Enlightenment CVS committal Author : ravenlock Project : e_modules Module : forecasts
Dir : e_modules/forecasts Modified Files: e_mod_config.c e_mod_main.c e_mod_main.h Log Message: Update to yahoo new xml format and add option to allow popup on mouse click =================================================================== RCS file: /cvs/e/e_modules/forecasts/e_mod_config.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- e_mod_config.c 12 Nov 2007 08:14:24 -0000 1.8 +++ e_mod_config.c 21 Dec 2007 18:39:19 -0000 1.9 @@ -8,6 +8,7 @@ int degrees; char *code; int show_text; + int popup_on_hover; }; static void *_create_data(E_Config_Dialog * cfd); @@ -50,6 +51,7 @@ if (ci->code) cfdata->code = strdup(ci->code); cfdata->show_text = ci->show_text; + cfdata->popup_on_hover = ci->popup_on_hover; } static void * @@ -94,6 +96,8 @@ e_widget_framelist_object_append(of, ob); ob = e_widget_check_add(evas, D_("Show Description"), &(cfdata->show_text)); e_widget_framelist_object_append(of, ob); + ob = e_widget_check_add(evas, _("Popup on mouse over"), &(cfdata->popup_on_hover)); + e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.5); of = e_widget_framelist_add(evas, D_("Unit Settings"), 0); @@ -142,6 +146,7 @@ *t = toupper(*t); ci->code = evas_stringshare_add(t); ci->show_text = cfdata->show_text; + ci->popup_on_hover = cfdata->popup_on_hover; e_config_save_queue(); _forecasts_config_updated(ci); =================================================================== RCS file: /cvs/e/e_modules/forecasts/e_mod_main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- e_mod_main.c 12 Nov 2007 04:15:51 -0000 1.14 +++ e_mod_main.c 21 Dec 2007 18:39:19 -0000 1.15 @@ -362,7 +362,8 @@ ci->host = evas_stringshare_add("xml.weather.yahoo.com"); ci->code = evas_stringshare_add("BUXX0005"); ci->show_text = 1; - + ci->popup_on_hover = 1; + forecasts_config->items = evas_list_append(forecasts_config->items, ci); return ci; } @@ -393,6 +394,7 @@ E_CONFIG_VAL(D, T, host, STR); E_CONFIG_VAL(D, T, code, STR); E_CONFIG_VAL(D, T, show_text, INT); + E_CONFIG_VAL(D, T, popup_on_hover, INT); conf_edd = E_CONFIG_DD_NEW("Forecasts_Config", Config); #undef T @@ -415,6 +417,7 @@ ci->code = evas_stringshare_add("BUXX0005"); ci->id = evas_stringshare_add("0"); ci->show_text = 1; + ci->popup_on_hover = 1; forecasts_config->items = evas_list_append(forecasts_config->items, ci); } @@ -646,7 +649,7 @@ char city[256]; char region[256]; char location[512]; - int visibility; + float visibility; int i; inst = data; @@ -694,7 +697,7 @@ sscanf(needle, "\"%3[^\"]\"", inst->units.speed); /* Current conditions */ - needle = strstr(inst->buffer, "<yweather:condition text="); + needle = strstr(inst->buffer, "<yweather:condition text="); if (!needle) goto error; needle = strstr(needle, "\""); sscanf(needle, "\"%255[^\"]\"", inst->condition.desc); @@ -734,8 +737,8 @@ needle = strstr(needle, "visibility=\""); if (!needle) goto error; needle = strstr(needle, "\""); - sscanf(needle, "\"%d\"", &visibility); - inst->details.atmosphere.visibility = (float) visibility / 100; + sscanf(needle, "\"%f\"", &visibility); + inst->details.atmosphere.visibility = visibility; needle = strstr(needle, "pressure=\""); if (!needle) goto error; needle = strstr(needle, "\""); @@ -1068,13 +1071,19 @@ e_object_del(E_OBJECT(inst->popup)); } -static void +static void _cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { Instance *inst; Evas_Event_Mouse_Down *ev; - inst = data; + if (!(inst = data)) return; + if (!inst->ci->popup_on_hover) + { + e_gadcon_popup_show(inst->popup); + return; + } + ev = event_info; if (ev->button == 1) { @@ -1086,17 +1095,21 @@ _cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) { Instance *inst; - + if (!(inst = data)) return; + if (!inst->ci->popup_on_hover) return; + e_gadcon_popup_show(inst->popup); } -static void +static void _cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) { Instance *inst; - + if (!(inst = data)) return; + + if (inst->popup->pinned) return; e_gadcon_popup_hide(inst->popup); } =================================================================== RCS file: /cvs/e/e_modules/forecasts/e_mod_main.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_mod_main.h 1 Nov 2007 10:41:41 -0000 1.6 +++ e_mod_main.h 21 Dec 2007 18:39:19 -0000 1.7 @@ -27,6 +27,7 @@ int degrees; const char *host, *code; int show_text; + int popup_on_hover; }; EAPI extern E_Module_Api e_modapi; ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs