more pager cleanups - still not 100% happy with it... but getting there.


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 18 years ago
parent a748b0cb82
commit 04d6dae32a
  1. 30
      data/themes/default_pager.edc
  2. BIN
      data/themes/images/e17_pager_desk_sel.png
  3. BIN
      data/themes/images/e17_pager_window.png
  4. 67
      src/bin/e_border.c
  5. 14
      src/bin/e_border.h
  6. 32
      src/bin/e_layout.c
  7. 2
      src/bin/e_layout.h
  8. 2
      src/bin/e_xinerama.c
  9. 980
      src/modules/pager/e_mod_main.c
  10. 6
      src/modules/pager/e_mod_main.h

@ -173,24 +173,6 @@ group {
group {
name: "modules/pager/window";
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;
@ -198,33 +180,31 @@ group {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
offset: -1 -1;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
offset: 2 2;
}
image {
normal: "e17_pager_window.png";
border: 4 7 4 2;
border: 6 13 7 5;
}
}
}
part {
name: "WindowIcon";
name: "icon";
mouse_events: 0;
type: SWALLOW;
description {
state: "default" 0.0;
align: 1.0 1.0;
max: 20 20;
max: 24 24;
aspect: 1.0 1.0;
rel1 {
relative: 0.0 0.0;
offset: 1 5;
}
rel2 {
relative: 1.0 1.0;
offset: -2 -2;
}
color: 0 0 0 0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 962 B

@ -77,6 +77,8 @@ static void _e_border_event_border_add_free(void *data, void *ev);
static void _e_border_event_border_remove_free(void *data, void *ev);
static void _e_border_event_border_zone_set_free(void *data, void *ev);
static void _e_border_event_border_desk_set_free(void *data, void *ev);
static void _e_border_event_border_raise_free(void *data, void *ev);
static void _e_border_event_border_lower_free(void *data, void *ev);
static void _e_border_event_border_resize_free(void *data, void *ev);
static void _e_border_event_border_move_free(void *data, void *ev);
static void _e_border_event_border_show_free(void *data, void *ev);
@ -116,6 +118,8 @@ int E_EVENT_BORDER_ICONIFY = 0;
int E_EVENT_BORDER_UNICONIFY = 0;
int E_EVENT_BORDER_STICK = 0;
int E_EVENT_BORDER_UNSTICK = 0;
int E_EVENT_BORDER_RAISE = 0;
int E_EVENT_BORDER_LOWER = 0;
#define GRAV_SET(bd, grav) \
printf("GRAV TO %i\n", grav); \
@ -157,6 +161,8 @@ e_border_init(void)
E_EVENT_BORDER_UNICONIFY = ecore_event_type_new();
E_EVENT_BORDER_STICK = ecore_event_type_new();
E_EVENT_BORDER_UNSTICK = ecore_event_type_new();
E_EVENT_BORDER_RAISE = ecore_event_type_new();
E_EVENT_BORDER_LOWER = ecore_event_type_new();
return 1;
}
@ -582,6 +588,15 @@ e_border_raise(E_Border *bd)
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
mwin, ECORE_X_WINDOW_STACK_BELOW);
{
E_Event_Border_Raise *ev;
ev = calloc(1, sizeof(E_Event_Border_Raise));
ev->border = bd;
e_object_ref(E_OBJECT(bd));
ev->above = NULL;
ecore_event_add(E_EVENT_BORDER_RAISE, ev, _e_border_event_border_raise_free, NULL);
}
}
void
@ -595,6 +610,15 @@ e_border_lower(E_Border *bd)
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
bd->container->bg_win, ECORE_X_WINDOW_STACK_ABOVE);
{
E_Event_Border_Lower *ev;
ev = calloc(1, sizeof(E_Event_Border_Lower));
ev->border = bd;
e_object_ref(E_OBJECT(bd));
ev->below = NULL;
ecore_event_add(E_EVENT_BORDER_LOWER, ev, _e_border_event_border_lower_free, NULL);
}
}
void
@ -608,6 +632,16 @@ e_border_stack_above(E_Border *bd, E_Border *above)
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
above->win, ECORE_X_WINDOW_STACK_ABOVE);
{
E_Event_Border_Raise *ev;
ev = calloc(1, sizeof(E_Event_Border_Raise));
ev->border = bd;
e_object_ref(E_OBJECT(bd));
ev->above = above;
e_object_ref(E_OBJECT(above));
ecore_event_add(E_EVENT_BORDER_RAISE, ev, _e_border_event_border_raise_free, NULL);
}
}
void
@ -621,6 +655,16 @@ e_border_stack_below(E_Border *bd, E_Border *below)
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
below->win, ECORE_X_WINDOW_STACK_BELOW);
{
E_Event_Border_Lower *ev;
ev = calloc(1, sizeof(E_Event_Border_Lower));
ev->border = bd;
e_object_ref(E_OBJECT(bd));
ev->below = below;
e_object_ref(E_OBJECT(below));
ecore_event_add(E_EVENT_BORDER_LOWER, ev, _e_border_event_border_lower_free, NULL);
}
}
void
@ -3411,6 +3455,29 @@ _e_border_event_border_desk_set_free(void *data, void *ev)
free(e);
}
static void
_e_border_event_border_raise_free(void *data, void *ev)
{
E_Event_Border_Raise *e;
e = ev;
e_object_unref(E_OBJECT(e->border));
if (e->above) e_object_unref(E_OBJECT(e->above));
free(e);
}
static void
_e_border_event_border_lower_free(void *data, void *ev)
{
E_Event_Border_Lower *e;
e = ev;
e_object_unref(E_OBJECT(e->border));
if (e->below) e_object_unref(E_OBJECT(e->below));
free(e);
}
static void
_e_border_zone_update(E_Border *bd)
{

@ -33,6 +33,8 @@ typedef struct _E_Event_Border_Stick E_Event_Border_Stick;
typedef struct _E_Event_Border_Unstick E_Event_Border_Unstick;
typedef struct _E_Event_Border_Zone_Set E_Event_Border_Zone_Set;
typedef struct _E_Event_Border_Desk_Set E_Event_Border_Desk_Set;
typedef struct _E_Event_Border_Raise E_Event_Border_Raise;
typedef struct _E_Event_Border_Lower E_Event_Border_Lower;
#else
#ifndef E_BORDER_H
@ -273,6 +275,16 @@ struct _E_Event_Border_Desk_Set
E_Desk *desk;
};
struct _E_Event_Border_Raise
{
E_Border *border, *above;
};
struct _E_Event_Border_Lower
{
E_Border *border, *below;
};
EAPI int e_border_init(void);
EAPI int e_border_shutdown(void);
@ -320,6 +332,8 @@ extern EAPI int E_EVENT_BORDER_STICK;
extern EAPI int E_EVENT_BORDER_UNSTICK;
extern EAPI int E_EVENT_BORDER_ZONE_SET;
extern EAPI int E_EVENT_BORDER_DESK_SET;
extern EAPI int E_EVENT_BORDER_RAISE;
extern EAPI int E_EVENT_BORDER_LOWER;
#endif
#endif

@ -3,6 +3,9 @@
*/
#include "e.h"
/* FIXME: something is weird here - i had to reverse all stacking logic to make
* it work... */
typedef struct _E_Smart_Data E_Smart_Data;
typedef struct _E_Layout_Item E_Layout_Item;
@ -112,7 +115,7 @@ e_layout_pack(Evas_Object *obj, Evas_Object *child)
sd = evas_object_smart_data_get(obj);
_e_layout_smart_adopt(sd, child);
sd->items = evas_list_append(sd->items, child);
sd->items = evas_list_prepend(sd->items, child);
li = evas_object_data_get(child, "e_layout_data");
_e_layout_smart_move_resize_item(li);
}
@ -146,7 +149,7 @@ e_layout_child_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
}
void
e_layout_child_raise(Evas_Object *obj)
e_layout_child_lower(Evas_Object *obj)
{
E_Layout_Item *li;
@ -154,12 +157,14 @@ e_layout_child_raise(Evas_Object *obj)
if (!li) return;
li->sd->items = evas_list_remove(li->sd->items, obj);
if (li->sd->items)
evas_object_stack_above(obj, evas_list_data(evas_list_last(li->sd->items)));
{
evas_object_stack_above(obj, evas_list_data(evas_list_last(li->sd->items)));
}
li->sd->items = evas_list_append(li->sd->items, obj);
}
void
e_layout_child_lower(Evas_Object *obj)
e_layout_child_raise(Evas_Object *obj)
{
E_Layout_Item *li;
@ -172,7 +177,7 @@ e_layout_child_lower(Evas_Object *obj)
}
void
e_layout_child_raise_above(Evas_Object *obj, Evas_Object *above)
e_layout_child_lower_below(Evas_Object *obj, Evas_Object *below)
{
E_Layout_Item *li;
@ -180,12 +185,12 @@ e_layout_child_raise_above(Evas_Object *obj, Evas_Object *above)
if (!li) return;
li->sd->items = evas_list_remove(li->sd->items, obj);
if (li->sd->items)
evas_object_stack_above(obj, above);
li->sd->items = evas_list_append_relative(li->sd->items, obj, above);
evas_object_stack_above(obj, below);
li->sd->items = evas_list_append_relative(li->sd->items, obj, below);
}
void
e_layout_child_raise_below(Evas_Object *obj, Evas_Object *below)
e_layout_child_raise_above(Evas_Object *obj, Evas_Object *above)
{
E_Layout_Item *li;
@ -193,8 +198,8 @@ e_layout_child_raise_below(Evas_Object *obj, Evas_Object *below)
if (!li) return;
li->sd->items = evas_list_remove(li->sd->items, obj);
if (li->sd->items)
evas_object_stack_below(obj, below);
li->sd->items = evas_list_prepend_relative(li->sd->items, obj, below);
evas_object_stack_below(obj, above);
li->sd->items = evas_list_prepend_relative(li->sd->items, obj, above);
}
void
@ -226,13 +231,12 @@ _e_layout_smart_adopt(E_Smart_Data *sd, Evas_Object *obj)
li->w = 0;
li->h = 0;
evas_object_clip_set(obj, sd->clip);
evas_object_stack_above(obj, sd->obj);
evas_object_smart_member_add(li->sd->obj, obj);
evas_object_data_set(obj, "e_layout_data", li);
evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE,
_e_layout_smart_item_del_hook, NULL);
if (li->sd->items)
evas_object_stack_above(obj, evas_list_data(evas_list_last(li->sd->items)));
evas_object_stack_below(obj, evas_list_data(li->sd->items));
else
evas_object_stack_above(obj, sd->obj);
if (!evas_object_visible_get(sd->clip))
@ -389,7 +393,6 @@ _e_layout_smart_raise(Evas_Object *obj)
sd = evas_object_smart_data_get(obj);
if (!sd) return;
{
Evas_List *l;
@ -407,7 +410,6 @@ _e_layout_smart_lower(Evas_Object *obj)
sd = evas_object_smart_data_get(obj);
if (!sd) return;
{
Evas_List *l;
@ -425,7 +427,6 @@ _e_layout_smart_stack_above(Evas_Object *obj, Evas_Object *above)
sd = evas_object_smart_data_get(obj);
if (!sd) return;
{
Evas_List *l;
@ -443,7 +444,6 @@ _e_layout_smart_stack_below(Evas_Object *obj, Evas_Object *below)
sd = evas_object_smart_data_get(obj);
if (!sd) return;
{
Evas_List *l;

@ -17,7 +17,7 @@ EAPI void e_layout_child_resize (Evas_Object *obj, Evas_Coord w, Ev
EAPI void e_layout_child_raise (Evas_Object *obj);
EAPI void e_layout_child_lower (Evas_Object *obj);
EAPI void e_layout_child_raise_above (Evas_Object *obj, Evas_Object *above);
EAPI void e_layout_child_raise_below (Evas_Object *obj, Evas_Object *below);
EAPI void e_layout_child_lower_below (Evas_Object *obj, Evas_Object *below);
EAPI void e_layout_unpack (Evas_Object *obj);
#endif

@ -149,7 +149,7 @@ _e_xinerama_update(void)
sz = scr->w * scr->h;
sz2 = scr2->w * scr2->h;
/* if the one we already have is bigger, DONT add the new */
if (sz2 > sz)
if (sz2 >= sz)
add = 0;
/* add the old to a list to remove */
else

File diff suppressed because it is too large Load Diff

@ -68,6 +68,8 @@ struct _Pager_Face
Ecore_Event_Handler *ev_handler_border_stick;
Ecore_Event_Handler *ev_handler_border_unstick;
Ecore_Event_Handler *ev_handler_border_desk_set;
Ecore_Event_Handler *ev_handler_border_raise;
Ecore_Event_Handler *ev_handler_border_lower;
Ecore_Event_Handler *ev_handler_zone_desk_count_set;
Ecore_Event_Handler *ev_handler_desk_show;
};
@ -91,8 +93,8 @@ struct _Pager_Win
E_Border *border;
Pager_Desk *desk;
Evas_Object *obj;
Evas_Object *icon;
Evas_Object *window_object;
Evas_Object *icon_object;
};
EAPI void *init (E_Module *module);

Loading…
Cancel
Save