2010-01-04 04:27:15 -08:00
# ifdef E_TYPEDEFS
2012-08-27 02:22:26 -07:00
typedef struct _E_Comp E_Comp ;
typedef struct _E_Comp_Win E_Comp_Win ;
typedef struct _E_Comp_Zone E_Comp_Zone ;
2013-01-18 04:47:14 -08:00
typedef struct E_Event_Comp E_Event_Comp ;
2010-01-14 20:41:20 -08:00
2013-02-07 05:20:07 -08:00
typedef enum
{
E_COMP_CANVAS_LAYER_BOTTOM = - 100 ,
E_COMP_CANVAS_LAYER_BG = - 1 , // zone bg stuff
E_COMP_CANVAS_LAYER_DESKTOP = 0 , // desktop objects: fileman, gadgets, shelves
2013-02-18 05:43:47 -08:00
E_COMP_CANVAS_LAYER_DESKTOP_TOP = 10 , // raised desktop objects: gadgets, shelves
2013-02-07 05:20:07 -08:00
E_COMP_CANVAS_LAYER_LAYOUT = 100 , // should be nothing else on this layer
2013-02-18 05:43:18 -08:00
E_COMP_CANVAS_LAYER_POPUP = 999 , // popups
2013-02-19 00:08:58 -08:00
E_COMP_CANVAS_LAYER_MENU = 5000 , // menus
2013-02-18 05:43:10 -08:00
E_COMP_CANVAS_LAYER_DESKLOCK = 9999 , // desklock
2013-02-07 05:20:07 -08:00
E_COMP_CANVAS_LAYER_MAX = 32767 // EVAS_LAYER_MAX
} E_Comp_Canvas_Layer ;
typedef enum _E_Layer
{
E_LAYER_DESKTOP = 0 ,
E_LAYER_BELOW = 50 ,
E_LAYER_NORMAL = 100 ,
E_LAYER_ABOVE = 150 ,
E_LAYER_EDGE = 200 ,
E_LAYER_FULLSCREEN = 250 ,
E_LAYER_EDGE_FULLSCREEN = 300 ,
E_LAYER_POPUP = 300 ,
E_LAYER_TOP = 350 ,
E_LAYER_DRAG = 400 ,
E_LAYER_PRIO = 450
} E_Layer ;
typedef enum
{
E_COMP_CANVAS_STACK_UNDER = - 1 ,
E_COMP_CANVAS_STACK_NONE = 0 ,
E_COMP_CANVAS_STACK_ABOVE = 1
} E_Comp_Canvas_Stack ;
2013-01-09 03:34:07 -08:00
# else
# ifndef E_MOD_COMP_H
# define E_MOD_COMP_H
2013-01-18 03:22:05 -08:00
# include "e_comp_cfdata.h"
2013-02-07 05:20:07 -08:00
# include "e_comp_render_update.h"
2013-01-18 03:22:05 -08:00
2013-02-07 05:19:47 -08:00
struct _E_Comp
{
Ecore_X_Window win ; // input overlay
Ecore_Evas * ee ;
2013-02-07 05:20:07 -08:00
Ecore_X_Window ee_win ;
2013-02-07 05:19:47 -08:00
Evas * evas ;
Evas_Object * layout ;
Eina_List * zones ;
E_Manager * man ;
2013-02-25 06:04:12 -08:00
E_Pointer * pointer ;
2013-02-07 05:20:07 -08:00
Eina_List * debug_rects ;
2013-02-18 05:43:47 -08:00
Eina_List * ignore_wins ;
2013-02-07 05:20:07 -08:00
2013-02-07 05:19:47 -08:00
Eina_Inlist * wins ;
Eina_List * wins_list ;
Eina_List * updates ;
Ecore_Animator * render_animator ;
2013-02-07 05:20:07 -08:00
Ecore_Job * shape_job ;
2013-02-07 05:19:47 -08:00
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 ;
int animating ;
int render_overflow ;
double frametimes [ 122 ] ;
int frameskip ;
2013-02-18 05:43:55 -08:00
int nocomp_override ; //number of times nocomp override has been requested
Ecore_X_Window block_win ;
int block_count ; //number of times block window has been requested
2013-02-07 05:19:47 -08:00
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
{
2013-02-07 05:20:07 -08:00
E_Comp * comp ;
2013-02-07 05:19:47 -08:00
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.
2013-02-07 05:20:07 -08:00
E_Container_Shape * shape ;
2013-02-07 05:19:47 -08:00
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
2013-02-07 05:20:07 -08:00
Eina_Rectangle hidden ; // hidden geometry (used when its unmapped and re-instated on map)
2013-02-07 05:19:47 -08:00
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
2013-04-16 05:16:48 -07:00
Evas_Object * zoomobj ; // zoomap
2013-02-07 05:19:47 -08:00
Evas_Object * shobj ; // shadow object
giant comp rejiggering commit #6:
* border->fx REMOVED, related border api REMOVED
* comp edc has new class of groups: e/comp/effects[/auto]
** these are effects which can be applied to any compositor object through the e_comp_win_effect* api and are written in embryo
*** two types - base and auto - base = manual, for use with animators; auto are "trigger and forget", for use as actual effects
* desk flip transition animations moved to comp effects and FIXED(ish)
* "zoom" effect renamed to "diagonal" for slightly less misleading name since it never did any zooming
* actual "zoom" effect added
* border hierarchy now as follows: cw->effect_obj swallows cw->shobj, cw->shobj swallows cw->bd->bg_object ?: cw->obj, if (cw->bd->bg_object) cw->bd->bg_object swallows cw->obj
** cw->effect_obj now used for all positioning and comp logic
** cw->effect_obj ONLY used for object transformation effects (moving, zooming, fading, etc)
** cw->shobj ONLY for comp visual/non-movement effects (focus effect, unfocus opacity, legacy shadows); this is a candidate for removal/rewrite in E19
* even more comp shape rewrites
* desk flip animation time now controlled by theme since edje doesn't support setting transition time in C; related config value removed
* desk flip transitions (in e_desk.c) rewritten
* various modules (evry/illume2) updated to use comp effects instead of fx offset
* desk flip configuration BROKEN(ish)
2013-02-28 07:20:32 -08:00
Evas_Object * effect_obj ; // effects object
2013-02-19 01:54:57 -08:00
E_Object * eobj ; // internal e object
2013-02-26 00:39:10 -08:00
E_Comp_Win * cw_above ; // comp win that should always be stacked above this one
Eina_List * stack_below ; // list of objects to keep stacked below this one
2013-02-07 05:19:47 -08:00
Eina_List * obj_mirror ; // extra mirror objects
Ecore_X_Image * xim ; // x image - software fallback
2013-02-07 05:20:07 -08:00
E_Comp_Render_Update * up ; // update handler
2013-02-07 05:19:47 -08:00
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_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
2013-02-22 01:33:13 -08:00
Ecore_Timer * opacity_set_timer ; // timer for setting opacity in ecore-x to avoid roundtrips
2013-02-07 05:19:47 -08:00
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
2013-04-16 07:05:11 -07:00
Eina_Bool geom_update : 1 ; // window needs geometry updated
2013-02-07 05:19:47 -08:00
Eina_Bool show_anim : 1 ; // ran show animation
Eina_Bool bg_win : 1 ; // window is the bg win for a container
2013-02-07 05:20:07 -08:00
Eina_Bool free_shape : 1 ; // container shape needs to be freed
2013-02-18 05:43:47 -08:00
Eina_Bool real_obj : 1 ; // real object (for dummy comp wins)
Eina_Bool not_in_layout : 1 ; // object is a dummy not in comp layout
giant comp rejiggering commit #6:
* border->fx REMOVED, related border api REMOVED
* comp edc has new class of groups: e/comp/effects[/auto]
** these are effects which can be applied to any compositor object through the e_comp_win_effect* api and are written in embryo
*** two types - base and auto - base = manual, for use with animators; auto are "trigger and forget", for use as actual effects
* desk flip transition animations moved to comp effects and FIXED(ish)
* "zoom" effect renamed to "diagonal" for slightly less misleading name since it never did any zooming
* actual "zoom" effect added
* border hierarchy now as follows: cw->effect_obj swallows cw->shobj, cw->shobj swallows cw->bd->bg_object ?: cw->obj, if (cw->bd->bg_object) cw->bd->bg_object swallows cw->obj
** cw->effect_obj now used for all positioning and comp logic
** cw->effect_obj ONLY used for object transformation effects (moving, zooming, fading, etc)
** cw->shobj ONLY for comp visual/non-movement effects (focus effect, unfocus opacity, legacy shadows); this is a candidate for removal/rewrite in E19
* even more comp shape rewrites
* desk flip animation time now controlled by theme since edje doesn't support setting transition time in C; related config value removed
* desk flip transitions (in e_desk.c) rewritten
* various modules (evry/illume2) updated to use comp effects instead of fx offset
* desk flip configuration BROKEN(ish)
2013-02-28 07:20:32 -08:00
Eina_Bool effect_clip : 1 ; //effect_obj is clipped
Eina_Bool effect_clip_able : 1 ; //effect_obj will be clipped for effects
2013-02-07 05:19:47 -08:00
} ;
2013-01-18 04:47:14 -08:00
struct E_Event_Comp
{
E_Comp_Win * cw ;
} ;
extern EAPI int E_EVENT_COMP_SOURCE_VISIBILITY ;
extern EAPI int E_EVENT_COMP_SOURCE_ADD ;
extern EAPI int E_EVENT_COMP_SOURCE_DEL ;
extern EAPI int E_EVENT_COMP_SOURCE_CONFIGURE ;
2013-04-19 05:49:34 -07:00
extern EAPI int E_EVENT_COMP_SOURCE_STACK ;
2013-01-18 04:47:14 -08:00
2013-01-13 03:55:16 -08:00
typedef enum
{
E_COMP_ENGINE_NONE = 0 ,
E_COMP_ENGINE_SW = 1 ,
E_COMP_ENGINE_GL = 2
} E_Comp_Engine ;
2013-01-09 23:53:20 -08:00
EINTERN Eina_Bool e_comp_init ( void ) ;
EINTERN int e_comp_shutdown ( void ) ;
2013-02-07 05:19:36 -08:00
EINTERN Eina_Bool e_comp_manager_init ( E_Manager * man ) ;
2012-09-10 04:01:11 -07:00
2013-02-18 05:43:55 -08:00
EAPI const Eina_List * e_comp_list ( void ) ;
2013-01-10 05:03:36 -08:00
EAPI int e_comp_internal_save ( void ) ;
EAPI E_Comp_Config * e_comp_config_get ( void ) ;
2013-01-10 06:05:08 -08:00
EAPI void e_comp_shadows_reset ( void ) ;
2010-01-14 20:41:20 -08:00
2013-02-18 05:43:55 -08:00
EAPI void e_comp_block_window_add ( void ) ;
EAPI void e_comp_block_window_del ( void ) ;
2013-02-07 05:20:07 -08:00
EAPI void e_comp_render_update ( E_Comp * c ) ;
EAPI void e_comp_zone_update ( E_Comp_Zone * cz ) ;
2013-02-07 05:19:47 -08:00
2013-02-18 05:43:55 -08:00
EAPI void e_comp_override_del ( E_Comp * c ) ;
EAPI void e_comp_override_add ( E_Comp * c ) ;
giant comp rejiggering commit #6:
* border->fx REMOVED, related border api REMOVED
* comp edc has new class of groups: e/comp/effects[/auto]
** these are effects which can be applied to any compositor object through the e_comp_win_effect* api and are written in embryo
*** two types - base and auto - base = manual, for use with animators; auto are "trigger and forget", for use as actual effects
* desk flip transition animations moved to comp effects and FIXED(ish)
* "zoom" effect renamed to "diagonal" for slightly less misleading name since it never did any zooming
* actual "zoom" effect added
* border hierarchy now as follows: cw->effect_obj swallows cw->shobj, cw->shobj swallows cw->bd->bg_object ?: cw->obj, if (cw->bd->bg_object) cw->bd->bg_object swallows cw->obj
** cw->effect_obj now used for all positioning and comp logic
** cw->effect_obj ONLY used for object transformation effects (moving, zooming, fading, etc)
** cw->shobj ONLY for comp visual/non-movement effects (focus effect, unfocus opacity, legacy shadows); this is a candidate for removal/rewrite in E19
* even more comp shape rewrites
* desk flip animation time now controlled by theme since edje doesn't support setting transition time in C; related config value removed
* desk flip transitions (in e_desk.c) rewritten
* various modules (evry/illume2) updated to use comp effects instead of fx offset
* desk flip configuration BROKEN(ish)
2013-02-28 07:20:32 -08:00
EAPI void e_comp_win_effect_set ( E_Comp_Win * cw , const char * effect ) ;
EAPI void e_comp_win_effect_params_set ( E_Comp_Win * cw , int id , int * params , unsigned int count ) ;
EAPI void e_comp_win_effect_start ( E_Comp_Win * cw , Edje_Signal_Cb end_cb , const void * end_data ) ;
EAPI void e_comp_win_effect_stop ( E_Comp_Win * cw , Edje_Signal_Cb end_cb ) ;
2013-05-30 01:39:30 -07:00
EAPI void e_comp_win_effect_clip ( E_Comp_Win * cw ) ;
2013-04-22 05:56:48 -07:00
EAPI void e_comp_win_effect_unclip ( E_Comp_Win * cw ) ;
giant comp rejiggering commit #6:
* border->fx REMOVED, related border api REMOVED
* comp edc has new class of groups: e/comp/effects[/auto]
** these are effects which can be applied to any compositor object through the e_comp_win_effect* api and are written in embryo
*** two types - base and auto - base = manual, for use with animators; auto are "trigger and forget", for use as actual effects
* desk flip transition animations moved to comp effects and FIXED(ish)
* "zoom" effect renamed to "diagonal" for slightly less misleading name since it never did any zooming
* actual "zoom" effect added
* border hierarchy now as follows: cw->effect_obj swallows cw->shobj, cw->shobj swallows cw->bd->bg_object ?: cw->obj, if (cw->bd->bg_object) cw->bd->bg_object swallows cw->obj
** cw->effect_obj now used for all positioning and comp logic
** cw->effect_obj ONLY used for object transformation effects (moving, zooming, fading, etc)
** cw->shobj ONLY for comp visual/non-movement effects (focus effect, unfocus opacity, legacy shadows); this is a candidate for removal/rewrite in E19
* even more comp shape rewrites
* desk flip animation time now controlled by theme since edje doesn't support setting transition time in C; related config value removed
* desk flip transitions (in e_desk.c) rewritten
* various modules (evry/illume2) updated to use comp effects instead of fx offset
* desk flip configuration BROKEN(ish)
2013-02-28 07:20:32 -08:00
2013-02-22 01:33:06 -08:00
EAPI E_Comp_Win * e_comp_win_find_client_win ( Ecore_X_Window win ) ;
2013-02-07 05:19:47 -08:00
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 ) ;
2013-02-22 01:33:13 -08:00
EAPI void e_comp_win_opacity_set ( E_Comp_Win * cw , unsigned int opacity ) ;
2013-02-07 05:19:47 -08:00
EAPI E_Comp * e_comp_get ( void * o ) ;
2013-04-26 00:21:37 -07:00
EAPI void e_comp_populate ( E_Comp * c ) ;
2013-02-07 05:19:47 -08:00
2013-05-21 05:52:11 -07:00
EAPI Ecore_X_Window e_comp_top_window_at_xy_get ( E_Comp * c , Evas_Coord x , Evas_Coord y , Eina_Bool vis , Ecore_X_Window * ignore , unsigned int ignore_num ) ;
2013-02-07 05:20:07 -08:00
2013-02-18 05:43:47 -08:00
/* for injecting objects into the comp layout */
EAPI E_Comp_Win * e_comp_object_inject ( E_Comp * c , Evas_Object * obj , E_Object * eobj , E_Layer layer ) ;
/* for giving objects the comp theme and such without injecting into layout */
EAPI E_Comp_Win * e_comp_object_add ( E_Comp * c , Evas_Object * obj , E_Object * eobj ) ;
2013-02-18 05:43:22 -08:00
2013-02-18 05:43:47 -08:00
EAPI void e_comp_win_move ( E_Comp_Win * cw , Evas_Coord x , Evas_Coord y ) ;
EAPI void e_comp_win_resize ( E_Comp_Win * cw , int w , int h ) ;
EAPI void e_comp_win_moveresize ( E_Comp_Win * cw , Evas_Coord x , Evas_Coord y , int w , int h ) ;
EAPI void e_comp_win_hide ( E_Comp_Win * cw ) ;
EAPI void e_comp_win_show ( E_Comp_Win * cw ) ;
EAPI void e_comp_win_del ( E_Comp_Win * cw ) ;
2013-02-25 06:04:12 -08:00
EAPI void e_comp_win_reshadow ( E_Comp_Win * cw ) ;
2013-02-07 05:20:07 -08:00
2013-02-18 05:43:47 -08:00
EAPI void e_comp_ignore_win_add ( Ecore_X_Window win ) ;
# define E_LAYER_SET(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_NONE)
# define E_LAYER_SET_UNDER(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_UNDER)
# define E_LAYER_SET_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_ABOVE)
# define E_LAYER_LAYOUT_ADD(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_NONE)
# define E_LAYER_LAYOUT_ADD_UNDER(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_UNDER)
# define E_LAYER_LAYOUT_ADD_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_ABOVE)
2013-02-25 06:04:12 -08:00
EAPI E_Comp_Win * e_comp_canvas_layer_set ( Evas_Object * obj , E_Comp_Canvas_Layer comp_layer , E_Layer layer , E_Comp_Canvas_Stack stack ) ;
2013-02-20 02:51:58 -08:00
EAPI unsigned int e_comp_e_object_layer_get ( const E_Object * obj ) ;
2013-02-18 05:43:47 -08:00
static inline E_Comp *
e_comp_util_evas_object_comp_get ( Evas_Object * obj )
2013-02-07 05:20:07 -08:00
{
2013-02-18 05:43:47 -08:00
return ecore_evas_data_get ( ecore_evas_ecore_evas_get ( evas_object_evas_get ( obj ) ) , " comp " ) ;
2013-02-07 05:20:07 -08:00
}
2013-02-07 05:19:47 -08:00
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 ;
}
2013-01-18 04:47:14 -08:00
2013-02-18 05:43:47 -08:00
static inline void
e_comp_win_ignore_events_set ( E_Comp_Win * cw , Eina_Bool ignore )
{
EINA_SAFETY_ON_NULL_RETURN ( cw ) ;
ignore = ! ! ignore ;
2013-05-23 02:42:51 -07:00
evas_object_pass_events_set ( cw - > effect_obj , ignore ) ;
2013-02-18 05:43:47 -08:00
}
2013-02-20 02:51:58 -08:00
static inline unsigned int
e_comp_e_object_layer_effective_get ( const E_Object * obj )
{
unsigned int layer ;
layer = e_comp_e_object_layer_get ( obj ) ;
if ( ( layer > E_COMP_CANVAS_LAYER_LAYOUT ) & & ( layer < E_COMP_CANVAS_LAYER_POPUP ) )
layer = E_COMP_CANVAS_LAYER_LAYOUT ;
return layer ;
}
2013-02-18 05:43:47 -08:00
EAPI void e_comp_util_wins_print ( const E_Comp * c ) ;
2010-01-04 04:27:15 -08:00
# endif
# endif