forked from enlightenment/enlightenment
Added start of pager module
need to add windows to the desk previews will not update properly all the time, need to add events etc please someone theme this to fit in with default theme better - thanks :) SVN revision: 12844
This commit is contained in:
parent
382effca39
commit
d086fe5e5d
|
@ -188,6 +188,7 @@ src/modules/test/Makefile
|
||||||
src/modules/ibar/Makefile
|
src/modules/ibar/Makefile
|
||||||
src/modules/dropshadow/Makefile
|
src/modules/dropshadow/Makefile
|
||||||
src/modules/clock/Makefile
|
src/modules/clock/Makefile
|
||||||
|
src/modules/pager/Makefile
|
||||||
src/modules/flame/Makefile
|
src/modules/flame/Makefile
|
||||||
src/modules/snow/Makefile
|
src/modules/snow/Makefile
|
||||||
src/modules/battery/Makefile
|
src/modules/battery/Makefile
|
||||||
|
|
|
@ -273,7 +273,9 @@ images {
|
||||||
image: "e17_temperature_base.png" COMP;
|
image: "e17_temperature_base.png" COMP;
|
||||||
image: "e17_temperature_mid.png" COMP;
|
image: "e17_temperature_mid.png" COMP;
|
||||||
image: "e17_temperature_overlay.png" COMP;
|
image: "e17_temperature_overlay.png" COMP;
|
||||||
|
|
||||||
|
image: "e17_pager_screen.png" COMP;
|
||||||
|
image: "e17_pager_desk.png" COMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
collections {
|
collections {
|
||||||
|
@ -5611,4 +5613,91 @@ collections {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group {
|
||||||
|
name: "modules/pager/screen";
|
||||||
|
parts {
|
||||||
|
part {
|
||||||
|
name: "background";
|
||||||
|
mouse_events: 0;
|
||||||
|
type: RECT;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
visible: 0;
|
||||||
|
min: 18 18;
|
||||||
|
max: 18 18;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 0 0;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -1 -1;
|
||||||
|
}
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "overlay";
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 0 0;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -1 -1;
|
||||||
|
}
|
||||||
|
image {
|
||||||
|
normal: "e17_pager_screen.png";
|
||||||
|
border: 7 7 7 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
group {
|
||||||
|
name: "modules/pager/desk";
|
||||||
|
parts {
|
||||||
|
part {
|
||||||
|
name: "background";
|
||||||
|
mouse_events: 0;
|
||||||
|
type: RECT;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
visible: 0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 0 0;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -1 -1;
|
||||||
|
}
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "overlay";
|
||||||
|
mouse_events: 0;
|
||||||
|
description {
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1 {
|
||||||
|
relative: 0.0 0.0;
|
||||||
|
offset: 0 0;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
relative: 1.0 1.0;
|
||||||
|
offset: -1 -1;
|
||||||
|
}
|
||||||
|
image {
|
||||||
|
normal: "e17_pager_desk.png";
|
||||||
|
border: 2 2 2 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ test \
|
||||||
ibar \
|
ibar \
|
||||||
dropshadow \
|
dropshadow \
|
||||||
clock \
|
clock \
|
||||||
|
pager \
|
||||||
flame \
|
flame \
|
||||||
snow \
|
snow \
|
||||||
battery \
|
battery \
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
MODULE = pager
|
||||||
|
|
||||||
|
# data files for the module
|
||||||
|
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
|
files_DATA = \
|
||||||
|
module_icon.png
|
||||||
|
|
||||||
|
EXTRA_DIST = $(files_DATA)
|
||||||
|
|
||||||
|
# the module .so file
|
||||||
|
INCLUDES = -I. \
|
||||||
|
-I$(top_srcdir) \
|
||||||
|
-I$(includedir) \
|
||||||
|
-I$(top_srcdir)$(MODULE) \
|
||||||
|
-I$(top_srcdir)/src/bin \
|
||||||
|
-I$(top_srcdir)/src/lib \
|
||||||
|
-I$(top_srcdir)/src/modules \
|
||||||
|
@e_cflags@
|
||||||
|
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||||
|
pkg_LTLIBRARIES = module.la
|
||||||
|
module_la_SOURCES = e_mod_main.c \
|
||||||
|
e_mod_main.h
|
||||||
|
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||||
|
module_la_LDFLAGS = -module -avoid-version
|
||||||
|
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
|
@ -0,0 +1,405 @@
|
||||||
|
#include "e.h"
|
||||||
|
#include "e_mod_main.h"
|
||||||
|
|
||||||
|
/* TODO List:
|
||||||
|
*
|
||||||
|
* should support proper resize and move handles in the edje.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* module private routines */
|
||||||
|
static Pager *_pager_init(E_Module *m);
|
||||||
|
static void _pager_shutdown(Pager *e);
|
||||||
|
static E_Menu *_pager_config_menu_new(Pager *e);
|
||||||
|
static void _pager_config_menu_del(Pager *e, E_Menu *m);
|
||||||
|
static void _pager_cb_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
|
static void _pager_cb_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
|
static void _pager_cb_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
|
static int _pager_cb_event_container_resize(void *data, int type, void *event);
|
||||||
|
|
||||||
|
static void _pager_reconfigure(Pager *e);
|
||||||
|
static void _pager_refresh(Pager *e);
|
||||||
|
|
||||||
|
#define PAGER_MIN_W 10
|
||||||
|
#define PAGER_MIN_H 7
|
||||||
|
|
||||||
|
|
||||||
|
Evas_List *_pager_desks;
|
||||||
|
|
||||||
|
/* public module routines. all modules must have these */
|
||||||
|
void *
|
||||||
|
init(E_Module *m)
|
||||||
|
{
|
||||||
|
Pager *e;
|
||||||
|
|
||||||
|
/* check module api version */
|
||||||
|
if (m->api->version < E_MODULE_API_VERSION)
|
||||||
|
{
|
||||||
|
e_error_dialog_show("Module API Error",
|
||||||
|
"Error initializing Module: Pager\n"
|
||||||
|
"It requires a minimum module API version of: %i.\n"
|
||||||
|
"The module API advertized by Enlightenment is: %i.\n"
|
||||||
|
"Aborting module.",
|
||||||
|
E_MODULE_API_VERSION,
|
||||||
|
m->api->version);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
/* actually init pager */
|
||||||
|
e = _pager_init(m);
|
||||||
|
m->config_menu = _pager_config_menu_new(e);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
shutdown(E_Module *m)
|
||||||
|
{
|
||||||
|
Pager *e;
|
||||||
|
|
||||||
|
e = m->data;
|
||||||
|
if (e)
|
||||||
|
{
|
||||||
|
if (m->config_menu)
|
||||||
|
{
|
||||||
|
_pager_config_menu_del(e, m->config_menu);
|
||||||
|
m->config_menu = NULL;
|
||||||
|
}
|
||||||
|
_pager_shutdown(e);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
save(E_Module *m)
|
||||||
|
{
|
||||||
|
Pager *e;
|
||||||
|
|
||||||
|
e = m->data;
|
||||||
|
e_config_domain_save("module.pager", e->conf_edd, e->conf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
info(E_Module *m)
|
||||||
|
{
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
m->label = strdup("Pager");
|
||||||
|
snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
|
||||||
|
m->icon_file = strdup(buf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
about(E_Module *m)
|
||||||
|
{
|
||||||
|
e_error_dialog_show("Enlightenment Pager Module",
|
||||||
|
"A pager module to navigate E17 desktops.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* module private routines */
|
||||||
|
static Pager *
|
||||||
|
_pager_init(E_Module *m)
|
||||||
|
{
|
||||||
|
Pager *e;
|
||||||
|
Evas_List *managers, *l, *l2;
|
||||||
|
Evas_Object *o;
|
||||||
|
|
||||||
|
e = calloc(1, sizeof(Pager));
|
||||||
|
if (!e) return NULL;
|
||||||
|
|
||||||
|
e->conf_edd = E_CONFIG_DD_NEW("Pager_Config", Config);
|
||||||
|
#undef T
|
||||||
|
#undef D
|
||||||
|
#define T Config
|
||||||
|
#define D e->conf_edd
|
||||||
|
E_CONFIG_VAL(D, T, width, INT);
|
||||||
|
E_CONFIG_VAL(D, T, height, INT);
|
||||||
|
E_CONFIG_VAL(D, T, x, DOUBLE);
|
||||||
|
E_CONFIG_VAL(D, T, y, DOUBLE);
|
||||||
|
|
||||||
|
e->conf = e_config_domain_load("module.pager", e->conf_edd);
|
||||||
|
if (!e->conf)
|
||||||
|
{
|
||||||
|
e->conf = E_NEW(Config, 1);
|
||||||
|
e->conf->width = 50;
|
||||||
|
e->conf->height = 30;
|
||||||
|
e->conf->x = 0.0;
|
||||||
|
e->conf->y = 0.0;
|
||||||
|
}
|
||||||
|
E_CONFIG_LIMIT(e->conf->x, 0.0, 1.0);
|
||||||
|
E_CONFIG_LIMIT(e->conf->y, 0.0, 1.0);
|
||||||
|
E_CONFIG_LIMIT(e->conf->width, PAGER_MIN_W, 1000);
|
||||||
|
E_CONFIG_LIMIT(e->conf->height, PAGER_MIN_H, 1000);
|
||||||
|
|
||||||
|
managers = e_manager_list();
|
||||||
|
for (l = managers; l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Manager *man;
|
||||||
|
|
||||||
|
man = l->data;
|
||||||
|
for (l2 = man->containers; l2; l2 = l2->next)
|
||||||
|
{
|
||||||
|
E_Container *con;
|
||||||
|
|
||||||
|
con = l2->data;
|
||||||
|
e->con = con;
|
||||||
|
e->evas = con->bg_evas;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
o = evas_object_rectangle_add(e->evas);
|
||||||
|
e->base = o;
|
||||||
|
evas_object_color_set(o, 128, 128, 128, 0);
|
||||||
|
evas_object_pass_events_set(o, 0);
|
||||||
|
evas_object_repeat_events_set(o, 0);
|
||||||
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _pager_cb_down, e);
|
||||||
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _pager_cb_up, e);
|
||||||
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _pager_cb_move, e);
|
||||||
|
evas_object_show(o);
|
||||||
|
|
||||||
|
o = edje_object_add(e->evas);
|
||||||
|
e->screen = o;
|
||||||
|
edje_object_file_set(o,
|
||||||
|
/* FIXME: "default.eet" needs to come from conf */
|
||||||
|
e_path_find(path_themes, "default.eet"),
|
||||||
|
"modules/pager/screen");
|
||||||
|
evas_object_show(o);
|
||||||
|
|
||||||
|
e->ev_handler_container_resize =
|
||||||
|
ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE,
|
||||||
|
_pager_cb_event_container_resize, e);
|
||||||
|
|
||||||
|
_pager_reconfigure(e);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_shutdown(Pager *e)
|
||||||
|
{
|
||||||
|
free(e->conf);
|
||||||
|
E_CONFIG_DD_FREE(e->conf_edd);
|
||||||
|
|
||||||
|
ecore_event_handler_del(e->ev_handler_container_resize);
|
||||||
|
free(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
static E_Menu *
|
||||||
|
_pager_config_menu_new(Pager *e)
|
||||||
|
{
|
||||||
|
E_Menu *mn;
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
|
mn = e_menu_new();
|
||||||
|
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, "(Unused)");
|
||||||
|
/* e_menu_item_callback_set(mi, _pager_cb_scale, e);*/
|
||||||
|
e->config_menu = mn;
|
||||||
|
|
||||||
|
return mn;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_config_menu_del(Pager *e, E_Menu *m)
|
||||||
|
{
|
||||||
|
e_object_del(E_OBJECT(m));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_reconfigure(Pager *e)
|
||||||
|
{
|
||||||
|
Evas_Coord ww, hh;
|
||||||
|
|
||||||
|
evas_output_viewport_get(e->evas, NULL, NULL, &ww, &hh);
|
||||||
|
e->fx = e->conf->x * (ww - e->conf->width);
|
||||||
|
e->fy = e->conf->y * (hh - e->conf->height);
|
||||||
|
e->fw = e->conf->width;
|
||||||
|
e->fh = e->conf->height;
|
||||||
|
|
||||||
|
_pager_refresh(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_refresh(Pager *e)
|
||||||
|
{
|
||||||
|
E_Zone *zone;
|
||||||
|
E_Desk *desk, *current;
|
||||||
|
Evas_Object *desk_obj;
|
||||||
|
int desks_x, desks_y, x, y;
|
||||||
|
Evas_Coord px, py, pw, ph;
|
||||||
|
|
||||||
|
evas_object_resize(e->base, e->fw, e->fh);
|
||||||
|
evas_object_move(e->base, e->fx, e->fy);
|
||||||
|
|
||||||
|
zone = e_zone_current_get(e->con);
|
||||||
|
e_zone_desk_count_get(zone, &desks_x, &desks_y);
|
||||||
|
pw = e->fw / (double) desks_x;
|
||||||
|
ph = e->fh / (double) desks_y;
|
||||||
|
|
||||||
|
evas_object_resize(e->screen, pw, ph);
|
||||||
|
|
||||||
|
while(_pager_desks)
|
||||||
|
{
|
||||||
|
evas_object_hide(_pager_desks->data);
|
||||||
|
evas_object_free(_pager_desks->data);
|
||||||
|
_pager_desks = evas_list_remove_list(_pager_desks, _pager_desks);
|
||||||
|
}
|
||||||
|
|
||||||
|
current = e_desk_current_get(zone);
|
||||||
|
for (x = 0; x < desks_x; x++)
|
||||||
|
for (y = 0; y < desks_y; y++)
|
||||||
|
{
|
||||||
|
desk = e_desk_at_xy_get(zone, x, y);
|
||||||
|
if (desk == current)
|
||||||
|
evas_object_move(e->screen, e->fx + (x * pw), e->fy + (y * ph));
|
||||||
|
desk_obj = edje_object_add(e->evas);
|
||||||
|
edje_object_file_set(desk_obj,
|
||||||
|
/* FIXME: "default.eet" needs to come from conf */
|
||||||
|
e_path_find(path_themes, "default.eet"),
|
||||||
|
"modules/pager/desk");
|
||||||
|
evas_object_pass_events_set(desk_obj, 1);
|
||||||
|
evas_object_resize(desk_obj, pw, ph);
|
||||||
|
evas_object_move(desk_obj, e->fx + (x * pw), e->fy + (y * ph));
|
||||||
|
|
||||||
|
evas_object_show(desk_obj);
|
||||||
|
_pager_desks = evas_list_append(_pager_desks, desk_obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_cb_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Down *ev;
|
||||||
|
Pager *p;
|
||||||
|
|
||||||
|
ev = event_info;
|
||||||
|
p = data;
|
||||||
|
if (ev->button == 3)
|
||||||
|
{
|
||||||
|
e_menu_activate_mouse(p->config_menu, p->con,
|
||||||
|
ev->output.x, ev->output.y, 1, 1,
|
||||||
|
E_MENU_POP_DIRECTION_DOWN);
|
||||||
|
e_util_container_fake_mouse_up_all_later(p->con);
|
||||||
|
}
|
||||||
|
else if (ev->button == 2)
|
||||||
|
{
|
||||||
|
p->resize = 1;
|
||||||
|
}
|
||||||
|
else if (ev->button == 1)
|
||||||
|
{
|
||||||
|
p->move = 1;
|
||||||
|
}
|
||||||
|
evas_pointer_canvas_xy_get(p->evas, &p->xx, &p->yy);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_cb_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Up *ev;
|
||||||
|
Pager *p;
|
||||||
|
Evas_Coord ww, hh;
|
||||||
|
double newx, newy;
|
||||||
|
|
||||||
|
ev = event_info;
|
||||||
|
p = data;
|
||||||
|
|
||||||
|
/* if we clicked, not moved - FIXME, this is a hack */
|
||||||
|
newx = (double)p->fx / (double)(ww - p->fw);
|
||||||
|
newy = (double)p->fy / (double)(hh - p->fy);
|
||||||
|
if (p->move && (p->conf->x == newx) && (p->conf->y == newy))
|
||||||
|
{
|
||||||
|
printf("clicked\n");
|
||||||
|
int x, y, w, h, xcount, ycount, cx, cy;
|
||||||
|
E_Zone *zone;
|
||||||
|
E_Desk *desk;
|
||||||
|
|
||||||
|
zone = e_zone_current_get(p->con);
|
||||||
|
e_zone_desk_count_get(zone, &xcount, &ycount);
|
||||||
|
evas_pointer_canvas_xy_get(e, &cx, &cy);
|
||||||
|
|
||||||
|
w = p->fw / xcount;
|
||||||
|
h = p->fh / ycount;
|
||||||
|
for (x = 0; x < xcount; x++)
|
||||||
|
for (y = 0; y < ycount; y++)
|
||||||
|
{
|
||||||
|
printf("test %d, %d\n", x, y);
|
||||||
|
int left, right, top, bottom;
|
||||||
|
left = p->fx + x * w;
|
||||||
|
right = left + w;
|
||||||
|
top = p->fy + y * h;
|
||||||
|
bottom = top + h;
|
||||||
|
printf("l %d r %d t %d b %d = %d, %d\n", left, right, top, bottom, cx, cy);
|
||||||
|
if (left <= cx && cx < right && top <= cy && cy < bottom)
|
||||||
|
{
|
||||||
|
printf("matched %d, %d\n", x, y);
|
||||||
|
desk = e_desk_at_xy_get(zone, x, y);
|
||||||
|
e_desk_show(desk);
|
||||||
|
evas_object_move(p->screen, left, top);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p->move = 0;
|
||||||
|
p->resize = 0;
|
||||||
|
|
||||||
|
evas_output_viewport_get(p->evas, NULL, NULL, &ww, &hh);
|
||||||
|
p->conf->width = p->fw;
|
||||||
|
p->conf->height = p->fh;
|
||||||
|
p->conf->x = newx;
|
||||||
|
p->conf->y = newy;
|
||||||
|
e_config_save_queue();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_cb_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Move *ev;
|
||||||
|
Pager *p;
|
||||||
|
Evas_Coord cx, cy, sw, sh;
|
||||||
|
|
||||||
|
evas_pointer_canvas_xy_get(e, &cx, &cy);
|
||||||
|
evas_output_viewport_get(e, NULL, NULL, &sw, &sh);
|
||||||
|
|
||||||
|
ev = event_info;
|
||||||
|
p = data;
|
||||||
|
if (p->move)
|
||||||
|
{
|
||||||
|
p->fx += cx - p->xx;
|
||||||
|
p->fy += cy - p->yy;
|
||||||
|
if (p->fx < 0) p->fx = 0;
|
||||||
|
if (p->fy < 0) p->fy = 0;
|
||||||
|
if (p->fx + p->fw > sw) p->fx = sw - p->fw;
|
||||||
|
if (p->fy + p->fh > sh) p->fy = sh - p->fh;
|
||||||
|
_pager_refresh(p);
|
||||||
|
}
|
||||||
|
else if (p->resize)
|
||||||
|
{
|
||||||
|
Evas_Coord dx, dy;
|
||||||
|
|
||||||
|
dx = cx - p->xx;
|
||||||
|
dy = cy - p->yy;
|
||||||
|
|
||||||
|
p->fw += dx;
|
||||||
|
p->fh += dy;
|
||||||
|
if (p->fw < PAGER_MIN_W) p->fw = PAGER_MIN_W;
|
||||||
|
if (p->fh < PAGER_MIN_H) p->fh = PAGER_MIN_H;
|
||||||
|
// if (p->fw < p->minsize) p->fw = p->minsize;
|
||||||
|
// if (p->fw > p->maxsize) p->fw = p->maxsize;
|
||||||
|
if (p->fx + p->fw > sw) p->fw = sw - p->fx;
|
||||||
|
if (p->fy + p->fh > sh) p->fh = sh - p->fy;
|
||||||
|
_pager_refresh(p);
|
||||||
|
}
|
||||||
|
p->xx = ev->cur.canvas.x;
|
||||||
|
p->yy = ev->cur.canvas.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_pager_cb_event_container_resize(void *data, int type, void *event)
|
||||||
|
{
|
||||||
|
Pager *e;
|
||||||
|
|
||||||
|
e = data;
|
||||||
|
_pager_reconfigure(e);
|
||||||
|
return 1;
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
#ifndef E_MOD_MAIN_H
|
||||||
|
#define E_MOD_MAIN_H
|
||||||
|
|
||||||
|
typedef struct _Config Config;
|
||||||
|
typedef struct _Pager Pager;
|
||||||
|
|
||||||
|
struct _Config
|
||||||
|
{
|
||||||
|
int width, height;
|
||||||
|
double x, y;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Pager
|
||||||
|
{
|
||||||
|
E_Menu *config_menu;
|
||||||
|
Evas *evas;
|
||||||
|
Evas_Object *base, *screen;
|
||||||
|
|
||||||
|
E_Container *con;
|
||||||
|
E_Config_DD *conf_edd;
|
||||||
|
Config *conf;
|
||||||
|
unsigned char move : 1;
|
||||||
|
unsigned char resize : 1;
|
||||||
|
Ecore_Event_Handler *ev_handler_container_resize;
|
||||||
|
Evas_Coord fx, fy, fw, fh;
|
||||||
|
Evas_Coord xx, yy;
|
||||||
|
};
|
||||||
|
|
||||||
|
EAPI void *init (E_Module *m);
|
||||||
|
EAPI int shutdown (E_Module *m);
|
||||||
|
EAPI int save (E_Module *m);
|
||||||
|
EAPI int info (E_Module *m);
|
||||||
|
EAPI int about (E_Module *m);
|
||||||
|
|
||||||
|
#endif
|
Binary file not shown.
Loading…
Reference in New Issue