add icon provision for gadcon classes and label provider functions. also add
all the data, update and add new icons etc. etc. SVN revision: 22495
3
TODO
|
@ -71,8 +71,9 @@ Some of the things (in very short form) that need to be done to E17...
|
||||||
* gui config dialogs for all config
|
* gui config dialogs for all config
|
||||||
* make it possible to disable border buttons/actions (tell theme what is
|
* make it possible to disable border buttons/actions (tell theme what is
|
||||||
disabled)
|
disabled)
|
||||||
* maximize doesnt account for shelves
|
|
||||||
* shelf gui config is ugly and badly arranged
|
* shelf gui config is ugly and badly arranged
|
||||||
|
* shelf needs a way to register a menu item appender for right click menu for
|
||||||
|
gadcon items
|
||||||
* pager should be able to be configured to control more than the current zone
|
* pager should be able to be configured to control more than the current zone
|
||||||
(select which zone they control)
|
(select which zone they control)
|
||||||
* ibar maybe should move bar dirs to subdirectories in "bar" to limit scope
|
* ibar maybe should move bar dirs to subdirectories in "bar" to limit scope
|
||||||
|
|
|
@ -79,11 +79,15 @@ struct _E_Gadcon
|
||||||
struct _E_Gadcon_Client_Class
|
struct _E_Gadcon_Client_Class
|
||||||
{
|
{
|
||||||
int version;
|
int version;
|
||||||
|
/* All members below are part of version 1 */
|
||||||
char *name;
|
char *name;
|
||||||
struct {
|
struct {
|
||||||
E_Gadcon_Client *(*init) (E_Gadcon *gc, char *name, char *id, char *style);
|
E_Gadcon_Client *(*init) (E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
void (*shutdown) (E_Gadcon_Client *gcc);
|
void (*shutdown) (E_Gadcon_Client *gcc);
|
||||||
void (*orient) (E_Gadcon_Client *gcc);
|
void (*orient) (E_Gadcon_Client *gcc);
|
||||||
|
char *(*label) (void);
|
||||||
|
Evas_Object *(*icon) (Evas *evas);
|
||||||
|
/* All members below are part of version 2 */
|
||||||
} func;
|
} func;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -187,10 +187,16 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
for (l = e_gadcon_provider_list(); l; l = l->next)
|
for (l = e_gadcon_provider_list(); l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Gadcon_Client_Class *cc;
|
E_Gadcon_Client_Class *cc;
|
||||||
|
char *label;
|
||||||
|
Evas_Object *icon;
|
||||||
|
|
||||||
cc = l->data;
|
cc = l->data;
|
||||||
/* FIXME: need icon */
|
icon = NULL;
|
||||||
e_widget_ilist_append(oi, NULL, cc->name, _cb_select, cfdata, cc->name);
|
label = NULL;
|
||||||
|
if (cc->func.label) label = cc->func.label();
|
||||||
|
if (!label) label = cc->name;
|
||||||
|
if (cc->func.icon) icon = cc->func.icon(evas);
|
||||||
|
e_widget_ilist_append(oi, icon, label, _cb_select, cfdata, cc->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
e_widget_ilist_go(oi);
|
e_widget_ilist_go(oi);
|
||||||
|
|
|
@ -4,6 +4,7 @@ MODULE = battery
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
files_DATA = \
|
files_DATA = \
|
||||||
|
module.eap \
|
||||||
module_icon.png
|
module_icon.png
|
||||||
|
|
||||||
EXTRA_DIST = $(files_DATA)
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
@ -11,7 +12,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -29,13 +29,15 @@
|
||||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||||
static void _gc_orient(E_Gadcon_Client *gcc);
|
static void _gc_orient(E_Gadcon_Client *gcc);
|
||||||
|
static char *_gc_label(void);
|
||||||
|
static Evas_Object *_gc_icon(Evas *evas);
|
||||||
/* and actually define the gadcon class that this module provides (just 1) */
|
/* and actually define the gadcon class that this module provides (just 1) */
|
||||||
static const E_Gadcon_Client_Class _gadcon_class =
|
static const E_Gadcon_Client_Class _gadcon_class =
|
||||||
{
|
{
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"battery",
|
"battery",
|
||||||
{
|
{
|
||||||
_gc_init, _gc_shutdown, _gc_orient
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
@ -125,6 +127,25 @@ _gc_orient(E_Gadcon_Client *gcc)
|
||||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gc_label(void)
|
||||||
|
{
|
||||||
|
return _("Battery");
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_gc_icon(Evas *evas)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
o = edje_object_add(evas);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module.eap",
|
||||||
|
e_module_dir_get(battery_config->module));
|
||||||
|
edje_object_file_set(o, buf, "icon");
|
||||||
|
return o;
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
@ -1369,6 +1390,8 @@ e_modapi_init(E_Module *m)
|
||||||
battery_config->battery_prev_battery = -1;
|
battery_config->battery_prev_battery = -1;
|
||||||
battery_config->battery_check_timer = ecore_timer_add(battery_config->poll_time,
|
battery_config->battery_check_timer = ecore_timer_add(battery_config->poll_time,
|
||||||
_battery_cb_check, NULL);
|
_battery_cb_check, NULL);
|
||||||
|
battery_config->module = m;
|
||||||
|
|
||||||
e_gadcon_provider_register(&_gadcon_class);
|
e_gadcon_provider_register(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ struct _Config
|
||||||
double poll_time;
|
double poll_time;
|
||||||
int alarm;
|
int alarm;
|
||||||
/* just config state */
|
/* just config state */
|
||||||
|
E_Module *module;
|
||||||
E_Config_Dialog *config_dialog;
|
E_Config_Dialog *config_dialog;
|
||||||
Evas_List *instances;
|
Evas_List *instances;
|
||||||
E_Menu *menu;
|
E_Menu *menu;
|
||||||
|
|
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 1.4 KiB |
|
@ -4,6 +4,7 @@ MODULE = clock
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
files_DATA = \
|
files_DATA = \
|
||||||
|
module.eap \
|
||||||
module_icon.png
|
module_icon.png
|
||||||
|
|
||||||
EXTRA_DIST = $(files_DATA)
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
@ -11,7 +12,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -10,13 +10,15 @@
|
||||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||||
static void _gc_orient(E_Gadcon_Client *gcc);
|
static void _gc_orient(E_Gadcon_Client *gcc);
|
||||||
|
static char *_gc_label(void);
|
||||||
|
static Evas_Object *_gc_icon(Evas *evas);
|
||||||
/* and actually define the gadcon class that this module provides (just 1) */
|
/* and actually define the gadcon class that this module provides (just 1) */
|
||||||
static const E_Gadcon_Client_Class _gadcon_class =
|
static const E_Gadcon_Client_Class _gadcon_class =
|
||||||
{
|
{
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"clock",
|
"clock",
|
||||||
{
|
{
|
||||||
_gc_init, _gc_shutdown, _gc_orient
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
@ -34,6 +36,8 @@ struct _Instance
|
||||||
Evas_Object *o_clock;
|
Evas_Object *o_clock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static E_Module *clock_module = NULL;
|
||||||
|
|
||||||
static E_Gadcon_Client *
|
static E_Gadcon_Client *
|
||||||
_gc_init(E_Gadcon *gc, char *name, char *id, char *style)
|
_gc_init(E_Gadcon *gc, char *name, char *id, char *style)
|
||||||
{
|
{
|
||||||
|
@ -78,6 +82,25 @@ _gc_orient(E_Gadcon_Client *gcc)
|
||||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gc_label(void)
|
||||||
|
{
|
||||||
|
return _("Clock");
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_gc_icon(Evas *evas)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
o = edje_object_add(evas);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module.eap",
|
||||||
|
e_module_dir_get(clock_module));
|
||||||
|
edje_object_file_set(o, buf, "icon");
|
||||||
|
return o;
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
@ -97,37 +120,41 @@ EAPI E_Module_Api e_modapi =
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *module)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
|
clock_module = m;
|
||||||
|
|
||||||
e_gadcon_provider_register(&_gadcon_class);
|
e_gadcon_provider_register(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *module)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
|
clock_module = NULL;
|
||||||
|
|
||||||
e_gadcon_provider_unregister(&_gadcon_class);
|
e_gadcon_provider_unregister(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_save(E_Module *module)
|
e_modapi_save(E_Module *m)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_info(E_Module *module)
|
e_modapi_info(E_Module *m)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(module));
|
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
|
||||||
module->icon_file = strdup(buf);
|
m->icon_file = strdup(buf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_about(E_Module *module)
|
e_modapi_about(E_Module *m)
|
||||||
{
|
{
|
||||||
e_module_dialog_show(_("Enlightenment Clock Module"),
|
e_module_dialog_show(_("Enlightenment Clock Module"),
|
||||||
_("A simple module to give E17 a clock."));
|
_("A simple module to give E17 a clock."));
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
|
|
||||||
EAPI extern E_Module_Api e_modapi;
|
EAPI extern E_Module_Api e_modapi;
|
||||||
|
|
||||||
EAPI void *e_modapi_init (E_Module *module);
|
EAPI void *e_modapi_init (E_Module *m);
|
||||||
EAPI int e_modapi_shutdown (E_Module *module);
|
EAPI int e_modapi_shutdown (E_Module *m);
|
||||||
EAPI int e_modapi_save (E_Module *module);
|
EAPI int e_modapi_save (E_Module *m);
|
||||||
EAPI int e_modapi_info (E_Module *module);
|
EAPI int e_modapi_info (E_Module *m);
|
||||||
EAPI int e_modapi_about (E_Module *module);
|
EAPI int e_modapi_about (E_Module *m);
|
||||||
EAPI int e_modapi_config (E_Module *module);
|
EAPI int e_modapi_config (E_Module *m);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,6 +4,7 @@ MODULE = cpufreq
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
files_DATA = \
|
files_DATA = \
|
||||||
|
module.eap \
|
||||||
module_icon.png
|
module_icon.png
|
||||||
|
|
||||||
EXTRA_DIST = $(files_DATA)
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
@ -11,7 +12,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -15,13 +15,15 @@
|
||||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||||
static void _gc_orient(E_Gadcon_Client *gcc);
|
static void _gc_orient(E_Gadcon_Client *gcc);
|
||||||
|
static char *_gc_label(void);
|
||||||
|
static Evas_Object *_gc_icon(Evas *evas);
|
||||||
/* and actually define the gadcon class that this module provides (just 1) */
|
/* and actually define the gadcon class that this module provides (just 1) */
|
||||||
static const E_Gadcon_Client_Class _gadcon_class =
|
static const E_Gadcon_Client_Class _gadcon_class =
|
||||||
{
|
{
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"cpufreq",
|
"cpufreq",
|
||||||
{
|
{
|
||||||
_gc_init, _gc_shutdown, _gc_orient
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
@ -119,6 +121,25 @@ _gc_orient(E_Gadcon_Client *gcc)
|
||||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gc_label(void)
|
||||||
|
{
|
||||||
|
return _("Cpufreq");
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_gc_icon(Evas *evas)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
o = edje_object_add(evas);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module.eap",
|
||||||
|
e_module_dir_get(cpufreq_config->module));
|
||||||
|
edje_object_file_set(o, buf, "icon");
|
||||||
|
return o;
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
@ -815,7 +836,7 @@ EAPI E_Module_Api e_modapi =
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *module)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
@ -840,7 +861,7 @@ e_modapi_init(E_Module *module)
|
||||||
E_CONFIG_LIMIT(cpufreq_config->poll_time, 0.5, 60.0);
|
E_CONFIG_LIMIT(cpufreq_config->poll_time, 0.5, 60.0);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/%s/freqset",
|
snprintf(buf, sizeof(buf), "%s/%s/freqset",
|
||||||
e_module_dir_get(module), MODULE_ARCH);
|
e_module_dir_get(m), MODULE_ARCH);
|
||||||
cpufreq_config->set_exe_path = strdup(buf);
|
cpufreq_config->set_exe_path = strdup(buf);
|
||||||
cpufreq_config->frequency_check_timer = ecore_timer_add(cpufreq_config->poll_time,
|
cpufreq_config->frequency_check_timer = ecore_timer_add(cpufreq_config->poll_time,
|
||||||
_cpufreq_cb_check, NULL);
|
_cpufreq_cb_check, NULL);
|
||||||
|
@ -860,12 +881,14 @@ e_modapi_init(E_Module *module)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cpufreq_config->module = m;
|
||||||
|
|
||||||
e_gadcon_provider_register(&_gadcon_class);
|
e_gadcon_provider_register(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *module)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
e_gadcon_provider_unregister(&_gadcon_class);
|
e_gadcon_provider_unregister(&_gadcon_class);
|
||||||
|
|
||||||
|
@ -904,24 +927,24 @@ e_modapi_shutdown(E_Module *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_save(E_Module *module)
|
e_modapi_save(E_Module *m)
|
||||||
{
|
{
|
||||||
e_config_domain_save("module.cpufreq", conf_edd, cpufreq_config);
|
e_config_domain_save("module.cpufreq", conf_edd, cpufreq_config);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_info(E_Module *module)
|
e_modapi_info(E_Module *m)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(module));
|
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
|
||||||
module->icon_file = strdup(buf);
|
m->icon_file = strdup(buf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_about(E_Module *module)
|
e_modapi_about(E_Module *m)
|
||||||
{
|
{
|
||||||
e_module_dialog_show(_("CPU Frequency Controller Module"),
|
e_module_dialog_show(_("CPU Frequency Controller Module"),
|
||||||
_("A simple module to control the frequency of the system CPU.<br>"
|
_("A simple module to control the frequency of the system CPU.<br>"
|
||||||
|
|
|
@ -21,6 +21,7 @@ struct _Config
|
||||||
int restore_governor;
|
int restore_governor;
|
||||||
char *governor;
|
char *governor;
|
||||||
/* just config state */
|
/* just config state */
|
||||||
|
E_Module *module;
|
||||||
Evas_List *instances;
|
Evas_List *instances;
|
||||||
E_Menu *menu;
|
E_Menu *menu;
|
||||||
E_Menu *menu_poll;
|
E_Menu *menu_poll;
|
||||||
|
@ -33,11 +34,11 @@ struct _Config
|
||||||
|
|
||||||
EAPI extern E_Module_Api e_modapi;
|
EAPI extern E_Module_Api e_modapi;
|
||||||
|
|
||||||
EAPI void *e_modapi_init (E_Module *module);
|
EAPI void *e_modapi_init (E_Module *m);
|
||||||
EAPI int e_modapi_shutdown (E_Module *module);
|
EAPI int e_modapi_shutdown (E_Module *m);
|
||||||
EAPI int e_modapi_save (E_Module *module);
|
EAPI int e_modapi_save (E_Module *m);
|
||||||
EAPI int e_modapi_info (E_Module *module);
|
EAPI int e_modapi_info (E_Module *m);
|
||||||
EAPI int e_modapi_about (E_Module *module);
|
EAPI int e_modapi_about (E_Module *m);
|
||||||
EAPI int e_modapi_config (E_Module *module);
|
EAPI int e_modapi_config (E_Module *m);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 985 B |
|
@ -23,7 +23,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -278,76 +278,6 @@ _ds_shutdown(Dropshadow *ds)
|
||||||
free(ds);
|
free(ds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
static E_Menu *
|
|
||||||
_ds_config_menu_new(Dropshadow *ds)
|
|
||||||
{
|
|
||||||
E_Menu *mn;
|
|
||||||
E_Menu_Item *mi;
|
|
||||||
char buf[4096];
|
|
||||||
|
|
||||||
mn = e_menu_new();
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("High Quality"));
|
|
||||||
snprintf(buf, sizeof(buf), "%s/menu_icon_hi_quality.png", e_module_dir_get(ds->module));
|
|
||||||
e_menu_item_icon_file_set(mi, buf);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 4);
|
|
||||||
if (ds->conf->quality == 1) e_menu_item_toggle_set(mi, 1);
|
|
||||||
else e_menu_item_toggle_set(mi, 0);
|
|
||||||
e_menu_item_callback_set(mi, _ds_menu_high_quality, ds);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Medium Quality"));
|
|
||||||
snprintf(buf, sizeof(buf), "%s/menu_icon_med_quality.png", e_module_dir_get(ds->module));
|
|
||||||
e_menu_item_icon_file_set(mi, buf);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 4);
|
|
||||||
if (ds->conf->quality == 2) e_menu_item_toggle_set(mi, 1);
|
|
||||||
else e_menu_item_toggle_set(mi, 0);
|
|
||||||
e_menu_item_callback_set(mi, _ds_menu_medium_quality, ds);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Low Quality"));
|
|
||||||
snprintf(buf, sizeof(buf), "%s/menu_icon_lo_quality.png", e_module_dir_get(ds->module));
|
|
||||||
e_menu_item_icon_file_set(mi, buf);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 4);
|
|
||||||
if (ds->conf->quality == 4) e_menu_item_toggle_set(mi, 1);
|
|
||||||
else e_menu_item_toggle_set(mi, 0);
|
|
||||||
e_menu_item_callback_set(mi, _ds_menu_low_quality, ds);
|
|
||||||
return mn;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ds_menu_high_quality(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Dropshadow *ds;
|
|
||||||
|
|
||||||
ds = data;
|
|
||||||
_ds_config_quality_set(ds, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ds_menu_medium_quality(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Dropshadow *ds;
|
|
||||||
|
|
||||||
ds = data;
|
|
||||||
_ds_config_quality_set(ds, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_ds_menu_low_quality(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Dropshadow *ds;
|
|
||||||
|
|
||||||
ds = data;
|
|
||||||
_ds_config_quality_set(ds, 4);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ds_container_shapes_add(Dropshadow *ds, E_Container *con)
|
_ds_container_shapes_add(Dropshadow *ds, E_Container *con)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,7 @@ MODULE = ibar
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
files_DATA = \
|
files_DATA = \
|
||||||
|
module.eap \
|
||||||
module_icon.png
|
module_icon.png
|
||||||
|
|
||||||
EXTRA_DIST = $(files_DATA)
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
@ -11,10 +12,9 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
|
||||||
@e_cflags@
|
@e_cflags@
|
||||||
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
||||||
pkg_LTLIBRARIES = module.la
|
pkg_LTLIBRARIES = module.la
|
||||||
|
|
|
@ -10,13 +10,15 @@
|
||||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||||
static void _gc_orient(E_Gadcon_Client *gcc);
|
static void _gc_orient(E_Gadcon_Client *gcc);
|
||||||
|
static char *_gc_label(void);
|
||||||
|
static Evas_Object *_gc_icon(Evas *evas);
|
||||||
/* and actually define the gadcon class that this module provides (just 1) */
|
/* and actually define the gadcon class that this module provides (just 1) */
|
||||||
static const E_Gadcon_Client_Class _gadcon_class =
|
static const E_Gadcon_Client_Class _gadcon_class =
|
||||||
{
|
{
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"ibar",
|
"ibar",
|
||||||
{
|
{
|
||||||
_gc_init, _gc_shutdown, _gc_orient
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
@ -204,13 +206,31 @@ _gc_orient(E_Gadcon_Client *gcc)
|
||||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gc_label(void)
|
||||||
|
{
|
||||||
|
return _("IBar");
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_gc_icon(Evas *evas)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
o = edje_object_add(evas);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module.eap",
|
||||||
|
e_module_dir_get(ibar_config->module));
|
||||||
|
edje_object_file_set(o, buf, "icon");
|
||||||
|
return o;
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
// FIXME: ibar specific calls here
|
|
||||||
static IBar *
|
static IBar *
|
||||||
_ibar_new(Evas *evas, char *dir)
|
_ibar_new(Evas *evas, char *dir)
|
||||||
{
|
{
|
||||||
|
@ -296,13 +316,11 @@ _ibar_resize_handle(IBar *b)
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
|
|
||||||
evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
|
evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
|
||||||
printf("BOX %ix%i\n", w, h);
|
|
||||||
if (e_box_orientation_get(b->o_box))
|
if (e_box_orientation_get(b->o_box))
|
||||||
w = h;
|
w = h;
|
||||||
else
|
else
|
||||||
h = w;
|
h = w;
|
||||||
e_box_freeze(b->o_box);
|
e_box_freeze(b->o_box);
|
||||||
printf("RESIZNE %i %i\n", w, h);
|
|
||||||
for (l = b->icons; l; l = l->next)
|
for (l = b->icons; l; l = l->next)
|
||||||
{
|
{
|
||||||
ic = l->data;
|
ic = l->data;
|
||||||
|
@ -513,7 +531,6 @@ _ibar_cb_app_change(void *data, E_App *a, E_App_Change ch)
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case E_APP_ADD:
|
case E_APP_ADD:
|
||||||
printf("ADD! %3.4f\n", ecore_time_get());
|
|
||||||
if (e_app_is_parent(b->apps, a))
|
if (e_app_is_parent(b->apps, a))
|
||||||
{
|
{
|
||||||
E_App *a2, *a_before = NULL;
|
E_App *a2, *a_before = NULL;
|
||||||
|
@ -554,7 +571,6 @@ _ibar_cb_app_change(void *data, E_App *a, E_App_Change ch)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case E_APP_DEL:
|
case E_APP_DEL:
|
||||||
printf("DEL! %3.4f\n", ecore_time_get());
|
|
||||||
if (e_app_is_parent(b->apps, a))
|
if (e_app_is_parent(b->apps, a))
|
||||||
{
|
{
|
||||||
IBar_Icon *ic;
|
IBar_Icon *ic;
|
||||||
|
@ -570,7 +586,6 @@ _ibar_cb_app_change(void *data, E_App *a, E_App_Change ch)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case E_APP_CHANGE:
|
case E_APP_CHANGE:
|
||||||
printf("CHANGE! %3.4f\n", ecore_time_get());
|
|
||||||
if (e_app_is_parent(b->apps, a))
|
if (e_app_is_parent(b->apps, a))
|
||||||
{
|
{
|
||||||
IBar_Icon *ic;
|
IBar_Icon *ic;
|
||||||
|
@ -586,7 +601,6 @@ _ibar_cb_app_change(void *data, E_App *a, E_App_Change ch)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case E_APP_ORDER:
|
case E_APP_ORDER:
|
||||||
printf("ORDER! %3.4f\n", ecore_time_get());
|
|
||||||
if (a == b->apps)
|
if (a == b->apps)
|
||||||
{
|
{
|
||||||
_ibar_empty(b);
|
_ibar_empty(b);
|
||||||
|
@ -1114,7 +1128,7 @@ EAPI E_Module_Api e_modapi =
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *module)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
conf_item_edd = E_CONFIG_DD_NEW("IBar_Config_Item", Config_Item);
|
conf_item_edd = E_CONFIG_DD_NEW("IBar_Config_Item", Config_Item);
|
||||||
#undef T
|
#undef T
|
||||||
|
@ -1146,12 +1160,14 @@ e_modapi_init(E_Module *module)
|
||||||
ibar_config->items = evas_list_append(ibar_config->items, ci);
|
ibar_config->items = evas_list_append(ibar_config->items, ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ibar_config->module = m;
|
||||||
|
|
||||||
e_gadcon_provider_register(&_gadcon_class);
|
e_gadcon_provider_register(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *module)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
e_gadcon_provider_unregister(&_gadcon_class);
|
e_gadcon_provider_unregister(&_gadcon_class);
|
||||||
|
|
||||||
|
@ -1186,7 +1202,7 @@ e_modapi_shutdown(E_Module *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_save(E_Module *module)
|
e_modapi_save(E_Module *m)
|
||||||
{
|
{
|
||||||
Evas_List *l, *l2;
|
Evas_List *l, *l2;
|
||||||
|
|
||||||
|
@ -1208,17 +1224,17 @@ e_modapi_save(E_Module *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_info(E_Module *module)
|
e_modapi_info(E_Module *m)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(module));
|
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
|
||||||
module->icon_file = strdup(buf);
|
m->icon_file = strdup(buf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_about(E_Module *module)
|
e_modapi_about(E_Module *m)
|
||||||
{
|
{
|
||||||
e_module_dialog_show(_("Enlightenment IBar Module"),
|
e_module_dialog_show(_("Enlightenment IBar Module"),
|
||||||
_("This is the IBar Application Launcher bar module for Enlightenment.<br>"
|
_("This is the IBar Application Launcher bar module for Enlightenment.<br>"
|
||||||
|
|
|
@ -10,12 +10,13 @@ typedef struct _Config_Item Config_Item;
|
||||||
struct _Config
|
struct _Config
|
||||||
{
|
{
|
||||||
/* saved * loaded config values */
|
/* saved * loaded config values */
|
||||||
Evas_List *items;
|
Evas_List *items;
|
||||||
/* just config state */
|
/* just config state */
|
||||||
|
E_Module *module;
|
||||||
E_Config_Dialog *config_dialog;
|
E_Config_Dialog *config_dialog;
|
||||||
Evas_List *instances;
|
Evas_List *instances;
|
||||||
E_Menu *menu;
|
E_Menu *menu;
|
||||||
Evas_List *handlers;
|
Evas_List *handlers;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Config_Item
|
struct _Config_Item
|
||||||
|
|
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 581 B |
|
@ -11,7 +11,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -11,7 +11,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -4,6 +4,7 @@ MODULE = pager
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
files_DATA = \
|
files_DATA = \
|
||||||
|
module.eap \
|
||||||
module_icon.png
|
module_icon.png
|
||||||
|
|
||||||
EXTRA_DIST = $(files_DATA)
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
@ -11,7 +12,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -10,13 +10,15 @@
|
||||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||||
static void _gc_orient(E_Gadcon_Client *gcc);
|
static void _gc_orient(E_Gadcon_Client *gcc);
|
||||||
|
static char *_gc_label(void);
|
||||||
|
static Evas_Object *_gc_icon(Evas *evas);
|
||||||
/* and actually define the gadcon class that this module provides (just 1) */
|
/* and actually define the gadcon class that this module provides (just 1) */
|
||||||
static const E_Gadcon_Client_Class _gadcon_class =
|
static const E_Gadcon_Client_Class _gadcon_class =
|
||||||
{
|
{
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"pager",
|
"pager",
|
||||||
{
|
{
|
||||||
_gc_init, _gc_shutdown, _gc_orient
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
@ -215,6 +217,25 @@ _gc_orient(E_Gadcon_Client *gcc)
|
||||||
inst->pager->ynum * inst->pager->zone->h);
|
inst->pager->ynum * inst->pager->zone->h);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gc_label(void)
|
||||||
|
{
|
||||||
|
return _("Pager");
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_gc_icon(Evas *evas)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
o = edje_object_add(evas);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module.eap",
|
||||||
|
e_module_dir_get(pager_config->module));
|
||||||
|
edje_object_file_set(o, buf, "icon");
|
||||||
|
return o;
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
@ -1684,7 +1705,7 @@ EAPI E_Module_Api e_modapi =
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *module)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
conf_edd = E_CONFIG_DD_NEW("Pager_Config", Config);
|
conf_edd = E_CONFIG_DD_NEW("Pager_Config", Config);
|
||||||
#undef T
|
#undef T
|
||||||
|
@ -1760,12 +1781,14 @@ e_modapi_init(E_Module *module)
|
||||||
(pager_config->handlers, ecore_event_handler_add
|
(pager_config->handlers, ecore_event_handler_add
|
||||||
(E_EVENT_CONTAINER_RESIZE, _pager_cb_event_container_resize, NULL));
|
(E_EVENT_CONTAINER_RESIZE, _pager_cb_event_container_resize, NULL));
|
||||||
|
|
||||||
|
pager_config->module = m;
|
||||||
|
|
||||||
e_gadcon_provider_register(&_gadcon_class);
|
e_gadcon_provider_register(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *module)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
e_gadcon_provider_unregister(&_gadcon_class);
|
e_gadcon_provider_unregister(&_gadcon_class);
|
||||||
|
|
||||||
|
@ -1790,24 +1813,24 @@ e_modapi_shutdown(E_Module *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_save(E_Module *module)
|
e_modapi_save(E_Module *m)
|
||||||
{
|
{
|
||||||
e_config_domain_save("module.pager", conf_edd, pager_config);
|
e_config_domain_save("module.pager", conf_edd, pager_config);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_info(E_Module *module)
|
e_modapi_info(E_Module *m)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(module));
|
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
|
||||||
module->icon_file = strdup(buf);
|
m->icon_file = strdup(buf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_about(E_Module *module)
|
e_modapi_about(E_Module *m)
|
||||||
{
|
{
|
||||||
e_module_dialog_show(_("Enlightenment Pager Module"),
|
e_module_dialog_show(_("Enlightenment Pager Module"),
|
||||||
_("A pager module to navigate virtual desktops."));
|
_("A pager module to navigate virtual desktops."));
|
||||||
|
|
|
@ -28,6 +28,7 @@ struct _Config
|
||||||
unsigned char resize;
|
unsigned char resize;
|
||||||
Evas_List *items; /* FIXME: save/load this */
|
Evas_List *items; /* FIXME: save/load this */
|
||||||
/* just config state */
|
/* just config state */
|
||||||
|
E_Module *module;
|
||||||
E_Config_Dialog *config_dialog;
|
E_Config_Dialog *config_dialog;
|
||||||
Evas_List *instances;
|
Evas_List *instances;
|
||||||
E_Menu *menu;
|
E_Menu *menu;
|
||||||
|
@ -42,11 +43,11 @@ struct _Config_Item
|
||||||
|
|
||||||
EAPI extern E_Module_Api e_modapi;
|
EAPI extern E_Module_Api e_modapi;
|
||||||
|
|
||||||
EAPI void *e_modapi_init (E_Module *module);
|
EAPI void *e_modapi_init (E_Module *m);
|
||||||
EAPI int e_modapi_shutdown (E_Module *module);
|
EAPI int e_modapi_shutdown (E_Module *m);
|
||||||
EAPI int e_modapi_save (E_Module *module);
|
EAPI int e_modapi_save (E_Module *m);
|
||||||
EAPI int e_modapi_info (E_Module *module);
|
EAPI int e_modapi_info (E_Module *m);
|
||||||
EAPI int e_modapi_about (E_Module *module);
|
EAPI int e_modapi_about (E_Module *m);
|
||||||
|
|
||||||
void _pager_cb_config_updated(void);
|
void _pager_cb_config_updated(void);
|
||||||
void _config_pager_module(Config_Item *ci);
|
void _config_pager_module(Config_Item *ci);
|
||||||
|
|
|
@ -4,6 +4,7 @@ MODULE = start
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
files_DATA = \
|
files_DATA = \
|
||||||
|
module.eap \
|
||||||
module_icon.png
|
module_icon.png
|
||||||
|
|
||||||
EXTRA_DIST = $(files_DATA)
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
@ -11,7 +12,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -10,13 +10,15 @@
|
||||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||||
static void _gc_orient(E_Gadcon_Client *gcc);
|
static void _gc_orient(E_Gadcon_Client *gcc);
|
||||||
|
static char *_gc_label(void);
|
||||||
|
static Evas_Object *_gc_icon(Evas *evas);
|
||||||
/* and actually define the gadcon class that this module provides (just 1) */
|
/* and actually define the gadcon class that this module provides (just 1) */
|
||||||
static const E_Gadcon_Client_Class _gadcon_class =
|
static const E_Gadcon_Client_Class _gadcon_class =
|
||||||
{
|
{
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"start",
|
"start",
|
||||||
{
|
{
|
||||||
_gc_init, _gc_shutdown, _gc_orient
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
@ -38,6 +40,8 @@ struct _Instance
|
||||||
static void _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
static void _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
static void _menu_cb_post(void *data, E_Menu *m);
|
static void _menu_cb_post(void *data, E_Menu *m);
|
||||||
|
|
||||||
|
static E_Module *start_module = NULL;
|
||||||
|
|
||||||
static E_Gadcon_Client *
|
static E_Gadcon_Client *
|
||||||
_gc_init(E_Gadcon *gc, char *name, char *id, char *style)
|
_gc_init(E_Gadcon *gc, char *name, char *id, char *style)
|
||||||
{
|
{
|
||||||
|
@ -90,6 +94,25 @@ _gc_orient(E_Gadcon_Client *gcc)
|
||||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gc_label(void)
|
||||||
|
{
|
||||||
|
return _("Start");
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_gc_icon(Evas *evas)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
o = edje_object_add(evas);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module.eap",
|
||||||
|
e_module_dir_get(start_module));
|
||||||
|
edje_object_file_set(o, buf, "icon");
|
||||||
|
return o;
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
@ -205,6 +228,8 @@ EAPI E_Module_Api e_modapi =
|
||||||
EAPI void *
|
EAPI void *
|
||||||
e_modapi_init(E_Module *m)
|
e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
|
start_module = m;
|
||||||
|
|
||||||
e_gadcon_provider_register(&_gadcon_class);
|
e_gadcon_provider_register(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -212,6 +237,8 @@ e_modapi_init(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
|
start_module = NULL;
|
||||||
|
|
||||||
e_gadcon_provider_unregister(&_gadcon_class);
|
e_gadcon_provider_unregister(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,5 @@ EAPI int e_modapi_shutdown (E_Module *m);
|
||||||
EAPI int e_modapi_save (E_Module *m);
|
EAPI int e_modapi_save (E_Module *m);
|
||||||
EAPI int e_modapi_info (E_Module *m);
|
EAPI int e_modapi_info (E_Module *m);
|
||||||
EAPI int e_modapi_about (E_Module *m);
|
EAPI int e_modapi_about (E_Module *m);
|
||||||
EAPI int e_modapi_config (E_Module *m);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
@ -4,6 +4,7 @@ MODULE = temperature
|
||||||
# data files for the module
|
# data files for the module
|
||||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
files_DATA = \
|
files_DATA = \
|
||||||
|
module.eap \
|
||||||
module_icon.png
|
module_icon.png
|
||||||
|
|
||||||
EXTRA_DIST = $(files_DATA)
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
@ -11,7 +12,7 @@ EXTRA_DIST = $(files_DATA)
|
||||||
# the module .so file
|
# the module .so file
|
||||||
INCLUDES = -I. \
|
INCLUDES = -I. \
|
||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_srcdir)/$(MODULE) \
|
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||||
-I$(top_srcdir)/src/bin \
|
-I$(top_srcdir)/src/bin \
|
||||||
-I$(top_srcdir)/src/lib \
|
-I$(top_srcdir)/src/lib \
|
||||||
-I$(top_srcdir)/src/modules \
|
-I$(top_srcdir)/src/modules \
|
||||||
|
|
|
@ -15,13 +15,15 @@
|
||||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, char *name, char *id, char *style);
|
||||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||||
static void _gc_orient(E_Gadcon_Client *gcc);
|
static void _gc_orient(E_Gadcon_Client *gcc);
|
||||||
|
static char *_gc_label(void);
|
||||||
|
static Evas_Object *_gc_icon(Evas *evas);
|
||||||
/* and actually define the gadcon class that this module provides (just 1) */
|
/* and actually define the gadcon class that this module provides (just 1) */
|
||||||
static const E_Gadcon_Client_Class _gadcon_class =
|
static const E_Gadcon_Client_Class _gadcon_class =
|
||||||
{
|
{
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"temperature",
|
"temperature",
|
||||||
{
|
{
|
||||||
_gc_init, _gc_shutdown, _gc_orient
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
@ -96,6 +98,25 @@ _gc_orient(E_Gadcon_Client *gcc)
|
||||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gc_label(void)
|
||||||
|
{
|
||||||
|
return _("Temperature");
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_gc_icon(Evas *evas)
|
||||||
|
{
|
||||||
|
Evas_Object *o;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
o = edje_object_add(evas);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module.eap",
|
||||||
|
e_module_dir_get(temperature_config->module));
|
||||||
|
edje_object_file_set(o, buf, "icon");
|
||||||
|
return o;
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
@ -385,6 +406,9 @@ e_modapi_init(E_Module *m)
|
||||||
temperature_config->temperature_check_timer =
|
temperature_config->temperature_check_timer =
|
||||||
ecore_timer_add(temperature_config->poll_time, _temperature_cb_check,
|
ecore_timer_add(temperature_config->poll_time, _temperature_cb_check,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
temperature_config->module = m;
|
||||||
|
|
||||||
e_gadcon_provider_register(&_gadcon_class);
|
e_gadcon_provider_register(&_gadcon_class);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ struct _Config
|
||||||
char *sensor_name;
|
char *sensor_name;
|
||||||
Unit units;
|
Unit units;
|
||||||
/* just config state */
|
/* just config state */
|
||||||
|
E_Module *module;
|
||||||
E_Config_Dialog *config_dialog;
|
E_Config_Dialog *config_dialog;
|
||||||
Evas_List *instances;
|
Evas_List *instances;
|
||||||
E_Menu *menu;
|
E_Menu *menu;
|
||||||
|
|
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 706 B |