update for beta release
[framework/uifw/e17.git] / src / modules / illume-indicator / e_mod_ind_win.c
1 #include "e.h"
2 #include "e_mod_main.h"
3 #include "e_mod_config.h"
4 #include "e_mod_ind_win.h"
5
6 /* local function prototypes */
7 static void _e_mod_ind_win_cb_free(Ind_Win *iwin);
8 static Eina_Bool _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event);
9 static Eina_Bool _e_mod_ind_win_cb_zone_resize(void *data, int type __UNUSED__, void *event);
10 static void _e_mod_ind_win_cb_resize(E_Win *win);
11 static void _e_mod_ind_win_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event);
12 static void _e_mod_ind_win_cb_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event);
13 static void _e_mod_ind_win_cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event);
14 static void _e_mod_ind_win_cb_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
15 static void _e_mod_ind_win_cb_size_request(void *data __UNUSED__, E_Gadcon *gc __UNUSED__, Evas_Coord w __UNUSED__, Evas_Coord h __UNUSED__);
16 static Evas_Object *_e_mod_ind_win_cb_frame_request(void *data __UNUSED__, E_Gadcon_Client *gcc __UNUSED__, const char *style __UNUSED__);
17 static void _e_mod_ind_win_cb_menu_items_append(void *data, E_Gadcon_Client *gcc __UNUSED__, E_Menu *mn);
18 static void _e_mod_ind_win_cb_menu_append(Ind_Win *iwin, E_Menu *mn);
19 static void _e_mod_ind_win_cb_menu_pre(void *data, E_Menu *mn);
20 static void _e_mod_ind_win_cb_menu_post(void *data, E_Menu *mn __UNUSED__);
21 static void _e_mod_ind_win_cb_menu_contents(void *data, E_Menu *mn __UNUSED__, E_Menu_Item *mi __UNUSED__);
22 static void _e_mod_ind_win_cb_menu_edit(void *data, E_Menu *mn __UNUSED__, E_Menu_Item *mi __UNUSED__);
23 static Eina_Bool _e_mod_ind_win_cb_border_hide(void *data, int type __UNUSED__, void *event);
24 static Eina_Bool _e_mod_ind_win_cb_border_show(void *data, int type __UNUSED__, void *event);
25
26 Ind_Win *
27 e_mod_ind_win_new(E_Zone *zone) 
28 {
29    Ind_Win *iwin;
30    Ecore_X_Window_State states[2];
31    Evas_Coord h = 0;
32
33    /* create our new indicator window object */
34    iwin = E_OBJECT_ALLOC(Ind_Win, IND_WIN_TYPE, _e_mod_ind_win_cb_free);
35    if (!iwin) return NULL;
36
37    h = (il_ind_cfg->height * e_scale);
38    iwin->zone = zone;
39
40    /* create new window */
41    iwin->win = e_win_new(zone->container);
42    iwin->win->data = iwin;
43
44    /* set some properties on the window */
45    e_win_title_set(iwin->win, _("Illume Indicator"));
46    e_win_name_class_set(iwin->win, "Illume-Indicator", "Illume-Indicator");
47    e_win_no_remember_set(iwin->win, EINA_TRUE);
48
49    /* hook into window resize so we can resize our objects */
50    e_win_resize_callback_set(iwin->win, _e_mod_ind_win_cb_resize);
51
52    /* set this window to not show in taskbar or pager */
53    states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
54    states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
55    ecore_x_netwm_window_state_set(iwin->win->evas_win, states, 2);
56
57    /* set this window to not accept or take focus */
58    ecore_x_icccm_hints_set(iwin->win->evas_win, 0, 0, 0, 0, 0, 0, 0);
59
60    /* create the popup */
61    iwin->popup = e_popup_new(zone, 0, 0, zone->w, h);
62    e_popup_name_set(iwin->popup, "indicator");
63    e_popup_layer_set(iwin->popup, 200);
64
65    /* create our event rectangle */
66    iwin->o_event = evas_object_rectangle_add(iwin->win->evas);
67    evas_object_color_set(iwin->o_event, 0, 0, 0, 0);
68    evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_DOWN, 
69                                   _e_mod_ind_win_cb_mouse_down, iwin);
70    evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_UP, 
71                                   _e_mod_ind_win_cb_mouse_up, iwin);
72    evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_MOVE, 
73                                   _e_mod_ind_win_cb_mouse_move, iwin);
74    evas_object_move(iwin->o_event, 0, 0);
75    evas_object_show(iwin->o_event);
76
77    /* create our base object */
78    iwin->o_base = edje_object_add(iwin->win->evas);
79    if (!e_theme_edje_object_set(iwin->o_base, 
80                                 "base/theme/modules/illume-indicator", 
81                                 "modules/illume-indicator/window")) 
82      {
83         char buff[PATH_MAX];
84
85         snprintf(buff, sizeof(buff), 
86                  "%s/e-module-illume-indicator.edj", _ind_mod_dir);
87         edje_object_file_set(iwin->o_base, buff, 
88                              "modules/illume-indicator/window");
89      }
90    evas_object_move(iwin->o_base, 0, 0);
91    evas_object_show(iwin->o_base);
92
93    e_popup_edje_bg_object_set(iwin->popup, iwin->o_base);
94
95    /* create our gadget container */
96    iwin->gadcon = e_gadcon_swallowed_new("illume-indicator", zone->id, 
97                                          iwin->o_base, "e.swallow.content");
98    edje_extern_object_min_size_set(iwin->gadcon->o_container, zone->w, h);
99    e_gadcon_min_size_request_callback_set(iwin->gadcon, 
100                                           _e_mod_ind_win_cb_min_size_request, 
101                                           iwin);
102    e_gadcon_size_request_callback_set(iwin->gadcon, 
103                                       _e_mod_ind_win_cb_size_request, iwin);
104    e_gadcon_frame_request_callback_set(iwin->gadcon, 
105                                        _e_mod_ind_win_cb_frame_request, iwin);
106    e_gadcon_orient(iwin->gadcon, E_GADCON_ORIENT_FLOAT);
107    e_gadcon_zone_set(iwin->gadcon, zone);
108    e_gadcon_ecore_evas_set(iwin->gadcon, iwin->win->ecore_evas);
109
110    e_gadcon_util_menu_attach_func_set(iwin->gadcon, 
111                                       _e_mod_ind_win_cb_menu_items_append, 
112                                       iwin);
113    e_gadcon_populate(iwin->gadcon);
114
115    /* hook into property change so we can adjust w/ e_scale */
116    iwin->hdls = 
117      eina_list_append(iwin->hdls, 
118                       ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, 
119                                               _e_mod_ind_win_cb_win_prop, iwin));
120
121    /* hook into zone resize so we can set minimum window width when zone 
122     * size changes */
123    iwin->hdls = 
124      eina_list_append(iwin->hdls, 
125                       ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE, 
126                                               _e_mod_ind_win_cb_zone_resize, 
127                                               iwin));
128
129    iwin->hdls = 
130      eina_list_append(iwin->hdls, 
131                       ecore_event_handler_add(E_EVENT_BORDER_HIDE, 
132                                               _e_mod_ind_win_cb_border_hide, 
133                                               iwin));
134
135    iwin->hdls = 
136      eina_list_append(iwin->hdls, 
137                       ecore_event_handler_add(E_EVENT_BORDER_SHOW, 
138                                               _e_mod_ind_win_cb_border_show, 
139                                               iwin));
140
141    /* set minimum size of this window & popup */
142    e_win_size_min_set(iwin->win, zone->w, h);
143    ecore_evas_size_min_set(iwin->popup->ecore_evas, zone->w, h);
144
145    /* position and resize this window */
146    e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, h);
147    e_popup_move_resize(iwin->popup, zone->x, zone->y, zone->w, h);
148
149    /* show the window */
150    e_win_show(iwin->win);
151    e_popup_show(iwin->popup);
152
153    /* set this window on proper zone */
154    e_border_zone_set(iwin->win->border, zone);
155    iwin->win->border->user_skip_winlist = 1;
156    iwin->win->border->lock_focus_in = 1;
157    iwin->win->border->lock_focus_out = 1;
158
159    /* set this window to be a dock window. This needs to be done after show 
160     * as E will sometimes reset the window type */
161    ecore_x_netwm_window_type_set(iwin->win->evas_win, ECORE_X_WINDOW_TYPE_DOCK);
162
163    /* tell conformant apps our position and size */
164    ecore_x_e_illume_indicator_geometry_set(zone->black_win, zone->x, zone->y, 
165                                            zone->w, h);
166
167    return iwin;
168 }
169
170 /* local function prototypes */
171 static void 
172 _e_mod_ind_win_cb_free(Ind_Win *iwin) 
173 {
174    Ecore_Event_Handler *hdl;
175
176    /* delete the handlers */
177    EINA_LIST_FREE(iwin->hdls, hdl)
178      ecore_event_handler_del(hdl);
179
180    /* delete the menu */
181    if (iwin->menu) 
182      {
183         e_menu_post_deactivate_callback_set(iwin->menu, NULL, NULL);
184         e_object_del(E_OBJECT(iwin->menu));
185      }
186    iwin->menu = NULL;
187
188    /* delete the gadget container */
189    if (iwin->gadcon) e_object_del(E_OBJECT(iwin->gadcon));
190    iwin->gadcon = NULL;
191
192    /* delete the objects */
193    if (iwin->o_base) evas_object_del(iwin->o_base);
194    iwin->o_base = NULL;
195    if (iwin->o_event) evas_object_del(iwin->o_event);
196    iwin->o_event = NULL;
197
198    /* tell conformant apps our position and size */
199    ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win, 0, 0, 0, 0);
200
201    if (iwin->popup) e_object_del(E_OBJECT(iwin->popup));
202    iwin->popup = NULL;
203
204    /* delete the window */
205    if (iwin->win) e_object_del(E_OBJECT(iwin->win));
206    iwin->win = NULL;
207
208    /* free the allocated object */
209    E_FREE(iwin);
210 }
211
212 static Eina_Bool
213 _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event) 
214 {
215    Ind_Win *iwin;
216    Ecore_X_Event_Window_Property *ev;
217    Evas_Coord h = 0;
218
219    ev = event;
220
221    if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
222    if (ev->win != iwin->win->container->manager->root) 
223      return ECORE_CALLBACK_PASS_ON;
224    if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return ECORE_CALLBACK_PASS_ON;
225
226    h = (il_ind_cfg->height * e_scale);
227
228    /* set minimum size of this window */
229    e_win_size_min_set(iwin->win, iwin->zone->w, h);
230    ecore_evas_size_min_set(iwin->popup->ecore_evas, iwin->zone->w, h);
231
232    /* NB: Not sure why, but we need to tell this border to fetch icccm 
233     * size position hints now :( (NOTE: This was not needed a few days ago) 
234     * If we do not do this, than indicator does not change w/ scale anymore */
235    iwin->win->border->client.icccm.fetch.size_pos_hints = 1;
236
237    /* resize this window */
238    e_win_resize(iwin->win, iwin->zone->w, h);
239    e_popup_resize(iwin->popup, iwin->zone->w, h);
240
241    /* tell conformant apps our position and size */
242    ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win, 
243                                            iwin->win->x, iwin->win->y, 
244                                            iwin->win->w, h);
245
246    return ECORE_CALLBACK_PASS_ON;
247 }
248
249 static Eina_Bool
250 _e_mod_ind_win_cb_zone_resize(void *data, int type __UNUSED__, void *event) 
251 {
252    Ind_Win *iwin;
253    E_Event_Zone_Move_Resize *ev;
254    Evas_Coord h = 0;
255
256    ev = event;
257    if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
258    if (ev->zone != iwin->zone) return ECORE_CALLBACK_PASS_ON;
259
260    h = (il_ind_cfg->height * e_scale);
261
262    /* set minimum size of this window to match zone size */
263    e_win_size_min_set(iwin->win, ev->zone->w, h);
264    ecore_evas_size_min_set(iwin->popup->ecore_evas, ev->zone->w, h);
265
266    return ECORE_CALLBACK_PASS_ON;
267 }
268
269 static void 
270 _e_mod_ind_win_cb_resize(E_Win *win) 
271 {
272    Ind_Win *iwin;
273
274    if (!(iwin = win->data)) return;
275    if (iwin->popup) e_popup_resize(iwin->popup, win->w, win->h);
276    if (iwin->o_event) evas_object_resize(iwin->o_event, win->w, win->h);
277    if (iwin->o_base) evas_object_resize(iwin->o_base, win->w, win->h);
278    if (iwin->gadcon->o_container)
279      edje_extern_object_min_size_set(iwin->gadcon->o_container, 
280                                      win->w, win->h);
281 }
282
283 static void 
284 _e_mod_ind_win_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event) 
285 {
286    Ind_Win *iwin;
287    Evas_Event_Mouse_Down *ev;
288
289    ev = event;
290    if (!(iwin = data)) return;
291    if (ev->button == 1) 
292      {
293         iwin->mouse_down = 1;
294
295         /* make sure we can drag */
296         if (iwin->win->border->client.illume.drag.locked) return;
297
298         iwin->drag.start = 1;
299         iwin->drag.dnd = 0;
300         iwin->drag.y = ev->output.y;
301         iwin->drag.by = iwin->win->border->y;
302      }
303    else if (ev->button == 3) 
304      {
305         int x, y;
306
307         /* create our popup menu */
308         iwin->menu = e_menu_new();
309         e_menu_post_deactivate_callback_set(iwin->menu, 
310                                             _e_mod_ind_win_cb_menu_post, iwin);
311
312         /* append items to our menu */
313         _e_mod_ind_win_cb_menu_append(iwin, iwin->menu);
314
315         /* show menu */
316         e_gadcon_canvas_zone_geometry_get(iwin->gadcon, &x, &y, NULL, NULL);
317         e_menu_activate_mouse(iwin->menu, iwin->zone, x + ev->output.x, 
318                               y + ev->output.y, 1, 1, 
319                               E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
320      }
321 }
322
323 static void 
324 _e_mod_ind_win_cb_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event) 
325 {
326    Ind_Win *iwin;
327    Evas_Event_Mouse_Up *ev;
328
329    ev = event;
330    if (!(iwin = data)) return;
331
332    if (ev->button != 1) return;
333
334    /* if we are not dragging, send message to toggle quickpanel state */
335    if ((!iwin->drag.dnd) && (iwin->mouse_down == 1)) 
336      {
337         Ecore_X_Window xwin;
338
339         xwin = iwin->win->border->zone->black_win;
340         ecore_x_e_illume_quickpanel_state_toggle(xwin);
341      }
342    else if (iwin->drag.dnd) 
343      {
344         E_Border *bd;
345
346         bd = iwin->win->border;
347
348         /* reset mouse pointer */
349         if (bd->pointer) 
350           e_pointer_type_pop(bd->pointer, bd, "move");
351
352         /* tell edj we are done moving */
353         edje_object_signal_emit(iwin->o_base, "e,action,move,stop", "e");
354
355         /* send message that we are done dragging */
356         ecore_x_e_illume_drag_end_send(bd->client.win);
357
358         /* update quickpanel position if needed */
359         if (bd->y != iwin->drag.by) 
360           ecore_x_e_illume_quickpanel_position_update_send(bd->client.win);
361
362         /* tell conformant apps our position and size */
363         ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win, 
364                                                 bd->x, bd->y, 
365                                                 bd->w, bd->h);
366      }
367    iwin->drag.start = 0;
368    iwin->drag.dnd = 0;
369    iwin->drag.y = 0;
370    iwin->drag.by = 0;
371    iwin->mouse_down = 0;
372 }
373
374 static void 
375 _e_mod_ind_win_cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event) 
376 {
377    Ind_Win *iwin;
378    Evas_Event_Mouse_Move *ev;
379    E_Border *bd;
380
381    ev = event;
382    if (!(iwin = data)) return;
383    bd = iwin->win->border;
384    if (iwin->drag.start) 
385      {
386         iwin->drag.dnd = 1;
387         iwin->drag.start = 0;
388
389         /* change mouse pointer to indicate we are dragging */
390         if (iwin->win->border->pointer) 
391           e_pointer_type_push(iwin->win->border->pointer, 
392                               iwin->win->border, "move");
393
394         /* tell edj we are going to start moving */
395         edje_object_signal_emit(iwin->o_base, "e,action,move,start", "e");
396
397         /* tell quickpanel to hide because we are going to drag */
398         ecore_x_e_illume_quickpanel_state_send(bd->zone->black_win, 
399                                               ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
400
401         /* send message that we are going to start dragging */
402         ecore_x_e_illume_drag_start_send(bd->client.win);
403      }
404
405    /* make sure we are dragging */
406    if (iwin->drag.dnd) 
407      {
408         int dy, py, ny;
409
410         /* get current mouse position */
411         py = ev->cur.output.y;
412
413         /* do moves in 'chunks' of screen size */
414         dy = ((bd->zone->h - bd->h) / 8);
415
416         /* are we moving up or down ? */
417         if (ev->cur.output.y > ev->prev.output.y) 
418           {
419              /* moving down */
420              if ((py - iwin->drag.y) < dy) return;
421           }
422         else if (ev->cur.output.y < ev->prev.output.y) 
423           {
424              /* moving up */
425              if ((iwin->drag.y - py) < dy) return;
426           }
427         else return;
428
429         if (py > iwin->drag.y) 
430           ny = bd->y + dy;
431         else if (py < iwin->drag.y) 
432           ny = bd->y - dy;
433         else return;
434
435         /* make sure we don't drag off the screen */
436         if (ny < iwin->zone->y) 
437           ny = iwin->zone->y;
438         else if ((ny + bd->h) > (iwin->zone->y + iwin->zone->h)) 
439           return;
440
441         /* move the border if we need to */
442         if (bd->y != ny) 
443           {
444              bd->y = ny;
445              bd->changes.pos = 1;
446              bd->changed = 1;
447              e_popup_move(iwin->popup, iwin->popup->x, ny);
448           }
449      }
450 }
451
452 static void 
453 _e_mod_ind_win_cb_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h) 
454 {
455    Ind_Win *iwin;
456
457    if (!(iwin = data)) return;
458    if (gc != iwin->gadcon) return;
459    if (h < iwin->win->h) h = iwin->win->h;
460    edje_extern_object_min_size_set(iwin->gadcon->o_container, w, h);
461 }
462
463 static void 
464 _e_mod_ind_win_cb_size_request(void *data __UNUSED__, E_Gadcon *gc __UNUSED__, Evas_Coord w __UNUSED__, Evas_Coord h __UNUSED__) 
465 {
466    return;
467 }
468
469 static Evas_Object *
470 _e_mod_ind_win_cb_frame_request(void *data __UNUSED__, E_Gadcon_Client *gcc __UNUSED__, const char *style __UNUSED__) 
471 {
472    return NULL;
473 }
474
475 static void 
476 _e_mod_ind_win_cb_menu_items_append(void *data, E_Gadcon_Client *gcc __UNUSED__, E_Menu *mn) 
477 {
478    Ind_Win *iwin;
479
480    if (!(iwin = data)) return;
481    _e_mod_ind_win_cb_menu_append(iwin, mn);
482 }
483
484 static void 
485 _e_mod_ind_win_cb_menu_append(Ind_Win *iwin, E_Menu *mn) 
486 {
487    E_Menu *subm;
488    E_Menu_Item *mi;
489    char buff[PATH_MAX];
490
491    snprintf(buff, sizeof(buff), 
492             "%s/e-module-illume-indicator.edj", _ind_mod_dir);
493
494    subm = e_menu_new();
495    mi = e_menu_item_new(mn);
496    e_menu_item_label_set(mi, _("Illume Indicator"));
497    e_menu_item_icon_edje_set(mi, buff, "icon");
498    e_menu_pre_activate_callback_set(subm, _e_mod_ind_win_cb_menu_pre, iwin);
499    e_menu_item_submenu_set(mi, subm);
500 }
501
502 static void 
503 _e_mod_ind_win_cb_menu_pre(void *data, E_Menu *mn) 
504 {
505    Ind_Win *iwin;
506    E_Menu_Item *mi;
507
508    if (!(iwin = data)) return;
509    e_menu_pre_activate_callback_set(mn, NULL, NULL);
510
511    mi = e_menu_item_new(mn);
512    e_menu_item_label_set(mi, _("Set Contents"));
513    e_util_menu_item_theme_icon_set(mi, "preferences-desktop-shelf");
514    e_menu_item_callback_set(mi, _e_mod_ind_win_cb_menu_contents, iwin);
515
516    mi = e_menu_item_new(mn);
517    if (iwin->gadcon->editing) 
518      e_menu_item_label_set(mi, _("End Move/Resize Items"));
519    else
520      e_menu_item_label_set(mi, _("Begin Move/Resize Items"));
521
522    e_util_menu_item_theme_icon_set(mi, "transform-scale");
523    e_menu_item_callback_set(mi, _e_mod_ind_win_cb_menu_edit, iwin);
524 }
525
526 static void 
527 _e_mod_ind_win_cb_menu_post(void *data, E_Menu *mn __UNUSED__) 
528 {
529    Ind_Win *iwin;
530
531    if (!(iwin = data)) return;
532    if (!iwin->menu) return;
533    e_object_del(E_OBJECT(iwin->menu));
534    iwin->menu = NULL;
535 }
536
537 static void 
538 _e_mod_ind_win_cb_menu_contents(void *data, E_Menu *mn __UNUSED__, E_Menu_Item *mi __UNUSED__) 
539 {
540    Ind_Win *iwin;
541
542    if (!(iwin = data)) return;
543    if (!iwin->gadcon->config_dialog) 
544      e_int_gadcon_config_shelf(iwin->gadcon);
545    else 
546      {
547         e_win_show(iwin->gadcon->config_dialog->dia->win);
548         e_win_raise(iwin->gadcon->config_dialog->dia->win);
549      }
550 }
551
552 static void 
553 _e_mod_ind_win_cb_menu_edit(void *data, E_Menu *mn __UNUSED__, E_Menu_Item *mi __UNUSED__) 
554 {
555    Ind_Win *iwin;
556
557    if (!(iwin = data)) return;
558    if (iwin->gadcon->editing) 
559      e_gadcon_edit_end(iwin->gadcon);
560    else
561      e_gadcon_edit_begin(iwin->gadcon);
562 }
563
564 static Eina_Bool 
565 _e_mod_ind_win_cb_border_hide(void *data, int type __UNUSED__, void *event) 
566 {
567    Ind_Win *iwin;
568    E_Event_Border_Hide *ev;
569
570    if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
571    ev = event;
572    if (ev->border != iwin->win->border) return ECORE_CALLBACK_PASS_ON;
573    e_popup_hide(iwin->popup);
574    return ECORE_CALLBACK_PASS_ON;
575 }
576
577 static Eina_Bool 
578 _e_mod_ind_win_cb_border_show(void *data, int type __UNUSED__, void *event) 
579 {
580    Ind_Win *iwin;
581    E_Event_Border_Show *ev;
582
583    if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
584    ev = event;
585    if (ev->border != iwin->win->border) return ECORE_CALLBACK_PASS_ON;
586    e_popup_show(iwin->popup);
587    return ECORE_CALLBACK_PASS_ON;
588 }