Remove old indicator & softkey modules. New ones coming.
SVN revision: 45636
This commit is contained in:
parent
c197d0c8a0
commit
ad84d78dff
|
@ -1,31 +0,0 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MODULE = illume-indicator
|
||||
|
||||
# data files for the module
|
||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||
files_DATA = \
|
||||
e-module-$(MODULE).edj module.desktop
|
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
||||
|
||||
# the module .so file
|
||||
INCLUDES = -I. \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||
-I$(top_srcdir)/src/bin \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/modules \
|
||||
@e_cflags@
|
||||
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
||||
pkg_LTLIBRARIES = module.la
|
||||
module_la_SOURCES = e_mod_main.c \
|
||||
e_mod_main.h \
|
||||
e_mod_win.c \
|
||||
e_mod_win.h
|
||||
|
||||
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
module_la_LDFLAGS = -module -avoid-version
|
||||
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
uninstall:
|
||||
rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
|
Binary file not shown.
|
@ -1,60 +0,0 @@
|
|||
#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(E_Module *m)
|
||||
{
|
||||
conf_edd = E_CONFIG_DD_NEW("Illume-Ind_Cfg", Il_Ind_Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Il_Ind_Config
|
||||
#define D conf_edd
|
||||
E_CONFIG_VAL(D, T, version, 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);
|
||||
il_ind_cfg = NULL;
|
||||
}
|
||||
if (!il_ind_cfg)
|
||||
{
|
||||
il_ind_cfg = E_NEW(Il_Ind_Config, 1);
|
||||
il_ind_cfg->version = 0;
|
||||
}
|
||||
if (il_ind_cfg)
|
||||
{
|
||||
/* Add new config variables here */
|
||||
/* if ((il_ind_cfg->version & 0xffff) < 1) */
|
||||
il_ind_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||
}
|
||||
|
||||
il_ind_cfg->mod_dir = eina_stringshare_add(m->dir);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_ind_config_shutdown(void)
|
||||
{
|
||||
if (il_ind_cfg->mod_dir) eina_stringshare_del(il_ind_cfg->mod_dir);
|
||||
il_ind_cfg->mod_dir = NULL;
|
||||
|
||||
E_FREE(il_ind_cfg);
|
||||
il_ind_cfg = NULL;
|
||||
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_ind_config_save(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#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;
|
||||
|
||||
// Placeholders
|
||||
const char *mod_dir;
|
||||
};
|
||||
|
||||
int il_ind_config_init(E_Module *m);
|
||||
int il_ind_config_shutdown(void);
|
||||
int il_ind_config_save(void);
|
||||
|
||||
extern EAPI Il_Ind_Config *il_ind_cfg;
|
||||
|
||||
#endif
|
|
@ -1,61 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_win.h"
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *iwins = NULL;
|
||||
const char *mod_dir = NULL;
|
||||
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume-Indicator" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
E_Zone *zone;
|
||||
Eina_List *l, *ll, *lll;
|
||||
|
||||
mod_dir = eina_stringshare_add(m->dir);
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
{
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
{
|
||||
EINA_LIST_FOREACH(con->zones, lll, zone)
|
||||
{
|
||||
Il_Ind_Win *iwin = NULL;
|
||||
|
||||
if (!(iwin = e_mod_win_new(zone))) continue;
|
||||
iwins = eina_list_append(iwins, iwin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
|
||||
EINA_LIST_FREE(iwins, iwin)
|
||||
{
|
||||
e_object_del(E_OBJECT(iwin));
|
||||
iwin = NULL;
|
||||
}
|
||||
|
||||
if (mod_dir) eina_stringshare_del(mod_dir);
|
||||
mod_dir = NULL;
|
||||
|
||||
ecore_x_e_illume_top_shelf_geometry_set(ecore_x_window_root_first_get(),
|
||||
0, 0, 0, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#ifndef E_MOD_MAIN_H
|
||||
# define E_MOD_MAIN_H
|
||||
|
||||
# define IL_IND_WIN_TYPE 0xE1b0886
|
||||
|
||||
typedef struct _Il_Ind_Win Il_Ind_Win;
|
||||
|
||||
struct _Il_Ind_Win
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
E_Win *win;
|
||||
E_Menu *menu;
|
||||
E_Gadcon *gadcon;
|
||||
Evas_Object *o_base, *o_event;
|
||||
struct
|
||||
{
|
||||
int y, start, dnd;
|
||||
} drag;
|
||||
int mouse_down;
|
||||
};
|
||||
|
||||
EAPI extern E_Module_Api e_modapi;
|
||||
|
||||
EAPI void *e_modapi_init(E_Module *m);
|
||||
EAPI int e_modapi_shutdown(E_Module *m);
|
||||
EAPI int e_modapi_save(E_Module *m);
|
||||
|
||||
extern const char *mod_dir;
|
||||
|
||||
#endif
|
|
@ -1,346 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_win.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_mod_win_cb_free(Il_Ind_Win *iwin);
|
||||
static void _e_mod_win_cb_resize(E_Win *win);
|
||||
static void _e_mod_win_cb_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||
static void _e_mod_win_cb_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||
static Evas_Object *_e_mod_win_cb_frame_request(void *data, E_Gadcon_Client *gcc, const char *style);
|
||||
static void _e_mod_win_cb_menu_items_append(void *data, E_Gadcon_Client *gcc, E_Menu *mn);
|
||||
static void _e_mod_win_cb_menu_append(Il_Ind_Win *iwin, E_Menu *mn);
|
||||
static void _e_mod_win_cb_menu_pre(void *data, E_Menu *mn);
|
||||
static void _e_mod_win_cb_menu_contents(void *data, E_Menu *mn, E_Menu_Item *mi);
|
||||
static void _e_mod_win_cb_menu_post(void *data, E_Menu *mn);
|
||||
static void _e_mod_win_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
static void _e_mod_win_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
static void _e_mod_win_cb_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
|
||||
Il_Ind_Win *
|
||||
e_mod_win_new(E_Zone *zone)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
Evas *evas;
|
||||
Ecore_X_Window_State states[2];
|
||||
Ecore_X_Illume_Mode mode;
|
||||
|
||||
iwin = E_OBJECT_ALLOC(Il_Ind_Win, IL_IND_WIN_TYPE, _e_mod_win_cb_free);
|
||||
if (!iwin) return NULL;
|
||||
|
||||
iwin->win = e_win_new(zone->container);
|
||||
iwin->win->data = iwin;
|
||||
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
||||
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
||||
e_win_title_set(iwin->win, _("Illume Indicator"));
|
||||
e_win_name_class_set(iwin->win, "Illume-Indicator", "Illume-Indicator");
|
||||
e_win_resize_callback_set(iwin->win, _e_mod_win_cb_resize);
|
||||
ecore_x_icccm_hints_set(iwin->win->evas_win, 0, 0, 0, 0, 0, 0, 0);
|
||||
ecore_x_netwm_window_state_set(iwin->win->evas_win, states, 2);
|
||||
ecore_x_netwm_window_type_set(iwin->win->evas_win, ECORE_X_WINDOW_TYPE_DOCK);
|
||||
|
||||
evas = e_win_evas_get(iwin->win);
|
||||
|
||||
iwin->o_event = evas_object_rectangle_add(evas);
|
||||
evas_object_color_set(iwin->o_event, 0, 0, 0, 0);
|
||||
evas_object_move(iwin->o_event, 0, 0);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_e_mod_win_cb_mouse_down, iwin);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_UP,
|
||||
_e_mod_win_cb_mouse_up, iwin);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_e_mod_win_cb_mouse_move, iwin);
|
||||
evas_object_show(iwin->o_event);
|
||||
|
||||
iwin->o_base = edje_object_add(evas);
|
||||
if (!e_theme_edje_object_set(iwin->o_base,
|
||||
"base/theme/modules/illume-indicator",
|
||||
"modules/illume-indicator/shelf"))
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-indicator.edj",
|
||||
mod_dir);
|
||||
edje_object_file_set(iwin->o_base, buff,
|
||||
"modules/illume-indicator/shelf");
|
||||
}
|
||||
evas_object_move(iwin->o_base, 0, 0);
|
||||
evas_object_show(iwin->o_base);
|
||||
|
||||
iwin->gadcon = e_gadcon_swallowed_new("illume-indicator", zone->id,
|
||||
iwin->o_base, "e.swallow.content");
|
||||
|
||||
edje_extern_object_min_size_set(iwin->gadcon->o_container, zone->w, 32);
|
||||
edje_object_part_swallow(iwin->o_base, "e.swallow.container",
|
||||
iwin->gadcon->o_container);
|
||||
e_gadcon_min_size_request_callback_set(iwin->gadcon,
|
||||
_e_mod_win_cb_min_size_request, iwin);
|
||||
e_gadcon_size_request_callback_set(iwin->gadcon,
|
||||
_e_mod_win_cb_size_request, iwin);
|
||||
e_gadcon_frame_request_callback_set(iwin->gadcon,
|
||||
_e_mod_win_cb_frame_request, iwin);
|
||||
e_gadcon_orient(iwin->gadcon, E_GADCON_ORIENT_FLOAT);
|
||||
e_gadcon_zone_set(iwin->gadcon, zone);
|
||||
e_gadcon_ecore_evas_set(iwin->gadcon, iwin->win->ecore_evas);
|
||||
e_gadcon_util_menu_attach_func_set(iwin->gadcon,
|
||||
_e_mod_win_cb_menu_items_append, iwin);
|
||||
e_gadcon_populate(iwin->gadcon);
|
||||
|
||||
e_win_size_min_set(iwin->win, zone->w, 32 * e_scale);
|
||||
e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, 32 * e_scale);
|
||||
e_win_show(iwin->win);
|
||||
e_border_zone_set(iwin->win->border, zone);
|
||||
|
||||
mode = ecore_x_e_illume_mode_get(zone->black_win);
|
||||
if (mode < ECORE_X_ILLUME_MODE_DUAL_TOP)
|
||||
iwin->win->border->client.illume.drag.locked = 1;
|
||||
else if (mode == ECORE_X_ILLUME_MODE_DUAL_TOP)
|
||||
iwin->win->border->client.illume.drag.locked = 0;
|
||||
else if (mode == ECORE_X_ILLUME_MODE_DUAL_LEFT)
|
||||
iwin->win->border->client.illume.drag.locked = 1;
|
||||
|
||||
ecore_x_e_illume_top_shelf_geometry_set(ecore_x_window_root_first_get(),
|
||||
zone->x, zone->y, zone->w, 32 * e_scale);
|
||||
|
||||
return iwin;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_mod_win_cb_free(Il_Ind_Win *iwin)
|
||||
{
|
||||
if (iwin->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(iwin->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(iwin->menu));
|
||||
iwin->menu = NULL;
|
||||
}
|
||||
|
||||
if (iwin->o_base) evas_object_del(iwin->o_base);
|
||||
if (iwin->o_event) evas_object_del(iwin->o_event);
|
||||
|
||||
e_object_del(E_OBJECT(iwin->gadcon));
|
||||
iwin->gadcon = NULL;
|
||||
|
||||
e_object_del(E_OBJECT(iwin->win));
|
||||
iwin->win = NULL;
|
||||
|
||||
E_FREE(iwin);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_resize(E_Win *win)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = win->data)) return;
|
||||
evas_object_resize(iwin->o_event, win->w, win->h);
|
||||
evas_object_resize(iwin->o_base, win->w, win->h);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (gc != iwin->gadcon) return;
|
||||
if (h < (32 * e_scale)) h = (32 * e_scale);
|
||||
edje_extern_object_min_size_set(iwin->gadcon->o_container, w, h);
|
||||
edje_object_part_swallow(iwin->o_base, "e.swallow.content",
|
||||
iwin->gadcon->o_container);
|
||||
evas_object_resize(iwin->o_base, iwin->win->w, iwin->win->h);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_e_mod_win_cb_frame_request(void *data, E_Gadcon_Client *gcc, const char *style)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_menu_items_append(void *data, E_Gadcon_Client *gcc, E_Menu *mn)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
_e_mod_win_cb_menu_append(iwin, mn);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_menu_append(Il_Ind_Win *iwin, E_Menu *mn)
|
||||
{
|
||||
E_Menu *sm;
|
||||
E_Menu_Item *mi;
|
||||
|
||||
sm = e_menu_new();
|
||||
mi = e_menu_item_new(mn);
|
||||
e_menu_item_label_set(mi, _("Illume Indicator"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-desktop-shelf");
|
||||
e_menu_pre_activate_callback_set(sm, _e_mod_win_cb_menu_pre, iwin);
|
||||
e_object_data_set(E_OBJECT(mi), iwin);
|
||||
e_menu_item_submenu_set(mi, sm);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_menu_pre(void *data, E_Menu *mn)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
E_Menu_Item *mi;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
e_menu_pre_activate_callback_set(mn, NULL, NULL);
|
||||
|
||||
mi = e_menu_item_new(mn);
|
||||
e_menu_item_label_set(mi, _("Set Contents"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-desktop-shelf");
|
||||
e_menu_item_callback_set(mi, _e_mod_win_cb_menu_contents, iwin);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_menu_contents(void *data, E_Menu *mn, E_Menu_Item *mi)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (!iwin->gadcon->config_dialog)
|
||||
e_int_gadcon_config_shelf(iwin->gadcon);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_menu_post(void *data, E_Menu *mn)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (!iwin->menu) return;
|
||||
e_object_del(E_OBJECT(iwin->menu));
|
||||
iwin->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
ev = event;
|
||||
if (ev->button == 1)
|
||||
{
|
||||
iwin->mouse_down = 1;
|
||||
if (iwin->win->border->client.illume.drag.locked) return;
|
||||
if (iwin->win->border->pointer)
|
||||
e_pointer_type_push(iwin->win->border->pointer,
|
||||
iwin->win->border, "move");
|
||||
iwin->drag.start = 1;
|
||||
iwin->drag.dnd = 0;
|
||||
ecore_x_pointer_last_xy_get(NULL, &iwin->drag.y);
|
||||
}
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
E_Menu *mn;
|
||||
E_Zone *zone;
|
||||
int x, y;
|
||||
|
||||
mn = e_menu_new();
|
||||
e_menu_post_deactivate_callback_set(mn, _e_mod_win_cb_menu_post, iwin);
|
||||
iwin->menu = mn;
|
||||
|
||||
_e_mod_win_cb_menu_append(iwin, mn);
|
||||
zone = e_util_zone_current_get(e_manager_current_get());
|
||||
e_gadcon_canvas_zone_geometry_get(iwin->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(mn, zone, x + ev->output.x, y + ev->output.y,
|
||||
1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Up *ev;
|
||||
Ecore_X_Window xwin;
|
||||
|
||||
ev = event;
|
||||
if (ev->button != 1) return;
|
||||
if (!(iwin = data)) return;
|
||||
xwin = iwin->win->border->zone->black_win;
|
||||
if ((!iwin->drag.dnd) && (iwin->mouse_down == 1))
|
||||
{
|
||||
ecore_x_e_illume_quickpanel_state_send
|
||||
(xwin, ECORE_X_ILLUME_QUICKPANEL_STATE_ON);
|
||||
}
|
||||
else if (iwin->drag.dnd)
|
||||
{
|
||||
E_Border *bd;
|
||||
|
||||
bd = iwin->win->border;
|
||||
if (bd->pointer)
|
||||
e_pointer_type_pop(bd->pointer, bd, "move");
|
||||
edje_object_signal_emit(iwin->o_base, "e,action,move,stop", "e");
|
||||
ecore_x_e_illume_top_shelf_geometry_set(xwin, bd->x, bd->y, bd->w,
|
||||
(32 * e_scale));
|
||||
ecore_x_e_illume_drag_end_send(bd->client.win);
|
||||
ecore_x_e_illume_quickpanel_position_update_send(bd->client.win);
|
||||
}
|
||||
iwin->drag.start = 0;
|
||||
iwin->drag.dnd = 0;
|
||||
iwin->drag.y = 0;
|
||||
iwin->mouse_down = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_win_cb_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||
{
|
||||
Il_Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Move *ev;
|
||||
E_Border *bd;
|
||||
int dy, ny, py;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (iwin->drag.start)
|
||||
{
|
||||
edje_object_signal_emit(iwin->o_base, "e,action,move,start", "e");
|
||||
ecore_x_e_illume_drag_start_send(iwin->win->border->client.win);
|
||||
iwin->drag.dnd = 1;
|
||||
iwin->drag.start = 0;
|
||||
}
|
||||
|
||||
if (!iwin->drag.dnd) return;
|
||||
|
||||
ev = event;
|
||||
bd = iwin->win->border;
|
||||
if ((bd->y + bd->h + ev->cur.output.y) >= (bd->zone->h)) return;
|
||||
|
||||
ecore_x_pointer_last_xy_get(NULL, &py);
|
||||
dy = ((bd->zone->h - bd->h) / 8);
|
||||
|
||||
if (ev->cur.output.y > ev->prev.output.y)
|
||||
{
|
||||
if ((py - iwin->drag.y) < dy) return;
|
||||
}
|
||||
else if (ev->cur.output.y < ev->prev.output.y)
|
||||
{
|
||||
if ((iwin->drag.y - py) < dy) return;
|
||||
}
|
||||
else return;
|
||||
|
||||
if (py > iwin->drag.y)
|
||||
ny = bd->y + dy;
|
||||
else if (py < iwin->drag.y)
|
||||
ny = bd->y - dy;
|
||||
else return;
|
||||
|
||||
if (bd->y != ny)
|
||||
{
|
||||
e_border_move(bd, bd->zone->x, ny);
|
||||
iwin->drag.y = py;
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef E_MOD_WIN_H
|
||||
# define E_MOD_WIN_H
|
||||
|
||||
Il_Ind_Win *e_mod_win_new(E_Zone *zone);
|
||||
|
||||
#endif
|
|
@ -1,8 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Link
|
||||
Name=Illume-Indicator
|
||||
Icon=e-module-illume-indicator
|
||||
X-Enlightenment-ModuleType=system
|
||||
Comment=<title>Illume Indicator for Embedded</title>
|
||||
Comment[fr]=<title>Illume pour l'embarqué – Indicator</title>
|
||||
Comment[it]=<title>Illume per sistemi embedded – modulo Indicator</title>
|
|
@ -1,31 +0,0 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MODULE = illume-softkey
|
||||
|
||||
# data files for the module
|
||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||
files_DATA = \
|
||||
e-module-$(MODULE).edj module.desktop
|
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
||||
|
||||
# the module .so file
|
||||
INCLUDES = -I. \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src/modules/$(MODULE) \
|
||||
-I$(top_srcdir)/src/bin \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/modules \
|
||||
@e_cflags@
|
||||
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
||||
pkg_LTLIBRARIES = module.la
|
||||
module_la_SOURCES = e_mod_main.c \
|
||||
e_mod_main.h \
|
||||
e_mod_win.c \
|
||||
e_mod_win.h
|
||||
|
||||
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
module_la_LDFLAGS = -module -avoid-version
|
||||
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
uninstall:
|
||||
rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
|
Binary file not shown.
|
@ -1,65 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
EAPI Il_Sk_Config *il_sk_cfg = NULL;
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
|
||||
/* public functions */
|
||||
int
|
||||
il_sk_config_init(E_Module *m)
|
||||
{
|
||||
conf_edd = E_CONFIG_DD_NEW("Illume-Softkey_Cfg", Il_Sk_Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Il_Sk_Config
|
||||
#define D conf_edd
|
||||
E_CONFIG_VAL(D, T, version, INT);
|
||||
|
||||
il_sk_cfg = e_config_domain_load("module.illume-softkey", conf_edd);
|
||||
if ((il_sk_cfg) &&
|
||||
((il_sk_cfg->version >> 16) < IL_CONFIG_MAJ))
|
||||
{
|
||||
E_FREE(il_sk_cfg);
|
||||
il_sk_cfg = NULL;
|
||||
}
|
||||
if (!il_sk_cfg)
|
||||
{
|
||||
il_sk_cfg = E_NEW(Il_Sk_Config, 1);
|
||||
il_sk_cfg->version = 0;
|
||||
}
|
||||
if (il_sk_cfg)
|
||||
{
|
||||
/* Add new config variables here */
|
||||
/* if ((il_sk_cfg->version & 0xffff) < 1) */
|
||||
il_sk_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||
}
|
||||
il_sk_cfg->mod_dir = eina_stringshare_add(m->dir);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_sk_config_shutdown(void)
|
||||
{
|
||||
if (il_sk_cfg->mod_dir) eina_stringshare_del(il_sk_cfg->mod_dir);
|
||||
il_sk_cfg->mod_dir = NULL;
|
||||
|
||||
E_FREE(il_sk_cfg);
|
||||
il_sk_cfg = NULL;
|
||||
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_sk_config_save(void)
|
||||
{
|
||||
e_config_domain_save("module.illume-softkey", conf_edd, il_sk_cfg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
il_sk_config_show(E_Container *con, const char *params)
|
||||
{
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
#ifndef E_MOD_CONFIG_H
|
||||
#define E_MOD_CONFIG_H
|
||||
|
||||
#define IL_CONFIG_MIN 0
|
||||
#define IL_CONFIG_MAJ 0
|
||||
|
||||
typedef struct _Il_Sk_Config Il_Sk_Config;
|
||||
struct _Il_Sk_Config
|
||||
{
|
||||
int version;
|
||||
|
||||
const char *mod_dir;
|
||||
};
|
||||
|
||||
int il_sk_config_init(E_Module *m);
|
||||
int il_sk_config_shutdown(void);
|
||||
int il_sk_config_save(void);
|
||||
void il_sk_config_show(E_Container *con, const char *params);
|
||||
|
||||
extern EAPI Il_Sk_Config *il_sk_cfg;
|
||||
|
||||
#endif
|
|
@ -1,62 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_win.h"
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *swins = NULL;
|
||||
const char *mod_dir = NULL;
|
||||
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume-Softkey" };
|
||||
|
||||
/* public functions */
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
E_Zone *zone;
|
||||
Eina_List *l, *ll, *lll;
|
||||
|
||||
mod_dir = eina_stringshare_add(m->dir);
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
{
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
{
|
||||
EINA_LIST_FOREACH(con->zones, lll, zone)
|
||||
{
|
||||
Il_Sk_Win *swin = NULL;
|
||||
|
||||
if (!(swin = e_mod_softkey_win_new(zone))) continue;
|
||||
swins = eina_list_append(swins, swin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m)
|
||||
{
|
||||
Il_Sk_Win *swin;
|
||||
|
||||
EINA_LIST_FREE(swins, swin)
|
||||
{
|
||||
e_object_del(E_OBJECT(swin));
|
||||
swin = NULL;
|
||||
}
|
||||
|
||||
if (mod_dir) eina_stringshare_del(mod_dir);
|
||||
mod_dir = NULL;
|
||||
|
||||
ecore_x_e_illume_bottom_panel_geometry_set(ecore_x_window_root_first_get(),
|
||||
0, 0, 0, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef E_MOD_MAIN_H
|
||||
#define E_MOD_MAIN_H
|
||||
|
||||
#define IL_SK_WIN_TYPE 0xE1b0784
|
||||
|
||||
typedef struct _Il_Sk_Win Il_Sk_Win;
|
||||
|
||||
struct _Il_Sk_Win
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
E_Win *win;
|
||||
Evas_Object *o_base, *o_box;
|
||||
Evas_Object *b_close, *b_back;
|
||||
};
|
||||
|
||||
EAPI extern E_Module_Api e_modapi;
|
||||
|
||||
EAPI void *e_modapi_init(E_Module *m);
|
||||
EAPI int e_modapi_shutdown(E_Module *m);
|
||||
EAPI int e_modapi_save(E_Module *m);
|
||||
|
||||
extern const char *mod_dir;
|
||||
|
||||
#endif
|
|
@ -1,111 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_win.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _il_sk_win_cb_free(Il_Sk_Win *win);
|
||||
static void _il_sk_win_cb_resize(E_Win *win);
|
||||
static void _il_sk_win_cb_back_click(void *data, void *data2);
|
||||
static void _il_sk_win_cb_close_click(void *data, void *data2);
|
||||
|
||||
Il_Sk_Win *
|
||||
e_mod_softkey_win_new(E_Zone *zone)
|
||||
{
|
||||
Il_Sk_Win *swin;
|
||||
Evas *evas;
|
||||
Ecore_X_Window_State states[2];
|
||||
char buff[PATH_MAX];
|
||||
|
||||
swin = E_OBJECT_ALLOC(Il_Sk_Win, IL_SK_WIN_TYPE, _il_sk_win_cb_free);
|
||||
if (!swin) return NULL;
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-softkey.edj", mod_dir);
|
||||
|
||||
swin->win = e_win_new(zone->container);
|
||||
swin->win->data = swin;
|
||||
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
||||
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
||||
e_win_title_set(swin->win, _("Illume Softkey"));
|
||||
e_win_name_class_set(swin->win, "Illume-Softkey", "Illume-Softkey");
|
||||
e_win_resize_callback_set(swin->win, _il_sk_win_cb_resize);
|
||||
ecore_x_icccm_hints_set(swin->win->evas_win, 0, 0, 0, 0, 0, 0, 0);
|
||||
ecore_x_netwm_window_state_set(swin->win->evas_win, states, 2);
|
||||
ecore_x_netwm_window_type_set(swin->win->evas_win, ECORE_X_WINDOW_TYPE_DOCK);
|
||||
|
||||
evas = e_win_evas_get(swin->win);
|
||||
|
||||
swin->o_base = edje_object_add(evas);
|
||||
if (!e_theme_edje_object_set(swin->o_base, "base/theme/modules/illume-softkey",
|
||||
"modules/illume-softkey/window"))
|
||||
edje_object_file_set(swin->o_base, buff, "modules/illume-softkey/window");
|
||||
evas_object_move(swin->o_base, 0, 0);
|
||||
evas_object_resize(swin->o_base, zone->w, 32);
|
||||
evas_object_show(swin->o_base);
|
||||
|
||||
swin->o_box = e_widget_list_add(evas, 1, 1);
|
||||
edje_object_part_swallow(swin->o_base, "e.swallow.buttons", swin->o_box);
|
||||
|
||||
swin->b_back = e_widget_button_add(evas, NULL, "go-previous",
|
||||
_il_sk_win_cb_back_click, swin, NULL);
|
||||
e_widget_list_object_append(swin->o_box, swin->b_back, 1, 0, 0.5);
|
||||
|
||||
swin->b_close = e_widget_button_add(evas, NULL, "window-close",
|
||||
_il_sk_win_cb_close_click, swin, NULL);
|
||||
e_widget_list_object_append(swin->o_box, swin->b_close, 1, 0, 0.5);
|
||||
|
||||
e_win_size_min_set(swin->win, zone->w, 32 * e_scale);
|
||||
e_win_move_resize(swin->win, zone->x, (zone->h - (32 * e_scale)),
|
||||
zone->w, (32 * e_scale));
|
||||
e_win_show(swin->win);
|
||||
e_border_zone_set(swin->win->border, zone);
|
||||
// e_win_placed_set(swin->win, 1);
|
||||
// swin->win->border->lock_user_location = 1;
|
||||
|
||||
ecore_x_e_illume_bottom_panel_geometry_set(ecore_x_window_root_first_get(),
|
||||
zone->x, (zone->h - (32 * e_scale)),
|
||||
zone->w, (32 * e_scale));
|
||||
return swin;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_il_sk_win_cb_free(Il_Sk_Win *win)
|
||||
{
|
||||
if (win->b_close) evas_object_del(win->b_close);
|
||||
if (win->b_back) evas_object_del(win->b_back);
|
||||
if (win->o_box) evas_object_del(win->o_box);
|
||||
if (win->o_base) evas_object_del(win->o_base);
|
||||
e_object_del(E_OBJECT(win->win));
|
||||
E_FREE(win);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_sk_win_cb_resize(E_Win *win)
|
||||
{
|
||||
Il_Sk_Win *swin;
|
||||
|
||||
if (!(swin = win->data)) return;
|
||||
evas_object_resize(swin->o_base, swin->win->w, swin->win->h);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_sk_win_cb_back_click(void *data, void *data2)
|
||||
{
|
||||
Il_Sk_Win *swin;
|
||||
E_Zone *zone;
|
||||
|
||||
if (!(swin = data)) return;
|
||||
zone = swin->win->border->zone;
|
||||
ecore_x_e_illume_back_send(zone->black_win);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_sk_win_cb_close_click(void *data, void *data2)
|
||||
{
|
||||
Il_Sk_Win *swin;
|
||||
E_Zone *zone;
|
||||
|
||||
if (!(swin = data)) return;
|
||||
zone = swin->win->border->zone;
|
||||
ecore_x_e_illume_close_send(zone->black_win);
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef E_MOD_WIN_H
|
||||
# define E_MOD_WIN_H
|
||||
|
||||
Il_Sk_Win *e_mod_softkey_win_new(E_Zone *zone);
|
||||
|
||||
#endif
|
|
@ -1,8 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Link
|
||||
Name=Illume-Softkey
|
||||
Icon=e-module-illume-softkey
|
||||
X-Enlightenment-ModuleType=system
|
||||
Comment=<title>Illume Softkey for Embedded</title>
|
||||
Comment[fr]=<title>Illume pour l'embarqué – Softkey</title>
|
||||
Comment[it]=<title>Illume per sistemi embedded – modulo Softkey</title>
|
Loading…
Reference in New Issue