Enlightenment CVS committal Author : handyande Project : misc Module : engage
Dir : misc/engage/src Modified Files: config.c engage.h icon.c main.c wm.c Log Message: Add misc fixes beginning of context items in menu icon grabbing is in effect but has gone badly wrong, needs work again add a few ignore options that have been asked for =================================================================== RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- config.c 11 Oct 2004 08:20:25 -0000 1.44 +++ config.c 13 Oct 2004 13:45:56 -0000 1.45 @@ -6,7 +6,7 @@ #ifdef HAVE_EWL #include <Ewl.h> -Ewl_Widget *menu, *menu_win; +Ewl_Widget *menu, *menu_win, *menu_app_name; Evas_Object *embed; int init; @@ -130,6 +130,13 @@ "appear-time", "Time taken (in seconds) for new icons to appear"); + ecore_config_boolean_create("engage.options.tray", 1, 'T', "tray", + "Enable system tray"); + ecore_config_boolean_create("engage.options.ignore_running", 0, 'i', + "ignore-running", "Ignore running apps"); + ecore_config_boolean_create("engage.options.ignore_iconified", 0, 'I', + "ignore-iconified", "Ignore iconified windows"); + ecore_config_load(); ret = ecore_config_args_parse(); @@ -167,6 +174,10 @@ options.icon_appear_duration = ecore_config_float_get("engage.options.icon_appear_duration"); + options.tray = ecore_config_boolean_get("engage.options.tray"); + options.ignore_run = ecore_config_boolean_get("engage.options.ignore_running"); + options.ignore_min = ecore_config_boolean_get("engage.options.ignore_iconified"); + return ret; } @@ -185,12 +196,10 @@ od_config_menu_out_cb(Ewl_Widget * w, void *ev_data, void *user_data) { int x, y; - evas_pointer_output_xy_get(evas, &x, &y); if (x <= menu_x + 1 || x >= (menu_x + menu_width) || y <= menu_y + 1 || y >= (menu_y + menu_height)) od_config_menu_hide(); - } void @@ -224,7 +233,7 @@ return; init = 1; /* FIXME: nasty nasty, we need to request the size, not code it in */ - menu_height = 87; + menu_height = 87; //121; menu_width = 100; menu_win = ewl_embed_new(); @@ -252,6 +261,18 @@ od_config_menu_out_cb, NULL); ewl_container_child_append(EWL_CONTAINER(menu_box), menu); /* *don't* show the menu, we only want the popup */ +/* + item = ewl_menu_item_new(NULL, "<name goes here>"); + ewl_container_child_append(EWL_CONTAINER(menu), item); + ewl_callback_append(item, EWL_CALLBACK_SELECT, od_config_menu_config_cb, NULL); + ewl_widget_show(item); + menu_app_name = item; + + item = ewl_menu_separator_new(); + ewl_container_child_append(EWL_CONTAINER(menu), item); + ewl_widget_show(item); +*/ + item = ewl_menu_item_new(NULL, "Icon Zooming"); ewl_container_child_append(EWL_CONTAINER(menu), item); @@ -285,11 +306,44 @@ od_config_menu_draw(Evas_Coord x, Evas_Coord y) { Evas_Coord menu_off_x, menu_off_y; + Evas_List *l; + Evas_Coord minx, maxx; + char *menu_text_launcher, *menu_text_not_launcher; menu_off_x = 5; menu_off_y = 5; od_config_menu_init(); + + minx = x - options.size / 2 ; + maxx = x + options.size / 2; + + menu_text_launcher = "don't keep \"%s\" in docker"; + menu_text_not_launcher = "keep \"%s\" in docker"; + l = dock.icons; + while (l) { + OD_Icon *icon; + icon = l->data; + if (icon->x >= minx && icon->x <= maxx) { + int len; + char *full; + if (icon->launcher) { + len = strlen(menu_text_launcher) + strlen(icon->winclass) - 1; + full = malloc(len); + snprintf(full, len, menu_text_launcher, icon->winclass); + } else { + len = strlen(menu_text_not_launcher) + strlen(icon->winclass) - 1; + full = malloc(len); + snprintf(full, len, menu_text_not_launcher, icon->winclass); + } + printf("context menu on %s\n", icon->name); +// ewl_menu_item_text_set(EWL_MENU_ITEM(menu_app_name), full); + free(full); + break; + } + l = l->next; + } + if (x - menu_off_x + menu_width > options.width) menu_x = options.width - menu_width; else if (x < menu_off_x) =================================================================== RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- engage.h 11 Oct 2004 10:05:08 -0000 1.24 +++ engage.h 13 Oct 2004 13:45:56 -0000 1.25 @@ -95,6 +95,7 @@ char *tt_fa; // font name int tt_fs; // font size double icon_appear_duration; + int tray, ignore_run, ignore_min; }; struct _OD_Window { =================================================================== RCS file: /cvsroot/enlightenment/misc/engage/src/icon.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -3 -r1.39 -r1.40 --- icon.c 11 Oct 2004 10:05:08 -0000 1.39 +++ icon.c 13 Oct 2004 13:45:56 -0000 1.40 @@ -91,9 +91,6 @@ Evas_Object *obj = NULL; assert(icon); - if (icon->pic && !strcmp(evas_object_type_get(icon->pic), "edje")) - return; - dsp = ecore_x_display_get(); scr = DefaultScreen(dsp); @@ -120,13 +117,12 @@ img = imlib_create_image_from_drawable(mask, x, y, w, h, 0); imlib_context_set_image(img); -#if 0 - /* This will only be necessary if we move to non image objects as pics */ if ((obj = edje_object_part_swallow_get(icon->icon, "EngageIcon"))) { - edje_object_part_unswallow(icon->icon, obj); - evas_object_del(obj); + edje_object_part_unswallow(icon->icon, icon->pic); + evas_object_del(icon->pic); + icon->pic = evas_object_image_add(evas); } -#endif + evas_object_image_size_set(icon->pic, w, h); evas_object_image_data_copy_set(icon->pic, imlib_image_get_data_for_reading_only()); @@ -251,10 +247,6 @@ } free(path); -#ifdef HAVE_IMLIB - if (options.grab_min_icons != 0) - od_icon_grab(in, in->data.minwin.window); -#endif if (in->data.applnk.count > 0) od_icon_arrow_show(in); } =================================================================== RCS file: /cvsroot/enlightenment/misc/engage/src/main.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- main.c 5 Oct 2004 21:51:26 -0000 1.11 +++ main.c 13 Oct 2004 13:45:56 -0000 1.12 @@ -49,10 +49,9 @@ od_window_init(); od_dock_init(); -#if 1 - // this is not getting added until we have a LOT more work done!!! - od_tray_init(); -#endif + + if (options.tray) + od_tray_init(); od_icon_add_path(options.icon_path); ecore_config_evas_font_path_apply(evas); =================================================================== RCS file: /cvsroot/enlightenment/misc/engage/src/wm.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- wm.c 6 Oct 2004 13:34:42 -0000 1.19 +++ wm.c 13 Oct 2004 13:45:56 -0000 1.20 @@ -293,7 +293,7 @@ snprintf(buf, 32, "%8x", *win); if ((owd = evas_hash_find(clients_hash, buf))) { dirty = evas_list_remove(dirty, owd); - if (!owd->minwin && od_wm_iconified(owd->id)) { + if (!owd->minwin && od_wm_iconified(owd->id) && !options.ignore_min) { owd->minwin = od_icon_new_minwin(owd->id, od_wm_get_title(owd->id), od_wm_get_winclass(owd->id)); od_dock_add_minwin(owd->minwin); @@ -370,12 +370,13 @@ } if (!owd->applnk) { owd->applnk = od_icon_new_applnk(od_icon_mapping_get(winclass), title, winclass); - od_dock_add_applnk(owd->applnk); + if (!options.ignore_run) + od_dock_add_applnk(owd->applnk); } owd->applnk->data.applnk.count++; if (owd->applnk->data.applnk.count == 1) od_icon_arrow_show(owd->applnk); - if (od_wm_iconified(owd->id)) { + if (od_wm_iconified(owd->id) && !options.ignore_min) { owd->minwin = od_icon_new_minwin(owd->id, title, winclass); od_dock_add_minwin(owd->minwin); } ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs