From: Enlightenment S. <no-...@en...> - 2012-06-15 16:33:01
|
Log: elementary: add elm_progressbar_unit_format_function_set Author: yoz Date: 2012-06-15 09:32:54 -0700 (Fri, 15 Jun 2012) New Revision: 72197 Trac: http://trac.enlightenment.org/e/changeset/72197 Modified: trunk/elementary/ChangeLog trunk/elementary/src/lib/elm_progressbar.c trunk/elementary/src/lib/elm_progressbar.h Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-06-15 16:21:21 UTC (rev 72196) +++ trunk/elementary/ChangeLog 2012-06-15 16:32:54 UTC (rev 72197) @@ -192,3 +192,7 @@ 2012-06-14 Michael Bouchaud * Add an enum to Elm_Calendar_Mark_Repeat_Type: ELM_CALENDAR_LAST_DAY_OF_MONTH + +2012-06-15 Michael Bouchaud + * elm_progressbar: elm_progressbar_format_function_set to add a callback + function to format the unit string. Modified: trunk/elementary/src/lib/elm_progressbar.c =================================================================== --- trunk/elementary/src/lib/elm_progressbar.c 2012-06-15 16:21:21 UTC (rev 72196) +++ trunk/elementary/src/lib/elm_progressbar.c 2012-06-15 16:32:54 UTC (rev 72197) @@ -23,6 +23,9 @@ Eina_Bool inverted : 1; Eina_Bool pulse : 1; Eina_Bool pulse_state : 1; + + char *(*unit_format_func)(double val); + void (*unit_format_free)(char *str); }; #define ELM_PROGRESSBAR_DATA_GET(o, sd) \ @@ -74,8 +77,16 @@ { ELM_PROGRESSBAR_DATA_GET(obj, sd); - if (sd->units) + if (sd->unit_format_func) { + char *buf; + + buf = sd->unit_format_func(sd->val); + elm_layout_text_set(obj, "elm.text.status", buf); + if (sd->unit_format_free) sd->unit_format_free(buf); + } + else if (sd->units) + { char buf[1024]; snprintf(buf, sizeof(buf), sd->units, 100 * sd->val); @@ -429,6 +440,19 @@ } EAPI void +elm_progressbar_unit_format_function_set(Evas_Object *obj, char *(func)(double), void (*free_func) (char *)) +{ + ELM_PROGRESSBAR_CHECK(obj); + ELM_PROGRESSBAR_DATA_GET(obj, sd); + + sd->unit_format_func = func; + sd->unit_format_free = free_func; + + _units_set(obj); + elm_layout_sizing_eval(obj); +} + +EAPI void elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { Modified: trunk/elementary/src/lib/elm_progressbar.h =================================================================== --- trunk/elementary/src/lib/elm_progressbar.h 2012-06-15 16:21:21 UTC (rev 72196) +++ trunk/elementary/src/lib/elm_progressbar.h 2012-06-15 16:32:54 UTC (rev 72197) @@ -229,6 +229,23 @@ EAPI const char *elm_progressbar_unit_format_get(const Evas_Object *obj); /** + * Set the format function pointer for the units label + * + * @param obj The progress bar object + * @param func The unit format function + * @param free_func The freeing function for the format string. + * + * Set the callback function to format the unit string. + * + * @see elm_progressbar_unit_format_set() for more info on how this works. + * + * @since 1.1.0 + * + * @ingroup Progressbar + */ +EAPI void elm_progressbar_unit_format_function_set(Evas_Object *obj, char *(func)(double), void (*free_func) (char *)); + +/** * Set the orientation of a given progress bar widget * * @param obj The progress bar object |
From: Enlightenment S. <no-...@en...> - 2012-06-22 22:45:19
|
Log: elementary: Add to the progressbar widget a changed signal to be emitted when the value is changed. Patch from Daniel Willmann. Thx Author: yoz Date: 2012-06-22 15:45:13 -0700 (Fri, 22 Jun 2012) New Revision: 72709 Trac: http://trac.enlightenment.org/e/changeset/72709 Modified: trunk/elementary/ChangeLog trunk/elementary/NEWS trunk/elementary/src/lib/elm_progressbar.c trunk/elementary/src/lib/elm_progressbar.h Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-06-22 22:39:16 UTC (rev 72708) +++ trunk/elementary/ChangeLog 2012-06-22 22:45:13 UTC (rev 72709) @@ -127,10 +127,12 @@ _Elm_Win_Smart_Data to allow grouping based on engine. 2012-05-29 Rob Bradford + * Move X related cursor items into their own substruct of Elm_Cursor to make supporting cursors on other platforms cleaner. 2012-05-30 Rob Bradford + * Add support for setting the cursor under Wayland: * Introduce a configure option and #define to as per other engines * Add always-built API function to allow identification of running @@ -190,13 +192,21 @@ After the item is long-pressed, it can be moved. 2012-06-14 Michael Bouchaud + * Add an enum to Elm_Calendar_Mark_Repeat_Type: ELM_CALENDAR_LAST_DAY_OF_MONTH 2012-06-15 Michael Bouchaud + * elm_progressbar: elm_progressbar_format_function_set to add a callback function to format the unit string. 2012-06-16 Davide Andreoli + * elm_map: add elm_map_overlay_del_cb_set to be notify when an overlay is deleted. + +2012-06-23 Daniel Willmann + + * elm_progressbar: Add "changed" signal to be emitted when the value + is changed. Modified: trunk/elementary/NEWS =================================================================== --- trunk/elementary/NEWS 2012-06-22 22:39:16 UTC (rev 72708) +++ trunk/elementary/NEWS 2012-06-22 22:45:13 UTC (rev 72709) @@ -14,6 +14,7 @@ * Add ELM_CALENDAR_LAST_DAY_OF_MONTH enum type * Add elm_progressbar_format_function_set API function * Add elm_map_overlay_del_cb_set API function + * Add "changed" signal to the progressbar widgets Fixes: Modified: trunk/elementary/src/lib/elm_progressbar.c =================================================================== --- trunk/elementary/src/lib/elm_progressbar.c 2012-06-22 22:39:16 UTC (rev 72708) +++ trunk/elementary/src/lib/elm_progressbar.c 2012-06-22 22:45:13 UTC (rev 72709) @@ -4,6 +4,8 @@ static const char PROGRESSBAR_SMART_NAME[] = "elm_progressbar"; +static const char SIG_CHANGED[] = "changed"; + #define MIN_RATIO_LVL 0.0 #define MAX_RATIO_LVL 1.0 @@ -54,11 +56,18 @@ ((obj), PROGRESSBAR_SMART_NAME, __func__)) \ return +/* smart callbacks coming from elm progressbar objects (besides the + * ones coming from elm layout): */ +static const Evas_Smart_Cb_Description _smart_callbacks[] = { + {SIG_CHANGED, ""}, + {NULL, NULL} +}; + /* Inheriting from elm_layout. Besides, we need no more than what is * there */ EVAS_SMART_SUBCLASS_NEW (PROGRESSBAR_SMART_NAME, _elm_progressbar, Elm_Layout_Smart_Class, - Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL); + Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks); static const Elm_Layout_Part_Alias_Description _content_aliases[] = { @@ -364,6 +373,7 @@ _val_set(obj); _units_set(obj); + evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); } EAPI double Modified: trunk/elementary/src/lib/elm_progressbar.h =================================================================== --- trunk/elementary/src/lib/elm_progressbar.h 2012-06-22 22:39:16 UTC (rev 72708) +++ trunk/elementary/src/lib/elm_progressbar.h 2012-06-22 22:45:13 UTC (rev 72709) @@ -33,6 +33,10 @@ * This widget inherits from the @ref Layout one, so that all the * functions acting on it also work for progress bar objects. * + * This widget emits the following signals, besides the ones sent from + * @ref Layout: + * @li @c "changed" - when the value is changed + * * This widget has the following styles: * - @c "default" * - @c "wheel" (simple style, no text, no progression, only |
From: Enlightenment S. <no-...@en...> - 2012-09-19 14:34:15
|
Log: elementary: fix resizing on naviframe when an item is poped (typo) Author: yoz Date: 2012-09-19 07:34:03 -0700 (Wed, 19 Sep 2012) New Revision: 76870 Trac: http://trac.enlightenment.org/e/changeset/76870 Modified: trunk/elementary/ChangeLog trunk/elementary/src/lib/elc_naviframe.c Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-09-19 14:12:34 UTC (rev 76869) +++ trunk/elementary/ChangeLog 2012-09-19 14:34:03 UTC (rev 76870) @@ -521,3 +521,8 @@ 2012-09-19 Jaehwan Kim * Add reorder mode set/get API in Toolbar + +2012-09-19 Michael Bouchaud (yoz) + + * fix resizing on naviframe when an item is poped + Modified: trunk/elementary/src/lib/elc_naviframe.c =================================================================== --- trunk/elementary/src/lib/elc_naviframe.c 2012-09-19 14:12:34 UTC (rev 76869) +++ trunk/elementary/src/lib/elc_naviframe.c 2012-09-19 14:34:03 UTC (rev 76870) @@ -1333,7 +1333,7 @@ evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE); } - elm_widget_resize_object_set(obj, VIEW(it)); + elm_widget_resize_object_set(obj, VIEW(prev_it)); evas_object_raise(VIEW(prev_it)); //XXX: ACCESS |
From: Enlightenment S. <no-...@en...> - 2012-10-12 10:27:20
|
Log: elementary: add elm_map_name_search Author: yoz Date: 2012-10-12 03:27:08 -0700 (Fri, 12 Oct 2012) New Revision: 77935 Trac: http://trac.enlightenment.org/e/changeset/77935 Modified: trunk/elementary/ChangeLog trunk/elementary/NEWS trunk/elementary/src/lib/elm_map.c trunk/elementary/src/lib/elm_map.h trunk/elementary/src/lib/elm_widget_map.h Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-10-12 06:49:55 UTC (rev 77934) +++ trunk/elementary/ChangeLog 2012-10-12 10:27:08 UTC (rev 77935) @@ -593,3 +593,6 @@ * Add access features to multibuttonentry * Fix diskselector bug on round with appended items with more than 4 items. + +2012-10-12 Michael Bouchaud (yoz) + * Add elm_map_name_search Modified: trunk/elementary/NEWS =================================================================== --- trunk/elementary/NEWS 2012-10-12 06:49:55 UTC (rev 77934) +++ trunk/elementary/NEWS 2012-10-12 10:27:08 UTC (rev 77935) @@ -10,6 +10,7 @@ * Add the toolbar API which expand the transverse length. * Add a way to know which month is displayed in elm_calendar * Add color picker to elm_colorselector. + * Add a search API to list all localisations corresponding to a name in map Improvements: Modified: trunk/elementary/src/lib/elm_map.c =================================================================== --- trunk/elementary/src/lib/elm_map.c 2012-10-12 06:49:55 UTC (rev 77934) +++ trunk/elementary/src/lib/elm_map.c 2012-10-12 10:27:08 UTC (rev 77935) @@ -33,6 +33,7 @@ #define NOMINATIM_PLACE "place" #define NOMINATIM_ATTR_LON "lon" #define NOMINATIM_ATTR_LAT "lat" +#define NOMINATIM_ATTR_ADDRESS "display_name" #ifdef HAVE_ELEMENTARY_ECORE_CON @@ -2801,6 +2802,11 @@ dump->lon = _elm_atof(value); else if (!strncmp(key, NOMINATIM_ATTR_LAT, sizeof(NOMINATIM_ATTR_LAT))) dump->lat = _elm_atof(value); + else if (!strncmp(key, NOMINATIM_ATTR_ADDRESS, sizeof(NOMINATIM_ATTR_ADDRESS))) + { + if (!dump->address) + dump->address = strdup(value); + } return EINA_TRUE; } @@ -2913,6 +2919,32 @@ return EINA_TRUE; } +static Eina_Bool +_xml_name_dump_list_cb(void *data, + Eina_Simple_XML_Type type, + const char *value, + unsigned offset, + unsigned length) +{ + Elm_Map_Name_List *name_list = data; + Elm_Map_Name *name; + Name_Dump dump = {0, NULL, 0.0, 0.0}; + _xml_name_dump_cb(&dump, type, value, offset, length); + name = calloc(1, sizeof(Elm_Map_Name)); + if (!name) return EINA_FALSE; + if (dump.address) + { + name->address = strdup(dump.address); + name->lon = dump.lon; + name->lat = dump.lat; + name->wsd = name_list->wsd; + name_list->names = eina_list_append(name_list->names, name); + name->wsd->names = eina_list_append(name->wsd->names, name); + } + return EINA_TRUE; +} + + static void _kml_parse(Elm_Map_Route *r) { @@ -3053,6 +3085,39 @@ } static void +_name_list_parse(Elm_Map_Name_List *nl) +{ + FILE *f; + EINA_SAFETY_ON_NULL_RETURN(nl); + EINA_SAFETY_ON_NULL_RETURN(nl->fname); + + f = fopen(nl->fname, "rb"); + if (f) + { + long sz; + + fseek(f, 0, SEEK_END); + sz = ftell(f); + if (sz > 0) + { + char *buf; + + fseek(f, 0, SEEK_SET); + buf = malloc(sz); + if (buf) + { + if (fread(buf, 1, sz, f)) + { + eina_simple_xml_parse + (buf, sz, EINA_TRUE, _xml_name_dump_list_cb, nl); + } + } + } + fclose(f); + } +} + +static void _route_cb(void *data, const char *file, int status) @@ -3123,6 +3188,68 @@ "elm,state,busy,stop", "elm"); } +static void +_name_list_cb(void *data, + const char *file, + int status) +{ + Elm_Map_Name_List *name_list; + Elm_Map_Smart_Data *sd; + + EINA_SAFETY_ON_NULL_RETURN(data); + EINA_SAFETY_ON_NULL_RETURN(file); + + name_list = data; + sd = name_list->wsd; + + name_list->job = NULL; + if (status == 200) + { + _name_list_parse(name_list); + INF("Name List request success address"); + if (name_list->cb) + name_list->cb(name_list->data, ELM_WIDGET_DATA(sd)->obj, + name_list->names); + evas_object_smart_callback_call + (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOADED, NULL); + } + else + { + ERR("Name List request failed: %d", status); + if (name_list->cb) + name_list->cb(name_list->data, ELM_WIDGET_DATA(sd)->obj, NULL); + evas_object_smart_callback_call + (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOADED_FAIL, NULL); + } + edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj, + "elm,state,busy,stop", "elm"); + free(name_list->fname); + free(name_list); +} + + +static char * +_prepare_download() +{ + char fname[PATH_MAX]; + { + const char *cachedir; + +#ifdef ELM_EFREET + snprintf(fname, sizeof(fname), "%s" CACHE_NAME_ROOT, + efreet_cache_home_get()); + (void)cachedir; +#else + cachedir = getenv("XDG_CACHE_HOME"); + snprintf(fname, sizeof(fname), "%s/%s" CACHE_NAME_ROOT, getenv("HOME"), + cachedir ? : "/.config"); +#endif + if (!ecore_file_exists(fname)) ecore_file_mkpath(fname); + } + return strdup(fname); +} + + static Elm_Map_Name * _name_request(const Evas_Object *obj, int method, @@ -3134,31 +3261,18 @@ { char *url; Elm_Map_Name *name; - char fname[PATH_MAX], fname2[PATH_MAX]; + char *fname, fname2[PATH_MAX]; ELM_MAP_DATA_GET(obj, sd); EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_name, NULL); - { - const char *cachedir; - -#ifdef ELM_EFREET - snprintf(fname, sizeof(fname), "%s" CACHE_NAME_ROOT, - efreet_cache_home_get()); - (void)cachedir; -#else - cachedir = getenv("XDG_CACHE_HOME"); - snprintf(fname, sizeof(fname), "%s/%s" CACHE_NAME_ROOT, getenv("HOME"), - cachedir ? : "/.config"); -#endif - if (!ecore_file_exists(fname)) ecore_file_mkpath(fname); - } - + fname = _prepare_download(); url = sd->src_name->url_cb - (ELM_WIDGET_DATA(sd)->obj, method, address, lon, lat); + (ELM_WIDGET_DATA(sd)->obj, method, address, lon, lat); if (!url) { ERR("Name URL is NULL"); + free(fname); return NULL; } @@ -3183,10 +3297,12 @@ if (name->address) free(name->address); free(name->fname); free(name); + free(fname); return NULL; } INF("Name requested from %s to %s", url, name->fname); free(url); + free(fname); sd->names = eina_list_append(sd->names, name); evas_object_smart_callback_call @@ -3196,6 +3312,60 @@ return name; } + +static Eina_List * +_name_list_request(const Evas_Object *obj, + int method, + const char *address, + double lon, + double lat, + Elm_Map_Name_List_Cb name_cb, + void *data) +{ + char *url; + Elm_Map_Name_List *name_list; + char *fname, fname2[PATH_MAX]; + + ELM_MAP_DATA_GET(obj, sd); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_name, NULL); + + fname = _prepare_download(); + url = sd->src_name->url_cb + (ELM_WIDGET_DATA(sd)->obj, method, address, lon, lat); + if (!url) + { + ERR("Name URL is NULL"); + free(fname); + return NULL; + } + name_list = ELM_NEW(Elm_Map_Name_List); + name_list->wsd = sd; + snprintf(fname2, sizeof(fname2), "%s/%d", fname, rand()); + name_list->fname = strdup(fname2); + name_list->cb = name_cb; + name_list->data = data; + if (!ecore_file_download_full(url, name_list->fname, _name_list_cb, + NULL, name_list, + &(name_list->job), sd->ua) || !(name_list->job)) + { + ERR("Can't request Name from %s to %s", url, name_list->fname); + free(name_list->fname); + free(name_list); + free(fname); + return NULL; + } + INF("Name requested from %s to %s", url, name_list->fname); + free(url); + free(fname); + + evas_object_smart_callback_call + (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOAD, name_list->names); + edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj, + "elm,state,busy,start", "elm"); + return name_list->names; +} + + static Evas_Event_Flags _pinch_zoom_start_cb(void *data, void *event_info __UNUSED__) @@ -4747,6 +4917,25 @@ } EAPI void +elm_map_name_search(const Evas_Object *obj, + const char *address, + Elm_Map_Name_List_Cb name_cb, + void *data) +{ +#ifdef HAVE_ELEMENTARY_ECORE_CON + ELM_MAP_CHECK(obj); + if (address) + _name_list_request(obj, ELM_MAP_NAME_METHOD_SEARCH, address, 0, 0, + name_cb, data); +#else + (void) obj; + (void address); + (void) name_cb; + (void) data; +#endif +} + +EAPI void elm_map_name_del(Elm_Map_Name *name) { #ifdef HAVE_ELEMENTARY_ECORE_CON Modified: trunk/elementary/src/lib/elm_map.h =================================================================== --- trunk/elementary/src/lib/elm_map.h 2012-10-12 06:49:55 UTC (rev 77934) +++ trunk/elementary/src/lib/elm_map.h 2012-10-12 10:27:08 UTC (rev 77935) @@ -197,6 +197,7 @@ typedef void (*Elm_Map_Overlay_Get_Cb)(void *data, Evas_Object *map, Elm_Map_Overlay *overlay); /**< Get callback function for the overlay. */ typedef void (*Elm_Map_Overlay_Del_Cb)(void *data, Evas_Object *map, Elm_Map_Overlay *overlay); /**< Det callback function for the overlay. @since 1.7 */ typedef void (*Elm_Map_Name_Cb)(void *data, Evas_Object *map, Elm_Map_Name *name); /**< Async-callback function for the name request. */ +typedef void (*Elm_Map_Name_List_Cb)(void *data, Evas_Object *map, Eina_List *name_list); /**< Async-callback function for the name list request. */ typedef void (*Elm_Map_Route_Cb)(void *data, Evas_Object *map, Elm_Map_Route *route); /**< Async-callback function for the route request. */ /** @@ -1486,6 +1487,22 @@ EAPI Elm_Map_Name *elm_map_name_add(const Evas_Object *obj, const char *address, double lon, double lat, Elm_Map_Name_Cb name_cb, void *data); /** + * Request a list of addresses corresponding to a given name + * + * @param obj The map object. + * @param address The address. + * @param name_cb The callback function. + * @param data The user callback data. + * + * If you want to search address from a name. + * + * @since 1.8 + * + * @ingroup Map + */ +EAPI void elm_map_name_search(const Evas_Object *obj, const char *address, Elm_Map_Name_List_Cb name_cb, void *data); + +/** * Get the address of the name. * * @param name The name handle. Modified: trunk/elementary/src/lib/elm_widget_map.h =================================================================== --- trunk/elementary/src/lib/elm_widget_map.h 2012-10-12 06:49:55 UTC (rev 77934) +++ trunk/elementary/src/lib/elm_widget_map.h 2012-10-12 10:27:08 UTC (rev 77935) @@ -119,6 +119,7 @@ */ typedef struct _Elm_Map_Smart_Data Elm_Map_Smart_Data; +typedef struct _Elm_Map_Name_List Elm_Map_Name_List; typedef char *(*Elm_Map_Module_Source_Name_Func)(void); typedef int (*Elm_Map_Module_Tile_Zoom_Min_Func)(void); typedef int (*Elm_Map_Module_Tile_Zoom_Max_Func)(void); @@ -429,6 +430,19 @@ void *data; }; +struct _Elm_Map_Name_List +{ + Elm_Map_Smart_Data *wsd; + + Eina_List *names; + double lon, lat; + + char *fname; + Ecore_File_Download_Job *job; + Elm_Map_Name_List_Cb cb; + void *data; +}; + struct _Route_Dump { int id; |
From: Enlightenment S. <no-...@en...> - 2012-11-12 17:56:22
|
Log: elementary: add missing selected in elm_index, when we use elm_index_item_selected_set Author: yoz Date: 2012-11-12 09:56:13 -0800 (Mon, 12 Nov 2012) New Revision: 79186 Trac: http://trac.enlightenment.org/e/changeset/79186 Modified: trunk/elementary/ChangeLog trunk/elementary/NEWS trunk/elementary/src/lib/elm_index.c Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-11-12 16:16:16 UTC (rev 79185) +++ trunk/elementary/ChangeLog 2012-11-12 17:56:13 UTC (rev 79186) @@ -674,3 +674,7 @@ * Add elm_toolbar_item_show/bring_in. It show or bring a specific item, when the toolbar can be scrolled. + +2012-10-25 Michael Bouchaud (yoz) + + * Add missing selected event in elm_index (elm_index_item_selected_set) Modified: trunk/elementary/NEWS =================================================================== --- trunk/elementary/NEWS 2012-11-12 16:16:16 UTC (rev 79185) +++ trunk/elementary/NEWS 2012-11-12 17:56:13 UTC (rev 79186) @@ -53,6 +53,7 @@ * Fix glview crash even if the object is failed allocating. * Fix the elm_flip to accept proxy object. * Fix wrong parameter for thumbnail error in elm_icon. + * Fix missing selected event in elm_index (elm_index_item_selected_set) Removals: Modified: trunk/elementary/src/lib/elm_index.c =================================================================== --- trunk/elementary/src/lib/elm_index.c 2012-11-12 16:16:16 UTC (rev 79185) +++ trunk/elementary/src/lib/elm_index.c 2012-11-12 17:56:13 UTC (rev 79186) @@ -989,6 +989,7 @@ { evas_object_geometry_get(VIEW(it), &x, &y, &w, &h); _sel_eval(WIDGET(it), x + (w / 2), y + (h / 2)); + evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it); } else _sel_eval(WIDGET(it), -99999, -9999); } |
From: Enlightenment S. <no-...@en...> - 2012-11-14 15:46:27
|
Log: elmentary: add elm_genlist_nth_item_get Author: yoz Date: 2012-11-14 07:46:14 -0800 (Wed, 14 Nov 2012) New Revision: 79295 Trac: http://trac.enlightenment.org/e/changeset/79295 Modified: trunk/elementary/ChangeLog trunk/elementary/NEWS trunk/elementary/src/lib/elm_genlist.c trunk/elementary/src/lib/elm_genlist.h Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-11-14 13:47:37 UTC (rev 79294) +++ trunk/elementary/ChangeLog 2012-11-14 15:46:14 UTC (rev 79295) @@ -675,6 +675,10 @@ * Add elm_toolbar_item_show/bring_in. It show or bring a specific item, when the toolbar can be scrolled. -2012-10-25 Michael Bouchaud (yoz) +2012-11-12 Michael Bouchaud (yoz) * Add missing selected event in elm_index (elm_index_item_selected_set) + +2012-11-14 Michael Bouchaud (yoz) + + * Add elm_genlist_nth_item_get Modified: trunk/elementary/NEWS =================================================================== --- trunk/elementary/NEWS 2012-11-14 13:47:37 UTC (rev 79294) +++ trunk/elementary/NEWS 2012-11-14 15:46:14 UTC (rev 79295) @@ -14,6 +14,7 @@ * Add elm_notify_align_set/get * Add virtualkeypad, clipboard state change signals from conformant. * Add elm_toolbar_item_show/bring_in. + * Add elm_genlist_nth_item_get Improvements: Modified: trunk/elementary/src/lib/elm_genlist.c =================================================================== --- trunk/elementary/src/lib/elm_genlist.c 2012-11-14 13:47:37 UTC (rev 79294) +++ trunk/elementary/src/lib/elm_genlist.c 2012-11-14 15:46:14 UTC (rev 79295) @@ -6761,3 +6761,23 @@ return sd->tree_effect_enabled; } +EAPI Elm_Object_Item * +elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth) +{ + Elm_Gen_Item *it = NULL; + Eina_Accessor *a; + void *data; + + ELM_GENLIST_CHECK(obj) NULL; + ELM_GENLIST_DATA_GET(obj, sd); + + if (!sd->items) return NULL; + + a = eina_inlist_accessor_new(sd->items); + if (!a) return NULL; + if (eina_accessor_data_get(a, nth, &data)) + it = ELM_GEN_ITEM_FROM_INLIST(data); + eina_accessor_free(a); + return (Elm_Object_Item *)it; +} + Modified: trunk/elementary/src/lib/elm_genlist.h =================================================================== --- trunk/elementary/src/lib/elm_genlist.h 2012-11-14 13:47:37 UTC (rev 79294) +++ trunk/elementary/src/lib/elm_genlist.h 2012-11-14 15:46:14 UTC (rev 79295) @@ -1913,6 +1913,23 @@ EAPI Elm_Object_Select_Mode elm_genlist_item_select_mode_get(const Elm_Object_Item *it); + /** + * Get the nth item, in a given genlist widget, placed at position @p nth, in + * its internal items list + * + * @param obj The genlist object + * @param nth The number of the item to grab (0 being the first) + * + * @return The item stored in @p obj at position @p nth or @c NULL, if there's + * no item with that index (and on errors) + * + * @ingroup Genilst + * @since 1.8 + */ +EAPI Elm_Object_Item * +elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth); + +/** * @} */ |
From: Enlightenment S. <no-...@en...> - 2012-11-14 16:35:00
|
Log: elmentary: add elm_gengrid_nth_item_get Author: yoz Date: 2012-11-14 08:34:33 -0800 (Wed, 14 Nov 2012) New Revision: 79296 Trac: http://trac.enlightenment.org/e/changeset/79296 Modified: trunk/elementary/ChangeLog trunk/elementary/NEWS trunk/elementary/src/lib/elm_gengrid.c trunk/elementary/src/lib/elm_gengrid.h Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-11-14 15:46:14 UTC (rev 79295) +++ trunk/elementary/ChangeLog 2012-11-14 16:34:33 UTC (rev 79296) @@ -682,3 +682,4 @@ 2012-11-14 Michael Bouchaud (yoz) * Add elm_genlist_nth_item_get + * Add elm_gengrid_nth_item_get Modified: trunk/elementary/NEWS =================================================================== --- trunk/elementary/NEWS 2012-11-14 15:46:14 UTC (rev 79295) +++ trunk/elementary/NEWS 2012-11-14 16:34:33 UTC (rev 79296) @@ -15,6 +15,7 @@ * Add virtualkeypad, clipboard state change signals from conformant. * Add elm_toolbar_item_show/bring_in. * Add elm_genlist_nth_item_get + * Add elm_gengrid_nth_item_get Improvements: Modified: trunk/elementary/src/lib/elm_gengrid.c =================================================================== --- trunk/elementary/src/lib/elm_gengrid.c 2012-11-14 15:46:14 UTC (rev 79295) +++ trunk/elementary/src/lib/elm_gengrid.c 2012-11-14 16:34:33 UTC (rev 79296) @@ -3529,3 +3529,23 @@ if (!it) return ELM_OBJECT_SELECT_MODE_MAX; return it->select_mode; } + +EAPI Elm_Object_Item * +elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth) +{ + Elm_Gen_Item *it = NULL; + Eina_Accessor *a; + void *data; + + ELM_GENGRID_CHECK(obj) EINA_FALSE; + ELM_GENGRID_DATA_GET(obj, sd); + + if (!sd->items) return NULL; + + a = eina_inlist_accessor_new(sd->items); + if (!a) return NULL; + if (eina_accessor_data_get(a, nth, &data)) + it = ELM_GEN_ITEM_FROM_INLIST(data); + eina_accessor_free(a); + return (Elm_Object_Item *)it; +} Modified: trunk/elementary/src/lib/elm_gengrid.h =================================================================== --- trunk/elementary/src/lib/elm_gengrid.h 2012-11-14 15:46:14 UTC (rev 79295) +++ trunk/elementary/src/lib/elm_gengrid.h 2012-11-14 16:34:33 UTC (rev 79296) @@ -1659,6 +1659,22 @@ */ EAPI Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(const Elm_Object_Item *it); + /** + * Get the nth item, in a given gengrid widget, placed at position @p nth, in + * its internal items list + * + * @param obj The gengrid object + * @param nth The number of the item to grab (0 being the first) + * + * @return The item stored in @p obj at position @p nth or @c NULL, if there's + * no item with that index (and on errors) + * + * @ingroup Genilst + * @since 1.8 + */ +EAPI Elm_Object_Item *elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth); + +/** * @} */ |
From: Enlightenment S. <no-...@en...> - 2012-11-21 17:09:57
|
Log: elementary: update the min size hint on elm_label after a text set Author: yoz Date: 2012-11-21 09:09:44 -0800 (Wed, 21 Nov 2012) New Revision: 79517 Trac: http://trac.enlightenment.org/e/changeset/79517 Modified: trunk/elementary/ChangeLog trunk/elementary/NEWS trunk/elementary/src/lib/elm_label.c Modified: trunk/elementary/ChangeLog =================================================================== --- trunk/elementary/ChangeLog 2012-11-21 15:45:20 UTC (rev 79516) +++ trunk/elementary/ChangeLog 2012-11-21 17:09:44 UTC (rev 79517) @@ -688,3 +688,7 @@ * Support indicator service in elm_conformant. elm conformant can manage indicator(elm_plug). + +2012-11-14 Michael Bouchaud (yoz) + + * update the min size hint on elm_label after a text set Modified: trunk/elementary/NEWS =================================================================== --- trunk/elementary/NEWS 2012-11-21 15:45:20 UTC (rev 79516) +++ trunk/elementary/NEWS 2012-11-21 17:09:44 UTC (rev 79517) @@ -58,6 +58,7 @@ * Fix wrong parameter for thumbnail error in elm_icon. * Fix missing selected event in elm_index (elm_index_item_selected_set) * Fix the elm_image which is made up of a edje object can call a callback function + * Fix update the min size hint on elm_label after a text set Removals: Modified: trunk/elementary/src/lib/elm_label.c =================================================================== --- trunk/elementary/src/lib/elm_label.c 2012-11-21 15:45:20 UTC (rev 79516) +++ trunk/elementary/src/lib/elm_label.c 2012-11-21 17:09:44 UTC (rev 79517) @@ -293,7 +293,14 @@ if (!label) label = ""; _label_format_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->format); - return _elm_label_parent_sc->text_set(obj, item, label); + if (_elm_label_parent_sc->text_set(obj, item, label)) + { + sd->lastw = 0; + _elm_label_smart_sizing_eval(obj); + return EINA_TRUE; + } + + return EINA_FALSE; } static Eina_Bool |