From: bdilly Date: Wed, 7 Mar 2012 01:02:21 +0000 (+0000) Subject: Elm_Calendar: fix function pointer as arg X-Git-Tag: REL_F_I9500_20120323_1~17^2~282 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b71c499d3094d557b52245dbd02fc1aa5589bcb;p=framework%2Fuifw%2Felementary.git Elm_Calendar: fix function pointer as arg Spotted by Michael Blumenkrantz git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68864 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c index ca02a52..bcdc5df 100644 --- a/src/lib/elm_calendar.c +++ b/src/lib/elm_calendar.c @@ -26,7 +26,7 @@ struct _Widget_Data int year_min, year_max, spin_speed; int today_it, selected_it, first_day_it; Ecore_Timer *spin, *update_timer; - char * (*format_func) (struct tm *selected_time); + Elm_Calendar_Format_Cb format_func; const char *weekdays[7]; struct tm current_time, selected_time; Day_Color day_color[42]; // EINA_DEPRECATED @@ -917,7 +917,7 @@ elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time) } EAPI void -elm_calendar_format_function_set(Evas_Object *obj, char * (*format_function) (struct tm *selected_time)) +elm_calendar_format_function_set(Evas_Object *obj, Elm_Calendar_Format_Cb format_function) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); diff --git a/src/lib/elm_calendar.h b/src/lib/elm_calendar.h index ee912b5..dc99a6b 100644 --- a/src/lib/elm_calendar.h +++ b/src/lib/elm_calendar.h @@ -57,6 +57,19 @@ typedef _Elm_Calendar_Mark_Repeat_Type Elm_Calendar_Mark_Repeat_Type; typedef struct _Elm_Calendar_Mark Elm_Calendar_Mark; /**< Item handle for a calendar mark. Created with elm_calendar_mark_add() and deleted with elm_calendar_mark_del(). */ /** + * @typedef Elm_Calendar_Format_Cb + * + * This callback type is used to format the string that will be used + * to display month and year. + * + * @param stime Struct representing time. + * @return String represeting time that will be set to calendar's text. + * + * @see elm_calendar_format_function_set() + */ +typedef char * (*Elm_Calendar_Format_Cb)(struct tm *stime); + +/** * Add a new calendar widget to the given parent Elementary * (container) object. * @@ -265,7 +278,7 @@ EAPI Eina_Bool elm_calendar_selected_time_get(const Evas_Object *obj, * * @ingroup Calendar */ -EAPI void elm_calendar_format_function_set(Evas_Object *obj, char *(*format_function)(struct tm *stime)); +EAPI void elm_calendar_format_function_set(Evas_Object *obj, Elm_Calendar_Format_Cb format_func); /** * Add a new mark to the calendar