Top | ![]() |
![]() |
![]() |
![]() |
gint datetime_compare_date (GDateTime *dt1
,GDateTime *dt2
);
Compares the dates of dt1
and dt2
. The times are
ignored.
icaltimetype *
datetime_to_icaltime (GDateTime *dt
);
Converts the GDateTime's dt
to an icaltimetype.
gboolean
datetime_is_date (GDateTime *dt
);
Checks if dt
represents a date. A pure date
has the values of hour, minutes and seconds set
to 0.
GDateTime *
icaltime_to_datetime (const icaltimetype *date
);
Converts the icaltimetype's date
to a GDateTime. The
timezone is preserved.
icaltimetype *
gcal_dup_icaltime (const icaltimetype *date
);
Creates an exact copy of date
.
cairo_surface_t * gcal_get_surface_from_color (GdkRGBA *color
,gint size
);
Creates a squared surface filled with color
. The
surface is always size
x size
.
cairo_surface_t * get_circle_surface_from_color (GdkRGBA *color
,gint size
);
Creates a circular surface filled with color
. The
surface is always size
x size
.
void get_color_name_from_source (ESource *source
,GdkRGBA *out_color
);
Utility function to retrieve the color from source
.
gchar * get_desc_from_component (ECalComponent *component
,const gchar *joint_char
);
Utility method to handle the extraction of the description from an ECalComponent. This cycle through the list of ECalComponentText and concatenate each string into one.
gchar * get_uuid_from_component (ESource *source
,ECalComponent *component
);
Obtains the uuid from a component in the form "source_uid:event_uid:event_rid" or "source:uid:event_uid" if the component doesn't hold a recurrence event
gint
get_first_weekday (void
);
Copied from Clocks, which by itself is copied from GtkCalendar.
ECalComponent * build_component_from_details (const gchar *summary
,GDateTime *initial_date
,GDateTime *final_date
);
Create a component with the provided details
gint icaltime_compare_date (const icaltimetype *date1
,const icaltimetype *date2
);
Compare date parts of icaltimetype objects. Returns negative value,
0 or positive value accordingly if date1
is before, same day of
after date2.
As a bonus it returns the amount of days passed between two days on the same year.
gint icaltime_compare_with_current (const icaltimetype *date1
,const icaltimetype *date2
,time_t *current_time_t
);
Compares date1
and date2
against the current time. Dates
closer to the current date are sorted before.
GDateTime *
get_start_of_week (icaltimetype *date
);
Retrieves the start of the week that date
falls in. This function already takes the
first weekday into account.
GDateTime *
get_end_of_week (icaltimetype *date
);
Retrieves the end of the week that date
falls in. This function already takes the
first weekday into account.
gboolean
is_clock_format_24h (void
);
Retrieves whether the current clock format is 12h or 24h based.
gsize e_strftime_fix_am_pm (gchar *str
,gsize max
,const gchar *fmt
,const struct tm *tm
);
Function to do a last minute fixup of the AM/PM stuff if the locale and gettext haven't done it right. Most English speaking countries except the USA use the 24 hour clock (UK, Australia etc). However since they are English nobody bothers to write a language translation (gettext) file. So the locale turns off the AM/PM, but gettext does not turn on the 24 hour clock. Leaving a mess.
This routine checks if AM/PM are defined in the locale, if not it forces the use of the 24 hour clock.
The function itself is a front end on strftime and takes exactly the same arguments.
TODO: Actually remove the 'p
' from the fixed up string so that
there isn't a stray space.
gsize e_utf8_strftime_fix_am_pm (gchar *str
,gsize max
,const gchar *fmt
,const struct tm *tm
);
Stolen from Evolution codebase. Selects the correct time format.
void
fix_popover_menu_icons (GtkPopover *popover
);
Hackish code that inspects the popover's children, retrieve the hidden GtkImage buried under lots of widgets, and make it visible again.
Hopefully, we'll find a better way to do this in the long run.
void get_source_parent_name_color (GcalManager *manager
,ESource *source
,gchar **name
,gchar **color
);
Retrieves the name and the color of the ESource that is
parent of source
.
gchar *
format_utc_offset (gint64 offset
);
Formats the UTC offset to a string that GTimeZone can parse. E.g. "-0300" or "+0530".
gint get_alarm_trigger_minutes (GcalEvent *event
,ECalComponentAlarm *alarm
);
Calculates the number of minutes before event
's
start time that the alarm should be triggered.
gboolean should_change_date_for_scroll (gdouble *scroll_value
,GdkEventScroll *scroll_event
);
Utility function to check if the date should change based on the scroll. The date is changed when the user scrolls too much on touchpad, or performs a rotation of the scroll button in a mouse.