finally - xkbswitch into core e. needs some polishing work. what i

have done here beyond just "copy the code" is:

1. fix up some code that was useless (didnt need to be done).
2. reformat all the code to be closer to efl/e style guidelines
3. add flags to the gadget popup menu to change keyboard
4. fix lots of warnings
5. fix some correctness in c - () vs (void)
6. added q66 to AUTHORS
7. made it use _() intl macro, not D_() (needed)
8. put xkbswitch module stuff in theme (need some prettying/work)
9. added some XXX: comments on things to do

right now xkbswithc is actually very powerful (thanks q66) but its not
that user-friendly. it lets you add a short-list of "keyboard layouts"
you nee/duse. the gagdet lets you quick-switch between them. this
actually works. it has nice little flaggy things to try help you out.

what we probably need to do is:

1. fix a buffer overflow waiting to happen in the kbdswitch changing.
XXX'd
2. add a wizard page asking for kbd layout
3. double-check that "last used kbdlayout" is actually turned on
4. move xkbd config to core e config (not separate in module)
5. pretty up the gagdet (add a shadow around the flag, some
placeholder if no flag is selected etc.)
6. go over the xkb parser - it looks fragile from a read

:)




SVN revision: 70531
devs/princeamd/enlightenment-0.17-elive
Carsten Haitzler 11 years ago
parent 889fdaf198
commit c1699d13a0
  1. 1
      AUTHORS
  2. 4
      configure.ac
  3. 4
      data/Makefile.am
  4. 97
      data/flags/Makefile.am
  5. BIN
      data/flags/ad_flag.png
  6. BIN
      data/flags/af_flag.png
  7. BIN
      data/flags/al_flag.png
  8. BIN
      data/flags/am_flag.png
  9. BIN
      data/flags/ara_flag.png
  10. BIN
      data/flags/at_flag.png
  11. BIN
      data/flags/az_flag.png
  12. BIN
      data/flags/ba_flag.png
  13. BIN
      data/flags/bd_flag.png
  14. BIN
      data/flags/be_flag.png
  15. BIN
      data/flags/bg_flag.png
  16. BIN
      data/flags/br_flag.png
  17. BIN
      data/flags/brai_flag.png
  18. BIN
      data/flags/bt_flag.png
  19. BIN
      data/flags/bw_flag.png
  20. BIN
      data/flags/by_flag.png
  21. BIN
      data/flags/ca_flag.png
  22. BIN
      data/flags/cd_flag.png
  23. BIN
      data/flags/ch_flag.png
  24. BIN
      data/flags/cn_flag.png
  25. BIN
      data/flags/cz_flag.png
  26. BIN
      data/flags/de_flag.png
  27. BIN
      data/flags/dk_flag.png
  28. BIN
      data/flags/ee_flag.png
  29. BIN
      data/flags/epo_flag.png
  30. BIN
      data/flags/es_flag.png
  31. BIN
      data/flags/et_flag.png
  32. BIN
      data/flags/fi_flag.png
  33. BIN
      data/flags/fo_flag.png
  34. BIN
      data/flags/fr_flag.png
  35. BIN
      data/flags/gb_flag.png
  36. BIN
      data/flags/ge_flag.png
  37. BIN
      data/flags/gh_flag.png
  38. BIN
      data/flags/gn_flag.png
  39. BIN
      data/flags/gr_flag.png
  40. BIN
      data/flags/hr_flag.png
  41. BIN
      data/flags/hu_flag.png
  42. BIN
      data/flags/ie_flag.png
  43. BIN
      data/flags/il_flag.png
  44. BIN
      data/flags/in_flag.png
  45. BIN
      data/flags/iq_flag.png
  46. BIN
      data/flags/ir_flag.png
  47. BIN
      data/flags/is_flag.png
  48. BIN
      data/flags/it_flag.png
  49. BIN
      data/flags/jp_flag.png
  50. BIN
      data/flags/ke_flag.png
  51. BIN
      data/flags/kg_flag.png
  52. BIN
      data/flags/kh_flag.png
  53. BIN
      data/flags/kr_flag.png
  54. BIN
      data/flags/kz_flag.png
  55. BIN
      data/flags/la_flag.png
  56. BIN
      data/flags/latam_flag.png
  57. BIN
      data/flags/lk_flag.png
  58. BIN
      data/flags/lt_flag.png
  59. BIN
      data/flags/lv_flag.png
  60. BIN
      data/flags/ma_flag.png
  61. BIN
      data/flags/mao_flag.png
  62. BIN
      data/flags/me_flag.png
  63. BIN
      data/flags/mk_flag.png
  64. BIN
      data/flags/ml_flag.png
  65. BIN
      data/flags/mm_flag.png
  66. BIN
      data/flags/mn_flag.png
  67. BIN
      data/flags/mt_flag.png
  68. BIN
      data/flags/mv_flag.png
  69. BIN
      data/flags/ng_flag.png
  70. BIN
      data/flags/nl_flag.png
  71. BIN
      data/flags/no_flag.png
  72. BIN
      data/flags/np_flag.png
  73. BIN
      data/flags/ph_flag.png
  74. BIN
      data/flags/pk_flag.png
  75. BIN
      data/flags/pl_flag.png
  76. BIN
      data/flags/pt_flag.png
  77. BIN
      data/flags/ro_flag.png
  78. BIN
      data/flags/rs_flag.png
  79. BIN
      data/flags/ru_flag.png
  80. BIN
      data/flags/se_flag.png
  81. BIN
      data/flags/si_flag.png
  82. BIN
      data/flags/sk_flag.png
  83. BIN
      data/flags/sn_flag.png
  84. BIN
      data/flags/sy_flag.png
  85. BIN
      data/flags/th_flag.png
  86. BIN
      data/flags/tj_flag.png
  87. BIN
      data/flags/tm_flag.png
  88. BIN
      data/flags/tr_flag.png
  89. BIN
      data/flags/tw_flag.png
  90. BIN
      data/flags/tz_flag.png
  91. BIN
      data/flags/ua_flag.png
  92. BIN
      data/flags/unknown_flag.png
  93. BIN
      data/flags/us_flag.png
  94. BIN
      data/flags/uz_flag.png
  95. BIN
      data/flags/vn_flag.png
  96. BIN
      data/flags/za_flag.png
  97. 135
      data/themes/default.edc
  98. 7
      po/POTFILES.in
  99. 4
      src/modules/Makefile.am
  100. 849
      src/modules/conf_display/e_int_config_display.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -32,3 +32,4 @@ Sthitha <iamsthitha@gmail>
Doyoun Kang <doyoun.kang@samsung.com>
Gwanglim Lee <gl77.lee@samsung.com>
Thomas Gstädtner <thomas@gstaedtner.net>
q66 <quaker66@gmail.com>

@ -797,6 +797,7 @@ AC_E_OPTIONAL_MODULE([shot], true)
AC_E_OPTIONAL_MODULE([backlight], true)
AC_E_OPTIONAL_MODULE([tasks], true)
AC_E_OPTIONAL_MODULE([conf_randr], true)
AC_E_OPTIONAL_MODULE([xkbswitch], true)
SUSPEND=""
HIBERNATE=""
@ -951,9 +952,12 @@ src/modules/backlight/Makefile
src/modules/backlight/module.desktop
src/modules/tasks/Makefile
src/modules/tasks/module.desktop
src/modules/xkbswitch/Makefile
src/modules/xkbswitch/module.desktop
src/preload/Makefile
data/Makefile
data/images/Makefile
data/flags/Makefile
data/input_methods/Makefile
data/themes/Makefile
data/themes/images/Makefile

@ -7,5 +7,5 @@ xsession \
input_methods \
etc \
icons \
backgrounds
backgrounds \
flags

@ -0,0 +1,97 @@
MAINTAINERCLEANFILES = Makefile.in
filesdir = $(datadir)/enlightenment/data/flags
files_DATA = \
ad_flag.png \
af_flag.png \
al_flag.png \
am_flag.png \
ara_flag.png \
at_flag.png \
az_flag.png \
ba_flag.png \
bd_flag.png \
be_flag.png \
bg_flag.png \
brai_flag.png \
br_flag.png \
bt_flag.png \
bw_flag.png \
by_flag.png \
ca_flag.png \
cd_flag.png \
ch_flag.png \
cn_flag.png \
cz_flag.png \
de_flag.png \
dk_flag.png \
ee_flag.png \
epo_flag.png \
es_flag.png \
et_flag.png \
fi_flag.png \
fo_flag.png \
fr_flag.png \
gb_flag.png \
ge_flag.png \
gh_flag.png \
gn_flag.png \
gr_flag.png \
hr_flag.png \
hu_flag.png \
ie_flag.png \
il_flag.png \
in_flag.png \
iq_flag.png \
ir_flag.png \
is_flag.png \
it_flag.png \
jp_flag.png \
ke_flag.png \
kg_flag.png \
kh_flag.png \
kr_flag.png \
kz_flag.png \
la_flag.png \
latam_flag.png \
lk_flag.png \
lt_flag.png \
lv_flag.png \
ma_flag.png \
mao_flag.png \
me_flag.png \
mk_flag.png \
ml_flag.png \
mm_flag.png \
mn_flag.png \
mt_flag.png \
mv_flag.png \
ng_flag.png \
nl_flag.png \
no_flag.png \
np_flag.png \
ph_flag.png \
pk_flag.png \
pl_flag.png \
pt_flag.png \
ro_flag.png \
rs_flag.png \
ru_flag.png \
se_flag.png \
si_flag.png \
sk_flag.png \
sn_flag.png \
sy_flag.png \
th_flag.png \
tj_flag.png \
tm_flag.png \
tr_flag.png \
tw_flag.png \
tz_flag.png \
ua_flag.png \
unknown_flag.png \
us_flag.png \
uz_flag.png \
vn_flag.png \
za_flag.png
EXTRA_DIST = $(files_DATA)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -41314,4 +41314,139 @@ collections {
}
}
}
group
{
name: "modules/xkbswitch/main";
max: 148 128;
parts
{
part
{
name: "flag";
type: SWALLOW;
mouse_events: 0;
description
{
state: "default" 0.0;
align: 0.5 0.5;
}
}
part
{
name: "event";
type: RECT;
mouse_events: 1;
description
{
state: "default" 0.0;
color: 255 255 255 0;
}
}
part
{
name: "label";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description
{
state: "default" 0.0;
align: 0.5 0.5;
rel1
{
relative: 0.5 0.5;
offset: 0 0;
}
rel2
{
relative: 0.5 0.5;
offset: 0 0;
}
color: 255 255 255 255;
color3: 0 0 0 128;
text
{
text: "";
font: "Sans";
size: 9;
align: 0.5 0.5;
min: 1 1;
text_class: "module_small";
}
}
}
}
}
group
{
name: "modules/xkbswitch/noflag";
max: 148 128;
parts
{
part
{
name: "event";
type: RECT;
mouse_events: 1;
description
{
state: "default" 0.0;
color: 255 255 255 0;
}
}
part
{
name: "label";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description
{
state: "default" 0.0;
align: 0.5 0.5;
rel1
{
relative: 0.5 0.5;
offset: 0 0;
}
rel2
{
relative: 0.5 0.5;
offset: 0 0;
}
color: 255 255 255 255;
color3: 0 0 0 128;
text
{
text: "";
font: "Sans";
size: 9;
align: 0.5 0.5;
min: 1 1;
text_class: "module_small";
}
}
}
}
}
}

@ -246,3 +246,10 @@ src/modules/mixer/conf_module.c
src/modules/mixer/e_mod_main.c
src/modules/connman/e_mod_main.c
src/modules/systray/e_mod_main.c
src/modules/shot/e_mod_main.c
src/modules/tasks/e_mod_main.c
src/modules/tasks/e_mod_config.c
src/modules/xkbswitch/e_mod_main.c
src/modules/xkbswitch/e_mod_config.c
src/modules/xkbswitch/e_mod_keybindings.c
src/modules/xkbswitch/e_mod_parse.c

@ -191,6 +191,10 @@ if USE_MODULE_TASKS
SUBDIRS += tasks
endif
if USE_MODULE_XKBSWITCH
SUBDIRS += xkbswitch
endif
#if HAVE_WAYLAND_DRM
# SUBDIRS += wl_drm
#endif

@ -5,226 +5,473 @@
* Give list some icons.
*/
#define RANDR_11 ((1 << 16) | 1)
static void _fill_data (E_Config_Dialog_Data *cfdata);
static void *_create_data (E_Config_Dialog *cfd);
static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_check_changed (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
static void _load_resolutions (E_Config_Dialog_Data *cfdata);
static void _load_rates (E_Config_Dialog_Data *cfdata);
static void _ilist_item_change (void *data);
static Eina_Bool _deferred_noxrandr_error (void *data);
static Eina_Bool _deferred_norates_error (void *data);
static int _sort_resolutions (const void *d1, const void *d2);
typedef struct _Resolution Resolution;
typedef struct _SureBox SureBox;
struct _Resolution
{
int id;
Ecore_X_Randr_Screen_Size size;
int size_index;
Eina_List *rates;
};
struct _SureBox
{
E_Dialog *dia;
Ecore_Timer *timer;
int iterations;
E_Config_Dialog *cfd;
E_Config_Dialog_Data *cfdata;
};
struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
Eina_List *resolutions;
Ecore_X_Randr_Screen_Size orig_size;
int orig_size_index;
Ecore_X_Randr_Refresh_Rate orig_rate;
int orig_orientation;
int orig_flip;
Evas_Object *scr_list;
Evas_Object *res_list;
Evas_Object *policy_list;
const char *cur_scr;
int restore;
int can_rotate;
int can_flip;
int orientation;
int flip;
int flip_x;
int flip_y;
Eina_Bool has_rates;
Evas_Object *rate_list;
Evas_Object *res_list;
SureBox *surebox;
};
static void
_surebox_dialog_cb_delete(E_Win *win)
E_Config_Dialog *
e_int_config_display(E_Container *con, const char *params __UNUSED__)
{
E_Dialog *dia;
SureBox *sb;
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
dia = win->data;
sb = dia->data;
sb->cfdata->surebox = NULL;
cfd = sb->cfdata->cfd;
if (sb->timer) ecore_timer_del(sb->timer);
sb->timer = NULL;
free(sb);
e_object_del(E_OBJECT(dia));
e_object_unref(E_OBJECT(cfd));
if (e_config_dialog_find("E", "screen/screen_resolution")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
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->basic.check_changed = _basic_check_changed;
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con, _("Screen Resolution Settings"),
"E", "screen/screen_resolution",
"preferences-system-screen-resolution", 0, v, NULL);
return cfd;
}
static void
_surebox_dialog_cb_yes(void *data, E_Dialog *dia)
_fill_data(E_Config_Dialog_Data *cfdata)
{
SureBox *sb;
sb = data;
}
if (sb->cfdata->restore)
e_randr_11_store_configuration(E_RANDR_CONFIGURATION_STORE_ALL);
static void *
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
_fill_data(sb->cfdata);
_load_resolutions(sb->cfdata);
/* No need to load rates as the currently selected resolution has not been
* changed since last selection. */
if (dia) _surebox_dialog_cb_delete(dia->win);
cfdata = E_NEW(E_Config_Dialog_Data, 1);
_fill_data(cfdata);
cfdata->cfd = cfd;
return cfdata;
}
static void
_surebox_dialog_cb_no(void *data, E_Dialog *dia)
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
SureBox *sb;
if (cfdata->cur_scr) eina_stringshare_del(cfdata->cur_scr);
E_FREE(cfdata);
}
sb = data;
ecore_x_randr_screen_primary_output_refresh_rate_set(sb->dia->win->container->manager->root,
sb->cfdata->orig_size_index, sb->cfdata->orig_rate);
_load_resolutions(sb->cfdata);
_load_rates(sb->cfdata);
_surebox_dialog_cb_delete(dia->win);
static int
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
return 1;
}
static void
_surebox_text_fill(SureBox *sb)
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
char buf[4096];
return 1;
}
if (!sb->dia) return;
if (sb->iterations > 1)
static void
_res_get(E_Config_Dialog_Data *cfdata)
{
Eina_List *l;
E_Randr_Output_Info *oi = NULL;
Ecore_X_Randr_Mode_Info *mode;
e_widget_ilist_clear(cfdata->res_list);
if (!cfdata->cur_scr) return;
if (e_randr_screen_info.rrvd_info.randr_info_12)
{
if (sb->cfdata->has_rates)
snprintf(buf, sizeof(buf),
_("Does this look OK? <hilight>Save</hilight> if it does, or Restore if not.<br>"
"If you do not press a button, the old resolution of<br>"
"%dx%d at %d Hz will be restored in %d seconds."),
sb->cfdata->orig_size.width, sb->cfdata->orig_size.height,
sb->cfdata->orig_rate, sb->iterations);
else
snprintf(buf, sizeof(buf),
_("Does this look OK? <hilight>Save</hilight> if it does, or Restore if not.<br>"
"If you do not press a button, the old resolution of<br>"
"%dx%d will be restored in %d seconds."),
sb->cfdata->orig_size.width, sb->cfdata->orig_size.height,
sb->iterations);
EINA_LIST_FOREACH
(e_randr_screen_info.rrvd_info.randr_info_12->outputs, l, oi)
{
char buf[512];
strncpy(buf, oi->name, sizeof(buf) - 1);
buf[oi->name_length] = 0;
if (!strcmp(buf, cfdata->cur_scr)) break;
oi = NULL;
}
}
else
if (!oi) return;
if (!oi->monitor) return;
switch (oi->policy)
{
if (sb->cfdata->has_rates)
snprintf(buf, sizeof(buf),
_("Does this look OK? <hilight>Save</hilight> if it does, or Restore if not.<br>"
"If you do not press a button, the old resolution of<br>"
"%dx%d at %d Hz will be restored <hilight>IMMEDIATELY</hilight>."),
sb->cfdata->orig_size.width, sb->cfdata->orig_size.height,
sb->cfdata->orig_rate);
else
snprintf(buf, sizeof(buf),
_("Does this look OK? <hilight>Save</hilight> if it does, or Restore if not.<br>"
"If you do not press a button, the old resolution of<br>"
"%dx%d will be restored <hilight>IMMEDIATELY</hilight>."),
sb->cfdata->orig_size.width, sb->cfdata->orig_size.height);
case ECORE_X_RANDR_OUTPUT_POLICY_ABOVE:
printf(" policy: ABOVE\n"); break;
case ECORE_X_RANDR_OUTPUT_POLICY_RIGHT:
printf(" policy: RIGHT\n"); break;
case ECORE_X_RANDR_OUTPUT_POLICY_BELOW:
printf(" policy: BELOW\n"); break;
case ECORE_X_RANDR_OUTPUT_POLICY_LEFT:
printf(" policy: LEFT\n"); break;
case ECORE_X_RANDR_OUTPUT_POLICY_CLONE:
printf(" policy: CLONE\n"); break;
case ECORE_X_RANDR_OUTPUT_POLICY_NONE:
printf(" policy: NONE\n"); break;
default:
printf(" policy: unknown\n"); break;
break;
}
if (oi->crtc)
{
mode = oi->crtc->current_mode;
if (mode)
{
if ((mode->hTotal > 0) && (mode->vTotal > 0) && (mode->dotClock > 0))
{
double hz = (double)mode->dotClock /
(double)(mode->hTotal * mode->vTotal);
printf( " %ix%i %1.1fHz\n", mode->width, mode->height, hz);
}
}
printf(" geometry: %i %i %ix%i\n",
oi->crtc->geometry.x, oi->crtc->geometry.y,
oi->crtc->geometry.w, oi->crtc->geometry.h);
if (oi->crtc->current_orientation & ECORE_X_RANDR_ORIENTATION_ROT_0)
printf(" orient: 0\n");
if (oi->crtc->current_orientation & ECORE_X_RANDR_ORIENTATION_ROT_90)
printf(" orient: 90\n");
if (oi->crtc->current_orientation & ECORE_X_RANDR_ORIENTATION_ROT_180)
printf(" orient: 180\n");
if (oi->crtc->current_orientation & ECORE_X_RANDR_ORIENTATION_ROT_270)
printf(" orient: 270\n");
if (oi->crtc->current_orientation & ECORE_X_RANDR_ORIENTATION_FLIP_X)
printf(" orient: flip x\n");
if (oi->crtc->current_orientation & ECORE_X_RANDR_ORIENTATION_FLIP_Y)
printf(" orient: flip y\n");
printf(" can do:\n");
if (oi->crtc->orientations & ECORE_X_RANDR_ORIENTATION_ROT_0)
printf(" orient: 0\n");
if (oi->crtc->orientations & ECORE_X_RANDR_ORIENTATION_ROT_90)
printf(" orient: 90\n");
if (oi->crtc->orientations & ECORE_X_RANDR_ORIENTATION_ROT_180)
printf(" orient: 180\n");
if (oi->crtc->orientations & ECORE_X_RANDR_ORIENTATION_ROT_270)
printf(" orient: 270\n");
if (oi->crtc->orientations & ECORE_X_RANDR_ORIENTATION_FLIP_X)
printf(" orient: flip x\n");
if (oi->crtc->orientations & ECORE_X_RANDR_ORIENTATION_FLIP_Y)
printf(" orient: flip y\n");
}
printf(" monitor is %ix%i mm\n",
oi->monitor->size_mm.width, oi->monitor->size_mm.height);
EINA_LIST_FOREACH(oi->monitor->modes, l, mode)
{
char buf[512];
if ((mode->hTotal > 0) && (mode->vTotal > 0) && (mode->dotClock > 0))
{
double hz = (double)mode->dotClock /
(double)(mode->hTotal * mode->vTotal);
snprintf(buf, sizeof(buf), "%ix%i %1.1fHz",
mode->width, mode->height, hz);
e_widget_ilist_append(cfdata->res_list, NULL, buf, NULL, cfdata, NULL);
}
}
e_dialog_text_set(sb->dia, buf);
}
static Eina_Bool
_surebox_timer_cb(void *data)
static void
_screens_select(void *data)
{
SureBox *sb;
E_Config_Dialog_Data *cfdata = data;
_res_get(cfdata);
}
sb = data;
sb->iterations--;
_surebox_text_fill(sb);
if (sb->iterations == 0)
static void
_screens_get(E_Config_Dialog_Data *cfdata)
{
Eina_List *l;
E_Randr_Output_Info *oi;
if (e_randr_screen_info.rrvd_info.randr_info_12)
{
_surebox_dialog_cb_no(sb, sb->dia);
return ECORE_CALLBACK_CANCEL;
EINA_LIST_FOREACH
(e_randr_screen_info.rrvd_info.randr_info_12->outputs, l, oi)
{
char buf[512];
strncpy(buf, oi->name, sizeof(buf) - 1);
buf[oi->name_length] = 0;
printf("%s:\n", buf);
switch (oi->connection_status)
{
case ECORE_X_RANDR_CONNECTION_STATUS_CONNECTED:
printf(" connect: connected\n"); break;
case ECORE_X_RANDR_CONNECTION_STATUS_DISCONNECTED:
printf(" connect: disconnected\n"); break;
default:
printf(" connect: unknown\n"); break;
}
switch (oi->connector_type)
{
case ECORE_X_RANDR_EDID_DISPLAY_INTERFACE_DVI:
printf(" type DVI\n"); break;
case ECORE_X_RANDR_EDID_DISPLAY_INTERFACE_HDMI_A:
printf(" type HDMI_A\n"); break;
case ECORE_X_RANDR_EDID_DISPLAY_INTERFACE_HDMI_B:
printf(" type HDMI_B\n"); break;
case ECORE_X_RANDR_EDID_DISPLAY_INTERFACE_MDDI:
printf(" type MDDI\n"); break;
case ECORE_X_RANDR_EDID_DISPLAY_INTERFACE_DISPLAY_PORT:
printf(" type DISPLAY_PORT\n"); break;
default:
printf(" type unknown\n"); break;
}
e_widget_ilist_append(cfdata->scr_list, NULL, buf, _screens_select, cfdata, buf);
}
}
return ECORE_CALLBACK_RENEW;
}
static SureBox *
_surebox_new(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
SureBox *sb;
Evas_Object *o, *of, *ob, *ot;
E_Radio_Group *rg;
sb = E_NEW(SureBox, 1);
sb->dia = e_dialog_new(cfd->con, "E", "_display_res_sure_dialog");
sb->timer = ecore_timer_add(1.0, _surebox_timer_cb, sb);
sb->iterations = 15;
sb->cfd = cfd;
sb->cfdata = cfdata;
cfdata->surebox = sb;
sb->dia->data = sb;
e_dialog_title_set(sb->dia, _("Resolution change"));
e_dialog_icon_set(sb->dia, "preferences-system-screen-resolution", 48);
_surebox_text_fill(sb);
e_win_delete_callback_set(sb->dia->win, _surebox_dialog_cb_delete);
e_dialog_button_add(sb->dia, _("Save"), NULL, _surebox_dialog_cb_yes, sb);
e_dialog_button_add(sb->dia, _("Restore"), NULL, _surebox_dialog_cb_no, sb);
e_dialog_button_focus_num(sb->dia, 1);
e_win_centered_set(sb->dia->win, 1);
e_win_borderless_set(sb->dia->win, 1);
e_win_layer_set(sb->dia->win, 6);
e_win_sticky_set(sb->dia->win, 1);
e_dialog_show(sb->dia);
e_object_ref(E_OBJECT(cfd));
return sb;
o = e_widget_table_add(evas, 0);
of = e_widget_framelist_add(evas, _("Outputs"), 0);
ob = e_widget_ilist_add(evas, 16, 16, &(cfdata->cur_scr));
cfdata->scr_list = ob;
e_widget_size_min_set(ob, 128, 200);
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(o, of, 0, 0, 1, 1, 1, 1, 1, 1);
of = e_widget_framelist_add(evas, _("Modes"), 0);
ob = e_widget_ilist_add(evas, 16, 16, NULL);
cfdata->res_list = ob;
e_widget_size_min_set(ob, 192, 200);
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(o, of, 1, 0, 1, 1, 1, 1, 1, 1);
ob = e_widget_check_add(evas, _("Restore on login"), &cfdata->restore);
e_widget_table_object_append(o, ob, 1, 1, 2, 1, 1, 1, 0, 0);
ot = e_widget_table_add(evas, 0);
of = e_widget_framelist_add(evas, _("Policy"), 0);
ob = e_widget_ilist_add(evas, 16, 16, NULL);
cfdata->policy_list = ob;
e_widget_size_min_set(ob, 100, 80);
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
of = e_widget_framelist_add(evas, _("Rotation"), 0);
rg = e_widget_radio_group_new(&(cfdata->orientation));
ob = e_widget_radio_icon_add(evas, NULL, "preferences-screen-normal", 24, 24, ECORE_X_RANDR_ORIENTATION_ROT_0, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "preferences-screen-left", 24, 24, ECORE_X_RANDR_ORIENTATION_ROT_90, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "preferences-screen-around", 24, 24, ECORE_X_RANDR_ORIENTATION_ROT_180, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_icon_add(evas, NULL, "preferences-screen-right", 24, 24, ECORE_X_RANDR_ORIENTATION_ROT_270, rg);
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(ot, of, 0, 1, 1, 1, 1, 0, 1, 0);
of = e_widget_framelist_add(evas, _("Mirroring"), 0);
ob = e_widget_check_icon_add(evas, NULL, "preferences-screen-hflip", 24, 24, &(cfdata->flip_x));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_icon_add(evas, NULL, "preferences-screen-vflip", 24, 24, &(cfdata->flip_y));
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(ot, of, 0, 2, 1, 1, 1, 0, 1, 0);
e_widget_table_object_append(o, ot, 2, 0, 1, 1, 1, 1, 1, 1);
e_dialog_resizable_set(cfd->dia, 1);
_screens_get(cfdata);
return o;
}
E_Config_Dialog *
e_int_config_display(E_Container *con, const char *params __UNUSED__)