forked from enlightenment/enlightenment
clean up sb removal. move menu border to its own file
SVN revision: 18149
This commit is contained in:
parent
470ce088d0
commit
ebefd8540e
10
TODO
10
TODO
|
@ -32,7 +32,6 @@ Some of the things (in very short form) that need to be done to E17...
|
||||||
ESSENTIAL FEATURES
|
ESSENTIAL FEATURES
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
* emit signal to submenu entries if they have a submenu shown for them or not
|
|
||||||
* add fullscreen support (e16 xvidmode or xrandr style)
|
* add fullscreen support (e16 xvidmode or xrandr style)
|
||||||
* implement thees maximise/fullscreen modes:
|
* implement thees maximise/fullscreen modes:
|
||||||
Which of these should be different modes, and which should be options for
|
Which of these should be different modes, and which should be options for
|
||||||
|
@ -68,16 +67,12 @@ Some of the things (in very short form) that need to be done to E17...
|
||||||
* actions to make current zone different (warp mouse to there)
|
* actions to make current zone different (warp mouse to there)
|
||||||
* actions to make the current container different
|
* actions to make the current container different
|
||||||
* titlebar/border expansion/gadget panel for modules to put window widgets in
|
* titlebar/border expansion/gadget panel for modules to put window widgets in
|
||||||
* break out desks x/y size config so you can have a different desktop size
|
|
||||||
per zone - right now there is a signle global (use this later as the default
|
|
||||||
for new/unconfigured zones)
|
|
||||||
* language packs: need to have a tool to load/setup a language pack (which
|
* language packs: need to have a tool to load/setup a language pack (which
|
||||||
means .mo compiled files from a .po, an optional font and a config file that
|
means .mo compiled files from a .po, an optional font and a config file that
|
||||||
specifies the locale and font) and then install the font(s) either as a user
|
specifies the locale and font) and then install the font(s) either as a user
|
||||||
or superuser, and the .mo in the system or a user locales dir.
|
or superuser, and the .mo in the system or a user locales dir.
|
||||||
* all menus need icons if they dont have them yet:)
|
* all menus need icons if they dont have them yet:)
|
||||||
* gadget containers (shelves?) using popups as well as in-line in a canvas
|
* gadget containers (shelves?) using popups as well as in-line in a canvas
|
||||||
* add key input focus control for desktop modules
|
|
||||||
* finish off icccm support
|
* finish off icccm support
|
||||||
* finish complete netwm support
|
* finish complete netwm support
|
||||||
* different cursors for different parts of the screen
|
* different cursors for different parts of the screen
|
||||||
|
@ -139,6 +134,11 @@ Some of the things (in very short form) that need to be done to E17...
|
||||||
"NICE TO HAVE" FEATURES
|
"NICE TO HAVE" FEATURES
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* add key input focus control for desktop modules
|
||||||
|
* break out desks x/y size config so you can have a different desktop size
|
||||||
|
per zone - right now there is a signle global (use this later as the default
|
||||||
|
for new/unconfigured zones)
|
||||||
|
* emit signal to submenu entries if they have a submenu shown for them or not
|
||||||
* screensaver/lock module
|
* screensaver/lock module
|
||||||
* tip/hint/suggestion dialog
|
* tip/hint/suggestion dialog
|
||||||
* add tooltips
|
* add tooltips
|
||||||
|
|
|
@ -39,7 +39,6 @@ default_configure.edc \
|
||||||
default_about.edc \
|
default_about.edc \
|
||||||
default_theme_about.edc \
|
default_theme_about.edc \
|
||||||
default_entry.edc \
|
default_entry.edc \
|
||||||
default_scrollbar.edc \
|
|
||||||
default_fileman.edc \
|
default_fileman.edc \
|
||||||
default_check.edc \
|
default_check.edc \
|
||||||
default_radio.edc \
|
default_radio.edc \
|
||||||
|
|
|
@ -49,7 +49,6 @@ collections {
|
||||||
#include "default_entry.edc"
|
#include "default_entry.edc"
|
||||||
#include "default_fileman.edc"
|
#include "default_fileman.edc"
|
||||||
#include "default_filesel.edc"
|
#include "default_filesel.edc"
|
||||||
#include "default_scrollbar.edc"
|
|
||||||
#include "default_check.edc"
|
#include "default_check.edc"
|
||||||
#include "default_radio.edc"
|
#include "default_radio.edc"
|
||||||
#include "default_frame.edc"
|
#include "default_frame.edc"
|
||||||
|
|
|
@ -107,7 +107,8 @@ e_widget_iconsel.h \
|
||||||
e_widget_fileman.h \
|
e_widget_fileman.h \
|
||||||
e_scrollframe.h \
|
e_scrollframe.h \
|
||||||
e_file_selector.h \
|
e_file_selector.h \
|
||||||
e_file_dialog.h
|
e_file_dialog.h \
|
||||||
|
e_int_border_menu.h
|
||||||
|
|
||||||
enlightenment_src = \
|
enlightenment_src = \
|
||||||
e_user.c \
|
e_user.c \
|
||||||
|
@ -196,6 +197,7 @@ e_widget_fileman.c \
|
||||||
e_scrollframe.c \
|
e_scrollframe.c \
|
||||||
e_file_selector.c \
|
e_file_selector.c \
|
||||||
e_file_dialog.c \
|
e_file_dialog.c \
|
||||||
|
e_int_border_menu.c \
|
||||||
$(ENLIGHTENMENTHEADERS)
|
$(ENLIGHTENMENTHEADERS)
|
||||||
|
|
||||||
enlightenment_SOURCES = \
|
enlightenment_SOURCES = \
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
static void _e_border_free(E_Border *bd);
|
static void _e_border_free(E_Border *bd);
|
||||||
static void _e_border_del(E_Border *bd);
|
static void _e_border_del(E_Border *bd);
|
||||||
static void _e_border_menus_del(E_Border *bd);
|
|
||||||
|
|
||||||
/* FIXME: these likely belong in a separate icccm/client handler */
|
/* FIXME: these likely belong in a separate icccm/client handler */
|
||||||
/* and the border needs to become a dumb object that just does what its */
|
/* and the border needs to become a dumb object that just does what its */
|
||||||
|
@ -62,24 +61,6 @@ static void _e_border_resize_handle(E_Border *bd);
|
||||||
|
|
||||||
static int _e_border_shade_animator(void *data);
|
static int _e_border_shade_animator(void *data);
|
||||||
|
|
||||||
static void _e_border_cb_border_menu_end(void *data, E_Menu *m);
|
|
||||||
static void _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp);
|
|
||||||
static void _e_border_menu_cb_close(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_iconify(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_on_top(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_normal(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_below(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_borderless(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_fullscreen(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_skip_winlist(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_sendto_pre(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _e_border_menu_cb_sendto(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
|
|
||||||
static void _e_border_event_border_add_free(void *data, void *ev);
|
static void _e_border_event_border_add_free(void *data, void *ev);
|
||||||
static void _e_border_event_border_remove_free(void *data, void *ev);
|
static void _e_border_event_border_remove_free(void *data, void *ev);
|
||||||
static void _e_border_event_border_zone_set_free(void *data, void *ev);
|
static void _e_border_event_border_zone_set_free(void *data, void *ev);
|
||||||
|
@ -2042,17 +2023,17 @@ e_border_act_menu_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev, int k
|
||||||
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
|
||||||
if (ev)
|
if (ev)
|
||||||
{
|
{
|
||||||
_e_border_menu_show(bd,
|
e_int_border_menu_show(bd,
|
||||||
bd->x + ev->x - bd->zone->container->x,
|
bd->x + ev->x - bd->zone->container->x,
|
||||||
bd->y + ev->y - bd->zone->container->y, key,
|
bd->y + ev->y - bd->zone->container->y, key,
|
||||||
ev->time);
|
ev->time);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
ecore_x_pointer_xy_get(bd->zone->container->win, &x, &y);
|
ecore_x_pointer_xy_get(bd->zone->container->win, &x, &y);
|
||||||
_e_border_menu_show(bd, x, y, key, 0);
|
e_int_border_menu_show(bd, x, y, key, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2595,7 +2576,7 @@ _e_border_free(E_Border *bd)
|
||||||
bd->border_remember_dialog = NULL;
|
bd->border_remember_dialog = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_e_border_menus_del(bd);
|
e_int_border_menu_del(bd);
|
||||||
|
|
||||||
if (focused == bd)
|
if (focused == bd)
|
||||||
{
|
{
|
||||||
|
@ -2701,8 +2682,9 @@ _e_border_del(E_Border *bd)
|
||||||
e_object_del(E_OBJECT(bd->border_remember_dialog));
|
e_object_del(E_OBJECT(bd->border_remember_dialog));
|
||||||
bd->border_remember_dialog = NULL;
|
bd->border_remember_dialog = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e_int_border_menu_del(bd);
|
||||||
|
|
||||||
_e_border_menus_del(bd);
|
|
||||||
if (bd->raise_timer)
|
if (bd->raise_timer)
|
||||||
{
|
{
|
||||||
ecore_timer_del(bd->raise_timer);
|
ecore_timer_del(bd->raise_timer);
|
||||||
|
@ -2776,28 +2758,6 @@ _e_border_del(E_Border *bd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menus_del(E_Border *bd)
|
|
||||||
{
|
|
||||||
int was_menu = 0;
|
|
||||||
|
|
||||||
if (bd->border_stacking_menu)
|
|
||||||
{
|
|
||||||
e_object_del(E_OBJECT(bd->border_stacking_menu));
|
|
||||||
bd->border_stacking_menu = NULL;
|
|
||||||
was_menu = 1;
|
|
||||||
}
|
|
||||||
if (bd->border_menu)
|
|
||||||
{
|
|
||||||
e_object_del(E_OBJECT(bd->border_menu));
|
|
||||||
bd->border_menu = NULL;
|
|
||||||
was_menu = 1;
|
|
||||||
}
|
|
||||||
if (was_menu)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_e_border_cb_window_show_request(void *data, int ev_type, void *ev)
|
_e_border_cb_window_show_request(void *data, int ev_type, void *ev)
|
||||||
{
|
{
|
||||||
|
@ -5715,529 +5675,6 @@ _e_border_shade_animator(void *data)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_cb_border_menu_end(void *data, E_Menu *m)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = e_object_data_get(E_OBJECT(m));
|
|
||||||
if (bd)
|
|
||||||
{
|
|
||||||
/* If the border exists, delete all associated menus */
|
|
||||||
_e_border_menus_del(bd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Just delete this menu */
|
|
||||||
e_object_del(E_OBJECT(m));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_locks(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (bd->border_locks_dialog) return;
|
|
||||||
e_int_border_locks(bd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_remember(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
bd = data;
|
|
||||||
if (bd->border_remember_dialog) return;
|
|
||||||
e_int_border_remember(bd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp)
|
|
||||||
{
|
|
||||||
E_Menu *m;
|
|
||||||
E_Menu_Item *mi;
|
|
||||||
|
|
||||||
if (bd->border_menu) return;
|
|
||||||
|
|
||||||
m = e_menu_new();
|
|
||||||
bd->border_stacking_menu = m;
|
|
||||||
/* Only allow to change layer for windows in "normal" layers */
|
|
||||||
if ((!bd->lock_user_stacking) &&
|
|
||||||
((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Always On Top"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
e_menu_item_toggle_set(mi, (bd->layer == 150 ? 1 : 0));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_on_top, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/stack_on_top"),
|
|
||||||
"widgets/border/default/stack_on_top");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Normal"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
e_menu_item_toggle_set(mi, (bd->layer == 100 ? 1 : 0));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_normal, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/stack_normal"),
|
|
||||||
"widgets/border/default/stack_normal");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Always Below"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
e_menu_item_toggle_set(mi, (bd->layer == 50 ? 1 : 0));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_below, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/stack_below"),
|
|
||||||
"widgets/border/default/stack_below");
|
|
||||||
}
|
|
||||||
|
|
||||||
m = e_menu_new();
|
|
||||||
e_object_data_set(E_OBJECT(m), bd);
|
|
||||||
bd->border_menu = m;
|
|
||||||
e_menu_post_deactivate_callback_set(m, _e_border_cb_border_menu_end, NULL);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Window Locks"));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_locks, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/locks"),
|
|
||||||
"widgets/border/default/locks");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Remember"));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_remember, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/remember"),
|
|
||||||
"widgets/border/default/remember");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Send to Desktop"));
|
|
||||||
e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_sendto_pre, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/sendto"),
|
|
||||||
"widgets/border/default/sendto");
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Stacking"));
|
|
||||||
e_menu_item_submenu_set(mi, bd->border_stacking_menu);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/stacking"),
|
|
||||||
"widgets/border/default/stacking");
|
|
||||||
|
|
||||||
if ((!bd->lock_user_shade) && (!(!strcmp("borderless", bd->client.border.name))))
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Shaded"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, (bd->shaded ? 1 : 0));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_shade, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/shade"),
|
|
||||||
"widgets/border/default/shade");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bd->lock_user_maximize)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Maximized"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/maximize"),
|
|
||||||
"widgets/border/default/maximize");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bd->lock_user_sticky)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Sticky"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, (bd->sticky ? 1 : 0));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_stick, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/stick"),
|
|
||||||
"widgets/border/default/stick");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((!bd->shaded) && (!bd->fullscreen) && (!bd->lock_border))
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Borderless"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, !strcmp("borderless", bd->client.border.name));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_borderless, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/borderless"),
|
|
||||||
"widgets/border/default/borderless");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bd->lock_user_fullscreen)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Fullscreen"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, bd->fullscreen);
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_fullscreen, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/fullscreen"),
|
|
||||||
"widgets/border/default/fullscreen");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((bd->client.icccm.accepts_focus || bd->client.icccm.take_focus) &&
|
|
||||||
(!bd->client.netwm.state.skip_taskbar))
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Skip Window List"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, bd->user_skip_winlist);
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_skip_winlist, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/skip_winlist"),
|
|
||||||
"widgets/border/default/skip_winlist");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ecore_file_app_installed("e_util_eapp_edit"))
|
|
||||||
{
|
|
||||||
char *title = "";
|
|
||||||
|
|
||||||
if (bd->client.netwm.name) title = bd->client.netwm.name;
|
|
||||||
else title = bd->client.icccm.title;
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
if (bd->app)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Edit Icon"));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd->app->path);
|
|
||||||
e_menu_item_icon_edje_set(mi, bd->app->path, "icon");
|
|
||||||
}
|
|
||||||
else if (bd->client.icccm.class) /* icons with no class useless to borders */
|
|
||||||
{
|
|
||||||
static char buf[PATH_MAX + 50];
|
|
||||||
char *name, *homedir;
|
|
||||||
int i, l;
|
|
||||||
|
|
||||||
buf[0] = '\0';
|
|
||||||
/* generate a reasonable file name from the window class */
|
|
||||||
/* FIXME - I think there could be duplicates - how better to do this? */
|
|
||||||
name = strdup(bd->client.icccm.class);
|
|
||||||
l = strlen(name);
|
|
||||||
for (i = 0; i < l; i++)
|
|
||||||
{
|
|
||||||
if (name[i] == ' ') name[i] = '_';
|
|
||||||
}
|
|
||||||
/* previously this could be null, but it will exist now */
|
|
||||||
homedir = e_user_homedir_get();
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf),
|
|
||||||
"--win-class \"%s\" %s/.e/e/applications/all/%s.eap",
|
|
||||||
bd->client.icccm.class, homedir, name);
|
|
||||||
free(homedir);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Create Icon"));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, buf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
|
|
||||||
if ((!bd->lock_close) && (!bd->internal))
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Kill"));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_kill, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/kill"),
|
|
||||||
"widgets/border/default/kill");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bd->lock_user_iconify)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Iconify"));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_iconify, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/minimize"),
|
|
||||||
"widgets/border/default/minimize");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bd->lock_close)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Close"));
|
|
||||||
e_menu_item_callback_set(mi, _e_border_menu_cb_close, bd);
|
|
||||||
e_menu_item_icon_edje_set(mi,
|
|
||||||
(char *)e_theme_edje_file_get("base/theme/borders",
|
|
||||||
"widgets/border/default/close"),
|
|
||||||
"widgets/border/default/close");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key)
|
|
||||||
e_menu_activate_key(m, bd->zone, x, y, 1, 1,
|
|
||||||
E_MENU_POP_DIRECTION_DOWN);
|
|
||||||
else
|
|
||||||
e_menu_activate_mouse(m, bd->zone, x, y, 1, 1,
|
|
||||||
E_MENU_POP_DIRECTION_DOWN, timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_close(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd->lock_close)
|
|
||||||
e_border_act_close_begin(bd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_iconify(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd->lock_user_iconify)
|
|
||||||
{
|
|
||||||
if (bd->iconic) e_border_uniconify(bd);
|
|
||||||
else e_border_iconify(bd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if ((!bd->lock_close) && (!bd->internal))
|
|
||||||
e_border_act_kill_begin(bd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd->lock_user_maximize)
|
|
||||||
{
|
|
||||||
if (bd->maximized) e_border_unmaximize(bd);
|
|
||||||
else e_border_maximize(bd, e_config->maximize_policy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd->lock_user_shade)
|
|
||||||
{
|
|
||||||
if (bd->shaded) e_border_unshade(bd, E_DIRECTION_UP);
|
|
||||||
else e_border_shade(bd, E_DIRECTION_UP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
char *file;
|
|
||||||
char *command;
|
|
||||||
char *full;
|
|
||||||
Ecore_Exe *process;
|
|
||||||
|
|
||||||
file = data;
|
|
||||||
command = "e_util_eapp_edit ";
|
|
||||||
full = malloc(strlen(file) + strlen(command) + 1);
|
|
||||||
strcpy(full, command);
|
|
||||||
strcat(full, file);
|
|
||||||
process = ecore_exe_run(full, NULL);
|
|
||||||
if (!process || !ecore_exe_pid_get(process))
|
|
||||||
e_error_dialog_show(_("Icon Edit Error"),
|
|
||||||
_("Error starting icon editor\n\n"
|
|
||||||
"please install e_util_eapp_edit\n"
|
|
||||||
"or make sure it is in your PATH\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd->lock_user_sticky)
|
|
||||||
{
|
|
||||||
if (bd->sticky) e_border_unstick(bd);
|
|
||||||
else e_border_stick(bd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_on_top(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (bd->layer != 150)
|
|
||||||
{
|
|
||||||
e_border_layer_set(bd, 150);
|
|
||||||
e_hints_window_stacking_set(bd, E_STACKING_ABOVE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_below(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (bd->layer != 50)
|
|
||||||
{
|
|
||||||
e_border_layer_set(bd, 50);
|
|
||||||
e_hints_window_stacking_set(bd, E_STACKING_BELOW);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_normal(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (bd->layer != 100)
|
|
||||||
{
|
|
||||||
e_border_layer_set(bd, 100);
|
|
||||||
e_hints_window_stacking_set(bd, E_STACKING_NONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_borderless(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
int toggle;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd) return;
|
|
||||||
|
|
||||||
if ((!bd->lock_border) && (!bd->shaded))
|
|
||||||
{
|
|
||||||
if (bd->client.border.name) free(bd->client.border.name);
|
|
||||||
toggle = e_menu_item_toggle_get(mi);
|
|
||||||
if (toggle)
|
|
||||||
bd->client.border.name = strdup("borderless");
|
|
||||||
else
|
|
||||||
bd->client.border.name = strdup("default");
|
|
||||||
bd->client.border.changed = 1;
|
|
||||||
bd->changed = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_fullscreen(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
int toggle;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd) return;
|
|
||||||
|
|
||||||
if (!bd->lock_user_fullscreen)
|
|
||||||
{
|
|
||||||
toggle = e_menu_item_toggle_get(mi);
|
|
||||||
if (toggle)
|
|
||||||
e_border_fullscreen(bd);
|
|
||||||
else
|
|
||||||
e_border_unfullscreen(bd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_skip_winlist(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
if (!bd) return;
|
|
||||||
|
|
||||||
if ((bd->client.icccm.accepts_focus || bd->client.icccm.take_focus) &&
|
|
||||||
(!bd->client.netwm.state.skip_taskbar))
|
|
||||||
bd->user_skip_winlist = e_menu_item_toggle_get(mi);
|
|
||||||
else
|
|
||||||
bd->user_skip_winlist = 0;
|
|
||||||
if (bd->remember) e_remember_update(bd->remember, bd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_sendto_pre(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Menu *subm;
|
|
||||||
E_Menu_Item *submi;
|
|
||||||
E_Border *bd;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
bd = data;
|
|
||||||
|
|
||||||
subm = e_menu_new();
|
|
||||||
e_object_data_set(E_OBJECT(subm), bd);
|
|
||||||
e_menu_item_submenu_set(mi, subm);
|
|
||||||
|
|
||||||
for (i = 0; i < bd->zone->desk_x_count * bd->zone->desk_y_count; i++)
|
|
||||||
{
|
|
||||||
E_Desk *desk;
|
|
||||||
|
|
||||||
desk = bd->zone->desks[i];
|
|
||||||
submi = e_menu_item_new(subm);
|
|
||||||
e_menu_item_label_set(submi, desk->name);
|
|
||||||
e_menu_item_callback_set(submi, _e_border_menu_cb_sendto, desk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_border_menu_cb_sendto(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
E_Desk *desk;
|
|
||||||
E_Border *bd;
|
|
||||||
|
|
||||||
desk = data;
|
|
||||||
bd = e_object_data_get(E_OBJECT(m));
|
|
||||||
if ((bd) && (desk))
|
|
||||||
{
|
|
||||||
e_border_desk_set(bd, desk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_border_event_border_resize_free(void *data, void *ev)
|
_e_border_event_border_resize_free(void *data, void *ev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,6 +135,7 @@ struct _E_Border
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
unsigned char changed : 1;
|
unsigned char changed : 1;
|
||||||
|
unsigned char user_selected : 1;
|
||||||
char *name;
|
char *name;
|
||||||
} border;
|
} border;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@
|
||||||
#include "e_about.h"
|
#include "e_about.h"
|
||||||
#include "e_theme_about.h"
|
#include "e_theme_about.h"
|
||||||
#include "e_apps_cache.h"
|
#include "e_apps_cache.h"
|
||||||
#include "e_scrollbar.h"
|
|
||||||
#include "e_fileman.h"
|
#include "e_fileman.h"
|
||||||
#include "e_fileman_smart.h"
|
#include "e_fileman_smart.h"
|
||||||
#include "e_fileman_file.h"
|
#include "e_fileman_file.h"
|
||||||
|
@ -88,3 +87,4 @@
|
||||||
#include "e_file_selector.h"
|
#include "e_file_selector.h"
|
||||||
#include "e_file_dialog.h"
|
#include "e_file_dialog.h"
|
||||||
#include "e_widget_fileman.h"
|
#include "e_widget_fileman.h"
|
||||||
|
#include "e_int_border_menu.h"
|
||||||
|
|
|
@ -0,0 +1,566 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
#include "e.h"
|
||||||
|
|
||||||
|
static void _e_border_cb_border_menu_end(void *data, E_Menu *m);
|
||||||
|
static void _e_border_menu_cb_locks(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_remember(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_close(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_iconify(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_on_top(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_normal(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_below(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_borderless(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_fullscreen(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_skip_winlist(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_sendto_pre(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_border_menu_cb_sendto(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
|
||||||
|
void
|
||||||
|
e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp)
|
||||||
|
{
|
||||||
|
E_Menu *m;
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
|
if (bd->border_menu) return;
|
||||||
|
|
||||||
|
m = e_menu_new();
|
||||||
|
bd->border_stacking_menu = m;
|
||||||
|
/* Only allow to change layer for windows in "normal" layers */
|
||||||
|
if ((!bd->lock_user_stacking) &&
|
||||||
|
((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150)))
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Always On Top"));
|
||||||
|
e_menu_item_radio_set(mi, 1);
|
||||||
|
e_menu_item_radio_group_set(mi, 2);
|
||||||
|
e_menu_item_toggle_set(mi, (bd->layer == 150 ? 1 : 0));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_on_top, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/stack_on_top"),
|
||||||
|
"widgets/border/default/stack_on_top");
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Normal"));
|
||||||
|
e_menu_item_radio_set(mi, 1);
|
||||||
|
e_menu_item_radio_group_set(mi, 2);
|
||||||
|
e_menu_item_toggle_set(mi, (bd->layer == 100 ? 1 : 0));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_normal, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/stack_normal"),
|
||||||
|
"widgets/border/default/stack_normal");
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Always Below"));
|
||||||
|
e_menu_item_radio_set(mi, 1);
|
||||||
|
e_menu_item_radio_group_set(mi, 2);
|
||||||
|
e_menu_item_toggle_set(mi, (bd->layer == 50 ? 1 : 0));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_below, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/stack_below"),
|
||||||
|
"widgets/border/default/stack_below");
|
||||||
|
}
|
||||||
|
|
||||||
|
m = e_menu_new();
|
||||||
|
e_object_data_set(E_OBJECT(m), bd);
|
||||||
|
bd->border_menu = m;
|
||||||
|
e_menu_post_deactivate_callback_set(m, _e_border_cb_border_menu_end, NULL);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Window Locks"));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_locks, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/locks"),
|
||||||
|
"widgets/border/default/locks");
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Remember"));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_remember, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/remember"),
|
||||||
|
"widgets/border/default/remember");
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Send to Desktop"));
|
||||||
|
e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_cb_sendto_pre, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/sendto"),
|
||||||
|
"widgets/border/default/sendto");
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Stacking"));
|
||||||
|
e_menu_item_submenu_set(mi, bd->border_stacking_menu);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/stacking"),
|
||||||
|
"widgets/border/default/stacking");
|
||||||
|
|
||||||
|
if ((!bd->lock_user_shade) && (!(!strcmp("borderless", bd->client.border.name))))
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Shaded"));
|
||||||
|
e_menu_item_check_set(mi, 1);
|
||||||
|
e_menu_item_toggle_set(mi, (bd->shaded ? 1 : 0));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_shade, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/shade"),
|
||||||
|
"widgets/border/default/shade");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bd->lock_user_maximize)
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Maximized"));
|
||||||
|
e_menu_item_check_set(mi, 1);
|
||||||
|
e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/maximize"),
|
||||||
|
"widgets/border/default/maximize");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bd->lock_user_sticky)
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Sticky"));
|
||||||
|
e_menu_item_check_set(mi, 1);
|
||||||
|
e_menu_item_toggle_set(mi, (bd->sticky ? 1 : 0));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_stick, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/stick"),
|
||||||
|
"widgets/border/default/stick");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!bd->shaded) && (!bd->fullscreen) && (!bd->lock_border))
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Borderless"));
|
||||||
|
e_menu_item_check_set(mi, 1);
|
||||||
|
e_menu_item_toggle_set(mi, !strcmp("borderless", bd->client.border.name));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_borderless, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/borderless"),
|
||||||
|
"widgets/border/default/borderless");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bd->lock_user_fullscreen)
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Fullscreen"));
|
||||||
|
e_menu_item_check_set(mi, 1);
|
||||||
|
e_menu_item_toggle_set(mi, bd->fullscreen);
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_fullscreen, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/fullscreen"),
|
||||||
|
"widgets/border/default/fullscreen");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((bd->client.icccm.accepts_focus || bd->client.icccm.take_focus) &&
|
||||||
|
(!bd->client.netwm.state.skip_taskbar))
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Skip Window List"));
|
||||||
|
e_menu_item_check_set(mi, 1);
|
||||||
|
e_menu_item_toggle_set(mi, bd->user_skip_winlist);
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_skip_winlist, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/skip_winlist"),
|
||||||
|
"widgets/border/default/skip_winlist");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ecore_file_app_installed("e_util_eapp_edit"))
|
||||||
|
{
|
||||||
|
char *title = "";
|
||||||
|
|
||||||
|
if (bd->client.netwm.name) title = bd->client.netwm.name;
|
||||||
|
else title = bd->client.icccm.title;
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
if (bd->app)
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Edit Icon"));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd->app->path);
|
||||||
|
e_menu_item_icon_edje_set(mi, bd->app->path, "icon");
|
||||||
|
}
|
||||||
|
else if (bd->client.icccm.class) /* icons with no class useless to borders */
|
||||||
|
{
|
||||||
|
static char buf[PATH_MAX + 50];
|
||||||
|
char *name, *homedir;
|
||||||
|
int i, l;
|
||||||
|
|
||||||
|
buf[0] = '\0';
|
||||||
|
/* generate a reasonable file name from the window class */
|
||||||
|
/* FIXME - I think there could be duplicates - how better to do this? */
|
||||||
|
name = strdup(bd->client.icccm.class);
|
||||||
|
l = strlen(name);
|
||||||
|
for (i = 0; i < l; i++)
|
||||||
|
{
|
||||||
|
if (name[i] == ' ') name[i] = '_';
|
||||||
|
}
|
||||||
|
/* previously this could be null, but it will exist now */
|
||||||
|
homedir = e_user_homedir_get();
|
||||||
|
|
||||||
|
snprintf(buf, sizeof(buf),
|
||||||
|
"--win-class \"%s\" %s/.e/e/applications/all/%s.eap",
|
||||||
|
bd->client.icccm.class, homedir, name);
|
||||||
|
free(homedir);
|
||||||
|
free(name);
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Create Icon"));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
|
if ((!bd->lock_close) && (!bd->internal))
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Kill"));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_kill, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/kill"),
|
||||||
|
"widgets/border/default/kill");
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bd->lock_user_iconify)
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Iconify"));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_iconify, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/minimize"),
|
||||||
|
"widgets/border/default/minimize");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bd->lock_close)
|
||||||
|
{
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Close"));
|
||||||
|
e_menu_item_callback_set(mi, _e_border_menu_cb_close, bd);
|
||||||
|
e_menu_item_icon_edje_set(mi,
|
||||||
|
(char *)e_theme_edje_file_get("base/theme/borders",
|
||||||
|
"widgets/border/default/close"),
|
||||||
|
"widgets/border/default/close");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key)
|
||||||
|
e_menu_activate_key(m, bd->zone, x, y, 1, 1,
|
||||||
|
E_MENU_POP_DIRECTION_DOWN);
|
||||||
|
else
|
||||||
|
e_menu_activate_mouse(m, bd->zone, x, y, 1, 1,
|
||||||
|
E_MENU_POP_DIRECTION_DOWN, timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
e_int_border_menu_del(E_Border *bd)
|
||||||
|
{
|
||||||
|
int was_menu = 0;
|
||||||
|
|
||||||
|
if (bd->border_stacking_menu)
|
||||||
|
{
|
||||||
|
e_object_del(E_OBJECT(bd->border_stacking_menu));
|
||||||
|
bd->border_stacking_menu = NULL;
|
||||||
|
was_menu = 1;
|
||||||
|
}
|
||||||
|
if (bd->border_menu)
|
||||||
|
{
|
||||||
|
e_object_del(E_OBJECT(bd->border_menu));
|
||||||
|
bd->border_menu = NULL;
|
||||||
|
was_menu = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_cb_border_menu_end(void *data, E_Menu *m)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = e_object_data_get(E_OBJECT(m));
|
||||||
|
if (bd)
|
||||||
|
{
|
||||||
|
/* If the border exists, delete all associated menus */
|
||||||
|
e_int_border_menu_del(bd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Just delete this menu */
|
||||||
|
e_object_del(E_OBJECT(m));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_locks(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (bd->border_locks_dialog) return;
|
||||||
|
e_int_border_locks(bd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_remember(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
bd = data;
|
||||||
|
if (bd->border_remember_dialog) return;
|
||||||
|
e_int_border_remember(bd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_close(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd->lock_close)
|
||||||
|
e_border_act_close_begin(bd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_iconify(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd->lock_user_iconify)
|
||||||
|
{
|
||||||
|
if (bd->iconic) e_border_uniconify(bd);
|
||||||
|
else e_border_iconify(bd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_kill(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if ((!bd->lock_close) && (!bd->internal))
|
||||||
|
e_border_act_kill_begin(bd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_maximize(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd->lock_user_maximize)
|
||||||
|
{
|
||||||
|
if (bd->maximized) e_border_unmaximize(bd);
|
||||||
|
else e_border_maximize(bd, e_config->maximize_policy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd->lock_user_shade)
|
||||||
|
{
|
||||||
|
if (bd->shaded) e_border_unshade(bd, E_DIRECTION_UP);
|
||||||
|
else e_border_shade(bd, E_DIRECTION_UP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
char *file;
|
||||||
|
char *command;
|
||||||
|
char *full;
|
||||||
|
Ecore_Exe *process;
|
||||||
|
|
||||||
|
file = data;
|
||||||
|
command = "e_util_eapp_edit ";
|
||||||
|
full = malloc(strlen(file) + strlen(command) + 1);
|
||||||
|
strcpy(full, command);
|
||||||
|
strcat(full, file);
|
||||||
|
process = ecore_exe_run(full, NULL);
|
||||||
|
if (!process || !ecore_exe_pid_get(process))
|
||||||
|
e_error_dialog_show(_("Icon Edit Error"),
|
||||||
|
_("Error starting icon editor\n\n"
|
||||||
|
"please install e_util_eapp_edit\n"
|
||||||
|
"or make sure it is in your PATH\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_stick(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd->lock_user_sticky)
|
||||||
|
{
|
||||||
|
if (bd->sticky) e_border_unstick(bd);
|
||||||
|
else e_border_stick(bd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_on_top(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (bd->layer != 150)
|
||||||
|
{
|
||||||
|
e_border_layer_set(bd, 150);
|
||||||
|
e_hints_window_stacking_set(bd, E_STACKING_ABOVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_below(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (bd->layer != 50)
|
||||||
|
{
|
||||||
|
e_border_layer_set(bd, 50);
|
||||||
|
e_hints_window_stacking_set(bd, E_STACKING_BELOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_normal(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (bd->layer != 100)
|
||||||
|
{
|
||||||
|
e_border_layer_set(bd, 100);
|
||||||
|
e_hints_window_stacking_set(bd, E_STACKING_NONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_borderless(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
int toggle;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd) return;
|
||||||
|
|
||||||
|
if ((!bd->lock_border) && (!bd->shaded))
|
||||||
|
{
|
||||||
|
if (bd->client.border.name) free(bd->client.border.name);
|
||||||
|
toggle = e_menu_item_toggle_get(mi);
|
||||||
|
if (toggle)
|
||||||
|
bd->client.border.name = strdup("borderless");
|
||||||
|
else
|
||||||
|
bd->client.border.name = strdup("default");
|
||||||
|
bd->client.border.changed = 1;
|
||||||
|
bd->changed = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_fullscreen(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
int toggle;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd) return;
|
||||||
|
|
||||||
|
if (!bd->lock_user_fullscreen)
|
||||||
|
{
|
||||||
|
toggle = e_menu_item_toggle_get(mi);
|
||||||
|
if (toggle)
|
||||||
|
e_border_fullscreen(bd);
|
||||||
|
else
|
||||||
|
e_border_unfullscreen(bd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_skip_winlist(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
if (!bd) return;
|
||||||
|
|
||||||
|
if ((bd->client.icccm.accepts_focus || bd->client.icccm.take_focus) &&
|
||||||
|
(!bd->client.netwm.state.skip_taskbar))
|
||||||
|
bd->user_skip_winlist = e_menu_item_toggle_get(mi);
|
||||||
|
else
|
||||||
|
bd->user_skip_winlist = 0;
|
||||||
|
if (bd->remember) e_remember_update(bd->remember, bd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_sendto_pre(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Menu *subm;
|
||||||
|
E_Menu_Item *submi;
|
||||||
|
E_Border *bd;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
bd = data;
|
||||||
|
|
||||||
|
subm = e_menu_new();
|
||||||
|
e_object_data_set(E_OBJECT(subm), bd);
|
||||||
|
e_menu_item_submenu_set(mi, subm);
|
||||||
|
|
||||||
|
for (i = 0; i < bd->zone->desk_x_count * bd->zone->desk_y_count; i++)
|
||||||
|
{
|
||||||
|
E_Desk *desk;
|
||||||
|
|
||||||
|
desk = bd->zone->desks[i];
|
||||||
|
submi = e_menu_item_new(subm);
|
||||||
|
e_menu_item_label_set(submi, desk->name);
|
||||||
|
e_menu_item_callback_set(submi, _e_border_menu_cb_sendto, desk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_border_menu_cb_sendto(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
E_Desk *desk;
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
desk = data;
|
||||||
|
bd = e_object_data_get(E_OBJECT(m));
|
||||||
|
if ((bd) && (desk))
|
||||||
|
{
|
||||||
|
e_border_desk_set(bd, desk);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
#ifdef E_TYPEDEFS
|
||||||
|
|
||||||
|
#else
|
||||||
|
#ifndef E_INT_BORDER_MENU_H
|
||||||
|
#define E_INT_BORDER_MENU_H
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in New Issue