Compare commits
313 Commits
master
...
devs/devil
Author | SHA1 | Date |
---|---|---|
Chris Michael | 6e72cb0573 | |
Chris Michael | 2a94274a99 | |
Chris Michael | 98ddf4d05c | |
Chris Michael | 1d8b816819 | |
Chris Michael | b422f31451 | |
Chris Michael | 098c5c5ca0 | |
Chris Michael | 101a1f7bea | |
Chris Michael | b8081e7c05 | |
Chris Michael | 11054d55e5 | |
Chris Michael | ba0b2a339b | |
Chris Michael | bf2ab8d933 | |
Chris Michael | fc2c2344a5 | |
Chris Michael | 016793098e | |
Chris Michael | cc6e76384c | |
Chris Michael | d6b51b7b4c | |
Chris Michael | 46fad2b716 | |
Chris Michael | 6705ad95df | |
Chris Michael | 29b736fe37 | |
Chris Michael | 2093443237 | |
Chris Michael | b0678e5152 | |
Chris Michael | 188f472a0d | |
Chris Michael | e37f590619 | |
Chris Michael | 274120f4c4 | |
Chris Michael | f541032c3d | |
Chris Michael | cf495efaf3 | |
Chris Michael | 248bbf22b5 | |
Chris Michael | 448af16831 | |
Chris Michael | df8c0a6533 | |
Chris Michael | e353385acb | |
Chris Michael | c322573793 | |
Chris Michael | be68f0e840 | |
Chris Michael | caeae50db3 | |
Chris Michael | eadce5e382 | |
Chris Michael | 390dd4a7e2 | |
Chris Michael | e8aba44ff7 | |
Chris Michael | 1e24d7e730 | |
Chris Michael | 8c20469d34 | |
Chris Michael | 3bd70f214e | |
Chris Michael | 2350671766 | |
Chris Michael | cdcf01fe4e | |
Chris Michael | 194b10c2ff | |
Chris Michael | 5c2d03b3aa | |
Chris Michael | ee2e852673 | |
Chris Michael | c351ba68eb | |
Chris Michael | a47f3ba8fd | |
Chris Michael | 245cc2164a | |
Chris Michael | 49ba7f2157 | |
Chris Michael | 90eb77b42e | |
Chris Michael | 2946f63664 | |
Chris Michael | 9841131e1c | |
Chris Michael | 5af1978ef3 | |
Chris Michael | 438102e98c | |
Chris Michael | 03c8995828 | |
Chris Michael | 3408b13dcc | |
Chris Michael | feadd8a535 | |
Chris Michael | 2bd2063aa6 | |
Chris Michael | 1c51e65942 | |
Chris Michael | f882da7f3f | |
Chris Michael | e50261ae34 | |
Chris Michael | ef6225a87c | |
Chris Michael | b7e87dab89 | |
Chris Michael | e83086287f | |
Chris Michael | ea11ca564b | |
Chris Michael | a2551b75c5 | |
Chris Michael | f1a2fdc10f | |
Chris Michael | d93921bc23 | |
Chris Michael | 4d003429c6 | |
Chris Michael | 941d03a466 | |
Chris Michael | e4fdc33adf | |
Chris Michael | 091d4932bd | |
Chris Michael | 9e307f8b5f | |
Chris Michael | 2126e5f3d0 | |
Chris Michael | 526f60e5b9 | |
Chris Michael | a30faf6e71 | |
Chris Michael | 9ef91e64f6 | |
Chris Michael | c61982bb54 | |
Chris Michael | 84561ae002 | |
Chris Michael | 9623cc3475 | |
Chris Michael | f97195229b | |
Chris Michael | c417fc64b6 | |
Chris Michael | a92d6850b4 | |
Chris Michael | b2062d0934 | |
Chris Michael | c65425c8b2 | |
Chris Michael | e0df793db0 | |
Chris Michael | cdd342b865 | |
Chris Michael | 536880e552 | |
Chris Michael | 18b27dd615 | |
Chris Michael | fdb1ba50bd | |
Chris Michael | 4eee0d330a | |
Chris Michael | c38e0dbb70 | |
Chris Michael | de673f6b46 | |
Chris Michael | 909f62fc47 | |
Chris Michael | cb9705db57 | |
Chris Michael | fa3f829c67 | |
Chris Michael | b09b90184d | |
Chris Michael | bd97b2c442 | |
Chris Michael | c2cbaa5503 | |
Chris Michael | f4d2a802ae | |
Chris Michael | 72597db192 | |
Chris Michael | 9c6a659675 | |
Chris Michael | 075da5d708 | |
Chris Michael | fb2e3f9c92 | |
Chris Michael | 43b8b81f4e | |
Chris Michael | 6db9da44bd | |
Chris Michael | 9f1d9fb712 | |
Chris Michael | c436a18eec | |
Mike Blumenkrantz | f2334d827a | |
Mike Blumenkrantz | feea2c28a6 | |
Mike Blumenkrantz | c8c2f6cf8a | |
Mike Blumenkrantz | ee8660a885 | |
Carsten Haitzler | 8a14a6c96b | |
Igor Murzov | 5ba194cace | |
Igor Murzov | 9feede7b5e | |
maxerba | 70ffb6a4da | |
maxerba | e240283488 | |
Chris Michael | ce80e9fbc3 | |
Chris Michael | d0022a7017 | |
Chris Michael | 48cbe12742 | |
Chris Michael | c3c3ed2ff8 | |
Chris Michael | 1c9c550205 | |
Chris Michael | e3e6c9d44e | |
Chris Michael | 0812d37559 | |
Chris Michael | 2886c1a156 | |
Chris Michael | 4fedd2bf7c | |
Chris Michael | d8ab66b113 | |
Chris Michael | 17d28fedca | |
Chris Michael | 2eef67fba6 | |
Chris Michael | 0bf381bae8 | |
Mike Blumenkrantz | b0c056f80d | |
Igor Murzov | 1030a456e5 | |
Chris Michael | 8c48ab1922 | |
Chris Michael | cb679ef168 | |
Chris Michael | e5fb0b8e2c | |
Chris Michael | 4253fe41cb | |
Chris Michael | ed277e2070 | |
Chris Michael | ff183f614f | |
Chris Michael | d7256d965d | |
Chris Michael | 4be041e97b | |
Chris Michael | 0a0a0363df | |
Chris Michael | 7b81df006d | |
Chris Michael | 77e69f990b | |
Chris Michael | a08c640b17 | |
Chris Michael | 4ad36e4d28 | |
Chris Michael | 2e24547178 | |
Chris Michael | 63c637898d | |
Chris Michael | cfe6102182 | |
Chris Michael | ea3e1cd985 | |
Chris Michael | 473a1de55f | |
Chris Michael | 10e9f1264d | |
Chris Michael | 03346a3d19 | |
Chris Michael | 52f21c4a64 | |
Chris Michael | e79d2caaec | |
Chris Michael | 296ee0018d | |
Chris Michael | 3eef8b7202 | |
Chris Michael | 3837e4c442 | |
Chris Michael | 59db3c7b89 | |
Chris Michael | e37bf7ab0b | |
Chris Michael | c657cf2852 | |
Chris Michael | 8bfd741611 | |
Chris Michael | c4378ce23d | |
Chris Michael | e09c94949f | |
Chris Michael | 6d9b6dc97e | |
Chris Michael | 4290891c73 | |
Chris Michael | b4fbebcd09 | |
Chris Michael | 58b03d351d | |
Chris Michael | 058a561fe2 | |
Chris Michael | fe802a2ca3 | |
Chris Michael | 8d4e3827b1 | |
Chris Michael | de21d14a9d | |
Chris Michael | b0c1244430 | |
Chris Michael | dee81285f3 | |
Chris Michael | 346851b424 | |
Chris Michael | 82b01815ab | |
Chris Michael | 49bca8fd79 | |
Chris Michael | d135216825 | |
Chris Michael | dbc1cc64bd | |
Chris Michael | 0bd7def0f8 | |
Chris Michael | 6b67d98884 | |
Chris Michael | 73e217bd65 | |
Chris Michael | 23e0821161 | |
Chris Michael | 1043a7ccfc | |
Chris Michael | b6dd15b8bd | |
Chris Michael | db98e6972c | |
Chris Michael | 991995bbd2 | |
Chris Michael | a5f21832dd | |
Chris Michael | 6326a99701 | |
Chris Michael | e526350c0f | |
Chris Michael | 243ca5a8e9 | |
Chris Michael | 86bb6565b9 | |
Chris Michael | 87943d7285 | |
Chris Michael | 2e5447c103 | |
Chris Michael | eef80e6ffc | |
Chris Michael | a775780c6b | |
Chris Michael | 010a1f689a | |
Chris Michael | 2b538b1d5f | |
Chris Michael | 13bd36733d | |
Chris Michael | 9f5fba4c51 | |
Chris Michael | 28bc50833e | |
Chris Michael | 461fee2f90 | |
Chris Michael | 7215d19291 | |
Chris Michael | 14fd080d02 | |
Chris Michael | 73b12b9e33 | |
Chris Michael | a61b4ab8bc | |
Chris Michael | 66c79553e2 | |
Chris Michael | 8e2a97cc06 | |
Chris Michael | 708ab95cbc | |
Chris Michael | d3f42dfef9 | |
Chris Michael | 8d39a06962 | |
Chris Michael | 20b09f265d | |
Chris Michael | 25e20b0d08 | |
Chris Michael | d167ab100c | |
Chris Michael | 80d75c00f0 | |
Chris Michael | 52837fd43d | |
Chris Michael | 2aec91cb81 | |
Chris Michael | 02eaf95ed8 | |
Chris Michael | a70b53b3b1 | |
Chris Michael | a42a692d93 | |
Chris Michael | b87c005c1e | |
Chris Michael | 7aaafdc2f5 | |
Chris Michael | 4b90c27a44 | |
Chris Michael | bc71f29cec | |
Chris Michael | 850b3b6c61 | |
Chris Michael | 541a784833 | |
Chris Michael | e583b6ad73 | |
Chris Michael | ddb40cead3 | |
Chris Michael | bece224d9e | |
Chris Michael | 34fb92a2c7 | |
Chris Michael | 089a32583a | |
Chris Michael | 1891bf3e98 | |
Chris Michael | 42526777e3 | |
Chris Michael | 8da383be03 | |
Chris Michael | 4f2f04d154 | |
Chris Michael | 902c858d66 | |
Chris Michael | e21a9c4784 | |
Chris Michael | 1dd25218ca | |
Chris Michael | 83ced90c98 | |
Chris Michael | ff0e58b604 | |
Chris Michael | f6b38ef9c2 | |
Chris Michael | 8828bd6097 | |
Chris Michael | 7f4ea2b0ff | |
Chris Michael | 58c6f6fae3 | |
Chris Michael | aa9a026cb5 | |
Chris Michael | 5e15119102 | |
Chris Michael | 9bd756abe4 | |
Chris Michael | cf549164c7 | |
Chris Michael | b9c62df395 | |
Chris Michael | bb99a10f0f | |
Chris Michael | 7f36bb66cd | |
Chris Michael | 78c378c24f | |
Chris Michael | af1404689a | |
Chris Michael | 2e0cfaf445 | |
Chris Michael | 0de4510de8 | |
Chris Michael | 2aa70a028e | |
Chris Michael | c824e82451 | |
Chris Michael | 69f5beda70 | |
Chris Michael | de72b92f26 | |
Chris Michael | 150d038235 | |
Chris Michael | 5b9b8b902c | |
Chris Michael | a428aac02f | |
Chris Michael | 1060816626 | |
Chris Michael | ddec826cf4 | |
Chris Michael | 3b360d9507 | |
Chris Michael | ba113b29eb | |
Chris Michael | 2cb9d5d29d | |
Chris Michael | 7ad99b32c3 | |
Chris Michael | 1285bbeb2a | |
Chris Michael | d217b96117 | |
Chris Michael | a04ba955d1 | |
Chris Michael | 5ce8ae53cf | |
Chris Michael | c6f3866486 | |
Chris Michael | 09eb83798b | |
Chris Michael | 99fe245a57 | |
Chris Michael | bcf9c9338e | |
Chris Michael | d2c4db5789 | |
Chris Michael | f92f0b0ede | |
Chris Michael | fa76cd551f | |
Chris Michael | 850d5e31a6 | |
Chris Michael | 910c0b7943 | |
Chris Michael | 429880e3fb | |
Chris Michael | fe791f117d | |
Chris Michael | bc06bdfde6 | |
Chris Michael | 85e3daec63 | |
Chris Michael | 10c8888e64 | |
Chris Michael | 8adba4c029 | |
Chris Michael | e0eb8d8b99 | |
Chris Michael | 27c88d42cc | |
Chris Michael | b2390319fa | |
Chris Michael | 9d7a4ad4c0 | |
Chris Michael | 479df84e28 | |
Chris Michael | 7e347eabc2 | |
Chris Michael | c94c8d8ff2 | |
Chris Michael | 8d2a7c198b | |
Chris Michael | 16216932e9 | |
Chris Michael | 852d73e2bb | |
Chris Michael | 81455dcc5e | |
Chris Michael | a07eb49ae7 | |
Chris Michael | 0d99d089bf | |
Chris Michael | 9c11a44d23 | |
Chris Michael | 15f96d9beb | |
Chris Michael | 111648822a | |
Chris Michael | 0c9ba27029 | |
Chris Michael | 27b20a3105 | |
Chris Michael | 35aa88724f | |
Chris Michael | b572a07017 | |
Chris Michael | 88de154b8a | |
Chris Michael | 9f0efcfebf | |
Chris Michael | d70c93467b | |
Chris Michael | 02560af2ad | |
Chris Michael | bb642a3b19 | |
Chris Michael | 411d8ca2f4 | |
Chris Michael | 5f21c0e615 | |
Chris Michael | a70dcd2df0 | |
Chris Michael | 717302fb37 |
110
configure.ac
110
configure.ac
|
@ -818,39 +818,47 @@ define([CHECK_MODULE_BLUEZ4],
|
|||
AC_SUBST(EBLUEZ4_CFLAGS)
|
||||
AC_SUBST(EBLUEZ4_LIBS)
|
||||
|
||||
have_wayland_only=no
|
||||
AC_ARG_ENABLE([wayland-only],
|
||||
AS_HELP_STRING([--enable-wayland-only],[enable wayland-only version of enlightenment @<:@default=disabled@:>@]),
|
||||
[e_cv_want_wayland_only=$enableval],
|
||||
[e_cv_want_wayland_only=no])
|
||||
AC_MSG_CHECKING([whether wayland-only version is enabled])
|
||||
AC_MSG_RESULT([${e_cv_want_wayland_only}])
|
||||
|
||||
have_wayland_clients=no
|
||||
AC_ARG_ENABLE([wayland-clients],
|
||||
AS_HELP_STRING([--enable-wayland-clients],[enable wayland clients in composite module @<:@default=disabled@:>@]),
|
||||
[e_cv_want_wayland_clients=$enableval],
|
||||
[e_cv_want_wayland_clients=no])
|
||||
|
||||
AC_MSG_CHECKING([whether wayland client support is enabled])
|
||||
AC_MSG_RESULT([${e_cv_want_wayland_clients}])
|
||||
|
||||
if test "x$e_cv_want_wayland_clients" != "xno";then
|
||||
have_wayland_egl=no
|
||||
AC_ARG_ENABLE([wayland-egl],
|
||||
AS_HELP_STRING([--enable-wayland-egl],[enable wayland to render using EGL @<:@default=disabled@:>@]),
|
||||
[e_cv_want_wayland_egl=$enableval],
|
||||
[e_cv_want_wayland_egl=no])
|
||||
AC_MSG_CHECKING([whether wayland EGL support is enabled])
|
||||
AC_MSG_RESULT([${e_cv_want_wayland_egl}])
|
||||
|
||||
if test "x${e_cv_want_wayland_only}" != "xno" || test "x${e_cv_want_wayland_clients}" != "xno";then
|
||||
PKG_CHECK_MODULES([WAYLAND], [wayland-server pixman-1 xkbcommon],
|
||||
[
|
||||
have_wayland_clients=yes
|
||||
AC_DEFINE_UNQUOTED([HAVE_WAYLAND_CLIENTS],[1],[enable wayland client support])
|
||||
have_wayland=yes
|
||||
AC_DEFINE_UNQUOTED([HAVE_WAYLAND],[1],[enable wayland support])
|
||||
],
|
||||
[have_wayland_clients=no])
|
||||
[have_wayland=no])
|
||||
else
|
||||
have_wayland_clients=no
|
||||
have_wayland=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([HAVE_WAYLAND_CLIENTS], [test "x${have_wayland_clients}" = "xyes"])
|
||||
|
||||
have_wayland_egl=no
|
||||
if test "x${have_wayland_clients}" = "xyes"; then
|
||||
AC_ARG_ENABLE([wayland-egl],
|
||||
AS_HELP_STRING([--enable-wayland-egl],[enable wayland clients to render using EGL @<:@default=disabled@:>@]),
|
||||
[e_cv_want_wayland_egl=$enableval],
|
||||
[e_cv_want_wayland_egl=no])
|
||||
|
||||
AC_MSG_CHECKING([whether wayland client EGL support is enabled])
|
||||
AC_MSG_RESULT([${e_cv_want_wayland_egl}])
|
||||
|
||||
if test "x$e_cv_want_wayland_egl" != "xno";then
|
||||
if test "x${have_wayland}" = "xyes"; then
|
||||
if test "x${e_cv_want_wayland_clients}" != "xno"; then
|
||||
have_wayland_clients=yes
|
||||
AC_DEFINE_UNQUOTED([HAVE_WAYLAND_CLIENTS],[1],[enable wayland clients in composite module])
|
||||
fi
|
||||
if test "x${e_cv_want_wayland_egl}" != "xno";then
|
||||
PKG_CHECK_MODULES([WAYLAND_EGL], [egl >= 7.10],
|
||||
[
|
||||
have_wayland_egl=yes
|
||||
|
@ -860,10 +868,70 @@ if test "x${have_wayland_clients}" = "xyes"; then
|
|||
else
|
||||
have_wayland_egl=no
|
||||
fi
|
||||
if test "x${e_cv_want_wayland_only}" != "xno"; then
|
||||
have_wayland_only=no
|
||||
PKG_CHECK_MODULES(E_WL, [
|
||||
evas >= ${efl_version}
|
||||
ecore >= ${efl_version}
|
||||
ecore-wayland >= ${efl_version}
|
||||
ecore-evas >= ${efl_version}
|
||||
ecore-input >= ${efl_version}
|
||||
ecore-input-evas >= ${efl_version}
|
||||
ecore-con >= ${efl_version}
|
||||
ecore-ipc >= ${efl_version}
|
||||
ecore-file >= ${efl_version}
|
||||
eet >= ${efl_version}
|
||||
edje >= ${efl_version}
|
||||
efreet >= ${efl_version}
|
||||
efreet-mime >= ${efl_version}
|
||||
efreet-trash >= ${efl_version}
|
||||
eina >= ${efl_version}
|
||||
eldbus >= ${efl_version}
|
||||
eio >= ${efl_version}
|
||||
$eeze_mount
|
||||
$udisks_mount
|
||||
$device_backend
|
||||
],
|
||||
[
|
||||
have_wayland_only=yes
|
||||
AC_DEFINE_UNQUOTED([HAVE_WAYLAND_ONLY],[1],[enable wayland-only version of enlightenment])
|
||||
])
|
||||
|
||||
e_wl_libs="$E_WL_LIBS $LIBINTL $fnmatch_libs $ECORE_IMF_LIBS $execinfo_libs"
|
||||
e_wl_cflags="-DUSE_E_CONFIG_H $E_WL_CFLAGS $ECORE_IMF_CFLAGS"
|
||||
e_configflags="-DUSE_E_CONFIG_H"
|
||||
|
||||
AC_SUBST(e_wl_libs)
|
||||
AC_SUBST(e_wl_cflags)
|
||||
AC_SUBST(e_configflags)
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([HAVE_WAYLAND], [test "x${have_wayland}" = "xyes"])
|
||||
AM_CONDITIONAL([HAVE_WAYLAND_ONLY], [test "x${have_wayland_only}" = "xyes"])
|
||||
AM_CONDITIONAL([HAVE_WAYLAND_CLIENTS], [test "x${have_wayland_clients}" = "xyes"])
|
||||
AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "x${have_wayland_egl}" = "xyes"])
|
||||
|
||||
define([CHECK_MODULE_WL_X11],
|
||||
[
|
||||
if test "x${have_wayland_only}" = "xyes"; then
|
||||
AC_E_CHECK_PKG(WL_X11, [ ecore-x >= $efl_version ], [WL_X11=true], [WL_X11=false])
|
||||
else
|
||||
WL_X11=false
|
||||
fi
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_WL_X11], [test "x${WL_X11}" = "xtrue"])
|
||||
|
||||
define([CHECK_MODULE_WL_DESKTOP],
|
||||
[
|
||||
if test "x${have_wayland_only}" = "xyes"; then
|
||||
AC_E_CHECK_PKG(WL_DESKTOP, [ ecore >= $efl_version ], [WL_DESKTOP=true], [WL_DESKTOP=false])
|
||||
else
|
||||
WL_DESKTOP=false
|
||||
fi
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_WL_DESKTOP], [test "x${WL_DESKTOP}" = "xtrue"])
|
||||
|
||||
define([CHECK_MODULE_WL_DESKTOP_SHELL],
|
||||
[
|
||||
if test "x${have_wayland_clients}" = "xyes"; then
|
||||
|
@ -925,6 +993,8 @@ AC_E_OPTIONAL_MODULE([tiling], true)
|
|||
AC_E_OPTIONAL_MODULE([access], true)
|
||||
AC_E_OPTIONAL_MODULE([music_control], true, [CHECK_MODULE_MUSIC_CONTROL])
|
||||
AC_E_OPTIONAL_MODULE([contact], true)
|
||||
AC_E_OPTIONAL_MODULE([wl_x11], true, [CHECK_MODULE_WL_X11])
|
||||
AC_E_OPTIONAL_MODULE([wl_desktop], true, [CHECK_MODULE_WL_DESKTOP])
|
||||
AC_E_OPTIONAL_MODULE([wl_desktop_shell], true, [CHECK_MODULE_WL_DESKTOP_SHELL])
|
||||
|
||||
HALT="/sbin/shutdown -h now"
|
||||
|
@ -986,6 +1056,7 @@ src/Makefile
|
|||
src/bin/Makefile
|
||||
src/bin/e_fm_shared_types.h
|
||||
src/bin/e_fm/Makefile
|
||||
src/bin/e_wayland/Makefile
|
||||
src/modules/Makefile
|
||||
src/modules/ibar/module.desktop
|
||||
src/modules/clock/module.desktop
|
||||
|
@ -1047,6 +1118,7 @@ src/modules/tiling/module.desktop
|
|||
src/modules/access/module.desktop
|
||||
src/modules/music-control/module.desktop
|
||||
src/modules/contact/module.desktop
|
||||
src/modules/wl_desktop/module.desktop
|
||||
src/modules/wl_desktop_shell/module.desktop
|
||||
data/Makefile
|
||||
data/images/Makefile
|
||||
|
|
109
po/POTFILES.in
109
po/POTFILES.in
|
@ -20,10 +20,10 @@ src/bin/e_container.c
|
|||
src/bin/e_datastore.c
|
||||
src/bin/e_desk.c
|
||||
src/bin/e_desklock.c
|
||||
src/bin/e_desktop_editor.c
|
||||
src/bin/e_dialog.c
|
||||
src/bin/e_dnd.c
|
||||
src/bin/e_dpms.c
|
||||
src/bin/e_desktop_editor.c
|
||||
src/bin/e_entry.c
|
||||
src/bin/e_entry_dialog.c
|
||||
src/bin/e_error.c
|
||||
|
@ -45,8 +45,8 @@ src/bin/e_hints.c
|
|||
src/bin/e_icon.c
|
||||
src/bin/e_ilist.c
|
||||
src/bin/e_imc_main.c
|
||||
src/bin/e_import_dialog.c
|
||||
src/bin/e_import_config_dialog.c
|
||||
src/bin/e_import_dialog.c
|
||||
src/bin/e_init.c
|
||||
src/bin/e_int_border_locks.c
|
||||
src/bin/e_int_border_menu.c
|
||||
|
@ -54,10 +54,10 @@ src/bin/e_int_border_prop.c
|
|||
src/bin/e_int_border_remember.c
|
||||
src/bin/e_int_config_modules.c
|
||||
src/bin/e_int_gadcon_config.c
|
||||
src/bin/e_int_toolbar_config.c
|
||||
src/bin/e_intl.c
|
||||
src/bin/e_int_menus.c
|
||||
src/bin/e_int_shelf_config.c
|
||||
src/bin/e_int_toolbar_config.c
|
||||
src/bin/e_intl.c
|
||||
src/bin/e_ipc.c
|
||||
src/bin/e_ipc_codec.c
|
||||
src/bin/e_layout.c
|
||||
|
@ -95,22 +95,22 @@ src/bin/e_sys.c
|
|||
src/bin/e_sys_main.c
|
||||
src/bin/e_table.c
|
||||
src/bin/e_test.c
|
||||
src/bin/e_theme_about.c
|
||||
src/bin/e_theme.c
|
||||
src/bin/e_theme_about.c
|
||||
src/bin/e_thumb.c
|
||||
src/bin/e_thumb_main.c
|
||||
src/bin/e_toolbar.c
|
||||
src/bin/e_user.c
|
||||
src/bin/e_utils.c
|
||||
src/bin/e_widget_aspect.c
|
||||
src/bin/e_widget_button.c
|
||||
src/bin/e_widget.c
|
||||
src/bin/e_widget_aspect.c
|
||||
src/bin/e_widget_bgpreview.c
|
||||
src/bin/e_widget_button.c
|
||||
src/bin/e_widget_check.c
|
||||
src/bin/e_widget_color_well.c
|
||||
src/bin/e_widget_config_list.c
|
||||
src/bin/e_widget_csel.c
|
||||
src/bin/e_widget_cslider.c
|
||||
src/bin/e_widget_bgpreview.c
|
||||
src/bin/e_widget_entry.c
|
||||
src/bin/e_widget_filepreview.c
|
||||
src/bin/e_widget_font_preview.c
|
||||
|
@ -145,31 +145,32 @@ src/modules/clock/e_mod_main.c
|
|||
src/modules/conf/e_conf.c
|
||||
src/modules/conf/e_mod_config.c
|
||||
src/modules/conf/e_mod_main.c
|
||||
src/modules/conf2/e_mod_main.c
|
||||
src/modules/conf2/e_conf2.c
|
||||
src/modules/conf_comp/e_mod_config.c
|
||||
src/modules/conf_comp/e_mod_main.c
|
||||
src/modules/conf_comp/e_mod_config.c
|
||||
src/modules/conf_comp/e_mod_main.c
|
||||
src/modules/conf2/e_mod_main.c
|
||||
src/modules/conf_applications/e_int_config_apps.c
|
||||
src/modules/conf_applications/e_int_config_apps_personal.c
|
||||
src/modules/conf_applications/e_int_config_defapps.c
|
||||
src/modules/conf_applications/e_int_config_deskenv.c
|
||||
src/modules/conf_applications/e_mod_main.c
|
||||
src/modules/conf_dialogs/e_int_config_profiles.c
|
||||
src/modules/conf_dialogs/e_int_config_dialogs.c
|
||||
src/modules/conf_dialogs/e_mod_main.c
|
||||
src/modules/conf_display/e_int_config_display.c
|
||||
src/modules/conf_display/e_int_config_desks.c
|
||||
src/modules/conf_display/e_int_config_desk.c
|
||||
src/modules/conf_display/e_int_config_desklock_fsel.c
|
||||
src/modules/conf_display/e_int_config_desklock.c
|
||||
src/modules/conf_display/e_int_config_screensaver.c
|
||||
src/modules/conf_display/e_int_config_dpms.c
|
||||
src/modules/conf_display/e_mod_main.c
|
||||
src/modules/conf_bindings/e_int_config_acpibindings.c
|
||||
src/modules/conf_bindings/e_int_config_edgebindings.c
|
||||
src/modules/conf_bindings/e_int_config_keybindings.c
|
||||
src/modules/conf_bindings/e_int_config_mousebindings.c
|
||||
src/modules/conf_bindings/e_int_config_signalbindings.c
|
||||
src/modules/conf_bindings/e_mod_main.c
|
||||
src/modules/conf_comp/e_mod_config.c
|
||||
src/modules/conf_comp/e_mod_main.c
|
||||
src/modules/conf_dialogs/e_int_config_dialogs.c
|
||||
src/modules/conf_dialogs/e_int_config_profiles.c
|
||||
src/modules/conf_dialogs/e_mod_main.c
|
||||
src/modules/conf_display/e_int_config_desk.c
|
||||
src/modules/conf_display/e_int_config_desklock.c
|
||||
src/modules/conf_display/e_int_config_desklock_fsel.c
|
||||
src/modules/conf_display/e_int_config_desks.c
|
||||
src/modules/conf_display/e_int_config_display.c
|
||||
src/modules/conf_display/e_int_config_dpms.c
|
||||
src/modules/conf_display/e_int_config_screensaver.c
|
||||
src/modules/conf_display/e_mod_main.c
|
||||
src/modules/conf_interaction/e_int_config_interaction.c
|
||||
src/modules/conf_interaction/e_int_config_mouse.c
|
||||
src/modules/conf_interaction/e_mod_main.c
|
||||
|
@ -177,14 +178,10 @@ src/modules/conf_intl/e_int_config_imc.c
|
|||
src/modules/conf_intl/e_int_config_imc_import.c
|
||||
src/modules/conf_intl/e_int_config_intl.c
|
||||
src/modules/conf_intl/e_mod_main.c
|
||||
src/modules/conf_bindings/e_int_config_acpibindings.c
|
||||
src/modules/conf_bindings/e_int_config_keybindings.c
|
||||
src/modules/conf_bindings/e_int_config_mousebindings.c
|
||||
src/modules/conf_bindings/e_mod_main.c
|
||||
src/modules/conf_menus/e_int_config_menus.c
|
||||
src/modules/conf_menus/e_mod_main.c
|
||||
src/modules/conf_paths/e_int_config_paths.c
|
||||
src/modules/conf_paths/e_int_config_env.c
|
||||
src/modules/conf_paths/e_int_config_paths.c
|
||||
src/modules/conf_paths/e_mod_main.c
|
||||
src/modules/conf_performance/e_int_config_engine.c
|
||||
src/modules/conf_performance/e_int_config_performance.c
|
||||
|
@ -194,27 +191,28 @@ src/modules/conf_randr/e_int_config_randr.c
|
|||
src/modules/conf_randr/e_mod_main.c
|
||||
src/modules/conf_shelves/e_int_config_shelf.c
|
||||
src/modules/conf_shelves/e_mod_main.c
|
||||
src/modules/conf_theme/e_int_config_wallpaper.c
|
||||
src/modules/conf_theme/e_int_config_borders.c
|
||||
src/modules/conf_theme/e_int_config_color_classes.c
|
||||
src/modules/conf_theme/e_int_config_fonts.c
|
||||
src/modules/conf_theme/e_int_config_scale.c
|
||||
src/modules/conf_theme/e_int_config_startup.c
|
||||
src/modules/conf_theme/e_int_config_transitions.c
|
||||
src/modules/conf_theme/e_int_config_theme.c
|
||||
src/modules/conf_theme/e_int_config_theme_import.c
|
||||
src/modules/conf_theme/e_int_config_transitions.c
|
||||
src/modules/conf_theme/e_int_config_wallpaper.c
|
||||
src/modules/conf_theme/e_int_config_xsettings.c
|
||||
src/modules/conf_theme/e_mod_main.c
|
||||
src/modules/conf_wallpaper2/e_int_config_wallpaper.c
|
||||
src/modules/conf_wallpaper2/e_mod_main.c
|
||||
src/modules/conf_window_manipulation/e_int_config_clientlist.c
|
||||
src/modules/conf_window_manipulation/e_int_config_window_display.c
|
||||
src/modules/conf_window_manipulation/e_int_config_focus.c
|
||||
src/modules/conf_window_manipulation/e_int_config_window_display.c
|
||||
src/modules/conf_window_manipulation/e_int_config_window_geometry.c
|
||||
src/modules/conf_window_manipulation/e_int_config_window_process.c
|
||||
src/modules/conf_window_manipulation/e_mod_main.c
|
||||
src/modules/conf_window_remembers/e_int_config_remembers.c
|
||||
src/modules/conf_window_remembers/e_mod_main.c
|
||||
src/modules/connman/e_mod_main.c
|
||||
src/modules/cpufreq/e_mod_main.c
|
||||
src/modules/cpufreq/freqset.c
|
||||
src/modules/everything/e_mod_main.c
|
||||
|
@ -249,23 +247,42 @@ src/modules/fileman_opinfo/e_mod_main.c
|
|||
src/modules/gadman/e_mod_config.c
|
||||
src/modules/gadman/e_mod_gadman.c
|
||||
src/modules/gadman/e_mod_main.c
|
||||
src/modules/winlist/e_int_config_winlist.c
|
||||
src/modules/winlist/e_mod_main.c
|
||||
src/modules/winlist/e_winlist.c
|
||||
src/modules/ibar/e_mod_config.c
|
||||
src/modules/ibar/e_mod_main.c
|
||||
src/modules/ibox/e_mod_config.c
|
||||
src/modules/ibox/e_mod_main.c
|
||||
src/modules/mixer/app_mixer.c
|
||||
src/modules/mixer/conf_gadget.c
|
||||
src/modules/mixer/conf_module.c
|
||||
src/modules/mixer/e_mod_main.c
|
||||
src/modules/music-control/e_mod_main.c
|
||||
src/modules/music-control/ui.c
|
||||
src/modules/notification/e_mod_config.c
|
||||
src/modules/notification/e_mod_main.c
|
||||
src/modules/pager/e_mod_config.c
|
||||
src/modules/pager/e_mod_main.c
|
||||
src/modules/physics/e_mod_config.c
|
||||
src/modules/physics/e_mod_main.c
|
||||
src/modules/quickaccess/e_mod_config.c
|
||||
src/modules/quickaccess/e_mod_main.c
|
||||
src/modules/quickaccess/e_mod_quickaccess.c
|
||||
src/modules/shot/e_mod_main.c
|
||||
src/modules/start/e_mod_main.c
|
||||
src/modules/syscon/e_int_config_syscon.c
|
||||
src/modules/syscon/e_mod_main.c
|
||||
src/modules/syscon/e_syscon.c
|
||||
src/modules/systray/e_mod_main.c
|
||||
src/modules/systray/e_mod_xembed.c
|
||||
src/modules/tasks/e_mod_config.c
|
||||
src/modules/tasks/e_mod_main.c
|
||||
src/modules/temperature/e_mod_config.c
|
||||
src/modules/temperature/e_mod_main.c
|
||||
src/modules/tiling/e_mod_config.c
|
||||
src/modules/tiling/e_mod_tiling.c
|
||||
src/modules/tiling/e_mod_tiling.h
|
||||
src/modules/winlist/e_int_config_winlist.c
|
||||
src/modules/winlist/e_mod_main.c
|
||||
src/modules/winlist/e_winlist.c
|
||||
src/modules/wizard/e_mod_main.c
|
||||
src/modules/wizard/e_wizard.c
|
||||
src/modules/wizard/page_000.c
|
||||
|
@ -289,26 +306,6 @@ src/modules/wizard/page_160.c
|
|||
src/modules/wizard/page_170.c
|
||||
src/modules/wizard/page_180.c
|
||||
src/modules/wizard/page_200.c
|
||||
src/modules/mixer/app_mixer.c
|
||||
src/modules/mixer/conf_gadget.c
|
||||
src/modules/mixer/conf_module.c
|
||||
src/modules/mixer/e_mod_main.c
|
||||
src/modules/music-control/e_mod_main.c
|
||||
src/modules/music-control/ui.c
|
||||
src/modules/connman/e_mod_main.c
|
||||
src/modules/quickaccess/e_mod_config.c
|
||||
src/modules/quickaccess/e_mod_main.c
|
||||
src/modules/quickaccess/e_mod_quickaccess.c
|
||||
src/modules/systray/e_mod_main.c
|
||||
src/modules/systray/e_mod_xembed.c
|
||||
src/modules/shot/e_mod_main.c
|
||||
src/modules/tasks/e_mod_main.c
|
||||
src/modules/tasks/e_mod_config.c
|
||||
src/modules/tiling/e_mod_config.c
|
||||
src/modules/tiling/e_mod_tiling.c
|
||||
src/modules/tiling/e_mod_tiling.h
|
||||
src/modules/xkbswitch/e_mod_main.c
|
||||
src/modules/xkbswitch/e_mod_config.c
|
||||
src/modules/xkbswitch/e_mod_main.c
|
||||
src/modules/xkbswitch/e_mod_parse.c
|
||||
src/modules/notification/e_mod_main.c
|
||||
src/modules/notification/e_mod_config.c
|
||||
|
|
8010
po/fr_CH.po
8010
po/fr_CH.po
File diff suppressed because it is too large
Load Diff
7642
po/pt_BR.po
7642
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
7581
po/zh_CN.po
7581
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
7440
po/zh_TW.po
7440
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,13 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
if HAVE_WAYLAND_ONLY
|
||||
|
||||
SUBDIRS = e_wayland
|
||||
|
||||
else
|
||||
|
||||
SUBDIRS = e_fm
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
DISTCLEANFILES = e_fm_shared_types.h
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
|
@ -458,3 +465,5 @@ install-data-hook:
|
|||
endif
|
||||
installed_headersdir = $(prefix)/include/enlightenment
|
||||
installed_headers_DATA = $(ENLIGHTENMENTHEADERS)
|
||||
|
||||
endif
|
||||
|
|
|
@ -2336,7 +2336,6 @@ e_border_shade(E_Border *bd,
|
|||
{
|
||||
bd->h = bd->client_inset.t + bd->client_inset.b;
|
||||
bd->y = bd->y + bd->client.h;
|
||||
bd->changes.pos = 1;
|
||||
}
|
||||
else if (bd->shade.dir == E_DIRECTION_LEFT)
|
||||
{
|
||||
|
@ -2346,7 +2345,6 @@ e_border_shade(E_Border *bd,
|
|||
{
|
||||
bd->w = bd->client_inset.l + bd->client_inset.r;
|
||||
bd->x = bd->x + bd->client.w;
|
||||
bd->changes.pos = 1;
|
||||
}
|
||||
|
||||
if (bd->client.shaped)
|
||||
|
@ -2359,7 +2357,6 @@ e_border_shade(E_Border *bd,
|
|||
bd->need_shape_merge = 1;
|
||||
}
|
||||
|
||||
bd->changes.size = 1;
|
||||
bd->shaded = 1;
|
||||
bd->changes.shaded = 1;
|
||||
BD_CHANGED(bd);
|
||||
|
@ -2421,33 +2418,17 @@ e_border_unshade(E_Border *bd,
|
|||
if (bd->shade.dir == E_DIRECTION_UP)
|
||||
{
|
||||
ecore_x_window_gravity_set(bd->client.win, ECORE_X_GRAVITY_SW);
|
||||
ecore_x_window_move_resize(bd->client.win, 0,
|
||||
bd->h - (bd->client_inset.t + bd->client_inset.b) -
|
||||
bd->client.h,
|
||||
bd->client.w, bd->client.h);
|
||||
if (bd->client.lock_win)
|
||||
{
|
||||
ecore_x_window_gravity_set(bd->client.lock_win, ECORE_X_GRAVITY_SW);
|
||||
ecore_x_window_move_resize(bd->client.lock_win, 0,
|
||||
bd->h - (bd->client_inset.t + bd->client_inset.b) -
|
||||
bd->client.h,
|
||||
bd->client.w, bd->client.h);
|
||||
}
|
||||
}
|
||||
else if (bd->shade.dir == E_DIRECTION_LEFT)
|
||||
{
|
||||
ecore_x_window_gravity_set(bd->client.win, ECORE_X_GRAVITY_SW);
|
||||
ecore_x_window_move_resize(bd->client.win,
|
||||
bd->w - (bd->client_inset.l + bd->client_inset.r) -
|
||||
bd->client.w,
|
||||
0, bd->client.w, bd->client.h);
|
||||
if (bd->client.lock_win)
|
||||
{
|
||||
ecore_x_window_gravity_set(bd->client.lock_win, ECORE_X_GRAVITY_SW);
|
||||
ecore_x_window_move_resize(bd->client.lock_win,
|
||||
bd->w - (bd->client_inset.l + bd->client_inset.r) -
|
||||
bd->client.w,
|
||||
0, bd->client.w, bd->client.h);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2469,7 +2450,6 @@ e_border_unshade(E_Border *bd,
|
|||
{
|
||||
bd->h = bd->client_inset.t + bd->client.h + bd->client_inset.b;
|
||||
bd->y = bd->y - bd->client.h;
|
||||
bd->changes.pos = 1;
|
||||
}
|
||||
else if (bd->shade.dir == E_DIRECTION_LEFT)
|
||||
{
|
||||
|
@ -2479,7 +2459,6 @@ e_border_unshade(E_Border *bd,
|
|||
{
|
||||
bd->w = bd->client_inset.l + bd->client.w + bd->client_inset.r;
|
||||
bd->x = bd->x - bd->client.w;
|
||||
bd->changes.pos = 1;
|
||||
}
|
||||
if (bd->client.shaped)
|
||||
{
|
||||
|
@ -2491,7 +2470,6 @@ e_border_unshade(E_Border *bd,
|
|||
bd->need_shape_merge = 1;
|
||||
}
|
||||
|
||||
bd->changes.size = 1;
|
||||
bd->shaded = 0;
|
||||
bd->changes.shaded = 1;
|
||||
BD_CHANGED(bd);
|
||||
|
@ -4341,8 +4319,10 @@ e_border_resize_cancel(void)
|
|||
EAPI void
|
||||
e_border_frame_recalc(E_Border *bd)
|
||||
{
|
||||
int w, h;
|
||||
if (!bd->bg_object) return;
|
||||
|
||||
w = bd->w, h = bd->h;
|
||||
bd->w -= (bd->client_inset.l + bd->client_inset.r);
|
||||
bd->h -= (bd->client_inset.t + bd->client_inset.b);
|
||||
|
||||
|
@ -4351,18 +4331,22 @@ e_border_frame_recalc(E_Border *bd)
|
|||
bd->w += (bd->client_inset.l + bd->client_inset.r);
|
||||
bd->h += (bd->client_inset.t + bd->client_inset.b);
|
||||
|
||||
BD_CHANGED(bd);
|
||||
bd->changes.size = 1;
|
||||
if (bd->client.shaped)
|
||||
if (bd->changes.shading || bd->changes.shaded) return;
|
||||
if ((w != bd->w) || (h != bd->h))
|
||||
{
|
||||
bd->need_shape_merge = 1;
|
||||
bd->need_shape_export = 1;
|
||||
BD_CHANGED(bd);
|
||||
bd->changes.size = 1;
|
||||
if (bd->client.shaped)
|
||||
{
|
||||
bd->need_shape_merge = 1;
|
||||
bd->need_shape_export = 1;
|
||||
}
|
||||
if (bd->shaped_input)
|
||||
{
|
||||
bd->need_shape_merge = 1;
|
||||
}
|
||||
_e_border_client_move_resize_send(bd);
|
||||
}
|
||||
if (bd->shaped_input)
|
||||
{
|
||||
bd->need_shape_merge = 1;
|
||||
}
|
||||
_e_border_client_move_resize_send(bd);
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
|
@ -8594,8 +8578,10 @@ _e_border_eval(E_Border *bd)
|
|||
//if (bd->shaded)
|
||||
//ecore_x_window_raise(bd->win);
|
||||
bd->changes.shading = 0;
|
||||
send_event = 0;
|
||||
rem_change = 1;
|
||||
}
|
||||
if (bd->changes.shaded) send_event = 0;
|
||||
if ((bd->changes.shaded) && (bd->changes.pos) && (bd->changes.size))
|
||||
{
|
||||
//if (bd->shaded)
|
||||
|
@ -8630,7 +8616,6 @@ _e_border_eval(E_Border *bd)
|
|||
//ecore_x_window_lower(bd->win);
|
||||
//else
|
||||
//ecore_x_window_raise(bd->win);
|
||||
bd->changes.size = 1;
|
||||
bd->changes.shaded = 0;
|
||||
rem_change = 1;
|
||||
}
|
||||
|
@ -8690,23 +8675,24 @@ _e_border_eval(E_Border *bd)
|
|||
bd->y + bd->client_inset.t + tmp->client.e.state.video_position.y);
|
||||
}
|
||||
|
||||
if ((!bd->shaded) || (bd->shading))
|
||||
ecore_x_window_move_resize(bd->win, x, y, w, h);
|
||||
|
||||
if (bd->internal_ecore_evas)
|
||||
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0, w, h);
|
||||
else if (!bd->client.e.state.video)
|
||||
if ((!bd->shaded) && (!bd->shading))
|
||||
{
|
||||
ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h);
|
||||
ecore_x_window_move_resize(bd->client.lock_win, 0, 0, bd->client.w, bd->client.h);
|
||||
ecore_x_window_move_resize(bd->win, x, y, w, h);
|
||||
|
||||
if (bd->internal_ecore_evas)
|
||||
ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0, w, h);
|
||||
else if (!bd->client.e.state.video)
|
||||
{
|
||||
ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h);
|
||||
ecore_x_window_move_resize(bd->client.lock_win, 0, 0, bd->client.w, bd->client.h);
|
||||
}
|
||||
_e_border_client_move_resize_send(bd);
|
||||
}
|
||||
|
||||
e_container_shape_resize(bd->shape, w, h);
|
||||
if (bd->changes.pos)
|
||||
e_container_shape_move(bd->shape, x, y);
|
||||
|
||||
_e_border_client_move_resize_send(bd);
|
||||
|
||||
bd->changes.pos = 0;
|
||||
bd->changes.size = 0;
|
||||
rem_change = 1;
|
||||
|
@ -9140,6 +9126,7 @@ static Eina_Bool
|
|||
_e_border_shade_animator(void *data)
|
||||
{
|
||||
E_Border *bd = data;
|
||||
E_Event_Border_Resize *ev;
|
||||
double dt, val;
|
||||
double dur = bd->client.h / e_config->border_shade_speed;
|
||||
|
||||
|
@ -9222,7 +9209,6 @@ _e_border_shade_animator(void *data)
|
|||
{
|
||||
bd->h = bd->client_inset.t + bd->client_inset.b + bd->client.h * bd->shade.val;
|
||||
bd->y = bd->shade.y + bd->client.h * (1 - bd->shade.val);
|
||||
bd->changes.pos = 1;
|
||||
}
|
||||
else if (bd->shade.dir == E_DIRECTION_LEFT)
|
||||
bd->w = bd->client_inset.l + bd->client_inset.r + bd->client.w * bd->shade.val;
|
||||
|
@ -9230,7 +9216,6 @@ _e_border_shade_animator(void *data)
|
|||
{
|
||||
bd->w = bd->client_inset.l + bd->client_inset.r + bd->client.w * bd->shade.val;
|
||||
bd->x = bd->shade.x + bd->client.w * (1 - bd->shade.val);
|
||||
bd->changes.pos = 1;
|
||||
}
|
||||
|
||||
if (bd->client.shaped)
|
||||
|
@ -9242,17 +9227,13 @@ _e_border_shade_animator(void *data)
|
|||
{
|
||||
bd->need_shape_merge = 1;
|
||||
}
|
||||
bd->changes.size = 1;
|
||||
BD_CHANGED(bd);
|
||||
|
||||
/* we're done */
|
||||
if (val == 1)
|
||||
{
|
||||
E_Event_Border_Resize *ev;
|
||||
|
||||
bd->shading = 0;
|
||||
bd->shaded = !(bd->shaded);
|
||||
bd->changes.size = 1;
|
||||
bd->changes.shaded = 1;
|
||||
bd->changes.shading = 1;
|
||||
BD_CHANGED(bd);
|
||||
|
@ -9267,14 +9248,13 @@ _e_border_shade_animator(void *data)
|
|||
|
||||
ecore_x_window_gravity_set(bd->client.win, ECORE_X_GRAVITY_NW);
|
||||
if (bd->client.lock_win) ecore_x_window_gravity_set(bd->client.lock_win, ECORE_X_GRAVITY_NW);
|
||||
ev = E_NEW(E_Event_Border_Resize, 1);
|
||||
ev->border = bd;
|
||||
e_object_ref(E_OBJECT(bd));
|
||||
// e_object_breadcrumb_add(E_OBJECT(bd), "border_resize_event");
|
||||
ecore_event_add(E_EVENT_BORDER_RESIZE, ev, _e_border_event_border_resize_free, NULL);
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
ev = E_NEW(E_Event_Border_Resize, 1);
|
||||
ev->border = bd;
|
||||
e_object_ref(E_OBJECT(bd));
|
||||
// e_object_breadcrumb_add(E_OBJECT(bd), "border_resize_event");
|
||||
ecore_event_add(E_EVENT_BORDER_RESIZE, ev, _e_border_event_border_resize_free, NULL);
|
||||
return (val != 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -496,7 +496,7 @@ _e_comp_win_geometry_update(E_Comp_Win *cw)
|
|||
w = cw->w, h = cw->h;
|
||||
else if (cw->bd)
|
||||
{
|
||||
if ((!cw->bd->shaded) && cw->pw && cw->ph)
|
||||
if (((!cw->bd->shaded) && (!cw->bd->shading)) && cw->pw && cw->ph)
|
||||
w = cw->pw + cw->bd->client_inset.l + cw->bd->client_inset.r, h = cw->ph + cw->bd->client_inset.t + cw->bd->client_inset.b;
|
||||
else
|
||||
w = cw->bd->w, h = cw->bd->h;
|
||||
|
@ -1219,6 +1219,7 @@ _e_comp_cb_update(E_Comp *c)
|
|||
{
|
||||
new_updates = eina_list_append(new_updates, cw);
|
||||
}
|
||||
if (cw->geom_update) _e_comp_win_geometry_update(cw);
|
||||
}
|
||||
_e_comp_fps_update(c);
|
||||
if (conf->fps_show)
|
||||
|
@ -2781,11 +2782,14 @@ _e_comp_win_configure(E_Comp_Win *cw, int x, int y, int w, int h, int border)
|
|||
#if 1
|
||||
cw->w = w;
|
||||
cw->h = h;
|
||||
cw->needpix = 1;
|
||||
// was cw->w / cw->h
|
||||
// evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
|
||||
resized = EINA_TRUE;
|
||||
_e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
|
||||
if ((!cw->bd) || ((!cw->bd->shading) && (cw->bd->shaded)))
|
||||
{
|
||||
cw->needpix = 1;
|
||||
// was cw->w / cw->h
|
||||
// evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
|
||||
_e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
|
||||
}
|
||||
#else
|
||||
if (cw->bd)
|
||||
{
|
||||
|
@ -2826,11 +2830,14 @@ _e_comp_win_configure(E_Comp_Win *cw, int x, int y, int w, int h, int border)
|
|||
DBG(" [0x%x] rsz %4ix%4i", cw->win, w, h);
|
||||
cw->w = w;
|
||||
cw->h = h;
|
||||
cw->needpix = 1;
|
||||
// was cw->w / cw->h
|
||||
// evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
|
||||
resized = EINA_TRUE;
|
||||
if (!cw->real_obj) _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
|
||||
if ((!cw->bd) || ((!cw->bd->shading) && (cw->bd->shaded)))
|
||||
{
|
||||
cw->needpix = 1;
|
||||
// was cw->w / cw->h
|
||||
// evas_object_resize(cw->effect_obj, cw->pw, cw->ph);
|
||||
if (!cw->real_obj) _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
|
||||
}
|
||||
}
|
||||
if (cw->border != border)
|
||||
{
|
||||
|
|
|
@ -294,32 +294,35 @@ e_comp_wl_shutdown(void)
|
|||
{
|
||||
E_Module *mod = NULL;
|
||||
|
||||
/* remove the idler */
|
||||
if (_e_wl_comp->idler) ecore_idler_del(_e_wl_comp->idler);
|
||||
if (_e_wl_comp)
|
||||
{
|
||||
/* remove the idler */
|
||||
if (_e_wl_comp->idler) ecore_idler_del(_e_wl_comp->idler);
|
||||
|
||||
/* remove the fd handler */
|
||||
if (_e_wl_comp->fd_handler)
|
||||
ecore_main_fd_handler_del(_e_wl_comp->fd_handler);
|
||||
/* remove the fd handler */
|
||||
if (_e_wl_comp->fd_handler)
|
||||
ecore_main_fd_handler_del(_e_wl_comp->fd_handler);
|
||||
|
||||
/* shutdown input */
|
||||
_e_comp_wl_input_shutdown();
|
||||
/* shutdown input */
|
||||
_e_comp_wl_input_shutdown();
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGL
|
||||
/* unbind wayland display */
|
||||
if (_e_wl_comp->egl.bound)
|
||||
_e_wl_comp->egl.unbind_display(_e_wl_comp->egl.display, _e_wl_comp->wl.display);
|
||||
/* unbind wayland display */
|
||||
if (_e_wl_comp->egl.bound)
|
||||
_e_wl_comp->egl.unbind_display(_e_wl_comp->egl.display, _e_wl_comp->wl.display);
|
||||
|
||||
/* terminate the egl display */
|
||||
if (_e_wl_comp->egl.display) eglTerminate(_e_wl_comp->egl.display);
|
||||
/* terminate the egl display */
|
||||
if (_e_wl_comp->egl.display) eglTerminate(_e_wl_comp->egl.display);
|
||||
|
||||
eglReleaseThread();
|
||||
eglReleaseThread();
|
||||
#endif
|
||||
|
||||
/* if we have a display, destroy it */
|
||||
if (_e_wl_comp->wl.display) wl_display_destroy(_e_wl_comp->wl.display);
|
||||
/* if we have a display, destroy it */
|
||||
if (_e_wl_comp->wl.display) wl_display_destroy(_e_wl_comp->wl.display);
|
||||
|
||||
/* free the compositor */
|
||||
E_FREE(_e_wl_comp);
|
||||
/* free the compositor */
|
||||
E_FREE(_e_wl_comp);
|
||||
}
|
||||
|
||||
/* disable the loaded shell module */
|
||||
/* TODO: we should have a config variable somewhere to store which
|
||||
|
@ -405,7 +408,7 @@ _e_comp_wl_cb_read(void *data EINA_UNUSED, Ecore_Fd_Handler *hdl EINA_UNUSED)
|
|||
static Eina_Bool
|
||||
_e_comp_wl_cb_idle(void *data EINA_UNUSED)
|
||||
{
|
||||
if (_e_wl_comp->wl.display)
|
||||
if ((_e_wl_comp) && (_e_wl_comp->wl.display))
|
||||
{
|
||||
/* flush any clients before we idle */
|
||||
wl_display_flush_clients(_e_wl_comp->wl.display);
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_builddir)/src/bin/e_wayland \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src/bin/e_wayland \
|
||||
@e_wl_cflags@ \
|
||||
@cf_cflags@ \
|
||||
@VALGRIND_CFLAGS@ \
|
||||
@EDJE_DEF@ \
|
||||
@ELM_CFLAGS@ \
|
||||
@EMOTION_CFLAGS@ \
|
||||
@WAYLAND_CFLAGS@ \
|
||||
@WAYLAND_EGL_CFLAGS@ \
|
||||
-DPACKAGE_BIN_DIR=\"@PACKAGE_BIN_DIR@\" \
|
||||
-DPACKAGE_LIB_DIR=\"@PACKAGE_LIB_DIR@\" \
|
||||
-DPACKAGE_DATA_DIR=\"@PACKAGE_DATA_DIR@\" \
|
||||
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
|
||||
-DPACKAGE_SYSCONF_DIR=\"@PACKAGE_SYSCONF_DIR@\"
|
||||
|
||||
bin_PROGRAMS = \
|
||||
enlightenment_wl
|
||||
|
||||
ENLIGHTENMENTHEADERS = \
|
||||
e.h \
|
||||
e_includes.h \
|
||||
e_intl.h \
|
||||
e_log.h \
|
||||
e_error.h \
|
||||
e_signals.h \
|
||||
e_utils.h \
|
||||
e_prefix.h \
|
||||
e_user.h \
|
||||
e_filereg.h \
|
||||
e_object.h \
|
||||
e_path.h \
|
||||
e_config_data.h \
|
||||
e_config.h \
|
||||
e_backlight.h \
|
||||
e_border.h \
|
||||
e_powersave.h \
|
||||
e_font.h \
|
||||
e_int_menus.h \
|
||||
e_env.h \
|
||||
e_plane.h \
|
||||
e_buffer.h \
|
||||
e_region.h \
|
||||
e_surface.h \
|
||||
e_shell_surface.h \
|
||||
e_module.h \
|
||||
e_comp.h \
|
||||
e_input.h \
|
||||
e_output.h \
|
||||
e_shader.h \
|
||||
e_renderer.h \
|
||||
e_shell.h \
|
||||
e_scale.h \
|
||||
e_theme.h \
|
||||
e_pointer.h \
|
||||
e_canvas.h \
|
||||
e_manager.h \
|
||||
e_container.h \
|
||||
e_zone.h \
|
||||
e_desk.h \
|
||||
e_bg.h \
|
||||
e_box.h \
|
||||
e_icon.h \
|
||||
e_menu.h \
|
||||
e_int_menus.h \
|
||||
e_win.h \
|
||||
e_dialog.h \
|
||||
e_about.h \
|
||||
e_theme_about.h \
|
||||
e_actions.h \
|
||||
e_acpi.h \
|
||||
e_exec.h \
|
||||
e_configure.h \
|
||||
e_config_dialog.h \
|
||||
e_thumb.h \
|
||||
e_shelf.h \
|
||||
e_gadcon.h \
|
||||
e_popup.h \
|
||||
e_obj_dialog.h \
|
||||
e_border.h \
|
||||
e_sys.h \
|
||||
e_bindings.h \
|
||||
e_ipc.h \
|
||||
e_ipc_codec.h \
|
||||
e_exehist.h \
|
||||
e_alert.h
|
||||
|
||||
enlightenment_wl_src = \
|
||||
e_log.c \
|
||||
e_error.c \
|
||||
e_signals.c \
|
||||
e_utils.c \
|
||||
e_prefix.c \
|
||||
e_user.c \
|
||||
e_filereg.c \
|
||||
e_object.c \
|
||||
e_path.c \
|
||||
e_config_data.c \
|
||||
e_config.c \
|
||||
e_powersave.c \
|
||||
e_env.c \
|
||||
e_plane.c \
|
||||
e_buffer.c \
|
||||
e_region.c \
|
||||
e_surface.c \
|
||||
e_shell_surface.c \
|
||||
e_module.c \
|
||||
e_comp.c \
|
||||
e_input.c \
|
||||
e_output.c \
|
||||
e_renderer.c \
|
||||
e_shell.c \
|
||||
e_scale.c \
|
||||
e_theme.c \
|
||||
e_pointer.c \
|
||||
e_canvas.c \
|
||||
e_manager.c \
|
||||
e_container.c \
|
||||
e_zone.c \
|
||||
e_desk.c \
|
||||
e_bg.c \
|
||||
e_box.c \
|
||||
e_icon.c \
|
||||
e_menu.c \
|
||||
e_int_menus.c \
|
||||
e_win.c \
|
||||
e_dialog.c \
|
||||
e_about.c \
|
||||
e_theme_about.c \
|
||||
e_actions.c \
|
||||
e_acpi.c \
|
||||
e_exec.c \
|
||||
e_configure.c \
|
||||
e_config_dialog.c \
|
||||
e_thumb.c \
|
||||
e_shelf.c \
|
||||
e_gadcon.c \
|
||||
e_popup.c \
|
||||
e_obj_dialog.c \
|
||||
e_border.c \
|
||||
e_sys.c \
|
||||
e_bindings.c \
|
||||
e_ipc.c \
|
||||
e_ipc_codec.c \
|
||||
e_exehist.c \
|
||||
$(ENLIGHTENMENTHEADERS)
|
||||
|
||||
enlightenment_wl_CFLAGS = $(AM_CPPFLAGS) @WAYLAND_CFLAGS@ @WAYLAND_EGL_CFLAGS@
|
||||
enlightenment_wl_CPPFLAGS = $(AM_CPPFLAGS) -DE_LOGGING=1
|
||||
enlightenment_wl_SOURCES = \
|
||||
e_main.c \
|
||||
$(enlightenment_wl_src)
|
||||
|
||||
enlightenment_wl_LDFLAGS = -export-dynamic
|
||||
enlightenment_wl_LDADD = @e_wl_libs@ @ELM_LIBS@ @EMOTION_LIBS@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ @WAYLAND_EGL_LIBS@ -lm
|
||||
|
||||
installed_headersdir = $(prefix)/include/enlightenment
|
||||
installed_headers_DATA = $(ENLIGHTENMENTHEADERS)
|
|
@ -0,0 +1,330 @@
|
|||
#ifndef E_H
|
||||
# define E_H
|
||||
|
||||
# pragma GCC diagnostic ignored "-Wshadow"
|
||||
|
||||
/**
|
||||
* @defgroup API Enlightenment API
|
||||
*
|
||||
* Application programming interface to be used by modules to extend
|
||||
* Enlightenment.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# define USE_IPC
|
||||
# if 0
|
||||
# define OBJECT_PARANOIA_CHECK
|
||||
# define OBJECT_CHECK
|
||||
# endif
|
||||
|
||||
# ifndef _FILE_OFFSET_BITS
|
||||
# define _FILE_OFFSET_BITS 64
|
||||
# endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <stddef.h>
|
||||
#else
|
||||
# ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
#elif !defined alloca
|
||||
# ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
# elif defined _AIX
|
||||
# define alloca __alloca
|
||||
# elif defined _MSC_VER
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# elif !defined HAVE_ALLOCA
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
void *alloca (size_t);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef __linux__
|
||||
# include <features.h>
|
||||
# endif
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
# include <string.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/param.h>
|
||||
# include <sys/resource.h>
|
||||
# include <utime.h>
|
||||
# include <dlfcn.h>
|
||||
# include <math.h>
|
||||
# include <fcntl.h>
|
||||
# include <fnmatch.h>
|
||||
# include <limits.h>
|
||||
# include <ctype.h>
|
||||
# include <time.h>
|
||||
# include <dirent.h>
|
||||
# include <pwd.h>
|
||||
# include <grp.h>
|
||||
# include <glob.h>
|
||||
# include <locale.h>
|
||||
# include <errno.h>
|
||||
# include <signal.h>
|
||||
# include <inttypes.h>
|
||||
# include <assert.h>
|
||||
|
||||
# ifdef HAVE_GETTEXT
|
||||
# include <libintl.h>
|
||||
# endif
|
||||
|
||||
# ifndef _POSIX_HOST_NAME_MAX
|
||||
# define _POSIX_HOST_NAME_MAX 255
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_VALGRIND
|
||||
# include <memcheck.h>
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_EXECINFO_H
|
||||
# include <execinfo.h>
|
||||
# endif
|
||||
|
||||
# include <setjmp.h>
|
||||
# include <Eina.h>
|
||||
# include <Eet.h>
|
||||
# include <Evas.h>
|
||||
# include <Evas_Engine_Buffer.h>
|
||||
# include <Ecore.h>
|
||||
# include <Ecore_Getopt.h>
|
||||
# include <Ecore_Wayland.h>
|
||||
# include <Ecore_Evas.h>
|
||||
# include <Ecore_Input.h>
|
||||
# include <Ecore_Input_Evas.h>
|
||||
# include <Ecore_Con.h>
|
||||
# include <Ecore_Ipc.h>
|
||||
# include <Ecore_File.h>
|
||||
# include <Efreet.h>
|
||||
# include <Efreet_Mime.h>
|
||||
# include <Edje.h>
|
||||
# include <Eldbus.h>
|
||||
# include <Eio.h>
|
||||
|
||||
# include <pixman.h>
|
||||
# include <wayland-server.h>
|
||||
# include <xkbcommon/xkbcommon.h>
|
||||
|
||||
# ifdef HAVE_WAYLAND_EGL
|
||||
# include <GLES2/gl2.h>
|
||||
# include <GLES2/gl2ext.h>
|
||||
# include <EGL/egl.h>
|
||||
# include <EGL/eglext.h>
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_HAL
|
||||
# include <E_Hal.h>
|
||||
# endif
|
||||
|
||||
# ifdef EAPI
|
||||
# undef EAPI
|
||||
# endif
|
||||
# ifdef WIN32
|
||||
# ifdef BUILDING_DLL
|
||||
# define EAPI __declspec(dllexport)
|
||||
# else
|
||||
# define EAPI __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# ifdef __GNUC__
|
||||
# if __GNUC__ >= 4
|
||||
/* BROKEN in gcc 4 on amd64 */
|
||||
# if 0
|
||||
# pragma GCC visibility push(hidden)
|
||||
# endif
|
||||
# define EAPI __attribute__ ((visibility("default")))
|
||||
# else
|
||||
# define EAPI
|
||||
# endif
|
||||
# else
|
||||
# define EAPI
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef EINTERN
|
||||
# undef EINTERN
|
||||
# endif
|
||||
# ifdef __GNUC__
|
||||
# if __GNUC__ >= 4
|
||||
# define EINTERN __attribute__ ((visibility("hidden")))
|
||||
# else
|
||||
# define EINTERN
|
||||
# endif
|
||||
# else
|
||||
# define EINTERN
|
||||
# endif
|
||||
|
||||
#ifndef strdupa
|
||||
# define strdupa(str) strcpy(alloca(strlen(str) + 1), str)
|
||||
#endif
|
||||
|
||||
#ifndef strndupa
|
||||
# define strndupa(str, len) strncpy(alloca(len + 1), str, len)
|
||||
#endif
|
||||
|
||||
/* convenience macro to compress code and avoid typos */
|
||||
#ifndef MAX
|
||||
# define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#if (EINA_VERSION_MAJOR == 1) && (EINA_VERSION_MINOR < 8)
|
||||
# define eina_list_last_data_get(X) eina_list_data_get(eina_list_last(X))
|
||||
#endif
|
||||
|
||||
# define E_FREE_FUNC(_h, _fn) do { if (_h) { _fn((void*)_h); _h = NULL; } } while (0)
|
||||
# define E_INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
|
||||
(((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy)))
|
||||
# define E_INSIDE(x, y, xx, yy, ww, hh) \
|
||||
(((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && ((x) >= (xx)) && ((y) >= (yy)))
|
||||
# define E_CONTAINS(x, y, w, h, xx, yy, ww, hh) \
|
||||
(((xx) >= (x)) && (((x) + (w)) >= ((xx) + (ww))) && ((yy) >= (y)) && (((y) + (h)) >= ((yy) + (hh))))
|
||||
# define E_SPANS_COMMON(x1, w1, x2, w2) \
|
||||
(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
|
||||
# define E_REALLOC(p, s, n) p = (s *)realloc(p, sizeof(s) * n)
|
||||
# define E_NEW(s, n) (s *)calloc(n, sizeof(s))
|
||||
# define E_NEW_RAW(s, n) (s *)malloc(n * sizeof(s))
|
||||
# define E_FREE(p) do { free(p); p = NULL; } while (0)
|
||||
# define E_FREE_LIST(list, free) \
|
||||
do \
|
||||
{ \
|
||||
void *_tmp_; \
|
||||
EINA_LIST_FREE(list, _tmp_) \
|
||||
{ \
|
||||
free(_tmp_); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define E_LIST_REVERSE_FREE(list, data) \
|
||||
for (data = eina_list_last_data_get(list); \
|
||||
list; \
|
||||
list = eina_list_remove_list(list, eina_list_last(list)), \
|
||||
data = eina_list_last_data_get(list))
|
||||
|
||||
# define E_LIST_FOREACH(list, func) \
|
||||
do \
|
||||
{ \
|
||||
void *_tmp_; \
|
||||
const Eina_List *_list, *_list2; \
|
||||
EINA_LIST_FOREACH_SAFE(list, _list, _list2, _tmp_) \
|
||||
{ \
|
||||
func(_tmp_); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define E_LIST_HANDLER_APPEND(list, type, callback, data) \
|
||||
do \
|
||||
{ \
|
||||
Ecore_Event_Handler *_eh; \
|
||||
_eh = ecore_event_handler_add(type, (Ecore_Event_Handler_Cb)callback, data); \
|
||||
assert(_eh); \
|
||||
list = eina_list_append(list, _eh); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define E_CLAMP(x, min, max) (x < min ? min : (x > max ? max : x))
|
||||
# define E_RECTS_CLIP_TO_RECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch) \
|
||||
{ \
|
||||
if (E_INTERSECTS(_x, _y, _w, _h, _cx, _cy, _cw, _ch)) \
|
||||
{ \
|
||||
if ((int)_x < (int)(_cx)) \
|
||||
{ \
|
||||
_w += _x - (_cx); \
|
||||
_x = (_cx); \
|
||||
if ((int)_w < 0) _w = 0; \
|
||||
} \
|
||||
if ((int)(_x + _w) > (int)((_cx) + (_cw))) \
|
||||
_w = (_cx) + (_cw) - _x; \
|
||||
if ((int)_y < (int)(_cy)) \
|
||||
{ \
|
||||
_h += _y - (_cy); \
|
||||
_y = (_cy); \
|
||||
if ((int)_h < 0) _h = 0; \
|
||||
} \
|
||||
if ((int)(_y + _h) > (int)((_cy) + (_ch))) \
|
||||
_h = (_cy) + (_ch) - _y; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
_w = 0; _h = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
//#define SMARTERR(args...) abort()
|
||||
#define SMARTERRNR() return
|
||||
#define SMARTERR(x) return x
|
||||
|
||||
# define E_REMOTE_OPTIONS 1
|
||||
# define E_REMOTE_OUT 2
|
||||
# define E_WM_IN 3
|
||||
# define E_REMOTE_IN 4
|
||||
# define E_ENUM 5
|
||||
# define E_LIB_IN 6
|
||||
|
||||
# define E_TYPEDEFS 1
|
||||
# include "e_includes.h"
|
||||
# undef E_TYPEDEFS
|
||||
# include "e_includes.h"
|
||||
|
||||
EAPI double e_main_ts(const char *str);
|
||||
|
||||
extern EAPI Eina_Bool good;
|
||||
extern EAPI Eina_Bool evil;
|
||||
extern EAPI Eina_Bool starting;
|
||||
extern EAPI Eina_Bool stopping;
|
||||
extern EAPI Eina_Bool restart;
|
||||
extern EAPI Eina_Bool e_nopause;
|
||||
extern EAPI Eina_Bool wl_fatal;
|
||||
|
||||
extern EAPI E_Path *path_data;
|
||||
extern EAPI E_Path *path_images;
|
||||
extern EAPI E_Path *path_fonts;
|
||||
extern EAPI E_Path *path_themes;
|
||||
extern EAPI E_Path *path_icons;
|
||||
extern EAPI E_Path *path_modules;
|
||||
extern EAPI E_Path *path_backgrounds;
|
||||
extern EAPI E_Path *path_messages;
|
||||
|
||||
extern EAPI E_Compositor *_e_comp;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup Optional_Modules Optional Modules
|
||||
* @{
|
||||
*
|
||||
* @defgroup Optional_Conf Configurations
|
||||
* @defgroup Optional_Control Controls
|
||||
* @defgroup Optional_Devices Devices & Hardware
|
||||
* @defgroup Optional_Fileman File Managers
|
||||
* @defgroup Optional_Gadgets Gadgets
|
||||
* @defgroup Optional_Launcher Launchers
|
||||
* @defgroup Optional_Layouts Layout Managers
|
||||
* @defgroup Optional_Look Look & Feel
|
||||
* @defgroup Optional_Monitors Monitors & Notifications
|
||||
* @defgroup Optional_Mobile Mobile Specific Extensions
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif
|
|
@ -0,0 +1,119 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local subsystem functions */
|
||||
|
||||
/* local subsystem globals */
|
||||
|
||||
/* externally accessible functions */
|
||||
|
||||
EAPI E_About *
|
||||
e_about_new(E_Container *con)
|
||||
{
|
||||
E_Obj_Dialog *od;
|
||||
char buf[16384];
|
||||
FILE *f;
|
||||
Eina_Strbuf *tbuf;
|
||||
|
||||
od = e_obj_dialog_new(con, _("About Enlightenment"), "E", "_about");
|
||||
if (!od) return NULL;
|
||||
e_obj_dialog_obj_theme_set(od, "base/theme/about", "e/widgets/about/main");
|
||||
e_obj_dialog_obj_part_text_set(od, "e.text.label", _("Close"));
|
||||
e_obj_dialog_obj_part_text_set(od, "e.text.title", _("Enlightenment"));
|
||||
e_obj_dialog_obj_part_text_set(od, "e.text.version", VERSION);
|
||||
snprintf
|
||||
(buf, sizeof(buf), "%s%s",
|
||||
_(
|
||||
"<title>Copyright © 2000-2013, by the Enlightenment "
|
||||
"Development Team</><br>"
|
||||
"<br>"
|
||||
"We hope you enjoy using this software as much as we enjoyed "
|
||||
"writing it.<br>"
|
||||
"<br>"
|
||||
"To contact us please visit:<br>"
|
||||
"<hilight>http://www.enlightenment.org</><br>"
|
||||
"<br>"
|
||||
),
|
||||
"All rights reserved.<br>"
|
||||
"<br>"
|
||||
"Redistribution and use in source and binary forms, with or without "
|
||||
"modification, are permitted provided that the following conditions "
|
||||
"are met:<br>"
|
||||
"<br>"
|
||||
"1. Redistributions of source code must retain the above copyright "
|
||||
"notice, this list of conditions and the following disclaimer.<br>"
|
||||
"2. Redistributions in binary form must reproduce the above copyright "
|
||||
"notice, this list of conditions and the following disclaimer in the "
|
||||
"documentation and/or other materials provided with the "
|
||||
"distribution.<br>"
|
||||
"<br>"
|
||||
"<hilight>THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR "
|
||||
"IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED "
|
||||
"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE "
|
||||
"ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR "
|
||||
"CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, "
|
||||
"SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT "
|
||||
"LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF "
|
||||
"USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED "
|
||||
"AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT "
|
||||
"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN "
|
||||
"ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE "
|
||||
"POSSIBILITY OF SUCH DAMAGE.</><br>"
|
||||
);
|
||||
e_obj_dialog_obj_part_text_set(od, "e.textblock.about", buf);
|
||||
|
||||
e_prefix_data_concat_static(buf, "AUTHORS");
|
||||
f = fopen(buf, "r");
|
||||
if (f)
|
||||
{
|
||||
tbuf = eina_strbuf_new();
|
||||
eina_strbuf_append(tbuf, _("<title>The Team</><br><br>"));
|
||||
while (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
int len;
|
||||
|
||||
len = strlen(buf);
|
||||
if (len > 0)
|
||||
{
|
||||
if (buf[len - 1] == '\n')
|
||||
{
|
||||
buf[len - 1] = 0;
|
||||
len--;
|
||||
}
|
||||
if (len > 0)
|
||||
{
|
||||
char *p;
|
||||
|
||||
do
|
||||
{
|
||||
p = strchr(buf, '<');
|
||||
if (p) *p = 0;
|
||||
}
|
||||
while (p);
|
||||
do
|
||||
{
|
||||
p = strchr(buf, '>');
|
||||
if (p) *p = 0;
|
||||
}
|
||||
while (p);
|
||||
eina_strbuf_append_printf(tbuf, "%s<br>", buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
if (tbuf)
|
||||
{
|
||||
e_obj_dialog_obj_part_text_set(od, "e.textblock.authors",
|
||||
(char *)eina_strbuf_string_get(tbuf));
|
||||
eina_strbuf_free(tbuf);
|
||||
}
|
||||
}
|
||||
return (E_About *)od;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_about_show(E_About *about)
|
||||
{
|
||||
e_obj_dialog_show((E_Obj_Dialog *)about);
|
||||
e_obj_dialog_icon_set((E_Obj_Dialog *)about, "help-about");
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Obj_Dialog E_About;
|
||||
|
||||
#else
|
||||
#ifndef E_ABOUT_H
|
||||
#define E_ABOUT_H
|
||||
|
||||
EAPI E_About *e_about_new (E_Container *con);
|
||||
EAPI void e_about_show (E_About *about);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,382 @@
|
|||
#include "e.h"
|
||||
|
||||
/* TODO:
|
||||
*
|
||||
* Sanatize data received from acpi for message status into something
|
||||
* meaningful (ie: 00000002 == LID_CLOSED, etc, etc).
|
||||
*
|
||||
* Find someone with a WIFI that actually emits ACPI events and add/debug the
|
||||
* E_EVENT_ACPI for wifi.
|
||||
*
|
||||
*/
|
||||
|
||||
/* local structures */
|
||||
/* for simple acpi device mapping */
|
||||
typedef struct _E_ACPI_Device_Simple E_ACPI_Device_Simple;
|
||||
typedef struct _E_ACPI_Device_Multiplexed E_ACPI_Device_Multiplexed;
|
||||
|
||||
struct _E_ACPI_Device_Simple
|
||||
{
|
||||
const char *name;
|
||||
// ->
|
||||
int type;
|
||||
};
|
||||
|
||||
struct _E_ACPI_Device_Multiplexed
|
||||
{
|
||||
const char *name;
|
||||
const char *bus;
|
||||
int status;
|
||||
// ->
|
||||
int type;
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
static Eina_Bool _e_acpi_cb_server_del(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||
static Eina_Bool _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||
static void _e_acpi_cb_event_free(void *data __UNUSED__, void *event);
|
||||
static int _e_acpi_lid_status_get(const char *device, const char *bus);
|
||||
static Eina_Bool _e_acpi_cb_event(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||
|
||||
/* local variables */
|
||||
static int _e_acpi_events_frozen = 0;
|
||||
static Ecore_Con_Server *_e_acpid = NULL;
|
||||
static Eina_List *_e_acpid_hdls = NULL;
|
||||
static Eina_Strbuf *acpibuf = NULL;
|
||||
|
||||
static E_ACPI_Device_Simple _devices_simple[] =
|
||||
{
|
||||
/* NB: DO NOT TRANSLATE THESE. */
|
||||
{"ac_adapter", E_ACPI_TYPE_AC_ADAPTER},
|
||||
{"battery", E_ACPI_TYPE_BATTERY},
|
||||
{"button/lid", E_ACPI_TYPE_LID},
|
||||
{"button/power", E_ACPI_TYPE_POWER},
|
||||
{"button/sleep", E_ACPI_TYPE_SLEEP},
|
||||
{"fan", E_ACPI_TYPE_FAN},
|
||||
{"processor", E_ACPI_TYPE_PROCESSOR},
|
||||
{"thermal_zone", E_ACPI_TYPE_THERMAL},
|
||||
{"video", E_ACPI_TYPE_VIDEO},
|
||||
|
||||
{NULL, E_ACPI_TYPE_UNKNOWN}
|
||||
};
|
||||
|
||||
static E_ACPI_Device_Multiplexed _devices_multiplexed[] =
|
||||
{
|
||||
/* NB: DO NOT TRANSLATE THESE. */
|
||||
/* Sony VAIO - VPCF115FM / PCG-81114L - nvidia gfx */
|
||||
{"sony/hotkey", NULL, 0x10, E_ACPI_TYPE_BRIGHTNESS_DOWN},
|
||||
{"sony/hotkey", NULL, 0x11, E_ACPI_TYPE_BRIGHTNESS_UP},
|
||||
{"sony/hotkey", NULL, 0x12, E_ACPI_TYPE_VIDEO},
|
||||
{"sony/hotkey", NULL, 0x14, E_ACPI_TYPE_ZOOM_OUT},
|
||||
{"sony/hotkey", NULL, 0x15, E_ACPI_TYPE_ZOOM_IN},
|
||||
{"sony/hotkey", NULL, 0x17, E_ACPI_TYPE_HIBERNATE},
|
||||
{"sony/hotkey", NULL, 0xa6, E_ACPI_TYPE_ASSIST},
|
||||
{"sony/hotkey", NULL, 0x20, E_ACPI_TYPE_S1},
|
||||
{"sony/hotkey", NULL, 0xa5, E_ACPI_TYPE_VAIO},
|
||||
|
||||
/* Sony VAIO - X505 - intel gfx */
|
||||
{"sony/hotkey", NULL, 0x0e, E_ACPI_TYPE_MUTE},
|
||||
{"sony/hotkey", NULL, 0x0f, E_ACPI_TYPE_VOLUME},
|
||||
{"sony/hotkey", NULL, 0x10, E_ACPI_TYPE_BRIGHTNESS},
|
||||
{"sony/hotkey", NULL, 0x12, E_ACPI_TYPE_VIDEO},
|
||||
|
||||
/* HP Compaq Presario - CQ61 - intel gfx */
|
||||
/** interesting these get auto-mapped to keys in x11. here for documentation
|
||||
** but not enabled as we can use regular keybinds for these
|
||||
{"video", "DD03", 0x87, E_ACPI_TYPE_BRIGHTNESS_DOWN},
|
||||
{"video", "DD03", 0x86, E_ACPI_TYPE_BRIGHTNESS_UP},
|
||||
{"video", "OVGA", 0x80, E_ACPI_TYPE_VIDEO},
|
||||
*/
|
||||
/* END */
|
||||
{NULL, NULL, 0x00, E_ACPI_TYPE_UNKNOWN}
|
||||
};
|
||||
|
||||
/* public variables */
|
||||
EAPI int E_EVENT_ACPI = 0;
|
||||
|
||||
/* public functions */
|
||||
EINTERN int
|
||||
e_acpi_init(void)
|
||||
{
|
||||
E_EVENT_ACPI = ecore_event_type_new();
|
||||
|
||||
/* check for running acpid */
|
||||
if (!ecore_file_exists("/var/run/acpid.socket")) return 1;
|
||||
|
||||
/* try to connect to acpid socket */
|
||||
_e_acpid = ecore_con_server_connect(ECORE_CON_LOCAL_SYSTEM,
|
||||
"/var/run/acpid.socket", -1, NULL);
|
||||
if (!_e_acpid) return 1;
|
||||
|
||||
/* setup handlers */
|
||||
_e_acpid_hdls =
|
||||
eina_list_append(_e_acpid_hdls,
|
||||
ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL,
|
||||
_e_acpi_cb_server_del, NULL));
|
||||
_e_acpid_hdls =
|
||||
eina_list_append(_e_acpid_hdls,
|
||||
ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA,
|
||||
_e_acpi_cb_server_data, NULL));
|
||||
|
||||
/* Add handlers for standard acpi events */
|
||||
_e_acpid_hdls =
|
||||
eina_list_append(_e_acpid_hdls,
|
||||
ecore_event_handler_add(E_EVENT_ACPI,
|
||||
_e_acpi_cb_event, NULL));
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_acpi_shutdown(void)
|
||||
{
|
||||
Ecore_Event_Handler *hdl;
|
||||
|
||||
/* cleanup event handlers */
|
||||
EINA_LIST_FREE(_e_acpid_hdls, hdl)
|
||||
ecore_event_handler_del(hdl);
|
||||
|
||||
/* kill the server if existing */
|
||||
if (_e_acpid)
|
||||
{
|
||||
ecore_con_server_del(_e_acpid);
|
||||
_e_acpid = NULL;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_acpi_events_freeze(void)
|
||||
{
|
||||
_e_acpi_events_frozen++;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_acpi_events_thaw(void)
|
||||
{
|
||||
_e_acpi_events_frozen--;
|
||||
if (_e_acpi_events_frozen < 0) _e_acpi_events_frozen = 0;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static Eina_Bool
|
||||
_e_acpi_cb_server_del(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
Ecore_Con_Event_Server_Del *ev;
|
||||
Ecore_Event_Handler *hdl;
|
||||
|
||||
ev = event;
|
||||
if (ev->server != _e_acpid) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
/* cleanup event handlers */
|
||||
EINA_LIST_FREE(_e_acpid_hdls, hdl)
|
||||
ecore_event_handler_del(hdl);
|
||||
|
||||
/* kill the server if existing */
|
||||
if (_e_acpid)
|
||||
{
|
||||
ecore_con_server_del(_e_acpid);
|
||||
_e_acpid = NULL;
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
Ecore_Con_Event_Server_Data *ev;
|
||||
E_Event_Acpi *acpi_event;
|
||||
int sig, status, i, done = 0;
|
||||
char device[1024], bus[1024], *sdata;
|
||||
const char *str, *p;
|
||||
|
||||
ev = event;
|
||||
|
||||
if ((!ev->data) || (ev->size < 1)) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
/* write out actual acpi received data to stdout for debugging
|
||||
res = fwrite(ev->data, ev->size, 1, stdout);
|
||||
*/
|
||||
/* data from a server isnt a string - its not 0 byte terminated. it's just
|
||||
* a blob of data. copy to string and 0 byte terminate it so it can be
|
||||
* string-swizzled/parsed etc. */
|
||||
if (!acpibuf) acpibuf = eina_strbuf_new();
|
||||
eina_strbuf_append_length(acpibuf, ev->data, ev->size);
|
||||
str = eina_strbuf_string_get(acpibuf);
|
||||
p = strchr(str, '\n');
|
||||
if (!p) return ECORE_CALLBACK_PASS_ON;
|
||||
while (p)
|
||||
{
|
||||
sdata = alloca(p - str + 1);
|
||||
strncpy(sdata, str, (int)(p - str));
|
||||
sdata[p - str] = 0;
|
||||
/* parse out this acpi string into separate pieces */
|
||||
if (sscanf(sdata, "%1023s %1023s %x %x",
|
||||
device, bus, &sig, &status) != 4)
|
||||
{
|
||||
sig = -1;
|
||||
status = -1;
|
||||
if (sscanf(sdata, "%1023s %1023s", device, bus) != 2)
|
||||
goto done_event;
|
||||
}
|
||||
|
||||
/* create new event structure to raise */
|
||||
acpi_event = E_NEW(E_Event_Acpi, 1);
|
||||
acpi_event->bus_id = eina_stringshare_add(bus);
|
||||
acpi_event->signal = sig;
|
||||
acpi_event->status = status;
|
||||
|
||||
/* FIXME: add in a key faking layer */
|
||||
if ((!done) && (sig >= 0) && (status >= 0))
|
||||
{
|
||||
for (i = 0; _devices_multiplexed[i].name; i++)
|
||||
{
|
||||
// if device name matches
|
||||
if ((!strcmp(device, _devices_multiplexed[i].name)) &&
|
||||
// AND busname not set OR device name matches
|
||||
(!_devices_multiplexed[i].bus ||
|
||||
(_devices_multiplexed[i].bus &&
|
||||
(!strcmp(bus, _devices_multiplexed[i].bus)))) &&
|
||||
// AND status matches
|
||||
(_devices_multiplexed[i].status == status))
|
||||
{
|
||||
acpi_event->type = _devices_multiplexed[i].type;
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!done)
|
||||
{
|
||||
// if device name matches
|
||||
for (i = 0; _devices_simple[i].name; i++)
|
||||
{
|
||||
if (!strcmp(device, _devices_simple[i].name))
|
||||
{
|
||||
acpi_event->type = _devices_simple[i].type;
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!done)
|
||||
{
|
||||
free(acpi_event);
|
||||
acpi_event = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (acpi_event->type)
|
||||
{
|
||||
case E_ACPI_TYPE_LID:
|
||||
acpi_event->status =
|
||||
_e_acpi_lid_status_get(device, bus);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* actually raise the event */
|
||||
ecore_event_add(E_EVENT_ACPI, acpi_event,
|
||||
_e_acpi_cb_event_free, NULL);
|
||||
}
|
||||
done_event:
|
||||
str = p + 1;
|
||||
p = strchr(str, '\n');
|
||||
}
|
||||
if (str[0] == 0)
|
||||
{
|
||||
eina_strbuf_free(acpibuf);
|
||||
acpibuf = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
Eina_Strbuf *newbuf;
|
||||
|
||||
newbuf = eina_strbuf_new();
|
||||
eina_strbuf_append(newbuf, str);
|
||||
eina_strbuf_free(acpibuf);
|
||||
acpibuf = newbuf;
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_acpi_cb_event_free(void *data __UNUSED__, void *event)
|
||||
{
|
||||
E_Event_Acpi *ev;
|
||||
|
||||
if (!(ev = event)) return;
|
||||
if (ev->device) eina_stringshare_del(ev->device);
|
||||
if (ev->bus_id) eina_stringshare_del(ev->bus_id);
|
||||
E_FREE(ev);
|
||||
}
|
||||
|
||||
static int
|
||||
_e_acpi_lid_status_get(const char *device, const char *bus)
|
||||
{
|
||||
FILE *f;
|
||||
int i = 0;
|
||||
char buff[PATH_MAX], *ret;
|
||||
|
||||
/* the acpi driver code in the kernel has a nice acpi function to return
|
||||
* the lid status easily, but that function is not exposed for user_space
|
||||
* so we need to check the proc fs to get the actual status */
|
||||
|
||||
/* make sure we have a device and bus */
|
||||
if ((!device) || (!bus)) return E_ACPI_LID_UNKNOWN;
|
||||
|
||||
/* open the state file from /proc */
|
||||
snprintf(buff, sizeof(buff), "/proc/acpi/%s/%s/state", device, bus);
|
||||
if (!(f = fopen(buff, "r")))
|
||||
{
|
||||
/* hack around ppurka's Thinkpad (G460 + Linux) that reports lid
|
||||
* state as "/proc/acpi/button/lid/LID0/state" but where the lid
|
||||
* event says "button/lid LID close".
|
||||
*
|
||||
* so let's take the base device name "LID" and add a numeric like
|
||||
* 0, 1, 2, 3 so we have LID0, LID1, LID2 etc. - try up to LID9
|
||||
* and then give up.
|
||||
*/
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
snprintf(buff, sizeof(buff), "/proc/acpi/%s/%s%i/state",
|
||||
device, bus, i);
|
||||
if ((f = fopen(buff, "r"))) break;
|
||||
f = NULL;
|
||||
}
|
||||
if (!f) return E_ACPI_LID_UNKNOWN;
|
||||
}
|
||||
|
||||
/* read the line from state file */
|
||||
ret = fgets(buff, sizeof(buff), f);
|
||||
fclose(f);
|
||||
|
||||
/* parse out state file */
|
||||
i = 0;
|
||||
while (buff[i] != ':')
|
||||
i++;
|
||||
while (!isalnum(buff[i]))
|
||||
i++;
|
||||
ret = &(buff[i]);
|
||||
while (isalnum(buff[i]))
|
||||
i++;
|
||||
buff[i] = 0;
|
||||
|
||||
/* compare value from state file and return something sane */
|
||||
if (!strcmp(ret, "open")) return E_ACPI_LID_OPEN;
|
||||
else if (!strcmp(ret, "closed"))
|
||||
return E_ACPI_LID_CLOSED;
|
||||
else return E_ACPI_LID_UNKNOWN;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_acpi_cb_event(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
E_Event_Acpi *ev;
|
||||
|
||||
ev = event;
|
||||
if (_e_acpi_events_frozen > 0) return ECORE_CALLBACK_PASS_ON;
|
||||
e_bindings_acpi_event_handle(E_BINDING_CONTEXT_NONE, NULL, ev);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
/* enum for various event types */
|
||||
typedef enum _E_Acpi_Type
|
||||
{
|
||||
E_ACPI_TYPE_UNKNOWN = 0,
|
||||
|
||||
E_ACPI_TYPE_AC_ADAPTER, // 1
|
||||
E_ACPI_TYPE_BATTERY, // 2
|
||||
E_ACPI_TYPE_BUTTON, // 3
|
||||
E_ACPI_TYPE_FAN, // 4
|
||||
E_ACPI_TYPE_LID, // 5
|
||||
E_ACPI_TYPE_POWER, // 6
|
||||
E_ACPI_TYPE_PROCESSOR, // 7
|
||||
E_ACPI_TYPE_SLEEP, // 8
|
||||
E_ACPI_TYPE_THERMAL, // 9
|
||||
E_ACPI_TYPE_VIDEO, // 10
|
||||
E_ACPI_TYPE_WIFI, // 11
|
||||
E_ACPI_TYPE_HIBERNATE, // 12
|
||||
E_ACPI_TYPE_ZOOM_OUT, // 13
|
||||
E_ACPI_TYPE_ZOOM_IN, // 14
|
||||
E_ACPI_TYPE_BRIGHTNESS_DOWN, // 15
|
||||
E_ACPI_TYPE_BRIGHTNESS_UP, // 16
|
||||
E_ACPI_TYPE_ASSIST, // 17
|
||||
E_ACPI_TYPE_S1, // 18
|
||||
E_ACPI_TYPE_VAIO, // 19
|
||||
E_ACPI_TYPE_MUTE, // 20
|
||||
E_ACPI_TYPE_VOLUME, // 21
|
||||
E_ACPI_TYPE_BRIGHTNESS // 22
|
||||
} E_Acpi_Type;
|
||||
|
||||
/* enum for acpi signals */
|
||||
typedef enum _E_Acpi_Device_Signal
|
||||
{
|
||||
E_ACPI_DEVICE_SIGNAL_UNKNOWN, // 0
|
||||
E_ACPI_DEVICE_SIGNAL_NOTIFY = 80,
|
||||
E_ACPI_DEVICE_SIGNAL_CHANGED = 82, // device added or removed
|
||||
E_ACPI_DEVICE_SIGNAL_AWAKE = 83,
|
||||
E_ACPI_DEVICE_SIGNAL_EJECT = 84
|
||||
} E_Acpi_Device_Signal;
|
||||
|
||||
/* enum for lid status */
|
||||
typedef enum _E_Acpi_Lid_Status
|
||||
{
|
||||
E_ACPI_LID_UNKNOWN, // 0
|
||||
E_ACPI_LID_CLOSED, // 1
|
||||
E_ACPI_LID_OPEN // 2
|
||||
} E_Acpi_Lid_Status;
|
||||
|
||||
/* struct used to pass to event handlers */
|
||||
typedef struct _E_Event_Acpi E_Event_Acpi;
|
||||
|
||||
#else
|
||||
# ifndef E_ACPI_H
|
||||
# define E_ACPI_H
|
||||
|
||||
struct _E_Event_Acpi
|
||||
{
|
||||
const char *device, *bus_id;
|
||||
int type, signal, status;
|
||||
};
|
||||
|
||||
EINTERN int e_acpi_init(void);
|
||||
EINTERN int e_acpi_shutdown(void);
|
||||
|
||||
EAPI void e_acpi_events_freeze(void);
|
||||
EAPI void e_acpi_events_thaw(void);
|
||||
|
||||
extern EAPI int E_EVENT_ACPI;
|
||||
|
||||
# endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,64 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Action E_Action;
|
||||
typedef struct _E_Action_Description E_Action_Description;
|
||||
typedef struct _E_Action_Group E_Action_Group;
|
||||
|
||||
#else
|
||||
#ifndef E_ACTIONS_H
|
||||
#define E_ACTIONS_H
|
||||
|
||||
#define E_ACTION_TYPE 0xE0b01010
|
||||
|
||||
struct _E_Action
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
const char *name;
|
||||
struct
|
||||
{
|
||||
void (*go) (E_Object *obj, const char *params);
|
||||
void (*go_mouse) (E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev);
|
||||
void (*go_wheel) (E_Object *obj, const char *params, Ecore_Event_Mouse_Wheel *ev);
|
||||
void (*go_edge) (E_Object *obj, const char *params, E_Event_Zone_Edge *ev);
|
||||
void (*go_key) (E_Object *obj, const char *params, Ecore_Event_Key *ev);
|
||||
void (*go_signal) (E_Object *obj, const char *params, const char *sig, const char *src);
|
||||
void (*go_acpi) (E_Object *obj, const char *params, E_Event_Acpi *ev);
|
||||
void (*end) (E_Object *obj, const char *params);
|
||||
void (*end_mouse) (E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev);
|
||||
void (*end_key) (E_Object *obj, const char *params, Ecore_Event_Key *ev);
|
||||
} func;
|
||||
};
|
||||
|
||||
struct _E_Action_Description
|
||||
{
|
||||
const char *act_name;
|
||||
const char *act_cmd;
|
||||
const char *act_params;
|
||||
const char *param_example;
|
||||
int editable;
|
||||
};
|
||||
|
||||
struct _E_Action_Group
|
||||
{
|
||||
const char *act_grp;
|
||||
Eina_List *acts;
|
||||
};
|
||||
|
||||
EINTERN int e_actions_init(void);
|
||||
EINTERN int e_actions_shutdown(void);
|
||||
|
||||
EAPI Eina_List *e_action_name_list(void);
|
||||
EAPI E_Action *e_action_add(const char *name);
|
||||
/* e_action_del allows, for example, modules to define their own actions dynamically. */
|
||||
EAPI void e_action_del(const char *name);
|
||||
EAPI E_Action *e_action_find(const char *name);
|
||||
|
||||
EAPI const char *e_action_predef_label_get(const char *action, const char *params);
|
||||
EAPI void e_action_predef_name_set(const char *act_grp, const char *act_name, const char *act_cmd, const char *act_params, const char *param_example, int editable);
|
||||
EAPI void e_action_predef_name_del(const char *act_grp, const char *act_name);
|
||||
EAPI void e_action_predef_name_all_del(void);
|
||||
EAPI Eina_List *e_action_groups_get(void);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef enum _E_Alert_Op_Type
|
||||
{
|
||||
E_ALERT_OP_RESTART = 0,
|
||||
E_ALERT_OP_EXIT
|
||||
} E_Alert_Op_Type;
|
||||
|
||||
#else
|
||||
#ifndef E_ALERT_H
|
||||
#define E_ALERT_H
|
||||
|
||||
EINTERN int e_alert_init(void);
|
||||
EINTERN int e_alert_shutdown(void);
|
||||
|
||||
EAPI void e_alert_show(void);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
//typedef struct _E_Screen E_Screen;
|
||||
|
||||
typedef enum _E_Backlight_Mode
|
||||
{
|
||||
E_BACKLIGHT_MODE_NORMAL = 0,
|
||||
E_BACKLIGHT_MODE_OFF = 1,
|
||||
E_BACKLIGHT_MODE_MIN = 2,
|
||||
E_BACKLIGHT_MODE_DIM = 3,
|
||||
E_BACKLIGHT_MODE_MAX = 4
|
||||
// for the future. right now not working as we'd need an optical
|
||||
// sensor support framework
|
||||
// E_BACKLIGHT_MODE_AUTO = 5
|
||||
} E_Backlight_Mode;
|
||||
|
||||
#else
|
||||
# ifndef E_BACKLIGHT_H
|
||||
# define E_BACKLIGHT_H
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,412 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_bg_signal(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__);
|
||||
|
||||
/* local variables */
|
||||
EAPI int E_EVENT_BG_UPDATE = 0;
|
||||
|
||||
EINTERN int
|
||||
e_bg_init(void)
|
||||
{
|
||||
Eina_List *l = NULL;
|
||||
E_Config_Desktop_Background *cfbg = NULL;
|
||||
|
||||
if (e_config->desktop_default_background)
|
||||
e_filereg_register(e_config->desktop_default_background);
|
||||
|
||||
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
|
||||
{
|
||||
if (!cfbg) continue;
|
||||
e_filereg_register(cfbg->file);
|
||||
}
|
||||
|
||||
E_EVENT_BG_UPDATE = ecore_event_type_new();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_bg_shutdown(void)
|
||||
{
|
||||
Eina_List *l = NULL;
|
||||
E_Config_Desktop_Background *cfbg = NULL;
|
||||
|
||||
if (e_config->desktop_default_background)
|
||||
e_filereg_deregister(e_config->desktop_default_background);
|
||||
|
||||
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
|
||||
{
|
||||
if (!cfbg) continue;
|
||||
e_filereg_deregister(cfbg->file);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
|
||||
{
|
||||
const char *bgfile = "", *trans = "";
|
||||
E_Desk *desk;
|
||||
|
||||
if (transition == E_BG_TRANSITION_START)
|
||||
trans = e_config->transition_start;
|
||||
else if (transition == E_BG_TRANSITION_DESK)
|
||||
trans = e_config->transition_desk;
|
||||
else if (transition == E_BG_TRANSITION_CHANGE)
|
||||
trans = e_config->transition_change;
|
||||
if ((!trans) || (!trans[0])) transition = E_BG_TRANSITION_NONE;
|
||||
|
||||
desk = e_desk_current_get(zone);
|
||||
if (desk)
|
||||
bgfile = e_bg_file_get(zone->container->num, zone->num, desk->x, desk->y);
|
||||
else
|
||||
bgfile = e_bg_file_get(zone->container->num, zone->num, -1, -1);
|
||||
|
||||
printf("Bg File: %s\n", bgfile);
|
||||
|
||||
if (zone->o_bg)
|
||||
{
|
||||
const char *pfile = "";
|
||||
|
||||
edje_object_file_get(zone->o_bg, &pfile, NULL);
|
||||
if (!strcmp(pfile, bgfile)) return;
|
||||
}
|
||||
|
||||
if (transition == E_BG_TRANSITION_NONE)
|
||||
{
|
||||
if (zone->o_bg)
|
||||
{
|
||||
evas_object_del(zone->o_bg);
|
||||
zone->o_bg = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char buff[PATH_MAX];
|
||||
|
||||
if (zone->o_bg)
|
||||
{
|
||||
if (zone->o_prev_bg) evas_object_del(zone->o_prev_bg);
|
||||
zone->o_prev_bg = zone->o_bg;
|
||||
if (zone->o_trans) evas_object_del(zone->o_trans);
|
||||
zone->o_trans = NULL;
|
||||
zone->o_bg = NULL;
|
||||
}
|
||||
zone->o_trans = edje_object_add(zone->container->bg_evas);
|
||||
evas_object_data_set(zone->o_trans, "e_zone", zone);
|
||||
snprintf(buff, sizeof(buff), "e/transitions/%s", trans);
|
||||
e_theme_edje_object_set(zone->o_trans, "base/theme/transitions", buff);
|
||||
edje_object_signal_callback_add(zone->o_trans, "e,state,done", "*",
|
||||
_e_bg_signal, zone);
|
||||
evas_object_move(zone->o_trans, zone->x, zone->y);
|
||||
evas_object_resize(zone->o_trans, zone->w, zone->h);
|
||||
evas_object_layer_set(zone->o_trans, -1);
|
||||
evas_object_clip_set(zone->o_trans, zone->o_bg_clip);
|
||||
evas_object_show(zone->o_trans);
|
||||
}
|
||||
|
||||
if (eina_str_has_extension(bgfile, ".edj"))
|
||||
{
|
||||
zone->o_bg = edje_object_add(zone->container->bg_evas);
|
||||
evas_object_move(zone->o_bg, zone->x, zone->y);
|
||||
evas_object_resize(zone->o_bg, zone->w, zone->h);
|
||||
evas_object_data_set(zone->o_bg, "e_zone", zone);
|
||||
edje_object_file_set(zone->o_bg, bgfile, "e/desktop/background");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
if (transition == E_BG_TRANSITION_NONE)
|
||||
{
|
||||
evas_object_move(zone->o_bg, zone->x, zone->y);
|
||||
evas_object_resize(zone->o_bg, zone->w, zone->h);
|
||||
evas_object_layer_set(zone->o_bg, -1);
|
||||
}
|
||||
evas_object_clip_set(zone->o_bg, zone->o_bg_clip);
|
||||
evas_object_show(zone->o_bg);
|
||||
|
||||
if (transition != E_BG_TRANSITION_NONE)
|
||||
{
|
||||
edje_extern_object_max_size_set(zone->o_prev_bg, 65536, 65536);
|
||||
edje_extern_object_min_size_set(zone->o_prev_bg, 0, 0);
|
||||
edje_object_part_swallow(zone->o_trans, "e.swallow.bg.old",
|
||||
zone->o_prev_bg);
|
||||
edje_extern_object_max_size_set(zone->o_bg, 65536, 65536);
|
||||
edje_extern_object_min_size_set(zone->o_bg, 0, 0);
|
||||
edje_object_part_swallow(zone->o_trans, "e.swallow.bg.new",
|
||||
zone->o_bg);
|
||||
edje_object_signal_emit(zone->o_trans, "e,action,start", "e");
|
||||
}
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
e_bg_file_get(int con_num, int zone_num, int desk_x, int desk_y)
|
||||
{
|
||||
const E_Config_Desktop_Background *cfbg;
|
||||
Eina_List *l, *entries;
|
||||
const char *bgfile = "";
|
||||
char *entry;
|
||||
Eina_Bool ok = EINA_FALSE;
|
||||
|
||||
cfbg = e_bg_config_get(con_num, zone_num, desk_x, desk_y);
|
||||
|
||||
/* fall back to default */
|
||||
if (cfbg)
|
||||
{
|
||||
bgfile = cfbg->file;
|
||||
if (bgfile)
|
||||
{
|
||||
if (bgfile[0] != '/')
|
||||
{
|
||||
const char *bf;
|
||||
|
||||
bf = e_path_find(path_backgrounds, bgfile);
|
||||
if (bf) bgfile = bf;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bgfile = e_config->desktop_default_background;
|
||||
if (bgfile)
|
||||
{
|
||||
if (bgfile[0] != '/')
|
||||
{
|
||||
const char *bf;
|
||||
|
||||
bf = e_path_find(path_backgrounds, bgfile);
|
||||
if (bf) bgfile = bf;
|
||||
}
|
||||
}
|
||||
if ((bgfile) && (eina_str_has_extension(bgfile, ".edj")))
|
||||
{
|
||||
entries = edje_file_collection_list(bgfile);
|
||||
if (entries)
|
||||
{
|
||||
EINA_LIST_FOREACH(entries, l, entry)
|
||||
{
|
||||
if (!strcmp(entry, "e/desktop/background"))
|
||||
{
|
||||
ok = EINA_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
edje_file_collection_list_free(entries);
|
||||
}
|
||||
}
|
||||
else if ((bgfile) && (bgfile[0]))
|
||||
ok = EINA_TRUE;
|
||||
|
||||
if (!ok)
|
||||
bgfile = e_theme_edje_file_get("base/theme/background",
|
||||
"e/desktop/background");
|
||||
}
|
||||
|
||||
return bgfile;
|
||||
}
|
||||
|
||||
EAPI const E_Config_Desktop_Background *
|
||||
e_bg_config_get(int con_num, int zone_num, int desk_x, int desk_y)
|
||||
{
|
||||
Eina_List *l, *ll, *entries;
|
||||
E_Config_Desktop_Background *bg = NULL, *cfbg = NULL;
|
||||
const char *bgfile = "";
|
||||
char *entry;
|
||||
int current_spec = 0; /* how specific the setting is - we want the least general one that applies */
|
||||
|
||||
/* look for desk specific background. */
|
||||
if ((con_num >= 0) || (zone_num >= 0) || (desk_x >= 0) || (desk_y >= 0))
|
||||
{
|
||||
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
|
||||
{
|
||||
int spec;
|
||||
|
||||
if (!cfbg) continue;
|
||||
spec = 0;
|
||||
if (cfbg->container == con_num) spec++;
|
||||
else if (cfbg->container >= 0) continue;
|
||||
if (cfbg->zone == zone_num) spec++;
|
||||
else if (cfbg->zone >= 0) continue;
|
||||
if (cfbg->desk_x == desk_x) spec++;
|
||||
else if (cfbg->desk_x >= 0) continue;
|
||||
if (cfbg->desk_y == desk_y) spec++;
|
||||
else if (cfbg->desk_y >= 0) continue;
|
||||
|
||||
if (spec <= current_spec) continue;
|
||||
bgfile = cfbg->file;
|
||||
if (bgfile)
|
||||
{
|
||||
if (bgfile[0] != '/')
|
||||
{
|
||||
const char *bf;
|
||||
|
||||
bf = e_path_find(path_backgrounds, bgfile);
|
||||
if (bf) bgfile = bf;
|
||||
}
|
||||
}
|
||||
if (eina_str_has_extension(bgfile, ".edj"))
|
||||
{
|
||||
entries = edje_file_collection_list(bgfile);
|
||||
if (entries)
|
||||
{
|
||||
EINA_LIST_FOREACH(entries, ll, entry)
|
||||
{
|
||||
if (!strcmp(entry, "e/desktop/background"))
|
||||
{
|
||||
bg = cfbg;
|
||||
current_spec = spec;
|
||||
}
|
||||
}
|
||||
edje_file_collection_list_free(entries);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bg = cfbg;
|
||||
current_spec = spec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bg;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bg_default_set(const char *file)
|
||||
{
|
||||
/* E_Event_Bg_Update *ev; */
|
||||
Eina_Bool changed;
|
||||
|
||||
file = eina_stringshare_add(file);
|
||||
changed = file != e_config->desktop_default_background;
|
||||
|
||||
if (!changed)
|
||||
{
|
||||
eina_stringshare_del(file);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e_config->desktop_default_background)
|
||||
{
|
||||
e_filereg_deregister(e_config->desktop_default_background);
|
||||
eina_stringshare_del(e_config->desktop_default_background);
|
||||
}
|
||||
|
||||
if (file)
|
||||
{
|
||||
e_filereg_register(file);
|
||||
e_config->desktop_default_background = file;
|
||||
}
|
||||
else
|
||||
e_config->desktop_default_background = NULL;
|
||||
|
||||
/* ev = E_NEW(E_Event_Bg_Update, 1); */
|
||||
/* ev->container = -1; */
|
||||
/* ev->zone = -1; */
|
||||
/* ev->desk_x = -1; */
|
||||
/* ev->desk_y = -1; */
|
||||
/* ecore_event_add(E_EVENT_BG_UPDATE, ev, _e_bg_event_bg_update_free, NULL); */
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bg_add(int con, int zone, int dx, int dy, const char *file)
|
||||
{
|
||||
const Eina_List *l;
|
||||
E_Config_Desktop_Background *cfbg;
|
||||
|
||||
file = eina_stringshare_add(file);
|
||||
|
||||
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
|
||||
{
|
||||
if ((cfbg) && (cfbg->container == con) && (cfbg->zone == zone) &&
|
||||
(cfbg->desk_x == dx) && (cfbg->desk_y == dy) &&
|
||||
(cfbg->file == file))
|
||||
{
|
||||
eina_stringshare_del(file);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
e_bg_del(con, zone, dx, dy);
|
||||
|
||||
cfbg = E_NEW(E_Config_Desktop_Background, 1);
|
||||
cfbg->container = con;
|
||||
cfbg->zone = zone;
|
||||
cfbg->desk_x = dx;
|
||||
cfbg->desk_y = dy;
|
||||
cfbg->file = file;
|
||||
e_config->desktop_backgrounds =
|
||||
eina_list_append(e_config->desktop_backgrounds, cfbg);
|
||||
|
||||
e_filereg_register(cfbg->file);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bg_del(int con, int zone, int dx, int dy)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Config_Desktop_Background *cfbg;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
|
||||
{
|
||||
if (!cfbg) continue;
|
||||
if ((cfbg->container == con) && (cfbg->zone == zone) &&
|
||||
(cfbg->desk_x == dx) && (cfbg->desk_y == dy))
|
||||
{
|
||||
e_config->desktop_backgrounds =
|
||||
eina_list_remove_list(e_config->desktop_backgrounds, l);
|
||||
e_filereg_deregister(cfbg->file);
|
||||
if (cfbg->file) eina_stringshare_del(cfbg->file);
|
||||
free(cfbg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_bg_update(void)
|
||||
{
|
||||
Eina_List *l, *ll, *lll;
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
E_Zone *zone;
|
||||
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
{
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
{
|
||||
EINA_LIST_FOREACH(con->zones, lll, zone)
|
||||
{
|
||||
e_zone_bg_reconfigure(zone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_bg_signal(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
||||
{
|
||||
E_Zone *zone;
|
||||
|
||||
zone = data;
|
||||
if (zone->o_prev_bg)
|
||||
{
|
||||
evas_object_del(zone->o_prev_bg);
|
||||
zone->o_prev_bg = NULL;
|
||||
}
|
||||
if (zone->o_trans)
|
||||
{
|
||||
evas_object_del(zone->o_trans);
|
||||
zone->o_trans = NULL;
|
||||
}
|
||||
evas_object_move(zone->o_bg, zone->x, zone->y);
|
||||
evas_object_resize(zone->o_bg, zone->w, zone->h);
|
||||
evas_object_layer_set(zone->o_bg, -1);
|
||||
evas_object_clip_set(zone->o_bg, zone->o_bg_clip);
|
||||
evas_object_show(zone->o_bg);
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_BG_TRANSITION_NONE,
|
||||
E_BG_TRANSITION_START,
|
||||
E_BG_TRANSITION_DESK,
|
||||
E_BG_TRANSITION_CHANGE
|
||||
} E_Bg_Transition;
|
||||
|
||||
#else
|
||||
# ifndef E_BG_H
|
||||
# define E_BG_H
|
||||
|
||||
extern EAPI int E_EVENT_BG_UPDATE;
|
||||
|
||||
EINTERN int e_bg_init(void);
|
||||
EINTERN int e_bg_shutdown(void);
|
||||
|
||||
EAPI void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition);
|
||||
EAPI const char *e_bg_file_get(int con_num, int zone_num, int desk_x, int desk_y);
|
||||
EAPI const E_Config_Desktop_Background *e_bg_config_get(int con_num, int zone_num, int desk_x, int desk_y);
|
||||
EAPI void e_bg_default_set(const char *file);
|
||||
EAPI void e_bg_add(int con, int zone, int dx, int dy, const char *file);
|
||||
EAPI void e_bg_del(int con, int zone, int dx, int dy);
|
||||
EAPI void e_bg_update(void);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,13 @@
|
|||
#include "e.h"
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_acpi_event_handle(E_Binding_Context ctxt __UNUSED__, E_Object *obj __UNUSED__, E_Event_Acpi *ev __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI E_Action *
|
||||
e_bindings_key_down_event_find(E_Binding_Context ctxt __UNUSED__, Ecore_Event_Key *ev)
|
||||
{
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef enum _E_Binding_Context
|
||||
{
|
||||
E_BINDING_CONTEXT_NONE,
|
||||
E_BINDING_CONTEXT_UNKNOWN,
|
||||
E_BINDING_CONTEXT_BORDER,
|
||||
E_BINDING_CONTEXT_ZONE,
|
||||
E_BINDING_CONTEXT_CONTAINER,
|
||||
E_BINDING_CONTEXT_MANAGER,
|
||||
E_BINDING_CONTEXT_MENU,
|
||||
E_BINDING_CONTEXT_WINLIST,
|
||||
E_BINDING_CONTEXT_POPUP,
|
||||
E_BINDING_CONTEXT_ANY
|
||||
} E_Binding_Context;
|
||||
|
||||
#else
|
||||
# ifndef E_BINDINGS_H
|
||||
# define E_BINDINGS_H
|
||||
|
||||
EAPI E_Action *e_bindings_acpi_event_handle(E_Binding_Context ctxt __UNUSED__, E_Object *obj __UNUSED__, E_Event_Acpi *ev __UNUSED__);
|
||||
EAPI E_Action *e_bindings_key_down_event_find(E_Binding_Context ctxt __UNUSED__, Ecore_Event_Key *ev);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
#include "e.h"
|
||||
|
||||
EAPI void
|
||||
e_border_uniconify(void *bd)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_border_unshade(void *bd, int dir)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_border_focus_set(void *bd, int focus, int set)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_border_desk_set(void *bd, E_Desk *desk)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
e_border_client_list(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef enum _E_Maximize
|
||||
{
|
||||
E_MAXIMIZE_NONE = 0x00000000,
|
||||
E_MAXIMIZE_FULLSCREEN = 0x00000001,
|
||||
E_MAXIMIZE_SMART = 0x00000002,
|
||||
E_MAXIMIZE_EXPAND = 0x00000003,
|
||||
E_MAXIMIZE_FILL = 0x00000004,
|
||||
E_MAXIMIZE_TYPE = 0x0000000f,
|
||||
E_MAXIMIZE_VERTICAL = 0x00000010,
|
||||
E_MAXIMIZE_HORIZONTAL = 0x00000020,
|
||||
E_MAXIMIZE_BOTH = 0x00000030,
|
||||
E_MAXIMIZE_DIRECTION = 0x000000f0
|
||||
} E_Maximize;
|
||||
|
||||
typedef enum _E_Window_Placement
|
||||
{
|
||||
E_WINDOW_PLACEMENT_SMART,
|
||||
E_WINDOW_PLACEMENT_ANTIGADGET,
|
||||
E_WINDOW_PLACEMENT_CURSOR,
|
||||
E_WINDOW_PLACEMENT_MANUAL
|
||||
} E_Window_Placement;
|
||||
|
||||
typedef struct _E_Border E_Border;
|
||||
|
||||
#else
|
||||
# ifndef E_BORDER_H
|
||||
# define E_BORDER_H
|
||||
|
||||
# define E_BORDER_TYPE 0xE0b01002
|
||||
|
||||
struct _E_Border
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
};
|
||||
|
||||
EAPI void e_border_uniconify(void *bd);
|
||||
EAPI void e_border_unshade(void *bd, int dir);
|
||||
EAPI void e_border_focus_set(void *bd, int focus, int set);
|
||||
EAPI void e_border_desk_set(void *bd, E_Desk *desk);
|
||||
|
||||
EAPI Eina_List *e_border_client_list(void);
|
||||
|
||||
EAPI void e_border_activate(E_Border *bd, Eina_Bool just_do_it);
|
||||
EAPI void e_border_raise(E_Border *bd);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,901 @@
|
|||
#include "e.h"
|
||||
|
||||
typedef struct _E_Smart_Data E_Smart_Data;
|
||||
typedef struct _E_Box_Item E_Box_Item;
|
||||
|
||||
struct _E_Smart_Data
|
||||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
Evas_Object *obj;
|
||||
Evas_Object *clip;
|
||||
int frozen;
|
||||
unsigned char changed : 1;
|
||||
unsigned char horizontal : 1;
|
||||
unsigned char homogenous : 1;
|
||||
E_Box_Item *items;
|
||||
unsigned int item_count;
|
||||
struct
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
} min, max;
|
||||
struct
|
||||
{
|
||||
double x, y;
|
||||
} align;
|
||||
};
|
||||
|
||||
struct _E_Box_Item
|
||||
{
|
||||
EINA_INLIST;
|
||||
E_Smart_Data *sd;
|
||||
unsigned char fill_w : 1;
|
||||
unsigned char fill_h : 1;
|
||||
unsigned char expand_w : 1;
|
||||
unsigned char expand_h : 1;
|
||||
struct
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
} min, max;
|
||||
struct
|
||||
{
|
||||
double x, y;
|
||||
} align;
|
||||
int x, y, w, h;
|
||||
Evas_Object *obj;
|
||||
};
|
||||
|
||||
/* local subsystem functions */
|
||||
static void _e_box_unpack_internal(E_Smart_Data *sd, E_Box_Item *bi);
|
||||
static E_Box_Item *_e_box_smart_adopt(E_Smart_Data *sd, Evas_Object *obj);
|
||||
static void _e_box_smart_disown(E_Box_Item *bi);
|
||||
static void _e_box_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _e_box_smart_reconfigure(E_Smart_Data *sd);
|
||||
static void _e_box_smart_extents_calculate(E_Smart_Data *sd);
|
||||
|
||||
static void _e_box_smart_init(void);
|
||||
static void _e_box_smart_add(Evas_Object *obj);
|
||||
static void _e_box_smart_del(Evas_Object *obj);
|
||||
static void _e_box_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
|
||||
static void _e_box_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
|
||||
static void _e_box_smart_show(Evas_Object *obj);
|
||||
static void _e_box_smart_hide(Evas_Object *obj);
|
||||
static void _e_box_smart_color_set(Evas_Object *obj, int r, int g, int b, int a);
|
||||
static void _e_box_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
|
||||
static void _e_box_smart_clip_unset(Evas_Object *obj);
|
||||
|
||||
/* local subsystem globals */
|
||||
static Evas_Smart *_e_smart = NULL;
|
||||
|
||||
static inline Evas_Object *
|
||||
_e_box_item_object_get(E_Box_Item *bi)
|
||||
{
|
||||
if (!bi) return NULL;
|
||||
return bi->obj;
|
||||
}
|
||||
|
||||
static inline Evas_Object *
|
||||
_e_box_item_nth_get(E_Smart_Data *sd, unsigned int n)
|
||||
{
|
||||
unsigned int x;
|
||||
E_Box_Item *bi;
|
||||
|
||||
if (!sd->items) return NULL;
|
||||
if (n > sd->item_count / 2)
|
||||
{
|
||||
x = sd->item_count - 1;
|
||||
EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (n == x) return bi->obj;
|
||||
x--;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
x = 0;
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (n == x) return bi->obj;
|
||||
x++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* externally accessible functions */
|
||||
EAPI Evas_Object *
|
||||
e_box_add(Evas *evas)
|
||||
{
|
||||
_e_box_smart_init();
|
||||
return evas_object_smart_add(evas, _e_smart);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_freeze(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return 0;
|
||||
sd->frozen++;
|
||||
return sd->frozen;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_thaw(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return 0;
|
||||
sd->frozen--;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
return sd->frozen;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_orientation_set(Evas_Object *obj, int horizontal)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR();
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (sd->horizontal == horizontal) return;
|
||||
sd->horizontal = horizontal;
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_orientation_get(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return 0;
|
||||
return sd->horizontal;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_homogenous_set(Evas_Object *obj, int homogenous)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR();
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (sd->homogenous == homogenous) return;
|
||||
sd->homogenous = homogenous;
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_pack_start(Evas_Object *obj, Evas_Object *child)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
E_Box_Item *bi;
|
||||
Eina_Inlist *l;
|
||||
|
||||
if (!child) return 0;
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return 0;
|
||||
bi = _e_box_smart_adopt(sd, child);
|
||||
l = EINA_INLIST_GET(sd->items);
|
||||
l = eina_inlist_prepend(l, EINA_INLIST_GET(bi));
|
||||
sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item);
|
||||
sd->item_count++;
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_pack_end(Evas_Object *obj, Evas_Object *child)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
E_Box_Item *bi;
|
||||
Eina_Inlist *l;
|
||||
|
||||
if (!child) return 0;
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return 0;
|
||||
bi = _e_box_smart_adopt(sd, child);
|
||||
l = EINA_INLIST_GET(sd->items);
|
||||
l = eina_inlist_append(l, EINA_INLIST_GET(bi));
|
||||
sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item);
|
||||
sd->item_count++;
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
return sd->item_count - 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
E_Box_Item *bi, *bi2;
|
||||
int i = 0;
|
||||
Eina_Inlist *l;
|
||||
|
||||
if (!child) return 0;
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return 0;
|
||||
bi2 = evas_object_data_get(before, "e_box_data");
|
||||
if (!bi2) return 0;
|
||||
bi = _e_box_smart_adopt(sd, child);
|
||||
l = EINA_INLIST_GET(sd->items);
|
||||
l = eina_inlist_prepend_relative(l, EINA_INLIST_GET(bi), EINA_INLIST_GET(bi2));
|
||||
sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item);
|
||||
sd->item_count++;
|
||||
|
||||
for (l = EINA_INLIST_GET(bi)->prev; l; l = l->prev)
|
||||
i++;
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
return i;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
E_Box_Item *bi, *bi2;
|
||||
int i = 0;
|
||||
Eina_Inlist *l;
|
||||
|
||||
if (!child) return 0;
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return 0;
|
||||
bi2 = evas_object_data_get(after, "e_box_data");
|
||||
if (!bi2) return 0;
|
||||
bi = _e_box_smart_adopt(sd, child);
|
||||
l = EINA_INLIST_GET(sd->items);
|
||||
l = eina_inlist_append_relative(l, EINA_INLIST_GET(bi), EINA_INLIST_GET(bi2));
|
||||
sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item);
|
||||
sd->item_count++;
|
||||
for (l = EINA_INLIST_GET(bi)->prev; l; l = l->prev)
|
||||
i++;
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
return i;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_box_pack_count_get(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
|
||||
if (!sd) return 0;
|
||||
return sd->item_count;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_box_pack_object_nth(Evas_Object *obj, int n)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(NULL);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return NULL;
|
||||
return _e_box_item_nth_get(sd, n);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_box_pack_object_first(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(NULL);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return NULL;
|
||||
return sd->items ? sd->items->obj : NULL;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_box_pack_object_last(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(NULL);
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if ((!sd) || (!sd->items)) return NULL;
|
||||
return EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(sd->items)->last, E_Box_Item)->obj;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_pack_options_set(Evas_Object *obj, int fill_w, int fill_h, int expand_w, int expand_h, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h)
|
||||
{
|
||||
E_Box_Item *bi;
|
||||
|
||||
bi = evas_object_data_get(obj, "e_box_data");
|
||||
if (!bi) return;
|
||||
bi->fill_w = fill_w;
|
||||
bi->fill_h = fill_h;
|
||||
bi->expand_w = expand_w;
|
||||
bi->expand_h = expand_h;
|
||||
bi->align.x = align_x;
|
||||
bi->align.y = align_y;
|
||||
bi->min.w = min_w;
|
||||
bi->min.h = min_h;
|
||||
bi->max.w = max_w;
|
||||
bi->max.h = max_h;
|
||||
bi->sd->changed = 1;
|
||||
if (bi->sd->frozen <= 0) _e_box_smart_reconfigure(bi->sd);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_unpack(Evas_Object *obj)
|
||||
{
|
||||
E_Box_Item *bi;
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (!obj) return;
|
||||
bi = evas_object_data_get(obj, "e_box_data");
|
||||
if (!bi) return;
|
||||
sd = bi->sd;
|
||||
if (!sd) return;
|
||||
_e_box_unpack_internal(sd, bi);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR();
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (sd->changed) _e_box_smart_extents_calculate(sd);
|
||||
if (minw) *minw = sd->min.w;
|
||||
if (minh) *minh = sd->min.h;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR();
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (sd->changed) _e_box_smart_extents_calculate(sd);
|
||||
if (maxw) *maxw = sd->max.w;
|
||||
if (maxh) *maxh = sd->max.h;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_align_get(Evas_Object *obj, double *ax, double *ay)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR();
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (ax) *ax = sd->align.x;
|
||||
if (ay) *ay = sd->align.y;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_box_align_set(Evas_Object *obj, double ax, double ay)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR();
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if ((sd->align.x == ax) && (sd->align.y == ay)) return;
|
||||
sd->align.x = ax;
|
||||
sd->align.y = ay;
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the number of pixels that are hidden on the left/top side.
|
||||
*/
|
||||
EAPI void
|
||||
e_box_align_pixel_offset_get(Evas_Object *obj, int *x, int *y)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR();
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (x) *x = (sd->min.w - sd->w) * (1.0 - sd->align.x);
|
||||
if (y) *y = (sd->min.h - sd->h) * (1.0 - sd->align.y);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_box_item_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
E_Box_Item *bi;
|
||||
|
||||
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR() NULL;
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return NULL;
|
||||
if (!E_INSIDE(x, y, sd->x, sd->y, sd->w, sd->h)) return NULL;
|
||||
if (sd->horizontal)
|
||||
{
|
||||
if (x < sd->w / 2)
|
||||
{
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (y < sd->h / 2)
|
||||
{
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_box_item_size_get(Evas_Object *obj, int *w, int *h)
|
||||
{
|
||||
E_Box_Item *bi;
|
||||
|
||||
bi = evas_object_data_get(obj, "e_box_data");
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(bi, EINA_FALSE);
|
||||
if (w) *w = bi->w;
|
||||
if (h) *h = bi->h;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
static void
|
||||
_e_box_unpack_internal(E_Smart_Data *sd, E_Box_Item *bi)
|
||||
{
|
||||
Eina_Inlist *l;
|
||||
|
||||
l = EINA_INLIST_GET(sd->items);
|
||||
l = eina_inlist_remove(l, EINA_INLIST_GET(bi));
|
||||
sd->items = EINA_INLIST_CONTAINER_GET(l, E_Box_Item);
|
||||
sd->item_count--;
|
||||
_e_box_smart_disown(bi);
|
||||
sd->changed = 1;
|
||||
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
|
||||
}
|
||||
|
||||
static E_Box_Item *
|
||||
_e_box_smart_adopt(E_Smart_Data *sd, Evas_Object *obj)
|
||||
{
|
||||
E_Box_Item *bi;
|
||||
|
||||
bi = calloc(1, sizeof(E_Box_Item));
|
||||
if (!bi) return NULL;
|
||||
bi->sd = sd;
|
||||
bi->obj = obj;
|
||||
/* defaults */
|
||||
bi->fill_w = 0;
|
||||
bi->fill_h = 0;
|
||||
bi->expand_w = 0;
|
||||
bi->expand_h = 0;
|
||||
bi->align.x = 0.5;
|
||||
bi->align.y = 0.5;
|
||||
bi->min.w = 0;
|
||||
bi->min.h = 0;
|
||||
bi->max.w = 0;
|
||||
bi->max.h = 0;
|
||||
evas_object_clip_set(obj, sd->clip);
|
||||
evas_object_smart_member_add(obj, bi->sd->obj);
|
||||
evas_object_data_set(obj, "e_box_data", bi);
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE,
|
||||
_e_box_smart_item_del_hook, NULL);
|
||||
if ((!evas_object_visible_get(sd->clip)) &&
|
||||
(evas_object_visible_get(sd->obj)))
|
||||
evas_object_show(sd->clip);
|
||||
return bi;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_disown(E_Box_Item *bi)
|
||||
{
|
||||
if (!bi) return;
|
||||
if (!bi->sd->items)
|
||||
{
|
||||
if (evas_object_visible_get(bi->sd->clip))
|
||||
evas_object_hide(bi->sd->clip);
|
||||
}
|
||||
evas_object_event_callback_del(bi->obj,
|
||||
EVAS_CALLBACK_FREE,
|
||||
_e_box_smart_item_del_hook);
|
||||
evas_object_smart_member_del(bi->obj);
|
||||
evas_object_clip_unset(bi->obj);
|
||||
evas_object_data_del(bi->obj, "e_box_data");
|
||||
free(bi);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_item_del_hook(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
e_box_unpack(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_reconfigure(E_Smart_Data *sd)
|
||||
{
|
||||
Evas_Coord x, y, w, h, xx, yy;
|
||||
E_Box_Item *bi;
|
||||
int minw, minh, wdif, hdif;
|
||||
int count, expand;
|
||||
|
||||
if (!sd->changed) return;
|
||||
|
||||
x = sd->x;
|
||||
y = sd->y;
|
||||
w = sd->w;
|
||||
h = sd->h;
|
||||
|
||||
_e_box_smart_extents_calculate(sd);
|
||||
minw = sd->min.w;
|
||||
minh = sd->min.h;
|
||||
count = sd->item_count;
|
||||
expand = 0;
|
||||
if (w < minw)
|
||||
{
|
||||
x = x + ((w - minw) * (1.0 - sd->align.x));
|
||||
w = minw;
|
||||
}
|
||||
if (h < minh)
|
||||
{
|
||||
y = y + ((h - minh) * (1.0 - sd->align.y));
|
||||
h = minh;
|
||||
}
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (sd->horizontal)
|
||||
{
|
||||
if (bi->expand_w) expand++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bi->expand_h) expand++;
|
||||
}
|
||||
}
|
||||
if (expand == 0)
|
||||
{
|
||||
if (sd->horizontal)
|
||||
{
|
||||
x += (double)(w - minw) * sd->align.x;
|
||||
w = minw;
|
||||
}
|
||||
else
|
||||
{
|
||||
y += (double)(h - minh) * sd->align.y;
|
||||
h = minh;
|
||||
}
|
||||
}
|
||||
wdif = w - minw;
|
||||
hdif = h - minh;
|
||||
xx = x;
|
||||
yy = y;
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (sd->horizontal)
|
||||
{
|
||||
if (sd->homogenous)
|
||||
{
|
||||
Evas_Coord ww, hh, ow, oh;
|
||||
|
||||
ww = (w / (Evas_Coord)count);
|
||||
hh = h;
|
||||
ow = bi->min.w;
|
||||
if (bi->fill_w) ow = ww;
|
||||
if ((bi->max.w >= 0) && (bi->max.w < ow))
|
||||
ow = bi->max.w;
|
||||
oh = bi->min.h;
|
||||
if (bi->fill_h) oh = hh;
|
||||
if ((bi->max.h >= 0) && (bi->max.h < oh))
|
||||
oh = bi->max.h;
|
||||
bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x);
|
||||
bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y);
|
||||
evas_object_move(bi->obj, bi->x, bi->y);
|
||||
evas_object_resize(bi->obj, bi->w = ow, bi->h = oh);
|
||||
xx += ww;
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Coord ww, hh, ow, oh;
|
||||
|
||||
ww = bi->min.w;
|
||||
if ((expand > 0) && (bi->expand_w))
|
||||
{
|
||||
if (expand == 1) ow = wdif;
|
||||
else ow = (w - minw) / expand;
|
||||
wdif -= ow;
|
||||
ww += ow;
|
||||
}
|
||||
hh = h;
|
||||
ow = bi->min.w;
|
||||
if (bi->fill_w) ow = ww;
|
||||
if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w;
|
||||
oh = bi->min.h;
|
||||
if (bi->fill_h) oh = hh;
|
||||
if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h;
|
||||
bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x);
|
||||
bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y);
|
||||
evas_object_move(bi->obj, bi->x, bi->y);
|
||||
evas_object_resize(bi->obj, bi->w = ow, bi->h = oh);
|
||||
xx += ww;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sd->homogenous)
|
||||
{
|
||||
Evas_Coord ww, hh, ow, oh;
|
||||
|
||||
ww = w;
|
||||
hh = (h / (Evas_Coord)count);
|
||||
ow = bi->min.w;
|
||||
if (bi->fill_w) ow = ww;
|
||||
if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w;
|
||||
oh = bi->min.h;
|
||||
if (bi->fill_h) oh = hh;
|
||||
if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h;
|
||||
bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x);
|
||||
bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y);
|
||||
evas_object_move(bi->obj, bi->x, bi->y);
|
||||
evas_object_resize(bi->obj, bi->w = ow, bi->h = oh);
|
||||
yy += hh;
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Coord ww, hh, ow, oh;
|
||||
|
||||
ww = w;
|
||||
hh = bi->min.h;
|
||||
if ((expand > 0) && (bi->expand_h))
|
||||
{
|
||||
if (expand == 1) oh = hdif;
|
||||
else oh = (h - minh) / expand;
|
||||
hdif -= oh;
|
||||
hh += oh;
|
||||
}
|
||||
ow = bi->min.w;
|
||||
if (bi->fill_w) ow = ww;
|
||||
if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w;
|
||||
oh = bi->min.h;
|
||||
if (bi->fill_h) oh = hh;
|
||||
if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h;
|
||||
bi->x = xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x);
|
||||
bi->y = yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y);
|
||||
evas_object_move(bi->obj, bi->x, bi->y);
|
||||
evas_object_resize(bi->obj, bi->w = ow, bi->h = oh);
|
||||
yy += hh;
|
||||
}
|
||||
}
|
||||
}
|
||||
sd->changed = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_extents_calculate(E_Smart_Data *sd)
|
||||
{
|
||||
E_Box_Item *bi;
|
||||
int minw, minh;
|
||||
|
||||
/* FIXME: need to calc max */
|
||||
sd->max.w = -1; /* max < 0 == unlimited */
|
||||
sd->max.h = -1;
|
||||
|
||||
minw = 0;
|
||||
minh = 0;
|
||||
if (sd->homogenous)
|
||||
{
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (minh < bi->min.h) minh = bi->min.h;
|
||||
if (minw < bi->min.w) minw = bi->min.w;
|
||||
}
|
||||
if (sd->horizontal)
|
||||
minw *= sd->item_count;
|
||||
else
|
||||
minh *= sd->item_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
if (sd->horizontal)
|
||||
{
|
||||
if (minh < bi->min.h) minh = bi->min.h;
|
||||
minw += bi->min.w;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minw < bi->min.w) minw = bi->min.w;
|
||||
minh += bi->min.h;
|
||||
}
|
||||
}
|
||||
}
|
||||
sd->min.w = minw;
|
||||
sd->min.h = minh;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_init(void)
|
||||
{
|
||||
if (_e_smart) return;
|
||||
{
|
||||
static const Evas_Smart_Class sc =
|
||||
{
|
||||
"e_box",
|
||||
EVAS_SMART_CLASS_VERSION,
|
||||
_e_box_smart_add,
|
||||
_e_box_smart_del,
|
||||
_e_box_smart_move,
|
||||
_e_box_smart_resize,
|
||||
_e_box_smart_show,
|
||||
_e_box_smart_hide,
|
||||
_e_box_smart_color_set,
|
||||
_e_box_smart_clip_set,
|
||||
_e_box_smart_clip_unset,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
_e_smart = evas_smart_class_new(&sc);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_add(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = calloc(1, sizeof(E_Smart_Data));
|
||||
if (!sd) return;
|
||||
sd->obj = obj;
|
||||
sd->x = 0;
|
||||
sd->y = 0;
|
||||
sd->w = 0;
|
||||
sd->h = 0;
|
||||
sd->align.x = 0.5;
|
||||
sd->align.y = 0.5;
|
||||
sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
|
||||
evas_object_smart_member_add(sd->clip, obj);
|
||||
evas_object_move(sd->clip, -100004, -100004);
|
||||
evas_object_resize(sd->clip, 200008, 200008);
|
||||
evas_object_color_set(sd->clip, 255, 255, 255, 255);
|
||||
evas_object_smart_data_set(obj, sd);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_del(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
/* FIXME: this gets into an infinite loop when changin basic->advanced on
|
||||
* ibar config dialog
|
||||
*/
|
||||
e_box_freeze(obj);
|
||||
while (sd->items)
|
||||
e_box_unpack(sd->items->obj);
|
||||
e_box_thaw(obj);
|
||||
evas_object_del(sd->clip);
|
||||
free(sd);
|
||||
|
||||
evas_object_smart_data_set(obj, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
E_Box_Item *bi;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if ((x == sd->x) && (y == sd->y)) return;
|
||||
{
|
||||
Evas_Coord dx, dy;
|
||||
|
||||
dx = x - sd->x;
|
||||
dy = y - sd->y;
|
||||
EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi)
|
||||
{
|
||||
bi->x += dx;
|
||||
bi->y += dy;
|
||||
evas_object_move(bi->obj, bi->x, bi->y);
|
||||
}
|
||||
}
|
||||
sd->x = x;
|
||||
sd->y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if ((w == sd->w) && (h == sd->h)) return;
|
||||
sd->w = w;
|
||||
sd->h = h;
|
||||
sd->changed = 1;
|
||||
_e_box_smart_reconfigure(sd);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_show(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
if (sd->items) evas_object_show(sd->clip);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_hide(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_hide(sd->clip);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_color_set(sd->clip, r, g, b, a);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_clip_set(Evas_Object *obj, Evas_Object *clip)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_clip_set(sd->clip, clip);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_box_smart_clip_unset(Evas_Object *obj)
|
||||
{
|
||||
E_Smart_Data *sd;
|
||||
|
||||
sd = evas_object_smart_data_get(obj);
|
||||
if (!sd) return;
|
||||
evas_object_clip_unset(sd->clip);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
#else
|
||||
#ifndef E_BOX_H
|
||||
#define E_BOX_H
|
||||
|
||||
EAPI Evas_Object *e_box_add (Evas *evas);
|
||||
EAPI int e_box_freeze (Evas_Object *obj);
|
||||
EAPI int e_box_thaw (Evas_Object *obj);
|
||||
EAPI void e_box_orientation_set (Evas_Object *obj, int horizontal);
|
||||
EAPI int e_box_orientation_get (Evas_Object *obj);
|
||||
EAPI void e_box_homogenous_set (Evas_Object *obj, int homogenous);
|
||||
EAPI int e_box_pack_start (Evas_Object *obj, Evas_Object *child);
|
||||
EAPI int e_box_pack_end (Evas_Object *obj, Evas_Object *child);
|
||||
EAPI int e_box_pack_before (Evas_Object *obj, Evas_Object *child, Evas_Object *before);
|
||||
EAPI int e_box_pack_after (Evas_Object *obj, Evas_Object *child, Evas_Object *after);
|
||||
EAPI int e_box_pack_count_get (Evas_Object *obj);
|
||||
EAPI Evas_Object *e_box_pack_object_nth (Evas_Object *obj, int n);
|
||||
EAPI Evas_Object *e_box_pack_object_first (Evas_Object *obj);
|
||||
EAPI Evas_Object *e_box_pack_object_last (Evas_Object *obj);
|
||||
EAPI void e_box_pack_options_set (Evas_Object *obj, int fill_w, int fill_h, int expand_w, int expand_h, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h);
|
||||
EAPI void e_box_unpack (Evas_Object *obj);
|
||||
EAPI void e_box_size_min_get (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
|
||||
EAPI void e_box_size_max_get (Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh);
|
||||
EAPI void e_box_align_get (Evas_Object *obj, double *ax, double *ay);
|
||||
EAPI void e_box_align_set (Evas_Object *obj, double ax, double ay);
|
||||
EAPI void e_box_align_pixel_offset_get (Evas_Object *obj, int *x, int *y);
|
||||
EAPI Evas_Object *e_box_item_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
|
||||
EAPI Eina_Bool e_box_item_size_get(Evas_Object *obj, int *w, int *h);
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,93 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_buffer_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSED);
|
||||
static void _e_buffer_reference_cb_destroy(struct wl_listener *listener, void *data);
|
||||
|
||||
EAPI E_Buffer *
|
||||
e_buffer_resource_get(struct wl_resource *resource)
|
||||
{
|
||||
E_Buffer *buffer;
|
||||
struct wl_listener *listener;
|
||||
|
||||
listener = wl_resource_get_destroy_listener(resource, _e_buffer_cb_destroy);
|
||||
if (listener)
|
||||
buffer = container_of(listener, E_Buffer, buffer_destroy);
|
||||
else
|
||||
{
|
||||
if (!(buffer = E_NEW_RAW(E_Buffer, 1)))
|
||||
return NULL;
|
||||
|
||||
buffer->w = 0;
|
||||
buffer->h = 0;
|
||||
buffer->wl.resource = resource;
|
||||
wl_signal_init(&buffer->signals.destroy);
|
||||
buffer->buffer_destroy.notify = _e_buffer_cb_destroy;
|
||||
wl_resource_add_destroy_listener(resource, &buffer->buffer_destroy);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_buffer_reference(E_Buffer_Reference *br, E_Buffer *buffer)
|
||||
{
|
||||
/* check for valid buffer reference */
|
||||
if (!br) return;
|
||||
|
||||
/* check if the new buffer is difference than the one we already have
|
||||
* referenced */
|
||||
if ((br->buffer) && (br->buffer != buffer))
|
||||
{
|
||||
br->buffer->busy_count--;
|
||||
if (br->buffer->busy_count == 0)
|
||||
{
|
||||
/* queue a release event */
|
||||
wl_resource_queue_event(br->buffer->wl.resource,
|
||||
WL_BUFFER_RELEASE);
|
||||
}
|
||||
|
||||
/* remove any existing destroy listener */
|
||||
wl_list_remove(&br->buffer_destroy.link);
|
||||
}
|
||||
|
||||
/* if we have a valid buffer, reference it */
|
||||
if ((buffer) && (br->buffer != buffer))
|
||||
{
|
||||
buffer->busy_count++;
|
||||
|
||||
/* setup destroy listener */
|
||||
wl_signal_add(&buffer->signals.destroy, &br->buffer_destroy);
|
||||
}
|
||||
|
||||
br->buffer = buffer;
|
||||
br->buffer_destroy.notify = _e_buffer_reference_cb_destroy;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_buffer_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSED)
|
||||
{
|
||||
E_Buffer *buffer;
|
||||
|
||||
/* try to get the buffer_reference structure from the listener */
|
||||
if (!(buffer = container_of(listener, E_Buffer, buffer_destroy)))
|
||||
return;
|
||||
|
||||
wl_signal_emit(&buffer->signals.destroy, buffer);
|
||||
|
||||
E_FREE(buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_buffer_reference_cb_destroy(struct wl_listener *listener, void *data)
|
||||
{
|
||||
E_Buffer_Reference *br;
|
||||
|
||||
if (!(br = container_of(listener, E_Buffer_Reference, buffer_destroy)))
|
||||
return;
|
||||
|
||||
if ((E_Buffer *)data != br->buffer) return;
|
||||
|
||||
br->buffer = NULL;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Buffer E_Buffer;
|
||||
typedef struct _E_Buffer_Reference E_Buffer_Reference;
|
||||
|
||||
#else
|
||||
# ifndef E_BUFFER_H
|
||||
# define E_BUFFER_H
|
||||
|
||||
struct _E_Buffer
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
} wl;
|
||||
|
||||
struct
|
||||
{
|
||||
struct wl_signal destroy;
|
||||
} signals;
|
||||
|
||||
struct wl_listener buffer_destroy;
|
||||
|
||||
union
|
||||
{
|
||||
struct wl_shm_buffer *shm_buffer;
|
||||
void *legacy_buffer;
|
||||
};
|
||||
|
||||
Evas_Coord w, h;
|
||||
unsigned int busy_count;
|
||||
};
|
||||
|
||||
struct _E_Buffer_Reference
|
||||
{
|
||||
E_Buffer *buffer;
|
||||
struct wl_listener buffer_destroy;
|
||||
};
|
||||
|
||||
EAPI E_Buffer *e_buffer_resource_get(struct wl_resource *resource);
|
||||
EAPI void e_buffer_reference(E_Buffer_Reference *br, E_Buffer *buffer);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,181 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static Eina_Bool _e_canvas_cb_flush(void *data);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *_e_canvases = NULL;
|
||||
static Ecore_Poller *_e_canvas_cache_flush_poller = NULL;
|
||||
|
||||
/* externally accessible functions */
|
||||
EAPI void
|
||||
e_canvas_add(Ecore_Evas *ee)
|
||||
{
|
||||
Evas *e;
|
||||
|
||||
_e_canvases = eina_list_prepend(_e_canvases, ee);
|
||||
e = ecore_evas_get(ee);
|
||||
evas_image_cache_set(e, e_config->image_cache * 1024);
|
||||
evas_font_cache_set(e, e_config->font_cache * 1024);
|
||||
e_path_evas_append(path_fonts, e);
|
||||
if (e_config->font_hinting == 0)
|
||||
{
|
||||
if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_BYTECODE))
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_BYTECODE);
|
||||
else if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_AUTO))
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_AUTO);
|
||||
else
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
|
||||
}
|
||||
else if (e_config->font_hinting == 1)
|
||||
{
|
||||
if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_AUTO))
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_AUTO);
|
||||
else
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
|
||||
}
|
||||
else if (e_config->font_hinting == 2)
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_canvas_del(Ecore_Evas *ee)
|
||||
{
|
||||
_e_canvases = eina_list_remove(_e_canvases, ee);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_canvas_recache(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
EINA_LIST_FOREACH(_e_canvases, l, ee)
|
||||
{
|
||||
Evas *e;
|
||||
|
||||
e = ecore_evas_get(ee);
|
||||
evas_image_cache_set(e, e_config->image_cache * 1024);
|
||||
evas_font_cache_set(e, e_config->font_cache * 1024);
|
||||
}
|
||||
edje_file_cache_set(e_config->edje_cache);
|
||||
edje_collection_cache_set(e_config->edje_collection_cache);
|
||||
if (_e_canvas_cache_flush_poller)
|
||||
{
|
||||
ecore_poller_del(_e_canvas_cache_flush_poller);
|
||||
_e_canvas_cache_flush_poller = NULL;
|
||||
}
|
||||
if (e_config->cache_flush_poll_interval > 0)
|
||||
{
|
||||
_e_canvas_cache_flush_poller =
|
||||
ecore_poller_add(ECORE_POLLER_CORE,
|
||||
e_config->cache_flush_poll_interval,
|
||||
_e_canvas_cb_flush, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_canvas_cache_flush(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
EINA_LIST_FOREACH(_e_canvases, l, ee)
|
||||
{
|
||||
Evas *e;
|
||||
|
||||
e = ecore_evas_get(ee);
|
||||
evas_image_cache_flush(e);
|
||||
evas_font_cache_flush(e);
|
||||
}
|
||||
edje_file_cache_flush();
|
||||
edje_collection_cache_flush();
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_canvas_cache_reload(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
EINA_LIST_FOREACH(_e_canvases, l, ee)
|
||||
{
|
||||
Evas *e;
|
||||
|
||||
e = ecore_evas_get(ee);
|
||||
evas_image_cache_reload(e);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_canvas_idle_flush(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
EINA_LIST_FOREACH(_e_canvases, l, ee)
|
||||
{
|
||||
Evas *e;
|
||||
|
||||
e = ecore_evas_get(ee);
|
||||
evas_render_idle_flush(e);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_canvas_rehint(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
EINA_LIST_FOREACH(_e_canvases, l, ee)
|
||||
{
|
||||
Evas *e;
|
||||
|
||||
e = ecore_evas_get(ee);
|
||||
if (e_config->font_hinting == 0)
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_BYTECODE);
|
||||
else if (e_config->font_hinting == 1)
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_AUTO);
|
||||
else if (e_config->font_hinting == 2)
|
||||
evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Ecore_Evas *
|
||||
e_canvas_new(unsigned int parent, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool override, Eina_Bool frame, Ecore_Wl_Window **win_ret)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
|
||||
/* #ifdef HAVE_WAYLAND_EGL */
|
||||
/* ee = ecore_evas_wayland_egl_new(NULL, parent, x, y, w, h, frame); */
|
||||
/* if (!ee) */
|
||||
/* #endif */
|
||||
ee = ecore_evas_wayland_shm_new(NULL, parent, x, y, w, h, frame);
|
||||
|
||||
if (!ee)
|
||||
{
|
||||
ERR("Impossible to build any Ecore_Evas window !!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ecore_evas_override_set(ee, override);
|
||||
if (win_ret) *win_ret = ecore_evas_wayland_window_get(ee);
|
||||
|
||||
return ee;
|
||||
}
|
||||
|
||||
EAPI const Eina_List *
|
||||
e_canvas_list(void)
|
||||
{
|
||||
return _e_canvases;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static Eina_Bool
|
||||
_e_canvas_cb_flush(void *data EINA_UNUSED)
|
||||
{
|
||||
e_canvas_cache_flush();
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
#else
|
||||
# ifndef E_CANVAS_H
|
||||
# define E_CANVAS_H
|
||||
|
||||
EAPI void e_canvas_add(Ecore_Evas *ee);
|
||||
EAPI void e_canvas_del(Ecore_Evas *ee);
|
||||
EAPI void e_canvas_recache(void);
|
||||
EAPI void e_canvas_cache_flush(void);
|
||||
EAPI void e_canvas_cache_reload(void);
|
||||
EAPI void e_canvas_idle_flush(void);
|
||||
EAPI void e_canvas_rehint(void);
|
||||
EAPI Ecore_Evas *e_canvas_new(unsigned int parent, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool override, Eina_Bool frame, Ecore_Wl_Window **win_ret);
|
||||
EAPI const Eina_List *e_canvas_list(void);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,561 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_comp_cb_bind(struct wl_client *client, void *data, unsigned int version EINA_UNUSED, unsigned int id);
|
||||
static void _e_comp_cb_bind_manager(struct wl_client *client, void *data EINA_UNUSED, unsigned int version EINA_UNUSED, unsigned int id);
|
||||
static void _e_comp_cb_surface_create(struct wl_client *client, struct wl_resource *resource, unsigned int id);
|
||||
static void _e_comp_cb_surface_destroy(struct wl_resource *resource);
|
||||
static void _e_comp_cb_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id);
|
||||
static void _e_comp_cb_region_destroy(struct wl_resource *resource);
|
||||
static Eina_Bool _e_comp_cb_read(void *data, Ecore_Fd_Handler *hdl EINA_UNUSED);
|
||||
static Eina_Bool _e_comp_cb_idle(void *data);
|
||||
|
||||
static void _e_comp_data_device_cb_get(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, unsigned int id, struct wl_resource *seat_resource);
|
||||
static void _e_comp_data_device_cb_unbind(struct wl_resource *resource);
|
||||
|
||||
static Eina_Bool _e_comp_xkb_init(E_Compositor *comp);
|
||||
|
||||
/* local interfaces */
|
||||
static const struct wl_compositor_interface _e_compositor_interface =
|
||||
{
|
||||
_e_comp_cb_surface_create,
|
||||
_e_comp_cb_region_create
|
||||
};
|
||||
|
||||
static const struct wl_data_device_manager_interface _e_manager_interface =
|
||||
{
|
||||
NULL, // create data source
|
||||
_e_comp_data_device_cb_get
|
||||
};
|
||||
|
||||
static const struct wl_data_device_interface _e_data_device_interface =
|
||||
{
|
||||
NULL, // start_drag
|
||||
NULL, // set_selection
|
||||
};
|
||||
|
||||
/* local variables */
|
||||
EAPI E_Compositor *_e_comp = NULL;
|
||||
|
||||
EINTERN int
|
||||
e_comp_init(void)
|
||||
{
|
||||
E_Module *mod = NULL;
|
||||
const char *modname;
|
||||
|
||||
/* NB: Basically, this function needs to load the appropriate
|
||||
* compositor module (drm, fb, x11, etc) */
|
||||
|
||||
if (getenv("DISPLAY"))
|
||||
modname = "wl_x11";
|
||||
else
|
||||
modname = "wl_drm";
|
||||
|
||||
if (!(mod = e_module_find(modname)))
|
||||
{
|
||||
if ((mod = e_module_new(modname)))
|
||||
{
|
||||
if (e_module_enable(mod))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_comp_shutdown(void)
|
||||
{
|
||||
E_Module *mod = NULL;
|
||||
const char *modname;
|
||||
|
||||
/* NB: This function needs to unload the compositor module */
|
||||
|
||||
if (getenv("DISPLAY"))
|
||||
modname = "wl_x11";
|
||||
else
|
||||
modname = "wl_drm";
|
||||
|
||||
if ((mod = e_module_find(modname)))
|
||||
e_module_disable(mod);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_compositor_init(E_Compositor *comp, void *display)
|
||||
{
|
||||
E_Plane *p;
|
||||
int fd = 0;
|
||||
|
||||
if (_e_comp)
|
||||
{
|
||||
ERR("Compositor already exists");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
/* try to create a wayland display */
|
||||
if (!(comp->wl.display = wl_display_create()))
|
||||
{
|
||||
ERR("Could not create a wayland display: %m");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
comp->output_pool = 0;
|
||||
|
||||
/* initialize signals */
|
||||
wl_signal_init(&comp->signals.destroy);
|
||||
wl_signal_init(&comp->signals.activate);
|
||||
wl_signal_init(&comp->signals.kill);
|
||||
wl_signal_init(&comp->signals.seat);
|
||||
|
||||
/* try to add the compositor to the displays global list */
|
||||
if (!wl_global_create(comp->wl.display, &wl_compositor_interface,
|
||||
3, comp, _e_comp_cb_bind))
|
||||
{
|
||||
ERR("Could not add compositor to globals: %m");
|
||||
goto global_err;
|
||||
}
|
||||
|
||||
/* initialize hardware plane */
|
||||
e_plane_init(&comp->plane, 0, 0);
|
||||
e_compositor_plane_stack(comp, &comp->plane, NULL);
|
||||
|
||||
/* init xkb */
|
||||
if (!_e_comp_xkb_init(comp))
|
||||
{
|
||||
ERR("Could not initialize xkb: %m");
|
||||
goto global_err;
|
||||
}
|
||||
|
||||
/* initialize the data device manager */
|
||||
if (!wl_global_create(comp->wl.display, &wl_data_device_manager_interface,
|
||||
1, NULL, _e_comp_cb_bind_manager))
|
||||
{
|
||||
ERR("Could not add data device manager to globals: %m");
|
||||
goto global_err;
|
||||
}
|
||||
|
||||
/* try to initialize the shm mechanism */
|
||||
if (wl_display_init_shm(comp->wl.display) < 0)
|
||||
ERR("Could not initialize SHM mechanism: %m");
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGL
|
||||
/* try to get the egl display
|
||||
*
|
||||
* NB: This is interesting....if we try to eglGetDisplay and pass in the
|
||||
* wayland display, then EGL fails due to XCB not owning the event queue.
|
||||
* If we pass it a NULL, it inits just fine
|
||||
*
|
||||
* NB: This is apparently a Mesa bug because it works now :/ Leaving this
|
||||
* note here in case it fails again in the future */
|
||||
comp->egl.display = eglGetDisplay((EGLNativeDisplayType)display);
|
||||
if (comp->egl.display == EGL_NO_DISPLAY)
|
||||
ERR("Could not get EGL display: %m");
|
||||
else
|
||||
{
|
||||
EGLint major, minor;
|
||||
|
||||
/* try to initialize EGL */
|
||||
if (!eglInitialize(comp->egl.display, &major, &minor))
|
||||
{
|
||||
ERR("Could not initialize EGL: %m");
|
||||
eglTerminate(comp->egl.display);
|
||||
eglReleaseThread();
|
||||
}
|
||||
else
|
||||
{
|
||||
EGLint n;
|
||||
EGLint attribs[] =
|
||||
{
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1,
|
||||
EGL_ALPHA_SIZE, 1, EGL_RENDERABLE_TYPE,
|
||||
EGL_OPENGL_ES2_BIT, EGL_NONE
|
||||
};
|
||||
|
||||
/* try to find a matching egl config */
|
||||
if ((!eglChooseConfig(comp->egl.display, attribs,
|
||||
&comp->egl.config, 1, &n) || (n == 0)))
|
||||
{
|
||||
ERR("Could not choose EGL config: %m");
|
||||
eglTerminate(comp->egl.display);
|
||||
eglReleaseThread();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* create the input loop */
|
||||
comp->wl.input_loop = wl_event_loop_create();
|
||||
|
||||
/* get the display event loop */
|
||||
comp->wl.loop = wl_display_get_event_loop(comp->wl.display);
|
||||
|
||||
/* get the event loop fd */
|
||||
fd = wl_event_loop_get_fd(comp->wl.loop);
|
||||
|
||||
/* add the event loop fd to main ecore */
|
||||
comp->fd_hdlr =
|
||||
ecore_main_fd_handler_add(fd, ECORE_FD_READ,
|
||||
_e_comp_cb_read, comp, NULL, NULL);
|
||||
|
||||
/* add an idler for flushing clients */
|
||||
comp->idler = ecore_idle_enterer_add(_e_comp_cb_idle, comp);
|
||||
|
||||
/* add the socket */
|
||||
if (wl_display_add_socket(comp->wl.display, NULL))
|
||||
{
|
||||
ERR("Failed to add socket: %m");
|
||||
goto sock_err;
|
||||
}
|
||||
|
||||
wl_event_loop_dispatch(comp->wl.loop, 0);
|
||||
|
||||
/* set a reference to the compositor */
|
||||
_e_comp = comp;
|
||||
|
||||
return EINA_TRUE;
|
||||
|
||||
sock_err:
|
||||
/* destroy the idler */
|
||||
if (comp->idler) ecore_idler_del(comp->idler);
|
||||
|
||||
/* destroy the fd handler */
|
||||
if (comp->fd_hdlr) ecore_main_fd_handler_del(comp->fd_hdlr);
|
||||
|
||||
/* destroy the input loop */
|
||||
if (comp->wl.input_loop) wl_event_loop_destroy(comp->wl.input_loop);
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGL
|
||||
/* destroy the egl display */
|
||||
if (comp->egl.display) eglTerminate(comp->egl.display);
|
||||
eglReleaseThread();
|
||||
#endif
|
||||
|
||||
/* free any planes */
|
||||
EINA_LIST_FREE(comp->planes, p)
|
||||
e_plane_shutdown(p);
|
||||
|
||||
global_err:
|
||||
/* destroy the previously created display */
|
||||
if (comp->wl.display) wl_display_destroy(comp->wl.display);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_compositor_shutdown(E_Compositor *comp)
|
||||
{
|
||||
E_Surface *es;
|
||||
E_Plane *p;
|
||||
|
||||
/* free any surfaces */
|
||||
EINA_LIST_FREE(comp->surfaces, es)
|
||||
e_surface_destroy(es);
|
||||
|
||||
/* free any planes */
|
||||
EINA_LIST_FREE(comp->planes, p)
|
||||
e_plane_shutdown(p);
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGL
|
||||
/* destroy the egl display */
|
||||
if (comp->egl.display) eglTerminate(comp->egl.display);
|
||||
eglReleaseThread();
|
||||
#endif
|
||||
|
||||
/* destroy the input loop */
|
||||
if (comp->wl.input_loop) wl_event_loop_destroy(comp->wl.input_loop);
|
||||
|
||||
/* destroy the fd handler */
|
||||
if (comp->fd_hdlr) ecore_main_fd_handler_del(comp->fd_hdlr);
|
||||
|
||||
/* destroy the previously created display */
|
||||
if (comp->wl.display) wl_display_terminate(comp->wl.display);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI E_Compositor *
|
||||
e_compositor_get(void)
|
||||
{
|
||||
return _e_comp;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_compositor_plane_stack(E_Compositor *comp, E_Plane *plane, E_Plane *above)
|
||||
{
|
||||
/* add this plane to the compositors list */
|
||||
comp->planes = eina_list_prepend_relative(comp->planes, plane, above);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_compositor_input_read(int fd EINA_UNUSED, unsigned int mask EINA_UNUSED, void *data)
|
||||
{
|
||||
E_Compositor *comp;
|
||||
|
||||
if (!(comp = data)) return 1;
|
||||
wl_event_loop_dispatch(comp->wl.input_loop, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_compositor_damage_calculate(E_Compositor *comp)
|
||||
{
|
||||
E_Plane *plane;
|
||||
E_Surface *es;
|
||||
Eina_List *l;
|
||||
pixman_region32_t clip, opaque;
|
||||
|
||||
/* check for valid compositor */
|
||||
if (!comp) return;
|
||||
|
||||
pixman_region32_init(&clip);
|
||||
|
||||
/* loop the planes */
|
||||
EINA_LIST_FOREACH(comp->planes, l, plane)
|
||||
{
|
||||
pixman_region32_copy(&plane->clip, &clip);
|
||||
|
||||
pixman_region32_init(&opaque);
|
||||
|
||||
/* loop the surfaces */
|
||||
EINA_LIST_FOREACH(comp->surfaces, l, es)
|
||||
{
|
||||
if (es->plane != plane) continue;
|
||||
e_surface_damage_calculate(es, &opaque);
|
||||
}
|
||||
|
||||
pixman_region32_union(&clip, &clip, &opaque);
|
||||
pixman_region32_fini(&opaque);
|
||||
}
|
||||
|
||||
pixman_region32_fini(&clip);
|
||||
|
||||
/* loop the surfaces */
|
||||
EINA_LIST_FOREACH(comp->surfaces, l, es)
|
||||
{
|
||||
if (!es->buffer.keep)
|
||||
e_buffer_reference(&es->buffer.reference, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI unsigned int
|
||||
e_compositor_get_time(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
|
||||
}
|
||||
|
||||
EAPI E_Surface *
|
||||
e_compositor_surface_find(E_Compositor *comp, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
E_Surface *es;
|
||||
Eina_List *l;
|
||||
|
||||
/* loop the surfaces and try to find one which has these
|
||||
* coordinates contained in it's input region */
|
||||
EINA_LIST_REVERSE_FOREACH(comp->surfaces, l, es)
|
||||
{
|
||||
if (pixman_region32_contains_point(&es->input, x, y, NULL))
|
||||
return es;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_compositor_repick(E_Compositor *comp)
|
||||
{
|
||||
E_Input *seat;
|
||||
Eina_List *l;
|
||||
|
||||
if (!comp->focus) return;
|
||||
EINA_LIST_FOREACH(comp->inputs, l, seat)
|
||||
e_input_repick(seat);
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_comp_cb_bind(struct wl_client *client, void *data, unsigned int version EINA_UNUSED, unsigned int id)
|
||||
{
|
||||
E_Compositor *comp;
|
||||
struct wl_resource *res;
|
||||
|
||||
if (!(comp = data)) return;
|
||||
|
||||
res = wl_resource_create(client, &wl_compositor_interface,
|
||||
MIN(version, 3), id);
|
||||
if (res)
|
||||
wl_resource_set_implementation(res, &_e_compositor_interface, comp, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_cb_bind_manager(struct wl_client *client, void *data EINA_UNUSED, unsigned int version EINA_UNUSED, unsigned int id)
|
||||
{
|
||||
struct wl_resource *res;
|
||||
|
||||
res = wl_resource_create(client, &wl_data_device_manager_interface, 1, id);
|
||||
if (res)
|
||||
wl_resource_set_implementation(res, &_e_manager_interface, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_cb_surface_create(struct wl_client *client, struct wl_resource *resource, unsigned int id)
|
||||
{
|
||||
E_Compositor *comp;
|
||||
E_Surface *es;
|
||||
|
||||
printf("Comp Surface Create: %d\n", id);
|
||||
|
||||
/* try to cast to our compositor */
|
||||
if (!(comp = resource->data)) return;
|
||||
|
||||
/* try to create a new surface */
|
||||
if (!(es = e_surface_new(client, resource, id)))
|
||||
{
|
||||
wl_resource_post_no_memory(resource);
|
||||
return;
|
||||
}
|
||||
|
||||
/* set destroy callback */
|
||||
wl_resource_set_destructor(es->wl.resource, _e_comp_cb_surface_destroy);
|
||||
|
||||
/* ask the renderer to create any internal representation of this surface
|
||||
* that it may need */
|
||||
if (!comp->renderer->surface_create(es))
|
||||
{
|
||||
e_surface_destroy(es);
|
||||
return;
|
||||
}
|
||||
|
||||
/* set surface plane to compositor primary plane */
|
||||
es->plane = &comp->plane;
|
||||
|
||||
printf("\tAdding Surface: %p\n", es);
|
||||
|
||||
/* add this surface to the compositors list */
|
||||
comp->surfaces = eina_list_append(comp->surfaces, es);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_cb_surface_destroy(struct wl_resource *resource)
|
||||
{
|
||||
E_Surface *es;
|
||||
|
||||
if (!(es = wl_resource_get_user_data(resource)))
|
||||
return;
|
||||
|
||||
printf("Surface Destroy: %p\n", es);
|
||||
|
||||
/* remove this surface from the compositor */
|
||||
_e_comp->surfaces = eina_list_remove(_e_comp->surfaces, es);
|
||||
|
||||
es->wl.resource = NULL;
|
||||
e_surface_destroy(es);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_cb_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id)
|
||||
{
|
||||
E_Compositor *comp;
|
||||
E_Region *reg;
|
||||
|
||||
/* try to cast to our compositor */
|
||||
if (!(comp = resource->data)) return;
|
||||
|
||||
/* try to create a new region */
|
||||
if (!(reg = e_region_new(client, id)))
|
||||
{
|
||||
wl_resource_post_no_memory(resource);
|
||||
return;
|
||||
}
|
||||
|
||||
wl_resource_set_destructor(reg->resource, _e_comp_cb_region_destroy);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_cb_region_destroy(struct wl_resource *resource)
|
||||
{
|
||||
E_Region *reg;
|
||||
|
||||
/* try to get the region from this resource */
|
||||
if (!(reg = wl_resource_get_user_data(resource)))
|
||||
return;
|
||||
|
||||
/* free the region */
|
||||
pixman_region32_fini(®->region);
|
||||
|
||||
/* free the structure */
|
||||
E_FREE(reg);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_cb_read(void *data, Ecore_Fd_Handler *hdl EINA_UNUSED)
|
||||
{
|
||||
E_Compositor *comp;
|
||||
|
||||
if ((comp = data))
|
||||
{
|
||||
wl_event_loop_dispatch(comp->wl.loop, 0);
|
||||
wl_display_flush_clients(comp->wl.display);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_cb_idle(void *data)
|
||||
{
|
||||
E_Compositor *comp;
|
||||
|
||||
if ((comp = data))
|
||||
{
|
||||
/* flush any clients before we idle */
|
||||
wl_display_flush_clients(comp->wl.display);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_data_device_cb_get(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, unsigned int id, struct wl_resource *seat_resource)
|
||||
{
|
||||
E_Input *seat;
|
||||
struct wl_resource *res;
|
||||
|
||||
if (!(seat = wl_resource_get_user_data(seat_resource))) return;
|
||||
|
||||
res = wl_resource_create(client, &wl_data_device_interface, 1, id);
|
||||
|
||||
wl_list_insert(&seat->drag_resources, wl_resource_get_link(res));
|
||||
wl_resource_set_implementation(res, &_e_data_device_interface,
|
||||
seat, _e_comp_data_device_cb_unbind);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_data_device_cb_unbind(struct wl_resource *resource)
|
||||
{
|
||||
wl_list_remove(wl_resource_get_link(resource));
|
||||
free(resource);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_xkb_init(E_Compositor *comp)
|
||||
{
|
||||
if (!(comp->xkb_context = xkb_context_new(0)))
|
||||
return EINA_FALSE;
|
||||
|
||||
if (!comp->xkb_names.rules)
|
||||
comp->xkb_names.rules = strdup("evdev");
|
||||
if (!comp->xkb_names.model)
|
||||
comp->xkb_names.model = strdup("pc105");
|
||||
if (!comp->xkb_names.layout)
|
||||
comp->xkb_names.layout = strdup("us");
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Compositor E_Compositor;
|
||||
|
||||
#else
|
||||
# ifndef E_COMP_H
|
||||
# define E_COMP_H
|
||||
|
||||
# define container_of(ptr, type, mbr) \
|
||||
({ \
|
||||
const __typeof__(((type *)0)->mbr) *__mptr = (ptr); \
|
||||
(type *)((char *)__mptr - offsetof(type, mbr)); \
|
||||
})
|
||||
|
||||
struct _E_Compositor
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct wl_display *display;
|
||||
struct wl_event_loop *loop;
|
||||
struct wl_event_loop *input_loop;
|
||||
struct wl_event_source *input_loop_source;
|
||||
} wl;
|
||||
|
||||
struct
|
||||
{
|
||||
struct wl_signal destroy;
|
||||
struct wl_signal activate;
|
||||
struct wl_signal kill;
|
||||
struct wl_signal seat;
|
||||
} signals;
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGL
|
||||
struct
|
||||
{
|
||||
EGLDisplay display;
|
||||
EGLContext context;
|
||||
EGLConfig config;
|
||||
} egl;
|
||||
#endif
|
||||
|
||||
E_Shell_Interface shell_interface;
|
||||
|
||||
E_Renderer *renderer;
|
||||
E_Plane plane; // primary plane
|
||||
|
||||
Ecore_Fd_Handler *fd_hdlr;
|
||||
Ecore_Idler *idler;
|
||||
|
||||
Eina_Bool focus : 1;
|
||||
|
||||
unsigned int output_pool;
|
||||
|
||||
Eina_List *planes;
|
||||
Eina_List *outputs;
|
||||
Eina_List *inputs;
|
||||
Eina_List *surfaces;
|
||||
|
||||
void (*cb_ping) (E_Surface *surface, unsigned int serial);
|
||||
|
||||
struct xkb_rule_names xkb_names;
|
||||
struct xkb_context *xkb_context;
|
||||
};
|
||||
|
||||
EINTERN int e_comp_init(void);
|
||||
EINTERN int e_comp_shutdown(void);
|
||||
|
||||
EAPI Eina_Bool e_compositor_init(E_Compositor *comp, void *display);
|
||||
EAPI Eina_Bool e_compositor_shutdown(E_Compositor *comp);
|
||||
EAPI E_Compositor *e_compositor_get(void);
|
||||
EAPI void e_compositor_plane_stack(E_Compositor *comp, E_Plane *plane, E_Plane *above);
|
||||
EAPI int e_compositor_input_read(int fd EINA_UNUSED, unsigned int mask EINA_UNUSED, void *data);
|
||||
EAPI void e_compositor_damage_calculate(E_Compositor *comp);
|
||||
EAPI unsigned int e_compositor_get_time(void);
|
||||
EAPI E_Surface *e_compositor_surface_find(E_Compositor *comp, Evas_Coord x, Evas_Coord y);
|
||||
EAPI void e_compositor_repick(E_Compositor *comp);
|
||||
|
||||
# endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,701 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
#define E_CONFIG_LIMIT(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min; }
|
||||
|
||||
typedef struct _E_Config E_Config;
|
||||
typedef struct _E_Config_Module E_Config_Module;
|
||||
typedef struct _E_Config_Theme E_Config_Theme;
|
||||
typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse;
|
||||
typedef struct _E_Config_Binding_Key E_Config_Binding_Key;
|
||||
typedef struct _E_Config_Binding_Edge E_Config_Binding_Edge;
|
||||
typedef struct _E_Config_Binding_Signal E_Config_Binding_Signal;
|
||||
typedef struct _E_Config_Binding_Wheel E_Config_Binding_Wheel;
|
||||
typedef struct _E_Config_Binding_Acpi E_Config_Binding_Acpi;
|
||||
typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background;
|
||||
typedef struct _E_Config_Desklock_Background E_Config_Desklock_Background;
|
||||
typedef struct _E_Config_Desktop_Name E_Config_Desktop_Name;
|
||||
typedef struct _E_Config_Desktop_Window_Profile E_Config_Desktop_Window_Profile;
|
||||
typedef struct _E_Config_Gadcon E_Config_Gadcon;
|
||||
typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client;
|
||||
typedef struct _E_Config_Shelf E_Config_Shelf;
|
||||
typedef struct _E_Config_Shelf_Desk E_Config_Shelf_Desk;
|
||||
typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon;
|
||||
typedef struct _E_Config_Syscon_Action E_Config_Syscon_Action;
|
||||
typedef struct _E_Config_Env_Var E_Config_Env_Var;
|
||||
typedef struct _E_Config_XKB_Layout E_Config_XKB_Layout;
|
||||
typedef struct _E_Config_XKB_Option E_Config_XKB_Option;
|
||||
|
||||
typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
|
||||
|
||||
typedef struct E_Config_Bindings E_Config_Bindings;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_CONFIG_PROFILE_TYPE_NONE,
|
||||
E_CONFIG_PROFILE_TYPE_MOBILE,
|
||||
E_CONFIG_PROFILE_TYPE_TABLET,
|
||||
E_CONFIG_PROFILE_TYPE_DESKTOP
|
||||
} E_Config_Profile_Type;
|
||||
|
||||
#else
|
||||
#ifndef E_CONFIG_H
|
||||
#define E_CONFIG_H
|
||||
|
||||
/* increment this whenever we change config enough that you need new
|
||||
* defaults for e to work.
|
||||
*/
|
||||
#define E_CONFIG_FILE_EPOCH 1
|
||||
/* increment this whenever a new set of config values are added but the users
|
||||
* config doesn't need to be wiped - simply new values need to be put in
|
||||
*/
|
||||
#define E_CONFIG_FILE_GENERATION 12
|
||||
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
|
||||
|
||||
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
|
||||
|
||||
struct _E_Config
|
||||
{
|
||||
int config_version; // INTERNAL
|
||||
E_Config_Profile_Type config_type; // INTERNAL
|
||||
int show_splash; // GUI
|
||||
const char *init_default_theme; // GUI
|
||||
const char *desktop_default_background; // GUI
|
||||
Eina_List *desktop_backgrounds; // GUI
|
||||
const char *desktop_default_name;
|
||||
const char *desktop_default_window_profile;
|
||||
Eina_List *desktop_names; // GUI
|
||||
Eina_List *desktop_window_profiles; // GUI
|
||||
double menus_scroll_speed; // GUI
|
||||
double menus_fast_mouse_move_threshhold; // GUI
|
||||
double menus_click_drag_timeout; // GUI
|
||||
int border_shade_animate; // GUI
|
||||
int border_shade_transition; // GUI
|
||||
double border_shade_speed; // GUI
|
||||
double framerate; // GUI
|
||||
int priority; // GUI
|
||||
int image_cache; // GUI
|
||||
int font_cache; // GUI
|
||||
int edje_cache; // GUI
|
||||
int edje_collection_cache; // GUI
|
||||
int zone_desks_x_count; // GUI
|
||||
int zone_desks_y_count; // GUI
|
||||
int show_desktop_icons; // GUI
|
||||
int edge_flip_dragging; // GUI
|
||||
int use_shaped_win; // GUI
|
||||
int no_module_delay; // GUI
|
||||
const char *language; // GUI
|
||||
const char *desklock_language; // GUI
|
||||
Eina_List *modules; // GUI
|
||||
Eina_List *bad_modules; // GUI
|
||||
Eina_List *font_fallbacks; // GUI
|
||||
Eina_List *font_defaults; // GUI
|
||||
Eina_List *themes; // GUI
|
||||
|
||||
/* NO LONGER SAVED WITH THIS STRUCT */
|
||||
Eina_List *mouse_bindings; // GUI
|
||||
Eina_List *key_bindings; // GUI
|
||||
Eina_List *edge_bindings; // GUI
|
||||
Eina_List *signal_bindings; // GUI
|
||||
Eina_List *wheel_bindings; // GUI
|
||||
Eina_List *acpi_bindings; // GUI
|
||||
|
||||
Eina_List *path_append_data; // GUI
|
||||
Eina_List *path_append_images; // GUI
|
||||
Eina_List *path_append_fonts; // GUI
|
||||
Eina_List *path_append_themes; // GUI
|
||||
Eina_List *path_append_init; // GUI
|
||||
Eina_List *path_append_icons; // GUI
|
||||
Eina_List *path_append_modules; // GUI
|
||||
Eina_List *path_append_backgrounds; // GUI
|
||||
Eina_List *path_append_messages; // GUI
|
||||
int window_placement_policy; // GUI
|
||||
int window_grouping; // GUI
|
||||
int focus_policy; // GUI
|
||||
int focus_setting; // GUI
|
||||
int pass_click_on; // GUI
|
||||
int window_activehint_policy; // GUI
|
||||
int always_click_to_raise; // GUI
|
||||
int always_click_to_focus; // GUI
|
||||
int use_auto_raise; // GUI
|
||||
double auto_raise_delay; // GUI
|
||||
int use_resist; // GUI
|
||||
int drag_resist;
|
||||
int desk_resist; // GUI
|
||||
int window_resist; // GUI
|
||||
int gadget_resist; // GUI
|
||||
int geometry_auto_move; // GUI
|
||||
int geometry_auto_resize_limit; // GUI
|
||||
int winlist_warp_while_selecting; // GUI
|
||||
int winlist_warp_at_end; // GUI
|
||||
int winlist_no_warp_on_direction; // GUI
|
||||
double winlist_warp_speed; // GUI **** NO LONGER USED!!!
|
||||
int winlist_scroll_animate; // GUI
|
||||
double winlist_scroll_speed; // GUI
|
||||
int winlist_list_show_iconified; // GUI
|
||||
int winlist_list_show_other_desk_iconified; // GUI
|
||||
int winlist_list_show_other_screen_iconified; // GUI
|
||||
int winlist_list_show_other_desk_windows; // GUI
|
||||
int winlist_list_show_other_screen_windows; // GUI
|
||||
int winlist_list_uncover_while_selecting; // GUI
|
||||
int winlist_list_jump_desk_while_selecting; // GUI
|
||||
int winlist_list_focus_while_selecting; // GUI
|
||||
int winlist_list_raise_while_selecting; // GUI
|
||||
double winlist_pos_align_x; // GUI
|
||||
double winlist_pos_align_y; // GUI
|
||||
double winlist_pos_size_w; // GUI
|
||||
double winlist_pos_size_h; // GUI
|
||||
int winlist_pos_min_w; // GUI
|
||||
int winlist_pos_min_h; // GUI
|
||||
int winlist_pos_max_w; // GUI
|
||||
int winlist_pos_max_h; // GUI
|
||||
int maximize_policy; // GUI
|
||||
int allow_manip; // GUI
|
||||
int border_fix_on_shelf_toggle; // GUI
|
||||
int allow_above_fullscreen; // GUI
|
||||
int kill_if_close_not_possible; // GUI
|
||||
int kill_process; // GUI
|
||||
double kill_timer_wait; // GUI
|
||||
int ping_clients; // GUI
|
||||
const char *transition_start; // GUI
|
||||
const char *transition_desk; // GUI
|
||||
const char *transition_change; // GUI
|
||||
Eina_List *remembers; // GUI
|
||||
int remember_internal_windows; // GUI
|
||||
Eina_Bool remember_internal_fm_windows; // GUI
|
||||
Eina_Bool remember_internal_fm_windows_globally; // GUI
|
||||
int move_info_follows; // GUI
|
||||
int resize_info_follows; // GUI
|
||||
int move_info_visible; // GUI
|
||||
int resize_info_visible; // GUI
|
||||
int focus_last_focused_per_desktop; // GUI
|
||||
int focus_revert_on_hide_or_close; // GUI
|
||||
int disable_all_pointer_warps; // GUI
|
||||
int pointer_slide; // GUI
|
||||
double pointer_warp_speed; // GUI
|
||||
int use_e_cursor; // GUI
|
||||
int cursor_size; // GUI
|
||||
int menu_autoscroll_margin; // GUI
|
||||
int menu_autoscroll_cursor_margin; // GUI
|
||||
const char *input_method; // GUI
|
||||
struct
|
||||
{
|
||||
int move; // GUI
|
||||
int resize; // GUI
|
||||
int raise; // GUI
|
||||
int lower; // GUI
|
||||
int layer; // GUI
|
||||
int desktop; // GUI
|
||||
int iconify; // GUI
|
||||
} transient;
|
||||
int modal_windows;
|
||||
int menu_eap_name_show; // GUI
|
||||
int menu_eap_generic_show; // GUI
|
||||
int menu_eap_comment_show; // GUI
|
||||
int menu_favorites_show; // GUI
|
||||
int menu_apps_show; // GUI
|
||||
Eina_Bool menu_icons_hide; // GUI
|
||||
int menu_gadcon_client_toplevel; // GUI
|
||||
int fullscreen_policy; // GUI
|
||||
const char *exebuf_term_cmd; // GUI
|
||||
Eina_List *color_classes; // GUI
|
||||
int use_app_icon; // GUI
|
||||
int cnfmdlg_disabled; // GUI
|
||||
int cfgdlg_auto_apply; // GUI
|
||||
int cfgdlg_default_mode; // GUI
|
||||
Eina_List *gadcons; // GUI
|
||||
Eina_List *shelves; // GUI
|
||||
int font_hinting; // GUI
|
||||
|
||||
const char *desklock_personal_passwd; // GUI
|
||||
const char *desklock_background; // OLD DON'T USE
|
||||
Eina_List *desklock_backgrounds; // GUI
|
||||
int desklock_auth_method; // GUI
|
||||
int desklock_login_box_zone; // GUI
|
||||
int desklock_start_locked; // GUI
|
||||
int desklock_on_suspend; // GUI
|
||||
int desklock_autolock_screensaver; // GUI
|
||||
double desklock_post_screensaver_time; // GUI
|
||||
int desklock_autolock_idle; // GUI
|
||||
double desklock_autolock_idle_timeout; // GUI
|
||||
int desklock_use_custom_desklock; // GUI
|
||||
const char *desklock_custom_desklock_cmd; // GUI
|
||||
unsigned char desklock_ask_presentation; // GUI
|
||||
double desklock_ask_presentation_timeout; // GUI
|
||||
|
||||
int screensaver_enable; // GUI
|
||||
int screensaver_timeout; // GUI
|
||||
int screensaver_interval; // GUI
|
||||
int screensaver_blanking; // GUI
|
||||
int screensaver_expose; // GUI
|
||||
unsigned char screensaver_ask_presentation; // GUI
|
||||
double screensaver_ask_presentation_timeout; // GUI
|
||||
|
||||
unsigned char screensaver_suspend; // GUI
|
||||
unsigned char screensaver_suspend_on_ac; // GUI
|
||||
double screensaver_suspend_delay; // GUI
|
||||
|
||||
int dpms_enable; // GUI
|
||||
int dpms_standby_enable; // GUI
|
||||
int dpms_standby_timeout; // GUI
|
||||
int dpms_suspend_enable; // GUI
|
||||
int dpms_suspend_timeout; // GUI
|
||||
int dpms_off_enable; // GUI
|
||||
int dpms_off_timeout; // GUI
|
||||
|
||||
int clientlist_group_by; // GUI
|
||||
int clientlist_include_all_zones; // GUI
|
||||
int clientlist_separate_with; // GUI
|
||||
int clientlist_sort_by; // GUI
|
||||
int clientlist_separate_iconified_apps; // GUI
|
||||
int clientlist_warp_to_iconified_desktop; // GUI
|
||||
int clientlist_limit_caption_len; // GUI
|
||||
int clientlist_max_caption_len; // GUI
|
||||
|
||||
int mouse_hand; //GUI
|
||||
int mouse_accel_numerator; // GUI
|
||||
int mouse_accel_denominator; // GUI
|
||||
int mouse_accel_threshold; // GUI
|
||||
|
||||
int border_raise_on_mouse_action; // GUI
|
||||
int border_raise_on_focus; // GUI
|
||||
int desk_flip_wrap; // GUI
|
||||
int fullscreen_flip; // GUI
|
||||
int multiscreen_flip; // GUI
|
||||
|
||||
const char *icon_theme; // GUI
|
||||
unsigned char icon_theme_overrides; // GUI
|
||||
|
||||
/* modes:
|
||||
* 1-"pane") horizontal or vertical movement to/from next/previous "screen"
|
||||
* 2-"zoom") 45degree diagonal movement based on border position
|
||||
*/
|
||||
int desk_flip_animate_mode; // GUI
|
||||
/* types based on theme */
|
||||
Eina_Stringshare *desk_flip_animate_type; // GUI
|
||||
int desk_flip_animate_interpolation; // GUI
|
||||
|
||||
const char *wallpaper_import_last_dev; // INTERNAL
|
||||
const char *wallpaper_import_last_path; // INTERNAL
|
||||
|
||||
const char *theme_default_border_style; // GUI
|
||||
|
||||
Eina_List *mime_icons; // GUI
|
||||
int desk_auto_switch; // GUI;
|
||||
|
||||
int screen_limits;
|
||||
|
||||
int thumb_nice;
|
||||
|
||||
int ping_clients_interval; // GUI
|
||||
int cache_flush_poll_interval; // GUI
|
||||
|
||||
int thumbscroll_enable; // GUI
|
||||
int thumbscroll_threshhold; // GUI
|
||||
double thumbscroll_momentum_threshhold; // GUI
|
||||
double thumbscroll_friction; // GUI
|
||||
|
||||
unsigned char filemanager_single_click; // GUI
|
||||
int device_desktop; // GUI
|
||||
int device_auto_mount; // GUI
|
||||
int device_auto_open; // GUI
|
||||
/* FIXME: TODO: Re-Enable */
|
||||
/* Efm_Mode device_detect_mode; */
|
||||
unsigned char filemanager_copy; // GUI
|
||||
unsigned char filemanager_secure_rm; // GUI
|
||||
|
||||
struct
|
||||
{
|
||||
double timeout; // GUI
|
||||
struct
|
||||
{
|
||||
unsigned char dx; // GUI
|
||||
unsigned char dy; // GUI
|
||||
} move;
|
||||
struct
|
||||
{
|
||||
unsigned char dx; // GUI
|
||||
unsigned char dy; // GUI
|
||||
} resize;
|
||||
} border_keyboard;
|
||||
|
||||
struct
|
||||
{
|
||||
double min; // GUI
|
||||
double max; // GUI
|
||||
double factor; // GUI
|
||||
int base_dpi; // GUI
|
||||
unsigned char use_dpi; // GUI
|
||||
unsigned char use_custom; // GUI
|
||||
} scale;
|
||||
|
||||
unsigned char show_cursor; // GUI
|
||||
unsigned char idle_cursor; // GUI
|
||||
|
||||
const char *default_system_menu; // GUI
|
||||
|
||||
unsigned char cfgdlg_normal_wins; // GUI
|
||||
|
||||
struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
int icon_size; // GUI
|
||||
} main, secondary, extra;
|
||||
double timeout; // GUI
|
||||
unsigned char do_input; // GUI
|
||||
Eina_List *actions;
|
||||
} syscon;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned char presentation; // INTERNAL
|
||||
unsigned char offline; // INTERNAL
|
||||
} mode;
|
||||
|
||||
struct
|
||||
{
|
||||
double expire_timeout;
|
||||
unsigned char show_run_dialog;
|
||||
unsigned char show_exit_dialog;
|
||||
} exec;
|
||||
|
||||
unsigned char null_container_win; // HYPER-ADVANCED-ONLY - TURNING ON KILLS DESKTOP BG
|
||||
|
||||
Eina_List *env_vars; // GUI
|
||||
|
||||
struct
|
||||
{
|
||||
double normal; // GUI
|
||||
double dim; // GUI
|
||||
double transition; // GUI
|
||||
double timer; // GUI
|
||||
const char *sysdev; // GUI
|
||||
unsigned char idle_dim; // GUI
|
||||
E_Backlight_Mode mode; /* not saved, display-only */
|
||||
} backlight;
|
||||
|
||||
struct
|
||||
{
|
||||
double none;
|
||||
double low;
|
||||
double medium;
|
||||
double high;
|
||||
double extreme;
|
||||
E_Powersave_Mode min;
|
||||
E_Powersave_Mode max;
|
||||
} powersave;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned char load_xrdb; // GUI
|
||||
unsigned char load_xmodmap; // GUI
|
||||
unsigned char load_gnome; // GUI
|
||||
unsigned char load_kde; // GUI
|
||||
} deskenv;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned char enabled; // GUI
|
||||
unsigned char match_e17_theme; // GUI
|
||||
unsigned char match_e17_icon_theme; // GUI
|
||||
int xft_antialias;
|
||||
int xft_hinting;
|
||||
const char *xft_hint_style;
|
||||
const char *xft_rgba;
|
||||
const char *net_theme_name; // GUI
|
||||
const char *net_theme_name_detected; // not saved
|
||||
const char *net_icon_theme_name;
|
||||
const char *gtk_font_name;
|
||||
} xsettings;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned char check; // INTERNAL
|
||||
unsigned char later; // INTERNAL
|
||||
} update;
|
||||
|
||||
struct
|
||||
{
|
||||
Eina_List *used_layouts;
|
||||
Eina_List *used_options;
|
||||
int only_label;
|
||||
const char *default_model;
|
||||
int cur_group;
|
||||
E_Config_XKB_Layout *current_layout;
|
||||
E_Config_XKB_Layout *sel_layout;
|
||||
E_Config_XKB_Layout *lock_layout;
|
||||
Eina_Bool dont_touch_my_damn_keyboard;
|
||||
|
||||
/* NO LONGER USED BECAUSE I SUCK
|
||||
* -zmike, 31 January 2013
|
||||
*/
|
||||
const char *cur_layout; // whatever the current layout is
|
||||
const char *selected_layout; // whatever teh current layout that the user has selected is
|
||||
const char *desklock_layout;
|
||||
} xkb;
|
||||
|
||||
Eina_List *menu_applications;
|
||||
unsigned char exe_always_single_instance; // GUI
|
||||
int use_desktop_window_profile; // GUI
|
||||
};
|
||||
|
||||
struct E_Config_Bindings
|
||||
{
|
||||
unsigned int config_version;
|
||||
Eina_List *mouse_bindings; // GUI
|
||||
Eina_List *key_bindings; // GUI
|
||||
Eina_List *edge_bindings; // GUI
|
||||
Eina_List *signal_bindings; // GUI
|
||||
Eina_List *wheel_bindings; // GUI
|
||||
Eina_List *acpi_bindings; // GUI
|
||||
};
|
||||
|
||||
struct _E_Config_Desklock_Background
|
||||
{
|
||||
const char *file;
|
||||
};
|
||||
|
||||
struct _E_Config_Env_Var
|
||||
{
|
||||
const char *var;
|
||||
const char *val;
|
||||
unsigned char unset;
|
||||
};
|
||||
|
||||
struct _E_Config_Syscon_Action
|
||||
{
|
||||
const char *action;
|
||||
const char *params;
|
||||
const char *button;
|
||||
const char *icon;
|
||||
int is_main;
|
||||
};
|
||||
|
||||
struct _E_Config_Module
|
||||
{
|
||||
const char *name;
|
||||
unsigned char enabled;
|
||||
unsigned char delayed;
|
||||
int priority;
|
||||
};
|
||||
|
||||
struct _E_Config_Theme
|
||||
{
|
||||
const char *category;
|
||||
const char *file;
|
||||
};
|
||||
|
||||
struct _E_Config_Binding_Mouse
|
||||
{
|
||||
int context;
|
||||
int modifiers;
|
||||
const char *action;
|
||||
const char *params;
|
||||
unsigned char button;
|
||||
unsigned char any_mod;
|
||||
};
|
||||
|
||||
struct _E_Config_Binding_Key
|
||||
{
|
||||
int context;
|
||||
unsigned int modifiers;
|
||||
const char *key;
|
||||
const char *action;
|
||||
const char *params;
|
||||
unsigned char any_mod;
|
||||
};
|
||||
|
||||
struct _E_Config_Binding_Edge
|
||||
{
|
||||
int context;
|
||||
int modifiers;
|
||||
float delay;
|
||||
const char *action;
|
||||
const char *params;
|
||||
unsigned char edge;
|
||||
unsigned char any_mod;
|
||||
Eina_Bool drag_only;
|
||||
};
|
||||
|
||||
struct _E_Config_Binding_Signal
|
||||
{
|
||||
int context;
|
||||
const char *signal;
|
||||
const char *source;
|
||||
int modifiers;
|
||||
unsigned char any_mod;
|
||||
const char *action;
|
||||
const char *params;
|
||||
};
|
||||
|
||||
struct _E_Config_Binding_Wheel
|
||||
{
|
||||
int context;
|
||||
int direction;
|
||||
int z;
|
||||
int modifiers;
|
||||
unsigned char any_mod;
|
||||
const char *action;
|
||||
const char *params;
|
||||
};
|
||||
|
||||
struct _E_Config_Binding_Acpi
|
||||
{
|
||||
int context, type, status;
|
||||
const char *action, *params;
|
||||
};
|
||||
|
||||
struct _E_Config_Desktop_Background
|
||||
{
|
||||
int container;
|
||||
int zone;
|
||||
int desk_x;
|
||||
int desk_y;
|
||||
const char *file;
|
||||
};
|
||||
|
||||
struct _E_Config_Desktop_Name
|
||||
{
|
||||
int container;
|
||||
int zone;
|
||||
int desk_x;
|
||||
int desk_y;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct _E_Config_Desktop_Window_Profile
|
||||
{
|
||||
int container;
|
||||
int zone;
|
||||
int desk_x;
|
||||
int desk_y;
|
||||
const char *profile;
|
||||
};
|
||||
|
||||
struct _E_Config_Gadcon
|
||||
{
|
||||
const char *name;
|
||||
int id;
|
||||
unsigned int zone;
|
||||
Eina_List *clients;
|
||||
};
|
||||
|
||||
struct _E_Config_Gadcon_Client
|
||||
{
|
||||
const char *name;
|
||||
const char *id;
|
||||
struct
|
||||
{
|
||||
int pos, size, res; //gadcon
|
||||
double pos_x, pos_y, size_w, size_h; //gadman
|
||||
} geom;
|
||||
struct
|
||||
{
|
||||
int seq, flags;
|
||||
} state_info;
|
||||
const char *style;
|
||||
int orient;
|
||||
unsigned char autoscroll;
|
||||
unsigned char resizable;
|
||||
const char *theme;
|
||||
};
|
||||
|
||||
struct _E_Config_Shelf
|
||||
{
|
||||
const char *name;
|
||||
int id;
|
||||
int container, zone;
|
||||
int layer;
|
||||
unsigned char popup;
|
||||
int orient;
|
||||
unsigned char fit_along;
|
||||
unsigned char fit_size;
|
||||
const char *style;
|
||||
int size;
|
||||
int overlap;
|
||||
int autohide;
|
||||
int autohide_show_action;
|
||||
float hide_timeout;
|
||||
float hide_duration;
|
||||
int desk_show_mode;
|
||||
Eina_List *desk_list;
|
||||
};
|
||||
|
||||
struct _E_Config_Shelf_Desk
|
||||
{
|
||||
int x, y;
|
||||
};
|
||||
|
||||
struct _E_Config_Mime_Icon
|
||||
{
|
||||
const char *mime;
|
||||
const char *icon;
|
||||
};
|
||||
|
||||
struct _E_Event_Config_Icon_Theme
|
||||
{
|
||||
const char *icon_theme;
|
||||
};
|
||||
|
||||
struct _E_Config_XKB_Layout
|
||||
{
|
||||
const char *name;
|
||||
const char *model;
|
||||
const char *variant;
|
||||
};
|
||||
|
||||
struct _E_Config_XKB_Option
|
||||
{
|
||||
const char *name;
|
||||
};
|
||||
|
||||
EINTERN int e_config_init(void);
|
||||
EINTERN int e_config_shutdown(void);
|
||||
|
||||
EAPI void e_config_load(void);
|
||||
|
||||
EAPI int e_config_save(void);
|
||||
EAPI void e_config_save_flush(void);
|
||||
EAPI void e_config_save_queue(void);
|
||||
|
||||
EAPI const char *e_config_profile_get(void);
|
||||
EAPI char *e_config_profile_dir_get(const char *prof);
|
||||
EAPI void e_config_profile_set(const char *prof);
|
||||
EAPI Eina_List *e_config_profile_list(void);
|
||||
EAPI void e_config_profile_add(const char *prof);
|
||||
EAPI void e_config_profile_del(const char *prof);
|
||||
|
||||
EAPI void e_config_save_block_set(int block);
|
||||
EAPI int e_config_save_block_get(void);
|
||||
|
||||
EAPI void *e_config_domain_load(const char *domain, E_Config_DD *edd);
|
||||
EAPI void *e_config_domain_system_load(const char *domain, E_Config_DD *edd);
|
||||
EAPI int e_config_profile_save(void);
|
||||
EAPI int e_config_domain_save(const char *domain, E_Config_DD *edd, const void *data);
|
||||
|
||||
EAPI E_Config_Binding_Mouse *e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in);
|
||||
EAPI E_Config_Binding_Key *e_config_binding_key_match(E_Config_Binding_Key *eb_in);
|
||||
EAPI E_Config_Binding_Edge *e_config_binding_edge_match(E_Config_Binding_Edge *eb_in);
|
||||
EAPI E_Config_Binding_Signal *e_config_binding_signal_match(E_Config_Binding_Signal *eb_in);
|
||||
EAPI E_Config_Binding_Wheel *e_config_binding_wheel_match(E_Config_Binding_Wheel *eb_in);
|
||||
EAPI E_Config_Binding_Acpi *e_config_binding_acpi_match(E_Config_Binding_Acpi *eb_in);
|
||||
EAPI void e_config_mode_changed(void);
|
||||
|
||||
|
||||
EAPI void e_config_bindings_free(E_Config_Bindings *ecb);
|
||||
EAPI void e_config_binding_signal_free(E_Config_Binding_Signal *ebs);
|
||||
EAPI void e_config_binding_wheel_free(E_Config_Binding_Wheel *ebw);
|
||||
EAPI void e_config_binding_mouse_free(E_Config_Binding_Mouse *ebm);
|
||||
EAPI void e_config_binding_edge_free(E_Config_Binding_Edge *ebe);
|
||||
EAPI void e_config_binding_key_free(E_Config_Binding_Key *ebk);
|
||||
EAPI void e_config_binding_acpi_free(E_Config_Binding_Acpi *eba);
|
||||
|
||||
extern EAPI E_Config *e_config;
|
||||
extern EAPI E_Config_Bindings *e_bindings;
|
||||
|
||||
extern EAPI int E_EVENT_CONFIG_ICON_THEME;
|
||||
extern EAPI int E_EVENT_CONFIG_MODE_CHANGED;
|
||||
extern EAPI int E_EVENT_CONFIG_LOADED;
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,41 @@
|
|||
#include "e.h"
|
||||
|
||||
static Eina_Hash *config_hash = NULL;
|
||||
|
||||
EAPI void
|
||||
e_config_descriptor_free(E_Config_DD *edd)
|
||||
{
|
||||
#if (EET_VERSION_MAJOR > 1) || (EET_VERSION_MINOR >= 8)
|
||||
eina_hash_del_by_key(config_hash, eet_data_descriptor_name_get((Eet_Data_Descriptor*)edd));
|
||||
#else
|
||||
eina_hash_del_by_data(config_hash, edd);
|
||||
#endif
|
||||
eet_data_descriptor_free((Eet_Data_Descriptor*)edd);
|
||||
}
|
||||
|
||||
EAPI E_Config_DD *
|
||||
e_config_descriptor_new(const char *name, int size)
|
||||
{
|
||||
Eet_Data_Descriptor_Class eddc;
|
||||
E_Config_DD *edd;
|
||||
|
||||
if (!eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), name, size))
|
||||
return NULL;
|
||||
|
||||
/* FIXME: We can directly map string inside an Eet_File and reuse it.
|
||||
But this need a break in all user of config every where in E.
|
||||
*/
|
||||
|
||||
edd = (E_Config_DD *)eet_data_descriptor_stream_new(&eddc);
|
||||
|
||||
if (!config_hash) config_hash = eina_hash_string_superfast_new(NULL);
|
||||
eina_hash_set(config_hash, name, edd);
|
||||
return edd;
|
||||
}
|
||||
|
||||
EAPI E_Config_DD *
|
||||
e_config_descriptor_find(const char *name)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
|
||||
return eina_hash_find(config_hash, name);
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
/** \def E_CONFIG_DD_NEW(str, typ)
|
||||
* is used to create definition of a struct
|
||||
* \str str name to give to struct
|
||||
* \typ typ the actual struct type
|
||||
*/
|
||||
#define E_CONFIG_DD_NEW(str, typ) \
|
||||
e_config_descriptor_new(str, sizeof(typ))
|
||||
|
||||
/** \def E_CONFIG_DD_FREE(eed)
|
||||
* is used to free definition of a struct
|
||||
* \eed eed the pointer created by \link #E_CONFIG_DD_NEW
|
||||
*/
|
||||
#define E_CONFIG_DD_FREE(eed) \
|
||||
if (eed) { e_config_descriptor_free((eed)); (eed) = NULL; }
|
||||
#define E_CONFIG_DD_FIND(type) \
|
||||
e_config_descriptor_find(type)
|
||||
#define E_CONFIG_VAL(edd, type, member, dtype) \
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
|
||||
#define E_CONFIG_SUB(edd, type, member, eddtype) \
|
||||
EET_DATA_DESCRIPTOR_ADD_SUB(edd, type, #member, member, eddtype)
|
||||
|
||||
/** \def E_CONFIG_LIST(edd, type, member, eddtype)
|
||||
* declares a struct member to be included definition
|
||||
* list type must be Evas_List and not Ecore_List
|
||||
* \edd edd the pointer created by \link #E_CONFIG_DD_NEW
|
||||
* \type type struct type
|
||||
* \member member member of struct
|
||||
* \eddtype struct definition to use for each entry in the list
|
||||
*/
|
||||
#define E_CONFIG_LIST(edd, type, member, eddtype) \
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(edd, type, #member, member, eddtype)
|
||||
|
||||
/** \def E_CONFIG_HASH(edd, type, member, eddtype)
|
||||
* declares a struct member to be included definition
|
||||
* list type must be Evas_Hash and not Ecore_Hash
|
||||
* \edd edd the pointer created by \link #E_CONFIG_DD_NEW
|
||||
* \type type struct type
|
||||
* \member member member of struct
|
||||
* \eddtype struct definition to use for each entry in the hash
|
||||
*/
|
||||
#define E_CONFIG_HASH(edd, type, member, eddtype) \
|
||||
EET_DATA_DESCRIPTOR_ADD_HASH(edd, type, #member, member, eddtype)
|
||||
|
||||
#define CHAR EET_T_CHAR
|
||||
#define SHORT EET_T_SHORT
|
||||
#define INT EET_T_INT
|
||||
#define LL EET_T_LONG_LONG
|
||||
#define FLOAT EET_T_FLOAT
|
||||
#define DOUBLE EET_T_DOUBLE
|
||||
#define UCHAR EET_T_UCHAR
|
||||
#define USHORT EET_T_USHORT
|
||||
#define UINT EET_T_UINT
|
||||
#define ULL EET_T_ULONG_LONG
|
||||
#define STR EET_T_STRING
|
||||
|
||||
typedef Eet_Data_Descriptor E_Config_DD;
|
||||
|
||||
#else
|
||||
#ifndef E_CONFIG_DATA_H
|
||||
#define E_CONFIG_DATA_H
|
||||
|
||||
EAPI E_Config_DD *e_config_descriptor_new(const char *name, int size);
|
||||
EAPI void e_config_descriptor_free(E_Config_DD *edd);
|
||||
EAPI E_Config_DD *e_config_descriptor_find(const char *name);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
#include "e.h"
|
||||
|
||||
EAPI E_Config_Dialog *
|
||||
e_config_dialog_new(E_Container *con, const char *title, const char *name, const char *class, const char *icon, int icon_size, E_Config_Dialog_View *view, void *data)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_config_dialog_find(const char *name, const char *class)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
EAPI E_Config_Dialog *
|
||||
e_config_dialog_get(const char *name, const char *class)
|
||||
{
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef enum _E_Config_Dialog_CFData_Type
|
||||
{
|
||||
E_CONFIG_DIALOG_CFDATA_TYPE_BASIC,
|
||||
E_CONFIG_DIALOG_CFDATA_TYPE_ADVANCED,
|
||||
E_CONFIG_DIALOG_CFDATA_TYPE_NORMAL_WINDOW
|
||||
} E_Config_Dialog_CFData_Type;
|
||||
|
||||
typedef struct _E_Config_Dialog E_Config_Dialog;
|
||||
typedef struct _E_Config_Dialog_View E_Config_Dialog_View;
|
||||
typedef struct _E_Config_Dialog_Data E_Config_Dialog_Data;
|
||||
|
||||
#else
|
||||
#ifndef E_CONFIG_DIALOG_H
|
||||
#define E_CONFIG_DIALOG_H
|
||||
|
||||
#define E_CONFIG_DIALOG_TYPE 0xE0b01017
|
||||
|
||||
struct _E_Config_Dialog_View
|
||||
{
|
||||
unsigned char override_auto_apply : 1;
|
||||
unsigned char basic_only : 1;
|
||||
unsigned char normal_win : 1;
|
||||
unsigned char scroll : 1;
|
||||
|
||||
void *(*create_cfdata) (E_Config_Dialog *cfd);
|
||||
void (*free_cfdata) (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
int (*close_cfdata) (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
struct {
|
||||
int (*apply_cfdata) (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Evas_Object *(*create_widgets) (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
int (*check_changed) (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
} basic, advanced;
|
||||
};
|
||||
|
||||
struct _E_Config_Dialog
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
E_Config_Dialog_CFData_Type view_type;
|
||||
E_Config_Dialog_View *view;
|
||||
E_Config_Dialog_Data *cfdata;
|
||||
E_Container *con;
|
||||
const char *title;
|
||||
const char *icon;
|
||||
const char *name;
|
||||
const char *class;
|
||||
int icon_size;
|
||||
E_Dialog *dia;
|
||||
void *data;
|
||||
Ecore_Timer *auto_apply_timer;
|
||||
unsigned char hide_buttons : 1;
|
||||
unsigned char cfg_changed : 1;
|
||||
unsigned char cfg_changed_auto : 1;
|
||||
};
|
||||
|
||||
EAPI E_Config_Dialog *e_config_dialog_new(E_Container *con, const char *title, const char *name, const char *class, const char *icon, int icon_size, E_Config_Dialog_View *view, void *data);
|
||||
EAPI int e_config_dialog_find(const char *name, const char *class);
|
||||
EAPI E_Config_Dialog *e_config_dialog_get(const char *name, const char *class);
|
||||
|
||||
EAPI void e_config_dialog_changed_auto_set(E_Config_Dialog *cfd, unsigned char value);
|
||||
EAPI void e_config_dialog_changed_set(E_Config_Dialog *cfd, unsigned char value);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,517 @@
|
|||
#include "e.h"
|
||||
|
||||
static void _e_configure_menu_module_item_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_configure_menu_add(void *data, E_Menu *m);
|
||||
static void _e_configure_efreet_desktop_cleanup(void);
|
||||
static void _e_configure_efreet_desktop_update(void);
|
||||
static Eina_Bool _e_configure_cb_efreet_desktop_cache_update(void *data, int type, void *event);
|
||||
static void _e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params), void (*generic_func)(E_Container *con, const char *params), Efreet_Desktop *desktop, const char *params);
|
||||
static void _e_configure_registry_item_free(E_Configure_It *eci);
|
||||
|
||||
static void _configure_job(void *data);
|
||||
static Eina_Bool _configure_init_timer(void *data);
|
||||
|
||||
EAPI Eina_List *e_configure_registry = NULL;
|
||||
|
||||
static Eina_List *handlers = NULL;
|
||||
static E_Int_Menu_Augmentation *maug = NULL;
|
||||
static Ecore_Job *update_job = NULL;
|
||||
|
||||
static struct
|
||||
{
|
||||
void (*func)(const void *data, E_Container *con, const char *params, Efreet_Desktop *desktop);
|
||||
const char *data;
|
||||
} custom_desktop_exec = { NULL, NULL };
|
||||
|
||||
EINTERN void
|
||||
e_configure_init(void)
|
||||
{
|
||||
e_configure_registry_category_add("extensions", 90, _("Extensions"), NULL, "preferences-extensions");
|
||||
/* e_configure_registry_item_add("extensions/modules", 10, _("Modules"), NULL, "preferences-plugin", e_int_config_modules); */
|
||||
|
||||
maug = e_int_menus_menu_augmentation_add_sorted
|
||||
("config/1", _("Modules"), _e_configure_menu_add, NULL, NULL, NULL);
|
||||
|
||||
if (update_job)
|
||||
{
|
||||
ecore_job_del(update_job);
|
||||
update_job = NULL;
|
||||
}
|
||||
ecore_timer_add(0.0, _configure_init_timer, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_configure_registry_call(const char *path, E_Container *con, const char *params)
|
||||
{
|
||||
E_Configure_Cat *ecat;
|
||||
Eina_List *l;
|
||||
char *cat;
|
||||
const char *item;
|
||||
|
||||
/* path is "category/item" */
|
||||
cat = ecore_file_dir_get(path);
|
||||
if (!cat) return;
|
||||
item = ecore_file_file_get(path);
|
||||
if (!con) con = e_container_current_get(e_manager_current_get());
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
||||
if (!strcmp(cat, ecat->cat))
|
||||
{
|
||||
E_Configure_It *eci;
|
||||
Eina_List *ll;
|
||||
|
||||
EINA_LIST_FOREACH(ecat->items, ll, eci)
|
||||
if (!strcmp(item, eci->item))
|
||||
{
|
||||
if (!params) params = eci->params;
|
||||
|
||||
if (eci->func) eci->func(con, params);
|
||||
else if (eci->generic_func)
|
||||
eci->generic_func(con, params);
|
||||
else if (eci->desktop)
|
||||
{
|
||||
if (custom_desktop_exec.func)
|
||||
custom_desktop_exec.func(custom_desktop_exec.data,
|
||||
con, params, eci->desktop);
|
||||
else
|
||||
e_exec(e_util_zone_current_get(con->man),
|
||||
eci->desktop, NULL, NULL, "config");
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
free(cat);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params))
|
||||
{
|
||||
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func)(E_Container *con, const char *params))
|
||||
{
|
||||
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, NULL, generic_func, NULL, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params), const char *params)
|
||||
{
|
||||
_e_configure_registry_item_full_add(path, pri, label, icon_file, icon, func, NULL, NULL, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an item in the configuration panel.
|
||||
*
|
||||
* @param path location the item to delete
|
||||
*/
|
||||
EAPI void
|
||||
e_configure_registry_item_del(const char *path)
|
||||
{
|
||||
E_Configure_Cat *ecat;
|
||||
Eina_List *l;
|
||||
const char *item;
|
||||
char *cat;
|
||||
|
||||
/* path is "category/item" */
|
||||
cat = ecore_file_dir_get(path);
|
||||
if (!cat) return;
|
||||
item = ecore_file_file_get(path);
|
||||
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
||||
if (!strcmp(cat, ecat->cat))
|
||||
{
|
||||
E_Configure_It *eci;
|
||||
Eina_List *ll;
|
||||
|
||||
EINA_LIST_FOREACH(ecat->items, ll, eci)
|
||||
if (!strcmp(item, eci->item))
|
||||
{
|
||||
ecat->items = eina_list_remove_list(ecat->items, ll);
|
||||
|
||||
_e_configure_registry_item_free(eci);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
free(cat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a category to the configuration panel.
|
||||
*
|
||||
* @param path location the new category
|
||||
* @param pri the priority for sorting the category in the category list
|
||||
* @param label the name the user will see in configuration panel
|
||||
* @param icon_file the edje file that holds the icon for the category.
|
||||
* Can be null to use current theme.
|
||||
* @param icon the name of the edje group to use as icon
|
||||
*/
|
||||
static int
|
||||
_E_configure_category_pri_cb(E_Configure_Cat *ecat, E_Configure_Cat *ecat2)
|
||||
{
|
||||
if (ecat->pri == ecat2->pri)
|
||||
return strcmp(ecat->label, ecat2->label);
|
||||
return ecat->pri - ecat2->pri;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_configure_registry_category_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon)
|
||||
{
|
||||
E_Configure_Cat *ecat2;
|
||||
E_Configure_Cat *ecat;
|
||||
Eina_List *l;
|
||||
|
||||
/* if it exists - ignore this */
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat2)
|
||||
if (!strcmp(ecat2->cat, path)) return;
|
||||
|
||||
ecat = E_NEW(E_Configure_Cat, 1);
|
||||
if (!ecat) return;
|
||||
|
||||
ecat->cat = eina_stringshare_add(path);
|
||||
ecat->pri = pri;
|
||||
ecat->label = eina_stringshare_add(label);
|
||||
if (icon_file) ecat->icon_file = eina_stringshare_add(icon_file);
|
||||
if (icon) ecat->icon = eina_stringshare_add(icon);
|
||||
e_configure_registry = eina_list_sorted_insert(e_configure_registry,
|
||||
EINA_COMPARE_CB(_E_configure_category_pri_cb),
|
||||
ecat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a category in the configuration panel.
|
||||
*
|
||||
* @param path location the category to delete
|
||||
*/
|
||||
EAPI void
|
||||
e_configure_registry_category_del(const char *path)
|
||||
{
|
||||
E_Configure_Cat *ecat;
|
||||
Eina_List *l;
|
||||
char *cat;
|
||||
|
||||
cat = ecore_file_dir_get(path);
|
||||
if (!cat) return;
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
||||
if (!strcmp(cat, ecat->cat))
|
||||
{
|
||||
if (ecat->items) break;
|
||||
e_configure_registry = eina_list_remove_list(e_configure_registry, l);
|
||||
eina_stringshare_del(ecat->cat);
|
||||
eina_stringshare_del(ecat->label);
|
||||
if (ecat->icon) eina_stringshare_del(ecat->icon);
|
||||
if (ecat->icon_file) eina_stringshare_del(ecat->icon_file);
|
||||
free(ecat);
|
||||
break;
|
||||
}
|
||||
free(cat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a item to the configuration panel.
|
||||
*
|
||||
* @param path location the location to place configuration item
|
||||
* @param pri the priority for sorting the item in the category list
|
||||
* @param label the name the user will see in configuration panel
|
||||
* @param icon_file the edje file that holds the icon for the category.
|
||||
* Can be null to use current theme.
|
||||
* @param icon the name of the edje group to use as icon
|
||||
* @param func the callback to use when the configuration item is clicked
|
||||
*/
|
||||
|
||||
EAPI void
|
||||
e_configure_registry_custom_desktop_exec_callback_set(void (*func)(const void *data, E_Container *con, const char *params, Efreet_Desktop *desktop), const void *data)
|
||||
{
|
||||
custom_desktop_exec.func = func;
|
||||
custom_desktop_exec.data = data;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_configure_registry_exists(const char *path)
|
||||
{
|
||||
E_Configure_Cat *ecat;
|
||||
Eina_List *l;
|
||||
char *cat;
|
||||
const char *item;
|
||||
int ret = 0;
|
||||
|
||||
/* path is "category/item" */
|
||||
cat = ecore_file_dir_get(path);
|
||||
if (!cat) return 0;
|
||||
item = ecore_file_file_get(path);
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
||||
if (!strcmp(cat, ecat->cat))
|
||||
{
|
||||
E_Configure_It *eci;
|
||||
Eina_List *ll;
|
||||
|
||||
if (!item)
|
||||
{
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
EINA_LIST_FOREACH(ecat->items, ll, eci)
|
||||
if (!strcmp(item, eci->item))
|
||||
{
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
free(cat);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_configure_menu_module_item_cb(void *data __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__)
|
||||
{
|
||||
/* e_int_config_modules(m->zone->container, NULL); */
|
||||
}
|
||||
|
||||
static void
|
||||
_e_configure_menu_add(void *data __UNUSED__, E_Menu *m)
|
||||
{
|
||||
E_Menu_Item *mi;
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Modules"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-plugin");
|
||||
e_menu_item_callback_set(mi, _e_configure_menu_module_item_cb, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_configure_job(void *data __UNUSED__)
|
||||
{
|
||||
_e_configure_efreet_desktop_update();
|
||||
update_job = NULL;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_configure_init_timer(void *data __UNUSED__)
|
||||
{
|
||||
handlers = eina_list_append
|
||||
(handlers, ecore_event_handler_add
|
||||
(EFREET_EVENT_DESKTOP_CACHE_UPDATE, _e_configure_cb_efreet_desktop_cache_update, NULL));
|
||||
if (update_job) ecore_job_del(update_job);
|
||||
update_job = ecore_job_add(_configure_job, NULL);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_configure_efreet_desktop_cleanup(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Configure_Cat *ecat;
|
||||
|
||||
// printf("_e_configure_efreet_desktop_cleanup\n");
|
||||
/* remove anything with a desktop entry */
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
||||
{
|
||||
E_Configure_It *eci;
|
||||
Eina_List *ll, *ln;
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(ecat->items, ll, ln, eci)
|
||||
if (eci->desktop)
|
||||
{
|
||||
_e_configure_registry_item_free(eci);
|
||||
ecat->items = eina_list_remove_list(ecat->items, ll);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_configure_efreet_desktop_update(void)
|
||||
{
|
||||
Eina_List *settings_desktops, *system_desktops;
|
||||
Efreet_Desktop *desktop;
|
||||
Eina_List *l;
|
||||
char buf[1024];
|
||||
|
||||
/* get desktops */
|
||||
settings_desktops = efreet_util_desktop_category_list("Settings");
|
||||
system_desktops = efreet_util_desktop_category_list("System");
|
||||
if ((!settings_desktops) || (!system_desktops))
|
||||
{
|
||||
EINA_LIST_FREE(settings_desktops, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
EINA_LIST_FREE(system_desktops, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
return;
|
||||
}
|
||||
|
||||
/* get ones in BOTH lists */
|
||||
EINA_LIST_FOREACH(settings_desktops, l, desktop)
|
||||
{
|
||||
char *s;
|
||||
char *cfg_cat_name;
|
||||
const char *cfg_cat_icon;
|
||||
char *cfg_cat;
|
||||
char *cfg_cat_cfg;
|
||||
const char *cfg_icon;
|
||||
char *label;
|
||||
int cfg_pri;
|
||||
int dopref;
|
||||
|
||||
dopref = 0;
|
||||
cfg_cat = NULL;
|
||||
cfg_icon = NULL;
|
||||
cfg_cat_cfg = NULL;
|
||||
cfg_pri = 1000;
|
||||
cfg_cat_name = NULL;
|
||||
cfg_cat_icon = NULL;
|
||||
label = NULL;
|
||||
if (!eina_list_data_find(system_desktops, desktop))
|
||||
{
|
||||
/* settings desktop but not in system -> put in preferences */
|
||||
dopref = 1;
|
||||
}
|
||||
if (desktop->x)
|
||||
{
|
||||
cfg_cat_cfg = eina_hash_find(desktop->x, "X-Enlightenment-Config-Category");
|
||||
s = eina_hash_find(desktop->x, "X-Enlightenment-Config-Priority");
|
||||
if (s) cfg_pri = atoi(s);
|
||||
cfg_cat_name = eina_hash_find(desktop->x, "X-Enlightenment-Config-Category-Name");
|
||||
cfg_cat_icon = eina_hash_find(desktop->x, "X-Enlightenment-Config-Category-Icon");
|
||||
if ((cfg_cat_icon) && (cfg_cat_icon[0] != '/'))
|
||||
cfg_cat_icon = efreet_icon_path_find(e_config->icon_theme,
|
||||
cfg_cat_icon, 64);
|
||||
}
|
||||
if (desktop->icon)
|
||||
{
|
||||
if (desktop->icon[0] == '/')
|
||||
cfg_icon = desktop->icon;
|
||||
else
|
||||
cfg_icon = efreet_icon_path_find(e_config->icon_theme,
|
||||
desktop->icon, 64);
|
||||
}
|
||||
if (desktop->name) label = desktop->name;
|
||||
else if (desktop->generic_name)
|
||||
label = desktop->generic_name;
|
||||
else label = "???";
|
||||
if (!cfg_cat_cfg)
|
||||
{
|
||||
const char *ic = cfg_cat_icon;
|
||||
|
||||
if (dopref)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "preferences/%s", label);
|
||||
if (!ic) ic = "preferences-preferences";
|
||||
e_configure_registry_category_add("preferences", 900,
|
||||
_("Preferences"),
|
||||
NULL, ic);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "system/%s", label);
|
||||
if (!ic) ic = "preferences-system";
|
||||
e_configure_registry_category_add("system", 1000,
|
||||
_("System"),
|
||||
NULL, ic);
|
||||
}
|
||||
cfg_cat_cfg = buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg_cat = ecore_file_dir_get(cfg_cat_cfg);
|
||||
if (!cfg_cat) cfg_cat = strdup(cfg_cat_cfg);
|
||||
if (cfg_cat)
|
||||
{
|
||||
if (!cfg_cat_name) cfg_cat_name = cfg_cat;
|
||||
e_configure_registry_category_add(cfg_cat,
|
||||
1000, cfg_cat_name,
|
||||
NULL, cfg_cat_icon);
|
||||
free(cfg_cat);
|
||||
cfg_cat = NULL;
|
||||
}
|
||||
}
|
||||
_e_configure_registry_item_full_add(cfg_cat_cfg, cfg_pri, label,
|
||||
NULL, cfg_icon,
|
||||
NULL, NULL, desktop, NULL);
|
||||
}
|
||||
EINA_LIST_FREE(settings_desktops, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
EINA_LIST_FREE(system_desktops, desktop)
|
||||
efreet_desktop_free(desktop);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_configure_cb_efreet_desktop_cache_update(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||
{
|
||||
_e_configure_efreet_desktop_cleanup();
|
||||
if (update_job) ecore_job_del(update_job);
|
||||
update_job = ecore_job_add(_configure_job, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_configure_compare_cb(E_Configure_It *eci, E_Configure_It *eci2)
|
||||
{
|
||||
return e_util_strcasecmp(eci->label, eci2->label);
|
||||
}
|
||||
|
||||
static int
|
||||
_e_configure_compare_pri_cb(E_Configure_It *eci, E_Configure_It *eci2)
|
||||
{
|
||||
if (eci->pri == eci2->pri)
|
||||
return strcmp(eci->label, eci2->label);
|
||||
return eci->pri - eci2->pri;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_configure_registry_item_full_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func)(E_Container * con, const char *params), void (*generic_func)(E_Container *con, const char *params), Efreet_Desktop *desktop, const char *params)
|
||||
{
|
||||
Eina_List *l;
|
||||
char *cat;
|
||||
const char *item;
|
||||
E_Configure_It *eci;
|
||||
E_Configure_Cat *ecat;
|
||||
Eina_Bool external;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(path);
|
||||
EINA_SAFETY_ON_NULL_RETURN(label);
|
||||
/* path is "category/item" */
|
||||
cat = ecore_file_dir_get(path);
|
||||
if (!cat) return;
|
||||
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat)
|
||||
{
|
||||
if (strcmp(cat, ecat->cat)) continue;
|
||||
item = ecore_file_file_get(path);
|
||||
eci = E_NEW(E_Configure_It, 1);
|
||||
|
||||
eci->item = eina_stringshare_add(item);
|
||||
eci->pri = pri;
|
||||
eci->label = eina_stringshare_add(label);
|
||||
if (icon_file) eci->icon_file = eina_stringshare_add(icon_file);
|
||||
if (icon) eci->icon = eina_stringshare_add(icon);
|
||||
if (params) eci->params = eina_stringshare_add(params);
|
||||
eci->func = func;
|
||||
eci->generic_func = generic_func;
|
||||
eci->desktop = desktop;
|
||||
if (eci->desktop) efreet_desktop_ref(eci->desktop);
|
||||
external = !strncmp(path, "preferences/", sizeof("preferences/") - 1);
|
||||
if (!external) external = !strncmp(path, "system/", sizeof("system/") - 1);
|
||||
if (external)
|
||||
ecat->items = eina_list_sorted_insert(ecat->items, EINA_COMPARE_CB(_e_configure_compare_cb), eci);
|
||||
else
|
||||
ecat->items = eina_list_sorted_insert(ecat->items, EINA_COMPARE_CB(_e_configure_compare_pri_cb), eci);
|
||||
break;
|
||||
}
|
||||
free(cat);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_configure_registry_item_free(E_Configure_It *eci)
|
||||
{
|
||||
eina_stringshare_del(eci->item);
|
||||
eina_stringshare_del(eci->label);
|
||||
eina_stringshare_del(eci->icon);
|
||||
if (eci->icon_file) eina_stringshare_del(eci->icon_file);
|
||||
if (eci->desktop) efreet_desktop_free(eci->desktop);
|
||||
if (eci->params) eina_stringshare_del(eci->params);
|
||||
free(eci);
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Configure_Cat E_Configure_Cat;
|
||||
typedef struct _E_Configure_It E_Configure_It;
|
||||
|
||||
#else
|
||||
#ifndef E_CONFIGURE_H
|
||||
#define E_CONFIGURE_H
|
||||
|
||||
struct _E_Configure_Cat
|
||||
{
|
||||
const char *cat;
|
||||
int pri;
|
||||
const char *label;
|
||||
const char *icon_file;
|
||||
const char *icon;
|
||||
Eina_List *items;
|
||||
};
|
||||
|
||||
struct _E_Configure_It
|
||||
{
|
||||
const char *item;
|
||||
int pri;
|
||||
const char *label;
|
||||
const char *icon_file;
|
||||
const char *icon;
|
||||
const char *params;
|
||||
E_Config_Dialog *(*func) (E_Container *con, const char *params);
|
||||
void (*generic_func) (E_Container *con, const char *params);
|
||||
Efreet_Desktop *desktop;
|
||||
};
|
||||
|
||||
EAPI void e_configure_registry_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params));
|
||||
EAPI void e_configure_registry_item_params_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, E_Config_Dialog *(*func) (E_Container *con, const char *params), const char *params);
|
||||
EAPI void e_configure_registry_generic_item_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon, void (*generic_func) (E_Container *con, const char *params));
|
||||
EAPI void e_configure_registry_item_del(const char *path);
|
||||
EAPI void e_configure_registry_category_add(const char *path, int pri, const char *label, const char *icon_file, const char *icon);
|
||||
EAPI void e_configure_registry_category_del(const char *path);
|
||||
EAPI void e_configure_registry_call(const char *path, E_Container *con, const char *params);
|
||||
EAPI int e_configure_registry_exists(const char *path);
|
||||
EAPI void e_configure_registry_custom_desktop_exec_callback_set(void (*func) (const void *data, E_Container *con, const char *params, Efreet_Desktop *desktop), const void *data);
|
||||
EINTERN void e_configure_init(void);
|
||||
|
||||
extern EAPI Eina_List *e_configure_registry;
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,298 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_container_cb_free(E_Container *con);
|
||||
static Eina_Bool _e_container_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||
static E_Container *_e_container_find_by_event_window(unsigned int win);
|
||||
|
||||
/* local variables */
|
||||
static Eina_List *_hdlrs = NULL;
|
||||
|
||||
EINTERN int
|
||||
e_container_init(void)
|
||||
{
|
||||
E_LIST_HANDLER_APPEND(_hdlrs, ECORE_WL_EVENT_MOUSE_IN,
|
||||
_e_container_cb_mouse_in, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_container_shutdown(void)
|
||||
{
|
||||
E_FREE_LIST(_hdlrs, ecore_event_handler_del);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI E_Container *
|
||||
e_container_new(E_Manager *man)
|
||||
{
|
||||
E_Container *con;
|
||||
E_Output *output;
|
||||
Eina_List *l;
|
||||
static unsigned int con_num = 0;
|
||||
int num = 0;
|
||||
|
||||
/* check for valid manager */
|
||||
E_OBJECT_CHECK_RETURN(man, NULL);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL);
|
||||
|
||||
/* try to allocate a new container object */
|
||||
if (!(con = E_OBJECT_ALLOC(E_Container, E_CONTAINER_TYPE,
|
||||
_e_container_cb_free)))
|
||||
return NULL;
|
||||
|
||||
/* set container properties */
|
||||
con->man = man;
|
||||
con->x = man->x;
|
||||
con->y = man->y;
|
||||
con->w = man->w;
|
||||
con->h = man->h;
|
||||
con->num = con_num;
|
||||
con_num++;
|
||||
|
||||
/* add this container to the managers list */
|
||||
man->containers = eina_list_append(man->containers, con);
|
||||
|
||||
/* create the containers canvas */
|
||||
con->bg_ee =
|
||||
e_canvas_new(0, con->x, con->y, con->w, con->h,
|
||||
EINA_FALSE, EINA_FALSE, &con->win);
|
||||
e_canvas_add(con->bg_ee);
|
||||
|
||||
/* set some properties on the ecore_evas */
|
||||
ecore_evas_name_class_set(con->bg_ee, "E", "Background Window");
|
||||
ecore_evas_title_set(con->bg_ee, "Enlightenment Background");
|
||||
|
||||
/* get the container window */
|
||||
/* con->win = ecore_evas_wayland_window_get(con->bg_ee)->id; */
|
||||
|
||||
/* get the background canvas */
|
||||
con->bg_evas = ecore_evas_get(con->bg_ee);
|
||||
|
||||
con->o_blank = evas_object_rectangle_add(con->bg_evas);
|
||||
evas_object_layer_set(con->o_blank, -100);
|
||||
evas_object_move(con->o_blank, con->x, con->y);
|
||||
evas_object_resize(con->o_blank, con->w, con->h);
|
||||
evas_object_color_set(con->o_blank, 255, 0, 0, 255);
|
||||
evas_object_name_set(con->o_blank, "e/desktop/background");
|
||||
evas_object_data_set(con->o_blank, "e_container", con);
|
||||
evas_object_show(con->o_blank);
|
||||
|
||||
EINA_LIST_FOREACH(_e_comp->outputs, l, output)
|
||||
{
|
||||
e_zone_new(con, num, output->x, output->y,
|
||||
output->current->w, output->current->h);
|
||||
num++;
|
||||
}
|
||||
|
||||
return con;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_container_show(E_Container *con)
|
||||
{
|
||||
E_Zone *zone;
|
||||
Eina_List *l;
|
||||
|
||||
/* check for valid container */
|
||||
E_OBJECT_CHECK(con);
|
||||
E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
|
||||
|
||||
/* check for already visible */
|
||||
if (con->visible) return;
|
||||
|
||||
/* show the ecore_evas */
|
||||
ecore_evas_show(con->bg_ee);
|
||||
|
||||
/* show zones */
|
||||
EINA_LIST_FOREACH(con->zones, l, zone)
|
||||
e_zone_show(zone);
|
||||
|
||||
/* check for valid pointer */
|
||||
if (!con->ptr)
|
||||
{
|
||||
/* create new pointer */
|
||||
con->ptr = e_pointer_new(con->win, EINA_TRUE);
|
||||
}
|
||||
|
||||
con->visible = EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_container_hide(E_Container *con)
|
||||
{
|
||||
E_Zone *zone;
|
||||
Eina_List *l;
|
||||
|
||||
/* check for valid container */
|
||||
E_OBJECT_CHECK(con);
|
||||
E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
|
||||
|
||||
/* check for already invisible */
|
||||
if (!con->visible) return;
|
||||
|
||||
/* hide zones */
|
||||
EINA_LIST_FOREACH(con->zones, l, zone)
|
||||
e_zone_hide(zone);
|
||||
|
||||
/* hide the ecore_evas */
|
||||
ecore_evas_hide(con->bg_ee);
|
||||
|
||||
con->visible = EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_container_all_freeze(void)
|
||||
{
|
||||
Eina_List *l, *ll;
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
|
||||
/* loop the managers */
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
{
|
||||
/* loop the containers */
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
{
|
||||
/* freeze events on the canvas */
|
||||
if (con->bg_evas) evas_event_freeze(con->bg_evas);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_container_all_thaw(void)
|
||||
{
|
||||
Eina_List *l, *ll;
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
|
||||
/* loop the managers */
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
{
|
||||
/* loop the containers */
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
{
|
||||
/* thaw events on the canvas */
|
||||
if (con->bg_evas) evas_event_thaw(con->bg_evas);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI E_Container *
|
||||
e_container_current_get(E_Manager *man)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Container *con;
|
||||
|
||||
E_OBJECT_CHECK_RETURN(man, NULL);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL);
|
||||
|
||||
EINA_LIST_FOREACH(man->containers, l, con)
|
||||
{
|
||||
if (!con) continue;
|
||||
if (con->visible) return con;
|
||||
}
|
||||
|
||||
if (!man->containers) return NULL;
|
||||
l = man->containers;
|
||||
|
||||
return (E_Container *)eina_list_data_get(l);
|
||||
}
|
||||
|
||||
EAPI E_Container *
|
||||
e_container_number_get(E_Manager *man, int num)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Container *con;
|
||||
|
||||
E_OBJECT_CHECK_RETURN(man, NULL);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL);
|
||||
|
||||
EINA_LIST_FOREACH(man->containers, l, con)
|
||||
if ((int)con->num == num) return con;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI E_Zone *
|
||||
e_container_zone_number_get(E_Container *con, int num)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Zone *zone;
|
||||
|
||||
E_OBJECT_CHECK_RETURN(con, NULL);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL);
|
||||
|
||||
EINA_LIST_FOREACH(con->zones, l, zone)
|
||||
if (((int)zone->num == num)) return zone;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_container_cb_free(E_Container *con)
|
||||
{
|
||||
/* TODO: free zones */
|
||||
|
||||
/* remove this container from the managers list */
|
||||
con->man->containers = eina_list_remove(con->man->containers, con);
|
||||
|
||||
/* delete the pointer object */
|
||||
if (con->ptr) e_object_del(E_OBJECT(con->ptr));
|
||||
|
||||
if (con->bg_ee)
|
||||
{
|
||||
/* delete the canvas */
|
||||
e_canvas_del(con->bg_ee);
|
||||
|
||||
/* free the ecore_evas */
|
||||
ecore_evas_free(con->bg_ee);
|
||||
}
|
||||
|
||||
/* free the object */
|
||||
E_FREE(con);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_container_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Wl_Event_Mouse_In *ev;
|
||||
E_Container *con;
|
||||
|
||||
ev = event;
|
||||
|
||||
if (!(con = _e_container_find_by_event_window(ev->window)))
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
if (con->ptr)
|
||||
{
|
||||
E_Pointer *ptr;
|
||||
struct wl_surface *surf;
|
||||
|
||||
ptr = con->ptr;
|
||||
surf = ecore_wl_window_surface_get(ptr->win);
|
||||
ecore_wl_window_pointer_set(ptr->win, surf, ptr->hot.x, ptr->hot.y);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static E_Container *
|
||||
_e_container_find_by_event_window(unsigned int win)
|
||||
{
|
||||
Eina_List *l, *ll;
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
{
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
if (con->win->id == (int)win) return con;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Container E_Container;
|
||||
|
||||
#else
|
||||
# ifndef E_CONTAINER_H
|
||||
# define E_CONTAINER_H
|
||||
|
||||
# define E_CONTAINER_TYPE 0xE0b01003
|
||||
|
||||
struct _E_Container
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
unsigned int num;
|
||||
Evas_Coord x, y, w, h;
|
||||
Eina_Bool visible : 1;
|
||||
|
||||
Ecore_Wl_Window *win;
|
||||
E_Manager *man;
|
||||
|
||||
Ecore_Evas *bg_ee;
|
||||
Evas *bg_evas;
|
||||
Evas_Object *o_blank;
|
||||
|
||||
E_Pointer *ptr;
|
||||
|
||||
Eina_List *zones;
|
||||
};
|
||||
|
||||
EINTERN int e_container_init(void);
|
||||
EINTERN int e_container_shutdown(void);
|
||||
|
||||
EAPI E_Container *e_container_new(E_Manager *man);
|
||||
EAPI void e_container_show(E_Container *con);
|
||||
EAPI void e_container_hide(E_Container *con);
|
||||
EAPI void e_container_all_freeze(void);
|
||||
EAPI void e_container_all_thaw(void);
|
||||
EAPI E_Container *e_container_current_get(E_Manager *man);
|
||||
EAPI E_Container *e_container_number_get(E_Manager *man, int num);
|
||||
EAPI E_Zone *e_container_zone_number_get(E_Container *con, int num);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,93 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static void _e_desk_cb_free(E_Desk *desk);
|
||||
|
||||
EINTERN int
|
||||
e_desk_init(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_desk_shutdown(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI E_Desk *
|
||||
e_desk_new(E_Zone *zone, int x, int y)
|
||||
{
|
||||
E_Desk *desk;
|
||||
|
||||
E_OBJECT_CHECK_RETURN(zone, NULL);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
|
||||
|
||||
desk = E_OBJECT_ALLOC(E_Desk, E_DESK_TYPE, _e_desk_cb_free);
|
||||
if (!desk)
|
||||
{
|
||||
printf("FAILED TO ALLOCATE DESK\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printf("Created New Desktop: %d %d\n", x, y);
|
||||
|
||||
desk->zone = zone;
|
||||
desk->x = x;
|
||||
desk->y = y;
|
||||
|
||||
return desk;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_desk_show(E_Desk *desk)
|
||||
{
|
||||
E_OBJECT_CHECK(desk);
|
||||
E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE);
|
||||
|
||||
if (desk->visible) return;
|
||||
|
||||
desk->visible = EINA_TRUE;
|
||||
e_bg_zone_update(desk->zone, E_BG_TRANSITION_START);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_desk_hide(E_Desk *desk)
|
||||
{
|
||||
E_OBJECT_CHECK(desk);
|
||||
E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE);
|
||||
|
||||
if (!desk->visible) return;
|
||||
|
||||
desk->visible = EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI E_Desk *
|
||||
e_desk_current_get(E_Zone *zone)
|
||||
{
|
||||
E_OBJECT_CHECK_RETURN(zone, NULL);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
|
||||
|
||||
return e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current);
|
||||
}
|
||||
|
||||
EAPI E_Desk *
|
||||
e_desk_at_xy_get(E_Zone *zone, int x, int y)
|
||||
{
|
||||
E_OBJECT_CHECK_RETURN(zone, NULL);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
|
||||
|
||||
if ((x >= zone->desk_x_count) || (y >= zone->desk_y_count))
|
||||
return NULL;
|
||||
else if ((x < 0) || (y < 0))
|
||||
return NULL;
|
||||
|
||||
return zone->desks[x + (y * zone->desk_x_count)];
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_desk_cb_free(E_Desk *desk)
|
||||
{
|
||||
free(desk);
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Desk E_Desk;
|
||||
typedef struct _E_Event_Desk_Show E_Event_Desk_Show;
|
||||
|
||||
#else
|
||||
# ifndef E_DESK_H
|
||||
# define E_DESK_H
|
||||
|
||||
# define E_DESK_TYPE 0xE0b01005
|
||||
|
||||
struct _E_Desk
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
E_Zone *zone;
|
||||
int x, y;
|
||||
const char *name;
|
||||
Eina_Bool visible : 1;
|
||||
Evas_Object *o_bg;
|
||||
};
|
||||
|
||||
struct _E_Event_Desk_Show
|
||||
{
|
||||
E_Desk *desk;
|
||||
};
|
||||
|
||||
extern EAPI int E_EVENT_DESK_SHOW;
|
||||
|
||||
EINTERN int e_desk_init(void);
|
||||
EINTERN int e_desk_shutdown(void);
|
||||
|
||||
EAPI E_Desk *e_desk_new(E_Zone *zone, int x, int y);
|
||||
EAPI void e_desk_show(E_Desk *desk);
|
||||
EAPI void e_desk_hide(E_Desk *desk);
|
||||
EAPI E_Desk *e_desk_current_get(E_Zone *zone);
|
||||
EAPI E_Desk *e_desk_at_xy_get(E_Zone *zone, int x, int y);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,219 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local function prototypes */
|
||||
static E_Dialog *_e_dialog_internal_new(E_Container *con, const char *name, const char *class, Eina_Bool dialog);
|
||||
static void _e_dialog_cb_free(E_Dialog *dia);
|
||||
|
||||
EAPI E_Dialog *
|
||||
e_dialog_new(E_Container *con, const char *name, const char *class)
|
||||
{
|
||||
return _e_dialog_internal_new(con, name, class, EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI E_Dialog *
|
||||
e_dialog_normal_win_new(E_Container *con, const char *name, const char *class)
|
||||
{
|
||||
return _e_dialog_internal_new(con, name, class, EINA_FALSE);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_button_add(E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
/* Evas_Object *o; */
|
||||
|
||||
/* if (!func) func = _e_dialog_cb_delete; */
|
||||
/* TODO: e_widgets */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_dialog_button_focus_num(E_Dialog *dia, int button)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_dialog_button_disable_num_set(E_Dialog *dia, int button, int disabled)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_dialog_button_disable_num_get(E_Dialog *dia, int button)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_title_set(E_Dialog *dia, const char *title)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
e_win_title_set(dia->win, title);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_text_set(E_Dialog *dia, const char *text)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
if (!dia->o_text)
|
||||
{
|
||||
dia->o_text = edje_object_add(dia->win->evas);
|
||||
e_theme_edje_object_set(dia->o_text, "base/theme/dialog",
|
||||
"e/widgets/dialog/text");
|
||||
edje_object_part_swallow(dia->o_bg, "e.swallow.content", dia->o_text);
|
||||
evas_object_show(dia->o_text);
|
||||
}
|
||||
edje_object_part_text_set(dia->o_text, "e.textblock.message", text);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_icon_set(E_Dialog *dia, const char *icon, Evas_Coord size)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
/* TODO: e_icon */
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_border_icon_set(E_Dialog *dia, const char *icon)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_content_set(E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
dia->o_content = obj;
|
||||
/* TODO: e_widget on focus_hook */
|
||||
edje_extern_object_min_size_set(obj, minw, minh);
|
||||
edje_object_part_swallow(dia->o_bg, "e.swallow.content", obj);
|
||||
evas_object_show(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_resizable_set(E_Dialog *dia, int resizable)
|
||||
{
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
dia->resizable = resizable;
|
||||
if (dia->win)
|
||||
{
|
||||
/* TODO: Finish */
|
||||
/* if (resizable) */
|
||||
/* { */
|
||||
/* } */
|
||||
/* else */
|
||||
/* { */
|
||||
/* } */
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_show(E_Dialog *dia)
|
||||
{
|
||||
Evas_Coord mw, mh;
|
||||
|
||||
E_OBJECT_CHECK(dia);
|
||||
E_OBJECT_TYPE_CHECK(dia, E_DIALOG_TYPE);
|
||||
|
||||
if (dia->o_text)
|
||||
{
|
||||
edje_object_size_min_calc(dia->o_text, &mw, &mh);
|
||||
edje_extern_object_min_size_set(dia->o_text, mw, mh);
|
||||
edje_object_part_swallow(dia->o_bg, "e.swallow.content", dia->o_text);
|
||||
}
|
||||
|
||||
/* TODO: e_widget_size_min_get */
|
||||
|
||||
e_win_show(dia->win);
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static E_Dialog *
|
||||
_e_dialog_internal_new(E_Container *con, const char *name, const char *class, Eina_Bool dialog)
|
||||
{
|
||||
E_Dialog *dia;
|
||||
|
||||
if (!con)
|
||||
{
|
||||
E_Manager *man;
|
||||
|
||||
if (!(man = e_manager_current_get())) return NULL;
|
||||
if (!(con = e_container_current_get(man)))
|
||||
con = e_container_number_get(man, 0);
|
||||
if (!con) return NULL;
|
||||
}
|
||||
|
||||
dia = E_OBJECT_ALLOC(E_Dialog, E_DIALOG_TYPE, _e_dialog_cb_free);
|
||||
if (!dia) return NULL;
|
||||
|
||||
if (!(dia->win = e_win_new(con)))
|
||||
{
|
||||
free(dia);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* TODO: e_win callbacks */
|
||||
dia->win->data = dia;
|
||||
|
||||
e_win_dialog_set(dia->win, dialog);
|
||||
e_win_name_class_set(dia->win, name, class);
|
||||
|
||||
dia->o_bg = edje_object_add(dia->win->evas);
|
||||
e_theme_edje_object_set(dia->o_bg, "base/theme/dialog",
|
||||
"e/widgets/dialog/main");
|
||||
evas_object_move(dia->o_bg, 0, 0);
|
||||
evas_object_show(dia->o_bg);
|
||||
|
||||
/* TODO: box object & event object */
|
||||
|
||||
return dia;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_dialog_cb_free(E_Dialog *dia)
|
||||
{
|
||||
if (dia->buttons)
|
||||
{
|
||||
E_FREE_LIST(dia->buttons, evas_object_del);
|
||||
/* Eina_List *l; */
|
||||
/* Evas_Object *o; */
|
||||
|
||||
/* EINA_LIST_FOREACH(dia->buttons, l, o) */
|
||||
/* evas_object_del(o); */
|
||||
|
||||
/* eina_list_free(dia->buttons); */
|
||||
}
|
||||
|
||||
if (dia->o_text) evas_object_del(dia->o_text);
|
||||
if (dia->o_icon) evas_object_del(dia->o_icon);
|
||||
if (dia->o_box) evas_object_del(dia->o_box);
|
||||
if (dia->o_bg) evas_object_del(dia->o_bg);
|
||||
if (dia->o_content) evas_object_del(dia->o_content);
|
||||
if (dia->o_event) evas_object_del(dia->o_event);
|
||||
|
||||
e_object_del(E_OBJECT(dia->win));
|
||||
free(dia);
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Dialog E_Dialog;
|
||||
|
||||
#else
|
||||
# ifndef E_DIALOG_H
|
||||
# define E_DIALOG_H
|
||||
|
||||
# define E_DIALOG_TYPE 0xE0b01012
|
||||
|
||||
struct _E_Dialog
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
E_Win *win;
|
||||
Evas_Object *o_bg, *o_box;
|
||||
Evas_Object *o_text, *o_content;
|
||||
Evas_Object *o_icon, *o_event;
|
||||
Eina_List *buttons;
|
||||
void *data;
|
||||
int min_w, min_h;
|
||||
Eina_Bool resizable : 1;
|
||||
};
|
||||
|
||||
EAPI E_Dialog *e_dialog_new(E_Container *con, const char *name, const char *class);
|
||||
EAPI E_Dialog *e_dialog_normal_win_new(E_Container *con, const char *name, const char *class);
|
||||
EAPI void e_dialog_button_add(E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data);
|
||||
EAPI int e_dialog_button_focus_num(E_Dialog *dia, int button);
|
||||
EAPI int e_dialog_button_disable_num_set(E_Dialog *dia, int button, int disabled);
|
||||
EAPI int e_dialog_button_disable_num_get(E_Dialog *dia, int button);
|
||||
EAPI void e_dialog_title_set(E_Dialog *dia, const char *title);
|
||||
EAPI void e_dialog_text_set(E_Dialog *dia, const char *text);
|
||||
EAPI void e_dialog_icon_set(E_Dialog *dia, const char *icon, Evas_Coord size);
|
||||
EAPI void e_dialog_border_icon_set(E_Dialog *dia, const char *icon);
|
||||
EAPI void e_dialog_content_set(E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
|
||||
EAPI void e_dialog_resizable_set(E_Dialog *dia, int resizable);
|
||||
EAPI void e_dialog_show(E_Dialog *dia);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,32 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local subsystem functions */
|
||||
|
||||
/* externally accessible functions */
|
||||
EINTERN int
|
||||
e_env_init(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Config_Env_Var *evr;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->env_vars, l, evr)
|
||||
{
|
||||
if (evr->unset)
|
||||
e_util_env_set(evr->var, NULL);
|
||||
else
|
||||
e_util_env_set(evr->var, evr->val);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_env_shutdown(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Config_Env_Var *evr;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->env_vars, l, evr)
|
||||
e_util_env_set(evr->var, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
#else
|
||||
# ifndef E_ENV_H
|
||||
# define E_ENV_H
|
||||
|
||||
/* init and setup */
|
||||
EINTERN int e_env_init(void);
|
||||
EINTERN int e_env_shutdown(void);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
#include "e.h"
|
||||
|
||||
/* local subsystem functions */
|
||||
|
||||
/* local subsystem globals */
|
||||
|
||||
/* externally accessible functions */
|
||||
EAPI void
|
||||
e_error_message_show_internal(char *txt)
|
||||
{
|
||||
/* FIXME: maybe log these to a file and display them at some point */
|
||||
printf("<<<< Enlightenment Error >>>>\n%s\n", txt);
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
|
@ -0,0 +1,17 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
# define e_error_message_show(args...) do \
|
||||
{ \
|
||||
char __tmpbuf[PATH_MAX]; \
|
||||
snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
|
||||
e_error_message_show_internal(__tmpbuf); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
# ifndef E_ERROR_H
|
||||
# define E_ERROR_H
|
||||
|
||||
EAPI void e_error_message_show_internal(char *txt);
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,64 @@
|
|||
#include "e.h"
|
||||
|
||||
#define MAX_OUTPUT_CHARACTERS 5000
|
||||
|
||||
/* externally accessible functions */
|
||||
EINTERN int
|
||||
e_exec_init(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_exec_shutdown(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exec_executor_set(E_Exec_Instance *(*func)(void *data, E_Zone * zone, Efreet_Desktop * desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EAPI E_Exec_Instance *
|
||||
e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI E_Exec_Instance *
|
||||
e_exec_startup_id_pid_instance_find(int id, pid_t pid)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Efreet_Desktop *
|
||||
e_exec_startup_id_pid_find(int id, pid_t pid)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI E_Exec_Instance *
|
||||
e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exec_instance_found(E_Exec_Instance *inst)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func)(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exec_instance_watcher_del(E_Exec_Instance *inst, void (*func)(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data)
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Exec_Instance E_Exec_Instance;
|
||||
|
||||
#else
|
||||
#ifndef E_EXEC_H
|
||||
#define E_EXEC_H
|
||||
|
||||
struct _E_Exec_Instance
|
||||
{
|
||||
Efreet_Desktop *desktop;
|
||||
const char *key;
|
||||
Ecore_Exe *exe;
|
||||
int startup_id;
|
||||
double launch_time;
|
||||
Ecore_Timer *expire_timer;
|
||||
int screen;
|
||||
int desk_x, desk_y;
|
||||
int used;
|
||||
int walking;
|
||||
Eina_List *watchers;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_EXEC_WATCH_STARTED,
|
||||
E_EXEC_WATCH_STOPPED,
|
||||
E_EXEC_WATCH_TIMEOUT
|
||||
} E_Exec_Watch_Type;
|
||||
|
||||
EINTERN int e_exec_init(void);
|
||||
EINTERN int e_exec_shutdown(void);
|
||||
EAPI void e_exec_executor_set(E_Exec_Instance *(*func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data);
|
||||
EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method);
|
||||
EAPI E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid);
|
||||
EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid);
|
||||
EAPI E_Exec_Instance *e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop);
|
||||
EAPI void e_exec_instance_found(E_Exec_Instance *inst);
|
||||
EAPI void e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data);
|
||||
EAPI void e_exec_instance_watcher_del(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,539 @@
|
|||
#include "e.h"
|
||||
#include <libgen.h>
|
||||
|
||||
EAPI int E_EVENT_EXEHIST_UPDATE = 0;
|
||||
|
||||
/* local subsystem functions */
|
||||
typedef struct _E_Exehist E_Exehist;
|
||||
typedef struct _E_Exehist_Item E_Exehist_Item;
|
||||
|
||||
struct _E_Exehist
|
||||
{
|
||||
Eina_List *history;
|
||||
Eina_List *mimes;
|
||||
};
|
||||
|
||||
struct _E_Exehist_Item
|
||||
{
|
||||
const char *exe;
|
||||
const char *normalized_exe;
|
||||
const char *launch_method;
|
||||
double exetime;
|
||||
unsigned int count;
|
||||
};
|
||||
|
||||
static void _e_exehist_unload_queue(void);
|
||||
static void _e_exehist_load(void);
|
||||
static void _e_exehist_clear(void);
|
||||
static void _e_exehist_unload(void);
|
||||
static void _e_exehist_limit(void);
|
||||
static const char *_e_exehist_normalize_exe(const char *exe);
|
||||
static void _e_exehist_cb_unload(void *data);
|
||||
static int _e_exehist_sort_exe_cb(const void *d1, const void *d2);
|
||||
static int _e_exehist_sort_pop_cb(const void *d1, const void *d2);
|
||||
|
||||
/* local subsystem globals */
|
||||
static E_Config_DD *_e_exehist_config_edd = NULL;
|
||||
static E_Config_DD *_e_exehist_config_item_edd = NULL;
|
||||
static E_Exehist *_e_exehist = NULL;
|
||||
static E_Powersave_Deferred_Action *_e_exehist_unload_defer = NULL;
|
||||
static int _e_exehist_changes = 0;
|
||||
|
||||
/* externally accessible functions */
|
||||
EINTERN int
|
||||
e_exehist_init(void)
|
||||
{
|
||||
_e_exehist_config_item_edd = E_CONFIG_DD_NEW("E_Exehist_Item", E_Exehist_Item);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T E_Exehist_Item
|
||||
#define D _e_exehist_config_item_edd
|
||||
E_CONFIG_VAL(D, T, exe, STR);
|
||||
E_CONFIG_VAL(D, T, normalized_exe, STR);
|
||||
E_CONFIG_VAL(D, T, launch_method, STR);
|
||||
E_CONFIG_VAL(D, T, exetime, DOUBLE);
|
||||
|
||||
_e_exehist_config_edd = E_CONFIG_DD_NEW("E_Exehist", E_Exehist);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T E_Exehist
|
||||
#define D _e_exehist_config_edd
|
||||
E_CONFIG_LIST(D, T, history, _e_exehist_config_item_edd);
|
||||
E_CONFIG_LIST(D, T, mimes, _e_exehist_config_item_edd);
|
||||
|
||||
E_EVENT_EXEHIST_UPDATE = ecore_event_type_new();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_exehist_shutdown(void)
|
||||
{
|
||||
if (_e_exehist_unload_defer)
|
||||
{
|
||||
e_powersave_deferred_action_del(_e_exehist_unload_defer);
|
||||
_e_exehist_unload_defer = NULL;
|
||||
}
|
||||
_e_exehist_cb_unload(NULL);
|
||||
E_CONFIG_DD_FREE(_e_exehist_config_item_edd);
|
||||
E_CONFIG_DD_FREE(_e_exehist_config_edd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exehist_add(const char *launch_method, const char *exe)
|
||||
{
|
||||
E_Exehist_Item *ei;
|
||||
|
||||
_e_exehist_load();
|
||||
if (!_e_exehist) return;
|
||||
ei = E_NEW(E_Exehist_Item, 1);
|
||||
if (!ei)
|
||||
{
|
||||
_e_exehist_unload_queue();
|
||||
return;
|
||||
}
|
||||
ei->launch_method = eina_stringshare_add(launch_method);
|
||||
ei->exe = eina_stringshare_add(exe);
|
||||
ei->normalized_exe = _e_exehist_normalize_exe(exe);
|
||||
ei->exetime = ecore_time_unix_get();
|
||||
_e_exehist->history = eina_list_append(_e_exehist->history, ei);
|
||||
_e_exehist_limit();
|
||||
_e_exehist_changes++;
|
||||
ecore_event_add(E_EVENT_EXEHIST_UPDATE, NULL, NULL, NULL);
|
||||
_e_exehist_unload_queue();
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exehist_del(const char *exe)
|
||||
{
|
||||
E_Exehist_Item *ei;
|
||||
Eina_List *l;
|
||||
Eina_Bool ok = EINA_FALSE;
|
||||
|
||||
_e_exehist_load();
|
||||
if (!_e_exehist) return;
|
||||
EINA_LIST_FOREACH(_e_exehist->history, l, ei)
|
||||
{
|
||||
if ((ei->exe) && (!strcmp(exe, ei->exe)))
|
||||
{
|
||||
eina_stringshare_del(ei->exe);
|
||||
eina_stringshare_del(ei->normalized_exe);
|
||||
eina_stringshare_del(ei->launch_method);
|
||||
free(ei);
|
||||
_e_exehist->history = eina_list_remove_list(_e_exehist->history,
|
||||
l);
|
||||
_e_exehist_changes++;
|
||||
_e_exehist_unload_queue();
|
||||
ok = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
if (ok)
|
||||
ecore_event_add(E_EVENT_EXEHIST_UPDATE, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exehist_clear(void)
|
||||
{
|
||||
_e_exehist_load();
|
||||
if (!_e_exehist) return;
|
||||
_e_exehist_clear();
|
||||
_e_exehist_changes++;
|
||||
ecore_event_add(E_EVENT_EXEHIST_UPDATE, NULL, NULL, NULL);
|
||||
_e_exehist_unload_queue();
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_exehist_popularity_get(const char *exe)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Exehist_Item *ei;
|
||||
const char *normal;
|
||||
int count = 0;
|
||||
|
||||
_e_exehist_load();
|
||||
if (!_e_exehist) return 0;
|
||||
normal = _e_exehist_normalize_exe(exe);
|
||||
if (!normal) return 0;
|
||||
EINA_LIST_FOREACH(_e_exehist->history, l, ei)
|
||||
{
|
||||
if ((ei->normalized_exe) && (!strcmp(normal, ei->normalized_exe)))
|
||||
count++;
|
||||
}
|
||||
eina_stringshare_del(normal);
|
||||
_e_exehist_unload_queue();
|
||||
return count;
|
||||
}
|
||||
|
||||
EAPI double
|
||||
e_exehist_newest_run_get(const char *exe)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Exehist_Item *ei;
|
||||
const char *normal;
|
||||
|
||||
_e_exehist_load();
|
||||
if (!_e_exehist) return 0.0;
|
||||
normal = _e_exehist_normalize_exe(exe);
|
||||
if (!normal) return 0.0;
|
||||
EINA_LIST_REVERSE_FOREACH(_e_exehist->history, l, ei)
|
||||
{
|
||||
if ((ei->normalized_exe) && (!strcmp(normal, ei->normalized_exe)))
|
||||
{
|
||||
eina_stringshare_del(normal);
|
||||
_e_exehist_unload_queue();
|
||||
return ei->exetime;
|
||||
}
|
||||
}
|
||||
eina_stringshare_del(normal);
|
||||
_e_exehist_unload_queue();
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
e_exehist_list_get(void)
|
||||
{
|
||||
return e_exehist_sorted_list_get(E_EXEHIST_SORT_BY_DATE, 0);
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
e_exehist_sorted_list_get(E_Exehist_Sort sort_type, int max)
|
||||
{
|
||||
Eina_List *list = NULL, *pop = NULL, *l = NULL, *m;
|
||||
Eina_Iterator *iter;
|
||||
E_Exehist_Item *ei;
|
||||
int count = 1;
|
||||
E_Exehist_Item *prev = NULL;
|
||||
|
||||
if (!max) max = 20;
|
||||
_e_exehist_load();
|
||||
switch (sort_type)
|
||||
{
|
||||
case E_EXEHIST_SORT_BY_EXE:
|
||||
case E_EXEHIST_SORT_BY_POPULARITY:
|
||||
l = eina_list_clone(_e_exehist->history);
|
||||
l = eina_list_sort(l, 0, _e_exehist_sort_exe_cb);
|
||||
iter = eina_list_iterator_new(l);
|
||||
break;
|
||||
|
||||
default:
|
||||
iter = eina_list_iterator_reversed_new(_e_exehist->history);
|
||||
break;
|
||||
}
|
||||
EINA_ITERATOR_FOREACH(iter, ei)
|
||||
{
|
||||
int bad = 0;
|
||||
|
||||
if (!(ei->normalized_exe)) continue;
|
||||
if (sort_type == E_EXEHIST_SORT_BY_POPULARITY)
|
||||
{
|
||||
if (!prev || (strcmp(prev->normalized_exe, ei->normalized_exe)))
|
||||
{
|
||||
prev = ei;
|
||||
pop = eina_list_append(pop, ei);
|
||||
}
|
||||
prev->count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *exe;
|
||||
|
||||
EINA_LIST_FOREACH(list, m, exe)
|
||||
{
|
||||
if (!exe) continue;
|
||||
if (!strcmp(exe, ei->exe))
|
||||
{
|
||||
bad = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!(bad))
|
||||
{
|
||||
list = eina_list_append(list, ei->exe);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count > max) break;
|
||||
}
|
||||
if (sort_type == E_EXEHIST_SORT_BY_POPULARITY)
|
||||
{
|
||||
count = 1;
|
||||
pop = eina_list_sort(pop, 0, _e_exehist_sort_pop_cb);
|
||||
EINA_LIST_FOREACH(pop, l, prev)
|
||||
{
|
||||
list = eina_list_append(list, prev->exe);
|
||||
count++;
|
||||
if (count > max) break;
|
||||
}
|
||||
eina_list_free(pop);
|
||||
}
|
||||
eina_list_free(l);
|
||||
eina_iterator_free(iter);
|
||||
_e_exehist_unload_queue();
|
||||
return list;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exehist_mime_desktop_add(const char *mime, Efreet_Desktop *desktop)
|
||||
{
|
||||
const char *f;
|
||||
E_Exehist_Item *ei;
|
||||
Eina_List *l;
|
||||
char buf[PATH_MAX];
|
||||
Efreet_Ini *ini;
|
||||
|
||||
if ((!mime) || (!desktop)) return;
|
||||
if (!desktop->orig_path) return;
|
||||
_e_exehist_load();
|
||||
if (!_e_exehist) return;
|
||||
|
||||
f = efreet_util_path_to_file_id(desktop->orig_path);
|
||||
if (!f) return;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/applications/defaults.list",
|
||||
efreet_data_home_get());
|
||||
ini = efreet_ini_new(buf);
|
||||
//fprintf(stderr, "try open %s = %p\n", buf, ini);
|
||||
if (ini)
|
||||
{
|
||||
//fprintf(stderr, "SAVE mime %s with %s\n", mime, desktop->orig_path);
|
||||
if (!efreet_ini_section_set(ini, "Default Applications"))
|
||||
{
|
||||
efreet_ini_section_add(ini, "Default Applications");
|
||||
efreet_ini_section_set(ini, "Default Applications");
|
||||
}
|
||||
if (desktop->orig_path)
|
||||
efreet_ini_string_set(ini, mime, ecore_file_file_get(desktop->orig_path));
|
||||
efreet_ini_save(ini, buf);
|
||||
efreet_ini_free(ini);
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(_e_exehist->mimes, l, ei)
|
||||
{
|
||||
if ((ei->launch_method) && (!strcmp(mime, ei->launch_method)))
|
||||
{
|
||||
if ((ei->exe) && (!strcmp(f, ei->exe)))
|
||||
{
|
||||
_e_exehist_unload_queue();
|
||||
return;
|
||||
}
|
||||
if (ei->exe) eina_stringshare_del(ei->exe);
|
||||
if (ei->launch_method) eina_stringshare_del(ei->launch_method);
|
||||
free(ei);
|
||||
_e_exehist->mimes = eina_list_remove_list(_e_exehist->mimes, l);
|
||||
_e_exehist_changes++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ei = E_NEW(E_Exehist_Item, 1);
|
||||
if (!ei)
|
||||
{
|
||||
_e_exehist_unload_queue();
|
||||
return;
|
||||
}
|
||||
ei->launch_method = eina_stringshare_add(mime);
|
||||
ei->exe = eina_stringshare_add(f);
|
||||
ei->exetime = ecore_time_unix_get();
|
||||
_e_exehist->mimes = eina_list_append(_e_exehist->mimes, ei);
|
||||
_e_exehist_limit();
|
||||
_e_exehist_changes++;
|
||||
_e_exehist_unload_queue();
|
||||
}
|
||||
|
||||
EAPI Efreet_Desktop *
|
||||
e_exehist_mime_desktop_get(const char *mime)
|
||||
{
|
||||
Efreet_Desktop *desktop;
|
||||
E_Exehist_Item *ei;
|
||||
Eina_List *l;
|
||||
|
||||
//fprintf(stderr, "e_exehist_mime_desktop_get(%s)\n", mime);
|
||||
if (!mime) return NULL;
|
||||
_e_exehist_load();
|
||||
//fprintf(stderr, "x\n");
|
||||
if (!_e_exehist) return NULL;
|
||||
EINA_LIST_FOREACH(_e_exehist->mimes, l, ei)
|
||||
{
|
||||
//fprintf(stderr, "look for %s == %s\n", mime, ei->launch_method);
|
||||
if ((ei->launch_method) && (!strcmp(mime, ei->launch_method)))
|
||||
{
|
||||
desktop = NULL;
|
||||
if (ei->exe) desktop = efreet_util_desktop_file_id_find(ei->exe);
|
||||
//fprintf(stderr, " desk = %p\n", desktop);
|
||||
if (desktop)
|
||||
{
|
||||
_e_exehist_unload_queue();
|
||||
return desktop;
|
||||
}
|
||||
}
|
||||
}
|
||||
_e_exehist_unload_queue();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
static void
|
||||
_e_exehist_unload_queue(void)
|
||||
{
|
||||
if (_e_exehist_unload_defer)
|
||||
e_powersave_deferred_action_del(_e_exehist_unload_defer);
|
||||
_e_exehist_unload_defer =
|
||||
e_powersave_deferred_action_add(_e_exehist_cb_unload, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_exehist_load(void)
|
||||
{
|
||||
if (!_e_exehist)
|
||||
_e_exehist = e_config_domain_load("exehist", _e_exehist_config_edd);
|
||||
if (!_e_exehist)
|
||||
_e_exehist = E_NEW(E_Exehist, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_exehist_clear(void)
|
||||
{
|
||||
if (_e_exehist)
|
||||
{
|
||||
E_Exehist_Item *ei;
|
||||
EINA_LIST_FREE(_e_exehist->history, ei)
|
||||
{
|
||||
eina_stringshare_del(ei->exe);
|
||||
eina_stringshare_del(ei->normalized_exe);
|
||||
eina_stringshare_del(ei->launch_method);
|
||||
free(ei);
|
||||
}
|
||||
EINA_LIST_FREE(_e_exehist->mimes, ei)
|
||||
{
|
||||
eina_stringshare_del(ei->exe);
|
||||
eina_stringshare_del(ei->launch_method);
|
||||
free(ei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_exehist_unload(void)
|
||||
{
|
||||
_e_exehist_clear();
|
||||
E_FREE(_e_exehist);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_exehist_limit(void)
|
||||
{
|
||||
/* go from first item in hist on and either delete all items before a
|
||||
* specific timestamp, or if the list count > limit then delete items
|
||||
*
|
||||
* for now - limit to 500
|
||||
*/
|
||||
if (_e_exehist)
|
||||
{
|
||||
while (eina_list_count(_e_exehist->history) > 500)
|
||||
{
|
||||
E_Exehist_Item *ei;
|
||||
|
||||
ei = eina_list_data_get(_e_exehist->history);
|
||||
eina_stringshare_del(ei->exe);
|
||||
eina_stringshare_del(ei->normalized_exe);
|
||||
eina_stringshare_del(ei->launch_method);
|
||||
free(ei);
|
||||
_e_exehist->history = eina_list_remove_list(_e_exehist->history, _e_exehist->history);
|
||||
}
|
||||
while (eina_list_count(_e_exehist->mimes) > 500)
|
||||
{
|
||||
E_Exehist_Item *ei;
|
||||
|
||||
ei = eina_list_data_get(_e_exehist->mimes);
|
||||
eina_stringshare_del(ei->exe);
|
||||
eina_stringshare_del(ei->launch_method);
|
||||
free(ei);
|
||||
_e_exehist->mimes = eina_list_remove_list(_e_exehist->mimes, _e_exehist->mimes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
_e_exehist_normalize_exe(const char *exe)
|
||||
{
|
||||
char *base, *buf, *cp, *space = NULL;
|
||||
const char *ret;
|
||||
Eina_Bool flag = EINA_FALSE;
|
||||
|
||||
buf = strdup(exe);
|
||||
base = basename(buf);
|
||||
if ((base[0] == '.') && (base[1] == '\0'))
|
||||
{
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cp = base;
|
||||
while (*cp)
|
||||
{
|
||||
if (isspace(*cp))
|
||||
{
|
||||
if (!space) space = cp;
|
||||
if (flag) flag = EINA_FALSE;
|
||||
}
|
||||
else if (!flag)
|
||||
{
|
||||
/* usually a variable in the desktop exe field */
|
||||
if (space && *cp == '%')
|
||||
flag = EINA_TRUE;
|
||||
else
|
||||
{
|
||||
char lower = tolower(*cp);
|
||||
|
||||
space = NULL;
|
||||
if (lower != *cp) *cp = lower;
|
||||
}
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
|
||||
if (space) *space = '\0';
|
||||
|
||||
ret = eina_stringshare_add(base);
|
||||
free(buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_exehist_cb_unload(void *data __UNUSED__)
|
||||
{
|
||||
if (_e_exehist_changes)
|
||||
{
|
||||
e_config_domain_save("exehist", _e_exehist_config_edd, _e_exehist);
|
||||
_e_exehist_changes = 0;
|
||||
}
|
||||
_e_exehist_unload();
|
||||
_e_exehist_unload_defer = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_exehist_sort_exe_cb(const void *d1, const void *d2)
|
||||
{
|
||||
const E_Exehist_Item *ei1, *ei2;
|
||||
|
||||
ei1 = d1;
|
||||
ei2 = d2;
|
||||
|
||||
if ((!ei1) || (!ei1->normalized_exe)) return 1;
|
||||
if ((!ei2) || (!ei2->normalized_exe)) return -1;
|
||||
|
||||
return strcmp(ei1->normalized_exe, ei2->normalized_exe);
|
||||
}
|
||||
|
||||
static int
|
||||
_e_exehist_sort_pop_cb(const void *d1, const void *d2)
|
||||
{
|
||||
const E_Exehist_Item *ei1, *ei2;
|
||||
|
||||
if (!(ei1 = d1)) return 1;
|
||||
if (!(ei2 = d2)) return -1;
|
||||
|
||||
return ei2->count - ei1->count;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
#else
|
||||
#ifndef E_EXEHIST_H
|
||||
#define E_EXEHIST_H
|
||||
|
||||
typedef enum _E_Exehist_Sort
|
||||
{
|
||||
E_EXEHIST_SORT_BY_DATE,
|
||||
E_EXEHIST_SORT_BY_EXE,
|
||||
E_EXEHIST_SORT_BY_POPULARITY
|
||||
} E_Exehist_Sort;
|
||||
|
||||
EINTERN int e_exehist_init(void);
|
||||
EINTERN int e_exehist_shutdown(void);
|
||||
|
||||
EAPI void e_exehist_add(const char *launch_method, const char *exe);
|
||||
EAPI void e_exehist_del(const char *exe);
|
||||
EAPI void e_exehist_clear(void);
|
||||
EAPI int e_exehist_popularity_get(const char *exe);
|
||||
EAPI double e_exehist_newest_run_get(const char *exe);
|
||||
EAPI Eina_List *e_exehist_list_get(void);
|
||||
EAPI Eina_List *e_exehist_sorted_list_get(E_Exehist_Sort sort_type, int max);
|
||||
EAPI void e_exehist_mime_desktop_add(const char *mime, Efreet_Desktop *desktop);
|
||||
EAPI Efreet_Desktop *e_exehist_mime_desktop_get(const char *mime);
|
||||
|
||||
extern EAPI int E_EVENT_EXEHIST_UPDATE;
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,93 @@
|
|||
#include "e.h"
|
||||
|
||||
/*
|
||||
* Implementation of a protected file registry. Any files that are
|
||||
* currently being used by E in core components should be registered
|
||||
* here and will be protected as best as E can. :)
|
||||
*/
|
||||
static Eina_Hash *_e_filereg = NULL;
|
||||
|
||||
typedef struct _Filereg_Item Filereg_Item;
|
||||
struct _Filereg_Item
|
||||
{
|
||||
const char *path;
|
||||
int ref_count;
|
||||
};
|
||||
|
||||
/* local function prototypes */
|
||||
static Eina_Bool _filereg_hash_cb_free(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata EINA_UNUSED);
|
||||
|
||||
/* Externally accessible functions */
|
||||
EINTERN int
|
||||
e_filereg_init(void)
|
||||
{
|
||||
_e_filereg = eina_hash_string_superfast_new(NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_filereg_shutdown(void)
|
||||
{
|
||||
eina_hash_foreach(_e_filereg, _filereg_hash_cb_free, NULL);
|
||||
eina_hash_free(_e_filereg);
|
||||
_e_filereg = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_filereg_register(const char *path)
|
||||
{
|
||||
Filereg_Item *fi = NULL;
|
||||
|
||||
fi = eina_hash_find(_e_filereg, path);
|
||||
if (fi)
|
||||
{
|
||||
fi->ref_count++;
|
||||
return 1;
|
||||
}
|
||||
fi = E_NEW(Filereg_Item, 1);
|
||||
if (!fi) return 0;
|
||||
fi->path = eina_stringshare_add(path);
|
||||
fi->ref_count = 1;
|
||||
eina_hash_add(_e_filereg, path, fi);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_filereg_deregister(const char *path)
|
||||
{
|
||||
Filereg_Item *fi = NULL;
|
||||
|
||||
fi = eina_hash_find(_e_filereg, path);
|
||||
if (fi)
|
||||
{
|
||||
fi->ref_count--;
|
||||
if (fi->ref_count == 0)
|
||||
{
|
||||
eina_hash_del(_e_filereg, path, fi);
|
||||
if (fi->path) eina_stringshare_del(fi->path);
|
||||
E_FREE(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
e_filereg_file_protected(const char *path)
|
||||
{
|
||||
if (eina_hash_find(_e_filereg, path)) return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static Eina_Bool
|
||||
_filereg_hash_cb_free(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data, void *fdata EINA_UNUSED)
|
||||
{
|
||||
Filereg_Item *fi;
|
||||
|
||||
fi = data;
|
||||
if (!fi) return EINA_TRUE;
|
||||
if (fi->path) eina_stringshare_del(fi->path);
|
||||
E_FREE(fi);
|
||||
return EINA_TRUE;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
#else
|
||||
#ifndef E_FILEREG_H
|
||||
#define E_FILEREG_H
|
||||
|
||||
EINTERN int e_filereg_init(void);
|
||||
EINTERN int e_filereg_shutdown(void);
|
||||
|
||||
EAPI int e_filereg_register(const char * path);
|
||||
EAPI void e_filereg_deregister(const char * path);
|
||||
EAPI Eina_Bool e_filereg_file_protected(const char * path);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,481 @@
|
|||
#include "e.h"
|
||||
|
||||
#define E_TOK_STYLE ":style="
|
||||
|
||||
static Eina_Bool _font_hash_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__);
|
||||
static Eina_Hash *_e_font_available_hash_add(Eina_Hash *font_hash, const char *full_name);
|
||||
static E_Font_Properties *_e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, const char *font);
|
||||
static char _fn_buf[1024];
|
||||
|
||||
EINTERN int
|
||||
e_font_init(void)
|
||||
{
|
||||
/* all init stuff is in e_config */
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_font_shutdown(void)
|
||||
{
|
||||
/* e_config will do this */
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_apply(void)
|
||||
{
|
||||
char buf[1024];
|
||||
Eina_List *l;
|
||||
E_Border *bd;
|
||||
E_Font_Default *efd;
|
||||
E_Font_Fallback *eff;
|
||||
int blen, len;
|
||||
|
||||
/* setup edje fallback list */
|
||||
blen = sizeof(buf) - 1;
|
||||
buf[0] = 0;
|
||||
buf[blen] = 0;
|
||||
l = e_config->font_fallbacks;
|
||||
if (l)
|
||||
{
|
||||
eff = eina_list_data_get(l);
|
||||
len = strlen(eff->name);
|
||||
if (len < blen)
|
||||
{
|
||||
strcpy(buf, eff->name);
|
||||
blen -= len;
|
||||
}
|
||||
EINA_LIST_FOREACH(eina_list_next(l), l, eff)
|
||||
{
|
||||
len = 1;
|
||||
if (len < blen)
|
||||
{
|
||||
strcat(buf, ",");
|
||||
blen -= len;
|
||||
}
|
||||
len = strlen(eff->name);
|
||||
if (len < blen)
|
||||
{
|
||||
strcat(buf, eff->name);
|
||||
blen -= len;
|
||||
}
|
||||
}
|
||||
edje_fontset_append_set(buf);
|
||||
}
|
||||
else
|
||||
edje_fontset_append_set(NULL);
|
||||
|
||||
/* setup edje text classes */
|
||||
EINA_LIST_FOREACH(e_config->font_defaults, l, efd)
|
||||
{
|
||||
edje_text_class_set(efd->text_class, efd->font, efd->size);
|
||||
}
|
||||
|
||||
/* Update borders */
|
||||
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
|
||||
{
|
||||
e_border_frame_recalc(bd);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
e_font_available_list(void)
|
||||
{
|
||||
Eina_List *evas_fonts;
|
||||
Eina_List *e_fonts;
|
||||
Eina_List *l;
|
||||
const char *evas_font;
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
|
||||
man = e_manager_current_get();
|
||||
if (!man) return NULL;
|
||||
con = e_container_current_get(man);
|
||||
if (!con) con = e_container_number_get(man, 0);
|
||||
if (!con) return NULL;
|
||||
|
||||
evas_fonts = evas_font_available_list(con->bg_evas);
|
||||
|
||||
e_fonts = NULL;
|
||||
EINA_LIST_FOREACH(evas_fonts, l, evas_font)
|
||||
{
|
||||
E_Font_Available *efa;
|
||||
|
||||
efa = E_NEW(E_Font_Available, 1);
|
||||
efa->name = eina_stringshare_add(evas_font);
|
||||
e_fonts = eina_list_append(e_fonts, efa);
|
||||
}
|
||||
|
||||
evas_font_available_list_free(con->bg_evas, evas_fonts);
|
||||
|
||||
return e_fonts;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_available_list_free(Eina_List *available)
|
||||
{
|
||||
E_Font_Available *efa;
|
||||
|
||||
EINA_LIST_FREE(available, efa)
|
||||
{
|
||||
if (efa->name) eina_stringshare_del(efa->name);
|
||||
E_FREE(efa);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_properties_free(E_Font_Properties *efp)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
EINA_LIST_FREE(efp->styles, str)
|
||||
{
|
||||
if (str) eina_stringshare_del(str);
|
||||
}
|
||||
if (efp->name) eina_stringshare_del(efp->name);
|
||||
free(efp);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_font_hash_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
|
||||
{
|
||||
E_Font_Properties *efp;
|
||||
|
||||
efp = data;
|
||||
e_font_properties_free(efp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_available_hash_free(Eina_Hash *hash)
|
||||
{
|
||||
eina_hash_foreach(hash, _font_hash_free_cb, NULL);
|
||||
eina_hash_free(hash);
|
||||
}
|
||||
|
||||
EAPI E_Font_Properties *
|
||||
e_font_fontconfig_name_parse(const char *font)
|
||||
{
|
||||
if (!font) return NULL;
|
||||
return _e_font_fontconfig_name_parse(NULL, NULL, font);
|
||||
}
|
||||
|
||||
static E_Font_Properties *
|
||||
_e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, const char *font)
|
||||
{
|
||||
char *s1;
|
||||
|
||||
s1 = strchr(font, ':');
|
||||
if (s1)
|
||||
{
|
||||
char *s2, *name, *style;
|
||||
int len;
|
||||
|
||||
len = s1 - font;
|
||||
name = calloc(sizeof(char), len + 1);
|
||||
strncpy(name, font, len);
|
||||
|
||||
/* Get subname (should be english) */
|
||||
s2 = strchr(name, ',');
|
||||
if (s2)
|
||||
{
|
||||
len = s2 - name;
|
||||
name = realloc(name, sizeof(char) * len + 1);
|
||||
memset(name, 0, sizeof(char) * len + 1);
|
||||
strncpy(name, font, len);
|
||||
}
|
||||
|
||||
if (strncmp(s1, E_TOK_STYLE, strlen(E_TOK_STYLE)) == 0)
|
||||
{
|
||||
style = s1 + strlen(E_TOK_STYLE);
|
||||
|
||||
if (font_hash) efp = eina_hash_find(*font_hash, name);
|
||||
if (!efp)
|
||||
{
|
||||
efp = calloc(1, sizeof(E_Font_Properties));
|
||||
efp->name = eina_stringshare_add(name);
|
||||
if (font_hash)
|
||||
{
|
||||
if (!*font_hash) *font_hash = eina_hash_string_superfast_new(NULL);
|
||||
eina_hash_add(*font_hash, name, efp);
|
||||
}
|
||||
}
|
||||
s2 = strchr(style, ',');
|
||||
if (s2)
|
||||
{
|
||||
char *style_old;
|
||||
|
||||
len = s2 - style;
|
||||
style_old = style;
|
||||
style = calloc(sizeof(char), len + 1);
|
||||
strncpy(style, style_old, len);
|
||||
efp->styles = eina_list_append(efp->styles, eina_stringshare_add(style));
|
||||
free(style);
|
||||
}
|
||||
else
|
||||
efp->styles = eina_list_append(efp->styles, eina_stringshare_add(style));
|
||||
}
|
||||
free(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (font_hash) efp = eina_hash_find(*font_hash, font);
|
||||
if (!efp)
|
||||
{
|
||||
efp = calloc(1, sizeof(E_Font_Properties));
|
||||
efp->name = eina_stringshare_add(font);
|
||||
if (font_hash)
|
||||
{
|
||||
if (!*font_hash) *font_hash = eina_hash_string_superfast_new(NULL);
|
||||
eina_hash_add(*font_hash, font, efp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return efp;
|
||||
}
|
||||
|
||||
static Eina_Hash *
|
||||
_e_font_available_hash_add(Eina_Hash *font_hash, const char *full_name)
|
||||
{
|
||||
_e_font_fontconfig_name_parse(&font_hash, NULL, full_name);
|
||||
return font_hash;
|
||||
}
|
||||
|
||||
EAPI Eina_Hash *
|
||||
e_font_available_list_parse(Eina_List *list)
|
||||
{
|
||||
Eina_Hash *font_hash;
|
||||
Eina_List *next;
|
||||
void *key;
|
||||
|
||||
font_hash = NULL;
|
||||
|
||||
/* Populate Default Font Families */
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Sans:style=Regular");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Sans:style=Bold");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Sans:style=Oblique");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Sans:style=Bold Oblique");
|
||||
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Serif:style=Regular");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Serif:style=Bold");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Serif:style=Oblique");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Serif:style=Bold Oblique");
|
||||
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Monospace:style=Regular");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Monospace:style=Bold");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Monospace:style=Oblique");
|
||||
font_hash = _e_font_available_hash_add(font_hash, "Monospace:style=Bold Oblique");
|
||||
|
||||
EINA_LIST_FOREACH(list, next, key)
|
||||
font_hash = _e_font_available_hash_add(font_hash, key);
|
||||
|
||||
return font_hash;
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
e_font_fontconfig_name_get(const char *name, const char *style)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
if (!name) return NULL;
|
||||
if (!style || style[0] == 0) return eina_stringshare_add(name);
|
||||
snprintf(buf, 256, "%s"E_TOK_STYLE "%s", name, style);
|
||||
return eina_stringshare_add(buf);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_fallback_clear(void)
|
||||
{
|
||||
E_Font_Fallback *eff;
|
||||
|
||||
EINA_LIST_FREE(e_config->font_fallbacks, eff)
|
||||
{
|
||||
if (eff->name) eina_stringshare_del(eff->name);
|
||||
E_FREE(eff);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_fallback_append(const char *font)
|
||||
{
|
||||
E_Font_Fallback *eff;
|
||||
|
||||
e_font_fallback_remove(font);
|
||||
|
||||
eff = E_NEW(E_Font_Fallback, 1);
|
||||
eff->name = eina_stringshare_add(font);
|
||||
e_config->font_fallbacks = eina_list_append(e_config->font_fallbacks, eff);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_fallback_prepend(const char *font)
|
||||
{
|
||||
E_Font_Fallback *eff;
|
||||
|
||||
e_font_fallback_remove(font);
|
||||
|
||||
eff = E_NEW(E_Font_Fallback, 1);
|
||||
eff->name = eina_stringshare_add(font);
|
||||
e_config->font_fallbacks = eina_list_prepend(e_config->font_fallbacks, eff);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_fallback_remove(const char *font)
|
||||
{
|
||||
Eina_List *next;
|
||||
E_Font_Fallback *eff;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->font_fallbacks, next, eff)
|
||||
{
|
||||
if (!strcmp(eff->name, font))
|
||||
{
|
||||
e_config->font_fallbacks =
|
||||
eina_list_remove_list(e_config->font_fallbacks, next);
|
||||
if (eff->name) eina_stringshare_del(eff->name);
|
||||
E_FREE(eff);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
e_font_fallback_list(void)
|
||||
{
|
||||
return e_config->font_fallbacks;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_default_set(const char *text_class, const char *font, Evas_Font_Size size)
|
||||
{
|
||||
E_Font_Default *efd;
|
||||
Eina_List *next;
|
||||
|
||||
/* search for the text class */
|
||||
EINA_LIST_FOREACH(e_config->font_defaults, next, efd)
|
||||
{
|
||||
if (!strcmp(efd->text_class, text_class))
|
||||
{
|
||||
if (efd->font) eina_stringshare_del(efd->font);
|
||||
efd->font = eina_stringshare_add(font);
|
||||
efd->size = size;
|
||||
/* move to the front of the list */
|
||||
e_config->font_defaults =
|
||||
eina_list_remove_list(e_config->font_defaults, next);
|
||||
e_config->font_defaults =
|
||||
eina_list_prepend(e_config->font_defaults, efd);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* the text class doesn't exist */
|
||||
efd = E_NEW(E_Font_Default, 1);
|
||||
efd->text_class = eina_stringshare_add(text_class);
|
||||
efd->font = eina_stringshare_add(font);
|
||||
efd->size = size;
|
||||
|
||||
e_config->font_defaults = eina_list_prepend(e_config->font_defaults, efd);
|
||||
}
|
||||
|
||||
/*
|
||||
* returns a pointer to the data, return null if nothing if found.
|
||||
*/
|
||||
EAPI E_Font_Default *
|
||||
e_font_default_get(const char *text_class)
|
||||
{
|
||||
E_Font_Default *efd = NULL, *defd = NULL;
|
||||
Eina_List *next;
|
||||
|
||||
/* search for the text class */
|
||||
EINA_LIST_FOREACH(e_config->font_defaults, next, efd)
|
||||
{
|
||||
if (!strcmp(efd->text_class, text_class))
|
||||
{
|
||||
/* move to the front of the list */
|
||||
e_config->font_defaults =
|
||||
eina_list_remove_list(e_config->font_defaults, next);
|
||||
e_config->font_defaults =
|
||||
eina_list_prepend(e_config->font_defaults, efd);
|
||||
return efd;
|
||||
}
|
||||
if (!strcmp(efd->text_class, "default")) defd = efd;
|
||||
}
|
||||
if (!defd) defd = efd;
|
||||
return defd;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_font_default_remove(const char *text_class)
|
||||
{
|
||||
E_Font_Default *efd;
|
||||
Eina_List *next;
|
||||
|
||||
/* search for the text class */
|
||||
EINA_LIST_FOREACH(e_config->font_defaults, next, efd)
|
||||
{
|
||||
if (!strcmp(efd->text_class, text_class))
|
||||
{
|
||||
e_config->font_defaults =
|
||||
eina_list_remove_list(e_config->font_defaults, next);
|
||||
if (efd->text_class) eina_stringshare_del(efd->text_class);
|
||||
if (efd->font) eina_stringshare_del(efd->font);
|
||||
E_FREE(efd);
|
||||
edje_text_class_del(text_class);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
e_font_default_list(void)
|
||||
{
|
||||
return e_config->font_defaults;
|
||||
}
|
||||
|
||||
/* return the default font name with fallbacks, font size is returned
|
||||
* in size_ret. This function is needed when all hell breaks loose and
|
||||
* we need a font name and size.
|
||||
*/
|
||||
EAPI const char *
|
||||
e_font_default_string_get(const char *text_class, Evas_Font_Size *size_ret)
|
||||
{
|
||||
E_Font_Default *efd;
|
||||
Eina_List *next;
|
||||
E_Font_Fallback *eff;
|
||||
int blen, len;
|
||||
|
||||
_fn_buf[0] = 0;
|
||||
efd = e_font_default_get(text_class);
|
||||
if (!efd)
|
||||
{
|
||||
if (size_ret) *size_ret = 0;
|
||||
return "";
|
||||
}
|
||||
blen = sizeof(_fn_buf) - 1;
|
||||
|
||||
len = strlen(efd->font);
|
||||
if (len < blen)
|
||||
{
|
||||
strcpy(_fn_buf, efd->font);
|
||||
blen -= len;
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(e_config->font_fallbacks, next, eff)
|
||||
{
|
||||
len = 1;
|
||||
if (len < blen)
|
||||
{
|
||||
strcat(_fn_buf, ",");
|
||||
blen -= len;
|
||||
}
|
||||
len = strlen(eff->name);
|
||||
if (len < blen)
|
||||
{
|
||||
strcat(_fn_buf, eff->name);
|
||||
blen -= len;
|
||||
}
|
||||
}
|
||||
|
||||
if (size_ret) *size_ret = efd->size;
|
||||
return _fn_buf;
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Font_Default E_Font_Default;
|
||||
typedef struct _E_Font_Fallback E_Font_Fallback;
|
||||
typedef struct _E_Font_Available E_Font_Available;
|
||||
typedef struct _E_Font_Properties E_Font_Properties;
|
||||
|
||||
#else
|
||||
#ifndef E_FONT_H
|
||||
#define E_FONT_H
|
||||
|
||||
struct _E_Font_Default
|
||||
{
|
||||
const char *text_class;
|
||||
const char *font;
|
||||
Evas_Font_Size size;
|
||||
};
|
||||
|
||||
struct _E_Font_Fallback
|
||||
{
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct _E_Font_Available
|
||||
{
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct _E_Font_Properties
|
||||
{
|
||||
const char *name;
|
||||
Eina_List *styles;
|
||||
};
|
||||
|
||||
EINTERN int e_font_init(void);
|
||||
EINTERN int e_font_shutdown(void);
|
||||
EAPI void e_font_apply(void);
|
||||
EAPI Eina_List *e_font_available_list(void);
|
||||
EAPI void e_font_available_list_free(Eina_List *available);
|
||||
EAPI Eina_Hash *e_font_available_list_parse(Eina_List *list);
|
||||
EAPI void e_font_available_hash_free(Eina_Hash *hash);
|
||||
EAPI E_Font_Properties *e_font_fontconfig_name_parse(const char *font);
|
||||
EAPI const char *e_font_fontconfig_name_get(const char *name, const char *style);
|
||||
EAPI void e_font_properties_free(E_Font_Properties *efp);
|
||||
|
||||
/* global font fallbacks */
|
||||
EAPI void e_font_fallback_clear(void);
|
||||
EAPI void e_font_fallback_append(const char *font);
|
||||
EAPI void e_font_fallback_prepend(const char *font);
|
||||
EAPI void e_font_fallback_remove(const char *font);
|
||||
EAPI Eina_List *e_font_fallback_list(void);
|
||||
|
||||
/* setup edje text classes */
|
||||
EAPI void e_font_default_set(const char *text_class, const char *font, Evas_Font_Size size);
|
||||
EAPI E_Font_Default *e_font_default_get(const char *text_class);
|
||||
EAPI void e_font_default_remove(const char *text_class);
|
||||
EAPI Eina_List *e_font_default_list(void);
|
||||
EAPI const char *e_font_default_string_get(const char *text_class, Evas_Font_Size *size_ret);
|
||||
|
||||
#endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,343 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
#define E_GADCON_CLIENT(x) ((E_Gadcon_Client *)(x))
|
||||
|
||||
/* different layout policies - only 1 supported for now */
|
||||
typedef enum _E_Gadcon_Layout_Policy
|
||||
{
|
||||
E_GADCON_LAYOUT_POLICY_PANEL
|
||||
} E_Gadcon_Layout_Policy;
|
||||
|
||||
typedef enum _E_Gadcon_Orient
|
||||
{
|
||||
/* generic orientations */
|
||||
E_GADCON_ORIENT_FLOAT,
|
||||
E_GADCON_ORIENT_HORIZ,
|
||||
E_GADCON_ORIENT_VERT,
|
||||
E_GADCON_ORIENT_LEFT,
|
||||
E_GADCON_ORIENT_RIGHT,
|
||||
E_GADCON_ORIENT_TOP,
|
||||
E_GADCON_ORIENT_BOTTOM,
|
||||
E_GADCON_ORIENT_CORNER_TL,
|
||||
E_GADCON_ORIENT_CORNER_TR,
|
||||
E_GADCON_ORIENT_CORNER_BL,
|
||||
E_GADCON_ORIENT_CORNER_BR,
|
||||
E_GADCON_ORIENT_CORNER_LT,
|
||||
E_GADCON_ORIENT_CORNER_RT,
|
||||
E_GADCON_ORIENT_CORNER_LB,
|
||||
E_GADCON_ORIENT_CORNER_RB
|
||||
} E_Gadcon_Orient;
|
||||
|
||||
typedef enum _E_Gadcon_Site
|
||||
{
|
||||
E_GADCON_SITE_UNKNOWN = 0, // when target site is unknown
|
||||
/* generic sities */
|
||||
E_GADCON_SITE_SHELF,
|
||||
E_GADCON_SITE_DESKTOP,
|
||||
E_GADCON_SITE_TOOLBAR, // generic toolbar
|
||||
E_GADCON_SITE_EFM_TOOLBAR // filemanager window toolbar
|
||||
} E_Gadcon_Site;
|
||||
|
||||
#define E_GADCON_CLIENT_STYLE_PLAIN "plain"
|
||||
#define E_GADCON_CLIENT_STYLE_INSET "inset"
|
||||
|
||||
typedef struct _E_Gadcon E_Gadcon;
|
||||
typedef struct _E_Gadcon_Client E_Gadcon_Client;
|
||||
typedef struct _E_Gadcon_Client_Class E_Gadcon_Client_Class;
|
||||
typedef struct _E_Gadcon_Location E_Gadcon_Location;
|
||||
|
||||
#else
|
||||
#ifndef E_GADCON_H
|
||||
#define E_GADCON_H
|
||||
|
||||
#define E_GADCON_TYPE 0xE0b01006
|
||||
#define E_GADCON_CLIENT_TYPE 0xE0b01007
|
||||
|
||||
struct _E_Gadcon
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
const char *name;
|
||||
int id;
|
||||
|
||||
E_Gadcon_Layout_Policy layout_policy;
|
||||
|
||||
struct
|
||||
{
|
||||
Evas_Object *o_parent;
|
||||
const char *swallow_name;
|
||||
} edje;
|
||||
Ecore_Evas *ecore_evas;
|
||||
E_Zone *zone;
|
||||
|
||||
E_Gadcon_Orient orient;
|
||||
|
||||
Evas *evas;
|
||||
Evas_Object *o_container;
|
||||
Eina_List *clients;
|
||||
|
||||
struct
|
||||
{
|
||||
void (*func) (void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||
void *data;
|
||||
} resize_request, min_size_request;
|
||||
struct
|
||||
{
|
||||
Evas_Object *(*func) (void *data, E_Gadcon_Client *gcc, const char *style);
|
||||
void *data;
|
||||
} frame_request;
|
||||
struct
|
||||
{
|
||||
void (*func) (void *data, E_Gadcon_Client *gcc, E_Menu *menu);
|
||||
void *data;
|
||||
} menu_attach;
|
||||
struct
|
||||
{
|
||||
void (*func) (void *data, E_Gadcon *gc, const E_Gadcon_Client_Class *cc);
|
||||
void *data;
|
||||
} populate_class;
|
||||
struct
|
||||
{
|
||||
void (*func) (void *data, int lock);
|
||||
void *data;
|
||||
} locked_set;
|
||||
struct
|
||||
{
|
||||
void (*func) (void *data);
|
||||
void *data;
|
||||
} urgent_show;
|
||||
|
||||
E_Config_Dialog *config_dialog;
|
||||
unsigned char editing : 1;
|
||||
// Ecore_X_Window dnd_win, xdnd_win;
|
||||
E_Shelf *shelf;
|
||||
// E_Toolbar *toolbar;
|
||||
E_Gadcon_Location *location;
|
||||
|
||||
// E_Drop_Handler *drop_handler;
|
||||
|
||||
E_Config_Gadcon *cf;
|
||||
|
||||
unsigned char instant_edit : 1;
|
||||
};
|
||||
|
||||
#define GADCON_CLIENT_CLASS_VERSION 3
|
||||
/* Version 3 add the *client_class param to icon(),label(),id_new(), id_del() */
|
||||
/* and the *orient param to orient() */
|
||||
struct _E_Gadcon_Client_Class
|
||||
{
|
||||
int version;
|
||||
/* All members below are part of version 1 */
|
||||
const char *name;
|
||||
struct
|
||||
{
|
||||
E_Gadcon_Client *(*init) (E_Gadcon *gc, const char *name, const char *id, const char *style);
|
||||
void (*shutdown) (E_Gadcon_Client *gcc);
|
||||
void (*orient) (E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
|
||||
const char *(*label) (E_Gadcon_Client_Class *client_class);
|
||||
Evas_Object *(*icon) (E_Gadcon_Client_Class *client_class, Evas *evas);
|
||||
/* All members below are part of version 2 */
|
||||
/* Create new id, so that the gadcon client can refer to a config set inside the module */
|
||||
const char *(*id_new) (E_Gadcon_Client_Class *client_class);
|
||||
/* Del an id when a gadcon client is removed from the system */
|
||||
void (*id_del) (E_Gadcon_Client_Class *client_class, const char *id);
|
||||
/* All members below are part of version 3 */
|
||||
Eina_Bool (*is_site) (E_Gadcon_Site site);
|
||||
} func;
|
||||
char *default_style;
|
||||
};
|
||||
|
||||
struct _E_Gadcon_Client
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
E_Gadcon *gadcon;
|
||||
const char *name;
|
||||
int id;
|
||||
Evas_Object *o_base;
|
||||
Evas_Object *o_box;
|
||||
Evas_Object *o_frame;
|
||||
Evas_Object *o_control;
|
||||
Evas_Object *o_event;
|
||||
const E_Gadcon_Client_Class *client_class;
|
||||
void *data;
|
||||
|
||||
struct
|
||||
{
|
||||
int pos, size, res; //gadcon
|
||||
double pos_x, pos_y, size_w, size_h; //gadman
|
||||
} config;
|
||||
|
||||
struct
|
||||
{
|
||||
int seq, flags; /* goes to save */
|
||||
int state, resist;
|
||||
int prev_pos, prev_size;
|
||||
int want_save : 1;
|
||||
} state_info;
|
||||
|
||||
struct
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
} pad, min, aspect;
|
||||
|
||||
Ecore_Timer *scroll_timer;
|
||||
Ecore_Timer *instant_edit_timer;
|
||||
Ecore_Animator *scroll_animator;
|
||||
double scroll_pos, scroll_wanted;
|
||||
|
||||
struct
|
||||
{
|
||||
void *data;
|
||||
void (*func) (void *data);
|
||||
} scroll_cb;
|
||||
|
||||
E_Menu *menu;
|
||||
const char *style;
|
||||
unsigned char autoscroll : 1;
|
||||
unsigned char resizable : 1;
|
||||
unsigned char moving : 1;
|
||||
unsigned char resizing : 1;
|
||||
unsigned char autoscroll_set : 1;
|
||||
Evas_Coord dx, dy;
|
||||
|
||||
struct
|
||||
{
|
||||
int x, y;
|
||||
} drag;
|
||||
|
||||
unsigned char hidden : 1;
|
||||
|
||||
E_Config_Gadcon_Client *cf;
|
||||
};
|
||||
|
||||
/* defines usable gadget placements such as Desktop, Shelf #, etc */
|
||||
/* next fields are mandatory (not NULL): name, add_gadget.func, remove_gadget.func */
|
||||
struct _E_Gadcon_Location
|
||||
{
|
||||
/* location name */
|
||||
const char * name;
|
||||
/* icon related to location, such as "preferences-desktop-shelf" for shelves, "preferences-desktop" for menus */
|
||||
const char * icon_name;
|
||||
E_Gadcon_Site site;
|
||||
/* adds gadcon client to location. Returns nonzero on success */
|
||||
struct
|
||||
{
|
||||
int (*func) (void *data, const E_Gadcon_Client_Class *cc);
|
||||
void *data;
|
||||
} gadget_add;
|
||||
/* removes existing gadcon client from location */
|
||||
struct
|
||||
{
|
||||
void (*func) (void *data, E_Gadcon_Client *gcc);
|
||||
void *data;
|
||||
} gadget_remove;
|
||||
};
|
||||
|
||||
EINTERN int e_gadcon_init(void);
|
||||
EINTERN int e_gadcon_shutdown(void);
|
||||
EAPI void e_gadcon_provider_register(const E_Gadcon_Client_Class *cc);
|
||||
EAPI void e_gadcon_provider_unregister(const E_Gadcon_Client_Class *cc);
|
||||
EAPI Eina_List *e_gadcon_provider_list(void);
|
||||
EAPI E_Gadcon *e_gadcon_swallowed_new(const char *name, int id, Evas_Object *obj, const char *swallow_name);
|
||||
EAPI void e_gadcon_custom_new(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_custom_del(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_swallowed_min_size_set(E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
||||
EAPI void e_gadcon_min_size_request_callback_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h), void *data);
|
||||
EAPI void e_gadcon_size_request_callback_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h), void *data);
|
||||
EAPI void e_gadcon_frame_request_callback_set(E_Gadcon *gc, Evas_Object *(*func) (void *data, E_Gadcon_Client *gcc, const char *style), void *data);
|
||||
EAPI void e_gadcon_populate_callback_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon *gc, const E_Gadcon_Client_Class *cc), void *data);
|
||||
EAPI void e_gadcon_layout_policy_set(E_Gadcon *gc, E_Gadcon_Layout_Policy layout_policy);
|
||||
EAPI void e_gadcon_populate(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_unpopulate(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_populate_class(E_Gadcon *gc, const E_Gadcon_Client_Class *cc);
|
||||
EAPI void e_gadcon_orient(E_Gadcon *gc, E_Gadcon_Orient orient);
|
||||
EAPI void e_gadcon_edit_begin(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_edit_end(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_all_edit_begin(void);
|
||||
EAPI void e_gadcon_all_edit_end(void);
|
||||
EAPI void e_gadcon_zone_set(E_Gadcon *gc, E_Zone *zone);
|
||||
EAPI E_Zone *e_gadcon_zone_get(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_ecore_evas_set(E_Gadcon *gc, Ecore_Evas *ee);
|
||||
EAPI int e_gadcon_canvas_zone_geometry_get(E_Gadcon *gc, int *x, int *y, int *w, int *h);
|
||||
EAPI void e_gadcon_util_menu_attach_func_set(E_Gadcon *gc, void (*func) (void *data, E_Gadcon_Client *gcc, E_Menu *menu), void *data);
|
||||
EAPI void e_gadcon_util_lock_func_set(E_Gadcon *gc, void (*func) (void *data, int lock), void *data);
|
||||
EAPI void e_gadcon_util_urgent_show_func_set(E_Gadcon *gc, void (*func) (void *data), void *data);
|
||||
EAPI void e_gadcon_dnd_window_set(E_Gadcon *gc, Ecore_X_Window win);
|
||||
EAPI Ecore_X_Window e_gadcon_dnd_window_get(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_xdnd_window_set(E_Gadcon *gc, Ecore_X_Window win);
|
||||
EAPI Ecore_X_Window e_gadcon_xdnd_window_get(E_Gadcon *gc);
|
||||
EAPI void e_gadcon_shelf_set(E_Gadcon *gc, E_Shelf *shelf);
|
||||
EAPI E_Shelf *e_gadcon_shelf_get(E_Gadcon *gc);
|
||||
/* EAPI void e_gadcon_toolbar_set(E_Gadcon *gc, E_Toolbar *toolbar); */
|
||||
/* EAPI E_Toolbar *e_gadcon_toolbar_get(E_Gadcon *gc); */
|
||||
EAPI E_Config_Gadcon_Client *e_gadcon_client_config_new(E_Gadcon *gc, const char *name);
|
||||
EAPI void e_gadcon_client_config_del(E_Config_Gadcon *cf_gc, E_Config_Gadcon_Client *cf_gcc);
|
||||
EAPI E_Gadcon_Client *e_gadcon_client_new(E_Gadcon *gc, const char *name, const char *id, const char *style, Evas_Object *base_obj);
|
||||
EAPI void e_gadcon_client_edit_begin(E_Gadcon_Client *gcc);
|
||||
EAPI void e_gadcon_client_edit_end(E_Gadcon_Client *gcc);
|
||||
EAPI void e_gadcon_client_show(E_Gadcon_Client *gcc);
|
||||
EAPI void e_gadcon_client_hide(E_Gadcon_Client *gcc);
|
||||
EAPI void e_gadcon_client_size_request(E_Gadcon_Client *gcc, Evas_Coord w, Evas_Coord h);
|
||||
EAPI void e_gadcon_client_min_size_set(E_Gadcon_Client *gcc, Evas_Coord w, Evas_Coord h);
|
||||
EAPI void e_gadcon_client_aspect_set(E_Gadcon_Client *gcc, int w, int h);
|
||||
EAPI void e_gadcon_client_autoscroll_set(E_Gadcon_Client *gcc, int autoscroll);
|
||||
EAPI void e_gadcon_client_autoscroll_update(E_Gadcon_Client *gcc, int mx, int my);
|
||||
EAPI void e_gadcon_client_autoscroll_cb_set(E_Gadcon_Client *gcc, void (*func)(void *data), void *data);
|
||||
EAPI void e_gadcon_client_resizable_set(E_Gadcon_Client *gcc, int resizable);
|
||||
EAPI int e_gadcon_client_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *h);
|
||||
EAPI int e_gadcon_client_viewport_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *h);
|
||||
EAPI E_Zone *e_gadcon_client_zone_get(E_Gadcon_Client *gcc);
|
||||
EAPI E_Menu *e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu_gadget, int flags);
|
||||
EAPI void e_gadcon_client_util_menu_attach(E_Gadcon_Client *gcc);
|
||||
EAPI void e_gadcon_locked_set(E_Gadcon *gc, int lock);
|
||||
EAPI void e_gadcon_urgent_show(E_Gadcon *gc);
|
||||
|
||||
/* site helpers */
|
||||
|
||||
EAPI Eina_Bool e_gadcon_site_is_shelf(E_Gadcon_Site site);
|
||||
EAPI Eina_Bool e_gadcon_site_is_desktop(E_Gadcon_Site site);
|
||||
EAPI Eina_Bool e_gadcon_site_is_efm_toolbar(E_Gadcon_Site site);
|
||||
|
||||
EAPI Eina_Bool e_gadcon_site_is_any_toolbar(E_Gadcon_Site site); // all toolbar sities
|
||||
EAPI Eina_Bool e_gadcon_site_is_not_toolbar(E_Gadcon_Site site); // all non-toolbar sities
|
||||
|
||||
/* location helpers */
|
||||
|
||||
EAPI E_Gadcon_Location *
|
||||
e_gadcon_location_new(const char * name, E_Gadcon_Site site,
|
||||
int (*add_func) (void *data, const E_Gadcon_Client_Class *cc),
|
||||
void *add_data,
|
||||
void (*remove_func) (void *data, E_Gadcon_Client *cc),
|
||||
void *remove_data);
|
||||
EAPI void e_gadcon_location_free(E_Gadcon_Location *loc);
|
||||
EAPI void e_gadcon_location_register (E_Gadcon_Location *loc);
|
||||
EAPI void e_gadcon_location_unregister (E_Gadcon_Location *loc);
|
||||
EAPI void e_gadcon_location_set_icon_name(E_Gadcon_Location *loc, const char *name);
|
||||
EAPI void e_gadcon_client_add_location_menu(E_Gadcon_Client *gcc, E_Menu *menu);
|
||||
|
||||
#define GADCON_CLIENT_CONFIG_GET(_type, _items, _gc_class, _id) \
|
||||
if (!_id) \
|
||||
{ \
|
||||
char buf[128]; \
|
||||
int num = 0; \
|
||||
_type *ci; \
|
||||
if (_items) \
|
||||
{ \
|
||||
const char *p; \
|
||||
ci = eina_list_last(_items)->data; \
|
||||
p = strrchr (ci->id, '.'); \
|
||||
if (p) num = atoi (p + 1) + 1; \
|
||||
} \
|
||||
snprintf (buf, sizeof (buf), "%s.%d", _gc_class.name, num); \
|
||||
_id = buf; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
Eina_List *l; \
|
||||
_type *ci; \
|
||||
EINA_LIST_FOREACH(_items, l, ci) \
|
||||
if ((ci->id) && (!strcmp(ci->id, id))) return ci; \
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,35 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
#else
|
||||
#ifndef E_ICON_H
|
||||
#define E_ICON_H
|
||||
|
||||
EINTERN int e_icon_init(void);
|
||||
EINTERN int e_icon_shutdown(void);
|
||||
|
||||
EAPI Evas_Object *e_icon_add (Evas *evas);
|
||||
EAPI Eina_Bool e_icon_file_set (Evas_Object *obj, const char *file);
|
||||
EAPI Eina_Bool e_icon_file_key_set (Evas_Object *obj, const char *file, const char *key);
|
||||
EAPI Eina_Bool e_icon_file_edje_set (Evas_Object *obj, const char *file, const char *part);
|
||||
EAPI Eina_Bool e_icon_fdo_icon_set (Evas_Object *obj, const char *icon);
|
||||
EAPI void e_icon_edje_object_set(Evas_Object *obj, Evas_Object *edje);
|
||||
EAPI void e_icon_object_set (Evas_Object *obj, Evas_Object *o) EINA_DEPRECATED;
|
||||
EAPI Eina_Bool e_icon_file_get(const Evas_Object *obj, const char **file, const char **group);
|
||||
EAPI void e_icon_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth);
|
||||
EAPI Eina_Bool e_icon_smooth_scale_get (const Evas_Object *obj);
|
||||
EAPI void e_icon_alpha_set (Evas_Object *obj, Eina_Bool smooth);
|
||||
EAPI Eina_Bool e_icon_alpha_get (const Evas_Object *obj);
|
||||
EAPI void e_icon_preload_set (Evas_Object *obj, Eina_Bool preload);
|
||||
EAPI Eina_Bool e_icon_preload_get (const Evas_Object *obj);
|
||||
EAPI void e_icon_size_get (const Evas_Object *obj, int *w, int *h);
|
||||
EAPI Eina_Bool e_icon_fill_inside_get (const Evas_Object *obj);
|
||||
EAPI void e_icon_fill_inside_set (Evas_Object *obj, Eina_Bool fill_inside);
|
||||
EAPI Eina_Bool e_icon_scale_up_get (const Evas_Object *obj);
|
||||
EAPI void e_icon_scale_up_set (Evas_Object *obj, Eina_Bool scale_up);
|
||||
EAPI void e_icon_data_set (Evas_Object *obj, void *data, int w, int h);
|
||||
EAPI void *e_icon_data_get (const Evas_Object *obj, int *w, int *h);
|
||||
EAPI void e_icon_scale_size_set (Evas_Object *obj, int size);
|
||||
EAPI int e_icon_scale_size_get (const Evas_Object *obj);
|
||||
EAPI void e_icon_selected_set (const Evas_Object *obj, Eina_Bool selected);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,63 @@
|
|||
#include "../e_mmx.h"
|
||||
#include "e_intl.h"
|
||||
#include "e_log.h"
|
||||
#include "e_error.h"
|
||||
#include "e_signals.h"
|
||||
#include "e_utils.h"
|
||||
#include "e_prefix.h"
|
||||
#include "e_user.h"
|
||||
#include "e_filereg.h"
|
||||
#include "e_object.h"
|
||||
#include "e_path.h"
|
||||
#include "e_config_data.h"
|
||||
#include "e_config.h"
|
||||
#include "e_backlight.h"
|
||||
#include "e_border.h"
|
||||
#include "e_powersave.h"
|
||||
#include "e_font.h"
|
||||
#include "e_int_menus.h"
|
||||
#include "e_env.h"
|
||||
#include "e_plane.h"
|
||||
#include "e_buffer.h"
|
||||
#include "e_region.h"
|
||||
#include "e_surface.h"
|
||||
#include "e_shell_surface.h"
|
||||
#include "e_shell.h"
|
||||
#include "e_module.h"
|
||||
#include "e_comp.h"
|
||||
#include "e_input.h"
|
||||
#include "e_output.h"
|
||||
#include "e_shader.h"
|
||||
#include "e_renderer.h"
|
||||
#include "e_scale.h"
|
||||
#include "e_theme.h"
|
||||
#include "e_pointer.h"
|
||||
#include "e_canvas.h"
|
||||
#include "e_manager.h"
|
||||
#include "e_container.h"
|
||||
#include "e_zone.h"
|
||||
#include "e_desk.h"
|
||||
#include "e_bg.h"
|
||||
#include "e_box.h"
|
||||
#include "e_icon.h"
|
||||
#include "e_menu.h"
|
||||
#include "e_win.h"
|
||||
#include "e_dialog.h"
|
||||
#include "e_about.h"
|
||||
#include "e_theme_about.h"
|
||||
#include "e_actions.h"
|
||||
#include "e_acpi.h"
|
||||
#include "e_exec.h"
|
||||
#include "e_configure.h"
|
||||
#include "e_config_dialog.h"
|
||||
#include "e_thumb.h"
|
||||
#include "e_shelf.h"
|
||||
#include "e_gadcon.h"
|
||||
#include "e_popup.h"
|
||||
#include "e_obj_dialog.h"
|
||||
#include "e_sys.h"
|
||||
#include "e_bindings.h"
|
||||
#include "e_ipc.h"
|
||||
#include "e_ipc_codec.h"
|
||||
#include "e_exehist.h"
|
||||
#include "e_alert.h"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue