forked from enlightenment/enlightenment
Add ability to set indicator height...requested by TAsn (Freerunner
project). SVN revision: 47709
This commit is contained in:
parent
f18fea93f8
commit
8bf1abea6f
|
@ -32,6 +32,8 @@ pkg_LTLIBRARIES = module.la
|
||||||
module_la_SOURCES = \
|
module_la_SOURCES = \
|
||||||
e_mod_ind_win.c \
|
e_mod_ind_win.c \
|
||||||
e_mod_ind_win.h \
|
e_mod_ind_win.h \
|
||||||
|
e_mod_config.c \
|
||||||
|
e_mod_config.h \
|
||||||
e_mod_main.c \
|
e_mod_main.c \
|
||||||
e_mod_main.h
|
e_mod_main.h
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
#include "e.h"
|
||||||
|
#include "e_mod_main.h"
|
||||||
|
#include "e_mod_config.h"
|
||||||
|
|
||||||
|
/* local variables */
|
||||||
|
EAPI Il_Ind_Config *il_ind_cfg = NULL;
|
||||||
|
static E_Config_DD *conf_edd = NULL;
|
||||||
|
|
||||||
|
int
|
||||||
|
il_ind_config_init(void)
|
||||||
|
{
|
||||||
|
conf_edd = E_CONFIG_DD_NEW("Illume-Indicator_Cfg", Il_Ind_Config);
|
||||||
|
#undef T
|
||||||
|
#undef D
|
||||||
|
#define T Il_Ind_Config
|
||||||
|
#define D conf_edd
|
||||||
|
E_CONFIG_VAL(D, T, version, INT);
|
||||||
|
E_CONFIG_VAL(D, T, height, INT);
|
||||||
|
|
||||||
|
il_ind_cfg = e_config_domain_load("module.illume-indicator", conf_edd);
|
||||||
|
if ((il_ind_cfg) &&
|
||||||
|
((il_ind_cfg->version >> 16) < IL_CONFIG_MAJ))
|
||||||
|
{
|
||||||
|
E_FREE(il_ind_cfg);
|
||||||
|
}
|
||||||
|
if (!il_ind_cfg)
|
||||||
|
{
|
||||||
|
il_ind_cfg = E_NEW(Il_Ind_Config, 1);
|
||||||
|
il_ind_cfg->version = 0;
|
||||||
|
il_ind_cfg->height = 32;
|
||||||
|
}
|
||||||
|
if (il_ind_cfg)
|
||||||
|
il_ind_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
il_ind_config_shutdown(void)
|
||||||
|
{
|
||||||
|
E_FREE(il_ind_cfg);
|
||||||
|
E_CONFIG_DD_FREE(conf_edd);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
il_ind_config_save(void)
|
||||||
|
{
|
||||||
|
return e_config_domain_save("module.illume-indicator", conf_edd, il_ind_cfg);
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
#ifndef E_MOD_CONFIG_H
|
||||||
|
#define E_MOD_CONFIG_H
|
||||||
|
|
||||||
|
#define IL_CONFIG_MIN 0
|
||||||
|
#define IL_CONFIG_MAJ 0
|
||||||
|
|
||||||
|
typedef struct _Il_Ind_Config Il_Ind_Config;
|
||||||
|
|
||||||
|
struct _Il_Ind_Config
|
||||||
|
{
|
||||||
|
int version, height;
|
||||||
|
};
|
||||||
|
|
||||||
|
int il_ind_config_init(void);
|
||||||
|
int il_ind_config_shutdown(void);
|
||||||
|
int il_ind_config_save(void);
|
||||||
|
|
||||||
|
extern EAPI Il_Ind_Config *il_ind_cfg;
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,5 +1,6 @@
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
#include "e_mod_main.h"
|
#include "e_mod_main.h"
|
||||||
|
#include "e_mod_config.h"
|
||||||
#include "e_mod_ind_win.h"
|
#include "e_mod_ind_win.h"
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
@ -85,7 +86,7 @@ e_mod_ind_win_new(E_Zone *zone)
|
||||||
iwin->o_base, "e.swallow.content");
|
iwin->o_base, "e.swallow.content");
|
||||||
// iwin->gadcon->instant_edit = 1;
|
// iwin->gadcon->instant_edit = 1;
|
||||||
edje_extern_object_min_size_set(iwin->gadcon->o_container, zone->w,
|
edje_extern_object_min_size_set(iwin->gadcon->o_container, zone->w,
|
||||||
(32 * e_scale));
|
(il_ind_cfg->height * e_scale));
|
||||||
edje_object_part_swallow(iwin->o_base, "e.swallow.container",
|
edje_object_part_swallow(iwin->o_base, "e.swallow.container",
|
||||||
iwin->gadcon->o_container);
|
iwin->gadcon->o_container);
|
||||||
e_gadcon_min_size_request_callback_set(iwin->gadcon,
|
e_gadcon_min_size_request_callback_set(iwin->gadcon,
|
||||||
|
@ -117,10 +118,11 @@ e_mod_ind_win_new(E_Zone *zone)
|
||||||
iwin));
|
iwin));
|
||||||
|
|
||||||
/* set minimum size of this window */
|
/* set minimum size of this window */
|
||||||
e_win_size_min_set(iwin->win, zone->w, (32 * e_scale));
|
e_win_size_min_set(iwin->win, zone->w, (il_ind_cfg->height * e_scale));
|
||||||
|
|
||||||
/* position and resize this window */
|
/* position and resize this window */
|
||||||
e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, (32 * e_scale));
|
e_win_move_resize(iwin->win, zone->x, zone->y, zone->w,
|
||||||
|
(il_ind_cfg->height * e_scale));
|
||||||
|
|
||||||
/* show the window */
|
/* show the window */
|
||||||
e_win_show(iwin->win);
|
e_win_show(iwin->win);
|
||||||
|
@ -134,7 +136,8 @@ e_mod_ind_win_new(E_Zone *zone)
|
||||||
|
|
||||||
/* tell conformant apps our position and size */
|
/* tell conformant apps our position and size */
|
||||||
ecore_x_e_illume_indicator_geometry_set(zone->black_win, zone->x, zone->y,
|
ecore_x_e_illume_indicator_geometry_set(zone->black_win, zone->x, zone->y,
|
||||||
zone->w, (32 * e_scale));
|
zone->w,
|
||||||
|
(il_ind_cfg->height * e_scale));
|
||||||
|
|
||||||
return iwin;
|
return iwin;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
#include "e_mod_main.h"
|
#include "e_mod_main.h"
|
||||||
|
#include "e_mod_config.h"
|
||||||
#include "e_mod_ind_win.h"
|
#include "e_mod_ind_win.h"
|
||||||
|
|
||||||
/* local variables */
|
/* local variables */
|
||||||
|
@ -22,6 +23,15 @@ e_modapi_init(E_Module *m)
|
||||||
/* set module directory variable */
|
/* set module directory variable */
|
||||||
_ind_mod_dir = eina_stringshare_add(m->dir);
|
_ind_mod_dir = eina_stringshare_add(m->dir);
|
||||||
|
|
||||||
|
/* init config subsystem */
|
||||||
|
if (!il_ind_config_init())
|
||||||
|
{
|
||||||
|
/* clear module directory variable */
|
||||||
|
if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
|
||||||
|
_ind_mod_dir = NULL;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* loop through the managers (root windows) */
|
/* loop through the managers (root windows) */
|
||||||
EINA_LIST_FOREACH(e_manager_list(), ml, man)
|
EINA_LIST_FOREACH(e_manager_list(), ml, man)
|
||||||
{
|
{
|
||||||
|
@ -58,6 +68,9 @@ e_modapi_shutdown(E_Module *m)
|
||||||
EINA_LIST_FREE(iwins, iwin)
|
EINA_LIST_FREE(iwins, iwin)
|
||||||
e_object_del(E_OBJECT(iwin));
|
e_object_del(E_OBJECT(iwin));
|
||||||
|
|
||||||
|
/* shutdown config */
|
||||||
|
il_ind_config_shutdown();
|
||||||
|
|
||||||
/* clear module directory variable */
|
/* clear module directory variable */
|
||||||
if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
|
if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
|
||||||
_ind_mod_dir = NULL;
|
_ind_mod_dir = NULL;
|
||||||
|
@ -68,5 +81,5 @@ e_modapi_shutdown(E_Module *m)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_save(E_Module *m)
|
e_modapi_save(E_Module *m)
|
||||||
{
|
{
|
||||||
return 1;
|
return il_ind_config_save();
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in New Issue