Elm_Calendar: fix function pointer as arg
authorbdilly <bdilly@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 7 Mar 2012 01:02:21 +0000 (01:02 +0000)
committerbdilly <bdilly@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 7 Mar 2012 01:02:21 +0000 (01:02 +0000)
Spotted by Michael Blumenkrantz

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68864 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_calendar.c
src/lib/elm_calendar.h

index ca02a52..bcdc5df 100644 (file)
@@ -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);
index ee912b5..dc99a6b 100644 (file)
@@ -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