forked from enlightenment/enlightenment
* 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
This commit is contained in:
parent
22c6bc8776
commit
c877698d48
|
@ -11,7 +11,7 @@ images {
|
|||
}
|
||||
|
||||
group {
|
||||
name: "configure/main";
|
||||
name: "widgets/configure/main";
|
||||
parts {
|
||||
part {
|
||||
name: "base";
|
||||
|
@ -205,7 +205,7 @@ part {
|
|||
}
|
||||
|
||||
group {
|
||||
name: "configure/icon";
|
||||
name: "widgets/configure/icon";
|
||||
min: 24 24;
|
||||
max: 128 128;
|
||||
parts {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue