if (!con)
{
- man = e_manager_current_get();
- if (!man) return NULL;
- con = e_container_current_get(man);
- if (!con) con = e_container_number_get(man, 0);
- if (!con) return NULL;
+ man = e_manager_current_get();
+ if (!man) return NULL;
+ con = e_container_current_get(man);
+ if (!con) con = e_container_number_get(man, 0);
+ if (!con) return NULL;
}
dia = E_OBJECT_ALLOC(E_Dialog, E_DIALOG_TYPE, _e_dialog_free);
if (!dia) return NULL;
dia->win = e_win_new(con);
if (!dia->win)
{
- free(dia);
- return NULL;
+ free(dia);
+ return NULL;
}
e_win_delete_callback_set(dia->win, _e_dialog_cb_delete);
e_win_resize_callback_set(dia->win, _e_dialog_cb_resize);
o = edje_object_add(e_win_evas_get(dia->win));
dia->bg_object = o;
e_theme_edje_object_set(o, "base/theme/dialog",
- "e/widgets/dialog/main");
+ "e/widgets/dialog/main");
evas_object_move(o, 0, 0);
evas_object_show(o);
mask = 0;
kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
if (!kg)
- fprintf(stderr,"ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
+ fprintf(stderr, "ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
mask = evas_key_modifier_mask_get(e_win_evas_get(dia->win), "Shift");
kg = evas_object_key_grab(o, "Tab", mask, ~mask, 0);
if (!kg)
- fprintf(stderr,"ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
+ fprintf(stderr, "ERROR: unable to redirect \"Tab\" key events to object %p.\n", o);
mask = 0;
kg = evas_object_key_grab(o, "Return", mask, ~mask, 0);
if (!kg)
- fprintf(stderr,"ERROR: unable to redirect \"Return\" key events to object %p.\n", o);
+ fprintf(stderr, "ERROR: unable to redirect \"Return\" key events to object %p.\n", o);
mask = 0;
kg = evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0);
if (!kg)
- fprintf(stderr,"ERROR: unable to redirect \"KP_Enter\" key events to object %p.\n", o);
+ fprintf(stderr, "ERROR: unable to redirect \"KP_Enter\" key events to object %p.\n", o);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_dialog_cb_key_down, dia);
}
EAPI void
-e_dialog_button_add(E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data)
+e_dialog_button_add(E_Dialog *dia, const char *label, const char *icon, void (*func)(void *data, E_Dialog *dia), void *data)
{
Evas_Object *o;
if (!func) func = _e_dialog_del_func_cb;
- o = e_widget_button_add(e_win_evas_get(dia->win), label, icon, (void (*) (void*, void*)) func, data, dia);
+ o = e_widget_button_add(e_win_evas_get(dia->win), label, icon, (void (*)(void *, void *))func, data, dia);
e_widget_list_object_append(dia->box_object, o, 1, 0, 0.5);
dia->buttons = eina_list_append(dia->buttons, o);
}
{
if (!dia->text_object)
{
- Evas_Object *o;
-
- o = edje_object_add(e_win_evas_get(dia->win));
- dia->text_object = o;
- e_theme_edje_object_set(o, "base/theme/dialog",
- "e/widgets/dialog/text");
- edje_object_part_swallow(dia->bg_object, "e.swallow.content", o);
- evas_object_show(o);
+ Evas_Object *o;
+
+ o = edje_object_add(e_win_evas_get(dia->win));
+ dia->text_object = o;
+ e_theme_edje_object_set(o, "base/theme/dialog",
+ "e/widgets/dialog/text");
+ edje_object_part_swallow(dia->bg_object, "e.swallow.content", o);
+ evas_object_show(o);
}
edje_object_part_text_set(dia->text_object, "e.textblock.message", text);
}
if (!border) return;
if (border->internal_icon)
{
- eina_stringshare_del(border->internal_icon);
- border->internal_icon = NULL;
+ eina_stringshare_del(border->internal_icon);
+ border->internal_icon = NULL;
}
if (icon)
border->internal_icon = eina_stringshare_add(icon);
dia->resizable = resizable;
if (dia->win)
{
- if (resizable)
- {
- e_win_size_max_set(dia->win, 99999, 99999);
+ if (resizable)
+ {
+ e_win_size_max_set(dia->win, 99999, 99999);
e_util_win_auto_resize_fill(dia->win);
- edje_object_signal_emit(dia->bg_object, "e,state,resizeble", "e");
- }
- else
- {
- e_win_resize(dia->win, dia->min_w, dia->min_h);
- e_win_size_max_set(dia->win, dia->min_w, dia->min_h);
- edje_object_signal_emit(dia->bg_object, "e,state,no_resizeble", "e");
- }
+ edje_object_signal_emit(dia->bg_object, "e,state,resizeble", "e");
+ }
+ else
+ {
+ e_win_resize(dia->win, dia->min_w, dia->min_h);
+ e_win_size_max_set(dia->win, dia->min_w, dia->min_h);
+ edje_object_signal_emit(dia->bg_object, "e,state,no_resizeble", "e");
+ }
}
}
o = dia->text_object;
if (o)
{
- edje_object_size_min_calc(o, &mw, &mh);
- edje_extern_object_min_size_set(o, mw, mh);
- edje_object_part_swallow(dia->bg_object, "e.swallow.content", o);
+ edje_object_size_min_calc(o, &mw, &mh);
+ edje_extern_object_min_size_set(o, mw, mh);
+ edje_object_part_swallow(dia->bg_object, "e.swallow.content", o);
}
o = dia->box_object;
dia = data;
if (!strcmp(ev->keyname, "Tab"))
{
- if (evas_key_modifier_is_set(evas_key_modifier_get(e_win_evas_get(dia->win)), "Shift"))
- {
- if (e_widget_focus_get(dia->box_object))
- {
- if (!e_widget_focus_jump(dia->box_object, 0))
- {
- if (dia->text_object)
- e_widget_focus_set(dia->box_object, 0);
- else
- {
- e_widget_focus_set(dia->content_object, 0);
- if (!e_widget_focus_get(dia->content_object))
- e_widget_focus_set(dia->box_object, 0);
- }
- }
- }
- else
- {
- if (!e_widget_focus_jump(dia->content_object, 0))
- e_widget_focus_set(dia->box_object, 0);
- }
- }
- else
- {
- if (e_widget_focus_get(dia->box_object))
- {
- if (!e_widget_focus_jump(dia->box_object, 1))
- {
- if (dia->text_object)
- e_widget_focus_set(dia->box_object, 1);
- else
- {
- e_widget_focus_set(dia->content_object, 1);
- if (!e_widget_focus_get(dia->content_object))
- e_widget_focus_set(dia->box_object, 1);
- }
- }
- }
- else
- {
- if (!e_widget_focus_jump(dia->content_object, 1))
- e_widget_focus_set(dia->box_object, 1);
- }
- }
+ if (evas_key_modifier_is_set(evas_key_modifier_get(e_win_evas_get(dia->win)), "Shift"))
+ {
+ if (e_widget_focus_get(dia->box_object))
+ {
+ if (!e_widget_focus_jump(dia->box_object, 0))
+ {
+ if (dia->text_object)
+ e_widget_focus_set(dia->box_object, 0);
+ else
+ {
+ e_widget_focus_set(dia->content_object, 0);
+ if (!e_widget_focus_get(dia->content_object))
+ e_widget_focus_set(dia->box_object, 0);
+ }
+ }
+ }
+ else
+ {
+ if (!e_widget_focus_jump(dia->content_object, 0))
+ e_widget_focus_set(dia->box_object, 0);
+ }
+ }
+ else
+ {
+ if (e_widget_focus_get(dia->box_object))
+ {
+ if (!e_widget_focus_jump(dia->box_object, 1))
+ {
+ if (dia->text_object)
+ e_widget_focus_set(dia->box_object, 1);
+ else
+ {
+ e_widget_focus_set(dia->content_object, 1);
+ if (!e_widget_focus_get(dia->content_object))
+ e_widget_focus_set(dia->box_object, 1);
+ }
+ }
+ }
+ else
+ {
+ if (!e_widget_focus_jump(dia->content_object, 1))
+ e_widget_focus_set(dia->box_object, 1);
+ }
+ }
}
else if (((!strcmp(ev->keyname, "Return")) ||
- (!strcmp(ev->keyname, "KP_Enter"))))
+ (!strcmp(ev->keyname, "KP_Enter"))))
{
- Evas_Object *o = NULL;
+ Evas_Object *o = NULL;
- if ((dia->content_object) && (e_widget_focus_get(dia->content_object)))
- o = e_widget_focused_object_get(dia->content_object);
- else
- o = e_widget_focused_object_get(dia->box_object);
- if (o) e_widget_activate(o);
+ if ((dia->content_object) && (e_widget_focus_get(dia->content_object)))
+ o = e_widget_focused_object_get(dia->content_object);
+ else
+ o = e_widget_focused_object_get(dia->box_object);
+ if (o) e_widget_activate(o);
}
}
else if (dia->content_object)
e_widget_focused_object_clear(dia->content_object);
}
+