forked from enlightenment/enlightenment
desklock lets you auto-lock if the screensaver kicks in and set the timeout
for the screensaver (optionally). SVN revision: 20937
This commit is contained in:
parent
272782b980
commit
9ab2777707
|
@ -462,6 +462,10 @@ e_config_init(void)
|
||||||
E_CONFIG_VAL(D, T, desklock_personal_passwd, STR);
|
E_CONFIG_VAL(D, T, desklock_personal_passwd, STR);
|
||||||
E_CONFIG_VAL(D, T, desklock_background, STR);
|
E_CONFIG_VAL(D, T, desklock_background, STR);
|
||||||
E_CONFIG_VAL(D, T, desklock_login_box_zone, INT);
|
E_CONFIG_VAL(D, T, desklock_login_box_zone, INT);
|
||||||
|
E_CONFIG_VAL(D, T, desklock_autolock, INT);
|
||||||
|
E_CONFIG_VAL(D, T, desklock_use_timeout, INT);
|
||||||
|
E_CONFIG_VAL(D, T, desklock_timeout, DOUBLE);
|
||||||
|
E_CONFIG_VAL(D, T, desklock_disable_screensaver, INT);
|
||||||
|
|
||||||
e_config = e_config_domain_load("e", _e_config_edd);
|
e_config = e_config_domain_load("e", _e_config_edd);
|
||||||
if (e_config)
|
if (e_config)
|
||||||
|
@ -618,6 +622,10 @@ e_config_init(void)
|
||||||
e_config->desklock_personal_passwd = NULL;
|
e_config->desklock_personal_passwd = NULL;
|
||||||
e_config->desklock_background = NULL;
|
e_config->desklock_background = NULL;
|
||||||
e_config->desklock_login_box_zone = -1;
|
e_config->desklock_login_box_zone = -1;
|
||||||
|
e_config->desklock_autolock = 0;
|
||||||
|
e_config->desklock_use_timeout = 0;
|
||||||
|
e_config->desklock_timeout = 300.0;
|
||||||
|
e_config->desklock_disable_screensaver = 0;
|
||||||
|
|
||||||
/* FIXME: fill up default gadcons! */
|
/* FIXME: fill up default gadcons! */
|
||||||
{
|
{
|
||||||
|
@ -1680,6 +1688,10 @@ e_config_init(void)
|
||||||
E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1);
|
E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1);
|
||||||
E_CONFIG_LIMIT(e_config->font_hinting, 0, 2);
|
E_CONFIG_LIMIT(e_config->font_hinting, 0, 2);
|
||||||
E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000);
|
E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000);
|
||||||
|
E_CONFIG_LIMIT(e_config->desklock_autolock, 0, 1);
|
||||||
|
E_CONFIG_LIMIT(e_config->desklock_use_timeout, 0, 1);
|
||||||
|
E_CONFIG_LIMIT(e_config->desklock_timeout, 1.0, 600.0);
|
||||||
|
E_CONFIG_LIMIT(e_config->desklock_disable_screensaver, 0, 1);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,11 @@ struct _E_Config
|
||||||
|
|
||||||
char *desklock_personal_passwd; // GUI
|
char *desklock_personal_passwd; // GUI
|
||||||
char *desklock_background; // GUI
|
char *desklock_background; // GUI
|
||||||
int desklock_login_box_zone; //GUI
|
int desklock_login_box_zone; // GUI
|
||||||
|
int desklock_autolock; // GUI
|
||||||
|
int desklock_use_timeout; // GUI
|
||||||
|
double desklock_timeout; // GUI
|
||||||
|
int desklock_disable_screensaver;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _E_Config_Module
|
struct _E_Config_Module
|
||||||
|
|
|
@ -49,6 +49,8 @@ e_desklock_show(void)
|
||||||
int zone_counter;
|
int zone_counter;
|
||||||
int total_zone_num;
|
int total_zone_num;
|
||||||
|
|
||||||
|
if (edd) return 0;
|
||||||
|
|
||||||
if (!e_config->desklock_personal_passwd)
|
if (!e_config->desklock_personal_passwd)
|
||||||
{
|
{
|
||||||
E_Zone *zone;
|
E_Zone *zone;
|
||||||
|
@ -114,8 +116,8 @@ e_desklock_show(void)
|
||||||
evas_event_freeze(edp->popup_wnd->evas);
|
evas_event_freeze(edp->popup_wnd->evas);
|
||||||
edp->bg_object = edje_object_add(edp->popup_wnd->evas);
|
edp->bg_object = edje_object_add(edp->popup_wnd->evas);
|
||||||
|
|
||||||
if (!e_config->desklock_background ||
|
if ((!e_config->desklock_background) ||
|
||||||
!strcmp(e_config->desklock_background, "theme_desklock_background"))
|
(!strcmp(e_config->desklock_background, "theme_desklock_background")))
|
||||||
{
|
{
|
||||||
e_theme_edje_object_set(edp->bg_object,
|
e_theme_edje_object_set(edp->bg_object,
|
||||||
"base/theme/desklock",
|
"base/theme/desklock",
|
||||||
|
@ -123,9 +125,9 @@ e_desklock_show(void)
|
||||||
}
|
}
|
||||||
else if (!strcmp(e_config->desklock_background, "theme_background"))
|
else if (!strcmp(e_config->desklock_background, "theme_background"))
|
||||||
{
|
{
|
||||||
e_theme_edje_object_set(edp->bg_object,
|
e_theme_edje_object_set(edp->bg_object,
|
||||||
"base/theme/backgrounds",
|
"base/theme/backgrounds",
|
||||||
"desktop/background");
|
"desktop/background");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -152,13 +154,12 @@ e_desklock_show(void)
|
||||||
evas_object_move(edp->bg_object, 0, 0);
|
evas_object_move(edp->bg_object, 0, 0);
|
||||||
evas_object_resize(edp->bg_object, zone->w, zone->h);
|
evas_object_resize(edp->bg_object, zone->w, zone->h);
|
||||||
evas_object_show(edp->bg_object);
|
evas_object_show(edp->bg_object);
|
||||||
/*edje_object_part_text_set(edp->bg_object, "title",
|
|
||||||
_("Please enter your unlock password"));*/
|
|
||||||
|
|
||||||
/**/
|
|
||||||
edp->login_box = edje_object_add(edp->popup_wnd->evas);
|
edp->login_box = edje_object_add(edp->popup_wnd->evas);
|
||||||
e_theme_edje_object_set(edp->login_box,
|
e_theme_edje_object_set(edp->login_box,
|
||||||
"base/theme/desklock", "desklock/login_box");
|
"base/theme/desklock",
|
||||||
|
"desklock/login_box");
|
||||||
|
edje_object_part_text_set(edp->login_box, "title",
|
||||||
|
_("Please enter your unlock password"));
|
||||||
edje_object_part_swallow(edp->bg_object, "login_box", edp->login_box);
|
edje_object_part_swallow(edp->bg_object, "login_box", edp->login_box);
|
||||||
edje_object_size_min_calc(edp->login_box, &mw, &mh);
|
edje_object_size_min_calc(edp->login_box, &mw, &mh);
|
||||||
evas_object_move(edp->login_box, (int)((zone->w - mw)/2),
|
evas_object_move(edp->login_box, (int)((zone->w - mw)/2),
|
||||||
|
@ -362,16 +363,13 @@ _e_desklock_idler(void *data)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_desklock_init(void)
|
e_desklock_init(void)
|
||||||
{
|
{
|
||||||
// desklock_edd = E_CONFIG_DD_NEW("E_Desklock", E_Decklock);
|
if (e_config->desklock_disable_screensaver)
|
||||||
//#undef T
|
ecore_x_screensaver_timeout_set(0);
|
||||||
//#undef D
|
else
|
||||||
//#define T E_Desklock
|
{
|
||||||
//#define D desklock_edd
|
if (e_config->desklock_use_timeout)
|
||||||
//E_CONFIG_VAL(D, T, path, STR);
|
ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
|
||||||
|
}
|
||||||
//#undef T
|
|
||||||
//#undef D
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,35 +46,35 @@ static void _e_desklock_cb_lb_show_on_specific_screen(void *data, Evas_Object *o
|
||||||
|
|
||||||
struct _E_Config_Dialog_Data
|
struct _E_Config_Dialog_Data
|
||||||
{
|
{
|
||||||
char *desklock_passwd;
|
char *desklock_passwd;
|
||||||
char *desklock_passwd_cp;
|
char *desklock_passwd_cp;
|
||||||
int show_password; // local
|
int show_password; // local
|
||||||
|
|
||||||
int login_box_zone; // in e_config;
|
int autolock; // in e_config;
|
||||||
int specific_lb_zone; // local variable
|
int use_timeout; // in e_config;
|
||||||
int specific_lb_zone_backup; // used to have smart iface
|
double timeout; // in e_config;
|
||||||
|
|
||||||
int zone_count; // local variable;
|
int login_box_zone; // in e_config;
|
||||||
|
int specific_lb_zone; // local variable
|
||||||
char *cur_bg; // local variable;
|
int specific_lb_zone_backup; // used to have smart iface
|
||||||
Evas *evas; // local variable
|
|
||||||
Evas_Object *preview_image; // local variable
|
int zone_count; // local variable;
|
||||||
|
|
||||||
/*double vertical_lb_align;
|
char *cur_bg; // local variable;
|
||||||
double horizontal_lb_align;*/
|
Evas *evas; // local variable
|
||||||
|
Evas_Object *preview_image; // local variable
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
Evas_Object *passwd_field;
|
Evas_Object *passwd_field;
|
||||||
Evas_Object *bg_list;
|
Evas_Object *bg_list;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
Evas_Object *show_all_screens;
|
Evas_Object *show_all_screens;
|
||||||
Evas_Object *show_current_screen;
|
Evas_Object *show_current_screen;
|
||||||
Evas_Object *show_specific_screen;
|
Evas_Object *show_specific_screen;
|
||||||
Evas_Object *screen_slider;
|
Evas_Object *screen_slider;
|
||||||
} loginbox_obj;
|
} loginbox_obj;
|
||||||
} gui;
|
} gui;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _E_Widget_Entry_Data E_Widget_Entry_Data;
|
typedef struct _E_Widget_Entry_Data E_Widget_Entry_Data;
|
||||||
|
@ -135,43 +135,47 @@ e_int_config_desklock(E_Container *con)
|
||||||
static void
|
static void
|
||||||
_fill_desklock_data(E_Config_Dialog_Data *cfdata)
|
_fill_desklock_data(E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
// we have to read it from e_config->...
|
// we have to read it from e_config->...
|
||||||
if (e_config->desklock_personal_passwd)
|
if (e_config->desklock_personal_passwd)
|
||||||
{
|
{
|
||||||
cfdata->desklock_passwd = strdup(e_config->desklock_personal_passwd);
|
cfdata->desklock_passwd = strdup(e_config->desklock_personal_passwd);
|
||||||
cfdata->desklock_passwd_cp = strdup(e_config->desklock_personal_passwd);
|
cfdata->desklock_passwd_cp = strdup(e_config->desklock_personal_passwd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cfdata->desklock_passwd = strdup("");
|
cfdata->desklock_passwd = strdup("");
|
||||||
cfdata->desklock_passwd_cp = strdup("");
|
cfdata->desklock_passwd_cp = strdup("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* should be taken from e_config */
|
cfdata->autolock = e_config->desklock_autolock;
|
||||||
//cfdata->login_box_on_zone = -1;
|
cfdata->use_timeout = e_config->desklock_use_timeout;
|
||||||
|
cfdata->timeout = e_config->desklock_timeout;
|
||||||
if (e_config->desklock_login_box_zone >= 0)
|
|
||||||
{
|
/* should be taken from e_config */
|
||||||
cfdata->login_box_zone = LOGINBOX_SHOW_SPECIFIC_SCREEN;
|
//cfdata->login_box_on_zone = -1;
|
||||||
cfdata->specific_lb_zone_backup = cfdata->specific_lb_zone =
|
|
||||||
e_config->desklock_login_box_zone;
|
if (e_config->desklock_login_box_zone >= 0)
|
||||||
}
|
{
|
||||||
else
|
cfdata->login_box_zone = LOGINBOX_SHOW_SPECIFIC_SCREEN;
|
||||||
{
|
cfdata->specific_lb_zone_backup = cfdata->specific_lb_zone =
|
||||||
cfdata->login_box_zone = e_config->desklock_login_box_zone;
|
e_config->desklock_login_box_zone;
|
||||||
cfdata->specific_lb_zone_backup = cfdata->specific_lb_zone = 0;
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
cfdata->zone_count = _e_desklock_zone_num_get();
|
cfdata->login_box_zone = e_config->desklock_login_box_zone;
|
||||||
|
cfdata->specific_lb_zone_backup = cfdata->specific_lb_zone = 0;
|
||||||
cfdata->show_password = 0;
|
}
|
||||||
|
|
||||||
if (!e_config->desklock_background)
|
cfdata->zone_count = _e_desklock_zone_num_get();
|
||||||
cfdata->cur_bg = strdup(DEF_DESKLOCK_BACKGROUND);
|
|
||||||
else
|
cfdata->show_password = 0;
|
||||||
cfdata->cur_bg = strdup(e_config->desklock_background);
|
|
||||||
|
if (!e_config->desklock_background)
|
||||||
//vertical_lb_align = e_config->desklock_login
|
cfdata->cur_bg = strdup(DEF_DESKLOCK_BACKGROUND);
|
||||||
|
else
|
||||||
|
cfdata->cur_bg = strdup(e_config->desklock_background);
|
||||||
|
|
||||||
|
//vertical_lb_align = e_config->desklock_login
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -202,50 +206,71 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
static int
|
static int
|
||||||
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
if (cfdata->desklock_passwd_cp)
|
if (cfdata->desklock_passwd_cp)
|
||||||
{
|
{
|
||||||
if (e_config->desklock_personal_passwd)
|
if (e_config->desklock_personal_passwd)
|
||||||
{
|
|
||||||
if (strcmp(e_config->desklock_personal_passwd, cfdata->desklock_passwd_cp) == 0)
|
|
||||||
return 1;
|
|
||||||
evas_stringshare_del(e_config->desklock_personal_passwd);
|
evas_stringshare_del(e_config->desklock_personal_passwd);
|
||||||
}
|
}
|
||||||
e_config->desklock_personal_passwd = (char *)evas_stringshare_add(cfdata->desklock_passwd_cp);
|
e_config->desklock_personal_passwd = (char *)evas_stringshare_add(cfdata->desklock_passwd_cp);
|
||||||
e_config_save_queue();
|
e_config->desklock_autolock = cfdata->autolock;
|
||||||
}
|
e_config->desklock_use_timeout = cfdata->use_timeout;
|
||||||
|
e_config->desklock_timeout = cfdata->timeout;
|
||||||
|
if (e_config->desklock_use_timeout)
|
||||||
|
{
|
||||||
|
ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
|
||||||
|
printf("%3.3f\n", e_config->desklock_timeout);
|
||||||
|
}
|
||||||
|
e_config_save_queue();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
Evas_Object *o, *of, *ob;
|
Evas_Object *o, *of, *ob;
|
||||||
E_Widget_Check_Data *wd;
|
E_Widget_Check_Data *wd;
|
||||||
|
|
||||||
|
//_fill_desklock_data(cfdata);
|
||||||
|
|
||||||
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Personalized Password:"), 0);
|
||||||
|
|
||||||
|
cfdata->gui.passwd_field = ob = e_widget_entry_add(evas, &(cfdata->desklock_passwd));
|
||||||
|
_e_desklock_passwd_cb_change(cfdata, ob);
|
||||||
|
e_widget_entry_on_change_callback_set(ob, _e_desklock_passwd_cb_change, cfdata);
|
||||||
|
e_widget_min_size_set(ob, 200, 25);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
|
||||||
|
ob = e_widget_check_add(evas, _("Show Password"), &(cfdata->show_password));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
|
||||||
|
wd = (E_Widget_Check_Data*)e_widget_data_get(ob);
|
||||||
|
edje_object_signal_callback_add(wd->o_check,"toggle_on", "", _e_desklock_cb_show_passwd, cfdata);
|
||||||
|
edje_object_signal_callback_add(wd->o_check,"toggle_off", "", _e_desklock_cb_show_passwd, cfdata);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Automatic Locking"), 0);
|
||||||
|
|
||||||
|
ob = e_widget_check_add(evas, _("Lock when the Screensaver starts"), &(cfdata->autolock));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
|
||||||
//_fill_desklock_data(cfdata);
|
ob = e_widget_check_add(evas, _("Set the screensaver timeout"), &(cfdata->use_timeout));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
o = e_widget_list_add(evas, 0, 0);
|
|
||||||
|
ob = e_widget_label_add(evas, _("Time until screensaver starts"));
|
||||||
of = e_widget_framelist_add(evas, _("Personalized Password:"), 0);
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
|
||||||
cfdata->gui.passwd_field = ob = e_widget_entry_add(evas, &(cfdata->desklock_passwd));
|
1.0, 600.0,
|
||||||
_e_desklock_passwd_cb_change(cfdata, ob);
|
1.0, 0, &(cfdata->timeout), NULL,
|
||||||
e_widget_entry_on_change_callback_set(ob, _e_desklock_passwd_cb_change, cfdata);
|
200);
|
||||||
e_widget_min_size_set(ob, 200, 25);
|
e_widget_framelist_object_append(of, ob);
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
ob = e_widget_check_add(evas, _("Show Password"), &(cfdata->show_password));
|
|
||||||
wd = (E_Widget_Check_Data*)e_widget_data_get(ob);
|
e_dialog_resizable_set(cfd->dia, 0);
|
||||||
|
|
||||||
edje_object_signal_callback_add(wd->o_check,"toggle_on", "", _e_desklock_cb_show_passwd, cfdata);
|
return o;
|
||||||
edje_object_signal_callback_add(wd->o_check,"toggle_off", "", _e_desklock_cb_show_passwd, cfdata);
|
|
||||||
|
|
||||||
e_widget_framelist_object_append(of, ob);
|
|
||||||
|
|
||||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
||||||
e_dialog_resizable_set(cfd->dia, 0);
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* advanced window */
|
/* advanced window */
|
||||||
|
@ -253,27 +278,31 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
static int
|
static int
|
||||||
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
if (!cfdata) return 0;
|
if (!cfdata) return 0;
|
||||||
|
|
||||||
|
if (cfdata->cur_bg)
|
||||||
|
{
|
||||||
|
if (e_config->desklock_background)
|
||||||
|
evas_stringshare_del(e_config->desklock_background);
|
||||||
|
e_config->desklock_background = (char *)evas_stringshare_add(cfdata->cur_bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_e_desklock_zone_num_get() > 1)
|
||||||
|
{
|
||||||
|
if (cfdata->login_box_zone >= 0)
|
||||||
|
e_config->desklock_login_box_zone = cfdata->specific_lb_zone;
|
||||||
|
else
|
||||||
|
e_config->desklock_login_box_zone = cfdata->login_box_zone;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
e_config->desklock_login_box_zone = LOGINBOX_SHOW_ALL_SCREENS;
|
||||||
|
|
||||||
if (cfdata->cur_bg)
|
e_config->desklock_autolock = cfdata->autolock;
|
||||||
{
|
e_config->desklock_use_timeout = cfdata->use_timeout;
|
||||||
if (e_config->desklock_background)
|
e_config->desklock_timeout = cfdata->timeout;
|
||||||
evas_stringshare_del(e_config->desklock_background);
|
|
||||||
e_config->desklock_background = (char *)evas_stringshare_add(cfdata->cur_bg);
|
e_config_save_queue();
|
||||||
}
|
return 1;
|
||||||
|
|
||||||
if (_e_desklock_zone_num_get() > 1)
|
|
||||||
{
|
|
||||||
if (cfdata->login_box_zone >= 0)
|
|
||||||
e_config->desklock_login_box_zone = cfdata->specific_lb_zone;
|
|
||||||
else
|
|
||||||
e_config->desklock_login_box_zone = cfdata->login_box_zone;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
e_config->desklock_login_box_zone = LOGINBOX_SHOW_ALL_SCREENS;
|
|
||||||
|
|
||||||
e_config_save_queue();
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
|
@ -282,6 +311,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
||||||
Evas_Object *o, *of, *of1, *ob;
|
Evas_Object *o, *of, *of1, *ob;
|
||||||
E_Widget_Radio_Data *wd;
|
E_Widget_Radio_Data *wd;
|
||||||
|
|
||||||
|
/* FIXME: this dialog is broken. advanced options should ALSO INCLUDE basic options */
|
||||||
E_Radio_Group *rg, *rg_bkg;
|
E_Radio_Group *rg, *rg_bkg;
|
||||||
Evas_Object *ot;
|
Evas_Object *ot;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ static int _e_manager_cb_key_up(void *data, int ev_type, void *ev);
|
||||||
static int _e_manager_cb_key_down(void *data, int ev_type, void *ev);
|
static int _e_manager_cb_key_down(void *data, int ev_type, void *ev);
|
||||||
static int _e_manager_cb_frame_extents_request(void *data, int ev_type, void *ev);
|
static int _e_manager_cb_frame_extents_request(void *data, int ev_type, void *ev);
|
||||||
static int _e_manager_cb_ping(void *data, int ev_type, void *ev);
|
static int _e_manager_cb_ping(void *data, int ev_type, void *ev);
|
||||||
|
static int _e_manager_cb_screensaver_notify(void *data, int ev_type, void *ev);
|
||||||
|
|
||||||
static Evas_Bool _e_manager_frame_extents_free_cb(Evas_Hash *hash __UNUSED__,
|
static Evas_Bool _e_manager_frame_extents_free_cb(Evas_Hash *hash __UNUSED__,
|
||||||
const char *key __UNUSED__,
|
const char *key __UNUSED__,
|
||||||
|
@ -47,6 +48,7 @@ static Evas_Hash *frame_extents = NULL;
|
||||||
EAPI int
|
EAPI int
|
||||||
e_manager_init(void)
|
e_manager_init(void)
|
||||||
{
|
{
|
||||||
|
ecore_x_screensaver_event_listen_set(1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +112,7 @@ e_manager_new(Ecore_X_Window root, int num)
|
||||||
{
|
{
|
||||||
man->win = man->root;
|
man->win = man->root;
|
||||||
}
|
}
|
||||||
|
|
||||||
h = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, _e_manager_cb_window_show_request, man);
|
h = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, _e_manager_cb_window_show_request, man);
|
||||||
if (h) man->handlers = evas_list_append(man->handlers, h);
|
if (h) man->handlers = evas_list_append(man->handlers, h);
|
||||||
h = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, _e_manager_cb_window_configure, man);
|
h = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, _e_manager_cb_window_configure, man);
|
||||||
|
@ -119,8 +122,11 @@ e_manager_new(Ecore_X_Window root, int num)
|
||||||
h = ecore_event_handler_add(ECORE_X_EVENT_KEY_UP, _e_manager_cb_key_up, man);
|
h = ecore_event_handler_add(ECORE_X_EVENT_KEY_UP, _e_manager_cb_key_up, man);
|
||||||
if (h) man->handlers = evas_list_append(man->handlers, h);
|
if (h) man->handlers = evas_list_append(man->handlers, h);
|
||||||
h = ecore_event_handler_add(ECORE_X_EVENT_FRAME_EXTENTS_REQUEST, _e_manager_cb_frame_extents_request, man);
|
h = ecore_event_handler_add(ECORE_X_EVENT_FRAME_EXTENTS_REQUEST, _e_manager_cb_frame_extents_request, man);
|
||||||
|
if (h) man->handlers = evas_list_append(man->handlers, h);
|
||||||
h = ecore_event_handler_add(ECORE_X_EVENT_PING, _e_manager_cb_ping, man);
|
h = ecore_event_handler_add(ECORE_X_EVENT_PING, _e_manager_cb_ping, man);
|
||||||
if (h) man->handlers = evas_list_append(man->handlers, h);
|
if (h) man->handlers = evas_list_append(man->handlers, h);
|
||||||
|
h = ecore_event_handler_add(ECORE_X_EVENT_SCREENSAVER_NOTIFY, _e_manager_cb_screensaver_notify, man);
|
||||||
|
if (h) man->handlers = evas_list_append(man->handlers, h);
|
||||||
|
|
||||||
man->pointer = e_pointer_window_new(man->root);
|
man->pointer = e_pointer_window_new(man->root);
|
||||||
|
|
||||||
|
@ -716,6 +722,22 @@ _e_manager_cb_ping(void *data, int ev_type __UNUSED__, void *ev)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_e_manager_cb_screensaver_notify(void *data, int ev_type __UNUSED__, void *ev)
|
||||||
|
{
|
||||||
|
E_Manager *man;
|
||||||
|
Ecore_X_Event_Screensaver_Notify *e;
|
||||||
|
|
||||||
|
man = data;
|
||||||
|
e = ev;
|
||||||
|
|
||||||
|
if (e->on)
|
||||||
|
{
|
||||||
|
if (e_config->desklock_autolock) e_desklock_show();
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static Evas_Bool
|
static Evas_Bool
|
||||||
_e_manager_frame_extents_free_cb(Evas_Hash *hash __UNUSED__, const char *key __UNUSED__,
|
_e_manager_frame_extents_free_cb(Evas_Hash *hash __UNUSED__, const char *key __UNUSED__,
|
||||||
void *data, void *fdata __UNUSED__)
|
void *data, void *fdata __UNUSED__)
|
||||||
|
|
Loading…
Reference in New Issue