forked from enlightenment/enlightenment
parent
d4374e0888
commit
49a60c2645
|
@ -20,7 +20,9 @@ INCLUDES = -I. \
|
||||||
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
||||||
pkg_LTLIBRARIES = module.la
|
pkg_LTLIBRARIES = module.la
|
||||||
module_la_SOURCES = e_mod_main.c \
|
module_la_SOURCES = e_mod_main.c \
|
||||||
e_mod_main.h
|
e_mod_main.h \
|
||||||
|
e_mod_config.c \
|
||||||
|
e_mod_config.h
|
||||||
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||||
module_la_LDFLAGS = -module -avoid-version
|
module_la_LDFLAGS = -module -avoid-version
|
||||||
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||||
|
|
|
@ -0,0 +1,188 @@
|
||||||
|
#include "e.h"
|
||||||
|
#include "e_mod_main.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
typedef struct _cfdata CFData;
|
||||||
|
typedef struct _Cfg_File_Data Cfg_File_Data;
|
||||||
|
|
||||||
|
struct _cfdata
|
||||||
|
{
|
||||||
|
int show_name;
|
||||||
|
int name_pos;
|
||||||
|
int show_popup;
|
||||||
|
double popup_speed;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Cfg_File_Data
|
||||||
|
{
|
||||||
|
E_Config_Dialog *cfd;
|
||||||
|
char *file;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Protos */
|
||||||
|
static Evas_Object *_create_widgets(E_Config_Dialog *cfd, Evas *evas, Config *cfdata);
|
||||||
|
static void *_create_data(E_Config_Dialog *cfd);
|
||||||
|
static void _free_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata);
|
||||||
|
static int _basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata);
|
||||||
|
static int _advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
|
||||||
|
Pager *p = NULL;
|
||||||
|
|
||||||
|
void
|
||||||
|
e_int_config_pager(E_Container *con, Pager *pager)
|
||||||
|
{
|
||||||
|
E_Config_Dialog *cfd;
|
||||||
|
E_Config_Dialog_View v;
|
||||||
|
|
||||||
|
p = pager;
|
||||||
|
|
||||||
|
v.create_cfdata = _create_data;
|
||||||
|
v.free_cfdata = _free_data;
|
||||||
|
v.basic.apply_cfdata = _basic_apply_data;
|
||||||
|
v.basic.create_widgets = _basic_create_widgets;
|
||||||
|
v.advanced.apply_cfdata = _advanced_apply_data;
|
||||||
|
v.advanced.create_widgets = _advanced_create_widgets;
|
||||||
|
|
||||||
|
cfd = e_config_dialog_new(con, _("Pager Module"), NULL, 0, &v, pager);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_fill_data(CFData *cfdata)
|
||||||
|
{
|
||||||
|
/* Name Pos, Show Popup, popup_speed */
|
||||||
|
cfdata->name_pos = p->conf->deskname_pos;
|
||||||
|
if (cfdata->name_pos == PAGER_DESKNAME_NONE)
|
||||||
|
{
|
||||||
|
cfdata->show_name = 0;
|
||||||
|
cfdata->name_pos = PAGER_DESKNAME_TOP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cfdata->show_name = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
cfdata->show_popup = p->conf->popup;
|
||||||
|
cfdata->popup_speed = p->conf->popup_speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
*_create_data(E_Config_Dialog *cfd)
|
||||||
|
{
|
||||||
|
CFData *cfdata;
|
||||||
|
|
||||||
|
cfdata = E_NEW(CFData, 1);
|
||||||
|
return cfdata;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_free_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
free(cfdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object
|
||||||
|
*_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
||||||
|
{
|
||||||
|
Evas_Object *o, *of, *ob;
|
||||||
|
E_Radio_Group *rg;
|
||||||
|
|
||||||
|
_fill_data(cfdata);
|
||||||
|
|
||||||
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
of = e_widget_framelist_add(evas, _("General Settings"), 0);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Popup"), &(cfdata->show_popup));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Desktop Name"), &(cfdata->show_name));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Desktop Name Position"), 0);
|
||||||
|
rg = e_widget_radio_group_new(&(cfdata->name_pos));
|
||||||
|
ob = e_widget_radio_add(evas, _("Top"), PAGER_DESKNAME_TOP, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, _("Bottom"), PAGER_DESKNAME_BOTTOM, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
/* Not Supported Yet ??
|
||||||
|
ob = e_widget_radio_add(evas, _("Left"), PAGER_DESKNAME_LEFT, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, _("Right"), PAGER_DESKNAME_RIGHT, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
*/
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
e_border_button_bindings_ungrab_all();
|
||||||
|
p->conf->popup = cfdata->show_popup;
|
||||||
|
|
||||||
|
p->conf->deskname_pos = cfdata->name_pos;
|
||||||
|
if (!cfdata->show_name) p->conf->deskname_pos = PAGER_DESKNAME_NONE;
|
||||||
|
|
||||||
|
e_border_button_bindings_grab_all();
|
||||||
|
e_config_save_queue();
|
||||||
|
|
||||||
|
_pager_cb_config_updated(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object
|
||||||
|
*_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
||||||
|
{
|
||||||
|
Evas_Object *o, *of, *ob;
|
||||||
|
E_Radio_Group *rg;
|
||||||
|
|
||||||
|
_fill_data(cfdata);
|
||||||
|
|
||||||
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
of = e_widget_framelist_add(evas, _("General Settings"), 0);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Popup"), &(cfdata->show_popup));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Desktop Name"), &(cfdata->show_name));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Desktop Name Position"), 0);
|
||||||
|
rg = e_widget_radio_group_new(&(cfdata->name_pos));
|
||||||
|
ob = e_widget_radio_add(evas, _("Top"), PAGER_DESKNAME_TOP, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, _("Bottom"), PAGER_DESKNAME_BOTTOM, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
/* Not Supported Yet ??
|
||||||
|
ob = e_widget_radio_add(evas, _("Left"), PAGER_DESKNAME_LEFT, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_radio_add(evas, _("Right"), PAGER_DESKNAME_RIGHT, rg);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
*/
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Popup Settings"), 0);
|
||||||
|
ob = e_widget_label_add(evas, _("Popup Speed"));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0.1, 10.0, 0.1, 0, &(cfdata->popup_speed), NULL, 200);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
e_border_button_bindings_ungrab_all();
|
||||||
|
p->conf->popup = cfdata->show_popup;
|
||||||
|
|
||||||
|
p->conf->deskname_pos = cfdata->name_pos;
|
||||||
|
if (!cfdata->show_name) p->conf->deskname_pos = PAGER_DESKNAME_NONE;
|
||||||
|
p->conf->popup_speed = cfdata->popup_speed;
|
||||||
|
|
||||||
|
e_border_button_bindings_grab_all();
|
||||||
|
e_config_save_queue();
|
||||||
|
|
||||||
|
_pager_cb_config_updated(p);
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
#ifdef E_TYPEDEFS
|
||||||
|
#else
|
||||||
|
#ifndef E_MOD_CONFIG_H
|
||||||
|
#define E_MOD_CONFIG_H
|
||||||
|
#include "e_mod_main.h"
|
||||||
|
EAPI void e_int_config_pager(E_Container *con, Pager *pager);
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -3,6 +3,7 @@
|
||||||
*/
|
*/
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
#include "e_mod_main.h"
|
#include "e_mod_main.h"
|
||||||
|
#include "e_mod_config.h"
|
||||||
|
|
||||||
/* TODO
|
/* TODO
|
||||||
* which options should be in main menu, and which in face menu?
|
* which options should be in main menu, and which in face menu?
|
||||||
|
@ -79,25 +80,17 @@ static void _pager_face_cb_move(void *data, const char *type, void *drop)
|
||||||
static void _pager_face_cb_leave(void *data, const char *type, void *drop);
|
static void _pager_face_cb_leave(void *data, const char *type, void *drop);
|
||||||
static void _pager_face_cb_drop(void *data, const char *type, void *drop);
|
static void _pager_face_cb_drop(void *data, const char *type, void *drop);
|
||||||
|
|
||||||
static void _pager_face_cb_deskname_none(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_face_cb_deskname_top(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_face_cb_deskname_bottom(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_face_cb_deskname_left(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_face_cb_deskname_right(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_face_deskname_position_change(Pager_Face *face);
|
static void _pager_face_deskname_position_change(Pager_Face *face);
|
||||||
static int _pager_popup_cb_timeout(void *data);
|
static int _pager_popup_cb_timeout(void *data);
|
||||||
|
|
||||||
static void _pager_menu_cb_speed_very_slow(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_menu_cb_speed_slow(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_menu_cb_speed_normal(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_menu_cb_speed_fast(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
static void _pager_menu_cb_speed_very_fast(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
||||||
|
|
||||||
static void _pager_menu_cb_popup_enable(void *data, E_Menu *m, E_Menu_Item *mi);
|
static void _pager_menu_cb_popup_enable(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
|
||||||
static void _pager_menu_cb_aspect_keep_height(void *data, E_Menu *m, E_Menu_Item *mi);
|
static void _pager_menu_cb_aspect_keep_height(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
static void _pager_menu_cb_aspect_keep_width(void *data, E_Menu *m, E_Menu_Item *mi);
|
static void _pager_menu_cb_aspect_keep_width(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
|
||||||
|
static void _pager_menu_cb_configure(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
|
||||||
|
|
||||||
static int _pager_count;
|
static int _pager_count;
|
||||||
|
|
||||||
static E_Config_DD *_conf_edd;
|
static E_Config_DD *_conf_edd;
|
||||||
|
@ -338,8 +331,6 @@ _pager_free(Pager *pager)
|
||||||
e_object_del(E_OBJECT(l->data));
|
e_object_del(E_OBJECT(l->data));
|
||||||
evas_list_free(pager->menus);
|
evas_list_free(pager->menus);
|
||||||
e_object_del(E_OBJECT(pager->config_menu));
|
e_object_del(E_OBJECT(pager->config_menu));
|
||||||
e_object_del(E_OBJECT(pager->config_menu_deskname));
|
|
||||||
e_object_del(E_OBJECT(pager->config_menu_speed));
|
|
||||||
|
|
||||||
if (pager->ev_handler_border_resize)
|
if (pager->ev_handler_border_resize)
|
||||||
ecore_event_handler_del(pager->ev_handler_border_resize);
|
ecore_event_handler_del(pager->ev_handler_border_resize);
|
||||||
|
@ -384,105 +375,9 @@ _pager_config_menu_new(Pager *pager)
|
||||||
mn = e_menu_new();
|
mn = e_menu_new();
|
||||||
pager->config_menu = mn;
|
pager->config_menu = mn;
|
||||||
|
|
||||||
mn = e_menu_new();
|
|
||||||
pager->config_menu_deskname = mn;
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
mi = e_menu_item_new(mn);
|
||||||
e_menu_item_label_set(mi, _("None"));
|
e_menu_item_label_set(mi, _("Configuration"));
|
||||||
e_menu_item_radio_set(mi, 1);
|
e_menu_item_callback_set(mi, _pager_menu_cb_configure, pager);
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
if (pager->conf->deskname_pos == PAGER_DESKNAME_NONE)
|
|
||||||
e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_face_cb_deskname_none, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Top"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
if (pager->conf->deskname_pos == PAGER_DESKNAME_TOP)
|
|
||||||
e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_face_cb_deskname_top, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Bottom"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
if (pager->conf->deskname_pos == PAGER_DESKNAME_BOTTOM)
|
|
||||||
e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_face_cb_deskname_bottom, pager);
|
|
||||||
|
|
||||||
/* FIXME: implement this in the theme, then re-enable */
|
|
||||||
/*
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Left"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
if (pager->conf->deskname_pos == PAGER_DESKNAME_LEFT)
|
|
||||||
e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_face_cb_deskname_left, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Right"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
if (pager->conf->deskname_pos == PAGER_DESKNAME_RIGHT)
|
|
||||||
e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_face_cb_deskname_right, pager);
|
|
||||||
*/
|
|
||||||
|
|
||||||
mn = e_menu_new();
|
|
||||||
pager->config_menu_speed = mn;
|
|
||||||
|
|
||||||
/* Desktopname speed */
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Very Slow"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
if (pager->conf->popup_speed == 6.0) e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_speed_very_slow, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Slow"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
if (pager->conf->popup_speed == 4.0) e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_speed_slow, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Normal"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
if (pager->conf->popup_speed == 2.0) e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_speed_normal, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Fast"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
if (pager->conf->popup_speed == 1.0) e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_speed_fast, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Very Fast"));
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
if (pager->conf->popup_speed == 0.5) e_menu_item_toggle_set(mi, 1);
|
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_speed_very_fast, pager);
|
|
||||||
|
|
||||||
/* Submenus */
|
|
||||||
mi = e_menu_item_new(pager->config_menu);
|
|
||||||
e_menu_item_label_set(mi, _("Desktop Name"));
|
|
||||||
e_menu_item_submenu_set(mi, pager->config_menu_deskname);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(pager->config_menu);
|
|
||||||
e_menu_item_label_set(mi, _("Enable Popup"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, pager->conf->popup);
|
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_popup_enable, pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(pager->config_menu);
|
|
||||||
e_menu_item_label_set(mi, _("Popup Speed"));
|
|
||||||
e_menu_item_submenu_set(mi, pager->config_menu_speed);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(pager->config_menu);
|
mi = e_menu_item_new(pager->config_menu);
|
||||||
e_menu_item_label_set(mi, _("Fix Aspect (Keep Height)"));
|
e_menu_item_label_set(mi, _("Fix Aspect (Keep Height)"));
|
||||||
|
@ -611,25 +506,16 @@ _pager_face_menu_new(Pager_Face *face)
|
||||||
if (face->conf->enabled) e_menu_item_toggle_set(mi, 1);
|
if (face->conf->enabled) e_menu_item_toggle_set(mi, 1);
|
||||||
e_menu_item_callback_set(mi, _pager_face_cb_menu_enabled, face);
|
e_menu_item_callback_set(mi, _pager_face_cb_menu_enabled, face);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Config */
|
||||||
|
mi = e_menu_item_new(mn);
|
||||||
|
e_menu_item_label_set(mi, _("Configuration"));
|
||||||
|
e_menu_item_callback_set(mi, _pager_menu_cb_configure, face->pager);
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
mi = e_menu_item_new(mn);
|
||||||
e_menu_item_label_set(mi, _("Edit Mode"));
|
e_menu_item_label_set(mi, _("Edit Mode"));
|
||||||
e_menu_item_callback_set(mi, _pager_face_cb_menu_edit, face);
|
e_menu_item_callback_set(mi, _pager_face_cb_menu_edit, face);
|
||||||
|
|
||||||
/* Submenus */
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Desktop Name"));
|
|
||||||
e_menu_item_submenu_set(mi, face->pager->config_menu_deskname);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Enable Popup"));
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_toggle_set(mi, face->pager->conf->popup);
|
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_popup_enable, face->pager);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
|
||||||
e_menu_item_label_set(mi, _("Popup Speed"));
|
|
||||||
e_menu_item_submenu_set(mi, face->pager->config_menu_speed);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(mn);
|
mi = e_menu_item_new(mn);
|
||||||
e_menu_item_label_set(mi, _("Fix Aspect (Keep Height)"));
|
e_menu_item_label_set(mi, _("Fix Aspect (Keep Height)"));
|
||||||
e_menu_item_callback_set(mi, _pager_menu_cb_aspect_keep_height, face->pager);
|
e_menu_item_callback_set(mi, _pager_menu_cb_aspect_keep_height, face->pager);
|
||||||
|
@ -2164,96 +2050,6 @@ _pager_face_cb_drop(void *data, const char *type, void *event_info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_face_cb_deskname_none(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
pager = data;
|
|
||||||
pager->conf->deskname_pos = PAGER_DESKNAME_NONE;
|
|
||||||
for (l = pager->faces; l; l = l->next)
|
|
||||||
{
|
|
||||||
Pager_Face *face;
|
|
||||||
|
|
||||||
face = l->data;
|
|
||||||
_pager_face_deskname_position_change(face);
|
|
||||||
}
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_face_cb_deskname_top(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
pager = data;
|
|
||||||
pager->conf->deskname_pos = PAGER_DESKNAME_TOP;
|
|
||||||
for (l = pager->faces; l; l = l->next)
|
|
||||||
{
|
|
||||||
Pager_Face *face;
|
|
||||||
|
|
||||||
face = l->data;
|
|
||||||
_pager_face_deskname_position_change(face);
|
|
||||||
}
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_face_cb_deskname_bottom(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
pager = data;
|
|
||||||
pager->conf->deskname_pos = PAGER_DESKNAME_BOTTOM;
|
|
||||||
for (l = pager->faces; l; l = l->next)
|
|
||||||
{
|
|
||||||
Pager_Face *face;
|
|
||||||
|
|
||||||
face = l->data;
|
|
||||||
_pager_face_deskname_position_change(face);
|
|
||||||
}
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_face_cb_deskname_left(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
pager = data;
|
|
||||||
pager->conf->deskname_pos = PAGER_DESKNAME_LEFT;
|
|
||||||
for (l = pager->faces; l; l = l->next)
|
|
||||||
{
|
|
||||||
Pager_Face *face;
|
|
||||||
|
|
||||||
face = l->data;
|
|
||||||
_pager_face_deskname_position_change(face);
|
|
||||||
}
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_face_cb_deskname_right(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
pager = data;
|
|
||||||
pager->conf->deskname_pos = PAGER_DESKNAME_RIGHT;
|
|
||||||
for (l = pager->faces; l; l = l->next)
|
|
||||||
{
|
|
||||||
Pager_Face *face;
|
|
||||||
|
|
||||||
face = l->data;
|
|
||||||
_pager_face_deskname_position_change(face);
|
|
||||||
}
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_pager_face_deskname_position_change(Pager_Face *face)
|
_pager_face_deskname_position_change(Pager_Face *face)
|
||||||
{
|
{
|
||||||
|
@ -2277,60 +2073,6 @@ _pager_face_deskname_position_change(Pager_Face *face)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_menu_cb_speed_very_slow(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
pager = data;
|
|
||||||
pager->conf->popup_speed = 6.0;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_menu_cb_speed_slow(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
pager = data;
|
|
||||||
pager->conf->popup_speed = 4.0;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_menu_cb_speed_normal(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
pager = data;
|
|
||||||
pager->conf->popup_speed = 2.0;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_menu_cb_speed_fast(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
pager = data;
|
|
||||||
pager->conf->popup_speed = 1.0;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_menu_cb_speed_very_fast(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
pager = data;
|
|
||||||
pager->conf->popup_speed = 0.5;
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_pager_menu_cb_popup_enable(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
Pager *pager;
|
|
||||||
pager = data;
|
|
||||||
pager->conf->popup = e_menu_item_toggle_get(mi);
|
|
||||||
e_config_save_queue();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_pager_menu_cb_aspect_keep_height(void *data, E_Menu *m, E_Menu_Item *mi)
|
_pager_menu_cb_aspect_keep_height(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
{
|
{
|
||||||
|
@ -2380,3 +2122,30 @@ _pager_menu_cb_aspect_keep_width(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
e_gadman_client_resize(face->gmc, face->fw, h);
|
e_gadman_client_resize(face->gmc, face->fw, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_pager_menu_cb_configure(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
Pager *p;
|
||||||
|
|
||||||
|
p = data;
|
||||||
|
if (!p) return;
|
||||||
|
e_int_config_pager(e_container_current_get(e_manager_current_get()), p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_pager_cb_config_updated(void *data)
|
||||||
|
{
|
||||||
|
Pager *pager;
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
/* Handle Desktop Name Position Change */
|
||||||
|
pager = data;
|
||||||
|
for (l = pager->faces; l; l = l->next)
|
||||||
|
{
|
||||||
|
Pager_Face *face;
|
||||||
|
|
||||||
|
face = l->data;
|
||||||
|
_pager_face_deskname_position_change(face);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -68,7 +68,6 @@ struct _Pager
|
||||||
Ecore_Event_Handler *ev_handler_zone_desk_count_set;
|
Ecore_Event_Handler *ev_handler_zone_desk_count_set;
|
||||||
Ecore_Event_Handler *ev_handler_desk_show;
|
Ecore_Event_Handler *ev_handler_desk_show;
|
||||||
Ecore_Event_Handler *ev_handler_desk_name_change;
|
Ecore_Event_Handler *ev_handler_desk_name_change;
|
||||||
Ecore_Event_Handler *ev_handler_container_resize;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Pager_Face
|
struct _Pager_Face
|
||||||
|
@ -148,4 +147,6 @@ EAPI int e_modapi_save (E_Module *module);
|
||||||
EAPI int e_modapi_info (E_Module *module);
|
EAPI int e_modapi_info (E_Module *module);
|
||||||
EAPI int e_modapi_about (E_Module *module);
|
EAPI int e_modapi_about (E_Module *module);
|
||||||
|
|
||||||
|
EAPI void _pager_cb_config_updated(void *data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue