From: Carsten Haitzler Date: Mon, 4 Jan 2010 12:27:15 +0000 (+0000) Subject: 1. compositor module skeletion. have more code elsehwere currently X-Git-Tag: submit/efl/20131021.015651~8570 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ebb87d1581f428f20b99c1e5dfa6b2a6bf8aafe;p=platform%2Fupstream%2Fenlightenment.git 1. compositor module skeletion. have more code elsehwere currently 2. lutin patch for path_max SVN revision: 44874 --- diff --git a/configure.ac b/configure.ac index db53b85..fae22c9 100644 --- a/configure.ac +++ b/configure.ac @@ -30,6 +30,8 @@ AC_PROG_LIBTOOL AC_SUBST(release) +EFL_CHECK_PATH_MAX + AC_CHECK_FUNCS(setenv) AC_CHECK_FUNCS(unsetenv) @@ -485,6 +487,7 @@ AC_E_OPTIONAL_MODULE([illume2], true) AC_E_OPTIONAL_MODULE([syscon], true) AC_E_OPTIONAL_MODULE([everything], true) AC_E_OPTIONAL_MODULE([systray], true) +AC_E_OPTIONAL_MODULE([comp], true) AC_OUTPUT([ Makefile @@ -645,6 +648,8 @@ src/modules/everything/module.desktop src/modules/everything/everything.pc src/modules/systray/Makefile src/modules/systray/module.desktop +src/modules/comp/Makefile +src/modules/comp/module.desktop src/preload/Makefile data/Makefile data/images/Makefile diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4 new file mode 100644 index 0000000..2c9b60a --- /dev/null +++ b/m4/efl_path_max.m4 @@ -0,0 +1,33 @@ +dnl Check for PATH_MAX in limits.h, and define a default value if not found +dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd + +dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND]) +dnl +dnl If PATH_MAX is not defined in , defines it +dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback +dnl to using 4096 + +AC_DEFUN([EFL_CHECK_PATH_MAX], +[ + +default_max=m4_default([$1], "4096") +AC_LANG_PUSH([C]) + +AC_MSG_CHECKING([for PATH_MAX in limit.h]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[int i = PATH_MAX]]) + ], + AC_MSG_RESULT([yes]), + [ + AC_DEFINE_UNQUOTED([PATH_MAX], + [${default_max}], + [default value since PATH_MAX is not defined]) + AC_MSG_RESULT([no: using ${default_max}]) + ] +) + +AC_LANG_POP([C]) + +]) +dnl end of efl_path_max.m4 diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index ffce5ab..aace6a9 100644 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -258,6 +258,10 @@ if USE_MODULE_SYSTRAY SUBDIRS += systray endif +if USE_MODULE_COMP +SUBDIRS += comp +endif + DIST_SUBDIRS = \ ibar \ @@ -329,4 +333,5 @@ illume-kbd-toggle \ illume-mode-toggle \ syscon \ everything \ -systray +systray \ +comp diff --git a/src/modules/comp/.cvsignore b/src/modules/comp/.cvsignore new file mode 100644 index 0000000..06d064a --- /dev/null +++ b/src/modules/comp/.cvsignore @@ -0,0 +1,7 @@ +.deps +.libs +Makefile +Makefile.in +*.lo +module.la +module.desktop diff --git a/src/modules/comp/Makefile.am b/src/modules/comp/Makefile.am new file mode 100644 index 0000000..1d2f1bc --- /dev/null +++ b/src/modules/comp/Makefile.am @@ -0,0 +1,33 @@ +MAINTAINERCLEANFILES = Makefile.in +MODULE = comp + +# data files for the module +filesdir = $(libdir)/enlightenment/modules/$(MODULE) +files_DATA = \ +e-module-$(MODULE).edj module.desktop + +EXTRA_DIST = $(files_DATA) + +# the module .so file +INCLUDES = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src/modules/$(MODULE) \ + -I$(top_srcdir)/src/bin \ + -I$(top_srcdir)/src/lib \ + -I$(top_srcdir)/src/modules \ + @e_cflags@ +pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH) +pkg_LTLIBRARIES = module.la +module_la_SOURCES = e_mod_main.c \ + e_mod_main.h \ + e_mod_config.c \ + e_mod_config.h \ + e_mod_comp.c \ + e_mod_comp.h + +module_la_LIBADD = @e_libs@ @dlopen_libs@ +module_la_LDFLAGS = -module -avoid-version +module_la_DEPENDENCIES = $(top_builddir)/config.h + +uninstall: + rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE) diff --git a/src/modules/comp/e-module-comp.edj b/src/modules/comp/e-module-comp.edj new file mode 100644 index 0000000..8721b81 Binary files /dev/null and b/src/modules/comp/e-module-comp.edj differ diff --git a/src/modules/comp/e_mod_comp.c b/src/modules/comp/e_mod_comp.c new file mode 100644 index 0000000..6eb2a36 --- /dev/null +++ b/src/modules/comp/e_mod_comp.c @@ -0,0 +1,15 @@ +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_comp.h" +#include "config.h" + +Eina_Bool +e_mod_comp_init(void) +{ + return 1; +} + +void +e_mod_comp_shutdown(void) +{ +} diff --git a/src/modules/comp/e_mod_comp.h b/src/modules/comp/e_mod_comp.h new file mode 100644 index 0000000..704ecba --- /dev/null +++ b/src/modules/comp/e_mod_comp.h @@ -0,0 +1,8 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_H +#define E_MOD_COMP_H +Eina_Bool e_mod_comp_init(void); +void e_mod_comp_shutdown(void); +#endif +#endif diff --git a/src/modules/comp/e_mod_config.c b/src/modules/comp/e_mod_config.c new file mode 100644 index 0000000..872695f --- /dev/null +++ b/src/modules/comp/e_mod_config.c @@ -0,0 +1,175 @@ +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_config.h" +#include "config.h" + +struct _E_Config_Dialog_Data +{ + int x; +}; + +/* Protos */ +static void *_create_data (E_Config_Dialog *cfd); +static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static Evas_Object *_basic_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); +static int _basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); + +E_Config_Dialog * +e_int_config_comp_module(E_Container *con, const char *params __UNUSED__) +{ + E_Config_Dialog *cfd; + E_Config_Dialog_View *v; + char buf[4096]; + Mod *mod = _comp_mod; + + if (e_config_dialog_find("E", "appearance/comp")) return NULL; + v = E_NEW(E_Config_Dialog_View, 1); + + v->create_cfdata = _create_data; + v->free_cfdata = _free_data; + v->basic.apply_cfdata = _basic_apply_data; + v->basic.create_widgets = _basic_create_widgets; + + snprintf(buf, sizeof(buf), "%s/e-module-comp.edj", + e_module_dir_get(mod->module)); + cfd = e_config_dialog_new(con, + _("Composite Settings"), + "E", "appearance/comp", + buf, 0, v, mod); + mod->config_dialog = cfd; + return cfd; +} + +static void * +_create_data(E_Config_Dialog *cfd) +{ + /* + E_Config_Dialog_Data *cfdata; + Dropshadow *ds; + + ds = cfd->data; + cfdata = E_NEW(E_Config_Dialog_Data, 1); + _fill_data(ds, cfdata); + return cfdata; + */ + return NULL; +} + +static void +_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) +{ + /* + Dropshadow *ds; + + ds = cfd->data; + ds->config_dialog = NULL; + free(cfdata); + */ +} + +static Evas_Object * +_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) +{ + Evas_Object *o, *ob, *of, *ot; + E_Radio_Group *rg; + + o = e_widget_list_add(evas, 0, 0); + ot = e_widget_table_add(evas, 1); + + of = e_widget_framelist_add(evas, _("Quality"), 0); + e_widget_framelist_content_align_set(of, 0.5, 0.0); + rg = e_widget_radio_group_new(&(cfdata->x)); + ob = e_widget_radio_add(evas, _("X"), 1, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Y"), 2, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Z"), 4, rg); + e_widget_framelist_object_append(of, ob); + e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1); +/* + of = e_widget_framelist_add(evas, _("Blur Type"), 0); + e_widget_framelist_content_align_set(of, 0.5, 0.0); + rg = e_widget_radio_group_new(&(cfdata->blur_size)); + ob = e_widget_radio_add(evas, _("Very Fuzzy"), 80, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Fuzzy"), 40, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Medium"), 20, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Sharp"), 10, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Very Sharp"), 5, rg); + e_widget_framelist_object_append(of, ob); + e_widget_table_object_append(ot, of, 0, 1, 1, 1, 1, 1, 1, 1); + + of = e_widget_framelist_add(evas, _("Shadow Distance"), 0); + e_widget_framelist_content_align_set(of, 0.5, 0.0); + rg = e_widget_radio_group_new(&(cfdata->shadow_x)); + ob = e_widget_radio_add(evas, _("Very Far"), 32, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Far"), 16, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Near"), 8, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Very Near"), 4, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Extremely Near"), 2, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Underneath"), 0, rg); + e_widget_framelist_object_append(of, ob); + e_widget_table_object_append(ot, of, 1, 0, 1, 1, 1, 1, 1, 1); + + of = e_widget_framelist_add(evas, _("Shadow Darkness"), 0); + e_widget_framelist_content_align_set(of, 0.5, 0.0); + rg = e_widget_radio_group_new(&(cfdata->darkness)); + ob = e_widget_radio_add(evas, _("Very Dark"), 0, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Dark"), 1, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Light"), 2, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Very Light"), 3, rg); + e_widget_framelist_object_append(of, ob); + e_widget_table_object_append(ot, of, 1, 1, 1, 1, 1, 1, 1, 1); + + e_widget_list_object_append(o, ot, 1, 1, 0.5); +*/ + return o; +} + +static int +_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) +{ + /* + Dropshadow *ds; + + ds = cfd->data; + e_border_button_bindings_ungrab_all(); + + ds->conf->quality = cfdata->quality; + ds->conf->blur_size = cfdata->blur_size; + ds->conf->shadow_x = cfdata->shadow_x; + ds->conf->shadow_y = cfdata->shadow_x; + switch (cfdata->darkness) + { + case 0: + ds->conf->shadow_darkness = 1.0; + break; + case 1: + ds->conf->shadow_darkness = 0.75; + break; + case 2: + ds->conf->shadow_darkness = 0.5; + break; + case 3: + ds->conf->shadow_darkness = 0.25; + break; + } + + e_config_save_queue(); + e_border_button_bindings_grab_all(); + + _dropshadow_cb_config_updated(ds); + */ + return 1; +} diff --git a/src/modules/comp/e_mod_config.h b/src/modules/comp/e_mod_config.h new file mode 100644 index 0000000..929ac4e --- /dev/null +++ b/src/modules/comp/e_mod_config.h @@ -0,0 +1,7 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_CONFIG_H +#define E_MOD_CONFIG_H +E_Config_Dialog *e_int_config_comp_module(E_Container *con, const char *params __UNUSED__); +#endif +#endif diff --git a/src/modules/comp/e_mod_main.c b/src/modules/comp/e_mod_main.c new file mode 100644 index 0000000..4b63c7a --- /dev/null +++ b/src/modules/comp/e_mod_main.c @@ -0,0 +1,79 @@ +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_config.h" +#include "e_mod_comp.h" + +/* module private routines */ +Mod *_comp_mod = NULL; + +/* public module routines. all modules must have these */ +EAPI E_Module_Api e_modapi = +{ + E_MODULE_API_VERSION, + "Composite" +}; + +EAPI void * +e_modapi_init(E_Module *m) +{ + Mod *mod; + char buf[4096]; + + mod = calloc(1, sizeof(Mod)); + mod->module = m; + snprintf(buf, sizeof(buf), "%s/e-module-comp.edj", e_module_dir_get(m)); + e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "preferences-appearance"); + e_configure_registry_item_add("appearance/comp", 120, _("Composite"), NULL, buf, e_int_config_comp_module); + + mod->conf_edd = E_CONFIG_DD_NEW("Comp_Config", Config); +#undef T +#undef D +#define T Config +#define D mod->conf_edd + E_CONFIG_VAL(D, T, x, INT); + + mod->conf = e_config_domain_load("module.comp", mod->conf_edd); + if (!mod->conf) + { + mod->conf = E_NEW(Config, 1); + mod->conf->x = 1; + } + E_CONFIG_LIMIT(mod->conf->x, -2, 2); + + _comp_mod = mod; + + e_mod_comp_init(); + + return mod; +} + +EAPI int +e_modapi_shutdown(E_Module *m) +{ + Mod *mod = m->data; + + e_mod_comp_shutdown(); + + e_configure_registry_item_del("appearance/comp"); + e_configure_registry_category_del("appearance"); + + if (mod->config_dialog) + { + e_object_del(E_OBJECT(mod->config_dialog)); + mod->config_dialog = NULL; + } + + free(mod->conf); + E_CONFIG_DD_FREE(mod->conf_edd); + free(mod); + + return 1; +} + +EAPI int +e_modapi_save(E_Module *m) +{ + Mod *mod = m->data; + e_config_domain_save("module.comp", mod->conf_edd, mod->conf); + return 1; +} diff --git a/src/modules/comp/e_mod_main.h b/src/modules/comp/e_mod_main.h new file mode 100644 index 0000000..3e01c52 --- /dev/null +++ b/src/modules/comp/e_mod_main.h @@ -0,0 +1,32 @@ +#ifndef E_MOD_MAIN_H +#define E_MOD_MAIN_H + +typedef struct _Config Config; +typedef struct _Mod Mod; + + +struct _Config +{ + int x; +}; + +struct _Mod +{ + E_Module *module; + + E_Config_DD *conf_edd; + Config *conf; + + E_Config_Dialog *config_dialog; +}; + +extern Mod *_comp_mod; + +EAPI extern E_Module_Api e_modapi; + +EAPI void *e_modapi_init (E_Module *m); +EAPI int e_modapi_shutdown (E_Module *m); +EAPI int e_modapi_save (E_Module *m); +EAPI int e_modapi_info (E_Module *m); + +#endif diff --git a/src/modules/comp/module.desktop.in b/src/modules/comp/module.desktop.in new file mode 100644 index 0000000..b09f8fe --- /dev/null +++ b/src/modules/comp/module.desktop.in @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Link +Name=Composite +Icon=e-module-comp +Comment=Composite Module
+X-Enlightenment-ModuleType=appearance diff --git a/x-ui.sh b/x-ui.sh index 5b39348..4264373 100755 --- a/x-ui.sh +++ b/x-ui.sh @@ -5,8 +5,8 @@ #Xephyr :1 -noreset -ac -br -dpi 186 -screen 272x480x16 & #Xephyr :1 -noreset -ac -br -dpi 186 -screen 480x272x16 & #Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 & -#Xephyr :1 -noreset -ac -br -dpi 183 -screen 320x480x16 -host-cursor & -Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x320x16 -host-cursor & +Xephyr :1 -noreset -ac -br -dpi 183 -screen 320x480x16 -host-cursor & +#Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x320x16 -host-cursor & #Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x800x16 & #Xephyr :1 -noreset -ac -br -dpi 183 -screen 800x480x16 & #Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 &