formatting
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 3 Jul 2012 13:01:36 +0000 (13:01 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 3 Jul 2012 13:01:36 +0000 (13:01 +0000)
SVN revision: 73237

src/bin/e_dialog.c

index 7f4c2bc..cd2e367 100644 (file)
@@ -23,19 +23,19 @@ _e_dialog_internal_new(E_Container *con, const char *name, const char *class, in
 
    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);
@@ -45,7 +45,7 @@ _e_dialog_internal_new(E_Container *con, const char *name, const char *class, in
    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);
 
@@ -59,19 +59,19 @@ _e_dialog_internal_new(E_Container *con, const char *name, const char *class, in
    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);
 
@@ -91,12 +91,12 @@ e_dialog_normal_win_new(E_Container *con, const char *name, const char *class)
 }
 
 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);
 }
@@ -143,14 +143,14 @@ e_dialog_text_set(E_Dialog *dia, const char *text)
 {
    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);
 }
@@ -177,8 +177,8 @@ e_dialog_border_icon_set(E_Dialog *dia, const char *icon)
    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);
@@ -200,18 +200,18 @@ e_dialog_resizable_set(E_Dialog *dia, int resizable)
    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");
+          }
      }
 }
 
@@ -224,9 +224,9 @@ e_dialog_show(E_Dialog *dia)
    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;
@@ -282,61 +282,61 @@ _e_dialog_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_
    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);
      }
 }
 
@@ -369,3 +369,4 @@ _e_dialog_cb_wid_on_focus(void *data, Evas_Object *obj)
    else if (dia->content_object)
      e_widget_focused_object_clear(dia->content_object);
 }
+