entrance: merge of my work, I still need to push some code. But I think it's a first step to unbork entrance...
What's in this patch ? theme rewriting, only a really basic theme is available for time. you can now set up the wallpaper in the login screen or in the conf authentication is more secure. xephyr support Add some tux Many bug fixdevs/bu5hm4n/develop
@ -1,4 +1,4 @@ |
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
SUBDIRS = beaumonts old
|
||||
SUBDIRS = default
|
||||
|
||||
|
@ -0,0 +1,20 @@ |
||||
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
EDJE_CC = @edje_cc@
|
||||
EDJE_FLAGS = -v -id $(top_srcdir)/data/themes/default/images -fd $(top_srcdir)/data/themes/default/fonts
|
||||
|
||||
filesdir = $(datadir)/entrance/themes/
|
||||
files_DATA = default.edj
|
||||
|
||||
EXTRA_DIST = default.edc
|
||||
|
||||
|
||||
default.edj: Makefile $(EXTRA_DIST) |
||||
$(EDJE_CC) $(EDJE_FLAGS) \
|
||||
$(top_srcdir)/data/themes/default/default.edc \
|
||||
$(top_builddir)/data/themes/default/default.edj
|
||||
|
||||
clean-local: |
||||
rm -f *.edj
|
||||
|
@ -0,0 +1,499 @@ |
||||
/* |
||||
* Default theme for Entrance |
||||
* By Michael Bouchaud |
||||
* Licence CC-By-Sa |
||||
* Photo by Philippe Caseiro |
||||
* Licence CC-By-Sa |
||||
*/ |
||||
|
||||
externals { |
||||
external: "elm"; |
||||
} |
||||
|
||||
collections { |
||||
group { |
||||
name: "entrance/background/default"; |
||||
images { |
||||
image: "entrance_background.jpg" LOSSY 90; |
||||
} |
||||
parts { |
||||
part { name: "base"; |
||||
type: IMAGE; |
||||
description { state: "default" 0.0; |
||||
image { |
||||
normal: "entrance_background.jpg"; |
||||
scale_hint: STATIC; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
group { |
||||
name: "entrance/background"; |
||||
data.item: "items" "default"; |
||||
} |
||||
|
||||
group { |
||||
name: "entrance/wallpaper/default"; |
||||
parts { |
||||
part { name: "base"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
color: 255 255 255 0; |
||||
} |
||||
} |
||||
part { name: "clip1"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
rel2 { |
||||
to: "cur"; |
||||
relative: 0.0 1.0; |
||||
} |
||||
} |
||||
} |
||||
part { name: "clip2"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
rel1 { |
||||
to: "cur"; |
||||
relative: 1.0 0.0; |
||||
} |
||||
} |
||||
} |
||||
part { name: "cur"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
min: 1 0; |
||||
max: 1 99999; |
||||
visible: 0; |
||||
align: 1.0 0.5; |
||||
} |
||||
description { state: "user" 0.0; |
||||
inherit: "default" 0.0; |
||||
align: 0.0 0.5; |
||||
} |
||||
} |
||||
part { name: "entrance.wallpaper.default"; |
||||
clip_to: "clip1"; |
||||
type: SWALLOW; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
part { name: "entrance.wallpaper.user"; |
||||
clip_to: "clip2"; |
||||
type: SWALLOW; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
part { name: "entrance.login"; |
||||
type: SWALLOW; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
} |
||||
programs { |
||||
program { name: "wallpaper_user"; |
||||
signal: "entrance,wallpaper,user"; |
||||
source: ""; |
||||
action: STATE_SET "user" 0.0; |
||||
target: "cur"; |
||||
} |
||||
program { name: "wallpaper_default"; |
||||
signal: "entrance,wallpaper,default"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "cur"; |
||||
} |
||||
} |
||||
} |
||||
|
||||
group { |
||||
name : "entrance"; |
||||
|
||||
images { |
||||
} |
||||
|
||||
parts { |
||||
part { name: "clip"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
color: 255 255 255 255; |
||||
//color: 255 255 255 0; |
||||
} |
||||
description { state: "show" 0.0; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "entrance.login"; |
||||
clip_to: "clip"; |
||||
type: SWALLOW; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
max: 0 0; |
||||
} |
||||
} |
||||
part { name: "entrance.users"; |
||||
type: EXTERNAL; |
||||
// source: "elm/list"; |
||||
// source: "elm/genlist"; |
||||
source: "elm/gengrid"; |
||||
description { state: "default" 0.0; |
||||
rel1.relative: 0.0 0.2; |
||||
rel2.relative: 0.0 0.8; |
||||
rel2.to_x: "entrance.login"; |
||||
visible: 1; |
||||
params { |
||||
bool: "horizontal" 0; |
||||
double: "vertical page relative" 0.0; |
||||
int: "horizontal item size" 96; |
||||
int: "vertical item size" 120; |
||||
} |
||||
} |
||||
} |
||||
|
||||
part { name: "entrance.actions"; |
||||
type: EXTERNAL; |
||||
source: "elm/hoversel"; |
||||
description { state: "default" 0.0; |
||||
fixed: 1 1; |
||||
visible: 0; |
||||
max: 0 0; |
||||
align: 1.0 1.0; |
||||
params { |
||||
string: "label" "action"; |
||||
} |
||||
} |
||||
description { state: "enabled" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
part { name: "entrance.conf"; |
||||
type: EXTERNAL; |
||||
source: "elm/button"; |
||||
description { state: "default" 0.0; |
||||
fixed: 1 1; |
||||
visible: 1; |
||||
max: 0 0; |
||||
align: 1.0 1.0; |
||||
rel2.to_x: "entrance.actions"; |
||||
rel2.relative: 0.0 1.0; |
||||
params { |
||||
string: "label" "Settings"; |
||||
} |
||||
} |
||||
description { state: "enabled" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
/* |
||||
part { name: "entrance.error"; |
||||
type: TEXT; |
||||
mouse_events: 0; |
||||
effect: SOFT_SHADOW; |
||||
scale: 1; |
||||
description { state: "default" 0.0; |
||||
color: 255 255 255 0; |
||||
fixed: 1 1; |
||||
rel1.to_y: "entrance.xsessions"; |
||||
rel1.relative: 0.0 1.0; |
||||
align: 0.5 0.0; |
||||
text { |
||||
text: "Error on login ! Maybe wrong password ?"; |
||||
font: "Sans"; |
||||
size: 18; |
||||
min: 1 1; |
||||
align: 0.5 0.5; |
||||
} |
||||
} |
||||
description { state: "visible" 0.0; |
||||
inherit: "default" 0.0; |
||||
rel1.offset: 0 50; |
||||
rel2.offset: 0 50; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
*/ |
||||
} |
||||
programs { |
||||
program { |
||||
name: "action_enabled"; |
||||
signal: "entrance,action,enabled"; |
||||
source: ""; |
||||
action: STATE_SET "enabled" 0.0; |
||||
target: "entrance.actions"; |
||||
} |
||||
program { |
||||
name: "action_disabled"; |
||||
signal: "entrance,action,disabled"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "entrance.actions"; |
||||
} |
||||
program { |
||||
name: "user_enabled"; |
||||
signal: "entrance,users,enabled"; |
||||
source: ""; |
||||
action: STATE_SET "enabled" 0.0; |
||||
target: "entrance.users"; |
||||
} |
||||
program { |
||||
name: "user_disabled"; |
||||
signal: "entrance,users,disabled"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "entrance.users"; |
||||
} |
||||
program { |
||||
name: "conf_enabled"; |
||||
signal: "entrance,custom_conf,enabled"; |
||||
source: ""; |
||||
action: STATE_SET "enabled" 0.0; |
||||
target: "entrance.conf"; |
||||
} |
||||
program { |
||||
name: "conf_disabled"; |
||||
signal: "entrance,custom_conf,disabled"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "entrance.conf"; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
group { |
||||
name : "entrance/login"; |
||||
parts { |
||||
part { |
||||
name: "entrance.login"; |
||||
type: SWALLOW; |
||||
repeat_events: 0; |
||||
description { |
||||
state: "default" 0.0; |
||||
min: 140 0; |
||||
max: 0 0; |
||||
align: 0.5 1.0; |
||||
rel2.to_y: "entrance.password"; |
||||
rel2.relative: 1.0 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
|
||||
part { |
||||
name: "entrance.password"; |
||||
type: SWALLOW; |
||||
repeat_events: 0; |
||||
source: "entrance/entry/password"; |
||||
description { |
||||
state: "default" 0.0; |
||||
min: 140 0; |
||||
max: 0 0; |
||||
align: 0.5 0.5; |
||||
visible: 1; |
||||
} |
||||
} |
||||
part { name: "entrance.xsessions"; |
||||
type: SWALLOW; |
||||
description { state: "default" 0.0; |
||||
max: 0 0; |
||||
rel1.to_y: "entrance.password"; |
||||
rel1.relative: 0.0 1.0; |
||||
align: 0.5 0.0; |
||||
//visible: 0; |
||||
} |
||||
description { state: "enabled" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
|
||||
/* |
||||
* PROGRAMS |
||||
*/ |
||||
programs { |
||||
program { |
||||
name: "xsession_enabled"; |
||||
signal: "entrance,xsession,enabled"; |
||||
source: ""; |
||||
action: STATE_SET "enabled" 0.0; |
||||
target: "entrance.xsessions"; |
||||
} |
||||
program { |
||||
name: "xsession_disabled"; |
||||
signal: "entrance,xsession,disabled"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "entrance.xsessions"; |
||||
} |
||||
} |
||||
|
||||
/* |
||||
* |
||||
* PROGRAMS |
||||
* |
||||
|
||||
programs { |
||||
program { |
||||
name: "login_error"; |
||||
signal: "entrance,auth,error"; |
||||
source: ""; |
||||
action: STATE_SET "visible" 0.0; |
||||
transition: DECELERATE 0.2; |
||||
target: "entrance.error"; |
||||
} |
||||
program { |
||||
name: "login_change"; |
||||
signal: "entrance.auth.change"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
transition: ACCELERATE 0.4; |
||||
target: "entrance.error"; |
||||
} |
||||
|
||||
program { |
||||
name: "auth_enable"; |
||||
signal: "entrance.auth.enable"; |
||||
source: ""; |
||||
action: STATE_SET "auth" 0.0; |
||||
transition: ACCELERATE 0.8; |
||||
target: "entrance.users"; |
||||
target: "entrance.password"; |
||||
target: "entrance.xsessions"; |
||||
} |
||||
|
||||
program { |
||||
name: "auth_disable"; |
||||
signal: "entrance.auth.disable"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
transition: LINEAR 0.5; |
||||
target: "entrance.users"; |
||||
target: "entrance.password"; |
||||
target: "entrance.xsessions"; |
||||
} |
||||
program { |
||||
name: "login"; |
||||
signal: "entrance.auth.valid"; |
||||
source: ""; |
||||
action: STATE_SET "default" 0.0; |
||||
transition: LINEAR 0.7; |
||||
target: "clip"; |
||||
} |
||||
program { |
||||
name: "login_valid"; |
||||
signal: "mouse,down,*"; |
||||
source: "valid"; |
||||
action: SIGNAL_EMIT "entrance.auth.request" ""; |
||||
} |
||||
|
||||
*/ |
||||
} |
||||
} |
||||
|
||||
group { name: "entrance/conf/login"; |
||||
parts { |
||||
alias: "entrance.login" "login:entrance.login"; |
||||
alias: "entrance.password" "login:entrance.password"; |
||||
alias: "entrance.xsessions" "login:entrance.xsessions"; |
||||
part { name: "base"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
visible: 0; |
||||
} |
||||
} |
||||
part { name: "entrance.conf"; |
||||
type: SWALLOW; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
} |
||||
part { name: "hover"; |
||||
type: RECT; |
||||
mouse_events: 1; |
||||
repeat_events: 0; |
||||
description { state: "default" 0.0; |
||||
color: 0 0 0 196; |
||||
} |
||||
description { state: "hidden" 0.0; |
||||
visible: 0; |
||||
} |
||||
} |
||||
part { name: "login"; |
||||
type: GROUP; |
||||
description { state: "default" 0.0; |
||||
visible: 1; |
||||
} |
||||
description { state: "hidden" 0.0; |
||||
visible: 0; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
group { name: "entrance/user"; |
||||
data.item: "items" "adrielhernandez-cmyk-tux brunocb-tux-1-euro cisoun-tux-coup-de-soleil eliaden-tux-marin fcys14-tux-breton fcys14-tux-croco fcys14-tux-pompier fcys14-yoshi-tux m4r10-tux-crema mybob-calimetux overlord59-astro-tux overlord59-dj-tux-mix-platine overlord59-magic-tux overlord59-tux-pianiste touko-tux-pirate"; |
||||
parts { |
||||
part { |
||||
name: "entrance.icon"; |
||||
type: SWALLOW; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
min: 96 96; |
||||
visible: 1; |
||||
//aspect : 1.0 1.0; |
||||
//aspect_preference : BOTH; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
#define ADD_USER_ICON(NAME) \ |
||||
group { name: "entrance/user/"NAME; \ |
||||
images { \ |
||||
image: NAME".png" COMP; \ |
||||
} \ |
||||
parts { \ |
||||
part { name: "base"; \ |
||||
type: RECT; \ |
||||
description { state: "default" 0.0; \ |
||||
visible: 0; \ |
||||
} \ |
||||
} \ |
||||
part { name: "icon"; \ |
||||
type: IMAGE; \ |
||||
description { \ |
||||
image { \ |
||||
normal: NAME".png"; \ |
||||
scale_hint: STATIC; \ |
||||
} \ |
||||
} \ |
||||
} \ |
||||
} \ |
||||
} |
||||
ADD_USER_ICON("adrielhernandez-cmyk-tux") |
||||
ADD_USER_ICON("brunocb-tux-1-euro") |
||||
ADD_USER_ICON("cisoun-tux-coup-de-soleil") |
||||
ADD_USER_ICON("eliaden-tux-marin") |
||||
ADD_USER_ICON("fcys14-tux-breton") |
||||
ADD_USER_ICON("fcys14-tux-croco") |
||||
ADD_USER_ICON("fcys14-tux-pompier") |
||||
ADD_USER_ICON("fcys14-yoshi-tux") |
||||
ADD_USER_ICON("m4r10-tux-crema") |
||||
ADD_USER_ICON("mybob-calimetux") |
||||
ADD_USER_ICON("overlord59-astro-tux") |
||||
ADD_USER_ICON("overlord59-dj-tux-mix-platine") |
||||
ADD_USER_ICON("overlord59-magic-tux") |
||||
ADD_USER_ICON("overlord59-tux-pianiste") |
||||
ADD_USER_ICON("touko-tux-pirate") |
||||
} |
||||
|
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 963 B |
After Width: | Height: | Size: 307 B |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 482 B |
After Width: | Height: | Size: 285 B |
After Width: | Height: | Size: 275 B |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 187 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 188 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 200 B |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 223 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 151 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 509 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 286 B |
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.9 KiB |
@ -0,0 +1,591 @@ |
||||
#include "entrance_client.h" |
||||
|
||||
typedef struct Entrance_Conf_Background_ |
||||
{ |
||||
const char *path; |
||||
const char *group; |
||||
const char *name; |
||||
} Entrance_Conf_Background; |
||||
|
||||
typedef struct Entrance_Int_Conf_ |
||||
{ |
||||
struct |
||||
{ |
||||
Evas_Object *preview; |
||||
const char *path; |
||||
const char *group; |
||||
} bg; |
||||
const char *theme; |
||||
const char *elm_profile; |
||||
Eina_Bool vkbd_enabled : 1; |
||||
double scale; |
||||
|
||||
struct |
||||
{ |
||||
const char *user; |
||||
struct |
||||
{ |
||||
Evas_Object *preview; |
||||
const char *path; |
||||
const char *group; |
||||
} bg; |
||||
Eina_Bool remember_session : 1; |
||||
} user; |
||||
|
||||
struct |
||||
{ |
||||
Evas_Object *btn_ok; |
||||
Evas_Object *btn_apply; |
||||
} gui; |
||||
|
||||
} Entrance_Int_Conf; |
||||
|
||||
|
||||
static void _entrance_conf_init(void); |
||||
static void _entrance_conf_shutdown(void); |
||||
static char *_entrance_conf_bg_text_get(void *data, Evas_Object *obj, const char *part); |
||||
static Evas_Object *_entrance_conf_bg_content_get(void *data, Evas_Object *obj, const char *part); |
||||
static Eina_Bool _entrance_conf_bg_state_get(void *data, Evas_Object *obj, const char *part); |
||||
static void _entrance_conf_bg_sel(void *data, Evas_Object *obj, void *event_info); |
||||
static void _entrance_conf_changed(); |
||||
static void _entrance_conf_apply(); |
||||
|
||||
static Entrance_Fill *_entrance_background_fill = NULL; |
||||
static Entrance_Int_Conf *_entrance_int_conf = NULL; |
||||
|
||||
static char * |
||||
_entrance_conf_bg_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) |
||||
{ |
||||
Entrance_Conf_Background *cbg; |
||||
cbg = data; |
||||
return strdup(cbg->name); |
||||
} |
||||
|
||||
static Evas_Object * |
||||
_entrance_conf_bg_content_get(void *data, Evas_Object *obj, const char *part) |
||||
{ |
||||
Entrance_Conf_Background *cbg; |
||||
Evas_Object *o = NULL; |
||||
cbg = data; |
||||
if (part && !strcmp("elm.swallow.icon", part)) |
||||
{ |
||||
o = elm_image_add(obj); |
||||
elm_image_file_set(o, cbg->path, cbg->group); |
||||
elm_image_smooth_set(o, EINA_FALSE); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, |
||||
EVAS_HINT_EXPAND); |
||||
evas_object_show(o); |
||||
} |
||||
return o; |
||||
} |
||||
|
||||
static Eina_Bool |
||||
_entrance_conf_bg_state_get(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) |
||||
{ |
||||
return EINA_FALSE; |
||||
} |
||||
|
||||
static void |
||||
_entrance_conf_bg_del(void *data, Evas_Object *obj EINA_UNUSED) |
||||
{ |
||||
Entrance_Conf_Background *cbg; |
||||
cbg = data; |
||||
eina_stringshare_del(cbg->name); |
||||
eina_stringshare_del(cbg->path); |
||||
eina_stringshare_del(cbg->group); |
||||
free(cbg); |
||||
} |
||||
|
||||
static void |
||||
_entrance_conf_bg_sel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) |
||||
{ |
||||
Entrance_Conf_Background *cbg; |
||||
cbg = elm_object_item_data_get(event_info); |
||||
fprintf(stderr, "%s %s\n", cbg->path, cbg->group); |
||||
if (!elm_layout_file_set(_entrance_int_conf->bg.preview, |
||||
cbg->path, cbg->group)) |
||||
{ |
||||
PT("Error on loading "); |
||||
fprintf(stderr, "%s %s\n", cbg->path, cbg->group); |
||||
} |
||||
_entrance_int_conf->bg.path = cbg->path; |
||||
_entrance_int_conf->bg.group = cbg->group; |
||||
_entrance_conf_changed(); |
||||
} |
||||
|
||||
/* vkbd */ |
||||
static void |
||||
_entrance_conf_vkbd_changed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED) |
||||
{ |
||||
Elm_Actionslider_Pos p; |
||||
|
||||
PT("User change vkbd state\n"); |
||||
|
||||
p = elm_actionslider_indicator_pos_get(obj); |
||||
_entrance_int_conf->vkbd_enabled = !!(p == ELM_ACTIONSLIDER_RIGHT); |
||||
_entrance_conf_changed(); |
||||
} |
||||
|
||||
/* scale */ |
||||
static void |
||||
_entrance_conf_scale_changed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED) |
||||
{ |
||||
_entrance_int_conf->scale = elm_spinner_value_get(obj); |
||||
_entrance_conf_changed(); |
||||
} |
||||
|
||||
/* Buttons Cb */ |
||||
static void |
||||
_entrance_conf_ok_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) |
||||
{ |
||||
_entrance_conf_apply(); |
||||
evas_object_del(data); |
||||
_entrance_conf_shutdown(); |
||||
} |
||||
|
||||
static void |
||||
_entrance_conf_apply_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) |
||||
{ |
||||
_entrance_conf_apply(); |
||||
_entrance_conf_changed(); |
||||
} |
||||
|
||||
static void |
||||
_entrance_conf_close_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) |
||||
{ |
||||
evas_object_del(data); |
||||
_entrance_conf_shutdown(); |
||||
} |
||||
|
||||
|
||||
static Eina_List * |
||||
_entrance_conf_backgrounds_get(Evas_Object *obj, const char *user) |
||||
{ |
||||
Evas_Object *o, *edj; |
||||
Eina_List *list, *l, *nl = NULL; |
||||
Entrance_Conf_Background *cbg; |
||||
const char *str; |
||||
const char *path; |
||||
char buf[PATH_MAX]; |
||||
Eina_Iterator *it; |
||||
|
||||
o = entrance_gui_theme_get(obj, "entrance/background"); |
||||
edj = elm_layout_edje_get(o); |
||||
edje_object_file_get(edj, &path, NULL); |
||||
list = entrance_gui_stringlist_get(edje_object_data_get(edj, "items")); |
||||
EINA_LIST_FOREACH(list, l, str) |
||||
{ |
||||
cbg = calloc(1, sizeof(Entrance_Conf_Background)); |
||||
snprintf(buf, sizeof(buf), |
||||
"entrance/background/%s", str); |
||||
|
||||
cbg->path = eina_stringshare_add(path); |
||||
cbg->group = eina_stringshare_add(buf); |
||||
cbg->name = eina_stringshare_add(str); |
||||
nl = eina_list_append(nl, cbg); |
||||
} |
||||
entrance_gui_stringlist_free(list); |
||||
evas_object_del(o); |
||||
|
||||
//TODO parse share/entrance/background
|
||||
it = eina_file_ls(PACKAGE_DATA_DIR"/backgrounds"); |
||||
EINA_ITERATOR_FOREACH(it, str) |
||||
{ |
||||
int len; |
||||
len = strlen(str); |
||||
if (len < 4) continue; |
||||
if (!strcmp(&str[len-4], ".edj")) |
||||
{ |
||||
cbg = calloc(1, sizeof(Entrance_Conf_Background)); |
||||
snprintf(buf, sizeof(buf), |
||||
"entrance/background/%s", str); |
||||
cbg->path = str; |
||||
cbg->group = eina_stringshare_add("e/desktop/background"); |
||||
{ |
||||
char *name, *p; |
||||
name = strrchr(str, '/'); |
||||
if (name) |
||||
{ |
||||
name++; |
||||
name = strdupa(name); |
||||
p = strrchr(name, '.'); |
||||
if (p) *p = '\0'; |
||||
} |
||||
cbg->name = eina_stringshare_add(name); |
||||
} |
||||
nl = eina_list_append(nl, cbg); |
||||
} |
||||
else |
||||
eina_stringshare_del(str); |
||||
} |
||||
eina_iterator_free(it); |
||||
|
||||
return nl; |
||||
} |
||||
|
||||
static void |
||||
_entrance_conf_apply() |
||||
{ |
||||
Entrance_Conf_Gui_Event conf; |
||||
|
||||
conf.bg.path = _entrance_int_conf->bg.path; |
||||
conf.bg.group = _entrance_int_conf->bg.group; |
||||
conf.vkbd_enabled = _entrance_int_conf->vkbd_enabled; |
||||
|
||||
entrance_gui_conf_set(&conf); |
||||
entrance_connect_conf_send(&conf); |
||||
} |
||||
|
||||
/* Build it */ |
||||
static Evas_Object * |
||||
_entrance_conf_build(Evas_Object *obj) |
||||
{ |
||||
Evas_Object *t, *bx, *hbx, *o; |
||||
Eina_List *l; |
||||
int j = 0; |
||||
|
||||
t = elm_table_add(obj); |
||||
elm_table_padding_set(t, 5 , 5); |
||||
evas_object_size_hint_weight_set(t, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); |
||||
|
||||
/* Background */ |
||||
o = elm_label_add(t); |
||||
elm_object_text_set(o, "Background"); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 1, 1); |
||||
evas_object_show(o); |
||||
++j; |
||||
|
||||
hbx = elm_box_add(t); |
||||
elm_box_horizontal_set(hbx, EINA_TRUE); |
||||
elm_table_pack(t, hbx, 0, j, 2, 3); |
||||
evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); |
||||
evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
o = elm_genlist_add(hbx); |
||||
elm_scroller_bounce_set(o, EINA_FALSE, EINA_TRUE); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
l = _entrance_conf_backgrounds_get(o, NULL); |
||||
entrance_fill(o, _entrance_background_fill, |
||||
l, _entrance_conf_bg_sel, o); |
||||
eina_list_free(l); |
||||
elm_box_pack_end(hbx, o); |
||||
evas_object_show(o); |
||||
bx = elm_box_add(hbx); |
||||
elm_box_pack_end(hbx, bx); |
||||
evas_object_show(bx); |
||||
o = elm_layout_add(hbx); |
||||
elm_box_pack_end(bx, o); |
||||
_entrance_int_conf->bg.preview = o; |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
evas_object_show(o); |
||||
o = evas_object_rectangle_add(hbx); |
||||
evas_object_color_set(o, 0, 0, 0, 0); |
||||
evas_object_size_hint_min_set(o, 256, 0); |
||||
elm_box_pack_end(bx, o); |
||||
evas_object_show(o); |
||||
evas_object_show(hbx); |
||||
j += 3; |
||||
|
||||
/* Touch Screen */ |
||||
o = elm_label_add(t); |
||||
elm_object_text_set(o, "Use a virtual keyboard"); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 1, 1); |
||||
evas_object_show(o); |
||||
o = elm_actionslider_add(t); |
||||
elm_object_style_set(o, "bar"); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_object_part_text_set(o, "left", "Disabled"); |
||||
elm_object_part_text_set(o, "right", "Enabled"); |
||||
|
||||
elm_actionslider_magnet_pos_set(o, ELM_ACTIONSLIDER_LEFT); |
||||
elm_actionslider_enabled_pos_set(o, ELM_ACTIONSLIDER_LEFT | |
||||
ELM_ACTIONSLIDER_RIGHT); |
||||
evas_object_smart_callback_add(o, "selected", |
||||
_entrance_conf_vkbd_changed, NULL); |
||||
if (_entrance_int_conf->vkbd_enabled) |
||||
elm_actionslider_indicator_pos_set(o, ELM_ACTIONSLIDER_RIGHT); |
||||
else |
||||
elm_actionslider_indicator_pos_set(o, ELM_ACTIONSLIDER_LEFT); |
||||
elm_table_pack(t, o, 1, j, 1, 1); |
||||
evas_object_show(o); |
||||
++j; |
||||
|
||||
/* Elementary Profile */ |
||||
o = elm_label_add(t); |
||||
elm_object_text_set(o, "elementary profile"); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 1, 1); |
||||
evas_object_show(o); |
||||
o = elm_button_add(t); |
||||
elm_object_text_set(o, _entrance_int_conf->elm_profile); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 1, j, 1, 1); |
||||
evas_object_show(o); |
||||
++j; |
||||
|
||||
/* Scaling */ |
||||
o = elm_label_add(t); |
||||
elm_object_text_set(o, "Scaling"); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 1, 1); |
||||
evas_object_show(o); |
||||
o = elm_spinner_add(t); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
evas_object_smart_callback_add(o, "changed", |
||||
_entrance_conf_scale_changed, NULL); |
||||
elm_spinner_value_set(o, _entrance_int_conf->scale); |
||||
elm_spinner_min_max_set(o, 0.25, 5.0); |
||||
elm_spinner_step_set(o, 0.15); |
||||
elm_spinner_label_format_set(o, "%.2f"); |
||||
|
||||
elm_table_pack(t, o, 1, j, 1, 1); |
||||
evas_object_show(o); |
||||
++j; |
||||
|
||||
o = evas_object_rectangle_add(o); |
||||
evas_object_color_set(o, 0, 0, 0, 0); |
||||
evas_object_size_hint_min_set(o, 128, 0); |
||||
elm_table_pack(t, o, 1, j, 1, 1); |
||||
|
||||
evas_object_show(t); |
||||
return t; |
||||
} |
||||
|
||||
static Evas_Object * |
||||
_entrance_conf_user_build(Evas_Object *obj) |
||||
{ |
||||
Evas_Object *t, *bx, *o, *ly; |
||||
int j = 0; |
||||
|
||||
ly = entrance_gui_theme_get(obj, "entrance/conf/login"); |
||||
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
evas_object_show(ly); |
||||
|
||||
t = elm_table_add(obj); |
||||
elm_object_part_content_set(ly, "entrance.conf", t); |
||||
elm_table_padding_set(t, 5 , 5); |
||||
|
||||
/* Background */ |
||||
o = elm_label_add(t); |
||||
elm_object_text_set(o, "Background"); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 1, 1); |
||||
evas_object_show(o); |
||||
++j; |
||||
o = elm_gengrid_add(t); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 2, 3); |
||||
elm_gengrid_item_size_set(o, 80, 50); |
||||
elm_gengrid_align_set(o, 0.0, 0.0); |
||||
evas_object_show(o); |
||||
j += 3; |
||||
|
||||
/* Session to autoselect */ |
||||
o = elm_label_add(t); |
||||
elm_object_text_set(o, "Session to use"); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 1, 1); |
||||
evas_object_show(o); |
||||
o = elm_hoversel_add(t); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_object_text_set(o, "Session"); |
||||
elm_table_pack(t, o, 1, j, 1, 1); |
||||
evas_object_show(o); |
||||
++j; |
||||
|
||||
/* Remember last session */ |
||||
o = elm_label_add(t); |
||||
elm_object_text_set(o, "Remember last session"); |
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_table_pack(t, o, 0, j, 1, 1); |
||||
evas_object_show(o); |
||||
o = elm_actionslider_add(t); |
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); |
||||
elm_object_part_text_set(o, "left", "Enabled"); |
||||
elm_object_part_text_set(o, "right", "Disabled"); |
||||
elm_table_pack(t, o, 1, j, 1, 1); |
||||
evas_object_show(o); |
||||
++j; |
||||
|
||||
evas_object_show(t); |
||||
|
||||
return ly; |
||||
} |
||||
|
||||
static void |
||||
_entrance_conf_control_changed(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) |
||||
{ |
||||
Elm_Object_Item *it; |
||||
it = event; |
||||
elm_naviframe_item_promote(elm_object_item_data_get(it)); |
||||
} |
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void |
||||
_entrance_conf_changed(void) |
||||
{ |
||||
const char *bg_path; |
||||
const char *bg_group; |
||||
|
||||
entrance_gui_background_get(&bg_path, &bg_group); |
||||
if ((_entrance_int_conf->theme != entrance_gui_theme_name_get()) |
||||
|| (_entrance_int_conf->bg.path != bg_path) |
||||
|| (_entrance_int_conf->bg.group != bg_group) |
||||
|| (_entrance_int_conf->scale != elm_config_scale_get()) |
||||