compositor rewrite / charlie-foxtrot situation

huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.

* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.

** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes

** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects

** protocol-specific window management and compositor functionality is now kept exclusively in backend files

** e_pixmap api provides generic client finding and rendering api

** screen/xinerama screens are now provided directly by compositor on startup and re-set on change

** e_comp_render_update finally replaced with eina_tiler

** wayland compositor no longer creates X windows

** compositor e_layout removed entirely

* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra

* e_manager is just for screensaver and keybind stuff now, possibly remove later?

* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor

** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.

*** do NOT set interceptors on a client's comp_object. seriously.

* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor

* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get

* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas

* deskmirror is (more) broken for now

* illume is totally fucked

* Ecore_X_Window replaced with Ecore_Window in most cases

* edge binding XWindows replaced with regular canvas objects

* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result

comp files and descriptions:

e_comp.c - overall compositor functions, rendering/update loop, shape cutting

e_comp_x.c - X window management and compositor functionality

e_comp_wl.c - Wayland surface management and compositor functionality

e_comp_canvas.c - general compositor canvas functions and utilities

e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems

additional authors: ivan.briano@intel.com

feature: new compositor

removal: e_border, e_container, e_popup
This commit is contained in:
Mike Blumenkrantz 2014-01-14 20:19:12 -05:00
parent 7f0c849a27
commit 86656e4df9
343 changed files with 26382 additions and 30784 deletions

View File

@ -12,7 +12,7 @@ SUFFIXES = .cfg
$(MKDIR_P) $(@D)
$(EET_EET) -e \
$(top_builddir)/$@ config \
$< 0
$< 1
include config/default/Makefile.mk
include config/standard/Makefile.mk

View File

@ -604,7 +604,7 @@ group "E_Config" struct {
}
value "name" string: "shelf";
value "id" int: 1;
value "container" int: 0;
value "manager" int: 0;
value "zone" int: 0;
value "layer" int: 200;
value "popup" uchar: 1;

View File

@ -4,9 +4,9 @@ src/bin/e_alert.c
src/bin/e_atoms.c
src/bin/e_bg.c
src/bin/e_bindings.c
src/bin/e_border.c
src/bin/e_box.c
src/bin/e_canvas.c
src/bin/e_client.c
src/bin/e_color.c
src/bin/e_color_class.c
src/bin/e_color_dialog.c
@ -15,7 +15,6 @@ src/bin/e_config.c
src/bin/e_config_dialog.c
src/bin/e_configure.c
src/bin/e_confirm_dialog.c
src/bin/e_container.c
src/bin/e_datastore.c
src/bin/e_desk.c
src/bin/e_desklock.c
@ -47,10 +46,10 @@ src/bin/e_imc_main.c
src/bin/e_import_config_dialog.c
src/bin/e_import_dialog.c
src/bin/e_init.c
src/bin/e_int_border_locks.c
src/bin/e_int_border_menu.c
src/bin/e_int_border_prop.c
src/bin/e_int_border_remember.c
src/bin/e_int_client_locks.c
src/bin/e_int_client_menu.c
src/bin/e_int_client_prop.c
src/bin/e_int_client_remember.c
src/bin/e_int_config_modules.c
src/bin/e_int_gadcon_config.c
src/bin/e_int_menus.c
@ -76,7 +75,6 @@ src/bin/e_pan.c
src/bin/e_path.c
src/bin/e_place.c
src/bin/e_pointer.c
src/bin/e_popup.c
src/bin/e_prefix.c
src/bin/e_randr.c
src/bin/e_remember.c
@ -90,7 +88,6 @@ src/bin/e_slider.c
src/bin/e_spectrum.c
src/bin/e_start_main.c
src/bin/e_startup.c
src/bin/e_stolen.c
src/bin/e_sys.c
src/bin/e_sys_main.c
src/bin/e_table.c

View File

@ -46,21 +46,23 @@ src/bin/e_atoms.h \
src/bin/e_backlight.h \
src/bin/e_bg.h \
src/bin/e_bindings.h \
src/bin/e_border.h \
src/bin/e_box.h \
src/bin/e_canvas.h \
src/bin/e_client.h \
src/bin/e_client.x \
src/bin/e_color_class.h \
src/bin/e_color_dialog.h \
src/bin/e_color.h \
src/bin/e_comp.h \
src/bin/e_comp_canvas.h \
src/bin/e_comp_cfdata.h \
src/bin/e_comp_render_update.h \
src/bin/e_comp_object.h \
src/bin/e_comp_x.h \
src/bin/e_config_data.h \
src/bin/e_config_dialog.h \
src/bin/e_config.h \
src/bin/e_configure.h \
src/bin/e_confirm_dialog.h \
src/bin/e_container.h \
src/bin/e_datastore.h \
src/bin/e_dbusmenu.h \
src/bin/e_desk.h \
@ -103,10 +105,10 @@ src/bin/e_import_config_dialog.h \
src/bin/e_import_dialog.h \
src/bin/e_includes.h \
src/bin/e_init.h \
src/bin/e_int_border_locks.h \
src/bin/e_int_border_menu.h \
src/bin/e_int_border_prop.h \
src/bin/e_int_border_remember.h \
src/bin/e_int_client_locks.h \
src/bin/e_int_client_menu.h \
src/bin/e_int_client_prop.h \
src/bin/e_int_client_remember.h \
src/bin/e_int_config_modules.h \
src/bin/e_int_gadcon_config.h \
src/bin/e_intl_data.h \
@ -134,9 +136,9 @@ src/bin/e_object.h \
src/bin/e_order.h \
src/bin/e_pan.h \
src/bin/e_path.h \
src/bin/e_pixmap.h \
src/bin/e_place.h \
src/bin/e_pointer.h \
src/bin/e_popup.h \
src/bin/e_powersave.h \
src/bin/e_prefix.h \
src/bin/e_randr.h \
@ -153,7 +155,6 @@ src/bin/e_slider.h \
src/bin/e_slidesel.h \
src/bin/e_spectrum.h \
src/bin/e_startup.h \
src/bin/e_stolen.h \
src/bin/e_sys.h \
src/bin/e_table.h \
src/bin/e_test.h \
@ -202,8 +203,7 @@ src/bin/e_zone.h
if HAVE_WAYLAND_CLIENTS
ENLIGHTENMENTHEADERS += \
src/bin/e_comp_wl.h \
src/bin/e_surface.h
src/bin/e_comp_wl.h
endif
@ -216,21 +216,22 @@ src/bin/e_atoms.c \
src/bin/e_backlight.c \
src/bin/e_bg.c \
src/bin/e_bindings.c \
src/bin/e_border.c \
src/bin/e_box.c \
src/bin/e_canvas.c \
src/bin/e_client.c \
src/bin/e_color.c \
src/bin/e_color_class.c \
src/bin/e_color_dialog.c \
src/bin/e_comp.c \
src/bin/e_comp_canvas.c \
src/bin/e_comp_cfdata.c \
src/bin/e_comp_render_update.c \
src/bin/e_comp_object.c \
src/bin/e_comp_x.c \
src/bin/e_config.c \
src/bin/e_config_data.c \
src/bin/e_config_dialog.c \
src/bin/e_configure.c \
src/bin/e_confirm_dialog.c \
src/bin/e_container.c \
src/bin/e_datastore.c \
src/bin/e_dbusmenu.c \
src/bin/e_desk.c \
@ -269,10 +270,10 @@ src/bin/e_ilist.c \
src/bin/e_import_config_dialog.c \
src/bin/e_import_dialog.c \
src/bin/e_init.c \
src/bin/e_int_border_locks.c \
src/bin/e_int_border_menu.c \
src/bin/e_int_border_prop.c \
src/bin/e_int_border_remember.c \
src/bin/e_int_client_locks.c \
src/bin/e_int_client_menu.c \
src/bin/e_int_client_prop.c \
src/bin/e_int_client_remember.c \
src/bin/e_int_config_modules.c \
src/bin/e_int_gadcon_config.c \
src/bin/e_intl.c \
@ -299,9 +300,9 @@ src/bin/e_object.c \
src/bin/e_order.c \
src/bin/e_pan.c \
src/bin/e_path.c \
src/bin/e_pixmap.c \
src/bin/e_place.c \
src/bin/e_pointer.c \
src/bin/e_popup.c \
src/bin/e_powersave.c \
src/bin/e_prefix.c \
src/bin/e_randr.c \
@ -318,7 +319,6 @@ src/bin/e_slider.c \
src/bin/e_slidesel.c \
src/bin/e_spectrum.c \
src/bin/e_startup.c \
src/bin/e_stolen.c \
src/bin/e_sys.c \
src/bin/e_table.c \
src/bin/e_test.c \
@ -368,8 +368,7 @@ $(ENLIGHTENMENTHEADERS)
if HAVE_WAYLAND_CLIENTS
enlightenment_src += \
src/bin/e_comp_wl.c \
src/bin/e_surface.c
src/bin/e_comp_wl.c
endif
src_bin_enlightenment_CFLAGS = $(AM_CPPFLAGS) @WAYLAND_CFLAGS@ @WAYLAND_EGL_CFLAGS@

View File

@ -7,14 +7,14 @@
/* externally accessible functions */
EAPI E_About *
e_about_new(E_Container *con)
e_about_new(E_Comp *c)
{
E_Obj_Dialog *od;
char buf[16384];
FILE *f;
Eina_Strbuf *tbuf;
od = e_obj_dialog_new(con, _("About Enlightenment"), "E", "_about");
od = e_obj_dialog_new(c, _("About Enlightenment"), "E", "_about");
if (!od) return NULL;
e_obj_dialog_obj_theme_set(od, "base/theme/about", "e/widgets/about/main");
e_obj_dialog_obj_part_text_set(od, "e.text.label", _("Close"));

View File

@ -6,7 +6,7 @@ typedef struct _E_Obj_Dialog E_About;
#ifndef E_ABOUT_H
#define E_ABOUT_H
EAPI E_About *e_about_new (E_Container *con);
EAPI E_About *e_about_new (E_Comp *c);
EAPI void e_about_show (E_About *about);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -88,7 +88,7 @@ main(int argc, char **argv)
fprintf(stderr, "exit_gdb: %i\n", exit_gdb);
tmp = getenv("E18_TAINTED");
tmp = getenv("E19_TAINTED");
if (tmp && !strcmp(tmp, "NO"))
tainted = EINA_FALSE;
@ -554,7 +554,7 @@ _e_alert_draw_text(void)
"on. We were not able to generate a backtrace, check \n"
"if your 'sysactions.conf' has an 'gdb' action line.\n"
"\n"
"Please compile latest Git E18 and EFL with\n"
"Please compile latest Git E19 and EFL with\n"
"-g and -ggdb3 in your CFLAGS.\n");
}
else if (backtrace_str)
@ -562,9 +562,9 @@ _e_alert_draw_text(void)
snprintf(msg, sizeof(msg),
"This is not meant to happen and is likely a sign of \n"
"a bug in Enlightenment or the libraries it relies \n"
"on. You will find an backtrace of E18 (%d) in :\n"
"on. You will find an backtrace of E19 (%d) in :\n"
"'%s'\n"
"Before reporting issue, compile latest E18 and EFL\n"
"Before reporting issue, compile latest E19 and EFL\n"
"from Git with '-g -ggdb3' in your CFLAGS.\n"
"You can then report this crash on :\n"
"https://phab.enlightenment.org/maniphest/.\n",
@ -580,7 +580,7 @@ _e_alert_draw_text(void)
"recover to try and get your desktop back the way \n"
"it was.\n"
"\n"
"Please compile latest Git E18 and EFL with\n"
"Please compile latest Git E19 and EFL with\n"
"-g and -ggdb3 in your CFLAGS.\n", pid);
}
}
@ -592,7 +592,7 @@ _e_alert_draw_text(void)
"modules; before reporting this issue, please\n"
"unload them and try to see if the bug is still\n"
"there. Also update to latest Git and be sure to\n"
"compile E18 and EFL with -g and -ggdb3 in your CFLAGS");
"compile E19 and EFL with -g and -ggdb3 in your CFLAGS");
}
strcpy(warn, "");

View File

@ -2,7 +2,6 @@
/* Atoms */
EAPI Ecore_X_Atom E_ATOM_MANAGED = 0;
EAPI Ecore_X_Atom E_ATOM_CONTAINER = 0;
EAPI Ecore_X_Atom E_ATOM_ZONE = 0;
EAPI Ecore_X_Atom E_ATOM_DESK = 0;
EAPI Ecore_X_Atom E_ATOM_MAPPED = 0;
@ -20,7 +19,6 @@ e_atoms_init(void)
{
const char *atom_names[] = {
"__E_WINDOW_MANAGED",
"__E_WINDOW_CONTAINER",
"__E_WINDOW_ZONE",
"__E_WINDOW_DESK",
"__E_WINDOW_MAPPED",
@ -32,21 +30,20 @@ e_atoms_init(void)
"__E_ATOM_DESKTOP_FILE",
"E_ZONE_GEOMETRY"
};
Ecore_X_Atom atoms[12];
Ecore_X_Atom atoms[11];
ecore_x_atoms_get(atom_names, 12, atoms);
ecore_x_atoms_get(atom_names, 11, atoms);
E_ATOM_MANAGED = atoms[0];
E_ATOM_CONTAINER = atoms[1];
E_ATOM_ZONE = atoms[2];
E_ATOM_DESK = atoms[3];
E_ATOM_MAPPED = atoms[4];
E_ATOM_SHADE_DIRECTION = atoms[5];
E_ATOM_HIDDEN = atoms[6];
E_ATOM_BORDER_SIZE = atoms[7];
E_ATOM_WINDOW_STATE = atoms[8];
E_ATOM_WINDOW_STATE_CENTERED = atoms[9];
E_ATOM_DESKTOP_FILE = atoms[10];
E_ATOM_ZONE_GEOMETRY = atoms[11];
E_ATOM_ZONE = atoms[1];
E_ATOM_DESK = atoms[2];
E_ATOM_MAPPED = atoms[3];
E_ATOM_SHADE_DIRECTION = atoms[4];
E_ATOM_HIDDEN = atoms[5];
E_ATOM_BORDER_SIZE = atoms[6];
E_ATOM_WINDOW_STATE = atoms[7];
E_ATOM_WINDOW_STATE_CENTERED = atoms[8];
E_ATOM_DESKTOP_FILE = atoms[9];
E_ATOM_ZONE_GEOMETRY = atoms[10];
return 1;
}

View File

@ -7,7 +7,6 @@
extern EAPI Ecore_X_Atom E_ATOM_MANAGED;
/* basic window properties */
extern EAPI Ecore_X_Atom E_ATOM_CONTAINER;
extern EAPI Ecore_X_Atom E_ATOM_ZONE;
extern EAPI Ecore_X_Atom E_ATOM_DESK;
extern EAPI Ecore_X_Atom E_ATOM_MAPPED;

View File

@ -62,22 +62,22 @@ e_backlight_init(void)
(E_EVENT_CONFIG_MODE_CHANGED, _e_backlight_handler, NULL);
_e_backlight_handler_border_fullscreen = ecore_event_handler_add
(E_EVENT_BORDER_FULLSCREEN, _e_backlight_handler, NULL);
(E_EVENT_CLIENT_FULLSCREEN, _e_backlight_handler, NULL);
_e_backlight_handler_border_unfullscreen = ecore_event_handler_add
(E_EVENT_BORDER_UNFULLSCREEN, _e_backlight_handler, NULL);
(E_EVENT_CLIENT_UNFULLSCREEN, _e_backlight_handler, NULL);
_e_backlight_handler_border_remove = ecore_event_handler_add
(E_EVENT_BORDER_REMOVE, _e_backlight_handler, NULL);
(E_EVENT_CLIENT_REMOVE, _e_backlight_handler, NULL);
_e_backlight_handler_border_iconify = ecore_event_handler_add
(E_EVENT_BORDER_ICONIFY, _e_backlight_handler, NULL);
(E_EVENT_CLIENT_ICONIFY, _e_backlight_handler, NULL);
_e_backlight_handler_border_uniconify = ecore_event_handler_add
(E_EVENT_BORDER_UNICONIFY, _e_backlight_handler, NULL);
(E_EVENT_CLIENT_UNICONIFY, _e_backlight_handler, NULL);
_e_backlight_handler_border_desk_set = ecore_event_handler_add
(E_EVENT_BORDER_DESK_SET, _e_backlight_handler, NULL);
(E_EVENT_CLIENT_DESK_SET, _e_backlight_handler, NULL);
_e_backlight_handler_desk_show = ecore_event_handler_add
(E_EVENT_DESK_SHOW, _e_backlight_handler, NULL);
@ -179,23 +179,15 @@ e_backlight_exists(void)
EAPI void
e_backlight_update(void)
{
Eina_List *m, *c, *z;
E_Manager *man;
E_Container *con;
const Eina_List *l, *ll;
E_Comp *c;
E_Zone *zone;
if (bl_avail == EINA_FALSE) return;
EINA_LIST_FOREACH(e_manager_list(), m, man)
{
EINA_LIST_FOREACH(man->containers, c, con)
{
EINA_LIST_FOREACH(con->zones, z, zone)
{
_e_backlight_update(zone);
}
}
}
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->zones, ll, zone)
_e_backlight_update(zone);
}
EAPI void
@ -296,33 +288,36 @@ _e_backlight_update(E_Zone *zone)
Ecore_X_Randr_Output *out;
int i, num = 0;
root = zone->container->manager->root;
root = zone->comp->man->root;
// try randr
out = ecore_x_randr_window_outputs_get(root, &num);
if ((out) && (num > 0) && (ecore_x_randr_output_backlight_available()))
if (ecore_x_randr_output_backlight_available())
{
char *name;
const char *s;
Eina_Bool gotten = EINA_FALSE;
EINA_LIST_FREE(bl_devs, s)
eina_stringshare_del(s);
for (i = 0; i < num; i++)
out = ecore_x_randr_window_outputs_get(root, &num);
if ((out) && (num > 0))
{
name = ecore_x_randr_output_name_get(root, out[i], NULL);
bl_devs = eina_list_append(bl_devs, eina_stringshare_add(name));
if ((name) && (e_config->backlight.sysdev) &&
(!strcmp(name, e_config->backlight.sysdev)))
char *name;
const char *s;
Eina_Bool gotten = EINA_FALSE;
EINA_LIST_FREE(bl_devs, s)
eina_stringshare_del(s);
for (i = 0; i < num; i++)
{
x_bl = ecore_x_randr_output_backlight_level_get(root, out[i]);
gotten = EINA_TRUE;
name = ecore_x_randr_output_name_get(root, out[i], NULL);
bl_devs = eina_list_append(bl_devs, eina_stringshare_add(name));
if ((name) && (e_config->backlight.sysdev) &&
(!strcmp(name, e_config->backlight.sysdev)))
{
x_bl = ecore_x_randr_output_backlight_level_get(root, out[i]);
gotten = EINA_TRUE;
}
free(name);
}
free(name);
if (!gotten)
x_bl = ecore_x_randr_output_backlight_level_get(root, out[0]);
}
if (!gotten)
x_bl = ecore_x_randr_output_backlight_level_get(root, out[0]);
free(out);
}
free(out);
if (x_bl >= 0.0)
{
bl_val = x_bl;
@ -350,7 +345,7 @@ _e_backlight_set(E_Zone *zone, double val)
int num = 0, i;
char *name;
root = zone->container->manager->root;
root = zone->comp->man->root;
out = ecore_x_randr_window_outputs_get(root, &num);
if ((out) && (num > 0))
{

View File

@ -76,7 +76,7 @@ e_bg_shutdown(void)
* The most specific match will be returned
*/
EAPI const E_Config_Desktop_Background *
e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
e_bg_config_get(int manager_num, int zone_num, int desk_x, int desk_y)
{
Eina_List *l, *entries;
E_Config_Desktop_Background *bg = NULL, *cfbg = NULL;
@ -85,7 +85,7 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
int current_spec = 0; /* how specific the setting is - we want the least general one that applies */
/* look for desk specific background. */
if (container_num >= 0 || zone_num >= 0 || desk_x >= 0 || desk_y >= 0)
if (manager_num >= 0 || zone_num >= 0 || desk_x >= 0 || desk_y >= 0)
{
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{
@ -93,8 +93,8 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
if (!cfbg) continue;
spec = 0;
if (cfbg->container == container_num) spec++;
else if (cfbg->container >= 0)
if (cfbg->manager == manager_num) spec++;
else if (cfbg->manager >= 0)
continue;
if (cfbg->zone == zone_num) spec++;
else if (cfbg->zone >= 0)
@ -144,13 +144,13 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
}
EAPI Eina_Stringshare *
e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
e_bg_file_get(int manager_num, int zone_num, int desk_x, int desk_y)
{
const E_Config_Desktop_Background *cfbg;
const char *bgfile = NULL;
int ok = 0;
cfbg = e_bg_config_get(container_num, zone_num, desk_x, desk_y);
cfbg = e_bg_config_get(manager_num, zone_num, desk_x, desk_y);
/* fall back to default */
if (cfbg)
@ -208,9 +208,9 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
desk = e_desk_current_get(zone);
if (desk)
bgfile = e_bg_file_get(zone->container->num, zone->num, desk->x, desk->y);
bgfile = e_bg_file_get(zone->comp->num, zone->num, desk->x, desk->y);
else
bgfile = e_bg_file_get(zone->container->num, zone->num, -1, -1);
bgfile = e_bg_file_get(zone->comp->num, zone->num, -1, -1);
if (zone->bg_object)
{
@ -233,39 +233,43 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
zone->bg_object = NULL;
E_FREE_FUNC(zone->transition_object, evas_object_del);
}
o = edje_object_add(zone->container->bg_evas);
o = edje_object_add(zone->comp->evas);
evas_object_repeat_events_set(o, 1);
zone->transition_object = o;
evas_object_name_set(zone->transition_object, "zone->transition_object");
/* FIXME: segv if zone is deleted while up??? */
evas_object_data_set(o, "e_zone", zone);
snprintf(buf, sizeof(buf), "e/transitions/%s", trans);
e_theme_edje_object_set(o, "base/theme/transitions", buf);
edje_object_signal_callback_add(o, "e,state,done", "*", _e_bg_signal, zone);
evas_object_layer_set(o, E_COMP_CANVAS_LAYER_BG);
evas_object_move(o, zone->x, zone->y);
evas_object_resize(o, zone->w, zone->h);
evas_object_layer_set(o, E_LAYER_BG);
evas_object_clip_set(o, zone->bg_clip_object);
evas_object_show(o);
}
if (eina_str_has_extension(bgfile, ".edj"))
{
o = edje_object_add(zone->container->bg_evas);
o = edje_object_add(zone->comp->evas);
edje_object_file_set(o, bgfile, "e/desktop/background");
if (edje_object_data_get(o, "noanimation"))
edje_object_animation_set(o, EINA_FALSE);
}
else
{
o = e_icon_add(zone->container->bg_evas);
o = e_icon_add(zone->comp->evas);
e_icon_file_key_set(o, bgfile, NULL);
e_icon_fill_inside_set(o, 0);
}
evas_object_data_set(o, "e_zone", zone);
evas_object_repeat_events_set(o, 1);
zone->bg_object = o;
evas_object_name_set(zone->bg_object, "zone->bg_object");
if (transition == E_BG_TRANSITION_NONE)
{
evas_object_move(o, zone->x, zone->y);
evas_object_resize(o, zone->w, zone->h);
evas_object_layer_set(o, E_COMP_CANVAS_LAYER_BG);
evas_object_layer_set(o, E_LAYER_BG);
}
evas_object_clip_set(o, zone->bg_clip_object);
evas_object_show(o);
@ -285,9 +289,9 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
if (zone->bg_object) evas_object_name_set(zone->bg_object, "zone->bg_object");
if (zone->prev_bg_object) evas_object_name_set(zone->prev_bg_object, "zone->prev_bg_object");
if (zone->transition_object) evas_object_name_set(zone->transition_object, "zone->transition_object");
if (zone->comp_zone) e_comp_zone_update(zone->comp_zone);
evas_object_move(zone->transition_object, zone->x, zone->y);
evas_object_resize(zone->transition_object, zone->w, zone->h);
e_comp_canvas_zone_update(zone);
end:
eina_stringshare_del(bgfile);
}
@ -322,7 +326,7 @@ e_bg_default_set(const char *file)
e_config->desktop_default_background = NULL;
ev = E_NEW(E_Event_Bg_Update, 1);
ev->container = -1;
ev->manager = -1;
ev->zone = -1;
ev->desk_x = -1;
ev->desk_y = -1;
@ -330,7 +334,7 @@ e_bg_default_set(const char *file)
}
EAPI void
e_bg_add(int container, int zone, int desk_x, int desk_y, const char *file)
e_bg_add(int manager, int zone, int desk_x, int desk_y, const char *file)
{
const Eina_List *l;
E_Config_Desktop_Background *cfbg;
@ -341,7 +345,7 @@ e_bg_add(int container, int zone, int desk_x, int desk_y, const char *file)
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{
if ((cfbg) &&
(cfbg->container == container) &&
(cfbg->manager == manager) &&
(cfbg->zone == zone) &&
(cfbg->desk_x == desk_x) &&
(cfbg->desk_y == desk_y) &&
@ -352,9 +356,9 @@ e_bg_add(int container, int zone, int desk_x, int desk_y, const char *file)
}
}
e_bg_del(container, zone, desk_x, desk_y);
e_bg_del(manager, zone, desk_x, desk_y);
cfbg = E_NEW(E_Config_Desktop_Background, 1);
cfbg->container = container;
cfbg->manager = manager;
cfbg->zone = zone;
cfbg->desk_x = desk_x;
cfbg->desk_y = desk_y;
@ -364,7 +368,7 @@ e_bg_add(int container, int zone, int desk_x, int desk_y, const char *file)
e_filereg_register(cfbg->file);
ev = E_NEW(E_Event_Bg_Update, 1);
ev->container = container;
ev->manager = manager;
ev->zone = zone;
ev->desk_x = desk_x;
ev->desk_y = desk_y;
@ -372,7 +376,7 @@ e_bg_add(int container, int zone, int desk_x, int desk_y, const char *file)
}
EAPI void
e_bg_del(int container, int zone, int desk_x, int desk_y)
e_bg_del(int manager, int zone, int desk_x, int desk_y)
{
Eina_List *l;
E_Config_Desktop_Background *cfbg;
@ -381,7 +385,7 @@ e_bg_del(int container, int zone, int desk_x, int desk_y)
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{
if (!cfbg) continue;
if ((cfbg->container == container) && (cfbg->zone == zone) &&
if ((cfbg->manager == manager) && (cfbg->zone == zone) &&
(cfbg->desk_x == desk_x) && (cfbg->desk_y == desk_y))
{
e_config->desktop_backgrounds = eina_list_remove_list(e_config->desktop_backgrounds, l);
@ -393,7 +397,7 @@ e_bg_del(int container, int zone, int desk_x, int desk_y)
}
ev = E_NEW(E_Event_Bg_Update, 1);
ev->container = container;
ev->manager = manager;
ev->zone = zone;
ev->desk_x = desk_x;
ev->desk_y = desk_y;
@ -403,21 +407,13 @@ e_bg_del(int container, int zone, int desk_x, int desk_y)
EAPI void
e_bg_update(void)
{
Eina_List *l, *ll, *lll;
E_Manager *man;
E_Container *con;
const Eina_List *l, *ll;
E_Comp *c;
E_Zone *zone;
EINA_LIST_FOREACH(e_manager_list(), l, man)
{
EINA_LIST_FOREACH(man->containers, ll, con)
{
EINA_LIST_FOREACH(con->zones, lll, zone)
{
e_zone_bg_reconfigure(zone);
}
}
}
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->zones, ll, zone)
e_zone_bg_reconfigure(zone);
}
/* local subsystem functions */
@ -507,19 +503,11 @@ _e_bg_signal(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNU
{
E_Zone *zone = data;
if (zone->prev_bg_object)
{
evas_object_del(zone->prev_bg_object);
zone->prev_bg_object = NULL;
}
if (zone->transition_object)
{
evas_object_del(zone->transition_object);
zone->transition_object = NULL;
}
E_FREE_FUNC(zone->prev_bg_object, evas_object_del);
E_FREE_FUNC(zone->transition_object, evas_object_del);
evas_object_move(zone->bg_object, zone->x, zone->y);
evas_object_resize(zone->bg_object, zone->w, zone->h);
evas_object_layer_set(zone->bg_object, E_COMP_CANVAS_LAYER_BG);
evas_object_layer_set(zone->bg_object, E_LAYER_BG);
evas_object_clip_set(zone->bg_object, zone->bg_clip_object);
evas_object_show(zone->bg_object);
}

View File

@ -19,7 +19,7 @@ extern EAPI int E_EVENT_BG_UPDATE;
struct _E_Event_Bg_Update
{
int container;
int manager;
int zone;
int desk_x;
int desk_y;
@ -28,11 +28,11 @@ struct _E_Event_Bg_Update
EINTERN int e_bg_init(void);
EINTERN int e_bg_shutdown(void);
EAPI const E_Config_Desktop_Background *e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y);
EAPI Eina_Stringshare *e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y);
EAPI const E_Config_Desktop_Background *e_bg_config_get(int manager_num, int zone_num, int desk_x, int desk_y);
EAPI Eina_Stringshare *e_bg_file_get(int manager_num, int zone_num, int desk_x, int desk_y);
EAPI void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition);
EAPI void e_bg_add(int container, int zone, int desk_x, int desk_y, const char *file);
EAPI void e_bg_del(int container, int zone, int desk_x, int desk_y);
EAPI void e_bg_add(int manager, int zone, int desk_x, int desk_y, const char *file);
EAPI void e_bg_del(int manager, int zone, int desk_x, int desk_y);
EAPI void e_bg_default_set(const char *file);
EAPI void e_bg_update(void);

View File

@ -1,8 +1,6 @@
#include "e.h"
/* local subsystem functions */
static Eina_Bool _e_bindings_mapping_change_event_cb(void *data, int type, void *event);
static void _e_bindings_mouse_free(E_Binding_Mouse *bind);
static void _e_bindings_key_free(E_Binding_Key *bind);
static void _e_bindings_edge_free(E_Binding_Edge *bind);
@ -15,15 +13,12 @@ static Eina_Bool _e_bindings_edge_cb_timer(void *data);
/* local subsystem globals */
static Ecore_Event_Handler *mapping_handler = NULL;
static Eina_List *mouse_bindings = NULL;
static Eina_List *key_bindings = NULL;
static Eina_List *edge_bindings = NULL;
static Eina_List *signal_bindings = NULL;
static Eina_List *wheel_bindings = NULL;
static Eina_List *acpi_bindings = NULL;
static int _e_bindings_mapping_change_enabled = 1;
typedef struct _E_Binding_Edge_Data E_Binding_Edge_Data;
@ -48,9 +43,6 @@ e_bindings_init(void)
E_Config_Binding_Acpi *eba;
Eina_List *l;
mapping_handler = ecore_event_handler_add
(ECORE_X_EVENT_MAPPING_CHANGE, _e_bindings_mapping_change_event_cb, NULL);
EINA_LIST_FOREACH(e_bindings->mouse_bindings, l, ebm)
e_bindings_mouse_add(ebm->context, ebm->button, ebm->modifiers,
ebm->any_mod, ebm->action, ebm->params);
@ -105,12 +97,6 @@ e_bindings_shutdown(void)
E_FREE_LIST(wheel_bindings, _e_bindings_wheel_free);
E_FREE_LIST(acpi_bindings, _e_bindings_acpi_free);
if (mapping_handler)
{
ecore_event_handler_del(mapping_handler);
mapping_handler = NULL;
}
return 1;
}
@ -136,7 +122,8 @@ e_bindings_ecore_event_mouse_wheel_convert(const Ecore_Event_Mouse_Wheel *ev, E_
memset(event, 0, sizeof(E_Binding_Event_Wheel));
event->direction = ev->direction;
event->z = ev->z;
event->canvas.x = ev->root.x, event->canvas.y = ev->root.y;
event->canvas.x = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x);
event->canvas.y = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.y);
event->timestamp = ev->timestamp;
event->modifiers = _e_bindings_modifiers(ev->modifiers);
}
@ -146,7 +133,8 @@ e_bindings_ecore_event_mouse_button_convert(const Ecore_Event_Mouse_Button *ev,
{
memset(event, 0, sizeof(E_Binding_Event_Mouse_Button));
event->button = ev->buttons;
event->canvas.x = ev->root.x, event->canvas.y = ev->root.y;
event->canvas.x = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.x);
event->canvas.y = e_comp_canvas_x_root_adjust(e_comp_get(NULL), ev->root.y);
event->timestamp = ev->timestamp;
event->modifiers = _e_bindings_modifiers(ev->modifiers);
@ -189,6 +177,20 @@ e_bindings_evas_event_mouse_wheel_convert(const Evas_Event_Mouse_Wheel *ev, E_Bi
*/
}
EAPI int
e_bindings_evas_modifiers_convert(Evas_Modifier *modifiers)
{
int mod = 0;
mod |= (E_BINDING_MODIFIER_SHIFT * evas_key_modifier_is_set(modifiers, "Shift"));
mod |= (E_BINDING_MODIFIER_CTRL * evas_key_modifier_is_set(modifiers, "Control"));
mod |= (E_BINDING_MODIFIER_ALT * evas_key_modifier_is_set(modifiers, "Alt"));
mod |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(modifiers, "Super"));
mod |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(modifiers, "Hyper"));
mod |= (E_BINDING_MODIFIER_ALTGR * evas_key_modifier_is_set(modifiers, "AltGr"));
return mod;
}
EAPI void
e_bindings_evas_event_mouse_button_convert(const Evas_Event_Mouse_Down *ev, E_Binding_Event_Mouse_Button *event)
{
@ -197,12 +199,7 @@ e_bindings_evas_event_mouse_button_convert(const Evas_Event_Mouse_Down *ev, E_Bi
event->canvas.x = ev->output.x, event->canvas.y = ev->output.y;
event->timestamp = ev->timestamp;
event->modifiers |= (E_BINDING_MODIFIER_SHIFT * evas_key_modifier_is_set(ev->modifiers, "Shift"));
event->modifiers |= (E_BINDING_MODIFIER_CTRL * evas_key_modifier_is_set(ev->modifiers, "Control"));
event->modifiers |= (E_BINDING_MODIFIER_ALT * evas_key_modifier_is_set(ev->modifiers, "Alt"));
event->modifiers |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(ev->modifiers, "Super"));
event->modifiers |= (E_BINDING_MODIFIER_WIN * evas_key_modifier_is_set(ev->modifiers, "Hyper"));
event->modifiers |= (E_BINDING_MODIFIER_ALTGR * evas_key_modifier_is_set(ev->modifiers, "AltGr"));
event->modifiers = e_bindings_evas_modifiers_convert(ev->modifiers);
event->hold = (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD);
event->scroll = (ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL);
@ -873,7 +870,7 @@ e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Z
Eina_List *l;
current = e_desk_at_xy_get(ev->zone, ev->zone->desk_x_current, ev->zone->desk_y_current);
if (current->fullscreen_borders && (!e_config->fullscreen_flip)) return NULL;
if (current->fullscreen_clients && (!e_config->fullscreen_flip)) return NULL;
if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
@ -965,7 +962,7 @@ e_bindings_edge_down_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event
Eina_List *l;
current = e_desk_at_xy_get(ev->zone, ev->zone->desk_x_current, ev->zone->desk_y_current);
if (current->fullscreen_borders && (!e_config->fullscreen_flip)) return NULL;
if (current->fullscreen_clients && (!e_config->fullscreen_flip)) return NULL;
if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT;
if (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL;
@ -1364,29 +1361,6 @@ e_bindings_acpi_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi
return act;
}
EAPI void
e_bindings_mapping_change_enable(Eina_Bool enable)
{
if (enable)
_e_bindings_mapping_change_enabled++;
else
_e_bindings_mapping_change_enabled--;
if (_e_bindings_mapping_change_enabled < 0)
_e_bindings_mapping_change_enabled = 0;
}
/* local subsystem functions */
static Eina_Bool
_e_bindings_mapping_change_event_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
{
if (!_e_bindings_mapping_change_enabled) return ECORE_CALLBACK_RENEW;
e_managers_keys_ungrab();
e_border_button_bindings_ungrab_all();
e_border_button_bindings_grab_all();
e_managers_keys_grab();
return ECORE_CALLBACK_PASS_ON;
}
static void
_e_bindings_mouse_free(E_Binding_Mouse *binding)
{
@ -1502,14 +1476,13 @@ _e_bindings_edge_cb_timer(void *data)
ev = ed->ev;
E_FREE(ed);
binding->timer = NULL;
if (act->func.go_edge)
act->func.go_edge(obj, binding->params, ev);
else if (act->func.go)
act->func.go(obj, binding->params);
binding->timer = NULL;
/* Duplicate event */
E_FREE(ev);

View File

@ -6,7 +6,7 @@ typedef enum _E_Binding_Context
E_BINDING_CONTEXT_UNKNOWN,
E_BINDING_CONTEXT_WINDOW,
E_BINDING_CONTEXT_ZONE,
E_BINDING_CONTEXT_CONTAINER,
E_BINDING_CONTEXT_COMPOSITOR,
E_BINDING_CONTEXT_MANAGER,
E_BINDING_CONTEXT_MENU,
E_BINDING_CONTEXT_WINLIST,
@ -193,8 +193,8 @@ EAPI void e_bindings_acpi_add(E_Binding_Context ctxt, int type, int status, cons
EAPI void e_bindings_acpi_del(E_Binding_Context ctxt, int type, int status, const char *action, const char *params);
EAPI E_Action *e_bindings_acpi_find(E_Binding_Context ctxt, E_Event_Acpi *ev, E_Binding_Acpi **bind_ret);
EAPI E_Action *e_bindings_acpi_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Acpi *ev);
EAPI void e_bindings_mapping_change_enable(Eina_Bool enable);
EAPI int e_bindings_evas_modifiers_convert(Evas_Modifier *modifiers);
EAPI int e_bindings_modifiers_to_ecore_convert(E_Binding_Modifier modifiers);
EAPI void e_bindings_evas_event_mouse_button_convert(const Evas_Event_Mouse_Down *ev, E_Binding_Event_Mouse_Button *event);
EAPI void e_bindings_evas_event_mouse_wheel_convert(const Evas_Event_Mouse_Wheel *ev, E_Binding_Event_Wheel *event);

File diff suppressed because it is too large Load Diff

View File

@ -1,885 +0,0 @@
#ifdef E_TYPEDEFS
typedef enum _E_Screen_Limits
{
E_SCREEN_LIMITS_PARTLY = 0,
E_SCREEN_LIMITS_COMPLETELY = 1,
E_SCREEN_LIMITS_WITHIN = 2
} E_Screen_Limits;
typedef enum _E_Icon_Preference
{
E_ICON_PREF_E_DEFAULT,
E_ICON_PREF_NETWM,
E_ICON_PREF_USER
} E_Icon_Preference;
typedef enum _E_Direction
{
E_DIRECTION_UP,
E_DIRECTION_DOWN,
E_DIRECTION_LEFT,
E_DIRECTION_RIGHT
} E_Direction;
typedef enum _E_Transition
{
E_TRANSITION_LINEAR = 0,
E_TRANSITION_SINUSOIDAL = 1,
E_TRANSITION_ACCELERATE = 2,
E_TRANSITION_DECELERATE = 3,
E_TRANSITION_ACCELERATE_LOTS = 4,
E_TRANSITION_DECELERATE_LOTS = 5,
E_TRANSITION_SINUSOIDAL_LOTS = 6,
E_TRANSITION_BOUNCE = 7,
E_TRANSITION_BOUNCE_LOTS = 8
} E_Transition;
typedef enum _E_Stacking
{
E_STACKING_NONE,
E_STACKING_ABOVE,
E_STACKING_BELOW
} E_Stacking;
typedef enum _E_Focus_Policy
{
E_FOCUS_CLICK,
E_FOCUS_MOUSE,
E_FOCUS_SLOPPY,
E_FOCUS_LAST
} E_Focus_Policy;
typedef enum _E_Urgency_Policy
{
E_ACTIVEHINT_POLICY_IGNORE,
E_ACTIVEHINT_POLICY_ANIMATE,
E_ACTIVEHINT_POLICY_ACTIVATE
} E_Urgency_Policy;
typedef enum _E_Focus_Setting
{
E_FOCUS_NONE,
E_FOCUS_NEW_WINDOW,
E_FOCUS_NEW_DIALOG,
E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED
} E_Focus_Setting;
typedef enum _E_Maximize
{
E_MAXIMIZE_NONE = 0x00000000,
E_MAXIMIZE_FULLSCREEN = 0x00000001,
E_MAXIMIZE_SMART = 0x00000002,
E_MAXIMIZE_EXPAND = 0x00000003,
E_MAXIMIZE_FILL = 0x00000004,
E_MAXIMIZE_TYPE = 0x0000000f,
E_MAXIMIZE_VERTICAL = 0x00000010,
E_MAXIMIZE_HORIZONTAL = 0x00000020,
E_MAXIMIZE_BOTH = 0x00000030,
E_MAXIMIZE_LEFT = 0x00000070,
E_MAXIMIZE_RIGHT = 0x000000b0,
E_MAXIMIZE_DIRECTION = 0x000000f0
} E_Maximize;
typedef enum _E_Fullscreen
{
/* Resize window */
E_FULLSCREEN_RESIZE,
/* Change screen resoultion and resize window */
E_FULLSCREEN_ZOOM
} E_Fullscreen;
typedef enum _E_Window_Placement
{
E_WINDOW_PLACEMENT_SMART,
E_WINDOW_PLACEMENT_ANTIGADGET,
E_WINDOW_PLACEMENT_CURSOR,
E_WINDOW_PLACEMENT_MANUAL
} E_Window_Placement;
typedef enum _E_Border_Hook_Point
{
E_BORDER_HOOK_EVAL_PRE_FETCH,
E_BORDER_HOOK_EVAL_PRE_POST_FETCH,
E_BORDER_HOOK_EVAL_POST_FETCH,
E_BORDER_HOOK_EVAL_PRE_BORDER_ASSIGN,
E_BORDER_HOOK_EVAL_POST_BORDER_ASSIGN,
E_BORDER_HOOK_EVAL_PRE_NEW_BORDER,
E_BORDER_HOOK_EVAL_POST_NEW_BORDER,
E_BORDER_HOOK_EVAL_END,
E_BORDER_HOOK_CONTAINER_LAYOUT,
E_BORDER_HOOK_NEW_BORDER,
E_BORDER_HOOK_SET_DESK,
E_BORDER_HOOK_MOVE_BEGIN,
E_BORDER_HOOK_MOVE_UPDATE,
E_BORDER_HOOK_MOVE_END,
E_BORDER_HOOK_RESIZE_BEGIN,
E_BORDER_HOOK_RESIZE_UPDATE,
E_BORDER_HOOK_RESIZE_END
} E_Border_Hook_Point;
typedef struct _E_Border E_Border;
typedef struct _E_Event_Border_Simple E_Event_Border_Simple;
typedef struct _E_Border_Pending_Move_Resize E_Border_Pending_Move_Resize;
typedef struct _E_Border_Hook E_Border_Hook;
typedef struct _E_Event_Border_Simple E_Event_Border_Resize;
typedef struct _E_Event_Border_Simple E_Event_Border_Move;
typedef struct _E_Event_Border_Simple E_Event_Border_Add;
typedef struct _E_Event_Border_Simple E_Event_Border_Remove;
typedef struct _E_Event_Border_Simple E_Event_Border_Show;
typedef struct _E_Event_Border_Hide E_Event_Border_Hide;
typedef struct _E_Event_Border_Simple E_Event_Border_Iconify;
typedef struct _E_Event_Border_Simple E_Event_Border_Uniconify;
typedef struct _E_Event_Border_Simple E_Event_Border_Stick;
typedef struct _E_Event_Border_Simple E_Event_Border_Unstick;
typedef struct _E_Event_Border_Zone_Set E_Event_Border_Zone_Set;
typedef struct _E_Event_Border_Desk_Set E_Event_Border_Desk_Set;
typedef struct _E_Event_Border_Stack E_Event_Border_Stack;
typedef struct _E_Event_Border_Simple E_Event_Border_Icon_Change;
typedef struct _E_Event_Border_Simple E_Event_Border_Title_Change;
typedef struct _E_Event_Border_Simple E_Event_Border_Urgent_Change;
typedef struct _E_Event_Border_Simple E_Event_Border_Focus_In;
typedef struct _E_Event_Border_Simple E_Event_Border_Focus_Out;
typedef struct _E_Event_Border_Simple E_Event_Border_Property;
typedef struct _E_Event_Border_Simple E_Event_Border_Fullscreen;
typedef struct _E_Event_Border_Simple E_Event_Border_Unfullscreen;
typedef void (*E_Border_Move_Intercept_Cb)(E_Border *, int x, int y);
#else
#ifndef E_BORDER_H
#define E_BORDER_H
#define E_BORDER_TYPE (int)0xE0b01002
struct _E_Border
{
E_Object e_obj_inherit;
struct
{
struct
{
int x, y, w, h;
int mx, my;
} current, last_down[3], last_up[3];
} mouse;
struct
{
struct
{
int x, y, w, h;
int mx, my;
int button;
} down;
} moveinfo;
int x, y, w, h;
int ref;
E_Zone *zone;
E_Desk *desk;
struct
{
int l, r, t, b;
Eina_Bool calc : 1; // inset has been calculated
} client_inset;
E_Comp_Win *cw;
Ecore_X_Window win;
Evas_Object *bg_object;
Evas_Object *icon_object;
Evas_Object *input_object;
Eina_Stringshare *internal_icon;
Eina_Stringshare *internal_icon_key;
Eina_Bool callbacks_set : 1;
struct
{
Ecore_X_Window lock_win;
Ecore_X_Window win;
int w, h;
struct
{
Eina_Bool mapping_change : 1;
Eina_Bool iconic_shading : 1;
} hacks;
struct
{
unsigned char changed : 1;
unsigned char user_selected : 1;
Eina_Stringshare *name;
} border;
unsigned char shaped : 1;
unsigned char argb : 1;
/* ICCCM */
struct
{
Eina_Stringshare *title;
Eina_Stringshare *name;
Eina_Stringshare *class;
Eina_Stringshare *icon_name;
Eina_Stringshare *machine;
int min_w, min_h;
int max_w, max_h;
int base_w, base_h;
int step_w, step_h;
int start_x, start_y;
double min_aspect, max_aspect;
Ecore_X_Window_State_Hint initial_state;
Ecore_X_Window_State_Hint state;
Ecore_X_Pixmap icon_pixmap;
Ecore_X_Pixmap icon_mask;
Ecore_X_Window icon_window;
Ecore_X_Window window_group;
Ecore_X_Window transient_for;
Ecore_X_Window client_leader;
Ecore_X_Gravity gravity;
Eina_Stringshare *window_role;
unsigned char take_focus : 1;
unsigned char accepts_focus : 1;
unsigned char urgent : 1;
unsigned char delete_request : 1;
unsigned char request_pos : 1;
struct
{
int argc;
char **argv;
} command;
struct
{
unsigned char title : 1;
unsigned char name_class : 1;
unsigned char icon_name : 1;
unsigned char machine : 1;
unsigned char hints : 1;
unsigned char size_pos_hints : 1;
unsigned char protocol : 1;
unsigned char transient_for : 1;
unsigned char client_leader : 1;
unsigned char window_role : 1;
unsigned char state : 1;
unsigned char command : 1;
} fetch;
} icccm;
/* MWM */
struct
{
Ecore_X_MWM_Hint_Func func;
Ecore_X_MWM_Hint_Decor decor;
Ecore_X_MWM_Hint_Input input;
unsigned char exists : 1;
unsigned char borderless : 1;
struct
{
unsigned char hints : 1;
} fetch;
} mwm;
/* NetWM */
struct
{
pid_t pid;
unsigned int desktop;
Eina_Stringshare *name;
Eina_Stringshare *icon_name;
Ecore_X_Icon *icons;
int num_icons;
unsigned int user_time;
unsigned char opacity;
Eina_Bool opacity_changed : 1; // prevent fetching opacity next prop change
struct
{
int left;
int right;
int top;
int bottom;
int left_start_y;
int left_end_y;
int right_start_y;
int right_end_y;
int top_start_x;
int top_end_x;
int bottom_start_x;
int bottom_end_x;
} strut;
unsigned char ping : 1;
struct
{
unsigned char request : 1;
unsigned int wait;
Ecore_X_Sync_Alarm alarm;
Ecore_X_Sync_Counter counter;
unsigned int serial;
double send_time;
} sync;
/* NetWM Window state */
struct
{
unsigned char modal : 1;
unsigned char sticky : 1;
unsigned char maximized_v : 1;
unsigned char maximized_h : 1;
unsigned char shaded : 1;
unsigned char skip_taskbar : 1;
unsigned char skip_pager : 1;
unsigned char hidden : 1;
unsigned char fullscreen : 1;
E_Stacking stacking;
} state;
/* NetWM Window allowed actions */
struct
{
unsigned char move : 1;
unsigned char resize : 1;
unsigned char minimize : 1;
unsigned char shade : 1;
unsigned char stick : 1;
unsigned char maximized_h : 1;
unsigned char maximized_v : 1;
unsigned char fullscreen : 1;
unsigned char change_desktop : 1;
unsigned char close : 1;
} action;
Ecore_X_Window_Type type;
Ecore_X_Window_Type *extra_types;
int extra_types_num;
int startup_id;
struct
{
unsigned char name : 1;
unsigned char icon_name : 1;
unsigned char icon : 1;
unsigned char user_time : 1;
unsigned char strut : 1;
unsigned char type : 1;
unsigned char state : 1;
unsigned char opacity : 1;
/* No, fetch on new_client, shouldn't be changed after map.
unsigned char pid : 1;
*/
/* No, ignore this
unsigned char desktop : 1;
*/
} fetch;
struct
{
unsigned char state : 1;
} update;
} netwm;
/* Extra e stuff */
struct
{
struct
{
struct
{
int x, y;
unsigned char updated : 1;
} video_position;
Ecore_X_Window video_parent;
E_Border *video_parent_border;
Eina_List *video_child;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
struct
{
Eina_Stringshare *name;
Eina_Stringshare **available_list;
int num;
unsigned char wait_for_done : 1;
unsigned char use : 1;
} profile;
#endif
unsigned char centered : 1;
unsigned char video : 1;
} state;
struct
{
unsigned char state : 1;
unsigned char video_parent : 1;
unsigned char video_position : 1;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
unsigned char profile : 1;
#endif
} fetch;
} e;
struct
{
struct
{
unsigned char soft_menu : 1;
unsigned char soft_menus : 1;
} fetch;
unsigned char soft_menu : 1;
unsigned char soft_menus : 1;
} qtopia;
struct
{
struct
{
unsigned char state : 1;
unsigned char vkbd : 1;
} fetch;
Ecore_X_Virtual_Keyboard_State state;
unsigned char have_property : 1;
unsigned char vkbd : 1;
} vkbd;
struct
{
struct
{
struct
{
unsigned char conformant : 1;
} fetch;
unsigned char conformant : 1;
} conformant;
struct
{
struct
{
unsigned char state : 1;
struct
{
unsigned int major : 1;
unsigned int minor : 1;
} priority;
unsigned char quickpanel : 1;
unsigned char zone : 1;
} fetch;
Ecore_X_Illume_Quickpanel_State state;
struct
{
unsigned int major : 1;
unsigned int minor : 1;
} priority;
unsigned char quickpanel : 1;
int zone;
} quickpanel;
struct
{
struct
{
unsigned char drag : 1;
unsigned char locked : 1;
} fetch;
unsigned char drag : 1;
unsigned char locked : 1;
} drag;
struct
{
struct
{
unsigned char state : 1;
} fetch;
Ecore_X_Illume_Window_State state;
} win_state;
} illume;
Ecore_X_Window_Attributes initial_attributes;
} client;
E_Container_Shape *shape;
unsigned int visible : 1;
Eina_Bool hidden : 1; // set when window has been hidden by api and should not be shown
unsigned int await_hide_event;
unsigned int moving : 1;
unsigned int focused : 1;
unsigned int new_client : 1;
unsigned int re_manage : 1;
unsigned int placed : 1;
unsigned int shading : 1;
unsigned int shaded : 1;
unsigned int iconic : 1;
unsigned int deskshow : 1;
unsigned int sticky : 1;
unsigned int shaped_input : 1;
unsigned int need_shape_merge : 1;
unsigned int need_shape_export : 1;
unsigned int fullscreen : 1;
unsigned int need_fullscreen : 1;
unsigned int already_unparented : 1;
unsigned int need_reparent : 1;
unsigned int button_grabbed : 1;
unsigned int delete_requested : 1;
unsigned int ping_ok : 1;
unsigned int hung : 1;
unsigned int take_focus : 1;
unsigned int want_focus : 1;
unsigned int user_skip_winlist : 1;
unsigned int need_maximize : 1;
E_Maximize maximized;
E_Fullscreen fullscreen_policy;
unsigned int borderless : 1;
unsigned char offer_resistance : 1;
Eina_Stringshare *bordername;
unsigned int lock_user_location : 1; /*DONE*/
unsigned int lock_client_location : 1; /*DONE*/
unsigned int lock_user_size : 1; /*DONE*/
unsigned int lock_client_size : 1; /*DONE*/
unsigned int lock_user_stacking : 1; /*DONE*/
unsigned int lock_client_stacking : 1; /*DONE*/
unsigned int lock_user_iconify : 1; /*DONE*/
unsigned int lock_client_iconify : 1; /*DONE*/
unsigned int lock_user_desk : 1;
unsigned int lock_client_desk : 1;
unsigned int lock_user_sticky : 1; /*DONE*/
unsigned int lock_client_sticky : 1; /*DONE*/
unsigned int lock_user_shade : 1; /*DONE*/
unsigned int lock_client_shade : 1; /*DONE*/
unsigned int lock_user_maximize : 1; /*DONE*/
unsigned int lock_client_maximize : 1; /*DONE*/
unsigned int lock_user_fullscreen : 1; /*DONE*/
unsigned int lock_client_fullscreen : 1; /*DONE*/
unsigned int lock_border : 1; /*DONE*/
unsigned int lock_close : 1; /*DONE*/
unsigned int lock_focus_in : 1; /*DONE*/
unsigned int lock_focus_out : 1; /*DONE*/
unsigned int lock_life : 1; /*DONE*/
unsigned int internal : 1;
unsigned int internal_no_remember : 1;
unsigned int internal_no_reopen : 1;
unsigned int stolen : 1;
Eina_Bool theme_shadow : 1;
Eina_Bool destroyed : 1;
Ecore_Evas *internal_ecore_evas;
double ping;
unsigned char changed : 1;
unsigned char icon_preference;
unsigned char ignore_first_unmap;
unsigned char resize_mode;
struct
{
int x, y, w, h;
E_Layer layer;
int zone;
E_Maximize maximized;
} saved;
struct
{
unsigned char valid : 1;
int x, y, w, h;
struct
{
int x, y, w, h;
} saved;
} pre_res_change;
struct
{
double start;
double val;
int x, y;
E_Direction dir;
Ecore_Animator *anim;
} shade;
struct
{
int x, y;
int modified;
} shelf_fix;
Eina_List *stick_desks;
E_Menu *border_menu;
E_Config_Dialog *border_locks_dialog;
E_Config_Dialog *border_remember_dialog;
E_Config_Dialog *border_border_dialog;
E_Dialog *border_prop_dialog;
Eina_List *pending_move_resize;
struct
{
unsigned char visible : 1;
unsigned char pos : 1;
unsigned char size : 1;
unsigned char stack : 1;
unsigned char prop : 1;
unsigned char border : 1;
unsigned char reset_gravity : 1;
unsigned char shading : 1;
unsigned char shaded : 1;
unsigned char shape : 1;
unsigned char shape_input : 1;
unsigned char icon : 1;
} changes;
struct
{
unsigned char start : 1;
int x, y;
} drag;
E_Layer layer;
E_Action *cur_mouse_action;
Ecore_Timer *raise_timer;
Ecore_Poller *ping_poller;
Ecore_Timer *kill_timer;
E_Border_Move_Intercept_Cb move_intercept_cb;
E_Remember *remember;
E_Border *modal;
E_Border *leader;
Eina_List *group;
E_Border *parent;
Eina_List *transients;
Efreet_Desktop *desktop;
E_Exec_Instance *exe_inst;
unsigned char comp_hidden : 1;
unsigned char post_move : 1;
unsigned char post_resize : 1;
unsigned char post_show : 1;
unsigned char during_lost : 1;
Ecore_Idle_Enterer *post_job;
Eina_Bool argb;
int tmp_input_hidden;
E_Focus_Policy focus_policy_override;
};
struct _E_Border_Pending_Move_Resize
{
int x, y, w, h;
unsigned char move : 1;
unsigned char resize : 1;
unsigned char without_border : 1;
unsigned int serial;
};
struct _E_Border_Hook
{
E_Border_Hook_Point hookpoint;
void (*func)(void *data, void *bd);
void *data;
unsigned char delete_me : 1;
};
struct _E_Event_Border_Hide
{
E_Border *border;
int manage;
};
struct _E_Event_Border_Simple
{
E_Border *border;
};
struct _E_Event_Border_Zone_Set
{
E_Border *border;
E_Zone *zone;
};
struct _E_Event_Border_Desk_Set
{
E_Border *border;
E_Desk *desk;
};
struct _E_Event_Border_Stack
{
E_Border *border, *stack;
E_Stacking type;
};
EINTERN int e_border_init(void);
EINTERN int e_border_shutdown(void);
EAPI E_Border *e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal);
EAPI void e_border_ref(E_Border *bd);
EAPI void e_border_unref(E_Border *bd);
EAPI void e_border_res_change_geometry_save(E_Border *bd);
EAPI void e_border_res_change_geometry_restore(E_Border *bd);
EAPI void e_border_zone_set(E_Border *bd, E_Zone *zone);
EAPI void e_border_desk_set(E_Border *bd, E_Desk *desk);
EAPI void e_border_show(E_Border *bd);
EAPI void e_border_hide(E_Border *bd, int manage);
EAPI void e_border_move(E_Border *bd, int x, int y);
EAPI void e_border_move_intercept_cb_set(E_Border *bd, E_Border_Move_Intercept_Cb cb);
EAPI void e_border_move_without_border(E_Border *bd, int x, int y);
EAPI void e_border_center(E_Border *bd);
EAPI void e_border_center_pos_get(E_Border *bd, int *x, int *y);
EAPI void e_border_resize(E_Border *bd, int w, int h);
EAPI void e_border_resize_without_border(E_Border *bd, int w, int h);
EAPI void e_border_move_resize(E_Border *bd, int x, int y, int w, int h);
EAPI void e_border_move_resize_without_border(E_Border *bd, int x, int y, int w, int h);
EAPI void e_border_layer_set(E_Border *bd, E_Layer layer);
EAPI void e_border_raise(E_Border *bd);
EAPI void e_border_lower(E_Border *bd);
EAPI void e_border_stack_above(E_Border *bd, E_Border *above);
EAPI void e_border_stack_below(E_Border *bd, E_Border *below);
EAPI void e_border_focus_latest_set(E_Border *bd);
EAPI void e_border_raise_latest_set(E_Border *bd);
EAPI void e_border_focus_set_with_pointer(E_Border *bd);
EAPI void e_border_focus_set(E_Border *bd, int focus, int set);
EAPI void e_border_shade(E_Border *bd, E_Direction dir);
EAPI void e_border_unshade(E_Border *bd, E_Direction dir);
EAPI void e_border_maximize(E_Border *bd, E_Maximize max);
EAPI void e_border_unmaximize(E_Border *bd, E_Maximize max);
EAPI void e_border_fullscreen(E_Border *bd, E_Fullscreen policy);
EAPI void e_border_unfullscreen(E_Border *bd);
EAPI void e_border_iconify(E_Border *bd);
EAPI void e_border_uniconify(E_Border *bd);
EAPI void e_border_stick(E_Border *bd);
EAPI void e_border_unstick(E_Border *bd);
EAPI void e_border_pinned_set(E_Border *bd, int set);
EAPI E_Border *e_border_find_by_client_window(Ecore_X_Window win);
EAPI E_Border *e_border_find_all_by_client_window(Ecore_X_Window win);
EAPI E_Border *e_border_find_by_window(Ecore_X_Window win);
EAPI E_Border *e_border_find_by_alarm(Ecore_X_Sync_Alarm alarm);
EAPI E_Border *e_border_focused_get(void);
EAPI void e_border_idler_before(void);
EAPI Eina_List *e_border_client_list(void);
EAPI void e_border_act_move_keyboard(E_Border *bd);
EAPI void e_border_act_resize_keyboard(E_Border *bd);
EAPI void e_border_act_move_begin(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
EAPI void e_border_act_move_end(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
EAPI void e_border_act_resize_begin(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
EAPI void e_border_act_resize_end(E_Border *bd, E_Binding_Event_Mouse_Button *ev);
EAPI void e_border_act_menu_begin(E_Border *bd, E_Binding_Event_Mouse_Button *ev, int key);
EAPI void e_border_act_close_begin(E_Border *bd);
EAPI void e_border_act_kill_begin(E_Border *bd);
EAPI Evas_Object *e_border_icon_add(E_Border *bd, Evas *evas);
EAPI void e_border_button_bindings_ungrab_all(void);
EAPI void e_border_button_bindings_grab_all(void);
EAPI Eina_List *e_border_focus_stack_get(void);
EAPI Eina_List *e_border_lost_windows_get(E_Zone *zone);
EAPI void e_border_ping(E_Border *bd);
EAPI void e_border_move_cancel(void);
EAPI void e_border_resize_cancel(void);
EAPI void e_border_frame_recalc(E_Border *bd);
EAPI Eina_List *e_border_immortal_windows_get(void);
EAPI const char *e_border_name_get(const E_Border *bd);
EAPI void e_border_signal_move_begin(E_Border *bd, const char *sig, const char *src);
EAPI void e_border_signal_move_end(E_Border *bd, const char *sig, const char *src);
EAPI int e_border_resizing_get(E_Border *bd);
EAPI void e_border_signal_resize_begin(E_Border *bd, const char *dir, const char *sig, const char *src);
EAPI void e_border_signal_resize_end(E_Border *bd, const char *dir, const char *sig, const char *src);
EAPI void e_border_resize_limit(E_Border *bd, int *w, int *h);
EAPI E_Border_Hook *e_border_hook_add(E_Border_Hook_Point hookpoint, void (*func)(void *data, void *bd), void *data);
EAPI void e_border_hook_del(E_Border_Hook *bh);
EAPI void e_border_focus_track_freeze(void);
EAPI void e_border_focus_track_thaw(void);
EAPI E_Border *e_border_under_pointer_get(E_Desk *desk, E_Border *exclude);
EAPI int e_border_pointer_warp_to_center_now(E_Border *bd);
EAPI int e_border_pointer_warp_to_center(E_Border *bd);
EAPI void e_border_comp_hidden_set(E_Border *bd, Eina_Bool hidden);
EAPI void e_border_tmp_input_hidden_push(E_Border *bd);
EAPI void e_border_tmp_input_hidden_pop(E_Border *bd);
EAPI void e_border_activate(E_Border *bd, Eina_Bool just_do_it);
EAPI void e_border_focus_lock_set(Eina_Bool lock);
EAPI Eina_Bool e_border_focus_lock_get(void);
EAPI void e_border_input_object_set(E_Border *bd, Evas_Object *input_obj);
extern EAPI int E_EVENT_BORDER_RESIZE;
extern EAPI int E_EVENT_BORDER_MOVE;
extern EAPI int E_EVENT_BORDER_ADD;
extern EAPI int E_EVENT_BORDER_SHOW;
extern EAPI int E_EVENT_BORDER_HIDE;
extern EAPI int E_EVENT_BORDER_REMOVE;
extern EAPI int E_EVENT_BORDER_ICONIFY;
extern EAPI int E_EVENT_BORDER_UNICONIFY;
extern EAPI int E_EVENT_BORDER_STICK;
extern EAPI int E_EVENT_BORDER_UNSTICK;
extern EAPI int E_EVENT_BORDER_ZONE_SET;
extern EAPI int E_EVENT_BORDER_DESK_SET;
extern EAPI int E_EVENT_BORDER_STACK;
extern EAPI int E_EVENT_BORDER_ICON_CHANGE;
extern EAPI int E_EVENT_BORDER_TITLE_CHANGE;
extern EAPI int E_EVENT_BORDER_URGENT_CHANGE;
extern EAPI int E_EVENT_BORDER_FOCUS_IN;
extern EAPI int E_EVENT_BORDER_FOCUS_OUT;
extern EAPI int E_EVENT_BORDER_PROPERTY;
extern EAPI int E_EVENT_BORDER_FULLSCREEN;
extern EAPI int E_EVENT_BORDER_UNFULLSCREEN;
static inline unsigned int
e_border_inset_width_get(const E_Border *bd)
{
return bd->client_inset.l + bd->client_inset.r;
}
static inline unsigned int
e_border_inset_height_get(const E_Border *bd)
{
return bd->client_inset.t + bd->client_inset.b;
}
/* e_config not available everywhere e_border.h is used...
static inline Eina_Bool
e_border_focus_policy_click(const E_Border *bd)
{
return ((bd->focus_policy_override == E_FOCUS_CLICK) || (e_config->focus_policy == E_FOCUS_CLICK));
}
*/
#define e_border_focus_policy_click(bd) \
((bd->focus_policy_override == E_FOCUS_CLICK) || (e_config->focus_policy == E_FOCUS_CLICK))
/* macro for finding misuse of changed flag */
#if 0
# define BD_CHANGED(BD) \
do { \
if (e_object_is_del(E_OBJECT(BD))) \
EINA_LOG_CRIT("CHANGED SET ON DELETED BORDER!"); \
BD->changed = 1; \
INF("%s:%d - BD CHANGED: %p", __FILE__, __LINE__, BD); \
} while (0)
#else
# define BD_CHANGED(BD) BD->changed = 1
#endif
#endif
#endif

View File

@ -146,7 +146,7 @@ EAPI Ecore_Evas *
e_canvas_new(Ecore_X_Window win, int x, int y, int w, int h,
int direct_resize, int override, Ecore_X_Window *win_ret)
{
Ecore_Evas *ee;
Ecore_Evas *ee = NULL;
ee = ecore_evas_software_x11_new(NULL, win, x, y, w, h);
if (ee)

4465
src/bin/e_client.c Normal file

File diff suppressed because it is too large Load Diff

846
src/bin/e_client.h Normal file
View File

@ -0,0 +1,846 @@
#ifdef E_TYPEDEFS
typedef enum _E_Screen_Limits
{
E_SCREEN_LIMITS_PARTLY = 0,
E_SCREEN_LIMITS_COMPLETELY = 1,
E_SCREEN_LIMITS_WITHIN = 2
} E_Screen_Limits;
typedef enum _E_Icon_Preference
{
E_ICON_PREF_E_DEFAULT,
E_ICON_PREF_NETWM,
E_ICON_PREF_USER
} E_Icon_Preference;
typedef enum _E_Direction
{
E_DIRECTION_UP,
E_DIRECTION_DOWN,
E_DIRECTION_LEFT,
E_DIRECTION_RIGHT
} E_Direction;
typedef enum _E_Transition
{
E_TRANSITION_LINEAR = 0,
E_TRANSITION_SINUSOIDAL = 1,
E_TRANSITION_ACCELERATE = 2,
E_TRANSITION_DECELERATE = 3,
E_TRANSITION_ACCELERATE_LOTS = 4,
E_TRANSITION_DECELERATE_LOTS = 5,
E_TRANSITION_SINUSOIDAL_LOTS = 6,
E_TRANSITION_BOUNCE = 7,
E_TRANSITION_BOUNCE_LOTS = 8
} E_Transition;
typedef enum _E_Stacking
{
E_STACKING_NONE,
E_STACKING_ABOVE,
E_STACKING_BELOW
} E_Stacking;
typedef enum _E_Focus_Policy
{
E_FOCUS_CLICK,
E_FOCUS_MOUSE,
E_FOCUS_SLOPPY,
E_FOCUS_LAST,
} E_Focus_Policy;
typedef enum
{
/* same as ecore-x types */
E_WINDOW_TYPE_UNKNOWN = 0,
E_WINDOW_TYPE_DESKTOP,
E_WINDOW_TYPE_DOCK,
E_WINDOW_TYPE_TOOLBAR,
E_WINDOW_TYPE_MENU,
E_WINDOW_TYPE_UTILITY,
E_WINDOW_TYPE_SPLASH,
E_WINDOW_TYPE_DIALOG,
E_WINDOW_TYPE_NORMAL,
E_WINDOW_TYPE_DROPDOWN_MENU,
E_WINDOW_TYPE_POPUP_MENU,
E_WINDOW_TYPE_TOOLTIP,
E_WINDOW_TYPE_NOTIFICATION,
E_WINDOW_TYPE_COMBO,
E_WINDOW_TYPE_DND
} E_Window_Type;
typedef enum _E_Urgency_Policy
{
E_ACTIVEHINT_POLICY_IGNORE,
E_ACTIVEHINT_POLICY_ANIMATE,
E_ACTIVEHINT_POLICY_ACTIVATE
} E_Urgency_Policy;
typedef enum _E_Focus_Setting
{
E_FOCUS_NONE,
E_FOCUS_NEW_WINDOW,
E_FOCUS_NEW_DIALOG,
E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED
} E_Focus_Setting;
typedef enum _E_Maximize
{
E_MAXIMIZE_NONE = 0x00000000,
E_MAXIMIZE_FULLSCREEN = 0x00000001,
E_MAXIMIZE_SMART = 0x00000002,
E_MAXIMIZE_EXPAND = 0x00000003,
E_MAXIMIZE_FILL = 0x00000004,
E_MAXIMIZE_TYPE = 0x0000000f,
E_MAXIMIZE_VERTICAL = 0x00000010,
E_MAXIMIZE_HORIZONTAL = 0x00000020,
E_MAXIMIZE_BOTH = 0x00000030,
E_MAXIMIZE_LEFT = 0x00000070,
E_MAXIMIZE_RIGHT = 0x000000b0,
E_MAXIMIZE_DIRECTION = 0x000000f0
} E_Maximize;
typedef enum _E_Fullscreen
{
/* Resize window */
E_FULLSCREEN_RESIZE,
/* Change screen resoultion and resize window */
E_FULLSCREEN_ZOOM
} E_Fullscreen;
typedef enum _E_Window_Placement
{
E_WINDOW_PLACEMENT_SMART,
E_WINDOW_PLACEMENT_ANTIGADGET,
E_WINDOW_PLACEMENT_CURSOR,
E_WINDOW_PLACEMENT_MANUAL
} E_Window_Placement;
typedef enum E_Client_Property
{
E_CLIENT_PROPERTY_NONE = 0,
E_CLIENT_PROPERTY_SIZE = (1 << 0),
E_CLIENT_PROPERTY_POS = (1 << 1),
E_CLIENT_PROPERTY_TITLE = (1 << 2),
E_CLIENT_PROPERTY_ICON = (1 << 3),
E_CLIENT_PROPERTY_URGENCY = (1 << 4),
E_CLIENT_PROPERTY_GRAVITY = (1 << 5),
E_CLIENT_PROPERTY_NETWM_STATE = (1 << 6),
} E_Client_Property;
typedef struct E_Client E_Client;
typedef struct E_Event_Client E_Event_Client;
typedef struct _E_Event_Client_Property E_Event_Client_Property;
typedef struct _E_Client_Pending_Resize E_Client_Pending_Resize;
typedef struct E_Event_Client_Zone_Set E_Event_Client_Zone_Set;
typedef struct E_Event_Client_Desk_Set E_Event_Client_Desk_Set;
typedef struct _E_Client_Hook E_Client_Hook;
typedef enum _E_Client_Hook_Point
{
E_CLIENT_HOOK_EVAL_PRE_FETCH,
E_CLIENT_HOOK_EVAL_FETCH,
E_CLIENT_HOOK_EVAL_PRE_POST_FETCH,
E_CLIENT_HOOK_EVAL_POST_FETCH,
E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN,
E_CLIENT_HOOK_EVAL_POST_FRAME_ASSIGN,
E_CLIENT_HOOK_EVAL_PRE_NEW_CLIENT,
E_CLIENT_HOOK_EVAL_POST_NEW_CLIENT,
E_CLIENT_HOOK_EVAL_END,
E_CLIENT_HOOK_FOCUS_SET,
E_CLIENT_HOOK_FOCUS_UNSET,
E_CLIENT_HOOK_CANVAS_LAYOUT, //sends E_Comp!
E_CLIENT_HOOK_NEW_CLIENT,
E_CLIENT_HOOK_DESK_SET,
E_CLIENT_HOOK_MOVE_BEGIN,
E_CLIENT_HOOK_MOVE_UPDATE,
E_CLIENT_HOOK_MOVE_END,
E_CLIENT_HOOK_RESIZE_BEGIN,
E_CLIENT_HOOK_RESIZE_UPDATE,
E_CLIENT_HOOK_RESIZE_END,
E_CLIENT_HOOK_DEL,
E_CLIENT_HOOK_UNREDIRECT,
E_CLIENT_HOOK_REDIRECT,
} E_Client_Hook_Point;
typedef void (*E_Client_Move_Intercept_Cb)(E_Client *, int x, int y);
typedef void (*E_Client_Hook_Cb)(void *data, E_Client *ec);
#else
#define E_CLIENT_TYPE (int)0xE0b01002
struct E_Event_Client
{
E_Client *ec;
};
struct E_Event_Client_Desk_Set
{
E_Client *ec;
E_Desk *desk;
};
struct E_Event_Client_Zone_Set
{
E_Client *ec;
E_Zone *zone;
};
struct _E_Event_Client_Property
{
E_Client *ec;
unsigned int property;
};
struct _E_Client_Hook
{
E_Client_Hook_Point hookpoint;
E_Client_Hook_Cb func;
void *data;
unsigned char delete_me : 1;
};
struct _E_Client_Pending_Resize
{
int w, h;
unsigned int serial;
};
struct E_Client
{
E_Object e_obj_inherit;
EINA_INLIST;
E_Pixmap *pixmap;
E_Comp *comp;
int depth;
int x, y, w, h; //frame+client geom
Eina_Rectangle client; //client geom
Evas_Object *frame; //comp object
E_Zone *zone;
E_Desk *desk;
Ecore_Poller *ping_poller;
Ecore_Timer *kill_timer;
E_Client *modal;
E_Client *leader;
Eina_List *group;
E_Client *parent;
Eina_List *transients;
E_Layer layer;
Eina_Rectangle *shape_rects;
unsigned int shape_rects_num;
Eina_Rectangle *shape_input_rects;
unsigned int shape_input_rects_num;
Eina_Stringshare *internal_icon;
Eina_Stringshare *internal_icon_key;
E_Direction shade_dir;
E_Comp_Client_Data *comp_data; //private for the compositor engine (X, Wayland) ONLY
Evas_Object *input_object; //for running wayland clients in X
E_Action *cur_mouse_action;
int border_size; //size of client's border
struct
{
struct
{
int x, y, w, h;
int mx, my;
} current, last_down[3], last_up[3];
} mouse;
struct
{
struct
{
int x, y, w, h;
int mx, my;
int button;
} down;
} moveinfo;
unsigned char ignore_first_unmap;
E_Pointer_Mode resize_mode;
struct
{
Eina_Bool mapping_change : 1;
Eina_Bool iconic_shading : 1;
} hacks;
struct
{
unsigned char changed : 1;
unsigned char user_selected : 1;
Eina_Stringshare *name;
} border;
struct
{
int x, y, w, h;
E_Layer layer;
int zone;
E_Maximize maximized;
} saved;
struct
{
unsigned char valid : 1;
int x, y, w, h;
struct
{
int x, y, w, h;
} saved;
} pre_res_change;
unsigned char shaped : 1;
unsigned char argb : 1;
/* ICCCM */
struct
{
Eina_Stringshare *title;
Eina_Stringshare *name;
Eina_Stringshare *class;
Eina_Stringshare *icon_name;
Eina_Stringshare *machine;
int min_w, min_h;
int max_w, max_h;
int base_w, base_h;
int step_w, step_h;
int start_x, start_y;
double min_aspect, max_aspect;
Ecore_X_Window_State_Hint initial_state;
Ecore_X_Window_State_Hint state;
Ecore_X_Pixmap icon_pixmap;
Ecore_X_Pixmap icon_mask;
Ecore_X_Window icon_window;
Ecore_X_Window window_group;
Ecore_X_Window transient_for;
Ecore_X_Window client_leader;
Ecore_X_Gravity gravity;
Eina_Stringshare *window_role;
unsigned char take_focus : 1;
unsigned char accepts_focus : 1;
unsigned char urgent : 1;
unsigned char delete_request : 1;
unsigned char request_pos : 1;
struct
{
int argc;
char **argv;
} command;
struct
{
unsigned char title : 1;
unsigned char name_class : 1;
unsigned char icon_name : 1;
unsigned char machine : 1;
unsigned char hints : 1;
unsigned char size_pos_hints : 1;
unsigned char protocol : 1;
unsigned char transient_for : 1;
unsigned char client_leader : 1;
unsigned char window_role : 1;
unsigned char state : 1;
unsigned char command : 1;
} fetch;
} icccm;
/* MWM */
struct
{
Ecore_X_MWM_Hint_Func func;
Ecore_X_MWM_Hint_Decor decor;
Ecore_X_MWM_Hint_Input input;
unsigned char exists : 1;
unsigned char borderless : 1;
struct
{
unsigned char hints : 1;
} fetch;
} mwm;
/* NetWM */
struct
{
pid_t pid;
unsigned int desktop;
Eina_Stringshare *name;
Eina_Stringshare *icon_name;
Ecore_X_Icon *icons;
int num_icons;
unsigned int user_time;
unsigned char opacity;
Eina_Bool opacity_changed : 1; // prevent fetching opacity next prop change
struct
{
int left;
int right;
int top;
int bottom;
int left_start_y;
int left_end_y;
int right_start_y;
int right_end_y;
int top_start_x;
int top_end_x;
int bottom_start_x;
int bottom_end_x;
} strut;
unsigned char ping : 1;
struct
{
unsigned char request : 1;
unsigned int wait;
Ecore_X_Sync_Alarm alarm;
Ecore_X_Sync_Counter counter;
unsigned int serial;
double send_time;
} sync;
/* NetWM Window state */
struct
{
unsigned char modal : 1;
unsigned char sticky : 1;
unsigned char maximized_v : 1;
unsigned char maximized_h : 1;
unsigned char shaded : 1;
unsigned char skip_taskbar : 1;
unsigned char skip_pager : 1;
unsigned char hidden : 1;
unsigned char fullscreen : 1;
E_Stacking stacking;
} state;
/* NetWM Window allowed actions */
struct
{
unsigned char move : 1;
unsigned char resize : 1;
unsigned char minimize : 1;
unsigned char shade : 1;
unsigned char stick : 1;
unsigned char maximized_h : 1;
unsigned char maximized_v : 1;
unsigned char fullscreen : 1;
unsigned char change_desktop : 1;
unsigned char close : 1;
} action;
E_Window_Type type;
E_Window_Type *extra_types;
int extra_types_num;
int startup_id;
struct
{
unsigned char name : 1;
unsigned char icon_name : 1;
unsigned char icon : 1;
unsigned char user_time : 1;
unsigned char strut : 1;
unsigned char type : 1;
unsigned char state : 1;
unsigned char opacity : 1;
/* No, fetch on new_client, shouldn't be changed after map.
unsigned char pid : 1;
*/
/* No, ignore this
unsigned char desktop : 1;
*/
} fetch;
struct
{
unsigned char state : 1;
} update;
} netwm;
/* Extra e stuff */
struct
{
struct
{
struct
{
int x, y;
unsigned char updated : 1;
} video_position;
Ecore_Window video_parent;
E_Client *video_parent_client;
Eina_List *video_child;
struct
{
Eina_Stringshare *name;
Eina_Stringshare **available_list;
Eina_Stringshare *set;
int num;
unsigned char wait_for_done : 1;
unsigned char use : 1;
} profile;
unsigned char centered : 1;
unsigned char video : 1;
} state;
struct
{
unsigned char state : 1;
unsigned char video_parent : 1;
unsigned char video_position : 1;
unsigned char profile : 1;
} fetch;
} e;
struct
{
struct
{
unsigned char soft_menu : 1;
unsigned char soft_menus : 1;
} fetch;
unsigned char soft_menu : 1;
unsigned char soft_menus : 1;
} qtopia;
struct
{
struct
{
unsigned char state : 1;
unsigned char vkbd : 1;
} fetch;
Ecore_X_Virtual_Keyboard_State state;
unsigned char have_property : 1;
unsigned char vkbd : 1;
} vkbd;
struct
{
struct
{
struct
{
unsigned char conformant : 1;
} fetch;
unsigned char conformant : 1;
} conformant;
struct
{
struct
{
unsigned char state : 1;
struct
{
unsigned int major : 1;
unsigned int minor : 1;
} priority;
unsigned char quickpanel : 1;
unsigned char zone : 1;
} fetch;
Ecore_X_Illume_Quickpanel_State state;
struct
{
unsigned int major : 1;
unsigned int minor : 1;
} priority;
unsigned char quickpanel : 1;
int zone;
} quickpanel;
struct
{
struct
{
unsigned char drag : 1;
unsigned char locked : 1;
} fetch;
unsigned char drag : 1;
unsigned char locked : 1;
} drag;
struct
{
struct
{
unsigned char state : 1;
} fetch;
Ecore_X_Illume_Window_State state;
} win_state;
} illume;
struct
{
unsigned char visible : 1;
unsigned char pos : 1;
unsigned char size : 1;
unsigned char stack : 1;
unsigned char prop : 1;
unsigned char border : 1;
unsigned char reset_gravity : 1;
unsigned char shading : 1;
unsigned char shaded : 1;
unsigned char shape : 1;
unsigned char shape_input : 1;
unsigned char icon : 1;
Eina_Bool internal_props : 1;
Eina_Bool internal_state : 1;
Eina_Bool need_maximize : 1;
Eina_Bool need_unmaximize : 1;
} changes;
unsigned int visible : 1;
Eina_Bool hidden : 1; // set when window has been hidden by api and should not be shown
unsigned int await_hide_event;
unsigned int moving : 1;
unsigned int focused : 1;
unsigned int new_client : 1;
unsigned int re_manage : 1;
unsigned int placed : 1;
unsigned int shading : 1;
unsigned int shaded : 1;
unsigned int iconic : 1;
unsigned int deskshow : 1;
unsigned int sticky : 1;
unsigned int shaped_input : 1;
unsigned int need_shape_merge : 1;
unsigned int need_shape_export : 1;
unsigned int fullscreen : 1;
unsigned int need_fullscreen : 1;
unsigned int already_unparented : 1;
unsigned int need_reparent : 1;
unsigned int button_grabbed : 1;
unsigned int delete_requested : 1;
unsigned int ping_ok : 1;
unsigned int hung : 1;
unsigned int take_focus : 1;
unsigned int want_focus : 1;
unsigned int user_skip_winlist : 1;
E_Maximize maximized;
E_Fullscreen fullscreen_policy;
unsigned int borderless : 1;
unsigned char offer_resistance : 1;
Eina_Stringshare *bordername;
unsigned int lock_user_location : 1; /*DONE*/
unsigned int lock_client_location : 1; /*DONE*/
unsigned int lock_user_size : 1; /*DONE*/
unsigned int lock_client_size : 1; /*DONE*/
unsigned int lock_user_stacking : 1; /*DONE*/
unsigned int lock_client_stacking : 1; /*DONE*/
unsigned int lock_user_iconify : 1; /*DONE*/
unsigned int lock_client_iconify : 1; /*DONE*/
unsigned int lock_user_desk : 1;
unsigned int lock_client_desk : 1;
unsigned int lock_user_sticky : 1; /*DONE*/
unsigned int lock_client_sticky : 1; /*DONE*/
unsigned int lock_user_shade : 1; /*DONE*/
unsigned int lock_client_shade : 1; /*DONE*/
unsigned int lock_user_maximize : 1; /*DONE*/
unsigned int lock_client_maximize : 1; /*DONE*/
unsigned int lock_user_fullscreen : 1; /*DONE*/
unsigned int lock_client_fullscreen : 1; /*DONE*/
unsigned int lock_border : 1; /*DONE*/
unsigned int lock_close : 1; /*DONE*/
unsigned int lock_focus_in : 1; /*DONE*/
unsigned int lock_focus_out : 1; /*DONE*/
unsigned int lock_life : 1; /*DONE*/
unsigned int stolen : 1;
unsigned int internal : 1;
unsigned int internal_no_remember : 1;
unsigned int internal_no_reopen : 1;
Eina_Bool theme_shadow : 1;
Ecore_Evas *internal_ecore_evas;
double ping;
unsigned char changed : 1;
unsigned char icon_preference;
struct
{
int x, y;
int modified;
} shelf_fix;
Eina_List *stick_desks;
E_Menu *border_menu;
E_Config_Dialog *border_locks_dialog;
E_Config_Dialog *border_remember_dialog;
E_Config_Dialog *border_border_dialog;
E_Dialog *border_prop_dialog;
Eina_List *pending_resize;
struct
{
unsigned char start : 1;
int x, y;
} drag;
Ecore_Timer *raise_timer;
E_Client_Move_Intercept_Cb move_intercept_cb;
E_Remember *remember;
Efreet_Desktop *desktop;
E_Exec_Instance *exe_inst;
unsigned char comp_hidden : 1;
unsigned char post_move : 1;
unsigned char post_resize : 1;
unsigned char post_show : 1;
unsigned char during_lost : 1;
Ecore_Idle_Enterer *post_job;
E_Focus_Policy focus_policy_override;
Eina_Bool override : 1;
Eina_Bool input_only : 1;
Eina_Bool dialog : 1;
Eina_Bool tooltip : 1;
Eina_Bool redirected : 1;
Eina_Bool shape_changed : 1;
Eina_Bool ignored : 1; // client is comp-ignored
Eina_Bool no_shape_cut : 1; // client shape should not be cut
};
#define e_client_focus_policy_click(ec) \
((ec->focus_policy_override == E_FOCUS_CLICK) || (e_config->focus_policy == E_FOCUS_CLICK))
/* macro for finding misuse of changed flag */
#if 0
# define EC_CHANGED(EC) \
do { \
if (e_object_is_del(E_OBJECT(EC))) \
EINA_LOG_CRIT("CHANGED SET ON DELETED CLIENT!"); \
EC->changed = 1; \
INF("%s:%d - EC CHANGED: %p", __FILE__, __LINE__, EC); \
} while (0)
#else
# define EC_CHANGED(EC) EC->changed = 1
#endif
#define E_CLIENT_FOREACH(COMP, EC) \
for (EC = e_client_bottom_get(COMP); EC; EC = e_client_above_get(EC))
#define E_CLIENT_REVERSE_FOREACH(COMP, EC) \
for (EC = e_client_top_get(COMP); EC; EC = e_client_below_get(EC))
EAPI extern int E_EVENT_CLIENT_ADD;
EAPI extern int E_EVENT_CLIENT_REMOVE;
EAPI extern int E_EVENT_CLIENT_ZONE_SET;
EAPI extern int E_EVENT_CLIENT_DESK_SET;
EAPI extern int E_EVENT_CLIENT_RESIZE;
EAPI extern int E_EVENT_CLIENT_MOVE;
EAPI extern int E_EVENT_CLIENT_SHOW;
EAPI extern int E_EVENT_CLIENT_HIDE;
EAPI extern int E_EVENT_CLIENT_ICONIFY;
EAPI extern int E_EVENT_CLIENT_UNICONIFY;
EAPI extern int E_EVENT_CLIENT_STICK;
EAPI extern int E_EVENT_CLIENT_UNSTICK;
EAPI extern int E_EVENT_CLIENT_STACK;
EAPI extern int E_EVENT_CLIENT_FOCUS_IN;
EAPI extern int E_EVENT_CLIENT_FOCUS_OUT;
EAPI extern int E_EVENT_CLIENT_PROPERTY;
EAPI extern int E_EVENT_CLIENT_FULLSCREEN;
EAPI extern int E_EVENT_CLIENT_UNFULLSCREEN;
EINTERN void e_client_idler_before(void);
EINTERN Eina_Bool e_client_init(void);
EINTERN void e_client_shutdown(void);
EAPI E_Client *e_client_new(E_Comp *c, E_Pixmap *cp, int first_map, int internal);
EAPI void e_client_desk_set(E_Client *ec, E_Desk *desk);
EAPI Eina_Bool e_client_comp_grabbed_get(void);
EAPI E_Client *e_client_action_get(void);
EAPI E_Client *e_client_warping_get(void);
EAPI Eina_List *e_clients_immortal_list(const E_Comp *c);
EAPI void e_client_mouse_in(E_Client *ec, int x, int y);
EAPI void e_client_mouse_out(E_Client *ec, int x, int y);
EAPI void e_client_mouse_wheel(E_Client *ec, Evas_Point *output, E_Binding_Event_Wheel *ev);
EAPI void e_client_mouse_down(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_Mouse_Button *ev);
EAPI void e_client_mouse_up(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_Mouse_Button* ev);
EAPI void e_client_mouse_move(E_Client *ec, Evas_Point *output);
EAPI void e_client_res_change_geometry_save(E_Client *bd);
EAPI void e_client_res_change_geometry_restore(E_Client *ec);
EAPI void e_client_zone_set(E_Client *ec, E_Zone *zone);
EAPI void e_client_geometry_get(E_Client *ec, int *x, int *y, int *w, int *h);
EAPI E_Client *e_client_above_get(const E_Client *ec);
EAPI E_Client *e_client_below_get(const E_Client *ec);
EAPI E_Client *e_client_bottom_get(const E_Comp *c);
EAPI E_Client *e_client_top_get(const E_Comp *c);
EAPI unsigned int e_clients_count(E_Comp *c);
EAPI void e_client_move_intercept_cb_set(E_Client *ec, E_Client_Move_Intercept_Cb cb);
EAPI E_Client_Hook *e_client_hook_add(E_Client_Hook_Point hookpoint, E_Client_Hook_Cb func, const void *data);
EAPI void e_client_hook_del(E_Client_Hook *ch);
EAPI void e_client_focus_latest_set(E_Client *ec);
EAPI void e_client_raise_latest_set(E_Client *ec);
EAPI Eina_Bool e_client_focus_track_enabled(void);
EAPI void e_client_focus_track_freeze(void);
EAPI void e_client_focus_track_thaw(void);
EAPI void e_client_focus_set_with_pointer(E_Client *ec);
EAPI void e_client_activate(E_Client *ec, Eina_Bool just_do_it);
EAPI E_Client *e_client_focused_get(void);
EAPI Eina_List *e_client_focus_stack_get(void);
EAPI Eina_List *e_client_raise_stack_get(void);
EAPI Eina_List *e_client_lost_windows_get(E_Zone *zone);
EAPI void e_client_shade(E_Client *ec, E_Direction dir);
EAPI void e_client_unshade(E_Client *ec, E_Direction dir);
EAPI void e_client_maximize(E_Client *ec, E_Maximize max);
EAPI void e_client_unmaximize(E_Client *ec, E_Maximize max);
EAPI void e_client_fullscreen(E_Client *ec, E_Fullscreen policy);
EAPI void e_client_unfullscreen(E_Client *ec);
EAPI void e_client_iconify(E_Client *ec);
EAPI void e_client_uniconify(E_Client *ec);
EAPI void e_client_stick(E_Client *ec);
EAPI void e_client_unstick(E_Client *ec);
EAPI void e_client_pinned_set(E_Client *ec, Eina_Bool set);
EAPI void e_client_comp_hidden_set(E_Client *ec, Eina_Bool hidden);
EAPI void e_client_act_move_keyboard(E_Client *ec);
EAPI void e_client_act_resize_keyboard(E_Client *ec);
EAPI void e_client_act_move_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev);
EAPI void e_client_act_move_end(E_Client *ec, E_Binding_Event_Mouse_Button *ev EINA_UNUSED);
EAPI void e_client_act_resize_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev);
EAPI void e_client_act_resize_end(E_Client *ec, E_Binding_Event_Mouse_Button *ev EINA_UNUSED);
EAPI void e_client_act_menu_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev, int key);
EAPI void e_client_act_close_begin(E_Client *ec);
EAPI void e_client_act_kill_begin(E_Client *ec);
EAPI Evas_Object *e_client_icon_add(E_Client *ec, Evas *evas);
EAPI void e_client_ping(E_Client *cw);
EAPI void e_client_move_cancel(void);
EAPI void e_client_resize_cancel(void);
EAPI Eina_Bool e_client_resize_begin(E_Client *ec);
EAPI void e_client_frame_recalc(E_Client *ec);
EAPI void e_client_signal_move_begin(E_Client *ec, const char *sig, const char *src EINA_UNUSED);
EAPI void e_client_signal_move_end(E_Client *ec, const char *sig EINA_UNUSED, const char *src EINA_UNUSED);
EAPI void e_client_signal_resize_begin(E_Client *ec, const char *dir, const char *sig, const char *src EINA_UNUSED);
EAPI void e_client_signal_resize_end(E_Client *ec, const char *dir EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED);
EAPI void e_client_resize_limit(E_Client *ec, int *w, int *h);
EAPI E_Client *e_client_under_pointer_get(E_Desk *desk, E_Client *exclude);
EAPI int e_client_pointer_warp_to_center_now(E_Client *ec);
EAPI int e_client_pointer_warp_to_center(E_Client *ec);
EAPI void e_client_redirected_set(E_Client *ec, Eina_Bool set);
EAPI Eina_Stringshare *e_client_name_get(const E_Client *ec);
EAPI Eina_Bool e_client_util_is_stacking(const E_Client *ec);
#include "e_client.x"
#endif

98
src/bin/e_client.x Normal file
View File

@ -0,0 +1,98 @@
/**
* Move window to coordinates that do not account client decorations yet.
*
* This call will consider given position does not account client
* decoration, so these values (e_comp_object_frame) will be
* accounted automatically. This is specially useful when it is a new
* client and has not be evaluated yet, in this case
* the frame will be zeroed and no information is known. It
* will mark pending requests so client will be accounted on
* evalutation phase.
*
* @parm x horizontal position to place window.
* @parm y vertical position to place window.
*
* @see e_client_move()
*/
static inline void
e_client_util_move_without_frame(E_Client *ec, int x, int y)
{
e_comp_object_frame_xy_adjust(ec->frame, x, y, &x, &y);
evas_object_move(ec->frame, x, y);
}
/**
* Resize window to values that do not account client decorations yet.
*
* This call will consider given size does not account client
* decoration, so these values (e_comp_object_frame) will be
* accounted automatically. This is specially useful when it is a new
* client and has not be evaluated yet, in this case
* e_comp_object_frame will be zeroed and no information is known. It
* will mark pending requests so client will be accounted on
* evalutation phase.
*
* @parm w horizontal window size.
* @parm h vertical window size.
*
* @see e_client_resize()
*/
static inline void
e_client_util_resize_without_frame(E_Client *ec, int w, int h)
{
e_comp_object_frame_wh_adjust(ec->frame, w, h, &w, &h);
evas_object_resize(ec->frame, w, h);
}
/**
* Move and resize window to values that do not account client decorations yet.
*
* This call will consider given values already accounts client
* decorations, so it will not be considered later. This will just
* work properly with clients that have being evaluated and client
* decorations are known (e_comp_object_frame).
*
* @parm x horizontal position to place window.
* @parm y vertical position to place window.
* @parm w horizontal window size.
* @parm h vertical window size.
*
* @see e_client_move_resize()
*/
static inline void
e_client_util_move_resize_without_frame(E_Client *ec, int x, int y, int w, int h)
{
e_client_util_move_without_frame(ec, x, y);
e_client_util_resize_without_frame(ec, w, h);
}
static inline Eina_Bool
e_client_util_ignored_get(const E_Client *ec)
{
return ec->override || ec->input_only || ec->ignored;
}
static inline Eina_Bool
e_client_util_desk_visible(const E_Client *ec, const E_Desk *desk)
{
return ec->sticky || (ec->desk == desk);
}
static inline Ecore_Window
e_client_util_pwin_get(const E_Client *ec)
{
return e_pixmap_parent_window_get(ec->pixmap);
}
static inline Ecore_Window
e_client_util_win_get(const E_Client *ec)
{
return e_pixmap_window_get(ec->pixmap);
}
static inline Eina_Bool
e_client_resizing_get(const E_Client *ec)
{
return (ec->resize_mode != E_POINTER_RESIZE_NONE);
}

View File

@ -9,12 +9,12 @@ static void _e_color_dialog_cb_csel_change(void *data, Evas_Object *obj);
/**
* Create a color selector dialog.
*
* @param con container to display on
* @param c compositor to display on
* @param color color to initialize to (or NULL for black).
* @param alpha_enabled if set, uses alpha and let user edit it.
*/
E_Color_Dialog *
e_color_dialog_new(E_Container *con, const E_Color *color, Eina_Bool alpha_enabled)
e_color_dialog_new(E_Comp *c, const E_Color *color, Eina_Bool alpha_enabled)
{
E_Color_Dialog *dia;
Evas_Object *o;
@ -22,7 +22,7 @@ e_color_dialog_new(E_Container *con, const E_Color *color, Eina_Bool alpha_enabl
dia = E_OBJECT_ALLOC(E_Color_Dialog, E_COLOR_DIALOG_TYPE, _e_color_dialog_free);
if (!dia) return NULL;
dia->dia = e_dialog_new(con, "E", "_color_dialog");
dia->dia = e_dialog_new(c, "E", "_color_dialog");
e_dialog_title_set(dia->dia, _("Color Selector"));
dia->color = calloc(1, sizeof(E_Color));

View File

@ -12,7 +12,6 @@ struct _E_Color_Dialog
{
E_Object e_obj_inherit;
E_Container *con;
E_Dialog *dia;
E_Color *color, *initial;
@ -25,7 +24,7 @@ struct _E_Color_Dialog
void *change_data;
};
EAPI E_Color_Dialog *e_color_dialog_new (E_Container *con, const E_Color *initial_color, Eina_Bool alpha_enabled);
EAPI E_Color_Dialog *e_color_dialog_new (E_Comp *c, const E_Color *initial_color, Eina_Bool alpha_enabled);
EAPI void e_color_dialog_show (E_Color_Dialog *dia);
EAPI void e_color_dialog_title_set (E_Color_Dialog *dia, const char *title);

File diff suppressed because it is too large Load Diff

View File

@ -1,210 +1,116 @@
#ifdef E_TYPEDEFS
typedef struct _E_Comp E_Comp;
typedef struct _E_Comp_Win E_Comp_Win;
typedef struct _E_Comp_Zone E_Comp_Zone;
typedef struct E_Event_Comp E_Event_Comp;
typedef struct _E_Comp_Data E_Comp_Data;
typedef struct E_Comp_Client_Data E_Comp_Client_Data;
typedef enum
{
E_COMP_CANVAS_LAYER_BOTTOM = -100,
E_COMP_CANVAS_LAYER_BG = -1, // zone bg stuff
E_COMP_CANVAS_LAYER_DESKTOP = 0, // desktop objects: fileman, gadgets, shelves
E_COMP_CANVAS_LAYER_DESKTOP_TOP = 10, // raised desktop objects: gadgets, shelves
E_COMP_CANVAS_LAYER_LAYOUT = 100, // should be nothing else on this layer
E_COMP_CANVAS_LAYER_POPUP = 999, // popups
E_COMP_CANVAS_LAYER_MENU = 5000, // menus
E_COMP_CANVAS_LAYER_DESKLOCK = 9999, // desklock
E_COMP_CANVAS_LAYER_MAX = 32767 // EVAS_LAYER_MAX
} E_Comp_Canvas_Layer;
#define E_COMP_TYPE (int) 0xE0b01003
#define E_LAYER_COUNT 19
#define E_CLIENT_LAYER_COUNT 11
typedef enum _E_Layer
{
E_LAYER_DESKTOP = 0,
E_LAYER_BELOW = 50,
E_LAYER_NORMAL = 100,
E_LAYER_ABOVE = 150,
E_LAYER_EDGE = 200,
E_LAYER_FULLSCREEN = 250,
E_LAYER_EDGE_FULLSCREEN = 300,
E_LAYER_POPUP = 300,
E_LAYER_TOP = 350,
E_LAYER_DRAG = 400,
E_LAYER_PRIO = 450
E_LAYER_BOTTOM = -100,
E_LAYER_BG = -1, // zone bg stuff
E_LAYER_DESKTOP = 0, // desktop objects: fileman, gadgets, shelves
E_LAYER_DESKTOP_TOP = 10, // raised desktop objects: gadgets
E_LAYER_CLIENT_DESKTOP = 100, //shelves
E_LAYER_CLIENT_BELOW = 150,
E_LAYER_CLIENT_NORMAL = 200,
E_LAYER_CLIENT_ABOVE = 250,
E_LAYER_CLIENT_EDGE = 300,
E_LAYER_CLIENT_FULLSCREEN = 350,
E_LAYER_CLIENT_EDGE_FULLSCREEN = 400,
E_LAYER_CLIENT_POPUP = 450,
E_LAYER_CLIENT_TOP = 500,
E_LAYER_CLIENT_DRAG = 550,
E_LAYER_CLIENT_PRIO = 600,
E_LAYER_POPUP = 999, // popups
E_LAYER_MENU = 5000, // menus
E_LAYER_DESKLOCK = 9999, // desklock
E_LAYER_MAX = 32767 // EVAS_LAYER_MAX
} E_Layer;
typedef enum
{
E_COMP_CANVAS_STACK_UNDER = -1,
E_COMP_CANVAS_STACK_NONE = 0,
E_COMP_CANVAS_STACK_ABOVE = 1
} E_Comp_Canvas_Stack;
#else
#ifndef E_MOD_COMP_H
#define E_MOD_COMP_H
# include "e_comp_cfdata.h"
# include "e_comp_render_update.h"
struct _E_Comp
{
Ecore_X_Window win; // input overlay
E_Object e_obj_inherit;
Ecore_Window win; // input overlay
Ecore_Evas *ee;
Ecore_X_Window ee_win;
Ecore_Window ee_win;
Evas *evas;
Evas_Object *layout;
Evas_Object *bg_blank_object;
Eina_List *zones;
E_Manager *man;
E_Pointer *pointer;
Eina_List *clients;
unsigned int new_clients;
E_Comp_Data *comp_data;
unsigned int num;
Eina_Stringshare *name;
struct {
Ecore_Window win;
Evas_Object *obj;
//Eina_Inlist *objs; /* E_Comp_Object; NOT to be exposed; seems pointless? */
Eina_Inlist *clients; /* E_Client, bottom to top */
unsigned int clients_count;
} layers[E_LAYER_COUNT];
struct
{
Evas_Object *rect;
Evas_Object *obj;
Ecore_Event_Handler *key_handler;
E_Comp_Object_Autoclose_Cb del_cb;
E_Comp_Object_Key_Cb key_cb;
void *data;
} autoclose;
Eina_List *debug_rects;
Eina_List *ignore_wins;
Eina_Inlist *wins;
Eina_List *wins_list;
Eina_List *updates;
Eina_List *post_updates;
Ecore_Animator *render_animator;
Ecore_Job *shape_job;
Ecore_Job *update_job;
Ecore_Timer *new_up_timer;
Evas_Object *fps_bg;
Evas_Object *fps_fg;
Ecore_Job *screen_job;
Ecore_Timer *nocomp_delay_timer;
Ecore_Timer *nocomp_override_timer;
int animating;
int render_overflow;
double frametimes[122];
int frameskip;
int nocomp_override; //number of times nocomp override has been requested
Ecore_X_Window block_win;
Ecore_Window block_win;
int block_count; //number of times block window has been requested
Ecore_X_Window cm_selection;
Ecore_Window cm_selection; //FIXME: move to comp_x ?
int depth;
Ecore_Cb grab_cb;
Ecore_Cb bindings_grab_cb;
Ecore_Cb bindings_ungrab_cb;
Eina_Bool gl : 1;
Eina_Bool grabbed : 1;
Eina_Bool nocomp : 1;
Eina_Bool nocomp_want : 1;
Eina_Bool wins_invalid : 1;
Eina_Bool saver : 1;
};
struct _E_Comp_Zone
{
E_Comp *comp;
E_Zone *zone; // never deref - just use for handle cmp's
Evas_Object *base;
Evas_Object *over;
int container_num;
int zone_num;
int x, y, w, h;
double bl;
Eina_Bool bloff;
};
struct _E_Comp_Win
{
EINA_INLIST;
E_Comp *c; // parent compositor
Ecore_X_Window win; // raw window - for menus etc.
E_Container_Shape *shape;
E_Border *bd; // if its a border - later
E_Popup *pop; // if its a popup - later
E_Menu *menu; // if it is a menu - later
int x, y, w, h; // geometry
Eina_Rectangle hidden; // hidden geometry (used when its unmapped and re-instated on map)
int pw, ph; // pixmap w/h
int border; // border width
Ecore_X_Pixmap pixmap; // the compositing pixmap
Ecore_X_Damage damage; // damage region
Ecore_X_Visual vis; // window visual
Ecore_X_Colormap cmap; // colormap of window
int depth; // window depth
Evas_Object *obj; // composite object
Evas_Object *zoomobj; // zoomap
Evas_Object *shobj; // shadow object
Evas_Object *effect_obj; // effects object
E_Object *eobj; // internal e object
E_Comp_Win *cw_above; // comp win that should always be stacked above this one
Eina_List *stack_below; // list of objects to keep stacked below this one
Eina_List *obj_mirror; // extra mirror objects
Ecore_X_Image *xim; // x image - software fallback
E_Comp_Render_Update *up; // update handler
E_Object_Delfn *dfn; // delete function handle for objects being tracked
Ecore_Timer *update_timeout; // max time between damage and "done" event
Ecore_Timer *ready_timeout; // max time on show (new window draw) to wait for window contents to be ready if sync protocol not handled. this is fallback.
int dmg_updates; // num of damage event updates since a redirect
Ecore_X_Pixmap cache_pixmap; // the cached pixmap (1/nth the dimensions)
int cache_w, cache_h; // cached pixmap size
int update_count; // how many updates have happened to this win
double last_visible_time; // last time window was visible
double last_draw_time; // last time window was damaged
int pending_count; // pending event count
unsigned int opacity; // opacity set with _NET_WM_WINDOW_OPACITY
Ecore_Timer *opacity_set_timer; // timer for setting opacity in ecore-x to avoid roundtrips
char *title, *name, *clas, *role; // fetched for override-redirect windowa
Ecore_X_Window_Type primary_type; // fetched for override-redirect windowa
unsigned char misses; // number of sync misses
Eina_Bool delete_pending : 1; // delete pendig
Eina_Bool hidden_override : 1; // hidden override
Eina_Bool animating : 1; // it's busy animating - defer hides/dels
Eina_Bool force : 1; // force del/hide even if animating
Eina_Bool defer_hide : 1; // flag to get hide to work on deferred hide
Eina_Bool delete_me : 1; // delete me!
Eina_Bool visible : 1; // is visible
Eina_Bool input_only : 1; // is input_only
Eina_Bool override : 1; // is override-redirect
Eina_Bool argb : 1; // is argb
Eina_Bool shaped : 1; // is shaped
Eina_Bool update : 1; // has updates to fetch
Eina_Bool redirected : 1; // has updates to fetch
Eina_Bool shape_changed : 1; // shape changed
Eina_Bool native : 1; // native
Eina_Bool drawme : 1; // drawme flag fo syncing rendering
Eina_Bool invalid : 1; // invalid depth used - just use as marker
Eina_Bool nocomp : 1; // nocomp applied
Eina_Bool nocomp_need_update : 1; // nocomp in effect, but this window updated while in nocomp mode
Eina_Bool needpix : 1; // need new pixmap
Eina_Bool needxim : 1; // need new xim
Eina_Bool real_hid : 1; // last hide was a real window unmap
Eina_Bool inhash : 1; // is in the windows hash
Eina_Bool show_ready : 1; // is this window ready for its first show
Eina_Bool geom_update : 1; // window needs geometry updated
Eina_Bool show_anim : 1; // ran show animation
Eina_Bool bg_win : 1; // window is the bg win for a container
Eina_Bool free_shape : 1; // container shape needs to be freed
Eina_Bool real_obj : 1; // real object (for dummy comp wins)
Eina_Bool not_in_layout : 1; // object is a dummy not in comp layout
Eina_Bool effect_clip : 1; //effect_obj is clipped
Eina_Bool effect_clip_able : 1; //effect_obj will be clipped for effects
};
struct E_Event_Comp
{
E_Comp_Win *cw;
};
extern EAPI int E_EVENT_COMP_SOURCE_VISIBILITY;
extern EAPI int E_EVENT_COMP_SOURCE_ADD;
extern EAPI int E_EVENT_COMP_SOURCE_DEL;
extern EAPI int E_EVENT_COMP_SOURCE_CONFIGURE;
extern EAPI int E_EVENT_COMP_SOURCE_STACK;
typedef enum
{
E_COMP_ENGINE_NONE = 0,
@ -213,67 +119,35 @@ typedef enum
} E_Comp_Engine;
EINTERN Eina_Bool e_comp_init(void);
EINTERN int e_comp_shutdown(void);
EINTERN Eina_Bool e_comp_manager_init(E_Manager *man);
EAPI const Eina_List *e_comp_list(void);
EAPI E_Comp *e_comp_new(void);
EAPI int e_comp_internal_save(void);
EINTERN int e_comp_shutdown(void);
EAPI void e_comp_render_queue(E_Comp *c);
EAPI void e_comp_shape_queue(E_Comp *c);
EAPI E_Comp_Config *e_comp_config_get(void);
EAPI const Eina_List *e_comp_list(void);
EAPI void e_comp_shadows_reset(void);
EAPI void e_comp_block_window_add(void);
EAPI void e_comp_block_window_del(void);
EAPI void e_comp_render_update(E_Comp *c);
EAPI void e_comp_zone_update(E_Comp_Zone *cz);
EAPI E_Comp *e_comp_get(const void *o);
EAPI Ecore_Window e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y);
EAPI void e_comp_util_wins_print(const E_Comp *c);
EAPI void e_comp_ignore_win_add(E_Pixmap_Type type, Ecore_Window win);
EAPI void e_comp_ignore_win_del(E_Pixmap_Type type, Ecore_Window win);
EAPI Eina_Bool e_comp_ignore_win_find(Ecore_Window win);
EAPI void e_comp_override_del(E_Comp *c);
EAPI void e_comp_override_add(E_Comp *c);
EAPI void e_comp_win_effect_set(E_Comp_Win *cw, const char *effect);
EAPI void e_comp_win_effect_params_set(E_Comp_Win *cw, int id, int *params, unsigned int count);
EAPI void e_comp_win_effect_start(E_Comp_Win *cw, Edje_Signal_Cb end_cb, const void *end_data);
EAPI void e_comp_win_effect_stop(E_Comp_Win *cw, Edje_Signal_Cb end_cb);
EAPI void e_comp_win_effect_clip(E_Comp_Win *cw);
EAPI void e_comp_win_effect_unclip(E_Comp_Win *cw);
EAPI E_Comp_Win *e_comp_win_find_client_win(Ecore_X_Window win);
EAPI E_Comp_Win *e_comp_win_find(Ecore_X_Window win);
EAPI const Eina_List *e_comp_win_list_get(E_Comp *c);
EAPI Evas_Object *e_comp_win_image_mirror_add(E_Comp_Win *cw);
EAPI void e_comp_win_hidden_set(E_Comp_Win *cw, Eina_Bool hidden);
EAPI void e_comp_win_opacity_set(E_Comp_Win *cw, unsigned int opacity);
EAPI E_Comp *e_comp_get(void *o);
EAPI void e_comp_populate(E_Comp *c);
EAPI Ecore_X_Window e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Eina_Bool vis, Ecore_X_Window *ignore, unsigned int ignore_num);
/* for injecting objects into the comp layout */
EAPI E_Comp_Win *e_comp_object_inject(E_Comp *c, Evas_Object *obj, E_Object *eobj, E_Layer layer);
/* for giving objects the comp theme and such without injecting into layout */
EAPI E_Comp_Win *e_comp_object_add(E_Comp *c, Evas_Object *obj, E_Object *eobj);
EAPI void e_comp_win_move(E_Comp_Win *cw, Evas_Coord x, Evas_Coord y);
EAPI void e_comp_win_resize(E_Comp_Win *cw, int w, int h);
EAPI void e_comp_win_moveresize(E_Comp_Win *cw, Evas_Coord x, Evas_Coord y, int w, int h);
EAPI void e_comp_win_hide(E_Comp_Win *cw);
EAPI void e_comp_win_show(E_Comp_Win *cw);
EAPI void e_comp_win_del(E_Comp_Win *cw);
EAPI void e_comp_win_reshadow(E_Comp_Win *cw);
EAPI void e_comp_ignore_win_add(Ecore_X_Window win);
#define E_LAYER_SET(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_NONE)
#define E_LAYER_SET_UNDER(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_UNDER)
#define E_LAYER_SET_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, layer, 0, E_COMP_CANVAS_STACK_ABOVE)
#define E_LAYER_LAYOUT_ADD(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_NONE)
#define E_LAYER_LAYOUT_ADD_UNDER(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_UNDER)
#define E_LAYER_LAYOUT_ADD_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_ABOVE)
EAPI E_Comp_Win *e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Layer layer, E_Comp_Canvas_Stack stack);
EAPI void e_comp_block_window_add(void);
EAPI void e_comp_block_window_del(void);
EAPI E_Comp *e_comp_find_by_window(Ecore_Window win);
EAPI void e_comp_override_timed_pop(E_Comp *c);
EAPI unsigned int e_comp_e_object_layer_get(const E_Object *obj);
EAPI Eina_Bool e_comp_grab_input(E_Comp *c, Eina_Bool mouse, Eina_Bool kbd);
EAPI void e_comp_ungrab_input(E_Comp *c, Eina_Bool mouse, Eina_Bool kbd);
EAPI void e_comp_gl_set(Eina_Bool set);
EAPI Eina_Bool e_comp_gl_get(void);
EAPI E_Comp *e_comp_evas_find(const Evas *e);
EAPI void e_comp_button_bindings_grab_all(void);
EAPI void e_comp_button_bindings_ungrab_all(void);
static inline E_Comp *
e_comp_util_evas_object_comp_get(Evas_Object *obj)
@ -282,35 +156,16 @@ e_comp_util_evas_object_comp_get(Evas_Object *obj)
}
static inline Eina_Bool
e_comp_evas_exists(void *o)
e_comp_util_client_is_fullscreen(const E_Client *ec)
{
E_Comp *c;
EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
c = e_comp_get(o);
return c ? !!c->evas : EINA_FALSE;
if ((!ec->visible) || (ec->input_only))
return EINA_FALSE;
return ((ec->client.x == 0) && (ec->client.y == 0) &&
((ec->client.w) >= ec->comp->man->w) &&
((ec->client.h) >= ec->comp->man->h) &&
(!ec->argb) && (!ec->shaped)
);
}
static inline void
e_comp_win_ignore_events_set(E_Comp_Win *cw, Eina_Bool ignore)
{
EINA_SAFETY_ON_NULL_RETURN(cw);
ignore = !!ignore;
evas_object_pass_events_set(cw->effect_obj, ignore);
}
static inline unsigned int
e_comp_e_object_layer_effective_get(const E_Object *obj)
{
unsigned int layer;
layer = e_comp_e_object_layer_get(obj);
if ((layer > E_COMP_CANVAS_LAYER_LAYOUT) && (layer < E_COMP_CANVAS_LAYER_POPUP))
layer = E_COMP_CANVAS_LAYER_LAYOUT;
return layer;
}
EAPI void e_comp_util_wins_print(const E_Comp *c);
EAPI void e_comp_shape_queue(E_Comp *c);
#endif
#endif

559
src/bin/e_comp_canvas.c Normal file
View File

@ -0,0 +1,559 @@
#include "e.h"
static void
_e_comp_canvas_event_compositor_resize_free(void *data EINA_UNUSED, void *event)
{
E_Event_Compositor_Resize *ev = event;
e_object_unref(E_OBJECT(ev->comp));
free(ev);
}
///////////////////////////////////
static void
_e_comp_canvas_render_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Comp *c = data;
E_Client *ec;
//Evas_Event_Render_Post *ev = event_info;
//Eina_List *l;
//Eina_Rectangle *r;
//if (ev)
//{
//EINA_LIST_FOREACH(ev->updated_area, l, r)
//INF("POST RENDER: %d,%d %dx%d", r->x, r->y, r->w, r->h);
//}
EINA_LIST_FREE(c->post_updates, ec)
{
//INF("POST %p", ec);
if (!e_object_is_del(E_OBJECT(ec)))
e_pixmap_image_clear(ec->pixmap, 1);
}
}
///////////////////////////////////
static void
_e_comp_canvas_cb_mouse_in(E_Comp *c EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Client *ec;
if (e_client_action_get()) return;
ec = e_client_focused_get();
if (ec && (!ec->border_menu)) e_focus_event_mouse_out(ec);
}
static void
_e_comp_canvas_cb_mouse_down(E_Comp *c, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
if (e_client_action_get()) return;
e_bindings_mouse_down_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, E_OBJECT(c), event_info);
}
static void
_e_comp_canvas_cb_mouse_up(E_Comp *c, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
if (e_client_action_get()) return;
e_bindings_mouse_up_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, E_OBJECT(c), event_info);
}
static void
_e_comp_canvas_cb_mouse_wheel(E_Comp *c, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
if (e_client_action_get()) return;
e_bindings_wheel_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, E_OBJECT(c), event_info);
}
////////////////////////////////////
static int
_e_comp_canvas_cb_zone_sort(const void *data1, const void *data2)
{
const E_Zone *z1 = data1, *z2 = data2;
return z2->num - z1->num;
}
EAPI Eina_Bool
e_comp_canvas_init(E_Comp *c)
{
Evas_Object *o;
Eina_List *screens;
unsigned int layer;
c->evas = ecore_evas_get(c->ee);
ecore_evas_data_set(c->ee, "comp", c);
o = evas_object_rectangle_add(c->evas);
c->bg_blank_object = o;
evas_object_layer_set(o, E_LAYER_BOTTOM);
evas_object_move(o, 0, 0);
evas_object_resize(o, c->man->w, c->man->h);
evas_object_color_set(o, 255, 255, 255, 255);
evas_object_name_set(o, "comp->bg_blank_object");
evas_object_data_set(o, "e_comp", c);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, (Evas_Object_Event_Cb)_e_comp_canvas_cb_mouse_down, c);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_e_comp_canvas_cb_mouse_up, c);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_e_comp_canvas_cb_mouse_in, c);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, (Evas_Object_Event_Cb)_e_comp_canvas_cb_mouse_wheel, c);
evas_object_show(o);
ecore_evas_name_class_set(c->ee, "E", "Comp_EE");
// ecore_evas_manual_render_set(c->ee, conf->lock_fps);
ecore_evas_show(c->ee);
evas_event_callback_add(c->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_render_post, c);
c->ee_win = ecore_evas_window_get(c->ee);
c->pointer = e_pointer_window_new(c->man->root, 1);
for (layer = 0; layer <= e_comp_canvas_layer_map(E_LAYER_MAX); layer++)
{
Evas_Object *o2;
/* client layers have actual X windows backing them, so we wait */
if (e_comp_canvas_client_layer_map(e_comp_canvas_layer_map_to(layer)) != 9999)
continue;
o2 = c->layers[layer].obj = evas_object_rectangle_add(c->evas);
evas_object_layer_set(o2, e_comp_canvas_layer_map_to(layer));
evas_object_name_set(o2, "layer_obj");
}
screens = (Eina_List *)e_xinerama_screens_get();
if (screens)
{
E_Screen *scr;
Eina_List *l;
EINA_LIST_FOREACH(screens, l, scr)
{
e_zone_new(c, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
}
}
else
e_zone_new(c, 0, 0, 0, 0, c->man->w, c->man->h);
return EINA_TRUE;
}
EINTERN void
e_comp_canvas_clear(E_Comp *c)
{
evas_event_freeze(c->evas);
edje_freeze();
E_FREE_FUNC(c->fps_fg, evas_object_del);
E_FREE_FUNC(c->fps_bg, evas_object_del);
E_FREE_FUNC(c->autoclose.rect, evas_object_del);
E_FREE_FUNC(c->shape_job, ecore_job_del);
E_FREE_FUNC(c->pointer, e_object_del);
}
//////////////////////////////////////////////
EAPI void
e_comp_all_freeze(void)
{
Eina_List *l;
E_Manager *man;
EINA_LIST_FOREACH(e_manager_list(), l, man)
evas_event_freeze(man->comp->evas);
}
EAPI void
e_comp_all_thaw(void)
{
Eina_List *l;
E_Manager *man;
EINA_LIST_FOREACH(e_manager_list(), l, man)
evas_event_thaw(man->comp->evas);
}
EAPI E_Zone *
e_comp_zone_xy_get(const E_Comp *c, Evas_Coord x, Evas_Coord y)
{
const Eina_List *l;
E_Zone *zone;
if (!c) c = e_comp_get(NULL);
EINA_LIST_FOREACH(c->zones, l, zone)
if (E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h)) return zone;
return NULL;
}
EAPI E_Zone *
e_comp_zone_number_get(E_Comp *c, int num)
{
Eina_List *l = NULL;
E_Zone *zone = NULL;
E_OBJECT_CHECK_RETURN(c, NULL);
E_OBJECT_TYPE_CHECK_RETURN(c, E_COMP_TYPE, NULL);
EINA_LIST_FOREACH(c->zones, l, zone)
{
if ((int)zone->num == num) return zone;
}
return NULL;
}
EAPI E_Zone *
e_comp_zone_id_get(E_Comp *c, int id)
{
Eina_List *l = NULL;
E_Zone *zone = NULL;
E_OBJECT_CHECK_RETURN(c, NULL);
E_OBJECT_TYPE_CHECK_RETURN(c, E_COMP_TYPE, NULL);
EINA_LIST_FOREACH(c->zones, l, zone)
{
if (zone->id == id) return zone;
}
return NULL;
}
EAPI E_Comp *
e_comp_number_get(unsigned int num)
{
const Eina_List *l;
E_Comp *c;
EINA_LIST_FOREACH(e_comp_list(), l, c)
if (c->num == num) return c;
return NULL;
}
EAPI E_Desk *
e_comp_desk_window_profile_get(E_Comp *c, const char *profile)
{
Eina_List *l = NULL;
E_Zone *zone = NULL;
int x, y;
E_OBJECT_CHECK_RETURN(c, NULL);
E_OBJECT_TYPE_CHECK_RETURN(c, E_COMP_TYPE, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(profile, NULL);
EINA_LIST_FOREACH(c->zones, l, zone)
{
for (x = 0; x < zone->desk_x_count; x++)
{
for (y = 0; y < zone->desk_y_count; y++)
{
E_Desk *desk = e_desk_at_xy_get(zone, x, y);
if (!e_util_strcmp(desk->window_profile, profile))
return desk;
}
}
}
return NULL;
}
EAPI void
e_comp_canvas_zone_update(E_Zone *zone)
{
Evas_Object *o;
const char *const over_styles[] =
{
"e/comp/screen/overlay/default",
"e/comp/screen/overlay/noeffects"
};
const char *const under_styles[] =
{
"e/comp/screen/base/default",
"e/comp/screen/base/noeffects"
};
E_Comp_Config *conf = e_comp_config_get();
if (zone->over && zone->base)
{
e_theme_edje_object_set(zone->base, "base/theme/comp",
under_styles[conf->disable_screen_effects]);
edje_object_part_swallow(zone->base, "e.swallow.background",
zone->transition_object ?: zone->bg_object);
e_theme_edje_object_set(zone->over, "base/theme/comp",
over_styles[conf->disable_screen_effects]);
return;
}
E_FREE_FUNC(zone->base, evas_object_del);
E_FREE_FUNC(zone->over, evas_object_del);
zone->base = o = edje_object_add(zone->comp->evas);
evas_object_repeat_events_set(o, 1);
evas_object_name_set(zone->base, "zone->base");
e_theme_edje_object_set(o, "base/theme/comp", under_styles[conf->disable_screen_effects]);
edje_object_part_swallow(zone->base, "e.swallow.background", zone->transition_object ?: zone->bg_object);
evas_object_move(o, zone->x, zone->y);
evas_object_resize(o, zone->w, zone->h);
evas_object_layer_set(o, E_LAYER_BG);
evas_object_show(o);
zone->over = o = edje_object_add(zone->comp->evas);
evas_object_layer_set(o, E_LAYER_MAX);
evas_object_raise(o);
evas_object_name_set(zone->over, "zone->over");
evas_object_pass_events_set(o, 1);
e_theme_edje_object_set(o, "base/theme/comp", over_styles[conf->disable_screen_effects]);
evas_object_move(o, zone->x, zone->y);
evas_object_resize(o, zone->w, zone->h);
evas_object_raise(o);
evas_object_show(o);
}
EAPI void
e_comp_canvas_update(E_Comp *c)
{
E_Event_Compositor_Resize *ev;
Eina_List *l, *screens, *zones = NULL, *ll;
E_Zone *zone;
E_Screen *scr;
int i;
Eina_Bool changed = EINA_FALSE;
screens = (Eina_List *)e_xinerama_screens_get();
if (screens)
{
zones = c->zones;
c->zones = NULL;
EINA_LIST_FOREACH(screens, l, scr)
{
zone = NULL;
EINA_LIST_FOREACH(zones, ll, zone)
{
if (zone->id == scr->escreen) break;
zone = NULL;
}
if (zone)
{
changed |= e_zone_move_resize(zone, scr->x, scr->y, scr->w, scr->h);
if (changed)
printf("@@@ FOUND ZONE %i %i [%p]\n", zone->num, zone->id, zone);
zones = eina_list_remove(zones, zone);
c->zones = eina_list_append(c->zones, zone);
zone->num = scr->screen;
}
else
{
zone = e_zone_new(c, scr->screen, scr->escreen,
scr->x, scr->y, scr->w, scr->h);
printf("@@@ NEW ZONE = %p\n", zone);
changed = EINA_TRUE;
}
if (changed)
printf("@@@ SCREENS: %i %i | %i %i %ix%i\n",
scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
}
c->zones = eina_list_sort(c->zones, 0, _e_comp_canvas_cb_zone_sort);
if (zones)
{
E_Zone *spare_zone;
changed = EINA_TRUE;
spare_zone = eina_list_data_get(c->zones);
EINA_LIST_FREE(zones, zone)
{
E_Client *ec;
/* delete any shelves on this zone */
E_CLIENT_FOREACH(c, ec)
{
if (ec->zone == zone)
{
if (spare_zone)
e_client_zone_set(ec, spare_zone);
else
printf("EEEK! should not be here - but no\n"
"spare zones exist to move this\n"
"window to!!! help!\n");
}
}
e_object_del(E_OBJECT(zone));
}
}
if (changed) e_shelf_config_update();
}
else
{
E_Zone *z;
z = e_comp_zone_number_get(c, 0);
if (z)
{
changed |= e_zone_move_resize(z, 0, 0, c->man->w, c->man->h);
if (changed) e_shelf_zone_move_resize_handle(z);
}
}
if (!changed) return;
if (!starting)
{
ev = calloc(1, sizeof(E_Event_Compositor_Resize));
ev->comp = c;
e_object_ref(E_OBJECT(c));
ecore_event_add(E_EVENT_COMPOSITOR_RESIZE, ev, _e_comp_canvas_event_compositor_resize_free, NULL);
}
EINA_LIST_FOREACH(c->zones, l, zone)
{
E_FREE_FUNC(zone->base, evas_object_del);
E_FREE_FUNC(zone->over, evas_object_del);
if (zone->bloff)
{
if (!e_comp_config_get()->nofade)
{
if (e_backlight_mode_get(zone) != E_BACKLIGHT_MODE_NORMAL)
e_backlight_mode_set(zone, E_BACKLIGHT_MODE_NORMAL);
e_backlight_level_set(zone, e_config->backlight.normal, -1.0);
}
}
e_comp_canvas_zone_update(zone);
}
for (i = 0; i < 11; i++)
{
Eina_List *tmp = NULL;
E_Client *ec;
if (!c->layers[i].clients) continue;
/* Make temporary list as e_client_res_change_geometry_restore
* rearranges the order. */
EINA_INLIST_FOREACH(c->layers[i].clients, ec)
tmp = eina_list_append(tmp, ec);
EINA_LIST_FREE(tmp, ec)
{
e_client_res_change_geometry_save(ec);
e_client_res_change_geometry_restore(ec);
}
}
}
EAPI void
e_comp_canvas_fake_layers_init(E_Comp *comp)
{
unsigned int layer;
/* init layers */
for (layer = e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); layer <= e_comp_canvas_layer_map(E_LAYER_CLIENT_PRIO); layer++)
{
Evas_Object *o2;
o2 = comp->layers[layer].obj = evas_object_rectangle_add(comp->evas);
evas_object_layer_set(o2, e_comp_canvas_layer_map_to(layer));
evas_object_name_set(o2, "layer_obj");
}
}
EAPI void
e_comp_canvas_fps_toggle(void)
{
E_Comp_Config *conf = e_comp_config_get();
conf->fps_show = !conf->fps_show;
e_comp_internal_save();
E_LIST_FOREACH(e_comp_list(), e_comp_render_queue);
}
EAPI E_Layer
e_comp_canvas_layer_map_to(unsigned int layer)
{
switch (layer)
{
case 0: return E_LAYER_BOTTOM;
case 1: return E_LAYER_BG;
case 2: return E_LAYER_DESKTOP;
case 3: return E_LAYER_DESKTOP_TOP;
case 4: return E_LAYER_CLIENT_DESKTOP;
case 5: return E_LAYER_CLIENT_BELOW;
case 6: return E_LAYER_CLIENT_NORMAL;
case 7: return E_LAYER_CLIENT_ABOVE;
case 8: return E_LAYER_CLIENT_EDGE;
case 9: return E_LAYER_CLIENT_FULLSCREEN;
case 10: return E_LAYER_CLIENT_EDGE_FULLSCREEN;
case 11: return E_LAYER_CLIENT_POPUP;
case 12: return E_LAYER_CLIENT_TOP;
case 13: return E_LAYER_CLIENT_DRAG;
case 14: return E_LAYER_CLIENT_PRIO;
case 15: return E_LAYER_POPUP;
case 16: return E_LAYER_MENU;
case 17: return E_LAYER_DESKLOCK;
case 18: return E_LAYER_MAX;
default: break;
}
return -INT_MAX;
}
EAPI unsigned int
e_comp_canvas_layer_map(E_Layer layer)
{
switch (layer)
{
case E_LAYER_BOTTOM: return 0;
case E_LAYER_BG: return 1;
case E_LAYER_DESKTOP: return 2;
case E_LAYER_DESKTOP_TOP: return 3;
case E_LAYER_CLIENT_DESKTOP: return 4;
case E_LAYER_CLIENT_BELOW: return 5;
case E_LAYER_CLIENT_NORMAL: return 6;
case E_LAYER_CLIENT_ABOVE: return 7;
case E_LAYER_CLIENT_EDGE: return 8;
case E_LAYER_CLIENT_FULLSCREEN: return 9;
case E_LAYER_CLIENT_EDGE_FULLSCREEN: return 10;
case E_LAYER_CLIENT_POPUP: return 11;
case E_LAYER_CLIENT_TOP: return 12;
case E_LAYER_CLIENT_DRAG: return 13;
case E_LAYER_CLIENT_PRIO: return 14;
case E_LAYER_POPUP: return 15;
case E_LAYER_MENU: return 16;
case E_LAYER_DESKLOCK: return 17;
case E_LAYER_MAX: return 18;
default: break;
}
return 9999;
}
EAPI unsigned int
e_comp_canvas_client_layer_map(E_Layer layer)
{
switch (layer)
{
case E_LAYER_CLIENT_DESKTOP: return 0;
case E_LAYER_CLIENT_BELOW: return 1;
case E_LAYER_CLIENT_NORMAL: return 2;
case E_LAYER_CLIENT_ABOVE: return 3;
case E_LAYER_CLIENT_EDGE: return 4;
case E_LAYER_CLIENT_FULLSCREEN: return 5;
case E_LAYER_CLIENT_EDGE_FULLSCREEN: return 6;
case E_LAYER_CLIENT_POPUP: return 7;
case E_LAYER_CLIENT_TOP: return 8;
case E_LAYER_CLIENT_DRAG: return 9;
case E_LAYER_CLIENT_PRIO: return 10;
default: break;
}
return 9999;
}
EAPI E_Layer
e_comp_canvas_client_layer_map_nearest(int layer)
{
#define LAYER_MAP(X) \
if (layer <= X) return X
LAYER_MAP(E_LAYER_CLIENT_DESKTOP);
LAYER_MAP(E_LAYER_CLIENT_BELOW);
LAYER_MAP(E_LAYER_CLIENT_NORMAL);
LAYER_MAP(E_LAYER_CLIENT_ABOVE);
LAYER_MAP(E_LAYER_CLIENT_EDGE);
LAYER_MAP(E_LAYER_CLIENT_FULLSCREEN);
LAYER_MAP(E_LAYER_CLIENT_EDGE_FULLSCREEN);
LAYER_MAP(E_LAYER_CLIENT_POPUP);
LAYER_MAP(E_LAYER_CLIENT_TOP);
LAYER_MAP(E_LAYER_CLIENT_DRAG);
return E_LAYER_CLIENT_PRIO;
}

81
src/bin/e_comp_canvas.h Normal file
View File

@ -0,0 +1,81 @@
#ifdef E_TYPEDEFS
typedef struct _E_Event_Compositor_Resize E_Event_Compositor_Resize;
#else
#ifndef E_COMP_CANVAS_H
#define E_COMP_CANVAS_H
struct _E_Event_Compositor_Resize
{
E_Comp *comp;
};
extern EAPI int E_EVENT_COMPOSITOR_RESIZE;
EAPI Eina_Bool e_comp_canvas_init(E_Comp *c);
EINTERN void e_comp_canvas_clear(E_Comp *c);
EAPI void e_comp_all_freeze(void);
EAPI void e_comp_all_thaw(void);
EAPI E_Zone * e_comp_zone_xy_get(const E_Comp *c, Evas_Coord x, Evas_Coord y);
EAPI E_Zone * e_comp_zone_number_get(E_Comp *c, int num);
EAPI E_Zone * e_comp_zone_id_get(E_Comp *c, int id);
EAPI E_Comp * e_comp_number_get(unsigned int num);
EAPI E_Desk * e_comp_desk_window_profile_get(E_Comp *c, const char *profile);
EAPI void e_comp_canvas_zone_update(E_Zone *zone);
EAPI void e_comp_canvas_update(E_Comp *c);
EAPI void e_comp_canvas_fake_layers_init(E_Comp *comp);
EAPI void e_comp_canvas_fps_toggle(void);
EAPI E_Layer e_comp_canvas_layer_map_to(unsigned int layer);
EAPI unsigned int e_comp_canvas_layer_map(E_Layer layer);
EAPI unsigned int e_comp_canvas_client_layer_map(E_Layer layer);
EAPI E_Layer e_comp_canvas_client_layer_map_nearest(int layer);
/* the following functions are used for adjusting root window coordinates
* to/from canvas coordinates.
* this ensures correct positioning when running E as a nested compositor
*
* - use the "adjust" functions to go root->canvas
* - use the "unadjust" functions to go canvas->root
*/
static inline int
e_comp_canvas_x_root_unadjust(const E_Comp *c, int x)
{
int cx;
ecore_evas_geometry_get(c->ee, &cx, NULL, NULL, NULL);
return x + cx;
}
static inline int
e_comp_canvas_y_root_unadjust(const E_Comp *c, int y)
{
int cy;
ecore_evas_geometry_get(c->ee, NULL, &cy, NULL, NULL);
return y + cy;
}
static inline int
e_comp_canvas_x_root_adjust(const E_Comp *c, int x)
{
int cx;
ecore_evas_geometry_get(c->ee, &cx, NULL, NULL, NULL);
return x - cx;
}
static inline int
e_comp_canvas_y_root_adjust(const E_Comp *c, int y)
{
int cy;
ecore_evas_geometry_get(c->ee, NULL, &cy, NULL, NULL);
return y - cy;
}
#endif
#endif

3364
src/bin/e_comp_object.c Normal file

File diff suppressed because it is too large Load Diff

79
src/bin/e_comp_object.h Normal file
View File

@ -0,0 +1,79 @@
#ifdef E_TYPEDEFS
typedef struct E_Comp_Object_Frame E_Comp_Object_Frame;
typedef struct E_Event_Comp_Object E_Event_Comp_Object;
typedef void (*E_Comp_Object_Autoclose_Cb)(void *, Evas_Object *);
typedef Eina_Bool (*E_Comp_Object_Key_Cb)(void *, Ecore_Event_Key *);
typedef enum
{
E_COMP_OBJECT_TYPE_NONE,
E_COMP_OBJECT_TYPE_MENU,
E_COMP_OBJECT_TYPE_POPUP,
E_COMP_OBJECT_TYPE_LAST,
} E_Comp_Object_Type;
#else
#ifndef E_COMP_OBJECT_H
#define E_COMP_OBJECT_H
#define E_COMP_OBJECT_FRAME_RESHADOW "COMP_RESHADOW"
struct E_Event_Comp_Object
{
Evas_Object *comp_object;
};
struct E_Comp_Object_Frame
{
int l, r, t, b;
Eina_Bool calc : 1; // inset has been calculated
};
extern EAPI int E_EVENT_COMP_OBJECT_ADD;
EAPI void e_comp_object_zoomap_set(Evas_Object *obj, Eina_Bool enabled);
EAPI Evas_Object *e_comp_object_client_add(E_Client *ec);
EAPI Evas_Object *e_comp_object_util_mirror_add(Evas_Object *obj);
EAPI Evas_Object *e_comp_object_util_add(Evas_Object *obj, E_Comp_Object_Type type);
EAPI void e_comp_object_frame_xy_adjust(Evas_Object *obj, int x, int y, int *ax, int *ay);
EAPI void e_comp_object_frame_xy_unadjust(Evas_Object *obj, int x, int y, int *ax, int *ay);
EAPI void e_comp_object_frame_wh_adjust(Evas_Object *obj, int w, int h, int *aw, int *ah);
EAPI void e_comp_object_frame_wh_unadjust(Evas_Object *obj, int w, int h, int *aw, int *ah);
EAPI E_Client *e_comp_object_client_get(Evas_Object *obj);
EAPI E_Zone *e_comp_object_util_zone_get(Evas_Object *obj);
EAPI void e_comp_object_util_del_list_append(Evas_Object *obj, Evas_Object *to_del);
EAPI void e_comp_object_util_del_list_remove(Evas_Object *obj, Evas_Object *to_del);
EAPI void e_comp_object_util_autoclose(Evas_Object *obj, E_Comp_Object_Autoclose_Cb del_cb, E_Comp_Object_Key_Cb cb, const void *data);
EAPI void e_comp_object_util_center(Evas_Object *obj);
EAPI void e_comp_object_util_center_on(Evas_Object *obj, Evas_Object *on);
EAPI void e_comp_object_util_center_pos_get(Evas_Object *obj, int *x, int *y);
EAPI void e_comp_object_util_fullscreen(Evas_Object *obj);
EAPI void e_comp_object_frame_geometry_get(Evas_Object *obj, int *l, int *r, int *t, int *b);
EAPI Eina_Bool e_comp_object_frame_title_set(Evas_Object *obj, const char *name);
EAPI Eina_Bool e_comp_object_frame_exists(Evas_Object *obj);
EAPI void e_comp_object_frame_icon_update(Evas_Object *obj);
EAPI Eina_Bool e_comp_object_frame_theme_set(Evas_Object *obj, const char *name);
EAPI void e_comp_object_signal_emit(Evas_Object *obj, const char *sig, const char *src);
EAPI void e_comp_object_signal_callback_add(Evas_Object *obj, const char *sig, const char *src, Edje_Signal_Cb cb, const void *data);
EAPI void e_comp_object_signal_callback_del(Evas_Object *obj, const char *sig, const char *src, Edje_Signal_Cb cb);
EAPI void e_comp_object_signal_callback_del_full(Evas_Object *obj, const char *sig, const char *src, Edje_Signal_Cb cb, const void *data);
EAPI void e_comp_object_input_area_set(Evas_Object *obj, int x, int y, int w, int h);
EAPI void e_comp_object_damage(Evas_Object *obj, int x, int y, int w, int h);
EAPI void e_comp_object_render_update_add(Evas_Object *obj);
EAPI void e_comp_object_render_update_del(Evas_Object *obj);
EAPI void e_comp_object_shape_apply(Evas_Object *obj);
EAPI void e_comp_object_redirected_set(Evas_Object *obj, Eina_Bool set);
EAPI void e_comp_object_native_surface_set(Evas_Object *obj, Eina_Bool set);
EAPI void e_comp_object_dirty(Evas_Object *obj);
EAPI Eina_Bool e_comp_object_render(Evas_Object *obj);
EAPI void e_comp_object_effect_set(Evas_Object *obj, const char *effect);
EAPI void e_comp_object_effect_params_set(Evas_Object *obj, int id, int *params, unsigned int count);
EAPI void e_comp_object_effect_clip(Evas_Object *obj);
EAPI void e_comp_object_effect_unclip(Evas_Object *obj);
EAPI void e_comp_object_effect_start(Evas_Object *obj, Edje_Signal_Cb end_cb, const void *end_data);
EAPI void e_comp_object_effect_stop(Evas_Object *obj, Edje_Signal_Cb end_cb EINA_UNUSED);
#endif
#endif

View File

@ -1,248 +0,0 @@
#include "e.h"
#include "e_comp_render_update.h"
//////////////////////////////////////////////////////////////////////////
static void
_e_comp_tiles_alloc(E_Comp_Render_Update *up)
{
if (up->tiles) return;
up->tiles = calloc(up->tw * up->th, sizeof(unsigned char));
}
//////////////////////////////////////////////////////////////////////////
E_Comp_Render_Update *
e_comp_render_update_new(void)
{
E_Comp_Render_Update *up;
up = calloc(1, sizeof(E_Comp_Render_Update));
up->tsw = 32;
up->tsh = 32;
up->pol = E_COMP_RENDER_UPDATE_POLICY_RAW;
return up;
}
void
e_comp_render_update_free(E_Comp_Render_Update *up)
{
if (!up) return;
free(up->tiles);
free(up);
}
void
e_comp_render_update_policy_set(E_Comp_Render_Update *up,
E_Comp_Render_Update_Policy pol)
{
up->pol = pol;
}
void
e_comp_render_update_tile_size_set(E_Comp_Render_Update *up,
int tsw,
int tsh)
{
if ((up->tsw == tsw) && (up->tsh == tsh)) return;
up->tsw = tsw;
up->tsh = tsh;
e_comp_render_update_clear(up);
}
void
e_comp_render_update_resize(E_Comp_Render_Update *up,
int w,
int h)
{
unsigned char *ptiles, *p, *pp;
int ptw, pth, x, y;
if ((!up) || ((up->w == w) && (up->h == h))) return;
ptw = up->tw;
pth = up->th;
ptiles = up->tiles;
up->w = w;
up->h = h;
up->tw = (up->w + up->tsw - 1) / up->tsw;
up->th = (up->h + up->tsh - 1) / up->tsh;
up->tiles = NULL;
_e_comp_tiles_alloc(up);
if ((ptiles) && (up->tiles))
{
if (pth <= up->th)
{
for (y = 0; y < pth; y++)
{
p = up->tiles + (y * up->tw);
pp = ptiles + (y * ptw);
if (ptw <= up->tw)
for (x = 0; x < ptw; x++)
*p++ = *pp++;
else
for (x = 0; x < up->tw; x++)
*p++ = *pp++;
}
}
else
{
for (y = 0; y < up->th; y++)
{
p = up->tiles + (y * up->tw);
pp = ptiles + (y * ptw);
if (ptw <= up->tw)
for (x = 0; x < ptw; x++)
*p++ = *pp++;
else
for (x = 0; x < up->tw; x++)
*p++ = *pp++;
}
}
}
free(ptiles);
}
void
e_comp_render_update_add(E_Comp_Render_Update *up,
int x,
int y,
int w,
int h)
{
int tx, ty, txx, tyy, xx, yy;
unsigned char *t, *t2;
if ((w <= 0) || (h <= 0)) return;
if ((up->tw <= 0) || (up->th <= 0)) return;
_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;
switch (up->pol)
{
case E_COMP_RENDER_UPDATE_POLICY_RAW:
break;
case E_COMP_RENDER_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH:
if (w > (up->w / 2))
{
x = 0;
w = up->w;
}
break;
default:
break;
}
tx = x / up->tsw;
ty = y / up->tsh;
txx = (x + w - 1) / up->tsw;
tyy = (y + h - 1) / up->tsh;
t = up->tiles + (ty * up->tw) + tx;
for (yy = ty; yy <= tyy; yy++)
{
t2 = t;
for (xx = tx; xx <= txx; xx++)
{
*t2 = 1;
t2++;
}
t += up->tw;
}
}
E_Comp_Render_Update_Rect *
e_comp_render_update_rects_get(E_Comp_Render_Update *up)
{
E_Comp_Render_Update_Rect *r;
int ri = 0;
int x, y;
unsigned char *t, *t2, *t3;
if (!up->tiles) return NULL;
r = calloc((up->tw * up->th) + 1, sizeof(E_Comp_Render_Update_Rect));
if (!r) return NULL;
t = up->tiles;
for (y = 0; y < up->th; y++)
{
for (x = 0; x < up->tw; x++)
{
if (*t)
{
int can_expand_x = 1, can_expand_y = 1;
int xx = 0, yy = 0;
t2 = t + 1;
while (can_expand_x)
{
xx++;
if ((x + xx) >= up->tw) can_expand_x = 0;
else if (!*t2)
can_expand_x = 0;
if (can_expand_x) *t2 = 0;
t2++;
}
t3 = t;
while (can_expand_y)
{
int i;
yy++;
t3 += up->tw;
if ((y + yy) >= up->th) can_expand_y = 0;
if (can_expand_y)
{
t2 = t3;
for (i = 0; i < xx; i++)
{
if (!*t2)
{
can_expand_y = 0;
break;
}
t2++;
}
}
if (can_expand_y)
{
t2 = t3;
for (i = 0; i < xx; i++)
{
*t2 = 0;
t2++;
}
}
}
*t = 0;
r[ri].x = x * up->tsw;
r[ri].y = y * up->tsh;
r[ri].w = xx * up->tsw;
r[ri].h = yy * up->tsh;
if ((r[ri].x + r[ri].w) > up->w) r[ri].w = up->w - r[ri].x;
if ((r[ri].y + r[ri].h) > up->h) r[ri].h = up->h - r[ri].y;
if ((r[ri].w <= 0) || (r[ri].h <= 0)) r[ri].w = 0;
else ri++;
x += xx - 1;
t += xx - 1;
}
t++;
}
}
return r;
}
void
e_comp_render_update_clear(E_Comp_Render_Update *up)
{
if (up->tiles)
{
free(up->tiles);
up->tiles = NULL;
}
}

View File

@ -1,46 +0,0 @@
#ifdef E_TYPEDEFS
typedef struct _E_Comp_Render_Update E_Comp_Render_Update;
typedef struct _E_Comp_Render_Update_Rect E_Comp_Render_Update_Rect;
typedef enum _E_Comp_Render_Update_Policy
{
E_COMP_RENDER_UPDATE_POLICY_RAW,
E_COMP_RENDER_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH,
} E_Comp_Render_Update_Policy;
#else
#ifndef E_COMP_RENDER_UPDATE_H
#define E_COMP_RENDER_UPDATE_H
struct _E_Comp_Render_Update_Rect
{
int x, y, w, h;
};
struct _E_Comp_Render_Update
{
int w, h;
int tw, th;
int tsw, tsh;
unsigned char *tiles;
E_Comp_Render_Update_Policy pol;
};
E_Comp_Render_Update *e_comp_render_update_new(void);
void e_comp_render_update_free(E_Comp_Render_Update *up);
void e_comp_render_update_policy_set(E_Comp_Render_Update *up,
E_Comp_Render_Update_Policy pol);
void e_comp_render_update_tile_size_set(E_Comp_Render_Update *up,
int tsw,
int tsh);
void e_comp_render_update_resize(E_Comp_Render_Update *up,
int w,
int h);
void e_comp_render_update_add(E_Comp_Render_Update *up,
int x,
int y,
int w,
int h);
E_Comp_Render_Update_Rect *e_comp_render_update_rects_get(E_Comp_Render_Update *up);
void e_comp_render_update_clear(E_Comp_Render_Update *up);
#endif
#endif

View File

@ -1,6 +1,5 @@
#include "e.h"
#include "e_comp_wl.h"
#include "e_surface.h"
#include <sys/mman.h>
/* compositor function prototypes */
@ -225,8 +224,6 @@ static const struct wl_pointer_grab_interface _e_drag_grab_interface =
/* local variables */
static Ecore_Idler *_module_idler = NULL;
static Eina_Hash *_e_wl_border_hash = NULL;
/* external variables */
EAPI E_Wayland_Compositor *_e_wl_comp;
@ -452,8 +449,6 @@ e_comp_wl_shutdown(void)
E_FREE(_e_wl_comp);
}
E_FREE_FUNC(_e_wl_border_hash, eina_hash_free);
/* disable the loaded shell module */
/* TODO: we should have a config variable somewhere to store which
* shell we want to unload (tablet, mobile, etc) */
@ -461,28 +456,6 @@ e_comp_wl_shutdown(void)
e_module_disable(mod);
}
EAPI void
e_comp_wl_border_surface_add(Ecore_Window win, const E_Border *bd)
{
if (!_e_wl_border_hash)
_e_wl_border_hash = eina_hash_int32_new(NULL);
eina_hash_add(_e_wl_border_hash, &win, bd);
}
EAPI void
e_comp_wl_border_surface_del(Ecore_Window win)
{
if (!_e_wl_border_hash) return;
eina_hash_del_by_key(_e_wl_border_hash, &win);
}
EAPI E_Border *
e_comp_wl_border_surface_find(Ecore_Window win)
{
if (!_e_wl_border_hash) return NULL;
return eina_hash_find(_e_wl_border_hash, &win);
}
EAPI void
wl_seat_init(struct wl_seat *seat)
{
@ -1679,8 +1652,11 @@ _e_comp_wl_cb_surface_create(struct wl_client *client, struct wl_resource *resou
wl_resource_post_no_memory(resource);
return;
}
ews->id = id;
ews->wl.client = client;
ews->pixmap = e_pixmap_new(E_PIXMAP_TYPE_WL, ews);
e_pixmap_parent_window_set(ews->pixmap, ews);
e_pixmap_usable_set(ews->pixmap, 1);
/* initialize the destroy signal */
wl_signal_init(&ews->wl.destroy_signal);
@ -1745,6 +1721,10 @@ _e_comp_wl_cb_surface_destroy(struct wl_resource *resource)
{
if (ews->unmap) ews->unmap(ews);
}
if (ews->buffer_reference.buffer)
ews->buffer_reference.buffer->ews = NULL;
if (ews->pending.buffer)
ews->pending.buffer->ews = NULL;
/* loop any pending surface frame callbacks and destroy them */
wl_list_for_each_safe(cb, ncb, &ews->pending.frames, wl.link)
@ -1772,11 +1752,14 @@ _e_comp_wl_cb_surface_destroy(struct wl_resource *resource)
wl_list_for_each_safe(cb, ncb, &ews->wl.frames, wl.link)
wl_resource_destroy(cb->wl.resource);
e_pixmap_parent_window_set(ews->pixmap, NULL);
e_pixmap_free(ews->pixmap);
/* remove this surface from the compositor's list of surfaces */
_e_wl_comp->surfaces = eina_inlist_remove(_e_wl_comp->surfaces, EINA_INLIST_GET(ews));
/* free the allocated surface structure */
E_FREE(ews);
free(ews);
}
static void
@ -2314,11 +2297,13 @@ _e_comp_wl_pointer_configure(E_Wayland_Surface *ews, Evas_Coord x, Evas_Coord y,
* using the pixels from their cursor surface */
/* is it mapped ? */
if ((focus->mapped) && (focus->ee))
if ((focus->mapped) && (focus->ec))
{
Ecore_Window win;
/* try to get the ecore_window */
#warning CURSOR BROKEN
#if 0
if ((win = ecore_evas_window_get(focus->ee)))
{
E_Wayland_Buffer_Reference *ref;
@ -2348,6 +2333,7 @@ _e_comp_wl_pointer_configure(E_Wayland_Surface *ews, Evas_Coord x, Evas_Coord y,
else
ecore_x_window_cursor_set(win, 0);
}
#endif
}
}
}
@ -2566,6 +2552,7 @@ _e_comp_wl_surface_buffer_reference(E_Wayland_Buffer_Reference *ref, E_Wayland_B
wl_signal_add(&buffer->wl.destroy_signal, &ref->destroy_listener);
}
//INF("CURRENT BUFFER SWAP");
ref->buffer = buffer;
ref->destroy_listener.notify =
_e_comp_wl_surface_buffer_reference_cb_destroy;
@ -2611,12 +2598,29 @@ _e_comp_wl_surface_buffer_resource(struct wl_resource *resource)
}
static void
_e_comp_wl_surface_buffer_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSED)
_e_comp_wl_surface_buffer_cb_destroy(struct wl_listener *listener, void *data)
{
E_Wayland_Buffer *buffer;
buffer = container_of(listener, E_Wayland_Buffer, wl.destroy_listener);
wl_signal_emit(&buffer->wl.destroy_signal, buffer);
if (buffer->ews && buffer->ews->pixmap && (e_pixmap_resource_get(buffer->ews->pixmap) == data))
{
if (buffer->ews->ec)
{
INF("DESTROYED CURRENT BUFFER: %s", e_pixmap_dirty_get(buffer->ews->pixmap) ? "DIRTY" : "CLEAN");
e_pixmap_usable_set(buffer->ews->pixmap, 0);
if (!e_pixmap_image_exists(buffer->ews->pixmap))
{
e_pixmap_image_refresh(buffer->ews->pixmap);
}
e_pixmap_image_clear(buffer->ews->pixmap, 0);
e_comp_object_damage(buffer->ews->ec->frame, 0, 0, buffer->ews->ec->client.w, buffer->ews->ec->client.h);
e_comp_object_render(buffer->ews->ec->frame);
e_comp_object_render_update_del(buffer->ews->ec->frame);
}
}
E_FREE(buffer);
}
@ -2637,13 +2641,26 @@ _e_comp_wl_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_res
if (!(ews = wl_resource_get_user_data(resource))) return;
if (buffer_resource)
buffer = _e_comp_wl_surface_buffer_resource(buffer_resource);
{
buffer = _e_comp_wl_surface_buffer_resource(buffer_resource);
if (ews->ec && (!ews->buffer_reference.buffer))
{
e_pixmap_usable_set(ews->pixmap, 1);
}
}
/* reference any existing buffers */
_e_comp_wl_surface_buffer_reference(&ews->buffer_reference, buffer);
//INF("ATTACHED NEW BUFFER");
e_pixmap_dirty(ews->pixmap);
//if (ews->ec)
//e_comp_object_damage(ews->ec->frame, 0, 0, ews->ec->client.w, ews->ec->client.h);
/* if we are setting a null buffer, then unmap the surface */
if (!buffer)
if (buffer)
buffer->ews = ews;
else
{
if (ews->mapped)
{
@ -2674,6 +2691,7 @@ _e_comp_wl_surface_cb_damage(struct wl_client *client EINA_UNUSED, struct wl_res
/* try to cast the resource data to our surface structure */
if (!(ews = wl_resource_get_user_data(resource))) return;
e_pixmap_image_clear(ews->pixmap, 1);
/* tell pixman to add this damage to pending */
pixman_region32_union_rect(&ews->pending.damage, &ews->pending.damage,
@ -2780,49 +2798,19 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_res
ews->pending.buffer);
/* if the pending buffer is NULL, unmap the surface */
if (!ews->pending.buffer)
if (ews->pending.buffer)
ews->pending.buffer->ews = ews;
else
{
if (ews->mapped)
{
if (ews->unmap) ews->unmap(ews);
}
}
else
{
if (ews->obj)
{
E_Wayland_Buffer *buff;
struct wl_shm_buffer *shm_buffer;
void *data;
buff = ews->pending.buffer;
shm_buffer = wl_shm_buffer_get(buff->wl.resource);
bw = wl_shm_buffer_get_width(shm_buffer);
bh = wl_shm_buffer_get_height(shm_buffer);
/* grab the pixel data from the buffer */
data = wl_shm_buffer_get_data(shm_buffer);
/* send the pixel data to the smart object */
e_surface_image_set(ews->obj, bw, bh, data);
}
}
}
/* if we have a reference to a buffer, get it's size */
if (&ews->buffer_reference)
{
E_Wayland_Buffer *buff;
struct wl_shm_buffer *shm_buffer;
buff = ews->buffer_reference.buffer;
shm_buffer = wl_shm_buffer_get(buff->wl.resource);
bw = wl_shm_buffer_get_width(shm_buffer);
bh = wl_shm_buffer_get_height(shm_buffer);
}
e_pixmap_dirty(ews->pixmap);
e_pixmap_refresh(ews->pixmap);
e_pixmap_size_get(ews->pixmap, &bw, &bh);
/* if we have a new pending buffer, call configure */
if ((ews->configure) && (ews->pending.new_buffer))
@ -2849,15 +2837,18 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_res
pixman_region32_init(&ews->pending.damage);
/* get the extent of the damage region */
rects = pixman_region32_rectangles(&ews->region.damage, &n);
while (n--)
if (ews->ec)
{
pixman_box32_t *r;
rects = pixman_region32_rectangles(&ews->region.damage, &n);
while (n--)
{
pixman_box32_t *r;
r = &rects[n];
r = &rects[n];
/* send damages to the image */
e_surface_damage_add(ews->obj, r->x1, r->y1, r->x2, r->y2);
/* send damages to the image */
e_comp_object_damage(ews->ec->frame, r->x1, r->y1, r->x2, r->y2);
}
}
/* tell pixman we are finished with this region */
@ -2898,9 +2889,9 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_res
rects = pixman_region32_extents(&ews->region.input);
/* update the smart object's input region */
if (ews->obj)
e_surface_input_set(ews->obj, rects->x1, rects->y1,
rects->x2, rects->y2);
if (ews->ec)
e_comp_object_input_area_set(ews->ec->frame, rects->x1, rects->y1,
rects->x2, rects->y2);
}
/* put any pending frame callbacks into active list */
@ -2909,6 +2900,10 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_res
/* clear list of pending frame callbacks */
wl_list_init(&ews->pending.frames);
ews->updates = 1;
_e_wl_comp->surfaces = eina_inlist_promote(_e_wl_comp->surfaces, EINA_INLIST_GET(ews));
/* TODO: schedule repaint ?? */
}

View File

@ -267,6 +267,7 @@ struct _E_Wayland_Buffer
int w, h;
unsigned int busy_count;
E_Wayland_Surface *ews;
};
struct _E_Wayland_Buffer_Reference
@ -281,6 +282,7 @@ struct _E_Wayland_Surface
Ecore_Window id;
struct
{
struct wl_client *client;
struct wl_resource *surface;
struct wl_signal destroy_signal;
struct wl_list link, frames;
@ -311,18 +313,12 @@ struct _E_Wayland_Surface
pixman_region32_t damage, clip;
} region;
/* smart object for this surface */
Evas_Object *obj;
Ecore_Evas *ee;
Ecore_X_Window evas_win;
Evas *evas;
E_Border *bd;
Eina_List *bd_hooks;
E_Client *ec;
E_Pixmap *pixmap;
E_Wayland_Shell_Surface *shell_surface;
Eina_Bool mapped : 1;
Eina_Bool updates : 1; //surface has render updates
E_Wayland_Input *input;
@ -367,7 +363,7 @@ struct _E_Wayland_Shell_Surface
E_Wayland_Surface *surface, *parent;
E_Wayland_Shell_Surface_Type type, next_type;
char *title, *clas;
Eina_Stringshare *title, *clas;
Eina_Bool active : 1;
@ -588,10 +584,6 @@ extern EAPI E_Wayland_Compositor *_e_wl_comp;
EINTERN Eina_Bool e_comp_wl_init(void);
EINTERN void e_comp_wl_shutdown(void);
EAPI void e_comp_wl_border_surface_add(Ecore_Window win, const E_Border *bd);
EAPI void e_comp_wl_border_surface_del(Ecore_Window win);
EAPI E_Border *e_comp_wl_border_surface_find(Ecore_Window win);
EAPI void wl_seat_init(struct wl_seat *seat);
EAPI void wl_seat_release(struct wl_seat *seat);

4851
src/bin/e_comp_x.c Normal file

File diff suppressed because it is too large Load Diff

7
src/bin/e_comp_x.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef E_COMP_X_H
#define E_COMP_X_H
EINTERN Eina_Bool e_comp_x_init(void);
EINTERN void e_comp_x_shutdown(void);
#endif

View File

@ -1,6 +1,6 @@
#include "e.h"
#if ((E18_PROFILE >= LOWRES_PDA) && (E18_PROFILE <= HIRES_PDA))
#if ((E19_PROFILE >= LOWRES_PDA) && (E19_PROFILE <= HIRES_PDA))
#define DEF_MENUCLICK 1.25
#else
#define DEF_MENUCLICK 0.25
@ -173,7 +173,8 @@ _e_config_edd_init(Eina_Bool old)
#define D _e_config_shelf_edd
E_CONFIG_VAL(D, T, name, STR);
E_CONFIG_VAL(D, T, id, INT);
E_CONFIG_VAL(D, T, container, INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(D, T, "container", manager, EET_T_INT);
E_CONFIG_VAL(D, T, manager /*container */, INT);
E_CONFIG_VAL(D, T, zone, INT);
E_CONFIG_VAL(D, T, layer, INT);
E_CONFIG_VAL(D, T, popup, UCHAR);
@ -202,7 +203,8 @@ _e_config_edd_init(Eina_Bool old)
#undef D
#define T E_Config_Desktop_Background
#define D _e_config_desktop_bg_edd
E_CONFIG_VAL(D, T, container, INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(D, T, "container", manager, EET_T_INT);
E_CONFIG_VAL(D, T, manager /*container */, INT);
E_CONFIG_VAL(D, T, zone, INT);
E_CONFIG_VAL(D, T, desk_x, INT);
E_CONFIG_VAL(D, T, desk_y, INT);
@ -213,7 +215,8 @@ _e_config_edd_init(Eina_Bool old)
#undef D
#define T E_Config_Desktop_Name
#define D _e_config_desktop_name_edd
E_CONFIG_VAL(D, T, container, INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(D, T, "container", manager, EET_T_INT);
E_CONFIG_VAL(D, T, manager /*container */, INT);
E_CONFIG_VAL(D, T, zone, INT);
E_CONFIG_VAL(D, T, desk_x, INT);
E_CONFIG_VAL(D, T, desk_y, INT);
@ -224,7 +227,7 @@ _e_config_edd_init(Eina_Bool old)
#undef D
#define T E_Config_Desktop_Window_Profile
#define D _e_config_desktop_window_profile_edd
E_CONFIG_VAL(D, T, container, INT);
E_CONFIG_VAL(D, T, manager, INT);
E_CONFIG_VAL(D, T, zone, INT);
E_CONFIG_VAL(D, T, desk_x, INT);
E_CONFIG_VAL(D, T, desk_y, INT);
@ -1233,29 +1236,50 @@ e_config_load(void)
break;
}
}
CONFIG_VERSION_CHECK(13)
CONFIG_VERSION_CHECK(14)
{
E_Config_Theme *et;
E_Path_Dir *epd;
char buf[PATH_MAX], buf2[PATH_MAX], *f;
Eina_List *files;
Eina_List *files, *l;
Eina_Bool fail = EINA_FALSE;
E_Config_Shelf *cf_es;
E_Remember *rem;
CONFIG_VERSION_UPDATE_INFO(14);
EINA_LIST_FOREACH(e_config->shelves, l, cf_es)
{
if (cf_es->popup)
{
if (cf_es->layer)
cf_es->layer = E_LAYER_CLIENT_ABOVE;
else
cf_es->layer = E_LAYER_CLIENT_DESKTOP;
}
else if (!cf_es->layer)
cf_es->layer = E_LAYER_DESKTOP; //redundant, but whatever
cf_es->popup = 0;
}
CONFIG_VERSION_UPDATE_INFO(13);
// empty out theme elements of config
eina_stringshare_del(e_config->init_default_theme);
e_config->init_default_theme = NULL;
eina_stringshare_replace(&e_config->init_default_theme, NULL);
EINA_LIST_FREE(e_config->themes, et)
{
if (et->category) eina_stringshare_del(et->category);
if (et->file) eina_stringshare_del(et->file);
E_FREE(et);
eina_stringshare_del(et->category);
eina_stringshare_del(et->file);
free(et);
}
EINA_LIST_FREE(e_config->path_append_themes, epd)
{
if (epd->dir) eina_stringshare_del(epd->dir);
E_FREE(epd);
eina_stringshare_del(epd->dir);
free(epd);
}
/* E19 layer values are higher */
EINA_LIST_FOREACH(e_config->remembers, l, rem)
if (rem->apply & E_REMEMBER_APPLY_LAYER)
rem->prop.layer += 100;
// copy all of ~/.e/e/themes/* into ~/.elementary/themes
// and delete original data in ~/.e/e/themes
ecore_file_mkpath(elm_theme_user_dir_get());
@ -1698,38 +1722,34 @@ e_config_domain_system_load(const char *domain, E_Config_DD *edd)
static void
_e_config_mv_error(const char *from, const char *to)
{
if (!_e_config_error_dialog)
{
E_Dialog *dia;
E_Dialog *dia;
char buf[8192];
dia = e_dialog_new(e_container_current_get(e_manager_current_get()),
"E", "_sys_error_logout_slow");
if (dia)
{
char buf[8192];
if (_e_config_error_dialog) return;
e_dialog_title_set(dia, _("Enlightenment Settings Write Problems"));
e_dialog_icon_set(dia, "dialog-error", 64);
snprintf(buf, sizeof(buf),
_("Enlightenment has had an error while moving config files<br>"
"from:<br>"
"%s<br>"
"<br>"
"to:<br>"
"%s<br>"
"<br>"
"The rest of the write has been aborted for safety.<br>"),
from, to);
e_dialog_text_set(dia, buf);
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
e_dialog_button_focus_num(dia, 0);
e_win_centered_set(dia->win, 1);
e_object_del_attach_func_set(E_OBJECT(dia),
_e_config_error_dialog_cb_delete);
e_dialog_show(dia);
_e_config_error_dialog = dia;
}
}
dia = e_dialog_new(NULL, "E", "_sys_error_logout_slow");
EINA_SAFETY_ON_NULL_RETURN(dia);
e_dialog_title_set(dia, _("Enlightenment Settings Write Problems"));
e_dialog_icon_set(dia, "dialog-error", 64);
snprintf(buf, sizeof(buf),
_("Enlightenment has had an error while moving config files<br>"
"from:<br>"
"%s<br>"
"<br>"
"to:<br>"
"%s<br>"
"<br>"
"The rest of the write has been aborted for safety.<br>"),
from, to);
e_dialog_text_set(dia, buf);
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
e_dialog_button_focus_num(dia, 0);
e_win_centered_set(dia->win, 1);
e_object_del_attach_func_set(E_OBJECT(dia),
_e_config_error_dialog_cb_delete);
e_dialog_show(dia);
_e_config_error_dialog = dia;
}
EAPI int
@ -2363,8 +2383,7 @@ _e_config_eet_close_handle(Eet_File *ef, char *file)
{
E_Dialog *dia;
dia = e_dialog_new(e_container_current_get(e_manager_current_get()),
"E", "_sys_error_logout_slow");
dia = e_dialog_new(NULL, "E", "_sys_error_logout_slow");
if (dia)
{
char buf[8192];

View File

@ -48,7 +48,7 @@ typedef enum
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 13
#define E_CONFIG_FILE_GENERATION 14
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
@ -546,7 +546,7 @@ struct _E_Config_Binding_Acpi
struct _E_Config_Desktop_Background
{
int container;
int manager;
int zone;
int desk_x;
int desk_y;
@ -555,7 +555,7 @@ struct _E_Config_Desktop_Background
struct _E_Config_Desktop_Name
{
int container;
int manager;
int zone;
int desk_x;
int desk_y;
@ -564,7 +564,7 @@ struct _E_Config_Desktop_Name
struct _E_Config_Desktop_Window_Profile
{
int container;
int manager;
int zone;
int desk_x;
int desk_y;
@ -603,9 +603,9 @@ struct _E_Config_Shelf
{
const char *name;
int id;
int container, zone;
int layer;
unsigned char popup;
int manager, zone;
int layer; //E_Layer
unsigned char popup; //DEAD
int orient;
unsigned char fit_along;
unsigned char fit_size;

View File

@ -21,7 +21,7 @@ static Eina_List *_e_config_dialog_list = NULL;
/**
* Creates a new dialog
*
* @param con the container the dialog will be added too
* @param c the compositor the dialog will be added to
* @param title to display for the dialog
* @param name the name used to register the window in e
* @param class the call used to register the window in e
@ -32,14 +32,14 @@ static Eina_List *_e_config_dialog_list = NULL;
* @return returns the created dialog. Null on failure
*/
EAPI E_Config_Dialog *
e_config_dialog_new(E_Container *con, const char *title, const char *name, const char *class, const char *icon, int icon_size, E_Config_Dialog_View *view, void *data)
e_config_dialog_new(E_Comp *c, const char *title, const char *name, const char *class, const char *icon, int icon_size, E_Config_Dialog_View *view, void *data)
{
E_Config_Dialog *cfd;
cfd = E_OBJECT_ALLOC(E_Config_Dialog, E_CONFIG_DIALOG_TYPE,
_e_config_dialog_free);
cfd->view = view;
cfd->con = con;
cfd->comp = c;
cfd->title = eina_stringshare_add(title);
cfd->name = eina_stringshare_add(name);
cfd->class = eina_stringshare_add(class);
@ -106,22 +106,21 @@ e_config_dialog_find(const char *name, const char *class)
E_Zone *z;
z = e_util_zone_current_get(e_manager_current_get());
e_border_uniconify(cfd->dia->win->border);
e_client_uniconify(cfd->dia->win->client);
e_win_raise(cfd->dia->win);
if (z->container == cfd->dia->win->border->zone->container)
e_border_desk_set(cfd->dia->win->border, e_desk_current_get(z));
if (z->comp == cfd->dia->win->client->zone->comp)
e_client_desk_set(cfd->dia->win->client, e_desk_current_get(z));
else
{
if (!cfd->dia->win->border->sticky)
e_desk_show(cfd->dia->win->border->desk);
ecore_x_pointer_warp(cfd->dia->win->border->zone->container->win,
cfd->dia->win->border->zone->x + (cfd->dia->win->border->zone->w / 2),
cfd->dia->win->border->zone->y + (cfd->dia->win->border->zone->h / 2));
if (!cfd->dia->win->client->sticky)
e_desk_show(cfd->dia->win->client->desk);
e_util_pointer_center(cfd->dia->win->client);
}
e_border_unshade(cfd->dia->win->border, cfd->dia->win->border->shade.dir);
if (cfd->dia->win->client->shaded || cfd->dia->win->client->shading)
e_client_unshade(cfd->dia->win->client, cfd->dia->win->client->shade_dir);
if ((e_config->focus_setting == E_FOCUS_NEW_DIALOG) ||
(e_config->focus_setting == E_FOCUS_NEW_WINDOW))
e_border_focus_set(cfd->dia->win->border, 1, 1);
evas_object_focus_set(cfd->dia->win->client->frame, 1);
return 1;
}
}
@ -192,9 +191,9 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
if (!pdia) /* creating window for the first time */
{
if ((cfd->view->normal_win) || (e_config->cfgdlg_normal_wins))
cfd->dia = e_dialog_normal_win_new(cfd->con, cfd->name, buf);
cfd->dia = e_dialog_normal_win_new(cfd->comp, cfd->name, buf);
else
cfd->dia = e_dialog_new(cfd->con, cfd->name, buf);
cfd->dia = e_dialog_new(cfd->comp, cfd->name, buf);
e_object_del_attach_func_set(E_OBJECT(cfd->dia),
_e_config_dialog_cb_dialog_del);
} /* window was created before - deleting content only */

View File

@ -41,7 +41,7 @@ struct _E_Config_Dialog
E_Config_Dialog_CFData_Type view_type;
E_Config_Dialog_View *view;
E_Config_Dialog_Data *cfdata;
E_Container *con;
E_Comp *comp;
const char *title;
const char *icon;
const char *name;
@ -55,7 +55,7 @@ struct _E_Config_Dialog
unsigned char cfg_changed_auto : 1;
};
EAPI E_Config_Dialog *e_config_dialog_new(E_Container *con, const char *title, const char *name, const char *class, const char *icon, int icon_size, E_Config_Dialog_View *view, void *data);
EAPI E_Config_Dialog *e_config_dialog_new(E_Comp *c, const char *title, const char *name, const char *class, const char *icon, int icon_size, E_Config_Dialog_View *view, void *data);
EAPI int e_config_dialog_find(const char *name, const char *class);
EAPI E_Config_Dialog *e_config_dialog_get(const char *name, const char *class);

View File

@ -5,7 +5,7 @@ static void _e_configure_menu_add(void *data, E_Menu *m);
static void _e_configure_efreet_desktop_cleanup(void);
static void _e_configure_efreet_desktop_update(void);
static Eina_Bool _e_configure_cb_efreet_desktop_cache_update(void *data, int type, void *event);
static void _e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params), void (*generic_func)(E_Container *con, const char *params), Efreet_Desktop *desktop, const char *params);
static void _e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Comp *c, const char *params), void (*generic_func)(E_Comp *c, const char *params), Efreet_Desktop *desktop, const char *params);
static void _e_configure_registry_item_free(E_Configure_It *eci);
static void _configure_job(void *data);
@ -19,7 +19,7 @@ static Ecore_Job *update_job = NULL;
static struct
{
void (*func)(const void *data, E_Container *con, const char *params, Efreet_Desktop *desktop);
void (*func)(const void *data, E_Comp *c, const char *params, Efreet_Desktop *desktop);
const char *data;
} custom_desktop_exec = { NULL, NULL };
@ -41,7 +41,7 @@ e_configure_init(void)
}
EAPI void
e_configure_registry_call(const char *path, E_Container *con, const char *params)
e_configure_registry_call(const char *path, E_Comp *c, const char *params)
{
E_Configure_Cat *ecat;
Eina_List *l;
@ -52,7 +52,7 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params
cat = ecore_file_dir_get(path);
if (!cat) return;
item = ecore_file_file_get(path);
if (!con) con = e_container_current_get(e_manager_current_get());
if (!c) c = e_comp_get(NULL);
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
if (!strcmp(cat, ecat->cat))
{
@ -64,16 +64,16 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params
{
if (!params) params = eci->params;
if (eci->func) eci->func(con, params);
if (eci->func) eci->func(c, params);
else if (eci->generic_func)
eci->generic_func(con, params);
eci->generic_func(c, params);
else if (eci->desktop)
{
if (custom_desktop_exec.func)
custom_desktop_exec.func(custom_desktop_exec.data,
con, params, eci->desktop);
c, params, eci->desktop);
else
e_exec(e_util_zone_current_get(con->manager),
e_exec(e_util_zone_current_get(c->man),
eci->desktop, NULL, NULL, "config");
}
break;
@ -84,27 +84,27 @@ e_configure_registry_call(const char *path, E_Container *con, const char *params
}
EAPI void
e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params))
e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Comp *c, const char *params))
{
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL, NULL);
}
EAPI void
e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func)(E_Container *con, const char *params))
e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func)(E_Comp *c, const char *params))
{
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, NULL, generic_func, NULL, NULL);
}
EAPI void
e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params), const char *params)
e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Comp *c, const char *params), const char *params)
{
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL, params);
}
/**
* Delete an item in the configuration panel.
*Delete an item in the configuration panel.
*
* @param path location the item to delete
*@param path location the item to delete
*/
EAPI void
e_configure_registry_item_del(const char *path)
@ -139,14 +139,14 @@ e_configure_registry_item_del(const char *path)
}
/**
* Add a category to the configuration panel.
*Add a category to the configuration panel.
*
* @param path location the new category
* @param pri the priority for sorting the category in the category list
* @param label the name the user will see in configuration panel
* @param icon_file the edje file that holds the icon for the category.
* Can be null to use current theme.
* @param icon the name of the edje group to use as icon
*@param path location the new category
*@param pri the priority for sorting the category in the category list
*@param label the name the user will see in configuration panel
*@param icon_file the edje file that holds the icon for the category.
*Can be null to use current theme.
*@param icon the name of the edje group to use as icon
*/
static int
_E_configure_category_pri_cb(E_Configure_Cat *ecat, E_Configure_Cat *ecat2)
@ -181,9 +181,9 @@ e_configure_registry_category_add(const char *path, int pri, const char *label,
}
/**
* Delete a category in the configuration panel.
*Delete a category in the configuration panel.
*
* @param path location the category to delete
*@param path location the category to delete
*/
EAPI void
e_configure_registry_category_del(const char *path)
@ -210,19 +210,19 @@ e_configure_registry_category_del(const char *path)
}
/**
* Add a item to the configuration panel.
*Add a item to the configuration panel.
*
* @param path location the location to place configuration item
* @param pri the priority for sorting the item in the category list
* @param label the name the user will see in configuration panel
* @param icon_file the edje file that holds the icon for the category.
* Can be null to use current theme.
* @param icon the name of the edje group to use as icon
* @param func the callback to use when the configuration item is clicked
*@param path location the location to place configuration item
*@param pri the priority for sorting the item in the category list
*@param label the name the user will see in configuration panel
*@param icon_file the edje file that holds the icon for the category.
*Can be null to use current theme.
*@param icon the name of the edje group to use as icon
*@param func the callback to use when the configuration item is clicked
*/
EAPI void
e_configure_registry_custom_desktop_exec_callback_set(void (*func)(const void *data, E_Container *con, const char *params, Efreet_Desktop *desktop), const void *data)
e_configure_registry_custom_desktop_exec_callback_set(void (*func)(const void *data, E_Comp *c, const char *params, Efreet_Desktop *desktop), const void *data)
{
custom_desktop_exec.func = func;
custom_desktop_exec.data = data;
@ -268,7 +268,7 @@ e_configure_registry_exists(const char *path)
static void
_e_configure_menu_module_item_cb(void *data __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__)
{
e_int_config_modules(m->zone->container, NULL);
e_int_config_modules(m->zone->comp, NULL);
}
static void
@ -461,7 +461,7 @@ _e_configure_compare_pri_cb(E_Configure_It *eci, E_Configure_It *eci2)
}
static void
_e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params), void (*generic_func)(E_Container *con, const char *params), Efreet_Desktop *desktop, const char *params)
_e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Comp *c, const char *params), void (*generic_func)(E_Comp *c, const char *params), Efreet_Desktop *desktop, const char *params)
{
Eina_List *l;
char *cat;

View File

@ -25,20 +25,20 @@ struct _E_Configure_It
const char *icon_file;
const char *icon;
const char *params;
E_Config_Dialog *(*func) (E_Container *con, const char *params);
void (*generic_func) (E_Container *con, const char *params);
E_Config_Dialog *(*func) (E_Comp *c, const char *params);
void (*generic_func) (E_Comp *c, const char *params);
Efreet_Desktop *desktop;
};
EAPI void e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params));
EAPI void e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), const char *params);
EAPI void e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func) (E_Container *con, const char *params));
EAPI void e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Comp *c, const char *params));
EAPI void e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Comp *c, const char *params), const char *params);
EAPI void e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func) (E_Comp *c, const char *params));
EAPI void e_configure_registry_item_del(const char *path);
EAPI void e_configure_registry_category_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon);
EAPI void e_configure_registry_category_del(const char *path);
EAPI void e_configure_registry_call(const char *path, E_Container *con, const char *params);
EAPI void e_configure_registry_call(const char *path, E_Comp *c, const char *params);
EAPI int e_configure_registry_exists(const char *path);
EAPI void e_configure_registry_custom_desktop_exec_callback_set(void (*func) (const void *data, E_Container *con, const char *params, Efreet_Desktop *desktop), const void *data);
EAPI void e_configure_registry_custom_desktop_exec_callback_set(void (*func) (const void *data, E_Comp *c, const char *params, Efreet_Desktop *desktop), const void *data);
EINTERN void e_configure_init(void);
extern EAPI Eina_List *e_configure_registry;

View File

@ -33,7 +33,7 @@ e_confirm_dialog_show(const char *title, const char *icon, const char *text,
cd->del.func = del_func;
cd->del.data = del_data;
dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_confirm_dialog");
dia = e_dialog_new(NULL, "E", "_confirm_dialog");
if (!dia)
{
e_object_del(E_OBJECT(cd));

File diff suppressed because it is too large Load Diff

View File

@ -1,157 +0,0 @@
#ifdef E_TYPEDEFS
typedef enum _E_Container_Shape_Change
{
E_CONTAINER_SHAPE_ADD,
E_CONTAINER_SHAPE_DEL,
E_CONTAINER_SHAPE_SHOW,
E_CONTAINER_SHAPE_HIDE,
E_CONTAINER_SHAPE_MOVE,
E_CONTAINER_SHAPE_RESIZE,
E_CONTAINER_SHAPE_RECTS,
E_CONTAINER_SHAPE_INPUT_RECTS
} E_Container_Shape_Change;
typedef struct _E_Container E_Container;
typedef struct _E_Border_List E_Border_List;
typedef struct _E_Container_Shape E_Container_Shape;
typedef struct _E_Container_Shape_Callback E_Container_Shape_Callback;
typedef struct _E_Event_Container_Resize E_Event_Container_Resize;
typedef void (*E_Container_Shape_Cb)(void *data, E_Container_Shape *es, E_Container_Shape_Change ch);
#else
#ifndef E_CONTAINER_H
#define E_CONTAINER_H
#define E_CONTAINER_TYPE (int) 0xE0b01003
#define E_CONTAINER_SHAPE_TYPE (int) 0xE0b01004
#define E_CONTAINER_LAYER_COUNT 12
struct _E_Container
{
E_Object e_obj_inherit;
Ecore_X_Window win;
int x, y, w, h;
char visible : 1;
E_Manager *manager;
unsigned int num;
const char *name;
Ecore_Evas *bg_ecore_evas;
Evas *bg_evas;
Evas_Object *bg_blank_object;
Ecore_X_Window bg_win;
Ecore_X_Window event_win;
Eina_List *shapes;
Eina_List *shape_change_cb;
Eina_List *zones;
unsigned int clients;
struct {
Ecore_X_Window win;
Eina_List *clients; /* E_Border */
} layers[E_CONTAINER_LAYER_COUNT];
Ecore_X_Window scratch_win;
};
struct _E_Border_List
{
E_Container *container;
Eina_Array client_array;
int pos;
};
struct _E_Container_Shape
{
E_Object e_obj_inherit;
E_Container *con;
E_Comp_Win *comp_win;
int x, y, w, h;
unsigned char visible : 1;
struct {
int x, y, w, h;
} solid_rect;
int shape_rects_num;
Eina_Rectangle *shape_rects;
int shape_input_rects_num;
Eina_Rectangle *shape_input_rects;
};
struct _E_Container_Shape_Callback
{
E_Container_Shape_Cb func;
void *data;
};
struct _E_Event_Container_Resize
{
E_Container *container;
};
EINTERN int e_container_init(void);
EINTERN int e_container_shutdown(void);
EAPI E_Container *e_container_new(E_Manager *man);
EAPI void e_container_show(E_Container *con);
EAPI void e_container_hide(E_Container *con);
EAPI E_Container *e_container_current_get(E_Manager *man);
EAPI E_Container *e_container_number_get(E_Manager *man, int num);
EAPI void e_container_move(E_Container *con, int x, int y);
EAPI void e_container_resize(E_Container *con, int w, int h);
EAPI void e_container_move_resize(E_Container *con, int x, int y, int w, int h);
EAPI void e_container_raise(E_Container *con);
EAPI void e_container_lower(E_Container *con);
EAPI E_Border_List *e_container_border_list_first(E_Container *con);
EAPI E_Border_List *e_container_border_list_last(E_Container *con);
EAPI E_Border *e_container_border_list_next(E_Border_List *list);
EAPI E_Border *e_container_border_list_prev(E_Border_List *list);
EAPI void e_container_border_list_free(E_Border_List *list);
EAPI E_Zone *e_container_zone_at_point_get(E_Container *con, int x, int y);
EAPI E_Zone *e_container_zone_number_get(E_Container *con, int num);
EAPI E_Zone *e_container_zone_id_get(E_Container *con, int id);
EAPI E_Desk *e_container_desk_window_profile_get(E_Container *con, const char *profile);
EAPI E_Container_Shape *e_container_shape_add(E_Container *con);
EAPI void e_container_shape_show(E_Container_Shape *es);
EAPI void e_container_shape_hide(E_Container_Shape *es);
EAPI void e_container_shape_move(E_Container_Shape *es, int x, int y);
EAPI void e_container_shape_resize(E_Container_Shape *es, int w, int h);
EAPI Eina_List *e_container_shape_list_get(E_Container *con);
EAPI void e_container_shape_geometry_get(E_Container_Shape *es, int *x, int *y, int *w, int *h);
EAPI E_Container *e_container_shape_container_get(E_Container_Shape *es);
EAPI void e_container_shape_change_callback_add(E_Container *con, E_Container_Shape_Cb func, void *data);
EAPI void e_container_shape_change_callback_del(E_Container *con, E_Container_Shape_Cb func, void *data);
EAPI void e_container_shape_rects_set(E_Container_Shape *es, Eina_Rectangle *rects, int num);
EAPI void e_container_shape_input_rects_set(E_Container_Shape *es, Eina_Rectangle *rects, int num);
EAPI void e_container_shape_solid_rect_set(E_Container_Shape *es, int x, int y, int w, int h);
EAPI void e_container_shape_solid_rect_get(E_Container_Shape *es, int *x, int *y, int *w, int *h);
EAPI int e_container_borders_count(E_Container *con);
EAPI void e_container_border_add(E_Border *bd);
EAPI void e_container_border_remove(E_Border *bd);
EAPI void e_container_window_raise(E_Container *con, Ecore_X_Window win, E_Layer layer);
EAPI void e_container_window_lower(E_Container *con, Ecore_X_Window win, E_Layer layer);
EAPI E_Border *e_container_border_raise(E_Border *bd);
EAPI E_Border *e_container_border_lower(E_Border *bd);
EAPI void e_container_border_stack_above(E_Border *bd, E_Border *above);
EAPI void e_container_border_stack_below(E_Border *bd, E_Border *below);
EAPI void e_container_all_freeze(void);
EAPI void e_container_all_thaw(void);
EAPI E_Container *e_container_evas_object_container_get(Evas_Object *obj);
extern EAPI int E_EVENT_CONTAINER_RESIZE;
#endif
#endif

View File

@ -13,10 +13,8 @@ static void _e_desk_event_desk_deskshow_free(void *data, void *ev);
static void _e_desk_event_desk_name_change_free(void *data, void *ev);
static void _e_desk_show_begin(E_Desk *desk, int dx, int dy);
static void _e_desk_hide_begin(E_Desk *desk, int dx, int dy);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
static void _e_desk_event_desk_window_profile_change_free(void *data, void *ev);
static void _e_desk_window_profile_change_protocol_set(void);
#endif
EAPI int E_EVENT_DESK_SHOW = 0;
EAPI int E_EVENT_DESK_BEFORE_SHOW = 0;
@ -49,9 +47,7 @@ e_desk_new(E_Zone *zone, int x, int y)
E_Desk *desk;
Eina_List *l;
E_Config_Desktop_Name *cfname;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
E_Config_Desktop_Window_Profile *cfprof;
#endif
char name[40];
int ok = 0;
@ -68,8 +64,8 @@ e_desk_new(E_Zone *zone, int x, int y)
/* Get current desktop's name */
EINA_LIST_FOREACH(e_config->desktop_names, l, cfname)
{
if ((cfname->container >= 0) &&
((int)zone->container->num != cfname->container)) continue;
if ((cfname->manager >= 0) &&
((int)zone->comp->num != cfname->manager)) continue;
if ((cfname->zone >= 0) &&
((int)zone->num != cfname->zone)) continue;
if ((cfname->desk_x != desk->x) || (cfname->desk_y != desk->y))
@ -84,13 +80,12 @@ e_desk_new(E_Zone *zone, int x, int y)
snprintf(name, sizeof(name), _(e_config->desktop_default_name), x, y);
desk->name = eina_stringshare_add(name);
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
/* Get window profile name for current desktop */
ok = 0;
EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
{
if ((cfprof->container >= 0) &&
((int)zone->container->num != cfprof->container)) continue;
if ((cfprof->manager >= 0) &&
((int)zone->comp->num != cfprof->manager)) continue;
if ((cfprof->zone >= 0) &&
((int)zone->num != cfprof->zone)) continue;
if ((cfprof->desk_x != desk->x) || (cfprof->desk_y != desk->y))
@ -105,7 +100,6 @@ e_desk_new(E_Zone *zone, int x, int y)
desk->window_profile = eina_stringshare_add
(e_config->desktop_default_window_profile);
}
#endif
return desk;
}
@ -127,14 +121,14 @@ e_desk_name_set(E_Desk *desk, const char *name)
}
EAPI void
e_desk_name_add(int container, int zone, int desk_x, int desk_y, const char *name)
e_desk_name_add(int manager, int zone, int desk_x, int desk_y, const char *name)
{
E_Config_Desktop_Name *cfname;
e_desk_name_del(container, zone, desk_x, desk_y);
e_desk_name_del(manager, zone, desk_x, desk_y);
cfname = E_NEW(E_Config_Desktop_Name, 1);
cfname->container = container;
cfname->manager = manager;
cfname->zone = zone;
cfname->desk_x = desk_x;
cfname->desk_y = desk_y;
@ -144,14 +138,14 @@ e_desk_name_add(int container, int zone, int desk_x, int desk_y, const char *nam
}
EAPI void
e_desk_name_del(int container, int zone, int desk_x, int desk_y)
e_desk_name_del(int manager, int zone, int desk_x, int desk_y)
{
Eina_List *l = NULL;
E_Config_Desktop_Name *cfname = NULL;
EINA_LIST_FOREACH(e_config->desktop_names, l, cfname)
{
if ((cfname->container == container) && (cfname->zone == zone) &&
if ((cfname->manager == manager) && (cfname->zone == zone) &&
(cfname->desk_x == desk_x) && (cfname->desk_y == desk_y))
{
e_config->desktop_names =
@ -166,48 +160,44 @@ e_desk_name_del(int container, int zone, int desk_x, int desk_y)
EAPI void
e_desk_name_update(void)
{
Eina_List *m, *c, *z, *l;
E_Manager *man;
E_Container *con;
const Eina_List *z, *l;
E_Comp *c;
E_Zone *zone;
E_Desk *desk;
E_Config_Desktop_Name *cfname;
int d_x, d_y, ok;
char name[40];
EINA_LIST_FOREACH(e_manager_list(), m, man)
EINA_LIST_FOREACH(e_comp_list(), l, c)
{
EINA_LIST_FOREACH(man->containers, c, con)
EINA_LIST_FOREACH(c->zones, z, zone)
{
EINA_LIST_FOREACH(con->zones, z, zone)
for (d_x = 0; d_x < zone->desk_x_count; d_x++)
{
for (d_x = 0; d_x < zone->desk_x_count; d_x++)
for (d_y = 0; d_y < zone->desk_y_count; d_y++)
{
for (d_y = 0; d_y < zone->desk_y_count; d_y++)
desk = zone->desks[d_x + zone->desk_x_count * d_y];
ok = 0;
EINA_LIST_FOREACH(e_config->desktop_names, l, cfname)
{
desk = zone->desks[d_x + zone->desk_x_count * d_y];
ok = 0;
if ((cfname->manager >= 0) &&
((int)c->num != cfname->manager)) continue;
if ((cfname->zone >= 0) &&
((int)zone->num != cfname->zone)) continue;
if ((cfname->desk_x != d_x) ||
(cfname->desk_y != d_y)) continue;
e_desk_name_set(desk, cfname->name);
ok = 1;
break;
}
EINA_LIST_FOREACH(e_config->desktop_names, l, cfname)
{
if ((cfname->container >= 0) &&
((int)con->num != cfname->container)) continue;
if ((cfname->zone >= 0) &&
((int)zone->num != cfname->zone)) continue;
if ((cfname->desk_x != d_x) ||
(cfname->desk_y != d_y)) continue;
e_desk_name_set(desk, cfname->name);
ok = 1;
break;
}
if (!ok)
{
snprintf(name, sizeof(name),
_(e_config->desktop_default_name),
d_x, d_y);
e_desk_name_set(desk, name);
}
if (!ok)
{
snprintf(name, sizeof(name),
_(e_config->desktop_default_name),
d_x, d_y);
e_desk_name_set(desk, name);
}
}
}
@ -236,7 +226,6 @@ e_desk_show(E_Desk *desk)
ecore_event_add(E_EVENT_DESK_BEFORE_SHOW, eev,
_e_desk_event_desk_before_show_free, NULL);
ecore_x_window_shadow_tree_flush();
for (x = 0; x < desk->zone->desk_x_count; x++)
{
for (y = 0; y < desk->zone->desk_y_count; y++)
@ -293,6 +282,8 @@ e_desk_show(E_Desk *desk)
{
if (e_config->focus_last_focused_per_desktop)
e_desk_last_focused_focus(desk);
else if (e_client_focused_get())
evas_object_focus_set(e_client_focused_get()->frame, 0);
}
if (was_zone)
@ -328,8 +319,7 @@ e_desk_show(E_Desk *desk)
EAPI void
e_desk_deskshow(E_Zone *zone)
{
E_Border *bd;
E_Border_List *bl;
E_Client *ec;
E_Desk *desk;
E_Event_Desk_Show *ev;
@ -337,32 +327,31 @@ e_desk_deskshow(E_Zone *zone)
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
desk = e_desk_current_get(zone);
bl = e_container_border_list_first(zone->container);
ecore_x_window_shadow_tree_flush();
while ((bd = e_container_border_list_next(bl)))
/* uniconify raises windows and changes stacking order
* go top-down to avoid skipping windows
*/
E_CLIENT_REVERSE_FOREACH(zone->comp, ec)
{
if (bd->desk == desk)
if (e_client_util_ignored_get(ec)) continue;
if (ec->desk != desk) continue;
if (desk->deskshow_toggle)
{
if (desk->deskshow_toggle)
if (ec->deskshow)
{
if (bd->deskshow)
{
bd->deskshow = 0;
e_border_uniconify(bd);
}
}
else
{
if (bd->iconic) continue;
if (bd->client.netwm.state.skip_taskbar) continue;
if (bd->user_skip_winlist) continue;
bd->deskshow = 1;
e_border_iconify(bd);
ec->deskshow = 0;
e_client_uniconify(ec);
}
}
else
{
if (ec->iconic) continue;
if (ec->netwm.state.skip_taskbar) continue;
if (ec->user_skip_winlist) continue;
ec->deskshow = 1;
e_client_iconify(ec);
}
}
desk->deskshow_toggle = desk->deskshow_toggle ? 0 : 1;
e_container_border_list_free(bl);
desk->deskshow_toggle = !desk->deskshow_toggle;
ev = E_NEW(E_Event_Desk_Show, 1);
ev->desk = desk;
e_object_ref(E_OBJECT(desk));
@ -370,41 +359,43 @@ e_desk_deskshow(E_Zone *zone)
_e_desk_event_desk_deskshow_free, NULL);
}
EAPI E_Border *
EAPI E_Client *
e_desk_last_focused_focus(E_Desk *desk)
{
Eina_List *l = NULL;
E_Border *bd, *bds = NULL;
E_Client *ec, *ecs = NULL;
EINA_LIST_FOREACH(e_border_focus_stack_get(), l, bd)
EINA_LIST_FOREACH(e_client_focus_stack_get(), l, ec)
{
if ((!bd->iconic) && (bd->visible) &&
((bd->desk == desk) || ((bd->zone == desk->zone) && bd->sticky)) &&
(bd->client.icccm.accepts_focus || bd->client.icccm.take_focus) &&
(bd->client.netwm.type != ECORE_X_WINDOW_TYPE_DOCK) &&
(bd->client.netwm.type != ECORE_X_WINDOW_TYPE_TOOLBAR) &&
(bd->client.netwm.type != ECORE_X_WINDOW_TYPE_MENU) &&
(bd->client.netwm.type != ECORE_X_WINDOW_TYPE_SPLASH) &&
(bd->client.netwm.type != ECORE_X_WINDOW_TYPE_DESKTOP))
if ((!ec->iconic) && (ec->visible) &&
((ec->desk == desk) || ((ec->zone == desk->zone) && ec->sticky)) &&
(ec->icccm.accepts_focus || ec->icccm.take_focus) &&
(ec->netwm.type != E_WINDOW_TYPE_DOCK) &&
(ec->netwm.type != E_WINDOW_TYPE_TOOLBAR) &&
(ec->netwm.type != E_WINDOW_TYPE_MENU) &&
(ec->netwm.type != E_WINDOW_TYPE_SPLASH) &&
(ec->netwm.type != E_WINDOW_TYPE_DESKTOP))
{
/* this was the window last focused in this desktop */
if (!bd->lock_focus_out)
if (!ec->lock_focus_out)
{
if (bd->sticky)
if (ec->sticky)
{
bds = bd;
ecs = ec;
continue;
}
e_border_focus_set_with_pointer(bd);
return bd;
e_client_focus_set_with_pointer(ec);
return ec;
}
}
}
if (bds)
if (ecs)
{
e_border_focus_set_with_pointer(bds);
return bds;
e_client_focus_set_with_pointer(ecs);
return ecs;
}
if (e_client_focused_get())
evas_object_focus_set(e_client_focused_get()->frame, 0);
return NULL;
}
@ -532,7 +523,6 @@ e_desk_prev(E_Zone *zone)
e_desk_show(e_desk_at_xy_get(zone, x, y));
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
EAPI void
e_desk_window_profile_set(E_Desk *desk,
const char *profile)
@ -552,7 +542,7 @@ e_desk_window_profile_set(E_Desk *desk,
}
EAPI void
e_desk_window_profile_add(int container,
e_desk_window_profile_add(int manager,
int zone,
int desk_x,
int desk_y,
@ -560,20 +550,19 @@ e_desk_window_profile_add(int container,
{
E_Config_Desktop_Window_Profile *cfprof;
e_desk_window_profile_del(container, zone, desk_x, desk_y);
e_desk_window_profile_del(manager, zone, desk_x, desk_y);
cfprof = E_NEW(E_Config_Desktop_Window_Profile, 1);
cfprof->container = container;
cfprof->manager = manager;
cfprof->zone = zone;
cfprof->desk_x = desk_x;
cfprof->desk_y = desk_y;
if (profile) cfprof->profile = eina_stringshare_add(profile);
else cfprof->profile = NULL;
cfprof->profile = eina_stringshare_add(profile);
e_config->desktop_window_profiles = eina_list_append(e_config->desktop_window_profiles, cfprof);
}
EAPI void
e_desk_window_profile_del(int container,
e_desk_window_profile_del(int manager,
int zone,
int desk_x,
int desk_y)
@ -583,7 +572,7 @@ e_desk_window_profile_del(int container,
EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
{
if (!((cfprof->container == container) &&
if (!((cfprof->manager == manager) &&
(cfprof->zone == zone) &&
(cfprof->desk_x == desk_x) &&
(cfprof->desk_y == desk_y)))
@ -591,8 +580,8 @@ e_desk_window_profile_del(int container,
e_config->desktop_window_profiles =
eina_list_remove_list(e_config->desktop_window_profiles, l);
if (cfprof->profile) eina_stringshare_del(cfprof->profile);
E_FREE(cfprof);
eina_stringshare_del(cfprof->profile);
free(cfprof);
break;
}
}
@ -600,9 +589,8 @@ e_desk_window_profile_del(int container,
EAPI void
e_desk_window_profile_update(void)
{
Eina_List *m, *c, *z, *l;
E_Manager *man;
E_Container *con;
const Eina_List *z, *l;
E_Comp *c;
E_Zone *zone;
E_Desk *desk;
E_Config_Desktop_Window_Profile *cfprof;
@ -613,37 +601,34 @@ e_desk_window_profile_update(void)
if (!(e_config->use_desktop_window_profile))
return;
EINA_LIST_FOREACH(e_manager_list(), m, man)
EINA_LIST_FOREACH(e_comp_list(), l, c)
{
EINA_LIST_FOREACH(man->containers, c, con)
EINA_LIST_FOREACH(c->zones, z, zone)
{
EINA_LIST_FOREACH(con->zones, z, zone)
for (d_x = 0; d_x < zone->desk_x_count; d_x++)
{
for (d_x = 0; d_x < zone->desk_x_count; d_x++)
for (d_y = 0; d_y < zone->desk_y_count; d_y++)
{
for (d_y = 0; d_y < zone->desk_y_count; d_y++)
desk = zone->desks[d_x + zone->desk_x_count * d_y];
ok = 0;
EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
{
desk = zone->desks[d_x + zone->desk_x_count * d_y];
ok = 0;
if ((cfprof->manager >= 0) &&
((int)c->num != cfprof->manager)) continue;
if ((cfprof->zone >= 0) &&
((int)zone->num != cfprof->zone)) continue;
if ((cfprof->desk_x != d_x) ||
(cfprof->desk_y != d_y)) continue;
e_desk_window_profile_set(desk, cfprof->profile);
ok = 1;
break;
}
EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
{
if ((cfprof->container >= 0) &&
((int)con->num != cfprof->container)) continue;
if ((cfprof->zone >= 0) &&
((int)zone->num != cfprof->zone)) continue;
if ((cfprof->desk_x != d_x) ||
(cfprof->desk_y != d_y)) continue;
e_desk_window_profile_set(desk, cfprof->profile);
ok = 1;
break;
}
if (!ok)
{
e_desk_window_profile_set
(desk, e_config->desktop_default_window_profile);
}
if (!ok)
{
e_desk_window_profile_set
(desk, e_config->desktop_default_window_profile);
}
}
}
@ -651,8 +636,6 @@ e_desk_window_profile_update(void)
}
}
#endif
static void
_e_desk_free(E_Desk *desk)
{
@ -704,34 +687,28 @@ _e_desk_event_desk_deskshow_free(void *data __UNUSED__, void *event)
static void
_e_desk_event_desk_name_change_free(void *data __UNUSED__, void *event)
{
E_Event_Desk_Name_Change *ev;
ev = event;
E_Event_Desk_Name_Change *ev = event;
e_object_unref(E_OBJECT(ev->desk));
free(ev);
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
static void
_e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, void *event)
{
E_Event_Desk_Window_Profile_Change *ev;
ev = event;
E_Event_Desk_Window_Profile_Change *ev = event;
e_object_unref(E_OBJECT(ev->desk));
E_FREE(ev);
}
#endif
static Eina_Bool
_e_desk_transition_setup(E_Border *bd, int dx, int dy, int state)
_e_desk_transition_setup(E_Client *ec, int dx, int dy, int state)
{
e_comp_win_effect_set(bd->cw, e_config->desk_flip_animate_type ?: "none");
e_comp_object_effect_set(ec->frame, e_config->desk_flip_animate_type ?: "none");
if (e_config->desk_flip_animate_type)
{
/* set geoms */
e_comp_win_effect_params_set(bd->cw, 1, (int[]){bd->x - bd->zone->x, bd->y - bd->zone->y, bd->w, bd->h, bd->zone->w, bd->zone->h, dx, dy}, 8);
e_comp_win_effect_params_set(bd->cw, 0, (int[]){state}, 1);
e_comp_object_effect_params_set(ec->frame, 1, (int[]){ec->x - ec->zone->x, ec->y - ec->zone->y, ec->w, ec->h, ec->zone->w, ec->zone->h, dx, dy}, 8);
e_comp_object_effect_params_set(ec->frame, 0, (int[]){state}, 1);
}
return !!e_config->desk_flip_animate_type;
@ -741,6 +718,7 @@ static void
_e_desk_show_end_serious(E_Desk *desk)
{
E_Event_Desk_After_Show *ev;
E_Client *ec;
ev = E_NEW(E_Event_Desk_After_Show, 1);
ev->desk = desk;
@ -752,49 +730,61 @@ _e_desk_show_end_serious(E_Desk *desk)
if ((e_config->focus_policy == E_FOCUS_MOUSE) ||
(e_config->focus_policy == E_FOCUS_SLOPPY))
{
E_Border *bd;
bd = e_border_focused_get();
ec = e_client_focused_get();
/* only set focus/warp pointer if currently focused window
* is on same screen (user hasn't switched screens during transition)
*/
if (bd && bd->desk && (bd->desk->zone != desk->zone))
if (ec && ec->desk && (ec->desk->zone != desk->zone))
return;
}
e_desk_last_focused_focus(desk);
if (starting) return;
ec = e_desk_last_focused_focus(desk);
if ((e_config->focus_policy != E_FOCUS_MOUSE) && (!ec))
{
/* we didn't previously have a focused window on this desk
* but we should, so this is probably the first time the
* user has flipped to this desk. let's be helpful and
* focus a random window!
*/
E_CLIENT_REVERSE_FOREACH(e_comp_get(desk), ec)
{
/* start with top and go down... */
if (e_client_util_ignored_get(ec)) continue;
if (!e_client_util_desk_visible(ec, desk)) continue;
evas_object_focus_set(ec->frame, 1);
break;
}
}
}
static void
_e_desk_show_end(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
E_Border *bd = data;
E_Client *ec = data;
bd->desk->animate_count--;
e_border_comp_hidden_set(bd, bd->shaded);
if (bd->desk != e_desk_current_get(bd->zone)) return;
e_comp_win_effect_unclip(bd->cw);
if (!bd->visible) e_border_show(bd);
if (bd->desk->animate_count) return;
_e_desk_show_end_serious(bd->desk);
ec->desk->animate_count--;
e_client_comp_hidden_set(ec, ec->shaded);
e_comp_object_effect_unclip(ec->frame);
ec->hidden = 0;
if (!ec->visible) evas_object_show(ec->frame);
if (ec->desk != e_desk_current_get(ec->zone)) return;
if (!ec->desk->animate_count) _e_desk_show_end_serious(ec->desk);
}
static void
_e_desk_hide_end(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
E_Border *bd = data;
E_Client *ec = data;
bd->desk->animate_count--;
e_border_comp_hidden_set(bd, bd->shaded);
e_border_hide(bd, 2);
if (bd->desk->animate_count) return;
ecore_x_window_shadow_tree_flush();
ec->desk->animate_count--;
ec->hidden = 1;
evas_object_hide(ec->frame);
}
static void
_e_desk_show_begin(E_Desk *desk, int dx, int dy)
{
E_Border_List *bl;
E_Border *bd;
E_Client *ec;
if (dx < 0) dx = -1;
if (dx > 0) dx = 1;
@ -802,36 +792,38 @@ _e_desk_show_begin(E_Desk *desk, int dx, int dy)
if (dy > 0) dy = 1;
desk->animate_count = 0;
bl = e_container_border_list_first(desk->zone->container);
while ((bd = e_container_border_list_next(bl)))
E_CLIENT_FOREACH(desk->zone->comp, ec)
{
if ((bd->desk->zone != desk->zone) || (bd->iconic)) continue;
if (bd->moving)
if ((ec->desk->zone != desk->zone) || (ec->iconic) || e_client_util_ignored_get(ec)) continue;
if (ec->moving)
{
e_border_desk_set(bd, desk);
e_border_show(bd);
e_client_desk_set(ec, desk);
evas_object_show(ec->frame);
continue;
}
if ((bd->desk != desk) || (bd->sticky)) continue;
if (_e_desk_transition_setup(bd, dx, dy, 1))
if ((ec->desk != desk) || (ec->sticky)) continue;
if (starting)
ec->hidden = 0;
else if (_e_desk_transition_setup(ec, dx, dy, 1))
{
e_comp_win_effect_stop(bd->cw, _e_desk_hide_end);
e_comp_win_effect_start(bd->cw, _e_desk_show_end, bd);
e_comp_object_effect_stop(ec->frame, _e_desk_hide_end);
e_comp_object_effect_start(ec->frame, _e_desk_show_end, ec);
desk->animate_count++;
e_border_comp_hidden_set(bd, EINA_TRUE);
}
e_border_show(bd);
else
ec->hidden = 0;
e_client_comp_hidden_set(ec, ec->hidden);
evas_object_show(ec->frame);
}
if ((!e_config->desk_flip_animate_type) || (!desk->animate_count))
_e_desk_show_end_serious(desk);
e_container_border_list_free(bl);
}
static void
_e_desk_hide_begin(E_Desk *desk, int dx, int dy)
{
E_Border_List *bl;
E_Border *bd;
E_Client *ec;
if (dx < 0) dx = -1;
if (dx > 0) dx = 1;
@ -839,28 +831,26 @@ _e_desk_hide_begin(E_Desk *desk, int dx, int dy)
if (dy > 0) dy = 1;
desk->animate_count = 0;
bl = e_container_border_list_first(desk->zone->container);
while ((bd = e_container_border_list_next(bl)))
E_CLIENT_FOREACH(desk->zone->comp, ec)
{
if ((bd->desk->zone != desk->zone) || (bd->iconic)) continue;
if (bd->moving) continue;
if ((bd->desk != desk) || (bd->sticky)) continue;
if (_e_desk_transition_setup(bd, -dx, -dy, 0))
if ((ec->desk->zone != desk->zone) || (ec->iconic) || e_client_util_ignored_get(ec)) continue;
if (ec->moving) continue;
if ((ec->desk != desk) || (ec->sticky)) continue;
if ((!starting) && _e_desk_transition_setup(ec, -dx, -dy, 0))
{
e_comp_win_effect_stop(bd->cw, _e_desk_show_end);
e_comp_win_effect_start(bd->cw, _e_desk_hide_end, bd);
e_comp_object_effect_stop(ec->frame, _e_desk_show_end);
e_comp_object_effect_start(ec->frame, _e_desk_hide_end, ec);
desk->animate_count++;
e_border_comp_hidden_set(bd, EINA_TRUE);
}
else
e_border_hide(bd, 2);
{
ec->hidden = 1;
evas_object_hide(ec->frame);
}
e_client_comp_hidden_set(ec, EINA_TRUE);
}
if (!e_config->desk_flip_animate_type)
ecore_x_window_shadow_tree_flush();
e_container_border_list_free(bl);
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
static void
_e_desk_window_profile_change_protocol_set(void)
{
@ -868,10 +858,5 @@ _e_desk_window_profile_change_protocol_set(void)
E_Manager *man;
EINA_LIST_FOREACH(e_manager_list(), l, man)
{
ecore_x_e_window_profile_supported_set
(man->root, e_config->use_desktop_window_profile);
}
ecore_x_e_window_profile_supported_set(man->root, e_config->use_desktop_window_profile);
}
#endif

View File

@ -30,7 +30,7 @@ struct _E_Desk
int x, y;
unsigned char visible : 1;
unsigned int deskshow_toggle : 1;
int fullscreen_borders;
Eina_List *fullscreen_clients;
Evas_Object *bg_object;
@ -66,12 +66,12 @@ EINTERN int e_desk_init(void);
EINTERN int e_desk_shutdown(void);
EAPI E_Desk *e_desk_new(E_Zone *zone, int x, int y);
EAPI void e_desk_name_set(E_Desk *desk, const char *name);
EAPI void e_desk_name_add(int container, int zone, int desk_x, int desk_y, const char *name);
EAPI void e_desk_name_del(int container, int zone, int desk_x, int desk_y);
EAPI void e_desk_name_add(int manager, int zone, int desk_x, int desk_y, const char *name);
EAPI void e_desk_name_del(int manager, int zone, int desk_x, int desk_y);
EAPI void e_desk_name_update(void);
EAPI void e_desk_show(E_Desk *desk);
EAPI void e_desk_deskshow(E_Zone *zone);
EAPI E_Border *e_desk_last_focused_focus(E_Desk *desk);
EAPI E_Client *e_desk_last_focused_focus(E_Desk *desk);
EAPI E_Desk *e_desk_current_get(E_Zone *zone);
EAPI E_Desk *e_desk_at_xy_get(E_Zone *zone, int x, int y);
EAPI E_Desk *e_desk_at_pos_get(E_Zone *zone, int pos);
@ -82,21 +82,17 @@ EAPI void e_desk_row_add(E_Zone *zone);
EAPI void e_desk_row_remove(E_Zone *zone);
EAPI void e_desk_col_add(E_Zone *zone);
EAPI void e_desk_col_remove(E_Zone *zone);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
EAPI void e_desk_window_profile_set(E_Desk *desk, const char *profile);
EAPI void e_desk_window_profile_add(int container, int zone, int desk_x, int desk_y, const char *profile);
EAPI void e_desk_window_profile_del(int container, int zone, int desk_x, int desk_y);
EAPI void e_desk_window_profile_add(int manager, int zone, int desk_x, int desk_y, const char *profile);
EAPI void e_desk_window_profile_del(int manager, int zone, int desk_x, int desk_y);
EAPI void e_desk_window_profile_update(void);
#endif
extern EAPI int E_EVENT_DESK_SHOW;
extern EAPI int E_EVENT_DESK_BEFORE_SHOW;
extern EAPI int E_EVENT_DESK_AFTER_SHOW;
extern EAPI int E_EVENT_DESK_DESKSHOW;
extern EAPI int E_EVENT_DESK_NAME_CHANGE;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
extern EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE;
#endif
#endif
#endif

View File

@ -22,6 +22,7 @@ typedef struct _E_Desklock_Run E_Desklock_Run;
struct _E_Desklock_Popup_Data
{
E_Zone *zone;
Evas_Object *comp_object;
Evas_Object *bg_object;
Evas_Object *login_box;
};
@ -183,7 +184,7 @@ _user_wallpaper_get(E_Zone *zone)
desk = e_desk_current_get(zone);
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cdbg)
{
if ((cdbg->container > -1) && (cdbg->container != (int)zone->container->num)) continue;
if ((cdbg->manager > -1) && (cdbg->manager != (int)zone->comp->num)) continue;
if ((cdbg->zone > -1) && (cdbg->zone != (int)zone->num)) continue;
if ((cdbg->desk_x > -1) && (cdbg->desk_x != desk->x)) continue;
if ((cdbg->desk_y > -1) && (cdbg->desk_y != desk->y)) continue;
@ -207,7 +208,7 @@ e_desklock_show_autolocked(void)
EAPI int
e_desklock_show(Eina_Bool suspend)
{
Eina_List *managers, *l, *l2, *l3;
Eina_List *managers, *l, *l3;
E_Manager *man;
int total_zone_num;
E_Event_Desklock *ev;
@ -251,7 +252,7 @@ e_desklock_show(Eina_Bool suspend)
zone = e_util_zone_current_get(e_manager_current_get());
if (zone)
e_configure_registry_call("screen/screen_lock", zone->container, NULL);
e_configure_registry_call("screen/screen_lock", zone->comp, NULL);
return 0;
}
#ifdef HAVE_PAM
@ -310,7 +311,7 @@ e_desklock_show(Eina_Bool suspend)
works:
//e_comp_block_window_add();
E_LIST_FOREACH(e_comp_list(), e_comp_override_add);
e_comp_ignore_win_add(edd->elock_wnd);
e_comp_ignore_win_add(E_PIXMAP_TYPE_X, edd->elock_wnd);
if (e_config->desklock_language)
e_intl_language_set(e_config->desklock_language);
@ -320,14 +321,9 @@ works:
total_zone_num = _e_desklock_zone_num_get();
EINA_LIST_FOREACH(managers, l, man)
{
E_Container *con;
EINA_LIST_FOREACH(man->containers, l2, con)
{
E_Zone *zone;
EINA_LIST_FOREACH(con->zones, l3, zone)
_e_desklock_popup_add(zone);
}
E_Zone *zone;
EINA_LIST_FOREACH(man->comp->zones, l3, zone)
_e_desklock_popup_add(zone);
}
/* handlers */
@ -476,8 +472,9 @@ _e_desklock_popup_add(E_Zone *zone)
evas_object_move(edp->bg_object, zone->x, zone->y);
evas_object_resize(edp->bg_object, zone->w, zone->h);
evas_object_show(edp->bg_object);
E_LAYER_SET_ABOVE(edp->bg_object, E_COMP_CANVAS_LAYER_DESKLOCK);
evas_object_clip_set(edp->bg_object, edp->zone->bg_clip_object);
edp->comp_object = e_comp_object_util_add(edp->bg_object, 0);
evas_object_layer_set(edp->comp_object, E_LAYER_DESKLOCK);
evas_object_clip_set(edp->comp_object, edp->zone->bg_clip_object);
_e_desklock_login_box_add(edp);
evas_event_thaw(evas);
@ -521,11 +518,10 @@ _e_desklock_login_box_add(E_Desklock_Popup_Data *edp)
else
{
evas_object_resize(edp->login_box, mw, mh);
evas_object_move(edp->login_box,
zone->x + ((zone->w - mw) / 2),
zone->y + ((zone->h - mh) / 2));
e_comp_object_util_center_on(edp->login_box, edp->comp_object);
evas_object_show(edp->login_box);
E_LAYER_SET_ABOVE(edp->login_box, E_COMP_CANVAS_LAYER_DESKLOCK);
evas_object_layer_set(edp->login_box, E_LAYER_DESKLOCK);
evas_object_stack_above(edp->login_box, edp->comp_object);
}
evas_object_clip_set(edp->login_box, edp->zone->bg_clip_object);
@ -536,6 +532,8 @@ _e_desklock_popup_free(E_Desklock_Popup_Data *edp)
{
if (!edp) return;
evas_object_hide(edp->comp_object);
evas_object_del(edp->comp_object);
evas_object_del(edp->bg_object);
evas_object_del(edp->login_box);
@ -580,7 +578,7 @@ _e_desklock_cb_zone_del(void *data __UNUSED__,
E_Event_Zone_Del *ev = event;
Eina_List *l;
if (!edd) return ECORE_CALLBACK_PASS_ON;
if ((eina_list_count(e_container_current_get(e_manager_current_get())->zones) == 1) && (e_config->desklock_login_box_zone == -2))
if ((eina_list_count(e_util_comp_current_get()->zones) == 1) && (e_config->desklock_login_box_zone == -2))
edd->move_handler = ecore_event_handler_del(edd->move_handler);
l = _e_desklock_popup_find(ev->zone);
@ -605,13 +603,8 @@ _e_desklock_cb_zone_move_resize(void *data __UNUSED__,
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
if (edp->zone == ev->zone)
{
int w, h;
evas_object_resize(edp->bg_object, ev->zone->w, ev->zone->h);
evas_object_geometry_get(edp->login_box, NULL, NULL, &w, &h);
evas_object_move(edp->login_box,
edp->zone->x + ((edp->zone->w - w) / 2),
edp->zone->y + ((edp->zone->h - h) / 2));
e_comp_object_util_center_on(edp->login_box, edp->comp_object);
break;
}
return ECORE_CALLBACK_PASS_ON;
@ -794,16 +787,12 @@ static int
_e_desklock_zone_num_get(void)
{
int num;
Eina_List *l, *l2;
Eina_List *l;
E_Manager *man;
num = 0;
EINA_LIST_FOREACH(e_manager_list(), l, man)
{
E_Container *con;
EINA_LIST_FOREACH(man->containers, l2, con)
num += eina_list_count(con->zones);
}
num += eina_list_count(man->comp->zones);
return num;
}
@ -870,8 +859,6 @@ _e_desklock_state_set(int state)
EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
{
edje_object_signal_emit(edp->login_box, signal_desklock, "e.desklock"); // compat
edje_object_signal_emit(edp->bg_object, signal_desklock, "e.desklock"); // compat
edje_object_signal_emit(edp->login_box, signal_desklock, "e");
edje_object_signal_emit(edp->bg_object, signal_desklock, "e");
edje_object_part_text_set(edp->login_box, "e.text.title", text);
@ -1223,15 +1210,11 @@ _e_desklock_ask_presentation_key_down(void *data, Evas *e __UNUSED__, Evas_Objec
static void
_e_desklock_ask_presentation_mode(void)
{
E_Manager *man;
E_Container *con;
E_Dialog *dia;
if (_e_desklock_ask_presentation_dia) return;
if (!(man = e_manager_current_get())) return;
if (!(con = e_container_current_get(man))) return;
if (!(dia = e_dialog_new(con, "E", "_desklock_ask_presentation"))) return;
if (!(dia = e_dialog_new(NULL, "E", "_desklock_ask_presentation"))) return;
e_dialog_title_set(dia, _("Activate Presentation Mode?"));
e_dialog_icon_set(dia, "dialog-ask", 64);

View File

@ -1,3 +1,5 @@
#warning FIXME
#if 0
#include "e.h"
#define INTERNAL_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if (!sd) return;
@ -406,7 +408,7 @@ _mirror_border_new(Mirror *m)
else
edje_object_signal_emit(mb->frame, "e,state,shadow,off", "e");
edje_object_signal_callback_add(mb->m->cw->bd->bg_object, "*", "*", _mirror_border_signal_cb, mb);
if (e_border_focused_get() == mb->m->cw->bd)
if (e_client_focused_get() == mb->m->cw->bd)
edje_object_signal_emit(mb->frame, "e,state,focused", "e");
if (mb->m->cw->bd->shaded)
edje_object_signal_emit(mb->frame, "e,state,shaded", "e");
@ -625,3 +627,4 @@ e_deskmirror_util_wins_print(Evas_Object *obj)
fprintf(stderr, "MIRROR WIN: %p - %u%s\n", m->cw, m->cw->win, m->cw->input_only ? " INPUT" : "");
}
}
#endif

View File

@ -38,7 +38,7 @@ struct _E_Config_Dialog_Data
/* local subsystem functions */
static int _e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con);
static int _e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Comp *c);
static void _e_desktop_edit_free(E_Desktop_Edit *editor);
static void *_e_desktop_edit_create_data(E_Config_Dialog *cfd);
static void _e_desktop_edit_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
@ -64,18 +64,18 @@ static void _e_desktop_editor_icon_entry_changed(void *data, Evas_Object
/* externally accessible functions */
EAPI Efreet_Desktop *
e_desktop_border_create(E_Border *bd)
e_desktop_client_create(E_Client *ec)
{
Efreet_Desktop *desktop = NULL;
const char *desktop_dir, *icon_dir;
const char *bname, *bclass, *btitle;
char path[PATH_MAX];
bname = bd->client.icccm.name;
bname = ec->icccm.name;
if ((bname) && (bname[0] == 0)) bname = NULL;
bclass = bd->client.icccm.class;
bclass = ec->icccm.class;
if ((bclass) && (bclass[0] == 0)) bclass = NULL;
btitle = e_border_name_get(bd);
btitle = e_client_name_get(ec);
desktop_dir = e_user_desktop_dir_get();
@ -125,15 +125,15 @@ e_desktop_border_create(E_Border *bd)
if (btitle) desktop->comment = strdup(btitle);
if (bclass) desktop->startup_wm_class = strdup(bclass);
if (bd->client.icccm.command.argc > 0)
if (ec->icccm.command.argc > 0)
// FIXME this should concat the entire argv array together
desktop->exec = strdup(bd->client.icccm.command.argv[0]);
desktop->exec = strdup(ec->icccm.command.argv[0]);
else if (bname)
desktop->exec = strdup(bname);
// disable this
// if (bd->client.netwm.startup_id > 0) desktop->startup_notify = 1;
if (bd->client.netwm.icons)
// if (ec->netwm.startup_id > 0) desktop->startup_notify = 1;
if (ec->netwm.icons)
{
/* FIXME
* - Find the icon with the best size
@ -143,7 +143,7 @@ e_desktop_border_create(E_Border *bd)
snprintf(file, sizeof(file), "%s-%.6f.png", bname ?: "", ecore_time_get());
snprintf(path, sizeof(path), "%s/%s", icon_dir, file);
if (e_util_icon_save(&(bd->client.netwm.icons[0]), path))
if (e_util_icon_save(&(ec->netwm.icons[0]), path))
desktop->icon = strdup(file);
else
fprintf(stderr, "Could not save file from ARGB: %s\n", path);
@ -152,22 +152,21 @@ e_desktop_border_create(E_Border *bd)
}
EAPI E_Desktop_Edit *
e_desktop_border_edit(E_Container *con, E_Border *bd)
e_desktop_border_edit(E_Comp *c, E_Client *ec)
{
E_Desktop_Edit *editor;
int new_desktop = 0;
if (!con) return NULL;
editor = E_OBJECT_ALLOC(E_Desktop_Edit, E_DESKTOP_EDIT_TYPE, _e_desktop_edit_free);
if (!editor) return NULL;
if (bd->desktop)
editor->desktop = bd->desktop;
if (ec->desktop)
editor->desktop = ec->desktop;
/* the border does not yet have a desktop entry. add one and pre-populate
it with values from the border */
if (!editor->desktop)
{
editor->desktop = e_desktop_border_create(bd);
editor->desktop = e_desktop_client_create(ec);
if ((editor->desktop) && (editor->desktop->icon))
editor->tmp_image_path = strdup(editor->desktop->icon);
new_desktop = 1;
@ -186,7 +185,7 @@ e_desktop_border_edit(E_Container *con, E_Border *bd)
"change."));
}
#endif
if (!_e_desktop_edit_view_create(editor, con))
if (!_e_desktop_edit_view_create(editor, c))
{
e_object_del(E_OBJECT(editor));
editor = NULL;
@ -198,14 +197,14 @@ e_desktop_border_edit(E_Container *con, E_Border *bd)
}
EAPI E_Desktop_Edit *
e_desktop_edit(E_Container *con, Efreet_Desktop *desktop)
e_desktop_edit(E_Comp *c, Efreet_Desktop *desktop)
{
E_Desktop_Edit *editor;
editor = E_OBJECT_ALLOC(E_Desktop_Edit, E_DESKTOP_EDIT_TYPE, _e_desktop_edit_free);
if (!editor) return NULL;
if (desktop) editor->desktop = desktop;
if (!_e_desktop_edit_view_create(editor, con))
if (!_e_desktop_edit_view_create(editor, c))
{
e_object_del(E_OBJECT(editor));
editor = NULL;
@ -214,7 +213,7 @@ e_desktop_edit(E_Container *con, Efreet_Desktop *desktop)
}
static int
_e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con)
_e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Comp *c)
{
E_Config_Dialog_View *v;
@ -229,7 +228,7 @@ _e_desktop_edit_view_create(E_Desktop_Edit *editor, E_Container *con)
v->basic.check_changed = _e_desktop_edit_basic_check_changed;
editor->cfd =
e_config_dialog_new(con, _("Desktop Entry Editor"), "E",
e_config_dialog_new(c, _("Desktop Entry Editor"), "E",
"applications/new_application",
"preferences-applications", 0, v, editor);
@ -813,7 +812,7 @@ _e_desktop_editor_cb_icon_select(void *data1, void *data2)
if (editor->icon_fsel_dia) return;
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_icon_select_dialog");
dia = e_dialog_new(cfdata->editor->cfd->comp, "E", "_eap_icon_select_dialog");
if (!dia) return;
e_object_del_attach_func_set(E_OBJECT(dia),
_e_desktop_edit_cb_icon_select_destroy);
@ -879,7 +878,7 @@ _e_desktop_editor_cb_exec_select(void *data1, void *data2)
if (editor->exec_fsel_dia) return;
dia = e_dialog_new(cfdata->editor->cfd->con, "E", "_eap_exec_select_dialog");
dia = e_dialog_new(cfdata->editor->cfd->comp, "E", "_eap_exec_select_dialog");
if (!dia) return;
e_object_del_attach_func_set(E_OBJECT(dia),
_e_desktop_edit_cb_exec_select_destroy);

View File

@ -32,9 +32,9 @@ struct _E_Desktop_Edit
E_Config_Dialog *cfd;
};
EAPI Efreet_Desktop *e_desktop_border_create(E_Border *bd);
EAPI E_Desktop_Edit *e_desktop_border_edit(E_Container *con, E_Border *bd);
EAPI E_Desktop_Edit *e_desktop_edit(E_Container *con, Efreet_Desktop *desktop);
EAPI Efreet_Desktop *e_desktop_client_create(E_Client *ec);
EAPI E_Desktop_Edit *e_desktop_border_edit(E_Comp *c, E_Client *ec);
EAPI E_Desktop_Edit *e_desktop_edit(E_Comp *c, Efreet_Desktop *desktop);
#endif
#endif

View File

@ -13,25 +13,17 @@ static void _e_dialog_cb_wid_on_focus(void *data, Evas_Object *obj);
/* externally accessible functions */
static E_Dialog *
_e_dialog_internal_new(E_Container *con, const char *name, const char *class, int dialog)
_e_dialog_internal_new(E_Comp *c, const char *name, const char *class, int dialog)
{
E_Dialog *dia;
E_Manager *man;
Evas_Object *o;
Evas_Modifier_Mask mask;
Eina_Bool kg;
if (!con)
{
man = e_manager_current_get();
if (!man) return NULL;
con = e_container_current_get(man);
if (!con) con = e_container_number_get(man, 0);
if (!con) return NULL;
}
if (!c) c = e_util_comp_current_get();
dia = E_OBJECT_ALLOC(E_Dialog, E_DIALOG_TYPE, _e_dialog_free);
if (!dia) return NULL;
dia->win = e_win_new(con);
dia->win = e_win_new(c);
if (!dia->win)
{
free(dia);
@ -84,15 +76,15 @@ _e_dialog_internal_new(E_Container *con, const char *name, const char *class, in
}
EAPI E_Dialog *
e_dialog_new(E_Container *con, const char *name, const char *class)
e_dialog_new(E_Comp *c, const char *name, const char *class)
{
return _e_dialog_internal_new(con, name, class, 1);
return _e_dialog_internal_new(c, name, class, 1);
}
EAPI E_Dialog *
e_dialog_normal_win_new(E_Container *con, const char *name, const char *class)
e_dialog_normal_win_new(E_Comp *c, const char *name, const char *class)
{
return _e_dialog_internal_new(con, name, class, 0);
return _e_dialog_internal_new(c, name, class, 0);
}
EAPI void
@ -182,17 +174,11 @@ e_dialog_icon_set(E_Dialog *dia, const char *icon, Evas_Coord size)
EAPI void
e_dialog_border_icon_set(E_Dialog *dia, const char *icon)
{
E_Border *border;
E_Client *ec;
border = dia->win->border;
if (!border) return;
if (border->internal_icon)
{
eina_stringshare_del(border->internal_icon);
border->internal_icon = NULL;
}
if (icon)
border->internal_icon = eina_stringshare_add(icon);
ec = dia->win->client;
if (ec)
eina_stringshare_replace(&ec->internal_icon, icon);
}
EAPI void

View File

@ -28,8 +28,8 @@ struct _E_Dialog
typedef void (*E_Dialog_Cb)(void *data, E_Dialog *dia);
EAPI E_Dialog *e_dialog_new (E_Container *con, const char *name, const char *class);
EAPI E_Dialog *e_dialog_normal_win_new (E_Container *con, const char *name, const char *class);
EAPI E_Dialog *e_dialog_new (E_Comp *c, const char *name, const char *class);
EAPI E_Dialog *e_dialog_normal_win_new (E_Comp *c, const char *name, const char *class);
EAPI void e_dialog_parent_set(E_Dialog *dia, E_Win *win);
EAPI void e_dialog_button_add (E_Dialog *dia, const char *label, const char *icon, E_Dialog_Cb func, void *data);
EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button);

View File

@ -49,8 +49,6 @@ static Eina_List *_drag_list = NULL;
static E_Drag *_drag_current = NULL;
static XDnd *_xdnd = NULL;
#define XDS_ATOM "XdndDirectSave0"
static Ecore_X_Atom _xds_atom = 0;
static Ecore_X_Atom _text_atom = 0;
static Eina_Stringshare *_type_text_uri_list = NULL;
@ -103,14 +101,16 @@ _e_drop_handler_active_check(E_Drop_Handler *h, const E_Drag *drag, Eina_Strings
EINTERN int
e_dnd_init(void)
{
E_Comp *c;
const Eina_List *l;
_type_text_uri_list = eina_stringshare_add("text/uri-list");
_type_xds = eina_stringshare_add(XDS_ATOM);
_type_xds = eina_stringshare_add("XdndDirectSave0");
_type_text_x_moz_url = eina_stringshare_add("text/x-moz-url");
_type_enlightenment_x_file = eina_stringshare_add("enlightenment/x-file");
_xds_atom = ecore_x_atom_get(XDS_ATOM);
_text_atom = ecore_x_atom_get("text/plain");
_drop_win_hash = eina_hash_string_superfast_new(NULL);
_drop_win_hash = eina_hash_int32_new(NULL);
_drop_handlers_responsives = eina_hash_string_superfast_new(NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _e_dnd_cb_mouse_up, NULL);
@ -126,6 +126,9 @@ e_dnd_init(void)
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_DOWN, _e_dnd_cb_key_down, NULL);
E_LIST_HANDLER_APPEND(_event_handlers, ECORE_EVENT_KEY_UP, _e_dnd_cb_key_up, NULL);
EINA_LIST_FOREACH(e_comp_list(), l, c)
e_drop_xdnd_register_set(c->ee_win, 1);
_action = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
return 1;
}
@ -152,13 +155,13 @@ e_dnd_shutdown(void)
_type_xds = NULL;
_type_text_x_moz_url = NULL;
_type_enlightenment_x_file = NULL;
_text_atom = _xds_atom = 0;
_text_atom = 0;
return 1;
}
EAPI E_Drag *
e_drag_new(E_Container *container, int x, int y,
e_drag_new(E_Comp *comp, int x, int y,
const char **types, unsigned int num_types,
void *data, int size,
void *(*convert_cb)(E_Drag * drag, const char *type),
@ -177,20 +180,11 @@ e_drag_new(E_Container *container, int x, int y,
drag->y = y;
drag->w = 24;
drag->h = 24;
drag->layer = E_LAYER_DRAG;
drag->container = container;
e_object_ref(E_OBJECT(drag->container));
drag->layer = E_LAYER_CLIENT_DRAG;
drag->comp = comp;
e_object_ref(E_OBJECT(drag->comp));
drag->evas = e_comp_get(drag)->evas;
/* use first zone to preserve location coords */
drag->pop = e_popup_new(eina_list_data_get(container->zones), x, y, drag->w, drag->h);
e_popup_name_set(drag->pop, "E Drag");
e_popup_layer_set(drag->pop, E_COMP_CANVAS_LAYER_POPUP, 0);
e_popup_ignore_events_set(drag->pop, 1);
drag->object = evas_object_rectangle_add(drag->evas);
evas_object_color_set(drag->object, 255, 0, 0, 255);
drag->evas = comp->evas;
drag->type = E_DRAG_NONE;
@ -206,7 +200,7 @@ e_drag_new(E_Container *container, int x, int y,
ecore_x_window_shadow_tree_flush();
_drag_win_root = drag->container->manager->root;
_drag_win_root = drag->comp->man->root;
drag->cb.key_down = NULL;
drag->cb.key_up = NULL;
@ -223,11 +217,17 @@ e_drag_evas_get(const E_Drag *drag)
EAPI void
e_drag_object_set(E_Drag *drag, Evas_Object *object)
{
if (drag->object) evas_object_del(drag->object);
EINA_SAFETY_ON_NULL_RETURN(object);
EINA_SAFETY_ON_TRUE_RETURN(!!drag->object);
if (drag->visible)
evas_object_show(object);
else
evas_object_hide(object);
drag->object = object;
drag->pop->content = NULL;
if (_drag_current == drag)
e_popup_content_set(drag->pop, object);
drag->comp_object = e_comp_object_util_add(object, E_COMP_OBJECT_TYPE_POPUP);
evas_object_layer_set(drag->comp_object, drag->layer);
evas_object_name_set(drag->comp_object, "E Drag");
evas_object_pass_events_set(drag->comp_object, 1);
}
EAPI void
@ -237,7 +237,7 @@ e_drag_move(E_Drag *drag, int x, int y)
drag->x = x;
drag->y = y;
if (_drag_current == drag)
e_popup_move(drag->pop, x, y);
evas_object_move(drag->comp_object, x, y);
}
EAPI void
@ -247,7 +247,7 @@ e_drag_resize(E_Drag *drag, int w, int h)
drag->h = h;
drag->w = w;
if (_drag_current == drag)
e_popup_resize(drag->pop, w, h);
evas_object_resize(drag->comp_object, w, h);
}
EAPI int
@ -263,18 +263,23 @@ e_drag_start(E_Drag *drag, int x, int y)
E_Drop_Handler *h;
if (_drag_win) return 0;
_drag_win = ecore_x_window_input_new(drag->container->win,
drag->container->x, drag->container->y,
drag->container->w, drag->container->h);
_drag_win_root = drag->container->manager->root;
_drag_win = ecore_x_window_input_new(drag->comp->win,
drag->comp->man->x, drag->comp->man->y,
drag->comp->man->w, drag->comp->man->h);
_drag_win_root = drag->comp->man->root;
ecore_x_window_show(_drag_win);
if (!e_grabinput_get(_drag_win, 1, _drag_win))
{
ecore_x_window_free(_drag_win);
return 0;
}
e_popup_move_resize(drag->pop, drag->x, drag->y, drag->w, drag->h);
e_popup_content_set(drag->pop, drag->object);
if (!drag->object)
{
e_drag_object_set(drag, evas_object_rectangle_add(drag->evas));
evas_object_color_set(drag->object, 255, 0, 0, 255);
}
evas_object_move(drag->comp_object, drag->x, drag->y);
evas_object_resize(drag->comp_object, drag->w, drag->h);
drag->visible = 1;
drag->type = E_DRAG_INTERNAL;
@ -315,9 +320,9 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
E_Drop_Handler *h;
if (_drag_win) return 0;
_drag_win = ecore_x_window_input_new(drag->container->win,
drag->container->x, drag->container->y,
drag->container->w, drag->container->h);
_drag_win = ecore_x_window_input_new(drag->comp->win,
drag->comp->man->x, drag->comp->man->y,
drag->comp->man->w, drag->comp->man->h);
ecore_x_window_show(_drag_win);
if (!e_grabinput_get(_drag_win, 1, _drag_win))
@ -325,8 +330,13 @@ e_drag_xdnd_start(E_Drag *drag, int x, int y)
ecore_x_window_free(_drag_win);
return 0;
}
e_popup_move_resize(drag->pop, drag->x, drag->y, drag->w, drag->h);
e_popup_content_set(drag->pop, drag->object);
if (!drag->object)
{
e_drag_object_set(drag, evas_object_rectangle_add(drag->evas));
evas_object_color_set(drag->object, 255, 0, 0, 255);
}
evas_object_move(drag->comp_object, drag->x, drag->y);
evas_object_resize(drag->comp_object, drag->w, drag->h);
drag->visible = 1;
drag->type = E_DRAG_XDND;
@ -380,7 +390,7 @@ e_drop_xds_update(Eina_Bool enable, const char *value)
xwin = ecore_x_selection_owner_get(ECORE_X_ATOM_SELECTION_XDND);
if (enable)
{
if (!ecore_x_window_prop_property_get(xwin, _xds_atom, _text_atom, 8, (unsigned char **)&file, &size))
if (!ecore_x_window_prop_property_get(xwin, ECORE_X_ATOM_XDND_DIRECTSAVE0, _text_atom, 8, (unsigned char **)&file, &size))
return;
len = strlen(value);
if (size + len + 8 + 1 > sizeof(buf))
@ -391,10 +401,10 @@ e_drop_xds_update(Eina_Bool enable, const char *value)
snprintf(buf, sizeof(buf), "file://%s/", value);
strncat(buf, file, size);
free(file);
ecore_x_window_prop_property_set(xwin, _xds_atom, _text_atom, 8, (void *)buf, size + len + 8);
ecore_x_window_prop_property_set(xwin, ECORE_X_ATOM_XDND_DIRECTSAVE0, _text_atom, 8, (void *)buf, size + len + 8);
}
else
ecore_x_window_prop_property_del(xwin, _xds_atom);
ecore_x_window_prop_property_del(xwin, ECORE_X_ATOM_XDND_DIRECTSAVE0);
}
EAPI E_Drop_Handler *
@ -473,21 +483,18 @@ e_drop_handler_del(E_Drop_Handler *handler)
EAPI int
e_drop_xdnd_register_set(Ecore_X_Window win, int reg)
{
const char *id;
id = e_util_winid_str_get(win);
if (reg)
{
if (!eina_hash_find(_drop_win_hash, id))
if (!eina_hash_find(_drop_win_hash, &win))
{
ecore_x_dnd_aware_set(win, 1);
eina_hash_add(_drop_win_hash, id, (void *)1);
eina_hash_add(_drop_win_hash, &win, (void *)1);
}
}
else
{
ecore_x_dnd_aware_set(win, 0);
eina_hash_del(_drop_win_hash, id, (void *)1);
eina_hash_del(_drop_win_hash, &win, (void *)1);
}
return 1;
}
@ -597,12 +604,12 @@ _e_drag_move(E_Drag *drag, int x, int y)
if (((drag->x + drag->dx) == x) && ((drag->y + drag->dy) == y)) return;
zone = e_container_zone_at_point_get(drag->container, x, y);
zone = e_comp_zone_xy_get(drag->comp, x, y);
if (zone) e_zone_flip_coords_handle(zone, x, y);
drag->x = x - drag->dx;
drag->y = y - drag->dy;
e_popup_move(drag->pop, drag->x, drag->y);
evas_object_move(drag->comp_object, drag->x, drag->y);
}
static void
@ -634,25 +641,20 @@ _e_drag_coords_update(const E_Drop_Handler *h, int *dx, int *dy)
break;
case E_WIN_TYPE:
px = ((E_Win *)(h->obj))->border->x;
py = ((E_Win *)(h->obj))->border->y;
px = ((E_Win *)(h->obj))->client->x;
py = ((E_Win *)(h->obj))->client->y;
break;
case E_ZONE_TYPE:
// zone based drag targets are in a container thus their coords should be
// zone based drag targets are in a comp thus their coords should be
// screen-relative as containers just cover the screen
// px = ((E_Zone *)(h->obj))->x;
// py = ((E_Zone *)(h->obj))->y;
break;
case E_BORDER_TYPE:
px = ((E_Border *)(h->obj))->x;
py = ((E_Border *)(h->obj))->y;
break;
case E_POPUP_TYPE:
px = ((E_Popup *)(h->obj))->x;
py = ((E_Popup *)(h->obj))->y;
case E_CLIENT_TYPE:
px = ((E_Client *)(h->obj))->x;
py = ((E_Client *)(h->obj))->y;
break;
/* FIXME: add more types as needed */
@ -671,25 +673,17 @@ _e_drag_win_get(const E_Drop_Handler *h, int xdnd)
if (h->obj)
{
E_Gadcon *gc = NULL;
switch (h->obj->type)
{
E_Gadcon *gc;
case E_GADCON_TYPE:
gc = (E_Gadcon *)h->obj;
if (gc->toolbar) hwin = gc->toolbar->fwin->border->win; //double check for xdnd...
else
{
if (xdnd) hwin = e_gadcon_xdnd_window_get(gc);
else hwin = e_gadcon_dnd_window_get(gc);
}
break;
case E_GADCON_CLIENT_TYPE:
gc = ((E_Gadcon_Client *)(h->obj))->gadcon;
if (!gc) return 0;
case E_GADCON_TYPE:
if (!gc) gc = (E_Gadcon *)h->obj;
if (gc->toolbar) hwin = gc->toolbar->fwin->border->win; //double check for xdnd...
if (gc->toolbar) hwin = e_client_util_pwin_get(gc->toolbar->fwin->client); //double check for xdnd...
else
{
if (xdnd) hwin = e_gadcon_xdnd_window_get(gc);
@ -701,9 +695,8 @@ _e_drag_win_get(const E_Drop_Handler *h, int xdnd)
hwin = ((E_Win *)(h->obj))->evas_win;
break;
case E_BORDER_TYPE:
case E_CLIENT_TYPE:
case E_ZONE_TYPE:
case E_POPUP_TYPE:
hwin = e_comp_get(h->obj)->ee_win;
break;
@ -812,18 +805,14 @@ _e_drag_update(Ecore_X_Window root, int x, int y, Ecore_X_Atom action)
// double t1 = ecore_time_get(); ////
if (_drag_current && !_xdnd)
{
Ecore_X_Window ignore[1];
ignore[0] = _drag_win;
win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y, 1, ignore, 1);
}
win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y);
else
win = root;
if (_drag_current)
{
if (_drag_current->visible) e_popup_show(_drag_current->pop);
else e_popup_hide(_drag_current->pop);
if (_drag_current->visible) evas_object_show(_drag_current->comp_object);
else evas_object_hide(_drag_current->comp_object);
_e_drag_move(_drag_current, x, y);
}
EINA_LIST_FOREACH(_active_handlers, l, h)
@ -937,16 +926,14 @@ _e_drag_end(int x, int y)
Ecore_X_Window win;
E_Drop_Handler *h;
int dropped;
Ecore_X_Window ignore[1];
if (!_drag_current) return;
ignore[0] = _drag_win;
win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y, 1, ignore, 1);
zone = e_container_zone_at_point_get(_drag_current->container, x, y);
win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y);
zone = e_comp_zone_xy_get(_drag_current->comp, x, y);
/* Pass -1, -1, so that it is possible to drop at the edge. */
if (zone) e_zone_flip_coords_handle(zone, -1, -1);
e_popup_hide(_drag_current->pop);
evas_object_hide(_drag_current->comp_object);
e_grabinput_release(_drag_win, _drag_win);
while (_drag_current->type == E_DRAG_XDND)
@ -1105,8 +1092,9 @@ _e_drag_free(E_Drag *drag)
_drag_list = eina_list_remove(_drag_list, drag);
e_object_unref(E_OBJECT(drag->container));
E_FREE_FUNC(drag->pop, e_object_del);
e_object_unref(E_OBJECT(drag->comp));
evas_object_hide(drag->comp_object);
E_FREE_FUNC(drag->comp_object, evas_object_del);
for (i = 0; i < drag->num_types; i++)
eina_stringshare_del(drag->types[i]);
free(drag);
@ -1176,12 +1164,10 @@ _e_dnd_cb_event_dnd_enter(void *data __UNUSED__, int type __UNUSED__, void *even
{
Ecore_X_Event_Xdnd_Enter *ev = event;
E_Drop_Handler *h;
const char *id;
const Eina_List *l;
int i;
id = e_util_winid_str_get(ev->win);
if (!eina_hash_find(_drop_win_hash, id)) return ECORE_CALLBACK_PASS_ON;
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
EINA_LIST_FREE(_active_handlers, h)
{
@ -1214,11 +1200,9 @@ _e_dnd_cb_event_dnd_leave(void *data __UNUSED__, int type __UNUSED__, void *even
{
Ecore_X_Event_Xdnd_Leave *ev = event;
E_Event_Dnd_Leave leave_ev;
const char *id;
const Eina_List *l;
id = e_util_winid_str_get(ev->win);
if (!eina_hash_find(_drop_win_hash, id)) return ECORE_CALLBACK_PASS_ON;
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
leave_ev.x = 0;
leave_ev.y = 0;
@ -1285,12 +1269,10 @@ _e_dnd_cb_event_dnd_position(void *data __UNUSED__, int type __UNUSED__, void *e
{
Ecore_X_Event_Xdnd_Position *ev = event;
Ecore_X_Rectangle rect;
const char *id;
int responsive;
// double t1 = ecore_time_get(); ////
id = e_util_winid_str_get(ev->win);
if (!eina_hash_find(_drop_win_hash, id))
if (!eina_hash_find(_drop_win_hash, &ev->win))
{
// double t2 = ecore_time_get() - t1; ////
// printf("DND POS EV 1 %3.7f\n", t2); ////
@ -1351,10 +1333,8 @@ static Eina_Bool
_e_dnd_cb_event_dnd_drop(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_X_Event_Xdnd_Drop *ev = event;
const char *id;
id = e_util_winid_str_get(ev->win);
if (!eina_hash_find(_drop_win_hash, id)) return ECORE_CALLBACK_PASS_ON;
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
if (_xdnd)
{
@ -1389,11 +1369,9 @@ static Eina_Bool
_e_dnd_cb_event_dnd_selection(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_X_Event_Selection_Notify *ev = event;
const char *id;
int i;
id = e_util_winid_str_get(ev->win);
if (!eina_hash_find(_drop_win_hash, id)) return ECORE_CALLBACK_PASS_ON;
if (!eina_hash_find(_drop_win_hash, &ev->win)) return ECORE_CALLBACK_PASS_ON;
if (ev->selection != ECORE_X_SELECTION_XDND) return ECORE_CALLBACK_PASS_ON;
if (!_xdnd)

View File

@ -38,9 +38,9 @@ struct _E_Drag
void (*key_up)(E_Drag *drag, Ecore_Event_Key *e);
} cb;
E_Container *container;
E_Comp *comp;
Evas *evas;
E_Popup *pop;
Evas_Object *comp_object;
Evas_Object *object;
int x, y, w, h;
@ -113,7 +113,7 @@ EINTERN int e_dnd_shutdown(void);
EAPI int e_dnd_active(void);
/* x and y are the top left coords of the object that is to be dragged */
EAPI E_Drag *e_drag_new(E_Container *container, int x, int y,
EAPI E_Drag *e_drag_new(E_Comp *comp, int x, int y,
const char **types, unsigned int num_types,
void *data, int size,
void *(*convert_cb)(E_Drag * drag, const char *type),

View File

@ -113,22 +113,22 @@ e_dpms_init(void)
(E_EVENT_CONFIG_MODE_CHANGED, _e_dpms_handler_config_mode_cb, NULL);
_e_dpms_handler_border_fullscreen = ecore_event_handler_add
(E_EVENT_BORDER_FULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL);
(E_EVENT_CLIENT_FULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL);
_e_dpms_handler_border_unfullscreen = ecore_event_handler_add
(E_EVENT_BORDER_UNFULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL);
(E_EVENT_CLIENT_UNFULLSCREEN, _e_dpms_handler_border_fullscreen_check_cb, NULL);
_e_dpms_handler_border_remove = ecore_event_handler_add
(E_EVENT_BORDER_REMOVE, _e_dpms_handler_border_fullscreen_check_cb, NULL);
(E_EVENT_CLIENT_REMOVE, _e_dpms_handler_border_fullscreen_check_cb, NULL);
_e_dpms_handler_border_iconify = ecore_event_handler_add
(E_EVENT_BORDER_ICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL);
(E_EVENT_CLIENT_ICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL);
_e_dpms_handler_border_uniconify = ecore_event_handler_add
(E_EVENT_BORDER_UNICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL);
(E_EVENT_CLIENT_UNICONIFY, _e_dpms_handler_border_fullscreen_check_cb, NULL);
_e_dpms_handler_border_desk_set = ecore_event_handler_add
(E_EVENT_BORDER_DESK_SET, _e_dpms_handler_border_desk_set_cb, NULL);
(E_EVENT_CLIENT_DESK_SET, _e_dpms_handler_border_desk_set_cb, NULL);
_e_dpms_handler_desk_show = ecore_event_handler_add
(E_EVENT_DESK_SHOW, _e_dpms_handler_desk_show_cb, NULL);

View File

@ -454,8 +454,6 @@ _e_entry_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o
if (event->button == 3)
{
E_Menu_Item *mi;
E_Manager *man;
E_Container *con;
Evas_Coord x, y;
int s_enabled, s_selecting, s_passwd, s_empty;
@ -466,9 +464,7 @@ _e_entry_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o
if (!s_selecting && !s_enabled && s_empty) return;
man = e_manager_current_get();
con = e_container_current_get(man);
ecore_x_pointer_xy_get(con->win, &x, &y);
ecore_evas_pointer_xy_get(e_util_comp_current_get()->ee, &x, &y);
/* Popup a menu */
sd->popup = e_menu_new();
@ -526,7 +522,7 @@ _e_entry_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o
e_menu_item_callback_set(mi, _e_entry_cb_select_all, sd);
}
e_menu_activate_mouse(sd->popup, e_util_zone_current_get(man),
e_menu_activate_mouse(sd->popup, e_util_zone_current_get(e_manager_current_get()),
x, y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, event->timestamp);
}
@ -574,9 +570,9 @@ static void
_e_entry_x_selection_update(Evas_Object *entry)
{
E_Entry_Smart_Data *sd;
Ecore_X_Window xwin;
Ecore_Window xwin;
E_Win *win;
E_Container *con;
E_Comp *c;
const char *text;
if ((!entry) || (!(sd = evas_object_smart_data_get(entry))))
@ -586,9 +582,9 @@ _e_entry_x_selection_update(Evas_Object *entry)
xwin = e_grabinput_key_win_get();
if (!xwin)
{
con = e_container_evas_object_container_get(sd->entry_object);
if (!con) return;
xwin = ecore_evas_window_get(con->bg_ecore_evas);
c = e_comp_util_evas_object_comp_get(sd->entry_object);
if (!c) return;
xwin = c->ee_win;
}
}
else
@ -608,18 +604,18 @@ _entry_paste_request_signal_cb(void *data,
const char *emission,
const char *source EINA_UNUSED)
{
Ecore_X_Window xwin;
Ecore_Window xwin;
E_Win *win;
E_Container *con;
E_Comp *c;
if (!(win = e_win_evas_object_win_get(data)))
{
xwin = e_grabinput_key_win_get();
if (!xwin)
{
con = e_container_evas_object_container_get(data);
if (!con) return;
xwin = ecore_evas_window_get(con->bg_ecore_evas);
c = e_comp_util_evas_object_comp_get(data);
if (!c) return;
xwin = c->ee_win;
}
}
else
@ -971,11 +967,11 @@ _e_entry_cb_copy(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
xwin = e_grabinput_key_win_get();
if (!xwin)
{
E_Container *con;
E_Comp *c;
con = e_container_evas_object_container_get(sd->entry_object);
if (!con) return;
xwin = ecore_evas_window_get(con->bg_ecore_evas);
c = e_comp_util_evas_object_comp_get(sd->entry_object);
if (!c) return;
xwin = c->ee_win;
}
}
ecore_x_selection_clipboard_set(xwin, range, strlen(range) + 1);
@ -1000,11 +996,11 @@ _e_entry_cb_paste(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
xwin = e_grabinput_key_win_get();
if (!xwin)
{
E_Container *con;
E_Comp *c;
con = e_container_evas_object_container_get(sd->entry_object);
if (!con) return;
xwin = ecore_evas_window_get(con->bg_ecore_evas);
c = e_comp_util_evas_object_comp_get(sd->entry_object);
if (!c) return;
xwin = c->ee_win;
}
}
ecore_x_selection_clipboard_request(xwin, ECORE_X_SELECTION_TARGET_UTF8_STRING);

View File

@ -30,7 +30,7 @@ e_entry_dialog_show(const char *title, const char *icon, const char *text,
if (initial_text)
ed->text = strdup(initial_text);
dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_entry_dialog");
dia = e_dialog_new(NULL, "E", "_entry_dialog");
if (!dia)
{
e_object_del(E_OBJECT(ed));
@ -76,6 +76,7 @@ _e_entry_dia_del(void *data)
{
E_Dialog *dia = data;
e_win_delete_callback_set(dia->win, _e_entry_dialog_delete);
e_object_del(dia->data);
}

View File

@ -90,7 +90,7 @@ e_exec_init(void)
ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _e_exec_cb_exit, NULL);
#if 0
_e_exec_border_add_handler =
ecore_event_handler_add(E_EVENT_BORDER_ADD, _e_exec_cb_event_border_add, NULL);
ecore_event_handler_add(E_EVENT_CLIENT_ADD, _e_exec_cb_event_border_add, NULL);
#endif
E_EVENT_EXEC_NEW = ecore_event_type_new();
@ -159,20 +159,22 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
if (dosingle)
{
Eina_List *l;
E_Border *bd;
const Eina_List *l, *ll;
E_Client *ec;
E_Comp *c;
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
if (bd && bd->desktop == desktop)
{
if (!bd->focused)
e_border_activate(bd, EINA_TRUE);
else
e_border_raise(bd);
return NULL;
}
}
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->clients, ll, ec)
{
if (ec && (ec->desktop == desktop))
{
if (!ec->focused)
e_client_activate(ec, EINA_TRUE);
else
evas_object_raise(ec->frame);
return NULL;
}
}
}
}
}
@ -222,7 +224,7 @@ e_exec_phony_del(E_Exec_Instance *inst)
}
EAPI E_Exec_Instance *
e_exec_phony(E_Border *bd)
e_exec_phony(E_Client *ec)
{
E_Exec_Instance *inst;
Eina_List *l, *lnew;
@ -230,23 +232,23 @@ e_exec_phony(E_Border *bd)
inst = E_NEW(E_Exec_Instance, 1);
inst->ref = 1;
inst->phony = 1;
inst->desktop = bd->desktop;
inst->startup_id = bd->client.netwm.startup_id;
if (bd->desktop)
inst->desktop = ec->desktop;
inst->startup_id = ec->netwm.startup_id;
if (ec->desktop)
{
efreet_desktop_ref(bd->desktop);
inst->key = eina_stringshare_add(bd->desktop->orig_path ?: bd->desktop->name);
efreet_desktop_ref(ec->desktop);
inst->key = eina_stringshare_add(ec->desktop->orig_path ?: ec->desktop->name);
}
else if (bd->client.icccm.command.argc)
else if (ec->icccm.command.argc)
{
Eina_Strbuf *buf;
int x;
buf = eina_strbuf_new();
for (x = 0; x < bd->client.icccm.command.argc; x++)
for (x = 0; x < ec->icccm.command.argc; x++)
{
eina_strbuf_append(buf, bd->client.icccm.command.argv[x]);
if (x + 1 < bd->client.icccm.command.argc)
eina_strbuf_append(buf, ec->icccm.command.argv[x]);
if (x + 1 < ec->icccm.command.argc)
eina_strbuf_append_char(buf, ' ');
}
inst->key = eina_stringshare_add(eina_strbuf_string_get(buf));
@ -258,13 +260,13 @@ e_exec_phony(E_Border *bd)
return NULL;
}
inst->used = 1;
bd->exe_inst = inst;
inst->borders = eina_list_append(inst->borders, bd);
if (bd->zone) inst->screen = bd->zone->num;
if (bd->desk)
ec->exe_inst = inst;
inst->clients = eina_list_append(inst->clients, ec);
if (ec->zone) inst->screen = ec->zone->num;
if (ec->desk)
{
inst->desk_x = bd->desk->x;
inst->desk_y = bd->desk->y;
inst->desk_x = ec->desk->x;
inst->desk_y = ec->desk->y;
}
l = eina_hash_find(e_exec_instances, inst->key);
lnew = eina_list_append(l, inst);
@ -344,10 +346,10 @@ e_exec_instance_found(E_Exec_Instance *inst)
}
EAPI void
e_exec_instance_client_add(E_Exec_Instance *inst, E_Border *bd)
e_exec_instance_client_add(E_Exec_Instance *inst, E_Client *ec)
{
inst->borders = eina_list_append(inst->borders, bd);
bd->exe_inst = inst;
inst->clients = eina_list_append(inst->clients, ec);
ec->exe_inst = inst;
inst->ref++;
ecore_event_add(E_EVENT_EXEC_NEW_CLIENT, inst, _e_exec_cb_exec_new_free, inst);
}
@ -422,7 +424,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
int head_length;
int penv_display_length;
head = launch->zone->container->manager->num;
head = launch->zone->comp->num;
penv_display_length = strlen(penv_display);
/* Check for insane length for DISPLAY env */
@ -629,7 +631,7 @@ static void
_e_exec_instance_free(E_Exec_Instance *inst)
{
Eina_List *instances;
E_Border *bd;
E_Client *ec;
if (inst->ref) return;
E_FREE_LIST(inst->watchers, free);
@ -656,8 +658,8 @@ _e_exec_instance_free(E_Exec_Instance *inst)
e_exec_start_pending = eina_list_remove(e_exec_start_pending,
inst->desktop);
if (inst->expire_timer) ecore_timer_del(inst->expire_timer);
EINA_LIST_FREE(inst->borders, bd)
bd->exe_inst = NULL;
EINA_LIST_FREE(inst->clients, ec)
ec->exe_inst = NULL;
if (inst->desktop) efreet_desktop_free(inst->desktop);
if (inst->exe) ecore_exe_data_set(inst->exe, NULL);
free(inst);
@ -716,7 +718,7 @@ _e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event)
{
E_Dialog *dia;
dia = e_dialog_new(e_container_current_get(e_manager_current_get()),
dia = e_dialog_new(NULL,
"E", "_e_exec_run_error_dialog");
if (dia)
{
@ -810,7 +812,6 @@ _e_exec_error_dialog(Efreet_Desktop *desktop, const char *exec, Ecore_Exe_Event_
{
E_Config_Dialog_View *v;
E_Config_Dialog_Data *cfdata;
E_Container *con;
v = E_NEW(E_Config_Dialog_View, 1);
if (!v) return;
@ -832,9 +833,8 @@ _e_exec_error_dialog(Efreet_Desktop *desktop, const char *exec, Ecore_Exe_Event_
v->basic.create_widgets = _basic_create_widgets;
v->advanced.create_widgets = _advanced_create_widgets;
con = e_container_current_get(e_manager_current_get());
/* Create The Dialog */
e_config_dialog_new(con, _("Application Execution Error"),
e_config_dialog_new(NULL, _("Application Execution Error"),
"E", "_e_exec_error_exit_dialog",
NULL, 0, v, cfdata);
}

View File

@ -9,7 +9,7 @@ typedef struct _E_Exec_Instance E_Exec_Instance;
struct _E_Exec_Instance
{
Efreet_Desktop *desktop;
Eina_List *borders;
Eina_List *clients;
const char *key;
Ecore_Exe *exe;
int startup_id;
@ -35,7 +35,7 @@ EINTERN int e_exec_init(void);
EINTERN int e_exec_shutdown(void);
EAPI void e_exec_executor_set(E_Exec_Instance *(*func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data);
EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method);
EAPI E_Exec_Instance *e_exec_phony(E_Border *bd);
EAPI E_Exec_Instance *e_exec_phony(E_Client *ec);
EAPI void e_exec_phony_del(E_Exec_Instance *inst);
EAPI E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid);
EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid);
@ -46,7 +46,7 @@ EAPI void e_exec_instance_watcher_del(E_Exec_Instance *inst, void (*func) (void
EAPI const Eina_List *e_exec_desktop_instances_find(const Efreet_Desktop *desktop);
EAPI const Eina_Hash *e_exec_instances_get(void);
EAPI void e_exec_instance_client_add(E_Exec_Instance *inst, E_Border *bd);
EAPI void e_exec_instance_client_add(E_Exec_Instance *inst, E_Client *ec);
/* sends E_Exec_Instance */
EAPI extern int E_EVENT_EXEC_NEW;

View File

@ -7529,41 +7529,15 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
(e_config->drag_resist * e_config->drag_resist))
{
E_Drag *d;
Evas_Object *o = NULL, *o2, *layout = NULL;
Evas_Object *o = NULL, *o2 = NULL, *layout = NULL;
const char *drag_types[] = { "text/uri-list" }, *real_path;
char buf[PATH_MAX + 8], *p, *sel = NULL;
E_Container *con = NULL;
E_Comp *c = NULL;
Eina_Binbuf *sbuf;
Eina_List *sl, *icons = NULL;
size_t sel_length = 0, p_offset, p_length;
switch (ic->sd->eobj->type)
{
case E_GADCON_TYPE:
con = ((E_Gadcon *)(ic->sd->eobj))->zone->container;
break;
case E_WIN_TYPE:
con = ((E_Win *)(ic->sd->eobj))->container;
break;
case E_ZONE_TYPE:
con = ((E_Zone *)(ic->sd->eobj))->container;
break;
case E_BORDER_TYPE:
con = ((E_Border *)(ic->sd->eobj))->zone->container;
break;
case E_POPUP_TYPE:
con = ((E_Popup *)(ic->sd->eobj))->zone->container;
break;
/* FIXME: add more types as needed */
default:
break;
}
if (!con) return;
c = e_comp_get(ic->sd->eobj);
ic->sd->drag = EINA_TRUE;
ic->drag.start = EINA_FALSE;
real_path = e_fm2_real_path_get(ic->sd->obj);
@ -7662,7 +7636,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
sel = (char*)eina_binbuf_string_steal(sbuf);
eina_binbuf_free(sbuf);
d = e_drag_new(con, 0, 0, drag_types, 1,
d = e_drag_new(c, 0, 0, drag_types, 1,
sel, sel_length, NULL, _e_fm2_cb_drag_finished);
if (layout)
d->x = ic->sd->x, d->y = ic->sd->y;
@ -7671,14 +7645,18 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNU
e_drop_handler_action_set(ECORE_X_ATOM_XDND_ACTION_MOVE);
e_drag_object_set(d, layout ?: o);
d->pop->objects = icons;
if (layout)
{
e_layout_thaw(layout);
e_drag_resize(d, ic->sd->w, ic->sd->h);
EINA_LIST_FREE(icons, o)
e_comp_object_util_del_list_append(d->comp_object, o);
}
else
e_drag_resize(d, ic->w, ic->h);
{
e_drag_resize(d, ic->w, ic->h);
e_comp_object_util_del_list_append(d->comp_object, o2);
}
evas_object_smart_callback_call(ic->sd->obj, "dnd_begin", &ic->info);
e_drag_key_down_cb_set(d, _e_fm_drag_key_down_cb);
@ -8834,8 +8812,6 @@ _e_fm2_menu(Evas_Object *obj, unsigned int timestamp)
E_Fm2_Smart_Data *sd;
E_Menu *mn, *sub;
E_Menu_Item *mi;
E_Manager *man;
E_Container *con;
E_Zone *zone;
int x, y;
@ -8950,20 +8926,8 @@ _e_fm2_menu(Evas_Object *obj, unsigned int timestamp)
sd->icon_menu.end.func(sd->icon_menu.end.data, sd->obj, mn, NULL);
}
man = e_manager_current_get();
if (!man)
{
e_object_del(E_OBJECT(mn));
return;
}
con = e_container_current_get(man);
if (!con)
{
e_object_del(E_OBJECT(mn));
return;
}
ecore_x_pointer_xy_get(con->win, &x, &y);
zone = e_util_zone_current_get(man);
ecore_evas_pointer_xy_get(e_util_comp_current_get()->ee, &x, &y);
zone = e_zone_current_get(e_util_comp_current_get());
if (!zone)
{
e_object_del(E_OBJECT(mn));
@ -8991,8 +8955,6 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
E_Fm2_Smart_Data *sd;
E_Menu *mn, *sub;
E_Menu_Item *mi;
E_Manager *man;
E_Container *con;
E_Zone *zone;
Eina_List *sel;
Eina_List *l = NULL;
@ -9297,20 +9259,8 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
sd->icon_menu.end.func(sd->icon_menu.end.data, sd->obj, mn, &(ic->info));
}
man = e_manager_current_get();
if (!man)
{
e_object_del(E_OBJECT(mn));
return;
}
con = e_container_current_get(man);
if (!con)
{
e_object_del(E_OBJECT(mn));
return;
}
ecore_x_pointer_xy_get(con->win, &x, &y);
zone = e_util_zone_current_get(man);
ecore_evas_pointer_xy_get(e_util_comp_current_get()->ee, &x, &y);
zone = e_zone_current_get(e_util_comp_current_get());
if (!zone)
{
e_object_del(E_OBJECT(mn));
@ -10335,9 +10285,7 @@ static Evas_Object *
_e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
{
Evas *e;
E_Container *con;
E_Manager *man;
Eina_List *l, *ll;
E_Comp *c;
if (ic->sd->iop_icon)
_e_fm2_icon_entry_widget_accept(ic->sd->iop_icon);
@ -10346,19 +10294,13 @@ _e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
return NULL;
e = evas_object_evas_get(ic->obj);
EINA_LIST_FOREACH(e_manager_list(), l, man)
EINA_LIST_FOREACH(man->containers, ll, con)
{
if (con->bg_evas != e) continue;
ic->keygrab = ecore_evas_window_get(con->bg_ecore_evas);
break;
}
c = e_comp_evas_find(e);
ic->entry_widget = e_widget_entry_add(e, NULL, NULL, NULL, NULL);
evas_object_event_callback_add(ic->entry_widget, EVAS_CALLBACK_KEY_DOWN,
_e_fm2_icon_entry_widget_cb_key_down, ic);
evas_event_feed_mouse_out(evas_object_evas_get(ic->obj), ecore_x_current_time_get(), NULL);
if (ic->keygrab)
e_grabinput_get(0, 0, ic->keygrab);
if (c)
e_comp_grab_input(c, 0, 1);
edje_object_part_swallow(ic->obj, "e.swallow.entry", ic->entry_widget);
evas_object_show(ic->entry_widget);
e_widget_entry_text_set(ic->entry_widget, ic->info.file);
@ -10366,7 +10308,7 @@ _e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
e_widget_entry_select_all(ic->entry_widget);
ic->sd->iop_icon = ic;
ic->sd->typebuf.disabled = EINA_TRUE;
evas_event_feed_mouse_in(evas_object_evas_get(ic->obj), ecore_x_current_time_get(), NULL);
evas_event_feed_mouse_in(e, ecore_x_current_time_get(), NULL);
return ic->entry_widget;
}
@ -10859,8 +10801,6 @@ _e_fm2_file_application_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item
{
Efreet_Desktop *desktop;
E_Fm2_Icon *ic;
E_Manager *man;
E_Container *con;
char buf[PATH_MAX];
ic = data;
@ -10868,31 +10808,19 @@ _e_fm2_file_application_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item
return;
desktop = efreet_desktop_get(buf);
man = e_manager_current_get();
if (!man) return;
con = e_container_current_get(man);
if (!con) return;
e_desktop_edit(con, desktop);
e_desktop_edit(NULL, desktop);
}
static void
_e_fm2_file_properties(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
E_Fm2_Icon *ic;
E_Manager *man;
E_Container *con;
ic = data;
if ((ic->entry_dialog) || (ic->entry_widget)) return;
man = e_manager_current_get();
if (!man) return;
con = e_container_current_get(man);
if (!con) return;
if (ic->prop_dialog) e_object_del(E_OBJECT(ic->prop_dialog));
ic->prop_dialog = e_fm_prop_file(con, ic);
ic->prop_dialog = e_fm_prop_file(NULL, ic);
E_OBJECT(ic->prop_dialog)->data = ic;
e_object_del_attach_func_set(E_OBJECT(ic->prop_dialog), _e_fm2_file_properties_delete_cb);
}
@ -11676,8 +11604,6 @@ e_fm2_drop_menu(Evas_Object *obj, char *args)
{
E_Menu *menu;
E_Menu_Item *item;
E_Manager *man;
E_Container *con;
E_Zone *zone;
int x, y;
@ -11722,12 +11648,8 @@ e_fm2_drop_menu(Evas_Object *obj, char *args)
"e/fileman/default/button/abort"),
"e/fileman/default/button/abort");
man = e_manager_current_get();
if (!man) goto error;
con = e_container_current_get(man);
if (!con) goto error;
ecore_x_pointer_xy_get(con->win, &x, &y);
zone = e_util_zone_current_get(man);
ecore_evas_pointer_xy_get(e_util_comp_current_get()->ee, &x, &y);
zone = e_zone_current_get(e_util_comp_current_get());
if (!zone) goto error;
e_menu_activate_mouse(menu, zone, x, y, 1, 1, E_MENU_POP_DIRECTION_DOWN, 0);
return;

View File

@ -94,7 +94,7 @@ struct _E_Config_Dialog_Data
/* a nice easy setup function that does the dirty work */
EAPI E_Config_Dialog *
e_fm_prop_file(E_Container *con, E_Fm2_Icon *ic)
e_fm_prop_file(E_Comp *c, E_Fm2_Icon *ic)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
@ -111,7 +111,7 @@ e_fm_prop_file(E_Container *con, E_Fm2_Icon *ic)
v->advanced.create_widgets = _advanced_create_widgets;
#endif
/* create config dialog for NULL object/data */
cfd = e_config_dialog_new(con,
cfd = e_config_dialog_new(c,
_("File Properties"),
"E", "_fm_prop",
"enlightenment/file_properties", 0, v, ic);
@ -605,7 +605,7 @@ _cb_icon_sel(void *data, void *data2)
cfd = data2;
if (!cfd) return;
dia = e_dialog_new(cfd->con, "E", "_fm2_file_properties_icon_select_dialog");
dia = e_dialog_new(cfd->comp, "E", "_fm2_file_properties_icon_select_dialog");
if (!dia) return;
// if (cfdata->type == EDJ)
// e_dialog_title_set(dia, _("Select an Edj File"));

View File

@ -3,7 +3,7 @@
#ifndef E_FM_PROP_H
#define E_FM_PROP_H
EAPI E_Config_Dialog *e_fm_prop_file(E_Container *con, E_Fm2_Icon *ic);
EAPI E_Config_Dialog *e_fm_prop_file(E_Comp *c, E_Fm2_Icon *ic);
#endif
#endif

View File

@ -6,173 +6,110 @@ static Eina_Bool _e_focus_raise_timer(void *data);
/* local subsystem globals */
/* externally accessible functions */
EINTERN int
e_focus_init(void)
{
return 1;
}
EINTERN int
e_focus_shutdown(void)
{
return 1;
}
EAPI void
e_focus_idler_before(void)
{
return;
}
EAPI void
e_focus_event_mouse_in(E_Border *bd)
e_focus_event_mouse_in(E_Client *ec)
{
if ((e_config->focus_policy == E_FOCUS_MOUSE) ||
(e_config->focus_policy == E_FOCUS_SLOPPY))
{
if (bd != e_border_focused_get())
e_border_focus_set(bd, 1, 1);
evas_object_focus_set(ec->frame, 1);
}
if (bd->raise_timer) ecore_timer_del(bd->raise_timer);
bd->raise_timer = NULL;
E_FREE_FUNC(ec->raise_timer, ecore_timer_del);
if (e_config->use_auto_raise)
{
if (e_config->auto_raise_delay == 0.0)
{
if (!bd->lock_user_stacking)
e_border_raise(bd);
if (!ec->lock_user_stacking)
evas_object_raise(ec->frame);
}
else
bd->raise_timer = ecore_timer_add(e_config->auto_raise_delay, _e_focus_raise_timer, bd);
ec->raise_timer = ecore_timer_add(e_config->auto_raise_delay, _e_focus_raise_timer, ec);
}
}
EAPI void
e_focus_event_mouse_out(E_Border *bd)
e_focus_event_mouse_out(E_Client *ec)
{
if (e_config->focus_policy == E_FOCUS_MOUSE)
{
if (!bd->lock_focus_in)
if (!ec->lock_focus_in)
{
if (bd->focused)
e_border_focus_set(bd, 0, 1);
if (ec->focused)
evas_object_focus_set(ec->frame, 0);
}
}
E_FREE_FUNC(bd->raise_timer, ecore_timer_del);
E_FREE_FUNC(ec->raise_timer, ecore_timer_del);
}
EAPI void
e_focus_event_mouse_down(E_Border *bd)
e_focus_event_mouse_down(E_Client *ec)
{
if (!bd->focused)
{
if (e_border_focus_policy_click(bd))
e_border_focus_set(bd, 1, 1);
else if (e_config->always_click_to_focus)
e_border_focus_set(bd, 1, 1);
}
if (e_client_focus_policy_click(ec) ||
e_config->always_click_to_focus)
evas_object_focus_set(ec->frame, 1);
if (e_config->always_click_to_raise)
{
if (!bd->lock_user_stacking)
e_border_raise(bd);
if (!ec->lock_user_stacking)
evas_object_raise(ec->frame);
}
}
EAPI void
e_focus_event_mouse_up(E_Border *bd __UNUSED__)
e_focus_event_mouse_up(E_Client *ec __UNUSED__)
{
}
EAPI void
e_focus_event_focus_in(E_Border *bd)
e_focus_event_focus_in(E_Client *ec)
{
if ((e_border_focus_policy_click(bd)) &&
if ((e_client_focus_policy_click(ec)) &&
(!e_config->always_click_to_raise) &&
(!e_config->always_click_to_focus))
{
if (!bd->button_grabbed) return;
e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
ecore_x_window_button_ungrab(bd->win, 1, 0, 1);
ecore_x_window_button_ungrab(bd->win, 2, 0, 1);
ecore_x_window_button_ungrab(bd->win, 3, 0, 1);
e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
bd->button_grabbed = 0;
if (!ec->button_grabbed) return;
e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
ecore_x_window_button_ungrab(e_client_util_pwin_get(ec), 1, 0, 1);
ecore_x_window_button_ungrab(e_client_util_pwin_get(ec), 2, 0, 1);
ecore_x_window_button_ungrab(e_client_util_pwin_get(ec), 3, 0, 1);
e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
ec->button_grabbed = 0;
}
}
EAPI void
e_focus_event_focus_out(E_Border *bd)
e_focus_event_focus_out(E_Client *ec)
{
if ((e_border_focus_policy_click(bd)) &&
if ((e_client_focus_policy_click(ec)) &&
(!e_config->always_click_to_raise) &&
(!e_config->always_click_to_focus))
{
if (bd->button_grabbed) return;
ecore_x_window_button_grab(bd->win, 1,
if (ec->button_grabbed) return;
ecore_x_window_button_grab(e_client_util_pwin_get(ec), 1,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
ecore_x_window_button_grab(bd->win, 2,
ecore_x_window_button_grab(e_client_util_pwin_get(ec), 2,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
ecore_x_window_button_grab(bd->win, 3,
ecore_x_window_button_grab(e_client_util_pwin_get(ec), 3,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
bd->button_grabbed = 1;
ec->button_grabbed = 1;
}
}
EAPI void
e_focus_setup(E_Border *bd)
{
if ((e_border_focus_policy_click(bd)) ||
(e_config->always_click_to_raise) ||
(e_config->always_click_to_focus))
{
if (bd->button_grabbed) return;
ecore_x_window_button_grab(bd->win, 1,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
ecore_x_window_button_grab(bd->win, 2,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
ecore_x_window_button_grab(bd->win, 3,
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_MOUSE_UP |
ECORE_X_EVENT_MASK_MOUSE_MOVE, 0, 1);
bd->button_grabbed = 1;
}
}
EAPI void
e_focus_setdown(E_Border *bd)
{
if (!bd->button_grabbed) return;
e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win);
ecore_x_window_button_ungrab(bd->win, 1, 0, 1);
ecore_x_window_button_ungrab(bd->win, 2, 0, 1);
ecore_x_window_button_ungrab(bd->win, 3, 0, 1);
e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win);
bd->button_grabbed = 0;
}
/* local subsystem functions */
static Eina_Bool
_e_focus_raise_timer(void *data)
{
E_Border *bd;
E_Client *ec = data;
bd = data;
if (!bd->lock_user_stacking) e_border_raise(bd);
bd->raise_timer = NULL;
if (!ec->lock_user_stacking) evas_object_raise(ec->frame);
ec->raise_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}

View File

@ -3,18 +3,14 @@
#ifndef E_FOCUS_H
#define E_FOCUS_H
EINTERN int e_focus_init(void);
EINTERN int e_focus_shutdown(void);
EAPI void e_focus_idler_before(void);
EAPI void e_focus_event_mouse_in(E_Border* bd);
EAPI void e_focus_event_mouse_out(E_Border* bd);
EAPI void e_focus_event_mouse_down(E_Border* bd);
EAPI void e_focus_event_mouse_up(E_Border* bd);
EAPI void e_focus_event_focus_in(E_Border *bd);
EAPI void e_focus_event_focus_out(E_Border *bd);
EAPI void e_focus_setup(E_Border *bd);
EAPI void e_focus_setdown(E_Border *bd);
EAPI void e_focus_event_mouse_in(E_Client* ec);
EAPI void e_focus_event_mouse_out(E_Client* ec);
EAPI void e_focus_event_mouse_down(E_Client* ec);
EAPI void e_focus_event_mouse_up(E_Client* ec);
EAPI void e_focus_event_focus_in(E_Client *ec);
EAPI void e_focus_event_focus_out(E_Client *ec);
EAPI void e_focus_setup(E_Client *ec);
EAPI void e_focus_setdown(E_Client *ec);
#endif
#endif

View File

@ -25,8 +25,9 @@ EAPI void
e_font_apply(void)
{
char buf[1024];
Eina_List *l;
E_Border *bd;
const Eina_List *l, *ll;
E_Client *ec;
E_Comp *c;
E_Font_Default *efd;
E_Font_Fallback *eff;
int blen, len;
@ -71,11 +72,10 @@ e_font_apply(void)
edje_text_class_set(efd->text_class, efd->font, efd->size);
}
/* Update borders */
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
e_border_frame_recalc(bd);
}
/* Update clients */
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->clients, ll, ec)
e_client_frame_recalc(ec);
}
EAPI Eina_List *
@ -85,16 +85,11 @@ e_font_available_list(void)
Eina_List *e_fonts;
Eina_List *l;
const char *evas_font;
E_Manager *man;
E_Container *con;
E_Comp *c;
man = e_manager_current_get();
if (!man) return NULL;
con = e_container_current_get(man);
if (!con) con = e_container_number_get(man, 0);
if (!con) return NULL;
c = e_util_comp_current_get();
evas_fonts = evas_font_available_list(con->bg_evas);
evas_fonts = evas_font_available_list(c->evas);
e_fonts = NULL;
EINA_LIST_FOREACH(evas_fonts, l, evas_font)
@ -106,7 +101,7 @@ e_font_available_list(void)
e_fonts = eina_list_append(e_fonts, efa);
}
evas_font_available_list_free(con->bg_evas, evas_fonts);
evas_font_available_list_free(c->evas, evas_fonts);
return e_fonts;
}

View File

@ -761,7 +761,7 @@ e_gadcon_zone_get(E_Gadcon *gc)
E_OBJECT_TYPE_CHECK_RETURN(gc, E_GADCON_TYPE, NULL);
if (gc->zone) return gc->zone;
if (!gc->toolbar) return NULL;
return gc->toolbar->fwin->border->zone;
return gc->toolbar->fwin->client->zone;
}
EAPI void
@ -779,7 +779,7 @@ e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, int *y, int *w, int *h)
E_OBJECT_TYPE_CHECK_RETURN(gc, E_GADCON_TYPE, 0);
if (!gc->ecore_evas) return 0;
ecore_evas_geometry_get(gc->ecore_evas, x, y, w, h);
// so much relies on this down here to have been broken... ie return container-relative coords.
// so much relies on this down here to have been broken... ie return comp-relative coords.
// if (gc->zone)
// {
// if (x) *x = *x - gc->zone->x;
@ -1133,7 +1133,7 @@ e_gadcon_client_edit_begin(E_Gadcon_Client *gcc)
{
Evas_Coord x, y, w, h;
Evas_Object *base;
unsigned int layer;
int layer;
E_OBJECT_CHECK(gcc);
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
@ -1141,11 +1141,11 @@ e_gadcon_client_edit_begin(E_Gadcon_Client *gcc)
base = gcc->o_frame ?: gcc->o_base;
if (!base) return;
layer = evas_object_layer_get(base) + 1;
evas_object_geometry_get(base, &x, &y, &w, &h);
gcc->o_control = edje_object_add(gcc->gadcon->evas);
/* FIXME: should probably be in gadget theme or something */
layer = e_comp_e_object_layer_effective_get(E_OBJECT(gcc)) + 1;
evas_object_layer_set(gcc->o_control, layer);
e_gadcon_locked_set(gcc->gadcon, 1);
gcc->gadcon->editing = 1;
@ -2272,7 +2272,7 @@ _e_gadcon_client_drag_begin(E_Gadcon_Client *gcc, int x, int y)
zone = e_gadcon_zone_get(gcc->gadcon);
if (gcc->gadcon->drag_gcc) return;
if ((!zone) || (!zone->container)) return;
if (!zone) return;
if (!e_util_strcmp(gcc->client_class->name, "systray"))
return;
@ -2289,9 +2289,9 @@ _e_gadcon_client_drag_begin(E_Gadcon_Client *gcc, int x, int y)
if (!e_drop_inside(gcc->gadcon->drop_handler, x, y))
e_gadcon_client_hide(gcc);
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
ecore_evas_pointer_xy_get(zone->comp->ee, &x, &y);
gcc->drag.drag = drag = e_drag_new(zone->container, x, y,
gcc->drag.drag = drag = e_drag_new(zone->comp, x, y,
drag_types, 1, gcc, -1, NULL,
e_gadcon_drag_finished_cb);
if (!drag) return;
@ -2480,7 +2480,7 @@ _e_gadcon_cb_client_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *o
}
if (gcc->gadcon->toolbar)
ecore_x_pointer_xy_get(zone->container->win, &cx, &cy);
ecore_evas_pointer_xy_get(zone->comp->ee, &cx, &cy);
else
{
e_gadcon_canvas_zone_geometry_get(gcc->gadcon, &cx, &cy, NULL, NULL);
@ -2591,7 +2591,7 @@ _e_gadcon_client_move_go(E_Gadcon_Client *gcc)
if (gcc->gadcon->toolbar)
evas_pointer_canvas_xy_get(gcc->gadcon->evas, &cx, &cy);
else
ecore_x_pointer_xy_get(gcc->gadcon->zone->container->win, &cx, &cy);
ecore_evas_pointer_xy_get(e_comp_get(gcc)->ee, &cx, &cy);
evas_object_geometry_get(gcc->gadcon->o_container, &gx, &gy, &gw, &gh);
@ -5557,7 +5557,7 @@ _e_gadcon_custom_populate_job(void *data __UNUSED__)
Eina_List *l, *ll;
E_Gadcon *gc;
#ifndef E18_RELEASE_BUILD
#ifndef E19_RELEASE_BUILD
static Eina_Bool first = EINA_TRUE;
if (first)
e_main_ts("gadcon custom populate idler start");
@ -5584,14 +5584,14 @@ _e_gadcon_custom_populate_job(void *data __UNUSED__)
_e_gadcon_event_populate(gc);
}
#ifndef E18_RELEASE_BUILD
#ifndef E19_RELEASE_BUILD
if (first)
e_main_ts("gadcon custom populate idler end");
#endif
if (!custom_populate_requests)
{
custom_populate_job = NULL;
#ifndef E18_RELEASE_BUILD
#ifndef E19_RELEASE_BUILD
first = EINA_FALSE;
#endif
}
@ -5604,7 +5604,7 @@ _e_gadcon_provider_populate_job(void *data __UNUSED__)
Eina_List *l;
E_Gadcon *gc;
#ifndef E18_RELEASE_BUILD
#ifndef E19_RELEASE_BUILD
static Eina_Bool first = EINA_TRUE;
if (first)
e_main_ts("gadcon populate idler start");
@ -5620,7 +5620,7 @@ _e_gadcon_provider_populate_job(void *data __UNUSED__)
}
EINA_LIST_FREE(gc->populate_requests, cc)
{
#ifndef E18_RELEASE_BUILD
#ifndef E19_RELEASE_BUILD
if (first) e_main_ts(cc->name);
#endif
if (gc->populate_class.func)
@ -5647,13 +5647,13 @@ _e_gadcon_provider_populate_job(void *data __UNUSED__)
if (x && _modules_loaded) _e_gadcon_event_populate(gc);
}
//out:
#ifndef E18_RELEASE_BUILD
#ifndef E19_RELEASE_BUILD
if (first)
e_main_ts("gadcon populate idler end");
#endif
populate_job = NULL;
#ifndef E18_RELEASE_BUILD
#ifndef E19_RELEASE_BUILD
first = EINA_FALSE;
#endif
}
@ -5754,9 +5754,8 @@ _e_gadcon_location_change(E_Gadcon_Client *gcc, E_Gadcon_Location *src, E_Gadcon
EAPI Eina_Bool
e_gadcon_client_visible_get(const E_Gadcon_Client *gcc, const E_Desk *desk)
{
const Eina_List *l, *ll, *lll;
E_Manager *man;
E_Container *con;
const Eina_List *l, *ll;
E_Comp *c;
E_Zone *zone;
if (!gcc->gadcon) return EINA_FALSE;
@ -5766,18 +5765,16 @@ e_gadcon_client_visible_get(const E_Gadcon_Client *gcc, const E_Desk *desk)
return EINA_TRUE; // FIXME for when gadman allows per-desk gadgets
case E_GADCON_SITE_SHELF:
if (desk) return e_shelf_desk_visible(gcc->gadcon->shelf, desk);
EINA_LIST_FOREACH(e_manager_list(), l, man)
EINA_LIST_FOREACH(man->containers, ll, con)
EINA_LIST_FOREACH(con->zones, lll, zone)
if (e_shelf_desk_visible(gcc->gadcon->shelf, e_desk_current_get(zone)))
return EINA_TRUE;
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->zones, ll, zone)
if (e_shelf_desk_visible(gcc->gadcon->shelf, e_desk_current_get(zone)))
return EINA_TRUE;
case E_GADCON_SITE_TOOLBAR:
case E_GADCON_SITE_EFM_TOOLBAR:
if (desk) return (gcc->gadcon->toolbar->fwin->border->desk == desk);
EINA_LIST_FOREACH(e_manager_list(), l, man)
EINA_LIST_FOREACH(man->containers, ll, con)
EINA_LIST_FOREACH(con->zones, lll, zone)
if (gcc->gadcon->toolbar->fwin->border->desk == e_desk_current_get(zone)) return EINA_TRUE;
if (desk) return (gcc->gadcon->toolbar->fwin->client->desk == desk);
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->zones, ll, zone)
if (gcc->gadcon->toolbar->fwin->client->desk == e_desk_current_get(zone)) return EINA_TRUE;
default:
break;
}

View File

@ -9,7 +9,7 @@ _e_popup_autoclose_deskafter_show_cb(void *data EINA_UNUSED, int type EINA_UNUSE
E_Gadcon_Popup *pop = data;
if (!pop) return ECORE_CALLBACK_RENEW;
if (!pop->win->visible) return ECORE_CALLBACK_RENEW;
if (!pop->visible) return ECORE_CALLBACK_RENEW;
if (!e_gadcon_client_visible_get(pop->gcc, ev->desk))
e_object_del(E_OBJECT(pop));
@ -17,15 +17,15 @@ _e_popup_autoclose_deskafter_show_cb(void *data EINA_UNUSED, int type EINA_UNUSE
}
static Eina_Bool
_e_popup_autoclose_border_fullscreen_cb(void *data, int type EINA_UNUSED, void *event)
_e_popup_autoclose_client_fullscreen_cb(void *data, int type EINA_UNUSED, void *event)
{
E_Event_Border_Fullscreen *ev = event;
E_Event_Client *ev = event;
E_Gadcon_Popup *pop = data;
if (!pop) return ECORE_CALLBACK_RENEW;
if (!pop->win->visible) return ECORE_CALLBACK_RENEW;
if (!ev->border->fullscreen) return ECORE_CALLBACK_RENEW;
if (e_gadcon_client_visible_get(pop->gcc, ev->border->desk))
if (!pop->visible) return ECORE_CALLBACK_RENEW;
if (!ev->ec->fullscreen) return ECORE_CALLBACK_RENEW;
if (e_gadcon_client_visible_get(pop->gcc, ev->ec->desk))
e_object_del(E_OBJECT(pop));
return ECORE_CALLBACK_RENEW;
}
@ -40,6 +40,14 @@ _e_gadcon_popup_locked_set(E_Gadcon_Popup *pop, Eina_Bool locked)
pop->gadcon_was_locked = locked;
}
static void
_e_gadcon_popup_delay_del(void *obj)
{
E_Gadcon_Popup *pop = obj;
if (pop->comp_object) evas_object_hide(pop->comp_object);
}
static void
_e_gadcon_popup_free(E_Gadcon_Popup *pop)
{
@ -49,33 +57,24 @@ _e_gadcon_popup_free(E_Gadcon_Popup *pop)
if (pop->gadcon_was_locked)
_e_gadcon_popup_locked_set(pop, 0);
pop->gcc = NULL;
if (pop->win)
E_OBJECT_DEL_SET(pop->win, NULL);
E_FREE_FUNC(pop->win, e_object_del);
evas_object_hide(pop->comp_object);
E_FREE_FUNC(pop->comp_object, evas_object_del);
free(pop);
}
static void
_e_gadcon_popup_del_cb(void *obj)
{
E_Gadcon_Popup *pop;
pop = e_object_data_get(obj);
pop->win = NULL;
e_object_del(E_OBJECT(pop));
}
static void
_e_gadcon_popup_position(E_Gadcon_Popup *pop)
{
Evas_Coord gx = 0, gy = 0, gw, gh, zw, zh, zx, zy, px, py;
E_Zone *zone;
/* Popup positioning */
e_gadcon_client_geometry_get(pop->gcc, &gx, &gy, &gw, &gh);
zx = pop->win->zone->x;
zy = pop->win->zone->y;
zw = pop->win->zone->w;
zh = pop->win->zone->h;
zone = e_gadcon_zone_get(pop->gcc->gadcon);
zx = zone->x;
zy = zone->y;
zw = zone->w;
zh = zone->h;
switch (pop->gcc->gadcon->orient)
{
case E_GADCON_ORIENT_CORNER_RT:
@ -135,14 +134,14 @@ _e_gadcon_popup_position(E_Gadcon_Popup *pop)
break;
default:
e_popup_move(pop->win, 50, 50);
evas_object_move(pop->comp_object, 50, 50);
return;
}
if (px - zx < 0)
px = zx;
if (py - zy < 0)
py = zy;
e_popup_move(pop->win, px - zx, py - zy);
evas_object_move(pop->comp_object, px, py);
if (pop->gadcon_lock && (!pop->gadcon_was_locked))
_e_gadcon_popup_locked_set(pop, 1);
@ -162,42 +161,37 @@ _e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj)
}
edje_extern_object_min_size_set(obj, w, h);
edje_object_size_min_calc(pop->o_bg, &pop->w, &pop->h);
e_popup_resize(pop->win, pop->w, pop->h);
evas_object_resize(pop->comp_object, pop->w, pop->h);
if (pop->win->visible)
if (pop->visible)
_e_gadcon_popup_position(pop);
}
static void
_e_gadcon_popup_changed_size_hints_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
E_Gadcon_Popup *pop;
pop = data;
_e_gadcon_popup_size_recalc(pop, obj);
_e_gadcon_popup_size_recalc(data, obj);
}
/* externally accessible functions */
EAPI E_Gadcon_Popup *
e_gadcon_popup_new(E_Gadcon_Client *gcc)
e_gadcon_popup_new(E_Gadcon_Client *gcc, Eina_Bool noshadow)
{
E_Gadcon_Popup *pop;
Evas_Object *o;
E_Zone *zone;
pop = E_OBJECT_ALLOC(E_Gadcon_Popup, E_GADCON_POPUP_TYPE, _e_gadcon_popup_free);
if (!pop) return NULL;
zone = e_gadcon_client_zone_get(gcc);
pop->win = e_popup_new(zone, 0, 0, 0, 0);
e_popup_layer_set(pop->win, E_COMP_CANVAS_LAYER_POPUP, 0);
e_object_data_set(E_OBJECT(pop->win), pop);
E_OBJECT_DEL_SET(pop->win, _e_gadcon_popup_del_cb);
e_object_delay_del_set(E_OBJECT(pop), _e_gadcon_popup_delay_del);
o = edje_object_add(pop->win->evas);
o = edje_object_add(e_comp_get(gcc)->evas);
e_theme_edje_object_set(o, "base/theme/gadman", "e/gadman/popup");
pop->o_bg = o;
pop->comp_object = e_comp_object_util_add(o, noshadow ? E_COMP_OBJECT_TYPE_NONE : E_COMP_OBJECT_TYPE_POPUP);
evas_object_layer_set(pop->comp_object, E_LAYER_POPUP);
pop->gcc = gcc;
pop->gadcon_lock = 1;
pop->gadcon_was_locked = 0;
@ -227,35 +221,31 @@ e_gadcon_popup_content_set(E_Gadcon_Popup *pop, Evas_Object *o)
_e_gadcon_popup_changed_size_hints_cb, pop);
}
pop->content = o;
if (old_o) e_popup_object_remove(pop->win, old_o);
if (o) e_popup_object_add(pop->win, o);
_e_gadcon_popup_size_recalc(pop, o);
}
EAPI void
e_gadcon_popup_show(E_Gadcon_Popup *pop)
{
if (!pop) return;
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_GADCON_POPUP_TYPE);
if (pop->win->visible) return;
if (pop->visible) return;
_e_gadcon_popup_position(pop);
pop->autoclose_handlers[0] = ecore_event_handler_add(E_EVENT_DESK_AFTER_SHOW, _e_popup_autoclose_deskafter_show_cb, NULL);
pop->autoclose_handlers[1] = ecore_event_handler_add(E_EVENT_BORDER_FULLSCREEN, _e_popup_autoclose_border_fullscreen_cb, NULL);
e_popup_content_set(pop->win, pop->o_bg);
e_popup_show(pop->win);
pop->autoclose_handlers[1] = ecore_event_handler_add(E_EVENT_CLIENT_FULLSCREEN, _e_popup_autoclose_client_fullscreen_cb, NULL);
e_comp_object_util_del_list_append(pop->comp_object, pop->content);
evas_object_show(pop->comp_object);
}
EAPI void
e_gadcon_popup_hide(E_Gadcon_Popup *pop)
{
if (!pop) return;
E_OBJECT_CHECK(pop);
E_OBJECT_TYPE_CHECK(pop, E_GADCON_POPUP_TYPE);
if (pop->pinned) return;
e_popup_hide(pop->win);
evas_object_hide(pop->comp_object);
if (pop->gadcon_was_locked)
_e_gadcon_popup_locked_set(pop, 0);
}

View File

@ -12,7 +12,7 @@ struct _E_Gadcon_Popup
{
E_Object e_obj_inherit;
E_Popup *win;
Evas_Object *comp_object;
E_Gadcon_Client *gcc;
Evas_Coord w, h;
Evas_Object *o_bg;
@ -22,9 +22,10 @@ struct _E_Gadcon_Popup
Eina_Bool pinned : 1;
Eina_Bool gadcon_lock : 1;
Eina_Bool gadcon_was_locked : 1;
Eina_Bool visible : 1;
};
EAPI E_Gadcon_Popup *e_gadcon_popup_new(E_Gadcon_Client *gcc);
EAPI E_Gadcon_Popup *e_gadcon_popup_new(E_Gadcon_Client *gcc, Eina_Bool noshadow);
EAPI void e_gadcon_popup_content_set(E_Gadcon_Popup *pop, Evas_Object *o);
EAPI void e_gadcon_popup_show(E_Gadcon_Popup *pop);
EAPI void e_gadcon_popup_hide(E_Gadcon_Popup *pop);

View File

@ -102,36 +102,31 @@ _e_grab_dialog_dia_del(void *data)
EAPI E_Grab_Dialog *
e_grab_dialog_show(E_Win *parent, Eina_Bool is_mouse, Ecore_Event_Handler_Cb key, Ecore_Event_Handler_Cb mouse, Ecore_Event_Handler_Cb wheel, const void *data)
{
E_Manager *man;
E_Container *con;
E_Comp *c = NULL;
E_Grab_Dialog *eg;
Ecore_Event_Handler *eh;
if (parent)
{
con = parent->container;
man = con->manager;
e_border_focus_set(parent->border, 0, 1);
c = parent->comp;
evas_object_focus_set(parent->client->frame, 0);
}
else
{
man = e_manager_current_get();
con = e_container_current_get(man);
}
c = e_comp_get(NULL);
eg = E_OBJECT_ALLOC(E_Grab_Dialog, E_GRAB_DIALOG_TYPE, _e_grab_dialog_free);
if (!eg) return NULL;
if (is_mouse)
{
eg->dia = e_dialog_new(con, "E", "_mousebind_getmouse_dialog");
eg->dia = e_dialog_new(c, "E", "_mousebind_getmouse_dialog");
e_dialog_title_set(eg->dia, _("Mouse Binding Sequence"));
e_dialog_icon_set(eg->dia, "preferences-desktop-mouse", 48);
e_dialog_text_set(eg->dia, TEXT_PRESS_MOUSE_BINIDING_SEQUENCE);
}
else
{
eg->dia = e_dialog_new(con, "E", "_keybind_getkey_dialog");
eg->dia = e_dialog_new(c, "E", "_keybind_getkey_dialog");
e_dialog_title_set(eg->dia, _("Key Binding Sequence"));
e_dialog_icon_set(eg->dia, "preferences-desktop-keyboard-shortcuts", 48);
e_dialog_text_set(eg->dia, TEXT_PRESS_KEY_SEQUENCE);
@ -142,7 +137,7 @@ e_grab_dialog_show(E_Win *parent, Eina_Bool is_mouse, Ecore_Event_Handler_Cb key
e_object_del_attach_func_set(E_OBJECT(eg->dia), _e_grab_dialog_dia_del);
e_win_delete_callback_set(eg->dia->win, _e_grab_dialog_delete);
eg->grab_win = ecore_x_window_input_new(man->root, 0, 0, 1, 1);
eg->grab_win = ecore_x_window_input_new(c->man->root, 0, 0, 1, 1);
ecore_x_window_show(eg->grab_win);
e_grabinput_get(eg->grab_win, 0, eg->grab_win);
@ -161,7 +156,7 @@ e_grab_dialog_show(E_Win *parent, Eina_Bool is_mouse, Ecore_Event_Handler_Cb key
eg->handlers = eina_list_append(eg->handlers, eh);
}
e_dialog_show(eg->dia);
e_border_layer_set(eg->dia->win->border, E_LAYER_ABOVE);
evas_object_layer_set(eg->dia->win->client->frame, E_LAYER_CLIENT_ABOVE);
if (parent)
e_dialog_parent_set(eg->dia, parent);
return eg;

View File

@ -2,17 +2,17 @@
/* local subsystem functions */
static Eina_Bool _e_grabinput_focus_check(void *data);
static void _e_grabinput_focus_do(Ecore_X_Window win, E_Focus_Method method);
static void _e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method);
static void _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method);
static void _e_grabinput_focus(Ecore_Window win, E_Focus_Method method);
/* local subsystem globals */
static Ecore_X_Window grab_mouse_win = 0;
static Ecore_X_Window grab_key_win = 0;
static Ecore_X_Window focus_win = 0;
static Ecore_Window grab_mouse_win = 0;
static Ecore_Window grab_key_win = 0;
static Ecore_Window focus_win = 0;
static E_Focus_Method focus_method = E_FOCUS_METHOD_NO_INPUT;
static double last_focus_time = 0.0;
static Ecore_X_Window focus_fix_win = 0;
static Ecore_Window focus_fix_win = 0;
static Ecore_Timer *focus_fix_timer = NULL;
static E_Focus_Method focus_fix_method = E_FOCUS_METHOD_NO_INPUT;
@ -35,7 +35,7 @@ e_grabinput_shutdown(void)
}
EAPI int
e_grabinput_get(Ecore_X_Window mouse_win, int confine_mouse, Ecore_X_Window key_win)
e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
{
if (grab_mouse_win)
{
@ -79,7 +79,7 @@ e_grabinput_get(Ecore_X_Window mouse_win, int confine_mouse, Ecore_X_Window key_
}
EAPI void
e_grabinput_release(Ecore_X_Window mouse_win, Ecore_X_Window key_win)
e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win)
{
if (mouse_win == grab_mouse_win)
{
@ -101,7 +101,7 @@ e_grabinput_release(Ecore_X_Window mouse_win, Ecore_X_Window key_win)
}
EAPI void
e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method)
e_grabinput_focus(Ecore_Window win, E_Focus_Method method)
{
if (grab_key_win != 0)
{
@ -122,13 +122,13 @@ e_grabinput_last_focus_time_get(void)
return last_focus_time;
}
EAPI Ecore_X_Window
EAPI Ecore_Window
e_grabinput_last_focus_win_get(void)
{
return focus_fix_win;
}
EAPI Ecore_X_Window
EAPI Ecore_Window
e_grabinput_key_win_get(void)
{
return grab_key_win;
@ -147,7 +147,7 @@ _e_grabinput_focus_check(void *data __UNUSED__)
}
static void
_e_grabinput_focus_do(Ecore_X_Window win, E_Focus_Method method)
_e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
{
/* fprintf(stderr, "focus to %x method %i\n", win, method); */
switch (method)
@ -174,7 +174,7 @@ _e_grabinput_focus_do(Ecore_X_Window win, E_Focus_Method method)
}
static void
_e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method)
_e_grabinput_focus(Ecore_Window win, E_Focus_Method method)
{
focus_fix_win = win;
focus_fix_method = method;

View File

@ -14,12 +14,12 @@ typedef enum _E_Focus_Method
EINTERN int e_grabinput_init(void);
EINTERN int e_grabinput_shutdown(void);
EAPI int e_grabinput_get(Ecore_X_Window mouse_win, int confine_mouse, Ecore_X_Window key_win);
EAPI void e_grabinput_release(Ecore_X_Window mouse_win, Ecore_X_Window key_win);
EAPI void e_grabinput_focus(Ecore_X_Window win, E_Focus_Method method);
EAPI int e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win);
EAPI void e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win);
EAPI void e_grabinput_focus(Ecore_Window win, E_Focus_Method method);
EAPI double e_grabinput_last_focus_time_get(void);
EAPI Ecore_X_Window e_grabinput_last_focus_win_get(void);
EAPI Ecore_X_Window e_grabinput_key_win_get(void);
EAPI Ecore_Window e_grabinput_last_focus_win_get(void);
EAPI Ecore_Window e_grabinput_key_win_get(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -3,49 +3,49 @@
#ifndef E_HINTS_H
#define E_HINTS_H
EINTERN void e_hints_init(void);
EAPI void e_hints_e16_comms_pretend(E_Manager *man);
EINTERN void e_hints_init(Ecore_X_Window win, Ecore_X_Window propwin);
EAPI void e_hints_e16_comms_pretend(Ecore_X_Window root, Ecore_X_Window propwin);
EINTERN void e_hints_manager_init(E_Manager *man);
EAPI void e_hints_client_list_set(void);
EAPI void e_hints_client_stacking_set(void);
EAPI void e_hints_active_window_set(E_Manager *man, E_Border *bd);
EAPI void e_hints_active_window_set(E_Manager *man, E_Client *ec);
EINTERN void e_hints_window_init(E_Border *bd);
EAPI void e_hints_window_state_set(E_Border *bd);
EAPI void e_hints_window_state_get(E_Border *bd);
EAPI void e_hints_window_type_set(E_Border *bd);
EAPI void e_hints_window_type_get(E_Border *bd);
EINTERN void e_hints_window_init(E_Client *ec);
EAPI void e_hints_window_state_set(E_Client *ec);
EAPI void e_hints_window_state_get(E_Client *ec);
EAPI void e_hints_window_type_set(E_Client *ec);
EAPI void e_hints_window_type_get(E_Client *ec);
EAPI void e_hints_window_state_update(E_Border *bd, Ecore_X_Window_State state,
EAPI void e_hints_window_state_update(E_Client *ec, Ecore_X_Window_State state,
Ecore_X_Window_State_Action action);
EAPI void e_hints_window_visible_set(E_Border *bd);
EAPI void e_hints_window_iconic_set(E_Border *bd);
EAPI void e_hints_window_hidden_set(E_Border *bd);
EAPI void e_hints_window_visible_set(E_Client *ec);
EAPI void e_hints_window_iconic_set(E_Client *ec);
EAPI void e_hints_window_hidden_set(E_Client *ec);
EAPI void e_hints_window_shade_direction_set(E_Border *bd, E_Direction dir);
EAPI E_Direction e_hints_window_shade_direction_get(E_Border *bd);
EAPI void e_hints_window_shade_direction_set(E_Client *ec, E_Direction dir);
EAPI E_Direction e_hints_window_shade_direction_get(E_Client *ec);
EAPI void e_hints_window_size_set(E_Border *bd);
EAPI void e_hints_window_size_unset(E_Border *bd);
EAPI int e_hints_window_size_get(E_Border *bd);
EAPI void e_hints_window_size_set(E_Client *ec);
EAPI void e_hints_window_size_unset(E_Client *ec);
EAPI int e_hints_window_size_get(E_Client *ec);
EAPI void e_hints_window_shaded_set(E_Border *bd, int on);
EAPI void e_hints_window_maximized_set(E_Border *bd, int horizontal, int vertical);
EAPI void e_hints_window_fullscreen_set(E_Border *bd, int on);
EAPI void e_hints_window_sticky_set(E_Border *bd, int on);
EAPI void e_hints_window_stacking_set(E_Border *bd, E_Stacking stacking);
EAPI void e_hints_window_desktop_set(E_Border *bd);
EAPI void e_hints_window_shaded_set(E_Client *ec, int on);
EAPI void e_hints_window_maximized_set(E_Client *ec, int horizontal, int vertical);
EAPI void e_hints_window_fullscreen_set(E_Client *ec, int on);
EAPI void e_hints_window_sticky_set(E_Client *ec, int on);
EAPI void e_hints_window_stacking_set(E_Client *ec, E_Stacking stacking);
EAPI void e_hints_window_desktop_set(E_Client *ec);
EAPI void e_hints_window_e_state_set(E_Border *bd);
EAPI void e_hints_window_e_state_get(E_Border *bd);
EAPI void e_hints_window_e_state_set(E_Client *ec);
EAPI void e_hints_window_e_state_get(E_Client *ec);
EAPI void e_hints_window_qtopia_soft_menu_get(E_Border *bd);
EAPI void e_hints_window_qtopia_soft_menus_get(E_Border *bd);
EAPI void e_hints_window_qtopia_soft_menu_get(E_Client *ec);
EAPI void e_hints_window_qtopia_soft_menus_get(E_Client *ec);
EAPI void e_hints_window_virtual_keyboard_state_get(E_Border *bd);
EAPI void e_hints_window_virtual_keyboard_get(E_Border *bd);
EAPI void e_hints_window_virtual_keyboard_state_get(E_Client *ec);
EAPI void e_hints_window_virtual_keyboard_get(E_Client *ec);
EAPI void e_hints_openoffice_gnome_fake(Ecore_X_Window root);
EAPI void e_hints_openoffice_kde_fake(Ecore_X_Window root);

View File

@ -393,8 +393,11 @@ static void
_e_import_config_dia_del(void *data)
{
E_Dialog *dia = data;
E_Import_Config_Dialog *import;
e_object_del(dia->data);
import = dia->data;
dia->data = NULL;
e_object_del(E_OBJECT(import));
}
static void
@ -421,6 +424,7 @@ _e_import_config_dialog_win_del(E_Win *win)
dia = win->data;
import = dia->data;
if (!import) return;
e_object_ref(E_OBJECT(import));
if (import->cancel) import->cancel(import);
e_object_del(E_OBJECT(import));
@ -430,7 +434,7 @@ _e_import_config_dialog_win_del(E_Win *win)
///////////////////////////////////////////////////////////////////////////////////
EAPI E_Import_Config_Dialog *
e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel)
e_import_config_dialog_show(E_Comp *c, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel)
{
Evas *evas;
E_Dialog *dia;
@ -444,7 +448,7 @@ e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok,
import = E_OBJECT_ALLOC(E_Import_Config_Dialog, E_IMPORT_CONFIG_DIALOG_TYPE, _e_import_config_dialog_del);
if (!import) return NULL;
dia = e_dialog_new(con, "E", "_import_config_dialog");
dia = e_dialog_new(c, "E", "_import_config_dialog");
if (!dia)
{
e_object_del(E_OBJECT(import));

View File

@ -26,7 +26,7 @@ struct _E_Import_Config_Dialog
E_Dialog *dia;
};
EAPI E_Import_Config_Dialog *e_import_config_dialog_show(E_Container *con, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel);
EAPI E_Import_Config_Dialog *e_import_config_dialog_show(E_Comp *c, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel);
#endif
#endif

View File

@ -54,7 +54,7 @@ _fsel_cb_ok(void *data, E_Dialog *dia __UNUSED__)
if ((p) && (strcasecmp(p, ".edj")))
{
E_Import_Config_Dialog *import;
import = e_import_config_dialog_show(id->dia->win->container, path, _import_ok, NULL);
import = e_import_config_dialog_show(id->dia->win->comp, path, _import_ok, NULL);
e_dialog_parent_set(import->dia, id->dia->win);
e_object_data_set(E_OBJECT(import), id);
return;
@ -103,8 +103,11 @@ static void
_e_import_dia_del(void *data)
{
E_Dialog *dia = data;
E_Import_Dialog *id;
e_object_del(dia->data);
id = dia->data;
dia->data = NULL;
e_object_del(E_OBJECT(id));
}
static void
@ -125,13 +128,14 @@ _e_import_dialog_win_del(E_Win *win)
dia = win->data;
id = dia->data;
e_object_del(E_OBJECT(id));
if (id)
e_object_del(E_OBJECT(id));
}
//////////////////////////////////////////////////////////////////////////////////
EAPI E_Import_Dialog *
e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel)
e_import_dialog_show(E_Comp *c, const char *dev, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel)
{
Evas *evas;
E_Import_Dialog *id;
@ -144,7 +148,7 @@ e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_
id = E_OBJECT_ALLOC(E_Import_Dialog, E_IMPORT_DIALOG_TYPE, _e_import_dialog_del);
if (!id) return NULL;
dia = e_dialog_new(con, "E", "_import_fsel_dialog");
dia = e_dialog_new(c, "E", "_import_fsel_dialog");
if (!dia)
{
e_object_del(E_OBJECT(id));

View File

@ -15,7 +15,7 @@ struct _E_Import_Dialog
E_Dialog *dia;
};
EAPI E_Import_Dialog *e_import_dialog_show(E_Container *con, const char *dev, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel);
EAPI E_Import_Dialog *e_import_dialog_show(E_Comp *c, const char *dev, const char *path, Ecore_End_Cb ok, Ecore_Cb cancel);
#endif
#endif

View File

@ -5,10 +5,11 @@
#include "e_path.h"
#include "e_ipc.h"
#include "e_error.h"
#include "e_container.h"
#include "e_zone.h"
#include "e_desk.h"
#include "e_border.h"
#include "e_pixmap.h"
#include "e_comp_object.h"
#include "e_client.h"
#include "e_pointer.h"
#include "e_config.h"
#include "e_config_data.h"
@ -21,7 +22,6 @@
#include "e_int_menus.h"
#include "e_module.h"
#include "e_atoms.h"
#include "e_utils.h"
#include "e_canvas.h"
#include "e_focus.h"
#include "e_place.h"
@ -41,7 +41,6 @@
#include "e_bindings.h"
#include "e_moveresize.h"
#include "e_actions.h"
#include "e_popup.h"
#include "e_gadcon_popup.h"
#include "e_ipc_codec.h"
#include "e_test.h"
@ -72,12 +71,12 @@
#include "e_widget_entry.h"
#include "e_widget_image.h"
#include "e_config_dialog.h"
#include "e_int_border_locks.h"
#include "e_int_client_locks.h"
#include "e_thumb.h"
#include "e_int_border_remember.h"
#include "e_int_client_remember.h"
#include "e_desktop_editor.h"
#include "e_scrollframe.h"
#include "e_int_border_menu.h"
#include "e_int_client_menu.h"
#include "e_ilist.h"
#include "e_livethumb.h"
#include "e_widget_ilist.h"
@ -91,14 +90,13 @@
#include "e_exehist.h"
#include "e_color_class.h"
#include "e_widget_textblock.h"
#include "e_stolen.h"
#include "e_gadcon.h"
#include "e_shelf.h"
#include "e_widget_preview.h"
#include "e_int_shelf_config.h"
#include "e_int_gadcon_config.h"
#include "e_confirm_dialog.h"
#include "e_int_border_prop.h"
#include "e_int_client_prop.h"
#include "e_entry_dialog.h"
#include "e_fm.h"
#include "e_fm_op_registry.h"
@ -153,4 +151,5 @@
#include "e_notification.h"
#include "e_comp.h"
#include "e_comp_cfdata.h"
#include "e_comp_render_update.h"
#include "e_comp_canvas.h"
#include "e_utils.h"

View File

@ -45,30 +45,28 @@ EAPI void
e_init_show(void)
{
Evas_Object *o;
E_Manager *man;
E_Container *con;
E_Comp *c;
E_Zone *zone;
Eina_List *l;
/* exec init */
/* extra screens */
EINA_LIST_FOREACH(e_manager_list()->next, l, man)
EINA_LIST_FOREACH(e_comp_list()->next, l, c)
{
o = edje_object_add(e_comp_get(man)->evas);
o = edje_object_add(c->evas);
e_theme_edje_object_set(o, NULL, "e/init/extra_screen");
evas_object_name_set(o, "_e_init_extra_screen");
evas_object_move(o, 0, 0);
evas_object_resize(o, man->w, man->h);
evas_object_layer_set(o, E_COMP_CANVAS_LAYER_MAX);
evas_object_resize(o, c->man->w, c->man->h);
evas_object_layer_set(o, E_LAYER_MAX);
evas_object_show(o);
splash_objs = eina_list_append(splash_objs, o);
}
man = eina_list_data_get(e_manager_list());
con = eina_list_data_get(man->containers);
EINA_LIST_FOREACH(con->zones, l, zone)
c = eina_list_data_get(e_comp_list());
EINA_LIST_FOREACH(c->zones, l, zone)
{
o = edje_object_add(e_comp_get(man)->evas);
o = edje_object_add(c->evas);
if (!zone->num)
{
e_theme_edje_object_set(o, NULL, "e/init/splash");
@ -84,7 +82,7 @@ e_init_show(void)
fprintf(stderr, "zone %p: %i %i %ix%i\n", zone, zone->x, zone->y, zone->w, zone->h);
evas_object_move(o, zone->x, zone->y);
evas_object_resize(o, zone->w, zone->h);
evas_object_layer_set(o, E_COMP_CANVAS_LAYER_MAX);
evas_object_layer_set(o, E_LAYER_MAX);
evas_object_show(o);
splash_objs = eina_list_append(splash_objs, o);
}
@ -101,6 +99,7 @@ EAPI void
e_init_hide(void)
{
E_FREE_LIST(splash_objs, evas_object_del);
E_LIST_FOREACH(e_comp_list(), e_comp_shape_queue);
_e_init_object = NULL;
E_FREE_FUNC(_e_init_timeout_timer, ecore_timer_del);
}

View File

@ -1,22 +0,0 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_BORDER_MENU_H
#define E_INT_BORDER_MENU_H
typedef void (*E_Border_Menu_Hook_Cb)(void *, E_Border *);
typedef struct E_Border_Menu_Hook
{
E_Border_Menu_Hook_Cb cb;
void *data;
} E_Border_Menu_Hook;
EAPI E_Border_Menu_Hook *e_int_border_menu_hook_add(E_Border_Menu_Hook_Cb cb, const void *data);
EAPI void e_int_border_menu_hook_del(E_Border_Menu_Hook *hook);
EAPI void e_int_border_menu_hooks_clear(void);
EAPI void e_int_border_menu_create(E_Border *bd);
EAPI void e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp);
EAPI void e_int_border_menu_del(E_Border *bd);
#endif
#endif

View File

@ -1,10 +0,0 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_BORDER_REMEMBER_H
#define E_INT_BORDER_REMEMBER_H
EAPI void e_int_border_remember(E_Border *bd);
EAPI E_Config_Dialog *e_int_border_remember_edit(E_Remember *rem);
#endif
#endif

View File

@ -11,7 +11,7 @@ static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E
/* Actual config data we will be playing with whil the dialog is active */
struct _E_Config_Dialog_Data
{
E_Border *border;
E_Client *client;
/*- BASIC -*/
int do_what_i_say;
int protect_from_me;
@ -45,7 +45,7 @@ struct _E_Config_Dialog_Data
/* a nice easy setup function that does the dirty work */
EAPI void
e_int_border_locks(E_Border *bd)
e_int_client_locks(E_Client *ec)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
@ -62,11 +62,11 @@ e_int_border_locks(E_Border *bd)
v->advanced.create_widgets = _advanced_create_widgets;
v->override_auto_apply = 1;
/* create config diaolg for bd object/data */
cfd = e_config_dialog_new(bd->zone->container,
cfd = e_config_dialog_new(ec->comp,
_("Window Locks"),
"E", "_border_locks_dialog",
NULL, 0, v, bd);
bd->border_locks_dialog = cfd;
NULL, 0, v, ec);
ec->border_locks_dialog = cfd;
}
}
@ -74,31 +74,31 @@ e_int_border_locks(E_Border *bd)
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
cfdata->lock.user.location = (int)cfdata->border->lock_user_location & 0x1;
cfdata->lock.user.size = (int)cfdata->border->lock_user_size & 0x1;
cfdata->lock.user.stacking = (int)cfdata->border->lock_user_stacking & 0x1;
cfdata->lock.user.iconify = (int)cfdata->border->lock_user_iconify & 0x1;
cfdata->lock.user.desk = (int)cfdata->border->lock_user_desk & 0x1;
cfdata->lock.user.sticky = (int)cfdata->border->lock_user_sticky & 0x1;
cfdata->lock.user.shade = (int)cfdata->border->lock_user_shade & 0x1;
cfdata->lock.user.maximize = (int)cfdata->border->lock_user_maximize & 0x1;
cfdata->lock.user.fullscreen = (int)cfdata->border->lock_user_fullscreen & 0x1;
cfdata->lock.client.location = (int)cfdata->border->lock_client_location & 0x1;
cfdata->lock.client.size = (int)cfdata->border->lock_client_size & 0x1;
cfdata->lock.client.stacking = (int)cfdata->border->lock_client_stacking & 0x1;
cfdata->lock.client.iconify = (int)cfdata->border->lock_client_iconify & 0x1;
cfdata->lock.client.desk = (int)cfdata->border->lock_client_desk & 0x1;
cfdata->lock.client.sticky = (int)cfdata->border->lock_client_sticky & 0x1;
cfdata->lock.client.shade = (int)cfdata->border->lock_client_shade & 0x1;
cfdata->lock.client.maximize = (int)cfdata->border->lock_client_maximize & 0x1;
cfdata->lock.client.fullscreen = (int)cfdata->border->lock_client_fullscreen & 0x1;
cfdata->lock.border = (int)cfdata->border->lock_border & 0x1;
cfdata->lock.close = (int)cfdata->border->lock_close & 0x1;
cfdata->lock.focus_in = (int)cfdata->border->lock_focus_in & 0x1;
cfdata->lock.focus_out = (int)cfdata->border->lock_focus_out & 0x1;
cfdata->lock.life = (int)cfdata->border->lock_life & 0x1;
if ((cfdata->border->remember) &&
(cfdata->border->remember->apply & E_REMEMBER_APPLY_LOCKS))
cfdata->lock.user.location = (int)cfdata->client->lock_user_location & 0x1;
cfdata->lock.user.size = (int)cfdata->client->lock_user_size & 0x1;
cfdata->lock.user.stacking = (int)cfdata->client->lock_user_stacking & 0x1;
cfdata->lock.user.iconify = (int)cfdata->client->lock_user_iconify & 0x1;
cfdata->lock.user.desk = (int)cfdata->client->lock_user_desk & 0x1;
cfdata->lock.user.sticky = (int)cfdata->client->lock_user_sticky & 0x1;
cfdata->lock.user.shade = (int)cfdata->client->lock_user_shade & 0x1;
cfdata->lock.user.maximize = (int)cfdata->client->lock_user_maximize & 0x1;
cfdata->lock.user.fullscreen = (int)cfdata->client->lock_user_fullscreen & 0x1;
cfdata->lock.client.location = (int)cfdata->client->lock_client_location & 0x1;
cfdata->lock.client.size = (int)cfdata->client->lock_client_size & 0x1;
cfdata->lock.client.stacking = (int)cfdata->client->lock_client_stacking & 0x1;
cfdata->lock.client.iconify = (int)cfdata->client->lock_client_iconify & 0x1;
cfdata->lock.client.desk = (int)cfdata->client->lock_client_desk & 0x1;
cfdata->lock.client.sticky = (int)cfdata->client->lock_client_sticky & 0x1;
cfdata->lock.client.shade = (int)cfdata->client->lock_client_shade & 0x1;
cfdata->lock.client.maximize = (int)cfdata->client->lock_client_maximize & 0x1;
cfdata->lock.client.fullscreen = (int)cfdata->client->lock_client_fullscreen & 0x1;
cfdata->lock.border = (int)cfdata->client->lock_border & 0x1;
cfdata->lock.close = (int)cfdata->client->lock_close & 0x1;
cfdata->lock.focus_in = (int)cfdata->client->lock_focus_in & 0x1;
cfdata->lock.focus_out = (int)cfdata->client->lock_focus_out & 0x1;
cfdata->lock.life = (int)cfdata->client->lock_life & 0x1;
if ((cfdata->client->remember) &&
(cfdata->client->remember->apply & E_REMEMBER_APPLY_LOCKS))
cfdata->lock.remember = 1;
/* figure out basic config from the current locks */
@ -131,7 +131,7 @@ _create_data(E_Config_Dialog *cfd)
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->border = cfd->data;
cfdata->client = cfd->data;
_fill_data(cfdata);
return cfdata;
}
@ -140,7 +140,7 @@ static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
/* Free the cfdata */
cfdata->border->border_locks_dialog = NULL;
cfdata->client->border_locks_dialog = NULL;
free(cfdata);
}
@ -152,59 +152,59 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
/* Actually take our cfdata settings and apply them in real life */
flag = cfdata->do_what_i_say;
cfdata->border->lock_client_location = flag;
cfdata->border->lock_client_size = flag;
cfdata->border->lock_client_stacking = flag;
cfdata->border->lock_client_iconify = flag;
cfdata->border->lock_client_desk = 0;
cfdata->border->lock_client_sticky = flag;
cfdata->border->lock_client_shade = flag;
cfdata->border->lock_client_maximize = flag;
cfdata->border->lock_client_fullscreen = flag;
cfdata->client->lock_client_location = flag;
cfdata->client->lock_client_size = flag;
cfdata->client->lock_client_stacking = flag;
cfdata->client->lock_client_iconify = flag;
cfdata->client->lock_client_desk = 0;
cfdata->client->lock_client_sticky = flag;
cfdata->client->lock_client_shade = flag;
cfdata->client->lock_client_maximize = flag;
cfdata->client->lock_client_fullscreen = flag;
flag = cfdata->protect_from_me;
cfdata->border->lock_user_location = flag;
cfdata->border->lock_user_size = flag;
cfdata->border->lock_user_stacking = flag;
cfdata->border->lock_user_iconify = flag;
cfdata->border->lock_user_desk = 0;
cfdata->border->lock_user_sticky = flag;
cfdata->border->lock_user_shade = flag;
cfdata->border->lock_user_maximize = flag;
cfdata->border->lock_user_fullscreen = flag;
cfdata->client->lock_user_location = flag;
cfdata->client->lock_user_size = flag;
cfdata->client->lock_user_stacking = flag;
cfdata->client->lock_user_iconify = flag;
cfdata->client->lock_user_desk = 0;
cfdata->client->lock_user_sticky = flag;
cfdata->client->lock_user_shade = flag;
cfdata->client->lock_user_maximize = flag;
cfdata->client->lock_user_fullscreen = flag;
flag = cfdata->important_window;
cfdata->border->lock_close = flag;
cfdata->border->lock_life = flag;
cfdata->client->lock_close = flag;
cfdata->client->lock_life = flag;
flag = cfdata->keep_my_border;
cfdata->border->lock_border = flag;
cfdata->client->lock_border = flag;
if (cfdata->remember_locks)
{
if (!cfdata->border->remember)
if (!cfdata->client->remember)
{
cfdata->border->remember = e_remember_new();
if (cfdata->border->remember)
e_remember_use(cfdata->border->remember);
cfdata->client->remember = e_remember_new();
if (cfdata->client->remember)
e_remember_use(cfdata->client->remember);
}
if (cfdata->border->remember)
if (cfdata->client->remember)
{
cfdata->border->remember->apply |= E_REMEMBER_APPLY_LOCKS;
e_remember_default_match_set(cfdata->border->remember, cfdata->border);
e_remember_update(cfdata->border);
cfdata->client->remember->apply |= E_REMEMBER_APPLY_LOCKS;
e_remember_default_match_set(cfdata->client->remember, cfdata->client);
e_remember_update(cfdata->client);
}
}
else
{
if (cfdata->border->remember)
if (cfdata->client->remember)
{
cfdata->border->remember->apply &= ~E_REMEMBER_APPLY_LOCKS;
if (cfdata->border->remember->apply == 0)
cfdata->client->remember->apply &= ~E_REMEMBER_APPLY_LOCKS;
if (cfdata->client->remember->apply == 0)
{
e_remember_unuse(cfdata->border->remember);
e_remember_del(cfdata->border->remember);
cfdata->border->remember = NULL;
e_remember_unuse(cfdata->client->remember);
e_remember_del(cfdata->client->remember);
cfdata->client->remember = NULL;
}
}
}
@ -216,55 +216,55 @@ static int
_advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
/* Actually take our cfdata settings and apply them in real life */
cfdata->border->lock_user_location = cfdata->lock.user.location;
cfdata->border->lock_user_size = cfdata->lock.user.size;
cfdata->border->lock_user_stacking = cfdata->lock.user.stacking;
cfdata->border->lock_user_iconify = cfdata->lock.user.iconify;
cfdata->border->lock_user_desk = cfdata->lock.user.desk;
cfdata->border->lock_user_sticky = cfdata->lock.user.sticky;
cfdata->border->lock_user_shade = cfdata->lock.user.shade;
cfdata->border->lock_user_maximize = cfdata->lock.user.maximize;
cfdata->border->lock_user_fullscreen = cfdata->lock.user.fullscreen;
cfdata->border->lock_client_location = cfdata->lock.client.location;
cfdata->border->lock_client_size = cfdata->lock.client.size;
cfdata->border->lock_client_stacking = cfdata->lock.client.stacking;
cfdata->border->lock_client_iconify = cfdata->lock.client.iconify;
cfdata->border->lock_client_desk = cfdata->lock.client.desk;
cfdata->border->lock_client_sticky = cfdata->lock.client.sticky;
cfdata->border->lock_client_shade = cfdata->lock.client.shade;
cfdata->border->lock_client_maximize = cfdata->lock.client.maximize;
cfdata->border->lock_client_fullscreen = cfdata->lock.client.fullscreen;
cfdata->border->lock_border = cfdata->lock.border;
cfdata->border->lock_close = cfdata->lock.close;
cfdata->border->lock_focus_in = cfdata->lock.focus_in;
cfdata->border->lock_focus_out = cfdata->lock.focus_out;
cfdata->border->lock_life = cfdata->lock.life;
cfdata->client->lock_user_location = cfdata->lock.user.location;
cfdata->client->lock_user_size = cfdata->lock.user.size;
cfdata->client->lock_user_stacking = cfdata->lock.user.stacking;
cfdata->client->lock_user_iconify = cfdata->lock.user.iconify;
cfdata->client->lock_user_desk = cfdata->lock.user.desk;
cfdata->client->lock_user_sticky = cfdata->lock.user.sticky;
cfdata->client->lock_user_shade = cfdata->lock.user.shade;
cfdata->client->lock_user_maximize = cfdata->lock.user.maximize;
cfdata->client->lock_user_fullscreen = cfdata->lock.user.fullscreen;
cfdata->client->lock_client_location = cfdata->lock.client.location;
cfdata->client->lock_client_size = cfdata->lock.client.size;
cfdata->client->lock_client_stacking = cfdata->lock.client.stacking;
cfdata->client->lock_client_iconify = cfdata->lock.client.iconify;
cfdata->client->lock_client_desk = cfdata->lock.client.desk;
cfdata->client->lock_client_sticky = cfdata->lock.client.sticky;
cfdata->client->lock_client_shade = cfdata->lock.client.shade;
cfdata->client->lock_client_maximize = cfdata->lock.client.maximize;
cfdata->client->lock_client_fullscreen = cfdata->lock.client.fullscreen;
cfdata->client->lock_border = cfdata->lock.border;
cfdata->client->lock_close = cfdata->lock.close;
cfdata->client->lock_focus_in = cfdata->lock.focus_in;
cfdata->client->lock_focus_out = cfdata->lock.focus_out;
cfdata->client->lock_life = cfdata->lock.life;
if (cfdata->lock.remember)
{
if (!cfdata->border->remember)
if (!cfdata->client->remember)
{
cfdata->border->remember = e_remember_new();
if (cfdata->border->remember)
e_remember_use(cfdata->border->remember);
cfdata->client->remember = e_remember_new();
if (cfdata->client->remember)
e_remember_use(cfdata->client->remember);
}
if (cfdata->border->remember)
if (cfdata->client->remember)
{
cfdata->border->remember->apply |= E_REMEMBER_APPLY_LOCKS;
e_remember_default_match_set(cfdata->border->remember, cfdata->border);
e_remember_update(cfdata->border);
cfdata->client->remember->apply |= E_REMEMBER_APPLY_LOCKS;
e_remember_default_match_set(cfdata->client->remember, cfdata->client);
e_remember_update(cfdata->client);
}
}
else
{
if (cfdata->border->remember)
if (cfdata->client->remember)
{
cfdata->border->remember->apply &= ~E_REMEMBER_APPLY_LOCKS;
if (cfdata->border->remember->apply == 0)
cfdata->client->remember->apply &= ~E_REMEMBER_APPLY_LOCKS;
if (cfdata->client->remember->apply == 0)
{
e_remember_unuse(cfdata->border->remember);
e_remember_del(cfdata->border->remember);
cfdata->border->remember = NULL;
e_remember_unuse(cfdata->client->remember);
e_remember_del(cfdata->client->remember);
cfdata->client->remember = NULL;
}
}
}

View File

@ -3,7 +3,7 @@
#ifndef E_INT_BORDER_LOCKS_H
#define E_INT_BORDER_LOCKS_H
EAPI void e_int_border_locks(E_Border *bd);
EAPI void e_int_client_locks(E_Client *ec);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_BORDER_MENU_H
#define E_INT_BORDER_MENU_H
typedef void (*E_Client_Menu_Hook_Cb)(void *, E_Client *);
typedef struct E_Client_Menu_Hook
{
E_Client_Menu_Hook_Cb cb;
void *data;
} E_Client_Menu_Hook;
EAPI E_Client_Menu_Hook *e_int_client_menu_hook_add(E_Client_Menu_Hook_Cb cb, const void *data);
EAPI void e_int_client_menu_hook_del(E_Client_Menu_Hook *hook);
EAPI void e_int_client_menu_hooks_clear(void);
EAPI void e_int_client_menu_create(E_Client *ec);
EAPI void e_int_client_menu_show(E_Client *ec, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp);
EAPI void e_int_client_menu_del(E_Client *ec);
#endif
#endif

View File

@ -6,17 +6,17 @@
#define MODE_GEOMETRY_LOCKS 3
#define MODE_ALL 4
static void _bd_cb_dialog_del(void *obj);
static void _bd_cb_dialog_close(void *data, E_Dialog *dia);
static Evas_Object *_bd_icccm_create(E_Dialog *dia, void *data);
static Evas_Object *_bd_netwm_create(E_Dialog *dia, void *data);
static void _bd_go(void *data, void *data2);
static void _create_data(E_Dialog *cfd, E_Border *bd);
static void _ec_cb_dialog_del(void *obj);
static void _ec_cb_dialog_close(void *data, E_Dialog *dia);
static Evas_Object *_ec_icccm_create(E_Dialog *dia, void *data);
static Evas_Object *_ec_netwm_create(E_Dialog *dia, void *data);
static void _ec_go(void *data, void *data2);
static void _create_data(E_Dialog *cfd, E_Client *ec);
static void _free_data(E_Dialog *cfd, E_Config_Dialog_Data *cfdata);
struct _E_Config_Dialog_Data
{
E_Border *border;
E_Client *client;
/*- BASIC -*/
struct
{
@ -65,89 +65,89 @@ struct _E_Config_Dialog_Data
};
EAPI void
e_int_border_prop(E_Border *bd)
e_int_client_prop(E_Client *ec)
{
E_Dialog *dia;
if (bd->border_prop_dialog) return;
if (ec->border_prop_dialog) return;
dia = e_dialog_new(bd->zone->container, "E", "_window_props");
e_object_del_attach_func_set(E_OBJECT(dia), _bd_cb_dialog_del);
dia = e_dialog_new(ec->zone->comp, "E", "_window_props");
e_object_del_attach_func_set(E_OBJECT(dia), _ec_cb_dialog_del);
_create_data(dia, bd);
_create_data(dia, ec);
_bd_go(dia, (void *)0);
_ec_go(dia, (void *)0);
e_dialog_button_add(dia, _("Close"), NULL, _bd_cb_dialog_close, dia);
e_dialog_button_add(dia, _("Close"), NULL, _ec_cb_dialog_close, dia);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
e_dialog_border_icon_set(dia, "preferences-system-windows");
}
static void
_create_data(E_Dialog *cfd, E_Border *bd)
_create_data(E_Dialog *cfd, E_Client *ec)
{
E_Config_Dialog_Data *cfdata;
char buf[4096];
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->border = bd;
bd->border_prop_dialog = cfd;
cfdata->client = ec;
ec->border_prop_dialog = cfd;
#define IFDUP(prop, dest) \
if (cfdata->border->prop) \
cfdata->dest = strdup(cfdata->border->prop)
if (cfdata->client->prop) \
cfdata->dest = strdup(cfdata->client->prop)
IFDUP(client.icccm.title, icccm.title);
IFDUP(client.icccm.name, icccm.name);
IFDUP(client.icccm.class, icccm.class);
IFDUP(client.icccm.icon_name, icccm.icon_name);
IFDUP(client.icccm.machine, icccm.machine);
IFDUP(client.icccm.window_role, icccm.role);
IFDUP(icccm.title, icccm.title);
IFDUP(icccm.name, icccm.name);
IFDUP(icccm.class, icccm.class);
IFDUP(icccm.icon_name, icccm.icon_name);
IFDUP(icccm.machine, icccm.machine);
IFDUP(icccm.window_role, icccm.role);
if (cfdata->border->client.icccm.min_w >= 0)
if (cfdata->client->icccm.min_w >= 0)
{
snprintf(buf, sizeof(buf), _("%i×%i"),
cfdata->border->client.icccm.min_w,
cfdata->border->client.icccm.min_h);
cfdata->client->icccm.min_w,
cfdata->client->icccm.min_h);
cfdata->icccm.min = strdup(buf);
}
if (cfdata->border->client.icccm.max_w >= 0)
if (cfdata->client->icccm.max_w >= 0)
{
snprintf(buf, sizeof(buf), _("%i×%i"),
cfdata->border->client.icccm.max_w,
cfdata->border->client.icccm.max_h);
cfdata->client->icccm.max_w,
cfdata->client->icccm.max_h);
cfdata->icccm.max = strdup(buf);
}
if (cfdata->border->client.icccm.base_w >= 0)
if (cfdata->client->icccm.base_w >= 0)
{
snprintf(buf, sizeof(buf), _("%i×%i"),
cfdata->border->client.icccm.base_w,
cfdata->border->client.icccm.base_h);
cfdata->client->icccm.base_w,
cfdata->client->icccm.base_h);
cfdata->icccm.base = strdup(buf);
}
if (cfdata->border->client.icccm.step_w >= 0)
if (cfdata->client->icccm.step_w >= 0)
{
snprintf(buf, sizeof(buf), _("%i,%i"),
cfdata->border->client.icccm.step_w,
cfdata->border->client.icccm.step_h);
cfdata->client->icccm.step_w,
cfdata->client->icccm.step_h);
cfdata->icccm.step = strdup(buf);
}
if ((cfdata->border->client.icccm.min_aspect > 0.0) &&
(cfdata->border->client.icccm.max_aspect > 0.0))
if ((cfdata->client->icccm.min_aspect > 0.0) &&
(cfdata->client->icccm.max_aspect > 0.0))
{
if (cfdata->border->client.icccm.min_aspect == cfdata->border->client.icccm.max_aspect)
if (cfdata->client->icccm.min_aspect == cfdata->client->icccm.max_aspect)
snprintf(buf, sizeof(buf), _("%1.3f"),
cfdata->border->client.icccm.min_aspect);
cfdata->client->icccm.min_aspect);
else
snprintf(buf, sizeof(buf), _("%1.3f%1.3f"),
cfdata->border->client.icccm.min_aspect,
cfdata->border->client.icccm.max_aspect);
cfdata->client->icccm.min_aspect,
cfdata->client->icccm.max_aspect);
cfdata->icccm.aspect = strdup(buf);
}
if (cfdata->border->client.icccm.initial_state != ECORE_X_WINDOW_STATE_HINT_NONE)
if (cfdata->client->icccm.initial_state != ECORE_X_WINDOW_STATE_HINT_NONE)
{
switch (cfdata->border->client.icccm.initial_state)
switch (cfdata->client->icccm.initial_state)
{
case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
snprintf(buf, sizeof(buf), _("Withdrawn"));
@ -167,9 +167,9 @@ _create_data(E_Dialog *cfd, E_Border *bd)
}
cfdata->icccm.initial_state = strdup(buf);
}
if (cfdata->border->client.icccm.state != ECORE_X_WINDOW_STATE_HINT_NONE)
if (cfdata->client->icccm.state != ECORE_X_WINDOW_STATE_HINT_NONE)
{
switch (cfdata->border->client.icccm.state)
switch (cfdata->client->icccm.state)
{
case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
snprintf(buf, sizeof(buf), _("Withdrawn"));
@ -190,27 +190,27 @@ _create_data(E_Dialog *cfd, E_Border *bd)
cfdata->icccm.state = strdup(buf);
}
snprintf(buf, sizeof(buf), "0x%08x",
cfdata->border->client.win);
(unsigned int)e_client_util_win_get(cfdata->client));
cfdata->icccm.window_id = strdup(buf);
if (cfdata->border->client.icccm.window_group != 0)
if (cfdata->client->icccm.window_group != 0)
{
snprintf(buf, sizeof(buf), "0x%08x",
cfdata->border->client.icccm.window_group);
cfdata->client->icccm.window_group);
cfdata->icccm.window_group = strdup(buf);
}
if (cfdata->border->client.icccm.transient_for != 0)
if (cfdata->client->icccm.transient_for != 0)
{
snprintf(buf, sizeof(buf), "0x%08x",
cfdata->border->client.icccm.transient_for);
cfdata->client->icccm.transient_for);
cfdata->icccm.transient_for = strdup(buf);
}
if (cfdata->border->client.icccm.client_leader != 0)
if (cfdata->client->icccm.client_leader != 0)
{
snprintf(buf, sizeof(buf), "0x%08x",
cfdata->border->client.icccm.client_leader);
cfdata->client->icccm.client_leader);
cfdata->icccm.client_leader = strdup(buf);
}
switch (cfdata->border->client.icccm.gravity)
switch (cfdata->client->icccm.gravity)
{
case ECORE_X_GRAVITY_FORGET:
snprintf(buf, sizeof(buf), _("Forget/Unmap"));
@ -261,38 +261,38 @@ _create_data(E_Dialog *cfd, E_Border *bd)
break;
}
cfdata->icccm.gravity = strdup(buf);
if (cfdata->border->client.icccm.command.argv)
if (cfdata->client->icccm.command.argv)
{
int i;
buf[0] = 0;
for (i = 0; i < cfdata->border->client.icccm.command.argc; i++)
for (i = 0; i < cfdata->client->icccm.command.argc; i++)
{
if ((sizeof(buf) - strlen(buf)) <
(strlen(cfdata->border->client.icccm.command.argv[i]) - 2))
(strlen(cfdata->client->icccm.command.argv[i]) - 2))
break;
strcat(buf, cfdata->border->client.icccm.command.argv[i]);
strcat(buf, cfdata->client->icccm.command.argv[i]);
strcat(buf, " ");
}
cfdata->icccm.command = strdup(buf);
}
cfdata->icccm.take_focus = cfdata->border->client.icccm.take_focus;
cfdata->icccm.accepts_focus = cfdata->border->client.icccm.accepts_focus;
cfdata->icccm.urgent = cfdata->border->client.icccm.urgent;
cfdata->icccm.delete_request = cfdata->border->client.icccm.delete_request;
cfdata->icccm.request_pos = cfdata->border->client.icccm.request_pos;
cfdata->icccm.take_focus = cfdata->client->icccm.take_focus;
cfdata->icccm.accepts_focus = cfdata->client->icccm.accepts_focus;
cfdata->icccm.urgent = cfdata->client->icccm.urgent;
cfdata->icccm.delete_request = cfdata->client->icccm.delete_request;
cfdata->icccm.request_pos = cfdata->client->icccm.request_pos;
IFDUP(client.netwm.name, netwm.name);
IFDUP(client.netwm.icon_name, netwm.icon_name);
cfdata->netwm.modal = cfdata->border->client.netwm.state.modal;
cfdata->netwm.sticky = cfdata->border->client.netwm.state.sticky;
cfdata->netwm.shaded = cfdata->border->client.netwm.state.shaded;
cfdata->netwm.skip_taskbar = cfdata->border->client.netwm.state.skip_taskbar;
cfdata->netwm.skip_pager = cfdata->border->client.netwm.state.skip_pager;
cfdata->netwm.hidden = cfdata->border->client.netwm.state.hidden;
cfdata->netwm.fullscreen = cfdata->border->client.netwm.state.fullscreen;
switch (cfdata->border->client.netwm.state.stacking)
IFDUP(netwm.name, netwm.name);
IFDUP(netwm.icon_name, netwm.icon_name);
cfdata->netwm.modal = cfdata->client->netwm.state.modal;
cfdata->netwm.sticky = cfdata->client->netwm.state.sticky;
cfdata->netwm.shaded = cfdata->client->netwm.state.shaded;
cfdata->netwm.skip_taskbar = cfdata->client->netwm.state.skip_taskbar;
cfdata->netwm.skip_pager = cfdata->client->netwm.state.skip_pager;
cfdata->netwm.hidden = cfdata->client->netwm.state.hidden;
cfdata->netwm.fullscreen = cfdata->client->netwm.state.fullscreen;
switch (cfdata->client->netwm.state.stacking)
{
case 0:
cfdata->netwm.stacking = strdup(_("None"));
@ -313,8 +313,8 @@ _create_data(E_Dialog *cfd, E_Border *bd)
static void
_free_data(E_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
if (cfdata->border)
cfdata->border->border_prop_dialog = NULL;
if (cfdata->client)
cfdata->client->border_prop_dialog = NULL;
/* Free the cfdata */
#define IFREE(x) E_FREE(cfdata->x)
@ -347,7 +347,7 @@ _free_data(E_Dialog *cfd, E_Config_Dialog_Data *cfdata)
}
static void
_bd_cb_dialog_del(void *obj)
_ec_cb_dialog_del(void *obj)
{
E_Dialog *dia;
@ -357,7 +357,7 @@ _bd_cb_dialog_del(void *obj)
}
static void
_bd_cb_dialog_close(void *data __UNUSED__, E_Dialog *dia)
_ec_cb_dialog_close(void *data __UNUSED__, E_Dialog *dia)
{
if (dia->data)
_free_data(dia, dia->data);
@ -365,7 +365,7 @@ _bd_cb_dialog_close(void *data __UNUSED__, E_Dialog *dia)
}
static void
_bd_go(void *data, void *data2)
_ec_go(void *data, void *data2)
{
E_Dialog *dia;
Evas_Object *c, *o, *ob;
@ -381,19 +381,19 @@ _bd_go(void *data, void *data2)
if (!data2)
{
o = _bd_icccm_create(dia, NULL);
o = _ec_icccm_create(dia, NULL);
e_dialog_title_set(dia, _("ICCCM Properties"));
e_widget_list_object_append(c, o, 1, 1, 0.0);
ob = e_widget_button_add(e_win_evas_get(dia->win), _("NetWM"), "go-next",
_bd_go, dia, (void *)1);
_ec_go, dia, (void *)1);
}
else
{
o = _bd_netwm_create(dia, NULL);
o = _ec_netwm_create(dia, NULL);
e_dialog_title_set(dia, _("NetWM Properties"));
e_widget_list_object_append(c, o, 1, 1, 0.0);
ob = e_widget_button_add(e_win_evas_get(dia->win), _("ICCCM"), "go-next",
_bd_go, dia, (void *)0);
_ec_go, dia, (void *)0);
}
e_widget_list_object_append(c, ob, 0, 0, 1.0);
@ -425,7 +425,7 @@ _bd_go(void *data, void *data2)
}
static Evas_Object *
_bd_icccm_create(E_Dialog *dia, void *data __UNUSED__)
_ec_icccm_create(E_Dialog *dia, void *data __UNUSED__)
{
Evas *evas;
Evas_Object *o, *ob, *otb;
@ -481,7 +481,7 @@ _bd_icccm_create(E_Dialog *dia, void *data __UNUSED__)
}
static Evas_Object *
_bd_netwm_create(E_Dialog *dia, void *data __UNUSED__)
_ec_netwm_create(E_Dialog *dia, void *data __UNUSED__)
{
Evas *evas;
Evas_Object *o, *ob, *otb;

View File

@ -3,7 +3,7 @@
#ifndef E_INT_BORDER_PROP_H
#define E_INT_BORDER_PROP_H
EAPI void e_int_border_prop(E_Border *bd);
EAPI void e_int_client_prop(E_Client *ec);
#endif
#endif

View File

@ -21,7 +21,7 @@ static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E
E_REMEMBER_APPLY_OFFER_RESISTANCE | E_REMEMBER_APPLY_OPACITY
struct _E_Config_Dialog_Data
{
E_Border *border;
E_Client *client;
E_Remember *rem;
/*- BASIC -*/
int mode;
@ -69,7 +69,7 @@ struct _E_Config_Dialog_Data
/* a nice easy setup function that does the dirty work */
EAPI E_Config_Dialog *
e_int_border_remember_edit(E_Remember *rem)
e_int_client_remember_edit(E_Remember *rem)
{
E_Config_Dialog_View *v;
@ -81,14 +81,14 @@ e_int_border_remember_edit(E_Remember *rem)
v->basic.create_widgets = _advanced_create_widgets;
v->override_auto_apply = 1;
/* create config dialog for bd object/data */
/* create config dialog for ec object/data */
return e_config_dialog_new(NULL, _("Window Remember"),
"E", "_border_remember_edit_dialog",
NULL, 0, v, rem);
}
EAPI void
e_int_border_remember(E_Border *bd)
e_int_client_remember(E_Client *ec)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
@ -105,12 +105,12 @@ e_int_border_remember(E_Border *bd)
v->advanced.create_widgets = _advanced_create_widgets;
v->override_auto_apply = 1;
/* create config dialog for bd object/data */
cfd = e_config_dialog_new(bd->zone->container,
/* create config dialog for ec object/data */
cfd = e_config_dialog_new(ec->zone->comp,
_("Window Remember"),
"E", "_border_remember_dialog",
NULL, 0, v, bd);
bd->border_remember_dialog = cfd;
NULL, 0, v, ec);
ec->border_remember_dialog = cfd;
}
}
@ -131,12 +131,12 @@ _clear_data(E_Config_Dialog_Data *cfdata)
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
E_Border *bd;
E_Client *ec;
E_Remember *rem;
bd = cfdata->border;
if (bd)
rem = bd->remember;
ec = cfdata->client;
if (ec)
rem = ec->remember;
else
rem = cfdata->rem;
@ -158,64 +158,64 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->remember.apply_desktop_file = 1;
}
if (bd)
if (ec)
{
if (!cfdata->name &&
bd->client.icccm.name &&
bd->client.icccm.name[0])
cfdata->name = strdup(bd->client.icccm.name);
ec->icccm.name &&
ec->icccm.name[0])
cfdata->name = strdup(ec->icccm.name);
if (!cfdata->class &&
bd->client.icccm.class &&
bd->client.icccm.class[0])
cfdata->class = strdup(bd->client.icccm.class);
ec->icccm.class &&
ec->icccm.class[0])
cfdata->class = strdup(ec->icccm.class);
if (!cfdata->role &&
bd->client.icccm.window_role &&
bd->client.icccm.window_role[0])
cfdata->role = strdup(bd->client.icccm.window_role);
ec->icccm.window_role &&
ec->icccm.window_role[0])
cfdata->role = strdup(ec->icccm.window_role);
if (!cfdata->title)
{
const char *title = e_border_name_get(bd);
const char *title = e_client_name_get(ec);
if (title && title[0])
cfdata->title = strdup(title);
}
if (!cfdata->desktop && bd->desktop)
cfdata->desktop = strdup(bd->desktop->name);
if (!cfdata->desktop && ec->desktop)
cfdata->desktop = strdup(ec->desktop->name);
if (!cfdata->command &&
(bd->client.icccm.command.argc > 0) &&
(bd->client.icccm.command.argv))
(ec->icccm.command.argc > 0) &&
(ec->icccm.command.argv))
{
char buf[4096];
int i, j, k;
buf[0] = 0;
k = 0;
for (i = 0; i < bd->client.icccm.command.argc; i++)
for (i = 0; i < ec->icccm.command.argc; i++)
{
if (i > 0)
{
buf[k] = ' ';
k++;
}
for (j = 0; bd->client.icccm.command.argv[i][j]; j++)
for (j = 0; ec->icccm.command.argv[i][j]; j++)
{
if (k >= (int)(sizeof(buf) - 10))
{
buf[k] = 0;
goto done;
}
if ((bd->client.icccm.command.argv[i][j] == ' ') ||
(bd->client.icccm.command.argv[i][j] == '\t') ||
(bd->client.icccm.command.argv[i][j] == '\\') ||
(bd->client.icccm.command.argv[i][j] == '\"') ||
(bd->client.icccm.command.argv[i][j] == '\'') ||
(bd->client.icccm.command.argv[i][j] == '$') ||
(bd->client.icccm.command.argv[i][j] == '%'))
if ((ec->icccm.command.argv[i][j] == ' ') ||
(ec->icccm.command.argv[i][j] == '\t') ||
(ec->icccm.command.argv[i][j] == '\\') ||
(ec->icccm.command.argv[i][j] == '\"') ||
(ec->icccm.command.argv[i][j] == '\'') ||
(ec->icccm.command.argv[i][j] == '$') ||
(ec->icccm.command.argv[i][j] == '%'))
{
buf[k] = '\\';
k++;
}
buf[k] = bd->client.icccm.command.argv[i][j];
buf[k] = ec->icccm.command.argv[i][j];
k++;
}
}
@ -295,7 +295,7 @@ _create_data(E_Config_Dialog *cfd)
cfdata = E_NEW(E_Config_Dialog_Data, 1);
if (!strcmp(cfd->class, "_border_remember_dialog"))
cfdata->border = cfd->data;
cfdata->client = cfd->data;
else
cfdata->rem = cfd->data;
cfdata->applied = 1;
@ -313,26 +313,26 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
free(cfdata->command);
free(cfdata->desktop);
if (cfdata->border)
if (cfdata->client)
{
if (!cfdata->applied && cfdata->border->remember)
if (!cfdata->applied && cfdata->client->remember)
{
e_remember_unuse(cfdata->border->remember);
e_remember_del(cfdata->border->remember);
e_remember_unuse(cfdata->client->remember);
e_remember_del(cfdata->client->remember);
e_config_save_queue();
}
cfdata->border->border_remember_dialog = NULL;
cfdata->client->border_remember_dialog = NULL;
}
free(cfdata);
}
static void
_warning_dialog_show(E_Container *con)
_warning_dialog_show(E_Comp *c)
{
E_Dialog *dia;
dia = e_dialog_new(con, "E", "_border_remember_error_multi_dialog");
dia = e_dialog_new(c, "E", "_border_remember_error_multi_dialog");
e_dialog_title_set(dia, _("Window properties are not a unique match"));
e_dialog_text_set
(dia,
@ -358,52 +358,54 @@ _warning_dialog_show(E_Container *con)
static int
_check_matches(E_Remember *rem, int update)
{
Eina_List *l;
E_Border *bd;
const Eina_List *l, *ll;
E_Client *ec;
E_Comp *c;
const char *title;
int n = 0;
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
int match = rem->match;
title = e_border_name_get(bd);
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->clients, ll, ec)
{
int match = rem->match;
title = e_client_name_get(ec);
if ((match & E_REMEMBER_MATCH_NAME) &&
(e_util_glob_match(bd->client.icccm.name, rem->name)))
match &= ~E_REMEMBER_MATCH_NAME;
if ((match & E_REMEMBER_MATCH_NAME) &&
(e_util_glob_match(ec->icccm.name, rem->name)))
match &= ~E_REMEMBER_MATCH_NAME;
if ((match & E_REMEMBER_MATCH_CLASS) &&
(e_util_glob_match(bd->client.icccm.class, rem->class)))
match &= ~E_REMEMBER_MATCH_CLASS;
if ((match & E_REMEMBER_MATCH_CLASS) &&
(e_util_glob_match(ec->icccm.class, rem->class)))
match &= ~E_REMEMBER_MATCH_CLASS;
if ((match & E_REMEMBER_MATCH_TITLE) &&
(e_util_glob_match(title, rem->title)))
match &= ~E_REMEMBER_MATCH_TITLE;
if ((match & E_REMEMBER_MATCH_TITLE) &&
(e_util_glob_match(title, rem->title)))
match &= ~E_REMEMBER_MATCH_TITLE;
if ((match & E_REMEMBER_MATCH_ROLE) &&
((!e_util_strcmp(rem->role, bd->client.icccm.window_role)) ||
(e_util_both_str_empty(rem->role, bd->client.icccm.window_role))))
match &= ~E_REMEMBER_MATCH_ROLE;
if ((match & E_REMEMBER_MATCH_ROLE) &&
((!e_util_strcmp(rem->role, ec->icccm.window_role)) ||
(e_util_both_str_empty(rem->role, ec->icccm.window_role))))
match &= ~E_REMEMBER_MATCH_ROLE;
if ((match & E_REMEMBER_MATCH_TYPE) &&
(rem->type == (int)bd->client.netwm.type))
match &= ~E_REMEMBER_MATCH_TYPE;
if ((match & E_REMEMBER_MATCH_TYPE) &&
(rem->type == (int)ec->netwm.type))
match &= ~E_REMEMBER_MATCH_TYPE;
if ((match & E_REMEMBER_MATCH_TRANSIENT) &&
((rem->transient && bd->client.icccm.transient_for != 0) ||
(!rem->transient && (bd->client.icccm.transient_for == 0))))
match &= ~E_REMEMBER_MATCH_TRANSIENT;
if ((match & E_REMEMBER_MATCH_TRANSIENT) &&
((rem->transient && ec->icccm.transient_for != 0) ||
(!rem->transient && (ec->icccm.transient_for == 0))))
match &= ~E_REMEMBER_MATCH_TRANSIENT;
if (match == 0) n++;
if (match == 0) n++;
if (update)
{
bd->changed = 1;
bd->changes.icon = 1;
}
else if (n > 1)
break;
}
if (update)
{
ec->changed = 1;
ec->changes.icon = 1;
}
else if (n > 1)
break;
}
return n;
}
@ -411,8 +413,8 @@ static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
/* Actually take our cfdata settings and apply them in real life */
E_Border *bd = cfdata->border;
E_Remember *rem = bd->remember;
E_Client *ec = cfdata->client;
E_Remember *rem = ec->remember;
if (cfdata->mode == MODE_NOTHING)
{
@ -430,18 +432,18 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
rem = e_remember_new();
if (rem)
{
bd->remember = rem;
ec->remember = rem;
cfdata->applied = 0;
}
else
return 0;
}
e_remember_default_match_set(rem, cfdata->border);
e_remember_default_match_set(rem, cfdata->client);
if ((!cfdata->warned) && (_check_matches(rem, 0) > 1))
{
_warning_dialog_show(cfd->con);
_warning_dialog_show(cfd->comp);
cfdata->warned = 1;
return 0;
}
@ -450,7 +452,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
rem->apply_first_only = 0;
e_remember_use(rem);
e_remember_update(bd);
e_remember_update(ec);
cfdata->applied = 1;
e_config_save_queue();
return 1; /* Apply was OK */
@ -459,10 +461,10 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
static int
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
E_Border *bd = cfdata->border;
E_Client *ec = cfdata->client;
E_Remember *rem;
if (bd) rem = bd->remember;
if (ec) rem = ec->remember;
else rem = cfdata->rem;
if (!rem)
@ -513,18 +515,18 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
rem->match |= E_REMEMBER_MATCH_ROLE;
rem->role = eina_stringshare_add(cfdata->role);
}
if (bd)
if (ec)
{
if (cfdata->remember.match_type)
{
rem->match |= E_REMEMBER_MATCH_TYPE;
rem->type = bd->client.netwm.type;
rem->type = ec->netwm.type;
}
if (cfdata->remember.match_transient)
{
rem->match |= E_REMEMBER_MATCH_TRANSIENT;
if (bd->client.icccm.transient_for != 0)
if (ec->icccm.transient_for != 0)
rem->transient = 1;
else
rem->transient = 0;
@ -535,7 +537,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
E_Dialog *dia;
dia = e_dialog_new(cfd->con, "E", "_border_remember_error_noprop_dialog");
dia = e_dialog_new(cfd->comp, "E", "_border_remember_error_noprop_dialog");
e_dialog_title_set(dia, _("No match properties set"));
e_dialog_text_set
(dia,
@ -548,8 +550,8 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
if (bd)
cfdata->border->remember = rem;
if (ec)
cfdata->client->remember = rem;
return 0;
}
@ -561,7 +563,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if ((!cfdata->remember.apply_first_only) &&
(_check_matches(rem, 0) > 1))
{
_warning_dialog_show(cfd->con);
_warning_dialog_show(cfd->comp);
cfdata->warned = 1;
return 0;
}
@ -610,21 +612,21 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if (cfdata->remember.apply_opacity)
rem->apply |= E_REMEMBER_APPLY_OPACITY;
if (bd && (!rem->apply && !rem->prop.desktop_file))
if (ec && (!rem->apply && !rem->prop.desktop_file))
{
e_remember_unuse(rem);
e_remember_del(rem);
if (cfdata->border->remember)
if (cfdata->client->remember)
e_config_save_queue();
return 1;
}
if (bd)
if (ec)
{
_check_matches(rem, 1);
rem->keep_settings = 0;
cfdata->border->remember = rem;
e_remember_update(cfdata->border);
cfdata->client->remember = rem;
e_remember_update(cfdata->client);
cfdata->applied = 1;
}
rem->keep_settings = cfdata->remember.keep_settings;
@ -717,9 +719,9 @@ _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_D
{
cfdata->remember.match_role = 0;
}
if (cfdata->border)
if (cfdata->client)
{
if (cfdata->border->client.netwm.type != ECORE_X_WINDOW_TYPE_UNKNOWN)
if (cfdata->client->netwm.type != E_WINDOW_TYPE_UNKNOWN)
{
ob = e_widget_check_add(evas, _("Window type"),
&(cfdata->remember.match_type));

View File

@ -0,0 +1,10 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_BORDER_REMEMBER_H
#define E_INT_BORDER_REMEMBER_H
EAPI void e_int_client_remember(E_Client *ec);
EAPI E_Config_Dialog *e_int_client_remember_edit(E_Remember *rem);
#endif
#endif

View File

@ -83,7 +83,7 @@ static void _btn_cb_unload(void *data, void *data2);
static void _btn_cb_load(void *data, void *data2);
EAPI E_Config_Dialog *
e_int_config_modules(E_Container *con, const char *params __UNUSED__)
e_int_config_modules(E_Comp *c, const char *params __UNUSED__)
{
E_Config_Dialog *cfd = NULL;
E_Config_Dialog_View *v = NULL;
@ -95,7 +95,7 @@ e_int_config_modules(E_Container *con, const char *params __UNUSED__)
v->free_cfdata = _free_data;
v->basic.create_widgets = _basic_create;
cfd = e_config_dialog_new(con, _("Module Settings"),
cfd = e_config_dialog_new(c, _("Module Settings"),
"E", "extensions/modules",
"preferences-plugin", 0, v, NULL);
return cfd;

View File

@ -3,7 +3,7 @@
#ifndef E_INT_CONFIG_MODULES_H
#define E_INT_CONFIG_MODULES_H
EAPI E_Config_Dialog *e_int_config_modules(E_Container *con, const char *params);
EAPI E_Config_Dialog *e_int_config_modules(E_Comp *c, const char *params);
#endif
#endif

View File

@ -51,12 +51,11 @@ static void
_create_dialog(E_Gadcon *gc, const char *title, E_Gadcon_Site site)
{
E_Config_Dialog_View *v;
E_Container *con;
if (gc->config_dialog)
{
e_win_raise(gc->config_dialog->dia->win);
e_border_focus_set(gc->config_dialog->dia->win->border, 1, 1);
evas_object_focus_set(gc->config_dialog->dia->win->client->frame, 1);
return;
}
if (!(v = E_NEW(E_Config_Dialog_View, 1))) return;
@ -66,9 +65,8 @@ _create_dialog(E_Gadcon *gc, const char *title, E_Gadcon_Site site)
v->basic.create_widgets = _basic_create;
v->advanced.create_widgets = _advanced_create;
con = e_container_current_get(e_manager_current_get());
gc->config_dialog =
e_config_dialog_new(con, title, "E", "_gadcon_config_dialog",
e_config_dialog_new(NULL, title, "E", "_gadcon_config_dialog",
"preferences-desktop-shelf", 0, v, gc);
if (site) gc->config_dialog->cfdata->site = site;
e_win_centered_set(gc->config_dialog->dia->win, EINA_TRUE);

View File

@ -26,7 +26,7 @@ static void _e_int_menus_apps_drag(void *data, E_Menu *m, E_Menu_Item *m
static void _e_int_menus_config_pre_cb(void *data, E_Menu *m);
static void _e_int_menus_config_free_hook(void *obj);
static void _e_int_menus_clients_pre_cb(void *data, E_Menu *m);
static void _e_int_menus_clients_item_create(E_Border *bd, E_Menu *m);
static void _e_int_menus_clients_item_create(E_Client *ec, E_Menu *m);
static void _e_int_menus_clients_free_hook(void *obj);
static void _e_int_menus_clients_item_cb(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_int_menus_clients_icon_cb(void *data, E_Menu *m, E_Menu_Item *mi);
@ -35,10 +35,10 @@ static int _e_int_menus_clients_group_desk_cb(const void *d1, const voi
static int _e_int_menus_clients_group_class_cb(const void *d1, const void *d2);
static int _e_int_menus_clients_sort_alpha_cb(const void *d1, const void *d2);
static int _e_int_menus_clients_sort_z_order_cb(const void *d1, const void *d2);
static void _e_int_menus_clients_add_by_class(Eina_List *borders, E_Menu *m);
static void _e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *m);
static void _e_int_menus_clients_add_by_none(Eina_List *borders, E_Menu *m);
static void _e_int_menus_clients_menu_add_iconified(Eina_List *borders, E_Menu *m);
static void _e_int_menus_clients_add_by_class(Eina_List *clients, E_Menu *m);
static void _e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *clients, E_Menu *m);
static void _e_int_menus_clients_add_by_none(Eina_List *clients, E_Menu *m);
static void _e_int_menus_clients_menu_add_iconified(Eina_List *clients, E_Menu *m);
static const char *_e_int_menus_clients_title_abbrv(const char *title);
static void _e_int_menus_virtuals_pre_cb(void *data, E_Menu *m);
static void _e_int_menus_virtuals_item_cb(void *data, E_Menu *m, E_Menu_Item *mi);
@ -109,7 +109,7 @@ _TEST(void *d __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__)
Evas_Object *o_list;
Evas *e;
dia = e_dialog_normal_win_new(m->zone->container, "E", "_widget_playground_dialog");
dia = e_dialog_normal_win_new(m->zone->comp, "E", "_widget_playground_dialog");
e = e_win_evas_get(dia->win);
o_list = e_widget_ilist_add(e, 32, 32, NULL);
e_dialog_button_add(dia, "Add", NULL, _TEST_ADD, o_list);
@ -587,7 +587,7 @@ _e_int_menus_main_about(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item
{
E_About *about;
about = e_about_new(e_container_current_get(e_manager_current_get()));
about = e_about_new(e_util_comp_current_get());
if (about) e_about_show(about);
}
@ -596,7 +596,7 @@ _e_int_menus_themes_about(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_It
{
E_Theme_About *about;
about = e_theme_about_new(e_container_current_get(e_manager_current_get()));
about = e_theme_about_new(e_util_comp_current_get());
if (about) e_theme_about_show(about);
}
@ -604,7 +604,7 @@ _e_int_menus_themes_about(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_It
static void
_e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
{
e_fwin_new(m->zone->container, "favorites", "/");
e_fwin_new(m->zone->comp, "favorites", "/");
}
*/
@ -988,7 +988,7 @@ _e_int_menus_apps_drag(void *data, E_Menu *m, E_Menu_Item *mi)
evas_object_geometry_get(mi->icon_object, &x, &y, &w, &h);
efreet_desktop_ref(desktop);
drag = e_drag_new(m->zone->container, x, y, drag_types, 1, desktop, -1,
drag = e_drag_new(m->zone->comp, x, y, drag_types, 1, desktop, -1,
NULL, NULL);
size = MIN(w, h);
@ -1062,7 +1062,7 @@ _e_int_menus_desktops_free_hook(void *obj)
static void
_e_int_menus_desk_item_cb(void *data __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__)
{
e_configure_registry_call("screen/virtual_desktops", m->zone->container, NULL);
e_configure_registry_call("screen/virtual_desktops", m->zone->comp, NULL);
}
static void
@ -1088,7 +1088,7 @@ _e_int_menus_virtuals_icon_cb(void *data, E_Menu *m, E_Menu_Item *mi)
tw = 50;
th = (tw * desk->zone->h) / desk->zone->w;
bgfile = e_bg_file_get(desk->zone->container->num, desk->zone->num, desk->x, desk->y);
bgfile = e_bg_file_get(desk->zone->comp->num, desk->zone->num, desk->x, desk->y);
o = e_thumb_icon_add(m->evas);
e_thumb_icon_file_set(o, bgfile, "e/desktop/background");
eina_stringshare_del(bgfile);
@ -1144,18 +1144,18 @@ _e_int_menus_config_free_hook(void *obj)
static int
_e_int_menus_clients_group_desk_cb(const void *d1, const void *d2)
{
const E_Border *bd1;
const E_Border *bd2;
const E_Client *ec1;
const E_Client *ec2;
int j, k;
if (!d1) return 1;
if (!d2) return -1;
bd1 = d1;
bd2 = d2;
ec1 = d1;
ec2 = d2;
j = bd1->desk->y * 12 + bd1->desk->x;
k = bd2->desk->y * 12 + bd2->desk->x;
j = ec1->desk->y * 12 + ec1->desk->x;
k = ec2->desk->y * 12 + ec2->desk->x;
if (j > k) return 1;
if (j < k) return -1;
@ -1165,35 +1165,35 @@ _e_int_menus_clients_group_desk_cb(const void *d1, const void *d2)
static int
_e_int_menus_clients_group_class_cb(const void *d1, const void *d2)
{
const E_Border *bd1, *bd2;
const E_Client *ec1, *ec2;
if (!d1) return 1;
if (!d2) return -1;
bd1 = d1;
bd2 = d2;
ec1 = d1;
ec2 = d2;
if (!bd1->client.icccm.class)
if (!ec1->icccm.class)
return -1;
if (!bd2->client.icccm.class)
if (!ec2->icccm.class)
return 1;
return strcmp(bd1->client.icccm.class, bd2->client.icccm.class) > 0 ? 1 : -1;
return strcmp(ec1->icccm.class, ec2->icccm.class) > 0 ? 1 : -1;
}
static int
_e_int_menus_clients_sort_alpha_cb(const void *d1, const void *d2)
{
const E_Border *bd1, *bd2;
const E_Client *ec1, *ec2;
const char *name1, *name2;
if (!d1) return 1;
if (!d2) return -1;
bd1 = d1;
bd2 = d2;
name1 = e_border_name_get(bd1);
name2 = e_border_name_get(bd2);
ec1 = d1;
ec2 = d2;
name1 = e_client_name_get(ec1);
name2 = e_client_name_get(ec2);
if (strcasecmp(name1, name2) > 0) return 1;
if (strcasecmp(name1, name2) < 0) return -1;
@ -1203,62 +1203,60 @@ _e_int_menus_clients_sort_alpha_cb(const void *d1, const void *d2)
static int
_e_int_menus_clients_sort_z_order_cb(const void *d1, const void *d2)
{
const E_Border *bd1, *bd2;
const E_Client *ec1, *ec2;
if (!d1) return 1;
if (!d2) return -1;
bd1 = d1;
bd2 = d2;
ec1 = d1;
ec2 = d2;
if (bd1->layer < bd2->layer) return 1;
if (bd1->layer > bd2->layer) return -1;
if (ec1->layer < ec2->layer) return 1;
if (ec1->layer > ec2->layer) return -1;
return 0;
}
static void
_e_int_menus_clients_menu_add_iconified(Eina_List *borders, E_Menu *m)
_e_int_menus_clients_menu_add_iconified(Eina_List *clients, E_Menu *m)
{
if (eina_list_count(borders) > 0)
{
Eina_List *l = NULL;
E_Border *bd = NULL;
E_Menu_Item *mi = NULL;
Eina_List *l = NULL;
E_Client *ec = NULL;
E_Menu_Item *mi = NULL;
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
if (!eina_list_count(clients)) return;
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
EINA_LIST_FOREACH(borders, l, bd)
_e_int_menus_clients_item_create(bd, m);
}
EINA_LIST_FOREACH(clients, l, ec)
_e_int_menus_clients_item_create(ec, m);
}
static void
_e_int_menus_clients_add_by_class(Eina_List *borders, E_Menu *m)
_e_int_menus_clients_add_by_class(Eina_List *clients, E_Menu *m)
{
Eina_List *l = NULL, *ico = NULL;
E_Border *bd;
E_Client *ec;
E_Menu *subm = NULL;
E_Menu_Item *mi = NULL;
char *class = NULL;
EINA_LIST_FOREACH(borders, l, bd)
EINA_LIST_FOREACH(clients, l, ec)
{
if ((bd->iconic) &&
if ((ec->iconic) &&
(e_config->clientlist_separate_iconified_apps == E_CLIENTLIST_GROUPICONS_SEP))
{
ico = eina_list_append(ico, bd);
ico = eina_list_append(ico, ec);
continue;
}
if (((e_util_strcmp(class, bd->client.icccm.class)) &&
if (((e_util_strcmp(class, ec->icccm.class)) &&
e_config->clientlist_separate_with != E_CLIENTLIST_GROUP_SEP_NONE))
{
if (e_config->clientlist_separate_with == E_CLIENTLIST_GROUP_SEP_MENU)
{
if ((subm) && (mi)) e_menu_item_submenu_set(mi, subm);
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, bd->client.icccm.class);
e_menu_item_label_set(mi, ec->icccm.class);
e_util_menu_item_theme_icon_set(mi, "preferences-system-windows");
subm = e_menu_new();
}
@ -1268,12 +1266,12 @@ _e_int_menus_clients_add_by_class(Eina_List *borders, E_Menu *m)
e_menu_item_separator_set(mi, 1);
}
free(class);
class = strdup(bd->client.icccm.class);
class = strdup(ec->icccm.class);
}
if (subm && (e_config->clientlist_separate_with == E_CLIENTLIST_GROUP_SEP_MENU))
_e_int_menus_clients_item_create(bd, subm);
_e_int_menus_clients_item_create(ec, subm);
else
_e_int_menus_clients_item_create(bd, m);
_e_int_menus_clients_item_create(ec, m);
}
if ((e_config->clientlist_separate_with == E_CLIENTLIST_GROUP_SEP_MENU)
@ -1285,35 +1283,35 @@ _e_int_menus_clients_add_by_class(Eina_List *borders, E_Menu *m)
}
static void
_e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *m)
_e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *clients, E_Menu *m)
{
E_Desk *desk = NULL;
Eina_List *l = NULL, *alt = NULL, *ico = NULL;
E_Border *bd;
E_Client *ec;
E_Menu *subm;
E_Menu_Item *mi = NULL;
/* Deal with present desk first */
EINA_LIST_FOREACH(borders, l, bd)
EINA_LIST_FOREACH(clients, l, ec)
{
if (bd->iconic && e_config->clientlist_separate_iconified_apps && E_CLIENTLIST_GROUPICONS_SEP)
if (ec->iconic && e_config->clientlist_separate_iconified_apps && E_CLIENTLIST_GROUPICONS_SEP)
{
ico = eina_list_append(ico, bd);
ico = eina_list_append(ico, ec);
continue;
}
if (bd->desk != curr_desk)
if (ec->desk != curr_desk)
{
if ((!bd->iconic) ||
(bd->iconic && e_config->clientlist_separate_iconified_apps ==
if ((!ec->iconic) ||
(ec->iconic && e_config->clientlist_separate_iconified_apps ==
E_CLIENTLIST_GROUPICONS_OWNER))
{
alt = eina_list_append(alt, bd);
alt = eina_list_append(alt, ec);
continue;
}
}
else
_e_int_menus_clients_item_create(bd, m);
_e_int_menus_clients_item_create(ec, m);
}
desk = NULL;
@ -1326,16 +1324,16 @@ _e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *
e_menu_item_separator_set(mi, 1);
}
EINA_LIST_FOREACH(alt, l, bd)
EINA_LIST_FOREACH(alt, l, ec)
{
if ((bd->desk != desk) &&
if ((ec->desk != desk) &&
(e_config->clientlist_separate_with != E_CLIENTLIST_GROUP_SEP_NONE))
{
if (e_config->clientlist_separate_with == E_CLIENTLIST_GROUP_SEP_MENU)
{
if (subm && mi) e_menu_item_submenu_set(mi, subm);
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, bd->desk->name);
e_menu_item_label_set(mi, ec->desk->name);
e_util_menu_item_theme_icon_set(mi, "preferences-desktop");
subm = e_menu_new();
}
@ -1344,12 +1342,12 @@ _e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
}
desk = bd->desk;
desk = ec->desk;
}
if (subm && (e_config->clientlist_separate_with == E_CLIENTLIST_GROUP_SEP_MENU))
_e_int_menus_clients_item_create(bd, subm);
_e_int_menus_clients_item_create(ec, subm);
else
_e_int_menus_clients_item_create(bd, m);
_e_int_menus_clients_item_create(ec, m);
}
if (e_config->clientlist_separate_with == E_CLIENTLIST_GROUP_SEP_MENU
&& (subm) && (mi))
@ -1360,20 +1358,20 @@ _e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *
}
static void
_e_int_menus_clients_add_by_none(Eina_List *borders, E_Menu *m)
_e_int_menus_clients_add_by_none(Eina_List *clients, E_Menu *m)
{
Eina_List *l = NULL, *ico = NULL;
E_Border *bd;
E_Client *ec;
EINA_LIST_FOREACH(borders, l, bd)
EINA_LIST_FOREACH(clients, l, ec)
{
if ((bd->iconic) && (e_config->clientlist_separate_iconified_apps) &&
if ((ec->iconic) && (e_config->clientlist_separate_iconified_apps) &&
(E_CLIENTLIST_GROUPICONS_SEP))
{
ico = eina_list_append(ico, bd);
ico = eina_list_append(ico, ec);
continue;
}
_e_int_menus_clients_item_create(bd, m);
_e_int_menus_clients_item_create(ec, m);
}
_e_int_menus_clients_menu_add_iconified(ico, m);
}
@ -1383,33 +1381,33 @@ _e_int_menus_clients_pre_cb(void *data __UNUSED__, E_Menu *m)
{
E_Menu *subm;
E_Menu_Item *mi = NULL;
Eina_List *l = NULL, *borders = NULL;
E_Border *border;
Eina_List *l = NULL, *clients = NULL;
E_Client *ec;
E_Zone *zone = NULL;
E_Desk *desk = NULL;
Main_Data *dat;
e_menu_pre_activate_callback_set(m, NULL, NULL);
/* get the current clients */
zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
zone = e_zone_current_get(e_util_comp_current_get());
desk = e_desk_current_get(zone);
if (e_config->clientlist_sort_by == E_CLIENTLIST_SORT_MOST_RECENT)
l = e_border_focus_stack_get();
l = e_client_focus_stack_get();
else
l = e_border_client_list();
EINA_LIST_FOREACH(l, l, border)
l = zone->comp->clients;
EINA_LIST_FOREACH(l, l, ec)
{
if (border->user_skip_winlist) continue;
if ((border->zone == zone) || (border->iconic) ||
(border->zone != zone && e_config->clientlist_include_all_zones))
borders = eina_list_append(borders, border);
if (ec->user_skip_winlist || e_client_util_ignored_get(ec)) continue;
if ((ec->zone == zone) || (ec->iconic) ||
(ec->zone != zone && e_config->clientlist_include_all_zones))
clients = eina_list_append(clients, ec);
}
dat = (Main_Data *)e_object_data_get(E_OBJECT(m));
if (!dat) e_menu_title_set(m, _("Windows"));
if (!borders)
if (!clients)
{
/* FIXME here we want nothing, but that crashes!!! */
mi = e_menu_item_new(m);
@ -1417,32 +1415,32 @@ _e_int_menus_clients_pre_cb(void *data __UNUSED__, E_Menu *m)
e_menu_item_disabled_set(mi, 1);
}
if (borders)
if (clients)
{
/* Sort the borders */
/* Sort the clients */
if (e_config->clientlist_sort_by == E_CLIENTLIST_SORT_ALPHA)
borders = eina_list_sort(borders, eina_list_count(borders),
clients = eina_list_sort(clients, eina_list_count(clients),
_e_int_menus_clients_sort_alpha_cb);
if (e_config->clientlist_sort_by == E_CLIENTLIST_SORT_ZORDER)
borders = eina_list_sort(borders, eina_list_count(borders),
clients = eina_list_sort(clients, eina_list_count(clients),
_e_int_menus_clients_sort_z_order_cb);
/* Group the borders */
/* Group the clients */
if (e_config->clientlist_group_by == E_CLIENTLIST_GROUP_DESK)
{
borders = eina_list_sort(borders, eina_list_count(borders),
clients = eina_list_sort(clients, eina_list_count(clients),
_e_int_menus_clients_group_desk_cb);
_e_int_menus_clients_add_by_desk(desk, borders, m);
_e_int_menus_clients_add_by_desk(desk, clients, m);
}
if (e_config->clientlist_group_by == E_CLIENTLIST_GROUP_CLASS)
{
borders = eina_list_sort(borders, eina_list_count(borders),
clients = eina_list_sort(clients, eina_list_count(clients),
_e_int_menus_clients_group_class_cb);
_e_int_menus_clients_add_by_class(borders, m);
_e_int_menus_clients_add_by_class(clients, m);
}
if (e_config->clientlist_group_by == E_CLIENTLIST_GROUP_NONE)
_e_int_menus_clients_add_by_none(borders, m);
_e_int_menus_clients_add_by_none(clients, m);
}
mi = e_menu_item_new(m);
@ -1468,7 +1466,7 @@ _e_int_menus_clients_pre_cb(void *data __UNUSED__, E_Menu *m)
}
e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_clients_free_hook);
e_object_data_set(E_OBJECT(m), borders);
e_object_data_set(E_OBJECT(m), clients);
}
static const char *
@ -1512,74 +1510,72 @@ _e_int_menus_clients_title_abbrv(const char *title)
}
static void
_e_int_menus_clients_item_create(E_Border *bd, E_Menu *m)
_e_int_menus_clients_item_create(E_Client *ec, E_Menu *m)
{
E_Menu_Item *mi;
const char *title;
title = _e_int_menus_clients_title_abbrv(e_border_name_get(bd));
title = _e_int_menus_clients_title_abbrv(e_client_name_get(ec));
mi = e_menu_item_new(m);
e_menu_item_check_set(mi, 1);
if ((title) && (title[0]))
e_menu_item_label_set(mi, title);
else
e_menu_item_label_set(mi, _("Untitled window"));
/* ref the border as we implicitly unref it in the callback */
e_object_ref(E_OBJECT(bd));
/* e_object_breadcrumb_add(E_OBJECT(bd), "clients_menu");*/
e_menu_item_callback_set(mi, _e_int_menus_clients_item_cb, bd);
e_menu_item_realize_callback_set(mi, _e_int_menus_clients_icon_cb, bd);
if (!bd->iconic) e_menu_item_toggle_set(mi, 1);
/* ref the client as we implicitly unref it in the callback */
e_object_ref(E_OBJECT(ec));
/* e_object_breadcrumb_add(E_OBJECT(ec), "clients_menu");*/
e_menu_item_callback_set(mi, _e_int_menus_clients_item_cb, ec);
e_menu_item_realize_callback_set(mi, _e_int_menus_clients_icon_cb, ec);
if (!ec->iconic) e_menu_item_toggle_set(mi, 1);
}
static void
_e_int_menus_clients_free_hook(void *obj)
{
Eina_List *borders;
E_Border *bd;
Eina_List *clients;
E_Client *ec;
E_Menu *m;
m = obj;
borders = e_object_data_get(E_OBJECT(m));
EINA_LIST_FREE(borders, bd)
e_object_unref(E_OBJECT(bd));
clients = e_object_data_get(E_OBJECT(m));
EINA_LIST_FREE(clients, ec)
e_object_unref(E_OBJECT(ec));
}
static void
_e_int_menus_clients_item_cb(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
E_Border *bd;
E_Client *ec;
bd = data;
E_OBJECT_CHECK(bd);
ec = data;
E_OBJECT_CHECK(ec);
if (bd->iconic)
if (ec->iconic)
{
if (e_config->clientlist_warp_to_iconified_desktop == 1)
e_desk_show(bd->desk);
if (!bd->lock_user_iconify)
e_border_uniconify(bd);
e_desk_show(ec->desk);
if (!ec->lock_user_iconify)
e_client_uniconify(ec);
}
if (!bd->iconic) e_desk_show(bd->desk);
if (!bd->lock_user_stacking) e_border_raise(bd);
if (!bd->lock_focus_out)
if (!ec->iconic) e_desk_show(ec->desk);
if (!ec->lock_user_stacking) evas_object_raise(ec->frame);
if (!ec->lock_focus_out)
{
if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win,
bd->x + (bd->w / 2), bd->y + (bd->h / 2));
e_border_focus_set(bd, 1, 1);
e_util_pointer_center(ec);
evas_object_focus_set(ec->frame, 1);
}
}
static void
_e_int_menus_clients_icon_cb(void *data, E_Menu *m, E_Menu_Item *mi)
{
E_Border *bd;
E_Client *ec;
bd = data;
E_OBJECT_CHECK(bd);
mi->icon_object = e_border_icon_add(bd, m->evas);
ec = data;
E_OBJECT_CHECK(ec);
mi->icon_object = e_client_icon_add(ec, m->evas);
}
static void
@ -1595,8 +1591,8 @@ static void
_e_int_menus_lost_clients_pre_cb(void *data __UNUSED__, E_Menu *m)
{
E_Menu_Item *mi;
Eina_List *l, *borders = NULL;
E_Border *bd;
Eina_List *l, *clients = NULL;
E_Client *ec;
E_Menu *root;
E_Zone *zone = NULL;
@ -1604,9 +1600,9 @@ _e_int_menus_lost_clients_pre_cb(void *data __UNUSED__, E_Menu *m)
root = e_menu_root_get(m);
/* get the current clients */
if (root) zone = root->zone;
borders = e_border_lost_windows_get(zone);
clients = e_client_lost_windows_get(zone);
if (!borders)
if (!clients)
{
/* FIXME here we want nothing, but that crashes!!! */
mi = e_menu_item_new(m);
@ -1614,52 +1610,52 @@ _e_int_menus_lost_clients_pre_cb(void *data __UNUSED__, E_Menu *m)
e_menu_item_disabled_set(mi, 1);
return;
}
EINA_LIST_FOREACH(borders, l, bd)
EINA_LIST_FOREACH(clients, l, ec)
{
const char *title = "";
title = e_border_name_get(bd);
title = e_client_name_get(ec);
mi = e_menu_item_new(m);
if ((title) && (title[0]))
e_menu_item_label_set(mi, title);
else
e_menu_item_label_set(mi, _("Untitled window"));
/* ref the border as we implicitly unref it in the callback */
e_object_ref(E_OBJECT(bd));
e_menu_item_callback_set(mi, _e_int_menus_lost_clients_item_cb, bd);
if (bd->desktop)
e_util_desktop_menu_item_icon_add(bd->desktop, 24, mi);
/* ref the client as we implicitly unref it in the callback */
e_object_ref(E_OBJECT(ec));
e_menu_item_callback_set(mi, _e_int_menus_lost_clients_item_cb, ec);
if (ec->desktop)
e_util_desktop_menu_item_icon_add(ec->desktop, 24, mi);
}
e_object_free_attach_func_set(E_OBJECT(m),
_e_int_menus_lost_clients_free_hook);
e_object_data_set(E_OBJECT(m), borders);
e_object_data_set(E_OBJECT(m), clients);
}
static void
_e_int_menus_lost_clients_free_hook(void *obj)
{
Eina_List *borders;
E_Border *bd;
Eina_List *clients;
E_Client *ec;
E_Menu *m;
m = obj;
borders = e_object_data_get(E_OBJECT(m));
EINA_LIST_FREE(borders, bd)
e_object_unref(E_OBJECT(bd));
clients = e_object_data_get(E_OBJECT(m));
EINA_LIST_FREE(clients, ec)
e_object_unref(E_OBJECT(ec));
}
static void
_e_int_menus_lost_clients_item_cb(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
E_Border *bd = data;
E_Client *ec = data;
E_OBJECT_CHECK(bd);
if (bd->iconic) e_border_uniconify(bd);
if (bd->desk) e_desk_show(bd->desk);
e_border_center(bd);
e_border_raise(bd);
if (!bd->lock_focus_out)
e_border_focus_set(bd, 1, 1);
E_OBJECT_CHECK(ec);
if (ec->iconic) e_client_uniconify(ec);
if (ec->desk) e_desk_show(ec->desk);
e_comp_object_util_center(ec->frame);
evas_object_raise(ec->frame);
if (!ec->lock_focus_out)
evas_object_focus_set(ec->frame, 1);
}
static void
@ -1700,12 +1696,12 @@ _e_int_menus_shelves_pre_cb(void *data __UNUSED__, E_Menu *m)
E_Menu_Item *mi;
Eina_List *l, *shelves = NULL;
E_Shelf *es;
E_Container *con;
E_Zone *zone;
E_Comp *c;
e_menu_pre_activate_callback_set(m, NULL, NULL);
con = e_container_current_get(e_manager_current_get());
zone = e_zone_current_get(con);
c = e_util_comp_current_get();
zone = e_zone_current_get(c);
/* get the current clients */
shelves = e_shelf_list();
@ -1716,7 +1712,7 @@ _e_int_menus_shelves_pre_cb(void *data __UNUSED__, E_Menu *m)
if (!es) continue;
if (es->zone->num != zone->num) continue;
if (es->cfg->container != (int)con->num) continue;
if (es->cfg->manager != (int)c->num) continue;
if (es->name)
name = es->name;
@ -1825,7 +1821,7 @@ _e_int_menus_shelves_add_cb(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_
static void
_e_int_menus_shelves_del_cb(void *data __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__)
{
e_configure_registry_call("extensions/shelves", m->zone->container, NULL);
e_configure_registry_call("extensions/shelves", m->zone->comp, NULL);
}
static void

View File

@ -43,7 +43,7 @@ e_int_shelf_config(E_Shelf *es)
v->basic.check_changed = _basic_check_changed;
es->config_dialog =
e_config_dialog_new(es->zone->container, _("Shelf Settings"),
e_config_dialog_new(es->zone->comp, _("Shelf Settings"),
"E", "_shelf_config_dialog",
"preferences-desktop-shelf", 0, v, es);
e_win_centered_set(es->config_dialog->dia->win, EINA_TRUE);
@ -84,10 +84,7 @@ static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
/* stacking */
if (cfdata->escfg->popup)
cfdata->layer = 1 + (!!cfdata->escfg->layer);
else
cfdata->layer = 0;
cfdata->layer = cfdata->escfg->layer;
cfdata->overlap = cfdata->escfg->overlap;
/* position */
@ -117,15 +114,8 @@ _fill_data(E_Config_Dialog_Data *cfdata)
static int
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
if (cfdata->escfg->popup)
{
if (cfdata->layer != 1 + (!!cfdata->escfg->layer)) return 1;
}
else
{
if (cfdata->layer) return 1;
}
#define CHECK(X) if (cfdata->X != cfdata->escfg->X) return 1
CHECK(layer);
CHECK(overlap);
CHECK(orient);
CHECK(fit_along);
@ -164,11 +154,11 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
/* Stacking */
ol = e_widget_list_add(evas, 0, 0);
rg = e_widget_radio_group_new(&(cfdata->layer));
ow = e_widget_radio_add(evas, _("Above Everything"), 2, rg);
ow = e_widget_radio_add(evas, _("Above Everything"), E_LAYER_CLIENT_ABOVE, rg);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Below Windows"), 1, rg);
ow = e_widget_radio_add(evas, _("Below Windows"), E_LAYER_CLIENT_DESKTOP, rg);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Below Everything"), 0, rg);
ow = e_widget_radio_add(evas, _("Below Everything"), E_LAYER_DESKTOP, rg);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Stacking"), ol,
1, 0, 1, 0, 0.5, 0.0);
@ -323,34 +313,8 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
recreate = 1;
}
if (cfdata->layer == 0)
{
if ((cfdata->escfg->popup != 0) || (cfdata->escfg->layer != 1))
{
cfdata->escfg->popup = 0;
cfdata->escfg->layer = E_COMP_CANVAS_LAYER_DESKTOP_TOP;
recreate = 1;
}
}
else if (cfdata->layer == 1)
{
if ((cfdata->escfg->popup != 1) || (cfdata->escfg->layer != 0))
{
cfdata->escfg->popup = 1;
cfdata->escfg->layer = 0;
recreate = 1;
}
}
else if (cfdata->layer == 2)
{
if ((cfdata->escfg->popup != 1) || (cfdata->escfg->layer != E_LAYER_ABOVE))
{
cfdata->escfg->popup = 1;
cfdata->escfg->layer = E_LAYER_ABOVE;
recreate = 1;
}
}
cfdata->escfg->layer = cfdata->layer;
evas_object_layer_set(cfdata->es->comp_object, cfdata->escfg->layer);
cfdata->escfg->overlap = cfdata->overlap;
e_shelf_autohide_set(cfdata->es, cfdata->autohide + (cfdata->autohide * cfdata->autohide_show_action));
cfdata->escfg->autohide_show_action = cfdata->autohide_show_action;

View File

@ -18,16 +18,14 @@ e_int_toolbar_config(E_Toolbar *tbar)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
E_Container *con;
v = E_NEW(E_Config_Dialog_View, 1);
if (!v) return;
con = e_container_current_get(e_manager_current_get());
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _basic_apply;
v->basic.create_widgets = _basic_create;
cfd = e_config_dialog_new(con, _("Toolbar Settings"), "E",
cfd = e_config_dialog_new(NULL, _("Toolbar Settings"), "E",
"_toolbar_config_dialog", "preferences-desktop-shelf",
0, v, tbar);
tbar->cfg_dlg = cfd;

View File

@ -67,11 +67,9 @@ static double t0, t1, t2;
static void _e_main_shutdown(int errcode);
static void _e_main_shutdown_push(int (*func)(void));
static void _e_main_parse_arguments(int argc, char **argv);
static void _e_main_cb_x_fatal(void *data __UNUSED__);
static Eina_Bool _e_main_cb_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__);
static Eina_Bool _e_main_cb_signal_hup(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__);
static Eina_Bool _e_main_cb_signal_user(void *data __UNUSED__, int ev_type __UNUSED__, void *ev);
static int _e_main_x_shutdown(void);
static int _e_main_dirs_init(void);
static int _e_main_dirs_shutdown(void);
static int _e_main_path_init(void);
@ -80,10 +78,9 @@ static void _e_main_test_formats(void);
static int _e_main_screens_init(void);
static int _e_main_screens_shutdown(void);
static void _e_main_desk_save(void);
static void _e_main_desk_restore(E_Manager *man, E_Container *con);
static void _e_main_desk_restore(void);
static void _e_main_efreet_paths_init(void);
static void _e_main_modules_load(Eina_Bool safe_mode);
static void _e_main_manage_all(void);
static Eina_Bool _e_main_cb_x_flusher(void *data __UNUSED__);
static Eina_Bool _e_main_cb_idle_before(void *data __UNUSED__);
static Eina_Bool _e_main_cb_idle_after(void *data __UNUSED__);
@ -355,17 +352,6 @@ main(int argc, char **argv)
_idle_before = ecore_idle_enterer_before_add(_e_main_cb_idle_before, NULL);
TS("Ecore_X Init");
if (!ecore_x_init(NULL))
{
e_error_message_show(_("Enlightenment cannot initialize Ecore_X!\n"));
_e_main_shutdown(-1);
}
TS("Ecore_X Init Done");
_e_main_shutdown_push(_e_main_x_shutdown);
ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL);
_xdg_data_dirs_augment();
TS("Ecore_Evas Init");
@ -450,10 +436,6 @@ main(int argc, char **argv)
TS("E_Alert Init Done");
_e_main_shutdown_push(e_alert_shutdown);
TS("E_Hints Init");
e_hints_init();
TS("E_Hints Init Done");
TS("E_Configure Init");
e_configure_init();
TS("E_Configure Init Done");
@ -496,15 +478,6 @@ main(int argc, char **argv)
_e_main_shutdown_push(e_randr_shutdown);
TS("E_Randr Init Done");
TS("E_Xinerama Init");
if (!e_xinerama_init())
{
e_error_message_show(_("Enlightenment cannot initialize E_Xinerama!\n"));
_e_main_shutdown(-1);
}
TS("E_Xinerama Init Done");
_e_main_shutdown_push(e_xinerama_shutdown);
TS("E_Env Init");
if (!e_env_init())
{
@ -521,15 +494,6 @@ main(int argc, char **argv)
s = getenv("E_DESKLOCK_LOCKED");
if ((s) && (!strcmp(s, "locked"))) waslocked = EINA_TRUE;
TS("E_Scale Init");
if (!e_scale_init())
{
e_error_message_show(_("Enlightenment cannot set up its scale system.\n"));
_e_main_shutdown(-1);
}
TS("E_Scale Init Done");
_e_main_shutdown_push(e_scale_shutdown);
TS("E_Pointer Init");
if (!e_pointer_init())
{
@ -587,6 +551,13 @@ main(int argc, char **argv)
TS("E_Moveresize Init Done");
_e_main_shutdown_push(e_moveresize_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Message Bus"));
TS("E_Msgbus Init");
if (e_msgbus_init())
_e_main_shutdown_push(e_msgbus_shutdown);
TS("E_Msgbus Init Done");
TS("Efreet Init");
if (!efreet_init())
{
@ -622,6 +593,14 @@ main(int argc, char **argv)
TS("E_Actions Init Done");
_e_main_shutdown_push(e_actions_shutdown);
/* these just add event handlers and can't fail
* timestamping them is dumb.
*/
e_zone_init();
e_desk_init();
e_menu_init();
e_exehist_init();
if (e_config->show_splash)
e_init_status_set(_("Setup Screens"));
TS("Screens Init");
@ -634,6 +613,16 @@ main(int argc, char **argv)
TS("Screens Init Done");
_e_main_shutdown_push(_e_main_screens_shutdown);
TS("E_Scale Init");
if (!e_scale_init())
{
e_error_message_show(_("Enlightenment cannot set up its scale system.\n"));
_e_main_shutdown(-1);
}
TS("E_Scale Init Done");
_e_main_shutdown_push(e_scale_shutdown);
if (e_config->show_splash)
{
TS("E_Splash Init");
@ -723,27 +712,9 @@ main(int argc, char **argv)
TS("E_Desklock Init Done");
_e_main_shutdown_push(e_desklock_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Popups"));
TS("E_Popups Init");
if (!e_popup_init())
{
e_error_message_show(_("Enlightenment cannot set up its popup system.\n"));
_e_main_shutdown(-1);
}
TS("E_Popups Init Done");
_e_main_shutdown_push(e_popup_shutdown);
if (waslocked || (locked && ((!after_restart) || (!getenv("E_DESKLOCK_UNLOCKED")))))
e_desklock_show(EINA_TRUE);
if (e_config->show_splash)
e_init_status_set(_("Setup Message Bus"));
TS("E_Msgbus Init");
if (e_msgbus_init())
_e_main_shutdown_push(e_msgbus_shutdown);
TS("E_Msgbus Init Done");
if (e_config->show_splash)
e_init_status_set(_("Setup Paths"));
TS("Efreet Paths");
@ -770,11 +741,10 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
TS("E_Exec Init Done");
_e_main_shutdown_push(e_exec_shutdown);
TS("E_Container Freeze");
e_container_all_freeze();
TS("E_Container Freeze Done");
TS("E_Comp Freeze");
e_comp_all_freeze();
TS("E_Comp Freeze Done");
if (e_config->show_splash)
e_init_status_set(_("Setup Filemanager"));
@ -916,15 +886,6 @@ main(int argc, char **argv)
TS("E_Icon Init Done");
_e_main_shutdown_push(e_icon_shutdown);
TS("E_XSettings Init");
if (!e_xsettings_init())
{
e_error_message_show(_("Enlightenment cannot initialize the XSettings system.\n"));
_e_main_shutdown(-1);
}
TS("E_XSettings Init Done");
_e_main_shutdown_push(e_xsettings_shutdown);
TS("E_Update Init");
if (!e_update_init())
{
@ -983,9 +944,9 @@ main(int argc, char **argv)
if (e_config->show_splash && (!after_restart))
ecore_timer_add(2.0, _e_main_cb_startup_fake_end, NULL);
TS("E_Container Thaw");
e_container_all_thaw();
TS("E_Container Thaw Done");
TS("E_Comp Thaw");
e_comp_all_thaw();
TS("E_Comp Thaw Done");
TS("E_Test Init");
e_test();
@ -1000,13 +961,9 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
TS("E_Shelf Init Done");
_e_main_shutdown_push(e_shelf_shutdown);
ecore_idle_enterer_before_add(_e_main_shelf_init_job, NULL);
TS("Manage all windows");
_e_main_manage_all();
_idle_after = ecore_idle_enterer_add(_e_main_cb_idle_after, NULL);
if (e_config->show_splash)
@ -1085,7 +1042,7 @@ _e_main_shutdown(int errcode)
{
int i = 0;
printf("E18: Begin Shutdown Procedure!\n");
printf("E19: Begin Shutdown Procedure!\n");
if (_idle_before) ecore_idle_enterer_del(_idle_before);
_idle_before = NULL;
@ -1234,7 +1191,7 @@ _e_main_parse_arguments(int argc, char **argv)
}
}
static void
EINTERN void
_e_main_cb_x_fatal(void *data __UNUSED__)
{
e_error_message_show("Lost X Connection.\n");
@ -1276,17 +1233,7 @@ _e_main_cb_signal_user(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
// comp module has its own handler for this for enabling/disabling fps debug
}
return ECORE_CALLBACK_RENEW;
}
static int
_e_main_x_shutdown(void)
{
if (x_fatal) return 1;
/* ecore_x_ungrab(); */
ecore_x_focus_reset();
ecore_x_events_allow_all();
ecore_x_shutdown();
return 1;
}
static int
@ -1559,62 +1506,13 @@ _e_main_test_formats(void)
static int
_e_main_screens_init(void)
{
Ecore_X_Window *roots;
int num, i;
TS("\tscreens: atoms");
if (!e_atoms_init()) return 0;
TS("\tscreens: manager");
if (!e_manager_init()) return 0;
TS("\tscreens: container");
if (!e_container_init()) return 0;
TS("\tscreens: zone");
if (!e_zone_init()) return 0;
TS("\tscreens: desk");
if (!e_desk_init()) return 0;
TS("\tscreens: menu");
if (!e_menu_init()) return 0;
TS("\tscreens: exehist");
if (!e_exehist_init()) return 0;
TS("\tscreens: get roots");
num = 0;
roots = ecore_x_window_root_list(&num);
if ((!roots) || (num <= 0))
{
free(roots);
e_error_message_show("X reports there are no root windows and %i screens!\n",
num);
return 0;
}
TS("\tscreens: focus");
if (!e_focus_init())
{
free(roots);
return 0;
}
TS("\tscreens: border");
if (!e_border_init())
{
free(roots);
return 0;
}
TS("E_Comp Init");
if (!e_comp_init())
{
e_error_message_show(_("Enlightenment cannot setup compositing.\n"));
_e_main_shutdown(-1);
}
TS("E_Comp Init Done");
TS("\tscreens: client");
if (!e_client_init()) return 0;
TS("\tscreens: win");
if (!e_win_init())
{
free(roots);
return 0;
}
if (!e_win_init()) return 0;
TS("E_Xkb Init");
if (!e_xkb_init())
{
@ -1623,6 +1521,15 @@ _e_main_screens_init(void)
}
TS("E_Xkb Init Done");
TS("Compositor Init");
if (!e_comp_init())
{
e_error_message_show(_("Enlightenment cannot create a compositor.\n"));
_e_main_shutdown(-1);
}
_e_main_desk_restore();
if (e_config->show_splash)
e_init_status_set(_("Setup DND"));
TS("E_Dnd Init");
@ -1634,48 +1541,6 @@ _e_main_screens_init(void)
TS("E_Dnd Init Done");
_e_main_shutdown_push(e_dnd_shutdown);
TS("\tscreens: manage roots");
for (i = 0; i < num; i++)
{
E_Manager *man;
E_Container *con;
man = e_manager_new(roots[i], i);
if (man)
e_manager_show(man);
else
{
e_error_message_show("Cannot create manager object for screen %i\n",
i);
free(roots);
return 0;
}
con = e_container_new(man);
if (con)
{
e_container_show(con);
e_grabinput_focus(con->bg_win, E_FOCUS_METHOD_PASSIVE);
e_hints_manager_init(man);
_e_main_desk_restore(man, con);
// e_manager_manage_windows(man);
}
else
{
e_error_message_show("Cannot create desktop object for manager on screen %i\n",
i);
free(roots);
return 0;
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
ecore_x_e_window_profile_supported_set(roots[i],
e_config->use_desktop_window_profile);
#endif
}
free(roots);
TS("\tscreens: sync");
ecore_x_sync();
return 1;
}
@ -1683,12 +1548,13 @@ static int
_e_main_screens_shutdown(void)
{
e_win_shutdown();
e_comp_shutdown();
e_border_shutdown();
e_focus_shutdown();
e_exehist_shutdown();
e_menu_shutdown();
e_shelf_shutdown();
e_comp_shutdown();
e_client_shutdown();
e_exehist_shutdown();
e_backlight_shutdown();
e_exec_shutdown();
// ecore_evas closes evas - deletes objs - deletes fm widgets which tries to
// ipc to slave to stop monitoring - but ipc has been shut down. dont shut
// down.
@ -1696,58 +1562,53 @@ _e_main_screens_shutdown(void)
// e_zone_shutdown();
// e_container_shutdown();
// e_manager_shutdown();
e_atoms_shutdown();
return 1;
}
static void
_e_main_desk_save(void)
{
Eina_List *ml;
E_Manager *man;
E_Comp *c;
const Eina_List *l;
char env[1024], name[1024];
EINA_LIST_FOREACH(e_manager_list(), ml, man)
EINA_LIST_FOREACH(e_comp_list(), l, c)
{
Eina_List *cl;
E_Container *con;
Eina_List *zl;
E_Zone *zone;
EINA_LIST_FOREACH(man->containers, cl, con)
EINA_LIST_FOREACH(c->zones, zl, zone)
{
Eina_List *zl;
E_Zone *zone;
EINA_LIST_FOREACH(con->zones, zl, zone)
{
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
e_util_env_set(name, env);
}
snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num);
snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
e_util_env_set(name, env);
}
}
}
static void
_e_main_desk_restore(E_Manager *man, E_Container *con)
_e_main_desk_restore(void)
{
Eina_List *zl;
E_Comp *c;
const Eina_List *l, *ll;
E_Zone *zone;
char *env;
char name[1024];
EINA_LIST_FOREACH(con->zones, zl, zone)
{
E_Desk *desk;
int desk_x, desk_y;
EINA_LIST_FOREACH(e_comp_list(), l, c)
EINA_LIST_FOREACH(c->zones, ll, zone)
{
E_Desk *desk;
int desk_x, desk_y;
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
env = getenv(name);
if (!env) continue;
if (!sscanf(env, "%d,%d", &desk_x, &desk_y)) continue;
desk = e_desk_at_xy_get(zone, desk_x, desk_y);
if (!desk) continue;
e_desk_show(desk);
}
snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num);
env = getenv(name);
if (!env) continue;
if (!sscanf(env, "%d,%d", &desk_x, &desk_y)) continue;
desk = e_desk_at_xy_get(zone, desk_x, desk_y);
if (!desk) continue;
e_desk_show(desk);
}
}
static void
@ -1825,19 +1686,6 @@ _e_main_modules_load(Eina_Bool safe_mode)
}
}
static void
_e_main_manage_all(void)
{
Eina_List *l;
E_Manager *man;
EINA_LIST_FOREACH(e_manager_list(), l, man)
{
e_manager_manage_windows(man);
e_comp_populate(man->comp);
}
}
static Eina_Bool
_e_main_cb_idle_before(void *data __UNUSED__)
{
@ -1845,8 +1693,7 @@ _e_main_cb_idle_before(void *data __UNUSED__)
E_Before_Idler *eb;
e_menu_idler_before();
e_focus_idler_before();
e_border_idler_before();
e_client_idler_before();
e_pointer_idler_before();
EINA_LIST_FOREACH(_idle_before_list, l, eb)
{
@ -1875,7 +1722,7 @@ _e_main_cb_idle_after(void *data __UNUSED__)
edje_freeze();
#ifdef E18_RELEASE_BUILD
#ifdef E19_RELEASE_BUILD
if (first_idle)
{
TS("SLEEP");

View File

@ -1,65 +1,90 @@
#include "e.h"
/* local subsystem functions */
static void _e_manager_free(E_Manager *man);
static Eina_Bool _e_manager_cb_window_show_request(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_window_configure(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_key_up(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_key_down(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_frame_extents_request(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_ping(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_screensaver_on(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_screensaver_off(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_cb_client_message(void *data, int ev_type, void *ev);
static Eina_Bool _e_manager_frame_extents_free_cb(const Eina_Hash *hash __UNUSED__,
const void *key __UNUSED__,
void *data, void *fdata __UNUSED__);
static E_Manager *_e_manager_get_for_root(Ecore_X_Window root);
static Eina_Bool _e_manager_clear_timer(void *data);
#if 0 /* use later - maybe */
static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_reparent(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_create(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_configure_request(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_gravity(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_stack(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_stack_request(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_property(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_colormap(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_shape(void *data, int ev_type, void *ev);
static int _e_manager_cb_client_message(void *data, int ev_type, void *ev);
#endif
/* local subsystem globals */
typedef struct _Frame_Extents Frame_Extents;
struct _Frame_Extents
{
int l, r, t, b;
};
EAPI int E_EVENT_MANAGER_KEYS_GRAB = -1;
EAPI int E_EVENT_MANAGER_COMP_SET = -1;
static Eina_List *managers = NULL;
static Eina_Hash *frame_extents = NULL;
static Ecore_Timer *timer_post_screensaver_lock = NULL;
static Ecore_Event_Handler *_show_request_handler = NULL;
static void
_e_manager_free(E_Manager *man)
{
E_FREE_LIST(man->handlers, ecore_event_handler_del);
managers = eina_list_remove(managers, man);
free(man);
}
static Eina_Bool
_e_manager_cb_key_down(void *data, int ev_type EINA_UNUSED, Ecore_Event_Key *ev)
{
E_Manager *man = data;
if (ev->event_window != man->root)
{
E_Client *ec;
ec = e_client_focused_get();
/* *block actions when no client is focused (probably something else did a grab here so we'll play nice)
* *block actions when client menu is up
* *block actions when event (grab) window isn't comp window
* *other cases?
*/
if (!ec) return ECORE_CALLBACK_RENEW;
if ((ec->border_menu) || (ev->event_window != man->comp->ee_win))
return ECORE_CALLBACK_PASS_ON;
}
if (ev->root_window != man->root) man = e_manager_find_by_root(ev->root_window);
if (!man) man = eina_list_data_get(managers);
return !e_bindings_key_down_event_handle(E_BINDING_CONTEXT_MANAGER, E_OBJECT(man), ev);
}
static Eina_Bool
_e_manager_cb_key_up(void *data, int ev_type EINA_UNUSED, Ecore_Event_Key *ev)
{
E_Manager *man = data;
if (ev->event_window != man->root) return ECORE_CALLBACK_PASS_ON;
if (ev->root_window != man->root) man = e_manager_find_by_root(ev->root_window);
if (!man) man = eina_list_data_get(managers);
return !e_bindings_key_up_event_handle(E_BINDING_CONTEXT_MANAGER, E_OBJECT(man), ev);
}
static Eina_Bool
_e_manager_cb_timer_post_screensaver_lock(void *data EINA_UNUSED)
{
e_desklock_show_autolocked();
timer_post_screensaver_lock = NULL;
return ECORE_CALLBACK_CANCEL;
}
static Eina_Bool
_e_manager_cb_screensaver_on(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev EINA_UNUSED)
{
if (e_config->desklock_autolock_screensaver)
{
E_FREE_FUNC(timer_post_screensaver_lock, ecore_timer_del);
if (e_config->desklock_post_screensaver_time <= 1.0)
e_desklock_show_autolocked();
else
timer_post_screensaver_lock = ecore_timer_add
(e_config->desklock_post_screensaver_time,
_e_manager_cb_timer_post_screensaver_lock, NULL);
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_screensaver_off(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev EINA_UNUSED)
{
E_FREE_FUNC(timer_post_screensaver_lock, ecore_timer_del);
return ECORE_CALLBACK_PASS_ON;
}
/* externally accessible functions */
EINTERN int
e_manager_init(void)
{
ecore_x_screensaver_event_listen_set(1);
frame_extents = eina_hash_string_superfast_new(NULL);
E_EVENT_MANAGER_KEYS_GRAB = ecore_event_type_new();
E_EVENT_MANAGER_COMP_SET = ecore_event_type_new();
_show_request_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST,
_e_manager_cb_window_show_request, NULL);
return 1;
}
@ -67,20 +92,7 @@ EINTERN int
e_manager_shutdown(void)
{
E_FREE_LIST(managers, e_object_del);
E_FREE_FUNC(_show_request_handler, ecore_event_handler_del);
if (frame_extents)
{
eina_hash_foreach(frame_extents, _e_manager_frame_extents_free_cb, NULL);
eina_hash_free(frame_extents);
frame_extents = NULL;
}
if (timer_post_screensaver_lock)
{
ecore_timer_del(timer_post_screensaver_lock);
timer_post_screensaver_lock = NULL;
}
E_FREE_FUNC(timer_post_screensaver_lock, ecore_timer_del);
return 1;
}
@ -92,359 +104,40 @@ e_manager_list(void)
}
EAPI E_Manager *
e_manager_new(Ecore_X_Window root, int num)
e_manager_new(Ecore_Window root, E_Comp *c, int w, int h)
{
E_Manager *man;
if (!ecore_x_window_manage(root)) return NULL;
man = E_OBJECT_ALLOC(E_Manager, E_MANAGER_TYPE, _e_manager_free);
if (!man) return NULL;
man->root = root;
man->num = num;
ecore_x_window_size_get(man->root, &(man->w), &(man->h));
man->win = man->root;
if (!e_comp_manager_init(man))
{
e_object_del(E_OBJECT(man));
return NULL;
}
man->num = c->num;
man->w = w;
man->h = h;
man->comp = c;
managers = eina_list_append(managers, man);
E_LIST_HANDLER_APPEND(man->handlers, ECORE_X_EVENT_WINDOW_CONFIGURE,
_e_manager_cb_window_configure, man);
E_LIST_HANDLER_APPEND(man->handlers, ECORE_EVENT_KEY_DOWN,
_e_manager_cb_key_down, man);
E_LIST_HANDLER_APPEND(man->handlers, ECORE_EVENT_KEY_UP,
_e_manager_cb_key_up, man);
E_LIST_HANDLER_APPEND(man->handlers, ECORE_X_EVENT_FRAME_EXTENTS_REQUEST,
_e_manager_cb_frame_extents_request, man);
E_LIST_HANDLER_APPEND(man->handlers, ECORE_X_EVENT_PING,
_e_manager_cb_ping, man);
E_LIST_HANDLER_APPEND(man->handlers, E_EVENT_SCREENSAVER_ON,
_e_manager_cb_screensaver_on, man);
E_LIST_HANDLER_APPEND(man->handlers, E_EVENT_SCREENSAVER_OFF,
_e_manager_cb_screensaver_off, man);
E_LIST_HANDLER_APPEND(man->handlers, ECORE_X_EVENT_CLIENT_MESSAGE,
_e_manager_cb_client_message, man);
man->pointer = e_pointer_window_new(man->root, 1);
ecore_x_window_background_color_set(man->root, 0, 0, 0);
man->clear_timer = ecore_timer_add(10.0, _e_manager_clear_timer, man);
return man;
}
EAPI void
e_manager_manage_windows(E_Manager *man)
{
Ecore_X_Window *windows;
int wnum;
/* a manager is designated for each root. lets get all the windows in
the managers root */
windows = ecore_x_window_children_get(man->root, &wnum);
if (windows)
{
int i;
const char *atom_names[] =
{
"_XEMBED_INFO",
"_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR",
"KWM_DOCKWINDOW"
};
Ecore_X_Atom atoms[3];
Ecore_X_Atom atom_xmbed, atom_kde_netwm_systray, atom_kwm_dockwindow;
unsigned char *data = NULL;
int count;
ecore_x_atoms_get(atom_names, 3, atoms);
atom_xmbed = atoms[0];
atom_kde_netwm_systray = atoms[1];
atom_kwm_dockwindow = atoms[2];
for (i = 0; i < wnum; i++)
{
Ecore_X_Window_Attributes att;
unsigned int ret_val, deskxy[2];
int ret;
if (e_border_find_by_client_window(windows[i]))
continue;
ecore_x_window_attributes_get(windows[i], &att);
if ((att.override) || (att.input_only))
{
if (att.override)
{
char *wname = NULL, *wclass = NULL;
ecore_x_icccm_name_class_get(windows[i],
&wname, &wclass);
if ((wname) && (wclass) &&
(!strcmp(wname, "E")) &&
(!strcmp(wclass, "Init_Window")))
{
free(wname);
free(wclass);
man->initwin = windows[i];
}
else
{
free(wname);
free(wclass);
continue;
}
}
else
continue;
}
/* XXX manage xembed windows as long as they are not override_redirect..
* if (!ecore_x_window_prop_property_get(windows[i],
* atom_xmbed,
* atom_xmbed, 32,
* &data, &count))
* data = NULL;
* if (!data) */
{
if (!ecore_x_window_prop_property_get(windows[i],
atom_kde_netwm_systray,
atom_xmbed, 32,
&data, &count))
data = NULL;
}
if (!data)
{
if (!ecore_x_window_prop_property_get(windows[i],
atom_kwm_dockwindow,
atom_kwm_dockwindow, 32,
&data, &count))
data = NULL;
}
if (data)
{
E_FREE(data);
continue;
}
ret = ecore_x_window_prop_card32_get(windows[i],
E_ATOM_MANAGED,
&ret_val, 1);
/* we have seen this window before */
if ((ret > -1) && (ret_val == 1))
{
E_Container *con = NULL;
E_Zone *zone = NULL;
E_Desk *desk = NULL;
E_Border *bd = NULL;
unsigned int id;
char *path;
Efreet_Desktop *desktop = NULL;
/* get all information from window before it is
* reset by e_border_new */
ret = ecore_x_window_prop_card32_get(windows[i],
E_ATOM_CONTAINER,
&id, 1);
if (ret == 1)
con = e_container_number_get(man, id);
if (!con)
con = e_container_current_get(man);
ret = ecore_x_window_prop_card32_get(windows[i],
E_ATOM_ZONE,
&id, 1);
if (ret == 1)
zone = e_container_zone_number_get(con, id);
if (!zone)
zone = e_zone_current_get(con);
ret = ecore_x_window_prop_card32_get(windows[i],
E_ATOM_DESK,
deskxy, 2);
if (ret == 2)
desk = e_desk_at_xy_get(zone,
deskxy[0],
deskxy[1]);
path = ecore_x_window_prop_string_get(windows[i],
E_ATOM_DESKTOP_FILE);
if (path)
{
desktop = efreet_desktop_get(path);
free(path);
}
{
bd = e_border_new(con, windows[i], 1, 0);
if (bd)
{
bd->ignore_first_unmap = 1;
/* FIXME:
* It's enough to set the desk, the zone will
* be set according to the desk */
// if (zone) e_border_zone_set(bd, zone);
if (desk) e_border_desk_set(bd, desk);
bd->desktop = desktop;
}
}
}
else if ((att.visible) && (!att.override) &&
(!att.input_only))
{
/* We have not seen this window, and X tells us it
* should be seen */
E_Container *con;
E_Border *bd;
con = e_container_current_get(man);
bd = e_border_new(con, windows[i], 1, 0);
if (bd)
{
bd->ignore_first_unmap = 1;
e_border_show(bd);
}
}
}
free(windows);
}
}
EAPI void
e_manager_show(E_Manager *man)
{
Eina_List *l;
E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if (man->visible) return;
EINA_LIST_FOREACH(man->containers, l, con)
{
e_container_show(con);
}
if (man->root != man->win)
{
Ecore_X_Window mwin;
mwin = e_menu_grab_window_get();
if (!mwin) mwin = man->initwin;
if (!mwin)
ecore_x_window_raise(man->win);
else
ecore_x_window_configure(man->win,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
mwin, ECORE_X_WINDOW_STACK_BELOW);
ecore_x_window_show(man->win);
}
man->visible = 1;
}
EAPI void
e_manager_hide(E_Manager *man)
{
Eina_List *l;
E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if (!man->visible) return;
EINA_LIST_FOREACH(man->containers, l, con)
{
e_container_hide(con);
}
if (man->root != man->win)
ecore_x_window_hide(man->win);
man->visible = 0;
}
EAPI void
e_manager_move(E_Manager *man, int x, int y)
{
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if ((x == man->x) && (y == man->y)) return;
if (man->root != man->win)
{
man->x = x;
man->y = y;
ecore_x_window_move(man->win, man->x, man->y);
}
}
EAPI void
e_manager_resize(E_Manager *man, int w, int h)
{
Eina_List *l;
E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if ((man->w == w) && (man->h == h)) return;
man->w = w;
man->h = h;
if (man->root != man->win)
ecore_x_window_resize(man->win, man->w, man->h);
EINA_LIST_FOREACH(man->containers, l, con)
{
e_container_resize(con, man->w, man->h);
}
ecore_x_netwm_desk_size_set(man->root, man->w, man->h);
}
EAPI void
e_manager_move_resize(E_Manager *man, int x, int y, int w, int h)
{
Eina_List *l;
E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if (man->root != man->win)
{
man->x = x;
man->y = y;
}
man->w = w;
man->h = h;
ecore_x_window_move_resize(man->win, man->x, man->y, man->w, man->h);
EINA_LIST_FOREACH(man->containers, l, con)
{
e_container_resize(con, man->w, man->h);
}
}
EAPI void
e_manager_raise(E_Manager *man)
{
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if (man->root != man->win)
{
Ecore_X_Window mwin;
mwin = e_menu_grab_window_get();
if (!mwin) mwin = man->initwin;
if (!mwin)
ecore_x_window_raise(man->win);
else
ecore_x_window_configure(man->win,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
mwin, ECORE_X_WINDOW_STACK_BELOW);
}
}
EAPI void
e_manager_lower(E_Manager *man)
{
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if (man->root != man->win)
ecore_x_window_lower(man->win);
ecore_evas_resize(man->comp->ee, w, h);
}
EAPI E_Manager *
@ -459,7 +152,7 @@ e_manager_current_get(void)
return eina_list_data_get(managers);
EINA_LIST_FOREACH(managers, l, man)
{
ecore_x_pointer_xy_get(man->win, &x, &y);
ecore_evas_pointer_xy_get(man->comp->ee, &x, &y);
if (x == -1 && y == -1)
continue;
if (E_INSIDE(x, y, man->x, man->y, man->w, man->h))
@ -507,407 +200,3 @@ e_managers_keys_ungrab(void)
e_bindings_key_ungrab(E_BINDING_CONTEXT_ANY, man->root);
}
}
/* local subsystem functions */
static void
_e_manager_free(E_Manager *man)
{
Eina_List *l;
E_FREE_LIST(man->handlers, ecore_event_handler_del);
l = man->containers;
man->containers = NULL;
E_FREE_LIST(l, e_object_del);
if (man->root != man->win)
{
ecore_x_window_free(man->win);
}
if (man->pointer) e_object_del(E_OBJECT(man->pointer));
managers = eina_list_remove(managers, man);
if (man->clear_timer) ecore_timer_del(man->clear_timer);
free(man);
}
static Eina_Bool
_e_manager_cb_window_show_request(void *data EINA_UNUSED, int ev_type __UNUSED__, void *ev)
{
E_Manager *man;
Ecore_X_Event_Window_Show_Request *e;
e = ev;
if (e_stolen_win_get(e->win)) return 1;
man = e_manager_find_by_root(ecore_x_window_parent_get(e->win));
if (!man)
return ECORE_CALLBACK_PASS_ON; /* try other handlers for this */
{
E_Container *con;
E_Border *bd;
con = e_container_current_get(man);
if (!e_border_find_by_client_window(e->win))
{
bd = e_border_new(con, e->win, 0, 0);
if (!bd)
ecore_x_window_show(e->win);
}
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_window_configure(void *data, int ev_type __UNUSED__, void *ev)
{
E_Manager *man;
Ecore_X_Event_Window_Configure *e;
man = data;
e = ev;
if (e->win != man->root) return ECORE_CALLBACK_PASS_ON;
e_manager_resize(man, e->w, e->h);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_key_down(void *data, int ev_type __UNUSED__, void *ev)
{
E_Manager *man = data;
Ecore_Event_Key *e = ev;
if (e->event_window != man->root)
{
E_Border *bd;
bd = e_border_focused_get();
/* *block actions when no border is focused (probably something else did a grab here so we'll play nice)
* *block actions when border menu is up
* *block actions when event (grab) window isn't comp window
* *other cases?
*/
if (!bd) return ECORE_CALLBACK_RENEW;
if ((bd->border_menu) || (e->event_window != e_comp_get(bd)->ee_win))
return ECORE_CALLBACK_PASS_ON;
}
if (e->root_window != man->root) man = _e_manager_get_for_root(e->root_window);
if (e_bindings_key_down_event_handle(E_BINDING_CONTEXT_MANAGER, E_OBJECT(man), ev))
return ECORE_CALLBACK_DONE;
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_key_up(void *data, int ev_type __UNUSED__, void *ev)
{
E_Manager *man;
Ecore_Event_Key *e;
man = data;
e = ev;
if (e->event_window != man->root) return ECORE_CALLBACK_PASS_ON;
if (e->root_window != man->root) man = _e_manager_get_for_root(e->root_window);
if (e_bindings_key_up_event_handle(E_BINDING_CONTEXT_MANAGER, E_OBJECT(man), ev))
return ECORE_CALLBACK_DONE;
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_frame_extents_request(void *data, int ev_type __UNUSED__, void *ev)
{
E_Manager *man;
E_Container *con;
Ecore_X_Event_Frame_Extents_Request *e;
Ecore_X_Window_Type type;
Ecore_X_MWM_Hint_Decor decor;
Ecore_X_Window_State *state;
Frame_Extents *extents;
const char *border, *sig, *key;
int ok;
unsigned int i, num;
man = data;
con = e_container_current_get(man);
e = ev;
if (ecore_x_window_parent_get(e->win) != man->root) return ECORE_CALLBACK_PASS_ON;
/* TODO:
* * We need to check if we remember this window, and border locking is set
*/
border = "default";
key = border;
ok = ecore_x_mwm_hints_get(e->win, NULL, &decor, NULL);
if ((ok) &&
(!(decor & ECORE_X_MWM_HINT_DECOR_ALL)) &&
(!(decor & ECORE_X_MWM_HINT_DECOR_TITLE)) &&
(!(decor & ECORE_X_MWM_HINT_DECOR_BORDER)))
{
border = "borderless";
key = border;
}
ok = ecore_x_netwm_window_type_get(e->win, &type);
if ((ok) &&
((type == ECORE_X_WINDOW_TYPE_DESKTOP) ||
(type == ECORE_X_WINDOW_TYPE_DOCK)))
{
border = "borderless";
key = border;
}
sig = NULL;
ecore_x_netwm_window_state_get(e->win, &state, &num);
if (state)
{
int maximized = 0;
for (i = 0; i < num; i++)
{
switch (state[i])
{
case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT:
maximized++;
break;
case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ:
maximized++;
break;
case ECORE_X_WINDOW_STATE_FULLSCREEN:
border = "borderless";
key = border;
break;
case ECORE_X_WINDOW_STATE_SHADED:
case ECORE_X_WINDOW_STATE_SKIP_TASKBAR:
case ECORE_X_WINDOW_STATE_SKIP_PAGER:
case ECORE_X_WINDOW_STATE_HIDDEN:
case ECORE_X_WINDOW_STATE_ICONIFIED:
case ECORE_X_WINDOW_STATE_MODAL:
case ECORE_X_WINDOW_STATE_STICKY:
case ECORE_X_WINDOW_STATE_ABOVE:
case ECORE_X_WINDOW_STATE_BELOW:
case ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION:
case ECORE_X_WINDOW_STATE_UNKNOWN:
break;
}
}
if ((maximized == 2) &&
(e_config->maximize_policy == E_MAXIMIZE_FULLSCREEN))
{
sig = "e,action,maximize,fullscreen";
key = "maximize,fullscreen";
}
free(state);
}
extents = eina_hash_find(frame_extents, key);
if (!extents)
{
extents = E_NEW(Frame_Extents, 1);
if (extents)
{
Evas_Object *o;
char buf[1024];
o = edje_object_add(con->bg_evas);
snprintf(buf, sizeof(buf), "e/widgets/border/%s/border", border);
ok = e_theme_edje_object_set(o, "base/theme/borders", buf);
if (ok)
{
Evas_Coord x, y, w, h;
if (sig)
{
edje_object_signal_emit(o, sig, "e");
edje_object_message_signal_process(o);
}
evas_object_resize(o, 1000, 1000);
edje_object_calc_force(o);
edje_object_part_geometry_get(o, "e.swallow.client",
&x, &y, &w, &h);
extents->l = x;
extents->r = 1000 - (x + w);
extents->t = y;
extents->b = 1000 - (y + h);
}
else
{
extents->l = 0;
extents->r = 0;
extents->t = 0;
extents->b = 0;
}
evas_object_del(o);
eina_hash_add(frame_extents, key, extents);
}
}
if (extents)
ecore_x_netwm_frame_size_set(e->win, extents->l, extents->r, extents->t, extents->b);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_ping(void *data, int ev_type __UNUSED__, void *ev)
{
E_Manager *man;
E_Border *bd;
Ecore_X_Event_Ping *e;
man = data;
e = ev;
if (e->win != man->root) return ECORE_CALLBACK_PASS_ON;
bd = e_border_find_by_client_window(e->event_win);
if (!bd) return ECORE_CALLBACK_PASS_ON;
bd->ping_ok = 1;
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_timer_post_screensaver_lock(void *data __UNUSED__)
{
e_desklock_show_autolocked();
timer_post_screensaver_lock = NULL;
return ECORE_CALLBACK_CANCEL;
}
static Eina_Bool
_e_manager_cb_screensaver_on(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
{
if (e_config->desklock_autolock_screensaver)
{
if (timer_post_screensaver_lock)
{
ecore_timer_del(timer_post_screensaver_lock);
timer_post_screensaver_lock = NULL;
}
if (e_config->desklock_post_screensaver_time <= 1.0)
e_desklock_show_autolocked();
else
timer_post_screensaver_lock = ecore_timer_add
(e_config->desklock_post_screensaver_time,
_e_manager_cb_timer_post_screensaver_lock, NULL);
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_screensaver_off(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
{
if (timer_post_screensaver_lock)
{
ecore_timer_del(timer_post_screensaver_lock);
timer_post_screensaver_lock = NULL;
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
{
Ecore_X_Event_Client_Message *e;
E_Border *bd;
e = ev;
if (e->message_type != ECORE_X_ATOM_NET_ACTIVE_WINDOW) return ECORE_CALLBACK_RENEW;
bd = e_border_find_by_client_window(e->win);
if (!bd) return ECORE_CALLBACK_RENEW;
#if 0 /* notes */
if (e->data.l[0] == 0 /* 0 == old, 1 == client, 2 == pager */)
{
}
timestamp = e->data.l[1];
requestor_id e->data.l[2];
#endif
switch (e_config->window_activehint_policy)
{
case 0: break;
case 1:
edje_object_signal_emit(bd->bg_object, "e,state,urgent", "e");
break;
default:
if ((!starting) && (!bd->focused)) e_border_activate(bd, EINA_TRUE);
else e_border_raise(bd);
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
_e_manager_frame_extents_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
void *data, void *fdata __UNUSED__)
{
free(data);
return EINA_TRUE;
}
static E_Manager *
_e_manager_get_for_root(Ecore_X_Window root)
{
Eina_List *l;
E_Manager *man;
if (!managers) return NULL;
EINA_LIST_FOREACH(managers, l, man)
{
if (man->root == root)
return man;
}
return eina_list_data_get(managers);
}
static Eina_Bool
_e_manager_clear_timer(void *data)
{
E_Manager *man = data;
ecore_x_window_background_color_set(man->root, 0, 0, 0);
man->clear_timer = NULL;
return EINA_FALSE;
}
#if 0 /* use later - maybe */
static int
_e_manager_cb_window_destroy(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_hide(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_reparent(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_create(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_configure_request(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_configure(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_gravity(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_stack(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_stack_request(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_property(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_colormap(void *data, int ev_type, void *ev){return 1; }
static int
_e_manager_cb_window_shape(void *data, int ev_type, void *ev){return 1; }
#endif

View File

@ -9,40 +9,28 @@ typedef struct _E_Manager E_Manager;
#define E_MANAGER_TYPE (int) 0xE0b01008
extern EAPI int E_EVENT_MANAGER_KEYS_GRAB;
extern EAPI int E_EVENT_MANAGER_COMP_SET;
struct _E_Manager
{
E_Object e_obj_inherit;
Ecore_X_Window win;
int num;
int x, y, w, h;
char visible : 1;
Ecore_X_Window root;
Ecore_Window root;
Eina_List *handlers;
Eina_List *containers;
E_Pointer *pointer;
Ecore_X_Window initwin;
E_Comp *comp;
Ecore_Timer *clear_timer;
Eina_Bool visible : 1;
};
EINTERN int e_manager_init(void);
EINTERN int e_manager_shutdown(void);
EAPI Eina_List *e_manager_list(void);
EAPI E_Manager *e_manager_new(Ecore_X_Window root, int num);
EAPI E_Manager *e_manager_new(Ecore_Window root, E_Comp *c, int w, int h);
EAPI void e_manager_manage_windows(E_Manager *man);
EAPI void e_manager_show(E_Manager *man);
EAPI void e_manager_hide(E_Manager *man);
EAPI void e_manager_move(E_Manager *man, int x, int y);
EAPI void e_manager_resize(E_Manager *man, int w, int h);
EAPI void e_manager_move_resize(E_Manager *man, int x, int y, int w, int h);
EAPI void e_manager_raise(E_Manager *man);
EAPI void e_manager_lower(E_Manager *man);
EAPI E_Manager *e_manager_current_get(void);
EAPI E_Manager *e_manager_number_get(int num);
@ -50,7 +38,7 @@ EAPI void e_managers_keys_grab(void);
EAPI void e_managers_keys_ungrab(void);
static inline E_Manager *
e_manager_find_by_root(Ecore_X_Window root)
e_manager_find_by_root(Ecore_Window root)
{
Eina_List *l;
E_Manager *man;

View File

@ -14,38 +14,36 @@ struct _E_Maximize_Rect
rects = eina_list_append(rects, r); \
}
static void _e_maximize_border_rects_fill(E_Border *bd, Eina_List *list, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir);
static void _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2);
static void _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int *x2, int *bx, int *by, int *bw, int *bh);
static void _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *yy1, int *y2, int *bx, int *by, int *bw, int *bh);
static void _e_maximize_client_rects_fill(E_Client *ec, Eina_List *list, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir);
static void _e_maximize_client_rects_fill_both(E_Client *ec, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2);
static void _e_maximize_client_rects_fill_horiz(E_Client *ec, Eina_List *rects, int *x1, int *x2, int *bx, int *by, int *bw, int *bh);
static void _e_maximize_client_rects_fill_vert(E_Client *ec, Eina_List *rects, int *yy1, int *y2, int *bx, int *by, int *bw, int *bh);
EAPI void
e_maximize_border_shelf_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
e_maximize_client_shelf_fit(E_Client *ec, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
e_maximize_border_shelf_fill(bd, x1, yy1, x2, y2, dir);
e_maximize_client_shelf_fill(ec, x1, yy1, x2, y2, dir);
}
EAPI void
e_maximize_border_dock_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2)
e_maximize_client_dock_fit(E_Client *ec, int *x1, int *yy1, int *x2, int *y2)
{
E_Border_List *bl;
E_Border *bd2;
E_Client *ec2;
int cx1, cx2, cy1, cy2;
cx1 = bd->zone->x;
cx1 = ec->zone->x;
if (x1) cx1 = *x1;
cy1 = bd->zone->y;
cy1 = ec->zone->y;
if (yy1) cy1 = *yy1;
cx2 = bd->zone->x + bd->zone->w;
cx2 = ec->zone->x + ec->zone->w;
if (x2) cx2 = *x2;
cy2 = bd->zone->y + bd->zone->h;
cy2 = ec->zone->y + ec->zone->h;
if (y2) cy2 = *y2;
bl = e_container_border_list_first(bd->zone->container);
while ((bd2 = e_container_border_list_next(bl)))
E_CLIENT_FOREACH(ec->comp, ec2)
{
enum
{
@ -56,61 +54,61 @@ e_maximize_border_dock_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2)
LEFT
} edge = NONE;
if ((bd2->zone != bd->zone) || (bd2 == bd) ||
(bd2->client.netwm.type != ECORE_X_WINDOW_TYPE_DOCK))
if ((ec2->zone != ec->zone) || (ec2 == ec) ||
(ec2->netwm.type != E_WINDOW_TYPE_DOCK))
continue;
if (((bd2->x == bd2->zone->x) || ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w))) &&
((bd2->y == bd2->zone->y) || ((bd2->x + bd2->h) == (bd2->zone->x + bd2->zone->h))))
if (((ec2->x == ec2->zone->x) || ((ec2->x + ec2->w) == (ec2->zone->x + ec2->zone->w))) &&
((ec2->y == ec2->zone->y) || ((ec2->x + ec2->h) == (ec2->zone->x + ec2->zone->h))))
{
/* corner */
if (bd2->w > bd2->h)
if (ec2->w > ec2->h)
{
if (bd2->y == bd2->zone->y)
if (ec2->y == ec2->zone->y)
edge = TOP;
else if ((bd2->y + bd2->h) == (bd2->zone->y + bd2->zone->h))
else if ((ec2->y + ec2->h) == (ec2->zone->y + ec2->zone->h))
edge = BOTTOM;
}
else
{
if ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w))
if ((ec2->x + ec2->w) == (ec2->zone->x + ec2->zone->w))
edge = RIGHT;
else if (bd2->x == bd2->zone->x)
else if (ec2->x == ec2->zone->x)
edge = LEFT;
}
}
else
{
if (bd2->y == bd2->zone->y)
if (ec2->y == ec2->zone->y)
edge = TOP;
else if ((bd2->y + bd2->h) == (bd2->zone->y + bd2->zone->h))
else if ((ec2->y + ec2->h) == (ec2->zone->y + ec2->zone->h))
edge = BOTTOM;
else if (bd2->x == bd2->zone->x)
else if (ec2->x == ec2->zone->x)
edge = LEFT;
else if ((bd2->x + bd2->w) == (bd2->zone->x + bd2->zone->w))
else if ((ec2->x + ec2->w) == (ec2->zone->x + ec2->zone->w))
edge = RIGHT;
}
switch (edge)
{
case TOP:
if ((bd2->y + bd2->h) > cy1)
cy1 = (bd2->y + bd2->h);
if ((ec2->y + ec2->h) > cy1)
cy1 = (ec2->y + ec2->h);
break;
case RIGHT:
if (bd2->x < cx2)
cx2 = bd2->x;
if (ec2->x < cx2)
cx2 = ec2->x;
break;
case BOTTOM:
if (bd2->y < cy2)
cy2 = bd2->y;
if (ec2->y < cy2)
cy2 = ec2->y;
break;
case LEFT:
if ((bd2->x + bd2->w) > cx1)
cx1 = (bd2->x + bd2->w);
if ((ec2->x + ec2->w) > cx1)
cx1 = (ec2->x + ec2->w);
break;
case NONE:
@ -118,7 +116,6 @@ e_maximize_border_dock_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2)
break;
}
}
e_container_border_list_free(bl);
if (x1) *x1 = cx1;
if (yy1) *yy1 = cy1;
@ -127,7 +124,7 @@ e_maximize_border_dock_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2)
}
EAPI void
e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
e_maximize_client_shelf_fill(E_Client *ec, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
Eina_List *l, *rects = NULL;
E_Shelf *es;
@ -139,13 +136,13 @@ e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2,
E_Config_Shelf_Desk *sd;
if (es->cfg->overlap) continue;
if (es->zone != bd->zone) continue;
if (es->zone != ec->zone) continue;
if (es->cfg->desk_show_mode)
{
EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd)
{
if (!sd) continue;
if ((sd->x == bd->desk->x) && (sd->y == bd->desk->y))
if ((sd->x == ec->desk->x) && (sd->y == ec->desk->y))
{
OBSTACLE(es->x + es->zone->x, es->y + es->zone->y,
es->x + es->zone->x + es->w, es->y + es->zone->y + es->h);
@ -161,91 +158,88 @@ e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2,
}
if (rects)
{
_e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir);
_e_maximize_client_rects_fill(ec, rects, x1, yy1, x2, y2, dir);
E_FREE_LIST(rects, free);
}
}
EAPI void
e_maximize_border_border_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
e_maximize_client_client_fill(E_Client *ec, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
Eina_List *rects = NULL;
E_Border_List *bl;
E_Maximize_Rect *r;
E_Border *bd2;
E_Client *ec2;
bl = e_container_border_list_first(bd->zone->container);
while ((bd2 = e_container_border_list_next(bl)))
E_CLIENT_FOREACH(ec->comp, ec2)
{
if ((bd2->zone != bd->zone) || (bd == bd2) || (bd2->desk != bd->desk && !bd2->sticky) || (bd2->iconic))
if ((ec2->zone != ec->zone) || (ec == ec2) || (ec2->desk != ec->desk && !ec2->sticky) || (ec2->iconic))
continue;
OBSTACLE(bd2->x, bd2->y, bd2->x + bd2->w, bd2->y + bd2->h);
OBSTACLE(ec2->x, ec2->y, ec2->x + ec2->w, ec2->y + ec2->h);
}
e_container_border_list_free(bl);
if (rects)
{
_e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir);
_e_maximize_client_rects_fill(ec, rects, x1, yy1, x2, y2, dir);
E_FREE_LIST(rects, free);
}
}
static void
_e_maximize_border_rects_fill(E_Border *bd, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
_e_maximize_client_rects_fill(E_Client *ec, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)
{
_e_maximize_border_rects_fill_both(bd, rects, x1, yy1, x2, y2);
_e_maximize_client_rects_fill_both(ec, rects, x1, yy1, x2, y2);
}
else
{
int bx, by, bw, bh;
bx = bd->x;
by = bd->y;
bw = bd->w;
bh = bd->h;
bx = ec->x;
by = ec->y;
bw = ec->w;
bh = ec->h;
if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
_e_maximize_border_rects_fill_horiz(bd, rects, x1, x2, &bx, &by, &bw, &bh);
_e_maximize_client_rects_fill_horiz(ec, rects, x1, x2, &bx, &by, &bw, &bh);
else if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL)
_e_maximize_border_rects_fill_vert(bd, rects, yy1, y2, &bx, &by, &bw, &bh);
_e_maximize_client_rects_fill_vert(ec, rects, yy1, y2, &bx, &by, &bw, &bh);
}
}
static void
_e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2)
_e_maximize_client_rects_fill_both(E_Client *ec, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2)
{
int hx1, hy1, hx2, hy2;
int vx1, vy1, vx2, vy2;
int bx, by, bw, bh;
hx1 = vx1 = bd->zone->x;
hx1 = vx1 = ec->zone->x;
if (x1) hx1 = vx1 = *x1;
hy1 = vy1 = bd->zone->y;
hy1 = vy1 = ec->zone->y;
if (yy1) hy1 = vy1 = *yy1;
hx2 = vx2 = bd->zone->x + bd->zone->w;
hx2 = vx2 = ec->zone->x + ec->zone->w;
if (x2) hx2 = vx2 = *x2;
hy2 = vy2 = bd->zone->y + bd->zone->h;
hy2 = vy2 = ec->zone->y + ec->zone->h;
if (y2) hy2 = vy2 = *y2;
/* Init working values, try maximizing horizontally first */
bx = bd->x;
by = bd->y;
bw = bd->w;
bh = bd->h;
_e_maximize_border_rects_fill_horiz(bd, rects, &hx1, &hx2, &bx, &by, &bw, &bh);
_e_maximize_border_rects_fill_vert(bd, rects, &hy1, &hy2, &bx, &by, &bw, &bh);
bx = ec->x;
by = ec->y;
bw = ec->w;
bh = ec->h;
_e_maximize_client_rects_fill_horiz(ec, rects, &hx1, &hx2, &bx, &by, &bw, &bh);
_e_maximize_client_rects_fill_vert(ec, rects, &hy1, &hy2, &bx, &by, &bw, &bh);
/* Reset working values, try maximizing vertically first */
bx = bd->x;
by = bd->y;
bw = bd->w;
bh = bd->h;
_e_maximize_border_rects_fill_vert(bd, rects, &vy1, &vy2, &bx, &by, &bw, &bh);
_e_maximize_border_rects_fill_horiz(bd, rects, &vx1, &vx2, &bx, &by, &bw, &bh);
bx = ec->x;
by = ec->y;
bw = ec->w;
bh = ec->h;
_e_maximize_client_rects_fill_vert(ec, rects, &vy1, &vy2, &bx, &by, &bw, &bh);
_e_maximize_client_rects_fill_horiz(ec, rects, &vx1, &vx2, &bx, &by, &bw, &bh);
/* Use the result set that gives the largest volume */
if (((hx2 - hx1) * (hy2 - hy1)) > ((vx2 - vx1) * (vy2 - vy1)))
@ -265,23 +259,23 @@ _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int
}
static void
_e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int *x2, int *bx, int *by, int *bw, int *bh)
_e_maximize_client_rects_fill_horiz(E_Client *ec, Eina_List *rects, int *x1, int *x2, int *bx, int *by, int *bw, int *bh)
{
Eina_List *l;
E_Maximize_Rect *rect;
int cx1, cx2;
cx1 = bd->zone->x;
cx1 = ec->zone->x;
if (x1) cx1 = *x1;
cx2 = bd->zone->x + bd->zone->w;
cx2 = ec->zone->x + ec->zone->w;
if (x2) cx2 = *x2;
/* Expand left */
EINA_LIST_FOREACH(rects, l, rect)
{
if ((rect->x2 > cx1) && (rect->x2 <= *bx) &&
E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh))
E_INTERSECTS(0, rect->yy1, ec->zone->w, (rect->y2 - rect->yy1), 0, *by, ec->zone->w, *bh))
{
cx1 = rect->x2;
}
@ -293,7 +287,7 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int
EINA_LIST_FOREACH(rects, l, rect)
{
if ((rect->x1 < cx2) && (rect->x1 >= (*bx + *bw)) &&
E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh))
E_INTERSECTS(0, rect->yy1, ec->zone->w, (rect->y2 - rect->yy1), 0, *by, ec->zone->w, *bh))
{
cx2 = rect->x1;
}
@ -305,23 +299,23 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int
}
static void
_e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *yy1, int *y2, int *bx, int *by, int *bw, int *bh)
_e_maximize_client_rects_fill_vert(E_Client *ec, Eina_List *rects, int *yy1, int *y2, int *bx, int *by, int *bw, int *bh)
{
Eina_List *l;
E_Maximize_Rect *rect;
int cy1, cy2;
cy1 = bd->zone->y;
cy1 = ec->zone->y;
if (yy1) cy1 = *yy1;
cy2 = bd->zone->y + bd->zone->h;
cy2 = ec->zone->y + ec->zone->h;
if (y2) cy2 = *y2;
/* Expand up */
EINA_LIST_FOREACH(rects, l, rect)
{
if ((rect->y2 > cy1) && (rect->y2 <= *by) &&
E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h))
E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), ec->zone->h, *bx, 0, *bw, ec->zone->h))
{
cy1 = rect->y2;
}
@ -333,7 +327,7 @@ _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *yy1, int
EINA_LIST_FOREACH(rects, l, rect)
{
if ((rect->yy1 < cy2) && (rect->yy1 >= (*by + *bh)) &&
E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h))
E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), ec->zone->h, *bx, 0, *bw, ec->zone->h))
{
cy2 = rect->yy1;
}

View File

@ -3,10 +3,10 @@
#ifndef E_MAXIMIZE_H
#define E_MAXIMIZE_H
EAPI void e_maximize_border_shelf_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir);
EAPI void e_maximize_border_dock_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2);
EAPI void e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir);
EAPI void e_maximize_border_border_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir);
EAPI void e_maximize_client_shelf_fit(E_Client *ec, int *x1, int *y1, int *x2, int *y2, E_Maximize dir);
EAPI void e_maximize_client_dock_fit(E_Client *ec, int *x1, int *y1, int *x2, int *y2);
EAPI void e_maximize_client_shelf_fill(E_Client *ec, int *x1, int *y1, int *x2, int *y2, E_Maximize dir);
EAPI void e_maximize_client_client_fill(E_Client *ec, int *x1, int *y1, int *x2, int *y2, E_Maximize dir);
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More