Compare commits
1 Commits
master
...
f/fix_xlib
Author | SHA1 | Date |
---|---|---|
Marcel Hollerbach | 04db77c4a9 |
2
COPYING
2
COPYING
|
@ -1,6 +1,6 @@
|
|||
Copyright notice for Enlightenment:
|
||||
|
||||
Copyright (C) 2000-2024 Carsten Haitzler and various contributors (see AUTHORS)
|
||||
Copyright (C) 2000-2020 Carsten Haitzler and various contributors (see AUTHORS)
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
@ -58,8 +58,7 @@ group "E_Config" struct {
|
|||
value "winlist_mode" int: 1;
|
||||
value "winlist_large_size" double: 0.6666;
|
||||
value "winlist_list_size" double: 0.3333;
|
||||
value "winlist_list_no_miniatures" uchar: 0;
|
||||
value "no_state_hidden_desktop" uchar: 0;
|
||||
value "winlist_list_no_miniatures" int: 0;
|
||||
value "maximize_policy" int: 49;
|
||||
value "allow_manip" int: 0;
|
||||
value "border_fix_on_shelf_toggle" int: 0;
|
||||
|
@ -140,8 +139,6 @@ group "E_Config" struct {
|
|||
value "clientlist_max_caption_len" int: 2;
|
||||
value "mouse_hand" int: 1;
|
||||
value "mouse_accel" double: 0.0;
|
||||
value "mouse_flat_accel" uchar: 0;
|
||||
value "mouse_hires_scroll" uchar: 1;
|
||||
value "mouse_accel_threshold" int: 4;
|
||||
value "mouse_natural_scroll" uchar: 0;
|
||||
value "mouse_emulate_middle_button" uchar: 1;
|
||||
|
@ -149,7 +146,6 @@ group "E_Config" struct {
|
|||
value "touch_natural_scroll" uchar: 0;
|
||||
value "touch_emulate_middle_button" uchar: 1;
|
||||
value "touch_tap_to_click" uchar: 0;
|
||||
value "touch_flat_accel" uchar: 0;
|
||||
value "touch_clickpad" uchar: 1;
|
||||
value "touch_scrolling_2finger" uchar: 1;
|
||||
value "touch_scrolling_edge" uchar: 0;
|
||||
|
|
|
@ -54,8 +54,7 @@ group "E_Config" struct {
|
|||
value "winlist_mode" int: 1;
|
||||
value "winlist_large_size" double: 0.6666;
|
||||
value "winlist_list_size" double: 0.3333;
|
||||
value "winlist_list_no_miniatures" uchar: 0;
|
||||
value "no_state_hidden_desktop" uchar: 0;
|
||||
value "winlist_list_no_miniatures" int: 0;
|
||||
value "maximize_policy" int: 50;
|
||||
value "allow_manip" int: 0;
|
||||
value "border_fix_on_shelf_toggle" int: 0;
|
||||
|
@ -138,8 +137,6 @@ group "E_Config" struct {
|
|||
value "clientlist_max_caption_len" int: 2;
|
||||
value "mouse_hand" int: 1;
|
||||
value "mouse_accel" double: 0.0;
|
||||
value "mouse_flat_accel" uchar: 0;
|
||||
value "mouse_hires_scroll" uchar: 1;
|
||||
value "mouse_accel_threshold" int: 4;
|
||||
value "mouse_natural_scroll" uchar: 0;
|
||||
value "mouse_emulate_middle_button" uchar: 1;
|
||||
|
@ -147,7 +144,6 @@ group "E_Config" struct {
|
|||
value "touch_natural_scroll" uchar: 0;
|
||||
value "touch_emulate_middle_button" uchar: 1;
|
||||
value "touch_tap_to_click" uchar: 0;
|
||||
value "touch_flat_accel" uchar: 0;
|
||||
value "touch_clickpad" uchar: 1;
|
||||
value "touch_scrolling_2finger" uchar: 1;
|
||||
value "touch_scrolling_edge" uchar: 0;
|
||||
|
|
|
@ -54,8 +54,7 @@ group "E_Config" struct {
|
|||
value "winlist_mode" int: 1;
|
||||
value "winlist_large_size" double: 0.6666;
|
||||
value "winlist_list_size" double: 0.3333;
|
||||
value "winlist_list_no_miniatures" uchar: 0;
|
||||
value "no_state_hidden_desktop" uchar: 0;
|
||||
value "winlist_list_no_miniatures" int: 0;
|
||||
value "maximize_policy" int: 50;
|
||||
value "allow_manip" int: 0;
|
||||
value "border_fix_on_shelf_toggle" int: 0;
|
||||
|
@ -139,15 +138,12 @@ group "E_Config" struct {
|
|||
value "mouse_hand" int: 1;
|
||||
value "mouse_accel" double: 0.0;
|
||||
value "mouse_accel_threshold" int: 4;
|
||||
value "mouse_flat_accel" uchar: 0;
|
||||
value "mouse_hires_scroll" uchar: 1;
|
||||
value "mouse_natural_scroll" uchar: 0;
|
||||
value "mouse_emulate_middle_button" uchar: 1;
|
||||
value "touch_accel" double: 0.0;
|
||||
value "touch_natural_scroll" uchar: 0;
|
||||
value "touch_emulate_middle_button" uchar: 1;
|
||||
value "touch_tap_to_click" uchar: 0;
|
||||
value "touch_flat_accel" uchar: 0;
|
||||
value "touch_clickpad" uchar: 1;
|
||||
value "touch_scrolling_2finger" uchar: 1;
|
||||
value "touch_scrolling_edge" uchar: 0;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
##### project
|
||||
project('enlightenment', 'c',
|
||||
version : '0.26.99',
|
||||
version : '0.25.99',
|
||||
license : 'BSD 2 clause',
|
||||
default_options: [ 'buildtype=release', 'c_std=gnu99', 'warning_level=2' ],
|
||||
meson_version : '>= 0.47.0')
|
||||
|
@ -30,7 +30,7 @@ else
|
|||
config_h.set('E_RELEASE_BUILD' , '1')
|
||||
endif
|
||||
|
||||
efl_version = '>= 1.27.0'
|
||||
efl_version = '>= 1.26.99'
|
||||
|
||||
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
|
||||
dir_prefix = get_option('prefix')
|
||||
|
@ -83,11 +83,6 @@ config_h.set('_POSIX_PTHREAD_SEMANTICS', '1')
|
|||
config_h.set('_TANDEM_SOURCE' , '1')
|
||||
config_h.set('__EXTENSIONS__' , '1')
|
||||
|
||||
str_ver_split = efl_version.replace('>= ', '').split('.')
|
||||
config_h.set('MIN_EFL_VERSION_MAJ', str_ver_split[0])
|
||||
config_h.set('MIN_EFL_VERSION_MIN', str_ver_split[1])
|
||||
config_h.set('MIN_EFL_VERSION_MIC', str_ver_split[2])
|
||||
|
||||
subdir('po')
|
||||
|
||||
darwin = host_machine.system().startswith('darwin')
|
||||
|
|
|
@ -132,10 +132,6 @@ option('connman',
|
|||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'enable connman module: (default=true)')
|
||||
option('convertible',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'enable convertible module: (default=true)')
|
||||
option('cpufreq',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
|
|
20838
po/fr_CH.po
20838
po/fr_CH.po
File diff suppressed because it is too large
Load Diff
19937
po/pt_BR.po
19937
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
19726
po/zh_CN.po
19726
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
19125
po/zh_TW.po
19125
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
|
@ -23,7 +23,7 @@ e_about_new(void)
|
|||
snprintf
|
||||
(buf, sizeof(buf), "%s%s",
|
||||
_(
|
||||
"<title>Copyright © 2000-2024, by the Enlightenment "
|
||||
"<title>Copyright © 2000-2022, by the Enlightenment "
|
||||
"Development Team</><ps/>"
|
||||
"<ps/>"
|
||||
"We hope you enjoy using this software as much as we enjoyed "
|
||||
|
|
|
@ -960,6 +960,13 @@ _e_comp_shapes_update_job(void *d EINA_UNUSED)
|
|||
win = e_comp->win;
|
||||
else
|
||||
win = e_comp->cm_selection;
|
||||
|
||||
if (e_comp->h <= 0 || e_comp->w <= 0)
|
||||
{
|
||||
e_comp->shape_update_on_resize = EINA_TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
E_FREE_LIST(e_comp->debug_rects, evas_object_del);
|
||||
tb = eina_tiler_new(e_comp->w, e_comp->h);
|
||||
eina_tiler_tile_size_set(tb, 1, 1);
|
||||
|
|
|
@ -192,6 +192,7 @@ struct _E_Comp
|
|||
Eina_Bool updating E_BITFIELD; // running client updates
|
||||
|
||||
Eina_Bool frozen E_BITFIELD; // frozen - when power save freeze mode is on
|
||||
Eina_Bool shape_update_on_resize E_BITFIELD; //a shape update was scheduled but e_comp size was 0 in one dimension
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -625,6 +625,9 @@ e_comp_canvas_resize(int w, int h)
|
|||
e_comp->w = w;
|
||||
e_comp->h = h;
|
||||
ecore_evas_resize(e_comp->ee, w, h);
|
||||
if (e_comp->shape_update_on_resize) {
|
||||
e_comp_shape_queue();
|
||||
}
|
||||
}
|
||||
|
||||
E_API void
|
||||
|
|
|
@ -144,44 +144,11 @@ _handle_dev_prop(int dev_slot, const char *dev, const char *prop, Device_Flags d
|
|||
}
|
||||
free(val);
|
||||
}
|
||||
else if (!strcmp(prop, "libinput Accel Profile Enabled"))
|
||||
{
|
||||
// 1 bool, 0 = adaptive, 1 = flat
|
||||
unsigned char cfval = 0;
|
||||
unsigned char *val = ecore_x_input_device_property_get
|
||||
(dev_slot, prop, &num, &fmt, &size);
|
||||
if (dev_flags == DEVICE_FLAG_TOUCHPAD)
|
||||
cfval = e_config->touch_flat_accel;
|
||||
else
|
||||
cfval = e_config->mouse_flat_accel;
|
||||
|
||||
if ((val) && (size == 8) && (num == 2) && (((cfval == 1) && (val[0] == 1)) ||
|
||||
((cfval == 0) && (val[0] == 0))))
|
||||
{
|
||||
// Does a little flip-flop for each variable
|
||||
val[0] = !cfval;
|
||||
val[1] = cfval;
|
||||
printf("DEV: change [%s] [%s] -> %i, %i\n", dev, prop, val[0], val[1]);
|
||||
ecore_x_input_device_property_set
|
||||
(dev_slot, prop, val, num, fmt, size);
|
||||
}
|
||||
free(val);
|
||||
}
|
||||
else if (!strcmp(prop, "libinput High Resolution Wheel Scroll Enabled"))
|
||||
{
|
||||
unsigned char cfval = e_config->mouse_hires_scroll;
|
||||
unsigned char *val = ecore_x_input_device_property_get
|
||||
(dev_slot, prop, &num, &fmt, &size);
|
||||
|
||||
if ((val) && (size == 8) && (num == 1) && (cfval != val[0]))
|
||||
{
|
||||
val[0] = cfval;
|
||||
printf("DEV: change [%s] [%s] -> %i\n", dev, prop, val[0]);
|
||||
ecore_x_input_device_property_set
|
||||
(dev_slot, prop, val, num, fmt, size);
|
||||
}
|
||||
free(val);
|
||||
}
|
||||
// not for now - default
|
||||
// else if (!strcmp(prop, "libinput Accel Profile Enabled"))
|
||||
// {
|
||||
// // 1 bool, 0 = adaptive, 1 = flat
|
||||
// }
|
||||
// do via button mapping for now - not sure about this evdev can't do this
|
||||
// else if (!strcmp(prop, "libinput Left Handed Enabled"))
|
||||
// {
|
||||
|
|
|
@ -875,17 +875,13 @@ _e_comp_xrandr_ecore_x(void)
|
|||
E_API void
|
||||
e_comp_x_randr_config_apply(void)
|
||||
{
|
||||
if (e_randr2_cfg->use_cmd)
|
||||
{
|
||||
if (use_xrandr == -1)
|
||||
{
|
||||
if (ecore_file_app_installed("xrandr")) use_xrandr = 1;
|
||||
else use_xrandr = 0;
|
||||
}
|
||||
}
|
||||
else use_xrandr = 0;
|
||||
if (use_xrandr == 1) _e_comp_xrandr_cmd();
|
||||
else _e_comp_xrandr_ecore_x();
|
||||
if (use_xrandr == -1)
|
||||
{
|
||||
if (ecore_file_app_installed("xrandr")) use_xrandr = 1;
|
||||
else use_xrandr = 0;
|
||||
}
|
||||
if (use_xrandr == 1) _e_comp_xrandr_cmd();
|
||||
else _e_comp_xrandr_ecore_x();
|
||||
}
|
||||
|
||||
E_API Eina_Bool
|
||||
|
|
|
@ -750,7 +750,6 @@ _e_config_edd_init(Eina_Bool old)
|
|||
E_CONFIG_VAL(D, T, winlist_list_size, DOUBLE); /**/
|
||||
E_CONFIG_VAL(D, T, winlist_large_size, DOUBLE); /**/
|
||||
E_CONFIG_VAL(D, T, winlist_list_no_miniatures, UCHAR); /**/
|
||||
E_CONFIG_VAL(D, T, no_state_hidden_desktop, UCHAR); /**/
|
||||
E_CONFIG_VAL(D, T, maximize_policy, INT); /**/
|
||||
E_CONFIG_VAL(D, T, allow_manip, INT); /**/
|
||||
E_CONFIG_VAL(D, T, border_fix_on_shelf_toggle, INT); /**/
|
||||
|
@ -856,10 +855,8 @@ _e_config_edd_init(Eina_Bool old)
|
|||
E_CONFIG_VAL(D, T, mouse_hand, INT);
|
||||
|
||||
E_CONFIG_VAL(D, T, mouse_accel, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, mouse_flat_accel, UCHAR);
|
||||
E_CONFIG_VAL(D, T, mouse_accel_threshold, INT);
|
||||
E_CONFIG_VAL(D, T, mouse_natural_scroll, UCHAR);
|
||||
E_CONFIG_VAL(D, T, mouse_hires_scroll, UCHAR);
|
||||
E_CONFIG_VAL(D, T, mouse_emulate_middle_button, UCHAR);
|
||||
|
||||
E_CONFIG_VAL(D, T, touch_accel, DOUBLE);
|
||||
|
@ -867,7 +864,6 @@ _e_config_edd_init(Eina_Bool old)
|
|||
E_CONFIG_VAL(D, T, touch_emulate_middle_button, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_tap_to_click, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_clickpad, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_flat_accel, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_scrolling_2finger, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_scrolling_edge, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_scrolling_circular, UCHAR);
|
||||
|
@ -1805,14 +1801,6 @@ e_config_load(void)
|
|||
e_config->backlight.ddc = 1;
|
||||
e_config_save_queue();
|
||||
}
|
||||
CONFIG_VERSION_CHECK(36)
|
||||
{
|
||||
CONFIG_VERSION_UPDATE_INFO(36);
|
||||
e_config->mouse_flat_accel = 0;
|
||||
e_config->mouse_hires_scroll = 1;
|
||||
e_config->touch_flat_accel = 0;
|
||||
e_config_save_queue();
|
||||
}
|
||||
}
|
||||
elm_config_profile_set(_e_config_profile);
|
||||
if (!e_config->remember_internal_fm_windows)
|
||||
|
|
|
@ -135,7 +135,6 @@ struct _E_Config
|
|||
double winlist_list_size; // GUI
|
||||
double winlist_large_size; // GUI
|
||||
Eina_Bool winlist_list_no_miniatures; // GUI
|
||||
Eina_Bool no_state_hidden_desktop; // GUI
|
||||
int maximize_policy; // GUI
|
||||
int allow_manip; // GUI
|
||||
int border_fix_on_shelf_toggle; // GUI
|
||||
|
@ -246,15 +245,12 @@ struct _E_Config
|
|||
int mouse_hand; //GUI
|
||||
double mouse_accel; // GUI
|
||||
int mouse_accel_threshold; // GUI
|
||||
unsigned char mouse_flat_accel; // GUI
|
||||
unsigned char mouse_natural_scroll; // GUI
|
||||
unsigned char mouse_hires_scroll; // GUI
|
||||
unsigned char mouse_emulate_middle_button; // GUI
|
||||
|
||||
double touch_accel; // GUI
|
||||
unsigned char touch_natural_scroll; // GUI
|
||||
unsigned char touch_emulate_middle_button; // GUI
|
||||
unsigned char touch_flat_accel; // GUI
|
||||
unsigned char touch_tap_to_click; // GUI
|
||||
unsigned char touch_clickpad; // GUI
|
||||
unsigned char touch_scrolling_2finger; // GUI
|
||||
|
|
|
@ -278,28 +278,6 @@ _desklock_show_internal(Eina_Bool suspend)
|
|||
if (e_config->desklock_language)
|
||||
e_intl_language_set(e_config->desklock_language);
|
||||
|
||||
if ((e_config->xkb.lock_layout) && (e_config->xkb.desklock_layout))
|
||||
{
|
||||
if ((!e_config->xkb.lock_layout->name) ||
|
||||
(!!strcmp(e_config->xkb.lock_layout->name, e_config->xkb.desklock_layout)))
|
||||
{
|
||||
e_config_xkb_layout_free(e_config->xkb.lock_layout);
|
||||
e_config->xkb.lock_layout = NULL;
|
||||
}
|
||||
}
|
||||
if ((e_config->xkb.desklock_layout) && (!e_config->xkb.lock_layout))
|
||||
{
|
||||
E_Config_XKB_Layout *cl;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->xkb.used_layouts, l, cl)
|
||||
{
|
||||
if ((cl->name) && (!strcmp(cl->name, e_config->xkb.desklock_layout)))
|
||||
{
|
||||
e_config->xkb.lock_layout = e_config_xkb_layout_dup(cl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e_config->xkb.lock_layout)
|
||||
e_xkb_layout_set(e_config->xkb.lock_layout);
|
||||
|
||||
|
|
|
@ -599,7 +599,6 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
|
|||
if (startup_id < 0) startup_id = 0;
|
||||
}
|
||||
if (++startup_id < 1) startup_id = 1;
|
||||
e_exehist_startup_id_set(startup_id);
|
||||
snprintf(buf, sizeof(buf), "E_START|%i", startup_id);
|
||||
e_util_env_set("DESKTOP_STARTUP_ID", buf);
|
||||
|
||||
|
|
|
@ -597,11 +597,8 @@ e_hints_window_state_set(E_Client *ec)
|
|||
if (ec->netwm.state.skip_pager)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
||||
}
|
||||
if (!e_config->no_state_hidden_desktop)
|
||||
{
|
||||
if (ec->netwm.state.hidden)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
|
||||
}
|
||||
if (ec->netwm.state.hidden)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
|
||||
if (ec->netwm.state.fullscreen)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
|
||||
|
||||
|
|
|
@ -90,7 +90,6 @@ e_randr2_init(void)
|
|||
E_CONFIG_LIST(D, T, screens, _e_randr2_cfg_screen_edd);
|
||||
E_CONFIG_VAL(D, T, hotplug_response, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, restore, UCHAR);
|
||||
E_CONFIG_VAL(D, T, use_cmd, UCHAR);
|
||||
E_CONFIG_VAL(D, T, ignore_hotplug_events, UCHAR);
|
||||
E_CONFIG_VAL(D, T, ignore_acpi_events, UCHAR);
|
||||
E_CONFIG_VAL(D, T, default_policy, UINT);
|
||||
|
@ -394,7 +393,6 @@ _config_load(void)
|
|||
cfg->version = E_RANDR_CONFIG_VERSION;
|
||||
cfg->screens = NULL;
|
||||
cfg->restore = 1;
|
||||
cfg->use_cmd = 0;
|
||||
cfg->ignore_hotplug_events = 0;
|
||||
cfg->ignore_acpi_events = 0;
|
||||
cfg->default_policy = E_RANDR2_POLICY_EXTEND;
|
||||
|
|
|
@ -102,7 +102,6 @@ struct _E_Config_Randr2
|
|||
unsigned char restore;
|
||||
unsigned char ignore_hotplug_events;
|
||||
unsigned char ignore_acpi_events;
|
||||
unsigned char use_cmd;
|
||||
E_Randr2_Policy default_policy;
|
||||
double hotplug_response;
|
||||
};
|
||||
|
|
|
@ -524,7 +524,6 @@ main(int argc, char **argv)
|
|||
struct sigaction action;
|
||||
pid_t child = -1;
|
||||
Eina_Bool restart = EINA_TRUE;
|
||||
unsigned int provided_eina_version, required_eina_version;
|
||||
|
||||
unsetenv("NOTIFY_SOCKET");
|
||||
|
||||
|
@ -548,58 +547,6 @@ main(int argc, char **argv)
|
|||
|
||||
eina_init();
|
||||
|
||||
/* check eina version ... this should be the whole efl version */
|
||||
/* check for sanity here in case someone has done something very silly */
|
||||
provided_eina_version =
|
||||
(eina_version->major * 1000 * 1000) +
|
||||
(eina_version->minor * 1000 ) +
|
||||
(eina_version->micro);
|
||||
required_eina_version =
|
||||
(MIN_EFL_VERSION_MAJ * 1000 * 1000) +
|
||||
(MIN_EFL_VERSION_MIN * 1000) +
|
||||
(MIN_EFL_VERSION_MIC);
|
||||
printf("Enlightenment: EFL Version Check: %u >= %u\n",
|
||||
provided_eina_version, required_eina_version);
|
||||
if (provided_eina_version < required_eina_version)
|
||||
{
|
||||
char *logf = NULL, *logf_old = NULL;
|
||||
FILE *fps[2];
|
||||
FILE *outf;
|
||||
|
||||
home = getenv("HOME");
|
||||
// rename old olg file
|
||||
if (!home)
|
||||
{
|
||||
myasprintf(&logf, ".e-log.log");
|
||||
myasprintf(&logf_old, ".e-log.log.old");
|
||||
}
|
||||
else
|
||||
{
|
||||
myasprintf(&logf, "%s/.e-log.log", home);
|
||||
myasprintf(&logf_old, "%s/.e-log.log.old", home);
|
||||
}
|
||||
rename(logf, logf_old);
|
||||
outf = fopen(logf, "w");
|
||||
fps[0] = stderr;
|
||||
fps[1] = outf;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (fps[i])
|
||||
fprintf(fps[i],
|
||||
"ERROR: EFL version provided is %i.%i.%i\n"
|
||||
"Enlightenment requires a minimum of %i.%i.%i\n"
|
||||
"Abort\n",
|
||||
eina_version->major,
|
||||
eina_version->minor,
|
||||
eina_version->micro,
|
||||
MIN_EFL_VERSION_MAJ,
|
||||
MIN_EFL_VERSION_MIN,
|
||||
MIN_EFL_VERSION_MIC);
|
||||
}
|
||||
if (outf) fclose(outf);
|
||||
exit(42); // exit 42 for this as life the universe and everything...
|
||||
}
|
||||
|
||||
/* reexcute myself with dbus-launch if dbus-launch is not running yet */
|
||||
if ((!getenv("DBUS_SESSION_BUS_ADDRESS")) &&
|
||||
(!getenv("DBUS_LAUNCHD_SESSION_BUS_SOCKET")))
|
||||
|
|
|
@ -342,7 +342,6 @@ main(int argc,
|
|||
rm = EINA_FALSE;
|
||||
eina_stringshare_del(s);
|
||||
}
|
||||
eina_iterator_free(it);
|
||||
if (rm)
|
||||
{
|
||||
if (rmdir(path))
|
||||
|
|
|
@ -85,33 +85,33 @@ _resolutions_calc(int w, int h)
|
|||
{
|
||||
int i, j = 0;
|
||||
int nw, nh, pw = 0, ph = 0;
|
||||
Mip *mips_ = calloc(1, sizeof(Mip) * MAX_RES_NUM);
|
||||
Mip *mips = calloc(1, sizeof(Mip) * MAX_RES_NUM);
|
||||
|
||||
if (!mips_) return NULL;
|
||||
if (!mips) return NULL;
|
||||
for (i = 0; resolutions[i]; i += 2)
|
||||
{
|
||||
nh = resolutions[i + 1];
|
||||
nw = (w * nh) / h;
|
||||
if ((nh >= h) || (nw >= w))
|
||||
{
|
||||
mips_[j].from_w = pw;
|
||||
mips_[j].from_h = ph;
|
||||
mips_[j].to_w = 1000000000;
|
||||
mips_[j].to_h = 1000000000;
|
||||
mips_[j].last = EINA_TRUE;
|
||||
mips[j].from_w = pw;
|
||||
mips[j].from_h = ph;
|
||||
mips[j].to_w = 1000000000;
|
||||
mips[j].to_h = 1000000000;
|
||||
mips[j].last = EINA_TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
mips_[j].from_w = pw;
|
||||
mips_[j].from_h = ph;
|
||||
mips_[j].to_w = nw;
|
||||
mips_[j].to_h = nh;
|
||||
mips[j].from_w = pw;
|
||||
mips[j].from_h = ph;
|
||||
mips[j].to_w = nw;
|
||||
mips[j].to_h = nh;
|
||||
|
||||
j++;
|
||||
pw = nw + 1;
|
||||
ph = nh + 1;
|
||||
}
|
||||
return mips_;
|
||||
return mips;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
|
@ -123,7 +123,7 @@ elm_main(int argc, char **argv)
|
|||
int bg_b = 64;
|
||||
char dir_buf[128], img_buf[256], edc_buf[256], cmd_buf[1024], qual_buf[64];
|
||||
const char *dir, *quality_string = NULL, *img_name = NULL;
|
||||
Mip *mips_ = NULL;
|
||||
Mip *mips = NULL;
|
||||
int i, imw, imh, w, h, quality;
|
||||
int ret = 0, mips_num = 0;
|
||||
Eina_Bool alpha;
|
||||
|
@ -207,25 +207,25 @@ elm_main(int argc, char **argv)
|
|||
(!strcmp(mode, "scale_out")) ||
|
||||
(!strcmp(mode, "pan")))
|
||||
{ // need to produce multiple scaled versions
|
||||
mips_ = _resolutions_calc(w, h);
|
||||
if (!mips_) return 6;
|
||||
for (i = 0; mips_[i].to_w; i++)
|
||||
mips = _resolutions_calc(w, h);
|
||||
if (!mips) return 6;
|
||||
for (i = 0; mips[i].to_w; i++)
|
||||
{
|
||||
mips_num++;
|
||||
if (mips_[i].last)
|
||||
if (mips[i].last)
|
||||
{
|
||||
imw = w;
|
||||
imh = h;
|
||||
}
|
||||
else
|
||||
{
|
||||
imw = mips_[i].to_w;
|
||||
imh = mips_[i].to_h;
|
||||
imw = mips[i].to_w;
|
||||
imh = mips[i].to_h;
|
||||
}
|
||||
evas_object_resize(subwin, imw, imh);
|
||||
evas_object_resize(image, imw, imh);
|
||||
elm_win_render(subwin);
|
||||
if (mips_[i].last)
|
||||
if (mips[i].last)
|
||||
snprintf(img_buf, sizeof(img_buf), "%s/img.png",
|
||||
dir);
|
||||
else
|
||||
|
@ -239,7 +239,7 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
// no multiple resolutions -0 save out original
|
||||
if (!mips_)
|
||||
if (!mips)
|
||||
{
|
||||
evas_object_resize(subwin, w, h);
|
||||
evas_object_resize(image, w, h);
|
||||
|
@ -267,7 +267,7 @@ elm_main(int argc, char **argv)
|
|||
snprintf(edc_buf, sizeof(edc_buf), "%s/bg.edc", dir);
|
||||
f = fopen(edc_buf, "w");
|
||||
if (!f) goto cleanup;
|
||||
if ((mips_) && (mips_num > 1))
|
||||
if ((mips) && (mips_num > 1))
|
||||
{
|
||||
fprintf(f,
|
||||
"images {\n"
|
||||
|
@ -276,7 +276,7 @@ elm_main(int argc, char **argv)
|
|||
{
|
||||
fprintf(f,
|
||||
" image {\n");
|
||||
if (mips_[i].last)
|
||||
if (mips[i].last)
|
||||
{
|
||||
fprintf(f,
|
||||
" image: \"img.png\" %s;\n",
|
||||
|
@ -284,8 +284,8 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
imw = mips_[i].to_w;
|
||||
imh = mips_[i].to_h;
|
||||
imw = mips[i].to_w;
|
||||
imh = mips[i].to_h;
|
||||
fprintf(f,
|
||||
" image: \"img-%ix%i.png\" %s;\n",
|
||||
imw, imh, quality_string);
|
||||
|
@ -293,8 +293,8 @@ elm_main(int argc, char **argv)
|
|||
fprintf(f,
|
||||
" size: %i %i %i %i;\n"
|
||||
" }\n",
|
||||
mips_[i].from_w, mips_[i].from_h,
|
||||
mips_[i].to_w, mips_[i].to_h);
|
||||
mips[i].from_w, mips[i].from_h,
|
||||
mips[i].to_w, mips[i].to_h);
|
||||
}
|
||||
fprintf(f,
|
||||
" }\n"
|
||||
|
@ -489,7 +489,7 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
ret = system(cmd_buf);
|
||||
cleanup:
|
||||
free(mips_);
|
||||
free(mips);
|
||||
ecore_file_recursive_rm(dir);
|
||||
evas_object_del(win);
|
||||
return ret;
|
||||
|
|
|
@ -304,14 +304,9 @@ err:
|
|||
static Eina_Bool
|
||||
_ddc_init(void)
|
||||
{
|
||||
// .so.[345] are ABI compatible with .so.2 for our uses - see
|
||||
// the changes listed at:
|
||||
// - https://www.ddcutil.com/c_api_99/
|
||||
// - https://www.ddcutil.com/c_api_120/
|
||||
// - https://www.ddcutil.com/c_api_200/
|
||||
ddc_lib = dlopen("libddcutil.so.5", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!ddc_lib)
|
||||
ddc_lib = dlopen("libddcutil.so.4", RTLD_NOW | RTLD_LOCAL);
|
||||
// .so.3 is ABI compatible twith .so.2 for out uses - see
|
||||
// https://www.ddcutil.com/c_api_99/ for changes between them
|
||||
ddc_lib = dlopen("libddcutil.so.4", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!ddc_lib)
|
||||
ddc_lib = dlopen("libddcutil.so.3", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!ddc_lib)
|
||||
|
|
|
@ -947,7 +947,6 @@ e_modapi_init(E_Module *m)
|
|||
E_API int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
E_FREE_LIST(handlers, ecore_event_handler_del);
|
||||
if (act)
|
||||
{
|
||||
e_action_predef_name_del("Clock", "Toggle calendar");
|
||||
|
|
|
@ -10,10 +10,10 @@ struct _E_Config_Dialog_Data
|
|||
{
|
||||
E_Config_Dialog *cfd;
|
||||
|
||||
int show_cursor;
|
||||
int idle_cursor;
|
||||
int use_e_cursor;
|
||||
int cursor_size;
|
||||
int show_cursor;
|
||||
int idle_cursor;
|
||||
int use_e_cursor;
|
||||
int cursor_size;
|
||||
|
||||
struct
|
||||
{
|
||||
|
@ -24,15 +24,12 @@ struct _E_Config_Dialog_Data
|
|||
|
||||
double mouse_accel;
|
||||
double mouse_accel_threshold;
|
||||
int mouse_flat_accel;
|
||||
int mouse_natural_scroll;
|
||||
int mouse_hires_scroll;
|
||||
int mouse_emulate_middle_button;
|
||||
|
||||
double touch_accel;
|
||||
int touch_natural_scroll;
|
||||
int touch_emulate_middle_button;
|
||||
int touch_flat_accel;
|
||||
int touch_tap_to_click;
|
||||
int touch_clickpad;
|
||||
int touch_scrolling_2finger;
|
||||
|
@ -76,15 +73,12 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->mouse_hand = e_config->mouse_hand;
|
||||
|
||||
cfdata->mouse_accel = e_config->mouse_accel;
|
||||
cfdata->mouse_flat_accel = e_config->mouse_flat_accel;
|
||||
cfdata->mouse_accel_threshold = e_config->mouse_accel_threshold;
|
||||
cfdata->mouse_natural_scroll = e_config->mouse_natural_scroll;
|
||||
cfdata->mouse_hires_scroll = e_config->mouse_hires_scroll;
|
||||
cfdata->mouse_emulate_middle_button = e_config->mouse_emulate_middle_button;
|
||||
|
||||
cfdata->touch_accel = e_config->touch_accel;
|
||||
cfdata->touch_natural_scroll = e_config->touch_natural_scroll;
|
||||
cfdata->touch_flat_accel = e_config->touch_flat_accel;
|
||||
cfdata->touch_emulate_middle_button = e_config->touch_emulate_middle_button;
|
||||
cfdata->touch_tap_to_click = e_config->touch_tap_to_click;
|
||||
cfdata->touch_clickpad = e_config->touch_clickpad;
|
||||
|
@ -118,12 +112,9 @@ _basic_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfd
|
|||
EINA_DBL_EQ(cfdata->mouse_accel_threshold, e_config->mouse_accel_threshold) &&
|
||||
(cfdata->mouse_natural_scroll == e_config->mouse_natural_scroll) &&
|
||||
(cfdata->mouse_emulate_middle_button == e_config->mouse_emulate_middle_button) &&
|
||||
(cfdata->mouse_hires_scroll == e_config->mouse_hires_scroll) &&
|
||||
(cfdata->mouse_flat_accel == e_config->mouse_flat_accel) &&
|
||||
EINA_DBL_EQ(cfdata->touch_accel, e_config->touch_accel) &&
|
||||
(cfdata->touch_natural_scroll == e_config->touch_natural_scroll) &&
|
||||
(cfdata->touch_emulate_middle_button == e_config->touch_emulate_middle_button) &&
|
||||
(cfdata->touch_flat_accel == e_config->touch_flat_accel) &&
|
||||
(cfdata->touch_tap_to_click == e_config->touch_tap_to_click) &&
|
||||
(cfdata->touch_clickpad == e_config->touch_clickpad) &&
|
||||
(cfdata->touch_scrolling_2finger == e_config->touch_scrolling_2finger) &&
|
||||
|
@ -153,14 +144,11 @@ _basic_apply_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata
|
|||
|
||||
e_config->mouse_accel = cfdata->mouse_accel;
|
||||
e_config->mouse_accel_threshold = cfdata->mouse_accel_threshold;
|
||||
e_config->mouse_flat_accel = cfdata->mouse_flat_accel;
|
||||
e_config->mouse_hires_scroll = cfdata->mouse_hires_scroll;
|
||||
e_config->mouse_natural_scroll = cfdata->mouse_natural_scroll;
|
||||
e_config->mouse_emulate_middle_button = cfdata->mouse_emulate_middle_button;
|
||||
|
||||
e_config->touch_accel = cfdata->touch_accel;
|
||||
e_config->touch_natural_scroll = cfdata->touch_natural_scroll;
|
||||
e_config->touch_flat_accel = cfdata->touch_flat_accel;
|
||||
e_config->touch_emulate_middle_button = cfdata->touch_emulate_middle_button;
|
||||
e_config->touch_tap_to_click = cfdata->touch_tap_to_click;
|
||||
e_config->touch_clickpad = cfdata->touch_clickpad;
|
||||
|
@ -267,8 +255,6 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dia
|
|||
e_widget_list_object_append(ol, of, 1, 0, 0.5);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Acceleration"), 0);
|
||||
ob = e_widget_check_add(evas, _("Flat acceleration"), &(cfdata->mouse_flat_accel));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f"), -1.0, 1.0, 0.1, 0,
|
||||
&(cfdata->mouse_accel), NULL, 100);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
@ -292,8 +278,6 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dia
|
|||
|
||||
oc = e_widget_check_add(evas, _("Natural scrolling"), &(cfdata->mouse_natural_scroll));
|
||||
e_widget_framelist_object_append(of, oc);
|
||||
oc = e_widget_check_add(evas, _("Hi-Res scrolling"), &(cfdata->mouse_hires_scroll));
|
||||
e_widget_framelist_object_append(of, oc);
|
||||
|
||||
e_widget_list_object_append(ol, of, 1, 0, 0.5);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Mouse"), ol,
|
||||
|
@ -305,8 +289,6 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dia
|
|||
|
||||
of = e_widget_framelist_add(evas, _("Acceleration"), 0);
|
||||
|
||||
ob = e_widget_check_add(evas, _("Flat acceleration"), &(cfdata->touch_flat_accel));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f"), -1.0, 1.0, 0.1, 0,
|
||||
&(cfdata->touch_accel), NULL, 100);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
|
|
@ -439,7 +439,7 @@ _change_hash_apply_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *
|
|||
|
||||
imc = data;
|
||||
|
||||
if (ecore_file_exists(key) && ecore_file_can_write(key))
|
||||
if (ecore_file_exists(key))
|
||||
{
|
||||
ef = eet_open(key, EET_FILE_MODE_WRITE);
|
||||
if (ef)
|
||||
|
|
|
@ -140,7 +140,7 @@ const E_Intl_Pair basic_language_predefined_pairs[] = {
|
|||
{"sl_SI.UTF-8", "si_flag.png", "Slovenščina"},
|
||||
{"sv_SE.UTF-8", "se_flag.png", "Svenska"},
|
||||
{"tr_TR.UTF-8", "tr_flag.png", "Türkçe"},
|
||||
{"uk_UA.UTF-8", "ua_flag.png", "Українська мова"},
|
||||
{"uk_UK.UTF-8", "ua_flag.png", "Українська мова"},
|
||||
{"vi_VN UTF-8", "vn_flag.png", "Tiếng Việt"},
|
||||
{"zh_CN.UTF-8", "cn_flag.png", "中文 (简体)"},
|
||||
{"zh_TW.UTF-8", "tw_flag.png", "中文 (繁體)"},
|
||||
|
|
|
@ -30,7 +30,6 @@ struct _E_Config_Dialog_Data
|
|||
Evas_Object *scale_value_obj;
|
||||
Evas_Object *policy_obj;
|
||||
int restore;
|
||||
int use_cmd;
|
||||
int hotplug;
|
||||
int acpi;
|
||||
int screen;
|
||||
|
@ -104,7 +103,6 @@ _create_data(E_Config_Dialog *cfd EINA_UNUSED)
|
|||
if (!(cfdata = E_NEW(E_Config_Dialog_Data, 1))) return NULL;
|
||||
if (cfd->data) cfdata->params = strdup(cfd->data);
|
||||
cfdata->restore = e_randr2_cfg->restore;
|
||||
cfdata->use_cmd = e_randr2_cfg->use_cmd;
|
||||
cfdata->hotplug = !e_randr2_cfg->ignore_hotplug_events;
|
||||
cfdata->acpi = !e_randr2_cfg->ignore_acpi_events;
|
||||
cfdata->policy = e_randr2_cfg->default_policy;
|
||||
|
@ -149,14 +147,6 @@ _cb_restore_changed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_U
|
|||
e_config_dialog_changed_set(cfdata->cfd, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_use_cmd_changed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
|
||||
{
|
||||
E_Config_Dialog_Data *cfdata = data;
|
||||
cfdata->use_cmd = elm_check_state_get(obj);
|
||||
e_config_dialog_changed_set(cfdata->cfd, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_hotplug_changed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
|
||||
{
|
||||
|
@ -1189,7 +1179,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas EINA_UNUSED, E_Config_Dialog_Data
|
|||
o = elm_check_add(win);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_text_set(o, _("Restore on start"));
|
||||
elm_object_text_set(o, _("Restore setup on start"));
|
||||
elm_check_state_set(o, cfdata->restore);
|
||||
elm_box_pack_end(bx2, o);
|
||||
evas_object_show(o);
|
||||
|
@ -1198,16 +1188,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas EINA_UNUSED, E_Config_Dialog_Data
|
|||
o = elm_check_add(win);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_text_set(o, _("Use command"));
|
||||
elm_check_state_set(o, cfdata->use_cmd);
|
||||
elm_box_pack_end(bx2, o);
|
||||
evas_object_show(o);
|
||||
evas_object_smart_callback_add(o, "changed", _cb_use_cmd_changed, cfdata);
|
||||
|
||||
o = elm_check_add(win);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_text_set(o, _("Hotplug"));
|
||||
elm_object_text_set(o, _("Monitor hotplug"));
|
||||
elm_check_state_set(o, cfdata->hotplug);
|
||||
elm_box_pack_end(bx2, o);
|
||||
evas_object_show(o);
|
||||
|
@ -1248,7 +1229,6 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
|||
E_Config_Randr2_Screen *cs, *cs2;
|
||||
|
||||
e_randr2_cfg->restore = cfdata->restore;
|
||||
e_randr2_cfg->use_cmd = cfdata->use_cmd;
|
||||
e_randr2_cfg->ignore_hotplug_events = !cfdata->hotplug;
|
||||
e_randr2_cfg->ignore_acpi_events = !cfdata->acpi;
|
||||
e_randr2_cfg->default_policy = cfdata->policy;
|
||||
|
|
|
@ -41,8 +41,7 @@ struct _E_Config_Dialog_Data
|
|||
int maximize_direction;
|
||||
int maximized_allow_manip;
|
||||
int border_fix_on_shelf_toggle;
|
||||
int allow_above_fullscreen;
|
||||
int state_hidden_desktop;
|
||||
int allow_above_fullscreen;
|
||||
};
|
||||
|
||||
E_Config_Dialog *
|
||||
|
@ -91,7 +90,6 @@ _create_data(E_Config_Dialog *cfd EINA_UNUSED)
|
|||
cfdata->transient.iconify = e_config->transient.iconify;
|
||||
cfdata->maximize_policy = (e_config->maximize_policy & E_MAXIMIZE_TYPE);
|
||||
cfdata->allow_above_fullscreen = e_config->allow_above_fullscreen;
|
||||
cfdata->state_hidden_desktop = ! e_config->no_state_hidden_desktop;
|
||||
if (cfdata->maximize_policy == E_MAXIMIZE_NONE)
|
||||
cfdata->maximize_policy = E_MAXIMIZE_FULLSCREEN;
|
||||
cfdata->maximize_direction =
|
||||
|
@ -135,7 +133,6 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
|||
e_config->allow_manip = cfdata->maximized_allow_manip;
|
||||
e_config->border_fix_on_shelf_toggle = cfdata->border_fix_on_shelf_toggle;
|
||||
e_config->allow_above_fullscreen = cfdata->allow_above_fullscreen;
|
||||
e_config->no_state_hidden_desktop = !cfdata->state_hidden_desktop;
|
||||
e_config_save_queue();
|
||||
return 1; /* Apply was OK */
|
||||
}
|
||||
|
@ -144,16 +141,16 @@ static int
|
|||
_basic_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
return ((e_config->use_resist != cfdata->use_resist) ||
|
||||
(e_config->desk_resist != cfdata->desk_resist) ||
|
||||
(e_config->window_resist != cfdata->window_resist) ||
|
||||
(e_config->gadget_resist != cfdata->gadget_resist) ||
|
||||
(e_config->geometry_auto_resize_limit != cfdata->geometry_auto_resize_limit) ||
|
||||
(e_config->desk_resist != cfdata->desk_resist) ||
|
||||
(e_config->window_resist != cfdata->window_resist) ||
|
||||
(e_config->gadget_resist != cfdata->gadget_resist) ||
|
||||
(e_config->geometry_auto_resize_limit != cfdata->geometry_auto_resize_limit) ||
|
||||
(e_config->geometry_auto_move != cfdata->geometry_auto_move) ||
|
||||
(!EINA_DBL_EQ(e_config->border_keyboard.timeout, cfdata->border_keyboard.timeout)) ||
|
||||
(e_config->border_keyboard.move.dx != cfdata->border_keyboard.move.dx) ||
|
||||
(e_config->border_keyboard.move.dy != cfdata->border_keyboard.move.dx) ||
|
||||
(e_config->border_keyboard.resize.dx != cfdata->border_keyboard.resize.dx) ||
|
||||
(e_config->border_keyboard.resize.dy != cfdata->border_keyboard.resize.dx) ||
|
||||
(!EINA_DBL_EQ(e_config->border_keyboard.timeout, cfdata->border_keyboard.timeout)) ||
|
||||
(e_config->border_keyboard.move.dx != cfdata->border_keyboard.move.dx) ||
|
||||
(e_config->border_keyboard.move.dy != cfdata->border_keyboard.move.dx) ||
|
||||
(e_config->border_keyboard.resize.dx != cfdata->border_keyboard.resize.dx) ||
|
||||
(e_config->border_keyboard.resize.dy != cfdata->border_keyboard.resize.dx) ||
|
||||
(e_config->transient.move != cfdata->transient.move) ||
|
||||
(e_config->transient.resize != cfdata->transient.resize) ||
|
||||
(e_config->transient.raise != cfdata->transient.raise) ||
|
||||
|
@ -164,9 +161,7 @@ _basic_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfd
|
|||
(e_config->maximize_policy != (cfdata->maximize_policy | cfdata->maximize_direction)) ||
|
||||
(e_config->allow_manip != cfdata->maximized_allow_manip) ||
|
||||
(e_config->border_fix_on_shelf_toggle != cfdata->border_fix_on_shelf_toggle) ||
|
||||
(e_config->allow_above_fullscreen != cfdata->allow_above_fullscreen) ||
|
||||
(e_config->no_state_hidden_desktop == cfdata->state_hidden_desktop)
|
||||
);
|
||||
(e_config->allow_above_fullscreen != cfdata->allow_above_fullscreen));
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
|
@ -272,9 +267,6 @@ _basic_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data
|
|||
ow = e_widget_check_add(evas, _("Adjust windows on shelf hide"),
|
||||
&(cfdata->border_fix_on_shelf_toggle));
|
||||
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
||||
ow = e_widget_check_add(evas, _("Set hidden state when not on current desktop"),
|
||||
&(cfdata->state_hidden_desktop));
|
||||
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Automatic"), ol,
|
||||
1, 1, 1, 0, 0.0, 0.0);
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 01/05/19.
|
||||
//
|
||||
|
||||
#ifndef E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H
|
||||
#define E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H
|
||||
|
||||
// Those costants are the possible states for the orientation of the accelerometer.
|
||||
|
||||
#define ACCELEROMETER_ORIENTATION_UNDEFINED "undefined"
|
||||
#define ACCELEROMETER_ORIENTATION_NORMAL "normal"
|
||||
#define ACCELEROMETER_ORIENTATION_LEFT "left-up"
|
||||
#define ACCELEROMETER_ORIENTATION_RIGHT "right-up"
|
||||
#define ACCELEROMETER_ORIENTATION_BOTTOM "bottom-up"
|
||||
|
||||
#endif //E_GADGET_CONVERTIBLE_IIO_SENSOR_ACCELEROMETER_H
|
|
@ -1,22 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 29/05/19.
|
||||
//
|
||||
|
||||
#ifndef E_GADGET_CONVERTIBLE_CONVERTIBLE_LOGGING_H
|
||||
#define E_GADGET_CONVERTIBLE_CONVERTIBLE_LOGGING_H
|
||||
|
||||
#undef CRIT
|
||||
#undef ERR
|
||||
#undef WARN
|
||||
#undef INF
|
||||
#undef DBG
|
||||
|
||||
extern int _convertible_log_dom;
|
||||
#define CRIT(...) EINA_LOG_DOM_CRIT(_convertible_log_dom, __VA_ARGS__)
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_convertible_log_dom, __VA_ARGS__)
|
||||
#define WARN(...) EINA_LOG_DOM_WARN(_convertible_log_dom, __VA_ARGS__)
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_convertible_log_dom, __VA_ARGS__)
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_convertible_log_dom, __VA_ARGS__)
|
||||
|
||||
|
||||
#endif //E_GADGET_CONVERTIBLE_CONVERTIBLE_LOGGING_H
|
|
@ -1,495 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 01/05/19.
|
||||
//
|
||||
//#include <Ecore_X.h>
|
||||
#include "convertible_logging.h"
|
||||
#include "accelerometer-orientation.h"
|
||||
#include "dbus_acceleration.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "input_rotation.h"
|
||||
|
||||
static DbusAccelerometer* accelerometer_dbus;
|
||||
|
||||
|
||||
static int
|
||||
_convertible_rotation_get(const screen_rotation orientation)
|
||||
{
|
||||
switch (orientation)
|
||||
{
|
||||
case NORMAL: return 0;
|
||||
case LEFT_UP: return 90;
|
||||
case FLIPPED: return 180;
|
||||
case RIGHT_UP: return 270;
|
||||
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static const float *
|
||||
_get_matrix_rotation_transformation(int rotation)
|
||||
{
|
||||
const float *transformation;
|
||||
switch (rotation) {
|
||||
case 90:
|
||||
transformation = MATRIX_ROTATION_90;
|
||||
break;
|
||||
case 180:
|
||||
transformation = MATRIX_ROTATION_180;
|
||||
break;
|
||||
case 270:
|
||||
transformation = MATRIX_ROTATION_270;
|
||||
break;
|
||||
default:
|
||||
transformation = MATRIX_ROTATION_IDENTITY;
|
||||
}
|
||||
return transformation;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
_is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator)
|
||||
{
|
||||
// Looking for a device with either a libinput property for calibration or the old evdev Axlis labels property.
|
||||
int is_correct_device = EINA_FALSE;
|
||||
for (int i = 0; i < num_properties; i++)
|
||||
{
|
||||
if (strstr(*iterator, "libinput Calibration Matrix"))
|
||||
is_correct_device = EINA_TRUE;
|
||||
if (strstr(*iterator, "Axis Labels"))
|
||||
{
|
||||
int num_ret, unit_size_ret;
|
||||
Ecore_X_Atom format_ret;
|
||||
char *result = ecore_x_input_device_property_get(dev_counter, *iterator, &num_ret, &format_ret, &unit_size_ret);
|
||||
if (result) {
|
||||
// TODO Shall check for the value "Abs MT Position"
|
||||
}
|
||||
DBG("Looks like I found a device with calibration capabilities");
|
||||
is_correct_device = EINA_TRUE;
|
||||
free(result);
|
||||
}
|
||||
iterator++;
|
||||
}
|
||||
return is_correct_device;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
_fetch_X_device_input_number(void)
|
||||
{
|
||||
// I should get the touchscreen associated with the screen probably by looking at the classes of the input devices
|
||||
// I need to submit my patch to add getters for other XIDeviceInfo fields, like raster mentioned in his commit.
|
||||
const char *dev_name;
|
||||
char **property_name;
|
||||
int dev_num = ecore_x_input_device_num_get();
|
||||
int dev_number = -1;
|
||||
|
||||
for (int dev_counter = 0; dev_counter < dev_num; dev_counter++)
|
||||
{
|
||||
dev_name = ecore_x_input_device_name_get(dev_counter);
|
||||
// Less horrible hack that relies on the presence of a property containing the work Calibration
|
||||
DBG("Found device with name %s", dev_name);
|
||||
int num_properties;
|
||||
property_name = ecore_x_input_device_properties_list(dev_counter, &num_properties);
|
||||
DBG("Found %d properties", num_properties);
|
||||
char **iterator = property_name;
|
||||
int is_correct_device = _is_device_a_touch_pointer(dev_counter, num_properties, iterator);
|
||||
if (is_correct_device == EINA_FALSE)
|
||||
continue;
|
||||
iterator = property_name;
|
||||
for (int i = 0; i < num_properties; i++)
|
||||
{
|
||||
if (!strcmp(*iterator, CTM_name))
|
||||
{
|
||||
dev_number = dev_counter;
|
||||
DBG("Setting device: %d", dev_number);
|
||||
break;
|
||||
}
|
||||
iterator++;
|
||||
}
|
||||
}
|
||||
|
||||
return dev_number;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch a screen from its ID and rotate it according to the rotation parameter
|
||||
* @param randr_id The randr2 id
|
||||
* @param rotation The expected rotation
|
||||
*/
|
||||
static void
|
||||
_fetch_and_rotate_screen(const char* randr_id, screen_rotation orientation)
|
||||
{
|
||||
DBG("Working on screen %s", randr_id);
|
||||
E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id);
|
||||
if (rotatable_screen == NULL)
|
||||
{
|
||||
DBG("Failed to load screen for id %s", randr_id);
|
||||
return;
|
||||
}
|
||||
|
||||
E_Config_Randr2_Screen *screen_randr_cfg = e_randr2_config_screen_find(rotatable_screen, e_randr2_cfg);
|
||||
if (screen_randr_cfg == NULL)
|
||||
{
|
||||
DBG("Failed to load screen configuration for id %s", randr_id);
|
||||
return;
|
||||
}
|
||||
int rotation = _convertible_rotation_get(orientation);
|
||||
DBG("Screen %s is going to be rotated to %d", randr_id, rotation);
|
||||
|
||||
if (rotation == screen_randr_cfg->rotation)
|
||||
{
|
||||
WARN("Screen %s is already rotated to %d degrees", randr_id, rotation);
|
||||
} else {
|
||||
screen_randr_cfg->rotation = rotation;
|
||||
e_randr2_config_apply();
|
||||
DBG("Screen %s rotated to %d", randr_id, rotation);
|
||||
|
||||
int x_dev_num = _fetch_X_device_input_number();
|
||||
if (x_dev_num == -1) {
|
||||
ERR("Unable to find a pointer device with coordinate transformation capabilities");
|
||||
return;
|
||||
}
|
||||
DBG("Rotating input number %d", x_dev_num);
|
||||
|
||||
int num_ret, unit_size_ret;
|
||||
Ecore_X_Atom format_ret;
|
||||
char *result = NULL;
|
||||
TransformationMatrix *matrix = calloc(1, sizeof(TransformationMatrix));
|
||||
if (matrix == NULL)
|
||||
{
|
||||
ERR("Unable to allocate memory for the transformation matrix");
|
||||
return;
|
||||
}
|
||||
|
||||
result = ecore_x_input_device_property_get(x_dev_num, CTM_name, &num_ret, &format_ret, &unit_size_ret);
|
||||
if (result)
|
||||
{
|
||||
DBG("Device with coordinates transformation matrix");
|
||||
// format_ret of 116 -> ECORE_X_ATOM_FLOAT
|
||||
// num_ret of 9 -> 9 (float) to read
|
||||
// unit_size_ret of 32 -> each float is 32 bits
|
||||
memcpy(matrix->values, result, sizeof(matrix->values));
|
||||
const float * rotation_matrix_2d = _get_matrix_rotation_transformation(rotation);
|
||||
memcpy(matrix->values, rotation_matrix_2d, 6 * sizeof(*rotation_matrix_2d));
|
||||
ecore_x_input_device_property_set(x_dev_num, CTM_name, matrix->values, num_ret, format_ret, unit_size_ret);
|
||||
|
||||
DBG("Input device %d rotated to %d", x_dev_num, rotation);
|
||||
} else {
|
||||
ERR("Unable to fetch coordinates transformation matrix for device %d", x_dev_num);
|
||||
}
|
||||
free(result);
|
||||
free(matrix);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get the interface
|
||||
* */
|
||||
static Eldbus_Proxy *
|
||||
_get_dbus_interface(const char *IFACE)
|
||||
{
|
||||
DBG("Working on interface: %s", IFACE);
|
||||
Eldbus_Connection *conn;
|
||||
Eldbus_Object *obj;
|
||||
Eldbus_Proxy *sensor_proxy;
|
||||
|
||||
conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
|
||||
if (!conn)
|
||||
{
|
||||
ERR("Error: could not get system bus");
|
||||
return NULL;
|
||||
}
|
||||
obj = eldbus_object_get(conn, EFL_DBUS_ACC_BUS, EFL_DBUS_ACC_PATH);
|
||||
if (!obj)
|
||||
{
|
||||
ERR("Error: could not get object");
|
||||
return NULL;
|
||||
}
|
||||
sensor_proxy = eldbus_proxy_get(obj, IFACE);
|
||||
if (!sensor_proxy)
|
||||
{
|
||||
ERR("Error: could not get proxy for interface %s", IFACE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sensor_proxy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to extract ta boolean property from the message
|
||||
* @param msg The message coming from the get property invocation
|
||||
* @param variant
|
||||
* @param boolean_property_value The boolean property pointer where the value should be stored, if read
|
||||
* @return
|
||||
*/
|
||||
static Eina_Bool
|
||||
_access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value)
|
||||
{
|
||||
char *type;
|
||||
Eina_Bool res = EINA_TRUE;
|
||||
|
||||
if (!eldbus_message_arguments_get(msg, "v", variant))
|
||||
{
|
||||
WARN("Error getting arguments.");
|
||||
res = EINA_FALSE;
|
||||
}
|
||||
type = eldbus_message_iter_signature_get((*variant));
|
||||
if (type == NULL)
|
||||
{
|
||||
WARN("Unable to get the type.");
|
||||
res = EINA_FALSE;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (type[0] != 'b')
|
||||
{
|
||||
WARN("Expected type is int.");
|
||||
res = EINA_FALSE;
|
||||
free(type);
|
||||
return res;
|
||||
}
|
||||
if (type[1])
|
||||
{
|
||||
WARN("It is a complex type, not handle yet.");
|
||||
res = EINA_FALSE;
|
||||
}
|
||||
|
||||
if (!eldbus_message_iter_arguments_get((*variant), "b", boolean_property_value))
|
||||
{
|
||||
WARN("error in eldbus_message_iter_arguments_get()");
|
||||
res = EINA_FALSE;
|
||||
}
|
||||
free(type);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS
|
||||
* interface net.hadess.SensorProxy
|
||||
* @param data not used
|
||||
* @param msg The message
|
||||
* @param pending
|
||||
*/
|
||||
static void
|
||||
_on_accelerometer_released(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
|
||||
{
|
||||
const char *errname, *errmsg;
|
||||
|
||||
INF("Going to release the accelerometer_dbus");
|
||||
if (eldbus_message_error_get(msg, &errname, &errmsg))
|
||||
{
|
||||
ERR("Error: %s %s", errname, errmsg);
|
||||
return;
|
||||
}
|
||||
INF("Accelerometer released");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Callback definition to handle the execution of the ClaimAccelerometer() method of DBUS
|
||||
* interface net.hadess.SensorProxy
|
||||
* @param data not used
|
||||
* @param msg The message
|
||||
* @param pending
|
||||
*/
|
||||
static void
|
||||
_on_accelerometer_claimed(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
|
||||
{
|
||||
const char *errname, *errmsg;
|
||||
|
||||
INF("Going to claim the accelerometer_dbus");
|
||||
if (eldbus_message_error_get(msg, &errname, &errmsg))
|
||||
{
|
||||
ERR("Error: %s %s", errname, errmsg);
|
||||
return;
|
||||
}
|
||||
INF("Accelerometer claimed");
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback definition to handle the request of the hasAccelerometer property of DBUS interface net.hadess.SensorProxy
|
||||
* @param data DbusAccelerometer
|
||||
* @param msg The message
|
||||
* @param pending
|
||||
*/
|
||||
static void
|
||||
_on_has_accelerometer(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
|
||||
{
|
||||
const char *errname, *errmsg;
|
||||
Eina_Bool has_accelerometer = EINA_FALSE;
|
||||
Eldbus_Message_Iter *variant = NULL;
|
||||
|
||||
if (eldbus_message_error_get(msg, &errname, &errmsg))
|
||||
{
|
||||
ERR("Error: %s %s", errname, errmsg);
|
||||
}
|
||||
|
||||
_access_bool_property(msg, &variant, &has_accelerometer);
|
||||
DbusAccelerometer *accelerometer = data;
|
||||
accelerometer->has_accelerometer = has_accelerometer;
|
||||
DBG("Has Accelerometer: %d", accelerometer->has_accelerometer);
|
||||
}
|
||||
|
||||
|
||||
DbusAccelerometer*
|
||||
sensor_proxy_init(void)
|
||||
{
|
||||
// Initialise DBUS component
|
||||
if (accelerometer_dbus)
|
||||
{
|
||||
INF("We already have a struct filled");
|
||||
return accelerometer_dbus;
|
||||
}
|
||||
accelerometer_dbus = calloc(1, sizeof(DbusAccelerometer));
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(accelerometer_dbus, NULL);
|
||||
|
||||
// The next line is probably redundant
|
||||
accelerometer_dbus->orientation = UNDEFINED;
|
||||
|
||||
INF("Getting dbus interfaces");
|
||||
accelerometer_dbus->sensor_proxy = _get_dbus_interface(EFL_DBUS_ACC_IFACE);
|
||||
accelerometer_dbus->sensor_proxy_properties = _get_dbus_interface(ELDBUS_FDO_INTERFACE_PROPERTIES);
|
||||
if (accelerometer_dbus->sensor_proxy == NULL)
|
||||
{
|
||||
ERR("Unable to get the proxy for interface %s", EFL_DBUS_ACC_IFACE);
|
||||
return accelerometer_dbus;
|
||||
}
|
||||
|
||||
accelerometer_dbus->pending_has_orientation = eldbus_proxy_property_get(accelerometer_dbus->sensor_proxy,
|
||||
"HasAccelerometer", _on_has_accelerometer,
|
||||
accelerometer_dbus);
|
||||
if (!accelerometer_dbus->pending_has_orientation)
|
||||
{
|
||||
ERR("Error: could not get property HasAccelerometer");
|
||||
}
|
||||
|
||||
// Claim the accelerometer_dbus
|
||||
accelerometer_dbus->pending_acc_claim = eldbus_proxy_call(accelerometer_dbus->sensor_proxy, "ClaimAccelerometer",
|
||||
_on_accelerometer_claimed, accelerometer_dbus, -1, "");
|
||||
|
||||
if (!accelerometer_dbus->pending_acc_claim)
|
||||
{
|
||||
ERR("Error: could not call ClaimAccelerometer");
|
||||
}
|
||||
|
||||
return accelerometer_dbus;
|
||||
}
|
||||
|
||||
void
|
||||
sensor_proxy_shutdown(void)
|
||||
{
|
||||
INF("Removing signal handler dbus_property_changed_sh");
|
||||
eldbus_signal_handler_del(accelerometer_dbus->dbus_property_changed_sh);
|
||||
|
||||
// TODO Should to this and wait for the release before continuing
|
||||
INF("Freeing convertible resources");
|
||||
accelerometer_dbus->pending_acc_crelease = eldbus_proxy_call(accelerometer_dbus->sensor_proxy, "ReleaseAccelerometer", _on_accelerometer_released, accelerometer_dbus, -1, "");
|
||||
if (accelerometer_dbus)
|
||||
{
|
||||
e_object_del(E_OBJECT(accelerometer_dbus));
|
||||
free(accelerometer_dbus);
|
||||
accelerometer_dbus = NULL;
|
||||
}
|
||||
|
||||
DBG("Shutting down ELDBUS");
|
||||
eldbus_shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to extract ta string property from the message
|
||||
* @param msg The message coming from the get property invocation
|
||||
* @param variant
|
||||
* @return Enum specifying the orientation. UNDEFINED by default
|
||||
*/
|
||||
static screen_rotation
|
||||
_access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant)
|
||||
{
|
||||
screen_rotation rotation = UNDEFINED;
|
||||
char *type = NULL;
|
||||
|
||||
if (!eldbus_message_arguments_get(msg, "v", variant))
|
||||
{
|
||||
WARN("Error getting arguments.");
|
||||
}
|
||||
type = eldbus_message_iter_signature_get((*variant));
|
||||
if (type == NULL)
|
||||
{
|
||||
WARN("Unable to get the type.");
|
||||
return rotation;
|
||||
}
|
||||
if (type[0] != 's')
|
||||
{
|
||||
WARN("Expected type is string(s).");
|
||||
free(type);
|
||||
return rotation;
|
||||
}
|
||||
if (type[1])
|
||||
{
|
||||
WARN("It is a complex type, not handle yet.");
|
||||
}
|
||||
|
||||
const char *string_property_value;
|
||||
if (!eldbus_message_iter_arguments_get(*variant, "s", &string_property_value))
|
||||
{
|
||||
WARN("error in eldbus_message_iter_arguments_get()");
|
||||
}
|
||||
|
||||
if (strcmp(ACCELEROMETER_ORIENTATION_RIGHT, string_property_value) == 0)
|
||||
rotation = RIGHT_UP;
|
||||
if (strcmp(ACCELEROMETER_ORIENTATION_LEFT, string_property_value) == 0)
|
||||
rotation = LEFT_UP;
|
||||
if (strcmp(ACCELEROMETER_ORIENTATION_BOTTOM, string_property_value) == 0)
|
||||
rotation = FLIPPED;
|
||||
if (strcmp(ACCELEROMETER_ORIENTATION_NORMAL, string_property_value) == 0)
|
||||
rotation = NORMAL;
|
||||
|
||||
free(type);
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void
|
||||
on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
|
||||
{
|
||||
INF("New orientation received");
|
||||
Instance *inst = data;
|
||||
|
||||
if (inst->locked_position == EINA_TRUE)
|
||||
{
|
||||
WARN("Locked position. Ignoring rotation");
|
||||
return;
|
||||
}
|
||||
|
||||
const char *errname, *errmsg;
|
||||
screen_rotation orientation;
|
||||
Eldbus_Message_Iter *variant = NULL;
|
||||
|
||||
if (eldbus_message_error_get(msg, &errname, &errmsg))
|
||||
{
|
||||
ERR("Error: %s %s", errname, errmsg);
|
||||
return;
|
||||
}
|
||||
|
||||
orientation = _access_string_property(msg, &variant);
|
||||
if (orientation == UNDEFINED)
|
||||
{
|
||||
INF("Failed to retrieve the orientation from dbus message");
|
||||
return;
|
||||
}
|
||||
|
||||
inst->accelerometer->orientation = orientation;
|
||||
DBG("Current Orientation: %d", inst->accelerometer->orientation);
|
||||
|
||||
if (inst->randr2_ids == NULL)
|
||||
ERR("Screen not set.");
|
||||
else
|
||||
{
|
||||
Eina_List *l;
|
||||
char *randr_id = NULL;
|
||||
EINA_LIST_FOREACH(inst->randr2_ids, l, randr_id)
|
||||
{
|
||||
_fetch_and_rotate_screen(randr_id, orientation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
#include <Ecore.h>
|
||||
#include <Elementary.h>
|
||||
#include <e.h>
|
||||
|
||||
#ifndef EFL_DBUS_ACCELERATION
|
||||
#define EFL_DBUS_ACCELERATION
|
||||
|
||||
#define EFL_DBUS_ACC_BUS "net.hadess.SensorProxy"
|
||||
#define EFL_DBUS_ACC_PATH "/net/hadess/SensorProxy"
|
||||
#define EFL_DBUS_ACC_IFACE "net.hadess.SensorProxy"
|
||||
|
||||
// This enum represents the 4 states of screen rotation plus UNDEFINED
|
||||
typedef enum {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP} screen_rotation;
|
||||
|
||||
typedef struct _DbusAccelerometer DbusAccelerometer;
|
||||
|
||||
struct _DbusAccelerometer
|
||||
{
|
||||
Eina_Bool has_accelerometer;
|
||||
screen_rotation orientation;
|
||||
Eldbus_Proxy *sensor_proxy, *sensor_proxy_properties;
|
||||
Eldbus_Pending *pending_has_orientation, *pending_orientation, *pending_acc_claim, *pending_acc_crelease;
|
||||
Eldbus_Signal_Handler *dbus_property_changed_sh;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch the DBUS interfaces and fill the DbusAccelerometer struct
|
||||
* */
|
||||
DbusAccelerometer* sensor_proxy_init(void);
|
||||
|
||||
|
||||
void sensor_proxy_shutdown(void);
|
||||
|
||||
void
|
||||
on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED);
|
||||
|
||||
/**
|
||||
* Callback definition to handle the request of the accelerometer property of DBUS interface net.hadess.SensorProxy
|
||||
* @param data DbusAccelerometer
|
||||
* @param msg The message
|
||||
* @param pending
|
||||
*/
|
||||
void
|
||||
on_accelerometer_orientation(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED);
|
||||
#endif
|
|
@ -1,56 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 04/05/19.
|
||||
//
|
||||
#include "convertible_logging.h"
|
||||
#include "e-gadget-convertible.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
|
||||
static void
|
||||
_update_instances(const Instance *current_instance)
|
||||
{
|
||||
Eina_List *l;
|
||||
Instance *instance;
|
||||
EINA_LIST_FOREACH(instances, l, instance)
|
||||
{
|
||||
if (current_instance != instance)
|
||||
{
|
||||
instance->locked_position = current_instance->locked_position;
|
||||
if (instance->locked_position == EINA_TRUE)
|
||||
edje_object_signal_emit(instance->o_button, "e,lock,rotation,icon", "convertible/tablet");
|
||||
else
|
||||
edje_object_signal_emit(instance->o_button, "e,unlock,rotation,icon", "convertible/tablet");
|
||||
|
||||
instance->disabled_keyboard = current_instance->disabled_keyboard;
|
||||
if (instance->disabled_keyboard == EINA_TRUE)
|
||||
edje_object_signal_emit(instance->o_button, "e,disable,keyboard,icon", "convertible/input");
|
||||
else
|
||||
edje_object_signal_emit(instance->o_button, "e,enable,keyboard,icon", "convertible/input");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED,
|
||||
const char *src EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
if (eina_str_has_prefix(sig, "e,unlock"))
|
||||
inst->locked_position = EINA_FALSE;
|
||||
if (eina_str_has_prefix(sig, "e,lock"))
|
||||
inst->locked_position = EINA_TRUE;
|
||||
_update_instances(inst);
|
||||
}
|
||||
|
||||
void
|
||||
_keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED,
|
||||
const char *src EINA_UNUSED)
|
||||
{
|
||||
Instance *inst = data;
|
||||
if (eina_str_has_prefix(sig, "e,enable,keyboard"))
|
||||
inst->disabled_keyboard = EINA_FALSE;
|
||||
if (eina_str_has_prefix(sig, "e,disable,keyboard"))
|
||||
inst->disabled_keyboard = EINA_TRUE;
|
||||
_update_instances(inst);
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 04/05/19.
|
||||
//
|
||||
#include <Ecore.h>
|
||||
#include <Elementary.h>
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#ifndef E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H
|
||||
#define E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H
|
||||
|
||||
/* LIST OF INSTANCES */
|
||||
extern Eina_List *instances;
|
||||
|
||||
/* gadcon callback for actions */
|
||||
void
|
||||
_rotation_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED);
|
||||
|
||||
void
|
||||
_keyboard_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED);
|
||||
|
||||
/* end gadcon callback for actions */
|
||||
|
||||
|
||||
#endif //E_GADGET_CONVERTIBLE_E_GADGET_CONVERTIBLE_H
|
Binary file not shown.
|
@ -1,173 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 01/08/19.
|
||||
//
|
||||
#include "convertible_logging.h"
|
||||
#include "e.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
static Convertible_Config *conv_config = NULL;
|
||||
E_Config_DD *config_edd = NULL;
|
||||
EINTERN Convertible_Config *convertible_config;
|
||||
|
||||
/**
|
||||
* Create the config structure
|
||||
* */
|
||||
static void
|
||||
_econvertible_config_dd_new(void)
|
||||
{
|
||||
// c_zone = E_CONFIG_DD_NEW("Econvertible_Zone_Config", Convertible_Zone_Config);
|
||||
// E_CONFIG_VAL(c_zone, Convertible_Zone_Config, name, STR);
|
||||
// E_CONFIG_VAL(c_zone, Convertible_Zone_Config, follow_rotation, INT);
|
||||
|
||||
// TODO Not sure what his line does. Apparently, it is needed to specify the type of the configuration data structure
|
||||
config_edd = E_CONFIG_DD_NEW("Convertible_Config", Convertible_Config);
|
||||
|
||||
E_CONFIG_VAL(config_edd, Convertible_Config, version, INT);
|
||||
E_CONFIG_VAL(config_edd, Convertible_Config, disable_keyboard_on_rotation, INT);
|
||||
// E_CONFIG_LIST(config_edd, Convertible_Config, rotatable_screen_configuration, c_zone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the *conv_config data structure based on the settings coming from the dialog panel
|
||||
* @param config The config coming from the Dialog Panel (E_Config_Dialog_data)
|
||||
*/
|
||||
static void
|
||||
_config_set(Convertible_Config *config)
|
||||
{
|
||||
DBG("config_set disable_keyboard_on_rotation %d", config->disable_keyboard_on_rotation);
|
||||
conv_config->disable_keyboard_on_rotation = config->disable_keyboard_on_rotation;
|
||||
e_config_domain_save("module.convertible", config_edd, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise the configuration object
|
||||
*
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
static void*
|
||||
_create_data(E_Config_Dialog *cfg EINA_UNUSED)
|
||||
{
|
||||
E_Config_Dialog_Data *dialog_data;
|
||||
|
||||
dialog_data = E_NEW(E_Config_Dialog_Data, 1);
|
||||
dialog_data->config = malloc(sizeof(Convertible_Config));
|
||||
dialog_data->config->disable_keyboard_on_rotation = conv_config->disable_keyboard_on_rotation;
|
||||
// dialog_data->config->rotatable_screen_configuration = conv_config->rotatable_screen_configuration;
|
||||
|
||||
DBG("disable_keyboard_on_rotation %d", dialog_data->config->disable_keyboard_on_rotation);
|
||||
return dialog_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Release memory for the data structure holding the configuration
|
||||
*
|
||||
* @param c
|
||||
* @param dialog_data
|
||||
*/
|
||||
static void
|
||||
_free_data(E_Config_Dialog *c EINA_UNUSED, E_Config_Dialog_Data *dialog_data)
|
||||
{
|
||||
free(dialog_data->config);
|
||||
free(dialog_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function should store the modified settings into the data structure referred by the pointer conv_config
|
||||
* @param cfd
|
||||
* @param cfdata
|
||||
* @return
|
||||
*/
|
||||
static int
|
||||
_basic_apply_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
DBG("_basic_apply_data");
|
||||
_config_set(cfdata->config);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the panel by adding all the items like labels, checkbox and lists
|
||||
*
|
||||
* @param cfd
|
||||
* @param evas
|
||||
* @param cfdata
|
||||
* @return
|
||||
*/
|
||||
static Evas_Object *
|
||||
_basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas,
|
||||
E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Evas_Object *o, *evas_option_input_disable; //, *evas_label_section_screens; // *list_item_screen,
|
||||
// Evas_Object *screen_list = NULL;
|
||||
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
|
||||
evas_option_input_disable = e_widget_check_add(evas, "Disable input when rotated", &(cfdata->config->disable_keyboard_on_rotation));
|
||||
e_widget_list_object_append(o, evas_option_input_disable, 0, 0, 0);
|
||||
|
||||
DBG("After basic_create_widget");
|
||||
return o;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function initialise the config dialog for the module
|
||||
* @param comp
|
||||
* @param p
|
||||
* @return
|
||||
*/
|
||||
E_Config_Dialog*
|
||||
e_int_config_convertible_module(Evas_Object *comp, const char *p EINA_UNUSED)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
E_Config_Dialog_View *v;
|
||||
|
||||
if (e_config_dialog_find("E", "windows/convertible"))
|
||||
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;
|
||||
|
||||
cfd = e_config_dialog_new(comp,
|
||||
"Convertible Configuration",
|
||||
"E", "windows/convertible",
|
||||
NULL,
|
||||
0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
void
|
||||
econvertible_config_init(void)
|
||||
{
|
||||
_econvertible_config_dd_new();
|
||||
conv_config = e_config_domain_load("module.econvertible", config_edd);
|
||||
|
||||
// Check version
|
||||
if (conv_config && !e_util_module_config_check(_("Convertible Module"),
|
||||
conv_config->version,
|
||||
MOD_CONFIG_FILE_VERSION))
|
||||
{
|
||||
free(conv_config);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!conv_config)
|
||||
{
|
||||
conv_config = E_NEW(Convertible_Config, 1);
|
||||
conv_config->disable_keyboard_on_rotation = 1;
|
||||
// conv_config->rotatable_screen_configuration = NULL;
|
||||
}
|
||||
|
||||
conv_config->version = MOD_CONFIG_FILE_VERSION;
|
||||
DBG("Config loaded");
|
||||
}
|
||||
|
||||
void econvertible_config_shutdown(void)
|
||||
{
|
||||
E_CONFIG_DD_FREE(config_edd);
|
||||
E_FREE(convertible_config);
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 01/08/19.
|
||||
//
|
||||
#include <e.h>
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#ifndef E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H
|
||||
#define E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H
|
||||
|
||||
/* Increment for Major Changes */
|
||||
#define MOD_CONFIG_FILE_EPOCH 1
|
||||
/* Increment for Minor Changes (ie: user doesn't need a new config) */
|
||||
#define MOD_CONFIG_FILE_GENERATION 0
|
||||
#define MOD_CONFIG_FILE_VERSION ((MOD_CONFIG_FILE_EPOCH * 1000000) + MOD_CONFIG_FILE_GENERATION)
|
||||
|
||||
// Definition of the data structure to hold the gadget configuration
|
||||
typedef struct _Convertible_Config Convertible_Config;
|
||||
struct _Convertible_Config
|
||||
{
|
||||
int version;
|
||||
int disable_keyboard_on_rotation;
|
||||
};
|
||||
|
||||
// As far as I understand, this structure should hold data useful for the configuration and a pointer to
|
||||
// another structure holding the configuration options
|
||||
struct _E_Config_Dialog_Data
|
||||
{
|
||||
Convertible_Config *config;
|
||||
Evas_Object *zones;
|
||||
Evas_Object *inputs;
|
||||
};
|
||||
|
||||
E_Config_Dialog*
|
||||
e_int_config_convertible_module(Evas_Object *comp, const char *p);
|
||||
void
|
||||
econvertible_config_init(void);
|
||||
void
|
||||
econvertible_config_shutdown(void);
|
||||
|
||||
#endif //E_GADGET_CONVERTIBLE_E_MOD_CONFIG_H
|
|
@ -1,373 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 04/05/19.
|
||||
//
|
||||
#include <e.h>
|
||||
#include <e_module.h>
|
||||
#include <e_gadcon.h>
|
||||
#include "convertible_logging.h"
|
||||
#include "accelerometer-orientation.h"
|
||||
#include "e-gadget-convertible.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "dbus_acceleration.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
|
||||
// The main module reference
|
||||
E_Module *convertible_module;
|
||||
Instance *inst;
|
||||
|
||||
// Configuration
|
||||
extern Convertible_Config *convertible_config;
|
||||
static E_Config_DD *config_edd;
|
||||
|
||||
// Logger
|
||||
int _convertible_log_dom;
|
||||
|
||||
/* module setup */
|
||||
E_API E_Module_Api e_modapi =
|
||||
{
|
||||
E_MODULE_API_VERSION,
|
||||
"convertible"
|
||||
};
|
||||
|
||||
|
||||
/* LIST OF INSTANCES */
|
||||
Eina_List *instances = NULL;
|
||||
|
||||
|
||||
/* gadcon requirements */
|
||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
|
||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
|
||||
static const char *_gc_label(const E_Gadcon_Client_Class *client_class);
|
||||
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas);
|
||||
static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class);
|
||||
/* and actually define the gadcon class that this module provides (just 1) */
|
||||
static const E_Gadcon_Client_Class _gadcon_class =
|
||||
{
|
||||
GADCON_CLIENT_CLASS_VERSION,
|
||||
"convertible",
|
||||
{
|
||||
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL,
|
||||
e_gadcon_site_is_not_toolbar
|
||||
},
|
||||
E_GADCON_CLIENT_STYLE_PLAIN
|
||||
};
|
||||
|
||||
|
||||
static E_Gadcon_Client *
|
||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||
{
|
||||
Evas_Object *evas_object;
|
||||
E_Gadcon_Client *gcc;
|
||||
Instance *instance;
|
||||
|
||||
evas_object = edje_object_add(gc->evas);
|
||||
e_theme_edje_object_set(evas_object, "base/theme/modules/convertible",
|
||||
"e/modules/convertible/main");
|
||||
|
||||
instance = E_NEW(Instance, 1);
|
||||
instance->accelerometer = inst->accelerometer;
|
||||
instance->disabled_keyboard = inst->disabled_keyboard;
|
||||
instance->locked_position = inst->locked_position;
|
||||
instance->randr2_ids = inst->randr2_ids;
|
||||
instance->o_button = evas_object;
|
||||
|
||||
instances = eina_list_append(instances, instance);
|
||||
|
||||
gcc = e_gadcon_client_new(gc, name, id, style, evas_object);
|
||||
gcc->data = instance;
|
||||
|
||||
evas_object_size_hint_aspect_set(evas_object, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
// evas_object_smart_callback_add(parent, "gadget_site_anchor", _anchor_change, inst);
|
||||
|
||||
// Adding callback for EDJE object
|
||||
INF("Adding callback for creation and other events from EDJE");
|
||||
edje_object_signal_callback_add(evas_object, "e,lock,rotation", "tablet", _rotation_signal_cb, instance);
|
||||
edje_object_signal_callback_add(evas_object, "e,unlock,rotation", "tablet", _rotation_signal_cb, instance);
|
||||
edje_object_signal_callback_add(evas_object, "e,enable,keyboard", "input", _keyboard_signal_cb, instance);
|
||||
edje_object_signal_callback_add(evas_object, "e,disable,keyboard", "input", _keyboard_signal_cb, instance);
|
||||
|
||||
inst->o_button = evas_object;
|
||||
|
||||
return gcc;
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_shutdown(E_Gadcon_Client *gcc)
|
||||
{
|
||||
DBG("CONVERTIBLE gadcon shutdown");
|
||||
Instance *instance;
|
||||
|
||||
if (!(instance = gcc->data)) return;
|
||||
instances = eina_list_remove(instances, instance);
|
||||
instance->accelerometer = NULL;
|
||||
|
||||
// Remove callbacks
|
||||
DBG("Removing EDJE callbacks");
|
||||
edje_object_signal_callback_del(instance->o_button, "lock,rotation", "tablet", _rotation_signal_cb);
|
||||
edje_object_signal_callback_del(instance->o_button, "unlock,rotation", "tablet", _rotation_signal_cb);
|
||||
edje_object_signal_callback_del(instance->o_button, "enable,keyboard", "keyboard", _keyboard_signal_cb);
|
||||
edje_object_signal_callback_del(instance->o_button, "disable,keyboard", "keyboard", _keyboard_signal_cb);
|
||||
|
||||
evas_object_del(instance->o_button);
|
||||
|
||||
E_FREE(instance);
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
|
||||
{
|
||||
Evas_Coord mw, mh;
|
||||
char buf[PATH_MAX];
|
||||
const char *s = "float";
|
||||
|
||||
Instance *current_instance = gcc->data;
|
||||
switch (orient)
|
||||
{
|
||||
case E_GADCON_ORIENT_FLOAT:
|
||||
s = "float";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_HORIZ:
|
||||
s = "horizontal";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_VERT:
|
||||
s = "vertical";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_LEFT:
|
||||
s = "left";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_RIGHT:
|
||||
s = "right";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_TOP:
|
||||
s = "top";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_BOTTOM:
|
||||
s = "bottom";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_TL:
|
||||
s = "top_left";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_TR:
|
||||
s = "top_right";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_BL:
|
||||
s = "bottom_left";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_BR:
|
||||
s = "bottom_right";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_LT:
|
||||
s = "left_top";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_RT:
|
||||
s = "right_top";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_LB:
|
||||
s = "left_bottom";
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_RB:
|
||||
s = "right_bottom";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "e,state,orientation,%s", s);
|
||||
edje_object_signal_emit(current_instance->o_button, buf, "e");
|
||||
edje_object_message_signal_process(current_instance->o_button);
|
||||
|
||||
mw = 0, mh = 0;
|
||||
edje_object_size_min_get(current_instance->o_button, &mw, &mh);
|
||||
if ((mw < 1) || (mh < 1))
|
||||
edje_object_size_min_calc(current_instance->o_button, &mw, &mh);
|
||||
if (mw < 4) mw = 4;
|
||||
if (mh < 4) mh = 4;
|
||||
e_gadcon_client_aspect_set(gcc, mw, mh);
|
||||
e_gadcon_client_min_size_set(gcc, mw, mh);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_label(const E_Gadcon_Client_Class *client_class EINA_UNUSED)
|
||||
{
|
||||
return "Convertible";
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas)
|
||||
{
|
||||
Evas_Object *o;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
o = edje_object_add(evas);
|
||||
snprintf(buf, sizeof(buf), "%s/e-module-convertible.edj", convertible_module->dir);
|
||||
edje_object_file_set(o, buf, "icon");
|
||||
return o;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED)
|
||||
{
|
||||
static char buf[PATH_MAX];
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s.%d", client_class->name,
|
||||
eina_list_count(instances) + 1);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepare to fetch the new value for the DBUS property that has changed
|
||||
* */
|
||||
static void
|
||||
_cb_properties_changed(void *data, const Eldbus_Message *msg)
|
||||
{
|
||||
Instance *current_instance = data;
|
||||
Eldbus_Message_Iter *array, *invalidate;
|
||||
char *iface;
|
||||
|
||||
if (!eldbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate))
|
||||
ERR("Error getting data from properties changed signal.");
|
||||
// Given that the property changed, let's get the new value
|
||||
Eldbus_Pending *pending_operation = eldbus_proxy_property_get(current_instance->accelerometer->sensor_proxy,
|
||||
"AccelerometerOrientation",
|
||||
on_accelerometer_orientation, current_instance);
|
||||
if (!pending_operation)
|
||||
ERR("Error: could not get property AccelerometerOrientation");
|
||||
}
|
||||
|
||||
E_API void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
// Initialise the logger
|
||||
_convertible_log_dom = eina_log_domain_register("convertible", EINA_COLOR_LIGHTBLUE);
|
||||
convertible_module = m;
|
||||
|
||||
char theme_overlay_path[PATH_MAX];
|
||||
snprintf(theme_overlay_path, sizeof(theme_overlay_path), "%s/e-module-convertible.edj", convertible_module->dir);
|
||||
elm_theme_extension_add(NULL, theme_overlay_path);
|
||||
|
||||
econvertible_config_init();
|
||||
|
||||
// Config DBus
|
||||
DbusAccelerometer *accelerometer = sensor_proxy_init();
|
||||
inst = E_NEW(Instance, 1);
|
||||
inst->accelerometer = accelerometer;
|
||||
inst->locked_position = EINA_FALSE;
|
||||
inst->disabled_keyboard = EINA_FALSE;
|
||||
|
||||
// Making sure we rotate the screen to the current orientation coming from the sensor
|
||||
inst->accelerometer->pending_orientation = eldbus_proxy_property_get(inst->accelerometer->sensor_proxy,
|
||||
"AccelerometerOrientation",
|
||||
on_accelerometer_orientation, inst);
|
||||
if (!inst->accelerometer->pending_orientation)
|
||||
{
|
||||
ERR("Error: could not get property AccelerometerOrientation");
|
||||
}
|
||||
|
||||
// Set the callback for property changed event
|
||||
accelerometer->dbus_property_changed_sh = eldbus_proxy_signal_handler_add(accelerometer->sensor_proxy_properties,
|
||||
"PropertiesChanged",
|
||||
_cb_properties_changed, inst);
|
||||
if (!accelerometer->dbus_property_changed_sh)
|
||||
ERR("Error: could not add the signal handler for PropertiesChanged");
|
||||
|
||||
// Screen related part
|
||||
E_Zone *zone;
|
||||
|
||||
// Initialise screen part
|
||||
DBG("Looking for the main screen");
|
||||
Eina_List *l;
|
||||
inst->randr2_ids = NULL;
|
||||
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
||||
{
|
||||
// Get the screen for the zone
|
||||
E_Randr2_Screen *screen = e_randr2_screen_id_find(zone->randr2_id);
|
||||
DBG("name randr2 id %s", zone->randr2_id);
|
||||
DBG("rot_90 %i", screen->info.can_rot_90);
|
||||
|
||||
// Arbitrarily chosen a condition to check that rotation is enabled
|
||||
if (screen->info.can_rot_90 == EINA_TRUE)
|
||||
{
|
||||
char *randr2_id = strdup(zone->randr2_id);
|
||||
if (randr2_id == NULL)
|
||||
ERR("Can't copy the screen name");
|
||||
else
|
||||
inst->randr2_ids = eina_list_append(inst->randr2_ids, randr2_id);
|
||||
if (eina_error_get())
|
||||
ERR("Memory is low. List allocation failed.");
|
||||
}
|
||||
}
|
||||
|
||||
if (inst->randr2_ids == NULL)
|
||||
ERR("Unable to find rotatable screens");
|
||||
|
||||
DBG("%d screen(s) has been found", eina_list_count(inst->randr2_ids));
|
||||
|
||||
e_gadcon_provider_register(&_gadcon_class);
|
||||
|
||||
INF("Creating menu entries for settings");
|
||||
e_configure_registry_category_add("extensions", 90, _("Extensions"), NULL,
|
||||
"preferences-extensions");
|
||||
e_configure_registry_item_add("extensions/convertible", 30, _("Convertible"), NULL,
|
||||
"preferences-desktop-edge-bindings", e_int_config_convertible_module);
|
||||
|
||||
instances = eina_list_append(instances, inst);
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
INF("Freeing configuration");
|
||||
econvertible_config_shutdown();
|
||||
|
||||
e_configure_registry_item_del("extensions/convertible");
|
||||
|
||||
// Shutdown Dbus
|
||||
sensor_proxy_shutdown();
|
||||
|
||||
// Remove screen info
|
||||
char *element;
|
||||
EINA_LIST_FREE(inst->randr2_ids, element)
|
||||
free(element);
|
||||
|
||||
free(inst);
|
||||
|
||||
INF("Shutting down the module");
|
||||
convertible_module = NULL;
|
||||
e_gadcon_provider_unregister(&_gadcon_class);
|
||||
|
||||
// Removing logger
|
||||
DBG("Removing the logger");
|
||||
eina_log_domain_unregister(_convertible_log_dom);
|
||||
_convertible_log_dom = -1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
if (convertible_config)
|
||||
{
|
||||
e_config_domain_save("module.convertible", config_edd, convertible_config);
|
||||
}
|
||||
return 1;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 04/05/19.
|
||||
//
|
||||
#include <e.h>
|
||||
#include "dbus_acceleration.h"
|
||||
|
||||
|
||||
#ifndef E_GADGET_CONVERTIBLE_CONVERTIBLE_H
|
||||
#define E_GADGET_CONVERTIBLE_CONVERTIBLE_H
|
||||
|
||||
typedef struct _Instance Instance;
|
||||
|
||||
struct _Instance
|
||||
{
|
||||
Evas_Object *o_button;
|
||||
DbusAccelerometer *accelerometer;
|
||||
// I hate to put DBUS related stuff in this struct. Unfortunately, I did not (quickly) find a better way of
|
||||
// handling signals across multiple instances sharing one DbusAccelerometer struct.
|
||||
Eina_List *randr2_ids;
|
||||
|
||||
Eina_Bool locked_position;
|
||||
Eina_Bool disabled_keyboard;
|
||||
};
|
||||
|
||||
#endif //E_GADGET_CONVERTIBLE_CONVERTIBLE_H
|
|
@ -1,20 +0,0 @@
|
|||
//
|
||||
// Created by raffaele on 18/12/19.
|
||||
//
|
||||
|
||||
#ifndef E_GADGET_CONVERTIBLE_INPUT_ROTATION_H
|
||||
#define E_GADGET_CONVERTIBLE_INPUT_ROTATION_H
|
||||
|
||||
typedef struct _TransformationMatrix {
|
||||
float values[9];
|
||||
} TransformationMatrix;
|
||||
|
||||
|
||||
static const float MATRIX_ROTATION_IDENTITY[6] = {1, 0, 0, 0, 1, 0 };
|
||||
static const float MATRIX_ROTATION_270[6] = {0, 1, 0, -1, 0, 1 };
|
||||
static const float MATRIX_ROTATION_180[6] = {-1, 0, 1, 0, -1, 1 };
|
||||
static const float MATRIX_ROTATION_90[6] = {0, -1, 1, 1, 0, 0 };
|
||||
|
||||
// "Coordinate Transformation Matrix"
|
||||
static const char *CTM_name = "Coordinate Transformation Matrix";
|
||||
#endif //E_GADGET_CONVERTIBLE_INPUT_ROTATION_H
|
|
@ -1,12 +0,0 @@
|
|||
src = files(
|
||||
'e_mod_main.c',
|
||||
'dbus_acceleration.h',
|
||||
'dbus_acceleration.c',
|
||||
'e-gadget-convertible.h',
|
||||
'e-gadget-convertible.c',
|
||||
'accelerometer-orientation.h',
|
||||
'convertible_logging.h',
|
||||
'e_mod_main.h',
|
||||
'e_mod_config.h',
|
||||
'e_mod_config.c'
|
||||
)
|
|
@ -1,9 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Link
|
||||
Name=E-convertible
|
||||
GenericName=E-convertible
|
||||
Comment=Helps to manage screen rotation based on accelerometer
|
||||
Comment[fr]=Permet de gérer la rotation de l'écran en fonction de l'accéléromètre.
|
||||
Comment[it]=Consente di gestire la rotazione dello schermo usando l'accelerometro
|
||||
Icon=e-module-convertible
|
||||
X-Enlightenment-ModuleType=system
|
|
@ -5,7 +5,7 @@ module_includes2 = [ '../..' , '../bin' , '../bin/efx' ]
|
|||
module_deps = [ deps_e, dep_dl ]
|
||||
|
||||
mods = [
|
||||
# standard run of the mill modules with icon and desktop
|
||||
# standard run of the mill modules with cion and desktop
|
||||
'ibar',
|
||||
'pager',
|
||||
'temperature',
|
||||
|
@ -29,7 +29,6 @@ mods = [
|
|||
'conf_performance',
|
||||
'conf_paths',
|
||||
'conf_interaction',
|
||||
'convertible',
|
||||
'gadman',
|
||||
'geolocation',
|
||||
'connman',
|
||||
|
|
|
@ -299,9 +299,6 @@ _alsa_cards_refresh(void)
|
|||
//save the addr to see if there are missing devices in the cache list
|
||||
|
||||
mixer = _alsa_card_create(buf);
|
||||
if (!mixer)
|
||||
continue;
|
||||
|
||||
ctx->cards = eina_list_append(ctx->cards, mixer);
|
||||
//get elements of the device
|
||||
elem = snd_mixer_first_elem(mixer);
|
||||
|
|
|
@ -779,10 +779,7 @@ _source_output_cb(pa_context *c EINA_UNUSED, const pa_source_output_info *info,
|
|||
if (eol > 0)
|
||||
return;
|
||||
|
||||
if ((info->name) &&
|
||||
((!strcmp(info->name, "__e_mon")) ||
|
||||
(!strcmp(info->name, "Peak detect"))))
|
||||
return;
|
||||
if ((info->name) && (!strcmp(info->name, "__e_mon"))) return;
|
||||
|
||||
output = calloc(1, sizeof(Source_Output));
|
||||
EINA_SAFETY_ON_NULL_RETURN(output);
|
||||
|
|
|
@ -160,13 +160,12 @@ notification_popup_notify(E_Notification_Notify *n,
|
|||
E_FREE_FUNC(popup->timer, ecore_timer_del);
|
||||
|
||||
if (n->timeout < 0 || notification_cfg->force_timeout)
|
||||
n->timeout = notification_cfg->timeout * 1000.0;
|
||||
n->timeout = notification_cfg->timeout;
|
||||
else n->timeout = n->timeout / 1000.0;
|
||||
|
||||
|
||||
if (n->timeout > 0)
|
||||
popup->timer = ecore_timer_loop_add((double)n->timeout / 1000.0,
|
||||
(Ecore_Task_Cb)_notification_timer_cb,
|
||||
popup);
|
||||
popup->timer = ecore_timer_loop_add(n->timeout, (Ecore_Task_Cb)_notification_timer_cb, popup);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1173,6 +1173,7 @@ _pager_cb_event_desk_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev
|
|||
|
||||
if (p->popup)
|
||||
edje_object_part_text_set(p->popup->o_bg, "e.text.label", ev->desk->name);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((pager_config->popup) && (!act_popup) &&
|
||||
|
|
|
@ -128,10 +128,8 @@ _redo_sizing(Instance *inst)
|
|||
evas_object_geometry_get(inst->ui.gadget, NULL, NULL, &w, &h);
|
||||
EINA_LIST_FOREACH(inst->icons, l, o)
|
||||
{
|
||||
edje_object_part_box_remove(inst->ui.gadget, "box", o);
|
||||
if (_is_horiz(inst)) evas_object_size_hint_min_set(o, h, 0);
|
||||
else evas_object_size_hint_min_set(o, 0, w);
|
||||
edje_object_part_box_append(inst->ui.gadget, "box", o);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,15 +203,6 @@ _systray_theme(Evas_Object *o, const char *shelf_style, const char *gc_style)
|
|||
e_theme_edje_object_set(o, NULL, _group_gadget);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_systray_delay_fill_timer_cb(void *data)
|
||||
{
|
||||
Instance *inst = data;
|
||||
systray_notifier_host_fill(inst->notifier);
|
||||
inst->fill_timer = NULL;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static E_Gadcon_Client *
|
||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||
{
|
||||
|
@ -256,8 +245,6 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
|||
|
||||
inst->notifier = systray_notifier_host_new(inst, inst->gcc->gadcon);
|
||||
|
||||
inst->fill_timer = ecore_timer_add(0.0, _systray_delay_fill_timer_cb, inst);
|
||||
|
||||
return inst->gcc;
|
||||
}
|
||||
|
||||
|
@ -278,8 +265,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
|
||||
if (inst->job.size_apply)
|
||||
ecore_job_del(inst->job.size_apply);
|
||||
if (inst->fill_timer)
|
||||
ecore_timer_del(inst->fill_timer);
|
||||
|
||||
inst->icons = eina_list_free(inst->icons);
|
||||
E_FREE(inst);
|
||||
|
|
|
@ -33,7 +33,6 @@ struct _Instance
|
|||
Evas *evas;
|
||||
Instance_Notifier_Host *notifier;
|
||||
Eina_List *icons;
|
||||
Ecore_Timer *fill_timer;
|
||||
struct {
|
||||
Evas_Object *gadget;
|
||||
} ui;
|
||||
|
@ -61,7 +60,6 @@ void systray_edje_box_remove(Instance *inst, Evas_Object *child);
|
|||
void systray_edje_box_prepend(Instance *inst, Evas_Object *child);
|
||||
|
||||
Instance_Notifier_Host *systray_notifier_host_new(Instance *inst, E_Gadcon *gadcon);
|
||||
void systray_notifier_host_fill(Instance_Notifier_Host *host_inst);
|
||||
void systray_notifier_host_free(Instance_Notifier_Host *notifier);
|
||||
void systray_notifier_host_init(void);
|
||||
void systray_notifier_host_shutdown(void);
|
||||
|
|
|
@ -420,30 +420,20 @@ systray_notifier_item_update(Notifier_Item *item)
|
|||
_systray_notifier_inst_item_update(inst, item, EINA_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
systray_notifier_host_fill(Instance_Notifier_Host *host_inst)
|
||||
{
|
||||
Notifier_Item *item;
|
||||
|
||||
EINA_INLIST_FOREACH(ctx->item_list, item)
|
||||
{
|
||||
_systray_notifier_inst_item_update(host_inst, item, EINA_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
Instance_Notifier_Host *
|
||||
systray_notifier_host_new(Instance *inst, E_Gadcon *gadcon)
|
||||
{
|
||||
Instance_Notifier_Host *host_inst = calloc(1, sizeof(Instance_Notifier_Host));
|
||||
|
||||
Instance_Notifier_Host *host_inst = NULL;
|
||||
Notifier_Item *item;
|
||||
host_inst = calloc(1, sizeof(Instance_Notifier_Host));
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(host_inst, NULL);
|
||||
|
||||
host_inst->inst = inst;
|
||||
host_inst->edje = systray_edje_get(inst);
|
||||
host_inst->gadcon = gadcon;
|
||||
ctx->instances = eina_inlist_append(ctx->instances, EINA_INLIST_GET(host_inst));
|
||||
|
||||
// systray_notifier_host_fill(host_inst);
|
||||
EINA_INLIST_FOREACH(ctx->item_list, item)
|
||||
_systray_notifier_inst_item_update(host_inst, item, EINA_FALSE);
|
||||
|
||||
return host_inst;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ const E_Intl_Pair basic_language_predefined_pairs[] =
|
|||
{"sl_SI.UTF-8", "si_flag.png", "Slovenščina"},
|
||||
{"sv_SE.UTF-8", "se_flag.png", "Svenska"},
|
||||
{"tr_TR.UTF-8", "tr_flag.png", "Türkçe"},
|
||||
{"uk_UA.UTF-8", "ua_flag.png", "Українська мова"},
|
||||
{"uk_UK.UTF-8", "ua_flag.png", "Українська мова"},
|
||||
{"vi_VN UTF-8", "vn_flag.png", "Tiếng Việt"},
|
||||
{"zh_CN.UTF-8", "cn_flag.png", "中文 (简体)"},
|
||||
{"zh_TW.UTF-8", "tw_flag.png", "中文 (繁體)"},
|
||||
|
|
|
@ -1019,49 +1019,11 @@ e_modapi_init(E_Module *m)
|
|||
{
|
||||
Evas_Object *o;
|
||||
char buf[PATH_MAX];
|
||||
int iw = 0, ih = 0;
|
||||
#define ARGB(a, r, g, b) ((a << 24) | (r << 16) | (g << 8) | b)
|
||||
#define B ARGB( 0, 0, 0, 0),
|
||||
#define W ARGB(255, 255, 255, 255),
|
||||
#define O ARGB(255, 255, 188, 0),
|
||||
unsigned int *idata;
|
||||
static const unsigned int wllogo[16 * 16] =
|
||||
{
|
||||
B B B B B B B B B B B B B B B B
|
||||
B B B B B B O O O O B B B B B B
|
||||
B B B W O O O O O O O O B B B B
|
||||
B B B W W O O O O O O O W B B B
|
||||
B B O W W O O O O O O O W W B B
|
||||
B B O W W O O W W O O O W W B B
|
||||
B O O W W W O W W O O W W O O B
|
||||
B O O W W W W W W W O W W O O B
|
||||
B O O W W W W W W W O W W O O B
|
||||
B O O W W W W O W W W W W O O B
|
||||
B B O W W W W O O W W W W O B B
|
||||
B B O W W W W O O W W W O O B B
|
||||
B B B O W W W O O W W W O B B B
|
||||
B B B B O W O O O W W O B B B B
|
||||
B B B B B B O O O O B B B B B B
|
||||
B B B B B B B B B B B B B B B B
|
||||
};
|
||||
|
||||
o = evas_object_image_filled_add(ecore_evas_get(e_comp->ee));
|
||||
evas_object_name_set(o, "__e_wl_watermark");
|
||||
e_prefix_data_concat_static(buf, "data/images/wayland.png");
|
||||
evas_object_image_file_set(o, buf, NULL);
|
||||
evas_object_image_size_get(o, &iw, &ih);
|
||||
if ((iw <= 1) && (ih <= 1))
|
||||
{ // someonme removed the watermark - use low res hardcoded logo
|
||||
evas_object_image_alpha_set(o, EINA_TRUE);
|
||||
evas_object_image_size_set(o, 16, 16);
|
||||
idata = evas_object_image_data_get(o, EINA_TRUE);
|
||||
if (idata)
|
||||
{
|
||||
memcpy(idata, wllogo, 16 * 16 * sizeof(unsigned int));
|
||||
evas_object_image_data_set(o, idata);
|
||||
evas_object_image_data_update_add(o, 0, 0, 16, 16);
|
||||
}
|
||||
}
|
||||
evas_object_move(o, w - 40 - 16, 16);
|
||||
evas_object_resize(o, 40, 40);
|
||||
evas_object_pass_events_set(o, EINA_TRUE);
|
||||
|
|
Loading…
Reference in New Issue