From 8cacf8429d401b03cdc38ce538b66ab4a953da96 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 9 Jan 2013 11:34:07 +0000 Subject: [PATCH] e: merge comp module into core * Move compositor to core, but letting the configuration there * Rename all files and functions from e_mod_comp_* to e_comp_* * Move the config dialogs to a new module named conf_comp. It still uses a domain config, otherwise it would not pick the current user's configuration. Maybe it would be wise to later on move these options to e_config * Fixup the wizard mess linking the header in the build tree in order to be able to create the config. Since now it's in core, we don't need to play linking games in the build system I'm not sure if the wayland part works. It was not even building previously so I'll let for who cares about this to actually test and report bugs. SVN revision: 82454 --- configure.ac | 4 +- po/POTFILES.in | 10 +- src/bin/Makefile.am | 33 +- .../comp/e_mod_comp.c => bin/e_comp.c} | 1826 ++++++++--------- .../comp/e_mod_comp.h => bin/e_comp.h} | 17 +- .../e_comp_cfdata.c} | 84 +- .../e_comp_cfdata.h} | 23 +- .../e_comp_update.c} | 27 +- src/bin/e_comp_update.h | 46 + .../comp/e_mod_comp_wl.c => bin/e_comp_wl.c} | 55 +- .../comp/e_mod_comp_wl.h => bin/e_comp_wl.h} | 20 +- .../e_comp_wl_buffer.c} | 15 +- src/bin/e_comp_wl_buffer.h | 10 + .../e_comp_wl_comp.c} | 191 +- src/bin/e_comp_wl_comp.h | 12 + .../e_comp_wl_input.c} | 55 +- src/bin/e_comp_wl_input.h | 11 + .../e_comp_wl_output.c} | 17 +- src/bin/e_comp_wl_output.h | 11 + .../e_comp_wl_region.c} | 13 +- src/bin/e_comp_wl_region.h | 11 + src/bin/e_comp_wl_shell.c | 475 +++++ src/bin/e_comp_wl_shell.h | 11 + .../e_comp_wl_surface.c} | 97 +- src/bin/e_comp_wl_surface.h | 20 + src/bin/e_includes.h | 3 + src/bin/e_main.c | 7 +- src/modules/Makefile.am | 8 +- src/modules/Makefile_comp.am | 45 - src/modules/Makefile_conf_comp.am | 17 + src/modules/Makefile_wizard.am | 20 - src/modules/comp/e_mod_comp_update.h | 47 - src/modules/comp/e_mod_comp_wl_buffer.h | 10 - src/modules/comp/e_mod_comp_wl_comp.h | 12 - src/modules/comp/e_mod_comp_wl_input.h | 11 - src/modules/comp/e_mod_comp_wl_output.h | 11 - src/modules/comp/e_mod_comp_wl_region.h | 11 - src/modules/comp/e_mod_comp_wl_shell.c | 476 ----- src/modules/comp/e_mod_comp_wl_shell.h | 11 - src/modules/comp/e_mod_comp_wl_surface.h | 20 - .../{comp => conf_comp}/e-module-comp.edj | Bin .../{comp => conf_comp}/e_mod_config.c | 43 +- .../{comp => conf_comp}/e_mod_config.h | 0 src/modules/{comp => conf_comp}/e_mod_main.c | 41 +- src/modules/{comp => conf_comp}/e_mod_main.h | 4 +- .../{comp => conf_comp}/module.desktop.in | 0 src/modules/wizard/page_150.c | 18 +- 47 files changed, 1932 insertions(+), 1977 deletions(-) rename src/{modules/comp/e_mod_comp.c => bin/e_comp.c} (71%) rename src/{modules/comp/e_mod_comp.h => bin/e_comp.h} (56%) rename src/{modules/comp/e_mod_comp_cfdata.c => bin/e_comp_cfdata.c} (85%) rename src/{modules/comp/e_mod_comp_cfdata.h => bin/e_comp_cfdata.h} (85%) rename src/{modules/comp/e_mod_comp_update.c => bin/e_comp_update.c} (91%) create mode 100644 src/bin/e_comp_update.h rename src/{modules/comp/e_mod_comp_wl.c => bin/e_comp_wl.c} (78%) rename src/{modules/comp/e_mod_comp_wl.h => bin/e_comp_wl.h} (93%) rename src/{modules/comp/e_mod_comp_wl_buffer.c => bin/e_comp_wl_buffer.c} (81%) create mode 100644 src/bin/e_comp_wl_buffer.h rename src/{modules/comp/e_mod_comp_wl_comp.c => bin/e_comp_wl_comp.c} (71%) create mode 100644 src/bin/e_comp_wl_comp.h rename src/{modules/comp/e_mod_comp_wl_input.c => bin/e_comp_wl_input.c} (69%) create mode 100644 src/bin/e_comp_wl_input.h rename src/{modules/comp/e_mod_comp_wl_output.c => bin/e_comp_wl_output.c} (82%) create mode 100644 src/bin/e_comp_wl_output.h rename src/{modules/comp/e_mod_comp_wl_region.c => bin/e_comp_wl_region.c} (51%) create mode 100644 src/bin/e_comp_wl_region.h create mode 100644 src/bin/e_comp_wl_shell.c create mode 100644 src/bin/e_comp_wl_shell.h rename src/{modules/comp/e_mod_comp_wl_surface.c => bin/e_comp_wl_surface.c} (66%) create mode 100644 src/bin/e_comp_wl_surface.h delete mode 100644 src/modules/Makefile_comp.am create mode 100644 src/modules/Makefile_conf_comp.am delete mode 100644 src/modules/comp/e_mod_comp_update.h delete mode 100644 src/modules/comp/e_mod_comp_wl_buffer.h delete mode 100644 src/modules/comp/e_mod_comp_wl_comp.h delete mode 100644 src/modules/comp/e_mod_comp_wl_input.h delete mode 100644 src/modules/comp/e_mod_comp_wl_output.h delete mode 100644 src/modules/comp/e_mod_comp_wl_region.h delete mode 100644 src/modules/comp/e_mod_comp_wl_shell.c delete mode 100644 src/modules/comp/e_mod_comp_wl_shell.h delete mode 100644 src/modules/comp/e_mod_comp_wl_surface.h rename src/modules/{comp => conf_comp}/e-module-comp.edj (100%) rename src/modules/{comp => conf_comp}/e_mod_config.c (98%) rename src/modules/{comp => conf_comp}/e_mod_config.h (100%) rename src/modules/{comp => conf_comp}/e_mod_main.c (84%) rename src/modules/{comp => conf_comp}/e_mod_main.h (93%) rename src/modules/{comp => conf_comp}/module.desktop.in (100%) diff --git a/configure.ac b/configure.ac index 2b2496a96..77277c08e 100644 --- a/configure.ac +++ b/configure.ac @@ -846,6 +846,7 @@ AC_E_OPTIONAL_MODULE([fileman_opinfo], true) AC_E_OPTIONAL_MODULE([wizard], true) AC_E_OPTIONAL_MODULE([conf], true) AC_E_OPTIONAL_MODULE([conf2], $have_elementary) +AC_E_OPTIONAL_MODULE([conf_comp], true) AC_E_OPTIONAL_MODULE([conf_wallpaper2], true) AC_E_OPTIONAL_MODULE([conf_theme], true, true) AC_E_OPTIONAL_MODULE([conf_intl], true) @@ -871,7 +872,6 @@ AC_E_OPTIONAL_MODULE([syscon], true) AC_E_OPTIONAL_MODULE([everything], true) AC_E_OPTIONAL_MODULE([systray], true) AC_E_OPTIONAL_MODULE([appmenu], true) -AC_E_OPTIONAL_MODULE([comp], true) AC_E_OPTIONAL_MODULE([physics], true, [CHECK_MODULE_PHYSICS]) AC_E_OPTIONAL_MODULE([quickaccess], true) AC_E_OPTIONAL_MODULE([shot], true) @@ -981,7 +981,7 @@ src/modules/everything/module.desktop src/modules/everything/everything.pc src/modules/systray/module.desktop src/modules/appmenu/module.desktop -src/modules/comp/module.desktop +src/modules/conf_comp/module.desktop src/modules/physics/module.desktop src/modules/quickaccess/module.desktop src/modules/shot/module.desktop diff --git a/po/POTFILES.in b/po/POTFILES.in index 7268424f6..04b47f6da 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -136,12 +136,10 @@ src/modules/battery/e_mod_config.c src/modules/battery/e_mod_main.c src/modules/clock/e_mod_config.c src/modules/clock/e_mod_main.c -src/modules/comp/e_mod_comp.c -src/modules/comp/e_mod_config.c -src/modules/comp/e_mod_main.c -src/modules/conf/e_conf.c -src/modules/conf/e_mod_config.c -src/modules/conf/e_mod_main.c +src/modules/conf_comp/e_mod_config.c +src/modules/conf_comp/e_mod_main.c +src/modules/conf_comp/e_mod_config.c +src/modules/conf_comp/e_mod_main.c src/modules/conf_applications/e_int_config_apps.c src/modules/conf_applications/e_int_config_apps_personal.c src/modules/conf_applications/e_int_config_defapps.c diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 6f35f17ce..e8ab4127b 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -55,6 +55,9 @@ e_canvas.h \ e_color_class.h \ e_color_dialog.h \ e_color.h \ +e_comp.h \ +e_comp_cfdata.h \ +e_comp_update.h \ e_config_data.h \ e_config_dialog.h \ e_config.h \ @@ -199,6 +202,18 @@ e_xkb.h \ e_xsettings.h \ e_zone.h +if HAVE_WAYLAND_CLIENTS +ENLIGHTENMENTHEADERS += \ +e_comp_wl.h \ +e_comp_wl_buffer.h \ +e_comp_wl_comp.h \ +e_comp_wl_input.h \ +e_comp_wl_output.h \ +e_comp_wl_region.h \ +e_comp_wl_shell.h \ +e_comp_wl_surface.h +endif + enlightenment_src = \ e_about.c \ @@ -215,6 +230,9 @@ e_canvas.c \ e_color.c \ e_color_class.c \ e_color_dialog.c \ +e_comp.c \ +e_comp_cfdata.c \ +e_comp_update.c \ e_config.c \ e_config_data.c \ e_config_dialog.c \ @@ -363,13 +381,26 @@ e_xsettings.c \ e_zone.c \ $(ENLIGHTENMENTHEADERS) +if HAVE_WAYLAND_CLIENTS +enlightenment_src += \ +e_comp_wl.c \ +e_comp_wl_buffer.c \ +e_comp_wl_comp.c \ +e_comp_wl_input.c \ +e_comp_wl_output.c \ +e_comp_wl_region.c \ +e_comp_wl_shell.c \ +e_comp_wl_surface.c +endif + +enlightenment_CFLAGS = $(AM_CPPFLAGS) @WAYLAND_CFLAGS@ enlightenment_CPPFLAGS = $(AM_CPPFLAGS) -DE_LOGGING=1 enlightenment_SOURCES = \ e_main.c \ $(enlightenment_src) enlightenment_LDFLAGS = -export-dynamic -enlightenment_LDADD = @e_libs@ @ELM_LIBS@ @EMOTION_LIBS@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ -lm +enlightenment_LDADD = @e_libs@ @ELM_LIBS@ @EMOTION_LIBS@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ -lm enlightenment_imc_SOURCES = \ e.h \ diff --git a/src/modules/comp/e_mod_comp.c b/src/bin/e_comp.c similarity index 71% rename from src/modules/comp/e_mod_comp.c rename to src/bin/e_comp.c index 265ef525e..c6e8835ce 100644 --- a/src/modules/comp/e_mod_comp.c +++ b/src/bin/e_comp.c @@ -1,9 +1,9 @@ #include "e.h" -#include "e_mod_main.h" -#include "e_mod_comp.h" -#include "e_mod_comp_update.h" +#include "e_comp.h" +#include "e_comp_cfdata.h" +#include "e_comp_update.h" #ifdef HAVE_WAYLAND_CLIENTS -#include "e_mod_comp_wl.h" +#include "e_comp_wl.h" #endif #define OVER_FLOW 1 @@ -52,7 +52,7 @@ struct _E_Comp int frameskip; int nocomp_override; - + E_Manager_Comp comp; Ecore_X_Window cm_selection; @@ -152,7 +152,7 @@ struct _E_Comp_Win 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 }; @@ -162,6 +162,10 @@ static Eina_Hash *windows = NULL; static Eina_Hash *borders = NULL; static Eina_Hash *damages = NULL; +static E_Comp_Config *conf = NULL; +static E_Config_DD *conf_edd = NULL; +static E_Config_DD *conf_match_edd = NULL; + ////////////////////////////////////////////////////////////////////////// #undef DBG #if 0 @@ -170,30 +174,24 @@ static Eina_Hash *damages = NULL; #define DBG(f, x ...) #endif -static void _e_mod_comp_win_ready_timeout_setup(E_Comp_Win *cw); -static void _e_mod_comp_render_queue(E_Comp *c); -static void _e_mod_comp_win_damage(E_Comp_Win *cw, - int x, - int y, - int w, - int h, - Eina_Bool dmg); -static void _e_mod_comp_win_render_queue(E_Comp_Win *cw); -static void _e_mod_comp_win_release(E_Comp_Win *cw); -static void _e_mod_comp_win_adopt(E_Comp_Win *cw); -static void _e_mod_comp_win_del(E_Comp_Win *cw); -static void _e_mod_comp_win_show(E_Comp_Win *cw); -static void _e_mod_comp_win_real_hide(E_Comp_Win *cw); -static void _e_mod_comp_win_hide(E_Comp_Win *cw); -static void _e_mod_comp_win_configure(E_Comp_Win *cw, - int x, - int y, - int w, - int h, - int border); +static void _e_comp_win_ready_timeout_setup(E_Comp_Win *cw); +static void _e_comp_render_queue(E_Comp *c); +static void _e_comp_win_damage(E_Comp_Win *cw, + int x, int y, int w, int h, + Eina_Bool dmg); +static void _e_comp_win_render_queue(E_Comp_Win *cw); +static void _e_comp_win_release(E_Comp_Win *cw); +static void _e_comp_win_adopt(E_Comp_Win *cw); +static void _e_comp_win_del(E_Comp_Win *cw); +static void _e_comp_win_show(E_Comp_Win *cw); +static void _e_comp_win_real_hide(E_Comp_Win *cw); +static void _e_comp_win_hide(E_Comp_Win *cw); +static void _e_comp_win_configure(E_Comp_Win *cw, + int x, int y, int w, int h, + int border); static void -_e_mod_comp_child_show(E_Comp_Win *cw) +_e_comp_child_show(E_Comp_Win *cw) { evas_object_show(cw->shobj); if (cw->bd) @@ -214,7 +212,7 @@ _e_mod_comp_child_show(E_Comp_Win *cw) } static void -_e_mod_comp_child_hide(E_Comp_Win *cw) +_e_comp_child_hide(E_Comp_Win *cw) { evas_object_hide(cw->shobj); if (cw->bd) @@ -235,9 +233,9 @@ _e_mod_comp_child_hide(E_Comp_Win *cw) } static void -_e_mod_comp_cb_pending_after(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_cb_pending_after(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { E_Comp_Win *cw = (E_Comp_Win *)src; cw->pending_count--; @@ -249,7 +247,7 @@ _e_mod_comp_cb_pending_after(void *data __UNUSED__, } static E_Comp_Win * -_e_mod_comp_fullscreen_check(E_Comp *c) +_e_comp_fullscreen_check(E_Comp *c) { E_Comp_Win *cw; @@ -262,7 +260,7 @@ _e_mod_comp_fullscreen_check(E_Comp *c) ((cw->x + cw->w) >= c->man->w) && ((cw->y + cw->h) >= c->man->h) && (!cw->argb) && (!cw->shaped) - ) + ) { return cw; } @@ -272,10 +270,10 @@ _e_mod_comp_fullscreen_check(E_Comp *c) } static inline Eina_Bool -_e_mod_comp_shaped_check(int w, - int h, - const Ecore_X_Rectangle *rects, - int num) +_e_comp_shaped_check(int w, + int h, + const Ecore_X_Rectangle *rects, + int num) { if ((!rects) || (num < 1)) return EINA_FALSE; if (num > 1) return EINA_TRUE; @@ -286,24 +284,24 @@ _e_mod_comp_shaped_check(int w, } static inline Eina_Bool -_e_mod_comp_win_shaped_check(const E_Comp_Win *cw, - const Ecore_X_Rectangle *rects, - int num) +_e_comp_win_shaped_check(const E_Comp_Win *cw, + const Ecore_X_Rectangle *rects, + int num) { - return _e_mod_comp_shaped_check(cw->w, cw->h, rects, num); + return _e_comp_shaped_check(cw->w, cw->h, rects, num); } static void -_e_mod_comp_win_shape_rectangles_apply(E_Comp_Win *cw, - const Ecore_X_Rectangle *rects, - int num) +_e_comp_win_shape_rectangles_apply(E_Comp_Win *cw, + const Ecore_X_Rectangle *rects, + int num) { Eina_List *l; Evas_Object *o; int i; DBG("SHAPE [0x%x] change, rects=%p (%d)\n", cw->win, rects, num); - if (!_e_mod_comp_win_shaped_check(cw, rects, num)) + if (!_e_comp_win_shaped_check(cw, rects, num)) { rects = NULL; } @@ -366,8 +364,8 @@ _e_mod_comp_win_shape_rectangles_apply(E_Comp_Win *cw, imask |= imask >> 8; imask |= imask >> 8; *p = mask | (*p & imask); -// if (*sp) *p = 0xff000000 | *p; -// else *p = 0x00000000; + // if (*sp) *p = 0xff000000 | *p; + // else *p = 0x00000000; sp++; p++; } @@ -431,7 +429,7 @@ _e_mod_comp_win_shape_rectangles_apply(E_Comp_Win *cw, } static Eina_Bool -_e_mod_comp_cb_win_show_ready_timeout(void *data) +_e_comp_cb_win_show_ready_timeout(void *data) { E_Comp_Win *cw = data; cw->show_ready = 1; @@ -447,14 +445,14 @@ _e_mod_comp_cb_win_show_ready_timeout(void *data) cw->update = 1; cw->c->updates = eina_list_append(cw->c->updates, cw); } - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); } cw->ready_timeout = NULL; return ECORE_CALLBACK_CANCEL; } static void -_e_mod_comp_win_ready_timeout_setup(E_Comp_Win *cw) +_e_comp_win_ready_timeout_setup(E_Comp_Win *cw) { if (cw->ready_timeout) { @@ -463,7 +461,7 @@ _e_mod_comp_win_ready_timeout_setup(E_Comp_Win *cw) } if (cw->show_ready) return; if (cw->counter) return; -// FIXME: make show_ready option + // FIXME: make show_ready option if (0) { cw->show_ready = 1; @@ -471,28 +469,28 @@ _e_mod_comp_win_ready_timeout_setup(E_Comp_Win *cw) else { cw->ready_timeout = ecore_timer_add - (_comp_mod->conf->first_draw_delay, _e_mod_comp_cb_win_show_ready_timeout, cw); + (conf->first_draw_delay, _e_comp_cb_win_show_ready_timeout, cw); } } static void -_e_mod_comp_win_layout_populate(E_Comp_Win *cw) +_e_comp_win_layout_populate(E_Comp_Win *cw) { e_layout_pack(cw->c->layout, cw->shobj); } static void -_e_mod_comp_win_restack(E_Comp_Win *cw) +_e_comp_win_restack(E_Comp_Win *cw) { Eina_Inlist *prev, *next; Eina_List *l; E_Comp_Win *cwp = NULL, *cwn = NULL; - + next = EINA_INLIST_GET(cw)->next; if (next) cwn = EINA_INLIST_CONTAINER_GET(next, E_Comp_Win); prev = EINA_INLIST_GET(cw)->prev; if (prev) cwp = EINA_INLIST_CONTAINER_GET(prev, E_Comp_Win); - + if (cwp) e_layout_child_raise_above(cw->shobj, cwp->shobj); else if (cwn) @@ -514,14 +512,14 @@ _e_mod_comp_win_restack(E_Comp_Win *cw) } static void -_e_mod_comp_win_geometry_update(E_Comp_Win *cw) +_e_comp_win_geometry_update(E_Comp_Win *cw) { e_layout_child_move(cw->shobj, cw->x, cw->y); e_layout_child_resize(cw->shobj, cw->pw, cw->ph); } static void -_e_mod_comp_win_update(E_Comp_Win *cw) +_e_comp_win_update(E_Comp_Win *cw) { Eina_List *l; Evas_Object *o; @@ -530,7 +528,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw) int pshaped = cw->shaped; DBG("UPDATE [0x%x] pm = %x\n", cw->win, cw->pixmap); - if (_comp_mod->conf->grab) ecore_x_grab(); + if (conf->grab) ecore_x_grab(); cw->update = 0; if (cw->argb) @@ -565,7 +563,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw) 0, 0, (int)cw->w, (int)cw->h); } } - if (!_e_mod_comp_win_shaped_check(cw, cw->rects, cw->rects_num)) + if (!_e_comp_win_shaped_check(cw, cw->rects, cw->rects_num)) { E_FREE(cw->rects); cw->rects_num = 0; @@ -586,10 +584,10 @@ _e_mod_comp_win_update(E_Comp_Win *cw) { Ecore_X_Pixmap pm = 0; -/* #ifdef HAVE_WAYLAND_CLIENTS */ -/* if ((cw->bd) && (cw->bd->borderless)) */ -/* pm = e_mod_comp_wl_pixmap_get(cw->win); */ -/* #endif */ + /* #ifdef HAVE_WAYLAND_CLIENTS */ + /* if ((cw->bd) && (cw->bd->borderless)) */ + /* pm = e_comp_wl_pixmap_get(cw->win); */ + /* #endif */ if (!pm) pm = ecore_x_composite_name_window_pixmap_get(cw->win); if (pm) { @@ -602,9 +600,9 @@ _e_mod_comp_win_update(E_Comp_Win *cw) if (cw->pixmap) { ecore_x_pixmap_geometry_get(cw->pixmap, NULL, NULL, &(cw->pw), &(cw->ph)); - _e_mod_comp_win_ready_timeout_setup(cw); + _e_comp_win_ready_timeout_setup(cw); if ((cw->pw > 0) && (cw->ph > 0)) - _e_mod_comp_win_geometry_update(cw); + _e_comp_win_geometry_update(cw); } else { @@ -629,7 +627,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw) DBG(" [0x%x] free pixmap\n", cw->win); ecore_x_pixmap_free(cw->pixmap); cw->pixmap = 0; -// cw->show_ready = 0; // hmm maybe not needed? + // cw->show_ready = 0; // hmm maybe not needed? } cw->pw = 0; cw->ph = 0; @@ -637,47 +635,47 @@ _e_mod_comp_win_update(E_Comp_Win *cw) ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); cw->native = 0; DBG(" [0x%x] up resize %ix%i\n", cw->win, cw->pw, cw->ph); - e_mod_comp_update_resize(cw->up, cw->pw, cw->ph); - e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + e_comp_update_resize(cw->up, cw->pw, cw->ph); + e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); if (oldpm) { DBG(" [0x%x] free pm %x\n", cw->win, oldpm); // XXX the below is unreachable code! :) -/* - if (cw->native) - { - cw->native = 0; - if (!((cw->pw > 0) && (cw->ph > 0))) - { - evas_object_image_native_surface_set(cw->obj, NULL); - EINA_LIST_FOREACH(cw->obj_mirror, l, o) - { - evas_object_image_native_surface_set(o, NULL); - } - } - } - */ + /* + if (cw->native) + { + cw->native = 0; + if (!((cw->pw > 0) && (cw->ph > 0))) + { + evas_object_image_native_surface_set(cw->obj, NULL); + EINA_LIST_FOREACH(cw->obj_mirror, l, o) + { + evas_object_image_native_surface_set(o, NULL); + } + } + } + */ ecore_x_pixmap_free(oldpm); } } } if (!((cw->pw > 0) && (cw->ph > 0))) { - if (_comp_mod->conf->grab) ecore_x_ungrab(); + if (conf->grab) ecore_x_ungrab(); return; } -// evas_object_move(cw->shobj, cw->x, cw->y); + // evas_object_move(cw->shobj, cw->x, cw->y); // was cw->w / cw->h -// evas_object_resize(cw->shobj, cw->pw, cw->ph); - _e_mod_comp_win_geometry_update(cw); + // evas_object_resize(cw->shobj, cw->pw, cw->ph); + _e_comp_win_geometry_update(cw); - if ((cw->c->gl) && (_comp_mod->conf->texture_from_pixmap) && + if ((cw->c->gl) && (conf->texture_from_pixmap) && (!cw->shaped) && (!cw->rects) && (cw->pixmap)) { -/* #ifdef HAVE_WAYLAND_CLIENTS */ -/* DBG("DEBUG - pm now %x\n", e_mod_comp_wl_pixmap_get(cw->win)); */ -/* #endif */ + /* #ifdef HAVE_WAYLAND_CLIENTS */ + /* DBG("DEBUG - pm now %x\n", e_comp_wl_pixmap_get(cw->win)); */ + /* #endif */ /* DBG("DEBUG - pm now %x\n", ecore_x_composite_name_window_pixmap_get(cw->win)); */ evas_object_image_size_set(cw->obj, cw->pw, cw->ph); EINA_LIST_FOREACH(cw->obj_mirror, l, o) @@ -700,10 +698,10 @@ _e_mod_comp_win_update(E_Comp_Win *cw) evas_object_image_native_surface_set(o, &ns); } } - r = e_mod_comp_update_rects_get(cw->up); + r = e_comp_update_rects_get(cw->up); if (r) { - e_mod_comp_update_clear(cw->up); + e_comp_update_clear(cw->up); for (i = 0; r[i].w > 0; i++) { int x, y, w, h; @@ -722,7 +720,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw) else { DBG("UPDATE [0x%x] NO RECTS!!! %i %i - %i %i\n", cw->win, cw->up->w, cw->up->h, cw->up->tw, cw->up->th); -// cw->update = 1; + // cw->update = 1; } } else if (cw->pixmap) @@ -755,9 +753,9 @@ _e_mod_comp_win_update(E_Comp_Win *cw) if (!cw->xim) { if ((cw->xim = ecore_x_image_new(cw->pw, cw->ph, cw->vis, cw->depth))) - e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); } - r = e_mod_comp_update_rects_get(cw->up); + r = e_comp_update_rects_get(cw->up); if (r) { if (cw->xim) @@ -765,7 +763,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw) if (ecore_x_image_is_argb32_get(cw->xim)) { unsigned int *pix; - + pix = ecore_x_image_data_get(cw->xim, NULL, NULL, NULL); evas_object_image_data_set(cw->obj, pix); evas_object_image_size_set(cw->obj, cw->pw, cw->ph); @@ -774,18 +772,18 @@ _e_mod_comp_win_update(E_Comp_Win *cw) evas_object_image_data_set(o, pix); evas_object_image_size_set(o, cw->pw, cw->ph); } - - e_mod_comp_update_clear(cw->up); + + e_comp_update_clear(cw->up); for (i = 0; r[i].w > 0; i++) { int x, y, w, h; - + x = r[i].x; y = r[i].y; w = r[i].w; h = r[i].h; if (!ecore_x_image_get(cw->xim, cw->pixmap, x, y, x, y, w, h)) { DBG("UPDATE [0x%x] %i %i %ix%i FAIL!!!!!!!!!!!!!!!!!\n", cw->win, x, y, w, h); - e_mod_comp_update_add(cw->up, x, y, w, h); + e_comp_update_add(cw->up, x, y, w, h); cw->update = 1; } else @@ -807,7 +805,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw) { unsigned int *pix; int stride; - + evas_object_image_size_set(cw->obj, cw->pw, cw->ph); pix = evas_object_image_data_get(cw->obj, EINA_TRUE); stride = evas_object_image_stride_get(cw->obj); @@ -816,18 +814,18 @@ _e_mod_comp_win_update(E_Comp_Win *cw) evas_object_image_data_set(o, pix); evas_object_image_size_set(o, cw->pw, cw->ph); } - - e_mod_comp_update_clear(cw->up); + + e_comp_update_clear(cw->up); for (i = 0; r[i].w > 0; i++) { int x, y, w, h; - + x = r[i].x; y = r[i].y; w = r[i].w; h = r[i].h; if (!ecore_x_image_get(cw->xim, cw->pixmap, x, y, x, y, w, h)) { DBG("UPDATE [0x%x] %i %i %ix%i FAIL!!!!!!!!!!!!!!!!!\n", cw->win, x, y, w, h); - e_mod_comp_update_add(cw->up, x, y, w, h); + e_comp_update_add(cw->up, x, y, w, h); cw->update = 1; } else @@ -836,7 +834,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw) int srcbpp = 0, srcbpl = 0; // why do we neeed these 2? this smells wrong srcpix = ecore_x_image_data_get - (cw->xim, &srcbpl, NULL, &srcbpp); + (cw->xim, &srcbpl, NULL, &srcbpp); ecore_x_image_to_argb_convert(srcpix, srcbpp, srcbpl, @@ -860,32 +858,32 @@ _e_mod_comp_win_update(E_Comp_Win *cw) free(r); if (cw->shaped) { - _e_mod_comp_win_shape_rectangles_apply(cw, cw->rects, cw->rects_num); + _e_comp_win_shape_rectangles_apply(cw, cw->rects, cw->rects_num); } else { if (cw->shape_changed) - _e_mod_comp_win_shape_rectangles_apply(cw, cw->rects, cw->rects_num); + _e_comp_win_shape_rectangles_apply(cw, cw->rects, cw->rects_num); } cw->shape_changed = 0; } else { DBG("UPDATE [0x%x] NO RECTS!!! %i %i - %i %i\n", cw->win, cw->up->w, cw->up->h, cw->up->tw, cw->up->th); -// causes updates to be flagged when not needed - disabled -// cw->update = 1; + // causes updates to be flagged when not needed - disabled + // cw->update = 1; } } -// FIXME: below cw update check screws with show + // FIXME: below cw update check screws with show if (/*(!cw->update) &&*/ (cw->visible) && (cw->dmg_updates >= 1) && - (cw->show_ready) && (!cw->bd || cw->bd->visible)) + (cw->show_ready) && (!cw->bd || cw->bd->visible)) { if (!evas_object_visible_get(cw->shobj)) { if (!cw->hidden_override) { - _e_mod_comp_child_show(cw); - _e_mod_comp_win_render_queue(cw); + _e_comp_child_show(cw); + _e_comp_win_render_queue(cw); } if (!cw->show_anim) @@ -900,8 +898,8 @@ _e_mod_comp_win_update(E_Comp_Win *cw) cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); cw->show_anim = EINA_TRUE; } @@ -918,16 +916,16 @@ _e_mod_comp_win_update(E_Comp_Win *cw) } } - if (_comp_mod->conf->grab) ecore_x_ungrab(); + if (conf->grab) ecore_x_ungrab(); } static void -_e_mod_comp_pre_swap(void *data, - Evas *e __UNUSED__) +_e_comp_pre_swap(void *data, + Evas *e __UNUSED__) { E_Comp *c = data; - if (_comp_mod->conf->grab) + if (conf->grab) { if (c->grabbed) { @@ -938,18 +936,18 @@ _e_mod_comp_pre_swap(void *data, } static Eina_Bool -_e_mod_comp_cb_delayed_update_timer(void *data) +_e_comp_cb_delayed_update_timer(void *data) { E_Comp *c = data; - _e_mod_comp_render_queue(c); + _e_comp_render_queue(c); c->new_up_timer = NULL; return ECORE_CALLBACK_CANCEL; } static void -_e_mod_comp_fps_update(E_Comp *c) +_e_comp_fps_update(E_Comp *c) { - if (_comp_mod->conf->fps_show) + if (conf->fps_show) { if (!c->fps_bg) { @@ -982,11 +980,11 @@ _e_mod_comp_fps_update(E_Comp *c) } static void -_e_mod_comp_win_release(E_Comp_Win *cw) +_e_comp_win_release(E_Comp_Win *cw) { Eina_List *l; Evas_Object *o; - + if (cw->xim) { evas_object_image_size_set(cw->obj, 1, 1); @@ -1016,8 +1014,8 @@ _e_mod_comp_win_release(E_Comp_Win *cw) } if (cw->redirected) { -// we redirect all subwindows anyway -// ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); + // we redirect all subwindows anyway + // ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); cw->redirected = 0; } if (cw->damage) @@ -1034,12 +1032,12 @@ _e_mod_comp_win_release(E_Comp_Win *cw) } static void -_e_mod_comp_win_adopt(E_Comp_Win *cw) +_e_comp_win_adopt(E_Comp_Win *cw) { if (!cw->damage) { cw->damage = ecore_x_damage_new - (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); + (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); eina_hash_add(damages, e_util_winid_str_get(cw->damage), cw); } if (!cw->update) @@ -1048,40 +1046,40 @@ _e_mod_comp_win_adopt(E_Comp_Win *cw) cw->c->updates = eina_list_append(cw->c->updates, cw); } cw->redirected = 1; - e_mod_comp_update_resize(cw->up, cw->pw, cw->ph); - e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); - _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); - _e_mod_comp_win_render_queue(cw); + e_comp_update_resize(cw->up, cw->pw, cw->ph); + e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + _e_comp_win_render_queue(cw); } static void -_e_mod_comp_cb_nocomp_begin(E_Comp *c) +_e_comp_cb_nocomp_begin(E_Comp *c) { E_Comp_Win *cw, *cwf; - + if (c->nocomp) return; - + if (c->nocomp_delay_timer) { ecore_timer_del(c->nocomp_delay_timer); c->nocomp_delay_timer = NULL; } - cwf = _e_mod_comp_fullscreen_check(c); + cwf = _e_comp_fullscreen_check(c); if (!cwf) return; - + EINA_INLIST_FOREACH(c->wins, cw) { - _e_mod_comp_win_release(cw); + _e_comp_win_release(cw); } cw = cwf; fprintf(stderr, "NOCOMP win %x shobj %p\n", cw->win, cw->shobj); - - _e_mod_comp_win_release(cw); - + + _e_comp_win_release(cw); + ecore_x_composite_unredirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); c->nocomp = 1; c->render_overflow = OVER_FLOW; ecore_x_window_hide(c->win); @@ -1095,7 +1093,7 @@ _e_mod_comp_cb_nocomp_begin(E_Comp *c) cw->nocomp = 1; if (cw->redirected) { -// ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); + // ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); cw->redirected = 0; } if (cw->update_timeout) @@ -1117,23 +1115,23 @@ _e_mod_comp_cb_nocomp_begin(E_Comp *c) ecore_x_sync_counter_inc(cw->counter, 1); } DBG("JOB2...\n"); - _e_mod_comp_render_queue(c); + _e_comp_render_queue(c); } static void -_e_mod_comp_cb_nocomp_end(E_Comp *c) +_e_comp_cb_nocomp_end(E_Comp *c) { E_Comp_Win *cw; - + if (!c->nocomp) return; ecore_x_composite_redirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); - + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + fprintf(stderr, "COMP!\n"); c->nocomp = 0; c->render_overflow = OVER_FLOW; -// ecore_evas_manual_render_set(c->ee, _comp_mod->conf->lock_fps); + // ecore_evas_manual_render_set(c->ee, conf->lock_fps); ecore_evas_manual_render_set(c->ee, EINA_FALSE); ecore_evas_resize(c->ee, c->man->w, c->man->h); ecore_x_window_show(c->win); @@ -1142,30 +1140,30 @@ _e_mod_comp_cb_nocomp_end(E_Comp *c) if (!cw->nocomp) { if ((cw->input_only) || (cw->invalid) || (cw->real_hid)) continue; - + if (cw->nocomp_need_update) { cw->nocomp_need_update = EINA_FALSE; - - e_mod_comp_update_resize(cw->up, cw->pw, cw->ph); - e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + + e_comp_update_resize(cw->up, cw->pw, cw->ph); + e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); } - _e_mod_comp_win_adopt(cw); + _e_comp_win_adopt(cw); continue; } cw->nocomp = 0; - - _e_mod_comp_win_adopt(cw); - + + _e_comp_win_adopt(cw); + fprintf(stderr, "restore comp %x --- %p\n", cw->win, cw->shobj); - + if (cw->visible) { - if (!cw->hidden_override) _e_mod_comp_child_show(cw); + if (!cw->hidden_override) _e_comp_child_show(cw); cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); // no need for effect } if (cw->counter) @@ -1179,32 +1177,32 @@ _e_mod_comp_cb_nocomp_end(E_Comp *c) } static Eina_Bool -_e_mod_comp_cb_nocomp_begin_timeout(void *data) +_e_comp_cb_nocomp_begin_timeout(void *data) { E_Comp *c = data; c->nocomp_delay_timer = NULL; if (c->nocomp_override == 0) { - if (_e_mod_comp_fullscreen_check(c)) c->nocomp_want = 1; - _e_mod_comp_cb_nocomp_begin(c); + if (_e_comp_fullscreen_check(c)) c->nocomp_want = 1; + _e_comp_cb_nocomp_begin(c); } return EINA_FALSE; } static Eina_Bool -_e_mod_comp_cb_update(E_Comp *c) +_e_comp_cb_update(E_Comp *c) { E_Comp_Win *cw; Eina_List *new_updates = NULL; // for failed pixmap fetches - get them next frame Eina_List *update_done = NULL; -// static int doframeinfo = -1; + // static int doframeinfo = -1; if (!c) return EINA_FALSE; c->update_job = NULL; DBG("UPDATE ALL\n"); if (c->nocomp) goto nocomp; - if (_comp_mod->conf->grab) + if (conf->grab) { ecore_x_grab(); ecore_x_sync(); @@ -1212,11 +1210,11 @@ _e_mod_comp_cb_update(E_Comp *c) } EINA_LIST_FREE(c->updates, cw) { - if (_comp_mod->conf->efl_sync) + if (conf->efl_sync) { if (((cw->counter) && (cw->drawme)) || (!cw->counter)) { - _e_mod_comp_win_update(cw); + _e_comp_win_update(cw); if (cw->drawme) { update_done = eina_list_append(update_done, cw); @@ -1227,14 +1225,14 @@ _e_mod_comp_cb_update(E_Comp *c) cw->update = 0; } else - _e_mod_comp_win_update(cw); + _e_comp_win_update(cw); if (cw->update) { new_updates = eina_list_append(new_updates, cw); } } - _e_mod_comp_fps_update(c); - if (_comp_mod->conf->fps_show) + _e_comp_fps_update(c); + if (conf->fps_show) { char buf[128]; double fps = 0.0, t, dt; @@ -1243,12 +1241,12 @@ _e_mod_comp_cb_update(E_Comp *c) E_Zone *z; t = ecore_time_get(); - if (_comp_mod->conf->fps_average_range < 1) - _comp_mod->conf->fps_average_range = 30; - else if (_comp_mod->conf->fps_average_range > 120) - _comp_mod->conf->fps_average_range = 120; - dt = t - c->frametimes[_comp_mod->conf->fps_average_range - 1]; - if (dt > 0.0) fps = (double)_comp_mod->conf->fps_average_range / dt; + if (conf->fps_average_range < 1) + conf->fps_average_range = 30; + else if (conf->fps_average_range > 120) + conf->fps_average_range = 120; + dt = t - c->frametimes[conf->fps_average_range - 1]; + if (dt > 0.0) fps = (double)conf->fps_average_range / dt; else fps = 0.0; if (fps > 0.0) snprintf(buf, sizeof(buf), "FPS: %1.1f", fps); else snprintf(buf, sizeof(buf), "N/A"); @@ -1256,7 +1254,7 @@ _e_mod_comp_cb_update(E_Comp *c) c->frametimes[i] = c->frametimes[i - 1]; c->frametimes[0] = t; c->frameskip++; - if (c->frameskip >= _comp_mod->conf->fps_average_range) + if (c->frameskip >= conf->fps_average_range) { c->frameskip = 0; evas_object_text_text_set(c->fps_fg, buf); @@ -1267,46 +1265,46 @@ _e_mod_comp_cb_update(E_Comp *c) z = e_util_zone_current_get(c->man); if (z) { - switch (_comp_mod->conf->fps_corner) + switch (conf->fps_corner) { case 3: // bottom-right - x = z->x + z->w - w; - y = z->y + z->h - h; - break; + x = z->x + z->w - w; + y = z->y + z->h - h; + break; case 2: // bottom-left - x = z->x; - y = z->y + z->h - h; - break; + x = z->x; + y = z->y + z->h - h; + break; case 1: // top-right - x = z->x + z->w - w; - y = z->y; - break; + x = z->x + z->w - w; + y = z->y; + break; default: // 0 // top-left - x = z->x; - y = z->y; - break; + x = z->x; + y = z->y; + break; } } evas_object_move(c->fps_bg, x, y); evas_object_resize(c->fps_bg, w, h); evas_object_move(c->fps_fg, x + 4, y + 4); } - if (_comp_mod->conf->lock_fps) + if (conf->lock_fps) { DBG("MANUAL RENDER...\n"); -// if (!c->nocomp) ecore_evas_manual_render(c->ee); + // if (!c->nocomp) ecore_evas_manual_render(c->ee); } - if (_comp_mod->conf->efl_sync) + if (conf->efl_sync) { EINA_LIST_FREE(update_done, cw) { ecore_x_sync_counter_inc(cw->counter, 1); } } - if (_comp_mod->conf->grab) + if (conf->grab) { if (c->grabbed) { @@ -1319,46 +1317,46 @@ _e_mod_comp_cb_update(E_Comp *c) DBG("JOB1...\n"); if (c->new_up_timer) ecore_timer_del(c->new_up_timer); c->new_up_timer = - ecore_timer_add(0.001, _e_mod_comp_cb_delayed_update_timer, c); -// _e_mod_comp_render_queue(c); + ecore_timer_add(0.001, _e_comp_cb_delayed_update_timer, c); + // _e_comp_render_queue(c); } c->updates = new_updates; if (!c->animating) c->render_overflow--; -/* - if (doframeinfo == -1) - { - doframeinfo = 0; - if (getenv("DFI")) doframeinfo = 1; - } - if (doframeinfo) - { - static double t0 = 0.0; - double td, t; + /* + if (doframeinfo == -1) + { + doframeinfo = 0; + if (getenv("DFI")) doframeinfo = 1; + } + if (doframeinfo) + { + static double t0 = 0.0; + double td, t; - t = ecore_time_get(); - td = t - t0; - if (td > 0.0) - { - int fps, i; + t = ecore_time_get(); + td = t - t0; + if (td > 0.0) + { + int fps, i; - fps = 1.0 / td; - for (i = 0; i < fps; i+= 2) putchar('='); - printf(" : %3.3f\n", 1.0 / td); - } - t0 = t; - } - */ + fps = 1.0 / td; + for (i = 0; i < fps; i+= 2) putchar('='); + printf(" : %3.3f\n", 1.0 / td); + } + t0 = t; + } + */ nocomp: - cw = _e_mod_comp_fullscreen_check(c); + cw = _e_comp_fullscreen_check(c); if (cw) { - if (_comp_mod->conf->nocomp_fs) + if (conf->nocomp_fs) { if ((!c->nocomp) && (!c->nocomp_override > 0)) { if (!c->nocomp_delay_timer) c->nocomp_delay_timer = ecore_timer_add - (1.0, _e_mod_comp_cb_nocomp_begin_timeout, c); + (1.0, _e_comp_cb_nocomp_begin_timeout, c); } } } @@ -1371,7 +1369,7 @@ nocomp: c->nocomp_delay_timer = NULL; } if (c->nocomp) - _e_mod_comp_cb_nocomp_end(c); + _e_comp_cb_nocomp_end(c); } DBG("UPDATE ALL DONE: overflow = %i\n", c->render_overflow); @@ -1385,32 +1383,32 @@ nocomp: } static void -_e_mod_comp_cb_job(void *data) +_e_comp_cb_job(void *data) { DBG("UPDATE ALL JOB...\n"); - _e_mod_comp_cb_update(data); + _e_comp_cb_update(data); } static Eina_Bool -_e_mod_comp_cb_animator(void *data) +_e_comp_cb_animator(void *data) { - return _e_mod_comp_cb_update(data); + return _e_comp_cb_update(data); } static void -_e_mod_comp_render_queue(E_Comp *c) +_e_comp_render_queue(E_Comp *c) { /* FIXME workaround */ if (!c) return; - if (_comp_mod->conf->lock_fps) + if (conf->lock_fps) { if (c->render_animator) { c->render_overflow = OVER_FLOW; return; } - c->render_animator = ecore_animator_add(_e_mod_comp_cb_animator, c); + c->render_animator = ecore_animator_add(_e_comp_cb_animator, c); } else { @@ -1422,19 +1420,19 @@ _e_mod_comp_render_queue(E_Comp *c) c->render_overflow = 0; } DBG("UPDATE JOB ADD...\n"); - c->update_job = ecore_job_add(_e_mod_comp_cb_job, c); + c->update_job = ecore_job_add(_e_comp_cb_job, c); } } static void -_e_mod_comp_win_render_queue(E_Comp_Win *cw) +_e_comp_win_render_queue(E_Comp_Win *cw) { DBG("JOB3...\n"); - _e_mod_comp_render_queue(cw->c); + _e_comp_render_queue(cw->c); } static E_Comp * -_e_mod_comp_find(Ecore_X_Window root) +_e_comp_find(Ecore_X_Window root) { Eina_List *l; E_Comp *c; @@ -1448,25 +1446,25 @@ _e_mod_comp_find(Ecore_X_Window root) } static E_Comp_Win * -_e_mod_comp_win_find(Ecore_X_Window win) +_e_comp_win_find(Ecore_X_Window win) { return eina_hash_find(windows, e_util_winid_str_get(win)); } static E_Comp_Win * -_e_mod_comp_border_client_find(Ecore_X_Window win) +_e_comp_border_client_find(Ecore_X_Window win) { return eina_hash_find(borders, e_util_winid_str_get(win)); } static E_Comp_Win * -_e_mod_comp_win_damage_find(Ecore_X_Damage damage) +_e_comp_win_damage_find(Ecore_X_Damage damage) { return eina_hash_find(damages, e_util_winid_str_get(damage)); } static Eina_Bool -_e_mod_comp_win_is_borderless(E_Comp_Win *cw) +_e_comp_win_is_borderless(E_Comp_Win *cw) { if (!cw->bd) return 1; if ((cw->bd->client.border.name) && @@ -1476,18 +1474,18 @@ _e_mod_comp_win_is_borderless(E_Comp_Win *cw) } static Eina_Bool -_e_mod_comp_win_do_shadow(E_Comp_Win *cw) +_e_comp_win_do_shadow(E_Comp_Win *cw) { if (cw->shaped) return 0; if (cw->argb) { - if (_e_mod_comp_win_is_borderless(cw)) return 0; + if (_e_comp_win_is_borderless(cw)) return 0; } return 1; } static Eina_Bool -_e_mod_comp_win_damage_timeout(void *data) +_e_comp_win_damage_timeout(void *data) { E_Comp_Win *cw = data; @@ -1502,20 +1500,20 @@ _e_mod_comp_win_damage_timeout(void *data) cw->c->updates = eina_list_append(cw->c->updates, cw); } cw->drawme = 1; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); cw->update_timeout = NULL; return ECORE_CALLBACK_CANCEL; } static void -_e_mod_comp_object_del(void *data, - void *obj) +_e_comp_object_del(void *data, + void *obj) { E_Comp_Win *cw = data; if (!cw) return; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); if (obj == cw->bd) { if (cw->counter) @@ -1529,8 +1527,8 @@ _e_mod_comp_object_del(void *data, if (cw->bd) eina_hash_del(borders, e_util_winid_str_get(cw->bd->client.win), cw); cw->bd = NULL; evas_object_data_del(cw->shobj, "border"); -// hmm - lockup? -// cw->counter = 0; + // hmm - lockup? + // cw->counter = 0; } else if (obj == cw->pop) { @@ -1550,51 +1548,51 @@ _e_mod_comp_object_del(void *data, } static void -_e_mod_comp_done_defer(E_Comp_Win *cw) +_e_comp_done_defer(E_Comp_Win *cw) { if (cw->animating) { cw->c->animating--; } cw->animating = 0; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); cw->force = 1; - if (cw->defer_hide) _e_mod_comp_win_hide(cw); + if (cw->defer_hide) _e_comp_win_hide(cw); cw->force = 1; - if (cw->delete_me) _e_mod_comp_win_del(cw); + if (cw->delete_me) _e_comp_win_del(cw); else cw->force = 0; } static void -_e_mod_comp_show_done(void *data, - Evas_Object *obj __UNUSED__, - const char *emission __UNUSED__, - const char *source __UNUSED__) +_e_comp_show_done(void *data, + Evas_Object *obj __UNUSED__, + const char *emission __UNUSED__, + const char *source __UNUSED__) { E_Comp_Win *cw = data; - _e_mod_comp_done_defer(cw); + _e_comp_done_defer(cw); } static void -_e_mod_comp_hide_done(void *data, - Evas_Object *obj __UNUSED__, - const char *emission __UNUSED__, - const char *source __UNUSED__) +_e_comp_hide_done(void *data, + Evas_Object *obj __UNUSED__, + const char *emission __UNUSED__, + const char *source __UNUSED__) { E_Comp_Win *cw = data; - _e_mod_comp_done_defer(cw); + _e_comp_done_defer(cw); } static void -_e_mod_comp_win_sync_setup(E_Comp_Win *cw, - Ecore_X_Window win) +_e_comp_win_sync_setup(E_Comp_Win *cw, + Ecore_X_Window win) { - if (!_comp_mod->conf->efl_sync) return; + if (!conf->efl_sync) return; if (cw->bd) { - if (_e_mod_comp_win_is_borderless(cw) || - (_comp_mod->conf->loose_sync)) + if (_e_comp_win_is_borderless(cw) || + (conf->loose_sync)) cw->counter = ecore_x_e_comp_sync_counter_get(win); else ecore_x_e_comp_sync_cancel_send(win); @@ -1609,25 +1607,25 @@ _e_mod_comp_win_sync_setup(E_Comp_Win *cw, } static void -_e_mod_comp_win_shadow_setup(E_Comp_Win *cw) +_e_comp_win_shadow_setup(E_Comp_Win *cw) { Evas_Object *o; int ok = 0; char buf[4096]; Eina_List *list = NULL, *l; - Match *m; + E_Comp_Match *m; Eina_Bool focus = EINA_FALSE, urgent = EINA_FALSE; const char *title = NULL, *name = NULL, *clas = NULL, *role = NULL; Ecore_X_Window_Type primary_type = ECORE_X_WINDOW_TYPE_UNKNOWN; - evas_object_image_smooth_scale_set(cw->obj, _comp_mod->conf->smooth_windows); + evas_object_image_smooth_scale_set(cw->obj, conf->smooth_windows); EINA_LIST_FOREACH(cw->obj_mirror, l, o) { - evas_object_image_smooth_scale_set(o, _comp_mod->conf->smooth_windows); + evas_object_image_smooth_scale_set(o, conf->smooth_windows); } if (cw->bd) { - list = _comp_mod->conf->match.borders; + list = conf->match.borders; title = cw->bd->client.icccm.title; if (cw->bd->client.netwm.name) title = cw->bd->client.netwm.name; name = cw->bd->client.icccm.name; @@ -1640,17 +1638,17 @@ _e_mod_comp_win_shadow_setup(E_Comp_Win *cw) // FIXME: i only added "shelf" as a name for popups that are shelves // ... need more nmes like for pager popup, evertything, exebuf // etc. etc. - list = _comp_mod->conf->match.popups; + list = conf->match.popups; name = cw->pop->name; } else if (cw->menu) { // FIXME: e has no way to tell e menus apart... need naming - list = _comp_mod->conf->match.menus; + list = conf->match.menus; } else { - list = _comp_mod->conf->match.overrides; + list = conf->match.overrides; title = cw->title; name = cw->name; clas = cw->clas; @@ -1776,10 +1774,10 @@ _e_mod_comp_win_shadow_setup(E_Comp_Win *cw) } if (!ok) { - if (_comp_mod->conf->shadow_style) + if (conf->shadow_style) { snprintf(buf, sizeof(buf), "e/comp/%s", - _comp_mod->conf->shadow_style); + conf->shadow_style); ok = e_theme_edje_object_set(cw->shobj, "base/theme/borders", buf); } @@ -1792,7 +1790,7 @@ _e_mod_comp_win_shadow_setup(E_Comp_Win *cw) edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e"); else { - if (_e_mod_comp_win_do_shadow(cw)) + if (_e_comp_win_do_shadow(cw)) edje_object_signal_emit(cw->shobj, "e,state,shadow,on", "e"); else edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e"); @@ -1814,11 +1812,11 @@ _e_mod_comp_win_shadow_setup(E_Comp_Win *cw) cw->c->animating++; } cw->animating = 1; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); } static void -_e_mod_comp_cb_win_mirror_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +_e_comp_cb_win_mirror_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { E_Comp_Win *cw; @@ -1827,7 +1825,7 @@ _e_mod_comp_cb_win_mirror_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, } static Evas_Object * -_e_mod_comp_win_mirror_add(E_Comp_Win *cw) +_e_comp_win_mirror_add(E_Comp_Win *cw) { Evas_Object *o; @@ -1836,10 +1834,10 @@ _e_mod_comp_win_mirror_add(E_Comp_Win *cw) o = evas_object_image_filled_add(cw->c->evas); evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); cw->obj_mirror = eina_list_append(cw->obj_mirror, o); - evas_object_image_smooth_scale_set(o, _comp_mod->conf->smooth_windows); + evas_object_image_smooth_scale_set(o, conf->smooth_windows); evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, - _e_mod_comp_cb_win_mirror_del, cw); + _e_comp_cb_win_mirror_del, cw); if ((cw->pixmap) && (cw->pw > 0) && (cw->ph > 0)) { @@ -1899,8 +1897,8 @@ _e_mod_comp_win_mirror_add(E_Comp_Win *cw) } static E_Comp_Win * -_e_mod_comp_win_add(E_Comp *c, - Ecore_X_Window win) +_e_comp_win_add(E_Comp *c, + Ecore_X_Window win) { Ecore_X_Window_Attributes att; E_Comp_Win *cw; @@ -1912,25 +1910,25 @@ _e_mod_comp_win_add(E_Comp *c, cw->real_hid = 1; cw->opacity = 255.0; cw->bd = e_border_find_by_window(cw->win); - if (_comp_mod->conf->grab) ecore_x_grab(); + if (conf->grab) ecore_x_grab(); if (cw->bd) { eina_hash_add(borders, e_util_winid_str_get(cw->bd->client.win), cw); - cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_mod_comp_object_del, cw); + cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_comp_object_del, cw); // setup on show - // _e_mod_comp_win_sync_setup(cw, cw->bd->client.win); + // _e_comp_win_sync_setup(cw, cw->bd->client.win); } else if ((cw->pop = e_popup_find_by_window(cw->win))) { cw->dfn = e_object_delfn_add(E_OBJECT(cw->pop), - _e_mod_comp_object_del, cw); + _e_comp_object_del, cw); cw->show_ready = 1; } else if ((cw->menu = e_menu_find_by_window(cw->win))) { cw->dfn = e_object_delfn_add(E_OBJECT(cw->menu), - _e_mod_comp_object_del, cw); + _e_comp_object_del, cw); cw->show_ready = 1; } else @@ -1948,7 +1946,7 @@ _e_mod_comp_win_add(E_Comp *c, if (!ecore_x_netwm_window_type_get(cw->win, &cw->primary_type)) cw->primary_type = ECORE_X_WINDOW_TYPE_UNKNOWN; // setup on show - // _e_mod_comp_win_sync_setup(cw, cw->win); + // _e_comp_win_sync_setup(cw, cw->win); } if (!cw->counter) @@ -1964,14 +1962,14 @@ _e_mod_comp_win_add(E_Comp *c, free(cw->clas); free(cw->role); free(cw); - if (_comp_mod->conf->grab) ecore_x_ungrab(); + if (conf->grab) ecore_x_ungrab(); return NULL; } if ((!att.input_only) && ((att.depth != 24) && (att.depth != 32))) { -// printf("WARNING: window 0x%x not 24/32bpp -> %ibpp\n", cw->win, att.depth); -// cw->invalid = 1; + // printf("WARNING: window 0x%x not 24/32bpp -> %ibpp\n", cw->win, att.depth); + // cw->invalid = 1; } cw->input_only = att.input_only; cw->override = att.override; @@ -1987,7 +1985,7 @@ _e_mod_comp_win_add(E_Comp *c, int num; cw->damage = ecore_x_damage_new - (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); + (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); eina_hash_add(damages, e_util_winid_str_get(cw->damage), cw); cw->shobj = edje_object_add(c->evas); cw->obj = evas_object_image_filled_add(c->evas); @@ -1998,14 +1996,14 @@ _e_mod_comp_win_add(E_Comp *c, if (cw->override && !(att.event_mask.mine & ECORE_X_EVENT_MASK_WINDOW_PROPERTY)) ecore_x_event_mask_set(cw->win, ECORE_X_EVENT_MASK_WINDOW_PROPERTY); - _e_mod_comp_win_shadow_setup(cw); + _e_comp_win_shadow_setup(cw); edje_object_signal_callback_add(cw->shobj, "e,action,show,done", "e", - _e_mod_comp_show_done, cw); + _e_comp_show_done, cw); edje_object_signal_callback_add(cw->shobj, "e,action,hide,done", "e", - _e_mod_comp_hide_done, cw); - - _e_mod_comp_win_layout_populate(cw); + _e_comp_hide_done, cw); + + _e_comp_win_layout_populate(cw); evas_object_show(cw->obj); ecore_x_window_shape_events_select(cw->win, 1); @@ -2019,7 +2017,7 @@ _e_mod_comp_win_add(E_Comp *c, rects[i].width, rects[i].height, 0, 0, (int)att.w, (int)att.h); - if (_e_mod_comp_shaped_check(att.w, att.h, rects, num)) + if (_e_comp_shaped_check(att.w, att.h, rects, num)) cw->shape_changed = 1; free(rects); @@ -2035,15 +2033,15 @@ _e_mod_comp_win_add(E_Comp *c, cw->pending_count++; e_manager_comp_event_src_add_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } else { cw->shobj = evas_object_rectangle_add(c->evas); - - _e_mod_comp_win_layout_populate(cw); - + + _e_comp_win_layout_populate(cw); + evas_object_color_set(cw->shobj, 0, 0, 0, 0); } evas_object_pass_events_set(cw->shobj, 1); @@ -2053,11 +2051,11 @@ _e_mod_comp_win_add(E_Comp *c, c->wins_invalid = 1; c->wins = eina_inlist_append(c->wins, EINA_INLIST_GET(cw)); - cw->up = e_mod_comp_update_new(); - e_mod_comp_update_tile_size_set(cw->up, 32, 32); + cw->up = e_comp_update_new(); + e_comp_update_tile_size_set(cw->up, 32, 32); // for software: - e_mod_comp_update_policy_set - (cw->up, E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH); + e_comp_update_policy_set + (cw->up, E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH); if (((!cw->input_only) && (!cw->invalid)) && (cw->override)) { cw->redirected = 1; @@ -2066,12 +2064,12 @@ _e_mod_comp_win_add(E_Comp *c, cw->dmg_updates = 0; } DBG(" [0x%x] add\n", cw->win); - if (_comp_mod->conf->grab) ecore_x_ungrab(); + if (conf->grab) ecore_x_ungrab(); return cw; } static void -_e_mod_comp_win_del(E_Comp_Win *cw) +_e_comp_win_del(E_Comp_Win *cw) { Evas_Object *o; int pending_count; @@ -2085,11 +2083,11 @@ _e_mod_comp_win_del(E_Comp_Win *cw) { cw->pending_count++; e_manager_comp_event_src_del_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } - e_mod_comp_update_free(cw->up); + e_comp_update_free(cw->up); DBG(" [0x%x] del\n", cw->win); E_FREE(cw->rects); if (cw->update_timeout) @@ -2127,16 +2125,16 @@ _e_mod_comp_win_del(E_Comp_Win *cw) cw->update = 0; cw->c->updates = eina_list_remove(cw->c->updates, cw); } - - _e_mod_comp_win_release(cw); - + + _e_comp_win_release(cw); + if (cw->obj_mirror) { EINA_LIST_FREE(cw->obj_mirror, o) { if (cw->xim) evas_object_image_data_set(o, NULL); evas_object_event_callback_del(o, EVAS_CALLBACK_DEL, - _e_mod_comp_cb_win_mirror_del); + _e_comp_cb_win_mirror_del); evas_object_del(o); } } @@ -2150,10 +2148,10 @@ _e_mod_comp_win_del(E_Comp_Win *cw) evas_object_del(cw->shobj); cw->shobj = NULL; } - + if (cw->inhash) eina_hash_del(windows, e_util_winid_str_get(cw->win), cw); - + free(cw->title); free(cw->name); free(cw->clas); @@ -2169,7 +2167,7 @@ _e_mod_comp_win_del(E_Comp_Win *cw) } static void -_e_mod_comp_win_show(E_Comp_Win *cw) +_e_comp_win_show(E_Comp_Win *cw) { Eina_List *l; Evas_Object *o; @@ -2178,16 +2176,16 @@ _e_mod_comp_win_show(E_Comp_Win *cw) cw->visible = 1; DBG(" [0x%x] sho ++ [redir=%i, pm=%x, dmg_up=%i]\n", cw->win, cw->redirected, cw->pixmap, cw->dmg_updates); - _e_mod_comp_win_configure(cw, cw->hidden.x, cw->hidden.y, cw->w, cw->h, cw->border); + _e_comp_win_configure(cw, cw->hidden.x, cw->hidden.y, cw->w, cw->h, cw->border); if ((cw->input_only) || (cw->invalid)) return; cw->show_anim = EINA_FALSE; -// setup on show + // setup on show if (cw->bd) - _e_mod_comp_win_sync_setup(cw, cw->bd->client.win); + _e_comp_win_sync_setup(cw, cw->bd->client.win); else - _e_mod_comp_win_sync_setup(cw, cw->win); + _e_comp_win_sync_setup(cw, cw->win); if (cw->real_hid) { @@ -2240,16 +2238,16 @@ _e_mod_comp_win_show(E_Comp_Win *cw) { // we redirect all subwindows anyway // ecore_x_composite_redirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); -/* #ifdef HAVE_WAYLAND_CLIENTS */ -/* if ((cw->bd) && (cw->bd->borderless)) */ -/* cw->pixmap = e_mod_comp_wl_pixmap_get(cw->win); */ -/* #endif */ + /* #ifdef HAVE_WAYLAND_CLIENTS */ + /* if ((cw->bd) && (cw->bd->borderless)) */ + /* cw->pixmap = e_comp_wl_pixmap_get(cw->win); */ + /* #endif */ if (!cw->pixmap) cw->pixmap = ecore_x_composite_name_window_pixmap_get(cw->win); if (cw->pixmap) { ecore_x_pixmap_geometry_get(cw->pixmap, NULL, NULL, &(cw->pw), &(cw->ph)); - _e_mod_comp_win_ready_timeout_setup(cw); + _e_comp_win_ready_timeout_setup(cw); } else { @@ -2267,8 +2265,8 @@ _e_mod_comp_win_show(E_Comp_Win *cw) } cw->redirected = 1; DBG(" [0x%x] up resize %ix%i\n", cw->win, cw->pw, cw->ph); - e_mod_comp_update_resize(cw->up, cw->pw, cw->ph); - e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + e_comp_update_resize(cw->up, cw->pw, cw->ph); + e_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); evas_object_image_size_set(cw->obj, cw->pw, cw->ph); EINA_LIST_FOREACH(cw->obj_mirror, l, o) { @@ -2279,37 +2277,37 @@ _e_mod_comp_win_show(E_Comp_Win *cw) if (((cw->dmg_updates >= 1) || (cw->defer_show)) && (cw->show_ready)) { cw->defer_hide = 0; - if (!cw->hidden_override) _e_mod_comp_child_show(cw); + if (!cw->hidden_override) _e_comp_child_show(cw); edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e"); if (!cw->animating) { cw->c->animating++; } cw->animating = 1; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); } static void -_e_mod_comp_win_real_hide(E_Comp_Win *cw) +_e_comp_win_real_hide(E_Comp_Win *cw) { if (cw->bd) { - _e_mod_comp_win_hide(cw); + _e_comp_win_hide(cw); return; } cw->real_hid = 1; - _e_mod_comp_win_hide(cw); + _e_comp_win_hide(cw); } static void -_e_mod_comp_win_hide(E_Comp_Win *cw) +_e_comp_win_hide(E_Comp_Win *cw) { Eina_List *l; Evas_Object *o; @@ -2327,31 +2325,31 @@ _e_mod_comp_win_hide(E_Comp_Win *cw) cw->c->animating++; } cw->animating = 1; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); return; } cw->defer_hide = 0; cw->force = 0; - _e_mod_comp_child_hide(cw); + _e_comp_child_hide(cw); if (cw->update_timeout) { ecore_timer_del(cw->update_timeout); cw->update_timeout = NULL; } - if (_comp_mod->conf->keep_unmapped) + if (conf->keep_unmapped) { - if (_comp_mod->conf->send_flush) + if (conf->send_flush) { if (cw->bd) ecore_x_e_comp_flush_send(cw->bd->client.win); else ecore_x_e_comp_flush_send(cw->win); } - if (_comp_mod->conf->send_dump) + if (conf->send_dump) { if (cw->bd) ecore_x_e_comp_dump_send(cw->bd->client.win); else ecore_x_e_comp_dump_send(cw->win); @@ -2380,7 +2378,7 @@ _e_mod_comp_win_hide(E_Comp_Win *cw) cw->pw = 0; cw->ph = 0; ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); -// cw->show_ready = 0; // hmm maybe not needed? + // cw->show_ready = 0; // hmm maybe not needed? } if (cw->xim) { @@ -2396,19 +2394,19 @@ _e_mod_comp_win_hide(E_Comp_Win *cw) } if (cw->redirected) { -// we redirect all subwindows anyway -// ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); + // we redirect all subwindows anyway + // ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); cw->redirected = 0; cw->pw = 0; cw->ph = 0; } - _e_mod_comp_win_render_queue(cw); - if (_comp_mod->conf->send_flush) + _e_comp_win_render_queue(cw); + if (conf->send_flush) { if (cw->bd) ecore_x_e_comp_flush_send(cw->bd->client.win); else ecore_x_e_comp_flush_send(cw->win); } - if (_comp_mod->conf->send_dump) + if (conf->send_dump) { if (cw->bd) ecore_x_e_comp_dump_send(cw->bd->client.win); else ecore_x_e_comp_dump_send(cw->win); @@ -2416,8 +2414,8 @@ _e_mod_comp_win_hide(E_Comp_Win *cw) } static void -_e_mod_comp_win_raise_above(E_Comp_Win *cw, - E_Comp_Win *cw2) +_e_comp_win_raise_above(E_Comp_Win *cw, + E_Comp_Win *cw2) { DBG(" [0x%x] abv [0x%x]\n", cw->win, cw2->win); cw->c->wins_invalid = 1; @@ -2425,54 +2423,54 @@ _e_mod_comp_win_raise_above(E_Comp_Win *cw, cw->c->wins = eina_inlist_append_relative(cw->c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cw2)); - _e_mod_comp_win_restack(cw); - _e_mod_comp_win_render_queue(cw); + _e_comp_win_restack(cw); + _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_config_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } static void -_e_mod_comp_win_raise(E_Comp_Win *cw) +_e_comp_win_raise(E_Comp_Win *cw) { DBG(" [0x%x] rai\n", cw->win); cw->c->wins_invalid = 1; cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); cw->c->wins = eina_inlist_append(cw->c->wins, EINA_INLIST_GET(cw)); - _e_mod_comp_win_restack(cw); - _e_mod_comp_win_render_queue(cw); + _e_comp_win_restack(cw); + _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_config_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } static void -_e_mod_comp_win_lower(E_Comp_Win *cw) +_e_comp_win_lower(E_Comp_Win *cw) { DBG(" [0x%x] low\n", cw->win); cw->c->wins_invalid = 1; cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); cw->c->wins = eina_inlist_prepend(cw->c->wins, EINA_INLIST_GET(cw)); - _e_mod_comp_win_restack(cw); - _e_mod_comp_win_render_queue(cw); + _e_comp_win_restack(cw); + _e_comp_win_render_queue(cw); cw->pending_count++; e_manager_comp_event_src_config_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } static void -_e_mod_comp_win_configure(E_Comp_Win *cw, - int x, - int y, - int w, - int h, - int border) +_e_comp_win_configure(E_Comp_Win *cw, + int x, + int y, + int w, + int h, + int border) { Eina_Bool moved = EINA_FALSE, resized = EINA_FALSE; - + if (!cw->visible) { cw->hidden.x = x; @@ -2486,7 +2484,7 @@ _e_mod_comp_win_configure(E_Comp_Win *cw, DBG(" [0x%x] mov %4i %4i\n", cw->win, x, y); cw->x = x; cw->y = y; -// evas_object_move(cw->shobj, cw->x, cw->y); + // evas_object_move(cw->shobj, cw->x, cw->y); moved = EINA_TRUE; } cw->hidden.x = x; @@ -2503,9 +2501,9 @@ _e_mod_comp_win_configure(E_Comp_Win *cw, cw->h = h; cw->needpix = 1; // was cw->w / cw->h -// evas_object_resize(cw->shobj, cw->pw, cw->ph); + // evas_object_resize(cw->shobj, cw->pw, cw->ph); resized = EINA_TRUE; - _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); #else if (cw->bd) { @@ -2513,9 +2511,9 @@ _e_mod_comp_win_configure(E_Comp_Win *cw, { cw->needpix = 1; // was cw->w / cw->h -// evas_object_resize(cw->shobj, cw->pw, cw->ph); + // evas_object_resize(cw->shobj, cw->pw, cw->ph); resized = EINA_TRUE; - _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); } else cw->update = 0; @@ -2523,10 +2521,10 @@ _e_mod_comp_win_configure(E_Comp_Win *cw, else { cw->update = 0; -// if (cw->ready_timeout) ecore_timer_del(cw->ready_timeout); -// cw->ready_timeout = ecore_timer_add -// (_comp_mod->conf->first_draw_delay, -// _e_mod_comp_cb_win_show_ready_timeout, cw); + // if (cw->ready_timeout) ecore_timer_del(cw->ready_timeout); + // cw->ready_timeout = ecore_timer_add + // (conf->first_draw_delay, + // _e_comp_cb_win_show_ready_timeout, cw); } #endif } @@ -2535,9 +2533,9 @@ _e_mod_comp_win_configure(E_Comp_Win *cw, cw->border = border; cw->needpix = 1; // was cw->w / cw->h -// evas_object_resize(cw->shobj, cw->pw, cw->ph); + // evas_object_resize(cw->shobj, cw->pw, cw->ph); resized = EINA_TRUE; - _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); } if ((cw->input_only) || (cw->invalid)) return; } @@ -2550,36 +2548,36 @@ _e_mod_comp_win_configure(E_Comp_Win *cw, cw->h = h; cw->needpix = 1; // was cw->w / cw->h -// evas_object_resize(cw->shobj, cw->pw, cw->ph); + // evas_object_resize(cw->shobj, cw->pw, cw->ph); resized = EINA_TRUE; - _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); } if (cw->border != border) { cw->border = border; cw->needpix = 1; -// evas_object_resize(cw->shobj, cw->pw, cw->ph); + // evas_object_resize(cw->shobj, cw->pw, cw->ph); resized = EINA_TRUE; - _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); } if ((cw->input_only) || (cw->invalid)) return; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); } - if (moved || resized) _e_mod_comp_win_geometry_update(cw); + if (moved || resized) _e_comp_win_geometry_update(cw); // add pending manager comp event count to match below config send cw->pending_count++; e_manager_comp_event_src_config_send(cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + _e_comp_cb_pending_after, cw->c); } static void -_e_mod_comp_win_damage(E_Comp_Win *cw, - int x, - int y, - int w, - int h, - Eina_Bool dmg) +_e_comp_win_damage(E_Comp_Win *cw, + int x, + int y, + int w, + int h, + Eina_Bool dmg) { if ((cw->input_only) || (cw->invalid)) return; DBG(" [0x%x] dmg [%x] %4i %4i %4ix%4i\n", cw->win, cw->damage, x, y, w, h); @@ -2598,15 +2596,15 @@ _e_mod_comp_win_damage(E_Comp_Win *cw, cw->nocomp_need_update = EINA_TRUE; return; } - e_mod_comp_update_add(cw->up, x, y, w, h); + e_comp_update_add(cw->up, x, y, w, h); if (dmg) { if (cw->counter) { if (!cw->update_timeout) cw->update_timeout = ecore_timer_add - (ecore_animator_frametime_get() * 2, - _e_mod_comp_win_damage_timeout, cw); + (ecore_animator_frametime_get() * 2, + _e_comp_win_damage_timeout, cw); return; } } @@ -2615,11 +2613,11 @@ _e_mod_comp_win_damage(E_Comp_Win *cw, cw->update = 1; cw->c->updates = eina_list_append(cw->c->updates, cw); } - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); } static void -_e_mod_comp_win_reshape(E_Comp_Win *cw) +_e_comp_win_reshape(E_Comp_Win *cw) { if (cw->shape_changed) return; cw->shape_changed = 1; @@ -2633,71 +2631,71 @@ _e_mod_comp_win_reshape(E_Comp_Win *cw) cw->update = 1; cw->c->updates = eina_list_append(cw->c->updates, cw); } - e_mod_comp_update_add(cw->up, 0, 0, cw->w, cw->h); - _e_mod_comp_win_render_queue(cw); + e_comp_update_add(cw->up, 0, 0, cw->w, cw->h); + _e_comp_win_render_queue(cw); } ////////////////////////////////////////////////////////////////////////// static Eina_Bool -_e_mod_comp_create(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_create(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Create *ev = event; E_Comp_Win *cw; - E_Comp *c = _e_mod_comp_find(ev->parent); + E_Comp *c = _e_comp_find(ev->parent); if (!c) return ECORE_CALLBACK_PASS_ON; - if (_e_mod_comp_win_find(ev->win)) return ECORE_CALLBACK_PASS_ON; + if (_e_comp_win_find(ev->win)) return ECORE_CALLBACK_PASS_ON; if (c->win == ev->win) return ECORE_CALLBACK_PASS_ON; if (c->ee_win == ev->win) return ECORE_CALLBACK_PASS_ON; - cw = _e_mod_comp_win_add(c, ev->win); - if (cw) _e_mod_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border); + cw = _e_comp_win_add(c, ev->win); + if (cw) _e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_destroy(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_destroy(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Destroy *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; if (cw->animating) cw->delete_me = 1; - else _e_mod_comp_win_del(cw); + else _e_comp_win_del(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_show(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_show(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Show *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; -/* - Vincent Torri via lists.sourceforge.net + /* + Vincent Torri via lists.sourceforge.net - 2:31 PM (8 minutes ago) +2:31 PM (8 minutes ago) - to enlightenment-devel. - would it be possible to add a note in the code, about the reason of - that change ? +to enlightenment-devel. +would it be possible to add a note in the code, about the reason of +that change ? - Vincent +Vincent - On Thu, Jun 21, 2012 at 3:29 PM, Enlightenment SVN - wrote: - > Log: - > gtk developers with IQs over 180 enjoy hiding and showing their windows constantly, - > especially when resizing. this broke e's comp since we are not nearly that clever - > and try to defer hide animations in most cases. undoing the defer whenever - > this happens allows us to keep up with their towering genius. - > fixes ticket #765 and probably some others. - > affected apps: claws-mail, firefox - */ +On Thu, Jun 21, 2012 at 3:29 PM, Enlightenment SVN + wrote: +> Log: +> gtk developers with IQs over 180 enjoy hiding and showing their windows constantly, +> especially when resizing. this broke e's comp since we are not nearly that clever +> and try to defer hide animations in most cases. undoing the defer whenever +> this happens allows us to keep up with their towering genius. +> fixes ticket #765 and probably some others. +> affected apps: claws-mail, firefox +*/ if (cw->defer_hide) { /* @@ -2708,7 +2706,7 @@ _e_mod_comp_show(void *data __UNUSED__, * the same window back-to-back. this means we end up with HIDE-SHOW-HIDE because * the next activation comes between the hides. to prevent this, we set the defer_show * flag, which tells comp to ignore the next hide event and to ignore the window's DAMAGE - * event counter when evaluating whether to show it in _e_mod_comp_win_show() below. in this + * event counter when evaluating whether to show it in _e_comp_win_show() below. in this * way, we ensure that such menus will always be shown. * ticket #1558 */ @@ -2716,60 +2714,60 @@ _e_mod_comp_show(void *data __UNUSED__, } cw->defer_hide = 0; if (cw->visible) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_win_show(cw); + _e_comp_win_show(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_hide(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_hide(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Hide *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; if (!cw->visible) return ECORE_CALLBACK_PASS_ON; if (cw->defer_show) cw->defer_show = 0; - else _e_mod_comp_win_real_hide(cw); + else _e_comp_win_real_hide(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_reparent(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_reparent(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Reparent *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; DBG("== repar [0x%x] to [0x%x]\n", ev->win, ev->parent); if (ev->parent != cw->c->man->root) - _e_mod_comp_win_del(cw); + _e_comp_win_del(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_configure(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_configure(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Configure *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; if (ev->abovewin == 0) { - if (EINA_INLIST_GET(cw)->prev) _e_mod_comp_win_lower(cw); + if (EINA_INLIST_GET(cw)->prev) _e_comp_win_lower(cw); } else { - E_Comp_Win *cw2 = _e_mod_comp_win_find(ev->abovewin); + E_Comp_Win *cw2 = _e_comp_win_find(ev->abovewin); if (cw2) { E_Comp_Win *cw3 = (E_Comp_Win *)(EINA_INLIST_GET(cw)->prev); - if (cw3 != cw2) _e_mod_comp_win_raise_above(cw, cw2); + if (cw3 != cw2) _e_comp_win_raise_above(cw, cw2); } } @@ -2777,26 +2775,26 @@ _e_mod_comp_configure(void *data __UNUSED__, (cw->w == ev->w) && (cw->h == ev->h) && (cw->border == ev->border))) { - _e_mod_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border); + _e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border); } return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_stack(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_stack(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Stack *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - if (ev->detail == ECORE_X_WINDOW_STACK_ABOVE) _e_mod_comp_win_raise(cw); - else _e_mod_comp_win_lower(cw); + if (ev->detail == ECORE_X_WINDOW_STACK_ABOVE) _e_comp_win_raise(cw); + else _e_comp_win_lower(cw); return ECORE_CALLBACK_PASS_ON; } static void -_e_mod_comp_win_opacity_set(E_Comp_Win *cw) +_e_comp_win_opacity_set(E_Comp_Win *cw) { unsigned int val; @@ -2808,25 +2806,25 @@ _e_mod_comp_win_opacity_set(E_Comp_Win *cw) } static Eina_Bool -_e_mod_comp_property(void *data __UNUSED__, - int type __UNUSED__, - void *event __UNUSED__) +_e_comp_property(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) { Ecore_X_Event_Window_Property *ev = event; if (ev->atom == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY) { - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_win_opacity_set(cw); + _e_comp_win_opacity_set(cw); } return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_message(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_message(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Client_Message *ev = event; E_Comp_Win *cw = NULL; @@ -2835,16 +2833,16 @@ _e_mod_comp_message(void *data __UNUSED__, if (ev->message_type == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY) { - cw = _e_mod_comp_win_find(ev->win); + cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_win_opacity_set(cw); + _e_comp_win_opacity_set(cw); return ECORE_CALLBACK_PASS_ON; } if ((ev->message_type != ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE) || (ev->format != 32)) return ECORE_CALLBACK_PASS_ON; version = ev->data.l[1]; - cw = _e_mod_comp_border_client_find(ev->data.l[0]); + cw = _e_comp_border_client_find(ev->data.l[0]); if (cw) { if (!cw->bd) return ECORE_CALLBACK_PASS_ON; @@ -2852,7 +2850,7 @@ _e_mod_comp_message(void *data __UNUSED__, } else { - cw = _e_mod_comp_win_find(ev->data.l[0]); + cw = _e_comp_win_find(ev->data.l[0]); if (!cw) return ECORE_CALLBACK_PASS_ON; if (ev->data.l[0] != (int)cw->win) return ECORE_CALLBACK_PASS_ON; } @@ -2866,11 +2864,11 @@ _e_mod_comp_message(void *data __UNUSED__, if ((cw->bd->shading) || (cw->bd->shaded)) force = 1; clw = cw->hidden.w - - cw->bd->client_inset.l - - cw->bd->client_inset.r; + cw->bd->client_inset.l - + cw->bd->client_inset.r; clh = cw->hidden.h - - cw->bd->client_inset.t - - cw->bd->client_inset.b; + cw->bd->client_inset.t - + cw->bd->client_inset.b; DBG(" [0x%x] sync draw done @%4ix%4i, bd %4ix%4i\n", cw->win, w, h, cw->bd->client.w, cw->bd->client.h); if ((w != clw) || (h != clh)) @@ -2901,75 +2899,75 @@ _e_mod_comp_message(void *data __UNUSED__, } } DBG(" [0x%x] sync draw done %4ix%4i\n", cw->win, cw->w, cw->h); -// if (cw->bd) - { - if (cw->counter) - { - DBG(" [0x%x] have counter\n", cw->win); - cw->show_ready = 1; - if (!cw->update) - { - DBG(" [0x%x] set update\n", cw->win); - if (cw->update_timeout) - { - DBG(" [0x%x] del timeout\n", cw->win); - ecore_timer_del(cw->update_timeout); - cw->update_timeout = NULL; - } - cw->update = 1; - cw->c->updates = eina_list_append(cw->c->updates, cw); - } - if ((cw->w != cw->hidden.w) || - (cw->h != cw->hidden.h) || - (force)) - { - DBG(" [0x%x] rsz done msg %4ix%4i\n", cw->win, cw->hidden.w, cw->hidden.h); - cw->w = cw->hidden.w; - cw->h = cw->hidden.h; - cw->needpix = 1; - // was cw->w / cw->h -// evas_object_resize(cw->shobj, cw->pw, cw->ph); - _e_mod_comp_win_geometry_update(cw); - _e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); - } - cw->drawme = 1; - _e_mod_comp_win_render_queue(cw); - } - } + // if (cw->bd) + { + if (cw->counter) + { + DBG(" [0x%x] have counter\n", cw->win); + cw->show_ready = 1; + if (!cw->update) + { + DBG(" [0x%x] set update\n", cw->win); + if (cw->update_timeout) + { + DBG(" [0x%x] del timeout\n", cw->win); + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); + } + if ((cw->w != cw->hidden.w) || + (cw->h != cw->hidden.h) || + (force)) + { + DBG(" [0x%x] rsz done msg %4ix%4i\n", cw->win, cw->hidden.w, cw->hidden.h); + cw->w = cw->hidden.w; + cw->h = cw->hidden.h; + cw->needpix = 1; + // was cw->w / cw->h + // evas_object_resize(cw->shobj, cw->pw, cw->ph); + _e_comp_win_geometry_update(cw); + _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + } + cw->drawme = 1; + _e_comp_win_render_queue(cw); + } + } return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_shape(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_shape(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Shape *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + E_Comp_Win *cw = _e_comp_win_find(ev->win); if (!cw) return ECORE_CALLBACK_PASS_ON; if (ev->type != ECORE_X_SHAPE_BOUNDING) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_win_reshape(cw); + _e_comp_win_reshape(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_damage(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_damage(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Damage *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_damage_find(ev->damage); + E_Comp_Win *cw = _e_comp_win_damage_find(ev->damage); if (!cw) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_win_damage(cw, - ev->area.x, ev->area.y, - ev->area.width, ev->area.height, 1); + _e_comp_win_damage(cw, + ev->area.x, ev->area.y, + ev->area.width, ev->area.height, 1); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_damage_win(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_damage_win(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_X_Event_Window_Damage *ev = event; Eina_List *l; @@ -2982,7 +2980,7 @@ _e_mod_comp_damage_win(void *data __UNUSED__, { // expose on comp win - init win or some other bypass win did it DBG("JOB4...\n"); - _e_mod_comp_render_queue(c); + _e_comp_render_queue(c); break; } } @@ -2990,53 +2988,53 @@ _e_mod_comp_damage_win(void *data __UNUSED__, } static Eina_Bool -_e_mod_comp_override_expire(void *data) +_e_comp_override_expire(void *data) { E_Comp *c = data; c->nocomp_override_timer = NULL; c->nocomp_override--; - + if (c->nocomp_override <= 0) { c->nocomp_override = 0; - if (c->nocomp_want) _e_mod_comp_cb_nocomp_begin(c); + if (c->nocomp_want) _e_comp_cb_nocomp_begin(c); } return EINA_FALSE; } static void -_e_mod_comp_override_timed_pop(E_Comp *c) +_e_comp_override_timed_pop(E_Comp *c) { if (c->nocomp_override <= 0) return; if (c->nocomp_override_timer) - ecore_timer_del(c->nocomp_override_timer); + ecore_timer_del(c->nocomp_override_timer); c->nocomp_override_timer = - ecore_timer_add(5.0, _e_mod_comp_override_expire, c); + ecore_timer_add(5.0, _e_comp_override_expire, c); } /* here for completeness -static void -_e_mod_comp_override_pop(E_Comp *c) -{ + static void + _e_comp_override_pop(E_Comp *c) + { c->nocomp_override--; if (c->nocomp_override <= 0) - { - c->nocomp_override = 0; - if (c->nocomp_want) _e_mod_comp_cb_nocomp_begin(c); - } -} -*/ + { + c->nocomp_override = 0; + if (c->nocomp_want) _e_comp_cb_nocomp_begin(c); + } + } + */ static void -_e_mod_comp_override_push(E_Comp *c) +_e_comp_override_push(E_Comp *c) { c->nocomp_override++; - if ((c->nocomp_override > 0) && (c->nocomp)) _e_mod_comp_cb_nocomp_end(c); + if ((c->nocomp_override > 0) && (c->nocomp)) _e_comp_cb_nocomp_end(c); } static void -_e_mod_comp_fade_handle(E_Comp_Zone *cz, int out, double tim) +_e_comp_fade_handle(E_Comp_Zone *cz, int out, double tim) { if (out == 1) { @@ -3063,9 +3061,9 @@ _e_mod_comp_fade_handle(E_Comp_Zone *cz, int out, double tim) } static Eina_Bool -_e_mod_comp_screensaver_on(void *data __UNUSED__, - int type __UNUSED__, - void *event __UNUSED__) +_e_comp_screensaver_on(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) { Eina_List *l, *ll; E_Comp_Zone *cz; @@ -3079,8 +3077,8 @@ _e_mod_comp_screensaver_on(void *data __UNUSED__, c->saver = EINA_TRUE; EINA_LIST_FOREACH(c->zones, ll, cz) { - _e_mod_comp_override_push(c); - _e_mod_comp_fade_handle(cz, 1, 3.0); + _e_comp_override_push(c); + _e_comp_fade_handle(cz, 1, 3.0); edje_object_signal_emit(cz->base, "e,state,screensaver,on", "e"); edje_object_signal_emit(cz->over, @@ -3092,9 +3090,9 @@ _e_mod_comp_screensaver_on(void *data __UNUSED__, } static Eina_Bool -_e_mod_comp_screensaver_off(void *data __UNUSED__, - int type __UNUSED__, - void *event __UNUSED__) +_e_comp_screensaver_off(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) { Eina_List *l, *ll; E_Comp_Zone *cz; @@ -3112,8 +3110,8 @@ _e_mod_comp_screensaver_off(void *data __UNUSED__, "e,state,screensaver,off", "e"); edje_object_signal_emit(cz->over, "e,state,screensaver,off", "e"); - _e_mod_comp_fade_handle(cz, 0, 0.5); - _e_mod_comp_override_timed_pop(c); + _e_comp_fade_handle(cz, 0, 0.5); + _e_comp_override_timed_pop(c); } } } @@ -3121,10 +3119,10 @@ _e_mod_comp_screensaver_off(void *data __UNUSED__, } static void -_e_mod_comp_zone_fill(E_Comp *c, E_Comp_Zone *cz) +_e_comp_zone_fill(E_Comp *c, E_Comp_Zone *cz) { Evas_Object *o; - + cz->base = o = edje_object_add(c->evas); e_theme_edje_object_set(o, "base/theme/modules/comp", "e/modules/comp/screen/base/default"); @@ -3143,7 +3141,7 @@ _e_mod_comp_zone_fill(E_Comp *c, E_Comp_Zone *cz) } static void -_e_mod_comp_screens_eval(E_Comp *c) +_e_comp_screens_eval(E_Comp *c) { Eina_List *l, *ll; E_Container *con; @@ -3179,7 +3177,7 @@ _e_mod_comp_screens_eval(E_Comp *c) cz->y = zone->y; cz->w = zone->w; cz->h = zone->h; - _e_mod_comp_zone_fill(c, cz); + _e_comp_zone_fill(c, cz); c->zones = eina_list_append(c->zones, cz); } zn++; @@ -3194,19 +3192,19 @@ _e_mod_comp_screens_eval(E_Comp *c) } static void -_e_mod_comp_screen_change(void *data) +_e_comp_screen_change(void *data) { E_Comp *c = data; - + c->screen_job = NULL; if (!c->nocomp) ecore_evas_resize(c->ee, c->man->w, c->man->h); - _e_mod_comp_screens_eval(c); + _e_comp_screens_eval(c); } static Eina_Bool -_e_mod_comp_randr(void *data __UNUSED__, - int type __UNUSED__, - __UNUSED__ void *event) +_e_comp_randr(void *data __UNUSED__, + int type __UNUSED__, + __UNUSED__ void *event) { Eina_List *l; E_Comp *c; @@ -3214,15 +3212,15 @@ _e_mod_comp_randr(void *data __UNUSED__, EINA_LIST_FOREACH(compositors, l, c) { if (c->screen_job) ecore_job_del(c->screen_job); - c->screen_job = ecore_job_add(_e_mod_comp_screen_change, c); + c->screen_job = ecore_job_add(_e_comp_screen_change, c); } return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_zonech(void *data __UNUSED__, - int type __UNUSED__, - __UNUSED__ void *event) +_e_comp_zonech(void *data __UNUSED__, + int type __UNUSED__, + __UNUSED__ void *event) { Eina_List *l; E_Comp *c; @@ -3230,116 +3228,116 @@ _e_mod_comp_zonech(void *data __UNUSED__, EINA_LIST_FOREACH(compositors, l, c) { if (c->screen_job) ecore_job_del(c->screen_job); - c->screen_job = ecore_job_add(_e_mod_comp_screen_change, c); + c->screen_job = ecore_job_add(_e_comp_screen_change, c); } return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_add(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_add(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Add *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; // fimxe: add/enable compositing here not in show event for borders return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_del(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_del(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Remove *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - if (cw->bd == ev->border) _e_mod_comp_object_del(cw, ev->border); + if (cw->bd == ev->border) _e_comp_object_del(cw, ev->border); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_show(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_show(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Show *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; if (cw->visible) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_win_show(cw); + _e_comp_win_show(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_hide(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_hide(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Hide *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; if (!cw->visible) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_win_hide(cw); + _e_comp_win_hide(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_move(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_move(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Move *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; // fimxe: do move here for composited bd return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_resize(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_resize(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Resize *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; // fimxe: do resize here instead of conf notify return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_iconify(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_iconify(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Iconify *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; // fimxe: special iconfiy anim return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_uniconify(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_uniconify(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Uniconify *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; // fimxe: special uniconfiy anim return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_urgent_change(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_urgent_change(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Urgent_Change *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; if (cw->bd->client.icccm.urgent) edje_object_signal_emit(cw->shobj, "e,state,urgent,on", "e"); @@ -3349,150 +3347,132 @@ _e_mod_comp_bd_urgent_change(void *data __UNUSED__, } static Eina_Bool -_e_mod_comp_bd_focus_in(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_focus_in(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Focus_In *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; edje_object_signal_emit(cw->shobj, "e,state,focus,on", "e"); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_focus_out(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_focus_out(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Focus_Out *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; edje_object_signal_emit(cw->shobj, "e,state,focus,off", "e"); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_property(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_property(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Property *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; // fimxe: other properties? return ECORE_CALLBACK_PASS_ON; } static void -_e_mod_comp_reshadow(E_Comp_Win *cw) +_e_comp_reshadow(E_Comp_Win *cw) { if (cw->visible) evas_object_hide(cw->shobj); - _e_mod_comp_win_shadow_setup(cw); -// evas_object_move(cw->shobj, cw->x, cw->y); -// evas_object_resize(cw->shobj, cw->pw, cw->ph); - _e_mod_comp_win_geometry_update(cw); + _e_comp_win_shadow_setup(cw); + // evas_object_move(cw->shobj, cw->x, cw->y); + // evas_object_resize(cw->shobj, cw->pw, cw->ph); + _e_comp_win_geometry_update(cw); if (cw->visible) { evas_object_show(cw->shobj); if (cw->show_ready) { cw->defer_hide = 0; - if (!cw->hidden_override) _e_mod_comp_child_show(cw); + if (!cw->hidden_override) _e_comp_child_show(cw); edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e"); if (!cw->animating) { cw->c->animating++; } cw->animating = 1; - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); } } } static Eina_Bool -_e_mod_comp_bd_fullscreen(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_fullscreen(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Property *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_reshadow(cw); + _e_comp_reshadow(cw); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_bd_unfullscreen(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_bd_unfullscreen(void *data __UNUSED__, + int type __UNUSED__, + void *event) { E_Event_Border_Property *ev = event; - E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - _e_mod_comp_reshadow(cw); + _e_comp_reshadow(cw); return ECORE_CALLBACK_PASS_ON; } ////////////////////////////////////////////////////////////////////////// static void -_e_mod_comp_fps_toggle(void) +_e_comp_fps_toggle(void) { - if (_comp_mod) - { - Eina_List *l; - E_Comp *c; + Eina_List *l; + E_Comp *c; - if (_comp_mod->conf->fps_show) - { - _comp_mod->conf->fps_show = 0; - e_config_save_queue(); - } - else - { - _comp_mod->conf->fps_show = 1; - e_config_save_queue(); - } - EINA_LIST_FOREACH(compositors, l, c) _e_mod_comp_cb_update(c); + if (conf->fps_show) + { + conf->fps_show = 0; + e_config_save_queue(); } + else + { + conf->fps_show = 1; + e_config_save_queue(); + } + EINA_LIST_FOREACH(compositors, l, c) _e_comp_cb_update(c); } static Eina_Bool -_e_mod_comp_key_down(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_key_down(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_Event_Key *ev = event; - if ((!strcmp(ev->keyname, "Home")) && - (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) && - (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) && - (ev->modifiers & ECORE_EVENT_MODIFIER_ALT)) - { - if (_comp_mod) - { - _e_mod_config_free(_comp_mod->module); - _e_mod_config_new(_comp_mod->module); - e_config_save(); - e_module_disable(_comp_mod->module); - e_config_save(); - e_sys_action_do(E_SYS_RESTART, NULL); - } - } - else if ((!strcasecmp(ev->keyname, "f")) && + if ((!strcasecmp(ev->keyname, "f")) && (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) && (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) && (ev->modifiers & ECORE_EVENT_MODIFIER_ALT)) { - _e_mod_comp_fps_toggle(); + _e_comp_fps_toggle(); } return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_signal_user(void *data __UNUSED__, - int type __UNUSED__, - void *event) +_e_comp_signal_user(void *data __UNUSED__, + int type __UNUSED__, + void *event) { Ecore_Event_Signal_User *ev = event; @@ -3502,47 +3482,47 @@ _e_mod_comp_signal_user(void *data __UNUSED__, } else if (ev->number == 2) { - _e_mod_comp_fps_toggle(); + _e_comp_fps_toggle(); } return ECORE_CALLBACK_PASS_ON; } ////////////////////////////////////////////////////////////////////////// static Evas * -_e_mod_comp_evas_get_func(void *data, - E_Manager *man __UNUSED__) +_e_comp_evas_get_func(void *data, + E_Manager *man __UNUSED__) { E_Comp *c = data; return c->evas; } static void -_e_mod_comp_update_func(void *data, - E_Manager *man __UNUSED__) +_e_comp_update_func(void *data, + E_Manager *man __UNUSED__) { E_Comp *c = data; - _e_mod_comp_render_queue(c); + _e_comp_render_queue(c); } static E_Manager_Comp_Source * -_e_mod_comp_border_src_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - Ecore_X_Window win) +_e_comp_border_src_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + Ecore_X_Window win) { - return (E_Manager_Comp_Source *)_e_mod_comp_border_client_find(win); + return (E_Manager_Comp_Source *)_e_comp_border_client_find(win); } static E_Manager_Comp_Source * -_e_mod_comp_src_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - Ecore_X_Window win) +_e_comp_src_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + Ecore_X_Window win) { - return (E_Manager_Comp_Source *)_e_mod_comp_win_find(win); + return (E_Manager_Comp_Source *)_e_comp_win_find(win); } static const Eina_List * -_e_mod_comp_src_list_get_func(void *data, - E_Manager *man __UNUSED__) +_e_comp_src_list_get_func(void *data, + E_Manager *man __UNUSED__) { E_Comp *c = data; E_Comp_Win *cw; @@ -3563,56 +3543,56 @@ _e_mod_comp_src_list_get_func(void *data, } static Evas_Object * -_e_mod_comp_src_image_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_image_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { -// E_Comp *c = data; + // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; if (!cw->c) return NULL; return cw->obj; } static Evas_Object * -_e_mod_comp_src_shadow_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_shadow_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { -// E_Comp *c = data; + // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; if (!cw->c) return NULL; return cw->shobj; } static Evas_Object * -_e_mod_comp_src_image_mirror_add_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_image_mirror_add_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { -// E_Comp *c = data; + // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; if (!cw->c) return NULL; - return _e_mod_comp_win_mirror_add(cw); + return _e_comp_win_mirror_add(cw); } static Eina_Bool -_e_mod_comp_src_visible_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_visible_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { -// E_Comp *c = data; + // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; if (!cw->c) return 0; return cw->visible; } static void -_e_mod_comp_src_hidden_set_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src, - Eina_Bool hidden) +_e_comp_src_hidden_set_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src, + Eina_Bool hidden) { -// E_Comp *c = data; + // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; if (!cw->c) return; if (cw->hidden_override == hidden) return; @@ -3621,31 +3601,31 @@ _e_mod_comp_src_hidden_set_func(void *data __UNUSED__, if (cw->visible) { if (cw->hidden_override) - _e_mod_comp_child_hide(cw); + _e_comp_child_hide(cw); else if (!cw->bd || cw->bd->visible) - _e_mod_comp_child_show(cw); + _e_comp_child_show(cw); } else { - if (cw->hidden_override) _e_mod_comp_child_hide(cw); + if (cw->hidden_override) _e_comp_child_hide(cw); } } static Eina_Bool -_e_mod_comp_src_hidden_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_hidden_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { -// E_Comp *c = data; + // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; if (!cw->c) return 0; return cw->hidden_override; } static E_Popup * -_e_mod_comp_src_popup_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_popup_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; @@ -3654,9 +3634,9 @@ _e_mod_comp_src_popup_get_func(void *data __UNUSED__, } static E_Border * -_e_mod_comp_src_border_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_border_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; @@ -3665,9 +3645,9 @@ _e_mod_comp_src_border_get_func(void *data __UNUSED__, } static Ecore_X_Window -_e_mod_comp_src_window_get_func(void *data __UNUSED__, - E_Manager *man __UNUSED__, - E_Manager_Comp_Source *src) +_e_comp_src_window_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) { // E_Comp *c = data; E_Comp_Win *cw = (E_Comp_Win *)src; @@ -3676,7 +3656,7 @@ _e_mod_comp_src_window_get_func(void *data __UNUSED__, } static E_Comp * -_e_mod_comp_add(E_Manager *man) +_e_comp_add(E_Manager *man) { E_Comp *c; Ecore_X_Window *wins; @@ -3691,9 +3671,9 @@ _e_mod_comp_add(E_Manager *man) if (res) { e_util_dialog_internal - (_("Compositor Error"), - _("Another compositor is already running
" - "on your display server.")); + (_("Compositor Error"), + _("Another compositor is already running
" + "on your display server.")); free(c); return NULL; } @@ -3706,17 +3686,17 @@ _e_mod_comp_add(E_Manager *man) } ecore_x_screen_is_composited_set(man->num, c->cm_selection); - ecore_x_e_comp_sync_supported_set(man->root, _comp_mod->conf->efl_sync); + ecore_x_e_comp_sync_supported_set(man->root, conf->efl_sync); c->man = man; c->win = ecore_x_composite_render_window_enable(man->root); if (!c->win) { e_util_dialog_internal - (_("Compositor Error"), - _("Your display server does not support the
" - "compositor overlay window. This is needed
" - "for it to function.")); + (_("Compositor Error"), + _("Your display server does not support the
" + "compositor overlay window. This is needed
" + "for it to function.")); free(c); return NULL; } @@ -3726,33 +3706,33 @@ _e_mod_comp_add(E_Manager *man) if ((att.depth != 24) && (att.depth != 32)) { -/* - e_util_dialog_internal - (_("Compositor Error"), - _("Your screen is not in 24/32bit display mode.
" - "This is required to be your default depth
" - "setting for the compositor to work properly.")); - ecore_x_composite_render_window_disable(c->win); - free(c); - return NULL; - */ + /* + e_util_dialog_internal + (_("Compositor Error"), + _("Your screen is not in 24/32bit display mode.
" + "This is required to be your default depth
" + "setting for the compositor to work properly.")); + ecore_x_composite_render_window_disable(c->win); + free(c); + return NULL; + */ } if (c->man->num == 0) e_alert_composite_win(c->man->root, c->win); - if (_comp_mod->conf->engine == ENGINE_GL) + if (conf->engine == E_COMP_ENGINE_GL) { int opt[20]; int opt_i = 0; - if (_comp_mod->conf->indirect) + if (conf->indirect) { opt[opt_i] = ECORE_EVAS_GL_X11_OPT_INDIRECT; opt_i++; opt[opt_i] = 1; opt_i++; } - if (_comp_mod->conf->vsync) + if (conf->vsync) { opt[opt_i] = ECORE_EVAS_GL_X11_OPT_VSYNC; opt_i++; @@ -3760,11 +3740,11 @@ _e_mod_comp_add(E_Manager *man) opt_i++; } #ifdef ECORE_EVAS_GL_X11_OPT_SWAP_MODE - if (_comp_mod->conf->swap_mode) + if (conf->swap_mode) { opt[opt_i] = ECORE_EVAS_GL_X11_OPT_SWAP_MODE; opt_i++; - opt[opt_i] = _comp_mod->conf->swap_mode; + opt[opt_i] = conf->swap_mode; opt_i++; } #endif @@ -3772,7 +3752,7 @@ _e_mod_comp_add(E_Manager *man) { opt[opt_i] = ECORE_EVAS_GL_X11_OPT_NONE; c->ee = ecore_evas_gl_x11_options_new - (NULL, c->win, 0, 0, man->w, man->h, opt); + (NULL, c->win, 0, 0, man->w, man->h, opt); } if (!c->ee) c->ee = ecore_evas_gl_x11_new(NULL, c->win, 0, 0, man->w, man->h); @@ -3780,36 +3760,36 @@ _e_mod_comp_add(E_Manager *man) { c->gl = 1; ecore_evas_gl_x11_pre_post_swap_callback_set - (c->ee, c, _e_mod_comp_pre_swap, NULL); + (c->ee, c, _e_comp_pre_swap, NULL); } } if (!c->ee) { - if (_comp_mod->conf->engine == ENGINE_GL) + if (conf->engine == E_COMP_ENGINE_GL) { e_util_dialog_internal - (_("Compositor Warning"), - _("Your display driver does not support OpenGL, or
" - "no OpenGL engines were compiled or installed for
" - "Evas or Ecore-Evas. Falling back to software engine.")); + (_("Compositor Warning"), + _("Your display driver does not support OpenGL, or
" + "no OpenGL engines were compiled or installed for
" + "Evas or Ecore-Evas. Falling back to software engine.")); } c->ee = ecore_evas_software_x11_new(NULL, c->win, 0, 0, man->w, man->h); } ecore_evas_comp_sync_set(c->ee, 0); -// ecore_evas_manual_render_set(c->ee, _comp_mod->conf->lock_fps); + // ecore_evas_manual_render_set(c->ee, conf->lock_fps); c->evas = ecore_evas_get(c->ee); ecore_evas_show(c->ee); c->layout = e_layout_add(c->evas); evas_object_show(c->layout); - _e_mod_comp_screens_eval(c); - + _e_comp_screens_eval(c); + c->ee_win = ecore_evas_window_get(c->ee); ecore_x_composite_redirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); wins = ecore_x_window_children_get(c->man->root, &num); if (wins) @@ -3834,14 +3814,14 @@ _e_mod_comp_add(E_Manager *man) free(wname); free(wclass); wname = wclass = NULL; - cw = _e_mod_comp_win_add(c, wins[i]); + cw = _e_comp_win_add(c, wins[i]); if (!cw) continue; ecore_x_window_geometry_get(cw->win, &x, &y, &w, &h); border = ecore_x_window_border_width_get(cw->win); if (wins[i] == c->win) continue; - _e_mod_comp_win_configure(cw, x, y, w, h, border); + _e_comp_win_configure(cw, x, y, w, h, border); if (ecore_x_window_visible_get(wins[i])) - _e_mod_comp_win_show(cw); + _e_comp_win_show(cw); } free(wins); } @@ -3858,39 +3838,39 @@ _e_mod_comp_add(E_Manager *man) ECORE_EVENT_MODIFIER_ALT, 0); c->comp.data = c; - c->comp.func.evas_get = _e_mod_comp_evas_get_func; - c->comp.func.update = _e_mod_comp_update_func; - c->comp.func.src_get = _e_mod_comp_src_get_func; - c->comp.func.border_src_get = _e_mod_comp_border_src_get_func; - c->comp.func.src_list_get = _e_mod_comp_src_list_get_func; - c->comp.func.src_image_get = _e_mod_comp_src_image_get_func; - c->comp.func.src_shadow_get = _e_mod_comp_src_shadow_get_func; - c->comp.func.src_image_mirror_add = _e_mod_comp_src_image_mirror_add_func; - c->comp.func.src_visible_get = _e_mod_comp_src_visible_get_func; - c->comp.func.src_hidden_set = _e_mod_comp_src_hidden_set_func; - c->comp.func.src_hidden_get = _e_mod_comp_src_hidden_get_func; - c->comp.func.src_window_get = _e_mod_comp_src_window_get_func; - c->comp.func.src_border_get = _e_mod_comp_src_border_get_func; - c->comp.func.src_popup_get = _e_mod_comp_src_popup_get_func; + c->comp.func.evas_get = _e_comp_evas_get_func; + c->comp.func.update = _e_comp_update_func; + c->comp.func.src_get = _e_comp_src_get_func; + c->comp.func.border_src_get = _e_comp_border_src_get_func; + c->comp.func.src_list_get = _e_comp_src_list_get_func; + c->comp.func.src_image_get = _e_comp_src_image_get_func; + c->comp.func.src_shadow_get = _e_comp_src_shadow_get_func; + c->comp.func.src_image_mirror_add = _e_comp_src_image_mirror_add_func; + c->comp.func.src_visible_get = _e_comp_src_visible_get_func; + c->comp.func.src_hidden_set = _e_comp_src_hidden_set_func; + c->comp.func.src_hidden_get = _e_comp_src_hidden_get_func; + c->comp.func.src_window_get = _e_comp_src_window_get_func; + c->comp.func.src_border_get = _e_comp_src_border_get_func; + c->comp.func.src_popup_get = _e_comp_src_popup_get_func; e_manager_comp_set(c->man, &(c->comp)); return c; } static void -_e_mod_comp_del(E_Comp *c) +_e_comp_del(E_Comp *c) { E_Comp_Win *cw; E_Comp_Zone *cz; Eina_List *l, *hide_bd = NULL; E_Border *bd; - + EINA_LIST_FOREACH(e_border_client_list(), l, bd) { if (!bd->visible) hide_bd = eina_list_append(hide_bd, bd); } - + if (c->fps_fg) { evas_object_del(c->fps_fg); @@ -3927,11 +3907,11 @@ _e_mod_comp_del(E_Comp *c) cw->counter = 0; } cw->force = 1; - _e_mod_comp_win_hide(cw); + _e_comp_win_hide(cw); cw->force = 1; - _e_mod_comp_win_del(cw); + _e_comp_win_del(cw); } - + EINA_LIST_FREE(c->zones, cz) { evas_object_del(cz->base); @@ -3946,10 +3926,10 @@ _e_mod_comp_del(E_Comp *c) } if (c->layout) evas_object_del(c->layout); - + ecore_evas_free(c->ee); ecore_x_composite_unredirect_subwindows - (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); ecore_x_composite_render_window_disable(c->win); if (c->man->num == 0) e_alert_composite_win(c->man->root, 0); if (c->render_animator) ecore_animator_del(c->render_animator); @@ -3963,7 +3943,7 @@ _e_mod_comp_del(E_Comp *c) ecore_x_window_free(c->cm_selection); ecore_x_e_comp_sync_supported_set(c->man->root, 0); ecore_x_screen_is_composited_set(c->man->num, 0); - + EINA_LIST_FREE(hide_bd, bd) { e_border_show(bd); @@ -3977,33 +3957,33 @@ _e_mod_comp_del(E_Comp *c) static void -_e_mod_comp_sys_done_cb(void *data, Evas_Object *obj, const char *sig, const char *src) +_e_comp_sys_done_cb(void *data, Evas_Object *obj, const char *sig, const char *src) { - edje_object_signal_callback_del(obj, sig, src, _e_mod_comp_sys_done_cb); + edje_object_signal_callback_del(obj, sig, src, _e_comp_sys_done_cb); e_sys_action_raw_do((E_Sys_Action)(long)data, NULL); } static void -_e_mod_comp_sys_emit_cb_wait(E_Sys_Action a, const char *sig, const char *rep, Eina_Bool nocomp_push) +_e_comp_sys_emit_cb_wait(E_Sys_Action a, const char *sig, const char *rep, Eina_Bool nocomp_push) { Eina_List *l, *ll; E_Comp_Zone *cz; E_Comp *c; Eina_Bool first = EINA_TRUE; - + EINA_LIST_FOREACH(compositors, l, c) { - if (nocomp_push) _e_mod_comp_override_push(c); - else _e_mod_comp_override_timed_pop(c); + if (nocomp_push) _e_comp_override_push(c); + else _e_comp_override_timed_pop(c); EINA_LIST_FOREACH(c->zones, ll, cz) { - if (nocomp_push) _e_mod_comp_fade_handle(cz, 1, 0.5); - else _e_mod_comp_fade_handle(cz, 0, 0.5); + if (nocomp_push) _e_comp_fade_handle(cz, 1, 0.5); + else _e_comp_fade_handle(cz, 0, 0.5); edje_object_signal_emit(cz->base, sig, "e"); edje_object_signal_emit(cz->over, sig, "e"); if ((rep) && (first)) edje_object_signal_callback_add(cz->over, rep, "e", - _e_mod_comp_sys_done_cb, + _e_comp_sys_done_cb, (void *)(long)a); first = EINA_FALSE; } @@ -4011,139 +3991,149 @@ _e_mod_comp_sys_emit_cb_wait(E_Sys_Action a, const char *sig, const char *rep, E } static void -_e_mod_comp_sys_suspend(void) +_e_comp_sys_suspend(void) { - _e_mod_comp_sys_emit_cb_wait(E_SYS_SUSPEND, - "e,state,sys,suspend", - "e,state,sys,suspend,done", - EINA_TRUE); + _e_comp_sys_emit_cb_wait(E_SYS_SUSPEND, + "e,state,sys,suspend", + "e,state,sys,suspend,done", + EINA_TRUE); } static void -_e_mod_comp_sys_hibernate(void) +_e_comp_sys_hibernate(void) { - _e_mod_comp_sys_emit_cb_wait(E_SYS_HIBERNATE, - "e,state,sys,hibernate", - "e,state,sys,hibernate,done", - EINA_TRUE); + _e_comp_sys_emit_cb_wait(E_SYS_HIBERNATE, + "e,state,sys,hibernate", + "e,state,sys,hibernate,done", + EINA_TRUE); } static void -_e_mod_comp_sys_reboot(void) +_e_comp_sys_reboot(void) { - _e_mod_comp_sys_emit_cb_wait(E_SYS_REBOOT, - "e,state,sys,reboot", - "e,state,sys,reboot,done", - EINA_TRUE); + _e_comp_sys_emit_cb_wait(E_SYS_REBOOT, + "e,state,sys,reboot", + "e,state,sys,reboot,done", + EINA_TRUE); } static void -_e_mod_comp_sys_shutdown(void) +_e_comp_sys_shutdown(void) { - _e_mod_comp_sys_emit_cb_wait(E_SYS_HALT, - "e,state,sys,halt", - "e,state,sys,halt,done", - EINA_TRUE); + _e_comp_sys_emit_cb_wait(E_SYS_HALT, + "e,state,sys,halt", + "e,state,sys,halt,done", + EINA_TRUE); } static void -_e_mod_comp_sys_logout(void) +_e_comp_sys_logout(void) { - _e_mod_comp_sys_emit_cb_wait(E_SYS_LOGOUT, - "e,state,sys,logout", - "e,state,sys,logout,done", - EINA_TRUE); + _e_comp_sys_emit_cb_wait(E_SYS_LOGOUT, + "e,state,sys,logout", + "e,state,sys,logout,done", + EINA_TRUE); } static void -_e_mod_comp_sys_resume(void) +_e_comp_sys_resume(void) { - _e_mod_comp_sys_emit_cb_wait(E_SYS_SUSPEND, - "e,state,sys,resume", - NULL, - EINA_FALSE); + _e_comp_sys_emit_cb_wait(E_SYS_SUSPEND, + "e,state,sys,resume", + NULL, + EINA_FALSE); } ////////////////////////////////////////////////////////////////////////// Eina_Bool -e_mod_comp_init(void) +e_comp_init(void) { Eina_List *l; E_Manager *man; - - e_sys_handlers_set(_e_mod_comp_sys_suspend, - _e_mod_comp_sys_hibernate, - _e_mod_comp_sys_reboot, - _e_mod_comp_sys_shutdown, - _e_mod_comp_sys_logout, - _e_mod_comp_sys_resume); + + e_sys_handlers_set(_e_comp_sys_suspend, + _e_comp_sys_hibernate, + _e_comp_sys_reboot, + _e_comp_sys_shutdown, + _e_comp_sys_logout, + _e_comp_sys_resume); windows = eina_hash_string_superfast_new(NULL); borders = eina_hash_string_superfast_new(NULL); damages = eina_hash_string_superfast_new(NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CREATE, _e_mod_comp_create, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_DESTROY, _e_mod_comp_destroy, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_SHOW, _e_mod_comp_show, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_HIDE, _e_mod_comp_hide, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_REPARENT, _e_mod_comp_reparent, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CONFIGURE, _e_mod_comp_configure, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_STACK, _e_mod_comp_stack, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_PROPERTY, _e_mod_comp_property, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_CLIENT_MESSAGE, _e_mod_comp_message, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_SHAPE, _e_mod_comp_shape, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_DAMAGE_NOTIFY, _e_mod_comp_damage, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_DAMAGE, _e_mod_comp_damage_win, NULL); - - E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_ON, _e_mod_comp_screensaver_on, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_OFF, _e_mod_comp_screensaver_off, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CREATE, _e_comp_create, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_DESTROY, _e_comp_destroy, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_SHOW, _e_comp_show, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_HIDE, _e_comp_hide, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_REPARENT, _e_comp_reparent, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CONFIGURE, _e_comp_configure, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_STACK, _e_comp_stack, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_PROPERTY, _e_comp_property, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_CLIENT_MESSAGE, _e_comp_message, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_SHAPE, _e_comp_shape, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_DAMAGE_NOTIFY, _e_comp_damage, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_DAMAGE, _e_comp_damage_win, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _e_mod_comp_key_down, NULL); - E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_SIGNAL_USER, _e_mod_comp_signal_user, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_ON, _e_comp_screensaver_on, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_OFF, _e_comp_screensaver_off, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_CONTAINER_RESIZE, _e_mod_comp_randr, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _e_comp_key_down, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_SIGNAL_USER, _e_comp_signal_user, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_MOVE_RESIZE, _e_mod_comp_zonech, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_ADD, _e_mod_comp_zonech, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DEL, _e_mod_comp_zonech, NULL); - - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_ADD, _e_mod_comp_bd_add, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_REMOVE, _e_mod_comp_bd_del, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_SHOW, _e_mod_comp_bd_show, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_HIDE, _e_mod_comp_bd_hide, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_MOVE, _e_mod_comp_bd_move, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_RESIZE, _e_mod_comp_bd_resize, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_ICONIFY, _e_mod_comp_bd_iconify, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_UNICONIFY, _e_mod_comp_bd_uniconify, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_URGENT_CHANGE, _e_mod_comp_bd_urgent_change, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_FOCUS_IN, _e_mod_comp_bd_focus_in, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_FOCUS_OUT, _e_mod_comp_bd_focus_out, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_PROPERTY, _e_mod_comp_bd_property, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_FULLSCREEN, _e_mod_comp_bd_fullscreen, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_UNFULLSCREEN, _e_mod_comp_bd_unfullscreen, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_CONTAINER_RESIZE, _e_comp_randr, NULL); + + E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_MOVE_RESIZE, _e_comp_zonech, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_ADD, _e_comp_zonech, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DEL, _e_comp_zonech, NULL); + + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_ADD, _e_comp_bd_add, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_REMOVE, _e_comp_bd_del, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_SHOW, _e_comp_bd_show, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_HIDE, _e_comp_bd_hide, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_MOVE, _e_comp_bd_move, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_RESIZE, _e_comp_bd_resize, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_ICONIFY, _e_comp_bd_iconify, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_UNICONIFY, _e_comp_bd_uniconify, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_URGENT_CHANGE, _e_comp_bd_urgent_change, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_FOCUS_IN, _e_comp_bd_focus_in, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_FOCUS_OUT, _e_comp_bd_focus_out, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_PROPERTY, _e_comp_bd_property, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_FULLSCREEN, _e_comp_bd_fullscreen, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_BORDER_UNFULLSCREEN, _e_comp_bd_unfullscreen, NULL); if (!ecore_x_composite_query()) { e_util_dialog_internal - (_("Compositor Error"), - _("Your display server does not support XComposite,
" - "or Ecore-X was built without XComposite support.
" - "Note that for composite support you will also need
" - "XRender and XFixes support in X11 and Ecore.")); - return 0; + (_("Compositor Error"), + _("Your display server does not support XComposite,
" + "or Ecore-X was built without XComposite support.
" + "Note that for composite support you will also need
" + "XRender and XFixes support in X11 and Ecore.")); + return EINA_FALSE; } if (!ecore_x_damage_query()) { e_util_dialog_internal - (_("Compositor Error"), - _("Your display server does not support XDamage
" - "or Ecore was built without XDamage support.")); - return 0; + (_("Compositor Error"), + _("Your display server does not support XDamage
" + "or Ecore was built without XDamage support.")); + return EINA_FALSE; } + e_comp_cfdata_edd_init(&conf_edd, &conf_match_edd); + conf = e_config_domain_load("module.comp", conf_edd); + if (conf) + { + conf->max_unmapped_pixels = 32 * 1024; + conf->keep_unmapped = 1; + } + else + conf = e_comp_cfdata_config_new(); + #ifdef HAVE_WAYLAND_CLIENTS - if (!e_mod_comp_wl_init()) + if (!e_comp_wl_init()) EINA_LOG_ERR("Failed to initialize Wayland Client Support !!\n"); #endif @@ -4151,37 +4141,45 @@ e_mod_comp_init(void) { E_Comp *c; - c = _e_mod_comp_add(man); - if (c) compositors = eina_list_append(compositors, c); + c = _e_comp_add(man); + if (c) + compositors = eina_list_append(compositors, c); } ecore_x_sync(); - return 1; + return EINA_TRUE; } void -e_mod_comp_shutdown(void) +e_comp_shutdown(void) { - E_FREE_LIST(compositors, _e_mod_comp_del); + E_FREE_LIST(compositors, _e_comp_del); E_FREE_LIST(handlers, ecore_event_handler_del); #ifdef HAVE_WAYLAND_CLIENTS - e_mod_comp_wl_shutdown(); + e_comp_wl_shutdown(); #endif - + + e_comp_cfdata_config_free(conf); + E_CONFIG_DD_FREE(conf_match_edd); + E_CONFIG_DD_FREE(conf_edd); + conf = NULL; + conf_match_edd = NULL; + conf_edd = NULL; + if (damages) eina_hash_free(damages); if (windows) eina_hash_free(windows); if (borders) eina_hash_free(borders); damages = NULL; windows = NULL; borders = NULL; - + e_sys_handlers_set(NULL, NULL, NULL, NULL, NULL, NULL); } void -e_mod_comp_shadow_set(void) +e_comp_shadow_set(void) { Eina_List *l; E_Comp *c; @@ -4190,13 +4188,13 @@ e_mod_comp_shadow_set(void) { E_Comp_Win *cw; -// ecore_evas_manual_render_set(c->ee, _comp_mod->conf->lock_fps); - _e_mod_comp_fps_update(c); + // ecore_evas_manual_render_set(c->ee, conf->lock_fps); + _e_comp_fps_update(c); EINA_INLIST_FOREACH(c->wins, cw) { if ((cw->shobj) && (cw->obj)) { - _e_mod_comp_win_shadow_setup(cw); + _e_comp_win_shadow_setup(cw); if (cw->visible) { @@ -4205,13 +4203,13 @@ e_mod_comp_shadow_set(void) { cw->c->animating++; } - _e_mod_comp_win_render_queue(cw); + _e_comp_win_render_queue(cw); cw->animating = 1; cw->pending_count++; e_manager_comp_event_src_visibility_send - (cw->c->man, (E_Manager_Comp_Source *)cw, - _e_mod_comp_cb_pending_after, cw->c); + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_comp_cb_pending_after, cw->c); } } } diff --git a/src/modules/comp/e_mod_comp.h b/src/bin/e_comp.h similarity index 56% rename from src/modules/comp/e_mod_comp.h rename to src/bin/e_comp.h index 8270e26df..2761c0b9b 100644 --- a/src/modules/comp/e_mod_comp.h +++ b/src/bin/e_comp.h @@ -1,16 +1,19 @@ #ifdef E_TYPEDEFS -#else -#ifndef E_MOD_COMP_H -#define E_MOD_COMP_H - typedef struct _E_Comp E_Comp; typedef struct _E_Comp_Win E_Comp_Win; typedef struct _E_Comp_Zone E_Comp_Zone; -Eina_Bool e_mod_comp_init(void); -void e_mod_comp_shutdown(void); +#define E_COMP_ENGINE_SW 1 +#define E_COMP_ENGINE_GL 2 -void e_mod_comp_shadow_set(void); +#else +#ifndef E_MOD_COMP_H +#define E_MOD_COMP_H + +Eina_Bool e_comp_init(void); +void e_comp_shutdown(void); + +EAPI void e_comp_shadow_set(void); #endif #endif diff --git a/src/modules/comp/e_mod_comp_cfdata.c b/src/bin/e_comp_cfdata.c similarity index 85% rename from src/modules/comp/e_mod_comp_cfdata.c rename to src/bin/e_comp_cfdata.c index 4e1143b52..8ff3f1fab 100644 --- a/src/modules/comp/e_mod_comp_cfdata.c +++ b/src/bin/e_comp_cfdata.c @@ -1,14 +1,13 @@ #include "e.h" -#include "e_mod_main.h" -#include "e_mod_comp_cfdata.h" +#include "e_comp_cfdata.h" EAPI void -e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd) +e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd) { - *match_edd = E_CONFIG_DD_NEW("Comp_Match", Match); + *match_edd = E_CONFIG_DD_NEW("Comp_Match", E_Comp_Match); #undef T #undef D -#define T Match +#define T E_Comp_Match #define D *match_edd E_CONFIG_VAL(D, T, title, STR); E_CONFIG_VAL(D, T, name, STR); @@ -27,10 +26,10 @@ e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd) E_CONFIG_VAL(D, T, urgent, CHAR); E_CONFIG_VAL(D, T, shadow_style, STR); - *conf_edd = E_CONFIG_DD_NEW("Comp_Config", Config); + *conf_edd = E_CONFIG_DD_NEW("Comp_Config", E_Comp_Config); #undef T #undef D -#define T Config +#define T E_Comp_Config #define D *conf_edd E_CONFIG_VAL(D, T, shadow_style, STR); E_CONFIG_VAL(D, T, engine, INT); @@ -60,15 +59,15 @@ e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd) E_CONFIG_LIST(D, T, match.menus, *match_edd); } -EAPI Config * -e_mod_comp_cfdata_config_new(void) +EAPI E_Comp_Config * +e_comp_cfdata_config_new(void) { - Config *cfg; - Match *mat; + E_Comp_Config *cfg; + E_Comp_Match *mat; - cfg = E_NEW(Config, 1); + cfg = E_NEW(E_Comp_Config, 1); cfg->shadow_style = eina_stringshare_add("default"); - cfg->engine = ENGINE_SW; + cfg->engine = E_COMP_ENGINE_SW; cfg->max_unmapped_pixels = 32 * 1024; // implement cfg->max_unmapped_time = 10 * 3600; // implement cfg->min_unmapped_time = 5 * 60; // implement @@ -95,80 +94,80 @@ e_mod_comp_cfdata_config_new(void) cfg->first_draw_delay = 0.15; cfg->match.popups = NULL; - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.popups = eina_list_append(cfg->match.popups, mat); mat->name = eina_stringshare_add("shelf"); mat->shadow_style = eina_stringshare_add("popup"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.popups = eina_list_append(cfg->match.popups, mat); mat->name = eina_stringshare_add("_e_popup_desklock"); mat->shadow_style = eina_stringshare_add("still"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.popups = eina_list_append(cfg->match.popups, mat); mat->name = eina_stringshare_add("_e_popup_notification"); mat->shadow_style = eina_stringshare_add("still"); mat->focus = 1; - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.popups = eina_list_append(cfg->match.popups, mat); mat->shadow_style = eina_stringshare_add("popup"); cfg->match.borders = NULL; - mat = E_NEW(Match, 1); + mat = E_NEW(E_Comp_Match, 1); cfg->match.borders = eina_list_append(cfg->match.borders, mat); mat->fullscreen = 1; mat->shadow_style = eina_stringshare_add("fullscreen"); - + cfg->match.overrides = NULL; - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->name = eina_stringshare_add("E"); mat->clas = eina_stringshare_add("Background_Window"); mat->shadow_style = eina_stringshare_add("none"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->name = eina_stringshare_add("E"); mat->clas = eina_stringshare_add("everything"); mat->shadow_style = eina_stringshare_add("everything"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->name = eina_stringshare_add("E"); mat->clas = eina_stringshare_add("Init_Window"); mat->shadow_style = eina_stringshare_add("still"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->primary_type = ECORE_X_WINDOW_TYPE_DROPDOWN_MENU; mat->shadow_style = eina_stringshare_add("menu"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->primary_type = ECORE_X_WINDOW_TYPE_POPUP_MENU; mat->shadow_style = eina_stringshare_add("menu"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->primary_type = ECORE_X_WINDOW_TYPE_COMBO; mat->shadow_style = eina_stringshare_add("menu"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->primary_type = ECORE_X_WINDOW_TYPE_TOOLTIP; mat->shadow_style = eina_stringshare_add("menu"); - - mat = E_NEW(Match, 1); + + mat = E_NEW(E_Comp_Match, 1); cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); mat->shadow_style = eina_stringshare_add("popup"); cfg->match.menus = NULL; - mat = E_NEW(Match, 1); + mat = E_NEW(E_Comp_Match, 1); cfg->match.menus = eina_list_append(cfg->match.menus, mat); mat->shadow_style = eina_stringshare_add("menu"); @@ -178,7 +177,7 @@ e_mod_comp_cfdata_config_new(void) static void _match_list_free(Eina_List *list) { - Match *m; + E_Comp_Match *m; EINA_LIST_FREE(list, m) { @@ -192,7 +191,7 @@ _match_list_free(Eina_List *list) } EAPI void -e_mod_cfdata_config_free(Config *cfg) +e_comp_cfdata_config_free(E_Comp_Config *cfg) { if (!cfg) return; eina_stringshare_del(cfg->shadow_style); @@ -204,4 +203,3 @@ e_mod_cfdata_config_free(Config *cfg) free(cfg); } - diff --git a/src/modules/comp/e_mod_comp_cfdata.h b/src/bin/e_comp_cfdata.h similarity index 85% rename from src/modules/comp/e_mod_comp_cfdata.h rename to src/bin/e_comp_cfdata.h index 9d20a20c7..749e1a6ee 100644 --- a/src/modules/comp/e_mod_comp_cfdata.h +++ b/src/bin/e_comp_cfdata.h @@ -1,10 +1,10 @@ -#ifndef E_MOD_COMP_CFDATA_H -#define E_MOD_COMP_CFDATA_H - -typedef struct _Config Config; -typedef struct _Match Match; - -struct _Config +#ifdef E_TYPEDEFS +typedef struct _E_Comp_Config E_Comp_Config; +typedef struct _E_Comp_Match E_Comp_Match; +#else +#ifndef E_COMP_CFDATA_H +#define E_COMP_CFDATA_H +struct _E_Comp_Config { const char *shadow_style; int engine; @@ -38,7 +38,7 @@ struct _Config } match; }; -struct _Match +struct _E_Comp_Match { const char *title; // glob - used for borders, NULL if not to be used const char *name; // glob - used for borders, overrides, popups, NULL if not to be used @@ -60,8 +60,9 @@ struct _Match char urgent; // used for setting urgent state (on popups): 1 is urgent, unset is use regular logic }; -EAPI void e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd); -EAPI Config *e_mod_comp_cfdata_config_new(void); -EAPI void e_mod_cfdata_config_free(Config *cfg); +EAPI void e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd); +EAPI E_Comp_Config *e_comp_cfdata_config_new(void); +EAPI void e_comp_cfdata_config_free(E_Comp_Config *cfg); #endif +#endif diff --git a/src/modules/comp/e_mod_comp_update.c b/src/bin/e_comp_update.c similarity index 91% rename from src/modules/comp/e_mod_comp_update.c rename to src/bin/e_comp_update.c index 992917b07..4c59e40d0 100644 --- a/src/modules/comp/e_mod_comp_update.c +++ b/src/bin/e_comp_update.c @@ -1,11 +1,10 @@ #include "e.h" -#include "e_mod_main.h" -#include "e_mod_comp_update.h" +#include "e_comp_update.h" ////////////////////////////////////////////////////////////////////////// static void -_e_mod_comp_tiles_alloc(E_Update *up) +_e_comp_tiles_alloc(E_Update *up) { if (up->tiles) return; up->tiles = calloc(up->tw * up->th, sizeof(unsigned char)); @@ -14,7 +13,7 @@ _e_mod_comp_tiles_alloc(E_Update *up) ////////////////////////////////////////////////////////////////////////// E_Update * -e_mod_comp_update_new(void) +e_comp_update_new(void) { E_Update *up; @@ -26,32 +25,32 @@ e_mod_comp_update_new(void) } void -e_mod_comp_update_free(E_Update *up) +e_comp_update_free(E_Update *up) { free(up->tiles); free(up); } void -e_mod_comp_update_policy_set(E_Update *up, +e_comp_update_policy_set(E_Update *up, E_Update_Policy pol) { up->pol = pol; } void -e_mod_comp_update_tile_size_set(E_Update *up, +e_comp_update_tile_size_set(E_Update *up, int tsw, int tsh) { if ((up->tsw == tsw) && (up->tsh == tsh)) return; up->tsw = tsw; up->tsh = tsh; - e_mod_comp_update_clear(up); + e_comp_update_clear(up); } void -e_mod_comp_update_resize(E_Update *up, +e_comp_update_resize(E_Update *up, int w, int h) { @@ -69,7 +68,7 @@ e_mod_comp_update_resize(E_Update *up, up->tw = (up->w + up->tsw - 1) / up->tsw; up->th = (up->h + up->tsh - 1) / up->tsh; up->tiles = NULL; - _e_mod_comp_tiles_alloc(up); + _e_comp_tiles_alloc(up); if ((ptiles) && (up->tiles)) { if (pth <= up->th) @@ -105,7 +104,7 @@ e_mod_comp_update_resize(E_Update *up, } void -e_mod_comp_update_add(E_Update *up, +e_comp_update_add(E_Update *up, int x, int y, int w, @@ -117,7 +116,7 @@ e_mod_comp_update_add(E_Update *up, if ((w <= 0) || (h <= 0)) return; if ((up->tw <= 0) || (up->th <= 0)) return; - _e_mod_comp_tiles_alloc(up); + _e_comp_tiles_alloc(up); E_RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, up->w, up->h); if ((w <= 0) || (h <= 0)) return; @@ -157,7 +156,7 @@ e_mod_comp_update_add(E_Update *up, } E_Update_Rect * -e_mod_comp_update_rects_get(E_Update *up) +e_comp_update_rects_get(E_Update *up) { E_Update_Rect *r; int ri = 0; @@ -237,7 +236,7 @@ e_mod_comp_update_rects_get(E_Update *up) } void -e_mod_comp_update_clear(E_Update *up) +e_comp_update_clear(E_Update *up) { if (up->tiles) { diff --git a/src/bin/e_comp_update.h b/src/bin/e_comp_update.h new file mode 100644 index 000000000..f2eef1086 --- /dev/null +++ b/src/bin/e_comp_update.h @@ -0,0 +1,46 @@ +#ifdef E_TYPEDEFS +typedef struct _E_Update E_Update; +typedef struct _E_Update_Rect E_Update_Rect; +typedef enum _E_Update_Policy +{ + E_UPDATE_POLICY_RAW, + E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH, +} E_Update_Policy; +#else +#ifndef E_COMP_UPDATE_H +#define E_COMP_UPDATE_H + +struct _E_Update_Rect +{ + int x, y, w, h; +}; + +struct _E_Update +{ + int w, h; + int tw, th; + int tsw, tsh; + unsigned char *tiles; + E_Update_Policy pol; +}; + +E_Update *e_comp_update_new(void); +void e_comp_update_free(E_Update *up); +void e_comp_update_policy_set(E_Update *up, + E_Update_Policy pol); +void e_comp_update_tile_size_set(E_Update *up, + int tsw, + int tsh); +void e_comp_update_resize(E_Update *up, + int w, + int h); +void e_comp_update_add(E_Update *up, + int x, + int y, + int w, + int h); +E_Update_Rect *e_comp_update_rects_get(E_Update *up); +void e_comp_update_clear(E_Update *up); + +#endif +#endif diff --git a/src/modules/comp/e_mod_comp_wl.c b/src/bin/e_comp_wl.c similarity index 78% rename from src/modules/comp/e_mod_comp_wl.c rename to src/bin/e_comp_wl.c index 6e6609195..319183ea4 100644 --- a/src/modules/comp/e_mod_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1,16 +1,15 @@ #include "e.h" -#include "e_mod_main.h" #ifdef HAVE_WAYLAND_CLIENTS # include -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_comp.h" -# include "e_mod_comp_wl_output.h" -# include "e_mod_comp_wl_input.h" -# include "e_mod_comp_wl_shell.h" +# include "e_comp_wl.h" +# include "e_comp_wl_comp.h" +# include "e_comp_wl_output.h" +# include "e_comp_wl_input.h" +# include "e_comp_wl_shell.h" #endif /* local function prototypes */ -static Eina_Bool _e_mod_comp_wl_fd_handle(void *data, Ecore_Fd_Handler *hdl); +static Eina_Bool _e_comp_wl_fd_handle(void *data, Ecore_Fd_Handler *hdl); /* private variables */ static Ecore_Fd_Handler *_wl_fd_handler = NULL; @@ -19,7 +18,7 @@ static Ecore_Fd_Handler *_wl_fd_handler = NULL; struct wl_display *_wl_disp; Eina_Bool -e_mod_comp_wl_init(void) +e_comp_wl_init(void) { struct wl_event_loop *loop; int fd = 0; @@ -41,7 +40,7 @@ e_mod_comp_wl_init(void) } /* init a wayland compositor ?? */ - if (!e_mod_comp_wl_comp_init()) + if (!e_comp_wl_comp_init()) { wl_display_terminate(_wl_disp); EINA_LOG_ERR("Failed to create wayland compositor\n"); @@ -49,30 +48,30 @@ e_mod_comp_wl_init(void) } /* init output */ - if (!e_mod_comp_wl_output_init()) + if (!e_comp_wl_output_init()) { - e_mod_comp_wl_comp_shutdown(); + e_comp_wl_comp_shutdown(); wl_display_terminate(_wl_disp); EINA_LOG_ERR("Failed to create wayland output\n"); return EINA_FALSE; } /* init input */ - if (!e_mod_comp_wl_input_init()) + if (!e_comp_wl_input_init()) { - e_mod_comp_wl_output_shutdown(); - e_mod_comp_wl_comp_shutdown(); + e_comp_wl_output_shutdown(); + e_comp_wl_comp_shutdown(); wl_display_terminate(_wl_disp); EINA_LOG_ERR("Failed to create wayland input\n"); return EINA_FALSE; } /* init a wayland shell */ - if (!e_mod_comp_wl_shell_init()) + if (!e_comp_wl_shell_init()) { - e_mod_comp_wl_input_shutdown(); - e_mod_comp_wl_output_shutdown(); - e_mod_comp_wl_comp_shutdown(); + e_comp_wl_input_shutdown(); + e_comp_wl_output_shutdown(); + e_comp_wl_comp_shutdown(); wl_display_terminate(_wl_disp); EINA_LOG_ERR("Failed to create wayland shell\n"); return EINA_FALSE; @@ -83,7 +82,7 @@ e_mod_comp_wl_init(void) _wl_fd_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ,// | ECORE_FD_WRITE, - _e_mod_comp_wl_fd_handle, NULL, NULL, NULL); + _e_comp_wl_fd_handle, NULL, NULL, NULL); wl_event_loop_dispatch(loop, 0); @@ -91,7 +90,7 @@ e_mod_comp_wl_init(void) } void -e_mod_comp_wl_shutdown(void) +e_comp_wl_shutdown(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -99,17 +98,17 @@ e_mod_comp_wl_shutdown(void) ecore_main_fd_handler_del(_wl_fd_handler); _wl_fd_handler = NULL; - e_mod_comp_wl_shell_shutdown(); - e_mod_comp_wl_input_shutdown(); - e_mod_comp_wl_output_shutdown(); - e_mod_comp_wl_comp_shutdown(); + e_comp_wl_shell_shutdown(); + e_comp_wl_input_shutdown(); + e_comp_wl_output_shutdown(); + e_comp_wl_comp_shutdown(); if (_wl_disp) wl_display_terminate(_wl_disp); _wl_disp = NULL; } uint32_t -e_mod_comp_wl_time_get(void) +e_comp_wl_time_get(void) { struct timeval tv; @@ -118,7 +117,7 @@ e_mod_comp_wl_time_get(void) } Ecore_X_Pixmap -e_mod_comp_wl_pixmap_get(Ecore_X_Window win) +e_comp_wl_pixmap_get(Ecore_X_Window win) { /* Wayland_Compositor *comp; */ /* Wayland_Surface *ws; */ @@ -126,7 +125,7 @@ e_mod_comp_wl_pixmap_get(Ecore_X_Window win) /* LOGFN(__FILE__, __LINE__, __FUNCTION__); */ - /* comp = e_mod_comp_wl_comp_get(); */ + /* comp = e_comp_wl_comp_get(); */ /* if (wl_list_empty(&comp->surfaces)) return 0; */ /* wl_list_for_each(ws, &comp->surfaces, link) */ @@ -180,7 +179,7 @@ e_mod_comp_wl_pixmap_get(Ecore_X_Window win) /* local functions */ static Eina_Bool -_e_mod_comp_wl_fd_handle(void *data __UNUSED__, Ecore_Fd_Handler *hdl) +_e_comp_wl_fd_handle(void *data __UNUSED__, Ecore_Fd_Handler *hdl) { struct wl_event_loop *loop; diff --git a/src/modules/comp/e_mod_comp_wl.h b/src/bin/e_comp_wl.h similarity index 93% rename from src/modules/comp/e_mod_comp_wl.h rename to src/bin/e_comp_wl.h index 98cd0b729..2cfed65e5 100644 --- a/src/modules/comp/e_mod_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -1,7 +1,7 @@ #ifdef E_TYPEDEFS #else -# ifndef E_MOD_COMP_WL_H -# define E_MOD_COMP_WL_H +# ifndef E_COMP_WL_H +# define E_COMP_WL_H # include # include @@ -91,7 +91,7 @@ struct _Wayland_Shell void (*destroy) (Wayland_Shell *shell); }; -struct _Wayland_Shell_Surface +struct _Wayland_Shell_Surface { struct wl_resource resource; Wayland_Surface *surface; @@ -103,7 +103,7 @@ struct _Wayland_Shell_Surface char *title, *clas; - struct + struct { struct wl_pointer_grab grab; uint32_t timestamp; @@ -115,7 +115,7 @@ struct _Wayland_Compositor { struct wl_list surfaces; - struct + struct { EGLDisplay display; EGLContext context; @@ -178,17 +178,17 @@ struct wl_shell struct wl_listener lock_surface_listener; struct wl_list hidden_surfaces; - struct + struct { struct wl_resource *desktop_shell; struct wl_client *client; } child; }; -Eina_Bool e_mod_comp_wl_init(void); -void e_mod_comp_wl_shutdown(void); -uint32_t e_mod_comp_wl_time_get(void); -Ecore_X_Pixmap e_mod_comp_wl_pixmap_get(Ecore_X_Window win); +Eina_Bool e_comp_wl_init(void); +void e_comp_wl_shutdown(void); +uint32_t e_comp_wl_time_get(void); +Ecore_X_Pixmap e_comp_wl_pixmap_get(Ecore_X_Window win); extern struct wl_display *_wl_disp; diff --git a/src/modules/comp/e_mod_comp_wl_buffer.c b/src/bin/e_comp_wl_buffer.c similarity index 81% rename from src/modules/comp/e_mod_comp_wl_buffer.c rename to src/bin/e_comp_wl_buffer.c index c1e4a73e5..eec28ef95 100644 --- a/src/modules/comp/e_mod_comp_wl_buffer.c +++ b/src/bin/e_comp_wl_buffer.c @@ -1,14 +1,13 @@ #include "e.h" -#include "e_mod_main.h" -#include "e_mod_comp.h" +#include "e_comp.h" #ifdef HAVE_WAYLAND_CLIENTS -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_buffer.h" -# include "e_mod_comp_wl_comp.h" +# include "e_comp_wl.h" +# include "e_comp_wl_buffer.h" +# include "e_comp_wl_comp.h" #endif void -e_mod_comp_wl_buffer_post_release(struct wl_buffer *buffer) +e_comp_wl_buffer_post_release(struct wl_buffer *buffer) { if (--buffer->busy_count > 0) return; if (buffer->resource.client) @@ -16,7 +15,7 @@ e_mod_comp_wl_buffer_post_release(struct wl_buffer *buffer) } void -e_mod_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface) +e_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface) { Wayland_Surface *ws; @@ -48,7 +47,7 @@ e_mod_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface { Wayland_Compositor *comp; - comp = e_mod_comp_wl_comp_get(); + comp = e_comp_wl_comp_get(); if (ws->image != EGL_NO_IMAGE_KHR) comp->destroy_image(comp->egl.display, ws->image); ws->image = comp->create_image(comp->egl.display, NULL, diff --git a/src/bin/e_comp_wl_buffer.h b/src/bin/e_comp_wl_buffer.h new file mode 100644 index 000000000..7c5d417bf --- /dev/null +++ b/src/bin/e_comp_wl_buffer.h @@ -0,0 +1,10 @@ +#ifdef E_TYPEDEFS +#else +# ifndef E_COMP_WL_BUFFER_H +# define E_COMP_WL_BUFFER_H + +void e_comp_wl_buffer_post_release(struct wl_buffer *buffer); +void e_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface); + +# endif +#endif diff --git a/src/modules/comp/e_mod_comp_wl_comp.c b/src/bin/e_comp_wl_comp.c similarity index 71% rename from src/modules/comp/e_mod_comp_wl_comp.c rename to src/bin/e_comp_wl_comp.c index 14504c0d5..63c3c3822 100644 --- a/src/modules/comp/e_mod_comp_wl_comp.c +++ b/src/bin/e_comp_wl_comp.c @@ -1,11 +1,10 @@ #include "e.h" -#include "e_mod_main.h" #ifdef HAVE_WAYLAND_CLIENTS -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_comp.h" -# include "e_mod_comp_wl_input.h" -# include "e_mod_comp_wl_surface.h" -# include "e_mod_comp_wl_region.h" +# include "e_comp_wl.h" +# include "e_comp_wl_comp.h" +# include "e_comp_wl_input.h" +# include "e_comp_wl_surface.h" +# include "e_comp_wl_region.h" #endif #ifdef __linux__ @@ -25,47 +24,47 @@ #define MODIFIER_SUPER (1 << 10) /* local function prototypes */ -static Eina_Bool _e_mod_comp_wl_comp_egl_init(void); -static void _e_mod_comp_wl_comp_egl_shutdown(void); -static void _e_mod_comp_wl_comp_destroy(void); -static void _e_mod_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); -static void _e_mod_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id); -static void _e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id); -static void _e_mod_comp_wl_comp_region_destroy(struct wl_resource *resource); -static Eina_Bool _e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event); -static Eina_Bool _e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__); -static Eina_Bool _e_mod_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); -static Eina_Bool _e_mod_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event); -static Eina_Bool _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event); -static Eina_Bool _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event); -static Eina_Bool _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event); -static Eina_Bool _e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event); -static Eina_Bool _e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_comp_egl_init(void); +static void _e_comp_wl_comp_egl_shutdown(void); +static void _e_comp_wl_comp_destroy(void); +static void _e_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); +static void _e_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id); +static void _e_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id); +static void _e_comp_wl_comp_region_destroy(struct wl_resource *resource); +static Eina_Bool _e_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__); +static Eina_Bool _e_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event); +static Eina_Bool _e_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event); -static Wayland_Surface *_e_mod_comp_wl_comp_pick_surface(int32_t x __UNUSED__, int32_t y __UNUSED__, int32_t *sx, int32_t *sy); -static void _e_mod_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t state); +static Wayland_Surface *_e_comp_wl_comp_pick_surface(int32_t x __UNUSED__, int32_t y __UNUSED__, int32_t *sx, int32_t *sy); +static void _e_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t state); /* wayland interfaces */ static const struct wl_compositor_interface _wl_comp_interface = { - _e_mod_comp_wl_comp_surface_create, - _e_mod_comp_wl_comp_region_create + _e_comp_wl_comp_surface_create, + _e_comp_wl_comp_region_create }; static const struct wl_surface_interface _wl_surface_interface = { - e_mod_comp_wl_surface_destroy, - e_mod_comp_wl_surface_attach, - e_mod_comp_wl_surface_damage, - e_mod_comp_wl_surface_frame, - e_mod_comp_wl_surface_set_opaque_region, - e_mod_comp_wl_surface_set_input_region, - e_mod_comp_wl_surface_commit + e_comp_wl_surface_destroy, + e_comp_wl_surface_attach, + e_comp_wl_surface_damage, + e_comp_wl_surface_frame, + e_comp_wl_surface_set_opaque_region, + e_comp_wl_surface_set_input_region, + e_comp_wl_surface_commit }; static const struct wl_region_interface _wl_region_interface = { - e_mod_comp_wl_region_destroy, - e_mod_comp_wl_region_add, - e_mod_comp_wl_region_subtract + e_comp_wl_region_destroy, + e_comp_wl_region_add, + e_comp_wl_region_subtract }; /* private variables */ @@ -73,7 +72,7 @@ static Wayland_Compositor *_wl_comp; static Eina_List *_wl_event_handlers = NULL; Eina_Bool -e_mod_comp_wl_comp_init(void) +e_comp_wl_comp_init(void) { const char *extensions; @@ -87,17 +86,17 @@ e_mod_comp_wl_comp_init(void) memset(_wl_comp, 0, sizeof(*_wl_comp)); - if (!_e_mod_comp_wl_comp_egl_init()) + if (!_e_comp_wl_comp_egl_init()) { EINA_LOG_ERR("Could not initialize egl\n"); free(_wl_comp); return EINA_FALSE; } - _wl_comp->destroy = _e_mod_comp_wl_comp_destroy; + _wl_comp->destroy = _e_comp_wl_comp_destroy; if (!wl_display_add_global(_wl_disp, &wl_compositor_interface, _wl_comp, - _e_mod_comp_wl_comp_bind)) + _e_comp_wl_comp_bind)) { EINA_LOG_ERR("Failed to add compositor to wayland\n"); free(_wl_comp); @@ -138,45 +137,45 @@ e_mod_comp_wl_comp_init(void) _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, - _e_mod_comp_wl_cb_focus_in, NULL)); + _e_comp_wl_cb_focus_in, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, - _e_mod_comp_wl_cb_focus_out, NULL)); + _e_comp_wl_cb_focus_out, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, - _e_mod_comp_wl_cb_mouse_in, NULL)); + _e_comp_wl_cb_mouse_in, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, - _e_mod_comp_wl_cb_mouse_out, NULL)); + _e_comp_wl_cb_mouse_out, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, - _e_mod_comp_wl_cb_mouse_move, NULL)); + _e_comp_wl_cb_mouse_move, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, - _e_mod_comp_wl_cb_mouse_down, NULL)); + _e_comp_wl_cb_mouse_down, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, - _e_mod_comp_wl_cb_mouse_up, NULL)); + _e_comp_wl_cb_mouse_up, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, - _e_mod_comp_wl_cb_key_down, NULL)); + _e_comp_wl_cb_key_down, NULL)); _wl_event_handlers = eina_list_append(_wl_event_handlers, ecore_event_handler_add(ECORE_EVENT_KEY_UP, - _e_mod_comp_wl_cb_key_up, NULL)); + _e_comp_wl_cb_key_up, NULL)); return EINA_TRUE; } void -e_mod_comp_wl_comp_shutdown(void) +e_comp_wl_comp_shutdown(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -186,13 +185,13 @@ e_mod_comp_wl_comp_shutdown(void) } Wayland_Compositor * -e_mod_comp_wl_comp_get(void) +e_comp_wl_comp_get(void) { return _wl_comp; } void -e_mod_comp_wl_comp_repick(struct wl_seat *seat, uint32_t timestamp __UNUSED__) +e_comp_wl_comp_repick(struct wl_seat *seat, uint32_t timestamp __UNUSED__) { Wayland_Surface *ws, *focus; struct wl_pointer *pointer; @@ -200,7 +199,7 @@ e_mod_comp_wl_comp_repick(struct wl_seat *seat, uint32_t timestamp __UNUSED__) if (!(pointer = seat->pointer)) return; ws = - _e_mod_comp_wl_comp_pick_surface(pointer->x, pointer->y, + _e_comp_wl_comp_pick_surface(pointer->x, pointer->y, &pointer->current_x, &pointer->current_y); if (!ws) return; if (&ws->surface != pointer->current) @@ -222,7 +221,7 @@ e_mod_comp_wl_comp_repick(struct wl_seat *seat, uint32_t timestamp __UNUSED__) /* local functions */ static Eina_Bool -_e_mod_comp_wl_comp_egl_init(void) +_e_comp_wl_comp_egl_init(void) { EGLint major, minor, n; EGLint config_attribs[] = @@ -288,7 +287,7 @@ _e_mod_comp_wl_comp_egl_init(void) } static void -_e_mod_comp_wl_comp_egl_shutdown(void) +_e_comp_wl_comp_egl_shutdown(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -299,21 +298,21 @@ _e_mod_comp_wl_comp_egl_shutdown(void) } static void -_e_mod_comp_wl_comp_destroy(void) +_e_comp_wl_comp_destroy(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); if (_wl_comp->has_bind) _wl_comp->unbind_display(_wl_comp->egl.display, _wl_disp); - _e_mod_comp_wl_comp_egl_shutdown(); + _e_comp_wl_comp_egl_shutdown(); if (&_wl_comp->surfaces) wl_list_remove(&_wl_comp->surfaces); free(_wl_comp); } static void -_e_mod_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) +_e_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -322,19 +321,19 @@ _e_mod_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version } static void -_e_mod_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id) +_e_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id) { Wayland_Surface *ws; LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (!(ws = e_mod_comp_wl_surface_create(0, 0, 0, 0))) + if (!(ws = e_comp_wl_surface_create(0, 0, 0, 0))) { wl_resource_post_no_memory(resource); return; } - ws->surface.resource.destroy = e_mod_comp_wl_surface_destroy_surface; + ws->surface.resource.destroy = e_comp_wl_surface_destroy_surface; ws->surface.resource.object.id = id; ws->surface.resource.object.interface = &wl_surface_interface; ws->surface.resource.object.implementation = @@ -345,7 +344,7 @@ _e_mod_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource } static void -_e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id) +_e_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id) { Wayland_Region *region; @@ -356,7 +355,7 @@ _e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource * return; } - region->resource.destroy = _e_mod_comp_wl_comp_region_destroy; + region->resource.destroy = _e_comp_wl_comp_region_destroy; region->resource.object.id = id; region->resource.object.interface = &wl_region_interface; region->resource.object.implementation = @@ -368,7 +367,7 @@ _e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource * } static void -_e_mod_comp_wl_comp_region_destroy(struct wl_resource *resource) +_e_comp_wl_comp_region_destroy(struct wl_resource *resource) { Wayland_Region *region; @@ -378,7 +377,7 @@ _e_mod_comp_wl_comp_region_destroy(struct wl_resource *resource) } static Eina_Bool -_e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event) { Wayland_Input *input; Wayland_Surface *ws; @@ -389,7 +388,7 @@ _e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *eve ev = event; if (wl_list_empty(&_wl_comp->surfaces)) return ECORE_CALLBACK_PASS_ON; - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); wl_list_for_each(ws, &_wl_comp->surfaces, link) { if (((ws->win) && (ws->win->border)) @@ -405,7 +404,7 @@ _e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *eve } static Eina_Bool -_e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) +_e_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) { Wayland_Input *input; /* Ecore_X_Event_Window_Focus_Out *ev; */ @@ -413,7 +412,7 @@ _e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *ev // LOGFN(__FILE__, __LINE__, __FUNCTION__); /* ev = event; */ - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); if ((!input) || (!input->seat.keyboard)) return ECORE_CALLBACK_PASS_ON; wl_keyboard_set_focus(input->seat.keyboard, NULL); @@ -423,7 +422,7 @@ _e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *ev } static Eina_Bool -_e_mod_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event) { Wayland_Input *input; Ecore_X_Event_Mouse_In *ev; @@ -434,20 +433,20 @@ _e_mod_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *eve ev = event; if (wl_list_empty(&_wl_comp->surfaces)) return ECORE_CALLBACK_PASS_ON; - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); ptr = input->seat.pointer; ptr->x = ev->x; ptr->y = ev->y; - timestamp = e_mod_comp_wl_time_get(); - e_mod_comp_wl_comp_repick(&input->seat, timestamp); + timestamp = e_comp_wl_time_get(); + e_comp_wl_comp_repick(&input->seat, timestamp); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event) { Wayland_Input *input; Ecore_X_Event_Mouse_Out *ev; @@ -457,16 +456,16 @@ _e_mod_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *ev ev = event; if (wl_list_empty(&_wl_comp->surfaces)) return ECORE_CALLBACK_PASS_ON; - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); - timestamp = e_mod_comp_wl_time_get(); - e_mod_comp_wl_comp_repick(&input->seat, timestamp); + timestamp = e_comp_wl_time_get(); + e_comp_wl_comp_repick(&input->seat, timestamp); return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event) { Wayland_Input *input; Ecore_Event_Mouse_Move *ev; @@ -479,14 +478,14 @@ _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e ev = event; if (wl_list_empty(&_wl_comp->surfaces)) return ECORE_CALLBACK_PASS_ON; - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); ptr = input->seat.pointer; ptr->x = ev->x; ptr->y = ev->y; - timestamp = e_mod_comp_wl_time_get(); - e_mod_comp_wl_comp_repick(&input->seat, timestamp); + timestamp = e_comp_wl_time_get(); + e_comp_wl_comp_repick(&input->seat, timestamp); interface = ptr->grab->interface; interface->motion(ptr->grab, timestamp, ptr->grab->x, ptr->grab->y); @@ -497,7 +496,7 @@ _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e } static Eina_Bool -_e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event) { Wayland_Input *input; Ecore_Event_Mouse_Button *ev; @@ -525,9 +524,9 @@ _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e break; } - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); ptr = input->seat.pointer; - timestamp = e_mod_comp_wl_time_get(); + timestamp = e_comp_wl_time_get(); if (ptr->button_count == 0) { ptr->grab_button = btn; @@ -549,7 +548,7 @@ _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e } static Eina_Bool -_e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event) { Wayland_Input *input; Ecore_Event_Mouse_Button *ev; @@ -577,12 +576,12 @@ _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *eve break; } - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); ptr = input->seat.pointer; ptr->button_count--; /* TODO: Run binding ?? */ - timestamp = e_mod_comp_wl_time_get(); + timestamp = e_comp_wl_time_get(); ptr->grab->interface->button(ptr->grab, timestamp, btn, 0); if (ptr->button_count == 1) @@ -592,7 +591,7 @@ _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *eve } static Eina_Bool -_e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event) { /* Wayland_Input *input; */ /* Ecore_Event_Key *ev; */ @@ -605,14 +604,14 @@ _e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *eve /* ev = event; */ /* if (wl_list_empty(&_wl_comp->surfaces)) return ECORE_CALLBACK_PASS_ON; */ - /* input = e_mod_comp_wl_input_get(); */ + /* input = e_comp_wl_input_get(); */ /* kbd = input->seat.keyboard; */ - /* timestamp = e_mod_comp_wl_time_get(); */ + /* timestamp = e_comp_wl_time_get(); */ /* key = ecore_x_keysym_keycode_get(ev->key); */ /* input->modifier_state = 0; */ - /* _e_mod_comp_wl_comp_update_modifier(input, key, 1); */ + /* _e_comp_wl_comp_update_modifier(input, key, 1); */ /* end = kbd->keys.data + kbd->keys.size; */ /* for (k = kbd->keys.data; k < end; k++) */ @@ -630,7 +629,7 @@ _e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *eve } static Eina_Bool -_e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event) +_e_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event) { /* Wayland_Input *input; */ /* Ecore_Event_Key *ev; */ @@ -643,13 +642,13 @@ _e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event /* ev = event; */ /* if (wl_list_empty(&_wl_comp->surfaces)) return ECORE_CALLBACK_PASS_ON; */ - /* input = e_mod_comp_wl_input_get(); */ + /* input = e_comp_wl_input_get(); */ /* device = &input->input_device; */ - /* timestamp = e_mod_comp_wl_time_get(); */ + /* timestamp = e_comp_wl_time_get(); */ /* key = ecore_x_keysym_keycode_get(ev->key); */ - /* _e_mod_comp_wl_comp_update_modifier(input, key, 0); */ + /* _e_comp_wl_comp_update_modifier(input, key, 0); */ /* end = device->keys.data + device->keys.size; */ /* for (k = device->keys.data; k < end; k++) */ @@ -667,7 +666,7 @@ _e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event } static Wayland_Surface * -_e_mod_comp_wl_comp_pick_surface(int32_t x __UNUSED__, int32_t y __UNUSED__, int32_t *sx, int32_t *sy) +_e_comp_wl_comp_pick_surface(int32_t x __UNUSED__, int32_t y __UNUSED__, int32_t *sx, int32_t *sy) { Wayland_Surface *ws; @@ -684,7 +683,7 @@ _e_mod_comp_wl_comp_pick_surface(int32_t x __UNUSED__, int32_t y __UNUSED__, int } static void -_e_mod_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t state) +_e_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t state) { uint32_t mod; diff --git a/src/bin/e_comp_wl_comp.h b/src/bin/e_comp_wl_comp.h new file mode 100644 index 000000000..ec89bda52 --- /dev/null +++ b/src/bin/e_comp_wl_comp.h @@ -0,0 +1,12 @@ +#ifdef E_TYPEDEFS +#else +# ifndef E_COMP_WL_COMP_H +# define E_COMP_WL_COMP_H + +Eina_Bool e_comp_wl_comp_init(void); +void e_comp_wl_comp_shutdown(void); +Wayland_Compositor *e_comp_wl_comp_get(void); +void e_comp_wl_comp_repick(struct wl_seat *seat, uint32_t timestamp); + +# endif +#endif diff --git a/src/modules/comp/e_mod_comp_wl_input.c b/src/bin/e_comp_wl_input.c similarity index 69% rename from src/modules/comp/e_mod_comp_wl_input.c rename to src/bin/e_comp_wl_input.c index cfd27007c..142b28441 100644 --- a/src/modules/comp/e_mod_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -1,36 +1,35 @@ #include "e.h" -#include "e_mod_main.h" #ifdef HAVE_WAYLAND_CLIENTS -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_input.h" +# include "e_comp_wl.h" +# include "e_comp_wl_input.h" #endif /* local function prototypes */ -static void _e_mod_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); -static void _e_mod_comp_wl_input_unbind(struct wl_resource *resource); -static void _e_mod_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *resource, unsigned int id); -static void _e_mod_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource *resource, unsigned int id); -static void _e_mod_comp_wl_input_touch_get(struct wl_client *client, struct wl_resource *resource, unsigned int id); -static void _e_mod_comp_wl_input_pointer_cursor_set(struct wl_client *client, struct wl_resource *resource, unsigned int serial, struct wl_resource *surface_resource, int x, int y); +static void _e_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); +static void _e_comp_wl_input_unbind(struct wl_resource *resource); +static void _e_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *resource, unsigned int id); +static void _e_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource *resource, unsigned int id); +static void _e_comp_wl_input_touch_get(struct wl_client *client, struct wl_resource *resource, unsigned int id); +static void _e_comp_wl_input_pointer_cursor_set(struct wl_client *client, struct wl_resource *resource, unsigned int serial, struct wl_resource *surface_resource, int x, int y); /* wayland interfaces */ static const struct wl_seat_interface _wl_seat_interface = { - _e_mod_comp_wl_input_pointer_get, - _e_mod_comp_wl_input_keyboard_get, - _e_mod_comp_wl_input_touch_get + _e_comp_wl_input_pointer_get, + _e_comp_wl_input_keyboard_get, + _e_comp_wl_input_touch_get }; static const struct wl_pointer_interface _wl_pointer_interface = { - _e_mod_comp_wl_input_pointer_cursor_set + _e_comp_wl_input_pointer_cursor_set }; /* private variables */ static Wayland_Input *_wl_input; Eina_Bool -e_mod_comp_wl_input_init(void) +e_comp_wl_input_init(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -44,7 +43,7 @@ e_mod_comp_wl_input_init(void) wl_seat_init(&_wl_input->seat); if (!wl_display_add_global(_wl_disp, &wl_seat_interface, _wl_input, - _e_mod_comp_wl_input_bind)) + _e_comp_wl_input_bind)) { EINA_LOG_ERR("Failed to add input to wayland\n"); free(_wl_input); @@ -58,7 +57,7 @@ e_mod_comp_wl_input_init(void) } void -e_mod_comp_wl_input_shutdown(void) +e_comp_wl_input_shutdown(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -68,14 +67,14 @@ e_mod_comp_wl_input_shutdown(void) } Wayland_Input * -e_mod_comp_wl_input_get(void) +e_comp_wl_input_get(void) { return _wl_input; } /* local functions */ static void -_e_mod_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) +_e_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) { Wayland_Input *input; struct wl_seat *device; @@ -91,7 +90,7 @@ _e_mod_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version wl_client_add_object(client, &wl_seat_interface, &_wl_seat_interface, id, data); wl_list_insert(&device->base_resource_list, &resource->link); - resource->destroy = _e_mod_comp_wl_input_unbind; + resource->destroy = _e_comp_wl_input_unbind; if (device->pointer) caps |= WL_SEAT_CAPABILITY_POINTER; if (device->keyboard) caps |= WL_SEAT_CAPABILITY_KEYBOARD; @@ -101,7 +100,7 @@ _e_mod_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version } static void -_e_mod_comp_wl_input_unbind(struct wl_resource *resource) +_e_comp_wl_input_unbind(struct wl_resource *resource) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -110,7 +109,7 @@ _e_mod_comp_wl_input_unbind(struct wl_resource *resource) } static void -_e_mod_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) +_e_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) { Wayland_Input *wi; struct wl_resource *res; @@ -123,7 +122,7 @@ _e_mod_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *r res = wl_client_add_object(client, &wl_pointer_interface, &_wl_pointer_interface, id, wi); wl_list_insert(&wi->seat.pointer->resource_list, &res->link); - res->destroy = _e_mod_comp_wl_input_unbind; + res->destroy = _e_comp_wl_input_unbind; if ((wi->seat.pointer->focus) && (wi->seat.pointer->focus->resource.client == client)) @@ -137,7 +136,7 @@ _e_mod_comp_wl_input_pointer_get(struct wl_client *client, struct wl_resource *r } static void -_e_mod_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) +_e_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) { Wayland_Input *wi; struct wl_resource *res; @@ -149,7 +148,7 @@ _e_mod_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource * res = wl_client_add_object(client, &wl_keyboard_interface, NULL, id, wi); wl_list_insert(&wi->seat.keyboard->resource_list, &res->link); - res->destroy = _e_mod_comp_wl_input_unbind; + res->destroy = _e_comp_wl_input_unbind; /* TODO: wl_keyboard_send_keymap ?? */ @@ -161,7 +160,7 @@ _e_mod_comp_wl_input_keyboard_get(struct wl_client *client, struct wl_resource * } static void -_e_mod_comp_wl_input_touch_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) +_e_comp_wl_input_touch_get(struct wl_client *client, struct wl_resource *resource, unsigned int id) { Wayland_Input *wi; struct wl_resource *res; @@ -173,11 +172,11 @@ _e_mod_comp_wl_input_touch_get(struct wl_client *client, struct wl_resource *res res = wl_client_add_object(client, &wl_touch_interface, NULL, id, wi); wl_list_insert(&wi->seat.touch->resource_list, &res->link); - res->destroy = _e_mod_comp_wl_input_unbind; + res->destroy = _e_comp_wl_input_unbind; } static void -_e_mod_comp_wl_input_pointer_cursor_set(struct wl_client *client, struct wl_resource *resource, unsigned int serial, struct wl_resource *surface_resource, int x, int y) +_e_comp_wl_input_pointer_cursor_set(struct wl_client *client, struct wl_resource *resource, unsigned int serial, struct wl_resource *surface_resource, int x, int y) { /* Wayland_Input *wi; */ /* Wayland_Surface *ws; */ @@ -219,7 +218,7 @@ _e_mod_comp_wl_input_pointer_cursor_set(struct wl_client *client, struct wl_reso } /* static void */ -/* _e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t serial, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y) */ +/* _e_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t serial, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y) */ /* { */ /* Wayland_Input *wi; */ diff --git a/src/bin/e_comp_wl_input.h b/src/bin/e_comp_wl_input.h new file mode 100644 index 000000000..e1e86278a --- /dev/null +++ b/src/bin/e_comp_wl_input.h @@ -0,0 +1,11 @@ +#ifdef E_TYPEDEFS +#else +# ifndef E_COMP_WL_INPUT_H +# define E_COMP_WL_INPUT_H + +Eina_Bool e_comp_wl_input_init(void); +void e_comp_wl_input_shutdown(void); +Wayland_Input *e_comp_wl_input_get(void); + +# endif +#endif diff --git a/src/modules/comp/e_mod_comp_wl_output.c b/src/bin/e_comp_wl_output.c similarity index 82% rename from src/modules/comp/e_mod_comp_wl_output.c rename to src/bin/e_comp_wl_output.c index ec9f560c6..43a6fd204 100644 --- a/src/modules/comp/e_mod_comp_wl_output.c +++ b/src/bin/e_comp_wl_output.c @@ -1,20 +1,19 @@ #include "e.h" -#include "e_mod_main.h" #ifdef HAVE_WAYLAND_CLIENTS -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_output.h" +# include "e_comp_wl.h" +# include "e_comp_wl_output.h" #endif # define WL_OUTPUT_FLIPPED 0x01 /* local function prototypes */ -static void _e_mod_comp_wl_output_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); +static void _e_comp_wl_output_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); /* private variables */ static Wayland_Output *_wl_output; Eina_Bool -e_mod_comp_wl_output_init(void) +e_comp_wl_output_init(void) { Ecore_X_Window *roots; int num = 0, rw, rh; @@ -54,7 +53,7 @@ e_mod_comp_wl_output_init(void) wl_list_init(&_wl_output->frame_callbacks); if (!wl_display_add_global(_wl_disp, &wl_output_interface, _wl_output, - _e_mod_comp_wl_output_bind)) + _e_comp_wl_output_bind)) { EINA_LOG_ERR("Failed to add output to wayland\n"); free(_wl_output); @@ -65,7 +64,7 @@ e_mod_comp_wl_output_init(void) } void -e_mod_comp_wl_output_shutdown(void) +e_comp_wl_output_shutdown(void) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -76,14 +75,14 @@ e_mod_comp_wl_output_shutdown(void) } Wayland_Output * -e_mod_comp_wl_output_get(void) +e_comp_wl_output_get(void) { return _wl_output; } /* local functions */ static void -_e_mod_comp_wl_output_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) +_e_comp_wl_output_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) { Wayland_Output *output; struct wl_resource *resource; diff --git a/src/bin/e_comp_wl_output.h b/src/bin/e_comp_wl_output.h new file mode 100644 index 000000000..8513f522a --- /dev/null +++ b/src/bin/e_comp_wl_output.h @@ -0,0 +1,11 @@ +#ifdef E_TYPEDEFS +#else +# ifndef E_COMP_WL_OUTPUT_H +# define E_COMP_WL_OUTPUT_H + +Eina_Bool e_comp_wl_output_init(void); +void e_comp_wl_output_shutdown(void); +Wayland_Output *e_comp_wl_output_get(void); + +# endif +#endif diff --git a/src/modules/comp/e_mod_comp_wl_region.c b/src/bin/e_comp_wl_region.c similarity index 51% rename from src/modules/comp/e_mod_comp_wl_region.c rename to src/bin/e_comp_wl_region.c index 4b79790ec..45bed8b61 100644 --- a/src/modules/comp/e_mod_comp_wl_region.c +++ b/src/bin/e_comp_wl_region.c @@ -1,19 +1,18 @@ #include "e.h" -#include "e_mod_main.h" #ifdef HAVE_WAYLAND_CLIENTS -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_comp.h" -# include "e_mod_comp_wl_region.h" +# include "e_comp_wl.h" +# include "e_comp_wl_comp.h" +# include "e_comp_wl_region.h" #endif void -e_mod_comp_wl_region_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource) +e_comp_wl_region_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource) { wl_resource_destroy(resource); } void -e_mod_comp_wl_region_add(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h) +e_comp_wl_region_add(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h) { Wayland_Region *region; @@ -22,7 +21,7 @@ e_mod_comp_wl_region_add(struct wl_client *client __UNUSED__, struct wl_resource } void -e_mod_comp_wl_region_subtract(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h) +e_comp_wl_region_subtract(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h) { Wayland_Region *region; pixman_region32_t rect; diff --git a/src/bin/e_comp_wl_region.h b/src/bin/e_comp_wl_region.h new file mode 100644 index 000000000..478710039 --- /dev/null +++ b/src/bin/e_comp_wl_region.h @@ -0,0 +1,11 @@ +#ifdef E_TYPEDEFS +#else +# ifndef E_COMP_WL_REGION_H +# define E_COMP_WL_REGION_H + +void e_comp_wl_region_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource); +void e_comp_wl_region_add(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h); +void e_comp_wl_region_subtract(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h); + +# endif +#endif diff --git a/src/bin/e_comp_wl_shell.c b/src/bin/e_comp_wl_shell.c new file mode 100644 index 000000000..d811c13a1 --- /dev/null +++ b/src/bin/e_comp_wl_shell.c @@ -0,0 +1,475 @@ +#include "e.h" +#ifdef HAVE_WAYLAND_CLIENTS +# include "e_comp_wl.h" +# include "e_comp_wl_comp.h" +# include "e_comp_wl_output.h" +# include "e_comp_wl_input.h" +# include "e_comp_wl_shell.h" +# include "e_comp_wl_surface.h" +#endif + +/* local function prototypes */ +static void _e_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); +static void _e_comp_wl_shell_lock(Wayland_Shell *base); +static void _e_comp_wl_shell_unlock(Wayland_Shell *base); +static void _e_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t width, int32_t height); +static void _e_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height); +static void _e_comp_wl_shell_destroy(Wayland_Shell *base); +static void _e_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp); + +static void _e_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource); +static void _e_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial); +static void _e_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp); +static void _e_comp_wl_shell_surface_resize(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp, uint32_t edges); +static void _e_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource); +static void _e_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__); +static void _e_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource, uint32_t method __UNUSED__, uint32_t framerate __UNUSED__, struct wl_resource *output_resource __UNUSED__); +static void _e_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource __UNUSED__, uint32_t timestamp __UNUSED__, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__); +static void _e_comp_wl_shell_surface_set_maximized(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__); +static void _e_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title); +static void _e_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *clas); + +static void _e_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__); +static Wayland_Shell_Surface *_e_comp_wl_shell_get_shell_surface(Wayland_Surface *ws); +static void _e_comp_wl_shell_surface_destroy(struct wl_resource *resource); + +/* wayland interfaces */ +static const struct wl_shell_interface _wl_shell_interface = +{ + _e_comp_wl_shell_shell_surface_get +}; +static const struct wl_shell_surface_interface _wl_shell_surface_interface = +{ + _e_comp_wl_shell_surface_pong, + _e_comp_wl_shell_surface_move, + _e_comp_wl_shell_surface_resize, + _e_comp_wl_shell_surface_set_toplevel, + _e_comp_wl_shell_surface_set_transient, + _e_comp_wl_shell_surface_set_fullscreen, + _e_comp_wl_shell_surface_set_popup, + _e_comp_wl_shell_surface_set_maximized, + _e_comp_wl_shell_surface_set_title, + _e_comp_wl_shell_surface_set_class +}; + +/* private variables */ +struct wl_shell *_wl_shell; + +Eina_Bool +e_comp_wl_shell_init(void) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if (!(_wl_shell = malloc(sizeof(*_wl_shell)))) + { + EINA_LOG_ERR("Could not allocate space for shell\n"); + return EINA_FALSE; + } + + memset(_wl_shell, 0, sizeof(*_wl_shell)); + + _wl_shell->shell.lock = _e_comp_wl_shell_lock; + _wl_shell->shell.unlock = _e_comp_wl_shell_unlock; + _wl_shell->shell.map = _e_comp_wl_shell_map; + _wl_shell->shell.configure = _e_comp_wl_shell_configure; + _wl_shell->shell.destroy = _e_comp_wl_shell_destroy; + + if (!wl_display_add_global(_wl_disp, &wl_shell_interface, _wl_shell, + _e_comp_wl_shell_bind)) + { + EINA_LOG_ERR("Could not create shell\n"); + free(_wl_shell); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void +e_comp_wl_shell_shutdown(void) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if (_wl_shell) + _wl_shell->shell.destroy(&_wl_shell->shell); +} + +struct wl_shell * +e_comp_wl_shell_get(void) +{ + return _wl_shell; +} + +/* local functions */ +static void +_e_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) +{ + struct wl_shell *shell; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + shell = data; + wl_client_add_object(client, &wl_shell_interface, &_wl_shell_interface, + id, shell); +} + +static void +_e_comp_wl_shell_lock(Wayland_Shell *base) +{ + struct wl_shell *shell; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + shell = container_of(base, struct wl_shell, shell); +} + +static void +_e_comp_wl_shell_unlock(Wayland_Shell *base) +{ + struct wl_shell *shell; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + shell = container_of(base, struct wl_shell, shell); +} + +static void +_e_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t width, int32_t height) +{ + Wayland_Compositor *comp; + Wayland_Shell_Surface *wss; + struct wl_shell *shell; + struct wl_list *list; + uint32_t type; + Eina_Bool do_configure = EINA_FALSE; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + comp = e_comp_wl_comp_get(); + type = SHELL_SURFACE_NONE; + shell = container_of(base, struct wl_shell, shell); + + if ((wss = _e_comp_wl_shell_get_shell_surface(surface))) + type = wss->type; + + if (shell->locked) + { + list = &shell->hidden_surfaces; + do_configure = EINA_FALSE; + } + else + { + list = &comp->surfaces; + do_configure = EINA_TRUE; + } + + surface->w = width; + surface->h = height; + + switch (type) + { + case SHELL_SURFACE_TOPLEVEL: + surface->x = 10 + random() % 400; + surface->y = 10 + random() % 400; + break; + + default: + wl_list_insert(list, &surface->link); + break; + } + + if (do_configure) + e_comp_wl_surface_configure(surface, surface->x, surface->y, + surface->w, surface->h); + + switch (type) + { + case SHELL_SURFACE_TOPLEVEL: + case SHELL_SURFACE_TRANSIENT: + case SHELL_SURFACE_FULLSCREEN: + if (!shell->locked) + _e_comp_wl_shell_activate(base, surface, e_comp_wl_time_get()); + break; + } +} + +static void +_e_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height) +{ + struct wl_shell *shell; + Wayland_Shell_Surface *wss; + Wayland_Shell_Surface_Type type; + Eina_Bool do_configure = EINA_FALSE; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + type = SHELL_SURFACE_NONE; + shell = container_of(base, struct wl_shell, shell); + do_configure = !shell->locked; + if ((wss = _e_comp_wl_shell_get_shell_surface(surface))) + type = wss->type; + + surface->w = width; + surface->h = height; + + switch (type) + { + case SHELL_SURFACE_SCREENSAVER: + do_configure = !do_configure; + + case SHELL_SURFACE_FULLSCREEN: + break; + + default: + break; + } + + if (do_configure) + e_comp_wl_surface_configure(surface, x, y, width, height); +} + +static void +_e_comp_wl_shell_destroy(Wayland_Shell *base) +{ + struct wl_shell *shell; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + shell = container_of(base, struct wl_shell, shell); + if (shell->child.client) wl_client_destroy(shell->child.client); + free(shell); +} + +static void +_e_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp) +{ + struct wl_shell *shell; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + shell = container_of(base, struct wl_shell, shell); + e_comp_wl_surface_activate(surface, e_comp_wl_input_get(), timestamp); +} + +static void +_e_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) +{ + Wayland_Surface *ws; + Wayland_Shell_Surface *wss; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + ws = surface_resource->data; + if (_e_comp_wl_shell_get_shell_surface(ws)) + { + wl_resource_post_error(surface_resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "get_shell_surface already requested"); + return; + } + + if (!(wss = calloc(1, sizeof(*wss)))) + { + wl_resource_post_no_memory(resource); + return; + } + + wss->resource.destroy = _e_comp_wl_shell_surface_destroy; + wss->resource.object.id = id; + wss->resource.object.interface = &wl_shell_surface_interface; + wss->resource.object.implementation = + (void (* *)(void)) & _wl_shell_surface_interface; + wss->resource.data = wss; + + wss->surface = ws; + wss->surface_destroy_listener.notify = + _e_comp_wl_shell_surface_destroy_handle; + wl_signal_add(&ws->surface.resource.destroy_signal, + &wss->surface_destroy_listener); + + wl_list_init(&wss->link); + + wss->type = SHELL_SURFACE_NONE; + wl_client_add_resource(client, &wss->resource); +} + +static void +_e_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial) +{ + Wayland_Shell_Surface *wss; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + /* TODO: handle ping timer */ +} + +static void +_e_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); +} + +static void +_e_comp_wl_shell_surface_resize(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp, uint32_t edges) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); +} + +static void +_e_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource) +{ + Wayland_Shell_Surface *wss; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + + /* TODO: Surface type reset */ + + e_comp_wl_surface_damage_surface(wss->surface); + wss->type = SHELL_SURFACE_TOPLEVEL; +} + +static void +_e_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__) +{ + Wayland_Shell_Surface *wss, *pss; + Wayland_Surface *ws, *pws; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + pss = parent_resource->data; + ws = wss->surface; + pws = pss->surface; + + /* TODO: Surface type reset */ + + ws->x = pws->x + x; + ws->y = pws->y + y; + + e_comp_wl_surface_damage_surface(ws); + + wss->type = SHELL_SURFACE_TRANSIENT; +} + +static void +_e_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource, uint32_t method __UNUSED__, uint32_t framerate __UNUSED__, struct wl_resource *output_resource __UNUSED__) +{ + Wayland_Shell_Surface *wss; + Wayland_Surface *ws; + Wayland_Output *output; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + ws = wss->surface; + output = e_comp_wl_output_get(); + + wss->saved_x = ws->x; + wss->saved_y = ws->y; + ws->x = (output->w - ws->w) / 2; + ws->y = (output->h - ws->h) / 2; + e_comp_wl_surface_damage_surface(ws); + wss->type = SHELL_SURFACE_FULLSCREEN; +} + +static void +_e_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource __UNUSED__, uint32_t timestamp __UNUSED__, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__) +{ + Wayland_Shell_Surface *wss; + Wayland_Surface *ws; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + ws = wss->surface; + e_comp_wl_surface_damage_surface(ws); + wss->type = SHELL_SURFACE_POPUP; + wss->parent = parent_resource->data; + wss->popup.x = x; + wss->popup.y = y; +} + +static void +_e_comp_wl_shell_surface_set_maximized(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__) +{ + Wayland_Shell_Surface *wss; + Wayland_Surface *ws; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + ws = wss->surface; + /* FIXME: Implement */ +} + +static void +_e_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title) +{ + Wayland_Shell_Surface *wss; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + free(wss->title); + wss->title = strdup(title); +} + +static void +_e_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *clas) +{ + Wayland_Shell_Surface *wss; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + free(wss->clas); + wss->clas = strdup(clas); +} + +static void +_e_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__) +{ + Wayland_Shell_Surface *wss; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = container_of(listener, Wayland_Shell_Surface, surface_destroy_listener); + wss->surface = NULL; + wl_resource_destroy(&wss->resource); +} + +static Wayland_Shell_Surface * +_e_comp_wl_shell_get_shell_surface(Wayland_Surface *ws) +{ + struct wl_listener *listener; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + listener = + wl_signal_get(&ws->surface.resource.destroy_signal, + _e_comp_wl_shell_surface_destroy_handle); + if (listener) + return container_of(listener, Wayland_Shell_Surface, + surface_destroy_listener); + return NULL; +} + +static void +_e_comp_wl_shell_surface_destroy(struct wl_resource *resource) +{ + Wayland_Shell_Surface *wss; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + wss = resource->data; + + /* TODO: popup grab input */ + + if (wss->surface) wl_list_remove(&wss->surface_destroy_listener.link); + wl_list_remove(&wss->link); + free(wss); +} + diff --git a/src/bin/e_comp_wl_shell.h b/src/bin/e_comp_wl_shell.h new file mode 100644 index 000000000..e136fc160 --- /dev/null +++ b/src/bin/e_comp_wl_shell.h @@ -0,0 +1,11 @@ +#ifdef E_TYPEDEFS +#else +# ifndef E_COMP_WL_SHELL_H +# define E_COMP_WL_SHELL_H + +Eina_Bool e_comp_wl_shell_init(void); +void e_comp_wl_shell_shutdown(void); +struct wl_shell *e_comp_wl_shell_get(void); + +# endif +#endif diff --git a/src/modules/comp/e_mod_comp_wl_surface.c b/src/bin/e_comp_wl_surface.c similarity index 66% rename from src/modules/comp/e_mod_comp_wl_surface.c rename to src/bin/e_comp_wl_surface.c index d6ebd6039..48b36e4f2 100644 --- a/src/modules/comp/e_mod_comp_wl_surface.c +++ b/src/bin/e_comp_wl_surface.c @@ -1,23 +1,22 @@ #include "e.h" -#include "e_mod_main.h" #ifdef HAVE_WAYLAND_CLIENTS -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_comp.h" -# include "e_mod_comp_wl_output.h" -# include "e_mod_comp_wl_input.h" -# include "e_mod_comp_wl_shell.h" -# include "e_mod_comp_wl_surface.h" -# include "e_mod_comp_wl_buffer.h" +# include "e_comp_wl.h" +# include "e_comp_wl_comp.h" +# include "e_comp_wl_output.h" +# include "e_comp_wl_input.h" +# include "e_comp_wl_shell.h" +# include "e_comp_wl_surface.h" +# include "e_comp_wl_buffer.h" #endif /* local function prototypes */ -static void _e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void *data __UNUSED__); -static void _e_mod_comp_wl_surface_raise(Wayland_Surface *ws); -static void _e_mod_comp_wl_surface_damage_rectangle(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height); -static void _e_mod_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource); +static void _e_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void *data __UNUSED__); +static void _e_comp_wl_surface_raise(Wayland_Surface *ws); +static void _e_comp_wl_surface_damage_rectangle(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height); +static void _e_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource); Wayland_Surface * -e_mod_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h) +e_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h) { Wayland_Surface *ws; @@ -52,7 +51,7 @@ e_mod_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h) wl_list_init(&ws->frame_callbacks); ws->buffer_destroy_listener.notify = - _e_mod_comp_wl_surface_buffer_destroy_handle; + _e_comp_wl_surface_buffer_destroy_handle; /* ws->transform = NULL; */ @@ -60,7 +59,7 @@ e_mod_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h) } void -e_mod_comp_wl_surface_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource) +e_comp_wl_surface_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -68,7 +67,7 @@ e_mod_comp_wl_surface_destroy(struct wl_client *client __UNUSED__, struct wl_res } void -e_mod_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t x, int32_t y) +e_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t x, int32_t y) { Wayland_Surface *ws; struct wl_buffer *buffer; @@ -78,13 +77,13 @@ e_mod_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_reso ws = resource->data; buffer = buffer_resource->data; - shell = e_mod_comp_wl_shell_get(); + shell = e_comp_wl_shell_get(); /* TODO: damage below ?? */ if (ws->buffer) { - e_mod_comp_wl_buffer_post_release(ws->buffer); + e_comp_wl_buffer_post_release(ws->buffer); wl_list_remove(&ws->buffer_destroy_listener.link); } @@ -100,22 +99,22 @@ e_mod_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_reso shell->shell.configure(&shell->shell, ws, ws->x + x, ws->y + y, buffer->width, buffer->height); - e_mod_comp_wl_buffer_attach(buffer, &ws->surface); + e_comp_wl_buffer_attach(buffer, &ws->surface); } void -e_mod_comp_wl_surface_damage(struct wl_client *client __UNUSED__, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) +e_comp_wl_surface_damage(struct wl_client *client __UNUSED__, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { Wayland_Surface *ws; LOGFN(__FILE__, __LINE__, __FUNCTION__); ws = resource->data; - _e_mod_comp_wl_surface_damage_rectangle(ws, x, y, width, height); + _e_comp_wl_surface_damage_rectangle(ws, x, y, width, height); } void -e_mod_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback) +e_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback) { Wayland_Surface *ws; Wayland_Frame_Callback *cb; @@ -131,7 +130,7 @@ e_mod_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resour cb->resource.object.interface = &wl_callback_interface; cb->resource.object.id = callback; - cb->resource.destroy = _e_mod_comp_wl_surface_frame_destroy_callback; + cb->resource.destroy = _e_comp_wl_surface_frame_destroy_callback; cb->resource.client = client; cb->resource.data = cb; @@ -140,7 +139,7 @@ e_mod_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resour } void -e_mod_comp_wl_surface_set_opaque_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource) +e_comp_wl_surface_set_opaque_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource) { Wayland_Surface *ws; @@ -161,7 +160,7 @@ e_mod_comp_wl_surface_set_opaque_region(struct wl_client *client __UNUSED__, str } void -e_mod_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource) +e_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource) { Wayland_Surface *ws; Wayland_Input *input; @@ -180,12 +179,12 @@ e_mod_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, stru else pixman_region32_init_rect(&ws->input, 0, 0, ws->w, ws->h); - input = e_mod_comp_wl_input_get(); - e_mod_comp_wl_comp_repick(&input->seat, e_mod_comp_wl_time_get()); + input = e_comp_wl_input_get(); + e_comp_wl_comp_repick(&input->seat, e_comp_wl_time_get()); } void -e_mod_comp_wl_surface_commit(struct wl_client *client, struct wl_resource *resource) +e_comp_wl_surface_commit(struct wl_client *client, struct wl_resource *resource) { Wayland_Surface *ws; pixman_region32_t opaque; @@ -196,8 +195,8 @@ e_mod_comp_wl_surface_commit(struct wl_client *client, struct wl_resource *resou /* TODO: handle 'pending' ?? */ - e_mod_comp_wl_surface_configure(ws, ws->x, ws->y, ws->w, ws->h); - e_mod_comp_wl_surface_damage_surface(ws); + e_comp_wl_surface_configure(ws, ws->x, ws->y, ws->w, ws->h); + e_comp_wl_surface_damage_surface(ws); pixman_region32_init_rect(&opaque, 0, 0, ws->w, ws->h); pixman_region32_intersect(&opaque, &opaque, &ws->opaque); @@ -216,7 +215,7 @@ e_mod_comp_wl_surface_commit(struct wl_client *client, struct wl_resource *resou } void -e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource) +e_comp_wl_surface_destroy_surface(struct wl_resource *resource) { Wayland_Surface *ws; Wayland_Input *input; @@ -228,13 +227,13 @@ e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource) /* TODO: damage below */ /* TODO: flush damage */ - input = e_mod_comp_wl_input_get(); + input = e_comp_wl_input_get(); if (ws->win) e_object_del(E_OBJECT(ws->win)); wl_list_remove(&ws->link); - e_mod_comp_wl_comp_repick(&input->seat, e_mod_comp_wl_time_get()); + e_comp_wl_comp_repick(&input->seat, e_comp_wl_time_get()); if (ws->texture) glDeleteTextures(1, &ws->texture); @@ -245,7 +244,7 @@ e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource) { Wayland_Compositor *comp; - comp = e_mod_comp_wl_comp_get(); + comp = e_comp_wl_comp_get(); comp->destroy_image(comp->egl.display, ws->image); } @@ -258,7 +257,7 @@ e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource) } void -e_mod_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height) +e_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -278,13 +277,13 @@ e_mod_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32 { Wayland_Output *output; - output = e_mod_comp_wl_output_get(); + output = e_comp_wl_output_get(); wl_list_insert_list(output->frame_callbacks.prev, &ws->frame_callbacks); wl_list_init(&ws->frame_callbacks); } - e_mod_comp_wl_surface_damage_surface(ws); + e_comp_wl_surface_damage_surface(ws); pixman_region32_fini(&ws->opaque); if (ws->visual == WAYLAND_RGB_VISUAL) @@ -294,7 +293,7 @@ e_mod_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32 } void -e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t timestamp __UNUSED__) +e_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t timestamp __UNUSED__) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -304,7 +303,7 @@ e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t ws->win->border->borderless = EINA_TRUE; } - _e_mod_comp_wl_surface_raise(ws); + _e_comp_wl_surface_raise(ws); if (wi->seat.keyboard) { @@ -316,16 +315,16 @@ e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t } void -e_mod_comp_wl_surface_damage_surface(Wayland_Surface *ws) +e_comp_wl_surface_damage_surface(Wayland_Surface *ws) { LOGFN(__FILE__, __LINE__, __FUNCTION__); - _e_mod_comp_wl_surface_damage_rectangle(ws, 0, 0, ws->w, ws->h); + _e_comp_wl_surface_damage_rectangle(ws, 0, 0, ws->w, ws->h); } /* local functions */ static void -_e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void *data __UNUSED__) +_e_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void *data __UNUSED__) { Wayland_Surface *ws; @@ -336,24 +335,24 @@ _e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void } static void -_e_mod_comp_wl_surface_raise(Wayland_Surface *ws) +_e_comp_wl_surface_raise(Wayland_Surface *ws) { Wayland_Compositor *comp; Wayland_Input *input; LOGFN(__FILE__, __LINE__, __FUNCTION__); - comp = e_mod_comp_wl_comp_get(); - input = e_mod_comp_wl_input_get(); + comp = e_comp_wl_comp_get(); + input = e_comp_wl_input_get(); wl_list_remove(&ws->link); wl_list_insert(&comp->surfaces, &ws->link); - e_mod_comp_wl_comp_repick(&input->seat, e_mod_comp_wl_time_get()); - e_mod_comp_wl_surface_damage_surface(ws); + e_comp_wl_comp_repick(&input->seat, e_comp_wl_time_get()); + e_comp_wl_surface_damage_surface(ws); } static void -_e_mod_comp_wl_surface_damage_rectangle(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height) +_e_comp_wl_surface_damage_rectangle(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -362,7 +361,7 @@ _e_mod_comp_wl_surface_damage_rectangle(Wayland_Surface *ws, int32_t x, int32_t } static void -_e_mod_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource) +_e_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource) { Wayland_Frame_Callback *cb; diff --git a/src/bin/e_comp_wl_surface.h b/src/bin/e_comp_wl_surface.h new file mode 100644 index 000000000..f1f828531 --- /dev/null +++ b/src/bin/e_comp_wl_surface.h @@ -0,0 +1,20 @@ +#ifdef E_TYPEDEFS +#else +# ifndef E_COMP_WL_SURFACE_H +# define E_COMP_WL_SURFACE_H + +Wayland_Surface *e_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h); +void e_comp_wl_surface_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource); +void e_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t x, int32_t y); +void e_comp_wl_surface_damage(struct wl_client *client __UNUSED__, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); +void e_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback); +void e_comp_wl_surface_set_opaque_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource); +void e_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource); +void e_comp_wl_surface_commit(struct wl_client *client, struct wl_resource *resource); +void e_comp_wl_surface_destroy_surface(struct wl_resource *resource); +void e_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height); +void e_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t timestamp); +void e_comp_wl_surface_damage_surface(Wayland_Surface *ws); + +# endif +#endif diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h index b72097b82..5f75e10ad 100644 --- a/src/bin/e_includes.h +++ b/src/bin/e_includes.h @@ -150,3 +150,6 @@ #include "e_widget_filepreview.h" #include "e_dbusmenu.h" #include "e_notification.h" +#include "e_comp.h" +#include "e_comp_cfdata.h" +#include "e_comp_update.h" diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 0917e2d98..d87671826 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -664,7 +664,12 @@ main(int argc, char **argv) } e_screensaver_preinit(); - + + TS("E_Comp Init"); + e_comp_init(); + TS("E_Comp Init Done"); + _e_main_shutdown_push(e_comp_shutdown); + if (e_config->show_splash) e_init_status_set(_("Setup Screens")); TS("Screens Init"); diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index b268d1083..b6bcd99e5 100644 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -94,6 +94,10 @@ if USE_MODULE_CONF2 include Makefile_conf2.am endif +if USE_MODULE_CONF_COMP +include Makefile_conf_comp.am +endif + if USE_MODULE_CONF_WALLPAPER2 include Makefile_conf_wallpaper2.am endif @@ -198,10 +202,6 @@ if USE_MODULE_APPMENU include Makefile_appmenu.am endif -if USE_MODULE_COMP -include Makefile_comp.am -endif - if USE_MODULE_PHYSICS include Makefile_physics.am endif diff --git a/src/modules/Makefile_comp.am b/src/modules/Makefile_comp.am deleted file mode 100644 index 872155cfd..000000000 --- a/src/modules/Makefile_comp.am +++ /dev/null @@ -1,45 +0,0 @@ -compdir = $(MDIR)/comp -comp_DATA = comp/e-module-comp.edj \ - comp/module.desktop - -EXTRA_DIST += $(comp_DATA) - -comppkgdir = $(MDIR)/comp/$(MODULE_ARCH) -comppkg_LTLIBRARIES = comp/module.la - -comp_module_la_SOURCES = comp/e_mod_main.h \ - comp/e_mod_main.c \ - comp/e_mod_config.c \ - comp/e_mod_config.h \ - comp/e_mod_comp.c \ - comp/e_mod_comp.h \ - comp/e_mod_comp_update.c \ - comp/e_mod_comp_update.h \ - comp/e_mod_comp_cfdata.c \ - comp/e_mod_comp_cfdata.h - -if HAVE_WAYLAND_CLIENTS -comp_module_la_SOURCES += comp/e_mod_comp_wl.h \ - comp/e_mod_comp_wl.c \ - comp/e_mod_comp_wl_comp.h \ - comp/e_mod_comp_wl_comp.c \ - comp/e_mod_comp_wl_output.h \ - comp/e_mod_comp_wl_output.c \ - comp/e_mod_comp_wl_input.h \ - comp/e_mod_comp_wl_input.c \ - comp/e_mod_comp_wl_shell.h \ - comp/e_mod_comp_wl_shell.c \ - comp/e_mod_comp_wl_surface.h \ - comp/e_mod_comp_wl_surface.c \ - comp/e_mod_comp_wl_buffer.h \ - comp/e_mod_comp_wl_buffer.c \ - comp/e_mod_comp_wl_region.h \ - comp/e_mod_comp_wl_region.c -endif - -comp_module_la_CFLAGS = $(AM_CFLAGS) @WAYLAND_CFLAGS@ -comp_module_la_LIBADD = @WAYLAND_LIBS@ - -.PHONY: comp install-comp -comp: $(comppkg_LTLIBRARIES) $(comp_DATA) -install-comp: install-compDATA install-comppkgLTLIBRARIES diff --git a/src/modules/Makefile_conf_comp.am b/src/modules/Makefile_conf_comp.am new file mode 100644 index 000000000..f97f2e05b --- /dev/null +++ b/src/modules/Makefile_conf_comp.am @@ -0,0 +1,17 @@ +conf_compdir = $(MDIR)/conf_comp +conf_comp_DATA = conf_comp/e-module-comp.edj \ + conf_comp/module.desktop + +EXTRA_DIST += $(comp_DATA) + +conf_comppkgdir = $(MDIR)/conf_comp/$(MODULE_ARCH) +conf_comppkg_LTLIBRARIES = conf_comp/module.la + +conf_comp_module_la_SOURCES = conf_comp/e_mod_main.h \ + conf_comp/e_mod_main.c \ + conf_comp/e_mod_config.c \ + conf_comp/e_mod_config.h + +.PHONY: conf_comp install-conf_comp +conf_comp: $(conf_mppkg_LTLIBRARIES) $(conf_comp_DATA) +install-conf_comp: install-conf_compDATA install-conf_comppkgLTLIBRARIES diff --git a/src/modules/Makefile_wizard.am b/src/modules/Makefile_wizard.am index b3e3a1af5..07f63b272 100644 --- a/src/modules/Makefile_wizard.am +++ b/src/modules/Makefile_wizard.am @@ -79,27 +79,7 @@ wizard_page_130_la_SOURCES = wizard/page_130.c wizard_page_140_la_SOURCES = wizard/page_140.c -wizard/e_mod_comp_main.h: $(abs_top_srcdir)/src/modules/comp/e_mod_main.h - $(AM_V_GEN) $(LN_S) -f $< $@ - -wizard/e_mod_comp_cfdata.h: $(abs_top_srcdir)/src/modules/comp/e_mod_comp_cfdata.h - $(AM_V_GEN) $(LN_S) -f $< $@ - -wizard/e_mod_comp_cfdata.c: $(top_srcdir)/src/modules/comp/e_mod_comp_cfdata.c wizard/e_mod_comp_main.h wizard/e_mod_comp_cfdata.h - $(AM_V_GEN) $(SED) 's/e_mod_main\.h/e_mod_comp_main.h/g' $< > $@ - -$(wizard_page_150_la_OBJECTS): wizard/e_mod_comp_cfdata.c - -CLEANFILES += wizard/e_mod_comp_cfdata.c \ - wizard/e_mod_comp_cfdata.h \ - wizard/e_mod_comp_main.h - -wizard_page_150_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/wizard/ wizard_page_150_la_SOURCES = wizard/page_150.c -nodist_wizard_page_150_la_SOURCES = wizard/e_mod_comp_cfdata.c \ - wizard/e_mod_comp_cfdata.h \ - wizard/e_mod_comp_main.h - wizard_page_160_la_SOURCES = wizard/page_160.c diff --git a/src/modules/comp/e_mod_comp_update.h b/src/modules/comp/e_mod_comp_update.h deleted file mode 100644 index 6adc2e7ca..000000000 --- a/src/modules/comp/e_mod_comp_update.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifdef E_TYPEDEFS -#else -#ifndef E_MOD_COMP_UPDATE_H -#define E_MOD_COMP_UPDATE_H - -typedef struct _E_Update E_Update; -typedef struct _E_Update_Rect E_Update_Rect; -typedef enum _E_Update_Policy -{ - E_UPDATE_POLICY_RAW, - E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH, -} E_Update_Policy; - -struct _E_Update_Rect -{ - int x, y, w, h; -}; - -struct _E_Update -{ - int w, h; - int tw, th; - int tsw, tsh; - unsigned char *tiles; - E_Update_Policy pol; -}; - -E_Update *e_mod_comp_update_new(void); -void e_mod_comp_update_free(E_Update *up); -void e_mod_comp_update_policy_set(E_Update *up, - E_Update_Policy pol); -void e_mod_comp_update_tile_size_set(E_Update *up, - int tsw, - int tsh); -void e_mod_comp_update_resize(E_Update *up, - int w, - int h); -void e_mod_comp_update_add(E_Update *up, - int x, - int y, - int w, - int h); -E_Update_Rect *e_mod_comp_update_rects_get(E_Update *up); -void e_mod_comp_update_clear(E_Update *up); - -#endif -#endif diff --git a/src/modules/comp/e_mod_comp_wl_buffer.h b/src/modules/comp/e_mod_comp_wl_buffer.h deleted file mode 100644 index ed57a136f..000000000 --- a/src/modules/comp/e_mod_comp_wl_buffer.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifdef E_TYPEDEFS -#else -# ifndef E_MOD_COMP_WL_BUFFER_H -# define E_MOD_COMP_WL_BUFFER_H - -void e_mod_comp_wl_buffer_post_release(struct wl_buffer *buffer); -void e_mod_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface); - -# endif -#endif diff --git a/src/modules/comp/e_mod_comp_wl_comp.h b/src/modules/comp/e_mod_comp_wl_comp.h deleted file mode 100644 index 769511648..000000000 --- a/src/modules/comp/e_mod_comp_wl_comp.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef E_TYPEDEFS -#else -# ifndef E_MOD_COMP_WL_COMP_H -# define E_MOD_COMP_WL_COMP_H - -Eina_Bool e_mod_comp_wl_comp_init(void); -void e_mod_comp_wl_comp_shutdown(void); -Wayland_Compositor *e_mod_comp_wl_comp_get(void); -void e_mod_comp_wl_comp_repick(struct wl_seat *seat, uint32_t timestamp); - -# endif -#endif diff --git a/src/modules/comp/e_mod_comp_wl_input.h b/src/modules/comp/e_mod_comp_wl_input.h deleted file mode 100644 index 7db777af8..000000000 --- a/src/modules/comp/e_mod_comp_wl_input.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef E_TYPEDEFS -#else -# ifndef E_MOD_COMP_WL_INPUT_H -# define E_MOD_COMP_WL_INPUT_H - -Eina_Bool e_mod_comp_wl_input_init(void); -void e_mod_comp_wl_input_shutdown(void); -Wayland_Input *e_mod_comp_wl_input_get(void); - -# endif -#endif diff --git a/src/modules/comp/e_mod_comp_wl_output.h b/src/modules/comp/e_mod_comp_wl_output.h deleted file mode 100644 index 21fa8e5d2..000000000 --- a/src/modules/comp/e_mod_comp_wl_output.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef E_TYPEDEFS -#else -# ifndef E_MOD_COMP_WL_OUTPUT_H -# define E_MOD_COMP_WL_OUTPUT_H - -Eina_Bool e_mod_comp_wl_output_init(void); -void e_mod_comp_wl_output_shutdown(void); -Wayland_Output *e_mod_comp_wl_output_get(void); - -# endif -#endif diff --git a/src/modules/comp/e_mod_comp_wl_region.h b/src/modules/comp/e_mod_comp_wl_region.h deleted file mode 100644 index d7d731e53..000000000 --- a/src/modules/comp/e_mod_comp_wl_region.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef E_TYPEDEFS -#else -# ifndef E_MOD_COMP_WL_REGION_H -# define E_MOD_COMP_WL_REGION_H - -void e_mod_comp_wl_region_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource); -void e_mod_comp_wl_region_add(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h); -void e_mod_comp_wl_region_subtract(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h); - -# endif -#endif diff --git a/src/modules/comp/e_mod_comp_wl_shell.c b/src/modules/comp/e_mod_comp_wl_shell.c deleted file mode 100644 index 8437d5d90..000000000 --- a/src/modules/comp/e_mod_comp_wl_shell.c +++ /dev/null @@ -1,476 +0,0 @@ -#include "e.h" -#include "e_mod_main.h" -#ifdef HAVE_WAYLAND_CLIENTS -# include "e_mod_comp_wl.h" -# include "e_mod_comp_wl_comp.h" -# include "e_mod_comp_wl_output.h" -# include "e_mod_comp_wl_input.h" -# include "e_mod_comp_wl_shell.h" -# include "e_mod_comp_wl_surface.h" -#endif - -/* local function prototypes */ -static void _e_mod_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id); -static void _e_mod_comp_wl_shell_lock(Wayland_Shell *base); -static void _e_mod_comp_wl_shell_unlock(Wayland_Shell *base); -static void _e_mod_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t width, int32_t height); -static void _e_mod_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height); -static void _e_mod_comp_wl_shell_destroy(Wayland_Shell *base); -static void _e_mod_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp); - -static void _e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource); -static void _e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial); -static void _e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp); -static void _e_mod_comp_wl_shell_surface_resize(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp, uint32_t edges); -static void _e_mod_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource); -static void _e_mod_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__); -static void _e_mod_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource, uint32_t method __UNUSED__, uint32_t framerate __UNUSED__, struct wl_resource *output_resource __UNUSED__); -static void _e_mod_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource __UNUSED__, uint32_t timestamp __UNUSED__, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__); -static void _e_mod_comp_wl_shell_surface_set_maximized(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__); -static void _e_mod_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title); -static void _e_mod_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *clas); - -static void _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__); -static Wayland_Shell_Surface *_e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws); -static void _e_mod_comp_wl_shell_surface_destroy(struct wl_resource *resource); - -/* wayland interfaces */ -static const struct wl_shell_interface _wl_shell_interface = -{ - _e_mod_comp_wl_shell_shell_surface_get -}; -static const struct wl_shell_surface_interface _wl_shell_surface_interface = -{ - _e_mod_comp_wl_shell_surface_pong, - _e_mod_comp_wl_shell_surface_move, - _e_mod_comp_wl_shell_surface_resize, - _e_mod_comp_wl_shell_surface_set_toplevel, - _e_mod_comp_wl_shell_surface_set_transient, - _e_mod_comp_wl_shell_surface_set_fullscreen, - _e_mod_comp_wl_shell_surface_set_popup, - _e_mod_comp_wl_shell_surface_set_maximized, - _e_mod_comp_wl_shell_surface_set_title, - _e_mod_comp_wl_shell_surface_set_class -}; - -/* private variables */ -struct wl_shell *_wl_shell; - -Eina_Bool -e_mod_comp_wl_shell_init(void) -{ - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - if (!(_wl_shell = malloc(sizeof(*_wl_shell)))) - { - EINA_LOG_ERR("Could not allocate space for shell\n"); - return EINA_FALSE; - } - - memset(_wl_shell, 0, sizeof(*_wl_shell)); - - _wl_shell->shell.lock = _e_mod_comp_wl_shell_lock; - _wl_shell->shell.unlock = _e_mod_comp_wl_shell_unlock; - _wl_shell->shell.map = _e_mod_comp_wl_shell_map; - _wl_shell->shell.configure = _e_mod_comp_wl_shell_configure; - _wl_shell->shell.destroy = _e_mod_comp_wl_shell_destroy; - - if (!wl_display_add_global(_wl_disp, &wl_shell_interface, _wl_shell, - _e_mod_comp_wl_shell_bind)) - { - EINA_LOG_ERR("Could not create shell\n"); - free(_wl_shell); - return EINA_FALSE; - } - - return EINA_TRUE; -} - -void -e_mod_comp_wl_shell_shutdown(void) -{ - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - if (_wl_shell) - _wl_shell->shell.destroy(&_wl_shell->shell); -} - -struct wl_shell * -e_mod_comp_wl_shell_get(void) -{ - return _wl_shell; -} - -/* local functions */ -static void -_e_mod_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id) -{ - struct wl_shell *shell; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - shell = data; - wl_client_add_object(client, &wl_shell_interface, &_wl_shell_interface, - id, shell); -} - -static void -_e_mod_comp_wl_shell_lock(Wayland_Shell *base) -{ - struct wl_shell *shell; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - shell = container_of(base, struct wl_shell, shell); -} - -static void -_e_mod_comp_wl_shell_unlock(Wayland_Shell *base) -{ - struct wl_shell *shell; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - shell = container_of(base, struct wl_shell, shell); -} - -static void -_e_mod_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t width, int32_t height) -{ - Wayland_Compositor *comp; - Wayland_Shell_Surface *wss; - struct wl_shell *shell; - struct wl_list *list; - uint32_t type; - Eina_Bool do_configure = EINA_FALSE; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - comp = e_mod_comp_wl_comp_get(); - type = SHELL_SURFACE_NONE; - shell = container_of(base, struct wl_shell, shell); - - if ((wss = _e_mod_comp_wl_shell_get_shell_surface(surface))) - type = wss->type; - - if (shell->locked) - { - list = &shell->hidden_surfaces; - do_configure = EINA_FALSE; - } - else - { - list = &comp->surfaces; - do_configure = EINA_TRUE; - } - - surface->w = width; - surface->h = height; - - switch (type) - { - case SHELL_SURFACE_TOPLEVEL: - surface->x = 10 + random() % 400; - surface->y = 10 + random() % 400; - break; - - default: - wl_list_insert(list, &surface->link); - break; - } - - if (do_configure) - e_mod_comp_wl_surface_configure(surface, surface->x, surface->y, - surface->w, surface->h); - - switch (type) - { - case SHELL_SURFACE_TOPLEVEL: - case SHELL_SURFACE_TRANSIENT: - case SHELL_SURFACE_FULLSCREEN: - if (!shell->locked) - _e_mod_comp_wl_shell_activate(base, surface, e_mod_comp_wl_time_get()); - break; - } -} - -static void -_e_mod_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height) -{ - struct wl_shell *shell; - Wayland_Shell_Surface *wss; - Wayland_Shell_Surface_Type type; - Eina_Bool do_configure = EINA_FALSE; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - type = SHELL_SURFACE_NONE; - shell = container_of(base, struct wl_shell, shell); - do_configure = !shell->locked; - if ((wss = _e_mod_comp_wl_shell_get_shell_surface(surface))) - type = wss->type; - - surface->w = width; - surface->h = height; - - switch (type) - { - case SHELL_SURFACE_SCREENSAVER: - do_configure = !do_configure; - - case SHELL_SURFACE_FULLSCREEN: - break; - - default: - break; - } - - if (do_configure) - e_mod_comp_wl_surface_configure(surface, x, y, width, height); -} - -static void -_e_mod_comp_wl_shell_destroy(Wayland_Shell *base) -{ - struct wl_shell *shell; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - shell = container_of(base, struct wl_shell, shell); - if (shell->child.client) wl_client_destroy(shell->child.client); - free(shell); -} - -static void -_e_mod_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp) -{ - struct wl_shell *shell; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - shell = container_of(base, struct wl_shell, shell); - e_mod_comp_wl_surface_activate(surface, e_mod_comp_wl_input_get(), timestamp); -} - -static void -_e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) -{ - Wayland_Surface *ws; - Wayland_Shell_Surface *wss; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - ws = surface_resource->data; - if (_e_mod_comp_wl_shell_get_shell_surface(ws)) - { - wl_resource_post_error(surface_resource, - WL_DISPLAY_ERROR_INVALID_OBJECT, - "get_shell_surface already requested"); - return; - } - - if (!(wss = calloc(1, sizeof(*wss)))) - { - wl_resource_post_no_memory(resource); - return; - } - - wss->resource.destroy = _e_mod_comp_wl_shell_surface_destroy; - wss->resource.object.id = id; - wss->resource.object.interface = &wl_shell_surface_interface; - wss->resource.object.implementation = - (void (* *)(void)) & _wl_shell_surface_interface; - wss->resource.data = wss; - - wss->surface = ws; - wss->surface_destroy_listener.notify = - _e_mod_comp_wl_shell_surface_destroy_handle; - wl_signal_add(&ws->surface.resource.destroy_signal, - &wss->surface_destroy_listener); - - wl_list_init(&wss->link); - - wss->type = SHELL_SURFACE_NONE; - wl_client_add_resource(client, &wss->resource); -} - -static void -_e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial) -{ - Wayland_Shell_Surface *wss; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - /* TODO: handle ping timer */ -} - -static void -_e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp) -{ - LOGFN(__FILE__, __LINE__, __FUNCTION__); -} - -static void -_e_mod_comp_wl_shell_surface_resize(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp, uint32_t edges) -{ - LOGFN(__FILE__, __LINE__, __FUNCTION__); -} - -static void -_e_mod_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource) -{ - Wayland_Shell_Surface *wss; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - - /* TODO: Surface type reset */ - - e_mod_comp_wl_surface_damage_surface(wss->surface); - wss->type = SHELL_SURFACE_TOPLEVEL; -} - -static void -_e_mod_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__) -{ - Wayland_Shell_Surface *wss, *pss; - Wayland_Surface *ws, *pws; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - pss = parent_resource->data; - ws = wss->surface; - pws = pss->surface; - - /* TODO: Surface type reset */ - - ws->x = pws->x + x; - ws->y = pws->y + y; - - e_mod_comp_wl_surface_damage_surface(ws); - - wss->type = SHELL_SURFACE_TRANSIENT; -} - -static void -_e_mod_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource, uint32_t method __UNUSED__, uint32_t framerate __UNUSED__, struct wl_resource *output_resource __UNUSED__) -{ - Wayland_Shell_Surface *wss; - Wayland_Surface *ws; - Wayland_Output *output; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - ws = wss->surface; - output = e_mod_comp_wl_output_get(); - - wss->saved_x = ws->x; - wss->saved_y = ws->y; - ws->x = (output->w - ws->w) / 2; - ws->y = (output->h - ws->h) / 2; - e_mod_comp_wl_surface_damage_surface(ws); - wss->type = SHELL_SURFACE_FULLSCREEN; -} - -static void -_e_mod_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource __UNUSED__, uint32_t timestamp __UNUSED__, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__) -{ - Wayland_Shell_Surface *wss; - Wayland_Surface *ws; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - ws = wss->surface; - e_mod_comp_wl_surface_damage_surface(ws); - wss->type = SHELL_SURFACE_POPUP; - wss->parent = parent_resource->data; - wss->popup.x = x; - wss->popup.y = y; -} - -static void -_e_mod_comp_wl_shell_surface_set_maximized(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__) -{ - Wayland_Shell_Surface *wss; - Wayland_Surface *ws; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - ws = wss->surface; - /* FIXME: Implement */ -} - -static void -_e_mod_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title) -{ - Wayland_Shell_Surface *wss; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - free(wss->title); - wss->title = strdup(title); -} - -static void -_e_mod_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *clas) -{ - Wayland_Shell_Surface *wss; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - free(wss->clas); - wss->clas = strdup(clas); -} - -static void -_e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__) -{ - Wayland_Shell_Surface *wss; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = container_of(listener, Wayland_Shell_Surface, surface_destroy_listener); - wss->surface = NULL; - wl_resource_destroy(&wss->resource); -} - -static Wayland_Shell_Surface * -_e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws) -{ - struct wl_listener *listener; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - listener = - wl_signal_get(&ws->surface.resource.destroy_signal, - _e_mod_comp_wl_shell_surface_destroy_handle); - if (listener) - return container_of(listener, Wayland_Shell_Surface, - surface_destroy_listener); - return NULL; -} - -static void -_e_mod_comp_wl_shell_surface_destroy(struct wl_resource *resource) -{ - Wayland_Shell_Surface *wss; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - wss = resource->data; - - /* TODO: popup grab input */ - - if (wss->surface) wl_list_remove(&wss->surface_destroy_listener.link); - wl_list_remove(&wss->link); - free(wss); -} - diff --git a/src/modules/comp/e_mod_comp_wl_shell.h b/src/modules/comp/e_mod_comp_wl_shell.h deleted file mode 100644 index 05a062c4c..000000000 --- a/src/modules/comp/e_mod_comp_wl_shell.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef E_TYPEDEFS -#else -# ifndef E_MOD_COMP_WL_SHELL_H -# define E_MOD_COMP_WL_SHELL_H - -Eina_Bool e_mod_comp_wl_shell_init(void); -void e_mod_comp_wl_shell_shutdown(void); -struct wl_shell *e_mod_comp_wl_shell_get(void); - -# endif -#endif diff --git a/src/modules/comp/e_mod_comp_wl_surface.h b/src/modules/comp/e_mod_comp_wl_surface.h deleted file mode 100644 index 59084a91b..000000000 --- a/src/modules/comp/e_mod_comp_wl_surface.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifdef E_TYPEDEFS -#else -# ifndef E_MOD_COMP_WL_SURFACE_H -# define E_MOD_COMP_WL_SURFACE_H - -Wayland_Surface *e_mod_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h); -void e_mod_comp_wl_surface_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource); -void e_mod_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t x, int32_t y); -void e_mod_comp_wl_surface_damage(struct wl_client *client __UNUSED__, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height); -void e_mod_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback); -void e_mod_comp_wl_surface_set_opaque_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource); -void e_mod_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource); -void e_mod_comp_wl_surface_commit(struct wl_client *client, struct wl_resource *resource); -void e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource); -void e_mod_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height); -void e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t timestamp); -void e_mod_comp_wl_surface_damage_surface(Wayland_Surface *ws); - -# endif -#endif diff --git a/src/modules/comp/e-module-comp.edj b/src/modules/conf_comp/e-module-comp.edj similarity index 100% rename from src/modules/comp/e-module-comp.edj rename to src/modules/conf_comp/e-module-comp.edj diff --git a/src/modules/comp/e_mod_config.c b/src/modules/conf_comp/e_mod_config.c similarity index 98% rename from src/modules/comp/e_mod_config.c rename to src/modules/conf_comp/e_mod_config.c index 8dc90a49e..3ef596122 100644 --- a/src/modules/comp/e_mod_config.c +++ b/src/modules/conf_comp/e_mod_config.c @@ -1,7 +1,8 @@ #include "e.h" #include "e_mod_main.h" #include "e_mod_config.h" -#include "e_mod_comp.h" +#include "e_comp.h" +#include "e_comp_cfdata.h" typedef struct _E_Demo_Style_Item { @@ -15,7 +16,7 @@ typedef struct _E_Demo_Style_Item typedef struct _Match_Config { - Match match; + E_Comp_Match match; E_Config_Dialog *cfd; char *title, *name, *clas, *role; int borderless, dialog, accepts_focus, vkbd; @@ -110,7 +111,7 @@ e_int_config_comp_module(E_Container *con, } static void -_match_dup(Match *m, +_match_dup(E_Comp_Match *m, Match_Config *m2) { m2->match = *m; @@ -126,7 +127,7 @@ _create_data(E_Config_Dialog *cfd) { E_Config_Dialog_Data *cfdata; Eina_List *l; - Match *m; + E_Comp_Match *m; Match_Config *m2; cfdata = E_NEW(E_Config_Dialog_Data, 1); @@ -678,7 +679,7 @@ _create_edit_frame(E_Config_Dialog *cfd, evas_object_resize(o, w, h); evas_object_show(o); - of = e_widget_frametable_add(evas, _("Edit Match"), 0); + of = e_widget_frametable_add(evas, _("Edit E_Comp_Match"), 0); evas_object_data_set(of, "bg", o); evas_object_data_set(of, "dia", cfd->dia->bg_object); evas_object_move(of, x, y); @@ -1347,7 +1348,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, static void _match_list_free(Eina_List *list) { - Match *m; + E_Comp_Match *m; EINA_LIST_FREE(list, m) { @@ -1362,7 +1363,7 @@ _match_list_free(Eina_List *list) static void _match_dup2(Match_Config *m2, - Match *m) + E_Comp_Match *m) { *m = m2->match; if (m->title) m->title = eina_stringshare_add(m->title); @@ -1397,7 +1398,7 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, if (cfdata->match.changed) { Eina_List *l; - Match *m; + E_Comp_Match *m; Match_Config *m2; _match_list_free(_comp_mod->conf->match.popups); @@ -1412,28 +1413,28 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, EINA_LIST_FOREACH(cfdata->match.popups, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.popups = eina_list_append(_comp_mod->conf->match.popups, m); } EINA_LIST_FOREACH(cfdata->match.borders, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.borders = eina_list_append(_comp_mod->conf->match.borders, m); } EINA_LIST_FOREACH(cfdata->match.overrides, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.overrides = eina_list_append(_comp_mod->conf->match.overrides, m); } EINA_LIST_FOREACH(cfdata->match.menus, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.menus = eina_list_append(_comp_mod->conf->match.menus, m); @@ -1459,7 +1460,7 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, _comp_mod->conf->shadow_style = NULL; if (cfdata->shadow_style) _comp_mod->conf->shadow_style = eina_stringshare_add(cfdata->shadow_style); - e_mod_comp_shadow_set(); + e_comp_shadow_set(); } if ((cfdata->engine != _comp_mod->conf->engine) || (cfdata->indirect != _comp_mod->conf->indirect) || @@ -1481,8 +1482,6 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, a = e_action_find("restart"); if ((a) && (a->func.go)) a->func.go(NULL, NULL); -// e_mod_comp_shutdown(); -// e_mod_comp_init(); } e_config_save_queue(); return 1; @@ -1578,7 +1577,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, if (cfdata->match.changed) { Eina_List *l; - Match *m; + E_Comp_Match *m; Match_Config *m2; _match_list_free(_comp_mod->conf->match.popups); @@ -1593,28 +1592,28 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, EINA_LIST_FOREACH(cfdata->match.popups, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.popups = eina_list_append(_comp_mod->conf->match.popups, m); } EINA_LIST_FOREACH(cfdata->match.borders, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.borders = eina_list_append(_comp_mod->conf->match.borders, m); } EINA_LIST_FOREACH(cfdata->match.overrides, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.overrides = eina_list_append(_comp_mod->conf->match.overrides, m); } EINA_LIST_FOREACH(cfdata->match.menus, l, m2) { - m = E_NEW(Match, 1); + m = E_NEW(E_Comp_Match, 1); _match_dup2(m2, m); _comp_mod->conf->match.menus = eina_list_append(_comp_mod->conf->match.menus, m); @@ -1640,7 +1639,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, _comp_mod->conf->shadow_style = NULL; if (cfdata->shadow_style) _comp_mod->conf->shadow_style = eina_stringshare_add(cfdata->shadow_style); - e_mod_comp_shadow_set(); + e_comp_shadow_set(); } if ((cfdata->engine != _comp_mod->conf->engine) || (cfdata->indirect != _comp_mod->conf->indirect) || @@ -1660,8 +1659,6 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, a = e_action_find("restart"); if ((a) && (a->func.go)) a->func.go(NULL, NULL); -// e_mod_comp_shutdown(); -// e_mod_comp_init(); } e_config_save_queue(); return 1; diff --git a/src/modules/comp/e_mod_config.h b/src/modules/conf_comp/e_mod_config.h similarity index 100% rename from src/modules/comp/e_mod_config.h rename to src/modules/conf_comp/e_mod_config.h diff --git a/src/modules/comp/e_mod_main.c b/src/modules/conf_comp/e_mod_main.c similarity index 84% rename from src/modules/comp/e_mod_main.c rename to src/modules/conf_comp/e_mod_main.c index 0c31b69c7..283a3d6c9 100644 --- a/src/modules/comp/e_mod_main.c +++ b/src/modules/conf_comp/e_mod_main.c @@ -1,22 +1,10 @@ #include "e.h" #include "e_mod_main.h" #include "e_mod_config.h" -#include "e_mod_comp.h" +#include "e_comp.h" +#include "e_comp_cfdata.h" static Eina_Inlist *cfg_opts = NULL; -//static Ecore_Event_Handler *init_done_handler = NULL; - -//static int -//_e_init_done(void *data, int type, void *event) -//{ -// ecore_event_handler_del(init_done_handler); -// init_done_handler = NULL; -// if (!e_mod_comp_init()) -// { -// // FIXME: handle if comp init fails -// } -// return 1; -//} /* module private routines */ Mod *_comp_mod = NULL; @@ -74,8 +62,8 @@ e_modapi_init(E_Module *m) e_configure_registry_item_add("appearance/comp", 120, _("Composite"), NULL, buf, e_int_config_comp_module); - e_mod_comp_cfdata_edd_init(&(mod->conf_edd), - &(mod->conf_match_edd)); + e_comp_cfdata_edd_init(&(mod->conf_edd), + &(mod->conf_match_edd)); mod->conf = e_config_domain_load("module.comp", mod->conf_edd); if (mod->conf) @@ -84,7 +72,7 @@ e_modapi_init(E_Module *m) mod->conf->keep_unmapped = 1; } else _e_mod_config_new(m); - + /* force some config vals off */ mod->conf->lock_fps = 0; mod->conf->indirect = 0; @@ -95,11 +83,6 @@ e_modapi_init(E_Module *m) _comp_mod = mod; - if (!e_mod_comp_init()) - { - // FIXME: handle if comp init fails - } - e_module_delayed_set(m, 0); e_module_priority_set(m, -1000); @@ -114,10 +97,10 @@ e_modapi_init(E_Module *m) co->requires_restart = 1; cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); E_CONFIGURE_OPTION_ADD(co, BOOL, smooth_windows, mod->conf, _("Smooth scaling of composited window content"), _("composite"), _("border")); - co->funcs[1].none = co->funcs[0].none = e_mod_comp_shadow_set; + co->funcs[1].none = co->funcs[0].none = e_comp_shadow_set; cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); E_CONFIGURE_OPTION_ADD(co, BOOL, nocomp_fs, mod->conf, _("Don't composite fullscreen windows"), _("composite"), _("border")); - co->funcs[1].none = co->funcs[0].none = e_mod_comp_shadow_set; + co->funcs[1].none = co->funcs[0].none = e_comp_shadow_set; cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); E_CONFIGURE_OPTION_ADD(co, ENUM, engine, mod->conf, _("Compositing engine"), _("composite"), _("border")); co->info_cb = _e_mod_engine_info_cb; @@ -128,7 +111,7 @@ e_modapi_init(E_Module *m) e_configure_option_category_tag_add(_("composite"), _("composite")); e_configure_option_category_icon_set(_("composite"), buf); } - + return mod; } @@ -137,7 +120,7 @@ _e_mod_config_new(E_Module *m) { Mod *mod = m->data; - mod->conf = e_mod_comp_cfdata_config_new(); + mod->conf = e_comp_cfdata_config_new(); } void @@ -145,7 +128,7 @@ _e_mod_config_free(E_Module *m) { Mod *mod = m->data; - e_mod_cfdata_config_free(mod->conf); + e_comp_cfdata_config_free(mod->conf); mod->conf = NULL; } @@ -154,8 +137,6 @@ e_modapi_shutdown(E_Module *m) { Mod *mod = m->data; - e_mod_comp_shutdown(); - e_configure_registry_item_del("appearance/comp"); e_configure_registry_category_del("appearance"); @@ -168,7 +149,7 @@ e_modapi_shutdown(E_Module *m) E_CONFIGURE_OPTION_LIST_CLEAR(cfg_opts); e_configure_option_category_tag_del(_("composite"), _("composite")); e_configure_option_category_tag_del(_("windows"), _("composite")); - + _e_mod_config_free(m); E_CONFIG_DD_FREE(mod->conf_match_edd); diff --git a/src/modules/comp/e_mod_main.h b/src/modules/conf_comp/e_mod_main.h similarity index 93% rename from src/modules/comp/e_mod_main.h rename to src/modules/conf_comp/e_mod_main.h index cce4cf65f..29f57726e 100644 --- a/src/modules/comp/e_mod_main.h +++ b/src/modules/conf_comp/e_mod_main.h @@ -1,7 +1,7 @@ #ifndef E_MOD_MAIN_H #define E_MOD_MAIN_H -#include "e_mod_comp_cfdata.h" +#include "e_comp_cfdata.h" typedef struct _Mod Mod; @@ -11,7 +11,7 @@ struct _Mod E_Config_DD *conf_edd; E_Config_DD *conf_match_edd; - Config *conf; + E_Comp_Config *conf; E_Config_Dialog *config_dialog; }; diff --git a/src/modules/comp/module.desktop.in b/src/modules/conf_comp/module.desktop.in similarity index 100% rename from src/modules/comp/module.desktop.in rename to src/modules/conf_comp/module.desktop.in diff --git a/src/modules/wizard/page_150.c b/src/modules/wizard/page_150.c index 61044738f..b4f76d019 100644 --- a/src/modules/wizard/page_150.c +++ b/src/modules/wizard/page_150.c @@ -1,9 +1,7 @@ /* Ask about compositing */ #include "e_wizard.h" -#include "e_mod_comp_cfdata.h" - -#define ENGINE_SW 1 -#define ENGINE_GL 2 +#include "e_comp.h" +#include "e_comp_cfdata.h" static int do_gl = 0; static int do_vsync = 0; @@ -101,20 +99,20 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__) { E_Config_DD *conf_edd = NULL; E_Config_DD *conf_match_edd = NULL; - Config *cfg = NULL; + E_Comp_Config *cfg = NULL; - e_mod_comp_cfdata_edd_init(&(conf_edd), &(conf_match_edd)); - cfg = e_mod_comp_cfdata_config_new(); + e_comp_cfdata_edd_init(&(conf_edd), &(conf_match_edd)); + cfg = e_comp_cfdata_config_new(); if (do_gl) { - cfg->engine = ENGINE_GL; + cfg->engine = E_COMP_ENGINE_GL; cfg->smooth_windows = 1; cfg->vsync = do_vsync; } else { - cfg->engine = ENGINE_SW; + cfg->engine = E_COMP_ENGINE_SW; cfg->smooth_windows = 0; cfg->vsync = 0; } @@ -122,7 +120,7 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__) e_config_domain_save("module.comp", conf_edd, cfg); E_CONFIG_DD_FREE(conf_match_edd); E_CONFIG_DD_FREE(conf_edd); - e_mod_cfdata_config_free(cfg); + e_comp_cfdata_config_free(cfg); e_config_save_queue();