summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorcodewarrior <codewarrior>2005-09-20 13:12:25 +0000
committercodewarrior <codewarrior@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2005-09-20 13:12:25 +0000
commitc877698d48bb3275b2b0de33494758045f8375db (patch)
tree3318015dd9aba80bcfe2189639a9447c9da8c3b7 /src/bin
parent22c6bc877660185c6c11c187700566799d519602 (diff)
downloadenlightenment-c877698d48bb3275b2b0de33494758045f8375db.tar.gz
* data/themes/default_configure.edc
- Rename edc parts to widgets/configure/* * src/bin/e_configure.c: - turn E_Configure into a real object * src/bin/e_configure.h: - turn E_Configure into a real object, add missing #else SVN revision: 16800
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/e_configure.c97
-rw-r--r--src/bin/e_configure.h5
2 files changed, 64 insertions, 38 deletions
diff --git a/src/bin/e_configure.c b/src/bin/e_configure.c
index 4ed7227f6d..a0b78b43ac 100644
--- a/src/bin/e_configure.c
+++ b/src/bin/e_configure.c
@@ -1,56 +1,50 @@
#include "e.h"
-static void _e_configure_gui_show(E_Configure *app);
static void _e_configure_gui_hide(E_Win *win);
static void _e_configure_apps_load(E_Configure *app);
static void _e_configure_apps_unload(E_Configure *app);
-
+static void _e_configure_free(E_Configure *app);
static void _e_configure_apps_click(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_configure_cb_resize(E_Win *win);
+
E_Configure *
e_configure_show(E_Container *con)
{
E_Configure *app;
-
- app = calloc(1, sizeof(E_Configure));
+ E_Manager *man;
+ Evas_Coord w, h, ew, eh;
+
+ 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;
+ }
+ app = E_OBJECT_ALLOC(E_Configure, E_CONFIGURE_TYPE, _e_configure_free);
+ if (!app) return NULL;
+ app->win = e_win_new(con);
+ if (!app->win)
+ {
+ free(app);
+ return NULL;
+ }
+
app->con = con;
- _e_configure_gui_show(app);
- return app;
-}
-
-static void
-_e_configure_cb_resize(E_Win *win)
-{
- Evas_Coord w, h;
- E_Configure *app;
-
- if (win)
- {
- ecore_evas_geometry_get(win->ecore_evas, NULL, NULL, &w, &h);
-
- app = (E_Configure *) ecore_evas_data_get(win->ecore_evas, "App");
- evas_object_resize(app->edje, w, h);
- }
-}
-
-static void
-_e_configure_gui_show(E_Configure *app)
-{
- Evas_Coord w, h, ew, eh;
-
- app->win = e_win_new(app->con);
+
e_win_delete_callback_set(app->win, _e_configure_gui_hide);
-
e_win_title_set(app->win, "Enlightenment Configuration");
e_win_name_class_set(app->win, "EConfigure", "EConfigure");
app->evas = e_win_evas_get(app->win);
- ecore_evas_data_set(app->win->ecore_evas, "App", app);
-
- e_win_resize_callback_set(app->win, _e_configure_cb_resize);
-
+ ecore_evas_data_set(app->win->ecore_evas, "App", app);
+ e_win_resize_callback_set(app->win, _e_configure_cb_resize);
+ e_win_centered_set(app->win, 1);
+
app->edje = edje_object_add(app->evas);
- e_theme_edje_object_set(app->edje, "base/theme/configure", "configure/main");
+ e_theme_edje_object_set(app->edje, "base/theme/configure", "widgets/configure/main");
app->box = e_box_add(app->evas);
@@ -82,9 +76,29 @@ _e_configure_gui_show(E_Configure *app)
evas_object_show(app->edje);
- e_win_show(app->win);
+ e_win_show(app->win);
+
+
+ return app;
+}
+
+static void
+_e_configure_cb_resize(E_Win *win)
+{
+ Evas_Coord w, h;
+ E_Configure *app;
+
+ if (win)
+ {
+ ecore_evas_geometry_get(win->ecore_evas, NULL, NULL, &w, &h);
+
+ app = (E_Configure *) ecore_evas_data_get(win->ecore_evas, "App");
+ evas_object_resize(app->edje, w, h);
+ }
}
+
+
static void
_e_configure_gui_hide(E_Win *win)
{
@@ -119,7 +133,7 @@ _e_configure_apps_load(E_Configure *app)
app->app_ref = evas_list_append(app->app_ref, a);
o = edje_object_add(app->evas);
- e_theme_edje_object_set(o, "base/theme/configure", "configure/icon");
+ e_theme_edje_object_set(o, "base/theme/configure", "widgets/configure/icon");
icon = edje_object_add(app->evas);
edje_object_file_set(icon, a->path, "icon");
@@ -144,7 +158,6 @@ _e_configure_apps_load(E_Configure *app)
999, 999 //172, 72 /* max */
);
-// evas_object_resize(o, 172, 72);
evas_object_show(o);
app->icons = evas_list_append(app->icons, o);
edje_object_signal_callback_add(o, "clicked", "",
@@ -190,3 +203,11 @@ _e_configure_apps_click(void *data, Evas_Object *obj, const char *emission, cons
if (exe) ecore_exe_free(exe);
}
}
+
+static void
+_e_configure_free(E_Configure *app)
+{
+ _e_configure_apps_unload(app);
+ e_object_del(E_OBJECT(app->win));
+ free(app);
+}
diff --git a/src/bin/e_configure.h b/src/bin/e_configure.h
index 78ab991619..6903994d89 100644
--- a/src/bin/e_configure.h
+++ b/src/bin/e_configure.h
@@ -2,11 +2,16 @@
typedef struct _E_Configure E_Configure;
+#else
#ifndef E_CONFIGURE_H
#define E_CONFIGURE_H
+#define E_CONFIGURE_TYPE 0xE0b01014
+
struct _E_Configure
{
+ E_Object e_obj_inherit;
+
E_Container *con;
E_Win *win;
Evas *evas;