summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-07 13:19:47 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-07 13:19:47 +0000
commit321f2b4fa3e2820f4b922e9d117c21b8ea4892ae (patch)
tree6b8a9a8a739e7b967e7ed43b1730c44b6c9a5412 /src
parent9fd79a599427a5c252f6d7fcb8ae0431452f26cb (diff)
downloadenlightenment-321f2b4fa3e2820f4b922e9d117c21b8ea4892ae.tar.gz
comp structs now public, remove comp struct accessor functions, add comp utility functions to simplify getting comp from an e_object
SVN revision: 83745
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_border.c6
-rw-r--r--src/bin/e_comp.c222
-rw-r--r--src/bin/e_comp.h164
3 files changed, 188 insertions, 204 deletions
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index fdb6871cd8..d9105d1428 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -1100,7 +1100,7 @@ e_border_hide(E_Border *bd,
case 1:
default:
- if (!e_comp_evas_get(bd->zone->container->manager->comp))
+ if (!e_comp_evas_exists(bd))
{
/* Make sure that this border isn't deleted */
bd->await_hide_event++;
@@ -3501,7 +3501,7 @@ _e_border_shape_input_rectangle_set(E_Border *bd)
}
else
{
- if (!e_comp_evas_get(bd->zone->container->manager->comp))
+ if (!e_comp_evas_exists(bd))
ecore_x_composite_window_events_enable(bd->win);
else
ecore_x_composite_window_events_disable(bd->win);
@@ -3677,7 +3677,7 @@ _e_border_hide(E_Border *bd)
E_Border *tmp;
Eina_List *l;
- if (!e_comp_evas_get(bd->zone->container->manager->comp))
+ if (!e_comp_evas_exists(bd))
{
ecore_x_window_hide(bd->win);
ecore_evas_hide(bd->bg_ecore_evas);
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 23a3c5517b..77e51e1130 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -24,136 +24,6 @@
//
//////////////////////////////////////////////////////////////////////////
-struct _E_Comp
-{
- Ecore_X_Window win; // input overlay
- Ecore_Evas *ee;
- Evas *evas;
- Evas_Object *layout;
- Eina_List *zones;
- E_Manager *man;
- Eina_Inlist *wins;
- Eina_List *wins_list;
- Eina_List *updates;
- Ecore_Animator *render_animator;
- Ecore_Job *update_job;
- Ecore_Timer *new_up_timer;
- Evas_Object *fps_bg;
- Evas_Object *fps_fg;
- Ecore_Job *screen_job;
- Ecore_Timer *nocomp_delay_timer;
- Ecore_Timer *nocomp_override_timer;
- Ecore_X_Window ee_win;
- int animating;
- int render_overflow;
- double frametimes[122];
- int frameskip;
-
- int nocomp_override;
-
- Ecore_X_Window cm_selection;
-
- Eina_Bool gl : 1;
- Eina_Bool grabbed : 1;
- Eina_Bool nocomp : 1;
- Eina_Bool nocomp_want : 1;
- Eina_Bool wins_invalid : 1;
- Eina_Bool saver : 1;
-};
-
-struct _E_Comp_Zone
-{
- E_Zone *zone; // never deref - just use for handle cmp's
- Evas_Object *base;
- Evas_Object *over;
- int container_num;
- int zone_num;
- int x, y, w, h;
- double bl;
- Eina_Bool bloff;
-};
-
-struct _E_Comp_Win
-{
- EINA_INLIST;
-
- E_Comp *c; // parent compositor
- Ecore_X_Window win; // raw window - for menus etc.
- E_Border *bd; // if its a border - later
- E_Popup *pop; // if its a popup - later
- E_Menu *menu; // if it is a menu - later
- int x, y, w, h; // geometry
- struct
- {
- int x, y, w, h; // hidden geometry (used when its unmapped and re-instated on map)
- } hidden;
- int pw, ph; // pixmap w/h
- int border; // border width
- Ecore_X_Pixmap pixmap; // the compositing pixmap
- Ecore_X_Damage damage; // damage region
- Ecore_X_Visual vis; // window visual
- Ecore_X_Colormap cmap; // colormap of window
- int depth; // window depth
- Evas_Object *obj; // composite object
- Evas_Object *shobj; // shadow object
- Eina_List *obj_mirror; // extra mirror objects
- Ecore_X_Image *xim; // x image - software fallback
- E_Update *up; // update handler
- E_Object_Delfn *dfn; // delete function handle for objects being tracked
- Ecore_X_Sync_Counter counter; // sync counter for syncronised drawing
- Ecore_Timer *update_timeout; // max time between damage and "done" event
- Ecore_Timer *ready_timeout; // max time on show (new window draw) to wait for window contents to be ready if sync protocol not handled. this is fallback.
- int dmg_updates; // num of damage event updates since a redirect
- Ecore_X_Rectangle *rects; // shape rects... if shaped :(
- int rects_num; // num rects above
-
- Ecore_X_Pixmap cache_pixmap; // the cached pixmap (1/nth the dimensions)
- int cache_w, cache_h; // cached pixmap size
- int update_count; // how many updates have happened to this win
- double last_visible_time; // last time window was visible
- double last_draw_time; // last time window was damaged
-
- int pending_count; // pending event count
-
- unsigned int opacity; // opacity set with _NET_WM_WINDOW_OPACITY
-
- char *title, *name, *clas, *role; // fetched for override-redirect windowa
- Ecore_X_Window_Type primary_type; // fetched for override-redirect windowa
-
- unsigned char misses; // number of sync misses
-
- Eina_Bool delete_pending : 1; // delete pendig
- Eina_Bool hidden_override : 1; // hidden override
- Eina_Bool animating : 1; // it's busy animating - defer hides/dels
- Eina_Bool force : 1; // force del/hide even if animating
- Eina_Bool defer_hide : 1; // flag to get hide to work on deferred hide
- Eina_Bool delete_me : 1; // delete me!
- Eina_Bool visible : 1; // is visible
- Eina_Bool input_only : 1; // is input_only
-
- Eina_Bool override : 1; // is override-redirect
- Eina_Bool argb : 1; // is argb
- Eina_Bool shaped : 1; // is shaped
- Eina_Bool update : 1; // has updates to fetch
- Eina_Bool redirected : 1; // has updates to fetch
- Eina_Bool shape_changed : 1; // shape changed
- Eina_Bool native : 1; // native
- Eina_Bool drawme : 1; // drawme flag fo syncing rendering
-
- Eina_Bool invalid : 1; // invalid depth used - just use as marker
- Eina_Bool nocomp : 1; // nocomp applied
- Eina_Bool nocomp_need_update : 1; // nocomp in effect, but this window updated while in nocomp mode
- Eina_Bool needpix : 1; // need new pixmap
- Eina_Bool needxim : 1; // need new xim
- Eina_Bool real_hid : 1; // last hide was a real window unmap
- Eina_Bool inhash : 1; // is in the windows hash
- Eina_Bool show_ready : 1; // is this window ready for its first show
-
- Eina_Bool show_anim : 1; // ran show animation
-
- Eina_Bool bg_win : 1; // window is the bg win for a container
-};
-
static Eina_List *handlers = NULL;
static Eina_List *compositors = NULL;
static Eina_Hash *windows = NULL;
@@ -4443,13 +4313,6 @@ e_comp_shadows_reset(void)
}
}
-
-EAPI Evas *
-e_comp_evas_get(E_Comp *c)
-{
- return c ? c->evas : NULL;
-}
-
EAPI void
e_comp_update(E_Comp *c)
{
@@ -4457,19 +4320,19 @@ e_comp_update(E_Comp *c)
}
EAPI E_Comp_Win *
-e_comp_border_src_get(Ecore_X_Window win)
+e_comp_win_find_border_win(Ecore_X_Window win)
{
return _e_comp_border_client_find(win);
}
EAPI E_Comp_Win *
-e_comp_src_get(Ecore_X_Window win)
+e_comp_win_find(Ecore_X_Window win)
{
return _e_comp_win_find(win);
}
EAPI const Eina_List *
-e_comp_src_list_get(E_Comp *c)
+e_comp_win_list_get(E_Comp *c)
{
E_Comp_Win *cw;
@@ -4489,35 +4352,14 @@ e_comp_src_list_get(E_Comp *c)
}
EAPI Evas_Object *
-e_comp_src_image_get(E_Comp_Win *cw)
-{
- if ((!cw) || (!cw->c)) return NULL;
- return cw->obj;
-}
-
-EAPI Evas_Object *
-e_comp_src_shadow_get(E_Comp_Win *cw)
-{
- if ((!cw) || (!cw->c)) return NULL;
- return cw->shobj;
-}
-
-EAPI Evas_Object *
-e_comp_src_image_mirror_add(E_Comp_Win *cw)
+e_comp_win_image_mirror_add(E_Comp_Win *cw)
{
if ((!cw) || (!cw->c)) return NULL;
return _e_comp_win_mirror_add(cw);
}
-EAPI Eina_Bool
-e_comp_src_visible_get(E_Comp_Win *cw)
-{
- if ((!cw) || (!cw->c)) return EINA_FALSE;
- return cw->visible;
-}
-
EAPI void
-e_comp_src_hidden_set(E_Comp_Win *cw, Eina_Bool hidden)
+e_comp_win_hidden_set(E_Comp_Win *cw, Eina_Bool hidden)
{
if (!cw->c) return;
if (cw->hidden_override == hidden) return;
@@ -4536,30 +4378,34 @@ e_comp_src_hidden_set(E_Comp_Win *cw, Eina_Bool hidden)
}
}
-EAPI Eina_Bool
-e_comp_src_hidden_get(E_Comp_Win *cw)
-{
- if ((!cw) || (!cw->c)) return EINA_FALSE;
- return cw->hidden_override;
-}
-
-EAPI E_Popup *
-e_comp_src_popup_get(E_Comp_Win *cw)
-{
- if ((!cw) || (!cw->c)) return NULL;
- return cw->pop;
-}
-
-EAPI E_Border *
-e_comp_src_border_get(E_Comp_Win *cw)
-{
- if ((!cw) || (!cw->c)) return NULL;
- return cw->bd;
-}
-
-EAPI Ecore_X_Window
-e_comp_src_window_get(E_Comp_Win *cw)
+EAPI E_Comp *
+e_comp_get(void *o)
{
- if ((!cw) || (!cw->c)) return 0;
- return cw->win;
+ E_Border *bd;
+ E_Object *obj = o;
+ E_Zone *zone = NULL;
+ E_Container *con = NULL;
+ E_Manager *man = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+ switch (obj->type)
+ {
+ case E_BORDER_TYPE:
+ bd = (E_Border*)obj;
+ zone = bd->zone;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(zone, NULL);
+ case E_ZONE_TYPE:
+ if (!zone) zone = (E_Zone*)obj;
+ con = zone->container;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(con, NULL);
+ case E_CONTAINER_TYPE:
+ if (!con) con = (E_Container*)obj;
+ man = con->manager;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(man, NULL);
+ case E_MANAGER_TYPE:
+ if (!man) man = (E_Manager*)obj;
+ return man->comp;
+ }
+ CRI("UNIMPLEMENTED TYPE PASSED! FIXME!");
+ return NULL;
}
diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h
index 534dfd9f5d..6723e76cf0 100644
--- a/src/bin/e_comp.h
+++ b/src/bin/e_comp.h
@@ -11,6 +11,137 @@ typedef struct E_Event_Comp E_Event_Comp;
# include "e_comp_cfdata.h"
# include "e_comp_update.h"
+
+struct _E_Comp
+{
+ Ecore_X_Window win; // input overlay
+ Ecore_Evas *ee;
+ Evas *evas;
+ Evas_Object *layout;
+ Eina_List *zones;
+ E_Manager *man;
+ Eina_Inlist *wins;
+ Eina_List *wins_list;
+ Eina_List *updates;
+ Ecore_Animator *render_animator;
+ Ecore_Job *update_job;
+ Ecore_Timer *new_up_timer;
+ Evas_Object *fps_bg;
+ Evas_Object *fps_fg;
+ Ecore_Job *screen_job;
+ Ecore_Timer *nocomp_delay_timer;
+ Ecore_Timer *nocomp_override_timer;
+ Ecore_X_Window ee_win;
+ int animating;
+ int render_overflow;
+ double frametimes[122];
+ int frameskip;
+
+ int nocomp_override;
+
+ Ecore_X_Window cm_selection;
+
+ Eina_Bool gl : 1;
+ Eina_Bool grabbed : 1;
+ Eina_Bool nocomp : 1;
+ Eina_Bool nocomp_want : 1;
+ Eina_Bool wins_invalid : 1;
+ Eina_Bool saver : 1;
+};
+
+struct _E_Comp_Zone
+{
+ E_Zone *zone; // never deref - just use for handle cmp's
+ Evas_Object *base;
+ Evas_Object *over;
+ int container_num;
+ int zone_num;
+ int x, y, w, h;
+ double bl;
+ Eina_Bool bloff;
+};
+
+struct _E_Comp_Win
+{
+ EINA_INLIST;
+
+ E_Comp *c; // parent compositor
+ Ecore_X_Window win; // raw window - for menus etc.
+ E_Border *bd; // if its a border - later
+ E_Popup *pop; // if its a popup - later
+ E_Menu *menu; // if it is a menu - later
+ int x, y, w, h; // geometry
+ struct
+ {
+ int x, y, w, h; // hidden geometry (used when its unmapped and re-instated on map)
+ } hidden;
+ int pw, ph; // pixmap w/h
+ int border; // border width
+ Ecore_X_Pixmap pixmap; // the compositing pixmap
+ Ecore_X_Damage damage; // damage region
+ Ecore_X_Visual vis; // window visual
+ Ecore_X_Colormap cmap; // colormap of window
+ int depth; // window depth
+ Evas_Object *obj; // composite object
+ Evas_Object *shobj; // shadow object
+ Eina_List *obj_mirror; // extra mirror objects
+ Ecore_X_Image *xim; // x image - software fallback
+ E_Update *up; // update handler
+ E_Object_Delfn *dfn; // delete function handle for objects being tracked
+ Ecore_X_Sync_Counter counter; // sync counter for syncronised drawing
+ Ecore_Timer *update_timeout; // max time between damage and "done" event
+ Ecore_Timer *ready_timeout; // max time on show (new window draw) to wait for window contents to be ready if sync protocol not handled. this is fallback.
+ int dmg_updates; // num of damage event updates since a redirect
+ Ecore_X_Rectangle *rects; // shape rects... if shaped :(
+ int rects_num; // num rects above
+
+ Ecore_X_Pixmap cache_pixmap; // the cached pixmap (1/nth the dimensions)
+ int cache_w, cache_h; // cached pixmap size
+ int update_count; // how many updates have happened to this win
+ double last_visible_time; // last time window was visible
+ double last_draw_time; // last time window was damaged
+
+ int pending_count; // pending event count
+
+ unsigned int opacity; // opacity set with _NET_WM_WINDOW_OPACITY
+
+ char *title, *name, *clas, *role; // fetched for override-redirect windowa
+ Ecore_X_Window_Type primary_type; // fetched for override-redirect windowa
+
+ unsigned char misses; // number of sync misses
+
+ Eina_Bool delete_pending : 1; // delete pendig
+ Eina_Bool hidden_override : 1; // hidden override
+ Eina_Bool animating : 1; // it's busy animating - defer hides/dels
+ Eina_Bool force : 1; // force del/hide even if animating
+ Eina_Bool defer_hide : 1; // flag to get hide to work on deferred hide
+ Eina_Bool delete_me : 1; // delete me!
+ Eina_Bool visible : 1; // is visible
+ Eina_Bool input_only : 1; // is input_only
+
+ Eina_Bool override : 1; // is override-redirect
+ Eina_Bool argb : 1; // is argb
+ Eina_Bool shaped : 1; // is shaped
+ Eina_Bool update : 1; // has updates to fetch
+ Eina_Bool redirected : 1; // has updates to fetch
+ Eina_Bool shape_changed : 1; // shape changed
+ Eina_Bool native : 1; // native
+ Eina_Bool drawme : 1; // drawme flag fo syncing rendering
+
+ Eina_Bool invalid : 1; // invalid depth used - just use as marker
+ Eina_Bool nocomp : 1; // nocomp applied
+ Eina_Bool nocomp_need_update : 1; // nocomp in effect, but this window updated while in nocomp mode
+ Eina_Bool needpix : 1; // need new pixmap
+ Eina_Bool needxim : 1; // need new xim
+ Eina_Bool real_hid : 1; // last hide was a real window unmap
+ Eina_Bool inhash : 1; // is in the windows hash
+ Eina_Bool show_ready : 1; // is this window ready for its first show
+
+ Eina_Bool show_anim : 1; // ran show animation
+
+ Eina_Bool bg_win : 1; // window is the bg win for a container
+};
+
struct E_Event_Comp
{
E_Comp_Win *cw;
@@ -36,20 +167,27 @@ EAPI int e_comp_internal_save(void);
EAPI E_Comp_Config *e_comp_config_get(void);
EAPI void e_comp_shadows_reset(void);
-EAPI Evas *e_comp_evas_get(E_Comp *c);
EAPI void e_comp_update(E_Comp *c);
-EAPI E_Comp_Win *e_comp_border_src_get(Ecore_X_Window win);
-EAPI E_Comp_Win *e_comp_src_get(Ecore_X_Window win);
-EAPI const Eina_List *e_comp_src_list_get(E_Comp *c);
-EAPI Evas_Object *e_comp_src_image_get(E_Comp_Win *cw);
-EAPI Evas_Object *e_comp_src_shadow_get(E_Comp_Win *cw);
-EAPI Evas_Object *e_comp_src_image_mirror_add(E_Comp_Win *cw);
-EAPI Eina_Bool e_comp_src_visible_get(E_Comp_Win *cw);
-EAPI void e_comp_src_hidden_set(E_Comp_Win *cw, Eina_Bool hidden);
-EAPI Eina_Bool e_comp_src_hidden_get(E_Comp_Win *cw);
-EAPI E_Popup *e_comp_src_popup_get(E_Comp_Win *cw);
-EAPI E_Border *e_comp_src_border_get(E_Comp_Win *cw);
-EAPI Ecore_X_Window e_comp_src_window_get(E_Comp_Win *cw);
+
+EAPI E_Comp_Win *e_comp_win_find_border_win(Ecore_X_Window win);
+EAPI E_Comp_Win *e_comp_win_find(Ecore_X_Window win);
+EAPI const Eina_List *e_comp_win_list_get(E_Comp *c);
+EAPI Evas_Object *e_comp_win_image_mirror_add(E_Comp_Win *cw);
+EAPI void e_comp_win_hidden_set(E_Comp_Win *cw, Eina_Bool hidden);
+
+
+EAPI E_Comp *e_comp_get(void *o);
+
+
+static inline Eina_Bool
+e_comp_evas_exists(void *o)
+{
+ E_Comp *c;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
+ c = e_comp_get(o);
+ return c ? !!c->evas : EINA_FALSE;
+}
#endif
#endif