remove illume modules
this code is dead. dead code does not belong in master. see devs/discomfitor/e_module-illume2.git
12
configure.ac
|
@ -943,7 +943,6 @@ AC_E_OPTIONAL_MODULE([gadman], true)
|
|||
AC_E_OPTIONAL_MODULE([mixer], true, [CHECK_MODULE_MIXER])
|
||||
AC_E_OPTIONAL_MODULE([connman], true, [CHECK_MODULE_CONNMAN])
|
||||
AC_E_OPTIONAL_MODULE([bluez4], true, [CHECK_MODULE_BLUEZ4])
|
||||
#AC_E_OPTIONAL_MODULE([illume2], true)
|
||||
AC_E_OPTIONAL_MODULE([syscon], true)
|
||||
AC_E_OPTIONAL_MODULE([everything], true)
|
||||
AC_E_OPTIONAL_MODULE([systray], true)
|
||||
|
@ -1102,17 +1101,6 @@ doc/Doxyfile
|
|||
doc/e.dox
|
||||
$po_makefile_in
|
||||
])
|
||||
#src/modules/access/module.desktop
|
||||
#src/modules/illume2/doc/illume.dox
|
||||
#src/modules/illume2/module.desktop
|
||||
#src/modules/illume-home/module.desktop
|
||||
#src/modules/illume-home-toggle/module.desktop
|
||||
#src/modules/illume-softkey/module.desktop
|
||||
#src/modules/illume-keyboard/module.desktop
|
||||
#src/modules/illume-indicator/module.desktop
|
||||
#src/modules/illume-kbd-toggle/module.desktop
|
||||
#src/modules/illume-mode-toggle/module.desktop
|
||||
#src/modules/illume-bluetooth/module.desktop
|
||||
|
||||
# report
|
||||
txt_strip() {
|
||||
|
|
|
@ -79,16 +79,6 @@ include src/modules/Makefile_gadman.mk
|
|||
|
||||
include src/modules/Makefile_mixer.mk
|
||||
|
||||
#include src/modules/Makefile_illume2.mk
|
||||
#include src/modules/Makefile_illume-home.mk
|
||||
#include src/modules/Makefile_illume-home-toggle.mk
|
||||
#include src/modules/Makefile_illume-softkey.mk
|
||||
#include src/modules/Makefile_illume-keyboard.mk
|
||||
#include src/modules/Makefile_illume-indicator.mk
|
||||
#include src/modules/Makefile_illume-kbd-toggle.mk
|
||||
#include src/modules/Makefile_illume-mode-toggle.mk
|
||||
#include src/modules/Makefile_illume-bluetooth.mk
|
||||
|
||||
include src/modules/Makefile_syscon.mk
|
||||
|
||||
include src/modules/Makefile_everything.mk
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
if USE_MODULE_ILLUME-BLUETOOTH
|
||||
illume_bluetoothdir = $(MDIR)/illume-bluetooth
|
||||
illume_bluetooth_DATA = src/modules/illume-bluetooth/e-module-illume-bluetooth.edj \
|
||||
src/modules/illume-bluetooth/module.desktop
|
||||
|
||||
|
||||
illume_bluetoothpkgdir = $(MDIR)/illume-bluetooth/$(MODULE_ARCH)
|
||||
illume_bluetoothpkg_LTLIBRARIES = src/modules/illume-bluetooth/module.la
|
||||
|
||||
src_modules_illume_bluetooth_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume_bluetooth_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_bluetooth_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_bluetooth_module_la_SOURCES = src/modules/illume-bluetooth/e_mod_main.c
|
||||
|
||||
PHONIES += illume_bluetooth install-illume_bluetooth
|
||||
illume_bluetooth: $(illume_bluetoothpkg_LTLIBRARIES) $(illume_bluetooth_DATA)
|
||||
install-illume_bluetooth: install-illume_bluetoothDATA install-illume_bluetoothpkgLTLIBRARIES
|
||||
endif
|
|
@ -1,18 +0,0 @@
|
|||
if USE_MODULE_ILLUME-HOME-TOGGLE
|
||||
illume_home_toggledir = $(MDIR)/illume-home-toggle
|
||||
illume_home_toggle_DATA = src/modules/illume-home-toggle/e-module-illume-home-toggle.edj \
|
||||
src/modules/illume-home-toggle/module.desktop
|
||||
|
||||
|
||||
illume_home_togglepkgdir = $(MDIR)/illume-home-toggle/$(MODULE_ARCH)
|
||||
illume_home_togglepkg_LTLIBRARIES = src/modules/illume-home-toggle/module.la
|
||||
|
||||
src_modules_illume_home_toggle_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume_home_toggle_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_home_toggle_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_home_toggle_module_la_SOURCES = src/modules/illume-home-toggle/e_mod_main.c
|
||||
|
||||
PHONIES += illume_home_toggle install-illume_home_toggle
|
||||
illume_home_toggle: $(illume_home_togglepkg_LTLIBRARIES) $(illume_home_toggle_DATA)
|
||||
install-illume_home_toggle: install-illume_home_toggleDATA install-illume_home_togglepkgLTLIBRARIES
|
||||
endif
|
|
@ -1,23 +0,0 @@
|
|||
if USE_MODULE_ILLUME-HOME
|
||||
illume_homedir = $(MDIR)/illume-home
|
||||
illume_home_DATA = src/modules/illume-home/e-module-illume-home.edj \
|
||||
src/modules/illume-home/module.desktop
|
||||
|
||||
|
||||
illume_homepkgdir = $(MDIR)/illume-home/$(MODULE_ARCH)
|
||||
illume_homepkg_LTLIBRARIES = src/modules/illume-home/module.la
|
||||
|
||||
src_modules_illume_home_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume_home_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_home_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_home_module_la_SOURCES = src/modules/illume-home/e_mod_main.c \
|
||||
src/modules/illume-home/e_mod_main.h \
|
||||
src/modules/illume-home/e_mod_config.c \
|
||||
src/modules/illume-home/e_mod_config.h \
|
||||
src/modules/illume-home/e_busycover.c \
|
||||
src/modules/illume-home/e_busycover.h
|
||||
|
||||
PHONIES += illume_home install-illume_home
|
||||
illume_home: $(illume_homepkg_LTLIBRARIES) $(illume_home_DATA)
|
||||
install-illume_home: install-illume_homeDATA install-illume_homepkgLTLIBRARIES
|
||||
endif
|
|
@ -1,29 +0,0 @@
|
|||
if USE_MODULE_ILLUME-INDICATOR
|
||||
illume_indicatordir = $(MDIR)/illume-indicator
|
||||
illume_indicator_DATA = src/modules/illume-indicator/e-module-illume-indicator.edj \
|
||||
src/modules/illume-indicator/module.desktop
|
||||
src/modules/illume-indicator/e-module-illume-indicator.edj
|
||||
|
||||
illume_indicatorpkgdir = $(MDIR)/illume-indicator/$(MODULE_ARCH)
|
||||
illume_indicatorpkg_LTLIBRARIES = src/modules/illume-indicator/module.la
|
||||
|
||||
src_modules_illume_indicator_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_indicator_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_indicator_module_la_SOURCES = src/modules/illume-indicator/e_mod_main.c \
|
||||
src/modules/illume-indicator/e_mod_main.h \
|
||||
src/modules/illume-indicator/e_mod_config.c \
|
||||
src/modules/illume-indicator/e_mod_config.h \
|
||||
src/modules/illume-indicator/e_mod_ind_win.c \
|
||||
src/modules/illume-indicator/e_mod_ind_win.h
|
||||
|
||||
if HAVE_ENOTIFY
|
||||
src_modules_illume_indicator_module_la_SOURCES += src/modules/illume-indicator/e_mod_notify.c \
|
||||
src/modules/illume-indicator/e_mod_notify.h
|
||||
endif
|
||||
|
||||
src_modules_illume_indicator_module_la_LIBADD = $(MOD_LIBS) @ENOTIFY_LIBS@
|
||||
|
||||
PHONIES += illume_indicator install-illume_indicator
|
||||
illume_indicator: $(illume_indicatorpkg_LTLIBRARIES) $(illume_indicator_DATA)
|
||||
install-illume_indicator: install-illume_indicatorDATA install-illume_indicatorpkgLTLIBRARIES
|
||||
endif
|
|
@ -1,18 +0,0 @@
|
|||
if USE_MODULE_ILLUME-KBD-TOGGLE
|
||||
illume_kbd_toggledir = $(MDIR)/illume-kbd-toggle
|
||||
illume_kbd_toggle_DATA = src/modules/illume-kbd-toggle/e-module-illume-kbd-toggle.edj \
|
||||
src/modules/illume-kbd-toggle/module.desktop
|
||||
|
||||
|
||||
illume_kbd_togglepkgdir = $(MDIR)/illume-kbd-toggle/$(MODULE_ARCH)
|
||||
illume_kbd_togglepkg_LTLIBRARIES = src/modules/illume-kbd-toggle/module.la
|
||||
|
||||
src_modules_illume_kbd_toggle_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume_kbd_toggle_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_kbd_toggle_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_kbd_toggle_module_la_SOURCES = src/modules/illume-kbd-toggle/e_mod_main.c
|
||||
|
||||
PHONIES += illume_kbd_toggle install-illume_kbd_toggle
|
||||
illume_kbd_toggle: $(illume_kbd_togglepkg_LTLIBRARIES) $(illume_kbd_toggle_DATA)
|
||||
install-illume_kbd_toggle: install-illume_kbd_toggleDATA install-illume_kbd_togglepkgLTLIBRARIES
|
||||
endif
|
|
@ -1,58 +0,0 @@
|
|||
if USE_MODULE_ILLUME-KEYBOARD
|
||||
illume_keyboarddir = $(MDIR)/illume-keyboard
|
||||
illume_keyboard_DATA = src/modules/illume-keyboard/e-module-illume-keyboard.edj \
|
||||
src/modules/illume-keyboard/module.desktop
|
||||
|
||||
src/modules/illume-keyboard/module.desktop.in
|
||||
|
||||
|
||||
# keyboards
|
||||
illumekeyboardsdir = $(MDIR)/illume-keyboard/keyboards
|
||||
illumekeyboards_DATA = src/modules/illume-keyboard/keyboards/ignore_built_in_keyboards \
|
||||
src/modules/illume-keyboard/keyboards/Default.kbd \
|
||||
src/modules/illume-keyboard/keyboards/alpha.png \
|
||||
src/modules/illume-keyboard/keyboards/Numbers.kbd \
|
||||
src/modules/illume-keyboard/keyboards/numeric.png \
|
||||
src/modules/illume-keyboard/keyboards/Terminal.kbd \
|
||||
src/modules/illume-keyboard/keyboards/qwerty.png \
|
||||
src/modules/illume-keyboard/keyboards/up.png \
|
||||
src/modules/illume-keyboard/keyboards/down.png \
|
||||
src/modules/illume-keyboard/keyboards/left.png \
|
||||
src/modules/illume-keyboard/keyboards/right.png \
|
||||
src/modules/illume-keyboard/keyboards/shift.png \
|
||||
src/modules/illume-keyboard/keyboards/tab.png \
|
||||
src/modules/illume-keyboard/keyboards/enter.png \
|
||||
src/modules/illume-keyboard/keyboards/backspace.png
|
||||
|
||||
|
||||
# dicts
|
||||
illumedictsdir = $(MDIR)/illume-keyboard/dicts
|
||||
illumedicts_DATA = src/modules/illume-keyboard/dicts/English_US.dic \
|
||||
src/modules/illume-keyboard/dicts/English_US_Small.dic
|
||||
|
||||
|
||||
|
||||
illume_keyboardpkgdir = $(MDIR)/illume-keyboard/$(MODULE_ARCH)
|
||||
illume_keyboardpkg_LTLIBRARIES = src/modules/illume-keyboard/module.la
|
||||
|
||||
src_modules_illume_keyboard_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume_keyboard_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_keyboard_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_keyboard_module_la_SOURCES = src/modules/illume-keyboard/e_mod_main.c \
|
||||
src/modules/illume-keyboard/e_mod_main.h \
|
||||
src/modules/illume-keyboard/e_kbd_int.c \
|
||||
src/modules/illume-keyboard/e_kbd_int.h \
|
||||
src/modules/illume-keyboard/e_kbd_dict.c \
|
||||
src/modules/illume-keyboard/e_kbd_dict.h \
|
||||
src/modules/illume-keyboard/e_kbd_buf.c \
|
||||
src/modules/illume-keyboard/e_kbd_buf.h \
|
||||
src/modules/illume-keyboard/e_kbd_send.c \
|
||||
src/modules/illume-keyboard/e_kbd_send.h \
|
||||
src/modules/illume-keyboard/e_mod_config.c \
|
||||
src/modules/illume-keyboard/e_mod_config.h
|
||||
|
||||
# TODO: incomplete
|
||||
PHONIES += illume_keyboard install-illume_keyboard
|
||||
illume_keyboard: $(illume_keyboardpkg_LTLIBRARIES) $(illume_keyboard_DATA)
|
||||
install-illume_keyboard: install-illume_keyboardDATA install-illume_keyboardpkgLTLIBRARIES
|
||||
endif
|
|
@ -1,18 +0,0 @@
|
|||
if USE_MODULE_ILLUME-MODE-TOGGLE
|
||||
illume_mode_toggledir = $(MDIR)/illume-mode-toggle
|
||||
illume_mode_toggle_DATA = src/modules/illume-mode-toggle/e-module-illume-mode-toggle.edj \
|
||||
src/modules/illume-mode-toggle/module.desktop
|
||||
|
||||
|
||||
illume_mode_togglepkgdir = $(MDIR)/illume-mode-toggle/$(MODULE_ARCH)
|
||||
illume_mode_togglepkg_LTLIBRARIES = src/modules/illume-mode-toggle/module.la
|
||||
|
||||
src_modules_illume_mode_toggle_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume_mode_toggle_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_mode_toggle_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_mode_toggle_module_la_SOURCES = src/modules/illume-mode-toggle/e_mod_main.c
|
||||
|
||||
PHONIES += illume_mode_toggle install-illume_mode_toggle
|
||||
illume_mode_toggle: $(illume_mode_togglepkg_LTLIBRARIES) $(illume_mode_toggle_DATA)
|
||||
install-illume_mode_toggle: install-illume_mode_toggleDATA install-illume_mode_togglepkgLTLIBRARIES
|
||||
endif
|
|
@ -1,25 +0,0 @@
|
|||
if USE_MODULE_ILLUME-SOFTKEY
|
||||
illume_softkeydir = $(MDIR)/illume-softkey
|
||||
illume_softkey_DATA = src/modules/illume-softkey/e-module-illume-softkey.edj \
|
||||
src/modules/illume-softkey/module.desktop
|
||||
|
||||
src/modules/illume-softkey/module.desktop.in
|
||||
|
||||
|
||||
illume_softkeypkgdir = $(MDIR)/illume-softkey/$(MODULE_ARCH)
|
||||
illume_softkeypkg_LTLIBRARIES = src/modules/illume-softkey/module.la
|
||||
|
||||
src_modules_illume_softkey_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume_softkey_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume_softkey_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume_softkey_module_la_SOURCES = src/modules/illume-softkey/e_mod_main.c \
|
||||
src/modules/illume-softkey/e_mod_main.h \
|
||||
src/modules/illume-softkey/e_mod_sft_win.c \
|
||||
src/modules/illume-softkey/e_mod_sft_win.h \
|
||||
src/modules/illume-softkey/e_mod_config.c \
|
||||
src/modules/illume-softkey/e_mod_config.h
|
||||
|
||||
PHONIES += illume_softkey install-illume_softkey
|
||||
illume_softkey: $(illume_softkeypkg_LTLIBRARIES) $(illume_softkey_DATA)
|
||||
install-illume_softkey: install-illume_softkeyDATA install-illume_softkeypkgLTLIBRARIES
|
||||
endif
|
|
@ -1,67 +0,0 @@
|
|||
EXTRA_DIST += src/modules/illume2/module.desktop.in \
|
||||
src/modules/illume2/e-module-illume2.edj
|
||||
if USE_MODULE_ILLUME2
|
||||
illume2dir = $(MDIR)/illume2
|
||||
illume2_DATA = src/modules/illume2/e-module-illume2.edj \
|
||||
src/modules/illume2/module.desktop
|
||||
|
||||
src/modules/illume2/module.desktop.in
|
||||
|
||||
# keyboards
|
||||
illume2keyboardsdir = $(MDIR)/illume2/keyboards
|
||||
illume2keyboards_DATA = src/modules/illume2/keyboards/ignore_built_in_keyboards
|
||||
|
||||
# policies
|
||||
## illume
|
||||
illume2policyillumedir = $(MDIR)/illume2/policies
|
||||
illume2policyillume_LTLIBRARIES = src/modules/illume2/policies/illume/illume.la
|
||||
ILLUME2POLICYCPPFLAGS = $(MOD_CPPFLAGS) -I$(top_srcdir)/src/modules/illume2
|
||||
|
||||
src_modules_illume2_policies_illume_illume_la_CPPFLAGS = $(ILLUME2POLICYCPPFLAGS)
|
||||
src_modules_illume2_policies_illume_illume_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume2_policies_illume_illume_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume2_policies_illume_illume_la_SOURCES = src/modules/illume2/policies/illume/policy.c \
|
||||
src/modules/illume2/policies/illume/policy.h \
|
||||
src/modules/illume2/policies/illume/illume.c \
|
||||
src/modules/illume2/policies/illume/illume.h
|
||||
src_modules_illume2_policies_illume_illume_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
## tablet
|
||||
src_modules_illume2policytabletdir = $(MDIR)/illume2/policies
|
||||
src_modules_illume2policytablet_LTLIBRARIES = src/modules/illume2/policies/tablet/tablet.la
|
||||
|
||||
src_modules_illume2_policies_tablet_tablet_la_CPPFLAGS = $(ILLUME2POLICYCPPFLAGS)
|
||||
src_modules_illume2_policies_tablet_tablet_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume2_policies_tablet_tablet_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume2_policies_tablet_tablet_la_SOURCES = src/modules/illume2/policies/tablet/policy.c \
|
||||
src/modules/illume2/policies/tablet/policy.h \
|
||||
src/modules/illume2/policies/tablet/tablet.c \
|
||||
src/modules/illume2/policies/tablet/tablet.h
|
||||
src_modules_illume2_policies_tablet_tablet_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
src_modules_illume2pkgdir = $(MDIR)/illume2/$(MODULE_ARCH)
|
||||
src_modules_illume2pkg_LTLIBRARIES = src/modules/illume2/module.la
|
||||
|
||||
src_modules_illume2_module_la_LIBADD = $(MOD_LIBS)
|
||||
src_modules_illume2_module_la_CPPFLAGS = $(MOD_CPPFLAGS)
|
||||
src_modules_illume2_module_la_LDFLAGS = $(MOD_LDFLAGS)
|
||||
src_modules_illume2_module_la_SOURCES = src/modules/illume2/e_mod_main.c \
|
||||
src/modules/illume2/e_mod_main.h \
|
||||
src/modules/illume2/e_illume.h \
|
||||
src/modules/illume2/e_illume.c \
|
||||
src/modules/illume2/e_illume_private.h \
|
||||
src/modules/illume2/e_mod_config_policy.c \
|
||||
src/modules/illume2/e_mod_select_window.c \
|
||||
src/modules/illume2/e_mod_config_windows.c \
|
||||
src/modules/illume2/e_mod_config_animation.c \
|
||||
src/modules/illume2/e_mod_quickpanel.c \
|
||||
src/modules/illume2/e_mod_kbd_device.c \
|
||||
src/modules/illume2/e_mod_kbd.c \
|
||||
src/modules/illume2/e_mod_policy.c \
|
||||
src/modules/illume2/e_mod_config.c
|
||||
|
||||
# TODO: incomplete
|
||||
PHONIES += illume2 install-illume2
|
||||
illume2: $(illume2pkg_LTLIBRARIES) $(illume2_DATA)
|
||||
install-illume2: install-illume2DATA install-illume2pkgLTLIBRARIES
|
||||
endif
|
|
@ -1,199 +0,0 @@
|
|||
#include "e.h"
|
||||
|
||||
typedef struct _Instance Instance;
|
||||
struct _Instance
|
||||
{
|
||||
E_Gadcon_Client *gcc;
|
||||
Evas_Object *obj;
|
||||
Ecore_Poller *poller;
|
||||
int on;
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
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 *cc);
|
||||
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *cc, Evas *evas);
|
||||
static const char *_gc_id_new(const E_Gadcon_Client_Class *cc);
|
||||
static Eina_Bool _cb_poll(void *data);
|
||||
static int _get_interface_class(int iclass);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *instances = NULL;
|
||||
static const char *_bt_mod_dir = NULL;
|
||||
|
||||
static const E_Gadcon_Client_Class _gc_class =
|
||||
{
|
||||
GADCON_CLIENT_CLASS_VERSION, "illume-bluetooth",
|
||||
{ _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
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
static E_Gadcon_Client *
|
||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||
{
|
||||
Instance *inst;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
inst = E_NEW(Instance, 1);
|
||||
|
||||
inst->obj = edje_object_add(gc->evas);
|
||||
if (!e_theme_edje_object_set(inst->obj, "base/theme/modules/illume-bluetooth",
|
||||
"modules/illume-bluetooth/main"))
|
||||
{
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-bluetooth.edj",
|
||||
_bt_mod_dir);
|
||||
edje_object_file_set(inst->obj, buff, "modules/illume-bluetooth/main");
|
||||
}
|
||||
evas_object_show(inst->obj);
|
||||
|
||||
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->obj);
|
||||
inst->gcc->data = inst;
|
||||
|
||||
inst->on = -1;
|
||||
inst->poller = ecore_poller_add(ECORE_POLLER_CORE, 16, _cb_poll, inst);
|
||||
return inst->gcc;
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_shutdown(E_Gadcon_Client *gcc)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
if (!(inst = gcc->data)) return;
|
||||
instances = eina_list_remove(instances, inst);
|
||||
if (inst->poller) ecore_poller_del(inst->poller);
|
||||
if (inst->obj) evas_object_del(inst->obj);
|
||||
E_FREE(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient EINA_UNUSED)
|
||||
{
|
||||
Instance *inst;
|
||||
int mw, mh, xw, xh;
|
||||
|
||||
inst = gcc->data;
|
||||
edje_object_size_min_get(inst->obj, &mw, &mh);
|
||||
edje_object_size_max_get(inst->obj, &xw, &xh);
|
||||
if ((mw < 1) || (mh < 1))
|
||||
edje_object_size_min_calc(inst->obj, &mw, &mh);
|
||||
if (mw < 4) mw = 4;
|
||||
if (mh < 4) mh = 4;
|
||||
if ((xw > 0) && (xh > 0))
|
||||
e_gadcon_client_aspect_set(gcc, xw, xh);
|
||||
e_gadcon_client_min_size_set(gcc, mw, mh);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_label(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
return _("Illume Bluetooth");
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_gc_icon(const E_Gadcon_Client_Class *cc EINA_UNUSED, Evas *evas)
|
||||
{
|
||||
Evas_Object *o;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-bluetooth.edj",
|
||||
_bt_mod_dir);
|
||||
o = edje_object_add(evas);
|
||||
edje_object_file_set(o, buff, "icon");
|
||||
return o;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_id_new(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
static char buff[32];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s.%d", _gc_class.name,
|
||||
eina_list_count(instances));
|
||||
return buff;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_poll(void *data)
|
||||
{
|
||||
Instance *inst;
|
||||
int pon;
|
||||
|
||||
inst = data;
|
||||
pon = inst->on;
|
||||
inst->on = _get_interface_class(0xe0);
|
||||
if (inst->on != pon)
|
||||
{
|
||||
if (inst->on)
|
||||
edje_object_signal_emit(inst->obj, "e,state,active", "e");
|
||||
else
|
||||
edje_object_signal_emit(inst->obj, "e,state,passive", "e");
|
||||
}
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static int
|
||||
_get_interface_class(int iclass)
|
||||
{
|
||||
Eina_List *devs;
|
||||
char *name;
|
||||
|
||||
devs = ecore_file_ls("/sys/bus/usb/devices");
|
||||
EINA_LIST_FREE(devs, name)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
FILE *f;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s/%s",
|
||||
"/sys/bus/usb/devices", name, "bInterfaceClass");
|
||||
f = fopen(buf, "r");
|
||||
if (f)
|
||||
{
|
||||
if (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
int id = -1;
|
||||
|
||||
sscanf(buf, "%x", &id);
|
||||
if (iclass == id)
|
||||
{
|
||||
EINA_LIST_FREE(devs, name)
|
||||
free(name);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
free(name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Bluetooth" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
_bt_mod_dir = eina_stringshare_add(m->dir);
|
||||
e_gadcon_provider_register(&_gc_class);
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
e_gadcon_provider_unregister(&_gc_class);
|
||||
if (_bt_mod_dir) eina_stringshare_del(_bt_mod_dir);
|
||||
_bt_mod_dir = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Bluetooth
|
||||
Name[ca]=Illume-Bluetooth
|
||||
Name[de]=Illume-Bluetooth
|
||||
Name[eo]=Bludento Illume
|
||||
Name[fr]=Bluetooth Illume
|
||||
Name[gl]=Illume-Bluetooth
|
||||
Name[ms]=Illume-Bluetooth
|
||||
Name[sr]=Блутут одсјај
|
||||
Name[tr]=Illume-Bluetooth
|
||||
Icon=e-module-illume-bluetooth
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1,134 +0,0 @@
|
|||
#include "e.h"
|
||||
|
||||
typedef struct _Instance Instance;
|
||||
struct _Instance
|
||||
{
|
||||
E_Gadcon_Client *gcc;
|
||||
Evas_Object *o_toggle;
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
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 *cc);
|
||||
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *cc, Evas *evas);
|
||||
static const char *_gc_id_new(const E_Gadcon_Client_Class *cc);
|
||||
static void _cb_action_home(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *instances = NULL;
|
||||
static const char *mod_dir = NULL;
|
||||
|
||||
static const E_Gadcon_Client_Class _gc_class =
|
||||
{
|
||||
GADCON_CLIENT_CLASS_VERSION, "illume-home-toggle",
|
||||
{ _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
|
||||
};
|
||||
|
||||
/* public functions */
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Home Toggle" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
mod_dir = eina_stringshare_add(m->dir);
|
||||
e_gadcon_provider_register(&_gc_class);
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
e_gadcon_provider_unregister(&_gc_class);
|
||||
if (mod_dir) eina_stringshare_del(mod_dir);
|
||||
mod_dir = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static E_Gadcon_Client *
|
||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
inst = E_NEW(Instance, 1);
|
||||
inst->o_toggle = edje_object_add(gc->evas);
|
||||
e_theme_edje_object_set(inst->o_toggle,
|
||||
"base/theme/modules/illume_home_toggle",
|
||||
"e/modules/illume_home_toggle/main");
|
||||
|
||||
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_toggle);
|
||||
inst->gcc->data = inst;
|
||||
|
||||
edje_object_signal_callback_add(inst->o_toggle, "e,action,home", "",
|
||||
_cb_action_home, inst);
|
||||
|
||||
instances = eina_list_append(instances, inst);
|
||||
return inst->gcc;
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_shutdown(E_Gadcon_Client *gcc)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
if (!(inst = gcc->data)) return;
|
||||
instances = eina_list_remove(instances, inst);
|
||||
if (inst->o_toggle) evas_object_del(inst->o_toggle);
|
||||
E_FREE(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient EINA_UNUSED)
|
||||
{
|
||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_label(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
return _("Illume-Home-Toggle");
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_gc_icon(const E_Gadcon_Client_Class *cc EINA_UNUSED, Evas *evas)
|
||||
{
|
||||
Evas_Object *o;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-home-toggle.edj", mod_dir);
|
||||
o = edje_object_add(evas);
|
||||
edje_object_file_set(o, buff, "icon");
|
||||
return o;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_id_new(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
static char buff[32];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s.%d", _gc_class.name,
|
||||
eina_list_count(instances));
|
||||
return buff;
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_action_home(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
Instance *inst;
|
||||
E_Zone *zone;
|
||||
|
||||
if (!(inst = data)) return;
|
||||
zone = inst->gcc->gadcon->zone;
|
||||
ecore_x_e_illume_focus_home_send(zone->black_win);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Home-Toggle
|
||||
Name[ca]=Illume-Home-Toggle
|
||||
Name[de]=Illume-Startumschalter
|
||||
Name[el]=Illume-Home-Toggle
|
||||
Name[eo]=Baskulilo de hejmo Illume
|
||||
Name[ms]=Illume-Home-Toggle
|
||||
Name[sr]=Прекидач личног одсјаја
|
||||
Name[tr]=Illume-Ev-Değiştirici
|
||||
Icon=e-module-illume-home-toggle
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1,91 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_busycover.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_busycover_cb_free(E_Busycover *cover);
|
||||
|
||||
EAPI E_Busycover *
|
||||
e_busycover_new(E_Win *win)
|
||||
{
|
||||
E_Busycover *cover;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
cover = E_OBJECT_ALLOC(E_Busycover, E_BUSYCOVER_TYPE, _e_busycover_cb_free);
|
||||
if (!cover) return NULL;
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-home.edj",
|
||||
il_home_cfg->mod_dir);
|
||||
|
||||
cover->o_base = edje_object_add(evas_object_evas_get(win));
|
||||
if (!e_theme_edje_object_set(cover->o_base,
|
||||
"base/theme/modules/illume-home",
|
||||
"modules/illume-home/busycover"))
|
||||
edje_object_file_set(cover->o_base, buff, "modules/illume-home/busycover");
|
||||
edje_object_part_text_set(cover->o_base, "e.text.title", _("LOADING"));
|
||||
evas_object_move(cover->o_base, win->x, win->y);
|
||||
evas_object_resize(cover->o_base, win->w, win->h);
|
||||
evas_object_layer_set(cover->o_base, 999);
|
||||
return cover;
|
||||
}
|
||||
|
||||
EAPI E_Busycover_Handle *
|
||||
e_busycover_push(E_Busycover *cover, const char *msg, const char *icon)
|
||||
{
|
||||
E_Busycover_Handle *handle;
|
||||
|
||||
E_OBJECT_CHECK(cover);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(cover, E_BUSYCOVER_TYPE, NULL);
|
||||
|
||||
handle = E_NEW(E_Busycover_Handle, 1);
|
||||
handle->cover = cover;
|
||||
if (msg) handle->msg = eina_stringshare_add(msg);
|
||||
if (icon) handle->icon = eina_stringshare_add(icon);
|
||||
cover->handles = eina_list_append(cover->handles, handle);
|
||||
edje_object_part_text_set(cover->o_base, "e.text.title", msg);
|
||||
evas_object_show(cover->o_base);
|
||||
return handle;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_busycover_pop(E_Busycover *cover, E_Busycover_Handle *handle)
|
||||
{
|
||||
E_OBJECT_CHECK(cover);
|
||||
E_OBJECT_TYPE_CHECK(cover, E_BUSYCOVER_TYPE);
|
||||
if (!eina_list_data_find(cover->handles, handle)) return;
|
||||
cover->handles = eina_list_remove(cover->handles, handle);
|
||||
if (handle->msg) eina_stringshare_del(handle->msg);
|
||||
if (handle->icon) eina_stringshare_del(handle->icon);
|
||||
E_FREE(handle);
|
||||
if (cover->handles)
|
||||
{
|
||||
handle = cover->handles->data;
|
||||
edje_object_part_text_set(cover->o_base, "e.text.title", handle->msg);
|
||||
}
|
||||
else
|
||||
evas_object_hide(cover->o_base);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_busycover_resize(E_Busycover *cover, int w, int h)
|
||||
{
|
||||
E_OBJECT_CHECK(cover);
|
||||
E_OBJECT_TYPE_CHECK(cover, E_BUSYCOVER_TYPE);
|
||||
evas_object_resize(cover->o_base, w, h);
|
||||
}
|
||||
|
||||
/* local function prototypes */
|
||||
static void
|
||||
_e_busycover_cb_free(E_Busycover *cover)
|
||||
{
|
||||
E_Busycover_Handle *handle;
|
||||
|
||||
EINA_LIST_FREE(cover->handles, handle)
|
||||
{
|
||||
if (handle->msg) eina_stringshare_del(handle->msg);
|
||||
if (handle->icon) eina_stringshare_del(handle->icon);
|
||||
E_FREE(handle);
|
||||
}
|
||||
|
||||
if (cover->o_base) evas_object_del(cover->o_base);
|
||||
E_FREE(cover);
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
#ifndef E_BUSYCOVER_H
|
||||
# define E_BUSYCOVER_H
|
||||
|
||||
# define E_BUSYCOVER_TYPE 0xE1b0782
|
||||
|
||||
typedef struct _E_Busycover E_Busycover;
|
||||
typedef struct _E_Busycover_Handle E_Busycover_Handle;
|
||||
|
||||
struct _E_Busycover
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
Evas_Object *o_base;
|
||||
Eina_List *handles;
|
||||
};
|
||||
struct _E_Busycover_Handle
|
||||
{
|
||||
E_Busycover *cover;
|
||||
const char *msg, *icon;
|
||||
};
|
||||
|
||||
EAPI E_Busycover *e_busycover_new(E_Win *win);
|
||||
EAPI E_Busycover_Handle *e_busycover_push(E_Busycover *cover, const char *msg, const char *icon);
|
||||
EAPI void e_busycover_pop(E_Busycover *cover, E_Busycover_Handle *handle);
|
||||
EAPI void e_busycover_resize(E_Busycover *cover, int w, int h);
|
||||
|
||||
#endif
|
|
@ -1,211 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void *_il_home_config_create(E_Config_Dialog *cfd);
|
||||
static void _il_home_config_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_il_home_config_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static void _il_home_config_changed(void *data, Evas_Object *obj, void *event);
|
||||
static void _il_home_config_slider_changed(void *data, Evas_Object *obj);
|
||||
static void _il_home_config_click_changed(void *data, Evas_Object *obj, void *event);
|
||||
static Eina_Bool _il_home_config_change_timeout(void *data);
|
||||
|
||||
/* local variables */
|
||||
EAPI Il_Home_Config *il_home_cfg = NULL;
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
Ecore_Timer *_il_home_config_change_timer = NULL;
|
||||
Evas_Object *delay_label, *delay_slider;
|
||||
|
||||
/* public functions */
|
||||
int
|
||||
il_home_config_init(E_Module *m)
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
conf_edd = E_CONFIG_DD_NEW("Illume-Home_Cfg", Il_Home_Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Il_Home_Config
|
||||
#define D conf_edd
|
||||
E_CONFIG_VAL(D, T, version, INT);
|
||||
E_CONFIG_VAL(D, T, icon_size, INT);
|
||||
E_CONFIG_VAL(D, T, single_click, INT);
|
||||
E_CONFIG_VAL(D, T, single_click_delay, INT);
|
||||
|
||||
il_home_cfg = e_config_domain_load("module.illume-home", conf_edd);
|
||||
if ((il_home_cfg) &&
|
||||
((il_home_cfg->version >> 16) < IL_CONFIG_MAJ))
|
||||
{
|
||||
E_FREE(il_home_cfg);
|
||||
il_home_cfg = NULL;
|
||||
}
|
||||
if (!il_home_cfg)
|
||||
{
|
||||
il_home_cfg = E_NEW(Il_Home_Config, 1);
|
||||
il_home_cfg->version = 0;
|
||||
il_home_cfg->icon_size = 120;
|
||||
il_home_cfg->single_click = 1;
|
||||
il_home_cfg->single_click_delay = 50;
|
||||
}
|
||||
if (il_home_cfg)
|
||||
{
|
||||
/* Add new config variables here */
|
||||
/* if ((il_home_cfg->version & 0xffff) < 1) */
|
||||
il_home_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||
}
|
||||
|
||||
il_home_cfg->mod_dir = eina_stringshare_add(m->dir);
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-home.edj",
|
||||
il_home_cfg->mod_dir);
|
||||
|
||||
e_configure_registry_category_add("illume", 0, _("Illume"), NULL,
|
||||
"enlightenment/display");
|
||||
e_configure_registry_generic_item_add("illume/home", 0, _("Home"),
|
||||
buff, "icon", il_home_config_show);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_home_config_shutdown(void)
|
||||
{
|
||||
il_home_cfg->cfd = NULL;
|
||||
|
||||
e_configure_registry_item_del("illume/home");
|
||||
e_configure_registry_category_del("illume");
|
||||
|
||||
if (il_home_cfg->mod_dir) eina_stringshare_del(il_home_cfg->mod_dir);
|
||||
|
||||
E_FREE(il_home_cfg);
|
||||
il_home_cfg = NULL;
|
||||
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_home_config_save(void)
|
||||
{
|
||||
e_config_domain_save("module.illume-home", conf_edd, il_home_cfg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
il_home_config_show(E_Comp *comp, const char *params EINA_UNUSED)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
E_Config_Dialog_View *v = NULL;
|
||||
|
||||
if (e_config_dialog_find("E", "_config_illume_home_settings")) return;
|
||||
|
||||
v = E_NEW(E_Config_Dialog_View, 1);
|
||||
v->create_cfdata = _il_home_config_create;
|
||||
v->free_cfdata = _il_home_config_free;
|
||||
v->basic.create_widgets = _il_home_config_ui;
|
||||
v->basic_only = 1;
|
||||
v->normal_win = 1;
|
||||
v->scroll = 1;
|
||||
|
||||
cfd = e_config_dialog_new(NULL, _("Home Settings"), "E",
|
||||
"_config_illume_home_settings",
|
||||
"enlightenment/launcher_settings", 0, v, NULL);
|
||||
il_home_cfg->cfd = cfd;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void *
|
||||
_il_home_config_create(E_Config_Dialog *cfd EINA_UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_config_free(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata EINA_UNUSED)
|
||||
{
|
||||
il_home_cfg->cfd = NULL;
|
||||
il_home_win_cfg_update();
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_il_home_config_ui(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data *cfdata EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *list, *of, *o;
|
||||
E_Radio_Group *rg;
|
||||
|
||||
list = e_widget_list_add(evas, 0, 0);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Icon Size"), 0);
|
||||
rg = e_widget_radio_group_new(&(il_home_cfg->icon_size));
|
||||
o = e_widget_radio_add(evas, _("Small"), 60, rg);
|
||||
e_widget_framelist_object_append(of, o);
|
||||
evas_object_smart_callback_add(o, "changed", _il_home_config_changed, NULL);
|
||||
o = e_widget_radio_add(evas, _("Medium"), 80, rg);
|
||||
e_widget_framelist_object_append(of, o);
|
||||
evas_object_smart_callback_add(o, "changed", _il_home_config_changed, NULL);
|
||||
o = e_widget_radio_add(evas, _("Large"), 120, rg);
|
||||
e_widget_framelist_object_append(of, o);
|
||||
evas_object_smart_callback_add(o, "changed", _il_home_config_changed, NULL);
|
||||
o = e_widget_radio_add(evas, _("Very Large"), 160, rg);
|
||||
e_widget_framelist_object_append(of, o);
|
||||
evas_object_smart_callback_add(o, "changed", _il_home_config_changed, NULL);
|
||||
o = e_widget_radio_add(evas, _("Massive"), 240, rg);
|
||||
e_widget_framelist_object_append(of, o);
|
||||
evas_object_smart_callback_add(o, "changed", _il_home_config_changed, NULL);
|
||||
e_widget_list_object_append(list, of, 1, 0, 0.0);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Launch Action"), 0);
|
||||
o = e_widget_check_add(evas, _("Single press"),
|
||||
&(il_home_cfg->single_click));
|
||||
e_widget_framelist_object_append(of, o);
|
||||
evas_object_smart_callback_add(o, "changed",
|
||||
_il_home_config_click_changed, NULL);
|
||||
o = e_widget_label_add(evas, _("Press Delay"));
|
||||
delay_label = o;
|
||||
e_widget_disabled_set(o, !(il_home_cfg->single_click));
|
||||
e_widget_framelist_object_append(of, o);
|
||||
o = e_widget_slider_add(evas, 1, 0, "%1.0f ms", 0, 350, 1, 0, NULL,
|
||||
&(il_home_cfg->single_click_delay), 150);
|
||||
delay_slider = o;
|
||||
e_widget_on_change_hook_set(o, _il_home_config_slider_changed, NULL);
|
||||
e_widget_disabled_set(o, !(il_home_cfg->single_click));
|
||||
e_widget_framelist_object_append(of, o);
|
||||
e_widget_list_object_append(list, of, 1, 0, 0.0);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_config_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
if (_il_home_config_change_timer)
|
||||
ecore_timer_del(_il_home_config_change_timer);
|
||||
_il_home_config_change_timer =
|
||||
ecore_timer_add(0.5, _il_home_config_change_timeout, data);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_config_slider_changed(void *data, Evas_Object *obj EINA_UNUSED)
|
||||
{
|
||||
if (_il_home_config_change_timer)
|
||||
ecore_timer_del(_il_home_config_change_timer);
|
||||
_il_home_config_change_timer =
|
||||
ecore_timer_add(0.5, _il_home_config_change_timeout, data);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_config_click_changed(void *data, Evas_Object *obj, void *event)
|
||||
{
|
||||
e_widget_disabled_set(delay_label, !il_home_cfg->single_click);
|
||||
e_widget_disabled_set(delay_slider, !il_home_cfg->single_click);
|
||||
_il_home_config_changed(data, obj, event);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_config_change_timeout(void *data EINA_UNUSED)
|
||||
{
|
||||
il_home_win_cfg_update();
|
||||
e_config_save_queue();
|
||||
_il_home_config_change_timer = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
#ifndef E_MOD_CONFIG_H
|
||||
#define E_MOD_CONFIG_H
|
||||
|
||||
#define IL_CONFIG_MIN 0
|
||||
#define IL_CONFIG_MAJ 0
|
||||
|
||||
typedef struct _Il_Home_Config Il_Home_Config;
|
||||
|
||||
struct _Il_Home_Config
|
||||
{
|
||||
int version;
|
||||
int mode, icon_size;
|
||||
int single_click, single_click_delay;
|
||||
|
||||
// Not User Configurable. Placeholders
|
||||
const char *mod_dir;
|
||||
E_Config_Dialog *cfd;
|
||||
};
|
||||
|
||||
int il_home_config_init(E_Module *m);
|
||||
int il_home_config_shutdown(void);
|
||||
int il_home_config_save(void);
|
||||
void il_home_config_show(E_Comp *comp, const char *params);
|
||||
|
||||
extern EAPI Il_Home_Config *il_home_cfg;
|
||||
|
||||
#endif
|
|
@ -1,753 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
#include "e_busycover.h"
|
||||
|
||||
#define IL_HOME_WIN_TYPE 0xE0b0102f
|
||||
|
||||
/* local structures */
|
||||
typedef struct _Il_Home_Win Il_Home_Win;
|
||||
typedef struct _Il_Home_Exec Il_Home_Exec;
|
||||
|
||||
struct _Il_Home_Win
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
E_Win *win;
|
||||
Evas_Object *o_bg, *o_sf, *o_fm, *o_cover;
|
||||
E_Busycover *cover;
|
||||
E_Zone *zone;
|
||||
};
|
||||
|
||||
struct _Il_Home_Exec
|
||||
{
|
||||
E_Busycover *cover;
|
||||
Efreet_Desktop *desktop;
|
||||
Ecore_Exe *exec;
|
||||
E_Client *client;
|
||||
E_Zone *zone;
|
||||
Ecore_Timer *timeout;
|
||||
int startup_id;
|
||||
pid_t pid;
|
||||
void *handle;
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
static void _il_home_apps_populate(void);
|
||||
static void _il_home_apps_unpopulate(void);
|
||||
static void _il_home_desks_populate(void);
|
||||
static void _il_home_desktop_run(Il_Home_Win *hwin, Efreet_Desktop *desktop);
|
||||
static E_Client *_il_home_desktop_find_border(E_Zone *zone, Efreet_Desktop *desktop);
|
||||
static void _il_home_win_new(E_Zone *zone);
|
||||
static void _il_home_win_cb_free(Il_Home_Win *hwin);
|
||||
static void _il_home_win_cb_resize(E_Win *win);
|
||||
static void _il_home_fmc_set(Evas_Object *obj);
|
||||
static Eina_Bool _il_home_update_deferred(void *data EINA_UNUSED);
|
||||
static void _il_home_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
|
||||
static void _il_home_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
|
||||
static void _il_home_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
|
||||
static void _il_home_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
|
||||
static void _il_home_cb_selected(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED);
|
||||
static Eina_Bool _il_home_desktop_cache_update(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED);
|
||||
static Eina_Bool _il_home_cb_border_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _il_home_cb_border_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _il_home_cb_exe_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _il_home_cb_exe_timeout(void *data);
|
||||
static Eina_Bool _il_home_cb_client_message(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _il_home_cb_prop_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _il_home_cb_bg_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *hwins = NULL;
|
||||
static Eina_List *hdls = NULL;
|
||||
static Eina_List *desks = NULL;
|
||||
static Eina_List *exes = NULL;
|
||||
static Ecore_Timer *defer = NULL;
|
||||
|
||||
/* public functions */
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Home" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
const Eina_List *l;
|
||||
E_Comp *comp;
|
||||
|
||||
if (!il_home_config_init(m)) return NULL;
|
||||
|
||||
_il_home_apps_unpopulate();
|
||||
_il_home_apps_populate();
|
||||
|
||||
hdls =
|
||||
eina_list_append(hdls,
|
||||
ecore_event_handler_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE,
|
||||
_il_home_desktop_cache_update,
|
||||
NULL));
|
||||
|
||||
hdls =
|
||||
eina_list_append(hdls,
|
||||
ecore_event_handler_add(E_EVENT_CLIENT_ADD,
|
||||
_il_home_cb_border_add, NULL));
|
||||
hdls =
|
||||
eina_list_append(hdls,
|
||||
ecore_event_handler_add(E_EVENT_CLIENT_REMOVE,
|
||||
_il_home_cb_border_del, NULL));
|
||||
hdls =
|
||||
eina_list_append(hdls,
|
||||
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
|
||||
_il_home_cb_exe_del, NULL));
|
||||
hdls =
|
||||
eina_list_append(hdls,
|
||||
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
|
||||
_il_home_cb_client_message,
|
||||
NULL));
|
||||
hdls =
|
||||
eina_list_append(hdls,
|
||||
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
|
||||
_il_home_cb_prop_change,
|
||||
NULL));
|
||||
hdls =
|
||||
eina_list_append(hdls,
|
||||
ecore_event_handler_add(E_EVENT_BG_UPDATE,
|
||||
_il_home_cb_bg_change, NULL));
|
||||
|
||||
EINA_LIST_FOREACH(e_comp_list(), l, comp)
|
||||
{
|
||||
E_Zone *zone;
|
||||
Eina_List *zl;
|
||||
|
||||
EINA_LIST_FOREACH(comp->zones, zl, zone)
|
||||
{
|
||||
Ecore_X_Illume_Mode mode;
|
||||
|
||||
mode = ecore_x_e_illume_mode_get(zone->black_win);
|
||||
_il_home_win_new(zone);
|
||||
if (mode > ECORE_X_ILLUME_MODE_SINGLE)
|
||||
_il_home_win_new(zone);
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
Ecore_Event_Handler *hdl;
|
||||
Il_Home_Win *hwin;
|
||||
Il_Home_Exec *exe;
|
||||
|
||||
EINA_LIST_FREE(hwins, hwin)
|
||||
e_object_del(E_OBJECT(hwin));
|
||||
|
||||
EINA_LIST_FREE(exes, exe)
|
||||
{
|
||||
if (exe->exec)
|
||||
{
|
||||
ecore_exe_terminate(exe->exec);
|
||||
ecore_exe_free(exe->exec);
|
||||
}
|
||||
if (exe->handle) e_busycover_pop(exe->cover, exe->handle);
|
||||
if (exe->timeout) ecore_timer_del(exe->timeout);
|
||||
if (exe->desktop) efreet_desktop_free(exe->desktop);
|
||||
E_FREE(exe);
|
||||
}
|
||||
|
||||
EINA_LIST_FREE(hdls, hdl)
|
||||
ecore_event_handler_del(hdl);
|
||||
|
||||
_il_home_apps_unpopulate();
|
||||
|
||||
il_home_config_shutdown();
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return il_home_config_save();
|
||||
}
|
||||
|
||||
void
|
||||
il_home_win_cfg_update(void)
|
||||
{
|
||||
_il_home_apps_unpopulate();
|
||||
_il_home_apps_populate();
|
||||
}
|
||||
|
||||
/* local function prototypes */
|
||||
static void
|
||||
_il_home_apps_populate(void)
|
||||
{
|
||||
Il_Home_Win *hwin;
|
||||
Eina_List *l;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
e_user_dir_concat_static(buff, "appshadow");
|
||||
ecore_file_mkpath(buff);
|
||||
|
||||
_il_home_desks_populate();
|
||||
|
||||
EINA_LIST_FOREACH(hwins, l, hwin)
|
||||
{
|
||||
_il_home_fmc_set(hwin->o_fm);
|
||||
e_fm2_path_set(hwin->o_fm, NULL, buff);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_apps_unpopulate(void)
|
||||
{
|
||||
Efreet_Desktop *desktop;
|
||||
Eina_List *files;
|
||||
char buff[PATH_MAX], *file;
|
||||
size_t len;
|
||||
|
||||
EINA_LIST_FREE(desks, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
|
||||
len = e_user_dir_concat_static(buff, "appshadow");
|
||||
if ((len + 2) >= sizeof(buff)) return;
|
||||
|
||||
files = ecore_file_ls(buff);
|
||||
buff[len] = '/';
|
||||
len++;
|
||||
|
||||
EINA_LIST_FREE(files, file)
|
||||
{
|
||||
if (eina_strlcpy(buff + len, file, sizeof(buff) - len) >= sizeof(buff) - len)
|
||||
continue;
|
||||
ecore_file_unlink(buff);
|
||||
free(file);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_desks_populate(void)
|
||||
{
|
||||
Efreet_Menu *menu, *entry;
|
||||
Eina_List *ml, *settings, *sys, *kbd;
|
||||
Efreet_Desktop *desktop;
|
||||
int num = 0;
|
||||
|
||||
if (!(menu = efreet_menu_get())) return;
|
||||
|
||||
settings = efreet_util_desktop_category_list("Settings");
|
||||
sys = efreet_util_desktop_category_list("System");
|
||||
kbd = efreet_util_desktop_category_list("Keyboard");
|
||||
|
||||
EINA_LIST_FOREACH(menu->entries, ml, entry)
|
||||
{
|
||||
Eina_List *sl;
|
||||
Efreet_Menu *sm;
|
||||
|
||||
if (entry->type != EFREET_MENU_ENTRY_MENU) continue;
|
||||
EINA_LIST_FOREACH(entry->entries, sl, sm)
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
if (sm->type != EFREET_MENU_ENTRY_DESKTOP) continue;
|
||||
if (!(desktop = sm->desktop)) continue;
|
||||
if ((settings) && (sys) &&
|
||||
(eina_list_data_find(settings, desktop)) &&
|
||||
(eina_list_data_find(sys, desktop))) continue;
|
||||
if ((kbd) && (eina_list_data_find(kbd, desktop)))
|
||||
continue;
|
||||
efreet_desktop_ref(desktop);
|
||||
desks = eina_list_append(desks, desktop);
|
||||
e_user_dir_snprintf(buff, sizeof(buff),
|
||||
"appshadow/%04x.desktop", num);
|
||||
ecore_file_symlink(desktop->orig_path, buff);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
efreet_menu_free(menu);
|
||||
|
||||
EINA_LIST_FREE(settings, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
EINA_LIST_FREE(sys, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
EINA_LIST_FREE(kbd, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_desktop_run(Il_Home_Win *hwin, Efreet_Desktop *desktop)
|
||||
{
|
||||
E_Exec_Instance *eins;
|
||||
Il_Home_Exec *exec;
|
||||
Eina_List *l;
|
||||
E_Client *ec;
|
||||
char buff[4096];
|
||||
|
||||
if ((!hwin) || (!desktop) || (!desktop->exec)) return;
|
||||
EINA_LIST_FOREACH(exes, l, exec)
|
||||
{
|
||||
if (exec->desktop != desktop) continue;
|
||||
if ((exec->client) && (exec->client->zone == hwin->zone))
|
||||
{
|
||||
e_client_uniconify(exec->client);
|
||||
evas_object_raise(exec->client->frame);
|
||||
evas_object_focus_set(exec->client->frame, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((ec = _il_home_desktop_find_border(hwin->zone, desktop)))
|
||||
{
|
||||
e_client_uniconify(ec);
|
||||
evas_object_raise(ec->frame);
|
||||
evas_object_focus_set(ec->frame, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
exec = E_NEW(Il_Home_Exec, 1);
|
||||
if (!exec) return;
|
||||
exec->cover = hwin->cover;
|
||||
eins = e_exec(hwin->zone, desktop, NULL, NULL, "illume-home");
|
||||
exec->desktop = desktop;
|
||||
exec->zone = hwin->zone;
|
||||
if (eins)
|
||||
{
|
||||
exec->exec = eins->exe;
|
||||
exec->startup_id = eins->startup_id;
|
||||
if (eins->exe)
|
||||
exec->pid = ecore_exe_pid_get(eins->exe);
|
||||
}
|
||||
exec->timeout = ecore_timer_add(2.0, _il_home_cb_exe_timeout, exec);
|
||||
snprintf(buff, sizeof(buff), "Starting %s", desktop->name);
|
||||
exec->handle = e_busycover_push(hwin->cover, buff, NULL);
|
||||
exes = eina_list_append(exes, exec);
|
||||
}
|
||||
|
||||
static E_Client *
|
||||
_il_home_desktop_find_border(E_Zone *zone, Efreet_Desktop *desktop)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Client *ec;
|
||||
char *exe = NULL, *p;
|
||||
|
||||
if (!desktop) return NULL;
|
||||
if (!desktop->exec) return NULL;
|
||||
p = strchr(desktop->exec, ' ');
|
||||
if (!p)
|
||||
exe = strdup(desktop->exec);
|
||||
else
|
||||
{
|
||||
size_t s = p - desktop->exec + 1;
|
||||
exe = calloc(1, s);
|
||||
if (exe) eina_strlcpy(exe, desktop->exec, s);
|
||||
}
|
||||
if (exe)
|
||||
{
|
||||
p = strrchr(exe, '/');
|
||||
if (p) strcpy(exe, p + 1);
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(e_comp->clients, l, ec)
|
||||
{
|
||||
if (e_client_util_ignored_get(ec)) continue;
|
||||
if (ec->zone != zone) continue;
|
||||
if (e_exec_startup_id_pid_find(ec->netwm.pid,
|
||||
ec->netwm.startup_id) == desktop)
|
||||
{
|
||||
free(exe);
|
||||
return ec;
|
||||
}
|
||||
if (exe)
|
||||
{
|
||||
if (ec->icccm.command.argv)
|
||||
{
|
||||
char *pp;
|
||||
|
||||
pp = strrchr(ec->icccm.command.argv[0], '/');
|
||||
if (!pp) pp = ec->icccm.command.argv[0];
|
||||
if (!strcmp(exe, pp))
|
||||
{
|
||||
free(exe);
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
if ((ec->icccm.name) &&
|
||||
(!strcasecmp(ec->icccm.name, exe)))
|
||||
{
|
||||
free(exe);
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(exe);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_win_new(E_Zone *zone)
|
||||
{
|
||||
Il_Home_Win *hwin;
|
||||
Evas *evas;
|
||||
E_Desk *desk;
|
||||
char buff[PATH_MAX];
|
||||
const char *bgfile;
|
||||
|
||||
hwin = E_OBJECT_ALLOC(Il_Home_Win, IL_HOME_WIN_TYPE, _il_home_win_cb_free);
|
||||
if (!hwin) return;
|
||||
|
||||
hwin->zone = zone;
|
||||
hwin->win = e_win_new(e_comp);
|
||||
if (!hwin->win)
|
||||
{
|
||||
e_object_del(E_OBJECT(hwin));
|
||||
return;
|
||||
}
|
||||
hwin->win->data = hwin;
|
||||
e_win_title_set(hwin->win, _("Illume Home"));
|
||||
e_win_name_class_set(hwin->win, "Illume-Home", "Illume-Home");
|
||||
evas_object_resize_callback_set(hwin->win, _il_home_win_cb_resize);
|
||||
e_win_no_remember_set(hwin->win, EINA_TRUE);
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-home.edj",
|
||||
il_home_cfg->mod_dir);
|
||||
|
||||
evas = evas_object_evas_get(hwin->win);
|
||||
|
||||
desk = e_desk_current_get(zone);
|
||||
if (desk)
|
||||
bgfile = e_bg_file_get(e_comp->num, zone->num, desk->x, desk->y);
|
||||
else
|
||||
bgfile = e_bg_file_get(e_comp->num, zone->num, -1, -1);
|
||||
|
||||
hwin->o_bg = edje_object_add(evas);
|
||||
edje_object_file_set(hwin->o_bg, bgfile, "e/desktop/background");
|
||||
eina_stringshare_del(bgfile);
|
||||
evas_object_move(hwin->o_bg, 0, 0);
|
||||
evas_object_show(hwin->o_bg);
|
||||
|
||||
hwin->o_sf = e_scrollframe_add(evas);
|
||||
e_scrollframe_single_dir_set(hwin->o_sf, EINA_TRUE);
|
||||
e_scrollframe_custom_edje_file_set(hwin->o_sf, buff,
|
||||
"modules/illume-home/launcher/scrollview");
|
||||
evas_object_move(hwin->o_sf, 0, 0);
|
||||
evas_object_show(hwin->o_sf);
|
||||
|
||||
hwin->o_fm = e_fm2_add(evas);
|
||||
_il_home_fmc_set(hwin->o_fm);
|
||||
evas_object_show(hwin->o_fm);
|
||||
e_user_dir_concat_static(buff, "appshadow");
|
||||
e_fm2_path_set(hwin->o_fm, NULL, buff);
|
||||
e_fm2_window_object_set(hwin->o_fm, E_OBJECT(hwin->win));
|
||||
e_scrollframe_extern_pan_set(hwin->o_sf, hwin->o_fm,
|
||||
_il_home_pan_set,
|
||||
_il_home_pan_get,
|
||||
_il_home_pan_max_get,
|
||||
_il_home_pan_child_size_get);
|
||||
evas_object_propagate_events_set(hwin->o_fm, 0);
|
||||
evas_object_smart_callback_add(hwin->o_fm, "selected",
|
||||
_il_home_cb_selected, hwin);
|
||||
|
||||
hwin->cover = e_busycover_new(hwin->win);
|
||||
|
||||
evas_object_geometry_set(hwin->win, zone->x, zone->y, zone->w, (zone->h / 2));
|
||||
evas_object_show(hwin->win);
|
||||
e_client_zone_set(hwin->win->client, zone);
|
||||
if (hwin->win->evas_win)
|
||||
e_drop_xdnd_register_set(hwin->win->evas_win, EINA_TRUE);
|
||||
|
||||
hwins = eina_list_append(hwins, hwin);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_win_cb_free(Il_Home_Win *hwin)
|
||||
{
|
||||
if (hwin->win->evas_win) e_drop_xdnd_register_set(hwin->win->evas_win, 0);
|
||||
if (hwin->cover) e_object_del(E_OBJECT(hwin->cover));
|
||||
if (hwin->o_bg) evas_object_del(hwin->o_bg);
|
||||
if (hwin->o_sf) evas_object_del(hwin->o_sf);
|
||||
if (hwin->o_fm) evas_object_del(hwin->o_fm);
|
||||
if (hwin->win) e_object_del(E_OBJECT(hwin->win));
|
||||
E_FREE(hwin);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_win_cb_resize(E_Win *win)
|
||||
{
|
||||
Il_Home_Win *hwin;
|
||||
|
||||
if (!(hwin = win->data)) return;
|
||||
if (hwin->o_bg) evas_object_resize(hwin->o_bg, win->w, win->h);
|
||||
if (hwin->o_sf) evas_object_resize(hwin->o_sf, win->w, win->h);
|
||||
if (hwin->cover) e_busycover_resize(hwin->cover, win->w, win->h);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_fmc_set(Evas_Object *obj)
|
||||
{
|
||||
E_Fm2_Config fmc;
|
||||
|
||||
if (!obj) return;
|
||||
memset(&fmc, 0, sizeof(E_Fm2_Config));
|
||||
fmc.view.mode = E_FM2_VIEW_MODE_GRID_ICONS;
|
||||
fmc.view.open_dirs_in_place = 1;
|
||||
fmc.view.selector = 0;
|
||||
fmc.view.single_click = il_home_cfg->single_click;
|
||||
fmc.view.single_click_delay = il_home_cfg->single_click_delay;
|
||||
fmc.view.no_subdir_jump = 1;
|
||||
fmc.icon.extension.show = 0;
|
||||
fmc.icon.icon.w = il_home_cfg->icon_size * e_scale / 2.0;
|
||||
fmc.icon.icon.h = il_home_cfg->icon_size * e_scale / 2.0;
|
||||
fmc.icon.fixed.w = il_home_cfg->icon_size * e_scale / 2.0;
|
||||
fmc.icon.fixed.h = il_home_cfg->icon_size * e_scale / 2.0;
|
||||
fmc.list.sort.no_case = 0;
|
||||
fmc.list.sort.dirs.first = 1;
|
||||
fmc.list.sort.dirs.last = 0;
|
||||
fmc.selection.single = 1;
|
||||
fmc.selection.windows_modifiers = 0;
|
||||
e_fm2_config_set(obj, &fmc);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_update_deferred(void *data EINA_UNUSED)
|
||||
{
|
||||
_il_home_apps_unpopulate();
|
||||
_il_home_apps_populate();
|
||||
defer = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
e_fm2_pan_set(obj, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
e_fm2_pan_get(obj, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
e_fm2_pan_max_get(obj, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
||||
{
|
||||
e_fm2_pan_child_size_get(obj, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
_il_home_cb_selected(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
Il_Home_Win *hwin;
|
||||
Eina_List *selected;
|
||||
E_Fm2_Icon_Info *ici;
|
||||
|
||||
if (!(hwin = data)) return;
|
||||
if (!(selected = e_fm2_selected_list_get(hwin->o_fm))) return;
|
||||
EINA_LIST_FREE(selected, ici)
|
||||
{
|
||||
Efreet_Desktop *desktop;
|
||||
|
||||
if ((!ici) || (!ici->real_link)) continue;
|
||||
if (!(desktop = efreet_desktop_get(ici->real_link))) continue;
|
||||
_il_home_desktop_run(hwin, desktop);
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_desktop_cache_update(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
if (defer) ecore_timer_del(defer);
|
||||
defer = ecore_timer_add(0.5, _il_home_update_deferred, NULL);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_cb_border_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
E_Event_Client *ev;
|
||||
Il_Home_Exec *exe;
|
||||
Eina_List *l;
|
||||
|
||||
ev = event;
|
||||
EINA_LIST_FOREACH(exes, l, exe)
|
||||
{
|
||||
if (!exe->client)
|
||||
{
|
||||
if ((exe->startup_id == ev->ec->netwm.startup_id) ||
|
||||
(exe->pid == ev->ec->netwm.pid))
|
||||
{
|
||||
exe->client = ev->ec;
|
||||
}
|
||||
}
|
||||
if (!exe->client) continue;
|
||||
if (exe->client->zone != exe->zone)
|
||||
{
|
||||
exe->client->zone = exe->zone;
|
||||
exe->client->x = exe->zone->x;
|
||||
exe->client->y = exe->zone->y;
|
||||
exe->client->changes.pos = 1;
|
||||
EC_CHANGED(exe->client);
|
||||
}
|
||||
if (exe->handle)
|
||||
{
|
||||
e_busycover_pop(exe->cover, exe->handle);
|
||||
exe->handle = NULL;
|
||||
}
|
||||
if (exe->timeout) ecore_timer_del(exe->timeout);
|
||||
exe->timeout = NULL;
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_cb_border_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
E_Event_Client *ev;
|
||||
Il_Home_Exec *exe;
|
||||
Eina_List *l;
|
||||
|
||||
ev = event;
|
||||
EINA_LIST_FOREACH(exes, l, exe)
|
||||
{
|
||||
if (exe->client == ev->ec)
|
||||
{
|
||||
exe->exec = NULL;
|
||||
if (exe->handle) e_busycover_pop(exe->cover, exe->handle);
|
||||
exe->handle = NULL;
|
||||
exe->client = NULL;
|
||||
exes = eina_list_remove(exes, exe);
|
||||
E_FREE(exe);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_cb_exe_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Il_Home_Exec *exe;
|
||||
Ecore_Exe_Event_Del *ev;
|
||||
Eina_List *l;
|
||||
|
||||
ev = event;
|
||||
EINA_LIST_FOREACH(exes, l, exe)
|
||||
{
|
||||
if (exe->pid == ev->pid)
|
||||
{
|
||||
if (exe->handle)
|
||||
{
|
||||
e_busycover_pop(exe->cover, exe->handle);
|
||||
exe->handle = NULL;
|
||||
}
|
||||
exes = eina_list_remove_list(exes, l);
|
||||
if (exe->timeout) ecore_timer_del(exe->timeout);
|
||||
if (exe->desktop) efreet_desktop_free(exe->desktop);
|
||||
E_FREE(exe);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_cb_exe_timeout(void *data)
|
||||
{
|
||||
Il_Home_Exec *exe;
|
||||
|
||||
if (!(exe = data)) return ECORE_CALLBACK_CANCEL;
|
||||
if (exe->handle) e_busycover_pop(exe->cover, exe->handle);
|
||||
exe->handle = NULL;
|
||||
if (!exe->client)
|
||||
{
|
||||
exes = eina_list_remove(exes, exe);
|
||||
if (exe->desktop) efreet_desktop_free(exe->desktop);
|
||||
E_FREE(exe);
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
exe->timeout = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_cb_client_message(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_X_Event_Client_Message *ev;
|
||||
|
||||
ev = event;
|
||||
if (ev->message_type == ECORE_X_ATOM_E_ILLUME_HOME_NEW)
|
||||
{
|
||||
E_Zone *zone;
|
||||
|
||||
zone = e_util_zone_window_find(ev->win);
|
||||
if (zone->black_win != ev->win) return ECORE_CALLBACK_PASS_ON;
|
||||
_il_home_win_new(zone);
|
||||
}
|
||||
else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_HOME_DEL)
|
||||
{
|
||||
E_Client *ec;
|
||||
Eina_List *l;
|
||||
Il_Home_Win *hwin;
|
||||
|
||||
if (!(ec = e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->win))) return ECORE_CALLBACK_PASS_ON;
|
||||
EINA_LIST_FOREACH(hwins, l, hwin)
|
||||
{
|
||||
if (hwin->win->client == ec)
|
||||
{
|
||||
hwins = eina_list_remove_list(hwins, hwins);
|
||||
e_object_del(E_OBJECT(hwin));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_cb_prop_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_X_Event_Window_Property *ev;
|
||||
Il_Home_Win *hwin;
|
||||
Eina_List *l;
|
||||
|
||||
ev = event;
|
||||
if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return ECORE_CALLBACK_PASS_ON;
|
||||
EINA_LIST_FOREACH(hwins, l, hwin)
|
||||
if (hwin->o_fm)
|
||||
{
|
||||
_il_home_fmc_set(hwin->o_fm);
|
||||
e_fm2_refresh(hwin->o_fm);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_home_cb_bg_change(void *data EINA_UNUSED, int type, void *event EINA_UNUSED)
|
||||
{
|
||||
Il_Home_Win *hwin;
|
||||
Eina_List *l;
|
||||
|
||||
if (type != E_EVENT_BG_UPDATE) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
EINA_LIST_FOREACH(hwins, l, hwin)
|
||||
{
|
||||
E_Zone *zone;
|
||||
E_Desk *desk;
|
||||
const char *bgfile;
|
||||
|
||||
zone = hwin->zone;
|
||||
desk = e_desk_current_get(zone);
|
||||
if (desk)
|
||||
bgfile = e_bg_file_get(e_comp->num, zone->num, desk->x, desk->y);
|
||||
else
|
||||
bgfile = e_bg_file_get(e_comp->num, zone->num, -1, -1);
|
||||
edje_object_file_set(hwin->o_bg, bgfile, "e/desktop/background");
|
||||
eina_stringshare_del(bgfile);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef E_MOD_MAIN_H
|
||||
#define E_MOD_MAIN_H
|
||||
|
||||
void il_home_win_cfg_update(void);
|
||||
|
||||
#endif
|
|
@ -1,14 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Home
|
||||
Name[ca]=Illume-Home
|
||||
Name[de]=Illume-Start
|
||||
Name[el]=Illume-Home
|
||||
Name[eo]=Illume-Hejmo
|
||||
Name[fr]=Accueil Illume
|
||||
Name[ms]=Illume-Home
|
||||
Name[sr]=Лични одсјај
|
||||
Name[tr]=Illume-Ev
|
||||
Icon=e-module-illume-home
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1 +0,0 @@
|
|||
e-module-illume-indicator.edj
|
|
@ -1,51 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
/* local variables */
|
||||
EAPI Il_Ind_Config *il_ind_cfg = NULL;
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
|
||||
int
|
||||
il_ind_config_init(void)
|
||||
{
|
||||
conf_edd = E_CONFIG_DD_NEW("Illume-Indicator_Cfg", Il_Ind_Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Il_Ind_Config
|
||||
#define D conf_edd
|
||||
E_CONFIG_VAL(D, T, version, INT);
|
||||
E_CONFIG_VAL(D, T, height, INT);
|
||||
|
||||
il_ind_cfg = e_config_domain_load("module.illume-indicator", conf_edd);
|
||||
if ((il_ind_cfg) &&
|
||||
((il_ind_cfg->version >> 16) < IL_CONFIG_MAJ))
|
||||
{
|
||||
E_FREE(il_ind_cfg);
|
||||
}
|
||||
if (!il_ind_cfg)
|
||||
{
|
||||
il_ind_cfg = E_NEW(Il_Ind_Config, 1);
|
||||
il_ind_cfg->version = 0;
|
||||
il_ind_cfg->height = 32;
|
||||
}
|
||||
if (il_ind_cfg)
|
||||
il_ind_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_ind_config_shutdown(void)
|
||||
{
|
||||
E_FREE(il_ind_cfg);
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_ind_config_save(void)
|
||||
{
|
||||
return e_config_domain_save("module.illume-indicator", conf_edd, il_ind_cfg);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef E_MOD_CONFIG_H
|
||||
#define E_MOD_CONFIG_H
|
||||
|
||||
#define IL_CONFIG_MIN 0
|
||||
#define IL_CONFIG_MAJ 0
|
||||
|
||||
typedef struct _Il_Ind_Config Il_Ind_Config;
|
||||
|
||||
struct _Il_Ind_Config
|
||||
{
|
||||
int version, height;
|
||||
};
|
||||
|
||||
int il_ind_config_init(void);
|
||||
int il_ind_config_shutdown(void);
|
||||
int il_ind_config_save(void);
|
||||
|
||||
extern EAPI Il_Ind_Config *il_ind_cfg;
|
||||
|
||||
#endif
|
|
@ -1,537 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
#include "e_mod_ind_win.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_mod_ind_win_cb_free(Ind_Win *iwin);
|
||||
static Eina_Bool _e_mod_ind_win_cb_win_prop(void *data, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _e_mod_ind_win_cb_zone_resize(void *data, int type EINA_UNUSED, void *event);
|
||||
static void _e_mod_ind_win_cb_resize(E_Win *win);
|
||||
static void _e_mod_ind_win_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
||||
static void _e_mod_ind_win_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
||||
static void _e_mod_ind_win_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
||||
static void _e_mod_ind_win_cb_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w EINA_UNUSED, Evas_Coord h);
|
||||
/* static void _e_mod_ind_win_cb_size_request(void *data EINA_UNUSED, E_Gadcon *gc EINA_UNUSED, Evas_Coord w EINA_UNUSED, Evas_Coord h EINA_UNUSED); */
|
||||
static Evas_Object *_e_mod_ind_win_cb_frame_request(void *data EINA_UNUSED, E_Gadcon_Client *gcc EINA_UNUSED, const char *style EINA_UNUSED);
|
||||
static void _e_mod_ind_win_cb_menu_items_append(void *data, E_Gadcon_Client *gcc EINA_UNUSED, E_Menu *mn);
|
||||
static void _e_mod_ind_win_cb_menu_append(Ind_Win *iwin, E_Menu *mn);
|
||||
static void _e_mod_ind_win_cb_menu_pre(void *data, E_Menu *mn);
|
||||
static void _e_mod_ind_win_cb_menu_post(void *data, E_Menu *mn EINA_UNUSED);
|
||||
static void _e_mod_ind_win_cb_menu_contents(void *data, E_Menu *mn EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED);
|
||||
static void _e_mod_ind_win_cb_menu_edit(void *data, E_Menu *mn EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED);
|
||||
|
||||
Ind_Win *
|
||||
e_mod_ind_win_new(E_Zone *zone)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
Ecore_X_Window_State states[2];
|
||||
Evas_Coord h = 0, mw = 0, mh = 0;
|
||||
|
||||
/* create our new indicator window object */
|
||||
iwin = E_OBJECT_ALLOC(Ind_Win, IND_WIN_TYPE, _e_mod_ind_win_cb_free);
|
||||
if (!iwin) return NULL;
|
||||
|
||||
h = (il_ind_cfg->height * e_scale);
|
||||
iwin->zone = zone;
|
||||
|
||||
/* create new window */
|
||||
iwin->win = e_win_new(e_comp);
|
||||
iwin->win->data = iwin;
|
||||
|
||||
/* set some properties on the window */
|
||||
e_win_title_set(iwin->win, _("Illume Indicator"));
|
||||
e_win_name_class_set(iwin->win, "Illume-Indicator", "Illume-Indicator");
|
||||
e_win_no_remember_set(iwin->win, EINA_TRUE);
|
||||
|
||||
/* hook into window resize so we can resize our objects */
|
||||
evas_object_resize_callback_set(iwin->win, _e_mod_ind_win_cb_resize);
|
||||
|
||||
/* set this window to not show in taskbar or pager */
|
||||
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
||||
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
||||
ecore_x_netwm_window_state_set(iwin->win->evas_win, states, 2);
|
||||
|
||||
/* set this window to not accept or take focus */
|
||||
ecore_x_icccm_hints_set(iwin->win->evas_win, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
/* create our event rectangle */
|
||||
iwin->o_event = evas_object_rectangle_add(iwin->win->evas);
|
||||
evas_object_color_set(iwin->o_event, 0, 0, 0, 0);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_e_mod_ind_win_cb_mouse_down, iwin);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_UP,
|
||||
_e_mod_ind_win_cb_mouse_up, iwin);
|
||||
evas_object_event_callback_add(iwin->o_event, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_e_mod_ind_win_cb_mouse_move, iwin);
|
||||
evas_object_move(iwin->o_event, 0, 0);
|
||||
evas_object_show(iwin->o_event);
|
||||
|
||||
/* create our base object */
|
||||
iwin->o_base = edje_object_add(iwin->win->evas);
|
||||
if (!e_theme_edje_object_set(iwin->o_base,
|
||||
"base/theme/modules/illume-indicator",
|
||||
"modules/illume-indicator/window"))
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff),
|
||||
"%s/e-module-illume-indicator.edj", _ind_mod_dir);
|
||||
edje_object_file_set(iwin->o_base, buff,
|
||||
"modules/illume-indicator/window");
|
||||
}
|
||||
evas_object_move(iwin->o_base, 0, 0);
|
||||
evas_object_show(iwin->o_base);
|
||||
|
||||
/* create our gadget container */
|
||||
iwin->gadcon = e_gadcon_swallowed_new("illume-indicator", zone->num,
|
||||
iwin->o_base, "e.swallow.content");
|
||||
evas_object_size_hint_min_set(iwin->gadcon->o_container, h, h);
|
||||
e_gadcon_min_size_request_callback_set(iwin->gadcon,
|
||||
_e_mod_ind_win_cb_min_size_request,
|
||||
iwin);
|
||||
/* e_gadcon_size_request_callback_set(iwin->gadcon, */
|
||||
/* _e_mod_ind_win_cb_size_request, iwin); */
|
||||
e_gadcon_frame_request_callback_set(iwin->gadcon,
|
||||
_e_mod_ind_win_cb_frame_request, iwin);
|
||||
e_gadcon_orient(iwin->gadcon, E_GADCON_ORIENT_TOP);
|
||||
e_gadcon_zone_set(iwin->gadcon, zone);
|
||||
e_gadcon_ecore_evas_set(iwin->gadcon, iwin->win->ecore_evas);
|
||||
|
||||
e_gadcon_util_menu_attach_func_set(iwin->gadcon,
|
||||
_e_mod_ind_win_cb_menu_items_append,
|
||||
iwin);
|
||||
e_gadcon_populate(iwin->gadcon);
|
||||
|
||||
/* hook into property change so we can adjust w/ e_scale */
|
||||
iwin->hdls =
|
||||
eina_list_append(iwin->hdls,
|
||||
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
|
||||
_e_mod_ind_win_cb_win_prop, iwin));
|
||||
|
||||
/* hook into zone resize so we can set minimum window width when zone
|
||||
* size changes */
|
||||
iwin->hdls =
|
||||
eina_list_append(iwin->hdls,
|
||||
ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,
|
||||
_e_mod_ind_win_cb_zone_resize,
|
||||
iwin));
|
||||
|
||||
edje_object_size_min_calc(iwin->o_base, &mw, &mh);
|
||||
// printf("@@@@@@@@@@@@@@@@@@@@@@@ %i: %ix%i\n", h, mw, mh);
|
||||
|
||||
/* set minimum size of this window */
|
||||
evas_object_size_hint_min_set(iwin->win, zone->w, mh);
|
||||
|
||||
/* position and resize this window */
|
||||
evas_object_geometry_set(iwin->win, zone->x, zone->y, zone->w, mh);
|
||||
|
||||
/* show the window */
|
||||
evas_object_show(iwin->win);
|
||||
|
||||
/* set this window on proper zone */
|
||||
e_client_zone_set(iwin->win->client, zone);
|
||||
iwin->win->client->user_skip_winlist = 1;
|
||||
iwin->win->client->lock_focus_in = 1;
|
||||
iwin->win->client->lock_focus_out = 1;
|
||||
|
||||
/* set this window to be a dock window. This needs to be done after show
|
||||
* as E will sometimes reset the window type */
|
||||
ecore_x_netwm_window_type_set(iwin->win->evas_win, E_WINDOW_TYPE_DOCK);
|
||||
|
||||
/* tell conformant apps our position and size */
|
||||
ecore_x_e_illume_indicator_geometry_set(zone->black_win, zone->x, zone->y,
|
||||
zone->w, mh);
|
||||
|
||||
return iwin;
|
||||
}
|
||||
|
||||
/* local function prototypes */
|
||||
static void
|
||||
_e_mod_ind_win_cb_free(Ind_Win *iwin)
|
||||
{
|
||||
Ecore_Event_Handler *hdl;
|
||||
|
||||
/* delete the handlers */
|
||||
EINA_LIST_FREE(iwin->hdls, hdl)
|
||||
ecore_event_handler_del(hdl);
|
||||
|
||||
/* delete the menu */
|
||||
if (iwin->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(iwin->menu, NULL, NULL);
|
||||
e_object_del(E_OBJECT(iwin->menu));
|
||||
}
|
||||
iwin->menu = NULL;
|
||||
|
||||
/* delete the gadget container */
|
||||
if (iwin->gadcon) e_object_del(E_OBJECT(iwin->gadcon));
|
||||
iwin->gadcon = NULL;
|
||||
|
||||
/* delete the objects */
|
||||
if (iwin->o_base) evas_object_del(iwin->o_base);
|
||||
iwin->o_base = NULL;
|
||||
if (iwin->o_event) evas_object_del(iwin->o_event);
|
||||
iwin->o_event = NULL;
|
||||
|
||||
/* tell conformant apps our position and size */
|
||||
ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win, 0, 0, 0, 0);
|
||||
|
||||
/* delete the window */
|
||||
if (iwin->win) e_object_del(E_OBJECT(iwin->win));
|
||||
iwin->win = NULL;
|
||||
|
||||
/* free the allocated object */
|
||||
E_FREE(iwin);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_mod_ind_win_cb_win_prop(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
Ecore_X_Event_Window_Property *ev;
|
||||
Evas_Coord mw = 0, mh = 0;
|
||||
|
||||
ev = event;
|
||||
|
||||
if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
if (ev->win != iwin->win->comp->man->root)
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
edje_object_size_min_calc(iwin->o_base, &mw, &mh);
|
||||
// printf("@@@@@@@@@@@@@@@@@@@@@@@ %i: %ix%i\n", h, mw, mh);
|
||||
|
||||
/* set minimum size of this window */
|
||||
evas_object_size_hint_min_set(iwin->win, iwin->zone->w, mh);
|
||||
|
||||
/* NB: Not sure why, but we need to tell this border to fetch icccm
|
||||
* size position hints now :( (NOTE: This was not needed a few days ago)
|
||||
* If we do not do this, than indicator does not change w/ scale anymore */
|
||||
iwin->win->client->icccm.fetch.size_pos_hints = 1;
|
||||
|
||||
/* resize this window */
|
||||
evas_object_resize(iwin->win, iwin->zone->w, mh);
|
||||
|
||||
/* tell conformant apps our position and size */
|
||||
ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win,
|
||||
iwin->win->x, iwin->win->y,
|
||||
iwin->win->w, mh);
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_mod_ind_win_cb_zone_resize(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
E_Event_Zone_Move_Resize *ev;
|
||||
Evas_Coord mw = 0, mh = 0;
|
||||
|
||||
ev = event;
|
||||
if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
if (ev->zone != iwin->zone) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
edje_object_size_min_calc(iwin->o_base, &mw, &mh);
|
||||
// printf("@@@@@@@@@@@@@@@@@@@@@@@ %i: %ix%i\n", h, mw, mh);
|
||||
|
||||
/* set minimum size of this window to match zone size */
|
||||
evas_object_size_hint_min_set(iwin->win, ev->zone->w, mh);
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_resize(E_Win *win)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = win->data)) return;
|
||||
if (iwin->o_event) evas_object_resize(iwin->o_event, win->w, win->h);
|
||||
if (iwin->o_base) evas_object_resize(iwin->o_base, win->w, win->h);
|
||||
if (iwin->gadcon->o_container)
|
||||
{
|
||||
// evas_object_size_hint_min_set(iwin->gadcon->o_container,
|
||||
// win->w, win->h);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
|
||||
ev = event;
|
||||
if (!(iwin = data)) return;
|
||||
if (ev->button == 1)
|
||||
{
|
||||
iwin->mouse_down = 1;
|
||||
|
||||
/* make sure we can drag */
|
||||
if (iwin->win->client->illume.drag.locked) return;
|
||||
|
||||
iwin->drag.start = 1;
|
||||
iwin->drag.dnd = 0;
|
||||
iwin->drag.y = ev->output.y;
|
||||
iwin->drag.by = iwin->win->client->y;
|
||||
}
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
/* create our popup menu */
|
||||
iwin->menu = e_menu_new();
|
||||
e_menu_post_deactivate_callback_set(iwin->menu,
|
||||
_e_mod_ind_win_cb_menu_post, iwin);
|
||||
|
||||
/* append items to our menu */
|
||||
_e_mod_ind_win_cb_menu_append(iwin, iwin->menu);
|
||||
|
||||
/* show menu */
|
||||
e_gadcon_canvas_zone_geometry_get(iwin->gadcon, &x, &y, NULL, NULL);
|
||||
e_menu_activate_mouse(iwin->menu, iwin->zone, x + ev->output.x,
|
||||
y + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Up *ev;
|
||||
|
||||
ev = event;
|
||||
if (!(iwin = data)) return;
|
||||
|
||||
if (ev->button != 1) return;
|
||||
|
||||
/* if we are not dragging, send message to toggle quickpanel state */
|
||||
if ((!iwin->drag.dnd) && (iwin->mouse_down == 1))
|
||||
{
|
||||
Ecore_X_Window xwin;
|
||||
|
||||
xwin = iwin->win->client->zone->black_win;
|
||||
ecore_x_e_illume_quickpanel_state_toggle(xwin);
|
||||
}
|
||||
else if (iwin->drag.dnd)
|
||||
{
|
||||
E_Client *ec;
|
||||
|
||||
ec = iwin->win->client;
|
||||
|
||||
/* reset mouse pointer */
|
||||
e_pointer_type_pop(e_comp->pointer, ec, "move");
|
||||
|
||||
/* tell edj we are done moving */
|
||||
edje_object_signal_emit(iwin->o_base, "e,action,move,stop", "e");
|
||||
|
||||
/* send message that we are done dragging */
|
||||
ecore_x_e_illume_drag_end_send(e_client_util_win_get(ec));
|
||||
|
||||
/* update quickpanel position if needed */
|
||||
if (ec->y != iwin->drag.by)
|
||||
ecore_x_e_illume_quickpanel_position_update_send(e_client_util_win_get(ec));
|
||||
|
||||
/* tell conformant apps our position and size */
|
||||
ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win,
|
||||
ec->x, ec->y,
|
||||
ec->w, ec->h);
|
||||
}
|
||||
iwin->drag.start = 0;
|
||||
iwin->drag.dnd = 0;
|
||||
iwin->drag.y = 0;
|
||||
iwin->drag.by = 0;
|
||||
iwin->mouse_down = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
Evas_Event_Mouse_Move *ev;
|
||||
E_Client *ec;
|
||||
|
||||
ev = event;
|
||||
if (!(iwin = data)) return;
|
||||
ec = iwin->win->client;
|
||||
if (iwin->drag.start)
|
||||
{
|
||||
iwin->drag.dnd = 1;
|
||||
iwin->drag.start = 0;
|
||||
|
||||
/* change mouse pointer to indicate we are dragging */
|
||||
e_pointer_type_push(e_comp->pointer,
|
||||
iwin->win->client, "move");
|
||||
|
||||
/* tell edj we are going to start moving */
|
||||
edje_object_signal_emit(iwin->o_base, "e,action,move,start", "e");
|
||||
|
||||
/* tell quickpanel to hide because we are going to drag */
|
||||
ecore_x_e_illume_quickpanel_state_send(ec->zone->black_win,
|
||||
ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
|
||||
|
||||
/* send message that we are going to start dragging */
|
||||
ecore_x_e_illume_drag_start_send(e_client_util_win_get(ec));
|
||||
}
|
||||
|
||||
/* make sure we are dragging */
|
||||
if (iwin->drag.dnd)
|
||||
{
|
||||
int dy, py, ny;
|
||||
|
||||
/* get current mouse position */
|
||||
py = ev->cur.output.y;
|
||||
|
||||
/* do moves in 'chunks' of screen size */
|
||||
dy = ((ec->zone->h - ec->h) / 8);
|
||||
|
||||
/* are we moving up or down ? */
|
||||
if (ev->cur.output.y > ev->prev.output.y)
|
||||
{
|
||||
/* moving down */
|
||||
if ((py - iwin->drag.y) < dy) return;
|
||||
}
|
||||
else if (ev->cur.output.y < ev->prev.output.y)
|
||||
{
|
||||
/* moving up */
|
||||
if ((iwin->drag.y - py) < dy) return;
|
||||
}
|
||||
else return;
|
||||
|
||||
if (py > iwin->drag.y)
|
||||
ny = ec->y + dy;
|
||||
else if (py < iwin->drag.y)
|
||||
ny = ec->y - dy;
|
||||
else return;
|
||||
|
||||
/* make sure we don't drag off the screen */
|
||||
if (ny < iwin->zone->y)
|
||||
ny = iwin->zone->y;
|
||||
else if ((ny + ec->h) > (iwin->zone->y + iwin->zone->h))
|
||||
return;
|
||||
|
||||
/* move the border if we need to */
|
||||
if (ec->y != ny)
|
||||
{
|
||||
ec->y = ny;
|
||||
ec->changes.pos = 1;
|
||||
EC_CHANGED(ec);
|
||||
evas_object_move(iwin->win, iwin->win->x, ny);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w EINA_UNUSED, Evas_Coord h)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (gc != iwin->gadcon) return;
|
||||
if (h < iwin->win->h) h = iwin->win->h;
|
||||
// evas_object_size_hint_min_set(iwin->gadcon->o_container, w, h);
|
||||
}
|
||||
|
||||
/* static void */
|
||||
/* _e_mod_ind_win_cb_size_request(void *data EINA_UNUSED, E_Gadcon *gc EINA_UNUSED, Evas_Coord w EINA_UNUSED, Evas_Coord h EINA_UNUSED) */
|
||||
/* { */
|
||||
/* return; */
|
||||
/* } */
|
||||
|
||||
static Evas_Object *
|
||||
_e_mod_ind_win_cb_frame_request(void *data EINA_UNUSED, E_Gadcon_Client *gcc EINA_UNUSED, const char *style EINA_UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_menu_items_append(void *data, E_Gadcon_Client *gcc EINA_UNUSED, E_Menu *mn)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
_e_mod_ind_win_cb_menu_append(iwin, mn);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_menu_append(Ind_Win *iwin, E_Menu *mn)
|
||||
{
|
||||
E_Menu *subm;
|
||||
E_Menu_Item *mi;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff),
|
||||
"%s/e-module-illume-indicator.edj", _ind_mod_dir);
|
||||
|
||||
subm = e_menu_new();
|
||||
mi = e_menu_item_new(mn);
|
||||
e_menu_item_label_set(mi, _("Illume Indicator"));
|
||||
e_menu_item_icon_edje_set(mi, buff, "icon");
|
||||
e_menu_pre_activate_callback_set(subm, _e_mod_ind_win_cb_menu_pre, iwin);
|
||||
e_menu_item_submenu_set(mi, subm);
|
||||
e_object_unref(E_OBJECT(subm));
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_menu_pre(void *data, E_Menu *mn)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
E_Menu_Item *mi;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
e_menu_pre_activate_callback_set(mn, NULL, NULL);
|
||||
|
||||
mi = e_menu_item_new(mn);
|
||||
e_menu_item_label_set(mi, _("Set Contents"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-desktop-shelf");
|
||||
e_menu_item_callback_set(mi, _e_mod_ind_win_cb_menu_contents, iwin);
|
||||
|
||||
mi = e_menu_item_new(mn);
|
||||
if (iwin->gadcon->editing)
|
||||
e_menu_item_label_set(mi, _("End Move/Resize Items"));
|
||||
else
|
||||
e_menu_item_label_set(mi, _("Begin Move/Resize Items"));
|
||||
|
||||
e_util_menu_item_theme_icon_set(mi, "transform-scale");
|
||||
e_menu_item_callback_set(mi, _e_mod_ind_win_cb_menu_edit, iwin);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_menu_post(void *data, E_Menu *mn EINA_UNUSED)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (!iwin->menu) return;
|
||||
e_object_del(E_OBJECT(iwin->menu));
|
||||
iwin->menu = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_menu_contents(void *data, E_Menu *mn EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (!iwin->gadcon->config_dialog)
|
||||
e_int_gadcon_config_shelf(iwin->gadcon);
|
||||
else
|
||||
{
|
||||
evas_object_show(iwin->gadcon->config_dialog->dia->win);
|
||||
elm_win_raise(iwin->gadcon->config_dialog->dia->win);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_ind_win_cb_menu_edit(void *data, E_Menu *mn EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
if (!(iwin = data)) return;
|
||||
if (iwin->gadcon->editing)
|
||||
e_gadcon_edit_end(iwin->gadcon);
|
||||
else
|
||||
e_gadcon_edit_begin(iwin->gadcon);
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef E_MOD_IND_WIN_H
|
||||
# define E_MOD_IND_WIN_H
|
||||
|
||||
/* define indicator window object type */
|
||||
# define IND_WIN_TYPE 0xE1b0886
|
||||
|
||||
/* define structure for indicator window */
|
||||
typedef struct _Ind_Win Ind_Win;
|
||||
struct _Ind_Win
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
E_Zone *zone;
|
||||
Eina_List *hdls;
|
||||
|
||||
E_Win *win;
|
||||
Evas_Object *o_base, *o_event;
|
||||
E_Gadcon *gadcon;
|
||||
E_Menu *menu;
|
||||
|
||||
struct
|
||||
{
|
||||
int y, start, dnd, by;
|
||||
} drag;
|
||||
|
||||
int mouse_down;
|
||||
};
|
||||
|
||||
Ind_Win *e_mod_ind_win_new(E_Zone *zone);
|
||||
|
||||
#endif
|
|
@ -1,105 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
#include "e_mod_ind_win.h"
|
||||
|
||||
#ifdef HAVE_ENOTIFY
|
||||
# include "e_mod_notify.h"
|
||||
#endif
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *iwins = NULL;
|
||||
|
||||
/* external variables */
|
||||
const char *_ind_mod_dir = NULL;
|
||||
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume-Indicator" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
const Eina_List *l;
|
||||
E_Comp *comp;
|
||||
|
||||
/* set module priority so we load before others */
|
||||
e_module_priority_set(m, 90);
|
||||
|
||||
/* set module directory variable */
|
||||
_ind_mod_dir = eina_stringshare_add(m->dir);
|
||||
|
||||
/* init config subsystem */
|
||||
if (!il_ind_config_init())
|
||||
{
|
||||
/* clear module directory variable */
|
||||
if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
|
||||
_ind_mod_dir = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ENOTIFY
|
||||
if (!(e_mod_notify_init()))
|
||||
{
|
||||
/* shutdown config */
|
||||
il_ind_config_shutdown();
|
||||
|
||||
/* clear module directory variable */
|
||||
if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
|
||||
_ind_mod_dir = NULL;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
EINA_LIST_FOREACH(e_comp_list(), l, comp)
|
||||
{
|
||||
E_Zone *zone;
|
||||
Eina_List *zl;
|
||||
|
||||
/* TODO: Make this configurable so illume2 can be run
|
||||
* on just one zone/screen/etc */
|
||||
|
||||
/* for each zone, create an indicator window */
|
||||
EINA_LIST_FOREACH(comp->zones, zl, zone)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
/* try to create new indicator window */
|
||||
if (!(iwin = e_mod_ind_win_new(zone))) continue;
|
||||
iwins = eina_list_append(iwins, iwin);
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
Ind_Win *iwin;
|
||||
|
||||
/* destroy the indicator windows */
|
||||
EINA_LIST_FREE(iwins, iwin)
|
||||
e_object_del(E_OBJECT(iwin));
|
||||
|
||||
/* reset indicator geometry for conformant apps */
|
||||
ecore_x_e_illume_indicator_geometry_set(ecore_x_window_root_first_get(),
|
||||
0, 0, 0, 0);
|
||||
|
||||
#ifdef HAVE_ENOTIFY
|
||||
e_mod_notify_shutdown();
|
||||
#endif
|
||||
|
||||
/* shutdown config */
|
||||
il_ind_config_shutdown();
|
||||
|
||||
/* clear module directory variable */
|
||||
if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
|
||||
_ind_mod_dir = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return il_ind_config_save();
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef E_MOD_MAIN_H
|
||||
# define E_MOD_MAIN_H
|
||||
|
||||
extern const char *_ind_mod_dir;
|
||||
|
||||
#endif
|
|
@ -1,262 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_notify.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static unsigned int _e_mod_notify_cb_add(void *data EINA_UNUSED, E_Notification_Notify *n);
|
||||
static void _e_mod_notify_cb_del(void *data EINA_UNUSED, unsigned int id);
|
||||
static Ind_Notify_Win *_e_mod_notify_find(unsigned int id);
|
||||
static void _e_mod_notify_refresh(Ind_Notify_Win *nwin);
|
||||
static Ind_Notify_Win *_e_mod_notify_new(E_Notification_Notify *n, unsigned id);
|
||||
static Eina_Bool _e_mod_notify_cb_timeout(void *data);
|
||||
static void _e_mod_notify_cb_free(Ind_Notify_Win *nwin);
|
||||
static void _e_mod_notify_cb_resize(E_Win *win);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *_nwins = NULL;
|
||||
static int _notify_id = 0;
|
||||
|
||||
static const E_Notification_Server_Info info = {
|
||||
.name = "illume-indicator",
|
||||
.vendor = "Enlightenment",
|
||||
.version = "0.17",
|
||||
.spec_version = "1.2",
|
||||
.capabilities = { "body", NULL }
|
||||
};
|
||||
|
||||
int
|
||||
e_mod_notify_init(void)
|
||||
{
|
||||
/* init notification subsystem */
|
||||
if (!e_notification_server_register(&info, _e_mod_notify_cb_add,
|
||||
_e_mod_notify_cb_del, NULL))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
e_mod_notify_shutdown(void)
|
||||
{
|
||||
Ind_Notify_Win *nwin;
|
||||
Eina_List *l, *l2;
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(_nwins, l, l2, nwin)
|
||||
e_object_del(E_OBJECT(nwin));
|
||||
|
||||
e_notification_server_unregister();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
_e_mod_notify_cb_add(void *data EINA_UNUSED, E_Notification_Notify *n)
|
||||
{
|
||||
Ind_Notify_Win *nwin = NULL;
|
||||
|
||||
_notify_id++;
|
||||
|
||||
if (n->replaces_id && (nwin = _e_mod_notify_find(n->replaces_id)))
|
||||
{
|
||||
if (nwin->notify)
|
||||
e_object_del(E_OBJECT(nwin->notify));
|
||||
nwin->notify = n;
|
||||
nwin->id = _notify_id;
|
||||
_e_mod_notify_refresh(nwin);
|
||||
}
|
||||
|
||||
if (!nwin)
|
||||
{
|
||||
nwin = _e_mod_notify_new(n, _notify_id);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(nwin, 0);
|
||||
}
|
||||
|
||||
/* show it */
|
||||
ecore_x_e_illume_quickpanel_state_send(nwin->zone->black_win,
|
||||
ECORE_X_ILLUME_QUICKPANEL_STATE_ON);
|
||||
|
||||
if (nwin->timer) ecore_timer_del(nwin->timer);
|
||||
nwin->timer = NULL;
|
||||
|
||||
if (n->timeout < 0) n->timeout = 3000.0;
|
||||
n->timeout = n->timeout / 1000.0;
|
||||
|
||||
if (n->timeout > 0)
|
||||
nwin->timer = ecore_timer_add(n->timeout, _e_mod_notify_cb_timeout, nwin);
|
||||
|
||||
return _notify_id;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_notify_cb_del(void *data EINA_UNUSED, unsigned int id)
|
||||
{
|
||||
Ind_Notify_Win *nwin = _e_mod_notify_find(id);
|
||||
if (!nwin)
|
||||
return;
|
||||
|
||||
e_object_del(E_OBJECT(nwin));
|
||||
}
|
||||
|
||||
static
|
||||
Ind_Notify_Win *
|
||||
_e_mod_notify_find(unsigned int id)
|
||||
{
|
||||
const Eina_List *l;
|
||||
Ind_Notify_Win *nwin;
|
||||
|
||||
EINA_LIST_FOREACH(_nwins, l, nwin)
|
||||
if (nwin->id == id)
|
||||
return nwin;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_notify_refresh(Ind_Notify_Win *nwin)
|
||||
{
|
||||
const char *icon;
|
||||
Evas_Coord mw, mh;
|
||||
int size;
|
||||
|
||||
if (!nwin) return;
|
||||
|
||||
if (nwin->o_icon)
|
||||
{
|
||||
edje_object_part_unswallow(nwin->o_base, nwin->o_icon);
|
||||
evas_object_del(nwin->o_icon);
|
||||
}
|
||||
|
||||
size = (48 * e_scale);
|
||||
if (nwin->notify->icon.raw.data)
|
||||
{
|
||||
nwin->o_icon = e_notification_notify_raw_image_get(nwin->notify,
|
||||
nwin->win->evas);
|
||||
if (nwin->o_icon)
|
||||
evas_object_image_fill_set(nwin->o_icon, 0, 0, size, size);
|
||||
}
|
||||
else if (nwin->notify->icon.icon[0])
|
||||
{
|
||||
icon = nwin->notify->icon.icon;
|
||||
if (!strncmp(icon, "file://", 7))
|
||||
{
|
||||
icon += 7;
|
||||
nwin->o_icon = e_util_icon_add(icon, nwin->win->evas);
|
||||
}
|
||||
else
|
||||
nwin->o_icon = e_util_icon_theme_icon_add(icon, size, nwin->win->evas);
|
||||
}
|
||||
|
||||
if (nwin->o_icon)
|
||||
{
|
||||
evas_object_resize(nwin->o_icon, size, size);
|
||||
evas_object_size_hint_min_set(nwin->o_icon, size, size);
|
||||
evas_object_size_hint_max_set(nwin->o_icon, size, size);
|
||||
edje_object_part_swallow(nwin->o_base, "e.swallow.icon", nwin->o_icon);
|
||||
}
|
||||
|
||||
edje_object_part_text_set(nwin->o_base, "e.text.title", nwin->notify->summary);
|
||||
edje_object_part_text_set(nwin->o_base, "e.text.message", nwin->notify->body);
|
||||
|
||||
|
||||
edje_object_calc_force(nwin->o_base);
|
||||
edje_object_size_min_calc(nwin->o_base, &mw, &mh);
|
||||
|
||||
evas_object_size_hint_min_set(nwin->o_base, mw, mh);
|
||||
evas_object_size_hint_min_set(nwin->win, nwin->zone->w, mh);
|
||||
}
|
||||
|
||||
static Ind_Notify_Win *
|
||||
_e_mod_notify_new(E_Notification_Notify *n, unsigned id)
|
||||
{
|
||||
Ind_Notify_Win *nwin;
|
||||
Ecore_X_Window_State states[2];
|
||||
E_Zone *zone;
|
||||
|
||||
nwin = E_OBJECT_ALLOC(Ind_Notify_Win, IND_NOTIFY_WIN_TYPE,
|
||||
_e_mod_notify_cb_free);
|
||||
if (!nwin) return NULL;
|
||||
_nwins = eina_list_append(_nwins, nwin);
|
||||
nwin->notify = n;
|
||||
nwin->id = id;
|
||||
|
||||
zone = e_zone_current_get();
|
||||
nwin->zone = zone;
|
||||
|
||||
nwin->win = e_win_new(e_comp);
|
||||
nwin->win->data = nwin;
|
||||
|
||||
e_win_name_class_set(nwin->win, "Illume-Notify", "Illume-Notify");
|
||||
e_win_no_remember_set(nwin->win, EINA_TRUE);
|
||||
evas_object_resize_callback_set(nwin->win, _e_mod_notify_cb_resize);
|
||||
|
||||
ecore_x_e_illume_quickpanel_set(nwin->win->evas_win, EINA_TRUE);
|
||||
ecore_x_e_illume_quickpanel_priority_major_set(nwin->win->evas_win, n->urgency);
|
||||
ecore_x_e_illume_quickpanel_zone_set(nwin->win->evas_win, zone->num);
|
||||
|
||||
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
||||
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
||||
ecore_x_netwm_window_state_set(nwin->win->evas_win, states, 2);
|
||||
ecore_x_icccm_hints_set(nwin->win->evas_win, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
nwin->o_base = edje_object_add(nwin->win->evas);
|
||||
if (!e_theme_edje_object_set(nwin->o_base,
|
||||
"base/theme/modules/illume-indicator",
|
||||
"modules/illume-indicator/notify"))
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff),
|
||||
"%s/e-module-illume-indicator.edj", _ind_mod_dir);
|
||||
edje_object_file_set(nwin->o_base, buff,
|
||||
"modules/illume-indicator/notify");
|
||||
}
|
||||
evas_object_move(nwin->o_base, 0, 0);
|
||||
evas_object_show(nwin->o_base);
|
||||
|
||||
_e_mod_notify_refresh(nwin);
|
||||
|
||||
evas_object_show(nwin->win);
|
||||
e_client_zone_set(nwin->win->client, zone);
|
||||
nwin->win->client->user_skip_winlist = 1;
|
||||
|
||||
return nwin;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_mod_notify_cb_timeout(void *data)
|
||||
{
|
||||
Ind_Notify_Win *nwin;
|
||||
|
||||
if (!(nwin = data)) return EINA_FALSE;
|
||||
|
||||
/* hide it */
|
||||
ecore_x_e_illume_quickpanel_state_send(nwin->zone->black_win,
|
||||
ECORE_X_ILLUME_QUICKPANEL_STATE_OFF);
|
||||
e_object_del(E_OBJECT(nwin));
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_notify_cb_free(Ind_Notify_Win *nwin)
|
||||
{
|
||||
if (nwin->timer) ecore_timer_del(nwin->timer);
|
||||
nwin->timer = NULL;
|
||||
if (nwin->o_icon) evas_object_del(nwin->o_icon);
|
||||
nwin->o_icon = NULL;
|
||||
if (nwin->o_base) evas_object_del(nwin->o_base);
|
||||
nwin->o_base = NULL;
|
||||
if (nwin->win) e_object_del(E_OBJECT(nwin->win));
|
||||
nwin->win = NULL;
|
||||
e_notification_notify_close(nwin->notify,
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_REQUESTED);
|
||||
e_object_del(E_OBJECT(nwin->notify));
|
||||
_nwins = eina_list_remove(_nwins, nwin);
|
||||
E_FREE(nwin);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_notify_cb_resize(E_Win *win)
|
||||
{
|
||||
Ind_Notify_Win *nwin;
|
||||
|
||||
if (!(nwin = win->data)) return;
|
||||
if (nwin->o_base) evas_object_resize(nwin->o_base, win->w, win->h);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef E_MOD_NOTIFY_H
|
||||
# define E_MOD_NOTIFY_H
|
||||
|
||||
# define IND_NOTIFY_WIN_TYPE 0xE1b0887
|
||||
|
||||
typedef struct _Ind_Notify_Win Ind_Notify_Win;
|
||||
struct _Ind_Notify_Win
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
unsigned id;
|
||||
E_Notification_Notify *notify;
|
||||
|
||||
E_Zone *zone;
|
||||
E_Win *win;
|
||||
Evas_Object *o_base, *o_icon;
|
||||
Ecore_Timer *timer;
|
||||
};
|
||||
|
||||
int e_mod_notify_init(void);
|
||||
int e_mod_notify_shutdown(void);
|
||||
|
||||
#endif
|
|
@ -1,14 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Indicator
|
||||
Name[ca]=Illume-Indicator
|
||||
Name[de]=Illume-Anzeige
|
||||
Name[el]=Illume-Indicator
|
||||
Name[eo]=Illume-Indikilo
|
||||
Name[fr]=Indicateur Illume
|
||||
Name[ms]=Penunjuk-Ilume
|
||||
Name[sr]=Указивач одсјаја
|
||||
Name[tr]=Illume-Gösterge
|
||||
Icon=e-module-illume-indicator
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1,232 +0,0 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local structures */
|
||||
typedef struct _Instance Instance;
|
||||
struct _Instance
|
||||
{
|
||||
E_Gadcon_Client *gcc;
|
||||
Evas_Object *o_toggle;
|
||||
Eina_List *handlers;
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
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 *cc);
|
||||
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *cc, Evas *evas);
|
||||
static const char *_gc_id_new(const E_Gadcon_Client_Class *cc);
|
||||
static void _cb_action_vkbd_enable(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _cb_action_vkbd_disable(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static Eina_Bool _cb_border_focus_in(void *data, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _cb_border_remove(void *data, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _cb_border_property(void *data, int type EINA_UNUSED, void *event);
|
||||
static void _set_btn_icon(Evas_Object *obj, Ecore_X_Virtual_Keyboard_State state);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *instances = NULL;
|
||||
static const char *mod_dir = NULL;
|
||||
|
||||
static const E_Gadcon_Client_Class _gc_class =
|
||||
{
|
||||
GADCON_CLIENT_CLASS_VERSION, "illume-kbd-toggle",
|
||||
{ _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
|
||||
};
|
||||
|
||||
/* public functions */
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard Toggle" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
mod_dir = eina_stringshare_add(m->dir);
|
||||
e_gadcon_provider_register(&_gc_class);
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
e_gadcon_provider_unregister(&_gc_class);
|
||||
if (mod_dir) eina_stringshare_del(mod_dir);
|
||||
mod_dir = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* local function prototypes */
|
||||
static E_Gadcon_Client *
|
||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
inst = E_NEW(Instance, 1);
|
||||
inst->o_toggle = edje_object_add(gc->evas);
|
||||
e_theme_edje_object_set(inst->o_toggle,
|
||||
"base/theme/modules/illume_kbd_toggle",
|
||||
"e/modules/illume_kbd_toggle/main");
|
||||
|
||||
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_toggle);
|
||||
inst->gcc->data = inst;
|
||||
|
||||
edje_object_signal_callback_add(inst->o_toggle, "e,action,vkbd,enable", "",
|
||||
_cb_action_vkbd_enable, inst);
|
||||
edje_object_signal_callback_add(inst->o_toggle, "e,action,vkbd,disable", "",
|
||||
_cb_action_vkbd_disable, inst);
|
||||
|
||||
inst->handlers =
|
||||
eina_list_append(inst->handlers,
|
||||
ecore_event_handler_add(E_EVENT_CLIENT_FOCUS_IN,
|
||||
_cb_border_focus_in, inst));
|
||||
inst->handlers =
|
||||
eina_list_append(inst->handlers,
|
||||
ecore_event_handler_add(E_EVENT_CLIENT_REMOVE,
|
||||
_cb_border_remove, inst));
|
||||
inst->handlers =
|
||||
eina_list_append(inst->handlers,
|
||||
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
|
||||
_cb_border_property, inst));
|
||||
|
||||
instances = eina_list_append(instances, inst);
|
||||
return inst->gcc;
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_shutdown(E_Gadcon_Client *gcc)
|
||||
{
|
||||
Instance *inst;
|
||||
Ecore_Event_Handler *handler;
|
||||
|
||||
if (!(inst = gcc->data)) return;
|
||||
instances = eina_list_remove(instances, inst);
|
||||
if (inst->o_toggle) evas_object_del(inst->o_toggle);
|
||||
EINA_LIST_FREE(inst->handlers, handler)
|
||||
ecore_event_handler_del(handler);
|
||||
E_FREE(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient EINA_UNUSED)
|
||||
{
|
||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_label(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
return _("Illume-Keyboard-Toggle");
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_gc_icon(const E_Gadcon_Client_Class *cc EINA_UNUSED, Evas *evas)
|
||||
{
|
||||
Evas_Object *o;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-kbd-toggle.edj", mod_dir);
|
||||
o = edje_object_add(evas);
|
||||
edje_object_file_set(o, buff, "icon");
|
||||
return o;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_id_new(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
static char buff[32];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s.%d", _gc_class.name,
|
||||
eina_list_count(instances));
|
||||
return buff;
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_action_vkbd_enable(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
Instance *inst;
|
||||
E_Client *ec;
|
||||
|
||||
if (!(inst = data)) return;
|
||||
if (!(ec = e_client_focused_get())) return;
|
||||
if (ec->zone != inst->gcc->gadcon->zone) return;
|
||||
if (ec->vkbd.state >= ECORE_X_VIRTUAL_KEYBOARD_STATE_ON) return;
|
||||
|
||||
ecore_x_e_virtual_keyboard_state_set(e_client_util_win_get(ec),
|
||||
ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_action_vkbd_disable(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
Instance *inst;
|
||||
E_Client *ec;
|
||||
|
||||
if (!(inst = data)) return;
|
||||
if (!(ec = e_client_focused_get())) return;
|
||||
if (ec->zone != inst->gcc->gadcon->zone) return;
|
||||
if (ec->vkbd.state <= ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return;
|
||||
|
||||
ecore_x_e_virtual_keyboard_state_set(e_client_util_win_get(ec),
|
||||
ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_border_focus_in(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Instance *inst;
|
||||
E_Event_Client *ev;
|
||||
E_Client *ec;
|
||||
|
||||
if (!(inst = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
ev = event;
|
||||
if (ev->ec->stolen) return ECORE_CALLBACK_PASS_ON;
|
||||
if (!(ec = ev->ec)) return ECORE_CALLBACK_PASS_ON;
|
||||
if (ec->zone != inst->gcc->gadcon->zone) return ECORE_CALLBACK_PASS_ON;
|
||||
_set_btn_icon(inst->o_toggle, ec->vkbd.state);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_border_remove(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
if (!(inst = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
_set_btn_icon(inst->o_toggle, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_border_property(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Instance *inst;
|
||||
Ecore_X_Event_Window_Property *ev;
|
||||
E_Client *ec;
|
||||
|
||||
ev = event;
|
||||
if (ev->atom != ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
if (!(ec = e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->win)))
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
if (!ec->focused) return ECORE_CALLBACK_PASS_ON;
|
||||
if (!(inst = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
if (ec->zone != inst->gcc->gadcon->zone) return ECORE_CALLBACK_PASS_ON;
|
||||
_set_btn_icon(inst->o_toggle, ec->vkbd.state);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static void
|
||||
_set_btn_icon(Evas_Object *obj, Ecore_X_Virtual_Keyboard_State state)
|
||||
{
|
||||
if (state >= ECORE_X_VIRTUAL_KEYBOARD_STATE_ON)
|
||||
edje_object_signal_emit(obj, "e,state,vkbd,on", "e");
|
||||
else
|
||||
edje_object_signal_emit(obj, "e,state,vkbd,off", "e");
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Keyboard-Toggle
|
||||
Name[ca]=Illume-Keyboard-Toggle
|
||||
Name[de]=Illume-Tastaturumschalter
|
||||
Name[el]=Illume-Keyboard-Toggle
|
||||
Name[eo]=Baskulo de klavaro Illume
|
||||
Name[fr]=Bascule clavier Illume
|
||||
Name[ja]=Illume-Keyboard-Toggle
|
||||
Name[ms]=Illume-Keyboard-Toggle
|
||||
Name[sr]=Прекидач тастатуре одјсаја
|
||||
Name[tr]=Illume-Klavye-Değiştirici
|
||||
Icon=e-module-illume-kbd-toggle
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1 +0,0 @@
|
|||
e-module-illume-keyboard.edj
|
|
@ -1,567 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_kbd_buf.h"
|
||||
#include "e_kbd_dict.h"
|
||||
|
||||
static E_Kbd_Buf_Layout *
|
||||
_e_kbd_buf_new(void)
|
||||
{
|
||||
E_Kbd_Buf_Layout *kbl;
|
||||
|
||||
kbl = E_NEW(E_Kbd_Buf_Layout, 1);
|
||||
kbl->ref =1;
|
||||
return kbl;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_layout_ref(E_Kbd_Buf_Layout *kbl)
|
||||
{
|
||||
kbl->ref++;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_layout_unref(E_Kbd_Buf_Layout *kbl)
|
||||
{
|
||||
kbl->ref--;
|
||||
if (kbl->ref > 0) return;
|
||||
while (kbl->keys)
|
||||
{
|
||||
E_Kbd_Buf_Key *ky;
|
||||
|
||||
ky = kbl->keys->data;
|
||||
if (ky->key) eina_stringshare_del(ky->key);
|
||||
if (ky->key_shift) eina_stringshare_del(ky->key_shift);
|
||||
if (ky->key_capslock) eina_stringshare_del(ky->key_capslock);
|
||||
if (ky->key_altgr) eina_stringshare_del(ky->key_altgr);
|
||||
free(ky);
|
||||
kbl->keys = eina_list_remove_list(kbl->keys, kbl->keys);
|
||||
}
|
||||
free(kbl);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_string_matches_clear(E_Kbd_Buf *kb)
|
||||
{
|
||||
while (kb->string_matches)
|
||||
{
|
||||
if (kb->string_matches->data)
|
||||
eina_stringshare_del(kb->string_matches->data);
|
||||
kb->string_matches = eina_list_remove_list(kb->string_matches, kb->string_matches);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_actual_string_clear(E_Kbd_Buf *kb)
|
||||
{
|
||||
if (kb->actual_string) eina_stringshare_del(kb->actual_string);
|
||||
kb->actual_string = NULL;
|
||||
}
|
||||
|
||||
static E_Kbd_Buf_Key *
|
||||
_e_kbd_buf_at_coord_get(E_Kbd_Buf *kb EINA_UNUSED, E_Kbd_Buf_Layout *kbl, int x, int y)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
for (l = kbl->keys; l; l = l->next)
|
||||
{
|
||||
E_Kbd_Buf_Key *ky;
|
||||
|
||||
ky = l->data;
|
||||
if (ky->key)
|
||||
{
|
||||
if ((x >= ky->x) && (y >= ky->y) &&
|
||||
(x < (ky->x + ky->w)) && (y < (ky->y + ky->h)))
|
||||
return ky;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static E_Kbd_Buf_Key *
|
||||
_e_kbd_buf_closest_get(E_Kbd_Buf *kb EINA_UNUSED, E_Kbd_Buf_Layout *kbl, int x, int y)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Kbd_Buf_Key *ky_closest = NULL;
|
||||
int dist_closest = 0x7fffffff;
|
||||
|
||||
for (l = kbl->keys; l; l = l->next)
|
||||
{
|
||||
E_Kbd_Buf_Key *ky;
|
||||
int dist, dx, dy;
|
||||
|
||||
ky = l->data;
|
||||
if (ky->key)
|
||||
{
|
||||
dx = x - (ky->x + (ky->w / 2));
|
||||
dy = y - (ky->y + (ky->h / 2));
|
||||
dist = (dx * dx) + (dy * dy);
|
||||
if (dist < dist_closest)
|
||||
{
|
||||
ky_closest = ky;
|
||||
dist_closest = dist;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ky_closest;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_kbd_buf_keystroke_key_string_get(E_Kbd_Buf *kb EINA_UNUSED, E_Kbd_Buf_Keystroke *ks, E_Kbd_Buf_Key *ky)
|
||||
{
|
||||
const char *str = NULL;
|
||||
|
||||
if ((ky) && (ky->key))
|
||||
{
|
||||
if (ks->shift)
|
||||
{
|
||||
if (ky->key_shift) str = ky->key_shift;
|
||||
else str = ky->key;
|
||||
}
|
||||
else if (ks->capslock)
|
||||
{
|
||||
if (ky->key_capslock) str = ky->key_capslock;
|
||||
else str = ky->key;
|
||||
}
|
||||
else str = ky->key;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_kbd_buf_keystroke_string_get(E_Kbd_Buf *kb, E_Kbd_Buf_Keystroke *ks)
|
||||
{
|
||||
const char *str = NULL;
|
||||
|
||||
if (ks->key) str = ks->key;
|
||||
else
|
||||
{
|
||||
E_Kbd_Buf_Key *ky;
|
||||
|
||||
ky = _e_kbd_buf_at_coord_get(kb, ks->layout, ks->x, ks->y);
|
||||
if (!ky) ky = _e_kbd_buf_closest_get(kb, ks->layout, ks->x, ks->y);
|
||||
str = _e_kbd_buf_keystroke_key_string_get(kb, ks, ky);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_actual_string_update(E_Kbd_Buf *kb)
|
||||
{
|
||||
Eina_List *l;
|
||||
char *actual = NULL;
|
||||
int actual_len = 0;
|
||||
unsigned int actual_size = 0;
|
||||
E_Kbd_Buf_Keystroke *ks;
|
||||
|
||||
_e_kbd_buf_actual_string_clear(kb);
|
||||
EINA_LIST_FOREACH(kb->keystrokes, l, ks)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
str = _e_kbd_buf_keystroke_string_get(kb, ks);
|
||||
if (!str) continue;
|
||||
if (!actual) actual_size += 64, actual = malloc(actual_size);
|
||||
else if ((actual_len + strlen(str) + 1) > actual_size)
|
||||
{
|
||||
actual_size += 64;
|
||||
actual = realloc(actual, actual_size);
|
||||
}
|
||||
strcpy(actual + actual_len, str);
|
||||
actual_len += strlen(str);
|
||||
}
|
||||
kb->actual_string = eina_stringshare_add(actual);
|
||||
free(actual);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_kbd_buf_matches_find(Eina_List *matches, const char *s)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
for (l = matches; l; l = l->next)
|
||||
{
|
||||
if (!strcmp(l->data, s)) return s;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_matches_update(E_Kbd_Buf *kb)
|
||||
{
|
||||
const char *word;
|
||||
int pri, i;
|
||||
E_Kbd_Dict *dicts[3];
|
||||
|
||||
_e_kbd_buf_string_matches_clear(kb);
|
||||
dicts[0] = kb->dict.personal;
|
||||
dicts[1] = kb->dict.sys;
|
||||
dicts[2] = kb->dict.data;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (!dicts[i]) continue;
|
||||
e_kbd_dict_matches_lookup(dicts[i]);
|
||||
e_kbd_dict_matches_first(dicts[i]);
|
||||
for (;;)
|
||||
{
|
||||
word = e_kbd_dict_matches_match_get(dicts[i], &pri);
|
||||
if (!word) break;
|
||||
if (!_e_kbd_buf_matches_find(kb->string_matches, word))
|
||||
kb->string_matches = eina_list_append(kb->string_matches,
|
||||
eina_stringshare_add(word));
|
||||
e_kbd_dict_matches_next(dicts[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_kbd_buf_cb_data_dict_reload(void *data)
|
||||
{
|
||||
E_Kbd_Buf *kb;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
kb = data;
|
||||
kb->dict.data_reload_delay = NULL;
|
||||
e_kbd_buf_clear(kb);
|
||||
if (kb->dict.data) e_kbd_dict_free(kb->dict.data);
|
||||
e_user_dir_concat_static(buf, "dicts-dynamic/data.dic");
|
||||
kb->dict.data = e_kbd_dict_new(buf);
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_cb_data_dict_change(void *data, Ecore_File_Monitor *em EINA_UNUSED, Ecore_File_Event event EINA_UNUSED, const char *path EINA_UNUSED)
|
||||
{
|
||||
E_Kbd_Buf *kb;
|
||||
|
||||
kb = data;
|
||||
if (kb->dict.data_reload_delay) ecore_timer_del(kb->dict.data_reload_delay);
|
||||
kb->dict.data_reload_delay = ecore_timer_add(2.0, _e_kbd_buf_cb_data_dict_reload, kb);
|
||||
}
|
||||
|
||||
EAPI E_Kbd_Buf *
|
||||
e_kbd_buf_new(const char *sysdicts, const char *dict)
|
||||
{
|
||||
E_Kbd_Buf *kb;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
kb = E_NEW(E_Kbd_Buf, 1);
|
||||
if (!kb) return NULL;
|
||||
kb->sysdicts = eina_stringshare_add(sysdicts);
|
||||
|
||||
e_user_dir_concat_static(buf, "dicts");
|
||||
if (!ecore_file_exists(buf)) ecore_file_mkpath(buf);
|
||||
|
||||
e_user_dir_snprintf(buf, sizeof(buf), "dicts/%s", dict);
|
||||
kb->dict.sys = e_kbd_dict_new(buf);
|
||||
if (!kb->dict.sys)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/dicts/%s", kb->sysdicts, dict);
|
||||
kb->dict.sys = e_kbd_dict_new(buf);
|
||||
}
|
||||
|
||||
e_user_dir_concat_static(buf, "dicts-dynamic");
|
||||
if (!ecore_file_exists(buf)) ecore_file_mkpath(buf);
|
||||
|
||||
e_user_dir_concat_static(buf, "dicts-dynamic/personal.dic");
|
||||
kb->dict.personal = e_kbd_dict_new(buf);
|
||||
if (!kb->dict.personal)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
f = fopen(buf, "w");
|
||||
if (f)
|
||||
{
|
||||
fprintf(f, "\n");
|
||||
fclose(f);
|
||||
}
|
||||
kb->dict.personal = e_kbd_dict_new(buf);
|
||||
}
|
||||
e_user_dir_concat_static(buf, "dicts-dynamic/data.dic");
|
||||
kb->dict.data = e_kbd_dict_new(buf);
|
||||
kb->dict.data_monitor =
|
||||
ecore_file_monitor_add(buf, _e_kbd_buf_cb_data_dict_change, kb);
|
||||
return kb;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_free(E_Kbd_Buf *kb)
|
||||
{
|
||||
e_kbd_buf_clear(kb);
|
||||
e_kbd_buf_layout_clear(kb);
|
||||
e_kbd_buf_lookup_cancel(kb);
|
||||
eina_stringshare_del(kb->sysdicts);
|
||||
if (kb->dict.sys) e_kbd_dict_free(kb->dict.sys);
|
||||
if (kb->dict.personal) e_kbd_dict_free(kb->dict.personal);
|
||||
if (kb->dict.data) e_kbd_dict_free(kb->dict.data);
|
||||
if (kb->dict.data_monitor) ecore_file_monitor_del(kb->dict.data_monitor);
|
||||
if (kb->dict.data_reload_delay) ecore_timer_del(kb->dict.data_reload_delay);
|
||||
free(kb);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_dict_set(E_Kbd_Buf *kb, const char *dict)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
|
||||
e_kbd_buf_clear(kb);
|
||||
|
||||
if (kb->dict.sys) e_kbd_dict_free(kb->dict.sys);
|
||||
|
||||
e_user_dir_concat_static(buf, "dicts");
|
||||
if (!ecore_file_exists(buf)) ecore_file_mkpath(buf);
|
||||
|
||||
e_user_dir_snprintf(buf, sizeof(buf), "dicts/%s", dict);
|
||||
kb->dict.sys = e_kbd_dict_new(buf);
|
||||
if (!kb->dict.sys)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/dicts/%s", kb->sysdicts, dict);
|
||||
kb->dict.sys = e_kbd_dict_new(buf);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_clear(E_Kbd_Buf *kb)
|
||||
{
|
||||
e_kbd_buf_lookup_cancel(kb);
|
||||
while (kb->keystrokes)
|
||||
{
|
||||
E_Kbd_Buf_Keystroke *ks;
|
||||
|
||||
ks = kb->keystrokes->data;
|
||||
if (ks->key) eina_stringshare_del(ks->key);
|
||||
_e_kbd_buf_layout_unref(ks->layout);
|
||||
free(ks);
|
||||
kb->keystrokes = eina_list_remove_list(kb->keystrokes, kb->keystrokes);
|
||||
}
|
||||
_e_kbd_buf_string_matches_clear(kb);
|
||||
if (kb->dict.sys) e_kbd_dict_word_letter_clear(kb->dict.sys);
|
||||
if (kb->dict.personal) e_kbd_dict_word_letter_clear(kb->dict.personal);
|
||||
if (kb->dict.data) e_kbd_dict_word_letter_clear(kb->dict.data);
|
||||
_e_kbd_buf_actual_string_clear(kb);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_layout_clear(E_Kbd_Buf *kb)
|
||||
{
|
||||
if (kb->layout)
|
||||
{
|
||||
_e_kbd_buf_layout_unref(kb->layout);
|
||||
kb->layout = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_layout_size_set(E_Kbd_Buf *kb, int w, int h)
|
||||
{
|
||||
if (!kb->layout) kb->layout = _e_kbd_buf_new();
|
||||
if (!kb->layout) return;
|
||||
kb->layout->w = w;
|
||||
kb->layout->h = h;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_layout_fuzz_set(E_Kbd_Buf *kb, int fuzz)
|
||||
{
|
||||
if (!kb->layout) kb->layout = _e_kbd_buf_new();
|
||||
if (!kb->layout) return;
|
||||
kb->layout->fuzz = fuzz;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_layout_key_add(E_Kbd_Buf *kb, const char *key, const char *key_shift, const char *key_capslock, const char *key_altgr, int x, int y, int w, int h)
|
||||
{
|
||||
E_Kbd_Buf_Key *ky;
|
||||
|
||||
if (!key) return;
|
||||
if (!kb->layout) kb->layout = _e_kbd_buf_new();
|
||||
if (!kb->layout) return;
|
||||
ky = E_NEW(E_Kbd_Buf_Key, 1);
|
||||
if (!ky) return;
|
||||
ky->key = eina_stringshare_add(key);
|
||||
if (key_shift) ky->key_shift = eina_stringshare_add(key_shift);
|
||||
if (key_capslock) ky->key_capslock = eina_stringshare_add(key_capslock);
|
||||
if (key_altgr) ky->key_altgr = eina_stringshare_add(key_altgr);
|
||||
ky->x = x;
|
||||
ky->y = y;
|
||||
ky->w = w;
|
||||
ky->h = h;
|
||||
kb->layout->keys = eina_list_append(kb->layout->keys, ky);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_keystroke_add(E_Kbd_Buf *kb, E_Kbd_Buf_Keystroke *ks)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
str = _e_kbd_buf_keystroke_string_get(kb, ks);
|
||||
if (str)
|
||||
{
|
||||
if (kb->dict.sys) e_kbd_dict_word_letter_add(kb->dict.sys, str, 0);
|
||||
if (kb->dict.personal) e_kbd_dict_word_letter_add(kb->dict.personal, str, 0);
|
||||
if (kb->dict.data) e_kbd_dict_word_letter_add(kb->dict.data, str, 0);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_pressed_key_add(E_Kbd_Buf *kb, const char *key, int shift, int capslock)
|
||||
{
|
||||
E_Kbd_Buf_Keystroke *ks;
|
||||
|
||||
e_kbd_buf_lookup_cancel(kb);
|
||||
if (!key) return;
|
||||
if (!kb->layout) kb->layout = _e_kbd_buf_new();
|
||||
if (!kb->layout) return;
|
||||
ks = E_NEW(E_Kbd_Buf_Keystroke, 1);
|
||||
if (!ks) return;
|
||||
ks->key = eina_stringshare_add(key);
|
||||
if (shift) ks->shift = 1;
|
||||
if (capslock) ks->capslock = 1;
|
||||
ks->layout = kb->layout;
|
||||
_e_kbd_buf_layout_ref(ks->layout);
|
||||
kb->keystrokes = eina_list_append(kb->keystrokes, ks);
|
||||
|
||||
if (kb->dict.sys) e_kbd_dict_word_letter_advance(kb->dict.sys);
|
||||
if (kb->dict.personal) e_kbd_dict_word_letter_advance(kb->dict.personal);
|
||||
if (kb->dict.data) e_kbd_dict_word_letter_advance(kb->dict.data);
|
||||
_e_kbd_buf_keystroke_add(kb, ks);
|
||||
|
||||
_e_kbd_buf_actual_string_update(kb);
|
||||
_e_kbd_buf_matches_update(kb);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_buf_keystroke_point_add(E_Kbd_Buf *kb, E_Kbd_Buf_Keystroke *ks)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
for (l = ks->layout->keys; l; l = l->next)
|
||||
{
|
||||
E_Kbd_Buf_Key *ky;
|
||||
const char *str;
|
||||
int px, py, dx, dy, d;
|
||||
|
||||
ky = l->data;
|
||||
px = ky->x + (ky->w / 2);
|
||||
py = ky->y + (ky->h / 2);
|
||||
dx = ks->x - px;
|
||||
dy = ks->y - py;
|
||||
d = sqrt((dx * dx) + (dy * dy));
|
||||
if (d <= ks->layout->fuzz)
|
||||
{
|
||||
str = _e_kbd_buf_keystroke_key_string_get(kb, ks, ky);
|
||||
if (str)
|
||||
{
|
||||
if (kb->dict.sys) e_kbd_dict_word_letter_add(kb->dict.sys, str, d);
|
||||
if (kb->dict.personal) e_kbd_dict_word_letter_add(kb->dict.personal, str, d);
|
||||
if (kb->dict.data) e_kbd_dict_word_letter_add(kb->dict.data, str, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_pressed_point_add(E_Kbd_Buf *kb, int x, int y, int shift, int capslock)
|
||||
{
|
||||
E_Kbd_Buf_Keystroke *ks;
|
||||
|
||||
e_kbd_buf_lookup_cancel(kb);
|
||||
if (!kb->layout) kb->layout = _e_kbd_buf_new();
|
||||
if (!kb->layout) return;
|
||||
ks = E_NEW(E_Kbd_Buf_Keystroke, 1);
|
||||
if (!ks) return;
|
||||
ks->x = x;
|
||||
ks->y = y;
|
||||
if (shift) ks->shift = 1;
|
||||
if (capslock) ks->capslock = 1;
|
||||
ks->layout = kb->layout;
|
||||
_e_kbd_buf_layout_ref(ks->layout);
|
||||
kb->keystrokes = eina_list_append(kb->keystrokes, ks);
|
||||
|
||||
if (kb->dict.sys) e_kbd_dict_word_letter_advance(kb->dict.sys);
|
||||
if (kb->dict.personal) e_kbd_dict_word_letter_advance(kb->dict.personal);
|
||||
if (kb->dict.data) e_kbd_dict_word_letter_advance(kb->dict.data);
|
||||
|
||||
_e_kbd_buf_keystroke_point_add(kb, ks);
|
||||
|
||||
_e_kbd_buf_actual_string_update(kb);
|
||||
_e_kbd_buf_matches_update(kb);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
e_kbd_buf_actual_string_get(E_Kbd_Buf *kb)
|
||||
{
|
||||
return kb->actual_string;
|
||||
}
|
||||
|
||||
EAPI const Eina_List *
|
||||
e_kbd_buf_string_matches_get(E_Kbd_Buf *kb)
|
||||
{
|
||||
return kb->string_matches;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_backspace(E_Kbd_Buf *kb)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
l = eina_list_last(kb->keystrokes);
|
||||
if (l)
|
||||
{
|
||||
E_Kbd_Buf_Keystroke *ks;
|
||||
|
||||
ks = l->data;
|
||||
if (ks->key) eina_stringshare_del(ks->key);
|
||||
_e_kbd_buf_layout_unref(ks->layout);
|
||||
free(ks);
|
||||
kb->keystrokes = eina_list_remove_list(kb->keystrokes, l);
|
||||
if (kb->dict.sys) e_kbd_dict_word_letter_delete(kb->dict.sys);
|
||||
if (kb->dict.personal) e_kbd_dict_word_letter_delete(kb->dict.personal);
|
||||
if (kb->dict.data) e_kbd_dict_word_letter_delete(kb->dict.data);
|
||||
_e_kbd_buf_actual_string_update(kb);
|
||||
_e_kbd_buf_matches_update(kb);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_word_use(E_Kbd_Buf *kb, const char *word)
|
||||
{
|
||||
if (kb->dict.personal)
|
||||
e_kbd_dict_word_usage_adjust(kb->dict.personal, word, 1);
|
||||
}
|
||||
|
||||
// FIXME: just faking delayed lookup with timer
|
||||
static Eina_Bool
|
||||
_e_kbd_buf_cb_faket(void *data)
|
||||
{
|
||||
E_Kbd_Buf *kb;
|
||||
|
||||
kb = data;
|
||||
kb->lookup.faket = NULL;
|
||||
kb->lookup.func((void *)kb->lookup.data);
|
||||
kb->lookup.func = NULL;
|
||||
kb->lookup.data = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_lookup(E_Kbd_Buf *kb, void (*func) (void *data), const void *data)
|
||||
{
|
||||
e_kbd_buf_lookup_cancel(kb);
|
||||
|
||||
kb->lookup.func = func;
|
||||
kb->lookup.data = data;
|
||||
|
||||
// FIXME: just faking delayed lookup with timer
|
||||
kb->lookup.faket = ecore_timer_add(0.1, _e_kbd_buf_cb_faket, kb);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_buf_lookup_cancel(E_Kbd_Buf *kb)
|
||||
{
|
||||
// FIXME: just faking delayed lookup with timer
|
||||
if (!kb->lookup.faket) return;
|
||||
ecore_timer_del(kb->lookup.faket);
|
||||
kb->lookup.faket = NULL;
|
||||
|
||||
kb->lookup.func = NULL;
|
||||
kb->lookup.data = NULL;
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
#ifndef E_KBD_BUF_H
|
||||
#define E_KBD_BUF_H
|
||||
|
||||
#include "e_kbd_dict.h"
|
||||
|
||||
typedef struct _E_Kbd_Buf E_Kbd_Buf;
|
||||
typedef struct _E_Kbd_Buf_Key E_Kbd_Buf_Key;
|
||||
typedef struct _E_Kbd_Buf_Keystroke E_Kbd_Buf_Keystroke;
|
||||
typedef struct _E_Kbd_Buf_Layout E_Kbd_Buf_Layout;
|
||||
|
||||
struct _E_Kbd_Buf
|
||||
{
|
||||
const char *sysdicts;
|
||||
Eina_List *keystrokes;
|
||||
Eina_List *string_matches;
|
||||
const char *actual_string;
|
||||
E_Kbd_Buf_Layout *layout;
|
||||
struct {
|
||||
void (*func) (void *data);
|
||||
const void *data;
|
||||
// FIXME: just faking delayed lookup with timer
|
||||
Ecore_Timer *faket;
|
||||
} lookup;
|
||||
struct {
|
||||
E_Kbd_Dict *sys;
|
||||
E_Kbd_Dict *personal;
|
||||
E_Kbd_Dict *data;
|
||||
Ecore_File_Monitor *data_monitor;
|
||||
Ecore_Timer *data_reload_delay;
|
||||
} dict;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Buf_Key
|
||||
{
|
||||
int x, y, w, h;
|
||||
const char *key, *key_shift, *key_capslock, *key_altgr;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Buf_Keystroke
|
||||
{
|
||||
const char *key;
|
||||
int x, y;
|
||||
E_Kbd_Buf_Layout *layout;
|
||||
unsigned char shift : 1;
|
||||
unsigned char capslock : 1;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Buf_Layout
|
||||
{
|
||||
int ref;
|
||||
int w, h;
|
||||
int fuzz;
|
||||
Eina_List *keys;
|
||||
};
|
||||
|
||||
EAPI E_Kbd_Buf *e_kbd_buf_new(const char *sysdicts, const char *dicts);
|
||||
EAPI void e_kbd_buf_free(E_Kbd_Buf *kb);
|
||||
EAPI void e_kbd_buf_dict_set(E_Kbd_Buf *kb, const char *dict);
|
||||
EAPI void e_kbd_buf_clear(E_Kbd_Buf *kb);
|
||||
EAPI void e_kbd_buf_layout_clear(E_Kbd_Buf *kb);
|
||||
EAPI void e_kbd_buf_layout_size_set(E_Kbd_Buf *kb, int w, int h);
|
||||
EAPI void e_kbd_buf_layout_fuzz_set(E_Kbd_Buf *kb, int fuzz);
|
||||
EAPI void e_kbd_buf_layout_key_add(E_Kbd_Buf *kb, const char *key, const char *key_shift, const char *key_capslock, const char *key_altgr, int x, int y, int w, int h);
|
||||
EAPI void e_kbd_buf_pressed_key_add(E_Kbd_Buf *kb, const char *key, int shift, int capslock);
|
||||
EAPI void e_kbd_buf_pressed_point_add(E_Kbd_Buf *kb, int x, int y, int shift, int capslock);
|
||||
EAPI const char *e_kbd_buf_actual_string_get(E_Kbd_Buf *kb);
|
||||
EAPI const Eina_List *e_kbd_buf_string_matches_get(E_Kbd_Buf *kb);
|
||||
EAPI void e_kbd_buf_backspace(E_Kbd_Buf *kb);
|
||||
EAPI void e_kbd_buf_lookup(E_Kbd_Buf *kb, void (*func) (void *data), const void *data);
|
||||
EAPI void e_kbd_buf_lookup_cancel(E_Kbd_Buf *kb);
|
||||
EAPI void e_kbd_buf_word_use(E_Kbd_Buf *kb, const char *word);
|
||||
|
||||
#endif
|
|
@ -1,864 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_kbd_dict.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define MAXLATIN 0x100
|
||||
|
||||
static unsigned char _e_kbd_normalise_base[MAXLATIN];
|
||||
static unsigned char _e_kbd_normalise_ready = 0;
|
||||
|
||||
static void
|
||||
_e_kbd_normalise_init(void)
|
||||
{
|
||||
int i;
|
||||
const char *table[][2] =
|
||||
{
|
||||
{"À", "a"},
|
||||
{"Á", "a"},
|
||||
{"Â", "a"},
|
||||
{"Ã", "a"},
|
||||
{"Ä", "a"},
|
||||
{"Å", "a"},
|
||||
{"Æ", "a"},
|
||||
{"Ç", "c"},
|
||||
{"È", "e"},
|
||||
{"É", "e"},
|
||||
{"Ê", "e"},
|
||||
{"Ë", "e"},
|
||||
{"Ì", "i"},
|
||||
{"Í", "i"},
|
||||
{"Î", "i"},
|
||||
{"Ï", "i"},
|
||||
{"Ð", "d"},
|
||||
{"Ñ", "n"},
|
||||
{"Ò", "o"},
|
||||
{"Ó", "o"},
|
||||
{"Ô", "o"},
|
||||
{"Õ", "o"},
|
||||
{"Ö", "o"},
|
||||
{"×", "x"},
|
||||
{"Ø", "o"},
|
||||
{"Ù", "u"},
|
||||
{"Ú", "u"},
|
||||
{"Û", "u"},
|
||||
{"Ü", "u"},
|
||||
{"Ý", "y"},
|
||||
{"Þ", "p"},
|
||||
{"ß", "s"},
|
||||
{"à", "a"},
|
||||
{"á", "a"},
|
||||
{"â", "a"},
|
||||
{"ã", "a"},
|
||||
{"ä", "a"},
|
||||
{"å", "a"},
|
||||
{"æ", "a"},
|
||||
{"ç", "c"},
|
||||
{"è", "e"},
|
||||
{"é", "e"},
|
||||
{"ê", "e"},
|
||||
{"ë", "e"},
|
||||
{"ì", "i"},
|
||||
{"í", "i"},
|
||||
{"î", "i"},
|
||||
{"ï", "i"},
|
||||
{"ð", "o"},
|
||||
{"ñ", "n"},
|
||||
{"ò", "o"},
|
||||
{"ó", "o"},
|
||||
{"ô", "o"},
|
||||
{"õ", "o"},
|
||||
{"ö", "o"},
|
||||
{"ø", "o"},
|
||||
{"ù", "u"},
|
||||
{"ú", "u"},
|
||||
{"û", "u"},
|
||||
{"ü", "u"},
|
||||
{"ý", "y"},
|
||||
{"þ", "p"},
|
||||
{"ÿ", "y"}
|
||||
}; // 63 items
|
||||
|
||||
if (_e_kbd_normalise_ready) return;
|
||||
_e_kbd_normalise_ready = 1;
|
||||
for (i = 0; i < 128; i++)
|
||||
_e_kbd_normalise_base[i] = tolower(i);
|
||||
for (;i < MAXLATIN; i++)
|
||||
{
|
||||
int glyph, j;
|
||||
|
||||
for (j = 0; j < 63; j++)
|
||||
{
|
||||
evas_string_char_next_get(table[j][0], 0, &glyph);
|
||||
if (glyph == i)
|
||||
{
|
||||
_e_kbd_normalise_base[i] = *table[j][1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
_e_kbd_dict_letter_normalise(int glyph)
|
||||
{
|
||||
// FIXME: ö -> o, ä -> a, Ó -> o etc. - ie normalise to latin-1
|
||||
if (glyph < MAXLATIN) return _e_kbd_normalise_base[glyph];
|
||||
return tolower(glyph) & 0x7f;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_kbd_dict_normalized_strncmp(const char *a, const char *b, int len)
|
||||
{
|
||||
// FIXME: normalise 2 strings and then compare
|
||||
if (len < 0) return strcasecmp(a, b);
|
||||
return strncasecmp(a, b, len);
|
||||
}
|
||||
|
||||
static int
|
||||
_e_kbd_dict_normalized_strcmp(const char *a, const char *b)
|
||||
{
|
||||
return _e_kbd_dict_normalized_strncmp(a, b, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_dict_normalized_strcpy(char *dst, const char *src)
|
||||
{
|
||||
const char *p;
|
||||
char *d;
|
||||
|
||||
for (p = src, d = dst; *p; p++, d++)
|
||||
*d = _e_kbd_dict_letter_normalise(*p);
|
||||
*d = 0;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_kbd_dict_matches_lookup_cb_sort(const void *d1, const void *d2)
|
||||
{
|
||||
const E_Kbd_Dict_Word *kw1, *kw2;
|
||||
|
||||
kw1 = d1;
|
||||
kw2 = d2;
|
||||
if (kw1->usage < kw2->usage) return 1;
|
||||
else if (kw1->usage > kw2->usage) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_kbd_dict_writes_cb_sort(const void *d1, const void *d2)
|
||||
{
|
||||
const E_Kbd_Dict_Word *kw1, *kw2;
|
||||
|
||||
kw1 = d1;
|
||||
kw2 = d2;
|
||||
return _e_kbd_dict_normalized_strcmp(kw1->word, kw2->word);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_kbd_dict_line_next(E_Kbd_Dict *kd, const char *p)
|
||||
{
|
||||
const char *e, *pp;
|
||||
|
||||
e = kd->file.dict + kd->file.size;
|
||||
for (pp = p; pp < e; pp++)
|
||||
if (*pp == '\n') return pp + 1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char *
|
||||
_e_kbd_dict_line_parse(E_Kbd_Dict *kd EINA_UNUSED, const char *p, int *usage)
|
||||
{
|
||||
const char *ps;
|
||||
char *wd = NULL;
|
||||
|
||||
for (ps = p; !isspace(*ps); ps++);
|
||||
wd = malloc(ps - p + 1);
|
||||
if (!wd) return NULL;
|
||||
strncpy(wd, p, ps - p);
|
||||
wd[ps - p] = 0;
|
||||
if (*ps == '\n') *usage = 0;
|
||||
else
|
||||
{
|
||||
ps++;
|
||||
*usage = atoi(ps);
|
||||
}
|
||||
return wd;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_dict_lookup_build_line(E_Kbd_Dict *kd EINA_UNUSED, const char *p, const char *eol, int *glyphs)
|
||||
{
|
||||
char *s;
|
||||
int p2;
|
||||
|
||||
s = alloca(eol - p + 1);
|
||||
strncpy(s, p, eol - p);
|
||||
s[eol - p] = 0;
|
||||
p2 = evas_string_char_next_get(s, 0, &(glyphs[0]));
|
||||
if ((p2 > 0) && (glyphs[0] > 0))
|
||||
evas_string_char_next_get(s, p2, &(glyphs[1]));
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_dict_lookup_build(E_Kbd_Dict *kd)
|
||||
{
|
||||
const char *p, *e, *eol;
|
||||
int glyphs[2], pglyphs[2];
|
||||
|
||||
p = kd->file.dict;
|
||||
e = p + kd->file.size;
|
||||
pglyphs[0] = pglyphs[1] = 0;
|
||||
while (p < e)
|
||||
{
|
||||
eol = strchr(p, '\n');
|
||||
if (!eol) break;
|
||||
if (eol > p)
|
||||
{
|
||||
glyphs[0] = glyphs[1] = 0;
|
||||
_e_kbd_dict_lookup_build_line(kd, p, eol, glyphs);
|
||||
if ((glyphs[1] != pglyphs[1]) || (glyphs[0] != pglyphs[0]))
|
||||
{
|
||||
int v1, v2;
|
||||
|
||||
if (isspace(glyphs[0]))
|
||||
{
|
||||
glyphs[0] = 0;
|
||||
glyphs[1] = 0;
|
||||
}
|
||||
else if (isspace(glyphs[1]))
|
||||
glyphs[1] = 0;
|
||||
if (glyphs[0] == 0)
|
||||
{
|
||||
pglyphs[0] = pglyphs[1] = 0;
|
||||
p = eol + 1;
|
||||
continue;
|
||||
}
|
||||
v1 = _e_kbd_dict_letter_normalise(glyphs[0]);
|
||||
v2 = _e_kbd_dict_letter_normalise(glyphs[1]);
|
||||
if (!kd->lookup.tuples[v1][v2])
|
||||
kd->lookup.tuples[v1][v2] = p;
|
||||
pglyphs[0] = v1;
|
||||
pglyphs[1] = v2;
|
||||
}
|
||||
}
|
||||
p = eol + 1;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
_e_kbd_dict_open(E_Kbd_Dict *kd)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
kd->file.fd = open(kd->file.file, O_RDONLY);
|
||||
if (kd->file.fd < 0) return 0;
|
||||
if (fstat(kd->file.fd, &st) < 0)
|
||||
{
|
||||
close(kd->file.fd);
|
||||
return 0;
|
||||
}
|
||||
kd->file.size = st.st_size;
|
||||
|
||||
eina_mmap_safety_enabled_set(EINA_TRUE);
|
||||
|
||||
kd->file.dict = mmap(NULL, kd->file.size, PROT_READ, MAP_SHARED,
|
||||
kd->file.fd, 0);
|
||||
if ((kd->file.dict== MAP_FAILED) || (!kd->file.dict))
|
||||
{
|
||||
close(kd->file.fd);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_dict_close(E_Kbd_Dict *kd)
|
||||
{
|
||||
if (kd->file.fd < 0) return;
|
||||
memset(kd->lookup.tuples, 0, sizeof(kd->lookup.tuples));
|
||||
munmap((void *)kd->file.dict, kd->file.size);
|
||||
close(kd->file.fd);
|
||||
kd->file.fd = -1;
|
||||
kd->file.dict = NULL;
|
||||
kd->file.size = 0;
|
||||
}
|
||||
|
||||
EAPI E_Kbd_Dict *
|
||||
e_kbd_dict_new(const char *file)
|
||||
{
|
||||
// alloc and load new dict - build quick-lookup table. words MUST be sorted
|
||||
E_Kbd_Dict *kd;
|
||||
|
||||
_e_kbd_normalise_init();
|
||||
kd = E_NEW(E_Kbd_Dict, 1);
|
||||
if (!kd) return NULL;
|
||||
kd->file.file = eina_stringshare_add(file);
|
||||
if (!kd->file.file)
|
||||
{
|
||||
free(kd);
|
||||
return NULL;
|
||||
}
|
||||
kd->file.fd = -1;
|
||||
if (!_e_kbd_dict_open(kd))
|
||||
{
|
||||
eina_stringshare_del(kd->file.file);
|
||||
free(kd);
|
||||
return NULL;
|
||||
}
|
||||
_e_kbd_dict_lookup_build(kd);
|
||||
return kd;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_free(E_Kbd_Dict *kd)
|
||||
{
|
||||
// free dict and anything in it
|
||||
e_kbd_dict_word_letter_clear(kd);
|
||||
e_kbd_dict_save(kd);
|
||||
_e_kbd_dict_close(kd);
|
||||
free(kd);
|
||||
}
|
||||
|
||||
static E_Kbd_Dict_Word *
|
||||
_e_kbd_dict_changed_write_find(E_Kbd_Dict *kd, const char *word)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
for (l = kd->changed.writes; l; l = l->next)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = l->data;
|
||||
if (!strcmp(kw->word, word)) return kw;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_save(E_Kbd_Dict *kd)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
// save any changes (new words added, usage adjustments).
|
||||
// all words MUST be sorted
|
||||
if (!kd->changed.writes) return;
|
||||
if (kd->changed.flush_timer)
|
||||
{
|
||||
ecore_timer_del(kd->changed.flush_timer);
|
||||
kd->changed.flush_timer = NULL;
|
||||
}
|
||||
ecore_file_unlink(kd->file.file);
|
||||
f = fopen(kd->file.file, "w");
|
||||
kd->changed.writes = eina_list_sort(kd->changed.writes,
|
||||
eina_list_count(kd->changed.writes),
|
||||
_e_kbd_dict_writes_cb_sort);
|
||||
if (f)
|
||||
{
|
||||
const char *p, *pn;
|
||||
|
||||
p = kd->file.dict;
|
||||
while (p)
|
||||
{
|
||||
char *wd;
|
||||
int usage = 0;
|
||||
|
||||
pn = _e_kbd_dict_line_next(kd, p);
|
||||
if (!pn)
|
||||
{
|
||||
fclose(f);
|
||||
return;
|
||||
}
|
||||
wd = _e_kbd_dict_line_parse(kd, p, &usage);
|
||||
if ((wd) && (strlen(wd) > 0))
|
||||
{
|
||||
if (kd->changed.writes)
|
||||
{
|
||||
int writeline = 0;
|
||||
|
||||
while (kd->changed.writes)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
int cmp;
|
||||
|
||||
kw = kd->changed.writes->data;
|
||||
cmp = _e_kbd_dict_normalized_strcmp(kw->word, wd);
|
||||
if (cmp < 0)
|
||||
{
|
||||
fprintf(f, "%s %i\n", kw->word, kw->usage);
|
||||
writeline = 1;
|
||||
eina_stringshare_del(kw->word);
|
||||
free(kw);
|
||||
kd->changed.writes = eina_list_remove_list(kd->changed.writes, kd->changed.writes);
|
||||
}
|
||||
else if (cmp == 0)
|
||||
{
|
||||
fprintf(f, "%s %i\n", wd, kw->usage);
|
||||
if (!strcmp(kw->word, wd))
|
||||
writeline = 0;
|
||||
else
|
||||
writeline = 1;
|
||||
eina_stringshare_del(kw->word);
|
||||
free(kw);
|
||||
kd->changed.writes = eina_list_remove_list(kd->changed.writes, kd->changed.writes);
|
||||
break;
|
||||
}
|
||||
else if (cmp > 0)
|
||||
{
|
||||
writeline = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (writeline)
|
||||
fprintf(f, "%s %i\n", wd, usage);
|
||||
}
|
||||
else
|
||||
fprintf(f, "%s %i\n", wd, usage);
|
||||
}
|
||||
free(wd);
|
||||
p = pn;
|
||||
if (p >= (kd->file.dict + kd->file.size)) break;
|
||||
}
|
||||
while (kd->changed.writes)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = kd->changed.writes->data;
|
||||
fprintf(f, "%s %i\n", kw->word, kw->usage);
|
||||
eina_stringshare_del(kw->word);
|
||||
free(kw);
|
||||
kd->changed.writes = eina_list_remove_list(kd->changed.writes, kd->changed.writes);
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
_e_kbd_dict_close(kd);
|
||||
if (_e_kbd_dict_open(kd)) _e_kbd_dict_lookup_build(kd);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_kbd_dict_cb_save_flush(void *data)
|
||||
{
|
||||
E_Kbd_Dict *kd;
|
||||
|
||||
kd = data;
|
||||
if ((kd->matches.list) || (kd->word.letters) || (kd->matches.deadends) ||
|
||||
(kd->matches.leads))
|
||||
return EINA_TRUE;
|
||||
kd->changed.flush_timer = NULL;
|
||||
e_kbd_dict_save(kd);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_dict_changed_write_add(E_Kbd_Dict *kd, const char *word, int usage)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = E_NEW(E_Kbd_Dict_Word, 1);
|
||||
kw->word = eina_stringshare_add(word);
|
||||
kw->usage = usage;
|
||||
kd->changed.writes = eina_list_prepend(kd->changed.writes, kw);
|
||||
if (eina_list_count(kd->changed.writes) > 64)
|
||||
e_kbd_dict_save(kd);
|
||||
else
|
||||
{
|
||||
if (kd->changed.flush_timer)
|
||||
ecore_timer_del(kd->changed.flush_timer);
|
||||
kd->changed.flush_timer =
|
||||
ecore_timer_add(5.0, _e_kbd_dict_cb_save_flush, kd);
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_kbd_dict_find_pointer(E_Kbd_Dict *kd, const char *p, int baselen, const char *word)
|
||||
{
|
||||
const char *pn;
|
||||
int len;
|
||||
|
||||
if (!p) return NULL;
|
||||
len = strlen(word);
|
||||
while (p)
|
||||
{
|
||||
pn = _e_kbd_dict_line_next(kd, p);
|
||||
if (!pn) return NULL;
|
||||
if ((pn - p) > len)
|
||||
{
|
||||
if (!_e_kbd_dict_normalized_strncmp(p, word, len))
|
||||
return p;
|
||||
}
|
||||
if (_e_kbd_dict_normalized_strncmp(p, word, baselen))
|
||||
return NULL;
|
||||
p = pn;
|
||||
if (p >= (kd->file.dict + kd->file.size)) break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_kbd_dict_find(E_Kbd_Dict *kd, const char *word)
|
||||
{
|
||||
const char *p;
|
||||
char *tword;
|
||||
int glyphs[2], p2, v1, v2, i;
|
||||
|
||||
/* work backwards in leads. i.e.:
|
||||
* going
|
||||
* goin
|
||||
* goi
|
||||
* go
|
||||
* g
|
||||
*/
|
||||
tword = alloca(strlen(word) + 1);
|
||||
_e_kbd_dict_normalized_strcpy(tword, word);
|
||||
p = eina_hash_find(kd->matches.leads, tword);
|
||||
if (p) return p;
|
||||
p2 = strlen(tword);
|
||||
while (tword[0])
|
||||
{
|
||||
p2 = evas_string_char_prev_get(tword, p2, &i);
|
||||
if (p2 < 0) break;
|
||||
tword[p2] = 0;
|
||||
p = eina_hash_find(kd->matches.leads, tword);
|
||||
if (p)
|
||||
return _e_kbd_dict_find_pointer(kd, p, p2, word);
|
||||
}
|
||||
/* looking at leads going back letters didn't work */
|
||||
p = kd->file.dict;
|
||||
if ((p[0] == '\n') && (kd->file.size <= 1)) return NULL;
|
||||
glyphs[0] = glyphs[1] = 0;
|
||||
p2 = evas_string_char_next_get(word, 0, &(glyphs[0]));
|
||||
if ((p2 > 0) && (glyphs[0] > 0))
|
||||
p2 = evas_string_char_next_get(word, p2, &(glyphs[1]));
|
||||
v1 = _e_kbd_dict_letter_normalise(glyphs[0]);
|
||||
if (glyphs[1] != 0)
|
||||
{
|
||||
v2 = _e_kbd_dict_letter_normalise(glyphs[1]);
|
||||
p = kd->lookup.tuples[v1][v2];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 128; i++)
|
||||
{
|
||||
p = kd->lookup.tuples[v1][i];
|
||||
if (p) break;
|
||||
}
|
||||
}
|
||||
return _e_kbd_dict_find_pointer(kd, p, p2, word);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_kbd_dict_find_full(E_Kbd_Dict *kd, const char *word)
|
||||
{
|
||||
const char *p;
|
||||
int len;
|
||||
|
||||
p = _e_kbd_dict_find(kd, word);
|
||||
if (!p) return NULL;
|
||||
len = strlen(word);
|
||||
if (isspace(p[len])) return p;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_word_usage_adjust(E_Kbd_Dict *kd, const char *word, int adjust)
|
||||
{
|
||||
// add "adjust" to word usage count
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = _e_kbd_dict_changed_write_find(kd, word);
|
||||
if (kw)
|
||||
{
|
||||
kw->usage += adjust;
|
||||
if (kd->changed.flush_timer)
|
||||
ecore_timer_del(kd->changed.flush_timer);
|
||||
kd->changed.flush_timer = ecore_timer_add(5.0, _e_kbd_dict_cb_save_flush, kd);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *line;
|
||||
int usage = 0;
|
||||
|
||||
line = _e_kbd_dict_find_full(kd, word);
|
||||
if (line)
|
||||
{
|
||||
char *wd;
|
||||
|
||||
// FIXME: we need to find an EXACT line match - case and all
|
||||
wd = _e_kbd_dict_line_parse(kd, line, &usage);
|
||||
free(wd);
|
||||
}
|
||||
usage += adjust;
|
||||
_e_kbd_dict_changed_write_add(kd, word, usage);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_word_delete(E_Kbd_Dict *kd, const char *word)
|
||||
{
|
||||
// delete a word from the dictionary
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = _e_kbd_dict_changed_write_find(kd, word);
|
||||
if (kw)
|
||||
kw->usage = -1;
|
||||
else
|
||||
{
|
||||
if (_e_kbd_dict_find_full(kd, word))
|
||||
_e_kbd_dict_changed_write_add(kd, word, -1);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_word_letter_clear(E_Kbd_Dict *kd)
|
||||
{
|
||||
// clear the current word buffer
|
||||
while (kd->word.letters)
|
||||
e_kbd_dict_word_letter_delete(kd);
|
||||
if (kd->matches.deadends)
|
||||
{
|
||||
eina_hash_free(kd->matches.deadends);
|
||||
kd->matches.deadends = NULL;
|
||||
}
|
||||
if (kd->matches.leads)
|
||||
{
|
||||
eina_hash_free(kd->matches.leads);
|
||||
kd->matches.leads = NULL;
|
||||
}
|
||||
while (kd->matches.list)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = kd->matches.list->data;
|
||||
eina_stringshare_del(kw->word);
|
||||
free(kw);
|
||||
kd->matches.list = eina_list_remove_list(kd->matches.list, kd->matches.list);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_word_letter_add(E_Kbd_Dict *kd, const char *letter, int dist)
|
||||
{
|
||||
// add a letter with a distance (0 == closest) as an option for the current
|
||||
// letter position - advance starts a new letter position
|
||||
Eina_List *l, *list;
|
||||
E_Kbd_Dict_Letter *kl;
|
||||
|
||||
l = eina_list_last(kd->word.letters);
|
||||
if (!l) return;
|
||||
list = l->data;
|
||||
kl = E_NEW(E_Kbd_Dict_Letter, 1);
|
||||
if (!kl) return;
|
||||
kl->letter = eina_stringshare_add(letter);
|
||||
kl->dist = dist;
|
||||
list = eina_list_append(list, kl);
|
||||
l->data = list;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_word_letter_advance(E_Kbd_Dict *kd)
|
||||
{
|
||||
// start a new letter in the word
|
||||
kd->word.letters = eina_list_append(kd->word.letters, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_word_letter_delete(E_Kbd_Dict *kd)
|
||||
{
|
||||
// delete the current letter completely
|
||||
Eina_List *l, *list;
|
||||
|
||||
l = eina_list_last(kd->word.letters);
|
||||
if (!l) return;
|
||||
list = l->data;
|
||||
while (list)
|
||||
{
|
||||
E_Kbd_Dict_Letter *kl;
|
||||
|
||||
kl = list->data;
|
||||
eina_stringshare_del(kl->letter);
|
||||
free(kl);
|
||||
list = eina_list_remove_list(list, list);
|
||||
}
|
||||
kd->word.letters = eina_list_remove_list(kd->word.letters, l);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_kbd_dict_matches_lookup_iter(E_Kbd_Dict *kd, Eina_List *word,
|
||||
Eina_List *more)
|
||||
{
|
||||
Eina_List *l, *list;
|
||||
const char *p;
|
||||
char *base, *buf, *wd, *bufapp;
|
||||
E_Kbd_Dict_Letter *kl;
|
||||
int len = 0, dist = 0, d, baselen, maxdist = 0, md;
|
||||
static int level = 0;
|
||||
|
||||
level++;
|
||||
for (l = word; l; l = l->next)
|
||||
{
|
||||
kl = l->data;
|
||||
len += strlen(kl->letter);
|
||||
dist += kl->dist;
|
||||
if (kl->dist > maxdist) maxdist = kl->dist;
|
||||
}
|
||||
if (maxdist < 1) maxdist = 1;
|
||||
buf = alloca(len + 20); // 20 - just padding enough for 1 more utf8 char
|
||||
base = alloca(len + 20);
|
||||
base[0] = 0;
|
||||
for (l = word; l; l = l->next)
|
||||
{
|
||||
kl = l->data;
|
||||
strcat(base, kl->letter);
|
||||
}
|
||||
baselen = strlen(base);
|
||||
strcpy(buf, base);
|
||||
bufapp = buf + baselen;
|
||||
list = more->data;
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
kl = l->data;
|
||||
if (kl->dist > maxdist) maxdist = kl->dist;
|
||||
}
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
kl = l->data;
|
||||
strcpy(bufapp, kl->letter);
|
||||
if ((kd->matches.deadends) && eina_hash_find(kd->matches.deadends, buf))
|
||||
continue;
|
||||
p = eina_hash_find(kd->matches.leads, buf);
|
||||
if (p) p = _e_kbd_dict_find_pointer(kd, p, baselen, buf);
|
||||
else p = _e_kbd_dict_find(kd, buf);
|
||||
if (!p)
|
||||
{
|
||||
if (!kd->matches.deadends)
|
||||
kd->matches.deadends = eina_hash_string_superfast_new(NULL);
|
||||
eina_hash_add(kd->matches.deadends, buf, kd);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!kd->matches.leads)
|
||||
kd->matches.leads = eina_hash_string_superfast_new(NULL);
|
||||
eina_hash_add(kd->matches.leads, buf, p);
|
||||
}
|
||||
if ((!more->next) || (!more->next->data))
|
||||
{
|
||||
d = dist + kl->dist;
|
||||
md = maxdist;
|
||||
for (;;)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
int usage = 0;
|
||||
|
||||
wd = _e_kbd_dict_line_parse(kd, p, &usage);
|
||||
if (!wd) break;
|
||||
if (_e_kbd_dict_normalized_strcmp(wd, buf))
|
||||
{
|
||||
free(wd);
|
||||
break;
|
||||
}
|
||||
kw = E_NEW(E_Kbd_Dict_Word, 1);
|
||||
if (kw)
|
||||
{
|
||||
int accuracy;
|
||||
int w, b, w2, b2, wc, bc;
|
||||
|
||||
// match any capitalisation
|
||||
for (w = 0, b = 0; wd[w] && buf[b];)
|
||||
{
|
||||
b2 = evas_string_char_next_get(buf, b, &bc);
|
||||
w2 = evas_string_char_next_get(wd, w, &wc);
|
||||
if (isupper(bc)) wd[w] = toupper(wc);
|
||||
w = w2;
|
||||
b = b2;
|
||||
}
|
||||
kw->word = eina_stringshare_add(wd);
|
||||
// FIXME: magic combination of distance metric and
|
||||
// frequency of usage. this is simple now, but could
|
||||
// be tweaked
|
||||
wc = eina_list_count(word);
|
||||
if (md < 1) md = 1;
|
||||
|
||||
// basically a metric to see how far away the keys that
|
||||
// were actually pressed are away from the letters of
|
||||
// this word in a physical on-screen sense
|
||||
accuracy = md - (d / (wc + 1));
|
||||
// usage is the frequency of usage in the dictionary.
|
||||
// it its < 1 time, it's assumed to be 1.
|
||||
if (usage < 1) usage = 1;
|
||||
// multiply usage by a factor of 100 for better detailed
|
||||
// sorting. 10 == 1/10th factor
|
||||
usage = 100 + ((usage - 1) * 10);
|
||||
// and well just multiply and lets see. maybe this can
|
||||
// do with multiplication factors etc. but simple for
|
||||
// now.
|
||||
kw->usage = (usage * accuracy) / md;
|
||||
kd->matches.list = eina_list_append(kd->matches.list, kw);
|
||||
}
|
||||
free(wd);
|
||||
p = _e_kbd_dict_line_next(kd, p);
|
||||
if (p >= (kd->file.dict + kd->file.size)) break;
|
||||
if (!p) break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
word = eina_list_append(word, kl);
|
||||
_e_kbd_dict_matches_lookup_iter(kd, word, more->next);
|
||||
word = eina_list_remove_list(word, eina_list_last(word));
|
||||
}
|
||||
}
|
||||
level--;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_matches_lookup(E_Kbd_Dict *kd)
|
||||
{
|
||||
// find all matches and sort them
|
||||
while (kd->matches.list)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = kd->matches.list->data;
|
||||
eina_stringshare_del(kw->word);
|
||||
free(kw);
|
||||
kd->matches.list = eina_list_remove_list(kd->matches.list, kd->matches.list);
|
||||
}
|
||||
if (kd->word.letters)
|
||||
_e_kbd_dict_matches_lookup_iter(kd, NULL, kd->word.letters);
|
||||
kd->matches.list = eina_list_sort(kd->matches.list,
|
||||
eina_list_count(kd->matches.list),
|
||||
_e_kbd_dict_matches_lookup_cb_sort);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_matches_first(E_Kbd_Dict *kd)
|
||||
{
|
||||
// jump to first match
|
||||
kd->matches.list_ptr = kd->matches.list;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_dict_matches_next(E_Kbd_Dict *kd)
|
||||
{
|
||||
// jump to next match
|
||||
kd->matches.list_ptr = kd->matches.list_ptr->next;
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
e_kbd_dict_matches_match_get(E_Kbd_Dict *kd, int *pri_ret)
|
||||
{
|
||||
// return the word (string utf-8) for the current match
|
||||
if (kd->matches.list_ptr)
|
||||
{
|
||||
E_Kbd_Dict_Word *kw;
|
||||
|
||||
kw = kd->matches.list_ptr->data;
|
||||
if (kw)
|
||||
{
|
||||
*pri_ret = kw->usage;
|
||||
return kw->word;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
#ifndef E_KBD_DICT_H
|
||||
#define E_KBD_DICT_H
|
||||
|
||||
typedef struct _E_Kbd_Dict E_Kbd_Dict;
|
||||
typedef struct _E_Kbd_Dict_Word E_Kbd_Dict_Word;
|
||||
typedef struct _E_Kbd_Dict_Letter E_Kbd_Dict_Letter;
|
||||
|
||||
struct _E_Kbd_Dict_Word
|
||||
{
|
||||
const char *word;
|
||||
int usage;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Dict_Letter
|
||||
{
|
||||
const char *letter;
|
||||
int dist;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Dict
|
||||
{
|
||||
struct {
|
||||
const char *file;
|
||||
int fd;
|
||||
const char *dict;
|
||||
int size;
|
||||
} file;
|
||||
struct {
|
||||
const char *tuples[256][256];
|
||||
} lookup;
|
||||
struct {
|
||||
Ecore_Timer *flush_timer;
|
||||
Eina_List *writes;
|
||||
} changed;
|
||||
struct {
|
||||
Eina_List *letters;
|
||||
} word;
|
||||
struct {
|
||||
Eina_Hash *deadends;
|
||||
Eina_Hash *leads;
|
||||
Eina_List *list;
|
||||
Eina_List *list_ptr;
|
||||
} matches;
|
||||
};
|
||||
|
||||
|
||||
EAPI E_Kbd_Dict *e_kbd_dict_new(const char *file);
|
||||
EAPI void e_kbd_dict_free(E_Kbd_Dict *kd);
|
||||
EAPI void e_kbd_dict_save(E_Kbd_Dict *kd);
|
||||
EAPI void e_kbd_dict_word_usage_adjust(E_Kbd_Dict *kd, const char *word, int adjust);
|
||||
EAPI void e_kbd_dict_word_delete(E_Kbd_Dict *kd, const char *word);
|
||||
EAPI void e_kbd_dict_word_letter_clear(E_Kbd_Dict *kd);
|
||||
EAPI void e_kbd_dict_word_letter_add(E_Kbd_Dict *kd, const char *letter, int dist);
|
||||
EAPI void e_kbd_dict_word_letter_advance(E_Kbd_Dict *kd);
|
||||
EAPI void e_kbd_dict_word_letter_delete(E_Kbd_Dict *kd);
|
||||
EAPI void e_kbd_dict_matches_lookup(E_Kbd_Dict *kd);
|
||||
EAPI void e_kbd_dict_matches_first(E_Kbd_Dict *kd);
|
||||
EAPI void e_kbd_dict_matches_next(E_Kbd_Dict *kd);
|
||||
EAPI const char *e_kbd_dict_matches_match_get(E_Kbd_Dict *kd, int *pri_ret);
|
||||
|
||||
#endif
|
|
@ -1,132 +0,0 @@
|
|||
#ifndef E_KBD_INT_H
|
||||
#define E_KBD_INT_H
|
||||
|
||||
#include "e_kbd_buf.h"
|
||||
|
||||
typedef enum _E_Kbd_Int_Type
|
||||
{
|
||||
E_KBD_INT_TYPE_UNKNOWN = 0,
|
||||
E_KBD_INT_TYPE_ALPHA = (1 << 0),
|
||||
E_KBD_INT_TYPE_NUMERIC = (1 << 1),
|
||||
E_KBD_INT_TYPE_PIN = (1 << 2),
|
||||
E_KBD_INT_TYPE_PHONE_NUMBER = (1 << 3),
|
||||
E_KBD_INT_TYPE_HEX = (1 << 4),
|
||||
E_KBD_INT_TYPE_TERMINAL = (1 << 5),
|
||||
E_KBD_INT_TYPE_PASSWORD = (1 << 6),
|
||||
E_KBD_INT_TYPE_IP = (1 << 7),
|
||||
E_KBD_INT_TYPE_HOST = (1 << 8),
|
||||
E_KBD_INT_TYPE_FILE = (1 << 9),
|
||||
E_KBD_INT_TYPE_URL = (1 << 10),
|
||||
E_KBD_INT_TYPE_KEYPAD = (1 << 11),
|
||||
E_KBD_INT_TYPE_J2ME = (1 << 12)
|
||||
} E_Kbd_Int_Type;
|
||||
|
||||
/* The natural text direction of the keyboard */
|
||||
typedef enum _E_kbd_Int_Direction
|
||||
{
|
||||
E_KBD_INT_DIRECTION_LTR = (1 << 0),
|
||||
E_KBD_INT_DIRECTION_RTL = (1 << 1)
|
||||
} E_Kbd_Int_Direction;
|
||||
|
||||
typedef struct _E_Kbd_Int E_Kbd_Int;
|
||||
typedef struct _E_Kbd_Int_Key E_Kbd_Int_Key;
|
||||
typedef struct _E_Kbd_Int_Key_State E_Kbd_Int_Key_State;
|
||||
typedef struct _E_Kbd_Int_Layout E_Kbd_Int_Layout;
|
||||
typedef struct _E_Kbd_Int_Match E_Kbd_Int_Match;
|
||||
|
||||
struct _E_Kbd_Int
|
||||
{
|
||||
E_Win *win;
|
||||
const char *themedir, *syskbds, *sysdicts;
|
||||
Evas_Object *base_obj, *layout_obj, *event_obj, *icon_obj, *box_obj;
|
||||
Eina_List *layouts;
|
||||
Eina_List *matches;
|
||||
Ecore_Event_Handler *client_message_handler;
|
||||
Ecore_Event_Handler *kbd_move_hdl;
|
||||
struct {
|
||||
char *directory;
|
||||
const char *file;
|
||||
int w, h, orig_h;
|
||||
int fuzz;
|
||||
int direction;
|
||||
E_Kbd_Int_Type type;
|
||||
Eina_List *keys;
|
||||
E_Kbd_Int_Key *pressed;
|
||||
int state;
|
||||
} layout;
|
||||
struct {
|
||||
Evas_Coord x, y, cx, cy;
|
||||
int lx, ly, clx, cly;
|
||||
Ecore_Timer *hold_timer;
|
||||
unsigned char down : 1;
|
||||
unsigned char stroke : 1;
|
||||
unsigned char zoom : 1;
|
||||
} down;
|
||||
struct {
|
||||
Evas_Object *popup;
|
||||
Evas_Object *base_obj, *ilist_obj;
|
||||
} layoutlist;
|
||||
struct {
|
||||
Evas_Object *popup;
|
||||
Evas_Object *base_obj, *ilist_obj;
|
||||
Eina_List *matches;
|
||||
} matchlist;
|
||||
struct {
|
||||
Evas_Object *popup;
|
||||
Evas_Object *base_obj, *ilist_obj;
|
||||
Eina_List *matches;
|
||||
} dictlist;
|
||||
struct {
|
||||
Evas_Object *popup;
|
||||
Evas_Object *base_obj, *layout_obj, *sublayout_obj;
|
||||
E_Kbd_Int_Key *pressed;
|
||||
} zoomkey;
|
||||
|
||||
E_Kbd_Buf *kbuf;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Int_Key
|
||||
{
|
||||
int x, y, w, h, orig_y, orig_h;
|
||||
|
||||
Eina_List *states;
|
||||
Evas_Object *obj, *zoom_obj, *icon_obj, *zoom_icon_obj;
|
||||
|
||||
unsigned char pressed : 1;
|
||||
unsigned char selected : 1;
|
||||
|
||||
unsigned char is_shift : 1;
|
||||
unsigned char is_multi_shift : 1;
|
||||
unsigned char is_ctrl : 1;
|
||||
unsigned char is_alt : 1;
|
||||
unsigned char is_altgr : 1;
|
||||
unsigned char is_capslock : 1;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Int_Key_State
|
||||
{
|
||||
int state;
|
||||
const char *label, *icon;
|
||||
const char *out;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Int_Layout
|
||||
{
|
||||
const char *path;
|
||||
const char *dir;
|
||||
const char *icon;
|
||||
const char *name;
|
||||
int type;
|
||||
};
|
||||
|
||||
struct _E_Kbd_Int_Match
|
||||
{
|
||||
E_Kbd_Int *ki;
|
||||
const char *str;
|
||||
Evas_Object *obj;
|
||||
};
|
||||
|
||||
EAPI E_Kbd_Int *e_kbd_int_new(const char *themedir, const char *syskbds, const char *sysdicts);
|
||||
EAPI void e_kbd_int_free(E_Kbd_Int *ki);
|
||||
|
||||
#endif
|
|
@ -1,38 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_kbd_send.h"
|
||||
|
||||
static const char *
|
||||
_string_to_keysym(const char *str)
|
||||
{
|
||||
int glyph;
|
||||
|
||||
/* utf8 -> glyph id (unicode - ucs4) */
|
||||
glyph = 0;
|
||||
evas_string_char_next_get(str, 0, &glyph);
|
||||
if (glyph <= 0) return NULL;
|
||||
/* glyph id -> keysym */
|
||||
if (glyph > 0xff) glyph |= 0x1000000;
|
||||
return ecore_x_keysym_string_get(glyph);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_send_string_press(const char *str, Kbd_Mod mod)
|
||||
{
|
||||
const char *key = NULL;
|
||||
|
||||
key = _string_to_keysym(str);
|
||||
if (!key) return;
|
||||
e_kbd_send_keysym_press(key, mod);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_kbd_send_keysym_press(const char *key, Kbd_Mod mod)
|
||||
{
|
||||
if (mod & KBD_MOD_CTRL) ecore_x_test_fake_key_down("Control_L");
|
||||
if (mod & KBD_MOD_ALT) ecore_x_test_fake_key_down("Alt_L");
|
||||
if (mod & KBD_MOD_WIN) ecore_x_test_fake_key_down("Super_L");
|
||||
ecore_x_test_fake_key_press(key);
|
||||
if (mod & KBD_MOD_WIN) ecore_x_test_fake_key_up("Super_L");
|
||||
if (mod & KBD_MOD_ALT) ecore_x_test_fake_key_up("Alt_L");
|
||||
if (mod & KBD_MOD_CTRL) ecore_x_test_fake_key_up("Control_L");
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef E_KBD_SEND_H
|
||||
#define E_KBD_SEND_H
|
||||
|
||||
typedef enum _Kbd_Mod
|
||||
{
|
||||
KBD_MOD_SHIFT = (1 << 0),
|
||||
KBD_MOD_CTRL = (1 << 1),
|
||||
KBD_MOD_ALT = (1 << 2),
|
||||
KBD_MOD_WIN = (1 << 3)
|
||||
} Kbd_Mod;
|
||||
|
||||
EAPI void e_kbd_send_string_press(const char *str, Kbd_Mod mod);
|
||||
EAPI void e_kbd_send_keysym_press(const char *key, Kbd_Mod mod);
|
||||
|
||||
#endif
|
|
@ -1,312 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
#include "e_kbd_int.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void *_il_kbd_config_create(E_Config_Dialog *cfd);
|
||||
static void _il_kbd_config_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_il_kbd_config_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static void _il_kbd_config_changed(void *data, Evas_Object *obj, void *event);
|
||||
static Eina_Bool _il_kbd_config_change_timeout(void *data);
|
||||
|
||||
EAPI Il_Kbd_Config *il_kbd_cfg = NULL;
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
Ecore_Timer *_il_kbd_config_change_timer = NULL;
|
||||
int kbd_external = 0;
|
||||
|
||||
/* public functions */
|
||||
EAPI int
|
||||
il_kbd_config_init(E_Module *m)
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
conf_edd = E_CONFIG_DD_NEW("Illume_Kbd_Cfg", Il_Kbd_Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Il_Kbd_Config
|
||||
#define D conf_edd
|
||||
E_CONFIG_VAL(D, T, version, INT);
|
||||
E_CONFIG_VAL(D, T, use_internal, INT);
|
||||
E_CONFIG_VAL(D, T, run_keyboard, STR);
|
||||
E_CONFIG_VAL(D, T, dict, STR);
|
||||
E_CONFIG_VAL(D, T, zoom_level, INT);
|
||||
E_CONFIG_VAL(D, T, hold_timer, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, slide_dim, INT);
|
||||
E_CONFIG_VAL(D, T, scale_height, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, layout, INT);
|
||||
il_kbd_cfg = e_config_domain_load("module.illume-keyboard", conf_edd);
|
||||
if ((il_kbd_cfg) &&
|
||||
((il_kbd_cfg->version >> 16) < IL_CONFIG_MAJ))
|
||||
{
|
||||
E_FREE(il_kbd_cfg);
|
||||
il_kbd_cfg = NULL;
|
||||
}
|
||||
if (!il_kbd_cfg)
|
||||
{
|
||||
il_kbd_cfg = E_NEW(Il_Kbd_Config, 1);
|
||||
il_kbd_cfg->version = 0;
|
||||
il_kbd_cfg->use_internal = 1;
|
||||
il_kbd_cfg->run_keyboard = NULL;
|
||||
il_kbd_cfg->dict = eina_stringshare_add("English_US.dic");
|
||||
il_kbd_cfg->zoom_level = 4;
|
||||
il_kbd_cfg->slide_dim = 4;
|
||||
il_kbd_cfg->hold_timer = 0.25;
|
||||
}
|
||||
if (il_kbd_cfg)
|
||||
{
|
||||
/* Add new config variables here */
|
||||
/* if ((il_kbd_cfg->version & 0xffff) < 1) */
|
||||
if ((il_kbd_cfg->version & 0xffff) < 2)
|
||||
{
|
||||
il_kbd_cfg->zoom_level = 4;
|
||||
il_kbd_cfg->slide_dim = 4;
|
||||
il_kbd_cfg->hold_timer = 0.25;
|
||||
il_kbd_cfg->scale_height = 1.0;
|
||||
}
|
||||
if ((il_kbd_cfg->version & 0xffff) < IL_CONFIG_MIN)
|
||||
{
|
||||
il_kbd_cfg->layout = E_KBD_INT_TYPE_ALPHA;
|
||||
}
|
||||
|
||||
il_kbd_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||
}
|
||||
|
||||
il_kbd_cfg->mod_dir = eina_stringshare_add(m->dir);
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-keyboard.edj",
|
||||
il_kbd_cfg->mod_dir);
|
||||
e_configure_registry_category_add("illume", 0, _("Illume"), NULL,
|
||||
"enlightenment/display");
|
||||
e_configure_registry_generic_item_add("illume/keyboard", 0, _("Keyboard"),
|
||||
buff, "icon", il_kbd_config_show);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
il_kbd_config_shutdown(void)
|
||||
{
|
||||
il_kbd_cfg->cfd = NULL;
|
||||
|
||||
e_configure_registry_item_del("illume/keyboard");
|
||||
e_configure_registry_category_del("illume");
|
||||
|
||||
if (il_kbd_cfg->mod_dir) eina_stringshare_del(il_kbd_cfg->mod_dir);
|
||||
if (il_kbd_cfg->run_keyboard) eina_stringshare_del(il_kbd_cfg->run_keyboard);
|
||||
if (il_kbd_cfg->dict) eina_stringshare_del(il_kbd_cfg->dict);
|
||||
|
||||
E_FREE(il_kbd_cfg);
|
||||
il_kbd_cfg = NULL;
|
||||
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
il_kbd_config_save(void)
|
||||
{
|
||||
e_config_domain_save("module.illume-keyboard", conf_edd, il_kbd_cfg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
il_kbd_config_show(E_Comp *comp, const char *params EINA_UNUSED)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
E_Config_Dialog_View *v;
|
||||
|
||||
if (e_config_dialog_find("E", "_config_illume_keyboard_settings")) return;
|
||||
|
||||
v = E_NEW(E_Config_Dialog_View, 1);
|
||||
v->create_cfdata = _il_kbd_config_create;
|
||||
v->free_cfdata = _il_kbd_config_free;
|
||||
v->basic.create_widgets = _il_kbd_config_ui;
|
||||
v->basic_only = 1;
|
||||
v->normal_win = 1;
|
||||
v->scroll = 1;
|
||||
|
||||
cfd = e_config_dialog_new(NULL, _("Keyboard Settings"), "E",
|
||||
"_config_illume_keyboard_settings",
|
||||
"enlightenment/keyboard_settings", 0, v, NULL);
|
||||
il_kbd_cfg->cfd = cfd;
|
||||
}
|
||||
|
||||
/* local function prototypes */
|
||||
static void *
|
||||
_il_kbd_config_create(E_Config_Dialog *cfd EINA_UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_il_kbd_config_free(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata EINA_UNUSED)
|
||||
{
|
||||
il_kbd_cfg->cfd = NULL;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_il_kbd_config_ui(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data *cfdata EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *list, *of, *ow, *sl, *ol;
|
||||
E_Radio_Group *rg;
|
||||
Eina_List *l;
|
||||
|
||||
list = e_widget_list_add(evas, 0, 0);
|
||||
if (!il_kbd_cfg->run_keyboard)
|
||||
{
|
||||
if (il_kbd_cfg->use_internal) kbd_external = 1;
|
||||
else kbd_external = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Eina_List *kbds;
|
||||
Efreet_Desktop *desktop;
|
||||
int nn = 0;
|
||||
|
||||
kbd_external = 0;
|
||||
kbds = efreet_util_desktop_category_list("Keyboard");
|
||||
if (kbds)
|
||||
{
|
||||
nn = 2;
|
||||
EINA_LIST_FOREACH(kbds, l, desktop)
|
||||
{
|
||||
const char *dname;
|
||||
|
||||
dname = ecore_file_file_get(desktop->orig_path);
|
||||
if (dname)
|
||||
{
|
||||
if (!strcmp(il_kbd_cfg->run_keyboard, dname))
|
||||
{
|
||||
kbd_external = nn;
|
||||
break;
|
||||
}
|
||||
}
|
||||
nn++;
|
||||
}
|
||||
EINA_LIST_FREE(kbds, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
}
|
||||
}
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Keyboards"), 0);
|
||||
rg = e_widget_radio_group_new(&(kbd_external));
|
||||
ow = e_widget_radio_add(evas, _("None"), 0, rg);
|
||||
e_widget_framelist_object_append(of, ow);
|
||||
evas_object_smart_callback_add(ow, "changed", _il_kbd_config_changed, NULL);
|
||||
ow = e_widget_radio_add(evas, _("Default"), 1, rg);
|
||||
e_widget_framelist_object_append(of, ow);
|
||||
evas_object_smart_callback_add(ow, "changed", _il_kbd_config_changed, NULL);
|
||||
{
|
||||
Eina_List *kbds;
|
||||
Efreet_Desktop *desktop;
|
||||
int nn = 2;
|
||||
|
||||
kbds = efreet_util_desktop_category_list("Keyboard");
|
||||
EINA_LIST_FREE(kbds, desktop)
|
||||
{
|
||||
ow = e_widget_radio_add(evas, desktop->name, nn, rg);
|
||||
e_widget_framelist_object_append(of, ow);
|
||||
evas_object_smart_callback_add(ow, "changed",
|
||||
_il_kbd_config_changed, NULL);
|
||||
efreet_desktop_free(desktop);
|
||||
nn++;
|
||||
}
|
||||
}
|
||||
|
||||
ol = e_widget_label_add(evas, _("Displacement ratio"));
|
||||
e_widget_framelist_object_append(of, ol);
|
||||
sl = e_widget_slider_add(evas, EINA_TRUE, 0, "1/%.0f", 1.0, 10.0, 1.0, 0,
|
||||
NULL, &(il_kbd_cfg->slide_dim), 150);
|
||||
e_widget_framelist_object_append(of, sl);
|
||||
|
||||
ol = e_widget_label_add(evas, _("Delay for zoom popup"));
|
||||
e_widget_framelist_object_append(of, ol);
|
||||
sl = e_widget_slider_add(evas, EINA_TRUE, 0, "%.2f second(s)", 0.0, 3.0, 0.01, 0,
|
||||
&(il_kbd_cfg->hold_timer), NULL, 150);
|
||||
e_widget_framelist_object_append(of, sl);
|
||||
|
||||
ol = e_widget_label_add(evas, _("Zoom level"));
|
||||
e_widget_framelist_object_append(of, ol);
|
||||
sl = e_widget_slider_add(evas, EINA_TRUE, 0, "%.0f", 1.0, 10.0, 1.0, 0,
|
||||
NULL, &(il_kbd_cfg->zoom_level), 150);
|
||||
e_widget_framelist_object_append(of, sl);
|
||||
|
||||
ol = e_widget_label_add(evas, _("Height"));
|
||||
e_widget_framelist_object_append(of, ol);
|
||||
sl = e_widget_slider_add(evas, EINA_TRUE, 0, "%.2f", 0.2, 2.0, 0.1, 0,
|
||||
&(il_kbd_cfg->scale_height), NULL, 150);
|
||||
evas_object_smart_callback_add(sl, "changed",
|
||||
_il_kbd_config_changed, NULL);
|
||||
|
||||
e_widget_framelist_object_append(of, sl);
|
||||
|
||||
e_widget_list_object_append(list, of, 1, 0, 0.0);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Layout"), 0);
|
||||
rg = e_widget_radio_group_new(&(il_kbd_cfg->layout));
|
||||
ow = e_widget_radio_add(evas, _("Default"), E_KBD_INT_TYPE_ALPHA, rg);
|
||||
e_widget_framelist_object_append(of, ow);
|
||||
evas_object_smart_callback_add(ow, "changed", _il_kbd_config_changed, NULL);
|
||||
ow = e_widget_radio_add(evas, _("Terminal"), E_KBD_INT_TYPE_TERMINAL, rg);
|
||||
e_widget_framelist_object_append(of, ow);
|
||||
evas_object_smart_callback_add(ow, "changed", _il_kbd_config_changed, NULL);
|
||||
e_widget_list_object_append(list, of, 1, 0, 0.0);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
static void
|
||||
_il_kbd_config_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
if (_il_kbd_config_change_timer)
|
||||
ecore_timer_del(_il_kbd_config_change_timer);
|
||||
_il_kbd_config_change_timer =
|
||||
ecore_timer_add(0.5, _il_kbd_config_change_timeout, data);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_kbd_config_change_timeout(void *data EINA_UNUSED)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
il_kbd_cfg->use_internal = 0;
|
||||
if (il_kbd_cfg->run_keyboard)
|
||||
eina_stringshare_del(il_kbd_cfg->run_keyboard);
|
||||
il_kbd_cfg->run_keyboard = NULL;
|
||||
if (kbd_external == 0)
|
||||
il_kbd_cfg->use_internal = 0;
|
||||
else if (kbd_external == 1)
|
||||
il_kbd_cfg->use_internal = 1;
|
||||
else
|
||||
{
|
||||
Eina_List *kbds;
|
||||
Efreet_Desktop *desktop;
|
||||
int nn;
|
||||
|
||||
kbds = efreet_util_desktop_category_list("Keyboard");
|
||||
if (kbds)
|
||||
{
|
||||
nn = 2;
|
||||
EINA_LIST_FOREACH(kbds, l, desktop)
|
||||
{
|
||||
const char *dname;
|
||||
|
||||
dname = ecore_file_file_get(desktop->orig_path);
|
||||
if (nn == kbd_external)
|
||||
{
|
||||
if (dname)
|
||||
il_kbd_cfg->run_keyboard = eina_stringshare_add(dname);
|
||||
break;
|
||||
}
|
||||
nn++;
|
||||
}
|
||||
EINA_LIST_FREE(kbds, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
}
|
||||
}
|
||||
|
||||
il_kbd_cfg_update();
|
||||
e_config_save_queue();
|
||||
_il_kbd_config_change_timer = NULL;
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
#ifndef E_MOD_CONFIG_H
|
||||
#define E_MOD_CONFIG_H
|
||||
|
||||
#define IL_CONFIG_MIN 3
|
||||
#define IL_CONFIG_MAJ 1
|
||||
|
||||
typedef struct _Il_Kbd_Config Il_Kbd_Config;
|
||||
|
||||
struct _Il_Kbd_Config
|
||||
{
|
||||
int version;
|
||||
|
||||
int use_internal;
|
||||
const char *dict, *run_keyboard;
|
||||
|
||||
// Not User Configurable. Placeholders
|
||||
const char *mod_dir;
|
||||
int zoom_level;
|
||||
int slide_dim;
|
||||
double hold_timer;
|
||||
double scale_height;
|
||||
int layout;
|
||||
|
||||
E_Config_Dialog *cfd;
|
||||
};
|
||||
|
||||
EAPI int il_kbd_config_init(E_Module *m);
|
||||
EAPI int il_kbd_config_shutdown(void);
|
||||
EAPI int il_kbd_config_save(void);
|
||||
|
||||
EAPI void il_kbd_config_show(E_Comp *comp, const char *params);
|
||||
|
||||
extern EAPI Il_Kbd_Config *il_kbd_cfg;
|
||||
|
||||
#endif
|
|
@ -1,126 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
#include "e_kbd_int.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _il_kbd_stop(void);
|
||||
static void _il_kbd_start(void);
|
||||
static Eina_Bool _il_kbd_cb_exit(void *data, int type, void *event);
|
||||
|
||||
/* local variables */
|
||||
static E_Kbd_Int *ki = NULL;
|
||||
static Ecore_Exe *_kbd_exe = NULL;
|
||||
static Ecore_Event_Handler *_kbd_exe_exit_handler = NULL;
|
||||
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
if (!il_kbd_config_init(m)) return NULL;
|
||||
_il_kbd_start();
|
||||
e_module_delayed_set(m, 1);
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
_il_kbd_stop();
|
||||
il_kbd_config_shutdown();
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return il_kbd_config_save();
|
||||
}
|
||||
|
||||
EAPI void
|
||||
il_kbd_cfg_update(void)
|
||||
{
|
||||
_il_kbd_stop();
|
||||
_il_kbd_start();
|
||||
}
|
||||
|
||||
static void
|
||||
_il_kbd_stop(void)
|
||||
{
|
||||
if (ki) e_kbd_int_free(ki);
|
||||
ki = NULL;
|
||||
if (_kbd_exe) ecore_exe_interrupt(_kbd_exe);
|
||||
_kbd_exe = NULL;
|
||||
if (_kbd_exe_exit_handler) ecore_event_handler_del(_kbd_exe_exit_handler);
|
||||
_kbd_exe_exit_handler = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_il_kbd_start(void)
|
||||
{
|
||||
if (il_kbd_cfg->use_internal)
|
||||
{
|
||||
ki = e_kbd_int_new(il_kbd_cfg->mod_dir,
|
||||
il_kbd_cfg->mod_dir, il_kbd_cfg->mod_dir);
|
||||
}
|
||||
else if (il_kbd_cfg->run_keyboard)
|
||||
{
|
||||
E_Exec_Instance *inst;
|
||||
Efreet_Desktop *desktop;
|
||||
|
||||
desktop = efreet_util_desktop_file_id_find(il_kbd_cfg->run_keyboard);
|
||||
if (!desktop)
|
||||
{
|
||||
Efreet_Desktop *d;
|
||||
Eina_List *kbds, *l;
|
||||
|
||||
kbds = efreet_util_desktop_category_list("Keyboard");
|
||||
if (kbds)
|
||||
{
|
||||
EINA_LIST_FOREACH(kbds, l, d)
|
||||
{
|
||||
const char *dname;
|
||||
|
||||
dname = ecore_file_file_get(d->orig_path);
|
||||
if (dname)
|
||||
{
|
||||
if (!strcmp(dname, il_kbd_cfg->run_keyboard))
|
||||
{
|
||||
desktop = d;
|
||||
efreet_desktop_ref(desktop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
EINA_LIST_FREE(kbds, d)
|
||||
efreet_desktop_free(d);
|
||||
}
|
||||
}
|
||||
if (desktop)
|
||||
{
|
||||
E_Zone *zone;
|
||||
|
||||
zone = e_zone_current_get();
|
||||
inst = e_exec(zone, desktop, NULL, NULL, "illume-keyboard");
|
||||
if (inst)
|
||||
{
|
||||
_kbd_exe = inst->exe;
|
||||
_kbd_exe_exit_handler =
|
||||
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
|
||||
_il_kbd_cb_exit, NULL);
|
||||
}
|
||||
efreet_desktop_free(desktop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_il_kbd_cb_exit(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Exe_Event_Del *ev;
|
||||
|
||||
ev = event;
|
||||
if (ev->exe == _kbd_exe) _kbd_exe = NULL;
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef E_MOD_MAIN_H
|
||||
#define E_MOD_MAIN_H
|
||||
|
||||
EAPI void il_kbd_cfg_update(void);
|
||||
|
||||
#endif
|
|
@ -1,143 +0,0 @@
|
|||
##KBDCONF-1.0
|
||||
kbd 130 45
|
||||
fuzz 20
|
||||
|
||||
# keyboard type
|
||||
type ALPHA
|
||||
# an icon for the keyboard so you know which one you have
|
||||
icon alpha.png
|
||||
|
||||
# if the key out is in quotes - "q" for example, then this key is used for
|
||||
# typing words and can be part of a dictionary match, any other key when
|
||||
# pressed will end the dictionary match (u can disable dictionary matching in
|
||||
# a layout by not having any outputs in quotes)
|
||||
key 5 5 10 10
|
||||
normal q "q"
|
||||
shift Q "Q"
|
||||
capslock Q "Q"
|
||||
altgr Ω Ω
|
||||
key 15 5 10 10
|
||||
normal w "w"
|
||||
shift W "W"
|
||||
capslock W "W"
|
||||
key 25 5 10 10
|
||||
normal e "e"
|
||||
shift E "E"
|
||||
altgr € €
|
||||
capslock E "E"
|
||||
key 35 5 10 10
|
||||
normal r "r"
|
||||
shift R "R"
|
||||
capslock R "R"
|
||||
altgr ® ®
|
||||
key 45 5 10 10
|
||||
normal t "t"
|
||||
shift T "T"
|
||||
capslock T "T"
|
||||
key 55 5 10 10
|
||||
normal y "y"
|
||||
shift Y "Y"
|
||||
capslock Y "Y"
|
||||
key 65 5 10 10
|
||||
normal u "u"
|
||||
shift U "U"
|
||||
capslock U "U"
|
||||
key 75 5 10 10
|
||||
normal i "i"
|
||||
shift I "I"
|
||||
capslock I "I"
|
||||
key 85 5 10 10
|
||||
normal o "o"
|
||||
shift O "O"
|
||||
capslock O "O"
|
||||
key 95 5 10 10
|
||||
normal p "p"
|
||||
shift P "P"
|
||||
capslock P "P"
|
||||
|
||||
key 10 15 10 10
|
||||
normal a "a"
|
||||
shift A "A"
|
||||
capslock A "A"
|
||||
key 20 15 10 10
|
||||
normal s "s"
|
||||
shift S "S"
|
||||
capslock S "S"
|
||||
key 30 15 10 10
|
||||
normal d "d"
|
||||
shift D "D"
|
||||
capslock D "D"
|
||||
key 40 15 10 10
|
||||
normal f "f"
|
||||
shift F "F"
|
||||
capslock F "F"
|
||||
key 50 15 10 10
|
||||
normal g "g"
|
||||
shift G "G"
|
||||
capslock G "G"
|
||||
key 60 15 10 10
|
||||
normal h "h"
|
||||
shift H "H"
|
||||
capslock H "H"
|
||||
key 70 15 10 10
|
||||
normal j "j"
|
||||
shift J "J"
|
||||
capslock J "J"
|
||||
key 80 15 10 10
|
||||
normal k "k"
|
||||
shift K "K"
|
||||
capslock K "K"
|
||||
key 90 15 10 10
|
||||
normal l "l"
|
||||
shift L "L"
|
||||
capslock L "L"
|
||||
|
||||
key 5 25 10 10
|
||||
normal ⎇
|
||||
is_altgr
|
||||
key 15 25 10 10
|
||||
normal z "z"
|
||||
shift Z "Z"
|
||||
capslock Z "Z"
|
||||
key 25 25 10 10
|
||||
normal x "x"
|
||||
shift X "X"
|
||||
capslock X "X"
|
||||
key 35 25 10 10
|
||||
normal c "c"
|
||||
shift C "C"
|
||||
capslock C "C"
|
||||
altgr ¢ ¢
|
||||
key 45 25 10 10
|
||||
normal v "v"
|
||||
shift V "V"
|
||||
capslock V "V"
|
||||
key 55 25 10 10
|
||||
normal b "b"
|
||||
shift B "B"
|
||||
capslock B "B"
|
||||
key 65 25 10 10
|
||||
normal n "n"
|
||||
shift N "N"
|
||||
capslock N "N"
|
||||
key 75 25 10 10
|
||||
normal m "m"
|
||||
shift M "M"
|
||||
capslock M "M"
|
||||
altgr µ µ
|
||||
key 105 25 10 10
|
||||
# normal shift.png
|
||||
normal ↑
|
||||
shift ⇈
|
||||
capslock ⇊
|
||||
is_multi_shift
|
||||
|
||||
key 115 5 10 10
|
||||
normal . period
|
||||
shift , comma
|
||||
key 115 15 10 10
|
||||
normal ? question
|
||||
shift ! exclam
|
||||
key 115 25 10 10
|
||||
normal ' "'"
|
||||
shift / slash
|
|
@ -1,120 +0,0 @@
|
|||
##KBDCONF-1.0
|
||||
kbd 130 45
|
||||
fuzz 20
|
||||
|
||||
# keyboard type
|
||||
type NUMERIC
|
||||
# an icon for the keyboard so you know which one you have
|
||||
icon numeric.png
|
||||
|
||||
key 5 5 10 10
|
||||
normal 1 1
|
||||
shift ! exclam
|
||||
key 15 5 10 10
|
||||
normal 2 2
|
||||
shift @ at
|
||||
key 25 5 10 10
|
||||
normal 3 3
|
||||
shift # numbersign
|
||||
key 35 5 10 10
|
||||
normal 4 4
|
||||
shift $ dollar
|
||||
key 45 5 10 10
|
||||
normal 5 5
|
||||
shift % percent
|
||||
key 55 5 10 10
|
||||
normal 6 6
|
||||
shift ^ asciicircum
|
||||
key 65 5 10 10
|
||||
normal 7 7
|
||||
shift & ampersand
|
||||
key 75 5 10 10
|
||||
normal 8 8
|
||||
shift * asterisk
|
||||
key 85 5 10 10
|
||||
normal 9 9
|
||||
shift ( parenleft
|
||||
key 95 5 10 10
|
||||
normal 0 0
|
||||
shift ) parenright
|
||||
key 105 5 10 10
|
||||
normal [ bracketleft
|
||||
shift { braceleft
|
||||
key 115 5 10 10
|
||||
normal ] bracketright
|
||||
shift } braceright
|
||||
|
||||
|
||||
key 5 15 10 10
|
||||
normal tab.png Tab
|
||||
shift tab.png ISO_Left_Tab
|
||||
key 15 15 10 10
|
||||
normal ` grave
|
||||
shift ~ asciitilde
|
||||
key 25 15 10 10
|
||||
normal - "-"
|
||||
shift _ underscore
|
||||
key 35 15 10 10
|
||||
normal = equal
|
||||
shift + plus
|
||||
key 45 15 10 10
|
||||
normal \ backslash
|
||||
shift | bar
|
||||
key 55 15 10 10
|
||||
normal ; semicolon
|
||||
shift : colon
|
||||
key 65 15 10 10
|
||||
normal ' apostrophe
|
||||
shift " quotedbl
|
||||
key 75 15 10 10
|
||||
normal / slash
|
||||
shift ? question
|
||||
key 85 15 10 10
|
||||
normal , comma
|
||||
shift < less
|
||||
key 95 15 10 10
|
||||
normal ß "ß"
|
||||
shift ¢ "¢"
|
||||
key 105 15 10 10
|
||||
normal € "€"
|
||||
shift £ "£"
|
||||
key 115 15 10 10
|
||||
normal ø "ø"
|
||||
shift Ø "Ø"
|
||||
|
||||
key 5 25 10 10
|
||||
normal ä "ä"
|
||||
shift Ä "Ä"
|
||||
key 15 25 10 10
|
||||
normal ö "ö"
|
||||
shift Ö "Ö"
|
||||
key 25 25 10 10
|
||||
normal ü "ü"
|
||||
shift Ü "Ü"
|
||||
key 35 25 10 10
|
||||
normal é "é"
|
||||
shift É "É"
|
||||
key 45 25 10 10
|
||||
normal è "è"
|
||||
shift È "È"
|
||||
key 55 25 10 10
|
||||
normal ô "ô"
|
||||
shift Ô "Ô"
|
||||
key 65 25 10 10
|
||||
normal ç "ç"
|
||||
shift Ç "Ç"
|
||||
key 75 25 10 10
|
||||
normal à "à"
|
||||
shift À "À"
|
||||
key 85 25 10 10
|
||||
normal ò "ò"
|
||||
shift Ò "Ò"
|
||||
key 95 25 10 10
|
||||
normal ó "ó"
|
||||
shift Ó "Ó"
|
||||
key 105 25 10 10
|
||||
normal ñ "ñ"
|
||||
shift Ñ "Ñ"
|
||||
key 115 25 10 10
|
||||
normal shift.png
|
||||
is_shift
|
|
@ -1,244 +0,0 @@
|
|||
##KBDCONF-1.0
|
||||
kbd 450 150
|
||||
|
||||
# keyboard type
|
||||
type TERMINAL
|
||||
# an icon for the keyboard so you know which one you have
|
||||
icon qwerty.png
|
||||
|
||||
key 0 0 30 30
|
||||
normal ` grave
|
||||
shift ~ asciitilde
|
||||
capslock ` grave
|
||||
key 30 0 30 30
|
||||
normal 1 1
|
||||
shift ! exclam
|
||||
capslock 1 1
|
||||
key 60 0 30 30
|
||||
normal 2 2
|
||||
shift @ at
|
||||
capslock 2 2
|
||||
key 90 0 30 30
|
||||
normal 3 3
|
||||
shift # numbersign
|
||||
capslock 3 3
|
||||
key 120 0 30 30
|
||||
normal 4 4
|
||||
shift $ dollar
|
||||
capslock 4 4
|
||||
key 150 0 30 30
|
||||
normal 5 5
|
||||
shift % percent
|
||||
capslock 5 5
|
||||
key 180 0 30 30
|
||||
normal 6 6
|
||||
shift ^ asciicircum
|
||||
capslock 6 6
|
||||
key 210 0 30 30
|
||||
normal 7 7
|
||||
shift & ampersand
|
||||
capslock 7 7
|
||||
key 240 0 30 30
|
||||
normal 8 8
|
||||
shift * asterisk
|
||||
capslock 8 8
|
||||
key 270 0 30 30
|
||||
normal 9 9
|
||||
shift ( parenleft
|
||||
capslock 9 9
|
||||
key 300 0 30 30
|
||||
normal 0 0
|
||||
shift ) parenright
|
||||
capslock 0 0
|
||||
key 330 0 30 30
|
||||
normal - minus
|
||||
shift _ underscore
|
||||
capslock - minus
|
||||
key 360 0 30 30
|
||||
normal = equal
|
||||
shift + plus
|
||||
capslock = equal
|
||||
key 390 0 60 30
|
||||
normal backspace.png BackSpace
|
||||
|
||||
key 0 30 45 30
|
||||
normal tab.png Tab
|
||||
shift tab.png ISO_Left_Tab
|
||||
key 45 30 30 30
|
||||
normal q q
|
||||
shift Q Q
|
||||
capslock Q Q
|
||||
key 75 30 30 30
|
||||
normal w w
|
||||
shift W W
|
||||
capslock W W
|
||||
key 105 30 30 30
|
||||
normal e e
|
||||
shift E E
|
||||
capslock E E
|
||||
key 135 30 30 30
|
||||
normal r r
|
||||
shift R R
|
||||
capslock R R
|
||||
key 165 30 30 30
|
||||
normal t t
|
||||
shift T T
|
||||
capslock T T
|
||||
key 195 30 30 30
|
||||
normal y y
|
||||
shift Y Y
|
||||
capslock Y Y
|
||||
key 225 30 30 30
|
||||
normal u u
|
||||
shift U U
|
||||
capslock U U
|
||||
key 255 30 30 30
|
||||
normal i i
|
||||
shift I I
|
||||
capslock I I
|
||||
key 285 30 30 30
|
||||
normal o o
|
||||
shift O O
|
||||
capslock O O
|
||||
key 315 30 30 30
|
||||
normal p p
|
||||
shift P P
|
||||
capslock P P
|
||||
key 345 30 30 30
|
||||
normal [ bracketleft
|
||||
shift { braceleft
|
||||
capslock [ bracketleft
|
||||
key 375 30 30 30
|
||||
normal ] bracketright
|
||||
shift } braceright
|
||||
capslock ] bracketright
|
||||
key 405 30 45 30
|
||||
normal \ backslash
|
||||
shift | bar
|
||||
capslock \ backslash
|
||||
|
||||
key 0 60 60 30
|
||||
normal caps
|
||||
capslock CAPS
|
||||
is_capslock
|
||||
key 60 60 30 30
|
||||
normal a a
|
||||
shift A A
|
||||
capslock A A
|
||||
key 90 60 30 30
|
||||
normal s s
|
||||
shift S S
|
||||
capslock S S
|
||||
key 120 60 30 30
|
||||
normal d d
|
||||
shift D D
|
||||
capslock D D
|
||||
key 150 60 30 30
|
||||
normal f f
|
||||
shift F F
|
||||
capslock F F
|
||||
key 180 60 30 30
|
||||
normal g g
|
||||
shift G G
|
||||
capslock G G
|
||||
key 210 60 30 30
|
||||
normal h h
|
||||
shift H H
|
||||
capslock H H
|
||||
key 240 60 30 30
|
||||
normal j j
|
||||
shift J J
|
||||
capslock J J
|
||||
key 270 60 30 30
|
||||
normal k k
|
||||
shift K K
|
||||
capslock K K
|
||||
key 300 60 30 30
|
||||
normal l l
|
||||
shift L L
|
||||
capslock L L
|
||||
key 330 60 30 30
|
||||
normal ; semicolon
|
||||
shift : colon
|
||||
capslock ; semicolon
|
||||
key 360 60 30 30
|
||||
normal ' apostrophe
|
||||
shift " quotedbl
|
||||
capslock ' apostrophe
|
||||
key 390 60 60 30
|
||||
normal enter.png Return
|
||||
|
||||
key 0 90 75 30
|
||||
normal shift.png
|
||||
is_shift
|
||||
key 75 90 30 30
|
||||
normal z z
|
||||
shift Z Z
|
||||
capslock Z Z
|
||||
key 105 90 30 30
|
||||
normal x x
|
||||
shift X X
|
||||
capslock X X
|
||||
key 135 90 30 30
|
||||
normal c c
|
||||
shift C C
|
||||
capslock C C
|
||||
key 165 90 30 30
|
||||
normal v v
|
||||
shift V V
|
||||
capslock V V
|
||||
key 195 90 30 30
|
||||
normal b b
|
||||
shift B B
|
||||
capslock B B
|
||||
key 225 90 30 30
|
||||
normal n n
|
||||
shift N N
|
||||
capslock N N
|
||||
key 255 90 30 30
|
||||
normal m m
|
||||
shift M M
|
||||
capslock M M
|
||||
key 285 90 30 30
|
||||
normal , comma
|
||||
shift < less
|
||||
capslock , comma
|
||||
key 315 90 30 30
|
||||
normal . period
|
||||
shift > greater
|
||||
capslock . period
|
||||
key 345 90 30 30
|
||||
normal / slash
|
||||
shift ? question
|
||||
capslock / slash
|
||||
key 375 90 30 30
|
||||
normal ins Insert
|
||||
key 405 90 35 30
|
||||
normal del Delete
|
||||
|
||||
key 0 120 30 30
|
||||
normal ctrl
|
||||
is_ctrl
|
||||
key 30 120 30 30
|
||||
normal alt
|
||||
is_alt
|
||||
key 60 120 120 30
|
||||
normal space space
|
||||
key 180 120 30 30
|
||||
normal left.png Left
|
||||
key 210 120 30 30
|
||||
normal right.png Right
|
||||
key 240 120 30 30
|
||||
normal up.png Up
|
||||
key 270 120 30 30
|
||||
normal down.png Down
|
||||
key 300 120 30 30
|
||||
normal pu Prior
|
||||
key 330 120 30 30
|
||||
normal pd Next
|
||||
key 360 120 30 30
|
||||
normal hm Home
|
||||
key 390 120 30 30
|
||||
normal en End
|
||||
key 420 120 30 30
|
||||
normal es Escape
|
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 286 B |
|
@ -1 +0,0 @@
|
|||
/org/freedesktop/Hal/devices/platform_*
|
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 262 B |
|
@ -1,13 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Keyboard
|
||||
Name[ca]=Illume-Teclat
|
||||
Name[de]=Illume-Tastatur
|
||||
Name[eo]=Illume-Klavaro
|
||||
Name[fr]=Clavier Illume
|
||||
Name[ms]=Illume-Keyboard
|
||||
Name[sr]=Тастатура одсјаја
|
||||
Name[tr]=Illume-Klavye
|
||||
Icon=e-module-illume-keyboard
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1,202 +0,0 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local structures */
|
||||
typedef struct _Instance Instance;
|
||||
struct _Instance
|
||||
{
|
||||
E_Gadcon_Client *gcc;
|
||||
Evas_Object *o_toggle;
|
||||
Ecore_Event_Handler *hdl;
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
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 *cc);
|
||||
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *cc, Evas *evas);
|
||||
static const char *_gc_id_new(const E_Gadcon_Client_Class *cc);
|
||||
static void _cb_action_mode_single(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED);
|
||||
static void _cb_action_mode_dual_top(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED);
|
||||
static void _cb_action_mode_dual_left(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED);
|
||||
static Eina_Bool _cb_event_client_message(void *data, int type EINA_UNUSED, void *event);
|
||||
static void _set_icon(Instance *inst);
|
||||
static void _mode_set(Instance *inst, Ecore_X_Illume_Mode mode);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *instances = NULL;
|
||||
static const char *mod_dir = NULL;
|
||||
|
||||
static const E_Gadcon_Client_Class _gc_class =
|
||||
{
|
||||
GADCON_CLIENT_CLASS_VERSION, "illume-mode-toggle",
|
||||
{ _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
|
||||
};
|
||||
|
||||
/* public functions */
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Mode Toggle" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
mod_dir = eina_stringshare_add(m->dir);
|
||||
e_gadcon_provider_register(&_gc_class);
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
e_gadcon_provider_unregister(&_gc_class);
|
||||
if (mod_dir) eina_stringshare_del(mod_dir);
|
||||
mod_dir = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static E_Gadcon_Client *
|
||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
inst = E_NEW(Instance, 1);
|
||||
inst->o_toggle = edje_object_add(gc->evas);
|
||||
e_theme_edje_object_set(inst->o_toggle,
|
||||
"base/theme/modules/illume_mode_toggle",
|
||||
"e/modules/illume_mode_toggle/main");
|
||||
|
||||
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_toggle);
|
||||
inst->gcc->data = inst;
|
||||
|
||||
edje_object_signal_callback_add(inst->o_toggle, "e,action,mode,single", "",
|
||||
_cb_action_mode_single, inst);
|
||||
edje_object_signal_callback_add(inst->o_toggle, "e,action,mode,dual,top", "",
|
||||
_cb_action_mode_dual_top, inst);
|
||||
edje_object_signal_callback_add(inst->o_toggle, "e,action,mode,dual,left", "",
|
||||
_cb_action_mode_dual_left, inst);
|
||||
|
||||
_set_icon(inst);
|
||||
|
||||
inst->hdl = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
|
||||
_cb_event_client_message, inst);
|
||||
|
||||
instances = eina_list_append(instances, inst);
|
||||
return inst->gcc;
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_shutdown(E_Gadcon_Client *gcc)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
if (!(inst = gcc->data)) return;
|
||||
instances = eina_list_remove(instances, inst);
|
||||
if (inst->o_toggle) evas_object_del(inst->o_toggle);
|
||||
if (inst->hdl) ecore_event_handler_del(inst->hdl);
|
||||
inst->hdl = NULL;
|
||||
E_FREE(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient EINA_UNUSED)
|
||||
{
|
||||
e_gadcon_client_aspect_set(gcc, 16, 16);
|
||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_label(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
return _("Illume-Mode-Toggle");
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_gc_icon(const E_Gadcon_Client_Class *cc EINA_UNUSED, Evas *evas)
|
||||
{
|
||||
Evas_Object *o;
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s/e-module-illume-mode-toggle.edj", mod_dir);
|
||||
o = edje_object_add(evas);
|
||||
edje_object_file_set(o, buff, "icon");
|
||||
return o;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_gc_id_new(const E_Gadcon_Client_Class *cc EINA_UNUSED)
|
||||
{
|
||||
static char buff[32];
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s.%d", _gc_class.name,
|
||||
eina_list_count(instances));
|
||||
return buff;
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_action_mode_single(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
_mode_set(data, ECORE_X_ILLUME_MODE_SINGLE);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_action_mode_dual_top(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
_mode_set(data, ECORE_X_ILLUME_MODE_DUAL_TOP);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_action_mode_dual_left(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
_mode_set(data, ECORE_X_ILLUME_MODE_DUAL_LEFT);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_event_client_message(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_X_Event_Client_Message *ev;
|
||||
Instance *inst;
|
||||
|
||||
ev = event;
|
||||
if (ev->message_type != ECORE_X_ATOM_E_ILLUME_MODE)
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
if (!(inst = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
_set_icon(inst);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static void
|
||||
_set_icon(Instance *inst)
|
||||
{
|
||||
Ecore_X_Window xwin;
|
||||
Ecore_X_Illume_Mode mode;
|
||||
|
||||
xwin = inst->gcc->gadcon->zone->black_win;
|
||||
mode = ecore_x_e_illume_mode_get(xwin);
|
||||
|
||||
if (mode == ECORE_X_ILLUME_MODE_DUAL_TOP)
|
||||
edje_object_signal_emit(inst->o_toggle, "e,mode,dual,top", "e");
|
||||
else if (mode == ECORE_X_ILLUME_MODE_DUAL_LEFT)
|
||||
edje_object_signal_emit(inst->o_toggle, "e,mode,dual,left", "e");
|
||||
else
|
||||
edje_object_signal_emit(inst->o_toggle, "e,mode,single", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_mode_set(Instance *inst, Ecore_X_Illume_Mode mode)
|
||||
{
|
||||
Ecore_X_Window xwin;
|
||||
|
||||
if (!inst) return;
|
||||
|
||||
xwin = inst->gcc->gadcon->zone->black_win;
|
||||
ecore_x_e_illume_mode_set(xwin, mode);
|
||||
ecore_x_e_illume_mode_send(xwin, mode);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Mode-Toggle
|
||||
Name[ca]=Illume-Mode-Toggle
|
||||
Name[de]=Illume-Modusumschalter
|
||||
Name[eo]=Baskulilo de reĝimo Illume
|
||||
Name[ms]=Illume-Mode-Toggle
|
||||
Name[sr]=Прекидач одсјаја
|
||||
Name[tr]=Illume-Mod-Değiştirici
|
||||
Icon=e-module-illume-mode-toggle
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1 +0,0 @@
|
|||
e-module-illume-softkey.edj
|
|
@ -1,51 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
/* local variables */
|
||||
EAPI Il_Sft_Config *il_sft_cfg = NULL;
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
|
||||
int
|
||||
il_sft_config_init(void)
|
||||
{
|
||||
conf_edd = E_CONFIG_DD_NEW("Illume-Softkey_Cfg", Il_Sft_Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Il_Sft_Config
|
||||
#define D conf_edd
|
||||
E_CONFIG_VAL(D, T, version, INT);
|
||||
E_CONFIG_VAL(D, T, height, INT);
|
||||
|
||||
il_sft_cfg = e_config_domain_load("module.illume-softkey", conf_edd);
|
||||
if ((il_sft_cfg) &&
|
||||
((il_sft_cfg->version >> 16) < IL_CONFIG_MAJ))
|
||||
{
|
||||
E_FREE(il_sft_cfg);
|
||||
}
|
||||
if (!il_sft_cfg)
|
||||
{
|
||||
il_sft_cfg = E_NEW(Il_Sft_Config, 1);
|
||||
il_sft_cfg->version = 0;
|
||||
il_sft_cfg->height = 32;
|
||||
}
|
||||
if (il_sft_cfg)
|
||||
il_sft_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_sft_config_shutdown(void)
|
||||
{
|
||||
E_FREE(il_sft_cfg);
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
il_sft_config_save(void)
|
||||
{
|
||||
return e_config_domain_save("module.illume-softkey", conf_edd, il_sft_cfg);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef E_MOD_CONFIG_H
|
||||
#define E_MOD_CONFIG_H
|
||||
|
||||
#define IL_CONFIG_MIN 0
|
||||
#define IL_CONFIG_MAJ 0
|
||||
|
||||
typedef struct _Il_Sft_Config Il_Sft_Config;
|
||||
|
||||
struct _Il_Sft_Config
|
||||
{
|
||||
int version, height;
|
||||
};
|
||||
|
||||
int il_sft_config_init(void);
|
||||
int il_sft_config_shutdown(void);
|
||||
int il_sft_config_save(void);
|
||||
|
||||
extern EAPI Il_Sft_Config *il_sft_cfg;
|
||||
|
||||
#endif
|
|
@ -1,81 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
#include "e_mod_sft_win.h"
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *swins = NULL;
|
||||
|
||||
/* external variables */
|
||||
const char *_sft_mod_dir = NULL;
|
||||
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume-Softkey" };
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
const Eina_List *l;
|
||||
E_Comp *comp;
|
||||
|
||||
/* set module priority so we load before others */
|
||||
e_module_priority_set(m, 85);
|
||||
|
||||
/* set module directory variable */
|
||||
_sft_mod_dir = eina_stringshare_add(m->dir);
|
||||
|
||||
/* init config subsystem */
|
||||
if (!il_sft_config_init())
|
||||
{
|
||||
/* clear module directory variable */
|
||||
if (_sft_mod_dir) eina_stringshare_del(_sft_mod_dir);
|
||||
_sft_mod_dir = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(e_comp_list(), l, comp)
|
||||
{
|
||||
E_Zone *zone;
|
||||
Eina_List *zl;
|
||||
|
||||
/* for each zone, create a softkey window */
|
||||
EINA_LIST_FOREACH(comp->zones, zl, zone)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
|
||||
/* try to create new softkey window */
|
||||
if (!(swin = e_mod_sft_win_new(zone))) continue;
|
||||
swins = eina_list_append(swins, swin);
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
|
||||
/* destroy the softkey windows */
|
||||
EINA_LIST_FREE(swins, swin)
|
||||
e_object_del(E_OBJECT(swin));
|
||||
|
||||
/* reset softkey geometry for conformant apps */
|
||||
ecore_x_e_illume_softkey_geometry_set(ecore_x_window_root_first_get(),
|
||||
0, 0, 0, 0);
|
||||
|
||||
/* shutdown config */
|
||||
il_sft_config_shutdown();
|
||||
|
||||
/* clear module directory variable */
|
||||
if (_sft_mod_dir) eina_stringshare_del(_sft_mod_dir);
|
||||
_sft_mod_dir = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_modapi_save(E_Module *m EINA_UNUSED)
|
||||
{
|
||||
return il_sft_config_save();
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef E_MOD_MAIN_H
|
||||
# define E_MOD_MAIN_H
|
||||
|
||||
extern const char *_sft_mod_dir;
|
||||
|
||||
#endif
|
|
@ -1,462 +0,0 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_config.h"
|
||||
#include "e_mod_sft_win.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_mod_sft_win_cb_free(Sft_Win *swin);
|
||||
static Eina_Bool _e_mod_sft_win_cb_win_prop(void *data, int type EINA_UNUSED, void *event);
|
||||
static Eina_Bool _e_mod_sft_win_cb_zone_resize(void *data, int type EINA_UNUSED, void *event);
|
||||
static void _e_mod_sft_win_cb_resize(E_Win *win);
|
||||
static void _e_mod_sft_win_create_default_buttons(Sft_Win *swin);
|
||||
static void _e_mod_sft_win_create_extra_buttons(Sft_Win *swin);
|
||||
static void _e_mod_sft_win_cb_close(void *data, void *data2 EINA_UNUSED);
|
||||
static void _e_mod_sft_win_cb_back(void *data, void *data2 EINA_UNUSED);
|
||||
static void _e_mod_sft_win_cb_forward(void *data, void *data2 EINA_UNUSED);
|
||||
static void _e_mod_sft_win_cb_win_pos(void *data, void *data2 EINA_UNUSED);
|
||||
static void _e_mod_sft_win_pos_toggle_top(Sft_Win *swin);
|
||||
static void _e_mod_sft_win_pos_toggle_left(Sft_Win *swin);
|
||||
static E_Client *_e_mod_sft_win_border_get(E_Zone *zone, int x, int y);
|
||||
|
||||
Sft_Win *
|
||||
e_mod_sft_win_new(E_Zone *zone)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
Ecore_X_Window_State states[2];
|
||||
Evas_Coord mw = 0, mh = 0;
|
||||
|
||||
/* create our new softkey window object */
|
||||
swin = E_OBJECT_ALLOC(Sft_Win, SFT_WIN_TYPE, _e_mod_sft_win_cb_free);
|
||||
if (!swin) return NULL;
|
||||
|
||||
swin->zone = zone;
|
||||
|
||||
/* hook into property change so we can adjust w/ e_scale */
|
||||
swin->hdls =
|
||||
eina_list_append(swin->hdls,
|
||||
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
|
||||
_e_mod_sft_win_cb_win_prop, swin));
|
||||
|
||||
/* hook into zone resize so we can adjust min width */
|
||||
swin->hdls =
|
||||
eina_list_append(swin->hdls,
|
||||
ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,
|
||||
_e_mod_sft_win_cb_zone_resize,
|
||||
swin));
|
||||
|
||||
/* create new window */
|
||||
swin->win = e_win_new(e_comp);
|
||||
swin->win->data = swin;
|
||||
|
||||
/* set some properties on the window */
|
||||
e_win_title_set(swin->win, _("Illume Softkey"));
|
||||
e_win_name_class_set(swin->win, "Illume-Softkey", "Illume-Softkey");
|
||||
e_win_no_remember_set(swin->win, EINA_TRUE);
|
||||
|
||||
/* hook into window resize so we can resize our objects */
|
||||
evas_object_resize_callback_set(swin->win, _e_mod_sft_win_cb_resize);
|
||||
|
||||
/* set this window to not show in taskbar or pager */
|
||||
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
||||
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
||||
ecore_x_netwm_window_state_set(swin->win->evas_win, states, 2);
|
||||
|
||||
/* set this window to not accept or take focus */
|
||||
ecore_x_icccm_hints_set(swin->win->evas_win, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
/* create our base object */
|
||||
swin->o_base = edje_object_add(swin->win->evas);
|
||||
if (!e_theme_edje_object_set(swin->o_base,
|
||||
"base/theme/modules/illume-softkey",
|
||||
"modules/illume-softkey/window"))
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
snprintf(buff, sizeof(buff),
|
||||
"%s/e-module-illume-softkey.edj", _sft_mod_dir);
|
||||
edje_object_file_set(swin->o_base, buff,
|
||||
"modules/illume-softkey/window");
|
||||
}
|
||||
evas_object_move(swin->o_base, 0, 0);
|
||||
evas_object_show(swin->o_base);
|
||||
|
||||
/* create default buttons */
|
||||
_e_mod_sft_win_create_default_buttons(swin);
|
||||
|
||||
/* create default buttons */
|
||||
_e_mod_sft_win_create_extra_buttons(swin);
|
||||
|
||||
edje_object_size_min_calc(swin->o_base, &mw, &mh);
|
||||
|
||||
mh = E_CLAMP(mh, 10, zone->h / 3);
|
||||
/* set minimum size of this window */
|
||||
evas_object_size_hint_min_set(swin->win, zone->w, mh);
|
||||
|
||||
/* position and resize this window */
|
||||
evas_object_geometry_set(swin->win, zone->x,
|
||||
(zone->y + zone->h - (il_sft_cfg->height * e_scale)),
|
||||
zone->w, mh);
|
||||
|
||||
/* show the window */
|
||||
evas_object_show(swin->win);
|
||||
|
||||
e_client_zone_set(swin->win->client, zone);
|
||||
swin->win->client->user_skip_winlist = 1;
|
||||
|
||||
swin->win->client->lock_focus_in = 1;
|
||||
swin->win->client->lock_focus_out = 1;
|
||||
|
||||
/* set this window to be a dock window. This needs to be done after show
|
||||
* as E will sometimes reset the window type */
|
||||
ecore_x_netwm_window_type_set(swin->win->evas_win, E_WINDOW_TYPE_DOCK);
|
||||
|
||||
/* tell conformant apps our position and size */
|
||||
ecore_x_e_illume_softkey_geometry_set(zone->black_win,
|
||||
zone->x,
|
||||
(zone->h - (il_sft_cfg->height * e_scale)),
|
||||
zone->w,
|
||||
(il_sft_cfg->height * e_scale));
|
||||
|
||||
return swin;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_mod_sft_win_cb_free(Sft_Win *swin)
|
||||
{
|
||||
Ecore_Event_Handler *hdl;
|
||||
const Evas_Object *box;
|
||||
|
||||
/* delete the event handlers */
|
||||
EINA_LIST_FREE(swin->hdls, hdl)
|
||||
ecore_event_handler_del(hdl);
|
||||
|
||||
if ((box = edje_object_part_object_get(swin->o_base, "e.box.buttons")))
|
||||
{
|
||||
Evas_Object *btn;
|
||||
|
||||
/* delete the buttons */
|
||||
EINA_LIST_FREE(swin->btns, btn)
|
||||
{
|
||||
edje_object_part_box_remove(swin->o_base, "e.box.buttons", btn);
|
||||
evas_object_del(btn);
|
||||
}
|
||||
}
|
||||
if ((box = edje_object_part_object_get(swin->o_base, "e.box.extra_buttons")))
|
||||
{
|
||||
Evas_Object *btn;
|
||||
|
||||
/* delete the buttons */
|
||||
EINA_LIST_FREE(swin->extra_btns, btn)
|
||||
{
|
||||
edje_object_part_box_remove(swin->o_base,
|
||||
"e.box.extra_buttons", btn);
|
||||
evas_object_del(btn);
|
||||
}
|
||||
}
|
||||
|
||||
/* delete the objects */
|
||||
if (swin->o_base) evas_object_del(swin->o_base);
|
||||
swin->o_base = NULL;
|
||||
|
||||
/* delete the window */
|
||||
if (swin->win) e_object_del(E_OBJECT(swin->win));
|
||||
swin->win = NULL;
|
||||
|
||||
/* tell conformant apps our position and size */
|
||||
ecore_x_e_illume_softkey_geometry_set(swin->zone->black_win, 0, 0, 0, 0);
|
||||
|
||||
/* free the allocated object */
|
||||
E_FREE(swin);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_mod_sft_win_cb_win_prop(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
Ecore_X_Event_Window_Property *ev;
|
||||
|
||||
ev = event;
|
||||
|
||||
if (!(swin = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
if (ev->win != swin->win->comp->man->root)
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
/* set minimum size of this window */
|
||||
evas_object_size_hint_min_set(swin->win, swin->zone->w, (il_sft_cfg->height * e_scale));
|
||||
|
||||
/* NB: Not sure why, but we need to tell this border to fetch icccm
|
||||
* size position hints now :( (NOTE: This was not needed a few days ago)
|
||||
* If we do not do this, than softkey does not change w/ scale anymore */
|
||||
swin->win->client->icccm.fetch.size_pos_hints = 1;
|
||||
|
||||
/* resize this window */
|
||||
evas_object_resize(swin->win, swin->zone->w, (il_sft_cfg->height * e_scale));
|
||||
|
||||
/* tell conformant apps our position and size */
|
||||
ecore_x_e_illume_softkey_geometry_set(swin->zone->black_win,
|
||||
swin->win->x, swin->win->y,
|
||||
swin->win->w,
|
||||
(il_sft_cfg->height * e_scale));
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_mod_sft_win_cb_zone_resize(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
E_Event_Zone_Move_Resize *ev;
|
||||
|
||||
ev = event;
|
||||
if (!(swin = data)) return ECORE_CALLBACK_PASS_ON;
|
||||
if (ev->zone != swin->zone) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
/* set minimum size of this window */
|
||||
evas_object_size_hint_min_set(swin->win, ev->zone->w, (il_sft_cfg->height * e_scale));
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_cb_resize(E_Win *win)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
Evas_Object *btn;
|
||||
const Evas_Object *box;
|
||||
Eina_List *l;
|
||||
int mw, mh;
|
||||
|
||||
if (!(swin = win->data)) return;
|
||||
|
||||
/* adjust button(s) size for e_scale */
|
||||
EINA_LIST_FOREACH(swin->btns, l, btn)
|
||||
{
|
||||
e_widget_size_min_get(btn, &mw, &mh);
|
||||
evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale));
|
||||
evas_object_resize(btn, (mw * e_scale), (mh * e_scale));
|
||||
}
|
||||
|
||||
/* adjust box size for content */
|
||||
if ((box = edje_object_part_object_get(swin->o_base, "e.box.buttons")))
|
||||
{
|
||||
evas_object_size_hint_min_get((Evas_Object *)box, &mw, &mh);
|
||||
evas_object_resize((Evas_Object *)box, mw, mh);
|
||||
}
|
||||
|
||||
mw = mh = 0;
|
||||
/* adjust button(s) size for e_scale */
|
||||
EINA_LIST_FOREACH(swin->extra_btns, l, btn)
|
||||
{
|
||||
e_widget_size_min_get(btn, &mw, &mh);
|
||||
evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale));
|
||||
evas_object_resize(btn, (mw * e_scale), (mh * e_scale));
|
||||
}
|
||||
|
||||
/* adjust box size for content */
|
||||
if ((box = edje_object_part_object_get(swin->o_base, "e.box.extra_buttons")))
|
||||
{
|
||||
evas_object_size_hint_min_get((Evas_Object *)box, &mw, &mh);
|
||||
evas_object_resize((Evas_Object *)box, mw, mh);
|
||||
}
|
||||
|
||||
/* resize the base object */
|
||||
if (swin->o_base) evas_object_resize(swin->o_base, win->w, win->h);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_create_default_buttons(Sft_Win *swin)
|
||||
{
|
||||
Evas_Object *btn;
|
||||
int mw, mh;
|
||||
|
||||
/* create back button */
|
||||
btn = e_widget_button_add(swin->win->evas, _("Back"), "go-previous",
|
||||
_e_mod_sft_win_cb_back, swin, NULL);
|
||||
e_widget_size_min_get(btn, &mw, &mh);
|
||||
evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale));
|
||||
|
||||
/* NB: this show is required when packing e_widgets into an edje box else
|
||||
* the widgets do not receive any events */
|
||||
evas_object_show(btn);
|
||||
|
||||
/* add button to box */
|
||||
edje_object_part_box_append(swin->o_base, "e.box.buttons", btn);
|
||||
|
||||
/* add button to our list */
|
||||
swin->btns = eina_list_append(swin->btns, btn);
|
||||
|
||||
/* create forward button */
|
||||
btn = e_widget_button_add(swin->win->evas, _("Forward"), "go-next",
|
||||
_e_mod_sft_win_cb_forward, swin, NULL);
|
||||
e_widget_size_min_get(btn, &mw, &mh);
|
||||
evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale));
|
||||
|
||||
/* NB: this show is required when packing e_widgets into an edje box else
|
||||
* the widgets do not receive any events */
|
||||
evas_object_show(btn);
|
||||
|
||||
/* add button to box */
|
||||
edje_object_part_box_append(swin->o_base, "e.box.buttons", btn);
|
||||
|
||||
/* add button to our list */
|
||||
swin->btns = eina_list_append(swin->btns, btn);
|
||||
/* create close button */
|
||||
btn = e_widget_button_add(swin->win->evas, _("Close"), "application-exit",
|
||||
_e_mod_sft_win_cb_close, swin, NULL);
|
||||
e_widget_size_min_get(btn, &mw, &mh);
|
||||
evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale));
|
||||
|
||||
/* NB: this show is required when packing e_widgets into an edje box else
|
||||
* the widgets do not receive any events */
|
||||
evas_object_show(btn);
|
||||
|
||||
/* add button to box */
|
||||
edje_object_part_box_append(swin->o_base, "e.box.buttons", btn);
|
||||
|
||||
/* add button to our list */
|
||||
swin->btns = eina_list_append(swin->btns, btn);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_create_extra_buttons(Sft_Win *swin)
|
||||
{
|
||||
Evas_Object *btn;
|
||||
int mw, mh;
|
||||
|
||||
/* create window toggle button */
|
||||
btn = e_widget_button_add(swin->win->evas, _("Switch"), "view-refresh",
|
||||
_e_mod_sft_win_cb_win_pos, swin, NULL);
|
||||
e_widget_size_min_get(btn, &mw, &mh);
|
||||
evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale));
|
||||
|
||||
/* NB: this show is required when packing e_widgets into an edje box else
|
||||
* the widgets do not receive any events */
|
||||
evas_object_show(btn);
|
||||
|
||||
/* add button to box */
|
||||
edje_object_part_box_append(swin->o_base, "e.box.extra_buttons", btn);
|
||||
|
||||
/* add button to our list */
|
||||
swin->extra_btns = eina_list_append(swin->extra_btns, btn);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_cb_close(void *data, void *data2 EINA_UNUSED)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
|
||||
if (!(swin = data)) return;
|
||||
ecore_x_e_illume_close_send(swin->zone->black_win);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_cb_back(void *data, void *data2 EINA_UNUSED)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
|
||||
if (!(swin = data)) return;
|
||||
ecore_x_e_illume_focus_back_send(swin->zone->black_win);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_cb_forward(void *data, void *data2 EINA_UNUSED)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
|
||||
if (!(swin = data)) return;
|
||||
ecore_x_e_illume_focus_forward_send(swin->zone->black_win);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_cb_win_pos(void *data, void *data2 EINA_UNUSED)
|
||||
{
|
||||
Sft_Win *swin;
|
||||
Ecore_X_Illume_Mode mode;
|
||||
|
||||
if (!(swin = data)) return;
|
||||
mode = ecore_x_e_illume_mode_get(swin->zone->black_win);
|
||||
switch (mode)
|
||||
{
|
||||
case ECORE_X_ILLUME_MODE_UNKNOWN:
|
||||
case ECORE_X_ILLUME_MODE_SINGLE:
|
||||
break;
|
||||
case ECORE_X_ILLUME_MODE_DUAL_TOP:
|
||||
_e_mod_sft_win_pos_toggle_top(swin);
|
||||
break;
|
||||
case ECORE_X_ILLUME_MODE_DUAL_LEFT:
|
||||
_e_mod_sft_win_pos_toggle_left(swin);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_pos_toggle_top(Sft_Win *swin)
|
||||
{
|
||||
E_Client *t, *b;
|
||||
int y, h, tpos, bpos;
|
||||
|
||||
if (!swin) return;
|
||||
if (!ecore_x_e_illume_indicator_geometry_get(swin->zone->black_win,
|
||||
NULL, &y, NULL, &h))
|
||||
y = 0;
|
||||
|
||||
if (y > 0)
|
||||
{
|
||||
tpos = 0;
|
||||
bpos = (y + h);
|
||||
}
|
||||
else
|
||||
{
|
||||
tpos = (y + h);
|
||||
bpos = (swin->zone->h / 2);
|
||||
}
|
||||
|
||||
t = _e_mod_sft_win_border_get(swin->zone, swin->zone->x, tpos);
|
||||
b = _e_mod_sft_win_border_get(swin->zone, swin->zone->x, bpos);
|
||||
|
||||
if (t) evas_object_move(t->frame, t->x, bpos);
|
||||
if (b) evas_object_move(b->frame, b->x, tpos);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_sft_win_pos_toggle_left(Sft_Win *swin)
|
||||
{
|
||||
E_Client *l, *r;
|
||||
int h, lpos, rpos;
|
||||
|
||||
if (!swin) return;
|
||||
|
||||
if (!ecore_x_e_illume_indicator_geometry_get(swin->zone->black_win,
|
||||
NULL, NULL, NULL, &h))
|
||||
h = 0;
|
||||
|
||||
lpos = 0;
|
||||
rpos = (swin->zone->w / 2);
|
||||
|
||||
l = _e_mod_sft_win_border_get(swin->zone, lpos, h);
|
||||
r = _e_mod_sft_win_border_get(swin->zone, rpos, h);
|
||||
|
||||
if (l) evas_object_move(l->frame, rpos, l->y);
|
||||
if (r) evas_object_move(r->frame, lpos, r->y);
|
||||
}
|
||||
|
||||
static E_Client *
|
||||
_e_mod_sft_win_border_get(E_Zone *zone, int x, int y)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Client *ec;
|
||||
|
||||
if (!zone) return NULL;
|
||||
EINA_LIST_REVERSE_FOREACH(e_comp->clients, l, ec)
|
||||
{
|
||||
if (e_client_util_ignored_get(ec)) continue;
|
||||
if (ec->zone != zone) continue;
|
||||
if (!ec->visible) continue;
|
||||
if ((ec->x != x) || (ec->y != y)) continue;
|
||||
if (ec->illume.quickpanel.quickpanel) continue;
|
||||
|
||||
return ec;
|
||||
}
|
||||
return NULL;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef E_MOD_SFT_WIN_H
|
||||
# define E_MOD_SFT_WIN_H
|
||||
|
||||
/* define softkey window object type */
|
||||
# define SFT_WIN_TYPE 0xE1b0784
|
||||
|
||||
/* define structure for softkey window */
|
||||
typedef struct _Sft_Win Sft_Win;
|
||||
struct _Sft_Win
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
E_Zone *zone;
|
||||
Eina_List *hdls;
|
||||
|
||||
E_Win *win;
|
||||
Evas_Object *o_base;
|
||||
Eina_List *btns, *extra_btns;
|
||||
};
|
||||
|
||||
Sft_Win *e_mod_sft_win_new(E_Zone *zone);
|
||||
|
||||
#endif
|
|
@ -1,11 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Link
|
||||
Name=Illume-Softkey
|
||||
Name[ca]=Illume-Softkey
|
||||
Name[de]=Illume-Funktionstaste
|
||||
Name[ms]=Illume-Softkey
|
||||
Name[sr]=Софтверска тастатура на додир
|
||||
Name[tr]=Illume-Ortatuş
|
||||
Icon=e-module-illume-softkey
|
||||
X-Enlightenment-ModuleType=mobile
|
|
@ -1,3 +0,0 @@
|
|||
/e-module-illume2.edj
|
||||
|
||||
/doc/illume.dox
|
|
@ -1,273 +0,0 @@
|
|||
/*
|
||||
Author:
|
||||
Andres Blanc <andresblanc@gmail.com>
|
||||
DaveMDS Andreoli <dave@gurumeditation.it>
|
||||
|
||||
Supported Browsers:
|
||||
ie7, opera9, konqueror4 and firefox3
|
||||
|
||||
Please use a different file for ie6, ie5, etc. hacks.
|
||||
*/
|
||||
|
||||
|
||||
/* Necessary to place the footer at the bottom of the page */
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#container {
|
||||
min-height: 100%;
|
||||
height: auto !important;
|
||||
height: 100%;
|
||||
margin: 0 auto -53px;
|
||||
}
|
||||
|
||||
#footer, #push {
|
||||
height: 53px;
|
||||
}
|
||||
|
||||
|
||||
* html #container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Prevent floating elements overflowing containers */
|
||||
.clear {
|
||||
clear: both;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
/* Flexible & centered layout from 750 to 960 pixels */
|
||||
.layout {
|
||||
max-width: 960px;
|
||||
min-width: 760px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
body {
|
||||
/*font-family: Lucida Grande, Helvetica, sans-serif;*/
|
||||
font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif
|
||||
}
|
||||
|
||||
/* Prevent design overflowing the viewport in small resolutions */
|
||||
#container {
|
||||
padding-right: 17px;
|
||||
padding-left: 17px;
|
||||
background-image: url(head_bg.png);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
/****************************/
|
||||
/* Top main menu */
|
||||
/****************************/
|
||||
#header_logo {
|
||||
background-image : url(logo.png);
|
||||
width : 61px;
|
||||
}
|
||||
|
||||
#header_logo a {
|
||||
position : absolute;
|
||||
border : 0px;
|
||||
background-color : transparent;
|
||||
top : 0px;
|
||||
width : 60px;
|
||||
height : 60px;
|
||||
}
|
||||
|
||||
#header_menu {
|
||||
background-image : url(header_menu_background.png);
|
||||
font : normal 10pt verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
|
||||
text-align : right;
|
||||
}
|
||||
|
||||
#header_last {
|
||||
background-image : url(header_menu_background_last.png);
|
||||
width : 15px;
|
||||
}
|
||||
|
||||
td.nav_passive {
|
||||
background : url(header_menu_unselected_background.png) 0 0 no-repeat;
|
||||
height : 63px;
|
||||
font-family : "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
|
||||
font-size : 11px;
|
||||
padding : 20px 10px 20px 10px;
|
||||
vertical-align : middle;
|
||||
}
|
||||
|
||||
td.nav_active {
|
||||
background : url(header_menu_current_background.png) 0 0 no-repeat;
|
||||
height : 63px;
|
||||
color : #646464;
|
||||
font-family : "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
|
||||
font-size : 11px;
|
||||
font-weight : bold;
|
||||
padding : 20px 10px 20px 10px;
|
||||
vertical-align : middle;
|
||||
}
|
||||
|
||||
#header_menu a {
|
||||
display : block;
|
||||
text-decoration : none;
|
||||
cursor : pointer;
|
||||
color : #cdcdcd;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#header {
|
||||
width: 100%;
|
||||
height: 102px;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
width: 63px;
|
||||
height: 63px;
|
||||
position: absolute;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#header h1 span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#header h2 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* .menu-container is used to set properties common to .menu and .submenu */
|
||||
#header .menu-container {
|
||||
}
|
||||
|
||||
#header .menu-container ul {
|
||||
list-style-type: none;
|
||||
list-style-position: inside;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#header .menu-container li {
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#header .menu {
|
||||
height: 63px;
|
||||
display: block;
|
||||
background-image: url(menu_bg.png);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
#header .menu ul {
|
||||
height: 100%;
|
||||
display: block;
|
||||
background-image: url(menu_bg_last.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: top right;
|
||||
padding-right: 17px;
|
||||
}
|
||||
|
||||
#header .menu li {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
background-image: url(menu_bg_unsel.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#header .menu a {
|
||||
height: 100%;
|
||||
display: block;
|
||||
color: #cdcdcd;
|
||||
text-decoration: none;
|
||||
font-size: 10pt;
|
||||
line-height: 59px;
|
||||
text-align: center;
|
||||
padding: 0px 15px 0px 15px;
|
||||
}
|
||||
|
||||
#header .menu li:hover {
|
||||
background-image: url(menu_bg_hover.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#header .menu li:hover a {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
#header .menu li.current {
|
||||
background-image: url(menu_bg_current.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#header .menu li.current a {
|
||||
color: #646464;
|
||||
}
|
||||
|
||||
|
||||
/* Hide all the submenus but the current */
|
||||
#header .submenu ul {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#header .submenu .current {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#header .submenu {
|
||||
font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#header .submenu a {
|
||||
color: #888888;
|
||||
text-decoration: none;
|
||||
font-size: 0.9em;
|
||||
line-height: 15px;
|
||||
padding:0px 5px 0px 5px;
|
||||
}
|
||||
|
||||
#header .submenu a:hover {
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
#header .submenu li {
|
||||
border-left: 1px solid #DDDDDD;
|
||||
}
|
||||
|
||||
#header .submenu li:last-child {
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
#header .doxytitle {
|
||||
position: absolute;
|
||||
font-size: 1.8em;
|
||||
font-weight: bold;
|
||||
color: #444444;
|
||||
line-height: 35px;
|
||||
}
|
||||
|
||||
#header small {
|
||||
font-size: 0.4em;
|
||||
}
|
||||
|
||||
#footer {
|
||||
background-image: url(foot_bg.png);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#footer table {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
padding: 5px 30px 5px 30px;
|
||||
font-size: 0.8em;
|
||||
font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
#footer td.copyright {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
|
||||
<div id="push"></div>
|
||||
</div> <!-- #content -->
|
||||
</div> <!-- .layout -->
|
||||
|
||||
</div> <!-- #container -->
|
||||
|
||||
|
||||
<div id="footer">
|
||||
<table><tr>
|
||||
<td class="copyright">Copyright ©$year Enlightenment</td>
|
||||
<td class="generated">Docs generated $datetime</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,69 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>$title</title>
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
|
||||
<meta name="author" content="Andres Blanc" >
|
||||
|
||||
<link rel="icon" href="img/favicon.png" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
|
||||
<link rel="icon" href="img/favicon.png" type="image/ico">
|
||||
<link rel="shortcut icon" href="img/favicon.png" type="image/ico">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="e.css">
|
||||
<link rel="stylesheet" type="text/css" href="edoxy.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="header">
|
||||
<div class="layout">
|
||||
|
||||
<h1><span>Enlightenment</span></h1>
|
||||
<h2><span>Beauty at your fingertips</span></h2>
|
||||
|
||||
<table cellspacing="0" cellpadding="0" width="100%"><tr>
|
||||
<td id="header_logo">
|
||||
<a href="http://www.enlightenment.org"></a>
|
||||
</td>
|
||||
<td id="header_menu">
|
||||
<table cellspacing="0" cellpadding="0" align="right"><tr>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=home">Home</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=news">News</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=about">About</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=download">Download</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=support">Support</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contact">Contact</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="https://phab.enlightenment.org/maniphest/">Tracker</a></td>
|
||||
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=docs">Docs</a></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
<td id="header_last"></td>
|
||||
</tr></table>
|
||||
|
||||
<div class="doxytitle">
|
||||
$projectname Documentation <small>at $date</small>
|
||||
</div>
|
||||
|
||||
<div class="menu-container">
|
||||
<div class="submenu">
|
||||
<ul class="current">
|
||||
<li><a href="files.html">Files</a></li>
|
||||
<li><a href="annotated.html">Data Structures</a></li>
|
||||
<li><a href="globals.html">Globals</a></li>
|
||||
<li><a href="modules.html">Modules</a></li>
|
||||
<li><a href="pages.html">Related Pages</a></li>
|
||||
<li class="current"><a href="index.html">Main Page</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div class="layout">
|
|
@ -1,88 +0,0 @@
|
|||
/**
|
||||
|
||||
@mainpage Illume
|
||||
|
||||
@image html e.png
|
||||
|
||||
@author Carsten Haitzler <raster\@rasterman.com>
|
||||
@author Christopher Michael <devilhorns\@comcast.net>
|
||||
@date 2000-2012
|
||||
|
||||
@section intro Introduction
|
||||
|
||||
Illume is a module for Enlightenment that modifies the user interface of
|
||||
enlightenment to work cleanly and nicely on a mobile device - such as an
|
||||
Openmoko phone. It is resolution independent meaning that it can
|
||||
accommodate a very wide range of devices, from cell phones and PDAs to
|
||||
tablets and desktops. Illume has been designed from the ground up to
|
||||
support multiple screens in more than one way using either xinerama or multi-head.
|
||||
|
||||
@warning This is a work in progress and as such is subject to change.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
@page Illume_Main_Page Illume Basics
|
||||
|
||||
@section intro What is Illume?
|
||||
|
||||
Illume is a module for that modifies the user interface of Enlightenment to work
|
||||
cleanly and nicely on an embedded system - from cell phones and PDAs to tablets and
|
||||
desktops. It is resolution independent meaning that it can accommodate a very wide
|
||||
range of devices. Illume has been designed from the ground up to support multiple
|
||||
screens in more than one way using either xinerama or multi-head.
|
||||
|
||||
@section work How does Illume work?
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
@page Illume_Policy_Api_Page Illume Policy API Information
|
||||
*/
|
||||
|
||||
/**
|
||||
@page Illume_Policy Illume Policy Information
|
||||
*/
|
||||
|
||||
|
||||
// GROUP DEFINITIONS
|
||||
|
||||
/**
|
||||
@addtogroup Module_Illume2
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
@defgroup E_Illume_Keyboard_Group Illume Keyboard Information
|
||||
|
||||
The following group defines information needed to interact with the
|
||||
Virtual Keyboard.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
@defgroup E_Illume_Policy_Group Illume Policy Information
|
||||
|
||||
The following group defines information needed to implement an Illume
|
||||
Policy.
|
||||
|
||||
@warning There are some requirements that every policy must implement and
|
||||
some things are optional. Please reference the @ref E_Illume_Policy
|
||||
structure for requirements.
|
||||
*/
|
||||
|
||||
/**
|
||||
@defgroup E_Illume_Config_Group Illume Configuration Information
|
||||
|
||||
The following group defines information pertaining to Illume Configuration.
|
||||
*/
|
||||
|
||||
/**
|
||||
@defgroup E_Illume_Quickpanel_Group Illume Quickpanel Information
|
||||
|
||||
The following group defines information pertaining to Illume Quickpanels.
|
||||
*/
|
||||
|
||||
/**
|
||||
@}
|
||||
*/
|
Before Width: | Height: | Size: 29 KiB |
|
@ -1,486 +0,0 @@
|
|||
/*
|
||||
* This file contain a custom doxygen style to match e.org graphics
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
}*/
|
||||
BODY, TD {
|
||||
font-size: 12px;
|
||||
}
|
||||
H1 {
|
||||
text-align: center;
|
||||
font-size: 160%;
|
||||
}
|
||||
H2 {
|
||||
font-size: 120%;
|
||||
}
|
||||
H3 {
|
||||
font-size: 100%;
|
||||
}
|
||||
CAPTION {
|
||||
font-weight: bold
|
||||
}
|
||||
DIV.qindex {
|
||||
width: 100%;
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
line-height: 140%;
|
||||
}
|
||||
DIV.navpath {
|
||||
width: 100%;
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
line-height: 140%;
|
||||
}
|
||||
DIV.navtab {
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
margin-right: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
TD.navtab {
|
||||
font-size: 70%;
|
||||
}
|
||||
A.qindex {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #1A419D;
|
||||
}
|
||||
A.qindex:visited {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #1A419D
|
||||
}
|
||||
A.qindex:hover {
|
||||
text-decoration: none;
|
||||
background-color: #ddddff;
|
||||
}
|
||||
A.qindexHL {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background-color: #6666cc;
|
||||
color: #ffffff;
|
||||
border: 1px double #9295C2;
|
||||
}
|
||||
A.qindexHL:hover {
|
||||
text-decoration: none;
|
||||
background-color: #6666cc;
|
||||
color: #ffffff;
|
||||
}
|
||||
A.qindexHL:visited {
|
||||
text-decoration: none;
|
||||
background-color: #6666cc;
|
||||
color: #ffffff
|
||||
}
|
||||
A.el {
|
||||
text-decoration: none;
|
||||
font-weight: bold
|
||||
}
|
||||
A.elRef {
|
||||
font-weight: bold
|
||||
}
|
||||
A.code:link {
|
||||
text-decoration: none;
|
||||
font-weight: normal;
|
||||
color: #0000FF
|
||||
}
|
||||
A.code:visited {
|
||||
text-decoration: none;
|
||||
font-weight: normal;
|
||||
color: #0000FF
|
||||
}
|
||||
A.codeRef:link {
|
||||
font-weight: normal;
|
||||
color: #0000FF
|
||||
}
|
||||
A.codeRef:visited {
|
||||
font-weight: normal;
|
||||
color: #0000FF
|
||||
}
|
||||
A:hover, A:visited:hover {
|
||||
text-decoration: none;
|
||||
/* background-color: #f2f2ff; */
|
||||
color: #000055;
|
||||
}
|
||||
A.anchor {
|
||||
color: #000;
|
||||
}
|
||||
DL.el {
|
||||
margin-left: -1cm
|
||||
}
|
||||
.fragment {
|
||||
font-family: monospace, fixed;
|
||||
font-size: 95%;
|
||||
}
|
||||
PRE.fragment {
|
||||
border: 1px solid #CCCCCC;
|
||||
background-color: #f5f5f5;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
margin-left: 2px;
|
||||
margin-right: 8px;
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
DIV.ah {
|
||||
background-color: black;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-bottom: 3px;
|
||||
margin-top: 3px
|
||||
}
|
||||
|
||||
DIV.groupHeader {
|
||||
margin-left: 16px;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
DIV.groupText {
|
||||
margin-left: 16px;
|
||||
font-style: italic;
|
||||
font-size: 90%
|
||||
}
|
||||
/*BODY {
|
||||
background: white;
|
||||
color: black;
|
||||
margin-right: 20px;
|
||||
margin-left: 20px;
|
||||
}*/
|
||||
TD.indexkey {
|
||||
background-color: #e8eef2;
|
||||
font-weight: bold;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
TD.indexvalue {
|
||||
background-color: #e8eef2;
|
||||
font-style: italic;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
TR.memlist {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
P.formulaDsp {
|
||||
text-align: center;
|
||||
}
|
||||
IMG.formulaDsp {
|
||||
}
|
||||
IMG.formulaInl {
|
||||
vertical-align: middle;
|
||||
}
|
||||
SPAN.keyword { color: #008000 }
|
||||
SPAN.keywordtype { color: #604020 }
|
||||
SPAN.keywordflow { color: #e08000 }
|
||||
SPAN.comment { color: #800000 }
|
||||
SPAN.preprocessor { color: #806020 }
|
||||
SPAN.stringliteral { color: #002080 }
|
||||
SPAN.charliteral { color: #008080 }
|
||||
SPAN.vhdldigit { color: #ff00ff }
|
||||
SPAN.vhdlchar { color: #000000 }
|
||||
SPAN.vhdlkeyword { color: #700070 }
|
||||
SPAN.vhdllogic { color: #ff0000 }
|
||||
|
||||
.mdescLeft {
|
||||
padding: 0px 8px 4px 8px;
|
||||
font-size: 80%;
|
||||
font-style: italic;
|
||||
background-color: #FAFAFA;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
}
|
||||
.mdescRight {
|
||||
padding: 0px 8px 4px 8px;
|
||||
font-size: 80%;
|
||||
font-style: italic;
|
||||
background-color: #FAFAFA;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
}
|
||||
.memItemLeft {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: solid;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memItemRight {
|
||||
padding: 1px 8px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: solid;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memTemplItemLeft {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: none;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memTemplItemRight {
|
||||
padding: 1px 8px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: none;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memTemplParams {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: solid;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
color: #606060;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.search {
|
||||
color: #003399;
|
||||
font-weight: bold;
|
||||
}
|
||||
FORM.search {
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
INPUT.search {
|
||||
font-size: 75%;
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
background-color: #e8eef2;
|
||||
}
|
||||
TD.tiny {
|
||||
font-size: 75%;
|
||||
}
|
||||
a {
|
||||
color: #1A41A8;
|
||||
}
|
||||
a:visited {
|
||||
color: #2A3798;
|
||||
}
|
||||
.dirtab {
|
||||
padding: 4px;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid #84b0c7;
|
||||
}
|
||||
TH.dirtab {
|
||||
background: #e8eef2;
|
||||
font-weight: bold;
|
||||
}
|
||||
HR {
|
||||
height: 1px;
|
||||
border: none;
|
||||
border-top: 1px solid black;
|
||||
}
|
||||
|
||||
/* Style for detailed member documentation */
|
||||
.memtemplate {
|
||||
font-size: 80%;
|
||||
color: #606060;
|
||||
font-weight: normal;
|
||||
margin-left: 3px;
|
||||
}
|
||||
.memnav {
|
||||
background-color: #eeeeee;
|
||||
border: 1px solid #dddddd;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
margin-right: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
.memitem {
|
||||
padding: 4px;
|
||||
background-color: #eeeeee;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #dddddd;
|
||||
-moz-border-radius: 4px 4px 4px 4px;
|
||||
}
|
||||
.memname {
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
}
|
||||
.memdoc{
|
||||
padding-left: 10px;
|
||||
}
|
||||
.memproto {
|
||||
background-color: #111111;
|
||||
width: 100%;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #000000;
|
||||
font-weight: bold;
|
||||
-moz-border-radius: 4px 4px 4px 4px;
|
||||
}
|
||||
.paramkey {
|
||||
text-align: right;
|
||||
color: #ffffff;
|
||||
}
|
||||
.paramtype {
|
||||
white-space: nowrap;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
.paramname {
|
||||
color: #ff0000;
|
||||
font-style: italic;
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* End Styling for detailed member documentation */
|
||||
|
||||
/* for the tree view */
|
||||
.ftvtree {
|
||||
font-family: sans-serif;
|
||||
margin:0.5em;
|
||||
}
|
||||
/* these are for tree view when used as main index */
|
||||
.directory {
|
||||
font-size: 9pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
.directory h3 {
|
||||
margin: 0px;
|
||||
margin-top: 1em;
|
||||
font-size: 11pt;
|
||||
}
|
||||
|
||||
/* The following two styles can be used to replace the root node title */
|
||||
/* with an image of your choice. Simply uncomment the next two styles, */
|
||||
/* specify the name of your image and be sure to set 'height' to the */
|
||||
/* proper pixel height of your image. */
|
||||
|
||||
/* .directory h3.swap { */
|
||||
/* height: 61px; */
|
||||
/* background-repeat: no-repeat; */
|
||||
/* background-image: url("yourimage.gif"); */
|
||||
/* } */
|
||||
/* .directory h3.swap span { */
|
||||
/* display: none; */
|
||||
/* } */
|
||||
|
||||
.directory > h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
.directory p {
|
||||
margin: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.directory div {
|
||||
display: none;
|
||||
margin: 0px;
|
||||
}
|
||||
.directory img {
|
||||
vertical-align: -30%;
|
||||
}
|
||||
/* these are for tree view when not used as main index */
|
||||
.directory-alt {
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
.directory-alt h3 {
|
||||
margin: 0px;
|
||||
margin-top: 1em;
|
||||
font-size: 11pt;
|
||||
}
|
||||
.directory-alt > h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
.directory-alt p {
|
||||
margin: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.directory-alt div {
|
||||
display: none;
|
||||
margin: 0px;
|
||||
}
|
||||
.directory-alt img {
|
||||
vertical-align: -30%;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 637 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.7 KiB |