From c860341b5a27b43bb6355fa3256ebc6eb7136fb2 Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Mon, 26 Oct 2015 15:49:25 +0900 Subject: [PATCH] tizen 2.4 release --- ABOUT-NLS | 768 ++ AUTHORS | 31 + COPYING | 25 + ChangeLog | 0 INSTALL | 291 + Makefile.am | 19 + NEWS | 0 README | 0 autogen.sh | 14 + configure.ac | 94 + data/Makefile.am | 20 + data/common/comp-config.edc | 11 + data/common/comp-image.edc | 4 + data/common/comp-part-clipper.edc | 17 + data/common/comp-part-logger.edc | 21 + data/common/comp-part-persp.edc | 18 + data/common/comp-part-shower.edc | 20 + ...omp-part-swallow-rotation-on-effect-for-win.edc | 64 + data/common/comp-part-swallow.edc | 16 + data/common/comp-prog-hide-rotation-no-effect.edc | 28 + data/common/comp-prog-logger-on-off.edc | 10 + .../comp-prog-rotation-on-effect-for-win.edc | 59 + data/common/comp-prog-rotation-on-no-effect.edc | 36 + data/common/comp-prog-show-rotation-no-effect.edc | 48 + data/common/comp-prog-signal-emit.edc | 33 + data/common/comp-script.edc | 96 + data/common/comp-style.edc | 9 + data/group/app_tray.edc | 415 ++ data/group/capture_effect.edc | 99 + data/group/dialog.edc | 655 ++ data/group/dialog_without_dim.edc | 464 ++ data/group/fake_effect_default.edc | 99 + data/group/fake_effect_fade.edc | 758 ++ data/group/fake_effect_twist.edc | 174 + data/group/home_screen.edc | 476 ++ data/group/indicator.edc | 466 ++ data/group/keyboard.edc | 343 + data/group/lock_screen.edc | 277 + data/group/no_effect.edc | 106 + data/group/quickpanel.edc | 274 + data/group/shadow_default.edc | 312 + data/group/shadow_fade.edc | 384 + data/group/shadow_twist.edc | 1091 +++ data/group/task_switcher.edc | 349 + data/group/vi_fade.edc | 421 ++ data/images/bt_glow.png | Bin 0 -> 629 bytes data/images/capture.png | Bin 0 -> 2693 bytes data/images/comp-sh1.png | Bin 0 -> 882 bytes data/shadow.edc | 94 + e17-mod-tizen-comp.manifest | 10 + m4/ac_attribute.m4 | 47 + m4/libtool.m4 | 7309 ++++++++++++++++++++ m4/ltoptions.m4 | 368 + m4/ltsugar.m4 | 123 + m4/ltversion.m4 | 23 + m4/lt~obsolete.m4 | 92 + module.desktop.in | 8 + packaging/e17-mod-tizen-comp.spec | 81 + src/Makefile.am | 70 + src/e17-mod-tizen-comp.edj | Bin 0 -> 13048 bytes src/e_mod_comp.c | 5479 +++++++++++++++ src/e_mod_comp.h | 34 + src/e_mod_comp_atoms.c | 231 + src/e_mod_comp_atoms.h | 64 + src/e_mod_comp_aux_hint.c | 162 + src/e_mod_comp_aux_hint.h | 11 + src/e_mod_comp_bg_win.c | 331 + src/e_mod_comp_bg_win.h | 17 + src/e_mod_comp_canvas.c | 1190 ++++ src/e_mod_comp_canvas.h | 106 + src/e_mod_comp_cfdata.c | 366 + src/e_mod_comp_cfdata.h | 124 + src/e_mod_comp_debug.c | 358 + src/e_mod_comp_debug.h | 41 + src/e_mod_comp_effect.h | 77 + src/e_mod_comp_effect_image_launch.h | 43 + src/e_mod_comp_effect_win_rotation.h | 49 + src/e_mod_comp_hw_ov_win.c | 501 ++ src/e_mod_comp_hw_ov_win.h | 42 + src/e_mod_comp_hwcomp.h | 79 + src/e_mod_comp_object.c | 1008 +++ src/e_mod_comp_object.h | 70 + src/e_mod_comp_policy.c | 113 + src/e_mod_comp_policy.h | 14 + src/e_mod_comp_screen.c | 212 + src/e_mod_comp_screen.h | 30 + src/e_mod_comp_shared_types.h | 291 + src/e_mod_comp_update.c | 243 + src/e_mod_comp_update.h | 47 + src/e_mod_comp_util.c | 523 ++ src/e_mod_comp_util.h | 154 + src/e_mod_comp_win_shape_input.c | 576 ++ src/e_mod_comp_win_shape_input.h | 21 + src/e_mod_comp_win_type.c | 390 ++ src/e_mod_comp_win_type.h | 103 + src/e_mod_config.c | 1587 +++++ src/e_mod_config.h | 7 + src/e_mod_main.c | 133 + src/e_mod_main.h | 56 + src/effect/Makefile.am | 55 + src/effect/effect.c | 2263 ++++++ src/effect/effect.h | 38 + src/effect/effect_image_launch.c | 550 ++ src/effect/effect_image_launch.h | 19 + src/effect/effect_win_rotation.c | 753 ++ src/effect/effect_win_rotation.h | 17 + src/hwcomp/Makefile.am | 35 + src/hwcomp/hwcomp.c | 1137 +++ src/hwcomp/hwcomp.h | 34 + src/hwcomp/hwcomp_debug.c | 84 + src/hwcomp/hwcomp_debug.h | 26 + src/hwcomp/hwcomp_mobile.c | 695 ++ src/hwcomp/hwcomp_mobile.h | 13 + src/hwcomp/hwcomp_util.c | 517 ++ src/hwcomp/hwcomp_util.h | 44 + 115 files changed, 38303 insertions(+) create mode 100644 ABOUT-NLS create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100755 autogen.sh create mode 100755 configure.ac create mode 100644 data/Makefile.am create mode 100644 data/common/comp-config.edc create mode 100644 data/common/comp-image.edc create mode 100644 data/common/comp-part-clipper.edc create mode 100644 data/common/comp-part-logger.edc create mode 100644 data/common/comp-part-persp.edc create mode 100644 data/common/comp-part-shower.edc create mode 100644 data/common/comp-part-swallow-rotation-on-effect-for-win.edc create mode 100644 data/common/comp-part-swallow.edc create mode 100644 data/common/comp-prog-hide-rotation-no-effect.edc create mode 100644 data/common/comp-prog-logger-on-off.edc create mode 100644 data/common/comp-prog-rotation-on-effect-for-win.edc create mode 100644 data/common/comp-prog-rotation-on-no-effect.edc create mode 100644 data/common/comp-prog-show-rotation-no-effect.edc create mode 100644 data/common/comp-prog-signal-emit.edc create mode 100644 data/common/comp-script.edc create mode 100644 data/common/comp-style.edc create mode 100644 data/group/app_tray.edc create mode 100644 data/group/capture_effect.edc create mode 100755 data/group/dialog.edc create mode 100644 data/group/dialog_without_dim.edc create mode 100644 data/group/fake_effect_default.edc create mode 100644 data/group/fake_effect_fade.edc create mode 100644 data/group/fake_effect_twist.edc create mode 100644 data/group/home_screen.edc create mode 100644 data/group/indicator.edc create mode 100644 data/group/keyboard.edc create mode 100644 data/group/lock_screen.edc create mode 100644 data/group/no_effect.edc create mode 100644 data/group/quickpanel.edc create mode 100644 data/group/shadow_default.edc create mode 100644 data/group/shadow_fade.edc create mode 100644 data/group/shadow_twist.edc create mode 100644 data/group/task_switcher.edc create mode 100644 data/group/vi_fade.edc create mode 100644 data/images/bt_glow.png create mode 100644 data/images/capture.png create mode 100644 data/images/comp-sh1.png create mode 100755 data/shadow.edc create mode 100644 e17-mod-tizen-comp.manifest create mode 100644 m4/ac_attribute.m4 create mode 100644 m4/libtool.m4 create mode 100644 m4/ltoptions.m4 create mode 100644 m4/ltsugar.m4 create mode 100644 m4/ltversion.m4 create mode 100644 m4/lt~obsolete.m4 create mode 100644 module.desktop.in create mode 100755 packaging/e17-mod-tizen-comp.spec create mode 100755 src/Makefile.am create mode 100644 src/e17-mod-tizen-comp.edj create mode 100644 src/e_mod_comp.c create mode 100644 src/e_mod_comp.h create mode 100644 src/e_mod_comp_atoms.c create mode 100644 src/e_mod_comp_atoms.h create mode 100644 src/e_mod_comp_aux_hint.c create mode 100644 src/e_mod_comp_aux_hint.h create mode 100644 src/e_mod_comp_bg_win.c create mode 100644 src/e_mod_comp_bg_win.h create mode 100755 src/e_mod_comp_canvas.c create mode 100644 src/e_mod_comp_canvas.h create mode 100755 src/e_mod_comp_cfdata.c create mode 100755 src/e_mod_comp_cfdata.h create mode 100644 src/e_mod_comp_debug.c create mode 100644 src/e_mod_comp_debug.h create mode 100644 src/e_mod_comp_effect.h create mode 100644 src/e_mod_comp_effect_image_launch.h create mode 100644 src/e_mod_comp_effect_win_rotation.h create mode 100644 src/e_mod_comp_hw_ov_win.c create mode 100644 src/e_mod_comp_hw_ov_win.h create mode 100644 src/e_mod_comp_hwcomp.h create mode 100644 src/e_mod_comp_object.c create mode 100644 src/e_mod_comp_object.h create mode 100644 src/e_mod_comp_policy.c create mode 100644 src/e_mod_comp_policy.h create mode 100644 src/e_mod_comp_screen.c create mode 100644 src/e_mod_comp_screen.h create mode 100755 src/e_mod_comp_shared_types.h create mode 100644 src/e_mod_comp_update.c create mode 100644 src/e_mod_comp_update.h create mode 100755 src/e_mod_comp_util.c create mode 100644 src/e_mod_comp_util.h create mode 100644 src/e_mod_comp_win_shape_input.c create mode 100644 src/e_mod_comp_win_shape_input.h create mode 100644 src/e_mod_comp_win_type.c create mode 100644 src/e_mod_comp_win_type.h create mode 100755 src/e_mod_config.c create mode 100644 src/e_mod_config.h create mode 100644 src/e_mod_main.c create mode 100644 src/e_mod_main.h create mode 100644 src/effect/Makefile.am create mode 100755 src/effect/effect.c create mode 100644 src/effect/effect.h create mode 100644 src/effect/effect_image_launch.c create mode 100644 src/effect/effect_image_launch.h create mode 100644 src/effect/effect_win_rotation.c create mode 100644 src/effect/effect_win_rotation.h create mode 100644 src/hwcomp/Makefile.am create mode 100644 src/hwcomp/hwcomp.c create mode 100644 src/hwcomp/hwcomp.h create mode 100644 src/hwcomp/hwcomp_debug.c create mode 100644 src/hwcomp/hwcomp_debug.h create mode 100644 src/hwcomp/hwcomp_mobile.c create mode 100644 src/hwcomp/hwcomp_mobile.h create mode 100644 src/hwcomp/hwcomp_util.c create mode 100644 src/hwcomp/hwcomp_util.h diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..2f50c66 --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,768 @@ +Notes on the Free Translation Project +************************************* + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that will gradually become able to speak many languages. +A few packages already provide translations for their messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work at translations should contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +Quick configuration advice +========================== + +If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +INSTALL Matters +=============== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the GNU `gettext' own +library will be used. This library is wholly contained within this +package, usually in the `intl/' subdirectory, so prior installation of +the GNU `gettext' package is _not_ required. Installers may use +special options at configuration time for changing the default +behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will respectively bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might be not what is desirable. You +should use the more recent version of the GNU `gettext' library. I.e. +if the file `intl/VERSION' shows that the library which comes with this +package is more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages have usually many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +Using This Package +================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your country by running the command +`locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +Translating Teams +================= + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skill are praised more than +programming skill, here. + +Available Packages +================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of January +2004. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am ar az be bg bs ca cs da de el en en_GB eo es + +----------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | | + ap-utils | | + aspell | [] | + bash | [] [] [] [] | + batchelor | | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] | + bluez-pin | [] [] [] | + clisp | | + clisp | [] [] [] | + console-tools | [] [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + darkstat | [] () [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] () [] [] [] [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] [] [] | + flex | [] [] [] [] | + fslint | | + gas | [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] [] | + gettext | [] [] [] [] [] | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] [] [] [] | + gliv | | + glunarclock | [] [] | + gnubiff | [] | + gnucash | [] () [] [] | + gnucash-glossary | [] () [] | + gnupg | [] () [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] [] | + gprof | [] [] [] | + gpsdrive | () () () | + gramadoir | [] | + grep | [] [] [] [] [] [] | + gretl | [] | + gtick | [] () | + hello | [] [] [] [] [] [] | + id-utils | [] [] | + indent | [] [] [] [] | + iso_3166 | [] [] [] [] [] [] [] [] [] [] | + iso_3166_1 | [] [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] | + iso_639 | | + jpilot | [] [] [] | + jtag | | + jwhois | [] | + kbd | [] [] [] [] [] | + latrine | () | + ld | [] [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] | + libiconv | [] [] [] [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lingoteach_lessons | () () | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] | + man-db | [] () [] [] () | + minicom | [] [] [] | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] | + nano_1_0 | [] () [] [] [] | + opcodes | [] | + parted | [] [] [] [] [] | + ptx | [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] | + sed | [] [] [] [] [] [] | + sh-utils | [] [] [] | + shared-mime-info | | + sharutils | [] [] [] [] [] [] | + silky | () | + skencil | [] () [] | + sketch | [] () [] | + soundtracker | [] [] [] | + sp | [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] [] | + tin | () () | + tp-robot | | + tuxpaint | [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] [] [] [] [] | + xchat | [] [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs da de el en en_GB eo es + 4 0 0 1 9 4 1 40 41 60 78 17 1 5 13 68 + + et eu fa fi fr ga gl he hr hu id is it ja ko lg + +-------------------------------------------------+ + a2ps | [] [] [] () () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] | + aspell | [] [] | + bash | [] [] | + batchelor | [] [] | + bfd | [] | + binutils | [] [] | + bison | [] [] [] [] | + bluez-pin | [] [] [] [] [] | + clisp | | + clisp | [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] [] | + darkstat | () [] [] [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext | [] [] [] | + gettext-examples | [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gliv | () | + glunarclock | [] [] [] [] | + gnubiff | [] | + gnucash | () [] | + gnucash-glossary | [] | + gnupg | [] [] [] [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] [] [] | + gpe-clock | [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] | + gpe-sketchbook | [] | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] | + gprof | [] [] | + gpsdrive | () () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] | + gtick | [] [] [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + indent | [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] [] [] [] [] | + iso_3166_1 | [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | | + iso_4217 | [] [] [] [] [] [] | + iso_639 | | + jpilot | [] () | + jtag | [] | + jwhois | [] [] [] [] | + kbd | [] | + latrine | [] | + ld | [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] [] [] | + libiconv | [] [] [] [] [] [] [] [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] | + lingoteach_lessons | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] [] [] [] [] | + man-db | () () | + minicom | [] [] [] [] | + mysecretdiary | [] [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] | + sed | [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] | + sharutils | [] [] [] [] [] | + silky | () [] () () | + skencil | [] | + sketch | [] | + soundtracker | [] [] | + sp | [] () | + tar | [] [] [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] [] [] | + tin | [] () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] () [] | + vorbis-tools | [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] | + xchat | [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] [] | + +-------------------------------------------------+ + et eu fa fi fr ga gl he hr hu id is it ja ko lg + 22 2 1 26 106 28 24 8 10 41 33 1 26 33 12 0 + + lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru + +-----------------------------------------------------+ + a2ps | [] [] () () [] [] [] | + aegis | () () () | + ant-phone | [] [] | + anubis | [] [] [] [] [] [] | + ap-utils | [] () [] | + aspell | [] | + bash | [] [] [] | + batchelor | [] | + bfd | [] | + binutils | [] | + bison | [] [] [] [] [] | + bluez-pin | [] [] [] | + clisp | | + clisp | [] | + console-tools | [] | + coreutils | [] [] | + cpio | [] [] [] [] [] | + darkstat | [] [] [] [] | + diffutils | [] [] [] [] [] [] | + e2fsprogs | [] | + enscript | [] [] [] [] | + error | [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] | + fslint | [] [] | + gas | | + gawk | [] [] [] | + gbiff | [] [] | + gcal | | + gcc | | + gettext | [] [] [] | + gettext-examples | [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] | + gliv | [] [] [] | + glunarclock | [] [] [] [] | + gnubiff | [] | + gnucash | [] [] () [] | + gnucash-glossary | [] [] | + gnupg | [] | + gpe-aerial | [] [] [] [] | + gpe-beam | [] [] [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] | + gprof | [] [] | + gpsdrive | () () [] | + gramadoir | () [] | + grep | [] [] [] [] [] | + gretl | | + gtick | [] [] [] | + hello | [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + indent | [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_1 | [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] | + jpilot | () () | + jtag | | + jwhois | [] [] [] [] () | + kbd | [] [] [] | + latrine | [] | + ld | | + libc | [] [] [] [] | + libgpewidget | [] [] [] | + libiconv | [] [] [] [] [] | + lifelines | | + lilypond | | + lingoteach | | + lingoteach_lessons | | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailutils | [] [] [] | + make | [] [] [] [] | + man-db | [] | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] [] [] [] [] | + nano_1_0 | [] [] [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + ptx | [] [] [] [] [] [] [] [] | + python | | + radius | [] [] | + recode | [] [] [] [] | + rpm | [] [] [] | + screem | | + scrollkeeper | [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] | + sharutils | [] [] | + silky | () | + skencil | [] [] | + sketch | [] [] | + soundtracker | | + sp | | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] | + tin | | + tp-robot | [] | + tuxpaint | [] [] [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] | + vorbis-tools | [] [] [] | + wastesedge | | + wdiff | [] [] [] [] [] | + wget | [] [] [] | + xchat | [] [] [] | + xfree86_xkb_xml | [] [] | + xpad | [] [] | + +-----------------------------------------------------+ + lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru + 1 2 0 3 12 0 10 69 6 7 1 40 26 36 76 63 + + sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu + +-----------------------------------------------------+ + a2ps | [] [] [] [] | 16 + aegis | | 0 + ant-phone | | 3 + anubis | [] [] | 9 + ap-utils | () | 3 + aspell | | 4 + bash | | 9 + batchelor | | 3 + bfd | [] [] | 6 + binutils | [] [] [] | 8 + bison | [] [] | 14 + bluez-pin | [] [] [] | 14 + clisp | | 0 + clisp | | 5 + console-tools | | 3 + coreutils | [] [] [] [] | 16 + cpio | [] [] | 14 + darkstat | [] [] [] () () | 12 + diffutils | [] [] [] | 23 + e2fsprogs | [] [] | 6 + enscript | [] [] | 12 + error | [] [] [] | 15 + fetchmail | [] [] | 11 + fileutils | [] [] [] [] [] | 17 + findutils | [] [] [] [] [] [] | 29 + flex | [] [] | 13 + fslint | | 3 + gas | [] | 3 + gawk | [] [] | 12 + gbiff | | 4 + gcal | [] [] | 4 + gcc | [] | 4 + gettext | [] [] [] [] [] | 16 + gettext-examples | [] [] [] [] [] | 14 + gettext-runtime | [] [] [] [] [] [] [] [] | 22 + gettext-tools | [] [] [] [] [] [] | 14 + gimp-print | [] [] | 10 + gliv | | 3 + glunarclock | [] [] [] | 13 + gnubiff | | 3 + gnucash | [] [] | 9 + gnucash-glossary | [] [] [] | 8 + gnupg | [] [] [] [] | 17 + gpe-aerial | [] | 7 + gpe-beam | [] | 8 + gpe-calendar | [] [] [] [] | 13 + gpe-clock | [] [] [] | 10 + gpe-conf | [] [] | 9 + gpe-contacts | [] [] [] | 11 + gpe-edit | [] [] [] [] [] | 12 + gpe-go | | 5 + gpe-login | [] [] [] [] [] | 13 + gpe-ownerinfo | [] [] [] [] | 13 + gpe-sketchbook | [] [] | 9 + gpe-su | [] [] [] | 10 + gpe-taskmanager | [] [] [] | 10 + gpe-timesheet | [] [] [] [] | 12 + gpe-today | [] [] [] [] [] | 13 + gpe-todo | [] [] [] [] | 12 + gphoto2 | [] [] [] | 11 + gprof | [] [] | 9 + gpsdrive | [] [] | 3 + gramadoir | [] | 5 + grep | [] [] [] [] | 26 + gretl | | 3 + gtick | | 7 + hello | [] [] [] [] [] | 34 + id-utils | [] [] | 12 + indent | [] [] [] [] | 21 + iso_3166 | [] [] [] [] [] [] [] | 27 + iso_3166_1 | [] [] [] | 16 + iso_3166_2 | | 0 + iso_3166_3 | | 2 + iso_4217 | [] [] [] [] [] [] | 24 + iso_639 | | 1 + jpilot | [] [] [] [] [] | 9 + jtag | [] | 2 + jwhois | () [] [] | 11 + kbd | [] [] | 11 + latrine | | 2 + ld | [] [] | 5 + libc | [] [] [] [] | 20 + libgpewidget | [] [] [] [] | 13 + libiconv | [] [] [] [] [] [] [] [] | 27 + lifelines | [] | 2 + lilypond | [] | 3 + lingoteach | | 2 + lingoteach_lessons | () | 0 + lynx | [] [] [] | 14 + m4 | [] [] | 15 + mailutils | | 5 + make | [] [] [] | 16 + man-db | [] | 5 + minicom | | 11 + mysecretdiary | [] [] | 10 + nano | [] [] [] [] | 17 + nano_1_0 | [] [] [] | 17 + opcodes | [] [] | 6 + parted | [] [] [] | 15 + ptx | [] [] | 22 + python | | 0 + radius | | 4 + recode | [] [] [] | 20 + rpm | [] [] | 9 + screem | [] [] | 2 + scrollkeeper | [] [] [] | 15 + sed | [] [] [] [] [] [] | 24 + sh-utils | [] [] | 14 + shared-mime-info | [] [] | 7 + sharutils | [] [] [] [] | 17 + silky | () | 3 + skencil | [] | 6 + sketch | [] | 6 + soundtracker | [] [] | 7 + sp | [] | 3 + tar | [] [] [] [] [] | 24 + texinfo | [] [] [] | 14 + textutils | [] [] [] [] | 16 + tin | | 1 + tp-robot | | 2 + tuxpaint | [] [] [] [] [] | 29 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux | [] [] | 15 + vorbis-tools | | 8 + wastesedge | | 0 + wdiff | [] [] [] | 18 + wget | [] [] [] [] [] [] [] [] | 24 + xchat | [] [] [] [] [] | 15 + xfree86_xkb_xml | [] [] [] [] [] | 11 + xpad | | 5 + +-----------------------------------------------------+ + 63 teams sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu + 131 domains 47 19 28 83 0 0 59 13 1 1 11 0 22 22 0 1373 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If January 2004 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +Using `gettext' in new packages +=============================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..dbcd77c --- /dev/null +++ b/AUTHORS @@ -0,0 +1,31 @@ +The Rasterman (Carsten Haitzler) +Ibukun Olumuyiwa +Sebastian Dransfeld +HandyAndE (Andrew Williams) +CodeWarrior (Hisham Mardam Bey) +dj2 (Dan Sinclair) +Tilman Sauerbeck +Aleksej Struk +Brian Mattern +devilhorns (Christopher Michael) +/dev/urandom (Viktor Kojouharov) +ilLogict (Chidambar Zinnoury) +Stafford Horne +Cedric Bail +onefang (David Seikel) +okra (Stephen Houston) +Byron Hillis +Ravenlock (Eric Schuele) +ManoWarrior (Luchezar Petkov) +morlenxus (Brian Miculcy) +Toma- (Tom Haste) +k-s (Gustavo Sverzut Barbieri) +Peter van de Werken +Florian Hackenberger +Hannes Janetzek +Mike Blumenkrantz (discomfitor/zmike) +Leif Middelschulte +yoz (Michael Bouchaud) +Gwanglim Lee +Gwangyeong Mun +Duna Oh diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..4556b54 --- /dev/null +++ b/COPYING @@ -0,0 +1,25 @@ +Copyright notice for Enlightenment: + +Copyright (C) 2000-2012 Carsten Haitzler and various contributors (see AUTHORS) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 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. + +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. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..8b82ade --- /dev/null +++ b/INSTALL @@ -0,0 +1,291 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008 Free Software Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..920e222 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,19 @@ +ACLOCAL_AMFLAGS = -I m4 +MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ + config.sub configure depcomp install-sh ltmain.sh \ + missing module.desktop config.rpath mkinstalldirs + +SUBDIRS = src \ +data + +filesdir = $(datadir) +files_DATA = module.desktop + +EXTRA_DIST = module.desktop.in + +clean-local: + rm -rf module.desktop *~ + +uninstall: + rm -rf $(DESTDIR)$(datadir) + diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..67a19c2 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +rm -rf autom4te.cache +rm -f aclocal.m4 ltmain.sh + +#echo "Running autopoint..." ; autopoint -f || : +echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1 +echo "Running autoconf..." ; autoconf || exit 1 +echo "Running autoheader..." ; autoheader || exit 1 +echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1 +echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1 + + diff --git a/configure.ac b/configure.ac new file mode 100755 index 0000000..0ad2b7f --- /dev/null +++ b/configure.ac @@ -0,0 +1,94 @@ +dnl Process this file with autoconf to produce a configure script. + +# get rid of that stupid cache mechanism +rm -f config.cache + +AC_INIT(e17-mod-tizen-comp, 0.1, gl77.lee@samsung.com) +AC_PREREQ(2.52) +AC_CONFIG_SRCDIR(configure.ac) +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_ISC_POSIX + +AM_INIT_AUTOMAKE(1.8) +AM_CONFIG_HEADER(config.h) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +AC_PROG_CC +AM_PROG_CC_STDC +AM_PROG_CC_C_O +AC_HEADER_STDC +AC_C_CONST +AC_C___ATTRIBUTE__ + +define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl +define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl +AC_PROG_LIBTOOL + +#AM_GNU_GETTEXT([external]) +#AM_GNU_GETTEXT_VERSION(0.14) + +PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment,elementary,utilX,dlog,pixman-1]) +AC_SUBST(ENLIGHTENMENT_CFLAGS) +AC_SUBST(ENLIGHTENMENT_LIBS) + +AC_ARG_ENABLE([hwc], + AC_HELP_STRING([--enable-hwc], + [enable hwc for mdp. @<:@default=enabled@:>@]), + [ + if test "x${enableval}" = "xyes" ; then + want_hwc="yes" + else + want_hwc="no" + fi + ]) + +if test "x${want_hwc}" = "xyes"; then + PKG_CHECK_MODULES([HWC], + [libhwc >= 0.2.0], + [ + AC_DEFINE([USE_HWC], [1], [Define to 1 if you have libhwc.]) + ]) +fi + +AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl) +AC_SUBST(dlopen_libs) + +release=$(pkg-config --variable=release enlightenment) +MODULE_ARCH="$host_os-$host_cpu-$release" +AC_SUBST(MODULE_ARCH) +AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture") + +# Find edje_cc +PKG_CHECK_MODULES(EDJE, [edje >= 1.0.0]) +AC_ARG_WITH(edje-cc, + AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc]), + [ + v=$withval; + EDJE_CC=$v + ],[ + EDJE_CC=$(pkg-config --variable=prefix edje)/bin/edje_cc + ] +) +AC_SUBST(EDJE_CC) +AC_MSG_CHECKING([Which edje_cc to use]) +AC_MSG_RESULT(${EDJE_CC}) + +# ttrace support +PKG_CHECK_MODULES(TTRACE, [ttrace], + AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available])); + +datadir=$(pkg-config --variable=modules enlightenment)/${PACKAGE} +AC_ARG_ENABLE(homedir-install, + AS_HELP_STRING([--enable-homedir-install], [Install module in homedir]), + [ datadir="${HOME}/.e/e/modules/${PACKAGE}" ] +) + +AC_CONFIG_FILES([Makefile + module.desktop + src/Makefile + src/effect/Makefile + src/hwcomp/Makefile + data/Makefile]) +AC_OUTPUT + diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..ac8afc9 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,20 @@ +MAINTAINERCLEANFILES = Makefile.in + +EDJE_CC = @EDJE_CC@ +EDJE_FLAGS = -v \ +-id $(top_srcdir)/data/images + +filesdir = /usr/share/enlightenment/data/themes +files_DATA = \ +shadow.edj + +EXTRA_DIST = \ +shadow.edc + +shadow.edj: Makefile $(EXTRA_DIST) + $(EDJE_CC) $(EDJE_FLAGS) \ + $(top_srcdir)/data/shadow.edc \ + $(top_builddir)/data/shadow.edj + +clean-local: + rm -f *.edj diff --git a/data/common/comp-config.edc b/data/common/comp-config.edc new file mode 100644 index 0000000..a8c822c --- /dev/null +++ b/data/common/comp-config.edc @@ -0,0 +1,11 @@ +#define DEBUG 0 +#define USE_LOGGER 0 + +#define USE_RESIZE_FOR_WND_ROT 1 +#define USE_ORI 1 + +#define DURATION_WND_ROT_PREV_PIXMAP_CLIPPER_HIDE SINUSOIDAL 0.3 +#define DURATION_WND_ROT_PREV_PIXMAP_SWALLOW_HIDE SINUSOIDAL 0.3 + +#define DURATION_WND_ROT_CLIPPER_HIDE_TO_SHOW SINUSOIDAL 0.3 +#define DURATION_WND_ROT_SWALLOW_DEG_TO_ZERO DECELERATE 0.3 diff --git a/data/common/comp-image.edc b/data/common/comp-image.edc new file mode 100644 index 0000000..de76585 --- /dev/null +++ b/data/common/comp-image.edc @@ -0,0 +1,4 @@ +images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; +} diff --git a/data/common/comp-part-clipper.edc b/data/common/comp-part-clipper.edc new file mode 100644 index 0000000..a098e35 --- /dev/null +++ b/data/common/comp-part-clipper.edc @@ -0,0 +1,17 @@ +part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1.relative: -1.0 -1.0; + rel1.offset: -9999 -9999; + rel2.relative: 2.0 2.0; + rel2.offset: 9999 9999; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } +} /* end of part "clipper" */ diff --git a/data/common/comp-part-logger.edc b/data/common/comp-part-logger.edc new file mode 100644 index 0000000..a64d289 --- /dev/null +++ b/data/common/comp-part-logger.edc @@ -0,0 +1,21 @@ +#if USE_LOGGER +part { name: "logger"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1.relative: 0.02 0.02; + rel2.relative: 0.98 0.98; + text { + style: "textblock_style"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } +} /* end of part "logger" */ +#endif diff --git a/data/common/comp-part-persp.edc b/data/common/comp-part-persp.edc new file mode 100644 index 0000000..dc62382 --- /dev/null +++ b/data/common/comp-part-persp.edc @@ -0,0 +1,18 @@ +part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 1 1; + max: 1 1; + visible: 0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "zoom-out" 0.0; + inherit: "default" 0.0; + perspective.zplane: -150; + } + description { state: "zoom-in" 0.0; + inherit: "default" 0.0; + perspective.zplane: 150; + } +} /* end of part "persp" */ diff --git a/data/common/comp-part-shower.edc b/data/common/comp-part-shower.edc new file mode 100644 index 0000000..9f3fa5c --- /dev/null +++ b/data/common/comp-part-shower.edc @@ -0,0 +1,20 @@ +part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 0 0; + } +} /* end of part "shower" */ diff --git a/data/common/comp-part-swallow-rotation-on-effect-for-win.edc b/data/common/comp-part-swallow-rotation-on-effect-for-win.edc new file mode 100644 index 0000000..ad75b49 --- /dev/null +++ b/data/common/comp-part-swallow-rotation-on-effect-for-win.edc @@ -0,0 +1,64 @@ +description { state: "default-visible" 0.0; + inherit: "default" 0.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + perspective: "persp"; + rotation.x: 0; + rotation.y: 0; + rotation.z: 0; + } +} +description { state: "visible-rotation--270" 0.0; + inherit: "default-visible" 0.0; + map.perspective: "persp"; + map.rotation.z: -270; +} +description { state: "visible-rotation--180" 0.0; + inherit: "default-visible" 0.0; + map.perspective: "persp"; + map.rotation.z: -180; +} +description { state: "visible-rotation--90" 0.0; + inherit: "default-visible" 0.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + perspective: "persp"; + rotation.x: 0; + rotation.y: 0; + rotation.z: -90; + } +} +description { state: "visible-rotation-0" 0.0; + inherit: "default-visible" 0.0; + map.perspective: "persp"; + map.rotation.z: 0; +} +description { state: "visible-rotation-90" 0.0; + inherit: "default-visible" 0.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + perspective: "persp"; + rotation.x: 0; + rotation.y: 0; + rotation.z: 90; + } +} +description { state: "visible-rotation-180" 0.0; + inherit: "default-visible" 0.0; + map.perspective: "persp"; + map.rotation.z: 180; +} +description { state: "visible-rotation-270" 0.0; + inherit: "default-visible" 0.0; + map.perspective: "persp"; + map.rotation.z: 270; +} diff --git a/data/common/comp-part-swallow.edc b/data/common/comp-part-swallow.edc new file mode 100644 index 0000000..314e8b5 --- /dev/null +++ b/data/common/comp-part-swallow.edc @@ -0,0 +1,16 @@ +part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel1.to: "shower"; + rel2.relative: 1 1; + rel2.to: "shower"; + } + description { state: "visible-rot-0" 0.0; inherit: "default" 0.0; } + description { state: "visible-rot-90" 0.0; inherit: "default" 0.0; } + description { state: "visible-rot-180" 0.0; inherit: "default" 0.0; } + description { state: "visible-rot-270" 0.0; inherit: "default" 0.0; } +} /* end of part "e.swallow.content" */ diff --git a/data/common/comp-prog-hide-rotation-no-effect.edc b/data/common/comp-prog-hide-rotation-no-effect.edc new file mode 100644 index 0000000..59f37e7 --- /dev/null +++ b/data/common/comp-prog-hide-rotation-no-effect.edc @@ -0,0 +1,28 @@ +program { name: "prog-hide-rot-0"; + signal: "e,state,visible,off"; + source: "e.rot.0"; + action: STATE_SET "visible-rot-0" 0.0; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; +} +program { name: "prog-hide-rot-90"; + signal: "e,state,visible,off"; + source: "e.rot.90"; + action: STATE_SET "visible-rot-90" 0.0; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; +} +program { name: "prog-hide-rot-180"; + signal: "e,state,visible,off"; + source: "e.rot.180"; + action: STATE_SET "visible-rot-180" 0.0; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; +} +program { name: "prog-hide-rot-270"; + signal: "e,state,visible,off"; + source: "e.rot.270"; + action: STATE_SET "visible-rot-270" 0.0; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; +} diff --git a/data/common/comp-prog-logger-on-off.edc b/data/common/comp-prog-logger-on-off.edc new file mode 100644 index 0000000..8ae3d48 --- /dev/null +++ b/data/common/comp-prog-logger-on-off.edc @@ -0,0 +1,10 @@ +#if USE_LOGGER +program { name: "prog-logger-enable"; + action: STATE_SET "visible" 0.0; + target: "logger"; +} +program { name: "prog-logger-disable"; + action: STATE_SET "default" 0.0; + target: "logger"; +} +#endif /* end of USE_LOGGER */ diff --git a/data/common/comp-prog-rotation-on-effect-for-win.edc b/data/common/comp-prog-rotation-on-effect-for-win.edc new file mode 100644 index 0000000..d499c15 --- /dev/null +++ b/data/common/comp-prog-rotation-on-effect-for-win.edc @@ -0,0 +1,59 @@ +program { name: "prog-window-rotation--270"; + signal: "e,state,window,rotation,-270"; + source: "e"; + action: STATE_SET "visible-rotation--270" 0.0; + target: "e.swallow.content"; + after: "prog-window-rotation-0-done"; +} +program { name: "prog-window-rotation--180"; + signal: "e,state,window,rotation,-180"; + source: "e"; + action: STATE_SET "visible-rotation--180" 0.0; + target: "e.swallow.content"; + after: "prog-window-rotation-0-done"; +} +program { name: "prog-window-rotation--90"; + signal: "e,state,window,rotation,-90"; + source: "e"; + action: STATE_SET "visible-rotation--90" 0.0; + target: "e.swallow.content"; + after: "prog-window-rotation-0-done"; +} +program { name: "prog-window-rotation-0"; + signal: "e,state,window,rotation,0"; + source: "e"; + action: STATE_SET "visible-rotation-0" 0.0; + target: "e.swallow.content"; + after: "prog-window-rotation-0-done"; +} +program { name: "prog-window-rotation-90"; + signal: "e,state,window,rotation,90"; + source: "e"; + action: STATE_SET "visible-rotation-90" 0.0; + target: "e.swallow.content"; + after: "prog-window-rotation-0-done"; +} +program { name: "prog-window-rotation-180"; + signal: "e,state,window,rotation,180"; + source: "e"; + action: STATE_SET "visible-rotation-180" 0.0; + target: "e.swallow.content"; + after: "prog-window-rotation-0-done"; +} +program { name: "prog-window-rotation-270"; + signal: "e,state,window,rotation,270"; + source: "e"; + action: STATE_SET "visible-rotation-270" 0.0; + target: "e.swallow.content"; + after: "prog-window-rotation-0-done"; +} + +program { name: "prog-window-rotation-0-done"; + action: STATE_SET "visible-rotation-0" 0.0; + target: "e.swallow.content"; + transition: DURATION_WND_ROT_SWALLOW_DEG_TO_ZERO; + after: "prog-emit-window-rotation-done"; +} +program { name: "prog-emit-window-rotation-done"; + action: SIGNAL_EMIT "e,action,window,rotation,done" "e"; +} diff --git a/data/common/comp-prog-rotation-on-no-effect.edc b/data/common/comp-prog-rotation-on-no-effect.edc new file mode 100644 index 0000000..a5979af --- /dev/null +++ b/data/common/comp-prog-rotation-on-no-effect.edc @@ -0,0 +1,36 @@ +program { name: "prog-rot-0"; + signal: "e,state,rotation,on"; + source: "e.rot.0"; + after : "prog-emit-rotation-done"; + script { + set_curr_window_ang(0) + window_rotation(0) + } +} +program { name: "prog-rot-90"; + signal: "e,state,rotation,on"; + source: "e.rot.90"; + after : "prog-emit-rotation-done"; + script { + set_curr_window_ang(90) + window_rotation(0) + } +} +program { name: "prog-rot-180"; + signal: "e,state,rotation,on"; + source: "e.rot.180"; + after : "prog-emit-rotation-done"; + script { + set_curr_window_ang(180) + window_rotation(0) + } +} +program { name: "prog-rot-270"; + signal: "e,state,rotation,on"; + source: "e.rot.270"; + after : "prog-emit-rotation-done"; + script { + set_curr_window_ang(270) + window_rotation(0) + } +} diff --git a/data/common/comp-prog-show-rotation-no-effect.edc b/data/common/comp-prog-show-rotation-no-effect.edc new file mode 100644 index 0000000..09ba778 --- /dev/null +++ b/data/common/comp-prog-show-rotation-no-effect.edc @@ -0,0 +1,48 @@ +program { name: "prog-show-rot-0"; + signal: "e,state,visible,on"; + source: "e.rot.0"; + action: STATE_SET "default" 0.0; + target: "e.swallow.content"; + //after: "prog-emit-show-done"; + after: "prog-emit-rotation-done"; + script { + set_curr_window_ang(0) + window_rotation(0) + } +} +program { name: "prog-show-rot-90"; + signal: "e,state,visible,on"; + source: "e.rot.90"; + action: STATE_SET "default" 0.0; + target: "e.swallow.content"; + //after: "prog-emit-show-done"; + after: "prog-emit-rotation-done"; + script { + set_curr_window_ang(90) + window_rotation(0) + } +} +program { name: "prog-show-rot-180"; + signal: "e,state,visible,on"; + source: "e.rot.180"; + action: STATE_SET "default" 0.0; + target: "e.swallow.content"; + //after: "prog-emit-show-done"; + after: "prog-emit-rotation-done"; + script { + set_curr_window_ang(180) + window_rotation(0) + } +} +program { name: "prog-show-rot-270"; + signal: "e,state,visible,on"; + source: "e.rot.270"; + action: STATE_SET "default" 0.0; + target: "e.swallow.content"; + //after: "prog-emit-show-done"; + after: "prog-emit-rotation-done"; + script { + set_curr_window_ang(270) + window_rotation(0) + } +} diff --git a/data/common/comp-prog-signal-emit.edc b/data/common/comp-prog-signal-emit.edc new file mode 100644 index 0000000..87df5fa --- /dev/null +++ b/data/common/comp-prog-signal-emit.edc @@ -0,0 +1,33 @@ +program { name: "prog-emit-show-done"; + action: SIGNAL_EMIT "e,action,show,done" "e"; +} +program { name: "prog-emit-hide-done"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; +} +program { name: "prog-emit-move-done"; + action: SIGNAL_EMIT "e,action,move,done" "e"; +} +program { name: "prog-emit-restack-done"; + action: SIGNAL_EMIT "e,action,restack,done" "e"; +} +program { name: "prog-emit-raise-above-1-done"; + action: SIGNAL_EMIT "e,action,raise_above1,done" "e"; +} +program { name: "prog-emit-raise-above-2-done"; + action: SIGNAL_EMIT "e,action,raise_above2,done" "e"; +} +program { name: "prog-emit-raise-above-3-done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; +} +program { name: "prog-emit-raise-above-hide-done"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; +} +program { name: "prog-emit-rotation-done"; + action: SIGNAL_EMIT "e,action,rotation,done" "e"; +} +program { name: "prog-emit-bg-show-done"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; +} +program { name: "prog-emit-bg-hide-done"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; +} diff --git a/data/common/comp-script.edc b/data/common/comp-script.edc new file mode 100644 index 0000000..86275ca --- /dev/null +++ b/data/common/comp-script.edc @@ -0,0 +1,96 @@ +/* ----------------------------------------------------------------------------*/ +/* embryo script for logger and rotation */ +/* ----------------------------------------------------------------------------*/ +script { + +#if USE_LOGGER + public logger_enable = 0; + public logno = 0; + + public set_logging(on) { + set_int(logger_enable, on); + } + + public log_msg(Msg_Type:type, ...) { + if (get_int(logger_enable) == 1) { + if (type == MSG_STRING) { + new msg[200]; + getsarg(1, msg, 200); + strcat(msg, "
"); + + new logno_str[10]; + new no = get_int(logno); + snprintf(logno_str, 10, "[%i] ", no); + strprep(msg, logno_str); + + new str[1024]; + get_text(PART:"logger", str, 1024); + + strprep(str, msg); + set_text(PART:"logger", str); + + set_int(logno, no+1); + } + } + } +#endif /* end of USE_LOGGER */ + + public prev_window_ang = 0; + public curr_window_ang = 0; + + public set_curr_window_ang(ang) { + set_int(curr_window_ang, ang); + } + + public window_rotation(do_effect) { + new prev_ang; + new curr_ang; + new diff_ang; + new x, y, w, h; + new rect_w, rect_h; + + prev_ang = get_int(prev_window_ang); + curr_ang = get_int(curr_window_ang); + + get_geometry(PART:"shower", x, y, w, h); + +#if USE_LOGGER + new str[200]; + snprintf(str, 200, "window_rotation() %i,%i %ix%i %i->%i", x, y, w, h, prev_ang, curr_ang); + log_msg(MSG_STRING, str); +#endif /* end of USE_LOGGER */ + + diff_ang = prev_ang - curr_ang; + + if (diff_ang == 180 || diff_ang == -180) { + rect_w = w; + rect_h = h; + } + else if (diff_ang == 0) { + rect_w = w; + rect_h = h; + } + else { + rect_w = h; + rect_h = w; + } + + custom_state(PART:"shower", "default", 0.0); + set_state_val(PART:"shower", STATE_MIN, rect_w, rect_h); + set_state_val(PART:"shower", STATE_MAX, rect_w, rect_h); + set_state_val(PART:"shower", STATE_MAP_ROT_Z, curr_ang*1.0); + set_state(PART:"shower", "custom", 0.0); + + custom_state(PART:"e.swallow.content", "default", 0.0); + if (do_effect) { + set_state_val(PART:"e.swallow.content", STATE_MAP_ROT_Z, prev_ang*1.0); + } + else { + set_state_val(PART:"e.swallow.content", STATE_MAP_ROT_Z, curr_ang*1.0); + } + set_state(PART:"e.swallow.content", "custom", 0.0); + + set_int(prev_window_ang, curr_ang); + } + +} /* end of script */ diff --git a/data/common/comp-style.edc b/data/common/comp-style.edc new file mode 100644 index 0000000..17df5bb --- /dev/null +++ b/data/common/comp-style.edc @@ -0,0 +1,9 @@ +styles { + /* common text block style for logger */ + style { name: "textblock_style"; + base: "font=Sans font_size=20 align=left color=#ff0c0c wrap=word"; + tag: "br" "\n"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "tab" "\t"; + } +} /* end of styles */ diff --git a/data/group/app_tray.edc b/data/group/app_tray.edc new file mode 100644 index 0000000..6b0c6f6 --- /dev/null +++ b/data/group/app_tray.edc @@ -0,0 +1,415 @@ +/*-----------------------------------------------------*/ +/* group "app_tray" */ +/*-----------------------------------------------------*/ +group { name: "app_tray"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "shower"; + type: SPACER; + description { state: "default" 0.0; + rel1 { + relative: 1.0 0.0; + } + rel2 { + relative: 2.0 1.0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "background" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.05 0.05; + } + rel2 { + relative: 0.95 0.95; + } + } + description { state: "default-angle-90" 0.0; + rel1 { + relative: 0.0 -1.0; + } + rel2 { + relative: 1.0 0.0; + } + } + description { state: "default-angle-270" 0.0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 2.0; + } + } + description { state: "default-angle-180" 0.0; + rel1 { + relative: -1.0 0.0; + } + rel2 { + relative: 0.0 1.0; + } + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "visible" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "background" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "default-angle-90" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "default-angle-270" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "default-angle-180" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + } + part { name: "hider"; + type: RECT; + description { state: "default" 0.0; + visible: 1; + color: 0 0 0 255; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 0 0 0 0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 0 0 0 155; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "default-angle-90" 0.0; + visible: 1; + color: 0 0 0 255; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "default-angle-270" 0.0; + visible: 1; + color: 0 0 0 255; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "default-angle-180" 0.0; + visible: 1; + color: 0 0 0 255; + rel1.to: "shower"; + rel2.to: "shower"; + } + } + } + programs { + program { name: "image_show1"; + signal: "e,state,visible,0,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "image_show2"; + } + program { name: "image_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.25 0.8; + target : "shower"; + target: "e.swallow.content"; + after : "image_show3"; + } + program { name: "image_show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hider_show1"; + signal: "e,state,visible,0,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "hider"; + after: "hider_show2"; + } + program { name: "hider_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.25 0.8; + target : "hider"; + } + program { name: "right_image_show1"; + signal: "e,state,visible,90,on"; + source: "e"; + action: STATE_SET "default-angle-90" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "right_image_show2"; + } + program { name: "right_image_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.3 0.8; + target : "shower"; + target: "e.swallow.content"; + after : "image_show3"; + } + program { name: "right_hider_show1"; + signal: "e,state,visible,90,on"; + source: "e"; + action: STATE_SET "default-angle-90" 0.0; + target: "hider"; + after: "right_hider_show2"; + } + program { name: "right_hider_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.3 0.8; + target : "hider"; + } + program { name: "left_image_show1"; + signal: "e,state,visible,270,on"; + source: "e"; + action: STATE_SET "default-angle-270" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "left_image_show2"; + } + program { name: "left_image_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.3 0.8; + target : "shower"; + target: "e.swallow.content"; + after : "image_show3"; + } + program { name: "left_hider_show1"; + signal: "e,state,visible,270,on"; + source: "e"; + action: STATE_SET "default-angle-270" 0.0; + target: "hider"; + after: "left_hider_show2"; + } + program { name: "left_hider_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.3 0.8; + target : "hider"; + } + program { name: "reverse_image_show1"; + signal: "e,state,visible,180,on"; + source: "e"; + action: STATE_SET "default-angle-180" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "reverse_image_show2"; + } + program { name: "reverse_image_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.3 0.8; + target : "shower"; + target: "e.swallow.content"; + after : "image_show3"; + } + program { name: "reverse_hider_show1"; + signal: "e,state,visible,180,on"; + source: "e"; + action: STATE_SET "default-angle-180" 0.0; + target: "hider"; + after: "reverse_hider_show2"; + } + program { name: "reverse_hider_show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.3 0.8; + target : "hider"; + } + program { name: "image_hide1"; + signal: "e,state,visible,0,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "image_hide2"; + } + program { name: "image_hide2"; + action: STATE_SET "default" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "shower"; + target: "e.swallow.content"; + after: "image_hide3"; + } + program { name: "image_hide3"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "hider_hide1"; + signal: "e,state,visible,0,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "hider"; + after: "hider_hide2"; + } + program { name: "hider_hide2"; + action: STATE_SET "default" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "hider"; + } + program { name: "right_image_hide1"; + signal: "e,state,visible,90,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "right_image_hide2"; + } + program { name: "right_image_hide2"; + action: STATE_SET "default-angle-90" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "shower"; + target: "e.swallow.content"; + after: "image_hide3"; + } + program { name: "right_hider_hide1"; + signal: "e,state,visible,90,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "hider"; + after: "right_hider_hide2"; + } + program { name: "right_hider_hide2"; + action: STATE_SET "default-angle-90" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "hider"; + } + program { name: "left_image_hide1"; + signal: "e,state,visible,270,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "left_image_hide2"; + } + program { name: "left_image_hide2"; + action: STATE_SET "default-angle-270" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "shower"; + target: "e.swallow.content"; + after: "image_hide3"; + } + program { name: "left_hider_hide1"; + signal: "e,state,visible,270,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "hider"; + after: "left_hider_hide2"; + } + program { name: "left_hider_hide2"; + action: STATE_SET "default-angle-270" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "hider"; + } + program { name: "reverse_image_hide1"; + signal: "e,state,visible,180,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "shower"; + target: "e.swallow.content"; + after: "reverse_image_hide2"; + } + program { name: "reverse_image_hide2"; + action: STATE_SET "default-angle-180" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "shower"; + target: "e.swallow.content"; + after: "image_hide3"; + } + program { name: "reverse_hider_hide1"; + signal: "e,state,visible,180,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "hider"; + after: "reverse_hider_hide2"; + } + program { name: "reverse_hider_hide2"; + action: STATE_SET "default-angle-180" 0.0; + transition: DECEL_FAC 0.3 0.8; + target: "hider"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "shower"; + target: "e.swallow.content"; + target: "hider"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "shower"; + target: "e.swallow.content"; + target: "hider"; + after: "image_show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "shower"; + target: "e.swallow.content"; + target: "hider"; + after: "image_hide3"; + } + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "shower"; + target: "e.swallow.content"; + target: "hider"; + after: "show_background2"; + } + program { name: "show_background2"; + action: STATE_SET "background" 0.0; + transition: DECELERATE 0.25; + target: "shower"; + target: "e.swallow.content"; + target: "hider"; + after: "image_show3"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + action: STATE_SET "background" 0.0; + target: "shower"; + target: "e.swallow.content"; + target: "hider"; + after: "hide_background2"; + } + program { name: "hide_background2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.3; + target: "shower"; + target: "e.swallow.content"; + target: "hider"; + after: "image_hide3"; + } + } +} /* end of group "app_tray" */ diff --git a/data/group/capture_effect.edc b/data/group/capture_effect.edc new file mode 100644 index 0000000..6137d73 --- /dev/null +++ b/data/group/capture_effect.edc @@ -0,0 +1,99 @@ + /*-----------------------------------------------------*/ + /* group "capture_effect" */ + /*-----------------------------------------------------*/ + group { name: "capture_effect"; + images { + image: "capture.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 20; + rel1 { + relative: -2.0 -2.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 128; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: -0.6 -0.6; + } + rel2 { + relative: 1.6 1.6; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + } + part { name: "capture_image"; + type: IMAGE; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "capture.png"; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "visible" 0.0; + image.normal: "capture.png"; + rel1.to: "shower"; + rel2.to: "shower"; + } + } + } + programs { + program { name: "capture-effect1"; + signal: "img,state,capture,on"; + source: "img"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "capture_image"; + after: "capture-effect2"; + } + program { name: "capture-effect2"; + action: STATE_SET "visible" 0.0; + //transition: ACCELERATE 0.15; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + after: "capture-effect3"; + } + program { name: "capture-effect3"; + action: STATE_SET "default" 0.0; + //transition: DECELERATE 0.15; + transition: ACCELERATE 0.15; + target: "clipper"; + target: "shower"; + after: "capture-effect4"; + } + + program { name: "capture-effect4"; + action: SIGNAL_EMIT "img,capture,show,done" "img"; + } + } + } /* end of group "testgroup" */ diff --git a/data/group/dialog.edc b/data/group/dialog.edc new file mode 100755 index 0000000..a088145 --- /dev/null +++ b/data/group/dialog.edc @@ -0,0 +1,655 @@ +/*-----------------------------------------------------*/ +/* group "dialog" */ +/*-----------------------------------------------------*/ +group { name: "dialog"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "visible" 1.0; + inherit: "visible" 0.0; + } + description { state: "switcher" 0.0; + inherit: "visible" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + } + part { name: "dim_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.35 0.35; + } + rel2 { + relative: 0.65 0.65; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "visible" 1.0; + inherit: "visible" 0.0; + } + description { state: "switcher" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative: 0.0 -1.0; + offset: 0 0; + } + rel2 { + relative: 1.0 0.0; + } + } + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "visible" 1.0; + inherit: "default" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "switcher" 0.0; + inherit: "default" 0.0; + perspective.zplane: -500; + perspective.focal: 1000; + } + description { state: "switcher2" 0.0; + inherit: "default" 0.0; + perspective.zplane: -500; + perspective.focal: 1000; + } + } + part { name: "dim"; + type: RECT; + mouse_events: 0; + clip_to: "dim_clip"; + description { state: "default" 0.0; + visible: 1; + color: 0 0 0 0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "visible" 0.0; + visible: 1; + color: 0 0 0 127; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + } + description { state: "switcher" 0.0; + visible: 1; + color: 0 0 0 180; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + rotation { + x: 0; + y: 75; + z: 0; + } + } + perspective { + zplane: -500; + focal: 1000; + } + } + description { state: "switcher2" 0.0; + visible: 1; + color: 0 0 0 180; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + rotation { + x: 0; + y: 45; + z: 0; + } + } + perspective { + zplane: -500; + focal: 1000; + } + } + description { state: "visible" 1.0; + visible: 1; + color: 0 0 0 180; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + rotation { + x: 0; + y: 0; + z: 0; + } + } + perspective { + zplane: 0; + focal: 1000; + } + } + } + part { name: "e.swallow.transp.offset"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 0.0 0.0; + to: "shower"; + } + rel2 { + relative: 0.0 0.0; + to: "shower"; + } + } + } + part { name: "e.swallow.transp.rect"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + rel2 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + description { state: "default" 1.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "visible" 1.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 0; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "switcher" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 75; + z: 0; + } + } + } + description { state: "switcher2" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 45; + z: 0; + } + } + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "dim"; + after: "show2_1"; + after: "show2_2"; + } + program { name: "show2_1"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.1; + target: "dim"; + } + program { name: "show2_2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after : "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "hide3"; + } + program { name: "hide3"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + } + program { name: "switcher_on"; + signal: "e,state,switcher,on"; + source: "e"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "dim"; + after: "switcher_on2"; + } + program { name: "switcher_on2"; + action: STATE_SET "switcher" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "dim"; + after: "switcher_on3"; + } + program { name: "switcher_on3"; + action: STATE_SET "switcher2" 0.0; + target: "e.swallow.content"; + target: "dim"; + transition: LINEAR 0.3; + after: "switcher_on4"; + } + program { name: "switcher_on4"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "dim"; + after: "switcher_on5"; + } + program { name: "switcher_on5"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "switcher_on_top"; + signal: "e,state,switcher_top,on"; + source: "e"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "dim"; + after: "switcher_on_top2"; + after: "switcher_on_top2_2"; + } + program { name: "switcher_on_top2"; + action: STATE_SET "switcher" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + transition: LINEAR 0.3; + after: "switcher_on_top3"; + } + program { name: "switcher_on_top2_2"; + action: STATE_SET "switcher2" 0.0; + target: "dim"; + target: "e.swallow.content"; + transition: ACCELERATE 0.3; + } + program { name: "switcher_on_top3"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "dim"; + target: "e.swallow.content"; + after: "switcher_on_top4"; + } + program { name: "switcher_on_top4"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_3"; + } + program { name: "raise_above3_3"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.16; + target: "shower"; + after : "raise_above3_4"; + } + program { name: "raise_above3_4"; + action : STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "dim"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "hide3"; + } + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + after: "show3"; + } + program { name: "show_background2"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + after: "hide3"; + } + program { name: "hide_background2"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "dim"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "hide2"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "dim"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "dim"; + after: "hide2"; + } + program { name: "hide_dim"; + signal: "e,state,dim,off"; + source: "e"; + action: STATE_SET "hide" 0.0; + target: "dim_clip"; + } + } +} /* end of group "dialog" */ diff --git a/data/group/dialog_without_dim.edc b/data/group/dialog_without_dim.edc new file mode 100644 index 0000000..5bc879d --- /dev/null +++ b/data/group/dialog_without_dim.edc @@ -0,0 +1,464 @@ +/*-----------------------------------------------------*/ +/* group "dialog_without_dim" */ +/*-----------------------------------------------------*/ +group { name: "dialog_without_dim"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "visible" 1.0; + inherit: "visible" 0.0; + } + description { state: "switcher" 0.0; + inherit: "visible" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.35 0.35; + } + rel2 { + relative: 0.65 0.65; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "visible" 1.0; + inherit: "visible" 0.0; + } + description { state: "switcher" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative: 0.0 -1.0; + offset: 0 0; + } + rel2 { + relative: 1.0 0.0; + } + } + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "visible" 1.0; + inherit: "default" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "switcher" 0.0; + inherit: "default" 0.0; + perspective.zplane: -500; + perspective.focal: 1000; + } + description { state: "switcher2" 0.0; + inherit: "default" 0.0; + perspective.zplane: -500; + perspective.focal: 1000; + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + description { state: "default" 1.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "visible" 1.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 0; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "switcher" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 75; + z: 0; + } + } + } + description { state: "switcher2" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 45; + z: 0; + } + } + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after : "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after: "hide3"; + } + program { name: "hide3"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after: "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + } + program { name: "switcher_on"; + signal: "e,state,switcher,on"; + source: "e"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "switcher_on2"; + } + program { name: "switcher_on2"; + action: STATE_SET "switcher" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "switcher_on3"; + } + program { name: "switcher_on3"; + action: STATE_SET "switcher2" 0.0; + target: "e.swallow.content"; + transition: LINEAR 0.3; + after: "switcher_on4"; + } + program { name: "switcher_on4"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "switcher_on5"; + } + program { name: "switcher_on5"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "switcher_on_top"; + signal: "e,state,switcher_top,on"; + source: "e"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "switcher_on_top2"; + after: "switcher_on_top2_2"; + } + program { name: "switcher_on_top2"; + action: STATE_SET "switcher" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + transition: LINEAR 0.3; + after: "switcher_on_top3"; + } + program { name: "switcher_on_top2_2"; + action: STATE_SET "switcher2" 0.0; + target: "e.swallow.content"; + transition: ACCELERATE 0.3; + } + program { name: "switcher_on_top3"; + action: STATE_SET "visible" 1.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "switcher_on_top4"; + } + program { name: "switcher_on_top4"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_3"; + } + program { name: "raise_above3_3"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.16; + target: "shower"; + after : "raise_above3_4"; + } + program { name: "raise_above3_4"; + action : STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide3"; + } + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + after: "show3"; + } + program { name: "show_background2"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + after: "hide3"; + } + program { name: "hide_background2"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + } +} /* end of group "dialog" */ diff --git a/data/group/fake_effect_default.edc b/data/group/fake_effect_default.edc new file mode 100644 index 0000000..f3431d7 --- /dev/null +++ b/data/group/fake_effect_default.edc @@ -0,0 +1,99 @@ +/*-----------------------------------------------------*/ +/* group "fake_effect" */ +/*-----------------------------------------------------*/ +group { name: "fake_effect"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.1 0.1; + } + rel2 { + relative: 0.9 0.9; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + } + part { name: "fake.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + } + } + programs { + program { name: "show1"; + signal: "fake,state,visible,on"; + source: "fake"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + transition: DECELERATE 0.1; + after: "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "fake,action,show,done" "fake"; + } + program { name: "hide1"; + signal: "fake,state,visible,off"; + source: "fake"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + transition: DECELERATE 0.2; + after: "hide2"; + } + program { name: "hide2"; + action: SIGNAL_EMIT "fake,action,hide,done" "fake"; + } + } +} /* end of group "fake_effect" */ diff --git a/data/group/fake_effect_fade.edc b/data/group/fake_effect_fade.edc new file mode 100644 index 0000000..def20d5 --- /dev/null +++ b/data/group/fake_effect_fade.edc @@ -0,0 +1,758 @@ +/*-----------------------------------------------------*/ +/* group "fake_effect_fade" */ +/*-----------------------------------------------------*/ +group { name: "fake_effect_fade"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 1; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default-180" 0.0; + visible: 0; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible-180" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default-90" 0.0; + visible: 0; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible-90" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default-270" 0.0; + visible: 0; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible-270" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: -2000.0; + perspective.focal: 1000; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "default-180" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: -2000.0; + perspective.focal: 1000; + } + description { state: "visible-180" 0.0; + inherit: "default-180" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "default-90" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: -2000.0; + perspective.focal: 1000; + } + description { state: "visible-90" 0.0; + inherit: "default-90" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "default-270" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: -2000.0; + perspective.focal: 1000; + } + description { state: "visible-270" 0.0; + inherit: "default-270" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; // fake effect start size + } + rel2 { + relative: 1.0 1.0; // fake effect start size + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; // fake effect end size + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "default-180" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; // fake effect start size + } + rel2 { + relative: 1.0 1.0; // fake effect start size + } + } + description { state: "visible-180" 0.0; + inherit: "default-180" 0.0; + rel1 { + relative: 0.0 0.0; // fake effect end size + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "default-90" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; // fake effect start size + } + rel2 { + relative: 1.0 1.0; // fake effect start size + } + } + description { state: "visible-90" 0.0; + inherit: "default-90" 0.0; + rel1 { + relative: 0.0 0.0; // fake effect end size + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "default-270" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; // fake effect start size + } + rel2 { + relative: 1.0 1.0; // fake effect start size + } + } + description { state: "visible-270" 0.0; + inherit: "default-270" 0.0; + rel1 { + relative: 0.0 0.0; // fake effect end size + } + rel2 { + relative: 1.0 1.0; + } + } + } + part { name: "fake.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 0; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "visible" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 0; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "default-180" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 0; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 180; + } + } + } + description { state: "visible-180" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 0; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 180; + } + } + } + description { state: "default-90" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 270; + } + } + } + description { state: "visible-90" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 270; + } + } + } + description { state: "default-270" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 90; + } + } + } + description { state: "visible-270" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 90; + } + } + } + } + part { name: "fake.swallow.indicator"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 0.05; + } + } + description { state: "visible" 0.0; + min: 0 36; + max: 999999 36; + align: 0.5 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; // fake effect end size + } + rel2 { + to: "shower"; + relative: 1.0 0.0; + } + } + description { state: "default-180" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.95; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 180; + } + } + } + description { state: "visible-180" 0.0; + min: 0 36; + max: 999999 36; + align: 0.5 1.0; + rel1 { + to: "shower"; + relative: 0.0 1.0; // fake effect end size + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 180; + } + } + } + description { state: "default-90" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 0.05; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + center: "shower"; + x: 0; + y: 0; + z: 270; + } + } + } + description { state: "visible-90" 0.0; + min: 0 36; + max: 999999 36; + align: 0.5 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; // fake effect end size + } + rel2 { + to: "shower"; + relative: 1.0 0.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + center: "shower"; + x: 0; + y: 0; + z: 270; + } + } + } + description { state: "default-270" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 0.05; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + center: "shower"; + x: 0; + y: 0; + z: 90; + } + } + } + description { state: "visible-270" 0.0; + min: 0 36; + max: 999999 36; + align: 0.5 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; // fake effect end size + } + rel2 { + to: "shower"; + relative: 1.0 0.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + center: "shower"; + x: 0; + y: 0; + z: 90; + } + } + } + } + } + programs { + program { name: "show1"; + signal: "fake,state,visible,on"; + source: "fake"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + transition: DECEL_FAC 0.3 0.8; + after: "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "fake,action,show,done" "fake"; + } + program { name: "reverse1"; + signal: "fake,state,visible,180,on"; + source: "fake"; + action: STATE_SET "default-180" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "reverse2"; + } + program { name: "reverse2"; + action: STATE_SET "visible-180" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + transition: DECEL_FAC 0.3 0.8; + after: "show3"; + } + program { name: "rotation-right1"; + signal: "fake,state,visible,90,on"; + source: "fake"; + action: STATE_SET "default-90" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "rotation-right2"; + } + program { name: "rotation-right2"; + action: STATE_SET "visible-90" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + transition: DECEL_FAC 0.3 0.8; + after: "show3"; + } + program { name: "rotation-left1"; + signal: "fake,state,visible,270,on"; + source: "fake"; + action: STATE_SET "default-270" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "rotation-left2"; + } + program { name: "rotation-left2"; + action: STATE_SET "visible-270" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + transition: DECEL_FAC 0.3 0.8; + after: "show3"; + } + program { name: "hide1"; + signal: "fake,state,visible,off"; + source: "fake"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.indicator"; + target: "fake.swallow.content"; + transition: DECELERATE 0.3; + after: "hide2"; + } + program { name: "hide2"; + action: SIGNAL_EMIT "fake,action,hide,done" "fake"; + } + program { name: "hide-reverse1"; + signal: "fake,state,visible,180,off"; + source: "fake"; + action: STATE_SET "default-180" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.indicator"; + target: "fake.swallow.content"; + transition: DECELERATE 0.3; + after: "hide2"; + } + program { name: "hide-rotate-right1"; + signal: "fake,state,visible,90,off"; + source: "fake"; + action: STATE_SET "default-90" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.indicator"; + target: "fake.swallow.content"; + transition: DECELERATE 0.3; + after: "hide2"; + } + program { name: "hide-rotate-left1"; + signal: "fake,state,visible,270,off"; + source: "fake"; + action: STATE_SET "default-270" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.indicator"; + target: "fake.swallow.content"; + transition: DECELERATE 0.3; + after: "hide2"; + } + program { name: "show_noeffect1"; + signal: "fake,state,visible,on,noeffect"; + source: "fake"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "show3"; + } + program { name: "reverse_noeffect1"; + signal: "fake,state,visible,180,on,noeffect"; + source: "fake"; + action: STATE_SET "visible-180" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "show3"; + } + program { name: "right_rotate_noeffect1"; + signal: "fake,state,visible,90,on,noeffect"; + source: "fake"; + action: STATE_SET "visible-90" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "show3"; + } + program { name: "left_rotate_noeffect1"; + signal: "fake,state,visible,270,on,noeffect"; + source: "fake"; + action: STATE_SET "visible-270" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + target: "fake.swallow.indicator"; + after: "show3"; + } + program { name: "hide_noeffect1"; + signal: "fake,state,visible,off,noeffect"; + source: "fake"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.indicator"; + target: "fake.swallow.content"; + after: "hide2"; + } + } +} /* end of group "fake_effect_fade" */ diff --git a/data/group/fake_effect_twist.edc b/data/group/fake_effect_twist.edc new file mode 100644 index 0000000..d03f9f7 --- /dev/null +++ b/data/group/fake_effect_twist.edc @@ -0,0 +1,174 @@ +/*-----------------------------------------------------*/ +/* group "fake_effect_twist" */ +/*-----------------------------------------------------*/ +group { name: "fake_effect_twist"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: -1500; + perspective.focal: 1000; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + } + part { name: "fake.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 90; + z: 0; + } + } + } + description { state: "visible" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + } + } + programs { + program { name: "show1"; + signal: "fake,state,visible,on"; + source: "fake"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + after: "show3"; + } + program { name: "show3"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + //transition: DECELERATE 0.3; + //transition: LINEAR 3; + //transition: DECELERATE 0.8; + transition: ACCELERATE 0.45; + after: "show4"; + } + program { name: "show4"; + action: SIGNAL_EMIT "fake,action,show,done" "fake"; + } + program { name: "hide1"; + signal: "fake,state,visible,off"; + source: "fake"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "fake.swallow.content"; + //transition: LINEAR 3; + transition: DECELERATE 0.45; + after: "hide3"; + } + program { name: "hide3"; + action: SIGNAL_EMIT "fake,action,hide,done" "fake"; + } + } +} /* end of group "fake_effect_twist" */ diff --git a/data/group/home_screen.edc b/data/group/home_screen.edc new file mode 100644 index 0000000..c1c1bb3 --- /dev/null +++ b/data/group/home_screen.edc @@ -0,0 +1,476 @@ +/*-----------------------------------------------------*/ +/* group "home_screen" */ +/*-----------------------------------------------------*/ +group { name: "home_screen"; + #include "../common/comp-config.edc" + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 1; + rel1.relative: -1.0 -1.0; + rel1.offset: -9999 -9999; + rel2.relative: 2.0 2.0; + rel2.offset: 9999 9999; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 100; + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + description { state: "custom0" 0.0; + inherit: "default" 0.0; + } + description { state: "custom1" 0.0; + inherit: "default" 0.0; + } + } + + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0.25 0.25; + rel1.offset: 0 0; + rel2.relative: 0.75 0.75; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.05 0.05; + rel1.offset: 0 0; + rel2.relative: 0.95 0.95; + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative : 0.0 0.0; + offset: 0 0; + } + rel2 { + relative : 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative : 0.0 -1.0; + offset: 0 0; + } + rel2 { + relative : 1.0 0.0; + } + } + description { state: "custom0" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 1; + rel2.relative: 1 2; + } + description { state: "custom1" 0.0; + inherit: "default" 0.0; + rel1.relative: 1 0; + rel2.relative: 2 1; + } + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 1 1; + max: 1 1; + visible: 0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + perspective.zplane: 0; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + perspective.zplane: -1500; + } + description { state: "hide" 1.0; + inherit: "default" 0.0; + perspective.zplane: 0; + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map.on: 0; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "background" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map.on: 0; + } + description { state: "foreground" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map.on: 0; + } + /*-------------------------------------------------------------------*/ + /* window roation state for swallow */ + /* it must be below default state. */ + /*-------------------------------------------------------------------*/ + #include "../common/comp-part-swallow-rotation-on-effect-for-win.edc" + /*-------------------------------------------------------------------*/ + description { state: "visible" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map.on: 0; + } + description { state: "custom0" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map.on: 0; + } + description { state: "custom1" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map.on: 0; + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "background" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.0415; + target: "shower"; + target: "clipper"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "show3"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.35; + target: "shower"; + target: "clipper"; + target: "e.swallow.content"; + after: "show4"; + } + program { name: "show4"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "background_show"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_show2"; + } + program { name: "background_show2"; + action: STATE_SET "background" 0.0; + transition: DECELERATE 0.25; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_show3"; + } + program { name: "background_show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.35; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide3"; + } + program { name: "hide3"; + action: STATE_SET "background" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide4"; + } + program { name: "hide4"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide5"; + } + program { name: "hide5"; + action: STATE_SET "visible" 0.0; + target: "e.swallow.content"; + after: "hide6"; + } + program { name: "hide6"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "background_hide"; + signal: "e,state,background,visible,off"; + source: "e"; + action: STATE_SET "background" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_hide2"; + } + program { name: "background_hide2"; + action: STATE_SET "foreground" 0.0; + transition: DECELERATE 0.3; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_hide3"; + } + program { name: "background_hide3"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_show1"; + signal: "e,state,raise_above,on"; + source: "e"; + action: STATE_SET "background" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "raise_above_show2"; + } + program { name: "raise_above_show2"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.0415; + target: "shower"; + target: "clipper"; + target: "e.swallow.content"; + after: "raise_above_show3"; + } + program { name: "raise_above_show3"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.35; + target: "shower"; + target: "clipper"; + target: "e.swallow.content"; + after: "raise_above_show4"; + } + program { name: "raise_above_show4"; + action: SIGNAL_EMIT "e,action,raise_above_show,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.35; + target: "clipper"; + target: "shower"; + after: "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "clipper"; + target: "shower"; + after: "raise_above_hide4"; + } + program { name: "raise_above_hide4"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + } + /*------------------------------------------------------------*/ + /* window roation Program */ + /*------------------------------------------------------------*/ + #include "../common/comp-prog-rotation-on-effect-for-win.edc" + /*------------------------------------------------------------*/ + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.166; + target: "shower"; + after : "raise_above3_3"; + } + program { name: "raise_above3_3"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.1328; + target: "shower"; + after : "raise_above3_4"; + } + program { name: "raise_above3_4"; + action : STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.166; + target: "shower"; + after : "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show4"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide3"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "custom0" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.6; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide2_custom0"; + } + program { name: "hide2_custom0"; + action: STATE_SET "custom0" 0.0; + transition: DECELERATE 0.6; + target: "clipper"; + target: "shower"; + after: "hide3"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "custom1" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide2_custom1"; + } + program { name: "hide2_custom1"; + action: STATE_SET "custom1" 0.0; + transition: DECELERATE 0.5; + target: "clipper"; + target: "shower"; + after: "hide3"; + } + } +} /* end of group "shadow_fade" */ diff --git a/data/group/indicator.edc b/data/group/indicator.edc new file mode 100644 index 0000000..aca4abb --- /dev/null +++ b/data/group/indicator.edc @@ -0,0 +1,466 @@ +/*-----------------------------------------------------*/ +/* group "indicator" */ +/*-----------------------------------------------------*/ +group { name: "indicator"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + /*------------------------------------------------*/ + part { name: "clipper"; + type: RECT; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1.relative: -1.0 -1.0 ; + rel1.offset : -9999 -9999; + rel2.relative: 2.0 2.0 ; + rel2.offset : 9999 9999; + } + description { state: "default" 0.1; + inherit: "default" 0.0; + visible: 0; + color : 0 0 0 0; + } + description { state: "default,0" 0.0; + inherit: "default" 0.0; + visible: 0; + color : 255 255 255 0; + } + description { state: "default,90" 0.0; + inherit: "default" 0.0; + visible: 0; + color : 255 255 255 0; + } + description { state: "default,180" 0.0; + inherit: "default" 0.0; + visible: 0; + color : 255 255 255 0; + } + description { state: "default,270" 0.0; + inherit: "default" 0.0; + visible: 0; + color : 255 255 255 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + /*------------------------------------------------*/ + part { name: "shower"; + type: RECT; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0 0; + rel1.offset : 0 0; + rel2.relative: 0 0; + } + description { state: "default" 0.1; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "default,0" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 -1; + rel2.relative: 1 0; + } + description { state: "default,90" 0.0; + inherit: "default" 0.0; + rel1.relative: -1 0; + rel2.relative: 0 1; + } + description { state: "default,180" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 1; + rel2.relative: 1 2; + } + description { state: "default,270" 0.0; + inherit: "default" 0.0; + rel1.relative: 1 0; + rel2.relative: 2 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + } + /*------------------------------------------------*/ + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "default" 0.1; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "default,0" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "default,90" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "default,180" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "default,270" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1 1; + } + } + /*------------------------------------------------*/ + } + programs { + /*------------------------------------------------*/ + /* signal emit program */ + /*------------------------------------------------*/ + #include "../common/comp-prog-signal-emit.edc" + + /*------------------------------------------------------------------- + * 0.2 0.15 + *------------------------------------------------------------------- + * [curr] ---> show0 ---> show1 ---> show2 ---> SHOW,DONE + *------------------------------------------------------------------- + * default0.0 default0.1 default0.1 visible0.0 + *------------------------------------------------------------------- + * clipper clipper clipper clipper + * shower shower shower shower + * swallow swallow swallow swallow + *------------------------------------------------------------------- + */ + program { name: "prog-show-0"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-show-1"; + } + program { name: "prog-show-1"; + action: STATE_SET "default" 0.1; + transition: LINEAR 0.2; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-show-2"; + } + program { name: "prog-show-2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-show-done"; + } + /*------------------------------------------------*/ + program { name: "prog-show-noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-show-done"; + } + /*------------------------------------------------------------------- + * 0.15 + *------------------------------------------------------------------- + * [curr] ---> custom0-show0 ---> custom0-show1 ---> SHOW,DONE + *------------------------------------------------------------------- + * default0.0 default,0 0.0 visible0.0 + *------------------------------------------------------------------- + * clipper clipper clipper + * shower shower shower + * swallow swallow swallow + *------------------------------------------------------------------- + */ + program { name: "prog-show-custom0,0-0"; + signal: "e,state,visible,on,custom0,0"; + source: "e"; + action: STATE_SET "default,0" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-show-custom0,0-1"; + } + program { name: "prog-show-custom0,0-1"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-show-done"; + } + program { name: "prog-show-custom0,90-0"; + signal: "e,state,visible,on,custom0,90"; + source: "e"; + action: STATE_SET "default,90" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-show-custom0,90-1"; + } + program { name: "prog-show-custom0,90-1"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-show-done"; + } + program { name: "prog-show-custom0,180-0"; + signal: "e,state,visible,on,custom0,180"; + source: "e"; + action: STATE_SET "default,180" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-show-custom0,180-1"; + } + program { name: "prog-show-custom0,180-1"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-show-done"; + } + program { name: "prog-show-custom0,270-0"; + signal: "e,state,visible,on,custom0,270"; + source: "e"; + action: STATE_SET "default,270" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-show-custom0,270-1"; + } + program { name: "prog-show-custom0,270-1"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-show-done"; + } + /*------------------------------------------------*/ + program { name: "prog-show-custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-show-done"; + } + /*------------------------------------------------ + * 0 + *------------------------------------------------ + * [curr] ---> hide0 ---> HIDE,DONE + *------------------------------------------------ + * visible0.0 default0.1 + *------------------------------------------------ + * clipper clipper + * shower shower + * swallow swallow + *------------------------------------------------ + */ + program { name: "prog-hide-0"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; + } + /*------------------------------------------------*/ + program { name: "prog-hide-noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; + } + /*------------------------------------------------------------------------------------- + * 0.15 + *------------------------------------------------------------------------------------- + * [curr] ---> custom0-hide0 ---> custom0-hide1 ---> custom0-hide1 ---> HIDE,DONE + *------------------------------------------------------------------------------------- + * visible0.0 visible0.0 default,0 0.0 default0.1 + *------------------------------------------------------------------------------------- + * clipper clipper clipper clipper + * shower shower shower shower + * swallow swallow swallow swallow + *------------------------------------------------------------------------------------- + */ + program { name: "prog-hide-custom0,0-0"; + signal: "e,state,visible,off,custom0,0"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,0-1"; + } + program { name: "prog-hide-custom0,0-1"; + action: STATE_SET "default,0" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,0-2"; + } + program { name: "prog-hide-custom0,0-2"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; + } + program { name: "prog-hide-custom0,90-0"; + signal: "e,state,visible,off,custom0,90"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,90-1"; + } + program { name: "prog-hide-custom0,90-1"; + action: STATE_SET "default,90" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,90-2"; + } + program { name: "prog-hide-custom0,90-2"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; + } + program { name: "prog-hide-custom0,180-0"; + signal: "e,state,visible,off,custom0,180"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,180-1"; + } + program { name: "prog-hide-custom0,180-1"; + action: STATE_SET "default,180" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,180-2"; + } + program { name: "prog-hide-custom0,180-2"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; + } + program { name: "prog-hide-custom0,270-0"; + signal: "e,state,visible,off,custom0,270"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,270-1"; + } + program { name: "prog-hide-custom0,270-1"; + action: STATE_SET "default,270" 0.0; + transition: DECELERATE 0.15; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-hide-custom0,270-2"; + } + program { name: "prog-hide-custom0,270-2"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; + } + /*------------------------------------------------*/ + program { name: "prog-hide-custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-hide-done"; + } + /*------------------------------------------------*/ + program { name: "prog-raise-above-hide"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-raise-above-hide-done"; + } + /*------------------------------------------------*/ + program { name: "prog-raise-above-hide-post-work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + } + /*------------------------------------------------*/ + program { name: "prog-show-bg"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-bg-show-done"; + } + /*------------------------------------------------*/ + program { name: "prog-hide-bg"; + signal: "e,state,background,visible,off"; + source: "e"; + action: STATE_SET "default" 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "prog-emit-bg-hide-done"; + } + /*------------------------------------------------*/ + } +} /* end of group "indicator" */ diff --git a/data/group/keyboard.edc b/data/group/keyboard.edc new file mode 100644 index 0000000..924f182 --- /dev/null +++ b/data/group/keyboard.edc @@ -0,0 +1,343 @@ +/*-------------------------------------------------------*/ +/* group "keyboard" */ +/*-------------------------------------------------------*/ + group { name: "keyboard"; + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "default-angle-90" 0.0; + visible: 1; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "default-angle-180" 0.0; + visible: 1; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "default-angle-270" 0.0; + visible: 1; + color: 255 255 255 1; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "default-noeffect" 0.0; + visible: 0; + color: 0 0 0 0; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0.0 0.2; + rel2.relative: 1.0 1.2; + } + description { state: "default-noeffect" 0.0; + visible: 0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + description { state: "default-angle-90" 0.0; + visible: 0; + rel1.relative: 0.2 0.0; + rel2.relative: 1.2 1.0; + } + description { state: "default-angle-180" 0.0; + visible: 0; + rel1.relative: 0.0 -0.2; + rel2.relative: 1.0 0.8; + } + description { state: "default-angle-270" 0.0; + visible: 0; + rel1.relative: -0.2 0.0; + rel2.relative: 0.8 1.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + + description { state: "default" 0.0; + rel1{ + to: "shower"; + relative: 0.0 0.0; + } + rel2{ + to: "shower"; + relative: 1.0 1.0; + } + } + description { state: "default-noeffect" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "visible" 0.0; + rel1{ + to: "shower"; + relative: 0.0 0.0; + } + rel2{ + to: "shower"; + relative: 1.0 1.0; + } + } + } + } + programs { +/*-------------------------------------------------------------------------*/ +/* Show Effect Program */ +/*-------------------------------------------------------------------------*/ + program { name: "show-default-0"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show-default-1"; + } + program { name: "show-angle-0"; + signal: "e,state,window,angle,0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "show-default-1"; + } + program { name: "show-angle-90"; + signal: "e,state,window,angle,90"; + source: "e"; + action: STATE_SET "default-angle-90" 0.0; + target: "clipper"; + target: "shower"; + after: "show-default-1"; + } + program { name: "show-angle-180"; + signal: "e,state,window,angle,180"; + source: "e"; + action: STATE_SET "default-angle-180" 0.0; + target: "clipper"; + target: "shower"; + after: "show-default-1"; + } + program { name: "show-angle-270"; + signal: "e,state,window,angle,270"; + source: "e"; + action: STATE_SET "default-angle-270" 0.0; + target: "clipper"; + target: "shower"; + after: "show-default-1"; + } + program { name: "show-default-1"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.05; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show-done"; + } + program { name: "show-done"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "show_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "background_show"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } +/*-------------------------------------------------------------------------*/ +/* Hide Effect Program */ +/*-------------------------------------------------------------------------*/ + program { name: "hide-default"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "hide-effect-default"; + } + program { name: "hide-effect-default"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + transition: ACCELERATE 0.05; + after : "hide-done"; + } + program { name: "hide-angle-0"; + signal: "e,state,visible,off,angle,0"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "hide-effect-angle-0"; + } + program { name: "hide-angle-90"; + signal: "e,state,visible,off,angle,90"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "hide-effect-angle-90"; + } + program { name: "hide-angle-180"; + signal: "e,state,visible,off,angle,180"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "hide-effect-angle-180"; + } + program { name: "hide-angle-270"; + signal: "e,state,visible,off,angle,270"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after : "hide-effect-angle-270"; + } + program { name: "hide-effect-angle-0"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + transition: ACCELERATE 0.05; + after: "hide-done"; + } + program { name: "hide-effect-angle-90"; + action: STATE_SET "default-angle-90" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + transition: ACCELERATE 0.05; + after : "hide-done"; + } + program { name: "hide-effect-angle-180"; + action: STATE_SET "default-angle-180" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + transition: ACCELERATE 0.05; + after : "hide-done"; + } + program { name: "hide-effect-angle-270"; + action: STATE_SET "default-angle-270" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + transition: ACCELERATE 0.05; + after : "hide-done"; + } + program { name: "hide_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide-done"; + } + program { name: "hide-done"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } +/*-------------------------------------------------------------------------*/ +/* STACKING Effect Program */ +/*-------------------------------------------------------------------------*/ + program { name: "raise_above_show1"; + signal: "e,state,raise_above,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "raise_above_show2"; + } + program { name: "raise_above_show2"; + action: SIGNAL_EMIT "e,action,raise_above_show,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + } +} /* end of group "keyboard" */ diff --git a/data/group/lock_screen.edc b/data/group/lock_screen.edc new file mode 100644 index 0000000..81deca8 --- /dev/null +++ b/data/group/lock_screen.edc @@ -0,0 +1,277 @@ +/*-----------------------------------------------------*/ +/* group "lockscreen" */ +/*-----------------------------------------------------*/ +group { name: "lockscreen"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1.relative: -1.0 -1.0; + rel1.offset: -9999 -9999; + rel2.relative: 2.0 2.0; + rel2.offset: 9999 9999; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.1 0.1; + offset: 0 0; + } + rel2 { + relative: 0.9 0.9; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative : 0.0 0.0; + offset: 0 0; + } + rel2 { + relative : 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative : 0.0 -1.0; + offset: 0 0; + } + rel2 { + relative : 1.0 0.0; + } + } + } + + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + description { state: "default" 1.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + after : "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "hide2"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after : "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_3"; + } + program { name: "raise_above3_3"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.16; + target: "shower"; + after : "raise_above3_4"; + } + program { name: "raise_above3_4"; + action : STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + after: "show_background2"; + } + program { name: "show_background2"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + after: "hide_background2"; + } + program { name: "hide_background2"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + } +} /* end of group "lockscreen" */ diff --git a/data/group/no_effect.edc b/data/group/no_effect.edc new file mode 100644 index 0000000..912aaab --- /dev/null +++ b/data/group/no_effect.edc @@ -0,0 +1,106 @@ +/*-----------------------------------------------------*/ +/* group "no-effect" */ +/*-----------------------------------------------------*/ +group { name: "no-effect"; + #include "../common/comp-config.edc" + #include "../common/comp-script.edc" + #include "../common/comp-image.edc" + parts { + #include "../common/comp-part-clipper.edc" + #include "../common/comp-part-persp.edc" + #include "../common/comp-part-shower.edc" + #include "../common/comp-part-swallow.edc" + #include "../common/comp-part-logger.edc" + } + programs { + #include "../common/comp-prog-signal-emit.edc" + /*------------------------------------------------ + * show/hide and fake show/hide + *-----------------------------------------------*/ + program { name: "prog-clipper-show"; + signal: "e,state,visible,on*"; + source: "*"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + after : "prog-emit-show-done"; + } + program { name: "prog-clipper-hide"; + signal: "e,state,visible,off*"; + source: "*"; + action: STATE_SET "default" 0.0; + target: "clipper"; + after : "prog-emit-hide-done"; + } + program { name: "prog-shower-show"; + signal: "e,state,visible,on*"; + source: "*"; + action: STATE_SET "visible" 0.0; + target: "shower"; + } + program { name: "prog-shower-hide"; + signal: "e,state,visible,off*"; + source: "*"; + action: STATE_SET "invisible" 0.0; + target: "shower"; + } + /*-----------------------------------------------*/ + program { name: "prog-swallow-show"; + signal: "e,state,visible,on*"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "e.swallow.content"; + } + program { name: "prog-swallow-hide"; + signal: "e,state,visible,off*"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "e.swallow.content"; + } + /*------------------------------------------------ + * raise above + *-----------------------------------------------*/ + program { name: "raise_above1"; + signal: "e,state,raise_above1,on"; + source: "e"; + after : "prog-emit-raise-above-1-done"; + } + program { name: "raise_above2"; + signal: "e,state,raise_above2,on"; + source: "e"; + after : "prog-emit-raise-above-2-done"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + after : "prog-emit-raise-above-3-done"; + } + program { name: "raise_above_hide"; + signal: "e,state,raise_above,off"; + source: "e"; + after : "prog-emit-raise-above-hide-done"; + } + /*------------------------------------------------ + * show/hide background + *-----------------------------------------------*/ + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + after : "prog-emit-show-done"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + after : "prog-emit-hide-done"; + } + /*------------------------------------------------ + * rotation + *-----------------------------------------------*/ + #include "../common/comp-prog-show-rotation-no-effect.edc" + #include "../common/comp-prog-hide-rotation-no-effect.edc" + #include "../common/comp-prog-rotation-on-no-effect.edc" + /*------------------------------------------------ + * logger + *-----------------------------------------------*/ + #include "../common/comp-prog-logger-on-off.edc" + } +} /* end of group "no-effect" */ diff --git a/data/group/quickpanel.edc b/data/group/quickpanel.edc new file mode 100644 index 0000000..5a9692d --- /dev/null +++ b/data/group/quickpanel.edc @@ -0,0 +1,274 @@ +/*-----------------------------------------------------*/ +/* group "quickpanel" */ +/*-----------------------------------------------------*/ +group { name: "quickpanel"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1.relative: -1.0 -1.0; + rel1.offset: -9999 -9999; + rel2.relative: 2.0 2.0; + rel2.offset: 9999 9999; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + } + part { name: "shower"; + type: RECT; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.1 0.1; + offset: 0 0; + } + rel2 { + relative: 0.9 0.9; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative : 0.0 0.0; + offset: 0 0; + } + rel2 { + relative : 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative : 0.0 -1.0; + offset: 0 0; + } + rel2 { + relative : 1.0 0.0; + } + } + } + + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + description { state: "default" 1.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + after : "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "hide2"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after : "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_3"; + } + program { name: "raise_above3_3"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.16; + target: "shower"; + after : "raise_above3_4"; + } + program { name: "raise_above3_4"; + action : STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + after: "show_background2"; + } + program { name: "show_background2"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + after: "hide_background2"; + } + program { name: "hide_background2"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + } +} /* end of group "quickpanel" */ diff --git a/data/group/shadow_default.edc b/data/group/shadow_default.edc new file mode 100644 index 0000000..d067aa6 --- /dev/null +++ b/data/group/shadow_default.edc @@ -0,0 +1,312 @@ +/*-----------------------------------------------------*/ +/* group "shadow" */ +/*-----------------------------------------------------*/ +group { name: "shadow"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 0 0 0 0; + rel1.relative: -1.0 -1.0; + rel1.offset: -9999 -9999; + rel2.relative: 2.0 2.0; + rel2.offset: 9999 9999; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.1 0.1; + offset: 0 0; + } + rel2 { + relative: 0.9 0.9; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative : 0.0 0.0; + offset: 0 0; + } + rel2 { + relative : 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative : 0.0 -1.0; + offset: 0 0; + } + rel2 { + relative : 1.0 0.0; + } + } + } + + part { name: "e.swallow.transp.offset"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 0.0 0.0; + to: "shower"; + } + rel2 { + relative: 0.0 0.0; + to: "shower"; + } + } + } + + part { name: "e.swallow.transp.rect"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + rel2 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + } + } + + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + description { state: "default" 1.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.1; + target : "clipper"; + target : "shower"; + after : "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "hide2"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + after: "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_3"; + } + program { name: "raise_above3_3"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.16; + target: "shower"; + after : "raise_above3_4"; + } + program { name: "raise_above3_4"; + action : STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.2; + target: "shower"; + after : "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + after : "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + after: "show3"; + } + program { name: "show_background2"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + after: "hide2"; + } + program { name: "hide_background2"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide2"; + } + } +} /* end of group "shadow" */ diff --git a/data/group/shadow_fade.edc b/data/group/shadow_fade.edc new file mode 100644 index 0000000..65fedec --- /dev/null +++ b/data/group/shadow_fade.edc @@ -0,0 +1,384 @@ +/*-----------------------------------------------------*/ +/* group "shadow_fade" */ +/*-----------------------------------------------------*/ +group { name: "shadow_fade"; + #include "../common/comp-config.edc" + images { + image: "comp-sh1.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 1; + rel1.relative: -1.0 -1.0; + rel1.offset: -9999 -9999; + rel2.relative: 2.0 2.0; + rel2.offset: 9999 9999; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 100; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + } + } + part { name: "shadow"; + mouse_events: 0; + clip_to: "clipper"; + description { state: "default" 0.0; + visible: 0; + image { + normal: "comp-sh1.png"; + border: 12 12 12 12; + middle: 0; + } + fill.smooth: 0; + rel1 { + to: "e.swallow.content"; + relative: 0.0 0.0; + offset: -12 -12; + } + rel2 { + to: "e.swallow.content"; + relative: 1.0 1.0; + offset: 11 11; + } + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.05 0.05; + rel1.offset: 0 0; + rel2.relative: 0.95 0.95; + } + } + part { name: "e.swallow.transp.offset"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 0.0 0.0; + to: "shower"; + } + rel2 { + relative: 0.0 0.0; + to: "shower"; + } + } + } + part { name: "e.swallow.transp.rect"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + rel2 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + } + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: 0.0; + perspective.focal: 1000; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + perspective.zplane: -700.0; + perspective.focal: 1000; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + perspective.zplane: -2000.0; + perspective.focal: 1000; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + perspective.zplane: 0.0; + perspective.focal: 1000; + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "invisible" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "visible" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "hide" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "foreground" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "background" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "invisible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "show1-1"; + } + program { name: "show1-1"; + action: STATE_SET "invisible" 0.0; + transition: LINEAR 0.05; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + transition: DECEL_FAC 0.15 0.8; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "background_show"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_show2"; + } + program { name: "background_show2"; + action: STATE_SET "background" 0.0; + transition: DECELERATE 0.25; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_show3"; + } + program { name: "background_show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "hide1-1"; + } + program { name: "hide1-1"; + action: STATE_SET "visible" 0.0; + transition: LINEAR 0.05; + target: "clipper"; + target: "shower"; + target: "persp"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "hide" 0.0; + transition: ACCEL_FAC 0.25 1.5; + target: "clipper"; + target: "shower"; + target: "persp"; + after: "hide3"; + } + program { name: "hide3"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + after: "hide4"; + } + program { name: "hide4"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "background_hide1"; + signal: "e,state,background,visible,off"; + source: "e"; + action: STATE_SET "background" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_hide2"; + } + program { name: "background_hide2"; + action: STATE_SET "foreground" 0.0; + transition: DECELERATE 0.25; + target: "clipper"; + target: "shower"; + after: "background_hide3"; + } + program { name: "background_hide3"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide3"; + } + program { name: "shadow-on"; + signal: "e,state,shadow,on"; + source: "e"; + action: STATE_SET "show" 0.0; + target: "shadow"; + } + program { name: "shadow-off"; + signal: "e,state,shadow,off"; + source: "e"; + action: STATE_SET "hidden" 0.0; + target: "shadow"; + } + } +} /* end of group "shadow_fade" */ diff --git a/data/group/shadow_twist.edc b/data/group/shadow_twist.edc new file mode 100644 index 0000000..217f29a --- /dev/null +++ b/data/group/shadow_twist.edc @@ -0,0 +1,1091 @@ +/*-----------------------------------------------------*/ +/* group "shadow_twist" */ +/*-----------------------------------------------------*/ +group { name: "shadow_twist"; + #include "../common/comp-config.edc" + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 0; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "interval" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 180 180 180 255; + } + description { state: "switcher" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "switcher2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + description { state: "default" 1.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "default" 0.5; + inherit: "default" 0.0; + visible: 0; + color: 0 0 0 0; + } + } + part { name: "shadow"; + mouse_events: 0; + clip_to: "clipper"; + description { state: "default" 0.0; + image { + normal: "comp-sh1.png"; + border: 12 12 12 12; + middle: 0; + } + fill.smooth: 0; + rel1 { + to: "e.swallow.content"; + relative: 0.0 0.0; + offset: -12 -12; + } + rel2 { + to: "e.swallow.content"; + relative: 1.0 1.0; + offset: 11 11; + } + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "interval" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "switcher" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "switcher2" 0.0; + inherit: "switcher" 0.0; + } + description { state: "visible" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + } + description { state: "background" 0.0; + visible: 0; + rel1 { + relative: 0.10 0.10; + } + rel2 { + relative: 0.90 0.90; + } + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative: 0.0 -1.0; + } + rel2 { + relative: 1.0 0.0; + } + } + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: -1500; + perspective.focal: 1000; + } + description { state: "interval" 0.0; + inherit: "default" 0.0; + perspective.zplane: -750; + perspective.focal: 1000; + } + description { state: "switcher" 0.0; + inherit: "default" 0.0; + perspective.zplane: -500; + perspective.focal: 1000; + } + description { state: "switcher2" 0.0; + inherit: "default" 0.0; + perspective.zplane: -500; + perspective.focal: 1000; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + perspective.zplane: 0; + perspective.focal: 1000; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + perspective.zplane: -1500; + perspective.focal: 1000; + } + } + part { name: "e.swallow.bgcontent"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "shower"; + rel1.relative: 0.0 0.0; + rel2.to: "shower"; + rel2.relative: 1.0 1.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 90; + z: 0; + } + } + } + description { state: "interval" 0.0; + rel1.to: "shower"; + rel1.relative: 0.0 0.0; + rel2.to: "shower"; + rel2.relative: 1.0 1.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 30; + z: 0; + } + } + } + description { state: "switcher" 0.0; + rel1.to: "shower"; + rel1.relative: 0.0 0.0; + rel2.to: "shower"; + rel2.relative: 1.0 1.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 75; + z: 0; + } + } + } + description { state: "switcher2" 0.0; + rel1.to: "shower"; + rel1.relative: 0.0 0.0; + rel2.to: "shower"; + rel2.relative: 1.0 1.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 45; + z: 0; + } + } + } + description { state: "visible" 0.0; + rel1.to: "shower"; + rel1.relative: 0.0 0.0; + rel2.to: "shower"; + rel2.relative: 1.0 1.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "hide" 0.0; + rel1.to: "shower"; + rel1.relative: 0.0 0.0; + rel2.to: "shower"; + rel2.relative: 1.0 1.0; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 90; + z: 0; + } + } + } + description { state: "visible" 1.0; + inherit: "visible" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map.on: 0; + } + description { state: "foreground" 0.0; + rel1.to: "shower"; + rel1.relative: 0.0 0.0; + rel2.to: "shower"; + rel2.relative: 1.0 1.0; + map.on: 0; + } + description { state: "background" 0.0; + inherit: "foreground" 0.0; + } + description { state: "default" 1.0; + inherit: "visible" 1.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + description { state: "default" 0.5; + inherit: "visible" 1.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + /*-------------------------------------------------------------------*/ + /* window roation state for swallow */ + /* it must be below default state. */ + /*-------------------------------------------------------------------*/ + #include "../common/comp-part-swallow-rotation-on-effect-for-win.edc" + /*-------------------------------------------------------------------*/ + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 90; + z: 0; + } + } + } + description { state: "interval" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 30; + z: 0; + } + } + } + description { state: "switcher" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 75; + z: 0; + } + } + } + description { state: "switcher2" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 45; + z: 0; + } + } + } + description { state: "visible" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "hide" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 90; + z: 0; + } + } + } + description { state: "visible" 1.0; + inherit: "visible" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + map.on: 0; + } + description { state: "foreground" 0.0; + rel1 { + to: "shower"; + relative: 0.0 0.0; + } + rel2 { + to: "shower"; + relative: 1.0 1.0; + } + map.on: 0; + } + description { state: "background" 0.0; + inherit: "foreground" 0.0; + } + description { state: "default" 1.0; + inherit: "visible" 1.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + description { state: "default" 0.5; + inherit: "visible" 1.0; + rel1.relative: 0 0; + rel2.relative: 1.0 1.0; + } + /*-------------------------------------------------------------------*/ + /* window roation state for swallow */ + /* it must be below default state. */ + /*-------------------------------------------------------------------*/ + #include "../common/comp-part-swallow-rotation-on-effect-for-win.edc" + /*-------------------------------------------------------------------*/ + } + } + programs { + program { name: "shadow-on"; + signal: "e,state,shadow,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "shadow"; + } + program { name: "shadow-off"; + signal: "e,state,shadow,off"; + source: "e"; + action: STATE_SET "hidden" 0.0; + target: "shadow"; + } + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "interval" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: LINEAR 0.2; + after: "show3"; + } + program { name: "show3"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: LINEAR 0.1; + after: "show4"; + } + program { name: "show4"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "interval" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: LINEAR 0.1; + after: "hide3"; + } + program { name: "hide3"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: LINEAR 0.2; + after: "hide4"; + } + program { name: "hide4"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "interval" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: LINEAR 0.1; + after: "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: LINEAR 0.2; + after: "raise_above_hide4"; + } + program { name: "raise_above_hide4"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + } + program { name: "switcher_on"; + signal: "e,state,switcher,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "switcher_on2"; + } + program { name: "switcher_on2"; + action: STATE_SET "switcher" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "switcher_on3"; + } + program { name: "switcher_on3"; + action: STATE_SET "switcher2" 0.0; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: LINEAR 0.3; + after: "switcher_on4"; + } + program { name: "switcher_on4"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "switcher_on5"; + } + program { name: "switcher_on5"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "switcher_on_top"; + signal: "e,state,switcher_top,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "switcher_on_top2"; + after: "switcher_on_top2_2"; + } + program { name: "switcher_on_top2"; + action: STATE_SET "switcher" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + transition: LINEAR 0.3; + after: "switcher_on_top3"; + } + program { name: "switcher_on_top2_2"; + action: STATE_SET "switcher2" 0.0; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + transition: ACCELERATE 0.3; + } + program { name: "switcher_on_top3"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "switcher_on_top4"; + } + program { name: "switcher_on_top4"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action: STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.2; + target: "shower"; + after: "raise_above3_3"; + } + program { name: "raise_above3_3"; + action: STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.16; + target: "shower"; + after: "raise_above3_4"; + } + program { name: "raise_above3_4"; + action: STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.2; + target: "shower"; + after: "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show4"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide2_noeffect"; + } + program { name: "hide2_noeffect"; + action: STATE_SET "hide" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide3"; + } + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show_background2"; + } + program { name: "show_background2"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.3; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show_background3"; + } + program { name: "show_background3"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.1; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show_background4"; + } + program { name: "show_background4"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show_background5"; + } + program { name: "show_background5"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide_background2"; + } + program { name: "hide_background2"; + action: STATE_SET "background" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide_background3"; + } + program { name: "hide_background3"; + action: STATE_SET "foreground" 0.0; + transition: LINEAR 0.3; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide_background4"; + } + program { name: "hide_background4"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide2_custom0"; + } + program { name: "hide2_custom0"; + action: STATE_SET "hide" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide3"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide2_custom1"; + } + program { name: "hide2_custom1"; + action: STATE_SET "hide" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "hide3"; + } + program { name: "fake_show_background1"; + signal: "e,state,fake,background,visible,on"; + source: "e"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "fake_show_background2"; + } + program { name: "fake_show_background2"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.44; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "fake_show_background3"; + } + program { name: "fake_show_background3"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "fake_show_background4"; + } + program { name: "fake_show_background4"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + program { name: "fake_hide_background1"; + signal: "e,state,fake,background,visible,off"; + source: "e"; + action: STATE_SET "foreground" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "fake_hide_background2"; + } + program { name: "fake_hide_background2"; + action: STATE_SET "background" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "fake_hide_background3"; + } + program { name: "fake_hide_background3"; + action: STATE_SET "foreground" 0.0; + transition: LINEAR 0.44; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + target: "e.swallow.bgcontent"; + after: "fake_hide_background4"; + } + program { name: "fake_hide_background4"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + /*------------------------------------------------------------*/ + /* window roation Program */ + /*------------------------------------------------------------*/ + #include "../common/comp-prog-rotation-on-effect-for-win.edc" + /*------------------------------------------------------------*/ + program { name: "prog-window-rotation-default--270"; + signal: "e,state,window,rotation,-270"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + } + program { name: "prog-window-rotation-default--180"; + signal: "e,state,window,rotation,-180"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + } + program { name: "prog-window-rotation-default--90"; + signal: "e,state,window,rotation,-90"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + } + program { name: "prog-window-rotation-default-0"; + signal: "e,state,window,rotation,0"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + } + program { name: "prog-window-rotation-default-90"; + signal: "e,state,window,rotation,90"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + } + program { name: "prog-window-rotation-default-180"; + signal: "e,state,window,rotation,180"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + } + program { name: "prog-window-rotation-default-270"; + signal: "e,state,window,rotation,270"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + } + } +} /* end of group "shadow_twist" */ diff --git a/data/group/task_switcher.edc b/data/group/task_switcher.edc new file mode 100644 index 0000000..9fac0fd --- /dev/null +++ b/data/group/task_switcher.edc @@ -0,0 +1,349 @@ +/*-----------------------------------------------------*/ +/* group "taskmgr" */ +/*-----------------------------------------------------*/ +group { name: "taskmgr"; + images { + image: "comp-sh1.png" COMP; + image: "bt_glow.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: -1.0 -1.0; + offset: -9999 -9999; + } + rel2 { + relative: 2.0 2.0; + offset: 9999 9999; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 180 180 180 255; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.0 1.0; + } + rel2 { + relative: 1.0 2.0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + description { state: "background" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.1 0.1; + rel2.relative: 0.9 0.9; + } + description { state: "indicator_raise_above" 0.0; + inherit : "default" 0.0; + rel1 { + relative : 0.0 0.0; + offset: 0 0; + } + rel2 { + relative : 1.0 1.0; + } + } + description { state: "indicator_raise_above" 0.1; + inherit : "default" 0.0; + rel1 { + relative : 0.0 -1.0; + offset: 0 0; + } + rel2 { + relative : 1.0 0.0; + } + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + + description { state: "default" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + description { state: "visible" 0.0; + rel1 { + to: "shower"; + } + rel2 { + to: "shower"; + } + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + transition: LINEAR 0.3; + target : "clipper"; + target : "shower"; + target: "e.swallow.content"; + after : "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.66; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide3"; + } + program { name: "hide3"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "raise_above_hide1"; + signal: "e,state,raise_above,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "raise_above_hide2"; + } + program { name: "raise_above_hide2"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.66; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "raise_above_hide3"; + } + program { name: "raise_above_hide3"; + action: SIGNAL_EMIT "e,action,raise_above_hide,done" "e"; + } + program { name: "raise_above_hide_post_work"; + signal: "e,state,raise_above_post,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + } + program { name: "raise_above3"; + signal: "e,state,raise_above3,on"; + source: "e"; + action: STATE_SET "indicator_raise_above" 0.0; + target: "shower"; + after: "raise_above3_2"; + } + program { name: "raise_above3_2"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: SINUSOIDAL 0.3; + target: "shower"; + after : "raise_above3_3"; + } + program { name: "raise_above3_3"; + action : STATE_SET "indicator_raise_above" 0.1; + transition: LINEAR 0.25; + target: "shower"; + after : "raise_above3_4"; + } + program { name: "raise_above3_4"; + action : STATE_SET "indicator_raise_above" 0.0; + transition: SINUSOIDAL 0.3; + target: "shower"; + after : "raise_above3_done"; + } + program { name: "raise_above3_done"; + action: SIGNAL_EMIT "e,action,raise_above3,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target : "clipper"; + target : "shower"; + target: "e.swallow.content"; + after : "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide2_noeffect"; + } + program { name: "hide2_noeffect"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide3"; + } + /*------------------------------------------------------------------- + * 0.3 0.1 + *------------------------------------------------------------------- + * visible --> background --> background --> visible + *------------------------------------------------------------------- + * clipper + * shower + *------------------------------------------------------------------- + */ + program { name: "show_background1"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show_background2"; + } + program { name: "show_background2"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.3; + target: "clipper"; + target: "shower"; + after: "show_background3"; + } + program { name: "show_background3"; + action: STATE_SET "background" 0.0; + transition: LINEAR 0.1; + target: "clipper"; + target: "shower"; + after: "show_background4"; + } + program { name: "show_background4"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + after: "show_background5"; + } + program { name: "show_background5"; + action: SIGNAL_EMIT "e,action,background,show,done" "e"; + } + //---------------------------------------------------------------------------- + program { name: "hide_background1"; + signal: "e,state,background,visible,off"; + source: "e"; + after: "hide_background2"; + } + program { name: "hide_background2"; + action: SIGNAL_EMIT "e,action,background,hide,done" "e"; + } + program { name: "show1_custom0"; + signal: "e,state,visible,on,custom0"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom0"; + } + program { name: "show2_custom0"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "hide1_custom0"; + signal: "e,state,visible,off,custom0"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide2_custom0"; + } + program { name: "hide2_custom0"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide3"; + } + program { name: "show1_custom1"; + signal: "e,state,visible,on,custom1"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_custom1"; + } + program { name: "show2_custom1"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "hide1_custom1"; + signal: "e,state,visible,off,custom1"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide2_custom1"; + } + program { name: "hide2_custom1"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "hide3"; + } + } +} /* end of group "taskmgr" */ diff --git a/data/group/vi_fade.edc b/data/group/vi_fade.edc new file mode 100644 index 0000000..78895cd --- /dev/null +++ b/data/group/vi_fade.edc @@ -0,0 +1,421 @@ +/*-----------------------------------------------------*/ +/* group "vi_fade" */ +/*-----------------------------------------------------*/ +group { name: "vi_fade"; + #include "../common/comp-config.edc" + images { + image: "comp-sh1.png" COMP; + } + parts { + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + color: 255 255 255 1; + rel1.relative: -1.0 -1.0; + rel1.offset: -9999 -9999; + rel2.relative: 2.0 2.0; + rel2.offset: 9999 9999; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 50; + visible: 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 100; + } + description { state: "center" 0.0; + inherit: "default" 0.0; + color: 255 255 255 50; + visible: 1; + } + description { state: "foreground_2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 50; + } + description { state: "background_2" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + } + } + part { name: "shadow"; + mouse_events: 0; + clip_to: "clipper"; + description { state: "default" 0.0; + visible: 0; + image { + normal: "comp-sh1.png"; + border: 12 12 12 12; + middle: 0; + } + fill.smooth: 0; + rel1 { + to: "e.swallow.content"; + relative: 0.0 0.0; + offset: -12 -12; + } + rel2 { + to: "e.swallow.content"; + relative: 1.0 1.0; + offset: 11 11; + } + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + } + } + part { name: "shower"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "foreground" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + rel1.offset: 0 0; + rel2.relative: 1 1; + } + description { state: "background" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.05 0.05; + rel1.offset: 0 0; + rel2.relative: 0.95 0.95; + } + description { state: "center" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.30 0.30; + rel1.offset: 0 0; + rel2.relative: 0.70 0.70; + } + description { state: "foreground_2" 0.0; + inherit: "default" 0.0; + rel1.relative: -0.25 -0.25; + rel1.offset: 0 0; + rel2.relative: 1.25 1.25; + } + description { state: "background_2" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.05 0.05; + rel1.offset: 0 0; + rel2.relative: 0.95 0.95; + } + } + part { name: "e.swallow.transp.offset"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 0.0 0.0; + to: "shower"; + } + rel2 { + relative: 0.0 0.0; + to: "shower"; + } + } + } + part { name: "e.swallow.transp.rect"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + align: 0 0; + rel1 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + rel2 { + relative: 1.0 1.0; + to: "e.swallow.transp.offset"; + } + } + } + part { name: "persp"; + type: RECT; + description { state: "default" 0.0; + min: 10 10; + max: 10 10; + visible: 0; + perspective.zplane: 0.0; + perspective.focal: 1000; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + perspective.zplane: -700.0; + perspective.focal: 1000; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + perspective.zplane: -2000.0; + perspective.focal: 1000; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + perspective.zplane: 0.0; + perspective.focal: 1000; + } + } + part { name: "e.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "invisible" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "visible" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "hide" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + map { + on: 1; + smooth: 1; + backface_cull: 0; + perspective_on: 1; + alpha: 1; + perspective: "persp"; + rotation { + x: 0; + y: 0; + z: 0; + } + } + } + description { state: "foreground" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "background" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "center" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "foreground_2" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + description { state: "background_2" 0.0; + rel1.to: "shower"; + rel2.to: "shower"; + } + } + } + programs { + program { name: "show1"; + signal: "e,state,visible,on"; + source: "e"; + action: STATE_SET "center" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.2; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "background_show"; + signal: "e,state,background,visible,on"; + source: "e"; + action: STATE_SET "background_2" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_show2"; + } + program { name: "background_show2"; + action: STATE_SET "foreground_2" 0.0; + transition: DECELERATE 0.25; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_show3"; + } + program { name: "background_show3"; + action: SIGNAL_EMIT "e,action,show,done" "e"; + } + program { name: "hide1"; + signal: "e,state,visible,off"; + source: "e"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + target: "e.swallow.content"; + after: "hide2"; + } + program { name: "hide1-1"; + action: STATE_SET "visible" 0.0; + transition: LINEAR 0.05; + target: "clipper"; + target: "shower"; + target: "persp"; + after: "hide2"; + } + program { name: "hide2"; + action: STATE_SET "hide" 0.0; + transition: ACCEL_FAC 0.25 1.5; + target: "clipper"; + target: "shower"; + target: "persp"; + after: "hide4"; + } + program { name: "hide3"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "persp"; + after: "hide4"; + } + program { name: "hide4"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "background_hide1"; + signal: "e,state,background,visible,off"; + source: "e"; + action: STATE_SET "foreground_2" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "background_hide2"; + } + program { name: "background_hide2"; + action: STATE_SET "foreground" 0.0; + transition: DECELERATE 0.25; + target: "clipper"; + target: "shower"; + after: "background_hide3"; + } + program { name: "background_hide3"; + action: SIGNAL_EMIT "e,action,hide,done" "e"; + } + program { name: "show1_noeffect"; + signal: "e,state,visible,on,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show2_noeffect"; + } + program { name: "show2_noeffect"; + action: STATE_SET "visible" 0.0; + target: "clipper"; + target: "shower"; + target: "e.swallow.content"; + after: "show3"; + } + program { name: "hide1_noeffect"; + signal: "e,state,visible,off,noeffect"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "clipper"; + target: "shower"; + after: "hide3"; + } + program { name: "shadow-on"; + signal: "e,state,shadow,on"; + source: "e"; + action: STATE_SET "show" 0.0; + target: "shadow"; + } + program { name: "shadow-off"; + signal: "e,state,shadow,off"; + source: "e"; + action: STATE_SET "hidden" 0.0; + target: "shadow"; + } + } +} /* end of group "shadow_fade" */ diff --git a/data/images/bt_glow.png b/data/images/bt_glow.png new file mode 100644 index 0000000000000000000000000000000000000000..25891a158e10337e699d42d20ffc2e188faa1596 GIT binary patch literal 629 zcmV-*0*d{KP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igP- z1_T=_qx{PN00H$$L_t(o!|j;CY7{{bhQGhNw==u5Nx(xONIWdE@u=WIJo)GzMSK9W zNDdJ%dk~U1aqXF%@?b?{$OANC3+i59|5Z)>B|OYbzyz3kWhi5OzxGmPq z0^hM!7Qkz-!wJr&1SP&uh(Z?*WH*|RX~!|w(acr_&CHEPb5u&Ea?!)$y+Sy-_Q)Dl&+Mr>HGde zjr~?id0R^9+O{3MYylBaczE7ytWBBw1)ACDzukWkcx15y+5zo=c0fCz9Z+pRk`z?2 zf6$)@5Bas^>%;cWs*`fgZO*yr`~FRh%W2NJ$vL+`^72g57O>>r{8CZ@rXhq`(=^MY zqoc8A`_MGaGK4VmMk?-JO9DE#u`kVRUs98EUd9-o)^6~C#>_@ZSI*Gg0zs8Sa&3R6o?NMQuI#tDt}g##eez`zVd3`{&A#9;tJ5Q&j22MHAH;W99C2j<2J8yIiioy}^o_!L(K zIO;}n3@IE?1LiF@5Mq%4A%O%Ca%f-#BB;bjmV*Qe_HY>)a*zapo+coEA1QLexQq9J zDaHmQL70(Y)*J~224+@I7srr_TW@b(EShZ~;Fica<$L`DsTZ!k zyYG2eyq%h{&v>)4aF6li{~4;QA5`U#zYp!5%QOU8usbWsCY{_DcEZ+qcuHBQ4 z=J>s86<+aS@02aixdnZ!emE&%QHdm7g0odObIN#`S;w=B)TF%gtYxHvCkvxc8*;3yTGt@xL{;J?YmwPBT7x z#Z-ObO)k*)-$d$og+hdU_OcxL^KJFh1-xlBYjj!mEmLJE_S(?;=FyIRD+jRz?}yh5 z_6sFcF+O^7R%lPoo9Ogs^Z9Krwd + + + + + + + + + diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 new file mode 100644 index 0000000..23479a9 --- /dev/null +++ b/m4/ac_attribute.m4 @@ -0,0 +1,47 @@ +dnl Copyright (C) 2004-2008 Kim Woelders +dnl Copyright (C) 2008 Vincent Torri +dnl That code is public domain and can be freely used or copied. +dnl Originally snatched from somewhere... + +dnl Macro for checking if the compiler supports __attribute__ + +dnl Usage: AC_C___ATTRIBUTE__ +dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__ +dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is +dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused)) +dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is +dnl defined to nothing. + +AC_DEFUN([AC_C___ATTRIBUTE__], +[ + +AC_MSG_CHECKING([for __attribute__]) + +AC_CACHE_VAL([ac_cv___attribute__], + [AC_TRY_COMPILE( + [ +#include + +int func(int x); +int foo(int x __attribute__ ((unused))) +{ + exit(1); +} + ], + [], + [ac_cv___attribute__="yes"], + [ac_cv___attribute__="no"] + )]) + +AC_MSG_RESULT($ac_cv___attribute__) + +if test "x${ac_cv___attribute__}" = "xyes" ; then + AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__]) + AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused]) + else + AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused]) +fi + +]) + +dnl End of ac_attribute.m4 diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 0000000..4ceb7f1 --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,7309 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_quote(m4_if([$2], [], + m4_quote(lt_decl_tag_varnames), + m4_quote(m4_shift($@)))), + m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) +m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc* ) + # Intel C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 new file mode 100644 index 0000000..e970119 --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1,368 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 new file mode 100644 index 0000000..9000a05 --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 new file mode 100644 index 0000000..f3c5309 --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3017 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6b' +macro_revision='1.3017' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 new file mode 100644 index 0000000..637bb20 --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -0,0 +1,92 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) diff --git a/module.desktop.in b/module.desktop.in new file mode 100644 index 0000000..e44b5f6 --- /dev/null +++ b/module.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Link +Name=e17-mod-tizen-comp +Icon= +X-Enlightenment-ModuleType=system +Comment= +Comment[fr]= +Comment[it]= diff --git a/packaging/e17-mod-tizen-comp.spec b/packaging/e17-mod-tizen-comp.spec new file mode 100755 index 0000000..b9948b8 --- /dev/null +++ b/packaging/e17-mod-tizen-comp.spec @@ -0,0 +1,81 @@ +Name: e17-mod-tizen-comp +Summary: The E17 Extra Compositor Module made by Tizen +Version: 0.1.12 +Release: 1 +Group: System/GUI/Other +License: BSD 2-clause +Source0: %{name}-%{version}.tar.gz +BuildRequires: pkgconfig(enlightenment) +BuildRequires: pkgconfig(utilX) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xrandr) +BuildRequires: pkgconfig(pixman-1) +BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(ttrace) +BuildRequires: pkgconfig(libhwc) +Requires: libX11 +Requires: vconf + +%description +The E17 Compositor Module made by Tizen + +%prep +%setup -q + + +%build +export GC_SECTIONS_FLAGS="-fdata-sections -ffunction-sections -Wl,--gc-sections" +export CFLAGS+=" -Wall -g -fPIC -rdynamic -Werror-implicit-function-declaration ${GC_SECTIONS_FLAGS} " +export LDFLAGS+=" -Wl,--hash-style=both -Wl,--as-needed -Wl,--rpath=/usr/lib" + +export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" + +%if "%{?tizen_profile_name}" == "mobile" +export CFLAGS+=" -D_ENV_MOBILE_" +%else +%if "%{?tizen_profile_name}" == "wearable" +export CFLAGS+=" -D_ENV_WEARABLE_" +%endif +%endif + +%ifarch %{arm} +export CFLAGS+=" -D_ENV_ARM" +%endif + +export CFLAGS+=" -D_F_USE_GRAB_KEY_SET_" +%autogen +%configure --enable-hwc \ + --prefix=/usr +make %{?jobs:-j%jobs} + + +%install +rm -rf %{buildroot} + +# for license notification +mkdir -p %{buildroot}/usr/share/license +cp -a %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/usr/share/license/%{name} + +make install DESTDIR=%{buildroot} + +find %{buildroot}/usr/lib/enlightenment/modules/ -name *.la | xargs rm +find %{buildroot}/usr/lib/enlightenment/modules/ -name *.a | xargs rm + +%files +%manifest e17-mod-tizen-comp.manifest +%defattr(-,root,root,-) + +%{_libdir}/enlightenment/modules/e17-mod-tizen-comp +%{_datadir}/enlightenment/data/* +/usr/share/license/%{name} + +%if "%{?tizen_profile_name}" == "mobile" +%exclude %{_libdir}/enlightenment/modules/e17-mod-tizen-comp/effect/micro.so +%else +%if "%{?tizen_profile_name}" == "wearable" +%exclude %{_libdir}/enlightenment/modules/e17-mod-tizen-comp/effect/common.so +%endif +%endif +%exclude %{_libdir}/enlightenment/modules/e17-mod-tizen-comp/effect/mobile.so diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100755 index 0000000..ec11cf2 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,70 @@ +MAINTAINERCLEANFILES = Makefile.in +MODULE = e17-mod-tizen-comp +SUBDIRS = effect \ + hwcomp + +#EDJE_CC = @edje_cc@ +#EDJE_FLAGS = -v \ +# @EDJE_DEF@ + +# data files for the module +filesdir = $(libdir)/enlightenment/modules/$(MODULE) + +EXTRA_DIST = $(files_DATA) + +# the module .so file +INCLUDES = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + @HWC_CFLAGS@ \ + @ENLIGHTENMENT_CFLAGS@ \ + @TTRACE_CFLAGS@ + +pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH) +pkg_LTLIBRARIES = module.la +module_la_SOURCES = e_mod_comp_atoms.c \ + e_mod_comp_atoms.h \ + e_mod_comp_aux_hint.c \ + e_mod_comp_aux_hint.h \ + e_mod_comp_bg_win.c \ + e_mod_comp_bg_win.h \ + e_mod_comp_cfdata.c \ + e_mod_comp_cfdata.h \ + e_mod_comp.c \ + e_mod_comp.h \ + e_mod_comp_canvas.c \ + e_mod_comp_canvas.h \ + e_mod_comp_debug.c \ + e_mod_comp_debug.h \ + e_mod_comp_effect.h \ + e_mod_comp_effect_image_launch.h \ + e_mod_comp_effect_win_rotation.h \ + e_mod_comp_hw_ov_win.c \ + e_mod_comp_hw_ov_win.h \ + e_mod_comp_object.c \ + e_mod_comp_object.h \ + e_mod_comp_policy.c \ + e_mod_comp_policy.h \ + e_mod_comp_screen.c \ + e_mod_comp_screen.h \ + e_mod_comp_shared_types.h \ + e_mod_comp_update.c \ + e_mod_comp_update.h \ + e_mod_comp_util.c \ + e_mod_comp_util.h \ + e_mod_comp_win_type.c \ + e_mod_comp_win_type.h \ + e_mod_comp_win_shape_input.c \ + e_mod_comp_win_shape_input.h \ + e_mod_comp_hwcomp.h \ + e_mod_config.c \ + e_mod_config.h \ + e_mod_main.c \ + e_mod_main.h + +module_la_LIBADD = @ENLIGHTENMENT_LIBS@ @HWC_LIBS@ @dlopen_libs@ @TTRACE_LIBS@ +module_la_LDFLAGS = -module -avoid-version +module_la_DEPENDENCIES = $(top_builddir)/config.h + +uninstall: + rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE) diff --git a/src/e17-mod-tizen-comp.edj b/src/e17-mod-tizen-comp.edj new file mode 100644 index 0000000000000000000000000000000000000000..2c1f4d26ef39661e481afc89202019f6d41e07cc GIT binary patch literal 13048 zcmeI2c|6tI*T=t_lm<;QW^TSnN`p#Lsjdd)rczD^hj2J@$dJ$^&D`oXiZsuIOchC` zQK{SpDP4(Bp+x5Av%cqhbhy9gc|HF=uh(;4cUfz{ziY3(_u6ak@Aux{PqSEYGQ%*P z8AeW#Vf1ZacaezFPv{X0*Fdn|`qW0^14Q zNkUj=1-1{2`kHWlbzsNPrZrCEm_68KwA;({#eDl=Y(^b&oby`&hV{`pn4ugS0EYQ6 zN)T6$RfBy&oANb?W7v;=HE3hq%tnsogCU2^0BX|@_7jFt)`8Z71ab^=4)-v}p`Kj!gi=-ZNAS5gZ!=#zULN<#8+k%$XRq=?5EgR(6Ay=h{>&*neejXv)sndda_rPdB4sm_M!9JkfS;kKTtgKC6$_v)lvbGbje*3Vvrl0A8J%(D94U+4D(PK!7-{Cs?7?panQ24LLO8m5rZt}`l9|+ zrg7{MH0^yDm^H_|I6rf+d0_I8vm6@@MzulAmt)vRm1V@JO+VN-!CawbbDsf*{I_EM zVCc`*ftc%S2}X6$lMN<`X9adZ%AjdIYrtsFsfN~beWSoqI2OyX_F#9x6lCJzE>U?( z3_|sA0ip-?2D&F?FV}Yv7}bI7T>b&82V?Ib&aaYTRB3N%F18$V0#im?c3j*|syb2z zjd?I=s}6&v{fKd#VaedXn=v;P%Eali?uv5gSO+VP*z^*{c z_C-yp-fF|J->T2r^rc+Al``mw5WK@wKS>!kMh@6_Fxhnoz-WBh^Ek+HNGijqQQqmi zUF7H1R&neiSQasv zF>p_+7lP3`PD6|#qrq_JOKKe20D|+U-T+Pa5XNKIxSe4%sODwwD@`yJFxk5aO%2^P z>n76`TrtT*I27w;Sxonu(5-)e2TXmnrfV4b%9I(!@Sw=AZ=)>H;NYk zEqx!M_UKO341?|j35QS|e=xG8XH^Wl1dPs>w66zjb1=HwrSA&52e2N^uWI%R8 zXfCKXmYsl(fMEWbbhgNEG~^N_73?|3UO?MG_Jb8bD?xBZnJW;?TeAk5tt;qFkiiV2 zMeCQ|L&yn(v9vUxsV~K+x8V<$OAAtj#0m4$VM>A55*&& ztB@gJtBG-Yei*hc*q_i8kNRO<^xoH^vq0<}?O4H42obQuUb^&8r--8U?ZQ}?V&qCXv~`&!gKdLWg3y@%Ku&m{E`$O$m2XJX{@4WbQp5}MXWKHnk8pKc1r$fpW|{ON+TeaYts1o_jY zy`jG3Qw>4>bSXCFk9=w%$e&(2Xv!7&{Nz|?j*(9-WH8+PAYRb`?w88d4BM0OoM`sjy(mTyD_{epDjr{3Rts@@!$aRE`{OM(L ze(;f_{2+gN|3D*uTx7RGaSlME*DnalU_E{2wyM0uVk}$o&u!8Nz6D4 zT=;%MUq&~9A;SPp2Qn^h0Rm@3 ze@-uFJl(v|qQ9{D0c7Lvas(B4qZ_LN5zd$mCicea4dKo3Ig^jj5)%t^K>_#(gvN&W z!}oPtDc}XPX$MN$A{Q62z*qW|YjMxqoTVHV%SN<`C)4Jh%f=gFC>w8tp)?+A1xj`l zkZ~0GI179Xg;K*uYWPYGN2%c@;^9!VcuIDah@se1B=TL3Y{K>yiFsH!X5Z4}JBp=E znI|$-+J`oV3qeo0CiUS=8Orx^#STk`N7DJu5}U10oLG^Mp$`=_v@53_In9@7k3J>SF>QUqOJcq1Y`5$AT;uH`>e=Gf-lpPNbAfDdh*WP?#K* z)+rl9(%_z8|0K7FBq*BX(~1djg2ZlO#?^=K?1nQ*+uLH(nL;9e0W?}wXp3j-2Z3#R zwA5H@|CVBt#WEEd&?=0~gVym|s(N-`UyC%M}M!wk3Hc zIorg^TFLnGaX}a^7kP?Y1zrMNWE_#kmOO9S0@nLie92R3I}o>pH=QtVyb8Rf4O}_P zaYy2bkBIhy=Y&1M)gUDSEtaG|c?GcyFB5X&P8FGaq4#n=3)vxfoQEUd$-~JHN0Oz6 zLEb{X7w%S?g`tZGx30`t7zySkgC2t5~fd#cBm4ce%`Hk{ewH zh$Z*B3}J8gU;8Fg(~?gp2CpF;G0ESSVx@|d7GSFn6Yi7bSB3HBN-2mBp-va z-+S!vQv=w~6XCBwsEDI|so^NMiZ9T_M#%Z$k9LwLiw$;2jf6V3V$#WJ;y(}iTghkY; z^JZIEbC2kt!EBieJJ)G+Dq23NB!%7b3jLoew{@wu6v@Bp>tEo1S8)HTEv|B8tKomO zZ8A%iq+d42ZIdFY%l~{-|9`=TZs> z7O^&V@aBlF+aIPUUmTLGb8qnF)5#w?ZB`gskfu}cp|;<%r1HF~Jti{*bw{tBPCNbe z@htuMCD#XJHjK*D|MOH@iiT52cv;oirOlmRrmWnu$lbuaaAEqIeUakJUqaU;EbQwmC*d1qVTo<(-KKkT30$jmK`{2+HBKGC%B ztoHpNk3~`9BMIFv2kvyWyJVZ-xxiD9HsG#(x_#=(yC2^xe9kX=J>=Bo1w*dCjrVY} zDpENZpIh@O;Dqa*VCBt!hxuFPX+AOJ8QlK-<8$>(oe-^L&FfmhOi+)tifh!Z?4kg z=`YS}MiDyqJRx%vCUO8nyRYQEh3f)lSw?70Yv^1cdY_PYdsK4A)Faue)EnPf-0-());u1{`)5strK(NAB{}PU)&tF;pJ7&nH^_aR;YV4J2nMo zo%}w*^htq1$lPKpVN-{utv10oH-0|j-gLZT>GOukxnnCt7325Dd^K0-D)(DETdj6} zUz+-#orM3;K*IiK7iigEfZUh;iz1Xtl)HuRQfch^b9+Kr_Tbq07O$!(j`Fz66$xoW| z3rs52pV~yWPwaOyC~}mU!nkwyx780%s{78H{AJsym!%<>BKyZ|G2fKGY4+N2VH%Md z5#v?N*RSa$pAz>_`Kg`IBi7tv+n(nM+ZQ*U-&tLmTmQ*_qQZ!(t`lQ*+-^t>o*6=W2}1HW$7cexZZU)lQ|F6M~%id1R0blSFLtP3wGmAui3cv z>dhaD0fY7$1t@1E9<6)Y!>{0syrSkp6*K>@R|Z#=JilADec{BIq%M61zS^p4BCP)W z+Enyz`~maOG=qf~(~IwHQSKMs;j&k9liZ4ITbhxMWq5$`{gUA3*B;G38tZEex*Zbq zz3N}?g`uxFqy{a@Pg^~!X5>ewL=IbJr(wc>RhYlTjcGdyY1&bEB{qe^i3zjbZGJpPjCyPT9R=Mz}FY>QE6&srE zkZnGAfw^h6c|gT7qk&_idBZZdh~75j1YAgY8kZe6wd=aS4D9Q!xc~hiBcQJ8)CQe% zp}o$BR;&q$H%%VPoZFUkrK)&KiRkl=$)QgUj(xu1>_WbMl2-x>H234fJ&l1eV}DeB zxLaL#e`nnEy!`+ed4Pq zJ*&^pj{V-$xOe^{yGje=qm^252QXQi$YBk0N_c6(DW31HzwV(mQK)R>Q1vpT$ktK& zx1`RRJ6|ko)=q3%(_TIZ*=$%GrTk;GSKdW^>zIjeu?&|3rkr>bc)w>D3%lue?uX=Alj3LvNrE>dM>~ zdi5H=z^n1)`K9st6%El%>*N)4Q^duH#%qa&{i|t-=8)<>qw~b(_VPVmy^eQnthX`i zDH*k0pr;t4aAeIe4twGyN?Oushp=LQ8W_ zg+z~beXJ4s)jr;3+m~0DZaoPNXx=pFMc?2_8htHIcU^8e67x)6J!5M zS1jCB_($-8&foSm9p@F--~aoBO-)y2!z)v_^n3m1fZv55AM8#H`r&R~bL6pkNJFxD z^O2ZQcWPr7hUl0Tl)fAg;$R)}$ZS&T^m0b4r+ki0@D}};fhP*DS@(3G6|}pm>}tj5 zf{QD^EJjI1=a>HzouBA=AU|KbW`bYou9)VIKSuAizZX95$2ApgyG;4pazDhY))<`} zkfD9|v;M^1TIIP34`;4<_c(2JeZ$!DSC^bZE<_~6H0-H~88vFAgO2*lrxzYJsCZ9Y zW>B~^T`}iLRlie5GScVV?z%d6_A3X4+v5(7S&>m*dpJ68k863A)%{`4mZ$3cN<6eG z42NqCAM|bZd&L6XZb8qgiYv3~AH6)5K7OOix22QJ$|9ccP>j=7|MSz!k7!aJS zZbyXNyKSW-uMA4rC>(sI>FA}Hsyd%C*B-+LeSGm`yu<7V=WgsuFv{{cYVOrMe~*6d z+V4F3G`qk04B7OidA7cTvRPwD^ZJ9S2k#w9&NqLSJtt&+(}ThJ0rBIlOm8;9#^$uQ&N{%XJ&R19^O9H%+w`eg=m?k^Y~!R7v`~c zksWj19cyYHv~>T2qTsL#n?^UJAB->xbB!9{rIG0@RQ~?hu>XT#vC}{8J6CtVIOzAa zPAQeq6ZUl#jSN#y%B!E|GRmV`OT)f+jpg*;o$XHReAq_*?tW`{&+xwmvtsRf zP7L!-e0)4d-Li9uZoT%=O~#)#=)3j_-aGQk1hYQ{YU8wvKD;znJXKcnt$Ol3MV+H% zHS4A}IV@Btyqj@g^dtZAxesQ@wI6c1Vf$Z3yR5S0J6A2RnQ4-AMRUWbNBa&Re_L6R za;9kJ!ef(eKi%)x|9W)ZT9xp!g!Au|vQ}vAtQ|E!e30w@^)Jr4nROgF- zI-Sk0juabYc8dmZvuiWb)3rO_eysT} zPh-;lD7kiF!7e>xx@_hLyPQ2Xok$E@^buAV=0z@Mk=jB9y2y@QK04jqeb()nV4 zBYJoBw*1G_SN-jwTvF$`ssED;3FcuRbe>%OdictP*z=2ZzmAPts#p0cUT^-%#i{3G z<7XF))_-Yl<@fD;yOBS={fhd0Y;0E^r9R->x2_Gl@}|^gy>Jh*O4%k=%97F<1-6)@q-UI&kz%?C?)k@fc)Ule6EJ?#-WwVSSkZd1XF zZaU$;^g_1ntLc93gF$Wo2{o&NE;tpg@GyDZ;qmwqt&!`7+#Y#6>;1Gx&oUp)$h-EU zePVuJt!3YIl(eG07dol^mVCa`AcY=phP+d~J7oM4S6?5kF&j4C@>8g{v~Av5ddoI+ z_QN!7tIt1OF6~iBQ?n^7FQEO(lM8DbmU-ssNQ~&?~ literal 0 HcmV?d00001 diff --git a/src/e_mod_comp.c b/src/e_mod_comp.c new file mode 100644 index 0000000..6876068 --- /dev/null +++ b/src/e_mod_comp.c @@ -0,0 +1,5479 @@ +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" +#include +#include +#include + +#define LOG_TAG "E17_EXTRA_MODULES" + +#define OVER_FLOW 2 + +////////////////////////////////////////////////////////////////////////// +// +// TODO (no specific order): +// 1. abstract evas object and compwin so we can duplicate the object N times +// in N canvases - for winlist, everything, pager etc. too +// 2. implement "unmapped composite cache" -> N pixels worth of unmapped +// windows to be fully composited. only the most active/recent. +// 3. for unmapped windows - when window goes out of unmapped comp cache +// make a miniature copy (1/4 width+height?) and set property on window +// with pixmap id +// 8. obey transparent property +// 9. shortcut lots of stuff to draw inside the compositor - shelf, +// wallpaper, efm - hell even menus and anything else in e (this is what +// e18 was mostly about) +// 10. fullscreen windows need to be able to bypass compositing *seems buggy* +// +////////////////////////////////////////////////////////////////////////// + +/* static global variables */ +static Eina_List *handlers = NULL; +static Eina_List *handlers_hook = NULL; +static Eina_List *compositors = NULL; +static Eina_Hash *windows = NULL; +static Eina_Hash *borders = NULL; +static Eina_Hash *damages = NULL; + +/* static functions */ +static void _e_mod_comp_render_queue(E_Comp *c); +static Eina_Bool _e_mod_comp_effect_init(E_Comp *c); +static Eina_Bool _e_mod_comp_hwcomp_init(E_Comp *c); +static void _e_mod_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg); +static void _e_mod_comp_win_del(E_Comp_Win *cw); +static void _e_mod_comp_win_real_hide(E_Comp_Win *cw); +static void _e_mod_comp_win_hide(E_Comp_Win *cw); +static void _e_mod_comp_win_configure(E_Comp_Win *cw, int x, int y, int w, int h, int border); +static Eina_Bool _e_mod_comp_win_damage_timeout(void *data); +static void _e_mod_comp_win_raise(E_Comp_Win *cw); +static void _e_mod_comp_win_lower(E_Comp_Win *cw); +static E_Comp_Win *_e_mod_comp_win_find(Ecore_X_Window win); +static E_Comp_Win *_e_mod_comp_border_client_find(Ecore_X_Window win); +static Eina_Bool _e_mod_comp_cb_update(E_Comp *c); +static Eina_Bool _e_mod_comp_win_is_border(E_Comp_Win *cw); +static void _e_mod_comp_cb_pending_after(void *data, E_Manager *man, E_Manager_Comp_Source *src); +static E_Comp *_e_mod_comp_find(Ecore_X_Window root); +static void _e_mod_comp_win_render_queue(E_Comp_Win *cw); +static Evas_Object *_e_mod_comp_win_mirror_add(E_Comp_Win *cw); +static void _e_mod_comp_cb_win_mirror_del(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_mod_comp_src_hidden_set_func(void *data, E_Manager *man, E_Manager_Comp_Source *src, Eina_Bool hidden); +static Eina_Bool _e_mod_comp_prop_window_use_dri2_get(Ecore_X_Window win); +static Eina_Bool _e_mod_comp_prop_use_dri2(Ecore_X_Event_Window_Property *ev); +static void _e_mod_comp_composite_mode_set(void *data, E_Manager *man, E_Zone *zone, Eina_Bool set); +static void _e_comp_event_src_visibility_free(void *data, void *event); +static void _e_mod_comp_win_transparent_rect_update(E_Comp_Win *cw); +static Eina_Bool _e_mod_comp_prop_window_role(Ecore_X_Event_Window_Property *ev); +static void _e_mod_comp_window_role_handle(E_Comp_Win *cw); +static Eina_Bool _e_mod_comp_win_rr_output_prop_set(Ecore_X_Window win, unsigned int_mode); +static Eina_Bool _e_mod_comp_prop_3d_win_mode(Ecore_X_Event_Window_Property *ev); +static Eina_Bool _e_mod_comp_win_stereo_layout_set(Ecore_X_Window win, unsigned int mode); +static void _e_mod_comp_active_request_handle(Ecore_X_Event_Client_Message *ev); +#ifdef _F_IGNORE_DMG_HIDE_ +static void _e_mod_comp_msg_deiconify_approve(Ecore_X_Event_Client_Message *ev); +#endif +/////////////////////////////////////////////////////////////////////////////////// +EAPI void +e_comp_event_src_visibility_send(Ecore_X_Window win, + Eina_Bool visible) +{ + E_Event_Comp_Source_Visibility *ev; + ev = E_NEW(E_Event_Comp_Source_Visibility, 1); + if (ev) + { + ev->win = win; + ev->visible = visible; + ecore_event_add(E_EVENT_COMP_SOURCE_VISIBILITY, ev, (Ecore_End_Cb)_e_comp_event_src_visibility_free, NULL); + } +} + +EAPI Eina_Bool +e_mod_comp_comp_event_src_visibility_send(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + E_CHECK_RETURN(cw->c->man, 0); + + cw->pending_count++; + + e_manager_comp_event_src_visibility_send + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_mod_comp_cb_pending_after, cw->c); + + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_win_is_border(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + if (cw->bd) return EINA_TRUE; + else return EINA_FALSE; +} + +EAPI void +e_mod_comp_fps_toggle(void) +{ + if (_comp_mod) + { + Eina_List *l; + E_Comp *c; + + if (_comp_mod->conf->fps_show) + { + _comp_mod->conf->fps_show = 0; + } + else + { + _comp_mod->conf->fps_show = 1; + } + e_config_save_queue(); + EINA_LIST_FOREACH(compositors, l, c) _e_mod_comp_cb_update(c); + } +} + +EAPI Eina_Bool +e_mod_comp_win_add_damage(E_Comp_Win *cw, + Ecore_X_Damage dmg) +{ + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(dmg, 0); + return eina_hash_add(damages, e_util_winid_str_get(dmg), cw); +} + +EAPI Eina_Bool +e_mod_comp_win_del_damage(E_Comp_Win *cw, + Ecore_X_Damage dmg) +{ + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(dmg, 0); + return eina_hash_del(damages, e_util_winid_str_get(dmg), cw); +} + +EAPI void +e_mod_comp_composite_mode_set(E_Zone *zone, + Eina_Bool set) +{ + _e_mod_comp_composite_mode_set(e_mod_comp_util_get(), + NULL, zone, set); +} + +static void +_e_mod_comp_cb_pending_after(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_Comp *c = (E_Comp *)data; + + cw->pending_count--; + + if (!cw->delete_pending) return; + if (cw->pending_count == 0) + { + E_Comp_Canvas *canvas = NULL; + Eina_List *l = NULL; + if (_comp_mod && _comp_mod->conf->nocomp_fs && c) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (canvas->nocomp.end.cw == cw) + { + if (canvas->nocomp.end.timer) + { + ecore_timer_del(canvas->nocomp.end.timer); + canvas->nocomp.end.timer = NULL; + } + e_mod_comp_canvas_nocomp_dispose(canvas); + break; + } + } + } + free(cw); + } +} + +static Eina_Bool +_e_mod_comp_effect_init(E_Comp *c) +{ + if (!(c->effect_handle = dlopen(_comp_mod->conf->effect_file, (RTLD_NOW | RTLD_GLOBAL)))) + { + /* cannot open the .so file, bail out */ + ELBF(ELBT_COMP, 0, 0, + "Cannot open effect so: %s", ecore_file_file_get(_comp_mod->conf->effect_file)); + return 0; + } + + c->effect_funcs.init = dlsym(c->effect_handle, "e_mod_comp_effect_mod_init"); + c->effect_funcs.shutdown = dlsym(c->effect_handle, "e_mod_comp_effect_mod_shutdown"); + + /* check that policy supports needed functions */ + if ((!c->effect_funcs.init) || (!c->effect_funcs.shutdown)) + { + ELBF(ELBT_COMP, 0, 0, + "Effect does not support needed functions: %s", ecore_file_file_get(_comp_mod->conf->effect_file)); + return 0; + } + + /* try to initialize the effect */ + if (!c->effect_funcs.init(c)) + { + /* init failed, bail out */ + ELBF(ELBT_COMP, 0, 0, + "Effect failed to initialize: %s", ecore_file_file_get(_comp_mod->conf->effect_file)); + return 0; + } + + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_hwcomp_init(E_Comp *c) +{ + if (!(c->hwcomp_handle = dlopen(_comp_mod->conf->hwcomp_file, (RTLD_NOW | RTLD_GLOBAL)))) + { + /* cannot open the .so file. bail out */ + ELBF(ELBT_COMP, 0, 0, "Cannot open hwcomp so: %s", _comp_mod->conf->hwcomp_file); + printf("Cannot open hwcomp so: %s\n", + ecore_file_file_get(_comp_mod->conf->hwcomp_file)); + return 0; + } + // function link + c->hwcomp_funcs.init = dlsym(c->hwcomp_handle, "e_mod_comp_hwcomp_mod_init"); + c->hwcomp_funcs.shutdown = dlsym(c->hwcomp_handle, "e_mod_comp_hwcomp_mod_shutdown"); + + /* check that policy supports needed functions */ + if ((!c->hwcomp_funcs.init) || (!c->hwcomp_funcs.shutdown)) + { + ELBF(ELBT_COMP, 0, 0, "HWComp does not support needed functions: %s", + ecore_file_file_get(_comp_mod->conf->hwcomp_file)); + return 0; + } + + /* try to initialize the hwcomp */ + if (!c->hwcomp_funcs.init(c)) + { + ELBF(ELBT_COMP, 0, 0, "HWComp failed to initialize: %s", + ecore_file_file_get(_comp_mod->conf->hwcomp_file)); + return 0; + + } + + return EINA_TRUE; +} + +static inline Eina_Bool +_e_mod_comp_shaped_check(int w, + int h, + const Ecore_X_Rectangle *rects, + int num) +{ + if ((!rects) || (num < 1)) return EINA_FALSE; + if (num > 1) return EINA_TRUE; + if ((rects[0].x == 0) && (rects[0].y == 0) && + ((int)rects[0].width == w) && ((int)rects[0].height == h)) + return EINA_FALSE; + return EINA_TRUE; +} + +static inline Eina_Bool +_e_mod_comp_win_shaped_check(const E_Comp_Win *cw, + const Ecore_X_Rectangle *rects, + int num) +{ + return _e_mod_comp_shaped_check(cw->w, cw->h, rects, num); +} + +static void +_e_mod_comp_win_shape_rectangles_apply(E_Comp_Win *cw, + const Ecore_X_Rectangle *rects, + int num) +{ + Eina_List *l, *ll; + Evas_Object *o; + E_Comp_Object *co; + int i; + + if (!_e_mod_comp_win_shaped_check(cw, rects, num)) + { + rects = NULL; + } + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (rects) + { + unsigned int *pix, *p; + unsigned char *spix, *sp; + int w, h, px, py; + + evas_object_image_size_get(co->img, &w, &h); + if ((w > 0) && (h > 0)) + { + if (co->native) return; + evas_object_image_native_surface_set(co->img, NULL); + evas_object_image_alpha_set(co->img, 1); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_native_surface_set(o, NULL); + evas_object_image_alpha_set(o, 1); + } + + pix = evas_object_image_data_get(co->img, 1); + if (pix) + { + spix = calloc(w * h, sizeof(unsigned char)); + if (spix) + { + for (i = 0; i < num; i++) + { + int rx, ry, rw, rh; + + rx = rects[i].x; ry = rects[i].y; + rw = rects[i].width; rh = rects[i].height; + E_RECTS_CLIP_TO_RECT(rx, ry, rw, rh, 0, 0, w, h); + sp = spix + (w * ry) + rx; + for (py = 0; py < rh; py++) + { + for (px = 0; px < rw; px++) + { + *sp = 0xff; sp++; + } + sp += w - rw; + } + } + sp = spix; + p = pix; + for (py = 0; py < h; py++) + { + for (px = 0; px < w; px++) + { + unsigned int mask, imask; + mask = ((unsigned int)(*sp)) << 24; + imask = mask >> 8; + imask |= imask >> 8; + imask |= imask >> 8; + *p = mask | (*p & imask); + sp++; + p++; + } + } + free(spix); + } + evas_object_image_data_set(co->img, pix); + evas_object_image_data_update_add(co->img, 0, 0, w, h); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_data_set(o, pix); + evas_object_image_data_update_add(o, 0, 0, w, h); + } + } + } + } + else + { + if (cw->shaped) + { + unsigned int *pix, *p; + int w, h, px, py; + + evas_object_image_size_get(co->img, &w, &h); + if ((w > 0) && (h > 0)) + { + if (co->native) return; + evas_object_image_alpha_set(co->img, 0); + EINA_LIST_FOREACH(co->img_mirror, l, o) + { + evas_object_image_alpha_set(o, 1); + } + pix = evas_object_image_data_get(co->img, 1); + if (pix) + { + p = pix; + for (py = 0; py < h; py++) + { + for (px = 0; px < w; px++) + *p |= 0xff000000; + } + } + evas_object_image_data_set(co->img, pix); + evas_object_image_data_update_add(co->img, 0, 0, w, h); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_data_set(o, pix); + evas_object_image_data_update_add(o, 0, 0, w, h); + } + } + } + // dont need to fix alpha chanel as blending + // should be totally off here regardless of + // alpha channel content + } + } +} + +static void +_e_mod_comp_win_update(E_Comp_Win *cw) +{ + E_Update_Rect *r; + int i; + E_Comp_Canvas *canvas = NULL; + Eina_List *l = NULL; + + e_mod_comp_x_grab_set(cw->c, EINA_TRUE); + cw->update = 0; + + if (cw->argb) + { + if (cw->rects) + { + free(cw->rects); + cw->rects = NULL; + cw->rects_num = 0; + } + } + else + { + if (cw->shape_changed) + { + if (cw->rects) + { + free(cw->rects); + cw->rects = NULL; + cw->rects_num = 0; + } + ecore_x_pixmap_geometry_get(cw->win, NULL, NULL, &(cw->w), &(cw->h)); + cw->rects = ecore_x_window_shape_rectangles_get(cw->win, &(cw->rects_num)); + if (cw->rects) + { + for (i = 0; i < cw->rects_num; i++) + { + E_RECTS_CLIP_TO_RECT(cw->rects[i].x, + cw->rects[i].y, + cw->rects[i].width, + cw->rects[i].height, + 0, 0, cw->w, cw->h); + } + } + if (!_e_mod_comp_win_shaped_check(cw, cw->rects, cw->rects_num)) + { + free(cw->rects); + cw->rects = NULL; + cw->rects_num = 0; + } + if ((cw->rects) && (!cw->shaped)) + { + cw->shaped = 1; + } + else if ((!cw->rects) && (cw->shaped)) + { + cw->shaped = 0; + } + } + } + + if ((cw->needpix) && (cw->dmg_updates <= 0)) + { + e_mod_comp_x_grab_set(cw->c, EINA_FALSE); + return; + } + + if ((!cw->pixmap) || (cw->needpix)) + { + Ecore_X_Pixmap pm = 0; + // named pixmap of the nocomp window will be updated in + // nocomp_dispose function after the damage event + if (cw->nocomp) + { + e_mod_comp_x_grab_set(cw->c, EINA_FALSE); + return; + } + pm = ecore_x_composite_name_window_pixmap_get(cw->win); + if (pm) + { + Ecore_X_Pixmap oldpm; + cw->needpix = 0; + e_mod_comp_win_comp_objs_needxim_set(cw, 1); + oldpm = cw->pixmap; + cw->pixmap = pm; + if (cw->pixmap) + { + ecore_x_pixmap_geometry_get(cw->pixmap, NULL, NULL, &(cw->pw), &(cw->ph)); + // pixmap's size is not equal with window's size case + if (!((cw->pw == (cw->w + cw->border * 2)) && + (cw->ph == (cw->h + cw->border *2)))) + { + cw->pw = cw->w; + cw->ph = cw->h; + cw->pixmap = oldpm; + cw->needpix = 1; + ecore_x_pixmap_free(pm); + e_mod_comp_x_grab_set(cw->c, EINA_FALSE); + return; + } + if ((cw->pw > 0) && (cw->ph > 0)) + e_mod_comp_win_comp_objs_img_resize(cw, cw->pw, cw->ph); + } + else + { + cw->pw = 0; + cw->ph = 0; + } + if ((cw->pw <= 0) || (cw->ph <= 0)) + { + e_mod_comp_win_comp_objs_img_deinit(cw); + if (cw->pixmap) + { + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + } + cw->pw = 0; + cw->ph = 0; + } + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + e_mod_comp_win_comp_objs_native_set(cw, 0); + e_mod_comp_update_resize(cw->up, cw->pw, cw->ph); + e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + if (oldpm) ecore_x_pixmap_free(oldpm); + } + } + + if (!((cw->pw > 0) && (cw->ph > 0))) + { + e_mod_comp_x_grab_set(cw->c, EINA_FALSE); + return; + } + + e_mod_comp_win_comp_objs_move(cw, cw->x, cw->y); + e_mod_comp_win_comp_objs_resize(cw, cw->pw, cw->ph); + + //update old geometry due to finish resize + cw->resizing.x = cw->x; + cw->resizing.y = cw->y; + + if (((cw->c->gl && _comp_mod->conf->texture_from_pixmap) || _comp_mod->conf->use_efl_native_surface) + && (!cw->shaped) + && (!cw->rects)) + { + e_mod_comp_win_comp_objs_img_size_set(cw, cw->pw, cw->ph); + e_mod_comp_win_comp_objs_img_init(cw); + + r = e_mod_comp_update_rects_get(cw->up); + if (r) + { + for (i = 0; r[i].w > 0; i++) + { + int x, y, w, h; + x = r[i].x; y = r[i].y; + w = r[i].w; h = r[i].h; + e_mod_comp_win_comp_objs_img_data_update_add(cw, x, y, w, h); + + /* check update region */ + if (_comp_mod->conf->use_hwc) + { + if (cw->c->hwcomp_funcs.check_win_update) + cw->c->hwcomp_funcs.check_win_update(cw, w, h); + } + } + e_mod_comp_update_clear(cw->up); + free(r); + } + } + else + { + Eina_List *l, *ll; + E_Comp_Object *co; + Evas_Object *o; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (co->native) + { + evas_object_image_native_surface_set(co->img, NULL); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_native_surface_set(o, NULL); + } + co->native = 0; + } + if (co->needxim) + { + co->needxim = 0; + if (co->xim) + { + evas_object_image_size_set(co->img, 1, 1); + evas_object_image_data_set(co->img, NULL); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_size_set(o, 1, 1); + evas_object_image_data_set(o, NULL); + } + ecore_x_image_free(co->xim); + co->xim = NULL; + } + } + if (!co->xim) + { + if ((co->xim = ecore_x_image_new(cw->pw, cw->ph, cw->vis, cw->depth))) + e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + } + } + r = e_mod_comp_update_rects_get(cw->up); + if (r) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (co->xim) + { + unsigned int *pix; + + pix = ecore_x_image_data_get(co->xim, NULL, NULL, NULL); + evas_object_image_data_set(co->img, pix); + evas_object_image_size_set(co->img, cw->pw, cw->ph); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_data_set(o, pix); + evas_object_image_size_set(o, cw->pw, cw->ph); + } + + e_mod_comp_update_clear(cw->up); + for (i = 0; r[i].w > 0; i++) + { + int x, y, w, h; + x = r[i].x; y = r[i].y; + w = r[i].w; h = r[i].h; + if (!ecore_x_image_get(co->xim, cw->pixmap, x, y, x, y, w, h)) + { + e_mod_comp_update_add(cw->up, x, y, w, h); + cw->update = 1; + } + else + { + // why do we neeed these 2? this smells wrong + pix = ecore_x_image_data_get(co->xim, NULL, NULL, NULL); + evas_object_image_data_set(co->img, pix); + evas_object_image_data_update_add(co->img, x, y, w, h); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_data_set(o, pix); + evas_object_image_data_update_add(o, x, y, w, h); + } + } + } + } + } + free(r); + if (cw->shaped) + { + _e_mod_comp_win_shape_rectangles_apply(cw, cw->rects, cw->rects_num); + } + else + { + if (cw->shape_changed) + _e_mod_comp_win_shape_rectangles_apply(cw, cw->rects, cw->rects_num); + } + cw->shape_changed = 0; + } + } + + e_mod_comp_win_comp_objs_show(cw); + + if (_comp_mod->conf->use_hwc) + { + if ((cw->hwc.set_drawable) && (cw->c->hwcomp_funcs.win_update)) + cw->c->hwcomp_funcs.win_update(cw); + } + + e_mod_comp_x_grab_set(cw->c, EINA_FALSE); + + if (_comp_mod->conf->stand_by_canvas_render_enable) + { + if ((cw->visible) && (cw->c) && (cw->c->stand_by_canvas_render)) + { + cw->c->stand_by_canvas_render = 0; + + EINA_LIST_FOREACH(cw->c->canvases, l, canvas) + { + ELBF(ELBT_COMP, 0, 0, "STAND BY CANVAS RENDER UNSET"); + if (ecore_evas_manual_render_get(canvas->ee) == EINA_TRUE) + ecore_evas_manual_render_set(canvas->ee, 0); + } + } + } +} + +static void +_e_mod_comp_win_transparent_rect_update(E_Comp_Win *cw) +{ + Ecore_X_Window win; + unsigned int val[4] = { 0, }; // offset and size + int ret = -1; + + win = e_mod_comp_util_client_xid_get(cw); + + ret = ecore_x_window_prop_card32_get + (win, ATOM_CM_TRANSPARENT_RECT, val, 4); + if (ret <= 0) + { + cw->transp_rect.use = EINA_FALSE; + cw->transp_rect.x = 0; + cw->transp_rect.y = 0; + cw->transp_rect.w = 0; + cw->transp_rect.h = 0; + } + else + { + cw->transp_rect.use = EINA_TRUE; + cw->transp_rect.x = val[0]; + cw->transp_rect.y = val[1]; + cw->transp_rect.w = val[2]; + cw->transp_rect.h = val[3]; + } + + e_mod_comp_win_comp_objs_transparent_rect_update(cw); +} + +// set XRandr RROutput property according to viewmode +static Eina_Bool +_e_mod_comp_win_rr_output_prop_set(Ecore_X_Window win, unsigned int mode) +{ + XRRScreenResources *resources = NULL; + Atom view_mode; + RROutput output = 0; + unsigned int op_num; + Data_Rrprop prop_data; + Ecore_X_Display *x_disp = ecore_x_display_get(); + + if (win) + resources = XRRGetScreenResources(x_disp, win); + else + resources = XRRGetScreenResources(x_disp, ecore_x_window_root_first_get()); + if ((!resources) || (resources->noutput <= 0)) + return EINA_FALSE; + + for (op_num = 0; op_num < resources->noutput; op_num++) + { + output = resources->outputs[op_num]; + view_mode = ATOM_CM_STEREOSCOPIC_MODE; + if (view_mode == None) + { + printf("RR property is not suppported \n"); + return EINA_FALSE; + } + + if (win) + { + prop_data.win = win; + } + else + { + prop_data.win = NULL; + } + + prop_data.value = mode; + XRRChangeOutputProperty(x_disp, output, view_mode, XA_INTEGER, 32, + PropModeReplace, (unsigned char *)&prop_data, 2); + } + XRRFreeScreenResources(resources); + return EINA_TRUE; +} + +// interfacing of compositor with stereoscopic mode (3D App, 2D App & Multimedia content) +static Eina_Bool +_e_mod_comp_win_stereo_layout_set(Ecore_X_Window win, unsigned int mode) +{ + unsigned int view_mode = 0; + int ret = -1; + E_Comp_Win *cw = NULL; + E_Zone *zone = NULL; + + cw = _e_mod_comp_win_find(win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(win); + E_CHECK_RETURN(cw, 0); + } + + ret = ecore_x_window_prop_card32_get + (win, ATOM_CM_3D_APP_WIN, &view_mode , 1); + if (ret <= 0) + { + cw->win3d = EINA_FALSE; + if (mode < 4) /*2D app and 3D multimedia content*/ + { + E_Comp *c = (E_Comp *)(cw->c); + E_Comp_Canvas *canvas = NULL; + Eina_List *l; + + E_CHECK_RETURN(c, NULL); + + zone = cw->bd->zone; + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + + if(canvas->zone == zone) canvas->stereoscopic_mode = mode; + + e_mod_comp_canvas_stereo_layout_set(canvas); + } + } + } + else + { + if (view_mode > 0) /*3D application window case */ + { + cw->win3d = EINA_TRUE; + //do nothing in case of 3D app, 3D app will take care + } + } + return EINA_TRUE; +} + +// added handler for RR Output property notification (instead of API calling from device manager) +static int +_e_mod_comp_cb_rr_output_prop(void *data, int type, void *ev) +{ + if (type == ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY) + { + Ecore_X_Event_Randr_Output_Property_Notify *event = (Ecore_X_Event_Randr_Output_Property_Notify *)ev; + /* available information: + struct _Ecore_X_Event_Randr_Output_Property_Notify + { + Ecore_X_Window win; + Ecore_X_Randr_Output output; + Ecore_X_Atom property; + Ecore_X_Time time; + Ecore_X_Randr_Property_Change state; + }; + */ + + char *atom_name = ecore_x_atom_name_get(event->property); + + // checking and retrieving 3D stereoscopic mode + if ((atom_name) && (strcmp(atom_name, "_E_COMP_STEREOSCOPIC_MODE") == 0)) + { + Ecore_X_Display *x_disp = ecore_x_display_get(); + Atom actual_type; + int actual_format; + unsigned int value; + unsigned long nitems; + unsigned long bytes_after; + Data_Rrprop *prop_data; + + + if (XRRGetOutputProperty(x_disp, event->output, ATOM_CM_STEREOSCOPIC_MODE, + 0, 4, False, False, None, &actual_type, &actual_format, + &nitems, &bytes_after, &prop_data) != Success) + { + fprintf(stderr,"DeviceManager :: stereoMode not valid \n"); + if (atom_name) free(atom_name); + return EINA_FALSE; + } + + if ((actual_type != XA_INTEGER) || (nitems != 2) || (actual_format != 32)) + { + fprintf(stderr,"DeviceManager :: stereoMode prop value not correct \n"); + if (atom_name) free(atom_name); + return EINA_FALSE; + } + + value = ((Data_Rrprop *)prop_data)->value; + + // taking specific action in compositor based on stereoscopic mode + if (((Data_Rrprop *)prop_data)->win != NULL) + _e_mod_comp_win_stereo_layout_set(((Data_Rrprop *)prop_data)->win, value); + } + + if (atom_name) free(atom_name); + } + return EINA_TRUE; +} + +#ifdef _F_USE_BORDER_TRANSFORM_ +static Eina_Bool +_e_mod_comp_bd_transform_changed(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Transform_Changed* ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + e_mod_comp_win_comp_objs_img_transform_set(cw, EINA_FALSE); + //_e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); + return ECORE_CALLBACK_PASS_ON; +} +#endif /* End of _F_USE_BORDER_TRANSFORM_ */ + +static Eina_Bool +_e_mod_comp_cb_delayed_update_timer(void *data) +{ + E_Comp *c = data; + _e_mod_comp_render_queue(c); + c->new_up_timer = NULL; + return ECORE_CALLBACK_CANCEL; +} + +static Eina_Bool +_e_mod_comp_cb_update(E_Comp *c) +{ + E_Comp_Win *cw; + Eina_List *l; + E_Comp_Canvas *canvas = NULL; + Eina_List *new_updates = NULL; + Eina_List *update_done = NULL; + + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:UPDATE CB"); + + c->update_job = NULL; + + if (_comp_mod->conf->nocomp_fs) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (canvas->nocomp.mode != E_NOCOMP_MODE_RUN) continue; + cw = e_mod_comp_canvas_fullscreen_check(canvas); + if ((!cw) || (cw != canvas->nocomp.cw) || + (canvas->nocomp.force_composite)) + { + ELBF(ELBT_COMP, 0, + cw ? e_mod_comp_util_client_xid_get(cw) : 0, + "NOCOMP_END nocomp.cw:0x%08x canvas:%d", + e_mod_comp_util_client_xid_get(canvas->nocomp.cw), + canvas->num); + + e_mod_comp_canvas_nocomp_end(canvas); + } + } + } + + e_mod_comp_x_grab_set(c, EINA_TRUE); + + EINA_LIST_FREE(c->updates, cw) + { + if (!cw) continue; + if (_comp_mod->conf->efl_sync) + { + if ((((cw->counter) && (cw->drawme)) || (!cw->counter)) && (cw->sync_info.version)) + { +#ifdef _F_IGNORE_DMG_HIDE_ + if(!cw->ignore_dmg) + { + _e_mod_comp_win_update(cw); + } + else + { + cw->update = 0; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), "%15.15s| skip render", "IGNORE_DMG"); + } +#else + _e_mod_comp_win_update(cw); +#endif + if (cw->drawme) + { + update_done = eina_list_append(update_done, cw); + cw->drawme = 0; + } + } + else + cw->update = 0; + } + else + { +#ifdef _F_IGNORE_DMG_HIDE_ + if(!cw->ignore_dmg) + { + _e_mod_comp_win_update(cw); + } + else + { + cw->update = 0; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), "%15.15s| skip render2", "IGNORE_DMG"); + } +#else + _e_mod_comp_win_update(cw); +#endif + } + + + if (cw->update) + new_updates = eina_list_append(new_updates, cw); + } + + if (_comp_mod->conf->efl_sync) + { + EINA_LIST_FREE(update_done, cw) + { + if (!cw) continue; + ecore_x_sync_counter_inc(cw->counter, 1); + cw->sync_info.val++; + + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|done:%d val:%d", "INC", + cw->sync_info.done_count, cw->sync_info.val); + } + } + e_mod_comp_win_shape_input_update(c); + e_mod_comp_x_grab_set(c, EINA_FALSE); + + if (new_updates) + { + if (c->new_up_timer) ecore_timer_del(c->new_up_timer); + c->new_up_timer = + ecore_timer_add(0.001, _e_mod_comp_cb_delayed_update_timer, c); + } + c->updates = new_updates; + if (!c->animating) c->render_overflow--; + + c->effect_funcs.signal_flush(); + + if (_comp_mod->conf->use_hwc) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas->hwcomp) continue; + if (c->hwcomp_funcs.cb_update) + { + if (!c->hwcomp_funcs.cb_update(canvas->hwcomp)) + { + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_RENEW; + } + } + } + } + + if (c->render_overflow <= 0) + { + c->render_overflow = 0; + if (c->render_animator) c->render_animator = NULL; + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_CANCEL; + } + + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_RENEW; +} + +static void +_e_mod_comp_cb_job(void *data) +{ + _e_mod_comp_cb_update(data); +} + +static Eina_Bool +_e_mod_comp_cb_animator(void *data) +{ + return _e_mod_comp_cb_update(data); +} + +static void +_e_comp_event_src_visibility_free(void *data __UNUSED__, + void *event) +{ + E_Event_Comp_Source_Visibility *ev = event; + E_FREE(ev); +} + +static void +_e_mod_comp_render_queue(E_Comp *c) +{ + E_CHECK(c); + + if (_comp_mod->conf->lock_fps) + { + if (c->render_animator) + { + c->render_overflow = OVER_FLOW; + return; + } + c->render_animator = ecore_animator_add(_e_mod_comp_cb_animator, c); + } + else + { + if (c->update_job) + { + ecore_job_del(c->update_job); + c->update_job = NULL; + c->render_overflow = 0; + } + c->update_job = ecore_job_add(_e_mod_comp_cb_job, c); + } +} + +static void +_e_mod_comp_win_render_queue(E_Comp_Win *cw) +{ + E_CHECK(cw); + E_CHECK(cw->c); + + _e_mod_comp_render_queue(cw->c); +} + +static E_Comp * +_e_mod_comp_find(Ecore_X_Window root) +{ + Eina_List *l; + E_Comp *c; + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + if (c->man->root == root) return c; + } + return NULL; +} + +static E_Comp_Win * +_e_mod_comp_win_find(Ecore_X_Window win) +{ + return eina_hash_find(windows, e_util_winid_str_get(win)); +} + +static E_Comp_Win * +_e_mod_comp_border_client_find(Ecore_X_Window win) +{ + return eina_hash_find(borders, e_util_winid_str_get(win)); +} + +/* wrapper function for external file */ +EAPI E_Comp_Win * +e_mod_comp_win_find(Ecore_X_Window win) +{ + return _e_mod_comp_win_find(win); +} + +EAPI E_Comp_Win * +e_mod_comp_border_client_find(Ecore_X_Window win) +{ + return _e_mod_comp_border_client_find(win); +} + +EAPI E_Comp * +e_mod_comp_find(Ecore_X_Window win) +{ + E_CHECK_RETURN(win, 0); + return _e_mod_comp_find(win); +} + +EAPI void +e_mod_comp_render_queue(E_Comp *c) +{ + E_CHECK(c); + _e_mod_comp_render_queue(c); +} + +EAPI void +e_mod_comp_win_render_queue(E_Comp_Win *cw) +{ + E_CHECK(cw); + _e_mod_comp_win_render_queue(cw); +} + +EAPI Eina_Bool +e_mod_comp_win_damage_timeout(void *data) +{ + E_CHECK_RETURN(data, 0); + return _e_mod_comp_win_damage_timeout(data); +} + +EAPI Eina_Bool +e_mod_comp_cb_update(E_Comp *c) +{ + E_CHECK_RETURN(c, 0); + return _e_mod_comp_cb_update(c); +} + +EAPI Evas_Object * +e_mod_comp_win_mirror_add(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + return _e_mod_comp_win_mirror_add(cw); +} + +EAPI void +e_mod_comp_cb_win_mirror_del(void *data, + Evas *e, + Evas_Object *obj, + void *event_info) +{ + E_CHECK(data); + _e_mod_comp_cb_win_mirror_del(data, + e, + obj, + event_info); +} + +EAPI void +e_mod_comp_src_hidden_set_func(void *data, + E_Manager *man, + E_Manager_Comp_Source *src, + Eina_Bool hidden) +{ + _e_mod_comp_src_hidden_set_func(data, man, src, hidden); +} + +static E_Comp_Win * +_e_mod_comp_win_damage_find(Ecore_X_Damage damage) +{ + return eina_hash_find(damages, e_util_winid_str_get(damage)); +} + +static Eina_Bool +_e_mod_comp_win_is_borderless(E_Comp_Win *cw) +{ + if (!cw->bd) return 1; + if ((cw->bd->client.border.name) && + (!strcmp(cw->bd->client.border.name, "borderless"))) + return 1; + return 0; +} + +static Eina_Bool +_e_mod_comp_win_damage_timeout(void *data) +{ + E_Comp_Win *cw = data; + E_CHECK_RETURN(cw, 0); + + if (!cw->update) + { + if (cw->update_timeout) + { + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } +#if 0 + // do not render by dmg_timeout. + // only render when received sync_draw_done. + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); +#endif + } + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|%dx%d p:%dx%d dmg:%d NO_DRAWDONE", "DMG_TIMEOUT", + cw->w, cw->h, cw->pw, cw->ph, cw->dmg_updates); +#if 0 + // do not render by dmg_timeout. + // only render when received sync_draw_done. + cw->drawme = 1; + _e_mod_comp_win_render_queue(cw); +#endif + if (cw->update_timeout) + { + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + return ECORE_CALLBACK_CANCEL; +} + +static void +_e_mod_comp_object_del(void *data, + void *obj) +{ + E_Comp_Win *cw = (E_Comp_Win *)data; + E_CHECK(cw); + + _e_mod_comp_win_render_queue(cw); + + if (obj == cw->bd) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|", "OBJECT_DEL"); + + if (cw->counter) + { + Ecore_X_Window _w = e_mod_comp_util_client_xid_get(cw); + ecore_x_e_comp_sync_cancel_send(_w); + ecore_x_sync_counter_inc(cw->counter, 1); + cw->sync_info.val++; + + ELBF(ELBT_COMP, 1, _w, "%15.15s", "SYNC_CANCEL"); + } + if (cw->bd) eina_hash_del(borders, e_util_winid_str_get(cw->bd->client.win), cw); + cw->bd = NULL; + e_mod_comp_win_comp_objs_data_del(cw, "border"); + } + else if (obj == cw->pop) + { + cw->pop = NULL; + e_mod_comp_win_comp_objs_data_del(cw, "popup"); + } + else if (obj == cw->menu) + { + cw->menu = NULL; + e_mod_comp_win_comp_objs_data_del(cw, "menu"); + } + if (cw->dfn) + { + e_object_delfn_del(obj, cw->dfn); + cw->dfn = NULL; + } +} + +EAPI void +e_mod_comp_done_defer(E_Comp_Win *cw) +{ + E_CHECK(cw); + cw->c->effect_funcs.animating_set(cw->c, cw, EINA_FALSE); + + cw->force = 1; + if (cw->defer_hide) + { + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "EDJ_DONE Force win to hide bd:%d", + cw->bd); + + _e_mod_comp_win_hide(cw); + } + cw->force = 1; + if (cw->delete_me) + { + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "EDJ_DONE Force win to del bd:%d", + cw->bd); + + _e_mod_comp_win_del(cw); + } + else cw->force = 0; +} + +static void +_e_mod_comp_show_done(void *data, + Evas_Object *obj, + const char *emission __UNUSED__, + const char *source __UNUSED__) +{ + E_Comp_Win *cw = (E_Comp_Win *)data; + E_CHECK(cw); + + SECURE_SLOGD("[e17:Application:Launching:done] win:0x%07x name:%s", + cw->bd ? cw->bd->client.win : cw->win, + cw->bd ? cw->bd->client.netwm.name : NULL); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|SHOW_DONE", "SIGNAL"); + + cw->c->effect_funcs.signal_del(cw, obj, "show,done"); + + cw->launched = EINA_TRUE; + cw->show_done = EINA_TRUE; + e_mod_comp_done_defer(cw); +} + +static void +_e_mod_comp_hide_done(void *data, + Evas_Object *obj, + const char *emission __UNUSED__, + const char *source __UNUSED__) +{ + E_Comp_Win *cw = (E_Comp_Win *)data; + E_CHECK(cw); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|HIDE_DONE", "SIGNAL"); + + cw->c->effect_funcs.signal_del(cw, obj, "hide,done"); + + cw->show_done = EINA_FALSE; + +#ifdef _F_IGNORE_DMG_HIDE_ + if (!cw->visible) + { + cw->ignore_dmg = 1; + ELBF(ELBT_COMP, 0, cw->win, "%15.15s| set 1", "IGNORE_DMG"); + } + else + { + ELBF(ELBT_COMP, 0, cw->win, "%15.15s| set 1 BUT Skip. Because this is visible current.", "IGNORE_DMG"); + } +#endif + + e_mod_comp_done_defer(cw); +} + +static void +_e_mod_comp_win_sync_setup(E_Comp_Win *cw, + Ecore_X_Window win) +{ + if (!_comp_mod->conf->efl_sync) return; + if (cw->bd) + { + if (_e_mod_comp_win_is_borderless(cw) || + (_comp_mod->conf->loose_sync)) + { + cw->counter = ecore_x_e_comp_sync_counter_get(win); + } + else + { + ecore_x_e_comp_sync_cancel_send(win); + cw->counter = 0; + } + } + else + cw->counter = ecore_x_e_comp_sync_counter_get(win); + + if (cw->counter) + { + if (cw->bd) + { + E_Comp_Win *client_cw = _e_mod_comp_win_find(win); + if (client_cw && + client_cw->counter == cw->counter) + { + ecore_x_sync_counter_inc(cw->counter, 1); + cw->sync_info.val++; + return; + } + } + + ecore_x_e_comp_sync_begin_send(win); + ecore_x_sync_counter_inc(cw->counter, 1); + cw->sync_info.val++; + } +} + +static void +_e_mod_comp_win_shadow_setup_error_get(E_Comp_Win *cw, + Evas_Object *o, + const char *msg, + const char *file) +{ + Ecore_X_Window win = e_mod_comp_util_client_xid_get(cw); + + fprintf(stdout, + "[E17-comp] EDC file ERROR win:0x%08x o:%p %s FILE:%s\n", + win, o, msg, file); + + ELBF(ELBT_COMP, 0, win, + "%15.15s|ERROR o:%p %s", + "EDC", o, msg); + + ELBF(ELBT_COMP, 0, win, + "%15.15s|ERROR FILE:%s", + "EDC", file); + + e_mod_comp_debug_edje_error_get(o, win); +} + +EAPI void +e_mod_comp_win_shadow_setup(E_Comp_Win *cw, + E_Comp_Object *co) +{ + Evas_Object *o; + int ok = 0; + char buf[PATH_MAX]; + Eina_List *l; + + evas_object_image_smooth_scale_set(co->img, _comp_mod->conf->smooth_windows); + EINA_LIST_FOREACH(co->img_mirror, l, o) + { + evas_object_image_smooth_scale_set(o, _comp_mod->conf->smooth_windows); + } + + if (_comp_mod->conf->shadow_file) + { + ok = edje_object_file_set + (co->shadow, _comp_mod->conf->shadow_file, + e_mod_comp_policy_win_shadow_group_get(cw)); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|GROUP:%s", "EDC", + e_mod_comp_policy_win_shadow_group_get(cw)); + } + + if (!ok) + { + _e_mod_comp_win_shadow_setup_error_get + (cw, co->shadow, "SHADOW_FILE", + _comp_mod->conf->shadow_file); + + if (_comp_mod->conf->shadow_style) + { + snprintf(buf, sizeof(buf), "e/comp/%s", + _comp_mod->conf->shadow_style); + + ok = e_theme_edje_object_set(co->shadow, + "base/theme/borders", + buf); + } + if (!ok) + { + _e_mod_comp_win_shadow_setup_error_get + (cw, co->shadow, "STYLE", + _comp_mod->conf->shadow_style); + + ok = e_theme_edje_object_set(co->shadow, + "base/theme/borders", + "e/comp/default"); + } + } + // fallback to local shadow.edj - will go when default theme supports this + if (!ok) + { + _e_mod_comp_win_shadow_setup_error_get + (cw, co->shadow, "STYLE_DEFAULT", + "e/comp/default"); + + snprintf(buf, sizeof(buf), "%s/shadow.edj", + e_module_dir_get(_comp_mod->module)); + ok = edje_object_file_set(co->shadow, buf, "shadow"); + + if (!ok) + { + _e_mod_comp_win_shadow_setup_error_get + (cw, co->shadow, "LOCAL", buf); + } + } + if (!edje_object_part_swallow(co->shadow, + "e.swallow.content", + co->img)) + { + fprintf(stdout, + "[E17-comp] EDC swallow ERROR win:0x%08x %s(%d) o:%p img:%p\n", + cw->win, __func__, __LINE__, co->shadow, co->img); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|SWALLOW_ERROR o:%p img:%p", + "EDC", co->shadow, co->img); + } + e_mod_comp_debug_edje_error_get + (co->shadow, e_mod_comp_util_client_xid_get(cw)); +} + +static Eina_Bool +_e_mod_comp_shadow_set(E_Comp_Win *cw, + Eina_Bool set) +{ +#if USE_SHADOW + Eina_List *l; + E_Comp_Object *co; + + if (!cw) return EINA_FALSE; + + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if ((co->shadow) && (co->img)) + { + if (set) + edje_object_signal_emit(co->shadow, "e,state,shadow,on", "e"); + else + edje_object_signal_emit(co->shadow, "e,state,shadow,off", "e"); + } + } +#endif + return EINA_TRUE; +} + +static void +_e_mod_comp_cb_win_mirror_del(void *data, + Evas *e, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + E_Comp_Win *cw = (E_Comp_Win *)data; + E_Comp_Object *co; + Eina_List *l; + E_CHECK(cw); + + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (co->canvas->evas == e) + { + co->img_mirror = eina_list_remove(co->img_mirror, obj); + break; + } + } +} + +static Evas_Object * +_e_mod_comp_win_mirror_add(E_Comp_Win *cw) +{ + Evas_Object *o, *smart_parent_obj; + Eina_List *l; + E_Comp_Object *co; + E_Zone *z; + + E_CHECK_RETURN(cw->c, 0); + + if (cw->bd) z = cw->bd->zone; + else z = e_util_zone_current_get(cw->c->man); + EINA_LIST_FOREACH(cw->objs, l, co) + { + if ((_comp_mod->conf->canvas_per_zone) && + ((co->zone) != (z))) + continue; + + o = evas_object_image_filled_add(co->canvas->evas); + evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); + co->img_mirror = eina_list_append(co->img_mirror, o); + evas_object_image_smooth_scale_set(o, _comp_mod->conf->smooth_windows); + + evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, + _e_mod_comp_cb_win_mirror_del, cw); + + if ((cw->pixmap) && (cw->pw > 0) && (cw->ph > 0)) + { + unsigned int *pix; + Eina_Bool alpha; + int w, h; + + alpha = evas_object_image_alpha_get(co->img); + evas_object_image_size_get(co->img, &w, &h); + + evas_object_image_alpha_set(o, alpha); + + if (cw->shaped) + { + pix = evas_object_image_data_get(co->img, 0); + evas_object_image_data_set(o, pix); + evas_object_image_size_set(o, w, h); + evas_object_image_data_set(o, pix); + evas_object_image_data_update_add(o, 0, 0, w, h); + } + else + { + if (co->native) + { + Evas_Native_Surface ns; + + ns.version = EVAS_NATIVE_SURFACE_VERSION; + ns.type = EVAS_NATIVE_SURFACE_X11; + ns.data.x11.visual = cw->vis; + ns.data.x11.pixmap = cw->pixmap; + evas_object_image_size_set(o, w, h); + evas_object_image_native_surface_set(o, &ns); + evas_object_image_data_update_add(o, 0, 0, w, h); + } + else + { + if (!co->xim) + { + evas_object_del(o); + return NULL; + } + pix = ecore_x_image_data_get(co->xim, NULL, NULL, NULL); + evas_object_image_data_set(o, pix); + evas_object_image_size_set(o, w, h); + evas_object_image_data_set(o, pix); + evas_object_image_data_update_add(o, 0, 0, w, h); + } + } + evas_object_image_size_set(o, w, h); + evas_object_image_data_update_add(o, 0, 0, w, h); + } + smart_parent_obj = evas_object_smart_parent_get(co->shadow); + if (!smart_parent_obj) + evas_object_stack_above(o, co->shadow); + else + evas_object_stack_above(o, smart_parent_obj); + return o; + } + return NULL; +} + +static E_Comp_Win * +_e_mod_comp_win_add(E_Comp *c, + Ecore_X_Window win) +{ + Ecore_X_Window_Attributes att; + E_Comp_Win *cw; + Eina_List *l; + E_Comp_Object *co; + + cw = E_NEW(E_Comp_Win, 1); + E_CHECK_RETURN(cw, 0); + cw->win = win; + cw->c = c; + cw->opacity = 255.0; + cw->bd = e_border_find_by_window(cw->win); + e_mod_comp_x_grab_set(c, EINA_TRUE); + if (cw->bd) + { + eina_hash_add(borders, e_util_winid_str_get(cw->bd->client.win), cw); + cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_mod_comp_object_del, cw); + } + else if ((cw->pop = e_popup_find_by_window(cw->win))) + { + cw->dfn = e_object_delfn_add(E_OBJECT(cw->pop), + _e_mod_comp_object_del, cw); + cw->show_ready = 1; + } + else if ((cw->menu = e_menu_find_by_window(cw->win))) + { + cw->dfn = e_object_delfn_add(E_OBJECT(cw->menu), + _e_mod_comp_object_del, cw); + cw->show_ready = 1; + } + else + { + char *netwm_title = NULL; + + cw->title = ecore_x_icccm_title_get(cw->win); + if (ecore_x_netwm_name_get(cw->win, &netwm_title)) + { + if (cw->title) free(cw->title); + cw->title = netwm_title; + } + ecore_x_icccm_name_class_get(cw->win, &cw->name, &cw->clas); + cw->role = ecore_x_icccm_window_role_get(cw->win); + if (!ecore_x_netwm_window_type_get(cw->win, &cw->primary_type)) + cw->primary_type = ECORE_X_WINDOW_TYPE_UNKNOWN; + } + + e_mod_comp_win_type_setup(cw); + memset((&att), 0, sizeof(Ecore_X_Window_Attributes)); + if (!ecore_x_window_attributes_get(cw->win, &att)) + { + LOGW("[CW Creating Fail!!(Attributes get)] Win:%08x, BD:%p, POP:%p, MENU:%p", e_mod_comp_util_client_xid_get(cw), cw->bd, cw->pop, cw->menu); + if (cw->bd) + { + eina_hash_del(borders, e_util_winid_str_get(cw->bd->client.win), cw); + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->bd), cw->dfn); + } + else if (cw->pop) + { + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->pop), cw->dfn); + } + else if (cw->menu) + { + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->menu), cw->dfn); + } + + if (cw->title) free(cw->title); + if (cw->name) free(cw->name); + if (cw->clas) free(cw->clas); + if (cw->role) free(cw->role); + free(cw); + + e_mod_comp_x_grab_set(c, EINA_FALSE); + return NULL; + } + + if ((!att.input_only) && + ((att.depth != 24) && (att.depth != 32))) + { + printf("WARNING: window 0x%x not 24/32bpp -> %ibpp\n", + cw->win, att.depth); + cw->invalid = 1; + } + cw->input_only = att.input_only; + cw->override = att.override; + cw->vis = att.visual; + cw->depth = att.depth; + cw->argb = ecore_x_window_argb_get(cw->win); + + // supporting sync_draw_done basically. + cw->sync_draw_support = EINA_TRUE; + + // setting default value for 3D win and stereoscpic mode + cw->win3d = EINA_FALSE; + //cw->c->stereoscopic_mode = 0; + + eina_hash_add(windows, e_util_winid_str_get(cw->win), cw); + cw->inhash = 1; + if ((!cw->input_only) && (!cw->invalid)) + { + Ecore_X_Rectangle *rects; + int num; + + cw->damage = ecore_x_damage_new + (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); + eina_hash_add(damages, e_util_winid_str_get(cw->damage), cw); + cw->objs = e_mod_comp_win_comp_objs_add(cw); + if (!cw->objs) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|ERROR", "OBJECT_ADD"); + + LOGW("[CW Creating Fail!!(Object Add fail)] Win:%08x, BD:%p, POP:%p, MENU:%p", e_mod_comp_util_client_xid_get(cw), cw->bd, cw->pop, cw->menu); + if (cw->bd) + { + eina_hash_del(borders, e_util_winid_str_get(cw->bd->client.win), cw); + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->bd), cw->dfn); + } + else if (cw->pop) + { + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->pop), cw->dfn); + } + else if (cw->menu) + { + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->menu), cw->dfn); + } + eina_hash_del(windows, e_util_winid_str_get(cw->win), cw); + + if (cw->damage) + { + eina_hash_del(damages, e_util_winid_str_get(cw->damage), cw); + ecore_x_damage_free(cw->damage); + cw->damage = 0; + } + + if (cw->title) free(cw->title); + if (cw->name) free(cw->name); + if (cw->clas) free(cw->clas); + if (cw->role) free(cw->role); + free(cw); + + e_mod_comp_x_grab_set(c, EINA_FALSE); + return NULL; + } + + E_Comp_Canvas *canvas; + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->use_bg_img) continue; + evas_object_lower(canvas->bg_img); + } + + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + e_mod_comp_win_shadow_setup(cw, co); + e_mod_comp_win_cb_setup(cw, co); + if (co->img) evas_object_show(co->img); + } + + _e_mod_comp_win_transparent_rect_update(cw); + + ecore_x_window_shape_events_select(cw->win, 1); + rects = ecore_x_window_shape_rectangles_get(cw->win, &num); + if (rects) + { + int i; + for (i = 0; i < num; i++) + E_RECTS_CLIP_TO_RECT(rects[i].x, rects[i].y, + rects[i].width, rects[i].height, + 0, 0, att.w, att.h); + if (_e_mod_comp_shaped_check(att.w, att.h, rects, num)) + cw->shape_changed = 1; + + free(rects); + } + + if (cw->bd) e_mod_comp_win_comp_objs_data_set(cw, "border", cw->bd); + else if (cw->pop) + e_mod_comp_win_comp_objs_data_set(cw, "popup", cw->pop); + else if (cw->menu) + e_mod_comp_win_comp_objs_data_set(cw, "menu", cw->menu); + + e_mod_comp_win_comp_objs_img_pass_events_set(cw, 1); + + cw->pending_count++; + e_manager_comp_event_src_add_send + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_mod_comp_cb_pending_after, cw->c); + } + else + { + cw->objs = e_mod_comp_win_comp_objs_add(cw); + if (!cw->objs) + { + LOGW("[CW Creating Fail!!(Input only Object Add fail)] Win:%08x, BD:%p, POP:%p, MENU:%p", e_mod_comp_util_client_xid_get(cw), cw->bd, cw->pop, cw->menu); + if (cw->bd) + { + eina_hash_del(borders, e_util_winid_str_get(cw->bd->client.win), cw); + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->bd), cw->dfn); + } + else if (cw->pop) + { + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->pop), cw->dfn); + } + else if (cw->menu) + { + if (cw->dfn) e_object_delfn_del(E_OBJECT(cw->menu), cw->dfn); + } + eina_hash_del(windows, e_util_winid_str_get(cw->win), cw); + + if (cw->title) free(cw->title); + if (cw->name) free(cw->name); + if (cw->clas) free(cw->clas); + if (cw->role) free(cw->role); + free(cw); + + e_mod_comp_x_grab_set(c, EINA_FALSE); + return NULL; + } + } + e_mod_comp_win_comp_objs_pass_events_set(cw, 1); + e_mod_comp_win_comp_objs_data_set(cw, "win", + (void *)((unsigned long)cw->win)); + e_mod_comp_win_comp_objs_data_set(cw, "src", cw); + + c->wins_invalid = 1; + c->wins = eina_inlist_append(c->wins, EINA_INLIST_GET(cw)); + cw->up = e_mod_comp_update_new(); + if (cw->up) + { + e_mod_comp_update_tile_size_set(cw->up, 32, 32); + // for software: + e_mod_comp_update_policy_set + (cw->up, E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH); + } + if (((!cw->input_only) && (!cw->invalid)) && (cw->override)) + { + cw->redirected = 1; + cw->dmg_updates = 0; + } + + cw->eff_type = cw->c->effect_funcs.type_new(); + if (cw->eff_type) + { + cw->c->effect_funcs.type_setup + (cw->eff_type, + e_mod_comp_util_client_xid_get(cw)); + } + if ((!cw->input_only) && (!cw->invalid)) + _e_mod_comp_window_role_handle(cw); + + e_mod_comp_x_grab_set(c, EINA_FALSE); + cw->launched = EINA_FALSE; + + if (_comp_mod->conf->use_hwc) + { + cw->hwc.set_drawable = EINA_FALSE; + } + + return cw; +} + +static void +_e_mod_comp_win_del(E_Comp_Win *cw) +{ + int pending_count; + E_Comp_Canvas *canvas; + E_Comp_Win *nocomp_cw = NULL; + E_Zone *zone = NULL; + + canvas = eina_list_nth(cw->c->canvases, 0); + if (canvas) zone = canvas->zone; + + if (zone) nocomp_cw = e_mod_comp_util_win_nocomp_get(cw->c, zone); + if ((canvas) && (nocomp_cw) && (nocomp_cw == cw)) + { + e_mod_comp_canvas_nocomp_end(canvas); +#if USE_NOCOMP_DISPOSE + e_mod_comp_canvas_nocomp_dispose(canvas); +#endif + } + + if (_comp_mod->conf->use_hwc && (canvas)) + { + if (cw->c->hwcomp_funcs.reset_idle_timer) + cw->c->hwcomp_funcs.reset_idle_timer(canvas); + if (cw->c->hwcomp_funcs.win_del) + cw->c->hwcomp_funcs.win_del(cw); + } + + if (cw->animating) + cw->c->effect_funcs.animating_set(cw->c, cw, EINA_FALSE); + + if (cw->shape_input) + { + e_mod_comp_win_shape_input_free(cw->shape_input); + cw->shape_input = NULL; + } + + if ((!cw->input_only) && (!cw->invalid)) + { + cw->pending_count++; + e_manager_comp_event_src_del_send + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_mod_comp_cb_pending_after, cw->c); + } + + e_mod_comp_update_free(cw->up); + e_mod_comp_bg_win_handler_release(cw); + + if (cw->rects) + { + free(cw->rects); + cw->rects = NULL; + } + if (cw->update_timeout) + { + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + if (cw->dfn) + { + if (cw->bd) + { + eina_hash_del(borders, e_util_winid_str_get(cw->bd->client.win), cw); + e_object_delfn_del(E_OBJECT(cw->bd), cw->dfn); + cw->bd = NULL; + } + else if (cw->pop) + { + e_object_delfn_del(E_OBJECT(cw->pop), cw->dfn); + cw->pop = NULL; + } + else if (cw->menu) + { + e_object_delfn_del(E_OBJECT(cw->menu), cw->dfn); + cw->menu = NULL; + } + cw->dfn = NULL; + } + if (cw->pixmap) + { + e_mod_comp_win_comp_objs_img_deinit(cw); + + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + cw->pw = 0; + cw->ph = 0; + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + e_mod_comp_win_comp_objs_xim_free(cw); + } + if (cw->redirected) + { + cw->redirected = 0; + cw->pw = 0; + cw->ph = 0; + } + if (cw->update) + { + cw->update = 0; + cw->c->updates = eina_list_remove(cw->c->updates, cw); + } + e_mod_comp_win_comp_objs_del(cw, cw->objs); + if (cw->inhash) + eina_hash_del(windows, e_util_winid_str_get(cw->win), cw); + if (cw->damage) + { + Ecore_X_Region parts; + eina_hash_del(damages, e_util_winid_str_get(cw->damage), cw); + parts = ecore_x_region_new(NULL, 0); + ecore_x_damage_subtract(cw->damage, 0, parts); + ecore_x_region_free(parts); + ecore_x_damage_free(cw->damage); + cw->damage = 0; + } + if (cw->title) free(cw->title); + if (cw->name) free(cw->name); + if (cw->clas) free(cw->clas); + if (cw->role) free(cw->role); + if (cw->eff_type) + { + cw->c->effect_funcs.type_free(cw->eff_type); + cw->eff_type = NULL; + } + if (cw->ov_obj) + { + evas_object_hide(cw->ov_obj); + evas_object_del(cw->ov_obj); + cw->ov_obj = NULL; + } + if (cw->ov_xim) + { + ecore_x_image_free(cw->ov_xim); + cw->ov_xim = NULL; + } + cw->c->wins_invalid = 1; + cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); + pending_count = cw->pending_count; + memset(cw, 0, sizeof(E_Comp_Win)); + cw->pending_count = pending_count; + cw->delete_pending = 1; + if (cw->pending_count > 0) return; + free(cw); +} + +static void +_e_mod_comp_win_prop_check(E_Comp_Win *cw) +{ + Ecore_X_Window win; + Ecore_X_Sync_Counter counter; + + E_CHECK(cw); + win = e_mod_comp_util_client_xid_get(cw); + + // ECORE_X_ATOM_E_COMP_SYNC_COUNTER + counter = ecore_x_e_comp_sync_counter_get(win); + if (cw->counter != counter) + { + if (cw->counter) + { + ecore_x_e_comp_sync_cancel_send(win); + ecore_x_sync_counter_inc(cw->counter, 1); + cw->sync_info.val++; + } + cw->counter = counter; + if (cw->counter) + { + ecore_x_sync_counter_inc(cw->counter, 1); + ecore_x_e_comp_sync_begin_send(win); + cw->sync_info.val = 1; + } + } +} + +static void +_e_mod_comp_win_show(E_Comp_Win *cw) +{ + Ecore_X_Window win; + + // if win_hide was showed then immediatly win_show() function is called. case. + if (cw->defer_hide == 1) cw->defer_hide = 0; + if (cw->visible) return; + cw->visible = 1; +#ifdef _F_IGNORE_DMG_HIDE_ + cw->ignore_dmg = 0; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), "%15.15s| set 0", "IGNORE_DMG"); +#endif + _e_mod_comp_win_configure(cw, + cw->hidden.x, cw->hidden.y, + cw->w, cw->h, + cw->border); + if ((cw->input_only) || (cw->invalid)) return; + + if (cw->bd) + { + e_mod_comp_aux_hint_eval(NULL, cw->bd); + _e_mod_comp_win_sync_setup(cw, cw->bd->client.win); + } + else + _e_mod_comp_win_sync_setup(cw, cw->win); + + if (cw->real_hid) + { + cw->real_hid = 0; + e_mod_comp_win_comp_objs_img_deinit(cw); + if (cw->pixmap) + { + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + cw->pw = 0; + cw->ph = 0; + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + } + e_mod_comp_win_comp_objs_xim_free(cw); + if (cw->redirected) + { + cw->redirected = 0; + cw->pw = 0; + cw->ph = 0; + } + } + + if ((!cw->redirected) || (!cw->pixmap)) + { + if (!cw->pixmap) + cw->pixmap = ecore_x_composite_name_window_pixmap_get(cw->win); + if (cw->pixmap) + ecore_x_pixmap_geometry_get(cw->pixmap, NULL, NULL, &(cw->pw), &(cw->ph)); + else + { + cw->pw = 0; + cw->ph = 0; + } + if ((cw->pw <= 0) || (cw->ph <= 0)) + { + if (cw->pixmap) + { + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + cw->needpix = 1; + } + } + cw->redirected = 1; + + e_mod_comp_update_resize(cw->up, cw->pw, cw->ph); + e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + + e_mod_comp_win_comp_objs_img_size_set(cw, cw->pw, cw->ph); + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + } + + if (cw->dmg_updates >= 1) + { + if ((cw->c->gl && _comp_mod->conf->texture_from_pixmap) || _comp_mod->conf->use_efl_native_surface) + { + if (!cw->pixmap) + cw->pixmap = ecore_x_composite_name_window_pixmap_get(cw->win); + + if (cw->pixmap) + { + ecore_x_pixmap_geometry_get(cw->pixmap, + NULL, NULL, + &(cw->pw), &(cw->ph)); + } + else + { + cw->pw = 0; + cw->ph = 0; + } + + if ((cw->pw <= 0) || (cw->ph <= 0)) + { + if (cw->pixmap) + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + cw->needpix = 1; + } + else + { + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + e_mod_comp_win_comp_objs_img_size_set(cw, cw->pw, cw->ph); + e_mod_comp_win_comp_objs_img_init(cw); + } + } + + if (cw->pixmap) + { + cw->defer_hide = 0; + if (!cw->hidden_override) + { + e_mod_comp_win_comp_objs_force_show(cw); + } + } + } + e_mod_comp_bg_win_handler_show(cw); + + win = e_mod_comp_util_client_xid_get(cw); + cw->use_dri2 = _e_mod_comp_prop_window_use_dri2_get(win); + + e_mod_comp_win_shape_input_invalid_set(cw->c, 1); + _e_mod_comp_win_render_queue(cw); + + if (!cw->sync_draw_support) + { + ELBF(ELBT_COMP, 0, 0, "not sync_draw_support. sync_info.version force set"); + cw->sync_info.version = 1; + } +} + +static void +_e_mod_comp_win_real_hide(E_Comp_Win *cw) +{ + if (cw->bd) + { + _e_mod_comp_win_hide(cw); + return; + } + cw->real_hid = 1; + _e_mod_comp_win_hide(cw); +} + +static void +_e_mod_comp_win_hide(E_Comp_Win *cw) +{ + Ecore_X_Window _w; + + if ((!cw->visible) && (!cw->defer_hide)) return; + + e_mod_comp_win_shape_input_invalid_set(cw->c, 1); + + if ((cw->input_only) || (cw->invalid)) return; + + if (!cw->force) + { + cw->defer_hide = 1; + if (cw->bd) + { + if (cw->bd->client.illume.win_state.state != ECORE_X_ILLUME_WINDOW_STATE_NORMAL) + _e_mod_comp_shadow_set(cw, EINA_FALSE); + } + cw->c->effect_funcs.win_hide(cw); + cw->visible = 0; + return; + } + + cw->visible = 0; + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + cw->c->effect_funcs.signal_del(cw, + co->shadow, + "hide,done"); + } + + cw->defer_hide = 0; + cw->force = 0; + e_mod_comp_win_comp_objs_hide(cw); + + if (cw->update_timeout) + { + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + if (_comp_mod->conf->keep_unmapped) + { + goto finish; + } + + e_mod_comp_win_comp_objs_img_deinit(cw); + if (cw->pixmap) + { + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + cw->pw = 0; + cw->ph = 0; + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + } + + e_mod_comp_win_comp_objs_xim_free(cw); + + if (cw->redirected) + { + cw->redirected = 0; + cw->pw = 0; + cw->ph = 0; + } + +finish: + _e_mod_comp_win_render_queue(cw); + _w = e_mod_comp_util_client_xid_get(cw); + if (_comp_mod->conf->send_flush) ecore_x_e_comp_flush_send(_w); + if (_comp_mod->conf->send_dump) ecore_x_e_comp_dump_send(_w); +} + +static void +_e_mod_comp_win_raise_above(E_Comp_Win *cw, + E_Comp_Win *cw2) +{ + Eina_Bool v1, v2; + + v1 = e_mod_comp_util_win_visible_get(cw, EINA_TRUE); + + cw->c->wins_invalid = 1; + cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); + cw->c->wins = eina_inlist_append_relative(cw->c->wins, + EINA_INLIST_GET(cw), + EINA_INLIST_GET(cw2)); + + v2 = e_mod_comp_util_win_visible_get(cw, EINA_TRUE); + cw->c->effect_funcs.win_restack(cw, v1, v2); + + e_mod_comp_win_comp_objs_stack_above(cw, cw2); + + _e_mod_comp_win_render_queue(cw); + cw->pending_count++; + e_manager_comp_event_src_config_send + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_mod_comp_cb_pending_after, cw->c); +} + +static void +_e_mod_comp_win_raise(E_Comp_Win *cw) +{ + cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); + cw->c->wins = eina_inlist_append(cw->c->wins, EINA_INLIST_GET(cw)); + + e_mod_comp_win_comp_objs_raise(cw); + _e_mod_comp_win_render_queue(cw); +} + +static void +_e_mod_comp_win_lower(E_Comp_Win *cw) +{ + cw->c->wins_invalid = 1; + cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); + cw->c->wins = eina_inlist_prepend(cw->c->wins, EINA_INLIST_GET(cw)); + + e_mod_comp_win_comp_objs_lower(cw); + _e_mod_comp_win_render_queue(cw); + cw->pending_count++; + e_manager_comp_event_src_config_send + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_mod_comp_cb_pending_after, cw->c); +} + +static void +_e_mod_comp_win_configure(E_Comp_Win *cw, + int x, int y, + int w, int h, + int border) +{ + Eina_Bool geo_changed = EINA_FALSE; + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + + if (!((w == cw->w) && (h == cw->h))) + { + cw->w = w; + cw->h = h; + cw->needpix = 1; + cw->dmg_updates = 0; + geo_changed = EINA_TRUE; + + /* reset dmg_updates of canvas.nocomp.end if this window + * is waiting for damage events before it is running with + * the comp mode. (E_NOCOMP_MODE_DISPOSE exactly) + */ +#if USE_NOCOMP_DISPOSE + if (_comp_mod->conf->nocomp_fs) + { + EINA_LIST_FOREACH(cw->c->canvases, l, canvas) + { + if ((canvas->nocomp.mode == E_NOCOMP_MODE_END) && + (canvas->nocomp.end.cw == cw)) + { + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "NOCOMP dmg:%d nocomp.end.dmg_updates:%d->2", + canvas->num, cw->dmg_updates, + canvas->nocomp.end.dmg_updates); + + canvas->nocomp.end.dmg_updates = 2; + } + } + } +#endif + + if ((_comp_mod->conf->use_hwc) && (cw->c->hwcomp_funcs.set_resize)) + { + cw->c->hwcomp_funcs.set_resize(cw); + } + } + + if (!cw->visible) + { + cw->hidden.x = x; + cw->hidden.y = y; + cw->border = border; + } + else + { + if (!((x == cw->x) && (y == cw->y))) + { + if (cw->needpix) + { + cw->resizing.x = cw->x; + cw->resizing.y = cw->y; + } + + cw->x = x; + cw->y = y; + geo_changed = EINA_TRUE; + if (!cw->needpix) + e_mod_comp_win_comp_objs_move(cw, cw->x, cw->y); + } + cw->hidden.x = x; + cw->hidden.y = y; + } + + if (cw->border != border) + { + cw->border = border; + geo_changed = EINA_TRUE; + e_mod_comp_win_comp_objs_resize(cw, + cw->pw + (cw->border * 2), + cw->ph + (cw->border * 2)); + } + cw->hidden.w = cw->w; + cw->hidden.h = cw->h; + if (geo_changed) + { + e_mod_comp_win_shape_input_invalid_set(cw->c, 1); + + if (_comp_mod->conf->nocomp_fs) + { + EINA_LIST_FOREACH(cw->c->canvases, l, canvas) + { + if ((canvas->nocomp.mode == E_NOCOMP_MODE_RUN) && + (canvas->nocomp.cw == cw)) + { + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "NOCOMP_END RESIZE canvas:%d dmg:%d", + canvas->num, cw->dmg_updates); + + e_mod_comp_canvas_nocomp_end(canvas); + } + } + } + } + if ((cw->input_only) || (cw->invalid) || (cw->needpix)) return; + _e_mod_comp_win_render_queue(cw); + cw->pending_count++; + e_manager_comp_event_src_config_send + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_mod_comp_cb_pending_after, cw->c); +} + +static void +_e_mod_comp_win_damage(E_Comp_Win *cw, + int x, + int y, + int w, + int h, + Eina_Bool dmg) +{ + if ((cw->input_only) || (cw->invalid)) return; + if ((dmg) && (cw->damage)) + { + Ecore_X_Region parts; + parts = ecore_x_region_new(NULL, 0); + ecore_x_damage_subtract(cw->damage, 0, parts); + ecore_x_region_free(parts); + cw->dmg_updates++; + } + +#if USE_NOCOMP_DISPOSE + if ((_comp_mod->conf->nocomp_fs) && + (cw->nocomp)) + { + EINA_LIST_FOREACH(cw->c->canvases, l, canvas) + { + if (canvas->nocomp.mode != E_NOCOMP_MODE_END) continue; + if (canvas->nocomp.end.cw != cw) continue; + if (canvas->nocomp.end.dmg_updates > cw->dmg_updates) continue; + e_mod_comp_canvas_nocomp_dispose(canvas); + } + } +#endif + + e_mod_comp_update_add(cw->up, x, y, w, h); + if (dmg) + { + if (cw->counter) + { +#ifdef _F_IGNORE_DMG_HIDE_ + if (!cw->update_timeout && + !cw->ignore_dmg) +#else + if (!cw->update_timeout) +#endif + { + cw->update_timeout = ecore_timer_add + (_comp_mod->conf->damage_timeout, + _e_mod_comp_win_damage_timeout, cw); + } + return; + } + } + + if ((dmg) && + (cw->dmg_updates <= 1)) + { + if (!(cw->needpix)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|SKIP FIRST DMG. bd:%s", "DMG", + cw->bd ? "O" : "X"); + return; + } + } +#ifdef _F_IGNORE_DMG_HIDE_ + if (cw->ignore_dmg) + { + ELBF(ELBT_COMP, 0, cw->win, "%15.15s| skip damage!", "IGNORE_DMG"); + return; + } +#endif + if (!cw->update) + { + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); + } + _e_mod_comp_win_render_queue(cw); +} + +static void +_e_mod_comp_win_reshape(E_Comp_Win *cw) +{ + if (cw->shape_changed) return; + cw->shape_changed = 1; + if (!cw->update) + { + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); + } + e_mod_comp_update_add(cw->up, 0, 0, cw->w, cw->h); + _e_mod_comp_win_render_queue(cw); +} + +static Eina_Bool +_e_mod_comp_create(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Create *ev = event; + Eina_List *l; + E_Comp_Win *cw; + E_Comp_Canvas *canvas; + E_Comp *c = _e_mod_comp_find(ev->parent); + if (!c) return ECORE_CALLBACK_PASS_ON; + if (_e_mod_comp_win_find(ev->win)) return ECORE_CALLBACK_PASS_ON; + if (c->win == ev->win) return ECORE_CALLBACK_PASS_ON; + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (canvas->ee_win == ev->win) return ECORE_CALLBACK_PASS_ON; + } + ELBF(ELBT_COMP, 0, ev->win, "%15.15s|", "X_CREATE"); + cw = _e_mod_comp_win_add(c, ev->win); + if (cw) + { + _e_mod_comp_win_configure(cw, + ev->x, ev->y, + ev->w, ev->h, + ev->border); + + if (cw->bd) + { + if (cw->bd->internal && cw->bd->visible) + _e_mod_comp_win_show(cw); + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_destroy(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Destroy *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|w:0x%08x|bd:%d cw:%p", "X_DESTROY", + ev->win, _e_mod_comp_win_is_border(cw), cw); + if (!cw->c->nocomp && cw->animating) cw->delete_me = 1; + else _e_mod_comp_win_del(cw); + return ECORE_CALLBACK_PASS_ON; +} + +/* Compositor must check the client window's property that want to be shown. + * TODO:Compositor will check the property of ECORE_X_ATOM_E_COMP_SYNC_COUNTER for now, + * but the other properties may also need to check later. + */ +static Eina_Bool +_e_mod_comp_show_request(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Show_Request *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|w:0x%08x|bd:%d cw:%p", "X_SHOW_REQUEST", + ev->win, _e_mod_comp_win_is_border(cw), cw); + _e_mod_comp_win_prop_check(cw); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_show(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Show *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + if (cw->visible) return ECORE_CALLBACK_PASS_ON; + if (_e_mod_comp_win_is_border(cw)) return ECORE_CALLBACK_PASS_ON; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|w:0x%08x|bd:%d cw:%p", "X_SHOW", + ev->win, _e_mod_comp_win_is_border(cw), cw); + _e_mod_comp_win_show(cw); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_hide(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Hide *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + if (!cw->visible) return ECORE_CALLBACK_PASS_ON; + if (_e_mod_comp_win_is_border(cw)) return ECORE_CALLBACK_PASS_ON; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|w:0x%08x|bd:%d cw:%p", "X_HIDE", + ev->win, _e_mod_comp_win_is_border(cw), cw); + _e_mod_comp_win_real_hide(cw); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_reparent(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Reparent *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|w:0x%08x|bd:%d cw:%p TO parent:0x%08x", "X_REPARENT", + ev->win, _e_mod_comp_win_is_border(cw), cw, ev->parent); + if (ev->parent != cw->c->man->root) + { + ELBF(ELBT_COMP, 1, e_mod_comp_util_client_xid_get(cw), + "DEL 0x%08x", ev->win); + _e_mod_comp_win_del(cw); + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_configure(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Configure *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + Eina_Bool need_shape_merge = EINA_FALSE; + if (!cw) return ECORE_CALLBACK_PASS_ON; + + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|%4d %4d %3dx%3d", "X_CONFIGURE", + ev->x, ev->y, ev->w, ev->h); + + if (ev->abovewin == 0) + { + if (EINA_INLIST_GET(cw)->prev) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|", "LOWER"); + SLOGI("%15.15s|0x%08x", "LOWER", e_mod_comp_util_client_xid_get(cw)); + + _e_mod_comp_win_lower(cw); + need_shape_merge = EINA_TRUE; + } + } + else + { + E_Comp_Win *cw2 = _e_mod_comp_win_find(ev->abovewin); + if (cw2) + { + E_Comp_Win *cw3 = (E_Comp_Win *)(EINA_INLIST_GET(cw)->prev); + if (cw3 != cw2) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|above:0x%08x", "RAISE_ABOVE", + e_mod_comp_util_client_xid_get(cw2)); + SLOGI("(0x%08x)%15.15s|above:0x%08x", e_mod_comp_util_client_xid_get(cw), "RAISE_ABOVE", + e_mod_comp_util_client_xid_get(cw2)); + + _e_mod_comp_win_raise_above(cw, cw2); + need_shape_merge = EINA_TRUE; + } + } + } + + if (need_shape_merge) + { + e_mod_comp_win_shape_input_invalid_set(cw->c, 1); + _e_mod_comp_win_render_queue(cw); + } + +#if OPTIMIZED_HWC_MOBILE + if (_comp_mod->conf->use_hwc && cw->hwc.resize_pending) + { + cw->hwc.resize_pending = 0; + } +#endif + + if (!((cw->x == ev->x) && (cw->y == ev->y)) && + ((cw->w == ev->w) && (cw->h == ev->h)) && + _e_mod_comp_win_is_border(cw)) + { + return ECORE_CALLBACK_PASS_ON; + } + + if (!((cw->x == ev->x) && (cw->y == ev->y) && + (cw->w == ev->w) && (cw->h == ev->h) && + (cw->border == ev->border))) + { + _e_mod_comp_win_configure(cw, + ev->x, ev->y, + ev->w, ev->h, + ev->border); + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_stack(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Stack *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + if (ev->detail == ECORE_X_WINDOW_STACK_ABOVE) _e_mod_comp_win_raise(cw); + else _e_mod_comp_win_lower(cw); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_prop_effect_state(Ecore_X_Event_Window_Property *ev __UNUSED__) +{ + E_Comp *c; + unsigned int val; + int ret; + + c = e_mod_comp_util_get(); + E_CHECK_RETURN(c, 0); + + ret = ecore_x_window_prop_card32_get + (c->man->root, ATOM_EFFECT_ENABLE, &val, 1); + E_CHECK_RETURN((ret >= 0), 0); + + if (val != 0) + { + c->animatable = EINA_TRUE; + c->keyboard_effect = EINA_TRUE; + if (_comp_mod->conf->default_window_effect != 1) + { + _comp_mod->conf->default_window_effect = 1; + e_config_domain_save("module.e17-mod-tizen-comp", + _comp_mod->conf_edd, + _comp_mod->conf); + + } + } + else + { + c->animatable = EINA_FALSE; + c->keyboard_effect = EINA_FALSE; + if (_comp_mod->conf->default_window_effect != 0) + { + _comp_mod->conf->default_window_effect = 0; + e_config_domain_save("module.e17-mod-tizen-comp", + _comp_mod->conf_edd, + _comp_mod->conf); + } + } + + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_prop_window_effect_state(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = NULL; + Ecore_X_Window w = 0; + E_CHECK_RETURN(ev, 0); + + cw = _e_mod_comp_win_find(ev->win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK_RETURN(cw, 0); + } + + E_CHECK_RETURN(cw->eff_type, 0); + + w = e_mod_comp_util_client_xid_get(cw); + cw->c->effect_funcs.state_setup(cw->eff_type, w); + + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_prop_effect_style(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = NULL; + Ecore_X_Window w = 0; + E_CHECK_RETURN(ev, 0); + + cw = _e_mod_comp_win_find(ev->win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK_RETURN(cw, 0); + } + + E_CHECK_RETURN(cw->eff_type, 0); + + w = e_mod_comp_util_client_xid_get(cw); + cw->c->effect_funcs.style_setup(cw->eff_type, w); + + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_prop_opacity(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = NULL; + unsigned int val = 0; + int ret = -1; + + cw = _e_mod_comp_win_find(ev->win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK_RETURN(cw, 0); + } + + ret = ecore_x_window_prop_card32_get + (ev->win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY, &val, 1); + E_CHECK_RETURN((ret > 0), 0); + + cw->opacity = (val >> 24); + + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + evas_object_color_set(co->shadow, + cw->opacity, + cw->opacity, + cw->opacity, + cw->opacity); + } + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_prop_sync_counter(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = NULL; + cw = _e_mod_comp_win_find(ev->win); + if (!cw) cw = _e_mod_comp_border_client_find(ev->win); + + Ecore_X_Sync_Counter counter = ecore_x_e_comp_sync_counter_get(ev->win); + if (cw) + { + if (cw->counter != counter) + { + Ecore_X_Window _w = e_mod_comp_util_client_xid_get(cw); + if (cw->counter) + { + ecore_x_e_comp_sync_cancel_send(_w); + ecore_x_sync_counter_inc(cw->counter, 1); + cw->sync_info.val++; + } + cw->counter = counter; + if (cw->counter) + { + ecore_x_sync_counter_inc(cw->counter, 1); + ecore_x_e_comp_sync_begin_send(_w); + cw->sync_info.val = 1; + } + } + } + else + { + if (counter) ecore_x_sync_counter_inc(counter, 1); + } + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_prop_window_use_dri2_get(Ecore_X_Window win) +{ + unsigned int val = 0; + int ret = ecore_x_window_prop_card32_get(win, + ATOM_X_WIN_USE_DRI2, + &val, + 1); + if (ret == -1) return EINA_FALSE; + + return val ? EINA_TRUE : EINA_FALSE; +} + +static Eina_Bool +_e_mod_comp_prop_use_dri2(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = NULL; + Ecore_X_Window win; + cw = _e_mod_comp_win_find(ev->win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK_RETURN(cw, 0); + } + + win = e_mod_comp_util_client_xid_get(cw); + cw->use_dri2 = _e_mod_comp_prop_window_use_dri2_get(win); + + return EINA_TRUE; +} + +/* TODO: change getting x prop code to e border event */ +static void +_e_mod_comp_prop_illume_win_state(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK(cw); + + unsigned int state = ecore_x_e_illume_window_state_get(ev->win); + + if (state == ECORE_X_ILLUME_WINDOW_STATE_NORMAL) + { + _e_mod_comp_shadow_set(cw, EINA_FALSE); + + if ((_comp_mod->conf->use_hwc) && (cw->c->hwcomp_funcs.set_resize)) + cw->c->hwcomp_funcs.set_resize(cw); + } + else if ((state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) || + (state == ECORE_X_ILLUME_WINDOW_STATE_ASSISTANT_MENU)) + { + _e_mod_comp_shadow_set(cw, EINA_TRUE); + + if ((_comp_mod->conf->use_hwc) && (cw->c->hwcomp_funcs.set_resize)) + cw->c->hwcomp_funcs.set_resize(cw); + } +} + +static Eina_Bool +_e_mod_comp_prop_transparent_rect(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = NULL; + cw = _e_mod_comp_win_find(ev->win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK_RETURN(cw, 0); + } + + _e_mod_comp_win_transparent_rect_update(cw); + + return EINA_TRUE; +} + +// for interfacing of 3D setreoscopic mode with compositor +/* one can change the property as below + unsigned int view_mode; + Atom StereoMode; + StereoMode = XInternAtom(disp, "_E_COMP_3D_APP_WIN", False); + if (StereoMode == None) + return ; + XChangeProperty(disp, win, StereoMode, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&view_mode, 1); +*/ +static Eina_Bool +_e_mod_comp_prop_3d_win_mode(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw = NULL; + unsigned int view_mode = 0; + int ret = 0; + + cw = _e_mod_comp_win_find(ev->win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK_RETURN(cw, 0); + } + + //retrieving view mode + ret = ecore_x_window_prop_card32_get + (ev->win, ATOM_CM_3D_APP_WIN, &view_mode , 1); + if (view_mode < 4) + { + cw->win3d = EINA_TRUE; + // set XRandr RROutput property according to viewmode + _e_mod_comp_win_rr_output_prop_set(ev->win, view_mode); + } + + return EINA_TRUE; +} + +#ifdef _F_IGNORE_DMG_HIDE_ +static void +_e_mod_comp_msg_deiconify_approve(Ecore_X_Event_Client_Message *ev) +{ + if (!e_config->deiconify_approve) return; + + E_Comp_Win *cw = NULL; + cw = _e_mod_comp_border_client_find(ev->win); + if (!cw) return; + if (ev->data.l[1] != 1) return; + cw->ignore_dmg = 0; + ELBF(ELBT_COMP, 0, ev->win, "%15.15s| set 0 via DEICONIFY APPROVE", "IGNORE_DMG"); +} +#endif + +//X client message handling for stereo mode change (from 2D Apps) +static void +_e_mod_comp_msg_stereo_mode_changed(Ecore_X_Event_Client_Message *ev) +{ + unsigned int res = 0, view_mode = 0; + Ecore_X_Window win; + + res = ev->data.l[0]; + win = ev->data.l[1]; + + switch(res) + { + case 0: + view_mode = E_COMP_STEREO_MONO; + break; + + case 1: + view_mode = E_COMP_STEREO_INTERLACED; + break; + + case 2: + view_mode = E_COMP_STEREO_VERTICAL; + break; + + case 3: + view_mode = E_COMP_STEREO_HORIZONTAL; + break; + + default: + break; + } + + if (view_mode < 4) + { + // set XRandr RROutput property according to viewmode + _e_mod_comp_win_rr_output_prop_set(win, view_mode); + } +} + +static void +_e_mod_comp_window_role_handle(E_Comp_Win *cw) +{ + E_CHECK(cw); + Ecore_X_Window win; + E_Comp_Object *co; + Eina_List *l; + char *hints = NULL; + char *token = NULL; + + win = e_mod_comp_util_client_xid_get(cw); + + hints = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_WINDOW_ROLE); + + if (hints) + token = strtok(hints, " ,"); + while (token != NULL) + { + if (!strncmp (token, "no-effect", strlen("no-effect"))) + { + cw->c->effect_funcs.state_set(cw->eff_type, 0); + } + else if (!strncmp(token, "no-dim", strlen("no-dim"))) + { + char* group = e_mod_comp_policy_win_shadow_group_get(cw); + if (group && !strcmp(group, "dialog")) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if ((co->shadow) && (co->img)) + { + edje_object_signal_emit(co->shadow, "e,state,dim,off", "e"); + } + } + } + } + token = strtok (NULL, " ,"); + } + + free(hints); +} + + +static Eina_Bool +_e_mod_comp_prop_window_role(Ecore_X_Event_Window_Property *ev) +{ + + E_Comp_Win *cw = NULL; + cw = _e_mod_comp_win_find(ev->win); + if (!cw) + { + cw = _e_mod_comp_border_client_find(ev->win); + E_CHECK_RETURN(cw, 0); + } + + _e_mod_comp_window_role_handle(cw); + + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_property(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) +{ + Ecore_X_Event_Window_Property *ev = event; + Ecore_X_Atom a = 0; + if (!ev) return ECORE_CALLBACK_PASS_ON; + if (!ev->atom) return ECORE_CALLBACK_PASS_ON; + if (!e_mod_comp_atoms_name_get(ev->atom)) return ECORE_CALLBACK_PASS_ON; + a = ev->atom; + + ELBF(ELBT_COMP_RENDER, 0, ev->win, + "%15.15s|atom:%s", "X_PROP", + e_mod_comp_atoms_name_get(a)); + + if (a == ECORE_X_ATOM_E_COMP_SYNC_COUNTER ) _e_mod_comp_prop_sync_counter(ev); + else if (a == ATOM_X_WIN_USE_DRI2 ) _e_mod_comp_prop_use_dri2(ev); + else if (a == ATOM_EFFECT_ENABLE ) _e_mod_comp_prop_effect_state(ev); + else if (a == ATOM_WINDOW_EFFECT_ENABLE ) _e_mod_comp_prop_window_effect_state(ev); + else if (a == ATOM_WINDOW_EFFECT_TYPE ) _e_mod_comp_prop_effect_style(ev); + else if (a == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY) _e_mod_comp_prop_opacity(ev); + else if (a == ECORE_X_ATOM_WM_CLASS ) e_mod_comp_win_type_handler_prop(ev); + else if (a == ATOM_NET_CM_WINDOW_BACKGROUND ) e_mod_comp_bg_win_handler_prop(ev); + else if (a == ATOM_CM_LOG ) e_mod_comp_debug_prop_handle(ev); + else if (a == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE) _e_mod_comp_prop_illume_win_state(ev); + else if (a == ATOM_CM_TRANSPARENT_RECT ) _e_mod_comp_prop_transparent_rect(ev); + else if (a == ECORE_X_ATOM_WM_WINDOW_ROLE ) _e_mod_comp_prop_window_role(ev); + else if (a == ATOM_CM_3D_APP_WIN ) _e_mod_comp_prop_3d_win_mode(ev); + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_msg_sync_draw_done(Ecore_X_Event_Client_Message *ev) +{ + E_Comp_Win *cw = NULL; + int v = 0, w = 0, h = 0; + cw = _e_mod_comp_border_client_find(ev->data.l[0]); + v = ev->data.l[1]; + w = ev->data.l[2]; + h = ev->data.l[3]; + if (cw) + { + cw->sync_info.version = v; + if (!cw->bd) + { + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|v:%d %dx%d ERR NO cw->bd", "DRAW_DONE", v, w, h); + return EINA_FALSE; + } + if ((Ecore_X_Window)(ev->data.l[0]) != cw->bd->client.win) + { + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|v:%d %dx%d ERR != 0x%08x", "DRAW_DONE", + v, w, h, ev->data.l[0]); + return EINA_FALSE; + } + } + else + { + cw = _e_mod_comp_win_find(ev->data.l[0]); + if (!cw || (ev->data.l[0] != (int)cw->win)) + { + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + + EINA_LIST_FOREACH (compositors, l, c) + { + if (!c) return EINA_FALSE; + EINA_LIST_FOREACH (c->canvases, ll, canvas) + { + if (!canvas) return EINA_FALSE; + + if ((ev->win) && (ev->data.l[0] != canvas->ee_win)) + { + Ecore_X_Sync_Counter counter = ecore_x_e_comp_sync_counter_get(ev->win); + ecore_x_e_comp_sync_cancel_send(ev->win); + if (counter) ecore_x_sync_counter_inc(counter, 1); + } + } + } + + /* + * FIXME : Is that a right aproach? + */ + if (_comp_mod->conf->use_hwc) + { + E_Comp_HWComp *hwcomp; + + EINA_LIST_FOREACH (compositors, l, c) + { + if (!c) return EINA_FALSE; + EINA_LIST_FOREACH (c->canvases, ll, canvas) + { + if (!canvas) return EINA_FALSE; + if (!canvas->hwcomp) return EINA_FALSE; + + hwcomp = canvas->hwcomp; + if (ev->data.l[0] == canvas->ee_win) + { + if (c->lock.locked) + { + if (ecore_evas_manual_render_get(canvas->ee) == EINA_FALSE) + ecore_evas_manual_render_set(canvas->ee, 1); + } + else if (c->hwcomp_funcs.update_composite) + c->hwcomp_funcs.update_composite(hwcomp); + } + } + } + } + + ELBF(ELBT_COMP_RENDER, 0, ev->data.l[0], + "%15.15s|v:%d %dx%d ERR NO cw", "DRAW_DONE", v, w, h); + return EINA_FALSE; + } + } + + cw->sync_info.version = v; + +#ifdef _F_USE_ICONIFY_RESIZE_ + if ((cw) && (cw->bd)) + { + if (cw->bd->iconify_resize.support) + { + if ((cw->bd->iconify_resize.need_draw) + && (w == cw->bd->iconify_resize.w) + && (h == cw->bd->iconify_resize.h)) + { + cw->bd->iconify_resize.need_draw = 0; + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| set %d - SYNC DRAW DONE received", "NEED_DRAW", + cw->bd->iconify_resize.need_draw); + + SECURE_SLOGE("[NEED_DRAW|set 0 - SYNC DRAW DONE received] win:0x%07x name:%s", + cw->bd ? cw->bd->client.win : cw->win, + cw->bd ? cw->bd->client.netwm.name : NULL); + } + } + } +#endif + + if (!cw->counter) + { + cw->counter = ecore_x_e_comp_sync_counter_get(e_mod_comp_util_client_xid_get(cw)); + if (cw->counter) + { + ecore_x_sync_counter_inc(cw->counter, 1); + ecore_x_e_comp_sync_begin_send(e_mod_comp_util_client_xid_get(cw)); + cw->sync_info.val = 1; + cw->sync_info.done_count = 1; + } + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|v:%d %dx%d WARN NO counter", "DRAW_DONE", v, w, h); + // Add exception for application that don't use sync_counter + if (!cw->update) + { + if (cw->update_timeout) + { + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); + } + cw->drawme = 1; + _e_mod_comp_win_render_queue(cw); + + return EINA_FALSE; + } + + if ((_comp_mod->conf->efl_sync) && + (_comp_mod->conf->nocomp_fs) && + (cw->nocomp)) + { + ecore_x_sync_counter_inc(cw->counter, 1); + cw->update = 0; + cw->drawme = 0; + cw->sync_info.done_count++; + cw->sync_info.val++; + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|v:%d %dx%d NOCOMP INC", "DRAW_DONE", v, w, h); + return EINA_TRUE; + } + + if (!cw->update) + { + if (cw->update_timeout) + { + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); + } + + cw->drawme = 1; + cw->sync_info.done_count++; + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|v:%d %dx%d", "DRAW_DONE", v, w, h); + _e_mod_comp_win_render_queue(cw); + return EINA_TRUE; +} + +static void +_e_mod_comp_active_request_handle(Ecore_X_Event_Client_Message *ev) +{ + E_Comp_Win *cw = NULL; + cw = _e_mod_comp_win_find(ev->win); + if (!cw) cw = _e_mod_comp_border_client_find(ev->win); + + if (!cw) return; + if (!cw->c->animatable) return; + + if (TYPE_HOME_CHECK(cw)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|", "HOME ACTIVE"); + + cw->activate = EINA_TRUE; + } +} + +static Eina_Bool +_e_mod_comp_hib_leave(Ecore_X_Event_Client_Message *ev) +{ + E_Comp *c; + Config *cfg; + + E_CHECK_RETURN(ev, 0); + E_CHECK_RETURN((ev->data.l[0] == 0), 0); + E_CHECK_RETURN(_comp_mod, 0); + + c = _e_mod_comp_find(ev->win); + E_CHECK_RETURN(c, 0); + + cfg = e_config_domain_load("module.e17-mod-tizen-comp", + _comp_mod->conf_edd); + E_CHECK_RETURN(cfg, 0); + + if (cfg->default_window_effect != c->animatable) + { + if (cfg->default_window_effect) + { + c->animatable = EINA_TRUE; + _comp_mod->conf->default_window_effect = 1; + } + else + { + c->animatable = EINA_FALSE; + _comp_mod->conf->default_window_effect = 0; + } + ecore_x_window_prop_card32_set + (c->man->root, ATOM_EFFECT_ENABLE, + (unsigned int *)(&(_comp_mod->conf->default_window_effect)), 1); + } + + if (cfg->shadow_file) eina_stringshare_del(cfg->shadow_file); + if (cfg->shadow_style) eina_stringshare_del(cfg->shadow_style); + if (cfg->effect_file) eina_stringshare_del(cfg->effect_file); + + if (cfg->effect_policy_unknown) eina_stringshare_del(cfg->effect_policy_unknown); + if (cfg->effect_policy_desktop) eina_stringshare_del(cfg->effect_policy_desktop); + if (cfg->effect_policy_dock) eina_stringshare_del(cfg->effect_policy_dock); + if (cfg->effect_policy_toolbar) eina_stringshare_del(cfg->effect_policy_toolbar); + if (cfg->effect_policy_menu) eina_stringshare_del(cfg->effect_policy_menu); + if (cfg->effect_policy_utility) eina_stringshare_del(cfg->effect_policy_utility); + if (cfg->effect_policy_splash) eina_stringshare_del(cfg->effect_policy_splash); + if (cfg->effect_policy_dialog) eina_stringshare_del(cfg->effect_policy_dialog); + if (cfg->effect_policy_normal) eina_stringshare_del(cfg->effect_policy_normal); + if (cfg->effect_policy_videocall) eina_stringshare_del(cfg->effect_policy_videocall); + if (cfg->effect_policy_dropdown_menu) eina_stringshare_del(cfg->effect_policy_dropdown_menu); + if (cfg->effect_policy_popup_menu) eina_stringshare_del(cfg->effect_policy_popup_menu); + if (cfg->effect_policy_tooltip) eina_stringshare_del(cfg->effect_policy_tooltip); + if (cfg->effect_policy_notification) eina_stringshare_del(cfg->effect_policy_notification); + if (cfg->effect_policy_combo) eina_stringshare_del(cfg->effect_policy_combo); + if (cfg->effect_policy_dnd) eina_stringshare_del(cfg->effect_policy_dnd); + if (cfg->effect_policy_menuscreen) eina_stringshare_del(cfg->effect_policy_menuscreen); + if (cfg->effect_policy_quickpanel_base) eina_stringshare_del(cfg->effect_policy_quickpanel_base); + if (cfg->effect_policy_quickpanel) eina_stringshare_del(cfg->effect_policy_quickpanel); + if (cfg->effect_policy_taskmanager) eina_stringshare_del(cfg->effect_policy_taskmanager); + if (cfg->effect_policy_livemagazine) eina_stringshare_del(cfg->effect_policy_livemagazine); + if (cfg->effect_policy_lockscreen) eina_stringshare_del(cfg->effect_policy_lockscreen); + if (cfg->effect_policy_indicator) eina_stringshare_del(cfg->effect_policy_indicator); + if (cfg->effect_policy_tickernoti) eina_stringshare_del(cfg->effect_policy_tickernoti); + if (cfg->effect_policy_debugging_info) eina_stringshare_del(cfg->effect_policy_debugging_info); + if (cfg->effect_policy_apptray) eina_stringshare_del(cfg->effect_policy_apptray); + if (cfg->effect_policy_mini_apptray) eina_stringshare_del(cfg->effect_policy_mini_apptray); + if (cfg->effect_policy_volume) eina_stringshare_del(cfg->effect_policy_volume); + if (cfg->effect_policy_background) eina_stringshare_del(cfg->effect_policy_background); + if (cfg->effect_policy_isf_keyboard) eina_stringshare_del(cfg->effect_policy_isf_keyboard); + if (cfg->effect_policy_isf_sub) eina_stringshare_del(cfg->effect_policy_isf_sub); + if (cfg->effect_policy_setup_wizard) eina_stringshare_del(cfg->effect_policy_setup_wizard); + if (cfg->effect_policy_toast) eina_stringshare_del(cfg->effect_policy_toast); + if (cfg->effect_policy_app_popup) eina_stringshare_del(cfg->effect_policy_app_popup); + + free(cfg); + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_xv_rot_begin(Ecore_X_Event_Client_Message* ev) +{ + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + + E_CHECK_RETURN(ev, 0); + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (!canvas) continue; + if ((canvas->zr) && (canvas->xv_ready[0])) + canvas->comp->effect_funcs.zone_rotation_begin(canvas->zr); + break; + } + } + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_xv_rot_end(Ecore_X_Event_Client_Message *ev) +{ + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + + E_CHECK_RETURN(ev, 0); + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (!canvas) continue; + if (canvas->zr) + { + if (canvas->xv_ready[0]) + { + canvas->xv_ready[2] = EINA_TRUE; + if (!canvas->xv_ready[1]) + break; + } + Eina_Bool res = canvas->comp->effect_funcs.zone_rotation_end(canvas->zr); + if (res) + canvas->comp->effect_funcs.zone_rotation_do(canvas->zr); + else + canvas->comp->effect_funcs.zone_rotation_clear(canvas->zr); + } + break; + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_message(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Client_Message *ev; + Ecore_X_Atom t; + E_Comp *c; + ev = (Ecore_X_Event_Client_Message *)event; + c = e_mod_comp_util_get(); + + E_CHECK_RETURN(c, 0); + E_CHECK_RETURN(ev, 0); + E_CHECK_RETURN((ev->format == 32), 0); + + t = ev->message_type; + + if (t == ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE ) _e_mod_comp_msg_sync_draw_done(ev); + else if (t == ECORE_X_ATOM_NET_ACTIVE_WINDOW ) _e_mod_comp_active_request_handle(ev); + else if (t == ATOM_CM_LOCK_SCREEN ) e_mod_comp_screen_lock_handler_message(ev); + else if (t == ATOM_X_HIBERNATION_STATE ) _e_mod_comp_hib_leave(ev); + else if (t == ATOM_IMAGE_LAUNCH_FILE ) c->effect_funcs.image_launch_handler_message(ev); + else if (t == ATOM_XV_BYPASS_DONE0 ) _e_mod_comp_xv_rot_begin(ev); + else if (t == ATOM_XV_BYPASS_DONE1 ) _e_mod_comp_xv_rot_end(ev); + else if (t == ATOM_CM_MSG_STEREO_MODE ) _e_mod_comp_msg_stereo_mode_changed(ev); +#ifdef _F_IGNORE_DMG_HIDE_ + else if (t == ECORE_X_ATOM_E_DEICONIFY_APPROVE ) _e_mod_comp_msg_deiconify_approve(ev); +#endif + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_shape(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Shape *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + if (ev->type != ECORE_X_SHAPE_BOUNDING) return ECORE_CALLBACK_PASS_ON; + _e_mod_comp_win_reshape(cw); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_damage(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Damage *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_damage_find(ev->damage); + + if (!cw) + { + ELBF(ELBT_COMP_RENDER, 0, ev->drawable, + "%15.15s|%4d %4d %3dx%3d ERR NO cw (ev->damage)", "DMG", + ev->area.x, ev->area.y, ev->area.width, ev->area.height); + cw = _e_mod_comp_border_client_find(ev->drawable); + + if (!cw) + { + ELBF(ELBT_COMP_RENDER, 0, ev->drawable, + "%15.15s|%4d %4d %3dx%3d ERR NO cw (ev->drawable)", "DMG", + ev->area.x, ev->area.y, ev->area.width, ev->area.height); + return ECORE_CALLBACK_PASS_ON; + } + } + + ELBF(ELBT_COMP_RENDER, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|%4d %4d %3dx%3d", "DMG", + ev->area.x, ev->area.y, ev->area.width, ev->area.height); + + _e_mod_comp_win_damage(cw, + ev->area.x, ev->area.y, + ev->area.width, ev->area.height, 1); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_damage_win(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_X_Event_Window_Damage *ev = event; + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + + // fixme: use hash if compositors list > 4 + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (!canvas) continue; + if (ev->win == canvas->ee_win) + { + // expose on comp win - init win or some other bypass win did it + _e_mod_comp_render_queue(c); + break; + } + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_randr(void *data __UNUSED__, + int type __UNUSED__, + void *event __UNUSED__) +{ + Eina_List *l; + E_Comp *c; + E_Comp_Canvas *canvas; + + ELB(ELBT_COMP, "E_CONTNR_RESIZE", 0); + + if (_comp_mod->conf->canvas_per_zone) + return ECORE_CALLBACK_PASS_ON; + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + canvas = eina_list_data_get(c->canvases); + if (!canvas) continue; + ecore_evas_resize(canvas->ee, + c->man->w, + c->man->h); + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_add(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Add *ev = event; + Eina_List *l; + E_Comp_Win *cw; + E_Comp_Canvas *canvas; + E_Comp* c = _e_mod_comp_find(ev->border->zone->container->manager->root); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x", "BD_ADD", ev->border->win); + + if (!c) return ECORE_CALLBACK_PASS_ON; + if (_e_mod_comp_win_find(ev->border->win)) return ECORE_CALLBACK_PASS_ON; + if (c->win == ev->border->win) return ECORE_CALLBACK_PASS_ON; + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (canvas->ee_win == ev->border->win) return ECORE_CALLBACK_PASS_ON; + } + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:BORDER ADD"); + cw = _e_mod_comp_win_add(c, ev->border->win); + if (!cw) + { + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_PASS_ON; + } + + _e_mod_comp_win_configure + (cw, ev->border->x, ev->border->y, + ev->border->w, ev->border->h, + ev->border->client.initial_attributes.border); + + if (ev->border->internal && ev->border->visible) + _e_mod_comp_win_show(cw); + + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_del(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Remove *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x cw:%p", "BD_DEL", ev->border->win, cw); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:BORDER DEL"); + if (cw->bd == ev->border) + { + if (e_mod_comp_policy_app_close_check(cw)) + cw->c->effect_funcs.signal_add(cw, NULL, "e,state,visible,off,noeffect", "e"); + + _e_mod_comp_object_del(cw, ev->border); + } + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_show(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Show *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x cw:%p", "BD_SHOW", ev->border->win, cw); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + if (cw->visible) return ECORE_CALLBACK_PASS_ON; + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:BORDER SHOW"); + _e_mod_comp_win_show(cw); + + unsigned int state = ev->border->client.illume.win_state.state; + if (state == ECORE_X_ILLUME_WINDOW_STATE_NORMAL) + _e_mod_comp_shadow_set(cw, EINA_FALSE); + else if ((state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) || + (state == ECORE_X_ILLUME_WINDOW_STATE_ASSISTANT_MENU)) + _e_mod_comp_shadow_set(cw, EINA_TRUE); + + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_hide(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Hide *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x cw:%p", "BD_HIDE", ev->border->win, cw); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + if (!cw->visible) return ECORE_CALLBACK_PASS_ON; + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:BORDER HIDE"); + _e_mod_comp_win_hide(cw); + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_move(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Move *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|cw[%dx%d] hidden[%d,%d] ev[%d,%d]", "BD_MOVE", + cw->x, cw->y, cw->hidden.x, cw->hidden.y, + ev->border->x, ev->border->y); + SLOGI("%15.15s|(0x%08x)cw[%dx%d] hidden[%d,%d] ev[%d,%d]", "BD_MOVE", ev->border->client.win, + cw->x, cw->y, cw->hidden.x, cw->hidden.y, + ev->border->x, ev->border->y); + + if (_comp_mod->conf->use_hwc) + { + if ((STATE_INSET_CHECK(cw)) || + CLASS_ICONIC_CHECK(cw)) + cw->hwc.geo_changed = 3; + } + + if (!((cw->x == ev->border->x) && + (cw->y == ev->border->y)) && + (cw->visible)) + { + _e_mod_comp_win_configure + (cw, ev->border->x, ev->border->y, + ev->border->w, ev->border->h, 0); +#if OPTIMIZED_HWC_MOBILE + if (_comp_mod->conf->use_hwc && !cw->hwc.resize_pending) + { + cw->hwc.resize_pending = 1; + } +#endif + } + else if (!((cw->hidden.x == ev->border->x) && + (cw->hidden.y == ev->border->y)) && + (!cw->visible)) + { + _e_mod_comp_win_configure + (cw, ev->border->x, ev->border->y, + ev->border->w, ev->border->h, 0); + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_resize(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Resize *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|%4dx%4d", "BD_RESIZE", + ev->border->w, ev->border->h); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + if ((cw->w == ev->border->w) && (cw->h == ev->border->h)) + return ECORE_CALLBACK_PASS_ON; + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:BORDER RESIZE"); + _e_mod_comp_win_configure + (cw, ev->border->x, ev->border->y, + ev->border->w, ev->border->h, cw->border); + +#if OPTIMIZED_HWC_MOBILE + if (_comp_mod->conf->use_hwc) + { + cw->hwc.resize_pending = 1; + } +#endif + + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_iconify(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Iconify *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x", "BD_ICONIFY", ev->border->win); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_uniconify(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Uniconify *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x", "BD_UNICONIFY", ev->border->win); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_focus_in(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Focus_In *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x", "BD_FOCUS_IN", ev->border->win); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_focus_out(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Focus_Out *ev = event; + E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win); + + ELBF(ELBT_COMP, 0, ev->border->client.win, + "%15.15s|bd:0x%08x", "BD_FOCUS_OUT", ev->border->win); + + if (!cw) return ECORE_CALLBACK_PASS_ON; + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_bd_stack(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Border_Stack *ev = event; + E_Comp_Win *cw, *cw2 = NULL; + if (!ev->border) return ECORE_CALLBACK_PASS_ON; + + cw = _e_mod_comp_win_find(ev->border->win); + if (!cw) return ECORE_CALLBACK_PASS_ON; + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:BORDER STACK"); + + if (ev->stack) + { + cw2 = _e_mod_comp_win_find(ev->stack->win); + /* there is no cw yet, thus put off doing it. */ + if (!cw2) return ECORE_CALLBACK_PASS_ON; + } + + if (ev->type == E_STACKING_BELOW) + { + if (cw2) + { + /* LOWER BELOW + * if user selects back icon of the application, then this event + * is occured first. thus we use this event for showing application + * hide effect. + * visible -> invisible + */ + + /* check visibility of cw before and after */ + Eina_Bool v1 = EINA_FALSE, v2 = EINA_FALSE; + E_Comp *c = cw->c; + E_Comp_Win *cw3 = NULL; + + v1 = e_mod_comp_util_win_visible_get(cw, EINA_TRUE); + if (v1) + { + cw3 = (E_Comp_Win *)(EINA_INLIST_GET(cw)->prev); + + c->wins = eina_inlist_remove(c->wins, EINA_INLIST_GET(cw)); + c->wins = eina_inlist_prepend_relative(c->wins, + EINA_INLIST_GET(cw), + EINA_INLIST_GET(cw2)); + + v2 = e_mod_comp_util_win_visible_get(cw, EINA_TRUE); + + /* restore c->wins */ + if (cw3) + { + c->wins = eina_inlist_remove(c->wins, EINA_INLIST_GET(cw)); + c->wins = eina_inlist_append_relative(c->wins, + EINA_INLIST_GET(cw), + EINA_INLIST_GET(cw3)); + } + else + { + c->wins = eina_inlist_remove(c->wins, EINA_INLIST_GET(cw)); + c->wins = eina_inlist_prepend(c->wins, EINA_INLIST_GET(cw)); + } + } + + /* TODO: try to check visibility of cw without changing c->wins */ + //v2 = e_mod_comp_util_win_visible_below_get(cw, cw2); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|LOWER_BELOW 0x%08x v:%d->%d", "BD_STACK", + e_mod_comp_util_client_xid_get(cw2), v1, v2); + + /* do hide effect if visibility of cw will be changed to invisible from visible */ + if ((v1) && (!v2)) + cw->c->effect_funcs.win_restack(cw, EINA_TRUE, EINA_FALSE); + } + } + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_key_down(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + Ecore_Event_Key *ev = (Ecore_Event_Key *)event; + E_CHECK_RETURN(ev, 0); + + if ((!strcmp(ev->keyname, "Home")) && + (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) && + (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL) && + (ev->modifiers & ECORE_EVENT_MODIFIER_ALT)) + { + if (_comp_mod) + { + _e_mod_config_free(_comp_mod->module); + _e_mod_config_new(_comp_mod->module); + e_config_save(); + e_module_disable(_comp_mod->module); + e_config_save(); + e_sys_action_do(E_SYS_RESTART, NULL); + } + } + return ECORE_CALLBACK_PASS_ON; +} + +////////////////////////////////////////////////////////////////////////// +static Evas * +_e_mod_comp_evas_get_func(void *data, + E_Manager *man __UNUSED__) +{ + E_Comp *c = (E_Comp *)data; + Eina_List *l; + E_Comp_Canvas *canvas; + E_Zone *z; + E_CHECK_RETURN(c, 0); + + z = e_util_zone_current_get(c->man); + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!_comp_mod->conf->canvas_per_zone) + return canvas->evas; + else if ((canvas->zone) && (canvas->zone == z)) + return canvas->evas; + } + return NULL; +} + +static void +_e_mod_comp_update_func(void *data, + E_Manager *man __UNUSED__) +{ + E_Comp *c = (E_Comp *)data; + E_CHECK(c); + _e_mod_comp_render_queue(c); +} + +static E_Manager_Comp_Source * +_e_mod_comp_src_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + Ecore_X_Window win) +{ + return (E_Manager_Comp_Source *)_e_mod_comp_win_find(win); +} + +static const Eina_List * +_e_mod_comp_src_list_get_func(void *data, + E_Manager *man __UNUSED__) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Win *cw; + Eina_List *l; + E_Comp_Object *co; + E_CHECK_RETURN(c, 0); + E_CHECK_RETURN(c->wins, 0); + + // source list should always be updated if multi-canvas is enabled. + if (_comp_mod->conf->canvas_per_zone) + { + if (c->wins_invalid) c->wins_invalid = 0; + if (c->wins_list) + { + eina_list_free(c->wins_list); + c->wins_list = NULL; + } + E_Zone *z = e_util_zone_current_get(c->man); + EINA_INLIST_FOREACH(c->wins, cw) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + if ((co->shadow) && (co->img) && (z == co->zone)) + c->wins_list = eina_list_append(c->wins_list, cw); + } + } + } + else + { + if (c->wins_invalid) + { + c->wins_invalid = 0; + if (c->wins_list) + { + eina_list_free(c->wins_list); + c->wins_list = NULL; + } + EINA_INLIST_FOREACH(c->wins, cw) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + if ((co->shadow) && (co->img)) + c->wins_list = eina_list_append(c->wins_list, cw); + } + } + } + } + return c->wins_list; +} + +static Evas_Object * +_e_mod_comp_src_image_get_func(void *data, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Win *cw = (E_Comp_Win *)src; + Eina_List *l; + E_Comp_Object *co; + E_Zone *z; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + + if (cw->bd) z = cw->bd->zone; + else z = e_util_zone_current_get(c->man); + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!_comp_mod->conf->canvas_per_zone) + return co->img; + else if ((co->zone) && (co->zone == z)) + return co->img; + } + return NULL; +} + +static Evas_Object * +_e_mod_comp_src_shadow_get_func(void *data, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Win *cw = (E_Comp_Win *)src; + Eina_List *l; + E_Comp_Object *co; + E_Zone *z; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + + if (cw->bd) z = cw->bd->zone; + else z = e_util_zone_current_get(c->man); + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!_comp_mod->conf->canvas_per_zone) + return co->shadow; + else if ((co->zone) && (co->zone == z)) + return co->shadow; + } + return NULL; +} + +static Evas_Object * +_e_mod_comp_src_image_mirror_add_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + E_CHECK_GOTO(_comp_mod->conf->nocomp_fs, end); + + EINA_LIST_FOREACH(cw->c->canvases, l, canvas) + { + if (canvas->nocomp.mode != E_NOCOMP_MODE_RUN) continue; + if (cw != canvas->nocomp.cw) continue; + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| END MIRROR_ADD", "NOCOMP"); + + e_mod_comp_canvas_nocomp_end(canvas); + } +end: + return _e_mod_comp_win_mirror_add(cw); +} + +static Eina_Bool +_e_mod_comp_src_visible_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + return cw->visible; +} + +static void +_e_mod_comp_src_hidden_set_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src, + Eina_Bool hidden) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + Eina_List *l; + E_Comp_Object *co; + E_CHECK(cw); + E_CHECK(cw->c); + if (cw->hidden_override == hidden) return; + cw->hidden_override = hidden; + if (cw->bd) + e_border_comp_hidden_set(cw->bd, + cw->hidden_override); + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (cw->visible) + { + if (cw->hidden_override) + evas_object_hide(co->shadow); + else if (!cw->bd || + (cw->bd->visible && cw->show_done)) + evas_object_show(co->shadow); + } + else + { + if (cw->hidden_override) + evas_object_hide(co->shadow); + } + } +} + +static Eina_Bool +_e_mod_comp_src_hidden_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + return cw->hidden_override; +} + +static E_Popup * +_e_mod_comp_src_popup_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + return cw->pop; +} + +static E_Border * +_e_mod_comp_src_border_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + return cw->bd; +} + +static Ecore_X_Window +_e_mod_comp_src_window_get_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + return cw->win; +} + +static Eina_Bool +_e_mod_comp_src_input_region_set_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src, + int x, + int y, + int w, + int h) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + Eina_Bool res = EINA_FALSE; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->c, 0); + + if (!cw->shape_input) + cw->shape_input = e_mod_comp_win_shape_input_new(cw); + E_CHECK_RETURN(cw->shape_input, 0); + + res = e_mod_comp_win_shape_input_rect_set(cw->shape_input, x, y, w, h); + E_CHECK_RETURN(res, 0); + + e_mod_comp_win_shape_input_invalid_set(cw->c, 1); + _e_mod_comp_win_render_queue(cw); + return EINA_TRUE; +} + +static int +_e_mod_comp_input_region_new_func(void *data __UNUSED__, + E_Manager *man __UNUSED__) +{ + E_Comp *c = e_mod_comp_util_get(); + E_CHECK_RETURN(c, 0); + + return e_mod_comp_shape_input_new(c); +} + +static Eina_Bool +_e_mod_comp_input_region_set_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + int id, + int x, + int y, + int w, + int h) +{ + E_Comp *c = e_mod_comp_util_get(); + Eina_Bool res = EINA_FALSE; + E_CHECK_RETURN(c, EINA_FALSE); + + if (id <= 0) return EINA_FALSE; + + res = e_mod_comp_shape_input_set(c, id, x, y, w, h); + if (res) + { + e_mod_comp_win_shape_input_invalid_set(c, 1); + _e_mod_comp_render_queue(c); + } + + return res; +} + +static Eina_Bool +_e_mod_comp_input_region_managed_set_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + int id, + Evas_Object *obj, + Eina_Bool set) +{ + E_Comp *c = e_mod_comp_util_get(); + Eina_Bool res = EINA_FALSE; + E_CHECK_RETURN(c, EINA_FALSE); + + if (id <= 0) return EINA_FALSE; + + res = e_mod_comp_shape_input_managed_set(c, id, obj, set); + if (res) + { + e_mod_comp_win_shape_input_invalid_set(c, 1); + _e_mod_comp_render_queue(c); + } + + return EINA_TRUE; +} + +static Eina_Bool +_e_mod_comp_input_region_del_func(void *data __UNUSED__, + E_Manager *man __UNUSED__, + int id) +{ + E_Comp *c = e_mod_comp_util_get(); + Eina_Bool res = EINA_FALSE; + E_CHECK_RETURN(c, 0); + + if (id <= 0) return EINA_FALSE; + + res = e_mod_comp_shape_input_del(c, id); + if (res) + { + e_mod_comp_win_shape_input_invalid_set(c, 1); + _e_mod_comp_render_queue(c); + } + return res; +} + +static void +_e_mod_comp_composite_mode_set(void *data, + E_Manager *man __UNUSED__, + E_Zone *zone, + Eina_Bool set) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Canvas *canvas; + Eina_List *l; + E_CHECK(c); + + if (_comp_mod->conf->use_hwc) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone != zone) continue; + + if ((canvas->hwcomp) && (c->hwcomp_funcs.force_composite_set)) + c->hwcomp_funcs.force_composite_set(canvas->hwcomp, set); + + if (set) + _e_mod_comp_render_queue(c); + } + } + + E_CHECK(_comp_mod->conf->nocomp_fs); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone == zone) + { + if (set) + { + canvas->nocomp.comp_ref++; + + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_NOCOMP, + ">> %d COMP REQUEST ref:%d", canvas->num, + canvas->nocomp.comp_ref); + + if (!canvas->nocomp.force_composite) + { + canvas->nocomp.force_composite = set; + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_NOCOMP, + ">> %d COMP REQUEST", canvas->num); + + if (canvas->nocomp.cw) + { + canvas->nocomp.cw->update = 1; + c->updates = eina_list_append(c->updates, canvas->nocomp.cw); + _e_mod_comp_win_render_queue(canvas->nocomp.cw); + } + else + { + _e_mod_comp_render_queue(c); + } + } + } + else + { + canvas->nocomp.comp_ref--; + if (canvas->nocomp.comp_ref < 0) + canvas->nocomp.comp_ref = 0; + + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_NOCOMP, + ">> %d NOCOMP REQUEST ref:%d", canvas->num, + canvas->nocomp.comp_ref); + + if ((canvas->nocomp.comp_ref == 0) && + (canvas->nocomp.force_composite)) + { + canvas->nocomp.force_composite = EINA_FALSE; + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_NOCOMP, + ">> %d NOCOMP REQUEST", canvas->num); + } + } + break; + } + } +} + +static Eina_Bool +_e_mod_comp_composite_mode_get(void *data, + E_Manager *man __UNUSED__, + E_Zone *zone) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Canvas *canvas; + Eina_List *l; + + E_CHECK_RETURN(_comp_mod->conf->nocomp_fs, 1); + E_CHECK_RETURN(c, 1); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone == zone) + { + if (canvas->nocomp.mode == E_NOCOMP_MODE_RUN) + return EINA_FALSE; + else + return EINA_TRUE; + } + } + return EINA_TRUE; +} + +static void +_e_mod_comp_src_shadow_show_func(void *data, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_CHECK(cw); + E_CHECK(cw->c); + + _e_mod_comp_win_show(cw); +} + +static void +_e_mod_comp_src_shadow_hide_func(void *data, + E_Manager *man __UNUSED__, + E_Manager_Comp_Source *src) +{ + E_Comp_Win *cw = (E_Comp_Win *)src; + E_CHECK(cw); + E_CHECK(cw->c); + + _e_mod_comp_win_hide(cw); +} + +static Evas_Object * +_e_mod_comp_layer_get_func(void *data, + E_Manager *man __UNUSED__, + E_Zone *zone, + const char *name) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Canvas *canvas = NULL; + E_Comp_Layer *ly = NULL; + Eina_List *l; + + E_CHECK_RETURN(c, NULL); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone == zone) + { + ly = e_mod_comp_canvas_layer_get(canvas, name); + if ((ly) && (!strcmp(name, "ly-ctrl")) && (ly->need_init)) + { + E_Comp_Layer *comp_ly = e_mod_comp_canvas_layer_get(canvas, "comp"); + if (comp_ly) + { + ly->need_init = EINA_FALSE; + + e_layout_pack(comp_ly->layout, ly->layout); + e_mod_comp_layer_populate_above_normal(comp_ly, ly->layout); + e_mod_comp_layer_bg_adjust(ly); + } + } + + if (ly) return ly->layout; + break; + } + } + + return NULL; +} + +static void +_e_mod_comp_layer_raise_above_func(void *data, + E_Manager *man __UNUSED__, + E_Zone *zone, + const char *name, + E_Border *bd) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Canvas *canvas = NULL; + E_Comp_Layer *ly = NULL; + Eina_List *l; + + E_CHECK(c); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone == zone) + { + ly = e_mod_comp_canvas_layer_get(canvas, name); + if (!ly) return; + e_mod_comp_layer_raise_above(canvas, ly->layout, bd); + } + } +} + +static void +_e_mod_comp_layer_lower_below_func(void *data, + E_Manager *man __UNUSED__, + E_Zone *zone, + const char *name, + E_Border *bd) +{ + E_Comp *c = (E_Comp *)data; + E_Comp_Canvas *canvas = NULL; + E_Comp_Layer *ly = NULL; + Eina_List *l; + + E_CHECK(c); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone == zone) + { + ly = e_mod_comp_canvas_layer_get(canvas, name); + if (!ly) return; + e_mod_comp_layer_lower_below(canvas, ly->layout, bd); + } + } +} + +static E_Comp * +_e_mod_comp_add(E_Manager *man) +{ + E_Comp *c; + Ecore_X_Window *wins; + Ecore_X_Window_Attributes att; + Eina_Bool res; + int i, num; + + E_Container *con; + E_Zone *zone; + E_Comp_Canvas *canvas; + Eina_List *l, *ll; + + c = E_NEW(E_Comp, 1); + E_CHECK_RETURN(c, NULL); + + res = ecore_x_screen_is_composited(man->num); + if (res) + { + e_util_dialog_internal + (_("Compositor Error"), + _("Another compositor is already running
" + "on your screen.")); + free(c); + return NULL; + } + + c->cm_selection = ecore_x_window_input_new(man->root, 0, 0, 1, 1); + if (!c->cm_selection) + { + free(c); + return NULL; + } + ecore_x_screen_is_composited_set(man->num, c->cm_selection); + + ecore_x_e_comp_sync_supported_set(man->root, _comp_mod->conf->efl_sync); + + c->man = man; + c->win = ecore_x_composite_render_window_enable(man->root); + if (!c->win) + { + e_util_dialog_internal + (_("Compositor Error"), + _("Your screen does not support the compositor
" + "overlay window. This is needed for it to
" + "function.")); + E_FREE(c); + return NULL; + } + + memset((&att), 0, sizeof(Ecore_X_Window_Attributes)); + ecore_x_window_attributes_get(c->win, &att); + + if ((att.depth != 24) && (att.depth != 32)) + { + e_util_dialog_internal + (_("Compositor Error"), + _("Your screen is not in 24/32bit display mode.
" + "This is required to be your default depth
" + "setting for the compositor to work properly.")); + ecore_x_composite_render_window_disable(c->win); + E_FREE(c); + return NULL; + } + + if (c->man->num == 0) e_alert_composite_win = c->win; + + e_mod_comp_screen_lock_init(&(c->lock)); + + if (!_e_mod_comp_effect_init(c)) + { + e_util_dialog_internal + (_("Compositor Error"), + _(" Effect failed to initialize.")); + ecore_x_composite_render_window_disable(c->win); + E_FREE(c); + return NULL; + } + + if (!_e_mod_comp_hwcomp_init(c)) + { + ELBF(ELBT_COMP, 0, 0, "HWComp INIT FAIL: %s", + ecore_file_file_get(_comp_mod->conf->hwcomp_file)); + } + + if (_comp_mod->conf->canvas_per_zone) + { + EINA_LIST_FOREACH(man->containers, l, con) + { + EINA_LIST_FOREACH(con->zones, ll, zone) + { + if (!zone) continue; + canvas = e_mod_comp_canvas_add(c, zone); + if (!canvas) + { + ecore_x_composite_render_window_disable(c->win); + E_FREE(c); + return NULL; + } + else + { + if (_comp_mod->conf->stand_by_canvas_render_enable) + { + ELBF(ELBT_COMP, 0, 0, "STAND BY CANVAS RENDER"); + c->stand_by_canvas_render = 1; + ecore_evas_manual_render_set(canvas->ee, 1); + } + } + + } + } + } + else + { + canvas = e_mod_comp_canvas_add(c, NULL); + if (!canvas) + { + ecore_x_composite_render_window_disable(c->win); + E_FREE(c); + return NULL; + } + else + { + if (_comp_mod->conf->stand_by_canvas_render_enable) + { + ELBF(ELBT_COMP, 0, 0, "STAND BY CANVAS RENDER"); + c->stand_by_canvas_render = 1; + ecore_evas_manual_render_set(canvas->ee, 1); + } + } + } + + if (_comp_mod->conf->keyboard_effect) c->keyboard_effect = EINA_TRUE; + if (_comp_mod->conf->defer_raise_effect) c->defer_raise_effect = EINA_TRUE; + if (_comp_mod->conf->fake_image_launch) c->fake_image_launch = EINA_TRUE; + + ecore_x_composite_redirect_subwindows + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + + wins = ecore_x_window_children_get(c->man->root, &num); + if (wins) + { + for (i = 0; i < num; i++) + { + E_Comp_Win *cw; + int x, y, w, h, border; + char *wname = NULL, *wclass = NULL; + + ecore_x_icccm_name_class_get(wins[i], &wname, &wclass); + if ((man->initwin == wins[i]) || + ((wname) && (wclass) && (!strcmp(wname, "E")) && + (!strcmp(wclass, "Init_Window")))) + { + free(wname); + free(wclass); + ecore_x_window_reparent(wins[i], c->win, 0, 0); + ecore_x_sync(); + continue; + } + if (wname) free(wname); + if (wclass) free(wclass); + wname = wclass = NULL; + cw = _e_mod_comp_win_add(c, wins[i]); + if (!cw) continue; + if (i == _comp_mod->conf->lower_layer) + c->lower_win = cw; + ecore_x_window_geometry_get(cw->win, &x, &y, &w, &h); + border = ecore_x_window_border_width_get(cw->win); + if (wins[i] == c->win) continue; + _e_mod_comp_win_configure(cw, x, y, w, h, border); + if (ecore_x_window_visible_get(wins[i])) + _e_mod_comp_win_show(cw); + } + free(wins); + } + + ecore_x_window_key_grab + (c->man->root, "Home", + ECORE_EVENT_MODIFIER_SHIFT | + ECORE_EVENT_MODIFIER_CTRL | + ECORE_EVENT_MODIFIER_ALT, 0); + ecore_x_window_key_grab + (c->man->root, "F", + ECORE_EVENT_MODIFIER_SHIFT | + ECORE_EVENT_MODIFIER_CTRL | + ECORE_EVENT_MODIFIER_ALT, 0); + + c->comp.data = c; + c->comp.func.evas_get = _e_mod_comp_evas_get_func; + c->comp.func.update = _e_mod_comp_update_func; + c->comp.func.src_get = _e_mod_comp_src_get_func; + c->comp.func.src_list_get = _e_mod_comp_src_list_get_func; + c->comp.func.src_image_get = _e_mod_comp_src_image_get_func; + c->comp.func.src_shadow_get = _e_mod_comp_src_shadow_get_func; + c->comp.func.src_image_mirror_add = _e_mod_comp_src_image_mirror_add_func; + c->comp.func.src_visible_get = _e_mod_comp_src_visible_get_func; + c->comp.func.src_hidden_set = _e_mod_comp_src_hidden_set_func; + c->comp.func.src_hidden_get = _e_mod_comp_src_hidden_get_func; + c->comp.func.src_window_get = _e_mod_comp_src_window_get_func; + c->comp.func.src_border_get = _e_mod_comp_src_border_get_func; + c->comp.func.src_popup_get = _e_mod_comp_src_popup_get_func; + c->comp.func.screen_lock = e_mod_comp_screen_lock_func; + c->comp.func.screen_unlock = e_mod_comp_screen_unlock_func; + c->comp.func.src_input_region_set = _e_mod_comp_src_input_region_set_func; + c->comp.func.input_region_new = _e_mod_comp_input_region_new_func; + c->comp.func.input_region_set = _e_mod_comp_input_region_set_func; + c->comp.func.input_region_managed_set = _e_mod_comp_input_region_managed_set_func; + c->comp.func.input_region_del = _e_mod_comp_input_region_del_func; + c->comp.func.src_move_lock = NULL; /* deprecated */ + c->comp.func.src_move_unlock = NULL; /* deprecated */ + c->comp.func.composite_mode_set = _e_mod_comp_composite_mode_set; + c->comp.func.composite_mode_get = _e_mod_comp_composite_mode_get; + c->comp.func.src_shadow_show = _e_mod_comp_src_shadow_show_func; + c->comp.func.src_shadow_hide = _e_mod_comp_src_shadow_hide_func; + c->comp.func.layer_get = _e_mod_comp_layer_get_func; + c->comp.func.layer_raise_above = _e_mod_comp_layer_raise_above_func; + c->comp.func.layer_lower_below = _e_mod_comp_layer_lower_below_func; + + e_manager_comp_set(c->man, &(c->comp)); + return c; +} + +static void +_e_mod_comp_del(E_Comp *c) +{ + E_Comp_Win *cw; + E_Comp_Canvas *canvas; + + e_manager_comp_set(c->man, NULL); + + ecore_x_window_key_ungrab + (c->man->root, "F", + ECORE_EVENT_MODIFIER_SHIFT | + ECORE_EVENT_MODIFIER_CTRL | + ECORE_EVENT_MODIFIER_ALT, 0); + ecore_x_window_key_ungrab + (c->man->root, "Home", + ECORE_EVENT_MODIFIER_SHIFT | + ECORE_EVENT_MODIFIER_CTRL | + ECORE_EVENT_MODIFIER_ALT, 0); + + e_mod_comp_x_grab_set(c, EINA_FALSE); + + if((c->fake_image_launch) && (c->eff_img)) + c->effect_funcs.image_launch_free(c->eff_img); + + while (c->wins) + { + cw = (E_Comp_Win *)(c->wins); + if (cw->counter) + { + ecore_x_sync_counter_free(cw->counter); + cw->counter = 0; + cw->sync_info.val = 0; + } + cw->force = 1; + _e_mod_comp_win_hide(cw); + cw->force = 1; + _e_mod_comp_win_del(cw); + } + + EINA_LIST_FREE(c->canvases, canvas) e_mod_comp_canvas_del(canvas); + c->canvases = NULL; + + ecore_x_composite_unredirect_subwindows + (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); + ecore_x_composite_render_window_disable(c->win); + if (c->man->num == 0) e_alert_composite_win = 0; + if (c->render_animator) ecore_animator_del(c->render_animator); + if (c->new_up_timer) ecore_timer_del(c->new_up_timer); + if (c->update_job) ecore_job_del(c->update_job); + if (c->wins_list) eina_list_free(c->wins_list); + + ecore_x_window_free(c->cm_selection); + ecore_x_e_comp_sync_supported_set(c->man->root, 0); + ecore_x_screen_is_composited_set(c->man->num, 0); + + if (c->shape_inputs) eina_list_free(c->shape_inputs); + if (c->shape_inputs_mo) eina_list_free(c->shape_inputs_mo); + + c->effect_funcs.shutdown(c); + + free(c); +} + +/////////////////////////////////////////////////////////////////////////////////////////// +static Eina_Bool +_e_mod_comp_zone_move_resize(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Zone_Move_Resize *ev = (E_Event_Zone_Move_Resize *)event; + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + if (!(ev && ev->zone)) + return ECORE_CALLBACK_PASS_ON; + + if (!_comp_mod->conf->canvas_per_zone) + return ECORE_CALLBACK_PASS_ON; + + ELB(ELBT_COMP, "E_ZONE_MOVE_RESIZE", ev->zone->id); + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (!canvas) continue; + if (canvas->zone != ev->zone) continue; + if (!((ev->zone->x == canvas->x) && + (ev->zone->y == canvas->y))) + { + canvas->x = ev->zone->x; + canvas->y = ev->zone->y; + ecore_evas_move(canvas->ee, + canvas->x, + canvas->y); + } + if (!((ev->zone->w == canvas->w) && + (ev->zone->h == canvas->h))) + { + canvas->w = ev->zone->w; + canvas->h = ev->zone->h; + ecore_evas_resize(canvas->ee, + canvas->w, + canvas->h); + } + break; + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_zone_add(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Zone_Add *ev = (E_Event_Zone_Add *)event; + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + E_Comp_Win *cw; + E_Comp_Object *co; + Eina_Bool found = EINA_FALSE; + if ((!ev) || (!ev->zone) || + (!ev->zone->container)) + { + return ECORE_CALLBACK_PASS_ON; + } + if (!_comp_mod->conf->canvas_per_zone) + { + return ECORE_CALLBACK_PASS_ON; + } + + EINA_LIST_FOREACH(compositors, l, c) + { + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (canvas->zone == ev->zone) + { + found = EINA_TRUE; + break; + } + } + } + + if (found) return ECORE_CALLBACK_PASS_ON; + + ELB(ELBT_COMP, "E_ZONE_ADD", ev->zone->id); + + EINA_LIST_FOREACH(compositors, l, c) + { + if ((!c) || (c->man != ev->zone->container->manager)) + { + continue; + } + + canvas = e_mod_comp_canvas_add(c, ev->zone); + if (!canvas) return ECORE_CALLBACK_PASS_ON; + + ecore_x_window_shape_rectangle_add(c->win, + canvas->zone->x, + canvas->zone->y, + canvas->zone->w, + canvas->zone->h); + ecore_x_sync(); + + EINA_INLIST_FOREACH(c->wins, cw) + { + Eina_Bool found = EINA_FALSE; + Eina_List *lll; + E_Comp_Canvas *_canvas; + EINA_LIST_FOREACH(c->canvases, lll, _canvas) + { + if (_canvas->ee_win == cw->win) + { + found = 1; + break; + } + } + + co = e_mod_comp_obj_add(cw, canvas); + if (!co) continue; + + cw->objs = eina_list_append(cw->objs, co); + + if ((!cw->input_only) && (!cw->invalid)) + { + e_mod_comp_win_shadow_setup(cw, co); + e_mod_comp_win_cb_setup(cw, co); + evas_object_show(co->img); + + _e_mod_comp_win_transparent_rect_update(cw); + + if (cw->bd) evas_object_data_set(co->shadow, "border", cw->bd); + else if (cw->pop) + evas_object_data_set(co->shadow, "popup", cw->pop); + else if (cw->menu) + evas_object_data_set(co->shadow, "menu", cw->menu); + + evas_object_pass_events_set(co->img, 1); + } + + evas_object_pass_events_set(co->shadow, 1); + evas_object_data_set(co->shadow, "win", + (void *)((unsigned long)cw->win)); + evas_object_data_set(co->shadow, "src", cw); + + int zx = 0, zy = 0; + zx = co->zone->x; + zy = co->zone->y; + evas_object_move(co->shadow, cw->x - zx, cw->y - zy); + evas_object_resize(co->shadow, cw->pw, cw->ph); + + if (cw->visible) + { + evas_object_image_size_set(co->img, cw->pw, cw->ph); + Evas_Object *o; + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_size_set(o, cw->pw, cw->ph); + } + if ((cw->dmg_updates >= 1)) + { + cw->defer_hide = 0; + if (!cw->hidden_override) + evas_object_show(co->shadow); + edje_object_signal_emit(co->shadow, "e,state,visible,on", "e"); + if (!cw->animating) + { + cw->c->animating++; + } + cw->animating = 1; + _e_mod_comp_win_render_queue(cw); + + cw->pending_count++; + e_manager_comp_event_src_visibility_send + (cw->c->man, (E_Manager_Comp_Source *)cw, + _e_mod_comp_cb_pending_after, cw->c); + } + } + } // end of eina_inlist + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_zone_del(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Zone_Del *ev = (E_Event_Zone_Del *)event; + Eina_List *l, *ll, *lll; + E_Comp *c; + E_Comp_Canvas *canvas; + E_Comp_Win *cw; + E_Comp_Object *co; + if (!ev || !ev->zone) + { + return ECORE_CALLBACK_PASS_ON; + } + if (!_comp_mod->conf->canvas_per_zone) + { + return ECORE_CALLBACK_PASS_ON; + } + + ELB(ELBT_COMP, "E_ZONE_DEL", ev->zone->id); + + EINA_LIST_FOREACH(compositors, l, c) + { + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (canvas->zone != ev->zone) continue; + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + EINA_LIST_FOREACH(cw->objs, lll, co) + { + if (co->zone != ev->zone) continue; + cw->objs = eina_list_remove(cw->objs, co); + e_mod_comp_obj_del(co); + } + } + + ecore_x_window_shape_rectangle_subtract(c->win, + canvas->zone->x, + canvas->zone->y, + canvas->zone->w, + canvas->zone->h); + ecore_x_sync(); + + c->canvases = eina_list_remove(c->canvases, canvas); + e_mod_comp_canvas_del(canvas); + break; + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_zone_rot_begin(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Zone_Rotation_Change_Begin *ev = (E_Event_Zone_Rotation_Change_Begin *)event; + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + + if (!(ev && ev->zone)) + return ECORE_CALLBACK_PASS_ON; + + ELBF(ELBT_COMP, 0, ev->zone->num, "%15.15s|", "ZONE_ROT_BEGIN"); + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (!canvas) continue; + if (canvas->zone != ev->zone) continue; + if (canvas->zr) + { +#if HWC_ROTATION_PATCH + if ((_comp_mod->conf->use_hwc) && (c->hwcomp_funcs.cb_rotation_begin)) + c->hwcomp_funcs.cb_rotation_begin(canvas->hwcomp); +#endif + c->effect_funcs.zone_rotation_begin(canvas->zr); + break; + } + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_zone_rot_cancel(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Zone_Rotation_Change_Cancel *ev = (E_Event_Zone_Rotation_Change_Cancel *)event; + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + + if (!(ev && ev->zone)) + return ECORE_CALLBACK_PASS_ON; + + ELBF(ELBT_COMP, 0, ev->zone->num, "%15.15s|", "ZONE_ROT_CANCEL"); + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (!canvas) continue; + if (canvas->zone != ev->zone) continue; + if (canvas->zr) + { +#if HWC_ROTATION_PATCH + if ((_comp_mod->conf->use_hwc) && (c->hwcomp_funcs.cb_rotation_end)) + c->hwcomp_funcs.cb_rotation_end(canvas->hwcomp); +#endif + canvas->xv_ready[0] = EINA_FALSE; + c->effect_funcs.zone_rotation_cancel(canvas->zr); + } + break; + } + } + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_mod_comp_zone_rot_end(void *data __UNUSED__, + int type __UNUSED__, + void *event) +{ + E_Event_Zone_Rotation_Change_End *ev = (E_Event_Zone_Rotation_Change_End *)event; + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Canvas *canvas; + + if (!(ev && ev->zone)) + return ECORE_CALLBACK_PASS_ON; + + ELBF(ELBT_COMP, 0, ev->zone->num, "%15.15s|", "ZONE_ROT_END"); + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_LIST_FOREACH(c->canvases, ll, canvas) + { + if (!canvas) continue; + if (canvas->zone != ev->zone) continue; + if (canvas->zr) + { +#if HWC_ROTATION_PATCH + if ((_comp_mod->conf->use_hwc) && (c->hwcomp_funcs.cb_rotation_end)) + c->hwcomp_funcs.cb_rotation_end(canvas->hwcomp); +#endif + if (canvas->xv_ready[0]) + { + canvas->xv_ready[1] = EINA_TRUE; + if (!canvas->xv_ready[2]) + break; + } + Eina_Bool res = c->effect_funcs.zone_rotation_end(canvas->zr); + if (res) + c->effect_funcs.zone_rotation_do(canvas->zr); + else + c->effect_funcs.zone_rotation_clear(canvas->zr); + + } + break; + } + } + return ECORE_CALLBACK_PASS_ON; +} + +////////////////////////////////////////////////////////////////////////// + +static Eina_Bool +_e_mod_comp_hwc_configure(void *data __UNUSED__, + int ev_type __UNUSED__, + void *event) +{ + Ecore_X_Event_Generic *e = (Ecore_X_Event_Generic *)event; + Eina_List *l = NULL; + E_Comp *c = NULL; + + if (!e) return ECORE_CALLBACK_PASS_ON; + + /* FIXME : No problem regarding timing issue??? */ + if (_comp_mod->conf->use_hwc) + { + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + if (c->hwcomp_funcs.process_event) + c->hwcomp_funcs.process_event(c, e); + } + } + + return ECORE_CALLBACK_PASS_ON; +} + +////////////////////////////////////////////////////////////////////////// + +Eina_Bool +e_mod_comp_init(void) +{ + Eina_List *l; + E_Manager *man; + unsigned int effect = 0; + int res = 0; + + windows = eina_hash_string_superfast_new(NULL); + borders = eina_hash_string_superfast_new(NULL); + damages = eina_hash_string_superfast_new(NULL); + + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CREATE, _e_mod_comp_create, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _e_mod_comp_destroy, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, _e_mod_comp_show_request, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, _e_mod_comp_show, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, _e_mod_comp_hide, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_REPARENT, _e_mod_comp_reparent, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, _e_mod_comp_configure, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_STACK, _e_mod_comp_stack, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _e_mod_comp_property, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _e_mod_comp_message, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE, _e_mod_comp_shape, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, _e_mod_comp_damage, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, _e_mod_comp_damage_win, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _e_mod_comp_key_down, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE, _e_mod_comp_randr, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_ADD, _e_mod_comp_bd_add, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_REMOVE, _e_mod_comp_bd_del, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_SHOW, _e_mod_comp_bd_show, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_HIDE, _e_mod_comp_bd_hide, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_MOVE, _e_mod_comp_bd_move, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_RESIZE, _e_mod_comp_bd_resize, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_ICONIFY, _e_mod_comp_bd_iconify, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_UNICONIFY, _e_mod_comp_bd_uniconify, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_FOCUS_IN, _e_mod_comp_bd_focus_in, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_FOCUS_OUT, _e_mod_comp_bd_focus_out, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_STACK, _e_mod_comp_bd_stack, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE, _e_mod_comp_zone_move_resize, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ADD, _e_mod_comp_zone_add, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_DEL, _e_mod_comp_zone_del, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ROTATION_CHANGE_BEGIN, _e_mod_comp_zone_rot_begin, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ROTATION_CHANGE_CANCEL, _e_mod_comp_zone_rot_cancel, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_ZONE_ROTATION_CHANGE_END, _e_mod_comp_zone_rot_end, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_GENERIC, _e_mod_comp_hwc_configure, NULL)); + handlers = eina_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY, _e_mod_comp_cb_rr_output_prop, NULL)); +#ifdef _F_USE_BORDER_TRANSFORM_ + handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_BORDER_TRANSFORM_CHANGED, _e_mod_comp_bd_transform_changed, NULL)); +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ + handlers_hook = eina_list_append(handlers_hook, e_border_hook_add(E_BORDER_HOOK_AUX_HINT_EVAL, e_mod_comp_aux_hint_eval, NULL)); + + res = e_mod_comp_atoms_init(); + E_CHECK_RETURN(res, 0); + + res = e_mod_comp_win_type_init(); + E_CHECK_RETURN(res, 0); + + res = e_mod_comp_policy_init(); + E_CHECK_RETURN(res, 0); + + if (!ecore_x_composite_query()) + { + e_util_dialog_internal + (_("Compositor Error"), + _("Your X Display does not support the XComposite extension
" + "or Ecore was built without XComposite support.
" + "Note that for composite support you will also need
" + "XRender and XFixes support in X11 and Ecore.")); + return 0; + } + if (!ecore_x_damage_query()) + { + e_util_dialog_internal + (_("Compositor Error"), + _("Your screen does not support the XDamage extension
" + "or Ecore was built without XDamage support.")); + return 0; + } + + EINA_LIST_FOREACH(e_manager_list(), l, man) + { + E_Comp *c; + if (!man) continue; + c = _e_mod_comp_add(man); + if (c) + { + int w, h; + if (c->fake_image_launch) + { + c->evas = _e_mod_comp_evas_get_func(c, c->man); + ecore_x_window_size_get(c->win, &w, &h); + c->eff_img = c->effect_funcs.image_launch_new(c->evas, w, h); + } + + compositors = eina_list_append(compositors, c); + e_mod_comp_util_set(c, man); + ecore_animator_frametime_set(1.0f/60.0f); + + if (_comp_mod->conf->default_window_effect) effect = 1; + ecore_x_window_prop_card32_set + (c->man->root, ATOM_EFFECT_ENABLE, + &effect, 1); + ecore_x_window_prop_property_set + (c->man->root, ATOM_OVERAY_WINDOW, + ECORE_X_ATOM_WINDOW, 32, &c->win, 1); + } + } + ecore_x_sync(); + + res = e_mod_comp_aux_hint_init(); + E_CHECK_RETURN(res, 0); + + return 1; +} + +void +e_mod_comp_shutdown(void) +{ + E_Comp *c; + + EINA_LIST_FREE(compositors, c) _e_mod_comp_del(c); + + E_FREE_LIST(handlers, ecore_event_handler_del); + + E_FREE_LIST(handlers_hook, e_border_hook_del); + + if (damages) eina_hash_free(damages); + if (windows) eina_hash_free(windows); + if (borders) eina_hash_free(borders); + damages = NULL; + windows = NULL; + borders = NULL; + + e_mod_comp_aux_hint_shutdown();; + e_mod_comp_policy_shutdown(); + e_mod_comp_win_type_shutdown(); + e_mod_comp_atoms_shutdown(); + + e_mod_comp_util_set(NULL, NULL); +} + +void +e_mod_comp_shadow_set(void) +{ + Eina_List *l, *ll; + E_Comp *c; + E_Comp_Win *cw; + E_Comp_Object *co; + + EINA_LIST_FOREACH(compositors, l, c) + { + if (!c) continue; + EINA_INLIST_FOREACH(c->wins, cw) + { + e_mod_comp_win_type_setup(cw); + EINA_LIST_FOREACH(cw->objs, ll, co) + { + if (!co) continue; + if ((co->shadow) && (co->img)) + e_mod_comp_win_shadow_setup(cw, co); + } + c->effect_funcs.win_show(cw); + _e_mod_comp_win_transparent_rect_update(cw); + } + } +} + +EAPI void +e_mod_comp_win_cb_setup(E_Comp_Win *cw, + E_Comp_Object *co) +{ + edje_object_signal_callback_add(co->shadow, "e,action,show,done", "e", _e_mod_comp_show_done, cw); + edje_object_signal_callback_add(co->shadow, "e,action,hide,done", "e", _e_mod_comp_hide_done, cw); +} + +EAPI void +e_mod_comp_x_grab_set(E_Comp *c, + Eina_Bool grab) +{ + E_CHECK(_comp_mod->conf->grab); + E_CHECK(c); + E_CHECK((c->grabbed != grab)); + if (grab) + ecore_x_grab(); + else + ecore_x_ungrab(); + c->grabbed = grab; +} diff --git a/src/e_mod_comp.h b/src/e_mod_comp.h new file mode 100644 index 0000000..64f3f3c --- /dev/null +++ b/src/e_mod_comp.h @@ -0,0 +1,34 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_H +#define E_MOD_COMP_H + +#include "e_mod_comp_shared_types.h" + +EAPI Eina_Bool e_mod_comp_init(void); +EAPI void e_mod_comp_shutdown(void); +EAPI void e_mod_comp_shadow_set(void); + +EAPI void e_mod_comp_done_defer(E_Comp_Win *cw); +EAPI Eina_Bool e_mod_comp_win_add_damage(E_Comp_Win *cw, Ecore_X_Damage dmg); +EAPI Eina_Bool e_mod_comp_win_del_damage(E_Comp_Win *cw, Ecore_X_Damage dmg); +EAPI E_Comp_Win *e_mod_comp_win_find(Ecore_X_Window win); +EAPI E_Comp_Win *e_mod_comp_border_client_find(Ecore_X_Window win); +EAPI Eina_Bool e_mod_comp_comp_event_src_visibility_send(E_Comp_Win *cw); +EAPI void e_mod_comp_win_shadow_setup(E_Comp_Win *cw, E_Comp_Object *co); +EAPI void e_mod_comp_win_cb_setup(E_Comp_Win *cw, E_Comp_Object *co); +EAPI void e_mod_comp_fps_toggle(void); +EAPI E_Comp *e_mod_comp_find(Ecore_X_Window win); +EAPI void e_mod_comp_win_render_queue(E_Comp_Win *cw); +EAPI void e_mod_comp_render_queue(E_Comp *c); +EAPI Eina_Bool e_mod_comp_win_damage_timeout(void *data); +EAPI Eina_Bool e_mod_comp_cb_update(E_Comp *c); +EAPI Evas_Object *e_mod_comp_win_mirror_add(E_Comp_Win *cw); +EAPI void e_mod_comp_cb_win_mirror_del(void *data, Evas *e, Evas_Object *obj, void *event_info); +EAPI void e_mod_comp_src_hidden_set_func(void *data, E_Manager *man, E_Manager_Comp_Source *src, Eina_Bool hidden); +EAPI void e_mod_comp_x_grab_set(E_Comp *c, Eina_Bool grab); +EAPI void e_mod_comp_composite_mode_set(E_Zone *zone, Eina_Bool set); +EAPI void e_comp_event_src_visibility_send(Ecore_X_Window win, Eina_Bool visible); + +#endif +#endif diff --git a/src/e_mod_comp_atoms.c b/src/e_mod_comp_atoms.c new file mode 100644 index 0000000..203c233 --- /dev/null +++ b/src/e_mod_comp_atoms.c @@ -0,0 +1,231 @@ +#include "e.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +/* atoms */ +EAPI Ecore_X_Atom ATOM_CM_LOG = 0; +EAPI Ecore_X_Atom ATOM_CM_LOG_DUMP_DONE = 0; +EAPI Ecore_X_Atom ATOM_IMAGE_LAUNCH = 0; +EAPI Ecore_X_Atom ATOM_IMAGE_LAUNCH_FILE = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_ENABLE = 0; +EAPI Ecore_X_Atom ATOM_WINDOW_EFFECT_ENABLE = 0; +EAPI Ecore_X_Atom ATOM_WINDOW_LAUNCHING_EFFECT_DONE = 0; +EAPI Ecore_X_Atom ATOM_WINDOW_EFFECT_CLIENT_STATE = 0; +EAPI Ecore_X_Atom ATOM_WINDOW_EFFECT_TYPE = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_DEFAULT = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_NONE = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM0 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM1 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM2 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM3 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM4 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM5 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM6 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM7 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM8 = 0; +EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM9 = 0; +EAPI Ecore_X_Atom ATOM_OVERAY_WINDOW = 0; +EAPI Ecore_X_Atom ATOM_X_HIBERNATION_STATE = 0; +EAPI Ecore_X_Atom ATOM_X_SCREEN_ROTATION = 0; +EAPI Ecore_X_Atom ATOM_X_WIN_USE_DRI2 = 0; +EAPI Ecore_X_Atom ATOM_X_WIN_HW_OV_SHOW = 0; +EAPI Ecore_X_Atom ATOM_CM_LOCK_SCREEN = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_SUPPORTED = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_STATE = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_BEGIN = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_BEGIN_DONE = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_END = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_END_DONE = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST_DONE = 0; +EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_RESIZE_PIXMAP = 0; +EAPI Ecore_X_Atom ATOM_NET_CM_WINDOW_BACKGROUND = 0; +EAPI Ecore_X_Atom ATOM_XV_USE = 0; +EAPI Ecore_X_Atom ATOM_XV_PIXMAP0 = 0; +EAPI Ecore_X_Atom ATOM_XV_PIXMAP1 = 0; +EAPI Ecore_X_Atom ATOM_XV_BYPASS_TO_PIXMAP0 = 0; +EAPI Ecore_X_Atom ATOM_XV_BYPASS_TO_PIXMAP1 = 0; +EAPI Ecore_X_Atom ATOM_XV_BYPASS_DONE0 = 0; +EAPI Ecore_X_Atom ATOM_XV_BYPASS_DONE1 = 0; +EAPI Ecore_X_Atom ATOM_XV_ROT_EFFECT_DONE = 0; +EAPI Ecore_X_Atom ATOM_XV_ROT_EFFECT_BEGIN = 0; +EAPI Ecore_X_Atom ATOM_CM_TRANSPARENT_RECT = 0; +EAPI Ecore_X_Atom ATOM_RR_WM_STATE = 0; +EAPI Ecore_X_Atom ATOM_CM_3D_APP_WIN = 0; +EAPI Ecore_X_Atom ATOM_CM_STEREOSCOPIC_MODE = 0; +EAPI Ecore_X_Atom ATOM_CM_MSG_STEREO_MODE = 0; + +/* local subsystem globals */ +static Eina_Hash *atoms_hash = NULL; + +static const char *atom_names[] = { + "_E_COMP_LOG", + "_E_COMP_LOG_DUMP_DONE", + "_E_COMP_FAKE_LAUNCH", + "_E_COMP_FAKE_LAUNCH_IMAGE", + "_NET_CM_EFFECT_ENABLE", + "_NET_CM_WINDOW_EFFECT_ENABLE", + "_NET_CM_WINDOW_LAUNCH_EFFECT_DONE", + "_NET_CM_WINDOW_EFFECT_CLIENT_STATE", + "_NET_CM_WINDOW_EFFECT_TYPE", + "_NET_CM_EFFECT_DEFAULT", + "_NET_CM_EFFECT_NONE", + "_NET_CM_EFFECT_CUSTOM0", + "_NET_CM_EFFECT_CUSTOM1", + "_NET_CM_EFFECT_CUSTOM2", + "_NET_CM_EFFECT_CUSTOM3", + "_NET_CM_EFFECT_CUSTOM4", + "_NET_CM_EFFECT_CUSTOM5", + "_NET_CM_EFFECT_CUSTOM6", + "_NET_CM_EFFECT_CUSTOM7", + "_NET_CM_EFFECT_CUSTOM8", + "_NET_CM_EFFECT_CUSTOM9", + "_E_COMP_OVERAY_WINDOW", + "X_HIBERNATION_STATE", + "X_SCREEN_ROTATION", + "X_WIN_USE_DRI2", + "X_WIN_HW_OV_SHOW", + "_E_COMP_LOCK_SCREEN", + "_E_COMP_PIXMAP_ROTATION_SUPPORTED", + "_E_COMP_PIXMAP_ROTATION_STATE", + "_E_COMP_PIXMAP_ROTATION_BEGIN", + "_E_COMP_PIXMAP_ROTATION_BEGIN_DONE", + "_E_COMP_PIXMAP_ROTATION_END", + "_E_COMP_PIXMAP_ROTATION_END_DONE", + "_E_COMP_PIXMAP_ROTATION_REQUEST", + "_E_COMP_PIXMAP_ROTATION_REQUEST_DONE", + "_E_COMP_PIXMAP_ROTATION_RESIZE_PIXMAP", + "_NET_CM_WINDOW_BACKGROUND", + "_XV_USE", + "_XV_PIXMAP0", + "_XV_PIXMAP1", + "_XV_BYPASS_TO_PIXMAP0", + "_XV_BYPASS_TO_PIXMAP1", + "_XV_BYPASS_DONE0", + "_XV_BYPASS_DONE1", + "_XV_ROT_EFFECT_DONE", + "_XV_ROT_EFFECT_BEGIN", + "_E_COMP_TRANSPARENT_RECT", + "_RR_NET_WM_STATE", + "_E_COMP_3D_APP_WIN", + "_E_COMP_STEREOSCOPIC_MODE", + "_E_COMP_MSG_STEREO_MODE" +}; + +static const char *external_atom_names[] = { + "SYNC_DRAW_DONE", + "SYNC_COUNTER", + "WIN_ROT_ANGLE", + "ILLUME_WIN_STATE", + "WM_WINDOW_OPACITY", + "WM_CLASS", + "WM_WINDOW_ROLE" +}; + +/* externally accessible functions */ +EAPI int +e_mod_comp_atoms_init(void) +{ + Ecore_X_Atom *atoms = NULL; + int n = 0, i = 0, res = 0; + + if (!atoms_hash) atoms_hash = eina_hash_string_superfast_new(NULL); + E_CHECK_RETURN(atoms_hash, 0); + + n = (sizeof(atom_names) / sizeof(char *)); + + atoms = E_NEW(Ecore_X_Atom, n); + E_CHECK_GOTO(atoms, cleanup); + + ecore_x_atoms_get(atom_names, n, atoms); + + ATOM_CM_LOG = atoms[i++]; + ATOM_CM_LOG_DUMP_DONE = atoms[i++]; + ATOM_IMAGE_LAUNCH = atoms[i++]; + ATOM_IMAGE_LAUNCH_FILE = atoms[i++]; + ATOM_EFFECT_ENABLE = atoms[i++]; + ATOM_WINDOW_EFFECT_ENABLE = atoms[i++]; + ATOM_WINDOW_LAUNCHING_EFFECT_DONE = atoms[i++]; + ATOM_WINDOW_EFFECT_CLIENT_STATE = atoms[i++]; + ATOM_WINDOW_EFFECT_TYPE = atoms[i++]; + ATOM_EFFECT_DEFAULT = atoms[i++]; + ATOM_EFFECT_NONE = atoms[i++]; + ATOM_EFFECT_CUSTOM0 = atoms[i++]; + ATOM_EFFECT_CUSTOM1 = atoms[i++]; + ATOM_EFFECT_CUSTOM2 = atoms[i++]; + ATOM_EFFECT_CUSTOM3 = atoms[i++]; + ATOM_EFFECT_CUSTOM4 = atoms[i++]; + ATOM_EFFECT_CUSTOM5 = atoms[i++]; + ATOM_EFFECT_CUSTOM6 = atoms[i++]; + ATOM_EFFECT_CUSTOM7 = atoms[i++]; + ATOM_EFFECT_CUSTOM8 = atoms[i++]; + ATOM_EFFECT_CUSTOM9 = atoms[i++]; + ATOM_OVERAY_WINDOW = atoms[i++]; + ATOM_X_HIBERNATION_STATE = atoms[i++]; + ATOM_X_SCREEN_ROTATION = atoms[i++]; + ATOM_X_WIN_USE_DRI2 = atoms[i++]; + ATOM_X_WIN_HW_OV_SHOW = atoms[i++]; + ATOM_CM_LOCK_SCREEN = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_SUPPORTED = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_STATE = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_BEGIN = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_BEGIN_DONE = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_END = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_END_DONE = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_REQUEST = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_REQUEST_DONE = atoms[i++]; + ATOM_CM_PIXMAP_ROTATION_RESIZE_PIXMAP = atoms[i++]; + ATOM_NET_CM_WINDOW_BACKGROUND = atoms[i++]; + ATOM_XV_USE = atoms[i++]; + ATOM_XV_PIXMAP0 = atoms[i++]; + ATOM_XV_PIXMAP1 = atoms[i++]; + ATOM_XV_BYPASS_TO_PIXMAP0 = atoms[i++]; + ATOM_XV_BYPASS_TO_PIXMAP1 = atoms[i++]; + ATOM_XV_BYPASS_DONE0 = atoms[i++]; + ATOM_XV_BYPASS_DONE1 = atoms[i++]; + ATOM_XV_ROT_EFFECT_DONE = atoms[i++]; + ATOM_XV_ROT_EFFECT_BEGIN = atoms[i++]; + ATOM_CM_TRANSPARENT_RECT = atoms[i++]; + ATOM_RR_WM_STATE = atoms[i++]; + ATOM_CM_3D_APP_WIN = atoms[i++]; + ATOM_CM_STEREOSCOPIC_MODE = atoms[i++]; + ATOM_CM_MSG_STEREO_MODE = atoms[i++]; + + for (i = 0; i < n; i++) + { + E_CHECK_GOTO(atoms[i], cleanup); + eina_hash_add(atoms_hash, + e_util_winid_str_get(atoms[i]), + atom_names[i]); + } + + i = 0; + eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE), external_atom_names[i++]); + eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_E_COMP_SYNC_COUNTER), external_atom_names[i++]); + eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_E_ILLUME_WINDOW_STATE), external_atom_names[i++]); + eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_NET_WM_WINDOW_OPACITY), external_atom_names[i++]); + eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_WM_CLASS), external_atom_names[i++]); + eina_hash_add(atoms_hash, e_util_winid_str_get(ECORE_X_ATOM_WM_WINDOW_ROLE), external_atom_names[i++]); + + res = 1; + +cleanup: + if (atoms) E_FREE(atoms); + return res; +} + +EAPI int +e_mod_comp_atoms_shutdown(void) +{ + if (atoms_hash) eina_hash_free(atoms_hash); + atoms_hash = NULL; + return 1; +} + +EAPI const char * +e_mod_comp_atoms_name_get(Ecore_X_Atom a) +{ + E_CHECK_RETURN(a, NULL); + return eina_hash_find(atoms_hash, + e_util_winid_str_get(a)); +} diff --git a/src/e_mod_comp_atoms.h b/src/e_mod_comp_atoms.h new file mode 100644 index 0000000..d229e41 --- /dev/null +++ b/src/e_mod_comp_atoms.h @@ -0,0 +1,64 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_ATOMS_H +#define E_MOD_COMP_ATOMS_H + +extern EAPI Ecore_X_Atom ATOM_CM_LOG; +extern EAPI Ecore_X_Atom ATOM_CM_LOG_DUMP_DONE; +extern EAPI Ecore_X_Atom ATOM_IMAGE_LAUNCH; +extern EAPI Ecore_X_Atom ATOM_IMAGE_LAUNCH_FILE; +extern EAPI Ecore_X_Atom ATOM_EFFECT_ENABLE; +extern EAPI Ecore_X_Atom ATOM_WINDOW_EFFECT_ENABLE; +extern EAPI Ecore_X_Atom ATOM_WINDOW_LAUNCHING_EFFECT_DONE; +extern EAPI Ecore_X_Atom ATOM_WINDOW_EFFECT_CLIENT_STATE; +extern EAPI Ecore_X_Atom ATOM_WINDOW_EFFECT_STATE; +extern EAPI Ecore_X_Atom ATOM_WINDOW_EFFECT_TYPE; +extern EAPI Ecore_X_Atom ATOM_EFFECT_DEFAULT; +extern EAPI Ecore_X_Atom ATOM_EFFECT_NONE; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM0; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM1; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM2; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM3; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM4; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM5; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM6; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM7; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM8; +extern EAPI Ecore_X_Atom ATOM_EFFECT_CUSTOM9; +extern EAPI Ecore_X_Atom ATOM_OVERAY_WINDOW; +extern EAPI Ecore_X_Atom ATOM_X_HIBERNATION_STATE; +extern EAPI Ecore_X_Atom ATOM_X_SCREEN_ROTATION; +extern EAPI Ecore_X_Atom ATOM_X_WIN_USE_DRI2; +extern EAPI Ecore_X_Atom ATOM_X_WIN_HW_OV_SHOW; +extern EAPI Ecore_X_Atom ATOM_CM_LOCK_SCREEN; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_SUPPORTED; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_STATE; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_BEGIN; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_BEGIN_DONE; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_END; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_END_DONE; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_REQUEST_DONE; +extern EAPI Ecore_X_Atom ATOM_CM_PIXMAP_ROTATION_RESIZE_PIXMAP; +extern EAPI Ecore_X_Atom ATOM_NET_CM_WINDOW_BACKGROUND; +extern EAPI Ecore_X_Atom ATOM_XV_USE; +extern EAPI Ecore_X_Atom ATOM_XV_PIXMAP0; +extern EAPI Ecore_X_Atom ATOM_XV_PIXMAP1; +extern EAPI Ecore_X_Atom ATOM_XV_BYPASS_TO_PIXMAP0; +extern EAPI Ecore_X_Atom ATOM_XV_BYPASS_TO_PIXMAP1; +extern EAPI Ecore_X_Atom ATOM_XV_BYPASS_DONE0; +extern EAPI Ecore_X_Atom ATOM_XV_BYPASS_DONE1; +extern EAPI Ecore_X_Atom ATOM_XV_ROT_EFFECT_DONE; +extern EAPI Ecore_X_Atom ATOM_XV_ROT_EFFECT_BEGIN; +extern EAPI Ecore_X_Atom ATOM_CM_TRANSPARENT_RECT; +extern EAPI Ecore_X_Atom ATOM_RR_WM_STATE; +extern EAPI Ecore_X_Atom ATOM_CM_3D_APP_WIN; +extern EAPI Ecore_X_Atom ATOM_CM_STEREOSCOPIC_MODE; +extern EAPI Ecore_X_Atom ATOM_CM_MSG_STEREO_MODE; + +EAPI int e_mod_comp_atoms_init(void); +EAPI int e_mod_comp_atoms_shutdown(void); +EAPI const char *e_mod_comp_atoms_name_get(Ecore_X_Atom a); + +#endif +#endif diff --git a/src/e_mod_comp_aux_hint.c b/src/e_mod_comp_aux_hint.c new file mode 100644 index 0000000..df728d8 --- /dev/null +++ b/src/e_mod_comp_aux_hint.c @@ -0,0 +1,162 @@ +#include "e_mod_comp.h" +#include "e_mod_comp_debug.h" + +typedef struct _E_Comp_Aux_Hint_Item E_Comp_Aux_Hint_Item; + +struct _E_Comp_Aux_Hint_Item +{ + /* val[0] previous value, val[1] current value */ + union + { + Eina_Bool b; + int i; + } val[2]; + Eina_Bool changed; +}; + +static const char *hint_names[] = +{ + "wm.comp.win.effect.enable", + "wm.comp.win.dim_bg.enable", + "wm.comp.win.sync_draw.support", + "wm.comp.win.always.selective.mode" +}; + +/* externally accessible functions */ +EAPI int +e_mod_comp_aux_hint_init(void) +{ + int i, n; + n = (sizeof(hint_names) / sizeof(char *)); + + Eina_List *l; + E_Manager *man; + EINA_LIST_FOREACH(e_manager_list(), l, man) + { + for (i = 0; i < n; i++) + { + e_hints_aux_hint_supported_add(man->root, hint_names[i]); + } + } + + return 1; +} + +EAPI int +e_mod_comp_aux_hint_shutdown(void) +{ + return 1; +} + +#define _STR_CMP(a, b) (strncmp(a, b, strlen(b)) == 0) + +#define _VAL_CHECK(a, b, c, d, e) \ + else if (_STR_CMP(a, b)) \ + { \ + c = d; \ + e = EINA_TRUE; \ + send = EINA_TRUE; \ + } + +EAPI void +e_mod_comp_aux_hint_eval(void *data __UNUSED__, + void *data2) +{ + E_Border *bd = (E_Border *)data2; + E_CHECK(bd); + + E_Comp_Win *cw = e_mod_comp_win_find(bd->win); + E_CHECK(cw); + + E_Comp_Aux_Hint_Item eff; + eff.val[0].b = cw->c->effect_funcs.state_get(cw->eff_type); + eff.val[1].b = EINA_FALSE; + eff.changed = EINA_FALSE; + + E_Comp_Aux_Hint_Item dim; + dim.val[0].b = EINA_TRUE; /* TODO: make e,state,dim,on */ + dim.val[1].b = EINA_FALSE; + dim.changed = EINA_FALSE; + + E_Comp_Aux_Hint_Item sync_draw; + sync_draw.val[0].b = cw->sync_draw_support; + sync_draw.val[1].b = EINA_FALSE; + sync_draw.changed = EINA_FALSE; + + E_Comp_Aux_Hint_Item selective_mode; + selective_mode.val[0].b = cw->always_selective_mode; + selective_mode.val[1].b = EINA_FALSE; + selective_mode.changed = EINA_FALSE; + + E_Border_Aux_Hint *hint; + Eina_List *l; + EINA_LIST_FOREACH(bd->client.e.state.aux_hint.hints, l, hint) + { + Eina_Bool send = EINA_FALSE; + if (!hint->deleted) + { + if (_STR_CMP(hint->hint, hint_names[0])) + { + if (0) ; + _VAL_CHECK(hint->val, "0", eff.val[1].b, EINA_FALSE, eff.changed) + _VAL_CHECK(hint->val, "1", eff.val[1].b, EINA_TRUE, eff.changed) + } + else if (_STR_CMP(hint->hint, hint_names[1])) + { + if (0) ; + _VAL_CHECK(hint->val, "0", dim.val[1].b, EINA_FALSE, dim.changed) + _VAL_CHECK(hint->val, "1", dim.val[1].b, EINA_TRUE, dim.changed) + } + else if (_STR_CMP(hint->hint, hint_names[2])) + { + if (0) ; + _VAL_CHECK(hint->val, "0", sync_draw.val[1].b, EINA_FALSE, sync_draw.changed) + _VAL_CHECK(hint->val, "1", sync_draw.val[1].b, EINA_TRUE, sync_draw.changed) + } + else if (_STR_CMP(hint->hint, hint_names[3])) + { + if (0) ; + _VAL_CHECK(hint->val, "0", selective_mode.val[1].b, EINA_FALSE, selective_mode.changed) + _VAL_CHECK(hint->val, "1", selective_mode.val[1].b, EINA_TRUE, selective_mode.changed) + } + } + + if (hint->changed) + { + if (send) + e_border_aux_hint_reply_send(bd, hint->id); + } + } + + if ((eff.changed) && (eff.val[0].b != eff.val[1].b)) + cw->c->effect_funcs.state_set(cw->eff_type, eff.val[1].b); + + if ((dim.changed) && (dim.val[0].b != dim.val[1].b)) + { + E_Comp_Win_Type type = e_mod_comp_win_type_get(cw); + if ((type == E_COMP_WIN_TYPE_DIALOG) || + (type == E_COMP_WIN_TYPE_NOTIFICATION)) + { + /* TODO: make e,state,dim,on */ + if (!dim.val[1].b) + { + E_Comp_Object *co; + Eina_List *l; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if ((co->shadow) && (co->img)) + { + edje_object_signal_emit(co->shadow, "e,state,dim,off", "e"); + } + } + } + } + } + + if ((sync_draw.changed) && (sync_draw.val[0].b != sync_draw.val[1].b)) + cw->sync_draw_support = sync_draw.val[1].b; + + if ((selective_mode.changed) && (selective_mode.val[0].b != selective_mode.val[1].b)) + cw->always_selective_mode = selective_mode.val[1].b; +} diff --git a/src/e_mod_comp_aux_hint.h b/src/e_mod_comp_aux_hint.h new file mode 100644 index 0000000..05f1f0b --- /dev/null +++ b/src/e_mod_comp_aux_hint.h @@ -0,0 +1,11 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_AUX_HINT_H +#define E_MOD_COMP_AUX_HINT_H + +EAPI int e_mod_comp_aux_hint_init(void); +EAPI int e_mod_comp_aux_hint_shutdown(void); +EAPI void e_mod_comp_aux_hint_eval(void *data, void *data2); + +#endif +#endif diff --git a/src/e_mod_comp_bg_win.c b/src/e_mod_comp_bg_win.c new file mode 100644 index 0000000..0f22258 --- /dev/null +++ b/src/e_mod_comp_bg_win.c @@ -0,0 +1,331 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +typedef enum _E_Comp_BG_Win_State +{ + E_COMP_BG_WIN_STATE_NONE = 0, + E_COMP_BG_WIN_STATE_PARENT, + E_COMP_BG_WIN_STATE_CHILD, + E_COMP_BG_WIN_STATE_CHILD_WAIT_FOR_DAMAGE +} E_Comp_BG_Win_State; + +struct _E_Comp_BG_Win +{ + E_Comp_BG_Win_State state; + Evas_Object *obj; + int x, y, w, h; + Eina_Bool hidden; + struct { + Ecore_X_Window parent; + Ecore_X_Window child; + Ecore_X_Window self; + } win; +}; + +/* local subsystem functions */ +static void _e_mod_comp_bg_win_fg_free(E_Comp_BG_Win *fg, E_Comp_Win *cw); +static void _e_mod_comp_bg_win_bg_free(E_Comp_BG_Win *bg, E_Comp_Win *cw); +static Eina_Bool _e_mod_comp_bg_win_get_prop(Ecore_X_Window win, Ecore_X_Window *wins); +static Eina_Bool _e_mod_comp_bg_win_setup(E_Comp_Win *cw, E_Comp_Win *cw2); +static Eina_Bool _e_mod_comp_bg_win_obj_set(E_Comp_Win *cw); + +/* externally accessible functions */ +EAPI E_Comp_BG_Win * +e_mod_comp_bg_win_new(void) +{ + E_Comp_BG_Win *bg; + bg = E_NEW(E_Comp_BG_Win, 1); + return bg; +} + +EAPI void +e_mod_comp_bg_win_free(E_Comp_BG_Win *bg) +{ + E_Comp_Win *cw; + E_CHECK(bg); + if (bg->obj) evas_object_del(bg->obj); + bg->obj = NULL; + + cw = e_mod_comp_win_find(bg->win.self); + switch (bg->state) + { + case E_COMP_BG_WIN_STATE_PARENT: + _e_mod_comp_bg_win_fg_free(bg, cw); + break; + case E_COMP_BG_WIN_STATE_CHILD: + case E_COMP_BG_WIN_STATE_CHILD_WAIT_FOR_DAMAGE: + _e_mod_comp_bg_win_bg_free(bg, cw); + break; + default: + break; + } + + memset(bg, 0, sizeof(E_Comp_BG_Win)); + E_FREE(bg); +} + +EAPI Eina_Bool +e_mod_comp_bg_win_handler_prop(Ecore_X_Event_Window_Property *ev) +{ + Eina_Bool res = EINA_FALSE; + E_Comp_Win *cw[2]; + Ecore_X_Window wins[2]; + int i; + + res = _e_mod_comp_bg_win_get_prop(ev->win, wins); + E_CHECK_RETURN(res, 0); + + for (i = 0; i < 2; i++) + { + cw[i] = e_mod_comp_win_find(wins[i]); + if (!cw[i]) + { + cw[i] = e_mod_comp_border_client_find(wins[i]); + E_CHECK_RETURN(cw[i], 0); + } + } + + res = _e_mod_comp_bg_win_setup(cw[0], cw[1]); + E_CHECK_RETURN(res, 0); + + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_bg_win_handler_release(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->bgwin, 0); + e_mod_comp_bg_win_free(cw->bgwin); + cw->bgwin = NULL; + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_bg_win_handler_show(E_Comp_Win *cw) +{ + Eina_Bool res = EINA_FALSE; + E_Comp_Win *cw2; + Ecore_X_Window wins[2]; + + res = _e_mod_comp_bg_win_get_prop + (e_mod_comp_util_client_xid_get(cw), wins); + E_CHECK_RETURN(res, 0); + + cw2 = e_mod_comp_win_find(wins[1]); + if (!cw2) + { + cw2 = e_mod_comp_border_client_find(wins[1]); + E_CHECK_RETURN(cw2, 0); + } + + res = _e_mod_comp_bg_win_setup(cw, cw2); + E_CHECK_RETURN(res, 0); + + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_bg_win_handler_update(E_Comp_Win *cw) +{ + E_Comp_Win *fgcw; + Eina_Bool res; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->bgwin, 0); + E_CHECK_RETURN(cw->bgwin->win.parent, 0); + if (cw->bgwin->state != E_COMP_BG_WIN_STATE_CHILD_WAIT_FOR_DAMAGE) + { + return EINA_FALSE; + } + + fgcw = e_mod_comp_win_find(cw->bgwin->win.parent); + E_CHECK_RETURN(fgcw, 0); + + res = _e_mod_comp_bg_win_obj_set(fgcw); + E_CHECK_RETURN(res, 0); + + cw->bgwin->state = E_COMP_BG_WIN_STATE_CHILD; + + return EINA_TRUE; +} + +/* local subsystem functions */ +static void +_e_mod_comp_bg_win_fg_free(E_Comp_BG_Win *fg, + E_Comp_Win *cw) +{ + E_Comp_BG_Win *bg; + E_Comp_Win *bgcw, *fgcw; + E_CHECK(fg->win.child); + + bgcw = e_mod_comp_win_find(fg->win.child); + E_CHECK(bgcw); + + bg = bgcw->bgwin; + E_CHECK(bg); + E_CHECK(bg->win.parent); + + fgcw = e_mod_comp_win_find(bg->win.parent); + E_CHECK(fgcw); + + E_CHECK(fgcw == cw); + + bg->win.parent = 0; +} + +static void +_e_mod_comp_bg_win_bg_free(E_Comp_BG_Win *bg, + E_Comp_Win *cw) +{ + E_Comp_BG_Win *fg; + E_Comp_Win *fgcw, *bgcw; + E_CHECK(bg->win.parent); + + fgcw = e_mod_comp_win_find(bg->win.parent); + E_CHECK(fgcw); + + fg = fgcw->bgwin; + E_CHECK(fg); + E_CHECK(fg->win.child); + + bgcw = e_mod_comp_win_find(fg->win.child); + E_CHECK(bgcw); + + E_CHECK(bgcw == cw); + + fg->win.child = 0; + + e_mod_comp_bg_win_free(fg); +} + +static Eina_Bool +_e_mod_comp_bg_win_get_prop(Ecore_X_Window win, + Ecore_X_Window *wins) +{ + Eina_Bool res = EINA_FALSE; + int ret, cnt; + unsigned char *data = NULL; + ret = ecore_x_window_prop_property_get + (win, ATOM_NET_CM_WINDOW_BACKGROUND, + ECORE_X_ATOM_CARDINAL, 32, &data, &cnt); + E_CHECK_GOTO((ret > 0), cleanup); + E_CHECK_GOTO((data && (cnt == 2)), cleanup); + + memcpy(wins, data, sizeof(Ecore_X_Window) * cnt); + + res = EINA_TRUE; + +cleanup: + if (data) E_FREE(data); + return res; +} + +static Eina_Bool +_e_mod_comp_bg_win_setup(E_Comp_Win *cw, + E_Comp_Win *cw2) +{ + Eina_Bool res = EINA_FALSE; + + if (TYPE_BG_CHECK(cw) || + !TYPE_BG_CHECK(cw2) || + (cw == cw2)) + { + return EINA_FALSE; + } + + if (cw->bgwin) + e_mod_comp_bg_win_free(cw->bgwin); + + cw->bgwin = e_mod_comp_bg_win_new(); + E_CHECK_GOTO(cw->bgwin, cleanup); + cw->bgwin->state = E_COMP_BG_WIN_STATE_PARENT; + + if (!cw2->bgwin) + { + cw2->bgwin = e_mod_comp_bg_win_new(); + E_CHECK_GOTO(cw2->bgwin, cleanup); + + e_mod_comp_src_hidden_set_func + (NULL, NULL, (E_Manager_Comp_Source *)cw2, 1); + + cw2->bgwin->hidden = EINA_TRUE; + } + + cw->bgwin->win.child = cw2->win; + cw2->bgwin->win.parent = cw->win; + if (cw2->dmg_updates <= 1) + { + cw2->bgwin->state = E_COMP_BG_WIN_STATE_CHILD_WAIT_FOR_DAMAGE; + res = EINA_TRUE; + goto cleanup; + } + + cw2->bgwin->state = E_COMP_BG_WIN_STATE_CHILD; + + res = _e_mod_comp_bg_win_obj_set(cw); + E_CHECK_GOTO(res, cleanup); + + res = EINA_TRUE; + +cleanup: + if (!res && cw->bgwin) + { + e_mod_comp_bg_win_free(cw->bgwin); + cw->bgwin = NULL; + } + return res; +} + +static Eina_Bool +_e_mod_comp_bg_win_obj_set(E_Comp_Win *cw) +{ + Eina_List *l; + E_Comp_Object *co; + E_Comp_Win *cw2; + Evas *evas; + Eina_Bool res = EINA_FALSE, set = EINA_FALSE; + E_CHECK_RETURN(cw->bgwin, 0); + + cw2 = e_mod_comp_win_find(cw->bgwin->win.child); + E_CHECK_RETURN(cw2, 0); + + cw->bgwin->x = 0; + cw->bgwin->y = 0; + cw->bgwin->w = cw2->pw; + cw->bgwin->h = cw2->ph; + cw->bgwin->obj = e_mod_comp_win_mirror_add(cw2); + E_CHECK_GOTO(cw->bgwin->obj, finish); + + evas = evas_object_evas_get(cw->bgwin->obj); + E_CHECK_GOTO(evas, finish); + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (evas == evas_object_evas_get(co->shadow)) + { + res = edje_object_part_swallow + (co->shadow, "e.swallow.bgcontent", + cw->bgwin->obj); + E_CHECK_GOTO(res, finish); + set = EINA_TRUE; + } + } + E_CHECK_GOTO(set, finish); + + if (cw2->bgwin && + !cw2->bgwin->hidden) + { + e_mod_comp_src_hidden_set_func + (NULL, NULL, (E_Manager_Comp_Source *)cw2, 1); + cw2->bgwin->hidden = EINA_TRUE; + } + + e_mod_comp_win_render_queue(cw); + + res = EINA_TRUE; + +finish: + return res; +} diff --git a/src/e_mod_comp_bg_win.h b/src/e_mod_comp_bg_win.h new file mode 100644 index 0000000..b414784 --- /dev/null +++ b/src/e_mod_comp_bg_win.h @@ -0,0 +1,17 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_BG_WIN_H +#define E_MOD_COMP_BG_WIN_H + +typedef struct _E_Comp_BG_Win E_Comp_BG_Win; + +/* background window setup and handler functions */ +EAPI E_Comp_BG_Win *e_mod_comp_bg_win_new(void); +EAPI void e_mod_comp_bg_win_free(E_Comp_BG_Win *bg); +EAPI Eina_Bool e_mod_comp_bg_win_handler_prop(Ecore_X_Event_Window_Property *ev); +EAPI Eina_Bool e_mod_comp_bg_win_handler_release(E_Comp_Win *cw); +EAPI Eina_Bool e_mod_comp_bg_win_handler_show(E_Comp_Win *cw); +EAPI Eina_Bool e_mod_comp_bg_win_handler_update(E_Comp_Win *cw); + +#endif +#endif diff --git a/src/e_mod_comp_canvas.c b/src/e_mod_comp_canvas.c new file mode 100755 index 0000000..e9a34fd --- /dev/null +++ b/src/e_mod_comp_canvas.c @@ -0,0 +1,1190 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp_debug.h" +#include "e_mod_comp.h" + +/* static global variables */ +static int _canvas_num = 0; + +/* local subsystem functions */ +static void _fps_update(E_Comp_Canvas *canvas); +static void _pre_swap(void *data, Evas *e, void *event_info); +static void _post_swap(void *data, Evas *e, void *event_info); +static Eina_Bool _nocomp_prepare_timeout(void *data); +#if USE_NOCOMP_DISPOSE +static Eina_Bool _nocomp_end_timeout(void *data); +#endif + +/* externally accessible functions */ +EAPI void +e_mod_comp_layer_eval(E_Comp_Layer *ly) +{ + e_layout_freeze(ly->layout); + + if (!ly->bg) + { + ly->bg = evas_object_rectangle_add(ly->canvas->evas); + /* TODO: make it configurable */ + if (!strncmp(ly->name, "move", strlen("move"))) + evas_object_color_set(ly->bg, 0, 0, 0, 0); + else if (!strncmp(ly->name, "ly-ctrl", strlen("ly-ctrl"))) +#if 0 + evas_object_color_set(ly->bg, 0, 255, 0, 80); +#else + evas_object_color_set(ly->bg, 0, 0, 0, 0); +#endif + else + evas_object_color_set(ly->bg, 0, 0, 0, 255); + evas_object_show(ly->bg); + e_layout_pack(ly->layout, ly->bg); + } + e_layout_child_move(ly->bg, ly->x, ly->y); + e_layout_child_resize(ly->bg, ly->w, ly->h); + e_layout_child_lower(ly->bg); + + evas_object_move(ly->layout, ly->x, ly->y); + evas_object_resize(ly->layout, ly->w, ly->h); + e_layout_virtual_size_set(ly->layout, ly->w, ly->h); + + e_layout_thaw(ly->layout); +} + +EAPI void +e_mod_comp_layer_populate(E_Comp_Layer *ly, + Evas_Object *o) +{ + e_layout_pack(ly->layout, o); +} + +EAPI void +e_mod_comp_layer_populate_above_normal(E_Comp_Layer *ly, + Evas_Object *o) +{ + E_Comp_Win *cw; + Eina_List *l; + E_Comp_Object *co; + + if (!((ly) && + (ly->canvas) && + (ly->canvas->zone) && + (ly->canvas->zone->container))) + { + return; + } + + /* try to look for the boundary of the normal layer in the E_Container */ + Ecore_X_Window win = ly->canvas->zone->container->layers[3].win; + if (!win) return; + + E_Comp *c = e_mod_comp_util_get(); + Eina_Bool found = EINA_FALSE; + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + if (cw->win == win) + { + found = EINA_TRUE; + break; + } + } + + if (found) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + e_layout_child_raise_above(o, co->shadow); + } + } + else + e_layout_child_raise(o); +} + +EAPI void +e_mod_comp_layer_raise_above(E_Comp_Canvas *canvas, + Evas_Object *o, + E_Border *bd) +{ + E_Comp_Win *cw; + Eina_List *l; + E_Comp_Object *co; + + if (!((canvas) && + (canvas->zone) && + (canvas->zone->container))) + { + return; + } + + E_Comp *c = e_mod_comp_util_get(); + Eina_Bool found = EINA_FALSE; + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + if ((cw->bd) && (cw->bd == bd)) + { + found = EINA_TRUE; + break; + } + } + + if (found) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + e_layout_child_raise_above(o, co->shadow); + } + } +} + +EAPI void +e_mod_comp_layer_lower_below(E_Comp_Canvas *canvas, + Evas_Object *o, + E_Border *bd) +{ + E_Comp_Win *cw; + Eina_List *l; + E_Comp_Object *co; + + if (!((canvas) && + (canvas->zone) && + (canvas->zone->container))) + { + return; + } + + E_Comp *c = e_mod_comp_util_get(); + Eina_Bool found = EINA_FALSE; + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + if ((cw->bd) && (cw->bd == bd)) + { + found = EINA_TRUE; + break; + } + } + + if (found) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + e_layout_child_lower_below(o, co->shadow); + } + } +} + +/* adjust the stack position of the background object to the bottom of layer */ +EAPI void +e_mod_comp_layer_bg_adjust(E_Comp_Layer *ly) +{ + e_layout_freeze(ly->layout); + + if (!ly->bg) + { + ly->bg = evas_object_rectangle_add(ly->canvas->evas); + evas_object_color_set(ly->bg, 0, 0, 0, 255); + evas_object_show(ly->bg); + e_layout_pack(ly->layout, ly->bg); + } + + e_layout_child_lower(ly->bg); + + e_layout_thaw(ly->layout); +} + +EAPI void +e_mod_comp_layer_effect_set(E_Comp_Layer *ly, + Eina_Bool set) +{ + if (strcmp(ly->name, "effect")) + return; + + if (set) + { + ly->count++; + ly->canvas->animation.run = 1; + ly->canvas->animation.num++; + + if (!evas_object_visible_get(ly->layout)) + { + e_mod_comp_composite_mode_set(ly->canvas->zone, EINA_TRUE); + evas_object_show(ly->layout); + } + } + else + { + /* decrease effect count and hide effect layer if it is 0 */ + ly->count--; + ly->canvas->animation.num--; + + if (ly->count <= 0) + { + E_FREE_LIST(ly->objs, ly->canvas->comp->effect_funcs.object_free); + evas_object_hide(ly->layout); + + ly->canvas->animation.run = 0; + ly->canvas->animation.num = 0; + ly->count = 0; + + e_mod_comp_composite_mode_set(ly->canvas->zone, EINA_FALSE); + } + } +} + +EAPI Eina_Bool +e_mod_comp_layer_effect_get(E_Comp_Layer *ly) +{ + E_CHECK_RETURN(ly, EINA_FALSE); + + if (strcmp(ly->name, "effect")) + return EINA_FALSE; + + return ly->canvas->animation.run; +} + +EAPI E_Comp_Effect_Object * +e_mod_comp_layer_effect_obj_get(E_Comp_Layer *ly, + Ecore_X_Window win) +{ + E_Comp_Effect_Object *obj = NULL; + Eina_List *l; + E_CHECK_RETURN(ly, NULL); + + if (strcmp(ly->name, "effect")) + return NULL; + + EINA_LIST_FOREACH(ly->objs, l, obj) + { + if (!obj) continue; + if (obj->win == win) + { + return obj; + } + } + + return NULL; +} + +static void +_ly_intercept_show(void *data, + Evas_Object *obj) +{ + E_Comp_Layer *ly = (E_Comp_Layer *)data; + + ELBF(ELBT_COMP, 0, 0, + "%15.15s|name:%s layout:%p obj:%p", + "LY_PRE_SHOW", ly->name, ly->layout, obj); + + /* TODO: an incontrollable effect layer show problem can occasionally occur. */ + if (!strcmp(ly->name, "effect")) + { + if (!ly->canvas->animation.run) + { + ELBF(ELBT_COMP, 0, 0, + "%15.15s|name:%s layout:%p obj:%p SKIP SHOW run:%d", + "LY_PRE_SHOW", ly->name, ly->layout, obj, + ly->canvas->animation.run); + + return; + } + } + + evas_object_show(obj); +} + +static void +_ly_intercept_hide(void *data, + Evas_Object *obj) +{ + E_Comp_Layer *ly = (E_Comp_Layer *)data; + + ELBF(ELBT_COMP, 0, 0, + "%15.15s|name:%s layout:%p obj:%p", + "LY_PRE_HIDE", ly->name, ly->layout, obj); + + evas_object_hide(obj); +} + +/* externally accessible functions */ +EAPI E_Comp_Canvas * +e_mod_comp_canvas_add(E_Comp *c, + E_Zone *zone) +{ + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + int x, y, w, h; + E_CHECK_RETURN(c, 0); + + canvas = E_NEW(E_Comp_Canvas, 1); + E_CHECK_RETURN(canvas, 0); + + if (zone) + { + x = zone->x; + y = zone->y; + w = zone->w; + h = zone->h; + } + else + { + x = 0; + y = 0; + w = c->man->w; + h = c->man->h; + } + + if (_comp_mod->conf->engine == ENGINE_GL) + { + int opt[20]; + int opt_i = 0; + + if (_comp_mod->conf->indirect) + { + opt[opt_i] = ECORE_EVAS_GL_X11_OPT_INDIRECT; + opt_i++; + opt[opt_i] = 1; + opt_i++; + } + if (_comp_mod->conf->vsync) + { + opt[opt_i] = ECORE_EVAS_GL_X11_OPT_VSYNC; + opt_i++; + opt[opt_i] = 1; + opt_i++; + } + if (opt_i > 0) + { + opt[opt_i] = ECORE_EVAS_GL_X11_OPT_NONE; + canvas->ee = ecore_evas_gl_x11_options_new(NULL, c->win, x, y, w, h, opt); + } + if (!canvas->ee) + canvas->ee = ecore_evas_gl_x11_new(NULL, c->win, x, y, w, h); + + if (canvas->ee) + c->gl = 1; + + } + if (!canvas->ee) + { + if (_comp_mod->conf->engine == ENGINE_GL) + { + e_util_dialog_internal + (_("Compositor Warning"), + _("Your screen does not support OpenGL.
" + "Falling back to software engine.")); + } + + canvas->ee = ecore_evas_software_x11_new(NULL, c->win, x, y, w, h); + } + if (!canvas->ee) + { + e_util_dialog_internal + (_("Compositor Error"), + _("Failed to initialize Ecore Evas.")); + goto error_cleanup; + } + + canvas->x = x; + canvas->y = y; + canvas->w = w; + canvas->h = h; + + canvas->comp = c; + canvas->num = _canvas_num++; + + ecore_evas_comp_sync_set(canvas->ee, 0); + canvas->evas = ecore_evas_get(canvas->ee); + + evas_event_callback_add(canvas->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, + _pre_swap, c); + evas_event_callback_add(canvas->evas, EVAS_CALLBACK_RENDER_FLUSH_POST, + _post_swap, c); + + canvas->bg_img = evas_object_rectangle_add(canvas->evas); + if (_comp_mod->conf->use_hwc) + { + ecore_evas_alpha_set(canvas->ee, EINA_TRUE); + evas_object_color_set(canvas->bg_img, 0, 0, 0, 0); + } + else + evas_object_color_set(canvas->bg_img, 0, 0, 0, 255); + + evas_object_stack_below(canvas->bg_img, evas_object_bottom_get(canvas->evas)); + evas_object_move(canvas->bg_img, 0, 0); + evas_object_resize(canvas->bg_img, w, h); + evas_object_show(canvas->bg_img); + + ecore_evas_show(canvas->ee); + + canvas->ee_win = ecore_evas_window_get(canvas->ee); + canvas->zone = zone; + + canvas->stereoscopic_mode = E_COMP_STEREO_MONO; + + /* TODO: make a configurable list */ + int i; + const char *names[] = {"comp", "effect", "move", "ly-ctrl"}; + for (i = 0; i < 4; i++) + { + ly = E_NEW(E_Comp_Layer, 1); + E_CHECK_GOTO(ly, error_cleanup); + ly->name = strdup(names[i]); + if (!ly->name) + { + E_FREE(ly); + goto error_cleanup; + } + + ly->layout = e_layout_add(canvas->evas); + if (!ly->layout) + { + free(ly->name); + E_FREE(ly); + goto error_cleanup; + } + + evas_object_color_set(ly->layout, 255, 255, 255, 255); + + ly->x = 0; + ly->y = 0; + ly->w = w; + ly->h = h; + ly->canvas = canvas; + ly->need_init = EINA_TRUE; + + e_mod_comp_layer_eval(ly); + + if (!strcmp(names[i], "comp")) + evas_object_show(ly->layout); + + evas_object_intercept_show_callback_add(ly->layout, _ly_intercept_show, ly); + evas_object_intercept_hide_callback_add(ly->layout, _ly_intercept_hide, ly); + + canvas->layers = eina_list_append(canvas->layers, ly); + + ELBF(ELBT_COMP, 0, i, "E_Comp_Layer:%s", names[i]); + } + + // comp can create only one ecore_evas for H/W overlay window + // this limit will be removed later + if ((_comp_mod->conf->use_hw_ov) && + ((!zone) || (zone->num == 0)) && + (!c->use_hw_ov)) + { + canvas->ov = e_mod_comp_hw_ov_win_new(c->win, x, y, w, h); + if (canvas->ov) + { + c->use_hw_ov = EINA_TRUE; + e_mod_comp_hw_ov_win_root_set(canvas->ov, c->man->root); + } + } + + canvas->zr = c->effect_funcs.zone_rotation_new(canvas); + E_CHECK_GOTO(canvas->zr, error_cleanup); + + if (_comp_mod->conf->use_hwc) + { + if (c->hwcomp_funcs.hwcomp_new) + canvas->hwcomp = c->hwcomp_funcs.hwcomp_new(canvas); + else + canvas->hwcomp = NULL; + + if (!canvas->hwcomp) + { + e_util_dialog_internal + (_("Compositor Error"), + _("Your screen does not support the HWC
" + "This is needed for it to function.")); + E_FREE(canvas); + return NULL; + } + + _comp_mod->conf->nocomp_fs = 0; + } + + c->canvases = eina_list_append(c->canvases, canvas); + + return canvas; + +error_cleanup: + if (canvas->zr) + c->effect_funcs.zone_rotation_free(canvas->zr); + + EINA_LIST_FREE(canvas->layers, ly) + { + free(ly->name); + evas_object_del(ly->layout); + E_FREE(ly); + } + if (canvas->ee) + ecore_evas_free(canvas->ee); + + memset(canvas, 0, sizeof(E_Comp_Canvas)); + E_FREE(canvas); + + return NULL; +} + +EAPI void +e_mod_comp_canvas_del(E_Comp_Canvas *canvas) +{ + E_Comp_Layer *ly; + E_Comp *c = e_mod_comp_util_get(); + + if (_comp_mod->conf->use_hwc) + { + if (c->hwcomp_funcs.hwcomp_free) + c->hwcomp_funcs.hwcomp_free(canvas->hwcomp); + canvas->hwcomp = NULL; + } + + if (canvas->fps.fg) + { + evas_object_del(canvas->fps.fg); + canvas->fps.fg = NULL; + } + if (canvas->fps.bg) + { + evas_object_del(canvas->fps.bg); + canvas->fps.bg = NULL; + } + if (canvas->bg_img) + { + evas_object_del(canvas->bg_img); + canvas->bg_img = NULL; + } + if (canvas->zr) + { + canvas->comp->effect_funcs.zone_rotation_free(canvas->zr); + canvas->zr = NULL; + } + if (canvas->ov) + { + e_mod_comp_hw_ov_win_free(canvas->ov); + canvas->ov = NULL; + canvas->comp->use_hw_ov = EINA_FALSE; + } + if ((c) && (c->gl)) + ecore_evas_gl_x11_pre_post_swap_callback_set(canvas->ee, NULL, NULL, NULL); + ecore_evas_manual_render(canvas->ee); + + EINA_LIST_FREE(canvas->layers, ly) + { + free(ly->name); + evas_object_del(ly->layout); + E_FREE(ly); + } + + ecore_evas_free(canvas->ee); + memset(canvas, 0, sizeof(E_Comp_Canvas)); + E_FREE(canvas); +} + +EAPI E_Comp_Layer * +e_mod_comp_canvas_layer_get(E_Comp_Canvas *canvas, + const char *name) +{ + E_Comp_Layer *ly; + Eina_List *l; + + E_CHECK_RETURN(canvas, NULL); + E_CHECK_RETURN(name, NULL); + + EINA_LIST_FOREACH(canvas->layers, l, ly) + { + if (!strcmp(ly->name, name)) + return ly; + } + + return NULL; +} + +EAPI E_Comp_Win * +e_mod_comp_canvas_fullscreen_check(E_Comp_Canvas *canvas) +{ + E_Comp *c = canvas->comp; + E_Comp_Win *cw = NULL; + + if (c->fake_image_launch) + { + Eina_Bool res = c->effect_funcs.image_launch_running_check(c->eff_img); + E_CHECK_RETURN(!res, NULL); + } + + E_CHECK_RETURN(c->wins, NULL); + E_CHECK_RETURN(_comp_mod->conf->nocomp_fs, NULL); + + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + if ((!cw->visible) || + (cw->input_only) || + (cw->invalid)) + { + continue; + } + if (!E_INTERSECTS(canvas->x, canvas->y, canvas->w, canvas->h, + cw->x, cw->y, cw->w, cw->h)) + { + continue; + } +#ifdef _F_USE_BORDER_TRANSFORM_ + if ((cw) && (cw->bd) && (e_border_transform_enable_get(cw->bd))) + { + return NULL; + } + else +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ + { + if (REGION_EQUAL_TO_CANVAS(cw, canvas) && + (!cw->argb) && + (!cw->shaped) && + (cw->dmg_updates >= 1) && + (!cw->show_ready) && + (cw->show_done) && + (cw->use_dri2)) + { + if (cw->always_selective_mode) + { + ELBF(ELBT_COMP, 0, 0, "ALWAYS_SELECTIVE_MODE [%x]", e_mod_comp_util_client_xid_get(cw)); + return NULL; + } + return cw; + } + else + return NULL; + } + } + return NULL; +} + +EAPI void +e_mod_comp_canvas_nocomp_prepare(E_Comp_Canvas *canvas, + E_Comp_Win *cw) +{ + E_CHECK(canvas); + E_CHECK(cw); + E_CHECK(canvas->nocomp.mode == E_NOCOMP_MODE_NONE); + + canvas->nocomp.mode = E_NOCOMP_MODE_PREPARE; + canvas->nocomp.prepare.cw = cw; + canvas->nocomp.prepare.timer = ecore_timer_add(_comp_mod->conf->nocomp_begin_timeout, + _nocomp_prepare_timeout, + canvas); +} + +EAPI Eina_Bool +e_mod_comp_canvas_nocomp_begin(E_Comp_Canvas *canvas) +{ + E_Comp *c = NULL; + E_Comp_Win *cw = NULL; + + E_CHECK_RETURN(canvas, EINA_FALSE); + c = canvas->comp; + E_CHECK_RETURN(c, EINA_FALSE); + cw = canvas->nocomp.prepare.cw; + E_CHECK_RETURN(cw, EINA_FALSE); + + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "NOCOMP_BEGIN canvas:%d dmg:%d", + canvas->num, cw->dmg_updates); + + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_NOCOMP, + ">> %d NOCOMP 0x%x dmg:%d", + canvas->num, + e_mod_comp_util_client_xid_get(cw), + cw->dmg_updates); + + ecore_x_grab(); + + if (cw->redirected) + { + ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL); + cw->redirected = 0; + } + + if (cw->damage) + { + Ecore_X_Region parts; + e_mod_comp_win_del_damage(cw, cw->damage); + parts = ecore_x_region_new(NULL, 0); + ecore_x_damage_subtract(cw->damage, 0, parts); + ecore_x_region_free(parts); + ecore_x_damage_free(cw->damage); + cw->damage = 0; + } + + e_mod_comp_win_comp_objs_img_deinit(cw); + if (cw->pixmap) + { + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + } + + ecore_x_window_shape_rectangle_subtract(c->win, + canvas->x, + canvas->y, + canvas->w, + canvas->h); + ecore_x_sync(); + ecore_x_ungrab(); + + ecore_evas_manual_render_set(canvas->ee, 1); + c->nocomp = 1; + //c->render_overflow = OVER_FLOW; + canvas->nocomp.mode = E_NOCOMP_MODE_RUN; + canvas->nocomp.cw = cw; + canvas->nocomp.prepare.cw = NULL; + + if (canvas->nocomp.prepare.timer) + { + ecore_timer_del(canvas->nocomp.prepare.timer); + canvas->nocomp.prepare.timer = NULL; + } + + if (cw->update_timeout) + { + ecore_timer_del(cw->update_timeout); + cw->update_timeout = NULL; + } + + cw->nocomp = 1; + cw->pw = 0; + cw->ph = 0; + cw->needpix = 1; + + e_mod_comp_win_shape_input_invalid_set(c, 1); + e_mod_comp_win_render_queue(cw); + + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_canvas_nocomp_end(E_Comp_Canvas *canvas) +{ + E_Comp *c = NULL; + E_Comp_Win *cw = NULL; + + E_CHECK_RETURN(_comp_mod->conf->nocomp_fs, EINA_FALSE); + + c = canvas->comp; + E_CHECK_RETURN(c, EINA_FALSE); + + cw = canvas->nocomp.cw; + E_CHECK_RETURN(cw, EINA_FALSE); + + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "NOCOMP_END canvas:%d dmg:%d", + canvas->num, cw->dmg_updates); + + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_NOCOMP, + ">> %d COMP 0x%x", + canvas->num, + e_mod_comp_util_client_xid_get(cw)); + + ecore_x_grab(); + if (!cw->damage) + { + cw->damage = ecore_x_damage_new + (cw->win, ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES); + e_mod_comp_win_add_damage(cw, cw->damage); + } + + ecore_x_window_shape_rectangle_add(c->win, + canvas->x, + canvas->y, + canvas->w, + canvas->h); + if (!cw->redirected) + { + ecore_x_composite_redirect_window(cw->win, + ECORE_X_COMPOSITE_UPDATE_MANUAL); + cw->redirected = 1; + } + ecore_x_sync(); + ecore_x_ungrab(); + +#if USE_NOCOMP_DISPOSE + canvas->nocomp.mode = E_NOCOMP_MODE_END; + canvas->nocomp.end.cw = cw; + canvas->nocomp.cw = NULL; + canvas->nocomp.end.dmg_updates = cw->dmg_updates + 2; + + + if (canvas->nocomp.end.timer) + { + ecore_timer_del(canvas->nocomp.end.timer); + canvas->nocomp.end.timer = NULL; + } + canvas->nocomp.end.timer = ecore_timer_add(2.0f, + _nocomp_end_timeout, + canvas); +#else + e_mod_comp_canvas_nocomp_dispose(canvas); +#endif + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_canvas_nocomp_dispose(E_Comp_Canvas *canvas) +{ + E_Comp *c = NULL; + E_Comp_Win *cw = NULL; + Ecore_X_Pixmap pm; + E_Update_Rect *r; + int i; + + E_CHECK_RETURN(_comp_mod->conf->nocomp_fs, EINA_FALSE); +#if USE_NOCOMP_DISPOSE + E_CHECK_RETURN((canvas->nocomp.mode == E_NOCOMP_MODE_END), EINA_FALSE); +#endif + + c = canvas->comp; + E_CHECK_RETURN(c, EINA_FALSE); + +#if USE_NOCOMP_DISPOSE + cw = canvas->nocomp.end.cw; +#else + cw = canvas->nocomp.cw; + canvas->nocomp.cw = NULL; +#endif + E_CHECK_RETURN(cw, EINA_FALSE); + E_CHECK_GOTO(cw->win, finish); + + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "NOCOMP_DISPOSE canvas:%d dmg:%d", + canvas->num, cw->dmg_updates); + + if (canvas->nocomp.end.timer) + { + ecore_timer_del(canvas->nocomp.end.timer); + canvas->nocomp.end.timer = NULL; + } + + pm = ecore_x_composite_name_window_pixmap_get(cw->win); + if (pm) + { + Ecore_X_Pixmap oldpm; + cw->needpix = 0; + e_mod_comp_win_comp_objs_needxim_set(cw, 1); + oldpm = cw->pixmap; + cw->pixmap = pm; + if (cw->pixmap) + { + ecore_x_pixmap_geometry_get(cw->pixmap, NULL, NULL, &(cw->pw), &(cw->ph)); + if (!((cw->pw == cw->w) && (cw->ph == cw->h))) + { + ELBF(ELBT_COMP, 0, + e_mod_comp_util_client_xid_get(cw), + "NOCOMP_DISPOSE Size was not same. cw(w=%d, h=%d), pw(w=%d, h=%d)", + cw->w, cw->h, cw->pw, cw->ph); + cw->needpix = 1; +#if USE_NOCOMP_DISPOSE + cw->pw = cw->w; + cw->ph = cw->h; + cw->pixmap = oldpm; + ecore_x_pixmap_free(pm); +#endif + } + if ((cw->pw > 0) && (cw->ph > 0)) + { + e_mod_comp_win_comp_objs_img_resize(cw, cw->pw, cw->ph); + e_mod_comp_win_comp_objs_resize(cw, cw->pw, cw->ph); + } + } + else + { + cw->pw = 0; + cw->ph = 0; + } + if ((cw->pw <= 0) || (cw->ph <= 0)) + { + e_mod_comp_win_comp_objs_img_deinit(cw); + if (cw->pixmap) + { + ecore_x_pixmap_free(cw->pixmap); + cw->pixmap = 0; + } + cw->pw = 0; + cw->ph = 0; + } + ecore_x_e_comp_pixmap_set(cw->win, cw->pixmap); + e_mod_comp_win_comp_objs_native_set(cw, 0); + e_mod_comp_update_resize(cw->up, cw->pw, cw->ph); + e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + if (oldpm) ecore_x_pixmap_free(oldpm); + } + if (((cw->c->gl && _comp_mod->conf->texture_from_pixmap) || _comp_mod->conf->use_efl_native_surface) + && (!cw->shaped) + && (!cw->rects)) + { + e_mod_comp_win_comp_objs_img_size_set(cw, cw->pw, cw->ph); + e_mod_comp_win_comp_objs_img_init(cw); + r = e_mod_comp_update_rects_get(cw->up); + if (r) + { + for (i = 0; r[i].w > 0; i++) + { + int x, y, w, h; + x = r[i].x; y = r[i].y; + w = r[i].w; h = r[i].h; + e_mod_comp_win_comp_objs_img_data_update_add(cw, x, y, w, h); + } + e_mod_comp_update_clear(cw->up); + free(r); + } + } + + cw->nocomp = 0; + e_mod_comp_win_render_queue(cw); + +finish: + ecore_evas_manual_render_set(canvas->ee, 0); + canvas->nocomp.end.cw = NULL; + canvas->nocomp.end.dmg_updates = 0; + canvas->nocomp.mode = E_NOCOMP_MODE_NONE; + c->nocomp = 0; + + return EINA_TRUE; +} + +EINTERN void +e_mod_comp_canvas_stereo_layout_set(E_Comp_Canvas *canvas) +{ + unsigned int stereo_mode = 0; + E_Comp_Layer *ly = NULL; + + stereo_mode = canvas->stereoscopic_mode; + + ly = e_mod_comp_canvas_layer_get(canvas, "comp"); + + if (!ly) return; + + e_layout_freeze(ly->layout); + if (stereo_mode == E_COMP_STEREO_HORIZONTAL) + { + e_layout_virtual_size_set(ly->layout, ly->w, (ly->h)*2); + } + else if (stereo_mode == E_COMP_STEREO_VERTICAL) + { + e_layout_virtual_size_set(ly->layout, (ly->w)*2, ly->h); + } + else if ((stereo_mode == E_COMP_STEREO_INTERLACED) || + (stereo_mode == E_COMP_STEREO_MONO)) + { + e_layout_virtual_size_set(ly->layout, ly->w, ly->h); + } + + e_layout_thaw(ly->layout); +} + +/* local subsystem functions */ +static void +_fps_update(E_Comp_Canvas *canvas) +{ + char buf[128]; + double fps = 0.0, t, dt; + int i; + Evas_Coord x = 0, y = 0, w = 0, h = 0; + E_Zone *z; + + if (!_comp_mod->conf->fps_show) return; + + t = ecore_time_get(); + + if (_comp_mod->conf->fps_average_range < 1) + _comp_mod->conf->fps_average_range = 30; + else if (_comp_mod->conf->fps_average_range > 120) + _comp_mod->conf->fps_average_range = 120; + + dt = t - canvas->fps.frametimes[_comp_mod->conf->fps_average_range - 1]; + + if (dt > 0.0) fps = (double)_comp_mod->conf->fps_average_range / dt; + else fps = 0.0; + + if (fps > 0.0) snprintf(buf, sizeof(buf), "FPS: %1.1f", fps); + else snprintf(buf, sizeof(buf), "FPS: N/A"); + + for (i = 121; i >= 1; i--) canvas->fps.frametimes[i] = canvas->fps.frametimes[i - 1]; + canvas->fps.frametimes[0] = t; + canvas->fps.frameskip++; + + if (canvas->fps.frameskip >= _comp_mod->conf->fps_average_range) + { + canvas->fps.frameskip = 0; + evas_object_text_text_set(canvas->fps.fg, buf); + } + + evas_object_geometry_get(canvas->fps.fg, NULL, NULL, &w, &h); + + w += 8; + h += 8; + + z = canvas->zone; + if (z) + { + switch (_comp_mod->conf->fps_corner) + { + case 3: // bottom-right + x = z->w - w; + y = z->h - h; + break; + case 2: // bottom-left + x = 0; + y = z->y + z->h - h; + break; + case 1: // top-right + x = z->w - w; + y = z->y; + break; + default: // 0 // top-left + x = 0; + y = z->y; + break; + } + } + evas_object_move(canvas->fps.bg, x, y); + evas_object_resize(canvas->fps.bg, w, h); + evas_object_move(canvas->fps.fg, x + 4, y + 4); +} + +static void +_pre_swap(void *data, Evas *e, void *event_info) +{ + E_Comp *c = (E_Comp *)data; + Eina_List *l; + E_Comp_Canvas *canvas; + E_CHECK(c); + + e_mod_comp_x_grab_set(c, EINA_FALSE); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->evas != e) continue; + + ELB(ELBT_COMP_RENDER, "----------------SWAP----------------", canvas->num); + + + if ((_comp_mod->conf->use_hwc) && (c->hwcomp_funcs.fullcomp_pending_release)) + { + c->hwcomp_funcs.fullcomp_pending_release(canvas->hwcomp); + } + + if (_comp_mod->conf->fps_show) + { + if (!canvas->fps.bg) + { + canvas->fps.bg = evas_object_rectangle_add(canvas->evas); + evas_object_color_set(canvas->fps.bg, 0, 0, 0, 128); + evas_object_layer_set(canvas->fps.bg, EVAS_LAYER_MAX); + evas_object_show(canvas->fps.bg); + } + if (!canvas->fps.fg) + { + canvas->fps.fg = evas_object_text_add(canvas->evas); + evas_object_text_font_set(canvas->fps.fg, "Sans", 30); + evas_object_text_text_set(canvas->fps.fg, "FPS: 0.0"); + evas_object_color_set(canvas->fps.fg, 255, 255, 255, 255); + evas_object_layer_set(canvas->fps.fg, EVAS_LAYER_MAX); + evas_object_show(canvas->fps.fg); + } + _fps_update(canvas); + } + else + { + if (canvas->fps.fg) + { + evas_object_del(canvas->fps.fg); + canvas->fps.fg = NULL; + } + if (canvas->fps.bg) + { + evas_object_del(canvas->fps.bg); + canvas->fps.bg = NULL; + } + } + } +} + +static void +_post_swap(void *data, Evas *e, void *event_info) +{ + E_Comp *c = (E_Comp *)data; + E_CHECK(c); + E_CHECK(_comp_mod->conf->nocomp_fs); + + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_Win *cw = NULL; + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (canvas->evas != e) continue; + if (canvas->nocomp.mode != E_NOCOMP_MODE_NONE) continue; + if (canvas->nocomp.force_composite) continue; + if (canvas->animation.run) continue; + + cw = e_mod_comp_canvas_fullscreen_check(canvas); + if (!cw) continue; + + e_mod_comp_canvas_nocomp_prepare(canvas, cw); + } +} + +static Eina_Bool +_nocomp_prepare_timeout(void *data) +{ + E_Comp_Canvas *canvas = (E_Comp_Canvas *)data; + E_Comp_Win *cw; + E_CHECK_RETURN(canvas, ECORE_CALLBACK_CANCEL); + + if (canvas->nocomp.prepare.timer) + { + ecore_timer_del(canvas->nocomp.prepare.timer); + canvas->nocomp.prepare.timer = NULL; + } + + if ((canvas->nocomp.force_composite)|| + (canvas->animation.run)) + { + canvas->nocomp.prepare.cw = NULL; + canvas->nocomp.mode = E_NOCOMP_MODE_NONE; + return ECORE_CALLBACK_CANCEL; + } + + cw = e_mod_comp_canvas_fullscreen_check(canvas); + if (!cw) + { + canvas->nocomp.prepare.cw = NULL; + canvas->nocomp.mode = E_NOCOMP_MODE_NONE; + return ECORE_CALLBACK_CANCEL; + } + else if (cw != canvas->nocomp.prepare.cw) + { + canvas->nocomp.prepare.cw = cw; + canvas->nocomp.prepare.timer = ecore_timer_add(_comp_mod->conf->nocomp_begin_timeout, + _nocomp_prepare_timeout, + canvas); + return ECORE_CALLBACK_CANCEL; + } + + e_mod_comp_canvas_nocomp_begin(canvas); + + return ECORE_CALLBACK_CANCEL; +} + +#if USE_NOCOMP_DISPOSE +static Eina_Bool +_nocomp_end_timeout(void *data) +{ + E_Comp_Canvas *canvas = (E_Comp_Canvas *)data; + if (canvas->nocomp.end.timer) + { + ecore_timer_del(canvas->nocomp.end.timer); + canvas->nocomp.end.timer = NULL; + } + e_mod_comp_canvas_nocomp_dispose(canvas); + return ECORE_CALLBACK_CANCEL; +} +#endif diff --git a/src/e_mod_comp_canvas.h b/src/e_mod_comp_canvas.h new file mode 100644 index 0000000..85a1beb --- /dev/null +++ b/src/e_mod_comp_canvas.h @@ -0,0 +1,106 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_CANVAS_H +#define E_MOD_COMP_CANVAS_H + +typedef struct _E_Comp_Canvas E_Comp_Canvas; +typedef struct _E_Comp_Layer E_Comp_Layer; + +//enum for stereoscopic view modes +typedef enum _E_Comp_Stereo_Mode +{ + E_COMP_STEREO_MONO = 0, + E_COMP_STEREO_HORIZONTAL = 1, + E_COMP_STEREO_VERTICAL = 2, + E_COMP_STEREO_INTERLACED = 3, +} E_Comp_Stereo_Mode; + +typedef enum _E_Nocomp_Mode +{ + E_NOCOMP_MODE_NONE, + E_NOCOMP_MODE_PREPARE, + E_NOCOMP_MODE_BEGIN, + E_NOCOMP_MODE_RUN, + E_NOCOMP_MODE_END, + E_NOCOMP_MODE_DISPOSE +} E_Nocomp_Mode; + +struct _E_Comp_Layer +{ + char *name; + Evas_Object *layout; // e_layout + Evas_Object *bg; // background rectangle object for e_layout + int x, y, w, h; // geometry + E_Comp_Canvas *canvas; // parent canvas + unsigned int count; // indicates number of running effect objects, if 0 then layer will be hidden + Eina_List *objs; // list of E_Comp_Effect_Object + Eina_Bool need_init; // EINA_TRUE: need to initialize, EINA_FALSE: already initialized. +}; + +struct _E_Comp_Canvas +{ + E_Comp *comp; + E_Zone *zone; // NULL if we have a single big canvas for all screens + Ecore_Evas *ee; + Ecore_X_Window ee_win; + Evas *evas; + Eina_List *layers; // list of E_Comp_Layer + int x, y, w, h; // geometry + int num; + struct { + Evas_Object *bg; + Evas_Object *fg; + double frametimes[122]; + int frameskip; + } fps; + struct { + E_Nocomp_Mode mode; + E_Comp_Win *cw; + Eina_Bool force_composite; + int comp_ref; // indicates the number of modules using composite mode + struct { + E_Comp_Win *cw; + Ecore_Timer *timer; + } prepare; + struct { + E_Comp_Win *cw; + Ecore_Timer *timer; + int dmg_updates; + } end; + } nocomp; + struct { + Eina_Bool run; + int num; + } animation; + Evas_Object *bg_img; + Eina_Bool use_bg_img : 1; + E_Comp_HW_Ov_Win *ov; + E_Comp_Effect_Zone_Rotation *zr; + Eina_Bool xv_ready[3]; // [0]: XV is running [1]: rotation_end_event was occcured [2]: XV_BYPASS_DONE1 msg was received + + E_Comp_HWComp *hwcomp; + E_Comp_Stereo_Mode stereoscopic_mode; //stereoscopic view mode +}; + +EAPI E_Comp_Canvas *e_mod_comp_canvas_add(E_Comp *c, E_Zone *zone); +EAPI void e_mod_comp_canvas_del(E_Comp_Canvas *canvas); +EAPI E_Comp_Win *e_mod_comp_canvas_fullscreen_check(E_Comp_Canvas *canvas); +EAPI void e_mod_comp_canvas_nocomp_prepare(E_Comp_Canvas *canvas, E_Comp_Win *cw); +EAPI Eina_Bool e_mod_comp_canvas_nocomp_begin(E_Comp_Canvas *canvas); +EAPI Eina_Bool e_mod_comp_canvas_nocomp_end(E_Comp_Canvas *canvas); +EAPI Eina_Bool e_mod_comp_canvas_nocomp_dispose(E_Comp_Canvas *canvas); +EAPI E_Comp_Layer *e_mod_comp_canvas_layer_get(E_Comp_Canvas *canvas, const char *name); +EAPI void e_mod_comp_canvas_stereo_layout_set(E_Comp_Canvas *canvas); + +EAPI void e_mod_comp_layer_populate(E_Comp_Layer *ly, Evas_Object *o); +EAPI void e_mod_comp_layer_populate_above_normal(E_Comp_Layer *ly, Evas_Object *o); +EAPI void e_mod_comp_layer_raise_above(E_Comp_Canvas *canvas, Evas_Object *o, E_Border *bd); +EAPI void e_mod_comp_layer_lower_below(E_Comp_Canvas *canvas, Evas_Object *o, E_Border *bd); +EAPI void e_mod_comp_layer_eval(E_Comp_Layer *ly); +EAPI void e_mod_comp_layer_bg_adjust(E_Comp_Layer *ly); +EAPI void e_mod_comp_layer_effect_set(E_Comp_Layer *ly, Eina_Bool set); +EAPI Eina_Bool e_mod_comp_layer_effect_get(E_Comp_Layer *ly); +EAPI E_Comp_Effect_Object *e_mod_comp_layer_effect_obj_get(E_Comp_Layer *ly, Ecore_X_Window win); + +#endif +#endif diff --git a/src/e_mod_comp_cfdata.c b/src/e_mod_comp_cfdata.c new file mode 100755 index 0000000..81b70b9 --- /dev/null +++ b/src/e_mod_comp_cfdata.c @@ -0,0 +1,366 @@ +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_comp_cfdata.h" + +EAPI void +e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd) +{ + *match_edd = E_CONFIG_DD_NEW("Comp_Match", Match); +#undef T +#undef D +#define T Match +#define D *match_edd + E_CONFIG_VAL(D, T, title, STR); + E_CONFIG_VAL(D, T, name, STR); + E_CONFIG_VAL(D, T, clas, STR); + E_CONFIG_VAL(D, T, role, STR); + E_CONFIG_VAL(D, T, primary_type, INT); + E_CONFIG_VAL(D, T, borderless, CHAR); + E_CONFIG_VAL(D, T, dialog, CHAR); + E_CONFIG_VAL(D, T, accepts_focus, CHAR); + E_CONFIG_VAL(D, T, vkbd, CHAR); + E_CONFIG_VAL(D, T, quickpanel, CHAR); + E_CONFIG_VAL(D, T, argb, CHAR); + E_CONFIG_VAL(D, T, fullscreen, CHAR); + E_CONFIG_VAL(D, T, modal, CHAR); + E_CONFIG_VAL(D, T, shadow_style, STR); + + *conf_edd = E_CONFIG_DD_NEW("Comp_Config", Config); +#undef T +#undef D +#define T Config +#define D *conf_edd + E_CONFIG_VAL(D, T, shadow_file, STR); + E_CONFIG_VAL(D, T, shadow_style, STR); + E_CONFIG_VAL(D, T, effect_file, STR); + E_CONFIG_VAL(D, T, hwcomp_file, STR); + E_CONFIG_VAL(D, T, engine, INT); + E_CONFIG_VAL(D, T, max_unmapped_pixels, INT); + E_CONFIG_VAL(D, T, max_unmapped_time, INT); + E_CONFIG_VAL(D, T, min_unmapped_time, INT); + E_CONFIG_VAL(D, T, fps_average_range, INT); + E_CONFIG_VAL(D, T, fps_corner, UCHAR); + E_CONFIG_VAL(D, T, fps_show, UCHAR); + E_CONFIG_VAL(D, T, use_shadow, UCHAR); + E_CONFIG_VAL(D, T, indirect, UCHAR); + E_CONFIG_VAL(D, T, texture_from_pixmap, UCHAR); + E_CONFIG_VAL(D, T, lock_fps, UCHAR); + E_CONFIG_VAL(D, T, loose_sync, UCHAR); + E_CONFIG_VAL(D, T, efl_sync, UCHAR); + E_CONFIG_VAL(D, T, grab, UCHAR); + E_CONFIG_VAL(D, T, vsync, UCHAR); + E_CONFIG_VAL(D, T, keep_unmapped, UCHAR); + E_CONFIG_VAL(D, T, send_flush, UCHAR); + E_CONFIG_VAL(D, T, send_dump, UCHAR); + E_CONFIG_VAL(D, T, nocomp_fs, UCHAR); + E_CONFIG_VAL(D, T, use_hwc, UCHAR); + E_CONFIG_VAL(D, T, smooth_windows, UCHAR); + E_CONFIG_VAL(D, T, first_draw_delay, DOUBLE); + E_CONFIG_VAL(D, T, canvas_per_zone, UCHAR); + E_CONFIG_VAL(D, T, use_lock_screen, UCHAR); + E_CONFIG_VAL(D, T, default_window_effect, UCHAR); + E_CONFIG_VAL(D, T, keyboard_effect, UCHAR); + E_CONFIG_VAL(D, T, xv_rotation_effect, UCHAR); + E_CONFIG_VAL(D, T, fake_image_launch, UCHAR); + E_CONFIG_VAL(D, T, fake_launch_layer, INT); + E_CONFIG_VAL(D, T, lower_layer, INT); + E_CONFIG_VAL(D, T, defer_raise_effect, UCHAR); + E_CONFIG_VAL(D, T, max_lock_screen_time, DOUBLE); + E_CONFIG_VAL(D, T, damage_timeout, DOUBLE); + E_CONFIG_VAL(D, T, nocomp_begin_timeout, DOUBLE); + E_CONFIG_VAL(D, T, use_hw_ov, UCHAR); + E_CONFIG_VAL(D, T, debug_info_show, UCHAR); + E_CONFIG_VAL(D, T, max_debug_msgs, INT); + E_CONFIG_VAL(D, T, debug_type_nocomp, UCHAR); + E_CONFIG_VAL(D, T, debug_type_swap, UCHAR); + E_CONFIG_VAL(D, T, debug_type_effect, UCHAR); + E_CONFIG_VAL(D, T, use_efl_native_surface, UCHAR); + E_CONFIG_VAL(D, T, stand_by_canvas_render_enable, UCHAR); + E_CONFIG_VAL(D, T, effect_policy_unknown, STR); + E_CONFIG_VAL(D, T, effect_policy_desktop, STR); + E_CONFIG_VAL(D, T, effect_policy_dock, STR); + E_CONFIG_VAL(D, T, effect_policy_toolbar, STR); + E_CONFIG_VAL(D, T, effect_policy_menu, STR); + E_CONFIG_VAL(D, T, effect_policy_utility, STR); + E_CONFIG_VAL(D, T, effect_policy_splash, STR); + E_CONFIG_VAL(D, T, effect_policy_dialog, STR); + E_CONFIG_VAL(D, T, effect_policy_normal, STR); + E_CONFIG_VAL(D, T, effect_policy_videocall, STR); + E_CONFIG_VAL(D, T, effect_policy_dropdown_menu, STR); + E_CONFIG_VAL(D, T, effect_policy_popup_menu, STR); + E_CONFIG_VAL(D, T, effect_policy_tooltip, STR); + E_CONFIG_VAL(D, T, effect_policy_notification, STR); + E_CONFIG_VAL(D, T, effect_policy_combo, STR); + E_CONFIG_VAL(D, T, effect_policy_dnd, STR); + E_CONFIG_VAL(D, T, effect_policy_menuscreen, STR); + E_CONFIG_VAL(D, T, effect_policy_quickpanel_base, STR); + E_CONFIG_VAL(D, T, effect_policy_quickpanel, STR); + E_CONFIG_VAL(D, T, effect_policy_taskmanager, STR); + E_CONFIG_VAL(D, T, effect_policy_livemagazine, STR); + E_CONFIG_VAL(D, T, effect_policy_lockscreen, STR); + E_CONFIG_VAL(D, T, effect_policy_indicator, STR); + E_CONFIG_VAL(D, T, effect_policy_tickernoti, STR); + E_CONFIG_VAL(D, T, effect_policy_debugging_info, STR); + E_CONFIG_VAL(D, T, effect_policy_apptray, STR); + E_CONFIG_VAL(D, T, effect_policy_mini_apptray, STR); + E_CONFIG_VAL(D, T, effect_policy_volume, STR); + E_CONFIG_VAL(D, T, effect_policy_background, STR); + E_CONFIG_VAL(D, T, effect_policy_isf_keyboard, STR); + E_CONFIG_VAL(D, T, effect_policy_isf_sub, STR); + E_CONFIG_VAL(D, T, effect_policy_setup_wizard, STR); + E_CONFIG_VAL(D, T, effect_policy_toast, STR); + E_CONFIG_VAL(D, T, effect_policy_app_popup, STR); + E_CONFIG_LIST(D, T, match.popups, *match_edd); + E_CONFIG_LIST(D, T, match.borders, *match_edd); + E_CONFIG_LIST(D, T, match.overrides, *match_edd); + E_CONFIG_LIST(D, T, match.menus, *match_edd); +} + +EAPI Config * +e_mod_comp_cfdata_config_new(void) +{ + Config *cfg; + Match *mat; + + cfg = E_NEW(Config, 1); + if (!cfg) return NULL; + + cfg->shadow_file = calloc(4096, sizeof(unsigned char)); + if (cfg->shadow_file) + { + snprintf((char *)(cfg->shadow_file), + 4096 * sizeof(unsigned char), + "%s/data/themes/shadow.edj", + e_prefix_data_get()); + fprintf(stdout, + "[E17-comp] shadow file path: %s\n", + cfg->shadow_file); + } + + cfg->shadow_style = eina_stringshare_add("default"); + cfg->effect_file = eina_stringshare_add("/usr/lib/enlightenment/modules/e17-mod-tizen-comp/effect/common.so"); + cfg->hwcomp_file = eina_stringshare_add("/usr/lib/enlightenment/modules/e17-mod-tizen-comp/effect/hwcomp.so"); + cfg->engine = ENGINE_GL; + cfg->max_unmapped_pixels = 32 * 1024; // implement + cfg->max_unmapped_time = 10 * 3600; // implement + cfg->min_unmapped_time = 5 * 60; // implement + cfg->fps_average_range = 30; + cfg->fps_corner = 0; + cfg->fps_show = 0; + cfg->use_shadow = 0; + cfg->indirect = 0; + cfg->texture_from_pixmap = 1; + cfg->lock_fps = 0; + cfg->loose_sync = 1; + cfg->efl_sync = 1; + cfg->grab = 0; + cfg->vsync = 1; + cfg->keep_unmapped = 1; + cfg->send_flush = 1; // implement + cfg->send_dump = 1; // implement + cfg->nocomp_fs = 0; // buggy + cfg->use_hwc = 0; // hardware_compositing + cfg->smooth_windows = 0; // 1 if gl, 0 if not + cfg->first_draw_delay = 0.15; + + cfg->canvas_per_zone = 1; + cfg->use_lock_screen = 1; + cfg->default_window_effect = 0; + cfg->keyboard_effect = 0; + cfg->xv_rotation_effect = 0; + cfg->fake_image_launch = 0; + cfg->fake_launch_layer = 0; + cfg->lower_layer = 5; + cfg->defer_raise_effect = 0; + cfg->max_lock_screen_time = 2.0; + cfg->damage_timeout = 10.0; + cfg->nocomp_begin_timeout = 2.0; + cfg->use_hw_ov = 0; + cfg->debug_info_show = 0; + cfg->max_debug_msgs = 1; + cfg->debug_type_nocomp = 1; + cfg->debug_type_swap = 0; + cfg->debug_type_effect = 0; + cfg->use_efl_native_surface = 1; + cfg->stand_by_canvas_render_enable = 0; + + cfg->effect_policy_unknown = eina_stringshare_add("shadow"); + cfg->effect_policy_desktop = eina_stringshare_add("no-effect"); + cfg->effect_policy_dock = eina_stringshare_add("shadow_fade"); + cfg->effect_policy_toolbar = eina_stringshare_add("no-effect"); + cfg->effect_policy_menu = eina_stringshare_add("no-effect"); + cfg->effect_policy_utility = eina_stringshare_add("no-effect"); + cfg->effect_policy_splash = eina_stringshare_add("no-effect"); + cfg->effect_policy_dialog = eina_stringshare_add("dialog"); + cfg->effect_policy_normal = eina_stringshare_add("shadow_fade"); + cfg->effect_policy_videocall = eina_stringshare_add("shadow_fade"); + cfg->effect_policy_dropdown_menu = eina_stringshare_add("no-effect"); + cfg->effect_policy_popup_menu = eina_stringshare_add("shadow"); + cfg->effect_policy_tooltip = eina_stringshare_add("shadow"); + cfg->effect_policy_notification = eina_stringshare_add("dialog"); + cfg->effect_policy_combo = eina_stringshare_add("no-effect"); + cfg->effect_policy_dnd = eina_stringshare_add("no-effect"); + cfg->effect_policy_menuscreen = eina_stringshare_add("home_screen"); + cfg->effect_policy_quickpanel_base = eina_stringshare_add("quickpanel"); + cfg->effect_policy_quickpanel = eina_stringshare_add("quickpanel"); + cfg->effect_policy_taskmanager = eina_stringshare_add("taskmgr"); + cfg->effect_policy_livemagazine = eina_stringshare_add("home_screen"); + cfg->effect_policy_lockscreen = eina_stringshare_add("lockscreen"); + cfg->effect_policy_indicator = eina_stringshare_add("indicator"); + cfg->effect_policy_tickernoti = eina_stringshare_add("dialog_without_dim"); + cfg->effect_policy_debugging_info = eina_stringshare_add("no-effect"); + cfg->effect_policy_apptray = eina_stringshare_add("app_tray"); + cfg->effect_policy_mini_apptray = eina_stringshare_add("app_tray"); + cfg->effect_policy_volume = eina_stringshare_add("dialog_without_dim"); + cfg->effect_policy_background = eina_stringshare_add("no-effect"); + cfg->effect_policy_isf_keyboard = eina_stringshare_add("keyboard"); + cfg->effect_policy_isf_sub = eina_stringshare_add("no-effect"); + cfg->effect_policy_setup_wizard = eina_stringshare_add("no-effect"); + cfg->effect_policy_toast = eina_stringshare_add("no-effect"); + cfg->effect_policy_app_popup = eina_stringshare_add("dialog_without_dim"); + + cfg->match.popups = NULL; + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.popups = eina_list_append(cfg->match.popups, mat); + mat->name = eina_stringshare_add("shelf"); + mat->shadow_style = eina_stringshare_add("popup"); + } + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.popups = eina_list_append(cfg->match.popups, mat); + mat->shadow_style = eina_stringshare_add("popup"); + } + cfg->match.borders = NULL; + + cfg->match.overrides = NULL; + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); + mat->name = eina_stringshare_add("E"); + mat->clas = eina_stringshare_add("Background_Window"); + mat->shadow_style = eina_stringshare_add("none"); + } + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); + mat->name = eina_stringshare_add("E"); + mat->clas = eina_stringshare_add("everything"); + mat->shadow_style = eina_stringshare_add("everything"); + } + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); + mat->primary_type = ECORE_X_WINDOW_TYPE_DROPDOWN_MENU; + mat->shadow_style = eina_stringshare_add("menu"); + } + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); + mat->primary_type = ECORE_X_WINDOW_TYPE_POPUP_MENU; + mat->shadow_style = eina_stringshare_add("menu"); + } + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); + mat->primary_type = ECORE_X_WINDOW_TYPE_COMBO; + mat->shadow_style = eina_stringshare_add("menu"); + } + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); + mat->primary_type = ECORE_X_WINDOW_TYPE_TOOLTIP; + mat->shadow_style = eina_stringshare_add("menu"); + } + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.overrides = eina_list_append(cfg->match.overrides, mat); + mat->shadow_style = eina_stringshare_add("popup"); + } + cfg->match.menus = NULL; + mat = E_NEW(Match, 1); + if (mat) + { + cfg->match.menus = eina_list_append(cfg->match.menus, mat); + mat->shadow_style = eina_stringshare_add("menu"); + } + + return cfg; +} + +static void +_match_list_free(Eina_List *list) +{ + Match *m; + + EINA_LIST_FREE(list, m) + { + if (m->title) eina_stringshare_del(m->title); + if (m->name) eina_stringshare_del(m->name); + if (m->clas) eina_stringshare_del(m->clas); + if (m->role) eina_stringshare_del(m->role); + if (m->shadow_style) eina_stringshare_del(m->shadow_style); + free(m); + } +} + +EAPI void +e_mod_cfdata_config_free(Config *cfg) +{ + if (cfg->shadow_file) eina_stringshare_del(cfg->shadow_file); + if (cfg->shadow_style) eina_stringshare_del(cfg->shadow_style); + if (cfg->effect_file) eina_stringshare_del(cfg->effect_file); + if (cfg->hwcomp_file) eina_stringshare_del(cfg->hwcomp_file); + + if (cfg->effect_policy_unknown) eina_stringshare_del(cfg->effect_policy_unknown); + if (cfg->effect_policy_desktop) eina_stringshare_del(cfg->effect_policy_desktop); + if (cfg->effect_policy_dock) eina_stringshare_del(cfg->effect_policy_dock); + if (cfg->effect_policy_toolbar) eina_stringshare_del(cfg->effect_policy_toolbar); + if (cfg->effect_policy_menu) eina_stringshare_del(cfg->effect_policy_menu); + if (cfg->effect_policy_utility) eina_stringshare_del(cfg->effect_policy_utility); + if (cfg->effect_policy_splash) eina_stringshare_del(cfg->effect_policy_splash); + if (cfg->effect_policy_dialog) eina_stringshare_del(cfg->effect_policy_dialog); + if (cfg->effect_policy_normal) eina_stringshare_del(cfg->effect_policy_normal); + if (cfg->effect_policy_videocall) eina_stringshare_del(cfg->effect_policy_videocall); + if (cfg->effect_policy_dropdown_menu) eina_stringshare_del(cfg->effect_policy_dropdown_menu); + if (cfg->effect_policy_popup_menu) eina_stringshare_del(cfg->effect_policy_popup_menu); + if (cfg->effect_policy_tooltip) eina_stringshare_del(cfg->effect_policy_tooltip); + if (cfg->effect_policy_notification) eina_stringshare_del(cfg->effect_policy_notification); + if (cfg->effect_policy_combo) eina_stringshare_del(cfg->effect_policy_combo); + if (cfg->effect_policy_dnd) eina_stringshare_del(cfg->effect_policy_dnd); + if (cfg->effect_policy_menuscreen) eina_stringshare_del(cfg->effect_policy_menuscreen); + if (cfg->effect_policy_quickpanel_base) eina_stringshare_del(cfg->effect_policy_quickpanel_base); + if (cfg->effect_policy_quickpanel) eina_stringshare_del(cfg->effect_policy_quickpanel); + if (cfg->effect_policy_taskmanager) eina_stringshare_del(cfg->effect_policy_taskmanager); + if (cfg->effect_policy_livemagazine) eina_stringshare_del(cfg->effect_policy_livemagazine); + if (cfg->effect_policy_lockscreen) eina_stringshare_del(cfg->effect_policy_lockscreen); + if (cfg->effect_policy_indicator) eina_stringshare_del(cfg->effect_policy_indicator); + if (cfg->effect_policy_tickernoti) eina_stringshare_del(cfg->effect_policy_tickernoti); + if (cfg->effect_policy_debugging_info) eina_stringshare_del(cfg->effect_policy_debugging_info); + if (cfg->effect_policy_apptray) eina_stringshare_del(cfg->effect_policy_apptray); + if (cfg->effect_policy_mini_apptray) eina_stringshare_del(cfg->effect_policy_mini_apptray); + if (cfg->effect_policy_volume) eina_stringshare_del(cfg->effect_policy_volume); + if (cfg->effect_policy_background) eina_stringshare_del(cfg->effect_policy_background); + if (cfg->effect_policy_isf_keyboard) eina_stringshare_del(cfg->effect_policy_isf_keyboard); + if (cfg->effect_policy_isf_sub) eina_stringshare_del(cfg->effect_policy_isf_sub); + if (cfg->effect_policy_setup_wizard) eina_stringshare_del(cfg->effect_policy_setup_wizard); + if (cfg->effect_policy_toast) eina_stringshare_del(cfg->effect_policy_toast); + if (cfg->effect_policy_app_popup) eina_stringshare_del(cfg->effect_policy_app_popup); + + _match_list_free(cfg->match.popups); + _match_list_free(cfg->match.borders); + _match_list_free(cfg->match.overrides); + _match_list_free(cfg->match.menus); + + free(cfg); +} + diff --git a/src/e_mod_comp_cfdata.h b/src/e_mod_comp_cfdata.h new file mode 100755 index 0000000..19ea47d --- /dev/null +++ b/src/e_mod_comp_cfdata.h @@ -0,0 +1,124 @@ +#ifndef E_MOD_COMP_CFDATA_H +#define E_MOD_COMP_CFDATA_H + +typedef struct _Config Config; +typedef struct _Match Match; + +struct _Config +{ + const char *shadow_file; + const char *shadow_style; + const char *effect_file; + const char *hwcomp_file; + int engine; + int max_unmapped_pixels; + int max_unmapped_time; + int min_unmapped_time; + int fps_average_range; + unsigned char fps_corner; + unsigned char fps_show; + unsigned char use_shadow; + unsigned char indirect; + unsigned char texture_from_pixmap; + unsigned char lock_fps; + unsigned char loose_sync; + unsigned char efl_sync; + unsigned char grab; + unsigned char vsync; + unsigned char keep_unmapped; + unsigned char send_flush; + unsigned char send_dump; + unsigned char nocomp_fs; + unsigned char use_hwc; + unsigned char smooth_windows; + double first_draw_delay; + unsigned char canvas_per_zone; + unsigned char use_lock_screen; + unsigned char default_window_effect; + unsigned char keyboard_effect; + unsigned char xv_rotation_effect; + unsigned char fake_image_launch; + int fake_launch_layer; + int lower_layer; + unsigned char defer_raise_effect; + double max_lock_screen_time; + double damage_timeout; + double nocomp_begin_timeout; + unsigned char use_hw_ov; + unsigned char debug_info_show; + int max_debug_msgs; + int debug_type_nocomp; + int debug_type_swap; + int debug_type_effect; + unsigned char use_efl_native_surface; + unsigned char stand_by_canvas_render_enable; + + const char *effect_policy_unknown; + const char *effect_policy_desktop; + const char *effect_policy_dock; + const char *effect_policy_toolbar; + const char *effect_policy_menu; + const char *effect_policy_utility; + const char *effect_policy_splash; + const char *effect_policy_dialog; + const char *effect_policy_normal; + const char *effect_policy_videocall; + const char *effect_policy_dropdown_menu; + const char *effect_policy_popup_menu; + const char *effect_policy_tooltip; + const char *effect_policy_notification; + const char *effect_policy_combo; + const char *effect_policy_dnd; + const char *effect_policy_menuscreen; + const char *effect_policy_quickpanel_base; + const char *effect_policy_quickpanel; + const char *effect_policy_taskmanager; + const char *effect_policy_livemagazine; + const char *effect_policy_lockscreen; + const char *effect_policy_indicator; + const char *effect_policy_tickernoti; + const char *effect_policy_debugging_info; + const char *effect_policy_apptray; + const char *effect_policy_mini_apptray; + const char *effect_policy_volume; + const char *effect_policy_background; + const char *effect_policy_isf_keyboard; + const char *effect_policy_isf_sub; + const char *effect_policy_setup_wizard; + const char *effect_policy_toast; + const char *effect_policy_app_popup; + + struct + { + Eina_List *popups; // used for e popups + Eina_List *borders; // used for borders + Eina_List *overrides; // used for client menus, tooltips etc. + Eina_List *menus; // used for e menus + } match; +}; + +struct _Match +{ + const char *title; // glob - used for borders, NULL if not to be used + const char *name; // glob - used for borders, overrides, popups, NULL if not to be used + const char *clas; // glob - used for borders, overrides, NULL if not to be used + const char *role; // glob - used for borders + + const char *shadow_style; // shadow style to use + + int primary_type; // Ecore_X_Window_Type - used for borders, overrides, first one found - ECORE_X_WINDOW_TYPE_UNKNOWN if not to be used + char borderless; // used for borders, 0 == dont use, 1 == borderless, -1 == not borderless + char dialog; // used for borders, 0 == don't use, 1 == dialog, -1 == not dialog + char accepts_focus; // used for borders, 0 == don't use, 1 == accepts focus, -1 == does not accept focus + char vkbd; // used for borders, 0 == don't use, 1 == is vkbd, -1 == not vkbd + char quickpanel; // used for borders, 0 == don't use, 1 == is quickpanel, -1 == not quickpanel + char argb; // used for borders, overrides, popups, menus, 0 == don't use, 1 == is argb, -1 == not argb + char fullscreen; // used for borders, 0 == don't use, 1 == is fullscreen, -1 == not fullscreen + char modal; // used for borders, 0 == don't use, 1 == is modal, -1 == not modal +}; + +EAPI void e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd); +EAPI Config *e_mod_comp_cfdata_config_new(void); +EAPI void e_mod_cfdata_config_free(Config *cfg); + +#endif diff --git a/src/e_mod_comp_debug.c b/src/e_mod_comp_debug.c new file mode 100644 index 0000000..2935439 --- /dev/null +++ b/src/e_mod_comp_debug.c @@ -0,0 +1,358 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +typedef struct _E_Mod_Comp_Log_Info +{ + int type; + char file[256]; +} E_Mod_Comp_Log_Info; + +/* TODO: remove */ +#define LT_NOTHING 0x0000 +#define LT_CREATE 0x0004 +#define LT_CONFIGURE 0x0008 +#define LT_DRAW 0x0020 +#define LT_DUMP 0x0100 + +/* local subsystem functions */ +static void +_e_mod_comp_debug_wins_info_dump(E_Comp *c, + FILE *fs) +{ + E_Comp_Win *cw; + Ecore_X_Window cid = 0; + char *wname = NULL, *wclas = NULL; + int pid = 0, i = 0; + char buf[4096], buf2[4096], buf3[4096]; + Eina_Bool res; + + fprintf(fs, "B-----------------------------------------------------------------------------------------------------------------------------\n"); + fprintf(fs, " NO WINDOW (CLIENT) V x y w h PIXMAP pw ph | v VAL DMGs DONE | PID WNAME WCLASS\n"); + fprintf(fs, "------------------------------------------------------------------------------------------------------------------------------\n"); + + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + cid = e_mod_comp_util_client_xid_get(cw); + ecore_x_icccm_name_class_get(cid, &wname, &wclas); + res = ecore_x_netwm_pid_get(cid, &pid); + if (!res) pid = 0; + + memset(buf, 0, sizeof(buf)); + memset(buf2, 0, sizeof(buf2)); + memset(buf3, 0, sizeof(buf3)); + + if (cw->bd) + snprintf(buf, sizeof(buf), "0x%07x", cw->bd->client.win); + + if (cw->pixmap) + snprintf(buf2, sizeof(buf2), "0x%07x", cw->pixmap); + + if (cw->sync_info.val) + snprintf(buf3, sizeof(buf3), "%d %4d %4d %4d", + cw->sync_info.version, + cw->sync_info.val, + cw->dmg_updates, + cw->sync_info.done_count); + + fprintf(fs, + " %3d 0x%07x %9s %s %5d %5d %4d %4d %9s %4d %4d | %16s | %d %d %d %d %d %d |%4d %s %s\n", + i, + cw->win, + buf, + cw->visible ? "v" : " ", + cw->x, cw->y, cw->w, cw->h, + buf2, + cw->pw, cw->ph, + buf3, + cw->argb, + cw->shaped, + cw->show_ready, + cw->show_done, + cw->animating, + cw->use_dri2, + pid, + wname ? wname : "", + wclas ? wclas : ""); + + if (wname) free(wname); + if (wclas) free(wclas); + wname = wclas = NULL; + pid = cid = 0; + i++; + } + fprintf(fs, "E-----------------------------------------------------------------------------------------------------------------------------\n"); +} + +static void +_e_mod_comp_debug_canvas_info_dump(E_Comp *c, + E_Comp_Canvas *canvas, + FILE *fs) +{ + Eina_List *l, *ll; + E_Comp_Object *co, *_co = NULL; + E_Comp_Win *cw, *_cw = NULL; + E_Comp_Layer *ly = NULL; + Eina_List *lm = NULL; + int x, y, w, h, i = 1; + const char *file = NULL, *group = NULL; + double val = 0.0; + fprintf(fs, "B-----------------------------------------------------------------------------------------------------------------------------\n"); + fprintf(fs, " canvas->zone:%p num:%d %d,%d %dx%d\n", + canvas->zone, canvas->zone->num, + canvas->zone->x, canvas->zone->y, + canvas->zone->w, canvas->zone->h); + fprintf(fs, " c->nocomp:%d use_hw_ov:%d\n", c->nocomp, c->use_hw_ov); + fprintf(fs, " canvas->nocomp mode:%d force_composite:%d(ref:%d)\n", canvas->nocomp.mode, canvas->nocomp.force_composite, canvas->nocomp.comp_ref); + fprintf(fs, " canvas->nocomp cw:0x%08x\n", e_mod_comp_util_client_xid_get(canvas->nocomp.cw)); + fprintf(fs, " canvas->animation run:%d num:%d\n", canvas->animation.run, canvas->animation.num); + fprintf(fs, " H/W ov win:%p\n", canvas->ov); + fprintf(fs, " Canvas Manual Render State: %d\n", ecore_evas_manual_render_get(canvas->ee)); + fprintf(fs, "------------------------------------------------------------------------------------------------------------------------------\n"); + + fprintf(fs, "--------------------------------------------------------------------------------------------------------------------------------------\n"); + fprintf(fs, " NO WinID shobj obj found_o ex ey ew eh | W S O | V SYNC DMG DONE |\n"); + fprintf(fs, "--------------------------------------------------------------------------------------------------------------------------------------\n"); + Eina_Bool found = 0; + + ly = e_mod_comp_canvas_layer_get(canvas, "comp"); + E_CHECK(ly); + + lm = evas_object_smart_members_get(ly->layout); + E_CHECK(lm); + Evas_Object *o = NULL; + + EINA_LIST_REVERSE_FOREACH(lm, ll, o) + { + if (!evas_object_visible_get(o)) continue; + + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (co->canvas != canvas) continue; + if (co->shadow == o) + { + found = 1; + _co = co; + _cw = cw; + break; + } + } + } + + if (found && _co && _cw) + { + edje_object_file_get(_co->shadow, &file, &group); + evas_object_geometry_get(o, &x, &y, &w, &h); + + fprintf(fs, + " %2d 0x%07x %p %p %p %4d %4d %4dx%4d %s %s|%s|%s %.1f|%s %.1f|%s %.1f\n", + i, _cw->win, _co->shadow, _co->img, o, x, y, w, h, + evas_object_visible_get(_co->shadow) ? "v" : "", + _cw->hidden_override ? "HIDDEN" : "", + group, + edje_object_part_state_get(_co->shadow, "clipper", &val), val, + edje_object_part_state_get(_co->shadow, "shower", &val), val, + edje_object_part_state_get(_co->shadow, "e.swallow.content", &val), val); + } + + found = 0; + _co = NULL; + _cw = NULL; + file = NULL; + group = NULL; + val = 0.0; + i++; + } + eina_list_free(lm); +} + +/* externally accessible globals */ +EAPI int logtype = LT_NOTHING; + +/* externally accessible functions */ +EAPI Eina_Bool +e_mod_comp_debug_info_dump(Eina_Bool to_file, + const char *name) +{ + E_Comp *c; + E_Comp_Canvas *canvas; + Eina_List *l; + FILE *fs = stderr; + + c = e_mod_comp_util_get(); + E_CHECK_RETURN(c, 0); + + if ((to_file) && (name)) + { + fs = fopen(name, "w"); + if (!fs) + { + fprintf(stderr, "can't open %s file.\n", name); + fs = stderr; + to_file = EINA_FALSE; + } + } + + _e_mod_comp_debug_wins_info_dump(c, fs); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + _e_mod_comp_debug_canvas_info_dump(c, canvas, fs); + } + + if (to_file) + { + fflush(fs); + fclose(fs); + } + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_debug_edje_error_get(Evas_Object *o, + Ecore_X_Window win) +{ + Edje_Load_Error err = edje_object_load_error_get(o); + char *_err_msg = NULL; + Eina_Bool res = EINA_TRUE; + + if (err != EDJE_LOAD_ERROR_NONE) + { + switch (err) + { + case EDJE_LOAD_ERROR_GENERIC: _err_msg = strdup("ERR_GENERIC"); break; + case EDJE_LOAD_ERROR_DOES_NOT_EXIST: _err_msg = strdup("ERR_DOES_NOT_EXIST"); break; + case EDJE_LOAD_ERROR_PERMISSION_DENIED: _err_msg = strdup("ERR_PERMISSION_DENIED"); break; + case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: _err_msg = strdup("ERR_RESOURCE_ALLOCATION_FAILED"); break; + case EDJE_LOAD_ERROR_CORRUPT_FILE: _err_msg = strdup("ERR_CORRUPT_FILE"); break; + case EDJE_LOAD_ERROR_UNKNOWN_FORMAT: _err_msg = strdup("ERR_UNKNOWN_FORMAT"); break; + case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE: _err_msg = strdup("ERR_INCOMPATIBLE_FILE"); break; + case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION: _err_msg = strdup("ERR_UNKNOWN_COLLECTION"); break; + case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE: _err_msg = strdup("ERR_RECURSIVE_REFERENCE"); break; + default: _err_msg = strdup("ERR_UNKNOWN_ERROR"); break; + } + res = EINA_FALSE; + } + + if (res) _err_msg = strdup("SUCCESS"); + ELBF(ELBT_COMP, 0, win, "%15.15s|o:%p %s", "EDC", o, _err_msg); + free(_err_msg); + + return res; +} + +EAPI Eina_Bool +e_mod_comp_debug_prop_handle(Ecore_X_Event_Window_Property *ev) +{ + Eina_Bool res = EINA_FALSE; + E_Mod_Comp_Log_Info info = {LT_NOTHING, {0,}}; + unsigned char* data = NULL; + int ret, n; + + E_CHECK_RETURN(ev, 0); + E_CHECK_RETURN(ev->win, 0); + + ret = ecore_x_window_prop_property_get + (ev->win, ATOM_CM_LOG, ECORE_X_ATOM_CARDINAL, + 32, &data, &n); + E_CHECK_GOTO((ret != -1), cleanup); + E_CHECK_GOTO(((ret > 0) && (data)), cleanup); + + memcpy(&info, data, sizeof(E_Mod_Comp_Log_Info)); + logtype = info.type; + + fprintf(stdout, "[COMP] logtupe:0x%08x\n", logtype); + + if (logtype == LT_CREATE) + { + e_mod_comp_debug_info_dump(EINA_FALSE, NULL); + } + else if (logtype == LT_CONFIGURE) + { + int enable = e_configure_registry_exists("appearance/comp"); + if (enable) + { + E_Comp *c = e_mod_comp_util_get(); + E_CHECK_GOTO(c, cleanup); + e_scale_update(); + e_configure_registry_call("appearance/comp", + e_container_current_get(c->man), + NULL); + } + } + else if (logtype == LT_DRAW) + { + E_Comp *c = e_mod_comp_util_get(); + E_Comp_Canvas *canvas; + Eina_List *l = NULL; + char msg[4096], buf[2048]; + + snprintf(msg, sizeof(msg), "This is a test dialog for debugging purpose."); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + snprintf(buf, sizeof(buf), + "
" + "Zone[%d] %d,%d %dx%d
" + "%s 0x%x F:%d(%d) A:%d(%d)", + canvas->zone->num, + canvas->zone->x, + canvas->zone->y, + canvas->zone->w, + canvas->zone->h, + (canvas->nocomp.mode == E_NOCOMP_MODE_RUN) ? "No composite" : "Composite", + e_mod_comp_util_client_xid_get(canvas->nocomp.cw), + canvas->nocomp.force_composite, + canvas->nocomp.comp_ref, + canvas->animation.run, + canvas->animation.num); + + strcat(msg, buf); + } + e_util_dialog_internal("Enlightenment Rendering Mode", msg); + } + + if ((logtype == LT_DUMP) && + (strlen(info.file) > 0)) + { + e_mod_comp_debug_info_dump(EINA_TRUE, info.file); + ecore_x_client_message32_send + (ev->win, ATOM_CM_LOG_DUMP_DONE, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, + 0, 0, 0, 0, 0); + } + + res = EINA_TRUE; + +cleanup: + if (data) E_FREE(data); + return res; +} + +#if COMP_DEBUG_PIXMAP +# ifdef ecore_x_composite_name_window_pixmap_get +# undef ecore_x_composite_name_window_pixmap_get +# endif +EAPI Ecore_X_Pixmap +e_mod_comp_debug_name_window_pixmap_get(Ecore_X_Window w, + const char *f, + const int l) +{ + Ecore_X_Pixmap p = 0; + Ecore_X_Window win = 0; + E_Border *bd = NULL; + + p = ecore_x_composite_name_window_pixmap_get(w); + bd = e_border_find_by_window(w); + if (bd) win = bd->client.win; + fprintf(stderr, + "[COMP] %30.30s|%04d 0x%08x NEW PIXMAP 0x%x\n", + f, l, win, p); + return p; +} +#endif /* COMP_DEBUG_PIXMAP */ diff --git a/src/e_mod_comp_debug.h b/src/e_mod_comp_debug.h new file mode 100644 index 0000000..e91b694 --- /dev/null +++ b/src/e_mod_comp_debug.h @@ -0,0 +1,41 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_DEBUG_H +#define E_MOD_COMP_DEBUG_H + +#define E_CHECK(x) do {if (!(x)) return; } while(0) +#define E_CHECK_RETURN(x, r) do {if (!(x)) return (r);} while(0) +#define E_CHECK_GOTO(x, l) do {if (!(x)) goto l; } while(0) + +#define COMP_DEBUG_PIXMAP 0 + +#if COMP_DEBUG_PIXMAP +EAPI Ecore_X_Pixmap e_mod_comp_debug_name_window_pixmap_get(Ecore_X_Window w, const char *f, const int l); + +#define ecore_x_composite_name_window_pixmap_get(w) \ + e_mod_comp_debug_name_window_pixmap_get(w, __func__, __LINE__) + +#define ecore_x_pixmap_free(p) { \ + ecore_x_pixmap_free(p); \ + fprintf(stderr, \ + "[COMP] %30.30s|%04d 0x%08x FREE PIXMAP 0x%x\n", \ + __func__, __LINE__, e_mod_comp_util_client_xid_get(cw), p); \ +} +#endif /* COMP_DEBUG_PIXMAP */ + +/* TODO: clean up nocomp logic */ +#define USE_NOCOMP_DISPOSE 0 +#define USE_SHADOW 0 +#define MOVE_IN_EFFECT 0 +#define DEBUG_HWC_COLOR 0 +#define DEBUG_HWC 1 +#define OPTIMIZED_HWC_MOBILE 1 +#define HWC_ROTATION_PATCH 0 +#define SEND_LAUNCHING_DONE 1 + +EAPI Eina_Bool e_mod_comp_debug_info_dump(Eina_Bool to_file, const char *name); +EAPI Eina_Bool e_mod_comp_debug_edje_error_get(Evas_Object *o, Ecore_X_Window win); +EAPI Eina_Bool e_mod_comp_debug_prop_handle(Ecore_X_Event_Window_Property *ev); + +#endif +#endif diff --git a/src/e_mod_comp_effect.h b/src/e_mod_comp_effect.h new file mode 100644 index 0000000..31e5e2c --- /dev/null +++ b/src/e_mod_comp_effect.h @@ -0,0 +1,77 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_EFFECT_H +#define E_MOD_COMP_EFFECT_H + +typedef enum _E_Comp_Effect_Style E_Comp_Effect_Style; +typedef enum _E_Comp_Effect_Kind E_Comp_Effect_Kind; +typedef struct _E_Comp_Effect_Type E_Comp_Effect_Type; +typedef struct _E_Comp_Effect_Job E_Comp_Effect_Job; + +enum _E_Comp_Effect_Style +{ + E_COMP_EFFECT_STYLE_DEFAULT = 0, + E_COMP_EFFECT_STYLE_NONE, + E_COMP_EFFECT_STYLE_CUSTOM0, + E_COMP_EFFECT_STYLE_CUSTOM1, + E_COMP_EFFECT_STYLE_CUSTOM2, + E_COMP_EFFECT_STYLE_CUSTOM3, + E_COMP_EFFECT_STYLE_CUSTOM4, + E_COMP_EFFECT_STYLE_CUSTOM5, + E_COMP_EFFECT_STYLE_CUSTOM6, + E_COMP_EFFECT_STYLE_CUSTOM7, + E_COMP_EFFECT_STYLE_CUSTOM8, + E_COMP_EFFECT_STYLE_CUSTOM9 +}; + +enum _E_Comp_Effect_Kind +{ + E_COMP_EFFECT_KIND_SHOW = 0, + E_COMP_EFFECT_KIND_HIDE, + E_COMP_EFFECT_KIND_RESTACK, + E_COMP_EFFECT_KIND_ROTATION, + E_COMP_EFFECT_KIND_FOCUSIN, + E_COMP_EFFECT_KIND_FOCUSOUT +}; + +struct _E_Comp_Effect_Object +{ + Evas_Object *edje; + Evas_Object *img; + Ecore_X_Window win; + Ecore_X_Window cwin; + Ecore_X_Pixmap pixmap; + Eina_Bool ev_vis; // send E_EVENT_COMP_SOURCE_VISIBILITY event when effect is done + Eina_Bool show; // indicates that object is used to show app launching effect + Eina_Bool send_launching_done; // send client message as the meaning that launching effect was done. + struct + { + Evas_Object *offset; // offset rectangle object for transparent rectangle + Evas_Object *rect; // transparent rectangle object + } transp; +}; + +struct _E_Comp_Effect_Type +{ + Eina_Bool animatable : 1; // if this valuse is true then window can show animaton. + E_Comp_Effect_Style show; // indicate show effect type + E_Comp_Effect_Style hide; // indicate hide effect type + E_Comp_Effect_Style restack; // indicate restack effect type + E_Comp_Effect_Style rotation; // indicate rotation effect type + E_Comp_Effect_Style focusin; // indicate focus in effect type + E_Comp_Effect_Style focusout; // indicate focus out effect type +}; + +struct _E_Comp_Effect_Job +{ + Evas_Object *o; + E_Comp_Canvas *canvas; + Ecore_X_Window win; + Ecore_X_Window cwin; + char emission[1024]; + char src[1024]; + Eina_Bool emitted; + Eina_Bool effect_obj; +}; +#endif +#endif diff --git a/src/e_mod_comp_effect_image_launch.h b/src/e_mod_comp_effect_image_launch.h new file mode 100644 index 0000000..f7ac11c --- /dev/null +++ b/src/e_mod_comp_effect_image_launch.h @@ -0,0 +1,43 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_EFFECT_IMAGE_LAUNCH_H +#define E_MOD_COMP_EFFECT_IMAGE_LAUNCH_H + +typedef enum _E_Fake_Effect_File_type +{ + E_FAKE_EFFECT_FILE_TYPE_EDJ = 0, + E_FAKE_EFFECT_FILE_TYPE_IMAGE +} E_Fake_Effect_File_type; + +typedef enum _E_Fake_Effect_Theme_type +{ + E_FAKE_EFFECT_THEME_DARK = 0, + E_FAKE_EFFECT_THEME_LIGHT, + E_FAKE_EFFECT_THEME_DEFAULT +} E_Fake_Effect_Theme_type; + + +typedef struct _E_Comp_Effect_Image_Launch E_Comp_Effect_Image_Launch; + +struct _E_Comp_Effect_Image_Launch +{ + Eina_Bool running : 1; + Eina_Bool fake_image_show_done : 1; // image launch edje object got effect done or not. + Evas_Object *obj; // image object + Evas_Object *shobj; // image shadow object + Ecore_Timer *timeout; // max time between show, hide image launch + Ecore_X_Window win; // this represent image launch effect's real window id. + int w, h; // width and height of image object + int rot; // rotation angle + int indicator_show; // indicator enable / disable flag + Evas_Object* indicator_obj; // plugin indicator object + Evas *evas; // pointer for saving evas of canvas + Ecore_Evas *ecore_evas; // pointer for saving ecore_evas of canvas + + //Changable UI variable + E_Fake_Effect_File_type file_type; //file type for fake effect + E_Fake_Effect_Theme_type theme_type; //file type for fake effect +}; + +#endif +#endif diff --git a/src/e_mod_comp_effect_win_rotation.h b/src/e_mod_comp_effect_win_rotation.h new file mode 100644 index 0000000..4f83a3b --- /dev/null +++ b/src/e_mod_comp_effect_win_rotation.h @@ -0,0 +1,49 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_EFFECT_WIN_ROTATION_H +#define E_MOD_COMP_EFFECT_WIN_ROTATION_H + +#include + +typedef struct _E_Comp_Zone_Rotation_Effect_Begin E_Comp_Zone_Rotation_Effect_Begin; +typedef struct _E_Comp_Zone_Rotation_Effect_End E_Comp_Zone_Rotation_Effect_End; + +struct _E_Comp_Zone_Rotation_Effect_Begin +{ + Evas_Object *o; + E_Zone *zone; + double src; + double target; + Ecore_X_Image *xim; + Evas_Object *img; + Evas_Object *xv_img; + Ecore_X_Pixmap xv_pix; + Eina_Bool init; + E_Comp_Layer *ly; +}; + +struct _E_Comp_Zone_Rotation_Effect_End +{ + Evas_Object *o; + E_Zone *zone; + double src; + double target; + Evas_Object *xv_img; + Ecore_X_Pixmap xv_pix; + Eina_Bool init; + Eina_Bool send_msg; +}; + +struct _E_Comp_Effect_Zone_Rotation +{ + E_Comp_Canvas *canvas; + Eina_Bool ready; + Eina_Bool run; + Eina_Bool xv_use; + Elm_Transit *trans_begin; + Elm_Transit *trans_end; + Elm_Transit_Effect *effect_begin; + Elm_Transit_Effect *effect_end; +}; +#endif +#endif diff --git a/src/e_mod_comp_hw_ov_win.c b/src/e_mod_comp_hw_ov_win.c new file mode 100644 index 0000000..a9864f7 --- /dev/null +++ b/src/e_mod_comp_hw_ov_win.c @@ -0,0 +1,501 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +typedef struct _E_Comp_Log +{ + E_Comp_Log_Type type; + int repeat; + Evas_Object *o; + Evas_Object *bg; + char str[256]; +} E_Comp_Log; + +struct _E_Comp_HW_Ov_Win +{ + Ecore_X_Window ee_win; + Ecore_Evas *ee; + Evas *evas; + Evas_Object *bg; + int x, y, w, h; + + Ecore_X_Window root; + + Eina_Bool on; + + // debugging info + struct { + int num; + Eina_List *list; + } info; +}; + +/* local subsystem globals */ +static E_Comp_HW_Ov_Win *ov_win = NULL; + +/* local subsystem functions */ +static void _hw_ov_win_power_set(E_Comp_HW_Ov_Win *ov, Eina_Bool set); +static Eina_Bool _hw_ov_win_update(E_Comp_HW_Ov_Win *ov, E_Comp_Win *cw); + +/* externally accessible functions */ +EAPI E_Comp_HW_Ov_Win * +e_mod_comp_hw_ov_win_new(Ecore_X_Window parent, + int x, + int y, + int w, + int h) +{ + E_Comp_HW_Ov_Win *ov = NULL; + Eina_Bool res = EINA_FALSE; + + E_CHECK_GOTO(parent, finish); + + ov = E_NEW(E_Comp_HW_Ov_Win, 1); + E_CHECK_GOTO(ov, finish); + + ov->ee = ecore_evas_software_x11_new(NULL, parent, x, y, w, h); + E_CHECK_GOTO(ov->ee, finish); + + ov->ee_win = ecore_evas_window_get(ov->ee);; + E_CHECK_GOTO(ov->ee_win, finish); + + ov->evas = ecore_evas_get(ov->ee); + E_CHECK_GOTO(ov->evas, finish); + + ecore_x_composite_redirect_window(ov->ee_win, ECORE_X_COMPOSITE_UPDATE_MANUAL); + ecore_evas_comp_sync_set(ov->ee, 0); + ecore_evas_show(ov->ee); + + ov->bg = evas_object_rectangle_add(ov->evas); + E_CHECK_GOTO(ov->bg, finish); + + evas_object_render_op_set(ov->bg, EVAS_RENDER_COPY); + evas_object_layer_set(ov->bg, EVAS_LAYER_MIN); + evas_object_color_set(ov->bg, 0, 0, 0, 0); + evas_object_move(ov->bg, 0, 0); + evas_object_resize(ov->bg, w, h); + evas_object_show(ov->bg); + _hw_ov_win_power_set(ov, EINA_FALSE); + + // comp has to unset shape input mask for the H/W overlay window + // to receive input event. + ecore_x_window_shape_input_rectangle_set(ov->ee_win, -1, -1, 1, 1); + + ov->x = x; + ov->y = y; + ov->w = w; + ov->h = h; + + ov_win = ov; + + res = EINA_TRUE; + +finish: + if (!res && ov) + { + if (ov->ee) + { + ecore_evas_free(ov->ee); + ov->ee = NULL; + } + E_FREE(ov); + ov = NULL; + } + return ov; +} + +EAPI void +e_mod_comp_hw_ov_win_msg_config_update(void) +{ + E_Comp_Log *log; + + E_CHECK(ov_win); + E_CHECK(_comp_mod->conf->use_hw_ov); + E_CHECK(_comp_mod->conf->debug_info_show); + + EINA_LIST_FREE(ov_win->info.list, log) + { + evas_object_hide(log->o); + evas_object_hide(log->bg); + evas_object_del(log->o); + evas_object_del(log->bg); + memset(log, 0, sizeof(E_Comp_Log)); + E_FREE(log); + } +} + +#ifdef _LOG_TYPE_CHECK +# undef _LOG_TYPE_CHECK +#endif +# define _LOG_TYPE_CHECK(a, b) \ + ((_comp_mod->conf->debug_type_##a) && \ + (E_COMP_LOG_TYPE_##b == type)) + +EAPI void +e_mod_comp_hw_ov_win_msg_show(E_Comp_Log_Type type, + const char *f, + ...) +{ + E_Comp_Log *log, *prev_log; + Evas_Object *bg, *o; + Evas_Coord w = 0, h = 0; + Eina_List *l; + int num, y; + char buf[256], str[256]; + va_list args; + + E_CHECK(ov_win); + E_CHECK(_comp_mod->conf->use_hw_ov); + E_CHECK(_comp_mod->conf->debug_info_show); + E_CHECK(_comp_mod->conf->max_debug_msgs >= 1); + E_CHECK(type > E_COMP_LOG_TYPE_DEFAULT); + E_CHECK(type < E_COMP_LOG_TYPE_MAX); + + if (!(_LOG_TYPE_CHECK(nocomp, NOCOMP) || + _LOG_TYPE_CHECK(swap, SWAP) || + _LOG_TYPE_CHECK(effect, EFFECT))) + { + return; + } + + va_start(args, f); + vsprintf(buf, f, args); + va_end(args); + + /* check if previous log is same type, just increment repeat value */ + num = eina_list_count(ov_win->info.list); + if (num >= 1) + { + log = eina_list_nth(ov_win->info.list, num - 1); + if ((log) && (log->type == type) && + (!strcmp(buf, log->str))) + { + sprintf(str, "%04d|%s %d", + ov_win->info.num++, + log->str, + log->repeat++); + evas_object_text_text_set(log->o, str); + return; + } + } + + log = E_NEW(E_Comp_Log, 1); + E_CHECK(log); + + log->type = type; + strcpy(log->str, buf); + sprintf(str, "%04d|%s", ov_win->info.num++, log->str); + + if (num < _comp_mod->conf->max_debug_msgs) + { + bg = evas_object_rectangle_add(ov_win->evas); + evas_object_layer_set(bg, EVAS_LAYER_MAX); + evas_object_render_op_set(bg, EVAS_RENDER_COPY); + evas_object_color_set(bg, 30, 30, 30, 128); + evas_object_show(bg); + + o = evas_object_text_add(ov_win->evas); + evas_object_text_font_set(o, "Sans", 28); + evas_object_text_text_set(o, str); + evas_object_layer_set(o, EVAS_LAYER_MAX); + evas_object_render_op_set(o, EVAS_RENDER_COPY); + evas_object_color_set(o, 200, 200, 200, 255); + evas_object_show(o); + + log->bg = bg; + log->o = o; + } + else + { + prev_log = eina_list_nth(ov_win->info.list, 0); + if (!prev_log) + { + E_FREE(log); + return; + } + log->bg = prev_log->bg; + log->o = prev_log->o; + ov_win->info.list = eina_list_remove(ov_win->info.list, prev_log); + E_FREE(prev_log); + + evas_object_text_text_set(log->o, str); + } + + ov_win->info.list = eina_list_append(ov_win->info.list, log); + + y = ov_win->h - 40; + EINA_LIST_REVERSE_FOREACH(ov_win->info.list, l, log) + { + if (!log) continue; + evas_object_geometry_get(log->o, NULL, NULL, &w, &h); + evas_object_move(log->bg, 0, y - 1); + evas_object_resize(log->bg, w + 2, h + 2); + evas_object_move(log->o, 1, y); + y -= (h+2); + } +} + +EAPI void +e_mod_comp_hw_ov_win_free(E_Comp_HW_Ov_Win *ov) +{ + E_Comp_Log *log; + E_CHECK(ov); + + _hw_ov_win_power_set(ov, EINA_FALSE); + + EINA_LIST_FREE(ov->info.list, log) + { + evas_object_hide(log->o); + evas_object_hide(log->bg); + evas_object_del(log->o); + evas_object_del(log->bg); + memset(log, 0, sizeof(E_Comp_Log)); + E_FREE(log); + } + if (ov->bg) + { + evas_object_del(ov->bg); + ov->bg = NULL; + } + if (ov->ee) + { + ecore_evas_free(ov->ee); + ov->ee = NULL; + } + memset(ov, 0, sizeof(E_Comp_HW_Ov_Win)); + E_FREE(ov); + + ov_win = NULL; +} + +EAPI void +e_mod_comp_hw_ov_win_show(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw) +{ + E_CHECK(ov); + E_CHECK(cw); + E_CHECK(cw->visible); + E_CHECK(cw->dmg_updates >= 1); + + _hw_ov_win_update(ov, cw); +} + +EAPI void +e_mod_comp_hw_ov_win_hide(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw) +{ + E_CHECK(ov); + E_CHECK(cw); + E_CHECK(!cw->visible); + + _hw_ov_win_power_set(ov, EINA_FALSE); + + if (cw->ov_obj) + { + evas_object_hide(cw->ov_obj); + evas_object_del(cw->ov_obj); + cw->ov_obj = NULL; + } + + if (cw->ov_xim) + { + ecore_x_image_free(cw->ov_xim); + cw->ov_xim = NULL; + } + cw->ov.w = 0; + cw->ov.h = 0; +} + +EAPI void +e_mod_comp_hw_ov_win_obj_show(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw) +{ + Eina_Bool visible; + + if (cw->ov_obj) + { + visible = evas_object_visible_get(cw->ov_obj); + if (!visible) + { + Eina_Bool res = _hw_ov_win_update(ov, cw); + if (res) + { + evas_object_show(cw->ov_obj); + _hw_ov_win_power_set(ov, EINA_TRUE); + } + } + } +} + +EAPI void +e_mod_comp_hw_ov_win_obj_hide(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw) +{ + Eina_Bool visible; + if (cw->ov_obj) + { + visible = evas_object_visible_get(cw->ov_obj); + if (visible) + { + _hw_ov_win_power_set(ov, EINA_FALSE); + evas_object_hide(cw->ov_obj); + } + } +} + + + +EAPI Eina_Bool +e_mod_comp_hw_ov_win_update(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw) +{ + E_CHECK_RETURN(ov, EINA_FALSE); + E_CHECK_RETURN(cw, EINA_FALSE); + + Eina_Bool res = _hw_ov_win_update(ov, cw); + if (!res) + { + // we will be trying to get image again at next update. + cw->update = 1; + cw->c->updates = eina_list_append(cw->c->updates, cw); + e_mod_comp_win_render_queue(cw); + } + + return res; +} + +EAPI void +e_mod_comp_hw_ov_win_root_set(E_Comp_HW_Ov_Win *ov, + Ecore_X_Window root) +{ + E_CHECK(ov); + ov->root = root; +} + +/* local subsystem functions */ +static void +_hw_ov_win_power_set(E_Comp_HW_Ov_Win *ov, + Eina_Bool set) +{ + if (set) + { + if (!ov->on) + { + // power on + e_mod_comp_util_fb_visible_set(set); + ov->on = EINA_TRUE; + } + } + else + { + if (ov->on) + { + // power off + e_mod_comp_util_fb_visible_set(set); + ov->on = EINA_FALSE; + } + } +} + +static Eina_Bool +_hw_ov_win_update(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw) +{ + Eina_Bool visible = EINA_FALSE; + Eina_Bool get = EINA_FALSE; + unsigned char *pix = NULL; + + if (!cw->pixmap || cw->pw <= 0 || cw->ph <= 0 || cw->needpix) + { + cw->ov.w = 0; + cw->ov.h = 0; + if (cw->ov_xim) ecore_x_image_free(cw->ov_xim); + cw->ov_xim = NULL; + return EINA_FALSE; + } + + if (cw->pixmap && cw->pw > 0 && cw->ph > 0) + { + if (!cw->ov_xim) + { + cw->ov_xim = ecore_x_image_new(cw->pw, cw->ph, cw->vis, cw->depth); + if (!cw->ov_xim) return EINA_FALSE; + + cw->ov.w = cw->pw; + cw->ov.h = cw->ph; + } + else if (cw->ov.w != cw->pw || cw->ov.h != cw->ph) + { + if (cw->ov_xim) ecore_x_image_free(cw->ov_xim); + cw->ov_xim = ecore_x_image_new(cw->pw, cw->ph, cw->vis, cw->depth); + if (!cw->ov_xim) + { + cw->ov.w = 0; + cw->ov.h = 0; + return EINA_FALSE; + } + cw->ov.w = cw->pw; + cw->ov.h = cw->ph; + } + } + + if (cw->pixmap && cw->pw > 0 && cw->ph > 0 && cw->ov_xim && + !cw->ov_obj && cw->visible) + { + cw->ov_obj = evas_object_image_filled_add(ov->evas); + if (!cw->ov_obj) return EINA_FALSE; + evas_object_image_content_hint_set(cw->ov_obj, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); + evas_object_image_colorspace_set(cw->ov_obj, EVAS_COLORSPACE_ARGB8888); + evas_object_image_size_set(cw->ov_obj, cw->pw, cw->ph); + if (cw->argb) evas_object_image_alpha_set(cw->ov_obj, 1); + else evas_object_image_alpha_set(cw->ov_obj, 0); + evas_object_image_fill_set(cw->ov_obj, 0, 0, cw->pw, cw->ph); + evas_object_resize(cw->ov_obj, cw->pw, cw->ph); + evas_object_render_op_set(cw->ov_obj, EVAS_RENDER_COPY); + evas_object_color_set(cw->ov_obj, 255, 255, 255, 255); + evas_object_show(cw->ov_obj); + _hw_ov_win_power_set(ov, EINA_TRUE); + } + + if (cw->ov_obj && cw->visible) + { + visible = evas_object_visible_get(cw->ov_obj); + if (!visible) + { + evas_object_show(cw->ov_obj); + _hw_ov_win_power_set(ov, EINA_TRUE); + } + } + + if (cw->ov_xim && cw->ov_obj && cw->visible) + { + pix = ecore_x_image_data_get(cw->ov_xim, NULL, NULL, NULL); + evas_object_image_data_set(cw->ov_obj, pix); + evas_object_image_size_set(cw->ov_obj, cw->pw, cw->ph); + + get = ecore_x_image_get(cw->ov_xim, cw->pixmap, + 0, 0, 0, 0, + cw->pw, cw->ph); + + if (!get) + { + e_mod_comp_update_add(cw->up, 0, 0, cw->pw, cw->ph); + return EINA_FALSE; + } + + evas_object_move(cw->ov_obj, cw->x, cw->y); + evas_object_resize(cw->ov_obj, cw->pw, cw->ph); + + int bpl, rows, bpp; + pix = ecore_x_image_data_get(cw->ov_xim, &bpl, &rows, &bpp); + if (pix) + { + evas_data_argb_unpremul((unsigned int *)pix, + (unsigned int)bpl * (unsigned int)rows / bpp); + evas_object_image_data_set(cw->ov_obj, pix); + evas_object_image_data_update_add(cw->ov_obj, 0, 0, cw->pw, cw->ph); + } + } + return EINA_TRUE; +} diff --git a/src/e_mod_comp_hw_ov_win.h b/src/e_mod_comp_hw_ov_win.h new file mode 100644 index 0000000..bc1168b --- /dev/null +++ b/src/e_mod_comp_hw_ov_win.h @@ -0,0 +1,42 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_HW_OV_WIN_H +#define E_MOD_COMP_HW_OV_WIN_H + +typedef enum _E_Comp_Log_Type E_Comp_Log_Type; +typedef struct _E_Comp_HW_Ov_Win E_Comp_HW_Ov_Win; + +enum _E_Comp_Log_Type +{ + E_COMP_LOG_TYPE_DEFAULT = 0, + E_COMP_LOG_TYPE_NOCOMP, + E_COMP_LOG_TYPE_SWAP, + E_COMP_LOG_TYPE_EFFECT, + E_COMP_LOG_TYPE_MAX +}; + +/* HW overlay window setup and handler functions */ +EAPI E_Comp_HW_Ov_Win *e_mod_comp_hw_ov_win_new(Ecore_X_Window parent, + int x, + int y, + int w, + int h); +EAPI void e_mod_comp_hw_ov_win_free(E_Comp_HW_Ov_Win *ov); +EAPI Eina_Bool e_mod_comp_hw_ov_win_update(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw); +EAPI void e_mod_comp_hw_ov_win_show(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw); +EAPI void e_mod_comp_hw_ov_win_hide(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw); +EAPI void e_mod_comp_hw_ov_win_msg_config_update(void); +EAPI void e_mod_comp_hw_ov_win_msg_show(E_Comp_Log_Type type, + const char *f, + ...); +EAPI void e_mod_comp_hw_ov_win_root_set(E_Comp_HW_Ov_Win *ov, + Ecore_X_Window root); +EAPI void e_mod_comp_hw_ov_win_obj_show(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw); +EAPI void e_mod_comp_hw_ov_win_obj_hide(E_Comp_HW_Ov_Win *ov, + E_Comp_Win *cw); +#endif +#endif diff --git a/src/e_mod_comp_hwcomp.h b/src/e_mod_comp_hwcomp.h new file mode 100644 index 0000000..51c1238 --- /dev/null +++ b/src/e_mod_comp_hwcomp.h @@ -0,0 +1,79 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_HWCOMP_H +#define E_MOD_COMP_HWCOMP_H + +typedef enum _E_HWComp_Mode +{ + E_HWCOMP_USE_INVALID = -1, + E_HWCOMP_USE_NOCOMP_MODE, + E_HWCOMP_USE_HYBRIDCOMP_MODE, + E_HWCOMP_USE_FULLCOMP_MODE +} E_HWComp_Mode; + +typedef struct _E_Comp_HWComp_Update E_Comp_HWComp_Update; +typedef struct _E_Comp_HWComp_Drawable E_Comp_HWComp_Drawable; + +struct _E_Comp_HWComp; + +struct _E_Comp_HWComp_Drawable +{ + E_Comp_Win *cw; + Ecore_X_Drawable d; + Eina_Bool set_drawable; /* if set_drawable is true, this drawable is set */ + int set_countdown; /* if set_countdown is 0, this drawable is going to hwc set */ + int comp_countdown; /* if comp_countdown is 0, this drawable is going to composite */ + Eina_Bool resized; + Eina_Bool region_update; + int first_update; + + int update_count; /* for debugging */ +}; + + +struct _E_Comp_HWComp_Update +{ + E_HWComp_Mode update_mode; /* hw composite mode */ + unsigned int num_overlays; /* # of hw overlays */ + unsigned int num_drawable; /* # of the candidate drawables */ + E_Comp_HWComp_Drawable **hwc_drawable; /* the candidate drawables */ + Eina_Bool comp_update; /* flag for ee_win update */ + + Eina_Bool ime_present; + Eina_Bool keymag_present; + Eina_Bool split_launcher_rect_present; + Eina_Rectangle ime_rect; + Eina_Rectangle keymag_rect; + Eina_Rectangle split_launcher_rect; + + struct _E_Comp_HWComp *hwcomp; +}; + +struct _E_Comp_HWComp +{ + E_Comp *c; + E_Comp_Canvas *canvas; + + int num_overlays; /* # of hw overlays */ + E_Comp_HWComp_Update *hwc_update; + + Ecore_Timer *idle_timer; + Eina_Bool idle_status; + Ecore_Idle_Enterer *idle_enterer; + + Eina_Bool force_composite; + int comp_ref; + + Eina_Bool miniapp_present; + int screen_width; + int screen_height; + + int fullcomp_pending; + Eina_Bool force_swap; + + Eina_Bool doing_rotation; +}; + + +#endif +#endif diff --git a/src/e_mod_comp_object.c b/src/e_mod_comp_object.c new file mode 100644 index 0000000..23e98d5 --- /dev/null +++ b/src/e_mod_comp_object.c @@ -0,0 +1,1008 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp_debug.h" +#include "e_mod_comp.h" + +#ifdef _F_BORDER_CLIP_TO_ZONE_ +#undef _F_BORDER_CLIP_TO_ZONE_ +#endif +#define _F_BORDER_CLIP_TO_ZONE_ 0 + +/* externally accessible functions */ +EAPI E_Comp_Object * +e_mod_comp_obj_add(E_Comp_Win *cw, + E_Comp_Canvas *canvas) +{ + E_Comp_Object *co; + co = E_NEW(E_Comp_Object, 1); + E_CHECK_RETURN(co, 0); + if ((!cw->input_only) && (!cw->invalid)) + { + if (_comp_mod->conf->use_hwc) + { + co->hwc.mask_rect = evas_object_rectangle_add(canvas->evas); +#if DEBUG_HWC_COLOR + evas_object_color_set(co->hwc.mask_rect, 50, 0, 0, 50); +#else + evas_object_color_set(co->hwc.mask_rect, 0, 0, 0, 0); +#endif + evas_object_render_op_set(co->hwc.mask_rect, EVAS_RENDER_COPY); + evas_object_hide(co->hwc.mask_rect); + } + co->shadow = edje_object_add(canvas->evas); + co->img = evas_object_image_filled_add(canvas->evas); + + if ((!co->shadow) || (!co->img)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|ERROR shadow:%p img:%p evas:%p argb:%d canvas_num:%d", + "OBJECT_CREATE", co->shadow, co->img, + canvas->evas, cw->argb, canvas->num); + } + + E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(canvas, "comp"); + if (ly) + { + e_mod_comp_layer_populate(ly, co->shadow); + if (_comp_mod->conf->use_hwc) + { + e_mod_comp_layer_populate(ly, co->hwc.mask_rect); + } + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|OK!! layer shadow:%p img:%p evas:%p argb:%d canvas_num:%d ly:%p", + "OBJECT_CREATE", co->shadow, co->img, + canvas->evas, cw->argb, canvas->num, ly); + } + else + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|ERROR shadow:%p img:%p evas:%p argb:%d canvas_num:%d ly:%p", + "OBJECT_CREATE", co->shadow, co->img, + canvas->evas, cw->argb, canvas->num, ly); + } + + evas_object_image_colorspace_set(co->img, EVAS_COLORSPACE_ARGB8888); + if (cw->argb) evas_object_image_alpha_set(co->img, 1); + else evas_object_image_alpha_set(co->img, 0); + } + else + { + co->shadow = evas_object_rectangle_add(canvas->evas); + + if (!co->shadow) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|ERROR shadow:%p evas:%p canvas_num:%d", + "OBJECT_CREATE", co->shadow, canvas->evas, + canvas->num); + } + else + { + E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(canvas, "comp"); + if (ly) + e_mod_comp_layer_populate(ly, co->shadow); + } + evas_object_color_set(co->shadow, 0, 0, 0, 0); + } + + co->canvas = canvas; + co->zone = canvas->zone; + return co; +} + +EAPI void +e_mod_comp_obj_del(E_Comp_Object *co) +{ + E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(co->canvas, "comp"); + if (ly) e_layout_unpack(co->shadow); + + if (_comp_mod->conf->use_hwc) + { + if (co->hwc.mask_rect) + { + evas_object_del(co->hwc.mask_rect); + co->hwc.mask_rect = NULL; + } + } + + if (co->img_mirror) + { + Evas_Object *o; + EINA_LIST_FREE(co->img_mirror, o) + { + if (co->xim) evas_object_image_data_set(o, NULL); + evas_object_event_callback_del(o, EVAS_CALLBACK_DEL, + e_mod_comp_cb_win_mirror_del); + evas_object_del(o); + } + } + if (co->xim) + { + evas_object_image_data_set(co->img, NULL); + ecore_x_image_free(co->xim); + co->xim = NULL; + } + if (co->clipper) + { + evas_object_del(co->clipper); + co->clipper = NULL; + } + if (co->img) + { + evas_object_del(co->img); + co->img = NULL; + } + if (co->transp.offset) + { + evas_object_del(co->transp.offset); + co->transp.offset = NULL; + } + if (co->transp.rect) + { + evas_object_del(co->transp.rect); + co->transp.rect = NULL; + } + if (co->shadow) + { + evas_object_del(co->shadow); + co->shadow = NULL; + } + E_FREE(co); +} + +EAPI Eina_List * +e_mod_comp_win_comp_objs_add(E_Comp_Win *cw) +{ + Eina_List *l, *objs = NULL; + E_Comp_Canvas *canvas; + E_Comp_Object *co; + + EINA_LIST_FOREACH(cw->c->canvases, l, canvas) + { + co = e_mod_comp_obj_add(cw, canvas); + if (!co) + { + e_mod_comp_win_comp_objs_del(cw, objs); + return NULL; + } + objs = eina_list_append(objs, co); + } + return objs; +} + +EAPI void +e_mod_comp_win_comp_objs_del(E_Comp_Win *cw, + Eina_List *objs) +{ + E_Comp_Object *co; + EINA_LIST_FREE(objs, co) e_mod_comp_obj_del(co); +} + +EAPI void +e_mod_comp_win_comp_objs_move(E_Comp_Win *cw, + int x, + int y) +{ + Eina_List *l; + E_Comp_Object *co; + E_Comp_Layer *ly; + + E_Comp_Canvas *canvas, *ly_canvas = NULL; + E_Comp_Layer *eff_ly; + E_Comp_Effect_Object *eff_obj = NULL; + Eina_Bool eff_run = EINA_FALSE; + canvas = eina_list_nth(cw->c->canvases, 0); + eff_ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + eff_run = e_mod_comp_layer_effect_get(eff_ly); +#ifdef _F_USE_BORDER_TRANSFORM_ + if ((cw->bd) && e_border_transform_enable_get(cw->bd)) + { + e_border_transform_get(cw->bd, &x, &y, 0, 0, 0); + } +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ + if (eff_run) + { + /* do not change position of the mini-mode window effect object + * during effect to avoid unnecessary move around screen. + * TODO: Move INSET check code to effect.c file. + */ + if (!STATE_INSET_CHECK(cw)) + { + eff_obj = e_mod_comp_layer_effect_obj_get(eff_ly, cw->win); + if (eff_obj) ly_canvas = eff_ly->canvas; + } + } + + EINA_LIST_FOREACH(cw->objs, l, co) + { + int zx = 0, zy = 0; + if (!co) continue; + if (!co->shadow) continue; + if (co->zone) + { + zx = co->zone->x; + zy = co->zone->y; + } + + ly = e_mod_comp_canvas_layer_get(co->canvas, "comp"); + if (ly) + { + e_layout_child_move(co->shadow, x - zx, y - zy); + if (_comp_mod->conf->use_hwc) + { + e_layout_child_move(co->hwc.mask_rect, x - zx, y - zy); + } + } + else + { + evas_object_move(co->shadow, x - zx, y - zy); + if (_comp_mod->conf->use_hwc) + { + evas_object_move(co->hwc.mask_rect, x - zx, y - zy); + } + } +#if MOVE_IN_EFFECT + /* to show moving window while effect, we should also update effect object */ + if (eff_obj) + { + if (ly_canvas == co->canvas) + e_layout_child_move(eff_obj->edje, x -zx, y - zy); + } +#else + if ((eff_obj) && (TYPE_QUICKPANEL_CHECK(cw))) + { + if (ly_canvas == co->canvas) + e_layout_child_move(eff_obj->edje, x -zx, y - zy); + } +#endif + +#if _F_BORDER_CLIP_TO_ZONE_ + if ((cw->visible) && (cw->bd) && (co->zone) && + (!cw->input_only) && (!cw->invalid) && + E_INTERSECTS(co->zone->x, co->zone->y, + co->zone->w, co->zone->h, + cw->x, cw->y, cw->w, cw->h)) + { + if (!(E_CONTAINS(co->zone->x, co->zone->y, + co->zone->w, co->zone->h, + cw->x, cw->y, cw->w, cw->h))) + { + int _x, _y, _w, _h; + _x = x - zx; _y = y - zy; + _w = cw->pw; _h = cw->ph; + + E_RECTS_CLIP_TO_RECT(_x, _y, _w, _h, + 0, 0, co->zone->w, co->zone->h); + if (!co->clipper) + { + co->clipper = evas_object_rectangle_add(co->canvas->evas); + evas_object_clip_set(co->shadow, co->clipper); + /* check to see if a given object exists on the zone which is + * equal to its border. if it is, the clipper will be shown. + * otherwise, the clipper will be invisible. + */ + if (cw->bd->zone == co->zone) + evas_object_show(co->clipper); + } + if (ly) + { + e_layout_child_move(co->clipper, _x, _y); + e_layout_child_resize(co->clipper, _w, _h); + } + else + { + evas_object_move(co->clipper, _x, _y); + evas_object_resize(co->clipper, _w, _h); + } + } + else + { + if (co->clipper) + { + evas_object_hide(co->clipper); + evas_object_clip_unset(co->shadow); + evas_object_del(co->clipper); + co->clipper = NULL; + } + } + } +#endif + } +} + +EAPI void +e_mod_comp_win_comp_objs_resize(E_Comp_Win *cw, + int w, + int h) +{ + Eina_List *l; + E_Comp_Object *co; + E_Comp_Layer *ly; +#ifdef _F_USE_BORDER_TRANSFORM_ + if ((cw->bd) && e_border_transform_enable_get(cw->bd)) + { + e_border_transform_get(cw->bd, 0, 0, &w, &h, 0); + } +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->shadow) continue; + ly = e_mod_comp_canvas_layer_get(co->canvas, "comp"); + if (ly) + { + e_layout_child_resize(co->shadow, w, h); + if (_comp_mod->conf->use_hwc) + { + e_layout_child_resize(co->hwc.mask_rect, w, h); + } + } + else + { + evas_object_resize(co->shadow, w, h); + if (_comp_mod->conf->use_hwc) + { + evas_object_resize(co->hwc.mask_rect, w, h); + } + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_img_resize(E_Comp_Win *cw, + int w, + int h) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->img) continue; + evas_object_image_size_set(co->img, w, h); + } +} + +EAPI void +e_mod_comp_win_comp_objs_img_init(E_Comp_Win *cw) +{ + Eina_List *l, *ll; + E_Comp_Object *co; + Evas_Object *o; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (co->native) continue; + Evas_Native_Surface ns; + ns.version = EVAS_NATIVE_SURFACE_VERSION; + ns.type = EVAS_NATIVE_SURFACE_X11; + ns.data.x11.visual = cw->vis; + ns.data.x11.pixmap = cw->pixmap; + if (!cw->argb) + evas_object_render_op_set(co->img, EVAS_RENDER_COPY); + evas_object_image_native_surface_set(co->img, &ns); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_native_surface_set(o, &ns); + } + evas_object_image_data_update_add(co->img, 0, 0, cw->pw, cw->ph); + co->native = 1; + } +} + +EAPI void +e_mod_comp_win_comp_objs_img_deinit(E_Comp_Win *cw) +{ + Eina_List *l, *ll; + E_Comp_Object *co; + Evas_Object *o; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->native) continue; + evas_object_image_native_surface_set(co->img, NULL); + co->native = 0; + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + if (!o) continue; + evas_object_image_native_surface_set(o, NULL); + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_xim_free(E_Comp_Win *cw) +{ + Eina_List *l, *ll; + E_Comp_Object *co; + Evas_Object *o; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->xim) continue; + evas_object_image_size_set(co->img, 1, 1); + evas_object_image_data_set(co->img, NULL); + ecore_x_image_free(co->xim); + co->xim = NULL; + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_size_set(o, 1, 1); + evas_object_image_data_set(o, NULL); + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_img_pass_events_set(E_Comp_Win *cw, + Eina_Bool set) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->img) continue; + evas_object_pass_events_set(co->img, set); + } +} + +EAPI void +e_mod_comp_win_comp_objs_pass_events_set(E_Comp_Win *cw, + Eina_Bool set) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->shadow) continue; + evas_object_pass_events_set(co->shadow, set); + } +} + +EAPI void +e_mod_comp_win_comp_objs_img_alpha_set(E_Comp_Win *cw, + Eina_Bool alpha) +{ + Eina_List *l, *ll; + E_Comp_Object *co; + Evas_Object *o; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->img) continue; + evas_object_image_alpha_set(co->img, alpha); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_alpha_set(o, alpha); + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_img_size_set(E_Comp_Win *cw, + int w, + int h) +{ + Eina_List *l, *ll; + E_Comp_Object *co; + Evas_Object *o; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->img) continue; + evas_object_image_size_set(co->img, w, h); + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_size_set(o, w, h); + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_img_data_update_add(E_Comp_Win *cw, + int x, + int y, + int w, + int h) +{ + Eina_List *l, *ll; + E_Comp_Object *co; + Evas_Object *o; + + E_Comp_Canvas *canvas, *ly_canvas = NULL; + E_Comp_Layer *ly; + E_Comp_Effect_Object *eff_obj = NULL; + Eina_Bool eff_run = EINA_FALSE; + canvas = eina_list_nth(cw->c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + eff_run = e_mod_comp_layer_effect_get(ly); + if (eff_run) + { + eff_obj = e_mod_comp_layer_effect_obj_get(ly, cw->win); + if (eff_obj) ly_canvas = ly->canvas; + } + + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->img) continue; + + /* viewport culling: + * Do nothing if an object is not located on E_Zone. + * A given object should not be marked if it is located on + * outer viewport. The evas doesn't perform viewport culling + * correctly. + */ + if ((cw->visible) && + !((cw->input_only) && (cw->invalid)) && + E_INTERSECTS(co->zone->x, co->zone->y, + co->zone->w, co->zone->h, + cw->x, cw->y, cw->w, cw->h)) + { + evas_object_image_data_update_add(co->img, x, y, w, h); + + /* to show damaged window while effect, we should also update effect object */ + if (eff_obj) + { + if (ly_canvas == co->canvas) + evas_object_image_data_update_add(eff_obj->img, x, y, w, h); + } + } + + EINA_LIST_FOREACH(co->img_mirror, ll, o) + { + evas_object_image_data_update_add(o, x, y, w, h); + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_needxim_set(E_Comp_Win *cw, + Eina_Bool need) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (need && co->xim) co->needxim = EINA_TRUE; + } +} + +EAPI void +e_mod_comp_win_comp_objs_native_set(E_Comp_Win *cw, + Eina_Bool native) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + co->native = native; + } +} + +EAPI void +e_mod_comp_win_comp_objs_data_del(E_Comp_Win *cw, + const char *key) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + evas_object_data_del(co->shadow, key); + } +} + +EAPI void +e_mod_comp_win_comp_objs_data_set(E_Comp_Win *cw, + const char *key, + const void *data) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->shadow) continue; + evas_object_data_set(co->shadow, key, data); + } +} + +EAPI void +e_mod_comp_win_comp_objs_show(E_Comp_Win *cw) +{ + Eina_List *l; + E_Comp_Object *co; + Eina_Bool eff = EINA_FALSE; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if ((!cw->update) && + (cw->visible) && + (cw->dmg_updates >= 1)) + { + if (!evas_object_visible_get(co->shadow) && + !(cw->animate_hide)) + { + if (!cw->hidden_override) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "[comp_objs_show] win:0x%07x name:%s", + cw->bd ? cw->bd->client.win : cw->win, + cw->bd ? cw->bd->client.netwm.name : NULL); + + evas_object_show(co->shadow); + + if (_comp_mod->conf->use_hwc) + { + cw->hwc.set_drawable = EINA_TRUE; + } + } + else + e_mod_comp_bg_win_handler_update(cw); + + if (!cw->hidden_override) + eff = EINA_TRUE; + } + } + } + + if (eff) cw->c->effect_funcs.win_show(cw); +} + +/** + * It is possible that the WM can receive a border show event immediatly + * after getting a border hide event such as indicator hide/show. + * In that case, if we use e_mod_comp_win_objs_show() function then we + * don't append showing EDJE signal because a shadow object of given window + * is still visible state. The hide_done callback can make object to hide. + * Thus the WM has to append showing EDJE signal into the job queue + * to show a shadow object of given window. + */ +EAPI void +e_mod_comp_win_comp_objs_force_show(E_Comp_Win *cw) +{ + Eina_List *l; + E_Comp_Object *co; + Eina_Bool eff = EINA_FALSE; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!cw->animate_hide) + { + if (!cw->hidden_override) + { + if (!evas_object_visible_get(co->shadow)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "[comp_objs_force_show] win:0x%07x name:%s", + cw->bd ? cw->bd->client.win : cw->win, + cw->bd ? cw->bd->client.netwm.name : NULL); + + evas_object_show(co->shadow); + + if (_comp_mod->conf->use_hwc) + { + cw->hwc.set_drawable = EINA_TRUE; + } + } + eff = EINA_TRUE; + } + else + e_mod_comp_bg_win_handler_update(cw); + } + } + + if (eff) cw->c->effect_funcs.win_show(cw); +} + +EAPI void +e_mod_comp_win_comp_objs_hide(E_Comp_Win *cw) +{ + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->shadow) continue; + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "[comp_objs_hide] win:0x%07x name:%s", + cw->bd ? cw->bd->client.win : cw->win, + cw->bd ? cw->bd->client.netwm.name : NULL); + + evas_object_hide(co->shadow); + + if (_comp_mod->conf->use_hwc) + { + evas_object_hide(co->hwc.mask_rect); + cw->hwc.set_drawable = EINA_FALSE; + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_raise(E_Comp_Win *cw) +{ + Eina_List *l; + E_Comp_Object *co; + E_Comp_Layer *ly; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + e_layout_child_raise(co->shadow); + if (_comp_mod->conf->use_hwc) + { + e_layout_child_raise_above(co->hwc.mask_rect, co->shadow); + } + ly = e_mod_comp_canvas_layer_get(co->canvas, "comp"); + if (ly) e_mod_comp_layer_bg_adjust(ly); + } +} + +EAPI void +e_mod_comp_win_comp_objs_lower(E_Comp_Win *cw) +{ + Eina_List *l; + E_Comp_Object *co; + E_Comp_Layer *ly; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + e_layout_child_lower(co->shadow); + if (_comp_mod->conf->use_hwc) + { + e_layout_child_raise_above(co->hwc.mask_rect, co->shadow); + } + + ly = e_mod_comp_canvas_layer_get(co->canvas, "comp"); + if (ly) e_mod_comp_layer_bg_adjust(ly); + } +} + +EAPI void +e_mod_comp_win_comp_objs_stack_above(E_Comp_Win *cw, + E_Comp_Win *cw2) +{ + Eina_List *l, *ll; + E_Comp_Object *co, *co2; + E_Comp_Layer *ly; + EINA_LIST_FOREACH(cw->objs, l, co) + { + EINA_LIST_FOREACH(cw2->objs, ll, co2) + { + if (co->zone == co2->zone) + { + e_layout_child_raise_above(co->shadow, + co2->shadow); + if (_comp_mod->conf->use_hwc) + { + e_layout_child_raise_above(co->hwc.mask_rect, co->shadow); + e_layout_child_raise_above(co2->hwc.mask_rect, co2->shadow); + } + ly = e_mod_comp_canvas_layer_get(co->canvas, "comp"); + if (ly) e_mod_comp_layer_bg_adjust(ly); + } + } + } +} + +EAPI void +e_mod_comp_win_comp_objs_transparent_rect_update(E_Comp_Win *cw) +{ + E_Comp_Object *co; + Eina_List *l; + + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (cw->transp_rect.use) + { + if (!co->transp.offset) + co->transp.offset = evas_object_rectangle_add(co->canvas->evas); + if (!co->transp.rect) + co->transp.rect = evas_object_rectangle_add(co->canvas->evas); + + if ((co->transp.offset) && (co->transp.rect)) + { + evas_object_size_hint_min_set(co->transp.offset, + cw->transp_rect.x, + cw->transp_rect.y); + evas_object_size_hint_min_set(co->transp.rect, + cw->transp_rect.w, + cw->transp_rect.h); + evas_object_color_set(co->transp.offset, 0, 0, 0, 0); + evas_object_color_set(co->transp.rect, 0, 0, 0, 0); + evas_object_render_op_set(co->transp.rect, EVAS_RENDER_COPY); + + if (co->shadow) + { + if (edje_object_part_exists(co->shadow, "e.swallow.transp.offset")) + { + edje_object_part_swallow(co->shadow, + "e.swallow.transp.offset", + co->transp.offset); + } + + if (edje_object_part_exists(co->shadow, "e.swallow.transp.rect")) + { + edje_object_part_swallow(co->shadow, + "e.swallow.transp.rect", + co->transp.rect); + } + } + } + } + else + { + if (co->transp.offset) + { + if (co->shadow) + { + if (edje_object_part_exists(co->shadow, "e.swallow.transp.offset")) + { + edje_object_part_unswallow(co->shadow, + co->transp.offset); + } + } + evas_object_size_hint_min_set(co->transp.offset, 0, 0); + evas_object_color_set(co->transp.offset, 0, 0, 0, 0); + evas_object_del(co->transp.offset); + co->transp.offset = NULL; + } + if (co->transp.rect) + { + if (co->shadow) + { + if (edje_object_part_exists(co->shadow, "e.swallow.transp.rect")) + { + edje_object_part_unswallow(co->shadow, + co->transp.rect); + } + } + evas_object_size_hint_min_set(co->transp.rect, 0, 0); + evas_object_color_set(co->transp.rect, 0, 0, 0, 0); + evas_object_render_op_set(co->transp.rect, EVAS_RENDER_BLEND); + evas_object_del(co->transp.rect); + co->transp.rect = NULL; + } + } + } + +#ifdef _F_USE_BORDER_TRANSFORM_ + e_mod_comp_win_comp_objs_img_transform_set(cw, EINA_TRUE); +#endif +} + +EAPI void +e_mod_comp_win_hwcomp_mask_objs_show(E_Comp_Win *cw) +{ + E_CHECK(cw); + + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->hwc.mask_rect) continue; + if (!co->shadow) continue; + + e_layout_child_move(co->hwc.mask_rect, cw->x, cw->y); + e_layout_child_resize(co->hwc.mask_rect, cw->pw, cw->ph); + e_layout_child_raise_above(co->hwc.mask_rect, co->shadow); + evas_object_show(co->hwc.mask_rect); +#if DEBUG_HWC + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| Show(x:%d, y:%d, w:%d, h:%d)", "Mask OBJ", cw->x, cw->y, cw->pw, cw->ph); +#endif + } +} + +EAPI void +e_mod_comp_win_hwcomp_mask_objs_hide(E_Comp_Win *cw) +{ + E_CHECK(cw); + + Eina_List *l; + E_Comp_Object *co; + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->hwc.mask_rect) continue; + + evas_object_hide(co->hwc.mask_rect); +#if DEBUG_HWC + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| Hide", "Mask OBJ"); +#endif + } +} + +#ifdef _F_USE_BORDER_TRANSFORM_ +EAPI void +e_mod_comp_win_comp_objs_img_transform_set(E_Comp_Win *cw, Eina_Bool force) +{ + if (!cw) return; + if (!cw->bd) return; + if (!cw->objs) return; + + E_Comp_Object* co = NULL; + co = eina_list_nth(cw->objs, 0); + + if ((!co) || (!co->shadow)) return;; + + if (e_border_transform_enable_get(cw->bd)) + { +#if 0 + Evas_Map* m = evas_map_new(4); + evas_map_util_points_populate_from_object_full(m, co->shadow, 0); + evas_map_util_points_color_set(m, 255, 255, 255, 255); + E_Border_Transform_Vertex vertex = e_border_transform_vertex_get(cw->bd); + + int i; + for (i = 0; i < 4; ++i) + { + evas_map_point_coord_set(m, i, vertex.vertexPosition[i][0], + vertex.vertexPosition[i][1], + vertex.vertexPosition[i][2]); + } + + evas_object_map_set(co->shadow, m); + evas_object_map_enable_set(co->shadow, EINA_TRUE); + evas_map_free(m); +#else + int x, y, w, h; + + e_border_transform_get(cw->bd, &x, &y, &w, &h, 0); + e_mod_comp_win_comp_objs_move(cw, x, y); + e_mod_comp_win_comp_objs_resize(cw, w, h); + + if (cw->transp_rect.use) + { + float dw = 0; + float dh = 0; + + if (cw->bd->w == 0) return; + if (cw->bd->h == 0) return; + + dw = (float)w / (float)cw->bd->w; + dh = (float)h / (float)cw->bd->h; + + if (co->transp.offset) + { + evas_object_size_hint_min_set(co->transp.offset, + (int)((float)cw->transp_rect.x * dw), + (int)((float)cw->transp_rect.y * dh)); + } + if (co->transp.rect) + { + evas_object_size_hint_min_set(co->transp.rect, + (int)((float)cw->transp_rect.w * dw), + (int)((float)cw->transp_rect.h * dh)); + } + } +#endif + } + else + { + if (force) return; + + e_mod_comp_win_comp_objs_move(cw, cw->bd->x, cw->bd->y); + e_mod_comp_win_comp_objs_resize(cw, cw->bd->w, cw->bd->h); + + if (cw->transp_rect.use) + { + if (co->transp.offset) + evas_object_size_hint_min_set(co->transp.offset, + cw->transp_rect.x, + cw->transp_rect.y); + if (co->transp.rect) + evas_object_size_hint_min_set(co->transp.rect, + cw->transp_rect.w, + cw->transp_rect.h); + } + } +} +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ diff --git a/src/e_mod_comp_object.h b/src/e_mod_comp_object.h new file mode 100644 index 0000000..03f38f2 --- /dev/null +++ b/src/e_mod_comp_object.h @@ -0,0 +1,70 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_OBJECT_H +#define E_MOD_COMP_OBJECT_H + +typedef struct _E_Comp_Object E_Comp_Object; + +struct _E_Comp_Object +{ + E_Comp_Canvas *canvas; + E_Zone *zone; + + Evas_Object *img; // composite image object + Evas_Object *shadow; // shadow object + Eina_List *img_mirror; // extra mirror image objects + Ecore_X_Image *xim; // x image - software fallback + + Evas_Object *clipper; + + Eina_Bool native : 1; // native + Eina_Bool needxim : 1; // need new xim + + struct + { + Evas_Object *offset; // offset rectangle object for transparent rectangle + Evas_Object *rect; // transparent rectangle object + } transp; + + struct + { + Evas_Object *mask_rect; // mask rectangle object for blending set_drawable area + } hwc; +}; + +EAPI E_Comp_Object *e_mod_comp_obj_add(E_Comp_Win *cw, E_Comp_Canvas *canvas); +EAPI void e_mod_comp_obj_del(E_Comp_Object *co); + +EAPI Eina_List *e_mod_comp_win_comp_objs_add(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_del(E_Comp_Win *cw, Eina_List *objs); +EAPI void e_mod_comp_win_comp_objs_move(E_Comp_Win *cw, int x, int y); +EAPI void e_mod_comp_win_comp_objs_resize(E_Comp_Win *cw, int w, int h); +EAPI void e_mod_comp_win_comp_objs_img_resize(E_Comp_Win *cw, int w, int h); +EAPI void e_mod_comp_win_comp_objs_img_init(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_img_deinit(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_xim_free(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_img_pass_events_set(E_Comp_Win *cw, Eina_Bool set); +EAPI void e_mod_comp_win_comp_objs_pass_events_set(E_Comp_Win *cw, Eina_Bool set); +EAPI void e_mod_comp_win_comp_objs_img_alpha_set(E_Comp_Win *cw, Eina_Bool alpha); +EAPI void e_mod_comp_win_comp_objs_img_size_set(E_Comp_Win *cw, int w, int h); +EAPI void e_mod_comp_win_comp_objs_img_data_update_add(E_Comp_Win *cw, int x, int y, int w, int h); +EAPI void e_mod_comp_win_comp_objs_needxim_set(E_Comp_Win *cw, Eina_Bool need); +EAPI void e_mod_comp_win_comp_objs_native_set(E_Comp_Win *cw, Eina_Bool native); +EAPI void e_mod_comp_win_comp_objs_data_del(E_Comp_Win *cw, const char *key); +EAPI void e_mod_comp_win_comp_objs_data_set(E_Comp_Win *cw, const char *key, const void *data); +EAPI void e_mod_comp_win_comp_objs_show(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_force_show(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_hide(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_raise(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_lower(E_Comp_Win *cw); +EAPI void e_mod_comp_win_comp_objs_stack_above(E_Comp_Win *cw, E_Comp_Win *cw2); +EAPI void e_mod_comp_win_comp_objs_transparent_rect_update(E_Comp_Win *cw); + +EAPI void e_mod_comp_win_hwcomp_mask_objs_show(E_Comp_Win *cw); +EAPI void e_mod_comp_win_hwcomp_mask_objs_hide(E_Comp_Win *cw); + +#ifdef _F_USE_BORDER_TRANSFORM_ +EAPI void e_mod_comp_win_comp_objs_img_transform_set(E_Comp_Win *cw, Eina_Bool force); +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ +#endif +#endif diff --git a/src/e_mod_comp_policy.c b/src/e_mod_comp_policy.c new file mode 100644 index 0000000..f8441b2 --- /dev/null +++ b/src/e_mod_comp_policy.c @@ -0,0 +1,113 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_debug.h" +#include "e_mod_comp_policy.h" + +/* local subsystem functions */ + +/* local subsystem globals */ +static Eina_Hash *shadow_hash = NULL; + +/* externally accessible functions */ +EAPI int +e_mod_comp_policy_init(void) +{ + if (!shadow_hash) shadow_hash = eina_hash_string_superfast_new(NULL); + + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_UNKNOWN), _comp_mod->conf->effect_policy_unknown); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_DESKTOP), _comp_mod->conf->effect_policy_desktop); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_DOCK), _comp_mod->conf->effect_policy_dock); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_TOOLBAR), _comp_mod->conf->effect_policy_toolbar); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_MENU), _comp_mod->conf->effect_policy_menu); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_UTILITY), _comp_mod->conf->effect_policy_utility); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_SPLASH), _comp_mod->conf->effect_policy_splash); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_DIALOG), _comp_mod->conf->effect_policy_dialog); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_NORMAL), _comp_mod->conf->effect_policy_normal); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_VIDEOCALL), _comp_mod->conf->effect_policy_videocall); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_DROPDOWN_MENU), _comp_mod->conf->effect_policy_dropdown_menu); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_POPUP_MENU), _comp_mod->conf->effect_policy_popup_menu); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_TOOLTIP), _comp_mod->conf->effect_policy_tooltip); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_NOTIFICATION), _comp_mod->conf->effect_policy_notification); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_COMBO), _comp_mod->conf->effect_policy_combo); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_DND), _comp_mod->conf->effect_policy_dnd); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_MENUSCREEN), _comp_mod->conf->effect_policy_menuscreen); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_QUICKPANEL_BASE), _comp_mod->conf->effect_policy_quickpanel_base); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_QUICKPANEL), _comp_mod->conf->effect_policy_quickpanel); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_TASKMANAGER), _comp_mod->conf->effect_policy_taskmanager); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_LIVEMAGAZINE), _comp_mod->conf->effect_policy_livemagazine); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_LOCKSCREEN), _comp_mod->conf->effect_policy_lockscreen); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_INDICATOR), _comp_mod->conf->effect_policy_indicator); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_TICKERNOTI), _comp_mod->conf->effect_policy_tickernoti); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_DEBUGGING_INFO), _comp_mod->conf->effect_policy_debugging_info); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_APPTRAY), _comp_mod->conf->effect_policy_apptray); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_MINI_APPTRAY), _comp_mod->conf->effect_policy_mini_apptray); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_VOLUME), _comp_mod->conf->effect_policy_volume); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_BACKGROUND), _comp_mod->conf->effect_policy_background); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_ISF_KEYBOARD), _comp_mod->conf->effect_policy_isf_keyboard); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_ISF_SUB), _comp_mod->conf->effect_policy_isf_sub); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_SETUP_WIZARD), _comp_mod->conf->effect_policy_setup_wizard); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_TOAST), _comp_mod->conf->effect_policy_toast); + eina_hash_add(shadow_hash, e_util_winid_str_get(E_COMP_WIN_TYPE_APP_POPUP), _comp_mod->conf->effect_policy_app_popup); + + return 1; +} + +EAPI int +e_mod_comp_policy_shutdown(void) +{ + if (shadow_hash) eina_hash_free(shadow_hash); + shadow_hash = NULL; + return 1; +} + +EAPI Eina_Bool +e_mod_comp_policy_app_launch_check(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->bd, 0); + E_CHECK_RETURN(cw->bd->zone, 0); + if (TYPE_NORMAL_CHECK(cw) && REGION_EQUAL_TO_ZONE(cw, cw->bd->zone)) + return EINA_TRUE; + return EINA_FALSE; +} + +EAPI Eina_Bool +e_mod_comp_policy_app_close_check(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->bd, 0); + E_CHECK_RETURN(cw->bd->zone, 0); + if (TYPE_NORMAL_CHECK(cw) && REGION_EQUAL_TO_ZONE(cw, cw->bd->zone)) + return EINA_TRUE; + return EINA_FALSE; +} + +EAPI char * +e_mod_comp_policy_win_shadow_group_get(E_Comp_Win *cw) +{ + E_Comp_Win_Type type; + E_CHECK_RETURN(cw, 0); + type = e_mod_comp_win_type_get(cw); + return eina_hash_find(shadow_hash, e_util_winid_str_get(type)); +} + +/* when receiving border show event for the home window, + * check before running app closing effect for given normal window. + * exceptional windows: lock, setup wizard + * otherwise: do app closing effect + */ +EAPI Eina_Bool +e_mod_comp_policy_home_app_win_check(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, EINA_FALSE); + + if (TYPE_LOCKSCREEN_CHECK(cw) || + TYPE_SETUP_WIZARD_CHECK(cw)) + { + return EINA_FALSE; + } + + return EINA_TRUE; +} + +/* local subsystem functions */ diff --git a/src/e_mod_comp_policy.h b/src/e_mod_comp_policy.h new file mode 100644 index 0000000..6f87cfd --- /dev/null +++ b/src/e_mod_comp_policy.h @@ -0,0 +1,14 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_POLICY_H +#define E_MOD_COMP_POLICY_H + +EAPI int e_mod_comp_policy_init(void); +EAPI int e_mod_comp_policy_shutdown(void); +EAPI Eina_Bool e_mod_comp_policy_app_launch_check(E_Comp_Win *cw); +EAPI Eina_Bool e_mod_comp_policy_app_close_check(E_Comp_Win *cw); +EAPI char *e_mod_comp_policy_win_shadow_group_get(E_Comp_Win *cw); +EAPI Eina_Bool e_mod_comp_policy_home_app_win_check(E_Comp_Win *cw); + +#endif +#endif diff --git a/src/e_mod_comp_screen.c b/src/e_mod_comp_screen.c new file mode 100644 index 0000000..b1adce2 --- /dev/null +++ b/src/e_mod_comp_screen.c @@ -0,0 +1,212 @@ +#include "e.h" +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" +#include "e_mod_comp.h" +#include "e_mod_comp_screen.h" + +/* local subsystem functions */ +static int _screen_angle_get(Ecore_X_Window root); +static void _screen_lock(E_Comp *c); +static void _screen_unlock(E_Comp *c); +static Eina_Bool _screen_lock_timeout(void *data); + +/* externally accessible functions */ +EAPI Eina_Bool +e_mod_comp_screen_rotation_init(E_Comp_Screen_Rotation *r, + Ecore_X_Window root, + int w, int h) +{ + E_CHECK_RETURN(r, 0); + E_CHECK_RETURN(root, 0); + E_CHECK_RETURN((w > 0), 0); + E_CHECK_RETURN((h > 0), 0); + + r->enabled = EINA_FALSE; + r->scr_w = w; + r->scr_h = h; + r->angle = _screen_angle_get(root); + + if (0 != r->angle) + { + r->enabled = EINA_TRUE; + if (0 != (r->angle % 180)) + { + r->scr_w = h; + r->scr_h = w; + } + } + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_screen_lock_init(E_Comp_Screen_Lock *l) +{ + E_CHECK_RETURN(l, 0); + l->locked = EINA_FALSE; + l->timeout = NULL; + return EINA_FALSE; +} + +EAPI Eina_Bool +e_mod_comp_screen_lock_handler_message(Ecore_X_Event_Client_Message *ev) +{ + E_Comp *c; + E_CHECK_RETURN(ev, 0); + E_CHECK_RETURN(_comp_mod->conf->use_lock_screen, 0); + + c = e_mod_comp_find(ev->win); + E_CHECK_RETURN(c, 0); + + if (ev->data.l[0] == 0) _screen_unlock(c); + else if (ev->data.l[0] == 1) _screen_lock(c); + + return EINA_TRUE; +} + +EAPI void +e_mod_comp_screen_lock_func(void *data, + E_Manager *man __UNUSED__) +{ + E_Comp *c = (E_Comp *)data; + E_CHECK(c); + _screen_lock(c); +} + +EAPI void +e_mod_comp_screen_unlock_func(void *data, + E_Manager *man __UNUSED__) +{ + E_Comp *c = (E_Comp *)data; + E_CHECK(c); + _screen_unlock(c); +} + +/* local subsystem functions */ +static int +_screen_angle_get(Ecore_X_Window root) +{ + int ret = -1, ang = 0; + unsigned int val = 0; + Ecore_X_Display* dpy = ecore_x_display_get(); + E_CHECK_RETURN(dpy, 0); + E_CHECK_RETURN(ATOM_X_SCREEN_ROTATION, 0); + + ret = ecore_x_window_prop_card32_get + (root, ATOM_X_SCREEN_ROTATION, &val, 1); + E_CHECK_RETURN((ret > 0), 0); + + switch (val) + { + case 1: ang = 0; break; + case 2: ang = 90; break; + case 4: ang = 180; break; + case 8: ang = 270; break; + default: ang = 0; break; + } + + return ang; +} + +static void +_screen_lock(E_Comp *c) +{ + Eina_List *l; + E_Comp_Canvas *canvas; + + E_CHECK(_comp_mod); + E_CHECK(_comp_mod->conf->use_lock_screen); + E_CHECK(c->lock.locked != 1); + E_CHECK(!c->lock.timeout); + + if (!_comp_mod->conf->lock_fps) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (_comp_mod->conf->use_hwc) + { + if (c->hwcomp_funcs.set_full_composite) + c->hwcomp_funcs.set_full_composite(canvas->hwcomp); +#if HWC_ROTATION_PATCH +#else + if (c->hwcomp_funcs.update_null_set_drawables) + c->hwcomp_funcs.update_null_set_drawables(canvas->hwcomp); +#endif + } + + ecore_evas_manual_render_set(canvas->ee, 1); + } + } + + c->lock.timeout = ecore_timer_add + (_comp_mod->conf->max_lock_screen_time, + _screen_lock_timeout, c); + + c->lock.locked = EINA_TRUE; +} + +static void +_screen_unlock(E_Comp *c) +{ + Eina_List *l; + E_Comp_Canvas *canvas; + E_Comp_Win *cw; + + E_CHECK(_comp_mod); + E_CHECK(_comp_mod->conf->use_lock_screen); + E_CHECK(c->lock.locked); + if (c->lock.timeout) + { + ecore_timer_del(c->lock.timeout); + c->lock.timeout = NULL; + } + + // remove all cw->update_timeout + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + if ((!cw->visible) || (cw->input_only) || (cw->invalid)) + continue; + if (cw->counter && cw->update_timeout) + { + cw->update = 0; + e_mod_comp_win_damage_timeout((void*)cw); + } + } + + // clear c->update_job + if (c->update_job) + { + ecore_job_del(c->update_job); + c->update_job = NULL; + c->render_overflow = 0; + } + + // clear c->updates + if (c->updates) e_mod_comp_cb_update(c); + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + + if ((canvas->nocomp.mode == E_NOCOMP_MODE_NONE) + || (canvas->nocomp.mode == E_NOCOMP_MODE_PREPARE)) + { + ecore_evas_manual_render(canvas->ee); + + if (!_comp_mod->conf->lock_fps) + ecore_evas_manual_render_set(canvas->ee, 0); + } + } + + c->lock.locked = 0; +} + +static Eina_Bool +_screen_lock_timeout(void *data) +{ + E_Comp *c = (E_Comp*)data; + E_CHECK_RETURN(c, 0); + _screen_unlock(c); + return EINA_TRUE; +} diff --git a/src/e_mod_comp_screen.h b/src/e_mod_comp_screen.h new file mode 100644 index 0000000..dbf57d2 --- /dev/null +++ b/src/e_mod_comp_screen.h @@ -0,0 +1,30 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_SCREEN_H +#define E_MOD_COMP_SCREEN_H + +typedef struct _E_Comp_Screen_Rotation E_Comp_Screen_Rotation; +typedef struct _E_Comp_Screen_Lock E_Comp_Screen_Lock; + +struct _E_Comp_Screen_Rotation +{ + Eina_Bool enabled : 1; + int angle; + int scr_w; + int scr_h; +}; + +struct _E_Comp_Screen_Lock +{ + Eina_Bool locked : 1; + Ecore_Timer *timeout; +}; + +EAPI Eina_Bool e_mod_comp_screen_rotation_init(E_Comp_Screen_Rotation *r, Ecore_X_Window root, int w, int h); +EAPI Eina_Bool e_mod_comp_screen_lock_init(E_Comp_Screen_Lock *l); +EAPI Eina_Bool e_mod_comp_screen_lock_handler_message(Ecore_X_Event_Client_Message *ev); +EAPI void e_mod_comp_screen_lock_func(void *data, E_Manager *man); +EAPI void e_mod_comp_screen_unlock_func(void *data, E_Manager *man); + +#endif +#endif diff --git a/src/e_mod_comp_shared_types.h b/src/e_mod_comp_shared_types.h new file mode 100755 index 0000000..f9e11e3 --- /dev/null +++ b/src/e_mod_comp_shared_types.h @@ -0,0 +1,291 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_SHARED_TYPES_H +#define E_MOD_COMP_SHARED_TYPES_H + +typedef struct _E_Comp E_Comp; +typedef struct _E_Comp_Win E_Comp_Win; +typedef struct _E_Comp_Effect_Object E_Comp_Effect_Object; +typedef struct _E_Comp_Effect_Zone_Rotation E_Comp_Effect_Zone_Rotation; +typedef struct _E_Comp_HWComp E_Comp_HWComp; + +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_comp_update.h" +#include "e_mod_comp_hw_ov_win.h" +#include "e_mod_comp_canvas.h" +#include "e_mod_comp_object.h" +#include "e_mod_comp_policy.h" +#include "e_mod_comp_effect_win_rotation.h" +#include "e_mod_comp_effect.h" +#include "e_mod_comp_win_type.h" +#include "e_mod_comp_screen.h" +#include "e_mod_comp_win_shape_input.h" +#include "e_mod_comp_bg_win.h" +#include "e_mod_comp_util.h" +#include "e_mod_comp_effect_image_launch.h" +#include "e_mod_comp_hwcomp.h" +#include "e_mod_comp_aux_hint.h" + +#ifdef ENABLE_TTRACE +#include +#endif //ENABLE_TTRACE + +#ifdef _F_USE_EXTN_DIALOG_ +# define e_util_dialog_internal e_util_extn_dialog_show +#endif + +//structure for passing values to XRR output property +typedef struct _Data_Rrprop +{ + Ecore_X_Window win; + unsigned int value; +}Data_Rrprop; + +struct _E_Comp +{ + Ecore_X_Window win; // COW + E_Manager *man; + Eina_Inlist *wins; + Eina_List *wins_list; + Eina_List *updates; + Ecore_Animator *render_animator; + Ecore_Job *update_job; + Ecore_Timer *new_up_timer; + int animating; + int render_overflow; + E_Manager_Comp comp; + Ecore_X_Window cm_selection; + Eina_List *canvases; // list of E_Comp_Canvas + Eina_Bool gl : 1; + Eina_Bool grabbed : 1; + Eina_Bool nocomp : 1; + Eina_Bool wins_invalid : 1; + + // added for tizen + Eina_Bool animatable : 1; // if this value is true then window can show animaton. otherwise, window can not show animation effect. + Eina_Bool effect_stage : 1; + E_Comp_Screen_Lock lock; + E_Comp_Screen_Rotation rotation; + Eina_Bool need_shape_merge; + Eina_Bool use_hw_ov; // use H/W overlay window for primary screen + Eina_Bool keyboard_effect : 1; // True: Compositor Show Keyborad Window Effect / False: Compositor do not show keyboard window effect + Eina_Bool defer_raise_effect : 1; // True : Compositor defer evas object restack on window effect + Eina_Bool fake_image_launch : 1; // True : Enable Fake Image Launch feature + E_Comp_Win *lower_win; // For saving window on backkey(lower) event + + // fake image launch + E_Comp_Effect_Image_Launch *eff_img; + Evas *evas; + + Eina_List *shape_inputs; + Eina_List *shape_inputs_mo; + + //effect module + void *effect_handle; + //hwcomp module + void *hwcomp_handle; + + struct + { + Eina_Bool (*init)(E_Comp *c); + void (*shutdown)(E_Comp *c); + + E_Comp_Effect_Type *(*type_new)(void); + void (*type_free)(E_Comp_Effect_Type *type); + Eina_Bool (*type_setup)(E_Comp_Effect_Type *type, Ecore_X_Window win); + Eina_Bool (*state_setup)(E_Comp_Effect_Type *type, Ecore_X_Window win); + Eina_Bool (*state_get)(E_Comp_Effect_Type *type); + void (*state_set)(E_Comp_Effect_Type *type, Eina_Bool state); + Eina_Bool (*style_setup)(E_Comp_Effect_Type *type, Ecore_X_Window win); + E_Comp_Effect_Style (*style_get)(E_Comp_Effect_Type *type, E_Comp_Effect_Kind kind); + + /* window effect functions */ + void (*win_show)(E_Comp_Win *cw); + void (*win_hide)(E_Comp_Win *cw); + void (*win_restack)(E_Comp_Win *cw, Eina_Bool v1, Eina_Bool v2); + + Eina_Bool (*signal_add)(E_Comp_Win *cw, Evas_Object *o, const char *emission, const char *src); + Eina_Bool (*signal_del)(E_Comp_Win *cw, Evas_Object *obj, const char *name); + Eina_Bool (*jobs_clean)(E_Comp_Win *cw, Evas_Object *obj, const char *name); + Eina_Bool (*signal_flush)(void); + Eina_Bool (*animating_set)(E_Comp *c, E_Comp_Win *cw, Eina_Bool set); + + /* effect object functions */ + E_Comp_Effect_Object *(*object_new)(E_Comp_Layer *ly, E_Comp_Win *cw, Eina_Bool recreate); + void (*object_free)(E_Comp_Effect_Object *o); + + void (*object_win_set)(E_Comp_Win *cw, const char *emission); + void (*above_wins_set)(E_Comp_Win *cw, Eina_Bool show); + + /* fake image functions */ + E_Comp_Effect_Image_Launch *(*image_launch_new)(Evas *e, int w, int h); + void (*image_launch_free)(E_Comp_Effect_Image_Launch *eff); + Eina_Bool (*image_launch_handler_message)(Ecore_X_Event_Client_Message *ev); + Eina_Bool (*image_launch_show)(E_Comp_Effect_Image_Launch *eff, const char *file); + Eina_Bool (*image_launch_hide)(E_Comp_Effect_Image_Launch *eff); + Eina_Bool (*image_launch_window_check)(E_Comp_Effect_Image_Launch *eff, E_Comp_Win *cw); + Eina_Bool (*image_launch_running_check)(E_Comp_Effect_Image_Launch *eff); + Eina_Bool (*image_launch_fake_show_done_check)(E_Comp_Effect_Image_Launch *eff); + Eina_Bool (*image_launch_window_set)(E_Comp_Effect_Image_Launch *eff, Ecore_X_Window w); + void (*image_launch_disable)(E_Comp_Effect_Image_Launch *eff); + + /* rotation functions */ + Eina_Bool (*win_angle_get)(E_Comp_Win *cw); + E_Comp_Effect_Zone_Rotation *(*zone_rotation_new)(E_Comp_Canvas *canvas); + void (*zone_rotation_free)(E_Comp_Effect_Zone_Rotation *zr); + Eina_Bool (*zone_rotation_begin)(E_Comp_Effect_Zone_Rotation *zr); + Eina_Bool (*zone_rotation_end)(E_Comp_Effect_Zone_Rotation *zr); + Eina_Bool (*zone_rotation_cancel)(E_Comp_Effect_Zone_Rotation *zr); + Eina_Bool (*zone_rotation_do)(E_Comp_Effect_Zone_Rotation *zr); + Eina_Bool (*zone_rotation_clear)(E_Comp_Effect_Zone_Rotation *zr); + }effect_funcs; + + struct + { + Eina_Bool (*init)(E_Comp *c); + void (*shutdown)(E_Comp *c); + + E_Comp_HWComp* (*hwcomp_new)(E_Comp_Canvas *canvas); + void (*hwcomp_free)(E_Comp_HWComp *hwcomp); + void (*update_composite)(E_Comp_HWComp *hwcomp); + void (*set_full_composite)(E_Comp_HWComp *hwcomp); + void (*force_composite_set)(E_Comp_HWComp *hwcomp, Eina_Bool set); + Eina_Bool (*force_composite_get)(E_Comp_HWComp *hwcomp); + Eina_Bool (*cb_update)(E_Comp_HWComp *hwcomp); + void (*process_event)(E_Comp *c, Ecore_X_Event_Generic *e); + void (*check_win_update)(E_Comp_Win *cw, int w, int h); + void (*win_update)(E_Comp_Win *cw); + void (*set_resize)(E_Comp_Win *cw); + void (*reset_idle_timer)(E_Comp_Canvas *canvas); + void (*win_del)(E_Comp_Win *cw); + E_HWComp_Mode (*mode_get)(E_Comp_HWComp *hwcomp); + void (*update_null_set_drawables)(E_Comp_HWComp *hwcomp); + void (*fullcomp_pending_release)(E_Comp_HWComp *hwcomp); + void (*cb_rotation_begin)(E_Comp_HWComp *hwcomp); + void (*cb_rotation_end)(E_Comp_HWComp *hwcomp); + void (*set_drawables)(E_Comp_HWComp_Update *hwc_update, Ecore_X_Window win); + Eina_Bool (*verify_update_mode)(E_Comp_HWComp *hwcomp, E_Comp_HWComp_Update *hwc_update); + }hwcomp_funcs; + + Eina_Bool stand_by_canvas_render; // stand by canvas flip while composite init +}; + +struct _E_Comp_Win +{ + EINA_INLIST; + + E_Comp *c; // parent compositor + Ecore_X_Window win; // raw window - for menus etc. + E_Border *bd; // if its a border - later + E_Popup *pop; // if its a popup - later + E_Menu *menu; // if it is a menu - later + int x, y, w, h; // geometry + struct + { + int x, y; // temporary geometry (for save geometry from window was resized to rendering was finished) + } resizing; + struct + { + int x, y, w, h; // hidden geometry (used when its unmapped and re-instated on map) + } hidden; + int pw, ph; // pixmap w/h + int border; // border width + Ecore_X_Pixmap pixmap; // the compositing pixmap + Ecore_X_Damage damage; // damage region + Ecore_X_Visual vis; // window visual + int depth; // window depth + Eina_List *objs; // list of E_Comp_Object + E_Update *up; // update handler + E_Object_Delfn *dfn; // delete function handle for objects being tracked + Ecore_X_Sync_Counter counter; // sync counter for syncronised drawing + Ecore_Timer *update_timeout; // max time between damage and "done" event + Ecore_Timer *ready_timeout; // max time on show (new window draw) to wait for window contents to be ready if sync protocol not handled. this is fallback. + int dmg_updates; // num of damage event updates since a redirect + Ecore_X_Rectangle *rects; // shape rects... if shaped :( + int rects_num; // num rects above + Ecore_X_Pixmap cache_pixmap; // the cached pixmap (1/nth the dimensions) + int cache_w, cache_h; // cached pixmap size + int update_count; // how many updates have happend to this win + double last_visible_time; // last time window was visible + double last_draw_time; // last time window was damaged + int pending_count; // pending event count + unsigned int opacity; // opacity set with _NET_WM_WINDOW_OPACITY + char *title, *name, *clas, *role; // fetched for override-redirect windowa + Ecore_X_Window_Type primary_type; // fetched for override-redirect windowa + unsigned char misses; // number of sync misses + struct { + int version; // version of efl sync + int val; // sync value + int done_count; // draw done event count + } sync_info; + Eina_Bool delete_pending : 1; // delete pendig + Eina_Bool hidden_override : 1; // hidden override + Eina_Bool animating : 1; // it's busy animating - defer hides/dels + Eina_Bool force : 1; // force del/hide even if animating + Eina_Bool defer_hide : 1; // flag to get hide to work on deferred hide + Eina_Bool delete_me : 1; // delete me! + Eina_Bool visible : 1; // is visible + Eina_Bool input_only : 1; // is input_only + Eina_Bool override : 1; // is override-redirect + Eina_Bool argb : 1; // is argb + Eina_Bool shaped : 1; // is shaped + Eina_Bool update : 1; // has updates to fetch + Eina_Bool redirected : 1; // has updates to fetch + Eina_Bool shape_changed : 1; // shape changed + Eina_Bool drawme : 1; // drawme flag fo syncing rendering + Eina_Bool invalid : 1; // invalid depth used - just use as marker + Eina_Bool nocomp : 1; // nocomp applied + Eina_Bool needpix : 1; // need new pixmap + Eina_Bool real_hid : 1; // last hide was a real window unmap + Eina_Bool inhash : 1; // is in the windows hash + Eina_Bool show_ready : 1; // is this window ready for its first show + Eina_Bool show_anim : 1; // ran show animation + Eina_Bool use_dri2 : 1; + + Eina_Bool animate_hide : 1 ; // if window animation effect is occured, do hide unrelated window. -> use evas_object_hide() + Eina_Bool resize_hide : 1; // if window do resize event received, set this valuse true; and check win_update() + Eina_Bool show_done : 1 ; // check for show is done + Eina_Bool effect_stage: 1; // check for if background window is hided or not. + Eina_Bool defer_raise; // flag to defer to raise + Eina_Bool activate; // flag to check activate + E_Comp_Effect_Type *eff_type; + E_Comp_Win_Type win_type; + E_Comp_Win_Shape_Input *shape_input; + E_Comp_BG_Win *bgwin; + int angle; // window's current angle property + Eina_Bool launched : 1; //flag for checking whether launch or not + + // ov object + Ecore_X_Image *ov_xim; + Evas_Object *ov_obj; + struct + { + int x, y, w, h; + } ov; + + /* transparent rectangle for showing under the H/W ui layer. i.e., video layer */ + struct + { + Eina_Bool use; + int x, y, w, h; + } transp_rect; + + struct + { + Eina_Bool set_drawable; + int geo_changed; + int resize_pending; + } hwc; + + Eina_Bool sync_draw_support: 1; // 1: update with damage immediately 2: ignore damage before receiving sync_draw_done + // interfacing for 3d stereoscopic mode + Eina_Bool win3d; // flag to set 3D window + Eina_Bool always_selective_mode: 1; // always selective mode (this window can't no-comp mode) + + // ignore rendering when hide + Eina_Bool ignore_dmg; // dmg ignore +}; + +#endif +#endif diff --git a/src/e_mod_comp_update.c b/src/e_mod_comp_update.c new file mode 100644 index 0000000..a510d8c --- /dev/null +++ b/src/e_mod_comp_update.c @@ -0,0 +1,243 @@ +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_comp_update.h" + +////////////////////////////////////////////////////////////////////////// + +static void +_e_mod_comp_tiles_alloc(E_Update *up) +{ + if (up->tiles) return; + up->tiles = calloc(up->tw * up->th, sizeof(unsigned char)); +} + +////////////////////////////////////////////////////////////////////////// + +E_Update * +e_mod_comp_update_new(void) +{ + E_Update *up; + + up = calloc(1, sizeof(E_Update)); + if (!up) return NULL; + + up->tsw = 32; + up->tsh = 32; + up->pol = E_UPDATE_POLICY_RAW; + return up; +} + +void +e_mod_comp_update_free(E_Update *up) +{ + if (!up) return; + if (up->tiles) free(up->tiles); + free(up); +} + +void +e_mod_comp_update_policy_set(E_Update *up, + E_Update_Policy pol) +{ + up->pol = pol; +} + +void +e_mod_comp_update_tile_size_set(E_Update *up, + int tsw, + int tsh) +{ + if ((up->tsw == tsw) && (up->tsh == tsh)) return; + up->tsw = tsw; + up->tsh = tsh; + e_mod_comp_update_clear(up); +} + +void +e_mod_comp_update_resize(E_Update *up, + int w, + int h) +{ + unsigned char *ptiles, *p, *pp; + int ptw, pth, x, y; + + if ((!up) || ((up->w == w) && (up->h == h))) return; + + ptw = up->tw; + pth = up->th; + ptiles = up->tiles; + + up->w = w; + up->h = h; + up->tw = (up->w + up->tsw - 1) / up->tsw; + up->th = (up->h + up->tsh - 1) / up->tsh; + up->tiles = NULL; + _e_mod_comp_tiles_alloc(up); + if ((ptiles) && (up->tiles)) + { + if (pth <= up->th) + { + for (y = 0; y < pth; y++) + { + p = up->tiles + (y * up->tw); + pp = ptiles + (y * ptw); + if (ptw <= up->tw) for (x = 0; x < ptw; x++) *p++ = *pp++; + else for (x = 0; x < up->tw; x++) *p++ = *pp++; + } + } + else + { + for (y = 0; y < up->th; y++) + { + p = up->tiles + (y * up->tw); + pp = ptiles + (y * ptw); + if (ptw <= up->tw) for (x = 0; x < ptw; x++) *p++ = *pp++; + else for (x = 0; x < up->tw; x++) *p++ = *pp++; + } + } + } + free(ptiles); +} + +void +e_mod_comp_update_add(E_Update *up, + int x, + int y, + int w, + int h) +{ + int tx, ty, txx, tyy, xx, yy; + unsigned char *t, *t2; + + if ((w <= 0) || (h <= 0)) return; + if ((up->tw <= 0) || (up->th <= 0)) return; + + _e_mod_comp_tiles_alloc(up); + + E_RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, up->w, up->h); + if ((w <= 0) || (h <= 0)) return; + + switch (up->pol) + { + case E_UPDATE_POLICY_RAW: + break; + + case E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH: + if (w > (up->w / 2)) + { + x = 0; + w = up->w; + } + break; + + default: + break; + } + + tx = x / up->tsw; + ty = y / up->tsh; + txx = (x + w - 1) / up->tsw; + tyy = (y + h - 1) / up->tsh; + t = up->tiles + (ty * up->tw) + tx; + for (yy = ty; yy <= tyy; yy++) + { + t2 = t; + for (xx = tx; xx <= txx; xx++) + { + *t2 = 1; + t2++; + } + t += up->tw; + } +} + +E_Update_Rect * +e_mod_comp_update_rects_get(E_Update *up) +{ + E_Update_Rect *r; + int ri = 0; + int x, y; + unsigned char *t, *t2, *t3; + + if (!up->tiles) return NULL; + r = calloc((up->tw * up->th) + 1, sizeof(E_Update_Rect)); + if (!r) return NULL; + t = up->tiles; + for (y = 0; y < up->th; y++) + { + for (x = 0; x < up->tw; x++) + { + if (*t) + { + int can_expand_x = 1, can_expand_y = 1; + int xx = 0, yy = 0; + + t2 = t + 1; + while (can_expand_x) + { + xx++; + if ((x + xx) >= up->tw) can_expand_x = 0; + else if (!*t2) + can_expand_x = 0; + if (can_expand_x) *t2 = 0; + t2++; + } + t3 = t; + while (can_expand_y) + { + int i; + + yy++; + t3 += up->tw; + if ((y + yy) >= up->th) can_expand_y = 0; + if (can_expand_y) + { + t2 = t3; + for (i = 0; i < xx; i++) + { + if (!*t2) + { + can_expand_y = 0; + break; + } + t2++; + } + } + if (can_expand_y) + { + t2 = t3; + for (i = 0; i < xx; i++) + { + *t2 = 0; + t2++; + } + } + } + *t = 0; + r[ri].x = x * up->tsw; + r[ri].y = y * up->tsh; + r[ri].w = xx * up->tsw; + r[ri].h = yy * up->tsh; + if ((r[ri].x + r[ri].w) > up->w) r[ri].w = up->w - r[ri].x; + if ((r[ri].y + r[ri].h) > up->h) r[ri].h = up->h - r[ri].y; + if ((r[ri].w <= 0) || (r[ri].h <= 0)) r[ri].w = 0; + else ri++; + x += xx - 1; + t += xx - 1; + } + t++; + } + } + return r; +} + +void +e_mod_comp_update_clear(E_Update *up) +{ + if (up->tiles) + { + free(up->tiles); + up->tiles = NULL; + } +} + diff --git a/src/e_mod_comp_update.h b/src/e_mod_comp_update.h new file mode 100644 index 0000000..6adc2e7 --- /dev/null +++ b/src/e_mod_comp_update.h @@ -0,0 +1,47 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_UPDATE_H +#define E_MOD_COMP_UPDATE_H + +typedef struct _E_Update E_Update; +typedef struct _E_Update_Rect E_Update_Rect; +typedef enum _E_Update_Policy +{ + E_UPDATE_POLICY_RAW, + E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH, +} E_Update_Policy; + +struct _E_Update_Rect +{ + int x, y, w, h; +}; + +struct _E_Update +{ + int w, h; + int tw, th; + int tsw, tsh; + unsigned char *tiles; + E_Update_Policy pol; +}; + +E_Update *e_mod_comp_update_new(void); +void e_mod_comp_update_free(E_Update *up); +void e_mod_comp_update_policy_set(E_Update *up, + E_Update_Policy pol); +void e_mod_comp_update_tile_size_set(E_Update *up, + int tsw, + int tsh); +void e_mod_comp_update_resize(E_Update *up, + int w, + int h); +void e_mod_comp_update_add(E_Update *up, + int x, + int y, + int w, + int h); +E_Update_Rect *e_mod_comp_update_rects_get(E_Update *up); +void e_mod_comp_update_clear(E_Update *up); + +#endif +#endif diff --git a/src/e_mod_comp_util.c b/src/e_mod_comp_util.c new file mode 100755 index 0000000..f838bbd --- /dev/null +++ b/src/e_mod_comp_util.c @@ -0,0 +1,523 @@ +#include +#include +#include +#include +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp_debug.h" + +/* local subsystem globals */ +static E_Comp *_c = NULL; + +/* externally accessible functions */ +EAPI void +e_mod_comp_util_set(E_Comp *c, + E_Manager *man __UNUSED__) +{ + _c = c; +} + +EAPI E_Comp * +e_mod_comp_util_get(void) +{ + return _c; +} + +EAPI Eina_Bool +e_mod_comp_util_grab_key_set(Eina_Bool grab) +{ +#ifdef _F_USE_GRAB_KEY_SET_ + E_Comp *c = NULL; + Ecore_X_Display *d = NULL; + Ecore_X_Window w; + int r[4] = { -1, }; + int i = 0; + + c = e_mod_comp_util_get(); + E_CHECK_RETURN(c, 0); + + d = ecore_x_display_get(); + E_CHECK_RETURN(d, 0); + + w = c->win; + E_CHECK_RETURN(w, 0); + + if (grab) + { + r[0] = utilx_grab_key(d, w, "XF86Home", EXCLUSIVE_GRAB); + r[1] = utilx_grab_key(d, w, KEY_VOLUMEUP, EXCLUSIVE_GRAB); + r[2] = utilx_grab_key(d, w, KEY_VOLUMEDOWN, EXCLUSIVE_GRAB); + r[3] = utilx_grab_key(d, w, KEY_CAMERA, EXCLUSIVE_GRAB); + + for (i = 0; i < 4; i++) + { + if (r[i] != 0) goto grab_failed; + } + } + else + { + utilx_ungrab_key(d, w, "XF86Home"); + utilx_ungrab_key(d, w, KEY_VOLUMEUP); + utilx_ungrab_key(d, w, KEY_VOLUMEDOWN); + utilx_ungrab_key(d, w, KEY_CAMERA); + } + + return EINA_TRUE; + +grab_failed: + utilx_ungrab_key(d, w, "XF86Home"); + utilx_ungrab_key(d, w, KEY_VOLUMEUP); + utilx_ungrab_key(d, w, KEY_VOLUMEDOWN); + utilx_ungrab_key(d, w, KEY_CAMERA); + return EINA_FALSE; +#endif + + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_util_grab_home_key_set(Eina_Bool grab) +{ +#ifdef _F_USE_GRAB_KEY_SET_ + E_Comp *c = NULL; + Ecore_X_Display *d = NULL; + Ecore_X_Window w; + int r = -1; + int i = 0; + + c = e_mod_comp_util_get(); + E_CHECK_RETURN(c, 0); + + d = ecore_x_display_get(); + E_CHECK_RETURN(d, 0); + + w = c->win; + E_CHECK_RETURN(w, 0); + + if (grab) + { + r = utilx_grab_key(d, w, "XF86Home", EXCLUSIVE_GRAB); + if (r != 0) goto grab_failed; + } + else + { + utilx_ungrab_key(d, w, "XF86Home"); + } + + return EINA_TRUE; + +grab_failed: + utilx_ungrab_key(d, w, "XF86Home"); + return EINA_FALSE; +#endif + + return EINA_TRUE; +} + + +EAPI Eina_Bool +e_mod_comp_util_screen_input_region_set(Eina_Bool set) +{ + E_Comp *c = e_mod_comp_util_get(); + int x = -1, y = -1, w = 1, h = 1; + E_CHECK_RETURN(c, 0); + + if (set) + { + x = y = 0; + w = c->man->w; + h = c->man->h; + } + + ecore_x_window_shape_input_rectangle_set(c->win, + x, y, w, h); + + return EINA_TRUE; +} + +EAPI E_Comp_Win * +e_mod_comp_util_win_nocomp_get(E_Comp *c, + E_Zone *zone) +{ + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_Win *cw = NULL; + + if (_comp_mod->conf->nocomp_fs) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone == zone) + { + if (canvas->nocomp.mode == E_NOCOMP_MODE_RUN) + { + if (canvas->nocomp.cw) + { + cw = canvas->nocomp.cw; + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| FOUND NOCOMP RUN WIN", "NOCOMP"); + } + } + break; + } + } + } + + return cw; +} + +/* TODO: clean up nocomp logic */ +#if USE_NOCOMP_DISPOSE +EAPI E_Comp_Win * +e_mod_comp_util_win_nocomp_end_get(E_Comp *c, + E_Zone *zone) +{ + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_Win *cw = NULL; + + if (_comp_mod->conf->nocomp_fs) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas) continue; + if (canvas->zone == zone) + { + if (canvas->nocomp.mode == E_NOCOMP_MODE_END) + { + if (canvas->nocomp.end.cw) + { + cw = canvas->nocomp.end.cw; + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| FOUND NOCOMP END WIN", "NOCOMP"); + } + } + break; + } + } + } + + return cw; +} +#endif + +EAPI E_Comp_Win * +e_mod_comp_util_win_normal_get(E_Comp_Win *cw, + Eina_Bool opaque) +{ + E_Comp *c = e_mod_comp_util_get(); + E_Comp_Win *cw2 = NULL, *nocomp_cw = NULL; + E_Zone *zone = NULL; + E_CHECK_RETURN(c, 0); + + if ((cw) && (cw->bd)) + zone = cw->bd->zone; + + if (!zone) + zone = e_util_zone_current_get(c->man); + + E_CHECK_RETURN(zone, NULL); + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:UTIL WIN NORMAL GET"); + + /* find nocomp window first because nocomp window doesn't have pixmap */ + nocomp_cw = e_mod_comp_util_win_nocomp_get(c, zone); + + /* look for visible normal window except for given window */ + EINA_INLIST_REVERSE_FOREACH(c->wins, cw2) + { + if ((cw2->invalid) || (cw2->input_only)) continue; + if ((cw) && (cw == cw2)) continue; /* except for given window */ + + /* return nocomp window */ + if ((nocomp_cw) && (nocomp_cw == cw2)) + { + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return cw2; + } + + /* check pixmap and compare size with zone */ + if (!cw2->bd) continue; + if (!cw2->bd->zone) continue; + if (cw2->bd->zone != zone) continue; + if (!E_INTERSECTS(zone->x, zone->y, zone->w, zone->h, + cw2->x, cw2->y, cw2->w, cw2->h)) + continue; + + if (!((cw2->pixmap) && + (cw2->pw > 0) && (cw2->ph > 0) && + (cw2->dmg_updates >= 1))) + continue; + + if (REGION_EQUAL_TO_ZONE(cw2, zone) && + ((!opaque) || (!cw2->argb))) + { + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return cw2; + } + } + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return NULL; +} + +EAPI E_Comp_Win * +e_mod_comp_util_win_home_get(E_Comp_Win *cw) +{ + E_Comp *c = e_mod_comp_util_get(); + E_Comp_Win *cw2 = NULL; + E_Zone *zone = NULL; + E_CHECK_RETURN(c, 0); + + if ((cw) && (cw->bd)) + zone = cw->bd->zone; + + if (!zone) + zone = e_util_zone_current_get(c->man); + + E_CHECK_RETURN(zone, NULL); + + /* look for visible normal window except for given window */ + EINA_INLIST_REVERSE_FOREACH(c->wins, cw2) + { + if (TYPE_HOME_CHECK(cw2)) + return cw2; + } + return NULL; +} +EAPI E_Comp_Win * +e_mod_comp_util_win_below_get(E_Comp_Win *cw, + Eina_Bool normal_check, + Eina_Bool visible_check) +{ + Eina_Inlist *l; + E_Comp_Win *_cw = cw; + E_CHECK_RETURN(_cw, NULL); + + while ((l = EINA_INLIST_GET(_cw)->prev)) + { + _cw = _EINA_INLIST_CONTAINER(_cw, l); + if ((_cw) && + (!_cw->invalid) && + (!_cw->input_only) && + (!TYPE_APPTRAY_CHECK(_cw)) && + (!TYPE_MINI_APPTRAY_CHECK(_cw)) && + REGION_EQUAL_TO_ROOT(_cw)) + { + if (visible_check && !_cw->visible) + continue; + if (normal_check) + { + if (TYPE_NORMAL_CHECK(_cw)) + return _cw; + else + return NULL; + } + else + return _cw; + } + } + return NULL; +} + +EAPI Eina_Bool +e_mod_comp_util_win_below_check(E_Comp_Win *cw, + E_Comp_Win *cw2) +{ + Eina_Inlist *wins_list; + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw2, 0); + + while ((wins_list = EINA_INLIST_GET(cw)->prev) != NULL) + { + cw = _EINA_INLIST_CONTAINER(cw, wins_list); + if (cw == cw2) + { + return EINA_TRUE; + } + } + return EINA_FALSE; +} + +EAPI Eina_Bool +e_mod_comp_util_win_visible_get(E_Comp_Win *cw, + Eina_Bool alpha_check) +{ + E_Comp_Win *cw2 = NULL, *nocomp_cw = NULL; + E_Zone *zone = NULL; + int count = 0; + + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->visible, 0); + E_CHECK_RETURN(!(cw->invalid), 0); + E_CHECK_RETURN(!(cw->input_only), 0); + E_CHECK_RETURN(cw->bd, 0); + E_CHECK_RETURN(cw->bd->zone, 0); + + zone = cw->bd->zone; + E_CHECK_RETURN(zone, 0); + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:UTIL WIN VISIBLE GET"); + + /* find nocomp window first because nocomp window doesn't have pixmap */ + nocomp_cw = e_mod_comp_util_win_nocomp_get(cw->c, zone); + + if (!E_INTERSECTS + (zone->x, zone->y, zone->w, zone->h, + cw->x, cw->y, cw->w, cw->h)) + { + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return EINA_FALSE; + } + + EINA_INLIST_REVERSE_FOREACH(cw->c->wins, cw2) + { + if (cw2->invalid) continue; + if (cw2->input_only) continue; + if (!cw2->bd) continue; + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| CHECK | %02d| %p %p 0x%08x pixmap:0x%x %dx%d %d", "EFFECT", + count++, + cw, cw2, + e_mod_comp_util_client_xid_get(cw2), + cw2->pixmap, cw2->pw, cw2->ph, + cw2->dmg_updates); + + if (!cw2->bd->zone) continue; + if (!cw2->visible) continue; + if (cw2->bd->zone != zone) continue; + if (!E_INTERSECTS(zone->x, zone->y, zone->w, zone->h, + cw2->x, cw2->y, cw2->w, cw2->h)) + continue; + + if (!((cw2->pixmap) && + (cw2->pw > 0) && (cw2->ph > 0) && + (cw2->dmg_updates >= 1))) + { + if ((nocomp_cw) && (nocomp_cw == cw2)) + { + if (cw2 == cw) + return EINA_TRUE; + else + return EINA_FALSE; + } + else + continue; + } + + if (cw2 == cw) + { + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return EINA_TRUE; + } + + if (REGION_EQUAL_TO_ZONE(cw2, zone) && + ((!alpha_check) || (!cw2->argb))) + { + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return EINA_FALSE; + } + } + + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return EINA_FALSE; +} + +/* check visibility of cw before changing c->wins. + * this utility function assumes that cw is positioned behind cw2. + */ +EAPI Eina_Bool +e_mod_comp_util_win_visible_below_get(E_Comp_Win *cw, + E_Comp_Win *cw2) +{ + /* TODO: */ + return EINA_TRUE; +} + +EAPI Ecore_X_Window +e_mod_comp_util_client_xid_get(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + if (cw->bd) return cw->bd->client.win; + else return cw->win; +} + +EAPI void +e_mod_comp_util_fb_visible_set(Eina_Bool set) +{ + Ecore_X_Display *d = ecore_x_display_get(); + E_CHECK(d); + + utilx_set_fb_visible(d, UTILX_FB_TYPE_OVERLAY, + set ? True : False); +} + +EAPI void +e_mod_comp_util_rr_prop_set(Ecore_X_Atom atom, + const char *state) +{ + E_Comp *c = e_mod_comp_util_get(); + Ecore_X_Display *dpy; + Ecore_X_Window root; + static RROutput output = 0; + int i; + + root = c->man->root; + dpy = ecore_x_display_get(); + if (!output) + { + XRRScreenResources *res = XRRGetScreenResources(dpy, root); + XRROutputInfo *output_info = NULL; + + if (res) + { + if (res->noutput != 0) + { + for (i = 0; i < res->noutput; i++) + { + output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]); + + if ((output_info) && + (output_info->name) && + (!strncmp(output_info->name, "LVDS1", 5))) + { + output = res->outputs[i]; + XRRFreeOutputInfo(output_info); + break; + } + + if (output_info) XRRFreeOutputInfo(output_info); + } + } + XRRFreeScreenResources(res); + } + } + + if (output) + XRRChangeOutputProperty(dpy, output, atom, XA_STRING, 8, PropModeReplace, (unsigned char*)state, strlen(state)); +} + +EAPI Ecore_X_Pixmap +e_mod_comp_util_copied_pixmap_get(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->win, 0); + E_CHECK_RETURN(cw->pixmap, 0); + + Ecore_X_Pixmap pixmap = 0; + int depth = ecore_x_pixmap_depth_get(cw->pixmap); + Ecore_X_GC gc = ecore_x_gc_new(cw->win, 0, NULL); + E_CHECK_RETURN(gc, 0); + + pixmap = ecore_x_pixmap_new(cw->win, cw->pw, cw->ph, depth); + E_CHECK_GOTO(pixmap, error); + + ecore_x_pixmap_paste(cw->pixmap, pixmap, gc, 0, 0, cw->pw, cw->ph, 0, 0); + ecore_x_gc_free(gc); + + return pixmap; +error: + if (gc) ecore_x_gc_free(gc); + return 0; +} + diff --git a/src/e_mod_comp_util.h b/src/e_mod_comp_util.h new file mode 100644 index 0000000..b90c2fd --- /dev/null +++ b/src/e_mod_comp_util.h @@ -0,0 +1,154 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_UTIL_H +#define E_MOD_COMP_UTIL_H + +/* check whether region of given window is equal to root */ +#ifdef _F_USE_BORDER_TRANSFORM_ + +#define TRANSFORM_EQUAL(bd, x_, y_, w_, h_) \ + (((bd) && ((bd)->transform.enable)) && \ + (((bd)->transform.border_geometry.x == (x_)) && \ + ((bd)->transform.border_geometry.y == (y_)) && \ + ((bd)->transform.border_geometry.w == (w_)) && \ + ((bd)->transform.border_geometry.h == (h_)))) + +#define CW_EQUAL(cw_, x_, y_, w_, h_) \ + ((!((cw_)->bd) || (((cw_)->bd) && (!(((cw_)->bd)->transform.enable)))) && \ + (((cw_)->x == (x_)) && \ + ((cw_)->y == (y_)) && \ + ((cw_)->w == (w_)) && \ + ((cw_)->h == (h_)))) + +#define TRANSFORM_EQUAL_SIZE(bd, w_, h_) \ + (((bd) && ((bd)->transform.enable)) && \ + (((bd)->transform.border_geometry.w == (w_)) && \ + ((bd)->transform.border_geometry.h == (h_)))) + +#define CW_EQUAL_SIZE(cw_, w_, h_) \ + (((!((cw_)->bd) || (((cw_)->bd) && (!(((cw_)->bd)->transform.enable))))) && \ + (((cw_)->w == (w_)) && \ + ((cw_)->h == (h_)))) + +#define TRANSFORM_BIGGER(bd, x_, y_, w_, h_) \ + (((bd) && ((bd)->transform.enable)) && \ + (((bd)->transform.border_geometry.x <= (x_)) && \ + ((bd)->transform.border_geometry.y <= (y_)) && \ + ((bd)->transform.border_geometry.x + (bd)->transform.border_geometry.w >= (x_) + (w_)) && \ + ((bd)->transform.border_geometry.y + (bd)->transform.border_geometry.h >= (y_) + (h_)))) + +#define CW_BIGGER(cw_, x_, y_, w_, h_) \ + (((!((cw_)->bd) || (((cw_)->bd) && (!(((cw_)->bd)->transform.enable))))) && \ + (((cw_)->x <= (x_)) && \ + ((cw_)->y <= (y_)) && \ + ((cw_)->x + (cw_)->w >= (x_) + (w_)) && \ + ((cw_)->y + (cw_)->h >= (y_) + (h_)))) + +#define TRANSFORM_INTERSECTS(bd, x_, y_, w_, h_) \ + (((bd) && ((bd)->transform.enable)) && \ + ((((bd)->transform.border_geometry.x) < ((x_) + (w_))) && \ + ((bd)->transform.border_geometry.y) < ((y_) + (h_)) && \ + (((bd)->transform.border_geometry.x + (bd)->transform.border_geometry.w) > (x_)) && \ + (((bd)->transform.border_geometry.y + (bd)->transform.border_geometry.h) > (y_)))) + +#define CW_INTERSECTS(cw_, x_, y_, w_, h_) \ + (((!((cw_)->bd) || (((cw_)->bd) && (!(((cw_)->bd)->transform.enable))))) && \ + (((cw_->x) < ((x_) + (w_))) && \ + ((cw_->y) < ((y_) + (h_))) && \ + (((cw_->x) + (cw_->w)) > (x_)) && \ + (((cw_->y) + (cw_->h)) > (y_)))) +#else + +#define TRANSFORM_EQUAL(bd, x_, y_, w_, h_) (0) +#define TRANSFORM_EQUAL_SIZE(bd, w_, h_) (0) +#define TRANSFORM_BIGGER(bd, x_, y_, w_, h_) (0) +#define TRANSFORM_INTERSECTS(bd, x_, y_, w_, h_) (0) + +#define CW_EQUAL(cw_, x_, y_, w_, h_) \ + (((cw_)->x == (x_)) && \ + ((cw_)->y == (y_)) && \ + ((cw_)->w == (w_)) && \ + ((cw_)->h == (h_))) + +#define CW_EQUAL_SIZE(cw_, w_, h_) \ + (((cw_)->w == (w_)) && \ + ((cw_)->h == (h_))) + +#define CW_BIGGER(cw_, x_, y_, w_, h_) \ + (((cw_)->x <= (x_)) && \ + ((cw_)->y <= (y_)) && \ + ((cw_)->x + (cw_)->w >= (x_) + (w_)) && \ + ((cw_)->y + (cw_)->h >= (y_) + (h_))) + +#define CW_INTERSECTS(cw, x_, y_, w_, h_) \ + (((cw->x) < ((x_) + (w_))) && \ + ((cw->y) < ((y_) + (h_))) && \ + (((cw->x) + (cw->w)) > (x_)) && \ + (((cw->y) + (cw->h)) > (y_))) + +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ + +#define REGION_EQUAL_TO_ROOT(a) \ + (CW_EQUAL((a), 0, 0, ((a)->c->man->w), ((a)->c->man->h)) || \ + TRANSFORM_EQUAL(((a)->bd), 0, 0, ((a)->c->man->w), ((a)->c->man->h))) + +#define SIZE_EQUAL_TO_ROOT(a) \ + (CW_EQUAL_SIZE((a), ((a)->c->man->w), ((a)->c->man->h)) || \ + TRANSFORM_EQUAL_SIZE(((a)->bd), ((a)->c->man->w), ((a)->c->man->h))) + +#define REGION_EQUAL_TO_ZONE(a, z) \ + (CW_EQUAL((a), ((z)->x), ((z)->y), ((z)->w), ((z)->h)) || \ + TRANSFORM_EQUAL(((a)->bd), ((z)->x), ((z)->y), ((z)->w), ((z)->h))) + +#define REGION_BIGGER_THAN_ZONE(a, z) \ + (CW_BIGGER((a), ((z)->x), ((z)->y), ((z)->w), ((z)->h)) || \ + TRANSFORM_BIGGER(((a)->bd), ((z)->x), ((z)->y), ((z)->w), ((z)->h))) + +# define E_INTERSECTS_EFFECT(cw, xx, yy, ww, hh) \ + (CW_INTERSECTS((cw), (xx), (yy), (ww), (hh)) || \ + TRANSFORM_INTERSECTS(((cw)->bd), (xx), (yy), (ww), (hh))) + +#define REGION_EQUAL_TO_CANVAS(a, c) \ + ((((a)->x) == ((c)->x)) && \ + (((a)->y) == ((c)->y)) && \ + (((a)->w) == ((c)->w)) && \ + (((a)->h) == ((c)->h))) + +#define STATE_INSET_CHECK(a) \ + ((a->bd) && \ + ((a->bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) || \ + (a->bd->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_ASSISTANT_MENU))) + +#define CLASS_ICONIC_CHECK(a) \ + ((a->bd) && \ + (a->bd->client.icccm.class) && \ + (!strcmp(a->bd->client.icccm.class, "ICON_WIN"))) + +#define PARENT_FLOAT_CHECK(a) \ + ((a->bd) && \ + (a->bd->parent) && \ + ((a->bd->parent->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_FLOATING) ||\ + (a->bd->parent->client.illume.win_state.state == ECORE_X_ILLUME_WINDOW_STATE_ASSISTANT_MENU))) + +EAPI void e_mod_comp_util_set(E_Comp *c, E_Manager *man); +EAPI E_Comp *e_mod_comp_util_get(void); +EAPI Eina_Bool e_mod_comp_util_grab_key_set(Eina_Bool grab); +EAPI Eina_Bool e_mod_comp_util_grab_home_key_set(Eina_Bool grab); +EAPI Eina_Bool e_mod_comp_util_screen_input_region_set(Eina_Bool set); +EAPI E_Comp_Win *e_mod_comp_util_win_nocomp_get(E_Comp *c, E_Zone *zone); +#if USE_NOCOMP_DISPOSE +EAPI E_Comp_Win *e_mod_comp_util_win_nocomp_end_get(E_Comp *c, E_Zone *zone); +#endif +EAPI E_Comp_Win *e_mod_comp_util_win_normal_get(E_Comp_Win *cw, Eina_Bool opaque); +EAPI E_Comp_Win *e_mod_comp_util_win_home_get(E_Comp_Win *cw); +EAPI E_Comp_Win *e_mod_comp_util_win_below_get(E_Comp_Win *cw, Eina_Bool normal_check, Eina_Bool visible_check); +EAPI Eina_Bool e_mod_comp_util_win_below_check(E_Comp_Win *cw, E_Comp_Win *cw2); +EAPI Eina_Bool e_mod_comp_util_win_visible_get(E_Comp_Win *cw, Eina_Bool alpha_check); +EAPI Eina_Bool e_mod_comp_util_win_visible_below_get(E_Comp_Win *cw, E_Comp_Win *cw2); +EAPI Ecore_X_Window e_mod_comp_util_client_xid_get(E_Comp_Win *cw); +EAPI void e_mod_comp_util_fb_visible_set(Eina_Bool set); +EAPI void e_mod_comp_util_rr_prop_set(Ecore_X_Atom atom, const char* state); +EAPI Ecore_X_Pixmap e_mod_comp_util_copied_pixmap_get(E_Comp_Win *cw); + +#endif +#endif diff --git a/src/e_mod_comp_win_shape_input.c b/src/e_mod_comp_win_shape_input.c new file mode 100644 index 0000000..ffc403f --- /dev/null +++ b/src/e_mod_comp_win_shape_input.c @@ -0,0 +1,576 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp_debug.h" +#include + +// input shape geometry (used on Move Module, +// Compositor receives input evevnt from this region.) +struct _E_Comp_Win_Shape_Input +{ + int x, y, w, h; +}; + +struct _E_Comp_Shape_Input +{ + int id; + int x, y, w, h; + Eina_Bool managed; + Eina_Bool skip; +}; + +/* local subsystem functions */ +static int +_e_mod_comp_shape_input_new_id_get(E_Comp *c) +{ + int new_id = 1; + E_Comp_Shape_Input *shape_input = NULL; + Eina_List *l = NULL; + Eina_Bool create_id = EINA_FALSE; + + E_CHECK_RETURN(c, 0); + + while (new_id < INT_MAX) + { + create_id = EINA_TRUE; + + EINA_LIST_FOREACH(c->shape_inputs, l, shape_input) + { + if (shape_input->id == new_id) + { + new_id++; + create_id = EINA_FALSE; + break; + } + } + + if (create_id) break; + } + + if (create_id) return new_id; + else return 0; +} + +/* externally accessible functions */ +EAPI int +e_mod_comp_shape_input_new(E_Comp *c) +{ + int id = 0; + E_Comp_Shape_Input *shape_input; + E_CHECK_RETURN(c, 0); + + id = _e_mod_comp_shape_input_new_id_get(c); + if (id) + { + shape_input = E_NEW(E_Comp_Shape_Input, 1); + E_CHECK_RETURN(shape_input, 0); + + shape_input->id = id; + c->shape_inputs = eina_list_append(c->shape_inputs, shape_input); + } + return id; +} + +EAPI Eina_Bool +e_mod_comp_shape_input_set(E_Comp *c, + int id, + int x, + int y, + int w, + int h) +{ + Eina_Bool found = EINA_FALSE; + E_Comp_Shape_Input *shape_input = NULL; + Eina_List *l = NULL; + + E_CHECK_RETURN(c, EINA_FALSE); + if ( id <= 0 ) return EINA_FALSE; + + EINA_LIST_FOREACH(c->shape_inputs, l, shape_input) + { + if (shape_input->id == id) + { + shape_input->x = x; + shape_input->y = y; + shape_input->w = w; + shape_input->h = h; + found = EINA_TRUE; + break; + } + } + + return found; +} + +EAPI Eina_Bool +e_mod_comp_shape_input_del(E_Comp *c, + int id) +{ + E_Comp_Shape_Input *shape_input = NULL; + E_Comp_Shape_Input *find_shape_input = NULL; + Eina_List *l = NULL; + Eina_Bool found = EINA_FALSE; + + E_CHECK_RETURN(c, EINA_FALSE); + if ( id <= 0 ) return EINA_FALSE; + + EINA_LIST_FOREACH(c->shape_inputs, l, shape_input) + { + if (shape_input->id == id) + { + find_shape_input = shape_input; + found = EINA_TRUE; + break; + } + } + + if (find_shape_input) + { + c->shape_inputs = eina_list_remove(c->shape_inputs, find_shape_input); + memset(find_shape_input, 0, sizeof(E_Comp_Shape_Input)); + E_FREE(find_shape_input); + } + + return found; +} + +EAPI Eina_Bool +e_mod_comp_win_shape_input_update(E_Comp *c) +{ + E_Comp_Win *_cw = NULL; + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_Shape_Input *shape_input = NULL; + + pixman_region32_t vis_part; + pixman_region32_t win_part; + pixman_region32_t cur_part; + pixman_region32_t res_part; + + pixman_region32_t input_part; + pixman_region32_t cur_input_part; + pixman_region32_t res_input_part; + pixman_region32_t sum_input_part; + pixman_region32_t comp_input_part; + + pixman_box32_t *input_rects; + + Ecore_X_Rectangle *input_shape_rects = NULL; + + int num_rects = 0; + int num_input_rects = 0; + int i = 0; + + pixman_box32_t screen_rect; + pixman_box32_t window_rect; + pixman_box32_t input_rect; + + E_CHECK_RETURN(c, EINA_FALSE); + if (c->eff_img) + { + Eina_Bool res = c->effect_funcs.image_launch_running_check(c->eff_img); + E_CHECK_RETURN(!res, EINA_FALSE); + } + +#if 0 + E_CHECK_RETURN(c->need_shape_merge, EINA_FALSE); +#endif + + screen_rect.x1 = 0; + screen_rect.y1 = 0; + screen_rect.x2 = c->man->w; + screen_rect.y2 = c->man->h; + + pixman_region32_init_rects(&vis_part, &screen_rect, 1); + pixman_region32_init_rect(&sum_input_part, 0, 0, 0, 0); + + EINA_INLIST_REVERSE_FOREACH(c->wins, _cw) + { + if ((!_cw->visible) || (_cw->defer_hide) || + (_cw->invalid) || + (!E_INTERSECTS(0, 0, c->man->w, c->man->h, + _cw->x, _cw->y, _cw->w, _cw->h))) + { + continue; + } + if (TYPE_DEBUGGING_INFO_CHECK(_cw)) continue; + + num_rects = 0; + + window_rect.x1 = _cw->x; + window_rect.y1 = _cw->y; + window_rect.x2 = window_rect.x1 + _cw->w; + window_rect.y2 = window_rect.y1 + _cw->h; + + if (_cw->shape_input) + { + input_rect.x1 = window_rect.x1 + _cw->shape_input->x; + input_rect.y1 = window_rect.y1 + _cw->shape_input->y; + input_rect.x2 = input_rect.x1 + _cw->shape_input->w; + input_rect.y2 = input_rect.y1 + _cw->shape_input->h; + } + else + { + input_rect.x1 = window_rect.x1; + input_rect.y1 = window_rect.y1; + input_rect.x2 = input_rect.x1; + input_rect.y2 = input_rect.y1; + } + + pixman_region32_init_rects(&input_part, &input_rect, 1); + pixman_region32_init_rect(&cur_input_part, 0, 0, 0, 0); + pixman_region32_init_rect(&res_input_part, 0, 0, 0, 0); + pixman_region32_init_rect(&cur_part, 0, 0, 0, 0); + pixman_region32_init_rects(&win_part, &window_rect, 1); + pixman_region32_init_rects(&res_part, &screen_rect, 1); + + // current_visible_window = window (intersect) screen visible part + pixman_region32_intersect(&cur_part, &win_part, &vis_part); + + // current_input = current_visible_window (intersect) input + pixman_region32_intersect(&cur_input_part, &cur_part, &input_part); + + // result_input = sum_input + // sum_input = result_input + current_input + pixman_region32_copy(&res_input_part, &sum_input_part); + pixman_region32_union(&sum_input_part, &res_input_part, &cur_input_part); + + // result = visible - window + pixman_region32_subtract(&res_part, &vis_part, &win_part); + pixman_region32_rectangles(&res_part, &num_rects); + + pixman_region32_fini(&input_part); + pixman_region32_fini(&cur_input_part); + pixman_region32_fini(&res_input_part); + pixman_region32_fini(&cur_part); + pixman_region32_fini(&win_part); + + if (num_rects == 0) + { + pixman_region32_fini(&res_part); + break; + } + + pixman_region32_copy(&vis_part, &res_part); + pixman_region32_fini(&res_part); + } + + e_mod_comp_shape_input_manage(c); + + EINA_LIST_FOREACH(c->shape_inputs, l, shape_input) + { + if ((shape_input->managed) && (shape_input->skip)) + continue; + if (E_INTERSECTS(0, 0, c->man->w, c->man->h, + shape_input->x, shape_input->y, + shape_input->w, shape_input->h)) + { + pixman_region32_init_rect(&comp_input_part, + shape_input->x, + shape_input->y, + shape_input->w, + shape_input->h); + pixman_region32_init_rect(&res_input_part, 0, 0, 0, 0); + + pixman_region32_copy(&res_input_part, &sum_input_part); + pixman_region32_union(&sum_input_part, &res_input_part, &comp_input_part); + + pixman_region32_fini(&res_input_part); + pixman_region32_fini(&comp_input_part); + } + } + + input_rects = pixman_region32_rectangles(&sum_input_part, &num_input_rects); + + if (num_input_rects) + { + input_shape_rects = E_NEW(Ecore_X_Rectangle, num_input_rects); + if (input_shape_rects) + { + for (i = 0; i < num_input_rects; i++) + { + input_shape_rects[i].x = input_rects[i].x1; + input_shape_rects[i].y = input_rects[i].y1; + input_shape_rects[i].width = input_rects[i].x2 - input_rects[i].x1; + input_shape_rects[i].height = input_rects[i].y2 - input_rects[i].y1; + } + } + + if (_comp_mod->conf->nocomp_fs) + { + /* set shape before setting shape input */ + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if ((canvas) && + (canvas->nocomp.mode == E_NOCOMP_MODE_RUN)) + { + ecore_x_window_shape_rectangles_set + (c->win, input_shape_rects, num_input_rects); + break; + } + } + + /* FIXME: this code causes compositor couldn't update center region during composite state and software backend. + so, disable for now. + we have to ask someone who wrote this code what purpose of this code, + so that we can fix it appropriately. */ +#if 0 + /* for the xv */ + if ((input_shape_rects) && (num_input_rects == 1)) + { + canvas = (E_Comp_Canvas *)eina_list_nth(c->canvases, 0); + if ((canvas) && + (input_shape_rects[0].x == canvas->x) && + (input_shape_rects[0].y == canvas->y) && + (input_shape_rects[0].width == canvas->w) && + (input_shape_rects[0].height == canvas->h)) + { + ecore_x_window_shape_rectangle_subtract(c->win, + (canvas->w / 2) - 16, + (canvas->h / 2) - 16, + 16, 16); + } + } +#endif + } + + ecore_x_window_shape_input_rectangles_set(c->win, + input_shape_rects, + num_input_rects); + if (input_shape_rects) E_FREE(input_shape_rects); + } + else + { + ecore_x_window_shape_input_rectangle_set(c->win, -1, -1, 1, 1); + } + + pixman_region32_fini(&vis_part); + pixman_region32_fini(&sum_input_part); + + c->need_shape_merge = EINA_FALSE; + return EINA_TRUE; +} + +EAPI E_Comp_Win_Shape_Input * +e_mod_comp_win_shape_input_new(E_Comp_Win *cw) +{ + Eina_List *l; + E_Comp_Object *co; + + E_CHECK_RETURN(cw, 0); + + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co->img) return NULL; + if (!co->shadow) return NULL; + } + + EINA_LIST_FOREACH(cw->objs, l, co) + { + evas_object_pass_events_set(co->img, EINA_FALSE); + evas_object_pass_events_set(co->shadow, EINA_FALSE); + } + + return E_NEW(E_Comp_Win_Shape_Input, 1); +} + +EAPI void +e_mod_comp_win_shape_input_free(E_Comp_Win_Shape_Input *input) +{ + E_CHECK(input); + E_FREE(input); +} + +EAPI Eina_Bool +e_mod_comp_win_shape_input_rect_set(E_Comp_Win_Shape_Input *input, + int x, + int y, + int w, + int h) +{ + E_CHECK_RETURN(input, EINA_FALSE); + + if (((input->x == x) && (input->y == y) && + (input->w == w) && (input->h == h))) + { + return EINA_FALSE; + } + + input->x = x; + input->y = y; + input->w = w; + input->h = h; + + return EINA_TRUE; +} + +EAPI Eina_Bool +e_mod_comp_win_shape_input_invalid_set(E_Comp *c, + Eina_Bool set) +{ + E_CHECK_RETURN(c, EINA_FALSE); + c->need_shape_merge = set; + return EINA_TRUE; +} + +EAPI void +e_mod_comp_shape_input_manage(E_Comp *c) +{ + E_Comp_Shape_Input *shape_input; + Eina_List *l, *ll, *lm; + Evas_Object *o, *oo, *layout; + E_Comp_Layer *comp_ly, *ctrl_ly; + E_Comp_Canvas *canvas; + Eina_Bool hidden = EINA_FALSE; + int x = 0, y = 0, w = 0, h = 0; + int _x = 0, _y = 0, _w = 0, _h = 0; + int num_rects = 0; + + pixman_region32_t target_part; + pixman_region32_t cur_part; + pixman_region32_t res_part; + pixman_box32_t *rects = NULL; + + canvas = eina_list_nth(c->canvases, 0); + comp_ly = e_mod_comp_canvas_layer_get(canvas, "comp"); + E_CHECK(comp_ly); + + ctrl_ly = e_mod_comp_canvas_layer_get(canvas, "ly-ctrl"); + E_CHECK(ctrl_ly); + + EINA_LIST_FOREACH(c->shape_inputs_mo, l, o) + { + if (!evas_object_visible_get(o)) continue; + + hidden = EINA_FALSE; + + /*TODO: find layout of objects */ + layout = ctrl_ly->layout; + + evas_object_geometry_get(o, &x, &y, &w, &h); + + pixman_region32_init_rect(&target_part, x, y, w, h); + pixman_region32_init_rect(&res_part, x, y, w, h); + + num_rects = 0; + rects = NULL; + + lm = evas_object_smart_members_get(comp_ly->layout); + EINA_LIST_REVERSE_FOREACH(lm, ll, oo) + { + if (!evas_object_visible_get(oo)) continue; + if ((oo == o) || ((oo == layout))) + break; + + evas_object_geometry_get(oo, &_x, &_y, &_w, &_h); + + //clipper + if (_x == -100001) continue; + if (!E_INTERSECTS(x, y, w, h, _x, _y, _w, _h)) continue; + + pixman_region32_copy(&target_part, &res_part); + pixman_region32_init_rect(&cur_part, _x, _y, _w, _h); + pixman_region32_subtract(&res_part, &target_part, &cur_part); + pixman_region32_fini(&cur_part); + + rects = pixman_region32_rectangles(&res_part, &num_rects); + + if (num_rects == 0) + { + hidden = EINA_TRUE; + break; + } + } + if (lm) eina_list_free(lm); + + if ((rects) && (num_rects == 1)) + { + if (((rects[0].x2 - rects[0].x1) >= w/2) && + ((rects[0].y2 - rects[0].y1) >= h/2)) + { + x = rects[0].x1; + y = rects[0].y1; + w = rects[0].x2 - rects[0].x1; + h = rects[0].y2 - rects[0].y1; + + hidden = EINA_FALSE; + } + else + hidden = EINA_TRUE; + } + else if ((rects) && (num_rects >=2)) + { + if ((((rects[0].x2 - rects[0].x1) >= w/2) && + ((rects[0].y2 - rects[0].y1) >= h/2)) || + (((rects[1].x2 - rects[1].x1) >= w/2) && + ((rects[1].y2 - rects[1].y1) >= h/2))) + hidden = EINA_FALSE; + else + hidden = EINA_TRUE; + } + + shape_input = evas_object_data_get(o, "e_shape_input_managed_data"); + if (shape_input) + { + if (hidden) + { + shape_input->skip = EINA_TRUE; + shape_input->x = -1; + shape_input->y = -1; + shape_input->w = 1; + shape_input->h = 1; + } + else + { + shape_input->skip = EINA_FALSE; + shape_input->x = x; + shape_input->y = y; + shape_input->w = w; + shape_input->h = h; + } + } + pixman_region32_fini(&target_part); + pixman_region32_fini(&res_part); + } +} + +EAPI Eina_Bool +e_mod_comp_shape_input_managed_set(E_Comp *c, + int id, + Evas_Object *obj, + Eina_Bool set) +{ + Eina_Bool found = EINA_FALSE; + E_Comp_Shape_Input *shape_input = NULL; + E_Comp_Shape_Input *find_shape_input = NULL; + Eina_List *l = NULL; + + E_CHECK_RETURN(c, EINA_FALSE); + if (id <= 0) return EINA_FALSE; + + EINA_LIST_FOREACH(c->shape_inputs, l, shape_input) + { + if (shape_input->id == id) + { + found = EINA_TRUE; + find_shape_input = shape_input; + break; + } + } + + if (find_shape_input) + { + find_shape_input->managed = set; + if (set) + { + evas_object_data_set(obj, "e_shape_input_managed_data", find_shape_input); + c->shape_inputs_mo = eina_list_append(c->shape_inputs_mo, obj); + } + else + { + evas_object_data_del(obj, "e_shape_input_managed_data"); + c->shape_inputs_mo = eina_list_remove(c->shape_inputs_mo, obj); + } + } + + return found; +} + diff --git a/src/e_mod_comp_win_shape_input.h b/src/e_mod_comp_win_shape_input.h new file mode 100644 index 0000000..6d3dbeb --- /dev/null +++ b/src/e_mod_comp_win_shape_input.h @@ -0,0 +1,21 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_WIN_SHAPE_INPUT_H +#define E_MOD_COMP_WIN_SHAPE_INPUT_H + +typedef struct _E_Comp_Win_Shape_Input E_Comp_Win_Shape_Input; +typedef struct _E_Comp_Shape_Input E_Comp_Shape_Input; + +/* shape input region functions */ +EAPI E_Comp_Win_Shape_Input *e_mod_comp_win_shape_input_new(E_Comp_Win *cw); +EAPI void e_mod_comp_win_shape_input_free(E_Comp_Win_Shape_Input *input); +EAPI Eina_Bool e_mod_comp_win_shape_input_rect_set(E_Comp_Win_Shape_Input *input, int x, int y, int w, int h); +EAPI Eina_Bool e_mod_comp_win_shape_input_invalid_set(E_Comp *c, Eina_Bool set); +EAPI Eina_Bool e_mod_comp_win_shape_input_update(E_Comp *c); +EAPI int e_mod_comp_shape_input_new(E_Comp *c); +EAPI Eina_Bool e_mod_comp_shape_input_set(E_Comp *c, int id, int x, int y, int w, int h); +EAPI Eina_Bool e_mod_comp_shape_input_del(E_Comp *c, int id); +EAPI void e_mod_comp_shape_input_manage(E_Comp *c); +EAPI Eina_Bool e_mod_comp_shape_input_managed_set(E_Comp *c, int id, Evas_Object *obj, Eina_Bool set); +#endif +#endif diff --git a/src/e_mod_comp_win_type.c b/src/e_mod_comp_win_type.c new file mode 100644 index 0000000..4619068 --- /dev/null +++ b/src/e_mod_comp_win_type.c @@ -0,0 +1,390 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_debug.h" + +typedef enum _E_Comp_Win_Class_Type +{ + E_COMP_WIN_CLASS_TYPE_UNKNOWN = 0, + E_COMP_WIN_CLASS_TYPE_NORMAL, + E_COMP_WIN_CLASS_TYPE_MENUSCREEN, + E_COMP_WIN_CLASS_TYPE_QUICKPANEL_BASE, + E_COMP_WIN_CLASS_TYPE_QUICKPANEL, + E_COMP_WIN_CLASS_TYPE_VIDEOCALL, + E_COMP_WIN_CLASS_TYPE_TASKMANAGER, + E_COMP_WIN_CLASS_TYPE_LIVEMAGAZINE, + E_COMP_WIN_CLASS_TYPE_LOCKSCREEN, + E_COMP_WIN_CLASS_TYPE_INDICATOR, + E_COMP_WIN_CLASS_TYPE_TICKERNOTI, + E_COMP_WIN_CLASS_TYPE_DEBUGGING_INFO, + E_COMP_WIN_CLASS_TYPE_APPTRAY, + E_COMP_WIN_CLASS_TYPE_MINI_APPTRAY, + E_COMP_WIN_CLASS_TYPE_VOLUME, + E_COMP_WIN_CLASS_TYPE_BACKGROUND, + E_COMP_WIN_CLASS_TYPE_SETUP_WIZARD, + E_COMP_WIN_CLASS_TYPE_TOAST, + E_COMP_WIN_CLASS_TYPE_ISF, +} E_Comp_Win_Class_Type; + +typedef enum _E_Comp_Win_Name_Type +{ + E_COMP_WIN_NAME_TYPE_UNKNOWN = 0, + E_COMP_WIN_NAME_TYPE_NORMAL, + E_COMP_WIN_NAME_TYPE_MENUSCREEN, + E_COMP_WIN_NAME_TYPE_QUICKPANEL_BASE, + E_COMP_WIN_NAME_TYPE_QUICKPANEL, + E_COMP_WIN_NAME_TYPE_TASKMANAGER, + E_COMP_WIN_NAME_TYPE_LIVEMAGAZINE, + E_COMP_WIN_NAME_TYPE_LOCKSCREEN, + E_COMP_WIN_NAME_TYPE_INDICATOR, + E_COMP_WIN_NAME_TYPE_TICKERNOTI, + E_COMP_WIN_NAME_TYPE_APPTRAY, + E_COMP_WIN_NAME_TYPE_MINI_APPTRAY, + E_COMP_WIN_NAME_TYPE_VOLUME, + E_COMP_WIN_NAME_TYPE_BACKGROUND, + E_COMP_WIN_NAME_TYPE_SETUP_WIZARD, + E_COMP_WIN_NAME_TYPE_TOAST, + E_COMP_WIN_NAME_TYPE_ISF_KEYBOARD, + E_COMP_WIN_NAME_TYPE_ISF_SUB, +} E_Comp_Win_Name_Type; + +/* local subsystem functions */ +static E_Comp_Win_Type _ecore_type_to_e_comp_type(Ecore_X_Window_Type t); + +/* local subsystem globals */ +static const char *win_class[] = +{ + "NORMAL_WINDOW", + "MENU_SCREEN", + "QUICKPANEL_BASE", + "QUICKPANEL", + "vtmain", + "TASK_MANAGER", + "LIVE_MAGAZINE", + "LOCK_SCREEN", + "lockscreen", + "INDICATOR", + "quickpanel", + "DEBUGGING_INFO", + "APP_TRAY", + "MINIAPP_TRAY", + "volume", + "BACKGROUND", + "SETUP_WIZARD", + "SYSTEM_POPUP", + "ISF", +}; + +static const char *win_name[] = +{ + "NORMAL_WINDOW", + "com.samsung.menu-screen", + "QUICKPANEL_BASE", + "QUICKPANEL", + "TASK_MANAGER", + "Live Magazine", + "LOCK_SCREEN", + "lockscreen", + "INDICATOR", + "noti_win", + "APP_TRAY", + "MINIAPP_TRAY", + "volume", + "BACKGROUND", + "SETUP_WIZARD", + "TOAST_POPUP", + // E_COMP_WIN_NAME_TYPE_ISF_KEYBOARD + "Virtual Keyboard", + // E_COMP_WIN_NAME_TYPE_ISF_SUB + "Key Magnifier", + "Prediction Window", + "Setting Window", + "ISF Popup", +}; + +static E_Comp_Win_Class_Type win_class_vals[] = +{ + E_COMP_WIN_CLASS_TYPE_NORMAL, + E_COMP_WIN_CLASS_TYPE_MENUSCREEN, + E_COMP_WIN_CLASS_TYPE_QUICKPANEL_BASE, + E_COMP_WIN_CLASS_TYPE_QUICKPANEL, + E_COMP_WIN_CLASS_TYPE_VIDEOCALL, + E_COMP_WIN_CLASS_TYPE_TASKMANAGER, + E_COMP_WIN_CLASS_TYPE_LIVEMAGAZINE, + E_COMP_WIN_CLASS_TYPE_LOCKSCREEN, + E_COMP_WIN_CLASS_TYPE_LOCKSCREEN, + E_COMP_WIN_CLASS_TYPE_INDICATOR, + E_COMP_WIN_CLASS_TYPE_TICKERNOTI, + E_COMP_WIN_CLASS_TYPE_DEBUGGING_INFO, + E_COMP_WIN_CLASS_TYPE_APPTRAY, + E_COMP_WIN_CLASS_TYPE_MINI_APPTRAY, + E_COMP_WIN_CLASS_TYPE_VOLUME, + E_COMP_WIN_CLASS_TYPE_BACKGROUND, + E_COMP_WIN_CLASS_TYPE_SETUP_WIZARD, + E_COMP_WIN_CLASS_TYPE_TOAST, + E_COMP_WIN_CLASS_TYPE_ISF, +}; + +static E_Comp_Win_Class_Type win_name_vals[] = +{ + E_COMP_WIN_NAME_TYPE_NORMAL, + E_COMP_WIN_NAME_TYPE_MENUSCREEN, + E_COMP_WIN_NAME_TYPE_QUICKPANEL_BASE, + E_COMP_WIN_NAME_TYPE_QUICKPANEL, + E_COMP_WIN_NAME_TYPE_TASKMANAGER, + E_COMP_WIN_NAME_TYPE_LIVEMAGAZINE, + E_COMP_WIN_NAME_TYPE_LOCKSCREEN, + E_COMP_WIN_NAME_TYPE_LOCKSCREEN, + E_COMP_WIN_NAME_TYPE_INDICATOR, + E_COMP_WIN_NAME_TYPE_TICKERNOTI, + E_COMP_WIN_NAME_TYPE_APPTRAY, + E_COMP_WIN_NAME_TYPE_MINI_APPTRAY, + E_COMP_WIN_NAME_TYPE_VOLUME, + E_COMP_WIN_NAME_TYPE_BACKGROUND, + E_COMP_WIN_NAME_TYPE_SETUP_WIZARD, + E_COMP_WIN_NAME_TYPE_TOAST, + E_COMP_WIN_NAME_TYPE_ISF_KEYBOARD, + E_COMP_WIN_NAME_TYPE_ISF_SUB, +}; + +static Eina_Hash *class_hash = NULL; +static Eina_Hash *names_hash = NULL; + +/* externally accessible functions */ +EAPI int +e_mod_comp_win_type_init(void) +{ + int i, n; + if (!class_hash) class_hash = eina_hash_string_superfast_new(NULL); + if (!names_hash) names_hash = eina_hash_string_superfast_new(NULL); + + n = (sizeof(win_class) / sizeof(char *)); + for (i = 0; i < n; i++) + { + eina_hash_add + (class_hash, win_class[i], + &win_class_vals[i]); + } + + n = (sizeof(win_name) / sizeof(char *)); + for (i = 0; i < n; i++) + { + if (i >= E_COMP_WIN_NAME_TYPE_ISF_SUB) + { + eina_hash_add + (names_hash, win_name[i], + &win_name_vals[E_COMP_WIN_NAME_TYPE_ISF_SUB]); + } + else + { + eina_hash_add + (names_hash, + win_name[i], &win_name_vals[i]); + } + } + + return 1; +} + +EAPI int +e_mod_comp_win_type_shutdown(void) +{ + if (class_hash) eina_hash_free(class_hash); + if (names_hash) eina_hash_free(names_hash); + + names_hash = NULL; + class_hash = NULL; + + return 1; +} + +EAPI Eina_Bool +e_mod_comp_win_type_setup(E_Comp_Win *cw) +{ + Ecore_X_Window_Type wtype = ECORE_X_WINDOW_TYPE_UNKNOWN; + E_Comp_Win_Class_Type ctype = E_COMP_WIN_CLASS_TYPE_UNKNOWN; + E_Comp_Win_Name_Type ntype = E_COMP_WIN_NAME_TYPE_UNKNOWN; + E_Comp_Win_Type res = E_COMP_WIN_TYPE_UNKNOWN; + E_Comp_Win_Class_Type *pctype = NULL; + E_Comp_Win_Name_Type *pntype = NULL; + char *clas = NULL, *name = NULL; + + E_CHECK_RETURN(cw, 0); + + if (cw->bd) + { + wtype = cw->bd->client.netwm.type; + if (cw->bd->internal) + ecore_x_icccm_name_class_get(cw->bd->client.win, &name, &clas); + else + { + clas = (char *)cw->bd->client.icccm.class; + name = (char *)cw->bd->client.icccm.name; + } + } + else + ecore_x_icccm_name_class_get(cw->win, &name, &clas); + + if (clas) + { + pctype = eina_hash_find(class_hash, clas); + if (pctype) ctype = *pctype; + } + if (name) + { + pntype = eina_hash_find(names_hash, name); + if (pntype) ntype = *pntype; + } + + switch (ctype) + { + case E_COMP_WIN_CLASS_TYPE_MENUSCREEN: + res = E_COMP_WIN_TYPE_MENUSCREEN; + break; + case E_COMP_WIN_CLASS_TYPE_QUICKPANEL_BASE: + res = E_COMP_WIN_TYPE_QUICKPANEL_BASE; + break; + case E_COMP_WIN_CLASS_TYPE_QUICKPANEL: + res = E_COMP_WIN_TYPE_QUICKPANEL; + break; + case E_COMP_WIN_CLASS_TYPE_VIDEOCALL: + res = E_COMP_WIN_TYPE_VIDEOCALL; + break; + case E_COMP_WIN_CLASS_TYPE_TASKMANAGER: + if (ntype == E_COMP_WIN_NAME_TYPE_TASKMANAGER) + res = E_COMP_WIN_TYPE_TASKMANAGER; + break; + case E_COMP_WIN_CLASS_TYPE_LIVEMAGAZINE: + if ((ntype == E_COMP_WIN_NAME_TYPE_LIVEMAGAZINE) && + (wtype == ECORE_X_WINDOW_TYPE_NORMAL)) + res = E_COMP_WIN_TYPE_LIVEMAGAZINE; + break; + case E_COMP_WIN_CLASS_TYPE_LOCKSCREEN: + if (ntype == E_COMP_WIN_NAME_TYPE_LOCKSCREEN) + res = E_COMP_WIN_TYPE_LOCKSCREEN; + break; + case E_COMP_WIN_CLASS_TYPE_INDICATOR: + if ((ntype == E_COMP_WIN_NAME_TYPE_INDICATOR) && + (wtype == ECORE_X_WINDOW_TYPE_DOCK)) + res = E_COMP_WIN_TYPE_INDICATOR; + break; + case E_COMP_WIN_CLASS_TYPE_TICKERNOTI: + if ((ntype == E_COMP_WIN_NAME_TYPE_TICKERNOTI) && + (wtype == ECORE_X_WINDOW_TYPE_NOTIFICATION)) + res = E_COMP_WIN_TYPE_TICKERNOTI; + break; + case E_COMP_WIN_CLASS_TYPE_DEBUGGING_INFO: + res = E_COMP_WIN_TYPE_DEBUGGING_INFO; + break; + case E_COMP_WIN_CLASS_TYPE_ISF: + if (wtype != ECORE_X_WINDOW_TYPE_UTILITY) + break; + else if (ntype == E_COMP_WIN_NAME_TYPE_ISF_KEYBOARD) + res = E_COMP_WIN_TYPE_ISF_KEYBOARD; + else if (ntype == E_COMP_WIN_NAME_TYPE_ISF_SUB) + res = E_COMP_WIN_TYPE_ISF_SUB; + break; + case E_COMP_WIN_CLASS_TYPE_NORMAL: + if ((wtype == ECORE_X_WINDOW_TYPE_NORMAL) || + (wtype == ECORE_X_WINDOW_TYPE_UNKNOWN)) + res = E_COMP_WIN_TYPE_NORMAL; + break; + case E_COMP_WIN_CLASS_TYPE_APPTRAY: + if (ntype == E_COMP_WIN_NAME_TYPE_APPTRAY) + res = E_COMP_WIN_TYPE_APPTRAY; + break; + case E_COMP_WIN_CLASS_TYPE_MINI_APPTRAY: + if (ntype == E_COMP_WIN_NAME_TYPE_MINI_APPTRAY) + res = E_COMP_WIN_TYPE_MINI_APPTRAY; + break; + case E_COMP_WIN_CLASS_TYPE_VOLUME: + if ((ntype == E_COMP_WIN_NAME_TYPE_VOLUME) && + (wtype == ECORE_X_WINDOW_TYPE_NOTIFICATION)) + res = E_COMP_WIN_TYPE_VOLUME; + break; + case E_COMP_WIN_CLASS_TYPE_BACKGROUND: + if (ntype == E_COMP_WIN_NAME_TYPE_BACKGROUND) + res = E_COMP_WIN_TYPE_BACKGROUND; + break; + case E_COMP_WIN_CLASS_TYPE_SETUP_WIZARD: + if (ntype == E_COMP_WIN_NAME_TYPE_SETUP_WIZARD) + res = E_COMP_WIN_TYPE_SETUP_WIZARD; + break; + case E_COMP_WIN_CLASS_TYPE_TOAST: + if (ntype == E_COMP_WIN_NAME_TYPE_TOAST) + res = E_COMP_WIN_TYPE_TOAST; + break; + default: + break; + } + + if (res == E_COMP_WIN_TYPE_UNKNOWN) + res = _ecore_type_to_e_comp_type(wtype); + + if (res == E_COMP_WIN_TYPE_DIALOG) + { + if (cw->bd && cw->bd->parent) + res = E_COMP_WIN_TYPE_APP_POPUP; + } + + if (!cw->bd || + (cw->bd && cw->bd->internal)) + { + if (name) E_FREE(name); + if (clas) E_FREE(clas); + } + + cw->win_type = res; + return EINA_TRUE; +} + +EAPI E_Comp_Win_Type +e_mod_comp_win_type_get(E_Comp_Win *cw) +{ + E_CHECK_RETURN(cw, E_COMP_WIN_TYPE_UNKNOWN); + return cw->win_type; +} + +EAPI Eina_Bool +e_mod_comp_win_type_handler_prop(Ecore_X_Event_Window_Property *ev) +{ + E_Comp_Win *cw; + E_CHECK_RETURN(ev, 0); + E_CHECK_RETURN(ev->win, 0); + + cw = e_mod_comp_border_client_find(ev->win); + if (cw) return EINA_TRUE; + + cw = e_mod_comp_win_find(ev->win); + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN((!cw->bd), 0); + + e_mod_comp_win_type_setup(cw); + return EINA_TRUE; +} + +/* local subsystem functions */ +static E_Comp_Win_Type +_ecore_type_to_e_comp_type(Ecore_X_Window_Type t) +{ + E_Comp_Win_Type r = E_COMP_WIN_TYPE_UNKNOWN; + switch (t) + { + case ECORE_X_WINDOW_TYPE_NORMAL: r = E_COMP_WIN_TYPE_NORMAL; break; + case ECORE_X_WINDOW_TYPE_TOOLTIP: r = E_COMP_WIN_TYPE_TOOLTIP; break; + case ECORE_X_WINDOW_TYPE_COMBO: r = E_COMP_WIN_TYPE_COMBO; break; + case ECORE_X_WINDOW_TYPE_DND: r = E_COMP_WIN_TYPE_DND; break; + case ECORE_X_WINDOW_TYPE_DESKTOP: r = E_COMP_WIN_TYPE_DESKTOP; break; + case ECORE_X_WINDOW_TYPE_TOOLBAR: r = E_COMP_WIN_TYPE_TOOLBAR; break; + case ECORE_X_WINDOW_TYPE_MENU: r = E_COMP_WIN_TYPE_MENU; break; + case ECORE_X_WINDOW_TYPE_SPLASH: r = E_COMP_WIN_TYPE_SPLASH; break; + case ECORE_X_WINDOW_TYPE_DROPDOWN_MENU: r = E_COMP_WIN_TYPE_DROPDOWN_MENU; break; + case ECORE_X_WINDOW_TYPE_NOTIFICATION: r = E_COMP_WIN_TYPE_NOTIFICATION; break; + case ECORE_X_WINDOW_TYPE_UTILITY: r = E_COMP_WIN_TYPE_UTILITY; break; + case ECORE_X_WINDOW_TYPE_POPUP_MENU: r = E_COMP_WIN_TYPE_POPUP_MENU; break; + case ECORE_X_WINDOW_TYPE_DIALOG: r = E_COMP_WIN_TYPE_DIALOG; break; + default: + r = E_COMP_WIN_TYPE_NORMAL; + break; + } + return r; +} diff --git a/src/e_mod_comp_win_type.h b/src/e_mod_comp_win_type.h new file mode 100644 index 0000000..0470e12 --- /dev/null +++ b/src/e_mod_comp_win_type.h @@ -0,0 +1,103 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_COMP_WIN_TYPE_H +#define E_MOD_COMP_WIN_TYPE_H + +#define TYPE_NORMAL_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_NORMAL) + +#define TYPE_INDICATOR_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_INDICATOR) + +#define TYPE_TICKERNOTI_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_TICKERNOTI) + +#define TYPE_DEBUGGING_INFO_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_DEBUGGING_INFO) + +#define TYPE_TASKMANAGER_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_TASKMANAGER) + +#define TYPE_HOME_CHECK(a) \ + (((a)->win_type == E_COMP_WIN_TYPE_MENUSCREEN) || \ + ((a)->win_type == E_COMP_WIN_TYPE_LIVEMAGAZINE)) + +#define TYPE_QUICKPANEL_CHECK(a) \ + (((a)->win_type == E_COMP_WIN_TYPE_QUICKPANEL_BASE) || \ + ((a)->win_type == E_COMP_WIN_TYPE_QUICKPANEL)) + +#define TYPE_BG_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_BACKGROUND) + +#define TYPE_KEYBOARD_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_ISF_KEYBOARD) + +#define TYPE_KEYBOARD_SUB_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_ISF_SUB) + +#define TYPE_APPTRAY_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_APPTRAY) + +#define TYPE_MINI_APPTRAY_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_MINI_APPTRAY) + +#define TYPE_LOCKSCREEN_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_LOCKSCREEN) + +#define TYPE_SETUP_WIZARD_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_SETUP_WIZARD) + +#define TYPE_TOAST_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_TOAST) + +#define TYPE_VIDEO_CALL_CHECK(a) \ + ((a)->win_type == E_COMP_WIN_TYPE_VIDEOCALL) + +typedef enum _E_Comp_Win_Type +{ + E_COMP_WIN_TYPE_UNKNOWN = 0, + E_COMP_WIN_TYPE_DESKTOP, + E_COMP_WIN_TYPE_DOCK, + E_COMP_WIN_TYPE_TOOLBAR, + E_COMP_WIN_TYPE_MENU, + E_COMP_WIN_TYPE_UTILITY, + E_COMP_WIN_TYPE_SPLASH, + E_COMP_WIN_TYPE_DIALOG, + E_COMP_WIN_TYPE_NORMAL, + E_COMP_WIN_TYPE_DROPDOWN_MENU, + E_COMP_WIN_TYPE_POPUP_MENU, + E_COMP_WIN_TYPE_TOOLTIP, + E_COMP_WIN_TYPE_NOTIFICATION, + E_COMP_WIN_TYPE_COMBO, + E_COMP_WIN_TYPE_DND, + /* added type */ + E_COMP_WIN_TYPE_MENUSCREEN, + E_COMP_WIN_TYPE_QUICKPANEL_BASE, + E_COMP_WIN_TYPE_QUICKPANEL, + E_COMP_WIN_TYPE_VIDEOCALL, + E_COMP_WIN_TYPE_TASKMANAGER, + E_COMP_WIN_TYPE_LIVEMAGAZINE, + E_COMP_WIN_TYPE_LOCKSCREEN, + E_COMP_WIN_TYPE_INDICATOR, + E_COMP_WIN_TYPE_TICKERNOTI, + E_COMP_WIN_TYPE_DEBUGGING_INFO, + E_COMP_WIN_TYPE_APPTRAY, + E_COMP_WIN_TYPE_MINI_APPTRAY, + E_COMP_WIN_TYPE_VOLUME, + E_COMP_WIN_TYPE_BACKGROUND, + E_COMP_WIN_TYPE_SETUP_WIZARD, + E_COMP_WIN_TYPE_TOAST, + E_COMP_WIN_TYPE_ISF_KEYBOARD, + E_COMP_WIN_TYPE_ISF_SUB, + E_COMP_WIN_TYPE_APP_POPUP, +} E_Comp_Win_Type; + +/* comp window type functions */ +EAPI int e_mod_comp_win_type_init(void); +EAPI int e_mod_comp_win_type_shutdown(void); +EAPI Eina_Bool e_mod_comp_win_type_setup(E_Comp_Win *cw); +EAPI E_Comp_Win_Type e_mod_comp_win_type_get(E_Comp_Win *cw); +EAPI Eina_Bool e_mod_comp_win_type_handler_prop(Ecore_X_Event_Window_Property *ev); + +#endif +#endif diff --git a/src/e_mod_config.c b/src/e_mod_config.c new file mode 100755 index 0000000..186ff05 --- /dev/null +++ b/src/e_mod_config.c @@ -0,0 +1,1587 @@ +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_config.h" +#include "e_mod_comp.h" + +typedef struct _E_Demo_Style_Item +{ + Evas_Object *preview; + Evas_Object *frame; + Evas_Object *livethumb; + Evas_Object *layout; + Evas_Object *border; + Evas_Object *client; +} E_Demo_Style_Item; + +typedef struct _Match_Config +{ + Match match; + E_Config_Dialog *cfd; + char *title, *name, *clas, *role; + int borderless, dialog, accepts_focus, vkbd; + int quickpanel, argb, fullscreen, modal; +} Match_Config; + +struct _E_Config_Dialog_Data +{ + int use_shadow; + int engine; + int indirect; + int texture_from_pixmap; + int smooth_windows; + int lock_fps; + int fake_image_launch; + int efl_sync; + int loose_sync; + int grab; + int vsync; + + const char *shadow_style; + + struct + { + Eina_List *popups; + Eina_List *borders; + Eina_List *overrides; + Eina_List *menus; + int changed; + } match; + + Evas_Object *popups_il; + Evas_Object *borders_il; + Evas_Object *overrides_il; + Evas_Object *menus_il; + + Evas_Object *edit_il; + + int keep_unmapped; + int max_unmapped_pixels; + int max_unmapped_time; + int min_unmapped_time; + int send_flush; + int send_dump; + int nocomp_fs; + int use_hwc; + + int fps_show; + int fps_corner; + int fps_average_range; + double first_draw_delay; + + int canvas_per_zone; + int use_hw_ov; + int debug_info_show; + int max_debug_msgs; + int debug_type_nocomp; + int debug_type_swap; + int debug_type_effect; + int use_efl_native_surface; +}; + +/* Protos */ +static void *_create_data(E_Config_Dialog *cfd); +static void _free_data(E_Config_Dialog *cfd, + E_Config_Dialog_Data *cfdata); +static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, + Evas *evas, + E_Config_Dialog_Data *cfdata); +static int _basic_apply_data(E_Config_Dialog *cfd, + E_Config_Dialog_Data *cfdata); + +E_Config_Dialog * +e_int_config_comp_module(E_Container *con, + const char *params __UNUSED__) +{ + E_Config_Dialog *cfd; + E_Config_Dialog_View *v; + char buf[4096]; + Mod *mod = _comp_mod; + + if (e_config_dialog_find("E", "appearance/comp")) return NULL; + v = E_NEW(E_Config_Dialog_View, 1); + if (!v) return NULL; + + v->create_cfdata = _create_data; + v->free_cfdata = _free_data; + v->basic.apply_cfdata = _basic_apply_data; +#ifndef _F_DISABLE_E_WIDGET + v->basic.create_widgets = _basic_create_widgets; +#endif + + snprintf(buf, sizeof(buf), "%s/e17-mod-tizen-comp.edj", + e_module_dir_get(mod->module)); + cfd = e_config_dialog_new(con, _("Composite Settings"), + "E", "appearance/comp", buf, 0, v, mod); + mod->config_dialog = cfd; + + return cfd; +} + +static void +_match_dup(Match *m, + Match_Config *m2) +{ + m2->match = *m; + if (m2->match.title) m2->match.title = eina_stringshare_add(m2->match.title); + if (m2->match.name) m2->match.name = eina_stringshare_add(m2->match.name); + if (m2->match.clas) m2->match.clas = eina_stringshare_add(m2->match.clas); + if (m2->match.role) m2->match.role = eina_stringshare_add(m2->match.role); + if (m2->match.shadow_style) m2->match.shadow_style = eina_stringshare_add(m2->match.shadow_style); +} + +static void * +_create_data(E_Config_Dialog *cfd) +{ + E_Config_Dialog_Data *cfdata; + Eina_List *l; + Match *m; + Match_Config *m2; + + cfdata = E_NEW(E_Config_Dialog_Data, 1); + + cfdata->use_shadow = _comp_mod->conf->use_shadow; + cfdata->engine = _comp_mod->conf->engine; + if ((cfdata->engine != ENGINE_SW) && + (cfdata->engine != ENGINE_GL)) + cfdata->engine = ENGINE_SW; + cfdata->indirect = _comp_mod->conf->indirect; + cfdata->texture_from_pixmap = _comp_mod->conf->texture_from_pixmap; + cfdata->smooth_windows = _comp_mod->conf->smooth_windows; + cfdata->lock_fps = _comp_mod->conf->lock_fps; + cfdata->fake_image_launch = _comp_mod->conf->fake_image_launch; + cfdata->efl_sync = _comp_mod->conf->efl_sync; + cfdata->loose_sync = _comp_mod->conf->loose_sync; + cfdata->grab = _comp_mod->conf->grab; + cfdata->vsync = _comp_mod->conf->vsync; + if (_comp_mod->conf->shadow_style) + cfdata->shadow_style = eina_stringshare_add(_comp_mod->conf->shadow_style); + + cfdata->keep_unmapped = _comp_mod->conf->keep_unmapped; + cfdata->max_unmapped_pixels = _comp_mod->conf->max_unmapped_pixels; + cfdata->max_unmapped_time = _comp_mod->conf->max_unmapped_time; + cfdata->min_unmapped_time = _comp_mod->conf->min_unmapped_time; + cfdata->send_flush = _comp_mod->conf->send_flush; + cfdata->send_dump = _comp_mod->conf->send_dump; + cfdata->nocomp_fs = _comp_mod->conf->nocomp_fs; + cfdata->use_hwc = _comp_mod->conf->use_hwc; + + cfdata->fps_show = _comp_mod->conf->fps_show; + cfdata->fps_corner = _comp_mod->conf->fps_corner; + cfdata->fps_average_range = _comp_mod->conf->fps_average_range; + if (cfdata->fps_average_range < 1) cfdata->fps_average_range = 12; + else if (cfdata->fps_average_range > 120) + cfdata->fps_average_range = 120; + cfdata->first_draw_delay = _comp_mod->conf->first_draw_delay; + + cfdata->canvas_per_zone = _comp_mod->conf->canvas_per_zone; + cfdata->use_hw_ov = _comp_mod->conf->use_hw_ov; + cfdata->debug_info_show = _comp_mod->conf->debug_info_show; + cfdata->max_debug_msgs = _comp_mod->conf->max_debug_msgs; + cfdata->debug_type_nocomp = _comp_mod->conf->debug_type_nocomp; + cfdata->debug_type_swap = _comp_mod->conf->debug_type_swap; + cfdata->debug_type_effect = _comp_mod->conf->debug_type_effect; + cfdata->use_efl_native_surface = _comp_mod->conf->use_efl_native_surface; + + EINA_LIST_FOREACH(_comp_mod->conf->match.popups, l, m) + { + m2 = E_NEW(Match_Config, 1); + _match_dup(m, m2); + m2->cfd = cfd; + cfdata->match.popups = eina_list_append(cfdata->match.popups, m2); + } + + EINA_LIST_FOREACH(_comp_mod->conf->match.borders, l, m) + { + m2 = E_NEW(Match_Config, 1); + _match_dup(m, m2); + m2->cfd = cfd; + cfdata->match.borders = eina_list_append(cfdata->match.borders, m2); + } + + EINA_LIST_FOREACH(_comp_mod->conf->match.overrides, l, m) + { + m2 = E_NEW(Match_Config, 1); + _match_dup(m, m2); + m2->cfd = cfd; + cfdata->match.overrides = eina_list_append(cfdata->match.overrides, m2); + } + + EINA_LIST_FOREACH(_comp_mod->conf->match.menus, l, m) + { + m2 = E_NEW(Match_Config, 1); + _match_dup(m, m2); + m2->cfd = cfd; + cfdata->match.menus = eina_list_append(cfdata->match.menus, m2); + } + + return cfdata; +} + +static void +_match_free(Match_Config *m) +{ + if (m->match.title) eina_stringshare_del(m->match.title); + if (m->match.name) eina_stringshare_del(m->match.name); + if (m->match.clas) eina_stringshare_del(m->match.clas); + if (m->match.role) eina_stringshare_del(m->match.role); + if (m->match.shadow_style) eina_stringshare_del(m->match.shadow_style); + if (m->title) free(m->title); + if (m->name) free(m->name); + if (m->clas) free(m->clas); + if (m->role) free(m->role); + free(m); +} + +static void +_free_data(E_Config_Dialog *cfd __UNUSED__, + E_Config_Dialog_Data *cfdata) +{ + Match_Config *m; + + _comp_mod->config_dialog = NULL; + if (cfdata->shadow_style) eina_stringshare_del(cfdata->shadow_style); + EINA_LIST_FREE(cfdata->match.popups, m) + { + _match_free(m); + } + EINA_LIST_FREE(cfdata->match.borders, m) + { + _match_free(m); + } + EINA_LIST_FREE(cfdata->match.overrides, m) + { + _match_free(m); + } + EINA_LIST_FREE(cfdata->match.menus, m) + { + _match_free(m); + } + free(cfdata); +} + +static void +_shadow_changed(void *data, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + E_Config_Dialog_Data *cfdata = data; + Evas_Object *orec0; + Eina_List *style_list; + const E_Demo_Style_Item *it; + const Eina_List *l; + + orec0 = evas_object_name_find(evas_object_evas_get(obj), "style_shadows"); + style_list = evas_object_data_get(orec0, "list"); + EINA_LIST_FOREACH(style_list, l, it) + { + if (!it) continue; + if (cfdata->use_shadow) + edje_object_signal_emit(it->preview, "e,state,shadow,on", "e"); + else + edje_object_signal_emit(it->preview, "e,state,shadow,off", "e"); + } +} + +static Eina_Bool +_style_demo(void *data) +{ + Eina_List *style_shadows, *l; + int demo_state; + const E_Demo_Style_Item *it; + + demo_state = (long)evas_object_data_get(data, "style_demo_state"); + demo_state = (demo_state + 1) % 4; + evas_object_data_set(data, "style_demo_state", (void *)(long)demo_state); + + style_shadows = evas_object_data_get(data, "style_shadows"); + EINA_LIST_FOREACH(style_shadows, l, it) + { + if (!it) continue; + + Evas_Object *ob = it->preview; + Evas_Object *of = it->frame; + + switch (demo_state) + { + case 0: + edje_object_signal_emit(ob, "e,state,visible,on", "e"); + edje_object_signal_emit(ob, "e,state,focus,on", "e"); + edje_object_part_text_set(of, "e.text.label", _("Visible")); + break; + + case 1: + edje_object_signal_emit(ob, "e,state,focus,off", "e"); + edje_object_part_text_set(of, "e.text.label", _("Focus-Out")); + break; + + case 2: + edje_object_signal_emit(ob, "e,state,focus,on", "e"); + edje_object_part_text_set(of, "e.text.label", _("Focus-In")); + break; + + case 3: + edje_object_signal_emit(ob, "e,state,visible,off", "e"); + edje_object_part_text_set(of, "e.text.label", _("Hidden")); + break; + + default: + break; + } + } + return ECORE_CALLBACK_RENEW; +} + +static void +_style_selector_del(void *data __UNUSED__, + Evas *e, + Evas_Object *o, + void *event_info __UNUSED__) +{ + Eina_List *style_shadows, *style_list; + Ecore_Timer *timer; + Evas_Object *orec0; + + orec0 = evas_object_name_find(e, "style_shadows"); + style_list = evas_object_data_get(orec0, "list"); + + style_shadows = evas_object_data_get(o, "style_shadows"); + if (style_shadows) + { + E_Demo_Style_Item *ds_it; + + EINA_LIST_FREE(style_shadows, ds_it) + { + style_list = eina_list_remove(style_list, ds_it); + + evas_object_del(ds_it->client); + evas_object_del(ds_it->border); + evas_object_del(ds_it->frame); + evas_object_del(ds_it->preview); + evas_object_del(ds_it->layout); + evas_object_del(ds_it->livethumb); + free(ds_it); + } + evas_object_data_set(o, "style_shadows", NULL); + } + + timer = evas_object_data_get(o, "style_timer"); + if (timer) + { + ecore_timer_del(timer); + evas_object_data_set(o, "style_timer", NULL); + } + + evas_object_data_set(orec0, "list", style_list); +} + +static Evas_Object * +_style_selector(Evas *evas, + int use_shadow, + const char **source) +{ + Evas_Object *oi, *ob, *oo, *obd, *orec, *oly, *orec0; + Eina_List *styles, *l, *style_shadows = NULL, *style_list; + char *style; + const char *str; + int n, sel; + Evas_Coord wmw, wmh; + Ecore_Timer *timer; + + orec0 = evas_object_name_find(evas, "style_shadows"); + style_list = evas_object_data_get(orec0, "list"); + oi = e_widget_ilist_add(evas, 80, 80, source); + evas_object_event_callback_add(oi, EVAS_CALLBACK_DEL, + _style_selector_del, oi); + sel = 0; + styles = e_theme_comp_list(); + n = 0; + EINA_LIST_FOREACH(styles, l, style) + { + E_Demo_Style_Item *ds_it; + char buf[PATH_MAX]; + + ds_it = malloc(sizeof(E_Demo_Style_Item)); + if (!ds_it) continue; +#ifndef _F_DISABLE_E_LIVETHUMB + ob = e_livethumb_add(evas); + ds_it->livethumb = ob; + e_livethumb_vsize_set(ob, 240, 240); + + oly = e_layout_add(e_livethumb_evas_get(ob)); + ds_it->layout = ob; + e_layout_virtual_size_set(oly, 240, 240); + e_livethumb_thumb_set(ob, oly); + evas_object_show(oly); + + oo = edje_object_add(e_livethumb_evas_get(ob)); + ds_it->preview = oo; + snprintf(buf, sizeof(buf), "e/comp/%s", style); + e_theme_edje_object_set(oo, "base/theme/borders", buf); + e_layout_pack(oly, oo); + e_layout_child_move(oo, 39, 39); + e_layout_child_resize(oo, 162, 162); + if (use_shadow) edje_object_signal_emit(oo, "e,state,shadow,on", "e"); + edje_object_signal_emit(oo, "e,state,visible,on", "e"); + evas_object_show(oo); +#endif + + ds_it->frame = edje_object_add(evas); + e_theme_edje_object_set + (ds_it->frame, "base/theme/modules/comp", "e/modules/comp/preview"); + edje_object_part_swallow(ds_it->frame, "e.swallow.preview", ob); + evas_object_show(ds_it->frame); + style_shadows = eina_list_append(style_shadows, ds_it); + +#ifndef _F_DISABLE_E_LIVETHUMB + + obd = edje_object_add(e_livethumb_evas_get(ob)); + ds_it->border = obd; + e_theme_edje_object_set(obd, "base/theme/borders", + "e/widgets/border/default/border"); + edje_object_part_text_set(obd, "e.text.title", _("Title")); + edje_object_signal_emit(obd, "e,state,focused", "e"); + edje_object_part_swallow(oo, "e.swallow.content", obd); + evas_object_show(obd); + + orec = evas_object_rectangle_add(e_livethumb_evas_get(ob)); + ds_it->client = orec; + evas_object_color_set(orec, 255, 255, 255, 255); + edje_object_part_swallow(obd, "e.swallow.client", orec); + evas_object_show(orec); + + e_widget_ilist_append(oi, ds_it->frame, style, NULL, NULL, style); + evas_object_show(ob); +#endif + if (*source) + { + if (!strcmp(*source, style)) sel = n; + } + n++; + + style_list = eina_list_append(style_list, ds_it); + } + evas_object_data_set(orec0, "list", style_list); + evas_object_data_set(oi, "style_shadows", style_shadows); + timer = ecore_timer_add(3.0, _style_demo, oi); + evas_object_data_set(oi, "style_timer", timer); + evas_object_data_set(oi, "style_demo_state", (void *)1); + e_widget_size_min_get(oi, &wmw, &wmh); + e_widget_size_min_set(oi, 160, 100); + e_widget_ilist_selected_set(oi, sel); + e_widget_ilist_go(oi); + + EINA_LIST_FREE(styles, str) + eina_stringshare_del(str); + + return oi; +} + +static void +_match_sel(void *data __UNUSED__) +{ +// Match_Config *m = data; +// E_Config_Dialog *cfd = m->cfd; +} + +static const char * +_match_type_label_get(int type) +{ + if (ECORE_X_WINDOW_TYPE_UNKNOWN == type) + return _("Unused"); + if (ECORE_X_WINDOW_TYPE_COMBO == type) + return _("Combo"); + if (ECORE_X_WINDOW_TYPE_DESKTOP == type) + return _("Desktop"); + if (ECORE_X_WINDOW_TYPE_DIALOG == type) + return _("Dialog"); + if (ECORE_X_WINDOW_TYPE_DOCK == type) + return _("Dock"); + if (ECORE_X_WINDOW_TYPE_DND == type) + return _("Drag and Drop"); + if (ECORE_X_WINDOW_TYPE_MENU == type) + return _("Menu"); + if (ECORE_X_WINDOW_TYPE_DROPDOWN_MENU == type) + return _("Menu (Dropdown)"); + if (ECORE_X_WINDOW_TYPE_POPUP_MENU == type) + return _("Menu (Popup)"); + if (ECORE_X_WINDOW_TYPE_NORMAL == type) + return _("Normal"); + if (ECORE_X_WINDOW_TYPE_NOTIFICATION == type) + return _("Notification"); + if (ECORE_X_WINDOW_TYPE_SPLASH == type) + return _("Splash"); + if (ECORE_X_WINDOW_TYPE_TOOLBAR == type) + return _("Toolbar"); + if (ECORE_X_WINDOW_TYPE_TOOLTIP == type) + return _("Tooltip"); + if (ECORE_X_WINDOW_TYPE_UTILITY == type) + return _("Utility"); + + return _("Unused"); +} + +static char * +_match_label_get(Match_Config *m) +{ + char *label; + Eina_Strbuf *buf = eina_strbuf_new(); + + if (m->match.title) + { + eina_strbuf_append(buf, _("Title:")); + eina_strbuf_append(buf, m->match.title); + eina_strbuf_append(buf, _(" / ")); + } + if (m->match.primary_type) + { + eina_strbuf_append(buf, _("Type:")); + eina_strbuf_append(buf, _match_type_label_get(m->match.primary_type)); + eina_strbuf_append(buf, _(" / ")); + } + if (m->match.name) + { + eina_strbuf_append(buf, _("Name:")); + eina_strbuf_append(buf, m->match.name); + eina_strbuf_append(buf, _(" / ")); + } + if (m->match.clas) + { + eina_strbuf_append(buf, _("Class:")); + eina_strbuf_append(buf, m->match.clas); + eina_strbuf_append(buf, _(" / ")); + } + if (m->match.role) + { + eina_strbuf_append(buf, _("Role:")); + eina_strbuf_append(buf, m->match.role); + eina_strbuf_append(buf, _(" / ")); + } + if (m->match.shadow_style) + { + eina_strbuf_append(buf, _("Style:")); + eina_strbuf_append(buf, m->match.shadow_style); + } + + if (!eina_strbuf_length_get(buf)) + { + eina_strbuf_free(buf); + return _("Unknown"); + } + + label = strdup(eina_strbuf_string_get(buf)); + eina_strbuf_free(buf); + + return label; +} + +static void +_match_ilist_append(Evas_Object *il, + Match_Config *m, + int pos, + int pre) +{ + char *name = _match_label_get(m); + + if (pos == -1) + e_widget_ilist_append(il, NULL, name, _match_sel, m, NULL); + else + { + if (pre) + e_widget_ilist_prepend_relative(il, NULL, name, _match_sel, m, NULL, pos); + else + e_widget_ilist_append_relative(il, NULL, name, _match_sel, m, NULL, pos); + } + E_FREE(name); +} + +static void +_match_list_up(Eina_List **list, + Match_Config *m) +{ + Eina_List *l, *lp; + + l = eina_list_data_find_list(*list, m); + if (!l) return; + lp = l->prev; + *list = eina_list_remove_list(*list, l); + if (lp) *list = eina_list_prepend_relative_list(*list, m, lp); + else *list = eina_list_prepend(*list, m); +} + +static void +_match_list_down(Eina_List **list, + Match_Config *m) +{ + Eina_List *l, *lp; + + l = eina_list_data_find_list(*list, m); + if (!l) return; + lp = l->next; + *list = eina_list_remove_list(*list, l); + if (lp) *list = eina_list_append_relative_list(*list, m, lp); + else *list = eina_list_append(*list, m); +} + +static Eina_Bool +_match_list_del(Eina_List **list, + Match_Config *m) +{ + Eina_List *l, *lp; + + if (!m) return EINA_FALSE; + l = eina_list_data_find_list(*list, m); + if (!l) return EINA_FALSE; + lp = l->next; + *list = eina_list_remove_list(*list, l); + _match_free(m); + return EINA_TRUE; +} + +static void +_cb_dialog_resize(void *data, + Evas *e __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + Evas_Object *bg, *of; + int x, y, w, h; + + of = data; + bg = evas_object_data_get(of, "bg"); + evas_object_geometry_get(obj, &x, &y, &w, &h); + + evas_object_move(bg, x, y); + evas_object_resize(bg, w, h); + evas_object_move(of, x, y); + evas_object_resize(of, w, h); +} + +static void +_edit_ok(void *d1, + void *d2) +{ + Match_Config *m = d1; + Evas_Object *dia, *bg, *of = d2; + Evas_Object *il; + char *label; + int n; + + if (m->match.title) eina_stringshare_del(m->match.title); + m->match.title = NULL; + if (m->title) + { + if (m->title[0]) m->match.title = eina_stringshare_add(m->title); + free(m->title); + m->title = NULL; + } + if (m->match.name) eina_stringshare_del(m->match.name); + m->match.name = NULL; + if (m->name) + { + if (m->name[0]) m->match.name = eina_stringshare_add(m->name); + free(m->name); + m->name = NULL; + } + if (m->match.clas) eina_stringshare_del(m->match.clas); + m->match.clas = NULL; + if (m->clas) + { + if (m->clas[0]) m->match.clas = eina_stringshare_add(m->clas); + free(m->clas); + m->clas = NULL; + } + if (m->match.role) eina_stringshare_del(m->match.role); + m->match.role = NULL; + if (m->role) + { + if (m->role[0]) m->match.role = eina_stringshare_add(m->role); + free(m->role); + m->role = NULL; + } + m->match.borderless = m->borderless; + m->match.dialog = m->dialog; + m->match.accepts_focus = m->accepts_focus; + m->match.vkbd = m->vkbd; + m->match.quickpanel = m->quickpanel; + m->match.argb = m->argb; + m->match.fullscreen = m->fullscreen; + m->match.modal = m->modal; + + il = m->cfd->cfdata->edit_il; + n = e_widget_ilist_selected_get(il); + label = _match_label_get(m); + e_widget_ilist_nth_label_set(il, n, label); + E_FREE(label); + bg = evas_object_data_get(of, "bg"); + dia = evas_object_data_get(of, "dia"); + + evas_object_event_callback_del(dia, EVAS_CALLBACK_RESIZE, _cb_dialog_resize); + evas_object_del(bg); + evas_object_del(of); +} + +static void +_create_edit_frame(E_Config_Dialog *cfd, + Evas *evas, + E_Config_Dialog_Data *cfdata, + Match_Config *m) +{ + Evas_Object *of, *oi, *lb, *en, *bt, *tb, *tab2, *o, *sf, *li; + E_Radio_Group *rg; + int row; + int x, y, w, h; + + o = edje_object_add(evas); + e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main"); + evas_object_geometry_get(cfd->dia->bg_object, &x, &y, &w, &h); + evas_object_move(o, x, y); + evas_object_resize(o, w, h); + evas_object_show(o); + + of = e_widget_frametable_add(evas, _("Edit Match"), 0); + evas_object_data_set(of, "bg", o); + evas_object_data_set(of, "dia", cfd->dia->bg_object); + evas_object_move(of, x, y); + evas_object_resize(of, w, h); + evas_object_show(of); + + evas_object_event_callback_add(cfd->dia->bg_object, EVAS_CALLBACK_RESIZE, + _cb_dialog_resize, of); + + tb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale); + + tab2 = e_widget_table_add(evas, 0); + if (cfdata->edit_il == cfdata->borders_il) + { + if (m->match.title) m->title = strdup(m->match.title); + else m->title = NULL; + lb = e_widget_label_add(evas, _("Title")); + e_widget_table_object_append(tab2, lb, 0, 0, 1, 1, 1, 0, 0, 0); + en = e_widget_entry_add(evas, &(m->title), NULL, NULL, NULL); + e_widget_table_object_append(tab2, en, 1, 0, 1, 1, 1, 0, 1, 0); + } + if ((cfdata->edit_il == cfdata->borders_il) || + (cfdata->edit_il == cfdata->overrides_il) || + (cfdata->edit_il == cfdata->popups_il)) + { + if (m->match.name) m->name = strdup(m->match.name); + else m->name = NULL; + lb = e_widget_label_add(evas, _("Name")); + e_widget_table_object_append(tab2, lb, 0, 1, 1, 1, 1, 0, 0, 0); + en = e_widget_entry_add(evas, &(m->name), NULL, NULL, NULL); + e_widget_table_object_append(tab2, en, 1, 1, 1, 1, 1, 0, 1, 0); + } + if ((cfdata->edit_il == cfdata->borders_il) || + (cfdata->edit_il == cfdata->overrides_il)) + { + if (m->match.clas) m->clas = strdup(m->match.clas); + else m->clas = NULL; + lb = e_widget_label_add(evas, _("Class")); + e_widget_table_object_append(tab2, lb, 0, 2, 1, 1, 1, 0, 0, 0); + en = e_widget_entry_add(evas, &(m->clas), NULL, NULL, NULL); + e_widget_table_object_append(tab2, en, 1, 2, 1, 1, 1, 0, 1, 0); + } + if (cfdata->edit_il == cfdata->borders_il) + { + if (m->match.role) m->role = strdup(m->match.role); + else m->role = NULL; + lb = e_widget_label_add(evas, _("Role")); + e_widget_table_object_append(tab2, lb, 0, 3, 1, 1, 1, 0, 0, 0); + en = e_widget_entry_add(evas, &(m->role), NULL, NULL, NULL); + e_widget_table_object_append(tab2, en, 1, 3, 1, 1, 1, 0, 1, 0); + } + e_widget_toolbook_page_append(tb, NULL, _("Names"), tab2, 1, 1, 1, 1, 0.5, 0.0); + + if ((cfdata->edit_il == cfdata->borders_il) || + (cfdata->edit_il == cfdata->overrides_il)) + { + Evas_Coord mw, mh; + + rg = e_widget_radio_group_new(&m->match.primary_type); + + li = e_widget_list_add(evas, 1, 0); + + o = e_widget_radio_add(evas, _("Unused"), ECORE_X_WINDOW_TYPE_UNKNOWN, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + + o = e_widget_radio_add(evas, _("Combo"), ECORE_X_WINDOW_TYPE_COMBO, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Desktop"), ECORE_X_WINDOW_TYPE_DESKTOP, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Dialog"), ECORE_X_WINDOW_TYPE_DIALOG, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Dock"), ECORE_X_WINDOW_TYPE_DOCK, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Drag and Drop"), ECORE_X_WINDOW_TYPE_DND, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Menu"), ECORE_X_WINDOW_TYPE_MENU, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Menu (Dropdown)"), ECORE_X_WINDOW_TYPE_DROPDOWN_MENU, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Menu (Popup)"), ECORE_X_WINDOW_TYPE_POPUP_MENU, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Normal"), ECORE_X_WINDOW_TYPE_NORMAL, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Notification"), ECORE_X_WINDOW_TYPE_NOTIFICATION, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Splash"), ECORE_X_WINDOW_TYPE_SPLASH, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Toolbar"), ECORE_X_WINDOW_TYPE_TOOLBAR, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Tooltip"), ECORE_X_WINDOW_TYPE_TOOLTIP, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + o = e_widget_radio_add(evas, _("Utility"), ECORE_X_WINDOW_TYPE_UTILITY, rg); + e_widget_list_object_append(li, o, 1, 0, 0.0); + + e_widget_size_min_get(li, &mw, &mh); + evas_object_resize(li, mw, mh); + + sf = e_widget_scrollframe_simple_add(evas, li); + e_widget_toolbook_page_append(tb, NULL, _("Types"), sf, + 1, 1, 1, 1, 0.5, 0.0); + } + + m->borderless = m->match.borderless; + m->dialog = m->match.dialog; + m->accepts_focus = m->match.accepts_focus; + m->vkbd = m->match.vkbd; + m->quickpanel = m->match.quickpanel; + m->argb = m->match.argb; + m->fullscreen = m->match.fullscreen; + m->modal = m->match.modal; + + row = 0; + tab2 = e_widget_table_add(evas, 0); + lb = e_widget_label_add(evas, _("Unused")); + e_widget_table_object_append(tab2, lb, 1, row, 1, 1, 0, 0, 0, 0); + lb = e_widget_label_add(evas, _("On")); + e_widget_table_object_append(tab2, lb, 2, row, 1, 1, 0, 0, 0, 0); + lb = e_widget_label_add(evas, _("Off")); + e_widget_table_object_append(tab2, lb, 3, row, 1, 1, 0, 0, 0, 0); + row++; + + if (cfdata->edit_il == cfdata->borders_il) + { + lb = e_widget_label_add(evas, _("Borderless")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->borderless); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + } + if (cfdata->edit_il == cfdata->borders_il) + { + lb = e_widget_label_add(evas, _("Dialog")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->dialog); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + } + if (cfdata->edit_il == cfdata->borders_il) + { + lb = e_widget_label_add(evas, _("Accepts Focus")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->accepts_focus); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + } + if (cfdata->edit_il == cfdata->borders_il) + { + lb = e_widget_label_add(evas, _("Virtual Keyboard")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->vkbd); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + } + if (cfdata->edit_il == cfdata->borders_il) + { + lb = e_widget_label_add(evas, _("Quick Panel")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->quickpanel); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + } + lb = e_widget_label_add(evas, _("ARGB")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->argb); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + if (cfdata->edit_il == cfdata->borders_il) + { + lb = e_widget_label_add(evas, _("Fullscreen")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->fullscreen); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + } + if (cfdata->edit_il == cfdata->borders_il) + { + lb = e_widget_label_add(evas, _("Modal")); + e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0); + rg = e_widget_radio_group_new(&m->modal); + o = e_widget_radio_add(evas, NULL, 0, rg); + e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, 1, rg); + e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0); + o = e_widget_radio_add(evas, NULL, -1, rg); + e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0); + row++; + } + e_widget_toolbook_page_append(tb, NULL, _("Flags"), tab2, + 1, 1, 1, 1, 0.5, 0.0); + + oi = _style_selector(evas, cfdata->use_shadow, &(m->match.shadow_style)); + e_widget_toolbook_page_append(tb, NULL, _("Style"), oi, + 1, 1, 1, 1, 0.5, 0.0); + + e_widget_frametable_object_append(of, tb, 0, 0, 1, 1, 1, 1, 1, 1); + e_widget_toolbook_page_show(tb, 0); + + bt = e_widget_button_add(evas, _("OK"), NULL, _edit_ok, m, of); + e_widget_frametable_object_append(of, bt, 0, 1, 1, 1, 0, 0, 0, 0); +} + +static void +_but_up(void *d1, + void *d2) +{ + E_Config_Dialog *cfd = d1; + Evas_Object *il = d2; + Match_Config *m; + int n; + + e_widget_ilist_freeze(il); + n = e_widget_ilist_selected_get(il); + if (n < 1) return; + m = e_widget_ilist_nth_data_get(il, n); + if (!m) + { + e_widget_ilist_thaw(il); + return; + } + e_widget_ilist_remove_num(il, n); + n--; + _match_ilist_append(il, m, n, 1); + e_widget_ilist_nth_show(il, n, 0); + e_widget_ilist_selected_set(il, n); + e_widget_ilist_thaw(il); + e_widget_ilist_go(il); + _match_list_up(&(cfd->cfdata->match.popups), m); + _match_list_up(&(cfd->cfdata->match.borders), m); + _match_list_up(&(cfd->cfdata->match.overrides), m); + _match_list_up(&(cfd->cfdata->match.menus), m); + cfd->cfdata->match.changed = 1; +} + +static void +_but_down(void *d1, + void *d2) +{ + E_Config_Dialog *cfd = d1; + Evas_Object *il = d2; + Match_Config *m; + int n; + + e_widget_ilist_freeze(il); + n = e_widget_ilist_selected_get(il); + if (n >= (e_widget_ilist_count(il) - 1)) return; + m = e_widget_ilist_nth_data_get(il, n); + if (!m) + { + e_widget_ilist_thaw(il); + return; + } + e_widget_ilist_remove_num(il, n); + _match_ilist_append(il, m, n, 0); + e_widget_ilist_nth_show(il, n + 1, 0); + e_widget_ilist_selected_set(il, n + 1); + e_widget_ilist_thaw(il); + e_widget_ilist_go(il); + _match_list_down(&(cfd->cfdata->match.popups), m); + _match_list_down(&(cfd->cfdata->match.borders), m); + _match_list_down(&(cfd->cfdata->match.overrides), m); + _match_list_down(&(cfd->cfdata->match.menus), m); + cfd->cfdata->match.changed = 1; +} + +static void +_but_add(void *d1, + void *d2) +{ + E_Config_Dialog *cfd = d1; + Evas_Object *il = d2; + Match_Config *m; + int n; + + m = E_NEW(Match_Config, 1); + if (m) + { + m->cfd = cfd; + m->match.title = NULL; + m->match.name = NULL; + m->match.clas = NULL; + m->match.role = NULL; + m->match.shadow_style = eina_stringshare_add("default"); + + if (il == cfd->cfdata->popups_il) + cfd->cfdata->match.popups = eina_list_append(cfd->cfdata->match.popups, m); + else if (il == cfd->cfdata->borders_il) + cfd->cfdata->match.borders = eina_list_append(cfd->cfdata->match.borders, m); + else if (il == cfd->cfdata->overrides_il) + cfd->cfdata->match.overrides = eina_list_append(cfd->cfdata->match.overrides, m); + else if (il == cfd->cfdata->menus_il) + cfd->cfdata->match.menus = eina_list_append(cfd->cfdata->match.menus, m); + } + + e_widget_ilist_freeze(il); + + if (m) + _match_ilist_append(il, m, -1, 0); + e_widget_ilist_thaw(il); + e_widget_ilist_go(il); + n = e_widget_ilist_count(il); + e_widget_ilist_nth_show(il, n - 1, 0); + e_widget_ilist_selected_set(il, n - 1); + + cfd->cfdata->edit_il = il; + if (m) + _create_edit_frame(cfd, evas_object_evas_get(il), cfd->cfdata, m); + cfd->cfdata->match.changed = 1; +} + +static void +_but_del(void *d1, + void *d2) +{ + E_Config_Dialog *cfd = d1; + Evas_Object *il = d2; + Match_Config *m; + int n; + + e_widget_ilist_freeze(il); + n = e_widget_ilist_selected_get(il); + m = e_widget_ilist_nth_data_get(il, n); + if (!m) + { + e_widget_ilist_thaw(il); + return; + } + e_widget_ilist_remove_num(il, n); + e_widget_ilist_thaw(il); + e_widget_ilist_go(il); + if(_match_list_del(&(cfd->cfdata->match.popups), m)) m = NULL; + if(_match_list_del(&(cfd->cfdata->match.borders), m)) m = NULL; + if(_match_list_del(&(cfd->cfdata->match.overrides), m)) m = NULL; + if(_match_list_del(&(cfd->cfdata->match.menus), m)) m = NULL; + cfd->cfdata->match.changed = 1; +} + +static void +_but_edit(void *d1, + void *d2) +{ + E_Config_Dialog *cfd = d1; + Evas_Object *il = d2; + int n; + Match_Config *m; + + n = e_widget_ilist_selected_get(il); + m = e_widget_ilist_nth_data_get(il, n); + if (!m) return; + + cfd->cfdata->edit_il = il; + _create_edit_frame(cfd, evas_object_evas_get(il), cfd->cfdata, m); + cfd->cfdata->match.changed = 1; +} + +static Evas_Object * +_create_match_editor(E_Config_Dialog *cfd, + Evas *evas, + E_Config_Dialog_Data *cfdata __UNUSED__, + Eina_List **matches, + Evas_Object **il_ret) +{ + Evas_Object *tab, *il, *bt; + Match_Config *m; + Eina_List *l; + + tab = e_widget_table_add(evas, 0); + + il = e_widget_ilist_add(evas, 16, 16, NULL); + e_widget_size_min_set(il, 160, 100); + + EINA_LIST_FOREACH(*matches, l, m) + { + _match_ilist_append(il, m, -1, 0); + } + + e_widget_ilist_go(il); + e_widget_table_object_append(tab, il, 0, 0, 1, 5, 1, 1, 1, 1); + + bt = e_widget_button_add(evas, _("Up"), NULL, _but_up, cfd, il); + e_widget_table_object_append(tab, bt, 1, 0, 1, 1, 1, 1, 0, 0); + bt = e_widget_button_add(evas, _("Down"), NULL, _but_down, cfd, il); + e_widget_table_object_append(tab, bt, 1, 1, 1, 1, 1, 1, 0, 0); + bt = e_widget_button_add(evas, _("Add"), NULL, _but_add, cfd, il); + e_widget_table_object_append(tab, bt, 1, 2, 1, 1, 1, 1, 0, 0); + bt = e_widget_button_add(evas, _("Del"), NULL, _but_del, cfd, il); + e_widget_table_object_append(tab, bt, 1, 3, 1, 1, 1, 1, 0, 0); + bt = e_widget_button_add(evas, _("Edit"), NULL, _but_edit, cfd, il); + e_widget_table_object_append(tab, bt, 1, 4, 1, 1, 1, 1, 0, 0); + + *il_ret = il; + + return tab; +} + +static Evas_Object * +_create_styles_toolbook(E_Config_Dialog *cfd, + Evas *evas, + E_Config_Dialog_Data *cfdata) +{ + Evas_Object *tb, *oi, *il; + + tb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale); + + oi = _style_selector(evas, cfdata->use_shadow, &(cfdata->shadow_style)); + e_widget_toolbook_page_append(tb, NULL, _("Default"), oi, 1, 1, 1, 1, 0.5, 0.0); + + oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.borders), &il); + cfdata->borders_il = il; + e_widget_toolbook_page_append(tb, NULL, _("Apps"), oi, 1, 1, 1, 1, 0.5, 0.0); + + oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.popups), &il); + cfdata->popups_il = il; + e_widget_toolbook_page_append(tb, NULL, _("E"), oi, 1, 1, 1, 1, 0.5, 0.0); + + oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.overrides), &il); + cfdata->overrides_il = il; + e_widget_toolbook_page_append(tb, NULL, _("Over"), oi, 1, 1, 1, 1, 0.5, 0.0); + + oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.menus), &il); + cfdata->menus_il = il; + e_widget_toolbook_page_append(tb, NULL, _("Menus"), oi, 1, 1, 1, 1, 0.5, 0.0); + + e_widget_toolbook_page_show(tb, 0); + + return tb; +} + +static Evas_Object * +_basic_create_widgets(E_Config_Dialog *cfd, + Evas *evas, + E_Config_Dialog_Data *cfdata) +{ + Evas_Object *ob, *ol, *ol2, *of, *otb, *oi, *orec0, *tab; + E_Radio_Group *rg; + + orec0 = evas_object_rectangle_add(evas); + evas_object_name_set(orec0, "style_shadows"); + + tab = e_widget_table_add(evas, 0); + evas_object_name_set(tab, "dia_table"); + + otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale); +#ifndef _F_DISABLE_E_WIDGET + ol = e_widget_list_add(evas, 0, 0); + ob = e_widget_check_add(evas, _("Shadows"), &(cfdata->use_shadow)); + evas_object_smart_callback_add(ob, "changed", _shadow_changed, cfdata); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + ob = e_widget_check_add(evas, _("Limit framerate"), &(cfdata->lock_fps)); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + ob = e_widget_check_add(evas, _("Smooth scaling"), &(cfdata->smooth_windows)); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + ob = e_widget_check_add(evas, _("Fake image launch"), &(cfdata->fake_image_launch)); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + + of = e_widget_frametable_add(evas, _("Styles"), 0); + e_widget_frametable_content_align_set(of, 0.5, 0.5); + oi = _create_styles_toolbook(cfd, evas, cfdata); + e_widget_frametable_object_append(of, oi, 0, 0, 1, 1, 1, 1, 1, 1); + e_widget_list_object_append(ol, of, 1, 1, 0.5); + + e_widget_toolbook_page_append(otb, NULL, _("Effects"), ol, 1, 1, 1, 1, 0.5, 0.0); + + /////////////////////////////////////////// + ol = e_widget_list_add(evas, 0, 0); + ob = e_widget_check_add(evas, _("Sync screen (VBlank)"), &(cfdata->vsync)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("Sync windows"), &(cfdata->efl_sync)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("Loose sync"), &(cfdata->loose_sync)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("Grab Server during draw"), &(cfdata->grab)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_label_add(evas, _("Initial draw timeout for newly mapped windows")); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_slider_add(evas, 1, 0, _("%1.2f Seconds"), 0.01, 0.5, 0.01, 0, &(cfdata->first_draw_delay), NULL, 150); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + e_widget_toolbook_page_append(otb, NULL, _("Sync"), ol, 0, 0, 0, 0, 0.5, 0.0); + + /////////////////////////////////////////// + ol = e_widget_list_add(evas, 0, 0); + rg = e_widget_radio_group_new(&(cfdata->engine)); + ob = e_widget_radio_add(evas, _("Software"), ENGINE_SW, rg); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + if (!getenv("ECORE_X_NO_XLIB")) + { + if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11)) + { + ob = e_widget_radio_add(evas, _("OpenGL"), ENGINE_GL, rg); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + + of = e_widget_framelist_add(evas, _("OpenGL options"), 0); + e_widget_framelist_content_align_set(of, 0.5, 0.0); + ob = e_widget_check_add(evas, _("Texture from pixmap"), &(cfdata->texture_from_pixmap)); + e_widget_framelist_object_append(of, ob); + ob = e_widget_label_add(evas, _("Ctrl+Alt+Shift+Home resets compositor")); + e_widget_framelist_object_append(of, ob); + ob = e_widget_check_add(evas, _("Indirect OpenGL (EXPERIMENTAL)"), &(cfdata->indirect)); + e_widget_framelist_object_append(of, ob); + e_widget_list_object_append(ol, of, 1, 1, 0.5); + } + } + e_widget_toolbook_page_append(otb, NULL, _("Engine"), ol, 0, 0, 0, 0, 0.5, 0.0); + + /////////////////////////////////////////// + ol = e_widget_list_add(evas, 0, 0); + ob = e_widget_check_add(evas, _("Send flush"), &(cfdata->send_flush)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("Send dump"), &(cfdata->send_dump)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("Don't composite fullscreen"), &(cfdata->nocomp_fs)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("Keep hidden windows"), &(cfdata->keep_unmapped)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + of = e_widget_frametable_add(evas, _("Maximum hidden pixels"), 0); + e_widget_frametable_content_align_set(of, 0.5, 0.5); + rg = e_widget_radio_group_new(&(cfdata->max_unmapped_pixels)); + ob = e_widget_radio_add(evas, _("1M"), 1 * 1024, rg); + e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("2M"), 2 * 1024, rg); + e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("4M"), 4 * 1024, rg); + e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("8M"), 8 * 1024, rg); + e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("16M"), 16 * 1024, rg); + e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("32M"), 32 * 1024, rg); + e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("64M"), 64 * 1024, rg); + e_widget_frametable_object_append(of, ob, 2, 0, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("128M"), 128 * 1024, rg); + e_widget_frametable_object_append(of, ob, 2, 1, 1, 1, 1, 1, 0, 0); + ob = e_widget_radio_add(evas, _("256M"), 256 * 1024, rg); + e_widget_frametable_object_append(of, ob, 2, 2, 1, 1, 1, 1, 0, 0); + e_widget_list_object_append(ol, of, 1, 1, 0.5); + e_widget_toolbook_page_append(otb, NULL, _("Memory"), ol, 0, 0, 0, 0, 0.5, 0.0); + + /////////////////////////////////////////// + ol = e_widget_list_add(evas, 0, 0); + ol2 = e_widget_list_add(evas, 1, 1); + of = e_widget_framelist_add(evas, _("Min hidden"), 0); + e_widget_framelist_content_align_set(of, 0.5, 0.0); + rg = e_widget_radio_group_new(&(cfdata->min_unmapped_time)); + ob = e_widget_radio_add(evas, _("30 Seconds"), 30, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("1 Minute"), 60, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("5 Minutes"), 5 * 60, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("30 Minutes"), 30 * 60, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("2 Hours"), 2 * 3600, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("10 Hours"), 10 * 3600, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Forever"), 0, rg); + e_widget_framelist_object_append(of, ob); + e_widget_list_object_append(ol2, of, 1, 1, 0.5); + of = e_widget_framelist_add(evas, _("Max hidden"), 0); + e_widget_framelist_content_align_set(of, 0.5, 0.0); + rg = e_widget_radio_group_new(&(cfdata->max_unmapped_time)); + ob = e_widget_radio_add(evas, _("30 Seconds"), 30, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("1 Minute"), 60, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("5 Minutes"), 5 * 60, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("30 Minutes"), 30 * 60, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("2 Hours"), 2 * 3600, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("10 Hours"), 10 * 3600, rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Forever"), 0, rg); + e_widget_framelist_object_append(of, ob); + e_widget_list_object_append(ol2, of, 1, 1, 0.5); + e_widget_list_object_append(ol, ol2, 1, 1, 0.5); + e_widget_toolbook_page_append(otb, NULL, _("Timeouts"), ol, 0, 0, 0, 0, 0.5, 0.0); + + /////////////////////////////////////////// + ol = e_widget_list_add(evas, 0, 0); + + ob = e_widget_check_add(evas, _("Show Framerate"), &(cfdata->fps_show)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_label_add(evas, _("Rolling average frame count")); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_slider_add(evas, 1, 0, _("%1.0f Frames"), 1, 120, 1, 0, + NULL, &(cfdata->fps_average_range), 240); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + + of = e_widget_frametable_add(evas, _("Corner"), 0); + e_widget_frametable_content_align_set(of, 0.5, 0.5); + rg = e_widget_radio_group_new(&(cfdata->fps_corner)); + ob = e_widget_radio_icon_add(evas, "Top Left", "preferences-position-top-left", + 24, 24, 0, rg); + e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1); + ob = e_widget_radio_icon_add(evas, "Top Right", "preferences-position-top-right", + 24, 24, 1, rg); + e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 1); + ob = e_widget_radio_icon_add(evas, "Bottom Left", "preferences-position-bottom-left", + 24, 24, 2, rg); + e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 1); + ob = e_widget_radio_icon_add(evas, "Bottom Right", "preferences-position-bottom-right", + 24, 24, 3, rg); + e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 1); + e_widget_list_object_append(ol, of, 1, 1, 0.5); + + e_widget_toolbook_page_append(otb, NULL, _("Debug"), ol, 0, 0, 0, 0, 0.5, 0.0); + + /////////////////////////////////////////// + ol = e_widget_list_add(evas, 0, 0); + ob = e_widget_check_add(evas, _("Evas canvas per zone"), &(cfdata->canvas_per_zone)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + + ob = e_widget_check_add(evas, _("H/W overlay window"), &(cfdata->use_hw_ov)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + + ob = e_widget_check_add(evas, _("Enable hardware composite"), &(cfdata->use_hwc)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + + ob = e_widget_check_add(evas, _("Show Log"), &(cfdata->debug_info_show)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_label_add(evas, _("Maximum number of log messages")); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_slider_add(evas, 1, 0, _("%1.0f Messages"), 1, 30, 1, 0, + NULL, &(cfdata->max_debug_msgs), 240); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_label_add(evas, _("Log Type")); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("COMP <-> NOCOMP"), &(cfdata->debug_type_nocomp)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("SWAP"), &(cfdata->debug_type_swap)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("EFFECT"), &(cfdata->debug_type_effect)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("NATIVE SURFACE"), &(cfdata->use_efl_native_surface)); + e_widget_list_object_append(ol, ob, 1, 1, 0.5); + + e_widget_toolbook_page_append(otb, NULL, _("Mobile"), ol, 0, 0, 0, 0, 0.5, 0.0); +#endif + /////////////////////////////////////////// + e_widget_toolbook_page_show(otb, 0); + + e_dialog_resizable_set(cfd->dia, 1); + + e_widget_table_object_append(tab, otb, 0, 0, 1, 1, 1, 1, 1, 1); + return tab; +} + +static void +_match_list_free(Eina_List *list) +{ + Match *m; + + EINA_LIST_FREE(list, m) + { + if (m->title) eina_stringshare_del(m->title); + if (m->name) eina_stringshare_del(m->name); + if (m->clas) eina_stringshare_del(m->clas); + if (m->role) eina_stringshare_del(m->role); + if (m->shadow_style) eina_stringshare_del(m->shadow_style); + free(m); + } +} + +static void +_match_dup2(Match_Config *m2, + Match *m) +{ + *m = m2->match; + if (m->title) m->title = eina_stringshare_add(m->title); + if (m->name) m->name = eina_stringshare_add(m->name); + if (m->clas) m->clas = eina_stringshare_add(m->clas); + if (m->role) m->role = eina_stringshare_add(m->role); + if (m->shadow_style) m->shadow_style = eina_stringshare_add(m->shadow_style); +} + +static int +_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, + E_Config_Dialog_Data *cfdata) +{ + if ((cfdata->use_shadow != _comp_mod->conf->use_shadow) || + (cfdata->lock_fps != _comp_mod->conf->lock_fps) || + (cfdata->smooth_windows != _comp_mod->conf->smooth_windows) || + (cfdata->fake_image_launch != _comp_mod->conf->fake_image_launch) || + (cfdata->grab != _comp_mod->conf->grab) || + (cfdata->keep_unmapped != _comp_mod->conf->keep_unmapped) || + (cfdata->nocomp_fs != _comp_mod->conf->nocomp_fs) || + (cfdata->use_hwc != _comp_mod->conf->use_hwc) || + (cfdata->shadow_style != _comp_mod->conf->shadow_style) || + (cfdata->max_unmapped_pixels != _comp_mod->conf->max_unmapped_pixels) || + (cfdata->max_unmapped_time != _comp_mod->conf->max_unmapped_time) || + (cfdata->min_unmapped_time != _comp_mod->conf->min_unmapped_time) || + (cfdata->send_flush != _comp_mod->conf->send_flush) || + (cfdata->send_dump != _comp_mod->conf->send_dump) || + (cfdata->fps_show != _comp_mod->conf->fps_show) || + (cfdata->fps_corner != _comp_mod->conf->fps_corner) || + (cfdata->fps_average_range != _comp_mod->conf->fps_average_range) || + (cfdata->first_draw_delay != _comp_mod->conf->first_draw_delay) || + (cfdata->canvas_per_zone != _comp_mod->conf->canvas_per_zone) || + (cfdata->use_hw_ov != _comp_mod->conf->use_hw_ov) || + (cfdata->debug_info_show != _comp_mod->conf->debug_info_show) || + (cfdata->max_debug_msgs != _comp_mod->conf->max_debug_msgs) || + (cfdata->debug_type_nocomp != _comp_mod->conf->debug_type_nocomp) || + (cfdata->debug_type_swap != _comp_mod->conf->debug_type_swap) || + (cfdata->debug_type_effect != _comp_mod->conf->debug_type_effect) || + (cfdata->use_efl_native_surface != _comp_mod->conf->use_efl_native_surface) || + (cfdata->match.changed) + ) + { + if (cfdata->match.changed) + { + Eina_List *l; + Match *m; + Match_Config *m2; + + _match_list_free(_comp_mod->conf->match.popups); + _match_list_free(_comp_mod->conf->match.borders); + _match_list_free(_comp_mod->conf->match.overrides); + _match_list_free(_comp_mod->conf->match.menus); + + _comp_mod->conf->match.popups = NULL; + _comp_mod->conf->match.borders = NULL; + _comp_mod->conf->match.overrides = NULL; + _comp_mod->conf->match.menus = NULL; + + EINA_LIST_FOREACH(cfdata->match.popups, l, m2) + { + m = E_NEW(Match, 1); + _match_dup2(m2, m); + _comp_mod->conf->match.popups = + eina_list_append(_comp_mod->conf->match.popups, m); + } + EINA_LIST_FOREACH(cfdata->match.borders, l, m2) + { + m = E_NEW(Match, 1); + _match_dup2(m2, m); + _comp_mod->conf->match.borders = + eina_list_append(_comp_mod->conf->match.borders, m); + } + EINA_LIST_FOREACH(cfdata->match.overrides, l, m2) + { + m = E_NEW(Match, 1); + _match_dup2(m2, m); + _comp_mod->conf->match.overrides = + eina_list_append(_comp_mod->conf->match.overrides, m); + } + EINA_LIST_FOREACH(cfdata->match.menus, l, m2) + { + m = E_NEW(Match, 1); + _match_dup2(m2, m); + _comp_mod->conf->match.menus = + eina_list_append(_comp_mod->conf->match.menus, m); + } + cfdata->match.changed = 0; + } + _comp_mod->conf->use_shadow = cfdata->use_shadow; + _comp_mod->conf->lock_fps = cfdata->lock_fps; + _comp_mod->conf->smooth_windows = cfdata->smooth_windows; + _comp_mod->conf->fake_image_launch = cfdata->fake_image_launch; + _comp_mod->conf->grab = cfdata->grab; + _comp_mod->conf->keep_unmapped = cfdata->keep_unmapped; + _comp_mod->conf->nocomp_fs = cfdata->nocomp_fs; + _comp_mod->conf->use_hwc = cfdata->use_hwc; + _comp_mod->conf->max_unmapped_pixels = cfdata->max_unmapped_pixels; + _comp_mod->conf->max_unmapped_time = cfdata->max_unmapped_time; + _comp_mod->conf->min_unmapped_time = cfdata->min_unmapped_time; + _comp_mod->conf->send_flush = cfdata->send_flush; + _comp_mod->conf->send_dump = cfdata->send_dump; + _comp_mod->conf->fps_show = cfdata->fps_show; + _comp_mod->conf->fps_corner = cfdata->fps_corner; + _comp_mod->conf->fps_average_range = cfdata->fps_average_range; + _comp_mod->conf->first_draw_delay = cfdata->first_draw_delay; + _comp_mod->conf->canvas_per_zone = cfdata->canvas_per_zone; + _comp_mod->conf->use_hw_ov = cfdata->use_hw_ov; + _comp_mod->conf->debug_info_show = cfdata->debug_info_show; + _comp_mod->conf->max_debug_msgs = cfdata->max_debug_msgs; + _comp_mod->conf->debug_type_nocomp = cfdata->debug_type_nocomp; + _comp_mod->conf->debug_type_swap = cfdata->debug_type_swap; + _comp_mod->conf->debug_type_effect = cfdata->debug_type_effect; + _comp_mod->conf->use_efl_native_surface = cfdata->use_efl_native_surface; + if (_comp_mod->conf->shadow_style) + eina_stringshare_del(_comp_mod->conf->shadow_style); + _comp_mod->conf->shadow_style = NULL; + if (cfdata->shadow_style) + _comp_mod->conf->shadow_style = eina_stringshare_add(cfdata->shadow_style); + e_mod_comp_shadow_set(); + e_mod_comp_hw_ov_win_msg_config_update(); + } + if ((cfdata->engine != _comp_mod->conf->engine) || + (cfdata->indirect != _comp_mod->conf->indirect) || + (cfdata->texture_from_pixmap != _comp_mod->conf->texture_from_pixmap) || + (cfdata->efl_sync != _comp_mod->conf->efl_sync) || + (cfdata->loose_sync != _comp_mod->conf->loose_sync) || + (cfdata->vsync != _comp_mod->conf->vsync)) + { + E_Action *a; + + _comp_mod->conf->engine = cfdata->engine; + _comp_mod->conf->indirect = cfdata->indirect; + _comp_mod->conf->texture_from_pixmap = cfdata->texture_from_pixmap; + _comp_mod->conf->efl_sync = cfdata->efl_sync; + _comp_mod->conf->loose_sync = cfdata->loose_sync; + _comp_mod->conf->vsync = cfdata->vsync; + + a = e_action_find("restart"); + if ((a) && (a->func.go)) a->func.go(NULL, NULL); + } + e_config_save_queue(); + return 1; +} diff --git a/src/e_mod_config.h b/src/e_mod_config.h new file mode 100644 index 0000000..929ac4e --- /dev/null +++ b/src/e_mod_config.h @@ -0,0 +1,7 @@ +#ifdef E_TYPEDEFS +#else +#ifndef E_MOD_CONFIG_H +#define E_MOD_CONFIG_H +E_Config_Dialog *e_int_config_comp_module(E_Container *con, const char *params __UNUSED__); +#endif +#endif diff --git a/src/e_mod_main.c b/src/e_mod_main.c new file mode 100644 index 0000000..f399ed7 --- /dev/null +++ b/src/e_mod_main.c @@ -0,0 +1,133 @@ +#include "e.h" +#include "e_mod_main.h" +#include "e_mod_config.h" +#include "e_mod_comp.h" + +//static Ecore_Event_Handler *init_done_handler = NULL; + +//static int +//_e_init_done(void *data, int type, void *event) +//{ +// ecore_event_handler_del(init_done_handler); +// init_done_handler = NULL; +// if (!e_mod_comp_init()) +// { +// // FIXME: handle if comp init fails +// } +// return 1; +//} + +/* module private routines */ +Mod *_comp_mod = NULL; + +/* public module routines. all modules must have these */ +EAPI E_Module_Api e_modapi = +{ + E_MODULE_API_VERSION, + "Composite" +}; + +EAPI void * +e_modapi_init(E_Module *m) +{ + Mod *mod; + char buf[4096]; + + mod = calloc(1, sizeof(Mod)); + if (!mod) return NULL; + + m->data = mod; + mod->module = m; + snprintf(buf, sizeof(buf), "%s/e17-mod-tizen-comp.edj", e_module_dir_get(m)); + e_configure_registry_category_add("appearance", 10, _("Look"), NULL, + "preferences-look"); + e_configure_registry_item_add("appearance/comp", 120, _("Composite"), NULL, + buf, e_int_config_comp_module); + + e_mod_comp_cfdata_edd_init(&(mod->conf_edd), + &(mod->conf_match_edd)); + + mod->conf = e_config_domain_load("module.e17-mod-tizen-comp", mod->conf_edd); + if (!mod->conf) _e_mod_config_new(m); + + if (!e_config->use_composite) + { + e_config->use_composite = 1; + e_config_save_queue(); + } + + /* XXX: disabled dropshadow module when comp is running */ + { + Eina_List *l; + E_Module *m2; + EINA_LIST_FOREACH(e_module_list(), l, m2) + { + if (m2->enabled && (!strcmp(m2->name, "dropshadow"))) + e_module_disable(m2); + } + } + + /* XXX: update old configs. add config versioning */ + if ((mod->conf) && (mod->conf->first_draw_delay == 0)) + mod->conf->first_draw_delay = 0.20; + + _comp_mod = mod; + + if (!e_mod_comp_init()) + { + // FIXME: handle if comp init fails + } + + e_module_priority_set(m, -1000); + return mod; +} + +void +_e_mod_config_new(E_Module *m) +{ + Mod *mod = m->data; + mod->conf = e_mod_comp_cfdata_config_new(); +} + +void +_e_mod_config_free(E_Module *m) +{ + Mod *mod = m->data; + + e_mod_cfdata_config_free(mod->conf); + mod->conf = NULL; +} + +EAPI int +e_modapi_shutdown(E_Module *m) +{ + Mod *mod = m->data; + + e_mod_comp_shutdown(); + + e_configure_registry_item_del("appearance/comp"); + e_configure_registry_category_del("appearance"); + + if (mod->config_dialog) + { + e_object_del(E_OBJECT(mod->config_dialog)); + mod->config_dialog = NULL; + } + _e_mod_config_free(m); + + E_CONFIG_DD_FREE(mod->conf_match_edd); + E_CONFIG_DD_FREE(mod->conf_edd); + free(mod); + + if (mod == _comp_mod) _comp_mod = NULL; + + return 1; +} + +EAPI int +e_modapi_save(E_Module *m) +{ + Mod *mod = m->data; + e_config_domain_save("module.e17-mod-tizen-comp", mod->conf_edd, mod->conf); + return 1; +} diff --git a/src/e_mod_main.h b/src/e_mod_main.h new file mode 100644 index 0000000..90628ac --- /dev/null +++ b/src/e_mod_main.h @@ -0,0 +1,56 @@ +#ifndef E_MOD_MAIN_H +#define E_MOD_MAIN_H + +#ifdef HAVE_GETTEXT +#define _(str) gettext(str) +#define d_(str, dom) dgettext(PACKAGE dom, str) +#else +#define _(str) (str) +#define d_(str, dom) (str) +#endif + +#include "e_mod_comp_cfdata.h" + +typedef struct _Mod Mod; + +struct _Mod +{ + E_Module *module; + + E_Config_DD *conf_edd; + E_Config_DD *conf_match_edd; + Config *conf; + + E_Config_Dialog *config_dialog; +}; + +extern Mod *_comp_mod; + +EAPI extern E_Module_Api e_modapi; + +EAPI void *e_modapi_init(E_Module *m); +EAPI int e_modapi_shutdown(E_Module *m); +EAPI int e_modapi_save(E_Module *m); +EAPI int e_modapi_info(E_Module *m); + +void _e_mod_config_new(E_Module *m); +void _e_mod_config_free(E_Module *m); + +#define ENGINE_SW 1 +#define ENGINE_GL 2 + + +/** + * @addtogroup Optional_Look + * @{ + * + * @defgroup Module_Comp Comp (Composite Manager) + * + * Implements the X11 Composite Manager to support alpha blend, + * semi-transparent windows and drop shadow. Does support animations + * and effects such as coloring unfocused windows. + * + * @} + */ + +#endif diff --git a/src/effect/Makefile.am b/src/effect/Makefile.am new file mode 100644 index 0000000..656af8d --- /dev/null +++ b/src/effect/Makefile.am @@ -0,0 +1,55 @@ +MAINTAINERCLEANFILES = Makefile.in +MODULE = e17-mod-tizen-comp +SUB_MODULE = effect + +#EDJE_CC = @edje_cc@ +#EDJE_FLAGS = -v \ +# @EDJE_DEF@ + +# data files for the module +filesdir = $(libdir)/enlightenment/modules/$(MODULE)/$(SUB_MODULE) + +EXTRA_DIST = $(files_DATA) + +# the module .so file +INCLUDES = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/effect \ + @HWC_CFLAGS@ \ + @ENLIGHTENMENT_CFLAGS@ + +pkgdir = $(filesdir) +pkg_LTLIBRARIES = common.la micro.la mobile.la +common_la_SOURCES = effect.h \ + effect.c \ + effect_image_launch.h \ + effect_image_launch.c \ + effect_win_rotation.h \ + effect_win_rotation.c + +common_la_LIBADD = @ENLIGHTENMENT_LIBS@ @HWC_LIBS@ @dlopen_libs@ +common_la_LDFLAGS = -module -avoid-version +common_la_DEPENDENCIES = $(top_builddir)/config.h + +micro_la_SOURCES = effect.h \ + effect.c \ + effect_image_launch.h \ + effect_image_launch.c \ + effect_win_rotation.h \ + effect_win_rotation.c + +micro_la_LIBADD = @ENLIGHTENMENT_LIBS@ @HWC_LIBS@ @dlopen_libs@ +micro_la_LDFLAGS = -module -avoid-version +micro_la_DEPENDENCIES = $(top_builddir)/config.h + +mobile_la_SOURCES = effect.h \ + effect.c \ + effect_image_launch.h \ + effect_image_launch.c \ + effect_win_rotation.h \ + effect_win_rotation.c + +mobile_la_LIBADD = @ENLIGHTENMENT_LIBS@ @HWC_LIBS@ @dlopen_libs@ +mobile_la_LDFLAGS = -module -avoid-version +mobile_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/src/effect/effect.c b/src/effect/effect.c new file mode 100755 index 0000000..9f54415 --- /dev/null +++ b/src/effect/effect.c @@ -0,0 +1,2263 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" +#include + +#include "effect.h" +#include "effect_image_launch.h" +#include "effect_win_rotation.h" + +static Eina_List *effect_jobs = NULL; + +/* local subsystem functions */ +static E_Comp_Effect_Style _effect_style_get(Ecore_X_Atom a); +static Eina_Bool _state_send(E_Comp_Win *cw, Eina_Bool state); +static Eina_Bool _effect_signal_del_intern(E_Comp_Win *cw, Evas_Object *obj, const char *name, Eina_Bool clean_all); +static E_Border *_effect_policy_border_transient_for_border_top_get(E_Border *bd); +static void _effect_policy_border_transient_for_group_make(E_Border *bd, Eina_List **list); + +static void _effect_win_set(E_Comp_Win *cw, const char *emission, Eina_Bool send_ev, Eina_Bool show, Eina_Bool recreate); +static void _effect_win_lower(E_Comp_Win *cw, const char *emission, Eina_Bool recreate); +static void _effect_below_wins_set(E_Comp_Win *cw, Eina_Bool recreate); +static void _effect_below_floating_wins_set(E_Comp_Win *cw, Eina_Bool show, Eina_Bool recreate); +static void _effect_home_active_below_wins_set(E_Comp_Win *cw, Eina_Bool show, Eina_Bool recreate); + +static void _effect_above_wins_set(E_Comp_Win *cw, Eina_Bool show, Eina_Bool recreate); + +static E_Comp_Effect_Object * _effect_object_control_layer_new(E_Comp_Layer *ly, E_Comp_Win *cw); +static void _effect_control_layer_set(E_Comp_Win *cw); + +static Eina_Bool _effect_show(E_Comp_Win *cw, Eina_Bool send_ev); +static Eina_Bool _effect_hide(E_Comp_Win *cw, Eina_Bool send_ev); +static Eina_Bool _effect_obj_win_set(E_Comp_Effect_Object *o, E_Comp_Win *cw); +static void _effect_obj_win_shape_rectangles_apply(E_Comp_Effect_Object *o, E_Comp_Win *cw); +static void _effect_obj_effect_done(void *data, Evas_Object *obj, const char *emission, const char *source); +static E_Comp_Effect_Object *_effect_obj_find(E_Comp_Win *cw); +static Eina_Bool _effect_obj_win_shaped_check(int w, int h, const Ecore_X_Rectangle *rects, int num); +static void _effect_role_handle(E_Comp_Effect_Object *o); +static Eina_Bool _effect_active_except_bd_check(E_Border *bd); +static void _effect_home_active_unset(E_Comp_Win *cw); + +EAPI Eina_Bool +e_mod_comp_effect_mod_init(E_Comp *c) +{ + E_CHECK_RETURN(c, 0); + + c->effect_funcs.type_new = _effect_mod_type_new; + c->effect_funcs.type_free = _effect_mod_type_free; + c->effect_funcs.type_setup = _effect_mod_type_setup; + c->effect_funcs.state_setup = _effect_mod_state_setup; + c->effect_funcs.state_get = _effect_mod_state_get; + c->effect_funcs.state_set = _effect_mod_state_set; + c->effect_funcs.style_setup = _effect_mod_style_setup; + c->effect_funcs.style_get = _effect_mod_style_get; + c->effect_funcs.win_show = _effect_mod_win_show; + c->effect_funcs.win_hide = _effect_mod_win_hide; + c->effect_funcs.win_restack = _effect_mod_win_restack; + c->effect_funcs.signal_add = _effect_mod_signal_add; + c->effect_funcs.signal_del = _effect_mod_signal_del; + c->effect_funcs.jobs_clean = _effect_mod_jobs_clean; + c->effect_funcs.signal_flush = _effect_mod_signal_flush; + c->effect_funcs.animating_set = _effect_mod_animating_set; + c->effect_funcs.object_new = _effect_mod_object_new; + c->effect_funcs.object_free = _effect_mod_object_free; + c->effect_funcs.object_win_set = _effect_mod_object_win_set; + c->effect_funcs.above_wins_set = _effect_mod_above_wins_set; + + c->effect_funcs.image_launch_new = _effect_mod_image_launch_new; + c->effect_funcs.image_launch_free = _effect_mod_image_launch_free; + c->effect_funcs.image_launch_handler_message = _effect_mod_image_launch_handler_message; + c->effect_funcs.image_launch_show = _effect_mod_image_launch_show; + c->effect_funcs.image_launch_hide = _effect_mod_image_launch_hide; + c->effect_funcs.image_launch_window_check = _effect_mod_image_launch_window_check; + c->effect_funcs.image_launch_running_check = _effect_mod_image_launch_running_check; + c->effect_funcs.image_launch_fake_show_done_check = _effect_mod_image_launch_fake_show_done_check; + c->effect_funcs.image_launch_window_set = _effect_mod_image_launch_window_set; + c->effect_funcs.image_launch_disable = _effect_mod_image_launch_disable; + + c->effect_funcs.win_angle_get = _effect_mod_win_angle_get; + c->effect_funcs.zone_rotation_new = _effect_mod_zone_rotation_new; + c->effect_funcs.zone_rotation_free = _effect_mod_zone_rotation_free; + c->effect_funcs.zone_rotation_begin = _effect_mod_zone_rotation_begin; + c->effect_funcs.zone_rotation_end = _effect_mod_zone_rotation_end; + c->effect_funcs.zone_rotation_cancel = _effect_mod_zone_rotation_cancel; + c->effect_funcs.zone_rotation_do = _effect_mod_zone_rotation_do; + c->effect_funcs.zone_rotation_clear = _effect_mod_zone_rotation_clear; + + return EINA_TRUE; +} + +EAPI void +e_mod_comp_effect_mod_shutdown(E_Comp *c) +{ + E_CHECK_RETURN(c, 0); + + c->effect_funcs.type_new = NULL; + c->effect_funcs.type_free = NULL; + c->effect_funcs.type_setup = NULL; + c->effect_funcs.state_setup = NULL; + c->effect_funcs.state_get = NULL; + c->effect_funcs.state_set = NULL; + c->effect_funcs.style_setup = NULL; + c->effect_funcs.style_get = NULL; + c->effect_funcs.win_show = NULL; + c->effect_funcs.win_hide = NULL; + c->effect_funcs.win_restack = NULL; + c->effect_funcs.signal_add = NULL; + c->effect_funcs.signal_del = NULL; + c->effect_funcs.jobs_clean = NULL; + c->effect_funcs.signal_flush = NULL; + c->effect_funcs.animating_set = NULL; + c->effect_funcs.object_new = NULL; + c->effect_funcs.object_free = NULL; + c->effect_funcs.object_win_set = NULL; + c->effect_funcs.above_wins_set = NULL; + + c->effect_funcs.image_launch_new = NULL; + c->effect_funcs.image_launch_free = NULL; + c->effect_funcs.image_launch_handler_message = NULL; + c->effect_funcs.image_launch_show = NULL; + c->effect_funcs.image_launch_hide = NULL; + c->effect_funcs.image_launch_window_check = NULL; + c->effect_funcs.image_launch_running_check = NULL; + c->effect_funcs.image_launch_fake_show_done_check = NULL; + c->effect_funcs.image_launch_window_set = NULL; + c->effect_funcs.image_launch_disable = NULL; + + c->effect_funcs.win_angle_get = NULL; + c->effect_funcs.zone_rotation_new = NULL; + c->effect_funcs.zone_rotation_free = NULL; + c->effect_funcs.zone_rotation_begin = NULL; + c->effect_funcs.zone_rotation_end = NULL; + c->effect_funcs.zone_rotation_cancel = NULL; + c->effect_funcs.zone_rotation_do = NULL; + c->effect_funcs.zone_rotation_clear = NULL; +} + +/* externally accessible functions */ +E_Comp_Effect_Object * +_effect_mod_object_new(E_Comp_Layer *ly, + E_Comp_Win *cw, + Eina_Bool recreate) +{ + E_Comp_Effect_Object *o = NULL, *o2 = NULL; + Eina_Bool res; + E_CHECK_RETURN(ly, NULL); + E_CHECK_RETURN(cw, NULL); + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:EFFECT OBJECT NEW"); + + o2 = _effect_obj_find(cw); + if ((o2) && (recreate)) + { + e_layout_unpack(o2->edje); + o2 = NULL; + } + /* TODO: clean up previous effect job */ + E_CHECK_RETURN(!o2, NULL); + + o = E_NEW(E_Comp_Effect_Object, 1); + E_CHECK_RETURN(o, NULL); + + o->edje = edje_object_add(ly->canvas->evas); + E_CHECK_GOTO(o->edje, fail); + + e_mod_comp_layer_populate(ly, o->edje); + + evas_object_data_set(o->edje, "comp.effect_obj.ly", ly); + evas_object_data_set(o->edje, "comp.effect_obj.cwin", + (void *)e_mod_comp_util_client_xid_get(cw)); + + res = _effect_obj_win_set(o, cw); + E_CHECK_GOTO(res, fail); + + ly->objs = eina_list_append(ly->objs, o); + + ELBF(ELBT_COMP, 0, o->cwin, + "%15.15s| OBJ_NEW %p", "EFFECT", o->edje); + + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return o; + +fail: + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| OBJ_NEW Failed", "EFFECT"); + if (o) + { + if (o->edje) + { + e_layout_unpack(o->edje); + evas_object_del(o->edje); + } + E_FREE(o); + } + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return NULL; +} + +void +_effect_mod_object_free(E_Comp_Effect_Object *o) +{ + E_CHECK(o); + +#if SEND_LAUNCHING_DONE + if ((o->cwin) && (o->send_launching_done)) + { + ecore_x_client_message32_send (o->cwin, ATOM_WINDOW_LAUNCHING_EFFECT_DONE, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 0, 0, 0, 0, 0); + e_msg_send("comp.message", "launching.done", o->cwin, NULL, NULL, NULL, NULL); + } +#endif + + if ((o->cwin) && (o->ev_vis)) + e_comp_event_src_visibility_send(o->cwin, o->show); + + if ((o->edje) && (o->img)) + edje_object_part_unswallow(o->edje, o->img); + + if (o->img) + { + /* TODO: consider when using an xim */ + evas_object_image_native_surface_set(o->img, NULL); + evas_object_image_size_set(o->img, 1, 1); + evas_object_image_data_set(o->img, NULL); + evas_object_hide(o->img); + evas_object_del(o->img); + } + + if(o->edje && o->transp.rect) + { + edje_object_part_unswallow(o->edje,o->transp.rect); + } + + if(o->edje && o->transp.offset) + { + edje_object_part_unswallow(o->edje,o->transp.offset); + } + + if(o->transp.offset) + { + evas_object_del(o->transp.offset); + o->transp.offset=NULL; + } + + if (o->transp.rect) + { + evas_object_del(o->transp.rect); + o->transp.rect=NULL; + } + + if (o->pixmap) + ecore_x_pixmap_free(o->pixmap); + + if (o->edje) + { + evas_object_data_del(o->edje, "comp.effect_obj.ly"); + evas_object_data_del(o->edje, "comp.effect_obj.cwin"); + evas_object_hide(o->edje); + evas_object_del(o->edje); + } + + ELBF(ELBT_COMP, 0, o->cwin, + "%15.15s| OBJ_FREE", "EFFECT"); + + memset(o, 0, sizeof(E_Comp_Effect_Object)); + + E_FREE(o); +} + +void +_effect_mod_object_win_set(E_Comp_Win *cw, const char *emission) +{ + _effect_win_set(cw, emission, EINA_FALSE, EINA_FALSE, EINA_FALSE); +} + +void +_effect_mod_above_wins_set(E_Comp_Win *cw, Eina_Bool show) +{ + _effect_above_wins_set(cw, show, EINA_FALSE); +} + +Eina_Bool +_effect_mod_signal_del(E_Comp_Win *cw, + Evas_Object *obj, + const char *name) +{ + return _effect_signal_del_intern(cw, obj, name, EINA_FALSE); +} + +Eina_Bool +_effect_mod_jobs_clean(E_Comp_Win *cw, + Evas_Object *obj, + const char *name) +{ + return _effect_signal_del_intern(cw, obj, name, EINA_TRUE); +} + +Eina_Bool +_effect_mod_signal_flush(void) +{ + E_Comp_Effect_Job *job; + Eina_List *l; + E_Comp_Win *cw; + E_Comp_Layer *ly; + traceBegin(TTRACE_TAG_WINDOW_MANAGER,"WM:COMP:EFFECT SIGNAL FLUSH"); + + EINA_LIST_FOREACH(effect_jobs, l, job) + { + if (!job) continue; + if (job->emitted) continue; + + if ((job->win) && (job->canvas)) + { + if ((cw = e_mod_comp_win_find(job->win))) + { + if (cw->animating) + { + ELBF(ELBT_COMP, 0, job->cwin, + "%15.15s| SIG_PEND:%s", "EFFECT", + job->emission); + continue; + } + else + { + _effect_mod_animating_set(cw->c, cw, EINA_TRUE); + job->emitted = EINA_TRUE; + + edje_object_signal_emit(job->o, job->emission, job->src); + + ELBF(ELBT_COMP, 0, job->cwin, + "%15.15s| SIG_EMIT>%s", "EFFECT", + job->emission); + } + } + else + { + ELBF(ELBT_COMP, 0, job->cwin, + "%15.15s| SIG_DEL :%s", "EFFECT", + job->emission); + + /* remove this job if cw was already removed */ + effect_jobs = eina_list_remove(effect_jobs, job); + E_FREE(job); + } + } + else + { + edje_object_signal_emit(job->o, job->emission, job->src); + + ELBF(ELBT_COMP, 0, job->cwin, + "%15.15s| OBJ SIG_EMIT>%s", "EFFECT", + job->emission); + + ly = evas_object_data_get(job->o, "comp.effect_obj.ly"); + if (ly) e_mod_comp_layer_effect_set(ly, EINA_TRUE); + + effect_jobs = eina_list_remove(effect_jobs, job); + E_FREE(job); + } + } + + traceEnd(TTRACE_TAG_WINDOW_MANAGER); + return EINA_TRUE; +} + +E_Comp_Effect_Type * +_effect_mod_type_new(void) +{ + E_Comp_Effect_Type *t; + t = E_NEW(E_Comp_Effect_Type, 1); + E_CHECK_RETURN(t, 0); + t->animatable = EINA_TRUE; + return t; +} + +void +_effect_mod_type_free(E_Comp_Effect_Type *type) +{ + E_CHECK(type); + E_FREE(type); +} + +Eina_Bool +_effect_mod_type_setup(E_Comp_Effect_Type *type, + Ecore_X_Window win) +{ + E_CHECK_RETURN(type, 0); + E_CHECK_RETURN(win, 0); + + _effect_mod_state_setup(type, win); + _effect_mod_style_setup(type, win); + + return EINA_TRUE; +} + +Eina_Bool +_effect_mod_state_setup(E_Comp_Effect_Type *type, + Ecore_X_Window win) +{ + Atom type_ret = 0; + int ret, size_ret = 0; + unsigned long num_ret = 0, bytes = 0; + unsigned char *prop_ret = NULL; + Ecore_X_Display *dpy; + Eina_Bool is_ok; + + E_CHECK_RETURN(type, 0); + E_CHECK_RETURN(win, 0); + + dpy = ecore_x_display_get(); + ret = XGetWindowProperty(dpy, win, ATOM_WINDOW_EFFECT_ENABLE, 0, LONG_MAX, + False, ECORE_X_ATOM_CARDINAL, &type_ret, &size_ret, + &num_ret, &bytes, &prop_ret); + if (ret == 0) // success + { + if (prop_ret && num_ret) + { + type->animatable = prop_ret[0]; + is_ok = EINA_TRUE; + } + else + is_ok = EINA_FALSE; + } + else // error + { + is_ok = EINA_FALSE; + } + + if (prop_ret) XFree(prop_ret); + return is_ok; +} + +Eina_Bool +_effect_mod_state_get(E_Comp_Effect_Type *type) +{ + E_CHECK_RETURN(type, 0); + return type->animatable; +} + +void +_effect_mod_state_set(E_Comp_Effect_Type *type, Eina_Bool state) +{ + E_CHECK(type); + type->animatable = state; +} + + +Eina_Bool +_effect_mod_style_setup(E_Comp_Effect_Type *type, + Ecore_X_Window win) +{ + Ecore_X_Atom *atoms = NULL; + Eina_Bool res = EINA_FALSE; + int num = 0; + + E_CHECK_RETURN(type, 0); + E_CHECK_RETURN(win, 0); + + num = ecore_x_window_prop_atom_list_get + (win, ATOM_WINDOW_EFFECT_TYPE, &atoms); + E_CHECK_GOTO((num == 6), cleanup); + E_CHECK_GOTO(atoms, cleanup); + + type->show = _effect_style_get(atoms[0]); + type->hide = _effect_style_get(atoms[1]); + type->restack = _effect_style_get(atoms[2]); + type->rotation = _effect_style_get(atoms[3]); + type->focusin = _effect_style_get(atoms[4]); + type->focusout = _effect_style_get(atoms[5]); + + res = EINA_TRUE; + +cleanup: + if (atoms) E_FREE(atoms); + return res; +} + +E_Comp_Effect_Style +_effect_mod_style_get(E_Comp_Effect_Type *type, + E_Comp_Effect_Kind kind) +{ + E_Comp_Effect_Style res; + E_CHECK_RETURN(type, E_COMP_EFFECT_STYLE_NONE); + switch (kind) + { + case E_COMP_EFFECT_KIND_SHOW: res = type->show; break; + case E_COMP_EFFECT_KIND_HIDE: res = type->hide; break; + case E_COMP_EFFECT_KIND_RESTACK: res = type->restack; break; + case E_COMP_EFFECT_KIND_ROTATION: res = type->rotation; break; + case E_COMP_EFFECT_KIND_FOCUSIN: res = type->focusin; break; + case E_COMP_EFFECT_KIND_FOCUSOUT: res = type->focusout; break; + default: res = E_COMP_EFFECT_STYLE_NONE; break; + } + return res; +} + +#define _MAKE_EMISSION(f, x...) do { snprintf(emission, sizeof(emission), f, ##x); } while(0) + +void +_effect_mod_win_restack(E_Comp_Win *cw, + Eina_Bool v1, + Eina_Bool v2) +{ + Eina_Bool animatable = _effect_mod_state_get(cw->eff_type); + if (!((cw->c->animatable) && (animatable))) return; + if ((v1) == (v2)) return; + + if ((!v1) && (v2)) + _effect_show(cw, EINA_FALSE); + else + _effect_hide(cw, EINA_FALSE); + + _effect_home_active_unset(cw); +} + +void +_effect_mod_win_show(E_Comp_Win *cw) +{ + Eina_Bool animatable = _effect_mod_state_get(cw->eff_type); + Eina_Bool res = EINA_FALSE; + + if (cw->c->fake_image_launch) + { + if ((_effect_mod_image_launch_window_check(cw->c->eff_img, cw)) && + (_effect_mod_image_launch_running_check(cw->c->eff_img))) + { + if (_effect_mod_image_launch_fake_show_done_check(cw->c->eff_img)) + { +#if SEND_LAUNCHING_DONE + _effect_mod_image_launch_window_set(cw->c->eff_img, cw->win); +#endif + _effect_mod_image_launch_disable(cw->c->eff_img); + goto postjob; + } + else + { + _effect_mod_image_launch_window_set(cw->c->eff_img, cw->win); + goto postjob; + } + } + } + + if ((cw->c->animatable) && (animatable)) + { + res = _effect_show(cw, EINA_TRUE); + } + +postjob: + /* for the composite window */ + _effect_mod_signal_add(cw, NULL, "e,state,visible,on,noeffect", "e"); + e_mod_comp_comp_event_src_visibility_send(cw); + if (!res) + { + e_comp_event_src_visibility_send + (e_mod_comp_util_client_xid_get(cw), EINA_TRUE); + } + + _effect_home_active_unset(cw); +} + +void +_effect_mod_win_hide(E_Comp_Win *cw) +{ + Eina_Bool animatable, vis; + Eina_Bool res = EINA_FALSE; + + animatable = _effect_mod_state_get(cw->eff_type); + vis = e_mod_comp_util_win_visible_get(cw, EINA_TRUE); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| CHECK visible:%d cw->visible:%d a:%d", "EFFECT", + vis, cw->visible, animatable); + + if ((cw->c->animatable) && (animatable) && (vis)) + { + res = _effect_hide(cw, EINA_TRUE); + } + + /* for the composite window */ + _effect_mod_signal_add(cw, NULL, "e,state,visible,off,noeffect", "e"); + e_mod_comp_comp_event_src_visibility_send(cw); + if (!res) + { + e_comp_event_src_visibility_send + (e_mod_comp_util_client_xid_get(cw), EINA_TRUE); + } + + _effect_home_active_unset(cw); +} + +Eina_Bool +_effect_mod_signal_add(E_Comp_Win *cw, + Evas_Object *o, + const char *emission, + const char *src) + +{ + Eina_List *l; + E_Comp *c = NULL; + E_Comp_Object *co; + E_Comp_Effect_Job *job = NULL; + size_t len; + + E_CHECK_RETURN((cw || o), 0); + E_CHECK_RETURN(emission, 0); + E_CHECK_RETURN(src, 0); + + if (cw) + { + c = cw->c; + + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (!co->shadow) continue; + + job = E_NEW(E_Comp_Effect_Job, 1); + if (!job) continue; + + job->o = co->shadow; + job->win = cw->win; + job->cwin = e_mod_comp_util_client_xid_get(cw); + job->canvas = co->canvas; + + len = sizeof(job->emission); + strncpy(job->emission, emission, len); + job->emission[len-1] = '\0'; + + len = sizeof(job->src); + strncpy(job->src, src, len); + job->src[len-1] = '\0'; + + effect_jobs = eina_list_append(effect_jobs, job); + + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_EFFECT, + "SIG_ADD 0x%x %s", + job->cwin, emission); + } + } + else + { + job = E_NEW(E_Comp_Effect_Job, 1); + if (job) + { + job->effect_obj = EINA_TRUE; + job->o = o; + job->win = 0; + job->cwin = (Ecore_X_Window)evas_object_data_get(o, "comp.effect_obj.cwin"); + + len = sizeof(job->emission); + strncpy(job->emission, emission, len); + job->emission[len-1] = '\0'; + + len = sizeof(job->src); + strncpy(job->src, src, len); + job->src[len-1] = '\0'; + + effect_jobs = eina_list_append(effect_jobs, job); + } + } + + if (job) + { + ELBF(ELBT_COMP, 0, job->cwin, + "%15.15s| %s SIG_ADD:%s", "EFFECT", + job->effect_obj ? "OBJ" : " ", + emission); + } + + return EINA_TRUE; +} + +Eina_Bool +_effect_mod_animating_set(E_Comp *c, + E_Comp_Win *cw, + Eina_Bool set) +{ + Eina_Bool state; + E_CHECK_RETURN(c, 0); + E_CHECK_GOTO(cw, postjob); + + if (set) + { + if (cw->animating) + { + c->animating--; + _state_send(cw, EINA_FALSE); + } + state = EINA_TRUE; + } + else + { + state = EINA_FALSE; + } + + cw->animating = state; + _state_send(cw, state); + +postjob: + if (set) c->animating++; + else c->animating--; + return EINA_TRUE; +} + +/* local subsystem functions */ +static E_Comp_Effect_Style +_effect_style_get(Ecore_X_Atom a) +{ + E_CHECK_RETURN(a, E_COMP_EFFECT_STYLE_NONE); + + if (a == ATOM_EFFECT_DEFAULT) return E_COMP_EFFECT_STYLE_DEFAULT; + else if (a == ATOM_EFFECT_NONE ) return E_COMP_EFFECT_STYLE_NONE; + else if (a == ATOM_EFFECT_CUSTOM0) return E_COMP_EFFECT_STYLE_CUSTOM0; + else if (a == ATOM_EFFECT_CUSTOM1) return E_COMP_EFFECT_STYLE_CUSTOM1; + else if (a == ATOM_EFFECT_CUSTOM2) return E_COMP_EFFECT_STYLE_CUSTOM2; + else if (a == ATOM_EFFECT_CUSTOM3) return E_COMP_EFFECT_STYLE_CUSTOM3; + else if (a == ATOM_EFFECT_CUSTOM4) return E_COMP_EFFECT_STYLE_CUSTOM4; + else if (a == ATOM_EFFECT_CUSTOM5) return E_COMP_EFFECT_STYLE_CUSTOM5; + else if (a == ATOM_EFFECT_CUSTOM6) return E_COMP_EFFECT_STYLE_CUSTOM6; + else if (a == ATOM_EFFECT_CUSTOM7) return E_COMP_EFFECT_STYLE_CUSTOM7; + else if (a == ATOM_EFFECT_CUSTOM8) return E_COMP_EFFECT_STYLE_CUSTOM8; + else if (a == ATOM_EFFECT_CUSTOM9) return E_COMP_EFFECT_STYLE_CUSTOM9; + + return E_COMP_EFFECT_STYLE_NONE; +} + +static Eina_Bool +_state_send(E_Comp_Win *cw, + Eina_Bool state) +{ + long d[5] = {0L, 0L, 0L, 0L, 0L}; + Ecore_X_Window win; + E_CHECK_RETURN(cw, 0); + + win = e_mod_comp_util_client_xid_get(cw); + E_CHECK_RETURN(win, 0); + + if (state) d[0] = 1L; + else d[1] = 1L; + + ecore_x_client_message32_send + (win, ATOM_WINDOW_EFFECT_CLIENT_STATE, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, + d[0], d[1], d[2], d[3], d[4]); + + return EINA_TRUE; +} + +static Eina_Bool +_effect_signal_del_intern(E_Comp_Win *cw, + Evas_Object *obj, + const char *name, + Eina_Bool clean_all) +{ + E_Comp_Effect_Job *job; + Eina_List *l; + EINA_LIST_FOREACH(effect_jobs, l, job) + { + if (!job) continue; + if (!job->emitted) continue; + if (!job->win) continue; + if (!job->canvas) continue; + + Ecore_X_Window win = cw ? cw->win : 0; + if (job->win == win) + { + ELBF(ELBT_COMP, 0, job->cwin, + "%15.15s| SIG_DEL :%s", "EFFECT", + job->emission); + + e_mod_comp_hw_ov_win_msg_show + (E_COMP_LOG_TYPE_EFFECT, + "SIG_DEL 0x%x %s", + job->win, job->emission); + + effect_jobs = eina_list_remove(effect_jobs, job); + + E_FREE(job); + + if (!clean_all) break; + } + } + return EINA_TRUE; +} + +static void +_effect_win_transparent_rect( E_Comp_Win *cw, + E_Comp_Effect_Object *o, + E_Comp_Layer *ly) +{ + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| TRANSP_RECT_UPDATE[%d, %d %d %d %d]", "EFFECT", + cw->transp_rect.use, cw->transp_rect.x, cw->transp_rect.y, + cw->transp_rect.w, cw->transp_rect.h); + + if (cw->transp_rect.use) + { + int alpha = 0; + if (!o->transp.offset) + o->transp.offset = evas_object_rectangle_add(ly->canvas->evas); + if (!o->transp.rect) + o->transp.rect = evas_object_rectangle_add(ly->canvas->evas); + + if ((o->transp.offset) && (o->transp.rect)) + { +#ifdef _F_USE_BORDER_TRANSFORM_ + if ((cw->bd) && (e_border_transform_enable_get(cw->bd))) + { + float dw = 0; + float dh = 0; + if (cw->bd->w != 0 && cw->bd->h != 0) + { + int tw, th; + e_border_transform_get(cw->bd, 0, 0, &tw, &th, 0); + + dw = (float)tw / (float)cw->bd->w; + dh = (float)th / (float)cw->bd->h; + + if (o->transp.offset) + { + evas_object_size_hint_min_set(o->transp.offset, + (int)((float)cw->transp_rect.x * dw), + (int)((float)cw->transp_rect.y * dh)); + } + if (o->transp.rect) + { + evas_object_size_hint_min_set(o->transp.rect, + (int)((float)cw->transp_rect.w * dw), + (int)((float)cw->transp_rect.h * dh)); + } + } + } + else +#endif + { + evas_object_size_hint_min_set(o->transp.offset, + cw->transp_rect.x, + cw->transp_rect.y); + evas_object_size_hint_min_set(o->transp.rect, + cw->transp_rect.w, + cw->transp_rect.h); + } + + evas_object_color_set(o->transp.offset, 0,0,0,0); + evas_object_color_set(o->transp.rect, 0,0,0,0); + evas_object_render_op_set(o->transp.rect, EVAS_RENDER_COPY); + + if (o->edje) + { + if (edje_object_part_exists(o->edje, "e.swallow.transp.offset")) + { + edje_object_part_swallow(o->edje,"e.swallow.transp.offset",o->transp.offset); + } + if (edje_object_part_exists(o->edje, "e.swallow.transp.rect")) + { + edje_object_part_swallow(o->edje,"e.swallow.transp.rect",o->transp.rect); + } + } + } + } + else + { + if (o->transp.offset) + { + if (o->edje) + { + if (edje_object_part_exists(o->edje, "e.swallow.transp.offset")) + { + edje_object_part_unswallow(o->edje, o->transp.offset); + } + } + evas_object_size_hint_min_set(o->transp.offset, 0, 0); + evas_object_color_set(o->transp.offset, 0, 0, 0, 0); + evas_object_del(o->transp.offset); + o->transp.offset = NULL; + } + if (o->transp.rect) + { + if (o->edje) + { + if (edje_object_part_exists(o->edje, "e.swallow.transp.rect")) + { + edje_object_part_unswallow(o->edje, o->transp.rect); + } + } + evas_object_size_hint_min_set(o->transp.rect, 0, 0); + evas_object_color_set(o->transp.rect, 0, 0, 0, 0); + evas_object_render_op_set(o->transp.rect, EVAS_RENDER_BLEND); + evas_object_del(o->transp.rect); + o->transp.rect = NULL; + } + } +} + +static void +_effect_role_handle(E_Comp_Effect_Object *o) +{ + E_CHECK(o); + E_CHECK(o->cwin); + E_CHECK(o->edje); + + char *hints = NULL; + char *token = NULL; + + hints = ecore_x_window_prop_string_get(o->cwin, ECORE_X_ATOM_WM_WINDOW_ROLE); + + if (hints) + token = strtok(hints, " ,"); + while (token != NULL) + { + if (!strncmp(token, "no-dim", strlen("no-dim"))) + { + const char *file = NULL, *group = NULL; + edje_object_file_get(o->edje, &file, &group); + E_CHECK_GOTO(group, cleanup); + + if (!strcmp(group, "dialog")) + edje_object_signal_emit(o->edje, "e,state,dim,off", "e"); + } + token = strtok (NULL, " ,"); + } + +cleanup: + if (hints) free(hints); +} + +static Eina_Bool +_effect_obj_win_set(E_Comp_Effect_Object *o, + E_Comp_Win *cw) +{ + E_Comp_Object *co = NULL; + E_Comp_Layer *ly = NULL; + const char *file = NULL, *group = NULL; + int ok = 0, pw = 0, ph = 0; + Ecore_X_Image *xim; + + ly = evas_object_data_get(o->edje, "comp.effect_obj.ly"); + E_CHECK_RETURN(ly, EINA_FALSE); + E_CHECK_RETURN(ly->canvas, EINA_FALSE); + + if(!cw->sync_info.version) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| Not Drawn", "EFFECT"); + return EINA_FALSE; + } + + co = eina_list_nth(cw->objs, 0); + E_CHECK_RETURN(co, EINA_FALSE); + + edje_object_file_get(co->shadow, &file, &group); + E_CHECK_RETURN(file, EINA_FALSE); + E_CHECK_RETURN(group, EINA_FALSE); + + ok = edje_object_file_set(o->edje, file, group); + E_CHECK_RETURN(ok, EINA_FALSE); + + o->img = evas_object_image_filled_add(ly->canvas->evas); + E_CHECK_RETURN(o->img, EINA_FALSE); + + if (cw->shaped) + { + pw = cw->pw; + ph = cw->ph; + E_CHECK_GOTO((pw > 0), fail); + E_CHECK_GOTO((ph > 0), fail); + + unsigned int *pix; + xim = ecore_x_image_new(pw, ph, cw->vis, cw->depth); + E_CHECK_GOTO(xim, fail); + pix = ecore_x_image_data_get(xim, NULL, NULL, NULL); + evas_object_image_size_set(o->img, pw, ph); + evas_object_image_data_set(o->img, pix); + evas_object_image_data_update_add(o->img, 0, 0, pw, ph); + if (ecore_x_image_get(xim, cw->win, 0, 0, 0, 0, pw, ph)) + { + pix = ecore_x_image_data_get(xim, NULL, NULL, NULL); + evas_object_image_data_set(o->img, pix); + evas_object_image_data_update_add(o->img, 0, 0, pw, ph); + } + _effect_obj_win_shape_rectangles_apply(o, cw); + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| SHAPED OBJ_NEW pix:0x%p %dx%d", "EFFECT", + xim, pw, ph); + } + else + { + evas_object_image_colorspace_set(o->img, EVAS_COLORSPACE_ARGB8888); + evas_object_image_smooth_scale_set(o->img, _comp_mod->conf->smooth_windows); + if (cw->argb) evas_object_image_alpha_set(o->img, 1); + else evas_object_image_alpha_set(o->img, 0); + + /* set nocomp mode before getting named pixmap */ + E_Comp_Win *nocomp_cw = e_mod_comp_util_win_nocomp_get(cw->c, ly->canvas->zone); + if (nocomp_cw == cw) + e_mod_comp_canvas_nocomp_end(ly->canvas); + if (cw->dmg_updates) + o->pixmap = ecore_x_composite_name_window_pixmap_get(cw->win); + else if (cw->needpix) + o->pixmap = e_mod_comp_util_copied_pixmap_get(cw); + E_CHECK_GOTO(o->pixmap, fail); + + ecore_x_pixmap_geometry_get(o->pixmap, NULL, NULL, &pw, &ph); + E_CHECK_GOTO((pw > 0), fail); + E_CHECK_GOTO((ph > 0), fail); + + Evas_Native_Surface ns; + ns.version = EVAS_NATIVE_SURFACE_VERSION; + ns.type = EVAS_NATIVE_SURFACE_X11; + ns.data.x11.visual = cw->vis; + ns.data.x11.pixmap = o->pixmap; + + evas_object_image_size_set(o->img, pw, ph); + evas_object_image_native_surface_set(o->img, &ns); + evas_object_image_data_update_add(o->img, 0, 0, pw, ph); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| OBJ_NEW pix:0x%x %dx%d", "EFFECT", + o->pixmap, pw, ph); + } + + _effect_win_transparent_rect(cw, o, ly); + edje_object_part_swallow(o->edje, "e.swallow.content", o->img); +#ifdef _F_USE_BORDER_TRANSFORM_ + if ((cw->bd) && (e_border_transform_enable_get(cw->bd))) + { + int x, y, w, h; + e_border_transform_get(cw->bd, &x, &y, &w, &h, 0); + e_layout_child_move(o->edje, x, y); + e_layout_child_resize(o->edje, w, h); + } + else +#endif /* end of _F_USE_BORDER_TRANSFORM_ */ + { + if (cw->dmg_updates) + e_layout_child_move(o->edje, cw->x, cw->y); + else if (cw->needpix) + e_layout_child_move(o->edje, cw->resizing.x, cw->resizing.y); + e_layout_child_resize(o->edje, pw, ph); + } + + edje_object_signal_callback_add(o->edje, "e,action,show,done", "e", _effect_obj_effect_done, o); + edje_object_signal_callback_add(o->edje, "e,action,hide,done", "e", _effect_obj_effect_done, o); + + o->win = cw->win; + o->cwin = e_mod_comp_util_client_xid_get(cw); + + _effect_role_handle(o); + + return EINA_TRUE; + +fail: + if (o->img) + { + evas_object_del(o->img); + o->img = NULL; + } + if (o->pixmap) + { + ecore_x_pixmap_free(o->pixmap); + o->pixmap = 0; + } + return EINA_FALSE; +} + +static Eina_Bool +_effect_obj_win_shaped_check(int w, + int h, + const Ecore_X_Rectangle *rects, + int num) +{ + if ((!rects) || (num < 1)) return EINA_FALSE; + if (num > 1) return EINA_TRUE; + if ((rects[0].x == 0) && (rects[0].y == 0) && + ((int)rects[0].width == w) && ((int)rects[0].height == h)) + return EINA_FALSE; + return EINA_TRUE; +} + +static void +_effect_obj_win_shape_rectangles_apply(E_Comp_Effect_Object *o, + E_Comp_Win *cw) +{ + int num; + Ecore_X_Rectangle *rects = ecore_x_window_shape_rectangles_get(cw->win, &(num)); + int w, h, i, px, py; + unsigned int *pix, *p; + unsigned char *spix, *sp; + + if (rects) + { + for (i = 0; i < cw->rects_num; i++) + { + E_RECTS_CLIP_TO_RECT(rects[i].x, + rects[i].y, + rects[i].width, + rects[i].height, + 0, 0, cw->pw, cw->ph); + } + } + + if (!_effect_obj_win_shaped_check(cw->pw, cw->ph, rects, num)) + { + if (rects) + free (rects); + rects = NULL; + } + + if (rects) + { + evas_object_image_size_get(o->img, &w, &h); + evas_object_image_alpha_set(o->img, 1); + pix = evas_object_image_data_get(o->img, 1); + + if (pix) + { + spix = calloc(w * h, sizeof(unsigned char)); + if (spix) + { + for (i = 0; i < num; i++) + { + int rx, ry, rw, rh; + + rx = rects[i].x; ry = rects[i].y; + rw = rects[i].width; rh = rects[i].height; + E_RECTS_CLIP_TO_RECT(rx, ry, rw, rh, 0, 0, w, h); + sp = spix + (w * ry) + rx; + for (py = 0; py < rh; py++) + { + for (px = 0; px < rw; px++) + { + *sp = 0xff; sp++; + } + sp += w - rw; + } + } + sp = spix; + p = pix; + for (py = 0; py < h; py++) + { + for (px = 0; px < w; px++) + { + unsigned int mask, imask; + mask = ((unsigned int)(*sp)) << 24; + imask = mask >> 8; + imask |= imask >> 8; + imask |= imask >> 8; + *p = mask | (*p & imask); + sp++; + p++; + } + } + free(spix); + } + evas_object_image_data_set(o->img, pix); + evas_object_image_data_update_add(o->img, 0, 0, w, h); + } + free (rects); + } + else + { + if (cw->shaped) + { + evas_object_image_size_get(o->img, &w, &h); + + evas_object_image_size_set(o->img, w, h); + evas_object_image_alpha_set(o->img, 0); + pix = evas_object_image_data_get(o->img, 1); + + if (pix) + { + p = pix; + for (py = 0; py < h; py++) + { + for (px = 0; px < w; px++) + *p |= 0xff000000; + } + } + evas_object_image_data_set(o->img, pix); + evas_object_image_data_update_add(o->img, 0, 0, w, h); + } + } +} + +static void +_effect_obj_effect_done(void *data, + Evas_Object *obj, + const char *emission __UNUSED__, + const char *source __UNUSED__) +{ + E_Comp_Effect_Object *o = data; + E_Comp_Layer *ly; + E_CHECK(o); + E_CHECK(obj); + + ly = evas_object_data_get(obj, "comp.effect_obj.ly"); + E_CHECK(ly); + + /* decrease effect count and hide effect layer if it is 0 */ + e_mod_comp_layer_effect_set(ly, EINA_FALSE); +} + +static void +_effect_policy_border_transient_for_group_make(E_Border *bd, + Eina_List **list) +{ + E_Border *child; + Eina_List *l; + + if (!bd) return; + + E_OBJECT_CHECK(bd); + E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); + + if (e_config->transient.raise) + { + EINA_LIST_FOREACH(bd->transients, l, child) + { + if (!child) continue; + if (!child->iconic) + { + *list = eina_list_prepend(*list, child); + _effect_policy_border_transient_for_group_make(child, list); + } + } + } +} + +static E_Border * +_effect_policy_border_transient_for_border_top_get(E_Border *bd) +{ + E_Border *top_border = NULL; + Eina_List *transient_list = NULL; + + _effect_policy_border_transient_for_group_make(bd, &transient_list); + + if (transient_list) + { + Eina_List *l = NULL; + E_Border *temp_bd; + E_Border *temp_bd2; + E_Border_List *bl; + + bl = e_container_border_list_last(bd->zone->container); + if (bl) + { + while ((temp_bd = e_container_border_list_prev(bl))) + { + if (top_border) break; + if (temp_bd == bd) break; + + EINA_LIST_FOREACH(transient_list, l, temp_bd2) + { + if (temp_bd == temp_bd2) + { + top_border = temp_bd2; + break; + } + } + } + e_container_border_list_free(bl); + } + } + + eina_list_free(transient_list); + + return top_border; +} + +static void +_effect_win_set(E_Comp_Win *cw, + const char *emission, + Eina_Bool send_ev, + Eina_Bool show, + Eina_Bool recreate) +{ + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + E_Comp_Effect_Object *o; + E_Comp_Effect_Object *o2 = NULL; + E_Comp_Effect_Object *o3 = NULL; + + canvas = eina_list_nth(cw->c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + if (ly) + { + o = _effect_mod_object_new(ly, cw, recreate); + if (o) + { + /* adjust the stack position of the given border to the above of + * parent if border belongs to parent using 'transient_for' + */ + if ((cw->bd) && (cw->bd->parent)) + { + E_Comp_Win *cw2 = e_mod_comp_win_find(cw->bd->parent->win); + if (cw2) + { + E_Border *top_border = NULL; + top_border = _effect_policy_border_transient_for_border_top_get(cw2->bd); + if (top_border) + { + E_Comp_Win *cw3 = e_mod_comp_border_client_find(top_border->client.win); + if (cw3) + o3 = _effect_obj_find(cw3); + } + o2 = _effect_obj_find(cw2); + + if (o3) + e_layout_child_raise_above(o->edje, o3->edje); + else if (o2) + e_layout_child_raise_above(o->edje, o2->edje); + } + } + + evas_object_show(o->img); + evas_object_show(o->edje); + _effect_mod_signal_add(NULL, o->edje, emission, "e"); +#if SEND_LAUNCHING_DONE + if ( strncmp(emission,"e,state,visible,on,",strlen("e,state,visible,on,")) == 0 ) + o->send_launching_done = 0; + else if ( strncmp(emission,"e,state,visible,on",strlen("e,state,visible,on")) == 0 ) + o->send_launching_done = 1; + else + o->send_launching_done = 0; +#endif + +#if USE_SHADOW + /* add shadow on floating mode window while doing effect */ + if (STATE_INSET_CHECK(cw)) + edje_object_signal_emit(o->edje, "e,state,shadow,on", "e"); +#endif + + if (send_ev) + { + o->ev_vis = send_ev; + o->show = show; + } + } + } +} + +static void +_effect_win_lower(E_Comp_Win *cw, + const char *emission, + Eina_Bool recreate) +{ + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + E_Comp_Effect_Object *o; + + canvas = eina_list_nth(cw->c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + + if (ly) + { + o = _effect_mod_object_new(ly, cw, recreate); + if (o) + { + evas_object_show(o->img); + evas_object_show(o->edje); + _effect_mod_signal_add(NULL, o->edje, emission, "e"); + + e_layout_child_lower(o->edje); + e_mod_comp_layer_bg_adjust(ly); + } + } +} + +static void +_effect_below_wins_set(E_Comp_Win *cw, + Eina_Bool recreate) +{ + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + E_Comp_Effect_Object *o; + Eina_Inlist *l; + E_Comp_Win *_cw = cw, *nocomp_cw = NULL; + E_Zone *zone; + char emission[64]; + Eina_Bool bg_noeffect = EINA_FALSE; + + _MAKE_EMISSION("e,state,visible,on,noeffect"); + if (TYPE_KEYBOARD_CHECK(cw) || + STATE_INSET_CHECK(cw) || + cw->argb) + bg_noeffect = EINA_TRUE; + + canvas = eina_list_nth(cw->c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + E_CHECK(ly); + + zone = canvas->zone; + E_CHECK(zone); + + nocomp_cw = e_mod_comp_util_win_nocomp_get(cw->c, zone); +#if USE_NOCOMP_DISPOSE + E_Comp_Win *nocomp_end_cw = e_mod_comp_util_win_nocomp_end_get(cw->c, zone); +#endif + + /* create effect objects until finding a non-alpha full-screen window */ + while ((l = EINA_INLIST_GET(_cw)->prev)) + { + _cw = _EINA_INLIST_CONTAINER(_cw, l); + + if (TYPE_HOME_CHECK(_cw) && !bg_noeffect) + _MAKE_EMISSION("e,state,background,visible,on"); + + if (!(_cw->visible)) continue; + if (_cw->invalid) continue; + if (_cw->input_only) continue; + if (!E_INTERSECTS_EFFECT(_cw, zone->x, zone->y, zone->w, zone->h)) + continue; + + /* if nocomp exist, change mode to the composite mode */ + if ((nocomp_cw) && (nocomp_cw == _cw)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(_cw), + "%15.15s| END EFFECT_OBJ_NEW", "NOCOMP"); + e_mod_comp_canvas_nocomp_end(canvas); + } +#if USE_NOCOMP_DISPOSE + else if ((nocomp_end_cw) && (nocomp_end_cw == _cw)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(_cw), + "%15.15s| ENDED EFFECT_OBJ_NEW", "NOCOMP"); + } +#endif + else if (!((_cw->pixmap) && + (_cw->pw > 0) && (_cw->ph > 0))) + { + continue; + } + + o = _effect_mod_object_new(ly, _cw, recreate); + if (o) + { + evas_object_show(o->img); + evas_object_show(o->edje); + _effect_mod_signal_add(NULL, o->edje, emission, "e"); + +#if USE_SHADOW + /* add shadow on floating mode window while doing effect */ + if (STATE_INSET_CHECK(_cw)) + edje_object_signal_emit(o->edje, "e,state,shadow,on", "e"); +#endif + + /* change the stack position of the object to the bottom + * of layer and also background object too + */ + e_layout_child_lower(o->edje); + e_mod_comp_layer_bg_adjust(ly); + } + + /* found a non-alpha full-screen window */ + if ((REGION_EQUAL_TO_ZONE(_cw, zone)) && !(_cw->argb)) + break; + } +} + +static void +_effect_below_floating_wins_set(E_Comp_Win *cw, + Eina_Bool show, + Eina_Bool recreate) +{ + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + E_Comp_Effect_Object *o; + Eina_Inlist *l; + E_Comp_Win *_cw = cw; + E_Zone *zone; + char emission[64]; + + canvas = eina_list_nth(cw->c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + E_CHECK(ly); + + zone = canvas->zone; + E_CHECK(zone); + + while ((l = EINA_INLIST_GET(_cw)->prev)) + { + _cw = _EINA_INLIST_CONTAINER(_cw, l); + + if (!(_cw->visible)) continue; + if ((REGION_EQUAL_TO_ZONE(_cw, zone)) && !(_cw->argb) && (!TYPE_VIDEO_CALL_CHECK(_cw))) break; + + _MAKE_EMISSION("e,state,visible,on,noeffect"); + + o = _effect_mod_object_new(ly, _cw, recreate); + if (o) + { + evas_object_show(o->img); + evas_object_show(o->edje); + _effect_mod_signal_add(NULL, o->edje, emission, "e"); +#if USE_SHADOW + edje_object_signal_emit(o->edje, "e,state,shadow,on", "e"); +#endif + + /* change the stack position of the object to the bottom + * of layer and also background object too + */ + e_layout_child_lower(o->edje); + e_mod_comp_layer_bg_adjust(ly); + } + + } +} + +static void +_effect_home_active_below_wins_set(E_Comp_Win *cw, + Eina_Bool show, + Eina_Bool recreate) +{ + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + E_Comp_Effect_Object *o; + Eina_Inlist *l; + E_Comp_Win *_cw = cw; + E_Zone *zone; + char emission[64]; + + canvas = eina_list_nth(cw->c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + E_CHECK(ly); + + zone = canvas->zone; + E_CHECK(zone); + + while ((l = EINA_INLIST_GET(_cw)->prev)) + { + _cw = _EINA_INLIST_CONTAINER(_cw, l); + + if (!(_cw->visible)) continue; + if (TYPE_HOME_CHECK(_cw)) break; + + if (STATE_INSET_CHECK(_cw)) + _MAKE_EMISSION("e,state,visible,on,noeffect"); + else + _MAKE_EMISSION("e,state,visible,off"); + + if (TYPE_VIDEO_CALL_CHECK(cw) && TYPE_VIDEO_CALL_CHECK(_cw)) + { + if (REGION_EQUAL_TO_ZONE(_cw, zone)) + _MAKE_EMISSION("e,state,visible,off"); + else + continue; + } + + o = _effect_mod_object_new(ly, _cw, recreate); + if (o) + { + evas_object_show(o->img); + evas_object_show(o->edje); + _effect_mod_signal_add(NULL, o->edje, emission, "e"); +#if USE_SHADOW + edje_object_signal_emit(o->edje, "e,state,shadow,on", "e"); +#endif + + /* change the stack position of the object to the bottom + * of layer and also background object too + */ + e_layout_child_lower(o->edje); + e_mod_comp_layer_bg_adjust(ly); + } + + if ((REGION_EQUAL_TO_ZONE(_cw, zone)) && !(_cw->argb) && (!TYPE_VIDEO_CALL_CHECK(_cw))) break; + } +} + +static void +_effect_above_wins_set(E_Comp_Win *cw, + Eina_Bool show, + Eina_Bool recreate) +{ + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + E_Comp_Effect_Object *o; + Eina_Inlist *l; + E_Comp_Win *_cw = cw; + E_Zone *zone; + char emission[64]; + E_Comp_Win *parent_cw = NULL; + + canvas = eina_list_nth(cw->c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + E_CHECK(ly); + + zone = canvas->zone; + E_CHECK(zone); + + while ((l = EINA_INLIST_GET(_cw)->next)) + { + _cw = _EINA_INLIST_CONTAINER(_cw, l); + if (!(_cw->visible)) continue; + if (_cw->invalid) continue; + if (_cw->input_only) continue; + if (!E_INTERSECTS_EFFECT(_cw, zone->x, zone->y, zone->w, zone->h)) + continue; + if (!((_cw->pixmap) && + (_cw->pw > 0) && (_cw->ph > 0))) + continue; + + if ((TYPE_KEYBOARD_SUB_CHECK(_cw)) && (!show)) continue; + + if ((REGION_EQUAL_TO_ZONE(_cw, zone)) && (!_cw->argb)) continue; + + if ((_cw->bd) && (_cw->bd->parent)) + { + parent_cw = e_mod_comp_win_find(_cw->bd->parent->win); + } + + if ((parent_cw) && (parent_cw == cw) && (!show)) + _MAKE_EMISSION("e,state,visible,off"); + else + _MAKE_EMISSION("e,state,visible,on,noeffect"); + + if ((TYPE_KEYBOARD_CHECK(_cw)) && (!show)) + { + if (cw->c->keyboard_effect && (!PARENT_FLOAT_CHECK(_cw))) + { + if (_effect_mod_win_angle_get(_cw)) + _MAKE_EMISSION("e,state,visible,off,angle,%d", _cw->angle); + else + _MAKE_EMISSION("e,state,visible,off,angle,0"); + } + else if (!cw->c->keyboard_effect) + continue; + } + + o = _effect_mod_object_new(ly, _cw, recreate); + if (o) + { + evas_object_show(o->img); + evas_object_show(o->edje); + _effect_mod_signal_add(NULL, o->edje, emission, "e"); + +#if USE_SHADOW + /* add shadow on floating mode window while doing effect */ + if (STATE_INSET_CHECK(_cw)) + edje_object_signal_emit(o->edje, "e,state,shadow,on", "e"); +#endif + } + } +} + +static E_Comp_Effect_Object * +_effect_object_control_layer_new(E_Comp_Layer *ly, E_Comp_Win *cw) +{ + E_Comp_Effect_Object *o = NULL; + int ok = 0; + + E_CHECK_RETURN(ly, NULL); + E_CHECK_RETURN(ly->canvas, NULL); + E_CHECK_RETURN(cw, NULL); + + E_Comp_Layer *effect_ly = e_mod_comp_canvas_layer_get(ly->canvas, "effect"); + E_CHECK_GOTO(effect_ly, fail); + + o = E_NEW(E_Comp_Effect_Object, 1); + E_CHECK_GOTO(o, fail); + + o->edje = edje_object_add(ly->canvas->evas); + E_CHECK_GOTO(o->edje, fail); + + e_mod_comp_layer_populate(effect_ly, o->edje); + + evas_object_data_set(o->edje, "comp.effect_obj.ly", effect_ly); + + E_Comp_Object *co = NULL; + const char *file = NULL, *group = NULL; + + co = eina_list_nth(cw->objs, 0); + E_CHECK_GOTO(co, fail); + + edje_object_file_get(co->shadow, &file, &group); + E_CHECK_GOTO(file, fail); + E_CHECK_GOTO(group, fail); + + ok = edje_object_file_set(o->edje, file, "no-effect"); + E_CHECK_GOTO(ok, fail); + + o->img = evas_object_image_filled_add(ly->canvas->evas); + E_CHECK_GOTO(o->img, fail); + + evas_object_image_source_set(o->img, ly->layout); + edje_object_part_swallow(o->edje, "e.swallow.content", o->img); + + e_layout_child_move(o->edje, ly->x, ly->y); + e_layout_child_resize(o->edje, ly->w, ly->h); + + evas_object_show(o->img); + evas_object_show(o->edje); + + edje_object_signal_callback_add(o->edje, "e,action,show,done", "e", _effect_obj_effect_done, o); + edje_object_signal_callback_add(o->edje, "e,action,hide,done", "e", _effect_obj_effect_done, o); + + o->win = 0; + o->cwin = 0; + + effect_ly->objs = eina_list_append(effect_ly->objs, o); + + return o; + +fail: + if (o) + { + if (o->img) evas_object_del(o->img); + + if (o->edje) + { + e_layout_unpack(o->edje); + evas_object_del(o->edje); + } + E_FREE(o); + } + return NULL; + + +} + + +static void +_effect_control_layer_set(E_Comp_Win *cw) +{ + E_Comp_Canvas *canvas = NULL; + E_Comp_Layer *ctrl_ly = NULL; + E_Comp_Layer *comp_ly = NULL; + Eina_Bool ctrl_visible; + Eina_List *lm = NULL; + Eina_List *l, *ll; + Evas_Object *member = NULL; + Evas_Object *active_shadow = NULL; + Eina_Bool find_ctrl_ly = EINA_FALSE; + E_Comp_Win *_cw; + E_Comp_Win *active_window = NULL; + E_Comp_Object *co; + char emission[64]; + + canvas = eina_list_nth(cw->c->canvases, 0); + ctrl_ly = e_mod_comp_canvas_layer_get(canvas, "ly-ctrl"); + E_CHECK(ctrl_ly); + + ctrl_visible = evas_object_visible_get(ctrl_ly->layout); + E_CHECK(ctrl_visible); + + comp_ly = e_mod_comp_canvas_layer_get(canvas, "comp"); + E_CHECK(comp_ly); + + lm = evas_object_smart_members_get(comp_ly->layout); + E_CHECK(lm); + + EINA_LIST_REVERSE_FOREACH(lm, ll, member) + { + if (member == ctrl_ly->layout) + { + find_ctrl_ly = EINA_TRUE; + continue; + } + if ((find_ctrl_ly) && (evas_object_visible_get(member))) + { + active_shadow = member; + break; + } + } + eina_list_free(lm); + E_CHECK(active_shadow); + + EINA_INLIST_REVERSE_FOREACH(cw->c->wins, _cw) + { + EINA_LIST_FOREACH(_cw->objs, l, co) + { + if (!co) continue; + if (co->shadow == active_shadow) + { + active_window = _cw; + break; + } + } + } + E_CHECK(active_window); + + E_Comp_Effect_Object *active_window_object = _effect_obj_find(active_window); + E_CHECK(active_window_object); + + E_Comp_Effect_Object *control_layer_object = _effect_object_control_layer_new(ctrl_ly, active_window); + E_CHECK(control_layer_object); + + _MAKE_EMISSION("e,state,visible,on,noeffect"); + _effect_mod_signal_add(NULL, control_layer_object->edje, emission, "e"); + + e_layout_child_raise_above(control_layer_object->edje, active_window_object->edje); +} + +static E_Comp_Effect_Object * +_effect_obj_find(E_Comp_Win *cw) +{ + E_Comp_Canvas *canvas = eina_list_nth(cw->c->canvases, 0); + E_CHECK_RETURN(canvas, NULL); + + E_Comp_Layer *ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + E_CHECK_RETURN(ly, NULL); + + Eina_List *l; + E_Comp_Effect_Object *o; + EINA_LIST_FOREACH(ly->objs, l, o) + { + if (!o) continue; + if (o->win == cw->win) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s| OBJ already exists!", "EFFECT"); + return o; + } + } + + return NULL; +} + +/* send_ev: indicates that comp sends the E_EVENT_COMP_SOURCE_VISIBILITY event + * when effect is done. show and hide effects will set this to true, but restack + * effect sets false. + */ +static Eina_Bool +_effect_show(E_Comp_Win *cw, + Eina_Bool send_ev) +{ + E_Comp_Effect_Style st; + char emission[64]; + E_Comp_Win *cw2 = NULL, *cw_below = NULL, *home_cw = NULL; + E_Comp_Effect_Object *o = NULL; + Eina_Bool launch, vis, res = EINA_FALSE; + Eina_Bool recreate = EINA_FALSE; + + E_CHECK_RETURN(cw, EINA_FALSE); + + o = _effect_obj_find(cw); + E_CHECK_RETURN(!o, EINA_FALSE); + + /* check effect condition and make emission string */ + st = _effect_mod_style_get(cw->eff_type, E_COMP_EFFECT_KIND_SHOW); + vis = e_mod_comp_util_win_visible_get(cw, EINA_TRUE); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|SHOW", "EFFECT"); + + if (E_COMP_EFFECT_STYLE_DEFAULT == st) + { + launch = e_mod_comp_policy_app_launch_check(cw); + if (launch) + { + home_cw = e_mod_comp_util_win_home_get(NULL); + + if ((cw->depth == 32) && (home_cw) && (_effect_obj_find(home_cw))) + { + cw2 = e_mod_comp_util_win_normal_get(NULL, EINA_TRUE); + if ((cw2) && (cw2 == cw)) + { + /* when 32bit window(Transient for) is resumed*/ + _effect_below_wins_set(cw, recreate); + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|>FG", "EFFECT"); + _MAKE_EMISSION("e,state,visible,on"); + _effect_win_set(cw, emission, send_ev, EINA_TRUE, recreate); + _effect_above_wins_set(cw, EINA_TRUE, recreate); + _effect_control_layer_set(cw); + res = EINA_TRUE; + } + else if ((cw2) && (cw2 != cw)) + { + /* when a stack of window lowered above 32bit window. */ + recreate = EINA_TRUE; + _MAKE_EMISSION("e,state,visible,on,noeffect"); + _effect_win_set(cw, emission, send_ev, EINA_TRUE, recreate); + + _MAKE_EMISSION("e,state,visible,off"); + _effect_win_set(cw2, emission, send_ev, EINA_TRUE, recreate); + + _effect_above_wins_set(cw, EINA_TRUE, recreate); + _effect_control_layer_set(cw); + res = EINA_TRUE; + } + } + else if (vis) + { + _effect_below_wins_set(cw, recreate); + + int full_child_count = 0; + E_Comp_Win *full_child_cw = NULL; + + if ((cw->bd) && (cw->bd->transients)) + { + E_Border *child_border = NULL; + E_Zone *zone = cw->bd->zone; + Eina_List *l; + + EINA_LIST_FOREACH(cw->bd->transients, l, child_border) + { + E_Comp_Win *child_cw = e_mod_comp_border_client_find(child_border->client.win); + if ((child_cw) && (zone)) + { + if ((zone) && (REGION_EQUAL_TO_ZONE(child_cw, zone))) + { + full_child_cw = child_cw; + full_child_count++; + } + } + } + } + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|>FG(Child : 0x%08x) A : %d", "EFFECT", + full_child_cw ? e_mod_comp_util_client_xid_get(full_child_cw): 0, + full_child_cw ? full_child_cw->argb : 0); + _MAKE_EMISSION("e,state,visible,on"); + if ((full_child_count == 1) && full_child_cw) + { + if (full_child_cw->argb) + { + _effect_win_set(cw, emission, send_ev, EINA_TRUE, recreate); + _effect_win_set(full_child_cw, emission, send_ev, EINA_TRUE, recreate); + } + else + _effect_win_set(full_child_cw, emission, send_ev, EINA_TRUE, recreate); + } + else + _effect_win_set(cw, emission, send_ev, EINA_TRUE, recreate); + _effect_above_wins_set(cw, EINA_TRUE, recreate); + _effect_control_layer_set(cw); + res = EINA_TRUE; + } + } + else if ((TYPE_KEYBOARD_CHECK(cw)) && (vis)) + { + if (cw->c->keyboard_effect) + { + _effect_below_wins_set(cw, recreate); + + E_Zone *zone = NULL; + if ((cw->bd) && (cw->bd->zone)) + zone = cw->bd->zone; + + if ((zone) && (zone->rot.block_count)) + _MAKE_EMISSION("e,state,visible,on,noeffect"); + else if (_effect_mod_win_angle_get(cw)) + _MAKE_EMISSION("e,state,window,angle,%d", cw->angle); + else + _MAKE_EMISSION("e,state,window,angle,0"); + + _effect_win_set(cw, emission, send_ev, EINA_TRUE, recreate); + _effect_above_wins_set(cw, EINA_TRUE, recreate); + _effect_control_layer_set(cw); + res = EINA_TRUE; + } + } + else if ((STATE_INSET_CHECK(cw)) && (vis)) + { + cw2 = e_mod_comp_util_win_normal_get(NULL, EINA_TRUE); + if ((cw2) && (cw2->depth == 32) && (_effect_obj_find(cw2))) + { + recreate = EINA_TRUE; + _MAKE_EMISSION("e,state,visible,on,noeffect"); + _effect_win_set(cw2, emission, EINA_FALSE, EINA_TRUE, EINA_TRUE); + } + + _effect_below_wins_set(cw, recreate); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|>FG", "EFFECT"); + + _MAKE_EMISSION("e,state,visible,on"); + _effect_win_set(cw, emission, send_ev, EINA_TRUE, recreate); + _effect_above_wins_set(cw, EINA_TRUE, recreate); + _effect_control_layer_set(cw); + res = EINA_TRUE; + } + /* in most cases, border show events of home window are generated + * by pressing the h/w home button. at that moment, home window + * is invisible thus the wm doesn't need to check visibility for + * home window. just make app closing effect except lock and + * setup wizard window. + */ + else if (TYPE_HOME_CHECK(cw) && (cw->activate)) + { + Eina_Bool animatable = EINA_FALSE; + /* app window hide effect by pressing the h/w home button */ + cw2 = e_mod_comp_util_win_normal_get(NULL, EINA_FALSE); + + if (cw2) + animatable = _effect_mod_state_get(cw2->eff_type); + + if (!animatable) + return EINA_FALSE; + + /* in case after hide effect proccessed already */ + if ((cw2) && (_effect_obj_find(cw2))) + return EINA_FALSE; + + if ((cw2) && (cw2->bd) && (_effect_active_except_bd_check(cw2->bd))) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw2), + "%15.15s|>BG HOME 0x%08x FG 0x%08x except_bd SKIP", "EFFECT", + e_mod_comp_util_client_xid_get(cw), + e_mod_comp_util_client_xid_get(cw2)); + return EINA_FALSE; + } + + /* In case of that Notification window show*/ + if ((cw2) && + (cw2->win_type == E_COMP_WIN_TYPE_NOTIFICATION)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw2), + "%15.15s|>BG HOME 0x%08x FG 0x%08x Notification SKIP", "EFFECT", + e_mod_comp_util_client_xid_get(cw), + e_mod_comp_util_client_xid_get(cw2)); + return EINA_FALSE; + } + + /* In case of that quickpanel window show*/ + if ((cw2) && + (cw2->win_type == E_COMP_WIN_TYPE_QUICKPANEL)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw2), + "%15.15s|>BG HOME 0x%08x FG 0x%08x quickpanel SKIP", "EFFECT", + e_mod_comp_util_client_xid_get(cw), + e_mod_comp_util_client_xid_get(cw2)); + return EINA_FALSE; + } + + /* In case of that no-effect 32bit windows show */ + if ((cw2) && + (cw2->win_type == E_COMP_WIN_TYPE_UTILITY)) + { + if (cw2->depth == 32) + return EINA_FALSE; + else + { + cw_below = e_mod_comp_util_win_below_get(cw2, EINA_FALSE, EINA_FALSE); + if ((cw_below) && (cw_below->depth == 32)) + return EINA_FALSE; + } + } + + /* In case of minimizing. */ + if ((cw2) && STATE_INSET_CHECK(cw2)) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw2), + "%15.15s|>BG HOME 0x%08x FG 0x%08x Minimize SKIP", "EFFECT", + e_mod_comp_util_client_xid_get(cw), + e_mod_comp_util_client_xid_get(cw2)); + return EINA_FALSE; + } + + /* In case of pressing home button when top normal window transients for floating window. */ + if ((cw2) && (PARENT_FLOAT_CHECK(cw2))) + { + cw2 = NULL; + } + + /* When top app window is stacked lower already. + * it is observed in case of a top window is 32bit windows. + */ + if ((cw2) && (cw2 == cw)) + { + cw_below = e_mod_comp_util_win_below_get(cw, EINA_FALSE, EINA_FALSE); + if ((cw_below) && (cw_below->depth == 32)) + cw2 = cw_below; + else + return EINA_FALSE; + } + if (cw2) + { + /* do nothing, if cw2 is such exceptional windows as lock + * and setup wizard window. this case usually happens when + * system is booting. (first show of the home window) + */ + res = e_mod_comp_policy_home_app_win_check(cw2); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|>BG HOME 0x%08x FG 0x%08x SKIP:%d", "EFFECT", + e_mod_comp_util_client_xid_get(cw), + e_mod_comp_util_client_xid_get(cw2), + !(res)); + + E_CHECK_RETURN(res, EINA_FALSE); + /* not enough to add effect to above wins. + * because it can be possible to stack cw2 above floating wins. + * typically, the case of that cw transients for any floating windows. + */ + _effect_home_active_below_wins_set(cw2, EINA_FALSE, recreate); + + _MAKE_EMISSION("e,state,visible,on,noeffect"); + _effect_win_lower(cw, emission, recreate); + + _MAKE_EMISSION("e,state,visible,off"); + _effect_win_set(cw2, emission, EINA_FALSE, EINA_FALSE, recreate); + + /* in order to show 'keyboard hide effect with 'app window hide effect', + * 'show' argument should be passed to false + */ + _effect_above_wins_set(cw2, EINA_FALSE, recreate); + _effect_control_layer_set(cw); + } + } + } + + return res; +} + +static Eina_Bool +_effect_hide(E_Comp_Win *cw, + Eina_Bool send_ev) +{ + E_Comp_Effect_Style st; + char emission[64]; + E_Comp_Win *cw2 = NULL, *home_cw = NULL; + E_Comp_Effect_Object *o = NULL; + Eina_Bool close, res = EINA_FALSE; + Eina_Bool recreate = EINA_FALSE; + + o = _effect_obj_find(cw); + + /* check effect condition and make emission string */ + st = _effect_mod_style_get(cw->eff_type, E_COMP_EFFECT_KIND_HIDE); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|HIDE", "EFFECT"); + + if (E_COMP_EFFECT_STYLE_DEFAULT == st) + { + close = e_mod_comp_policy_app_close_check(cw); + + if ((!close) && (o)) + return EINA_FALSE; + + if (close) + { + /* not enough to add effect to above wins. + * because it can be possible to stack cw above floating wins. + * typically, the case of that cw transients for any floating windows. + * when hide effect runs on a normal window, change to show only below floating windows not all below windows. + */ + _effect_below_floating_wins_set(cw, EINA_TRUE, recreate); + + /* background window */ + cw2 = e_mod_comp_util_win_normal_get(cw, EINA_TRUE); + + /* when 32bit window hides effect doesn't work, + * because there are effect object of the window already (home show effect). + * so it need to be handled exceptionally. + */ + if ((cw2) && (cw2->depth == 32) && (o)) + { + home_cw = e_mod_comp_util_win_home_get(cw); + if ((home_cw) && (_effect_obj_find(home_cw))) + { + recreate = EINA_TRUE; + _MAKE_EMISSION("e,state,visible,on,noeffect"); + _effect_win_set(cw2, emission, send_ev, EINA_FALSE, EINA_TRUE); + cw2 = NULL; + } + else + return EINA_FALSE; + } + else if(o) + return EINA_FALSE; + + if (cw2) + { + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|>BG 0x%08x", "EFFECT", + e_mod_comp_util_client_xid_get(cw2)); + + if (cw->argb) + _MAKE_EMISSION("e,state,visible,on,noeffect"); + else + _MAKE_EMISSION("e,state,background,visible,off"); + + _effect_win_lower(cw2, emission, recreate); + } + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|>FG", "EFFECT"); + + _MAKE_EMISSION("e,state,visible,off"); + _effect_win_set(cw, emission, send_ev, EINA_FALSE, recreate); + _effect_above_wins_set(cw, EINA_FALSE, recreate); + _effect_control_layer_set(cw); + + res = EINA_TRUE; + } + else if (TYPE_KEYBOARD_CHECK(cw)) + { + if (cw->c->keyboard_effect) + { + _effect_below_wins_set(cw, recreate); + + E_Zone *zone = NULL; + if ((cw->bd) && (cw->bd->zone)) + zone = cw->bd->zone; + + if ((zone) && (zone->rot.block_count)) + _MAKE_EMISSION("e,state,visible,off,noeffect"); + else if (_effect_mod_win_angle_get(cw)) + _MAKE_EMISSION("e,state,visible,off,angle,%d", cw->angle); + else + _MAKE_EMISSION("e,state,visible,off,angle,0"); + + _effect_win_set(cw, emission, send_ev, EINA_FALSE, recreate); + _effect_above_wins_set(cw, EINA_FALSE, recreate); + _effect_control_layer_set(cw); + + res = EINA_TRUE; + } + } + else if (STATE_INSET_CHECK(cw)) + { + _effect_below_wins_set(cw, recreate); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%15.15s|>FG", "EFFECT"); + + _MAKE_EMISSION("e,state,visible,off"); + _effect_win_set(cw, emission, send_ev, EINA_FALSE, recreate); + _effect_above_wins_set(cw, EINA_FALSE, recreate); + _effect_control_layer_set(cw); + } + } + + return res; +} + +static Eina_Bool +_effect_active_except_bd_check(E_Border *bd) +{ + const char *name = NULL; + const char *clas = NULL; + + if (!bd) return EINA_FALSE; + + name = bd->client.icccm.name; + clas = bd->client.icccm.class; + + if (!clas) return EINA_FALSE; + if (!name) return EINA_FALSE; + if (strncmp(clas,"setting_encrypting_menu", strlen("setting_encrypting_menu")) == 0) return EINA_TRUE; + if (strncmp(name,"com.samsung.setting.encrypting", strlen("com.samsung.setting.encrypting")) == 0) return EINA_TRUE; + + return EINA_FALSE; +} + +static void +_effect_home_active_unset(E_Comp_Win *cw) +{ + E_CHECK(cw); + E_CHECK(TYPE_HOME_CHECK(cw)); + E_CHECK(cw->c->animatable); + E_CHECK(cw->activate); + + ELBF(ELBT_COMP, 0, e_mod_comp_util_client_xid_get(cw), + "%s", "HOME ACTIVE Unset"); + + cw->activate = 0; +} diff --git a/src/effect/effect.h b/src/effect/effect.h new file mode 100644 index 0000000..c388fa1 --- /dev/null +++ b/src/effect/effect.h @@ -0,0 +1,38 @@ +#ifdef E_TYPEDEFS +#else +#ifndef EFFECT_H +#define EFFECT_H + +EAPI Eina_Bool e_mod_comp_effect_mod_init(E_Comp *c); +EAPI void e_mod_comp_effect_mod_shutdown(E_Comp *c); + +/* window effect type functions */ +E_Comp_Effect_Type *_effect_mod_type_new(void); +void _effect_mod_type_free(E_Comp_Effect_Type *type); +Eina_Bool _effect_mod_type_setup(E_Comp_Effect_Type *type, Ecore_X_Window win); +Eina_Bool _effect_mod_state_setup(E_Comp_Effect_Type *type, Ecore_X_Window win); +Eina_Bool _effect_mod_state_get(E_Comp_Effect_Type *type); +void _effect_mod_state_set(E_Comp_Effect_Type *type, Eina_Bool state); +Eina_Bool _effect_mod_style_setup(E_Comp_Effect_Type *type, Ecore_X_Window win); +E_Comp_Effect_Style _effect_mod_style_get(E_Comp_Effect_Type *type, E_Comp_Effect_Kind kind); + +/* window effect functions */ +void _effect_mod_win_show(E_Comp_Win *cw); +void _effect_mod_win_hide(E_Comp_Win *cw); +void _effect_mod_win_restack(E_Comp_Win *cw, Eina_Bool v1, Eina_Bool v2); + +Eina_Bool _effect_mod_signal_add(E_Comp_Win *cw, Evas_Object *o, const char *emission, const char *src); +Eina_Bool _effect_mod_signal_del(E_Comp_Win *cw, Evas_Object *obj, const char *name); +Eina_Bool _effect_mod_jobs_clean(E_Comp_Win *cw, Evas_Object *obj, const char *name); +Eina_Bool _effect_mod_signal_flush(void); +Eina_Bool _effect_mod_animating_set(E_Comp *c, E_Comp_Win *cw, Eina_Bool set); + +/* effect object functions */ +E_Comp_Effect_Object *_effect_mod_object_new(E_Comp_Layer *ly, E_Comp_Win *cw, Eina_Bool recreate); +void _effect_mod_object_free(E_Comp_Effect_Object *o); + +void _effect_mod_object_win_set(E_Comp_Win *cw, const char *emission); +void _effect_mod_above_wins_set(E_Comp_Win *cw, Eina_Bool show); + +#endif +#endif diff --git a/src/effect/effect_image_launch.c b/src/effect/effect_image_launch.c new file mode 100644 index 0000000..10ed651 --- /dev/null +++ b/src/effect/effect_image_launch.c @@ -0,0 +1,550 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" +#include "e_mod_comp_effect_image_launch.h" + +#include "effect.h" +#include "effect_image_launch.h" +#include "effect_win_rotation.h" + +#define FAKE_TABLE_PATH "/usr/share/themes/LaunchColorTable.xml" +#define APP_DEFINE_GROUP_NAME "effect" + +/* local subsystem functions */ +static void _show_done(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _hide_done(void *data, Evas_Object *obj, const char *emission, const char *source); +static Eina_Bool _launch_timeout(void *data); +/* local subsystem globals */ + +/* externally accessible functions */ +E_Comp_Effect_Image_Launch * +_effect_mod_image_launch_new(Evas *e, + int w, int h) +{ + E_Comp_Effect_Image_Launch *eff; + int ok = 0; + + E_Container *con; + E_Comp_Win *layers_cw = NULL; + Eina_List *ll; + E_Comp_Object *co; + int layer; + + E_CHECK_RETURN(e, NULL); + + eff = E_NEW(E_Comp_Effect_Image_Launch, 1); + E_CHECK_RETURN(eff, NULL); + + eff->shobj = edje_object_add(e); + E_CHECK_GOTO(eff->shobj, error); + + //get ecore_evas and save + Ecore_Evas *ee; + ee = ecore_evas_ecore_evas_get(e); + E_CHECK_GOTO(ee, error); + eff->ecore_evas = ee; + eff->evas = e; + + ok = edje_object_file_set + (eff->shobj, + _comp_mod->conf->shadow_file, + "fake_effect_fade"); + E_CHECK_GOTO(ok, error); + + eff->w = w; + eff->h = h; + + evas_object_move(eff->shobj, 0, 0); + evas_object_resize(eff->shobj, w, h); + + edje_object_signal_callback_add + (eff->shobj, "fake,action,hide,done", "fake", + _hide_done, eff); + + edje_object_signal_callback_add + (eff->shobj, "fake,action,show,done", "fake", + _show_done, eff); + + return eff; + +error: + _effect_mod_image_launch_free(eff); + return NULL; +} + +void +_effect_mod_image_launch_free(E_Comp_Effect_Image_Launch *eff) +{ + E_CHECK(eff); + if (eff->shobj) evas_object_del(eff->shobj); + if (eff->obj) evas_object_del(eff->obj); + E_FREE(eff); +} + +Eina_Bool +_effect_mod_image_launch_handler_message(Ecore_X_Event_Client_Message *ev) +{ + E_Comp_Effect_Image_Launch *eff; + E_Comp *c = NULL; + char *file = NULL; + + E_CHECK_RETURN(ev, 0); + + c = e_mod_comp_find(ev->win); + E_CHECK_RETURN(c, 0); + E_CHECK_RETURN(c->fake_image_launch, 0); + + eff = c->eff_img; + E_CHECK_RETURN(eff, 0); + + eff->file_type = ev->data.l[0]; //fake effect file type + eff->rot = ev->data.l[1]; //rotation value + eff->indicator_show = ev->data.l[2]; //indicator flag value + eff->theme_type = ev->data.l[3]; //fake effect theme type + + file = ecore_x_window_prop_string_get + (ev->win, ATOM_IMAGE_LAUNCH_FILE); + E_CHECK_RETURN(file, 0); + + ELBF(ELBT_COMP, 0, 0, + "%15.15s| type:%d, ROT:%d, Indi:%d, theme:%d", "FAKE SHOW", + eff->file_type, eff->rot, eff->indicator_show, eff->theme_type); + + ELBF(ELBT_COMP, 0, 0, + "%15.15s| File:%s", "FAKE SHOW", file); + + + _effect_mod_image_launch_show(eff, file); + E_FREE(file); + + return EINA_TRUE; +} + +Eina_Bool +_effect_mod_image_launch_show(E_Comp_Effect_Image_Launch *eff, + const char *file) +{ + E_Comp *c = e_mod_comp_util_get(); + E_Comp_Win *bg_cw = NULL; + Eina_Bool grabbed; + Evas_Load_Error err; + Eina_Bool res; + int img_w, img_h; + E_Comp_Canvas *canvas; + E_Comp_Layer *ly; + + E_CHECK_RETURN(eff, 0); + E_CHECK_RETURN(eff->evas, 0); + E_CHECK_RETURN(eff->ecore_evas, 0); + E_CHECK_RETURN(file, 0); + E_CHECK_RETURN(c, 0); + E_CHECK_RETURN(!(eff->running), 0); + + grabbed = e_mod_comp_util_grab_home_key_set(EINA_TRUE); + E_CHECK_RETURN(grabbed, 0); + + eff->running = EINA_TRUE; + + bg_cw = e_mod_comp_util_win_normal_get(NULL, EINA_TRUE); + if (bg_cw) + { + E_CHECK_GOTO(!TYPE_LOCKSCREEN_CHECK(bg_cw), error); + _effect_mod_object_win_set(bg_cw, "e,state,visible,on,noeffect"); + } + + if (eff->file_type == E_FAKE_EFFECT_FILE_TYPE_IMAGE) + { + eff->obj = evas_object_image_add(eff->evas); + E_CHECK_GOTO(eff->obj, error); + evas_object_image_file_set(eff->obj, file, NULL); + err = evas_object_image_load_error_get(eff->obj); + E_CHECK_GOTO(err == EVAS_LOAD_ERROR_NONE, error); + + evas_object_image_size_get(eff->obj, &(img_w), &(img_h)); + evas_object_image_fill_set(eff->obj, 0, 0, img_w, img_h); + evas_object_image_filled_set(eff->obj, EINA_TRUE); + evas_object_show(eff->obj); + } + else + { + char *path = NULL; + + if (file) + path = strtok(file, ":"); + E_CHECK_GOTO(path, error); + + eff->obj = edje_object_add(eff->evas); + E_CHECK_GOTO(eff->obj, error); + edje_object_file_set (eff->obj, path, APP_DEFINE_GROUP_NAME); + + evas_object_move(eff->obj, 0, 0); + evas_object_resize(eff->obj, eff->w, eff->h); + evas_object_show(eff->obj); + evas_object_lower(eff->obj); + } + + res = edje_object_part_swallow + (eff->shobj, "fake.swallow.content", eff->obj); + E_CHECK_GOTO(res, error); + + evas_object_show(eff->shobj); + + canvas = eina_list_nth(c->canvases, 0); + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + if (ly) + { + evas_object_data_set(eff->shobj, "comp.effect_obj.ly", ly); + e_mod_comp_layer_populate(ly, eff->shobj); + } + + if (bg_cw) + _effect_mod_above_wins_set(bg_cw, EINA_TRUE); + + eff->indicator_obj = ecore_evas_extn_plug_new(eff->ecore_evas); + E_CHECK_GOTO(eff->indicator_obj, error); + + if ((eff->rot == 0) || (eff->rot == 180))//portrait mode + { + e_layout_child_move(eff->shobj, 0, 0); + e_layout_child_resize(eff->shobj, eff->w, eff->h); + //get indicator object + if (eff->indicator_show) + { + if (!ecore_evas_extn_plug_connect(eff->indicator_obj, "elm_indicator_portrait", 0, EINA_FALSE)) + eff->indicator_show = 0; + } + } + else //landscape mode + { + e_layout_child_move(eff->shobj, (eff->w - eff->h)/2, (eff->h - eff->w)/2); + e_layout_child_resize(eff->shobj, eff->h, eff->w); + //get indicator object + if (eff->indicator_show) + { + if (!ecore_evas_extn_plug_connect(eff->indicator_obj, "elm_indicator_landscape", 0, EINA_FALSE)) + eff->indicator_show = 0; + } + } + + if (eff->indicator_show) + { + evas_object_show(eff->indicator_obj); + res = edje_object_part_swallow + (eff->shobj, "fake.swallow.indicator", eff->indicator_obj); + E_CHECK_GOTO(res, error); + } + + if (c->animatable) + { + switch (eff->rot) + { + case 90: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,90,on", "fake"); + break; + case 180: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,180,on", "fake"); + break; + case 270: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,270,on", "fake"); + break; + default: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,on", "fake"); + break; + } + } + else + { + switch (eff->rot) + { + case 90: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,90,on,noeffect", "fake"); + break; + case 180: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,180,on,noeffect", "fake"); + break; + case 270: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,270,on,noeffect", "fake"); + break; + default: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,on,noeffect", "fake"); + break; + } + } + eff->timeout = ecore_timer_add(20.0f, _launch_timeout, eff); + e_mod_comp_util_screen_input_region_set(EINA_TRUE); + + e_mod_comp_render_queue(c); + return EINA_TRUE; + +error: + eff->running = EINA_FALSE; + if (grabbed) + e_mod_comp_util_grab_home_key_set(EINA_FALSE); + return EINA_FALSE; +} + +Eina_Bool +_effect_mod_image_launch_hide(E_Comp_Effect_Image_Launch *eff) +{ + E_Comp *c = e_mod_comp_util_get(); + E_CHECK_RETURN(c, 0); + E_CHECK_RETURN(eff, 0); + + if (eff->timeout) + ecore_timer_del(eff->timeout); + eff->timeout = NULL; + + if (c->animatable) + { + switch (eff->rot) + { + case 90: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,90,off", "fake"); + break; + case 180: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,180,off", "fake"); + break; + case 270: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,270,off", "fake"); + break; + default: + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,off", "fake"); + break; + } + } + else + _effect_mod_signal_add + (NULL, eff->shobj, + "fake,state,visible,off,noeffect", "fake"); + + e_mod_comp_render_queue(c); + return EINA_TRUE; +} + +Eina_Bool +_effect_mod_image_launch_window_check(E_Comp_Effect_Image_Launch *eff, E_Comp_Win *cw) +{ + E_CHECK_RETURN(eff, 0); + E_CHECK_RETURN(eff->running, 0); + E_CHECK_RETURN(cw, 0); + E_CHECK_RETURN(cw->bd, 0); + + if ( REGION_EQUAL_TO_ROOT(cw) && TYPE_NORMAL_CHECK(cw)) + { + return EINA_TRUE; + } + else if ((e_config->use_tiled_desk_layout) && + (cw->bd->client.e.state.ly.support) && + TYPE_NORMAL_CHECK(cw)) + { + return EINA_TRUE; + } + return EINA_FALSE; +} + +Eina_Bool +_effect_mod_image_launch_running_check(E_Comp_Effect_Image_Launch *eff) +{ + E_CHECK_RETURN(eff, 0); + return eff->running; +} + +Eina_Bool +_effect_mod_image_launch_fake_show_done_check(E_Comp_Effect_Image_Launch *eff) +{ + E_CHECK_RETURN(eff, 0); + return eff->fake_image_show_done; +} + +Eina_Bool +_effect_mod_image_launch_window_set(E_Comp_Effect_Image_Launch *eff, + Ecore_X_Window w) +{ + E_CHECK_RETURN(eff, 0); + E_CHECK_RETURN(w, 0); + eff->win = w; + return EINA_TRUE; +} + +void +_effect_mod_image_launch_disable(E_Comp_Effect_Image_Launch *eff) +{ + E_CHECK(eff); + E_CHECK(eff->running); + + ELBF(ELBT_COMP, 0, 0, + "%15.15s|", "FAKE DISABLE"); + +#if SEND_LAUNCHING_DONE + if (eff->win) + { + E_Comp_Win *cw = NULL; + cw = e_mod_comp_win_find(eff->win); + if ((cw) && (cw->bd)) + { + ecore_x_client_message32_send (cw->bd->client.win, ATOM_WINDOW_LAUNCHING_EFFECT_DONE, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, 0, 0, 0, 0, 0); + e_msg_send("comp.message", "launching.done", cw->bd->client.win, NULL, NULL, NULL, NULL); + } + } +#endif + + eff->running = EINA_FALSE; + eff->fake_image_show_done= EINA_FALSE; + eff->win = 0; + + e_mod_comp_util_screen_input_region_set(EINA_FALSE); + e_mod_comp_util_grab_home_key_set(EINA_FALSE); + + E_Comp_Canvas *canvas = NULL; + E_Comp_Layer *ly = NULL; + + E_Comp *c = e_mod_comp_util_get(); + if (c) + { + e_mod_comp_win_shape_input_update(c); + canvas = eina_list_nth(c->canvases, 0); + } + + if (eff->timeout) + ecore_timer_del(eff->timeout); + eff->timeout = NULL; + + if (eff->indicator_show) + { + edje_object_part_unswallow(eff->shobj, eff->indicator_obj); + evas_object_hide(eff->indicator_obj); + evas_object_del(eff->indicator_obj); + eff->indicator_obj = NULL; + } + edje_object_part_unswallow(eff->shobj, eff->obj); + + evas_object_hide(eff->shobj); + evas_object_hide(eff->obj); + evas_object_del(eff->obj); + eff->obj = NULL; + + e_layout_unpack(eff->shobj); + + if (canvas) + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + + if (ly) + { + e_mod_comp_layer_effect_set(ly, EINA_FALSE); + evas_object_hide(ly->layout); + } + evas_object_data_del(eff->shobj, "comp.effect_obj.ly"); +} + +static void +_show_done(void *data, + Evas_Object *obj __UNUSED__, + const char *emission __UNUSED__, + const char *source __UNUSED__) +{ + E_Comp_Win *cw; + E_Comp_Effect_Image_Launch *eff; + eff = (E_Comp_Effect_Image_Launch *)data; + E_CHECK(eff); + + eff->fake_image_show_done = EINA_TRUE; + + E_CHECK(eff->win); + + cw = e_mod_comp_win_find(eff->win); + E_CHECK(cw); + + _effect_mod_signal_add + (cw, NULL, "e,state,visible,on,noeffect", "e"); + e_mod_comp_comp_event_src_visibility_send(cw); + _effect_mod_image_launch_disable(eff); + + e_mod_comp_win_render_queue(cw); +} + +static void +_hide_done(void *data, + Evas_Object *obj __UNUSED__, + const char *emission __UNUSED__, + const char *source __UNUSED__) +{ + E_Comp_Effect_Image_Launch *eff; + E_Comp_Canvas *canvas = NULL; + E_Comp_Layer *ly = NULL; + + E_Comp *c = e_mod_comp_util_get(); + + eff = (E_Comp_Effect_Image_Launch *)data; + E_CHECK(eff); + + e_mod_comp_util_screen_input_region_set(EINA_FALSE); + e_mod_comp_util_grab_home_key_set(EINA_FALSE); + + if (eff->indicator_show) + { + edje_object_part_unswallow(eff->shobj, eff->indicator_obj); + evas_object_hide(eff->indicator_obj); + eff->indicator_obj = NULL; + } + edje_object_part_unswallow(eff->shobj, eff->obj); + evas_object_hide(eff->shobj); + evas_object_hide(eff->obj); + eff->obj = NULL; + + e_layout_unpack(eff->shobj); + if (c) + { + e_mod_comp_win_shape_input_update(c); + canvas = eina_list_nth(c->canvases, 0); + } + + if (canvas) + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + + if (ly) + e_mod_comp_layer_effect_set(ly, EINA_FALSE); + + evas_object_data_del(eff->shobj, "comp.effect_obj.ly"); +} + +static Eina_Bool +_launch_timeout(void *data) +{ + E_Comp_Effect_Image_Launch *eff; + E_Comp *c = e_mod_comp_util_get(); + eff = (E_Comp_Effect_Image_Launch *)data; + + E_CHECK_RETURN(c, 0); + E_CHECK_RETURN(eff, 0); + + _effect_mod_image_launch_disable(eff); + e_mod_comp_render_queue(c); + + return EINA_FALSE; +} diff --git a/src/effect/effect_image_launch.h b/src/effect/effect_image_launch.h new file mode 100644 index 0000000..ff7171a --- /dev/null +++ b/src/effect/effect_image_launch.h @@ -0,0 +1,19 @@ +#ifdef E_TYPEDEFS +#else +#ifndef EFFECT_IMAGE_LAUNCH_H +#define EFFECT_IMAGE_LAUNCH_H + +/* image launch effect functions */ + E_Comp_Effect_Image_Launch *_effect_mod_image_launch_new(Evas *e, int w, int h); + void _effect_mod_image_launch_free(E_Comp_Effect_Image_Launch *eff); + Eina_Bool _effect_mod_image_launch_handler_message(Ecore_X_Event_Client_Message *ev); + Eina_Bool _effect_mod_image_launch_show(E_Comp_Effect_Image_Launch *eff, const char *file); + Eina_Bool _effect_mod_image_launch_hide(E_Comp_Effect_Image_Launch *eff); + Eina_Bool _effect_mod_image_launch_window_check(E_Comp_Effect_Image_Launch *eff, E_Comp_Win *cw); + Eina_Bool _effect_mod_image_launch_running_check(E_Comp_Effect_Image_Launch *eff); + Eina_Bool _effect_mod_image_launch_fake_show_done_check(E_Comp_Effect_Image_Launch *eff); + Eina_Bool _effect_mod_image_launch_window_set(E_Comp_Effect_Image_Launch *eff, Ecore_X_Window w); + void _effect_mod_image_launch_disable(E_Comp_Effect_Image_Launch *eff); + +#endif +#endif diff --git a/src/effect/effect_win_rotation.c b/src/effect/effect_win_rotation.c new file mode 100644 index 0000000..a6db668 --- /dev/null +++ b/src/effect/effect_win_rotation.c @@ -0,0 +1,753 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" +#include "e_mod_comp_effect_win_rotation.h" +#include + +#include "effect.h" +#include "effect_image_launch.h" +#include "effect_win_rotation.h" + +/* local subsystem functions */ +static void _on_trans_begin_end(void *data, Elm_Transit *transit __UNUSED__); +static void _on_trans_end_end(void *data, Elm_Transit *transit __UNUSED__); +static Eina_Bool _angle_get(E_Comp_Win *cw, int *req, int *curr); +static Eina_Bool _effect_zone_rot_bd_check(E_Border *bd); +static Elm_Transit_Effect *_effect_zone_rot_begin_new(E_Comp_Layer *ly, Eina_Bool xv_use); +static Elm_Transit_Effect *_effect_zone_rot_end_new(E_Comp_Layer *ly, E_Zone *zone, Eina_Bool xv_use); +static void _effect_zone_rot_begin_free(Elm_Transit_Effect *effect, Elm_Transit *transit); +static void _effect_zone_rot_end_free(Elm_Transit_Effect *effect, Elm_Transit *transit); +static void _effect_zone_rot_begin_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress); +static void _effect_zone_rot_end_op(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress); +static Eina_Bool _effect_zone_rot_clear(E_Comp_Effect_Zone_Rotation *zr); + +/* externally accessible functions */ +Eina_Bool +_effect_mod_win_angle_get(E_Comp_Win *cw) +{ + E_Comp_Effect_Style st; + int req_angle = -1; + int cur_angle = -1; + Eina_Bool res; + Ecore_X_Window win; + E_CHECK_RETURN(cw, 0); + + win = e_mod_comp_util_client_xid_get(cw); + st = _effect_mod_style_get + (cw->eff_type, + E_COMP_EFFECT_KIND_ROTATION); + + if (st == E_COMP_EFFECT_STYLE_NONE) + return EINA_FALSE; + + res = _angle_get(cw, &req_angle, &cur_angle); + if (!res) + return EINA_FALSE; + + cw->angle = cur_angle; + cw->angle %= 360; + + return EINA_TRUE; +} + +E_Comp_Effect_Zone_Rotation * +_effect_mod_zone_rotation_new(E_Comp_Canvas *canvas) +{ + E_Comp_Effect_Zone_Rotation *zr = NULL; + zr = E_NEW(E_Comp_Effect_Zone_Rotation, 1); + E_CHECK_RETURN(zr, NULL); + + zr->canvas = canvas; + memset(canvas->xv_ready, 0, sizeof(canvas->xv_ready)); + + return zr; +} + +void +_effect_mod_zone_rotation_free(E_Comp_Effect_Zone_Rotation *zr) +{ + E_FREE(zr); +} + +Eina_Bool +_effect_mod_zone_rotation_begin(E_Comp_Effect_Zone_Rotation *zr) +{ + E_Comp_Layer *ly; + E_Comp *c = e_mod_comp_util_get(); + + e_mod_comp_util_rr_prop_set(ATOM_RR_WM_STATE, "wm.zone.rotation.begin"); + + E_CHECK_GOTO(c->animatable, finish); + + E_Comp_Win *cw = NULL, *nocomp_cw = NULL; + E_Zone *zone = NULL; + E_Comp_Canvas *canvas = NULL; + + Eina_Bool res = EINA_FALSE; + + Ecore_X_Window root = c->man->root; + int xv_prop_res = -1; + unsigned int xv_use = 0; + + canvas = zr->canvas; + + zone = zr->canvas->zone; + E_CHECK_GOTO(zone, finish); + + /* find nocomp window first because nocomp window doesn't have pixmap */ + nocomp_cw = e_mod_comp_util_win_nocomp_get(c, zone); + + /* Check whether or not it will do xv rotation effect. */ + xv_prop_res = ecore_x_window_prop_card32_get(root, ATOM_XV_USE, &xv_use, 1); + if ((xv_prop_res == -1 ) || (!xv_use)) + { + zr->xv_use = EINA_FALSE; + canvas->xv_ready[0] = EINA_FALSE; + } + else + { + if (!_comp_mod->conf->xv_rotation_effect) + { + zr->xv_use = EINA_FALSE; + canvas->xv_ready[0] = EINA_FALSE; + goto finish; + } + } + + /* if it is first entering to effect begin route and xv is running, + * rotation effect is canceled at first and waits until xv pass pixmap0. + */ + if ((!zr->xv_use) && (xv_prop_res >= 0) && (xv_use)) + { + Ecore_X_Pixmap pix0 = 0, pix1 = 0; + zr->xv_use = EINA_TRUE; + zr->canvas->xv_ready[0] = EINA_TRUE; + + pix0 = ecore_x_pixmap_new(root, zone->w, zone->h, 24); + ecore_x_window_prop_xid_set(root, ATOM_XV_PIXMAP0, ECORE_X_ATOM_PIXMAP, &pix0, 1); + + pix1 = ecore_x_pixmap_new(root, zone->w, zone->h, 24); + ecore_x_window_prop_xid_set(root, ATOM_XV_PIXMAP1, ECORE_X_ATOM_PIXMAP, &pix1, 1); + + ecore_x_client_message32_send(root, + ATOM_XV_BYPASS_TO_PIXMAP0, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, + root, 0, 0, 0, 0); + + ecore_x_client_message32_send(root, + ATOM_XV_BYPASS_TO_PIXMAP1, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, + root, 0, 0, 0, 0); + + goto finish; + } + + if (_effect_mod_image_launch_running_check(c->eff_img)) + goto finish; + + /* look for visible normal window except for given window */ + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + if ((cw->invalid) || (cw->input_only)) continue; + if (!cw->bd) continue; + if (!cw->bd->zone) continue; + if (cw->bd->zone != zone) continue; + if (!E_INTERSECTS(zone->x, zone->y, zone->w, zone->h, + cw->x, cw->y, cw->w, cw->h)) + continue; + + /* return nocomp window */ + if ((nocomp_cw) && (nocomp_cw == cw)) + { + if (TYPE_LOCKSCREEN_CHECK(cw)) + { + ELB(ELBT_COMP, "SKIP LOCKSCREEN", e_mod_comp_util_client_xid_get(cw)); + goto finish; + } + else + { + if (cw->bd) + { + res = _effect_zone_rot_bd_check(cw->bd); + E_CHECK_GOTO(res, finish); + } + + Eina_Bool animatable = EINA_FALSE; + animatable = _effect_mod_state_get(cw->eff_type); + E_CHECK_GOTO(animatable, finish); + break; /* do rotation effect */ + } + } + + /* check pixmap and compare size with zone */ + if (!((cw->pixmap) && (cw->pw > 0) && (cw->ph > 0) && + (cw->dmg_updates >= 1))) + continue; + + if (REGION_EQUAL_TO_ZONE(cw, zone)) + { + if (cw->argb) + { + /* except the lock screen window */ + if (TYPE_LOCKSCREEN_CHECK(cw)) + { + ELB(ELBT_COMP, "SKIP LOCKSCREEN", e_mod_comp_util_client_xid_get(cw)); + goto finish; + } + else + { + if (cw->bd) + { + res = _effect_zone_rot_bd_check(cw->bd); + E_CHECK_GOTO(res, finish); + } + else + continue; + } + } + else + { + if (cw->bd) + { + res = _effect_zone_rot_bd_check(cw->bd); + E_CHECK_GOTO(res, finish); + } + + Eina_Bool animatable = EINA_FALSE; + animatable = _effect_mod_state_get(cw->eff_type); + E_CHECK_GOTO(animatable, finish); + break; /* do rotation effect */ + } + } + else + { + /* block effect of desk layout */ + if ((cw->bd) && + (cw->bd->client.e.state.ly.support) && + (cw->bd->client.e.state.ly.curr_ly)) + { + goto finish; + } + } + } + + ly = e_mod_comp_canvas_layer_get(zr->canvas, "effect"); + if (ly) + { + /* TODO: check animation is running */ + if (zr->trans_begin) + { + elm_transit_del_cb_set(zr->trans_begin, NULL, NULL); + elm_transit_del(zr->trans_begin); + } + if (zr->trans_end) + { + elm_transit_del_cb_set(zr->trans_end, NULL, NULL); + elm_transit_del(zr->trans_end); + } + zr->trans_begin = NULL; + zr->trans_end = NULL; + zr->trans_begin = elm_transit_add(); + elm_transit_del_cb_set(zr->trans_begin, _on_trans_begin_end, zr); + + zr->effect_begin = _effect_zone_rot_begin_new(ly, zr->xv_use); + if (!zr->effect_begin) + { + if (zr->trans_begin) + { + elm_transit_del_cb_set(zr->trans_begin, NULL, NULL); + elm_transit_del(zr->trans_begin); + } + zr->trans_begin = NULL; + zr->ready = EINA_FALSE; + zr->xv_use = EINA_FALSE; + goto finish; + } + elm_transit_object_add(zr->trans_begin, ly->layout); + elm_transit_smooth_set(zr->trans_begin, EINA_FALSE); + elm_transit_duration_set(zr->trans_begin, 0.2f); + elm_transit_effect_add(zr->trans_begin, _effect_zone_rot_begin_op, zr->effect_begin, _effect_zone_rot_begin_free); + elm_transit_tween_mode_set(zr->trans_begin, ELM_TRANSIT_TWEEN_MODE_DECELERATE); + elm_transit_objects_final_state_keep_set(zr->trans_begin, EINA_FALSE); + + e_mod_comp_layer_effect_set(ly, EINA_TRUE); + + if (_comp_mod->conf->use_hwc) + { + if (canvas->comp->hwcomp_funcs.set_full_composite) + canvas->comp->hwcomp_funcs.set_full_composite(canvas->hwcomp); + if (canvas->comp->hwcomp_funcs.update_null_set_drawables) + canvas->comp->hwcomp_funcs.update_null_set_drawables(canvas->hwcomp); + } + + zr->ready = EINA_TRUE; + } + + return EINA_TRUE; + +finish: + e_mod_comp_util_rr_prop_set(ATOM_RR_WM_STATE, "wm.effect.rotation.cancel"); + return EINA_FALSE; +} + +Eina_Bool +_effect_mod_zone_rotation_end(E_Comp_Effect_Zone_Rotation *zr) +{ + E_Comp_Layer *ly; + E_Comp *c = e_mod_comp_util_get(); + Eina_Bool xv_use = EINA_FALSE; + + e_mod_comp_util_rr_prop_set(ATOM_RR_WM_STATE, "wm.zone.rotation.end"); + + E_CHECK_RETURN(c->animatable, EINA_FALSE); + + if ((!zr->ready) || (!zr->trans_begin)) + { + zr->canvas->xv_ready[0] = EINA_FALSE; + return EINA_FALSE; + } + + if ((zr->canvas->xv_ready[0]) && (!((zr->canvas->xv_ready[1]) && (zr->canvas->xv_ready[2])))) + return EINA_FALSE; + + zr->ready = EINA_FALSE; + xv_use = zr->xv_use; + zr->xv_use = EINA_FALSE; + memset(zr->canvas->xv_ready, 0, sizeof(zr->canvas->xv_ready)); + + ly = e_mod_comp_canvas_layer_get(zr->canvas, "comp"); + if (ly) + { + if (zr->trans_end) + { + elm_transit_del_cb_set(zr->trans_end, NULL, NULL); + elm_transit_del(zr->trans_end); + } + zr->trans_end = NULL; + zr->trans_end = elm_transit_add(); + elm_transit_del_cb_set(zr->trans_end, _on_trans_end_end, zr); + zr->effect_end = _effect_zone_rot_end_new(ly, zr->canvas->zone, xv_use); + elm_transit_object_add(zr->trans_end, ly->layout); + elm_transit_smooth_set(zr->trans_end, EINA_FALSE); + elm_transit_duration_set(zr->trans_end, 0.2f); + elm_transit_effect_add(zr->trans_end, _effect_zone_rot_end_op, zr->effect_end, _effect_zone_rot_end_free); + elm_transit_tween_mode_set(zr->trans_end, ELM_TRANSIT_TWEEN_MODE_DECELERATE); + elm_transit_objects_final_state_keep_set(zr->trans_end, EINA_FALSE); + + e_zone_rotation_block_set(zr->canvas->zone, "comp-tizen", EINA_TRUE); + + return EINA_TRUE; + } + + return EINA_FALSE; +} + +Eina_Bool +_effect_mod_zone_rotation_cancel(E_Comp_Effect_Zone_Rotation *zr) +{ + e_mod_comp_util_rr_prop_set(ATOM_RR_WM_STATE, "wm.zone.rotation.cancel"); + return _effect_zone_rot_clear(zr); +} + +Eina_Bool +_effect_mod_zone_rotation_do(E_Comp_Effect_Zone_Rotation *zr) +{ + E_Comp *c = e_mod_comp_util_get(); + E_CHECK_RETURN(c->animatable, EINA_FALSE); + + e_mod_comp_util_rr_prop_set(ATOM_RR_WM_STATE, "wm.effect.rotation.start"); + + elm_transit_go(zr->trans_begin); + elm_transit_go(zr->trans_end); + + return EINA_TRUE; +} + +Eina_Bool +_effect_mod_zone_rotation_clear(E_Comp_Effect_Zone_Rotation *zr) +{ + e_mod_comp_util_rr_prop_set(ATOM_RR_WM_STATE, "wm.effect.rotation.cancel"); + return _effect_zone_rot_clear(zr); +} + +static Eina_Bool +_effect_zone_rot_clear(E_Comp_Effect_Zone_Rotation *zr) +{ + if (zr->trans_begin) + { + elm_transit_del_cb_set(zr->trans_begin, NULL, NULL); + elm_transit_del(zr->trans_begin); + zr->trans_begin = NULL; + } + if (zr->trans_end) + { + elm_transit_del_cb_set(zr->trans_end, NULL, NULL); + elm_transit_del(zr->trans_end); + zr->trans_end = NULL; + } + zr->ready = EINA_FALSE; + zr->xv_use = EINA_FALSE; + + return EINA_TRUE; +} + +static void +_on_trans_begin_end(void *data, + Elm_Transit *transit __UNUSED__) +{ + E_Comp_Effect_Zone_Rotation *zr = data; + zr->trans_begin = NULL; + if (zr->trans_begin) + { + elm_transit_del_cb_set(zr->trans_begin, NULL, NULL); + zr->trans_begin = NULL; + } +} + +static void +_on_trans_end_end(void *data, + Elm_Transit *transit __UNUSED__) +{ + E_Comp_Effect_Zone_Rotation *zr = data; + if (zr->trans_end) + { + elm_transit_del_cb_set(zr->trans_end, NULL, NULL); + zr->trans_end = NULL; + } +} + +/* local subsystem functions */ +static Eina_Bool +_angle_get(E_Comp_Win *cw, + int *req, + int *curr) +{ + E_CHECK_RETURN(cw->bd, 0); + E_CHECK_RETURN(req, 0); + E_CHECK_RETURN(curr, 0); + + *req = e_border_rotation_prev_angle_get(cw->bd); + *curr = e_border_rotation_curr_angle_get(cw->bd); + + return EINA_TRUE; +} + +/* check before running rotation effect for given normal window. + * exceptional windows: lock, setup wizard + * otherwise: do rotation effect + */ +static Eina_Bool +_effect_zone_rot_bd_check(E_Border *bd) +{ + /* except window which does not use the wm rotation */ + if (!bd->client.e.state.rot.app_set) + { + ELB(ELBT_COMP, "SKIP ROT_EFFECT app_set:0", bd->client.win); + return EINA_FALSE; + } + /* except window which has the value of preferred rotation */ + else if (bd->client.e.state.rot.preferred_rot != -1) + { + ELB(ELBT_COMP, "SKIP ROT_EFFECT preferred_rot", bd->client.win); + return EINA_FALSE; + } + + return EINA_TRUE; +} + + +static Elm_Transit_Effect * +_effect_zone_rot_begin_new(E_Comp_Layer *ly, + Eina_Bool xv_use) +{ + E_Comp_Zone_Rotation_Effect_Begin *ctx= E_NEW(E_Comp_Zone_Rotation_Effect_Begin, 1); + E_CHECK_RETURN(ctx, NULL); + + Evas_Native_Surface ns; + + E_Zone *zone = ly->canvas->zone; + + /* capture the screen */ + Ecore_X_Window_Attributes att; + Ecore_X_Window root = ecore_x_window_root_first_get(); + memset((&att), 0, sizeof(Ecore_X_Window_Attributes)); + if (!ecore_x_window_attributes_get(root, &att)) + { + E_FREE(ctx); + return NULL; + } + + ctx->xim = ecore_x_image_new(zone->w, zone->h, att.visual, att.depth); + if (!ctx->xim) + { + E_FREE(ctx); + return NULL; + } + + unsigned int *pix = ecore_x_image_data_get(ctx->xim, NULL, NULL, NULL);; + ELBF(ELBT_COMP, 0, 0, "%15.15s|root:0x%08x vis:%p depth:%d xim:%p pix:%p", "ZONE_ROT_B_NEW", + root, att.visual, att.depth, ctx->xim, pix); + + ctx->img = evas_object_image_filled_add(evas_object_evas_get(ly->layout)); + evas_object_image_colorspace_set(ctx->img, EVAS_COLORSPACE_ARGB8888); + evas_object_image_alpha_set(ctx->img, 1); + evas_object_render_op_set(ctx->img, EVAS_RENDER_COPY); + evas_object_image_size_set(ctx->img, zone->w, zone->h); + evas_object_image_smooth_scale_set(ctx->img, EINA_FALSE); + evas_object_image_data_set(ctx->img, pix); + evas_object_image_data_update_add(ctx->img, 0, 0, zone->w, zone->h); + + // why do we neeed these 2? this smells wrong + if (ecore_x_image_get(ctx->xim, root, 0, 0, 0, 0, zone->w, zone->h)) + { + pix = ecore_x_image_data_get(ctx->xim, NULL, NULL, NULL);; + evas_object_image_data_set(ctx->img, pix); + evas_object_image_data_update_add(ctx->img, 0, 0, zone->w, zone->h); + } + + if (xv_use) + { + int ret = -1; + int pw = 0, ph = 0; + ctx->xv_pix = 0; + + ret = ecore_x_window_prop_xid_get(root, ATOM_XV_PIXMAP0, ECORE_X_ATOM_PIXMAP, &ctx->xv_pix, 1); + + if (ret < 0) + ctx->xv_pix = ecore_x_pixmap_new(root, zone->w, zone->h, 32); + + ecore_x_pixmap_geometry_get(ctx->xv_pix, NULL, NULL, &pw, &ph); + + ns.version = EVAS_NATIVE_SURFACE_VERSION; + ns.type = EVAS_NATIVE_SURFACE_X11; + ns.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get()); + ns.data.x11.pixmap = ctx->xv_pix; + + ctx->xv_img = evas_object_image_filled_add(ly->canvas->evas); + evas_object_image_size_set(ctx->xv_img, pw, ph); + evas_object_image_smooth_scale_set(ctx->xv_img, EINA_FALSE); + evas_object_image_native_surface_set(ctx->xv_img, &ns); + evas_object_image_data_update_add(ctx->xv_img, 0, 0, zone->w, zone->h); + + evas_object_show(ctx->xv_img); + + e_layout_pack(ly->layout, ctx->xv_img); + e_layout_child_move(ctx->xv_img, 0, 0); + e_layout_child_resize(ctx->xv_img, zone->w, zone->h); + } + + evas_object_show(ctx->img); + + e_mod_comp_layer_populate(ly, ctx->img); + e_layout_child_move(ctx->img, 0, 0); + e_layout_child_resize(ctx->img, zone->w, zone->h); + + ctx->o = ly->layout; + ctx->zone = ly->canvas->zone; + ctx->ly = ly; + + int diff = zone->rot.prev - zone->rot.curr; + if (diff == 270) diff = -90; + else if (diff == -270) diff = 90; + ctx->src = 0.0; + ctx->target = diff; + ELBF(ELBT_COMP, 0, 0, "%15.15s|%d->%d pix:%p", "ZONE_ROT_B_NEW", zone->rot.prev, zone->rot.curr, pix); + return ctx; +} + +static Elm_Transit_Effect * +_effect_zone_rot_end_new(E_Comp_Layer *ly, + E_Zone *zone, + Eina_Bool xv_use) +{ + E_Comp_Zone_Rotation_Effect_End *ctx= E_NEW(E_Comp_Zone_Rotation_Effect_End, 1); + E_CHECK_RETURN(ctx, NULL); + + Evas_Native_Surface ns; + + Ecore_X_Window root = ecore_x_window_root_first_get(); + + if (xv_use) + { + int ret = -1; + ctx->xv_pix = 0; + + ret = ecore_x_window_prop_xid_get(root, ATOM_XV_PIXMAP1, ECORE_X_ATOM_PIXMAP, &ctx->xv_pix, 1); + + if (ret < 0) + ctx->xv_pix = ecore_x_pixmap_new(root, zone->w, zone->h, 24); + + ns.version = EVAS_NATIVE_SURFACE_VERSION; + ns.type = EVAS_NATIVE_SURFACE_X11; + ns.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get()); + ns.data.x11.pixmap = ctx->xv_pix; + + ctx->xv_img = evas_object_image_filled_add(evas_object_evas_get(ly->layout)); + evas_object_image_size_set(ctx->xv_img, zone->w, zone->h); + evas_object_image_smooth_scale_set(ctx->xv_img, EINA_FALSE); + evas_object_image_native_surface_set(ctx->xv_img, &ns); + evas_object_image_data_update_add(ctx->xv_img, 0, 0, zone->w, zone->h); + +// evas_object_show(ctx->xv_img); + + e_layout_pack(ly->layout, ctx->xv_img); + e_layout_child_move(ctx->xv_img, 0, 0); + e_layout_child_resize(ctx->xv_img, zone->w, zone->h); + + ctx->send_msg = EINA_TRUE; + } + + ctx->o = ly->layout; + ctx->zone = zone; + int diff = zone->rot.curr - zone->rot.prev; + if (diff == 270) diff = -90; + else if (diff == -270) diff = 90; + ctx->src = diff; + ctx->target = 0.0; + ELBF(ELBT_COMP, 0, 0, "%15.15s|%d->%d", "ZONE_ROTATION_EFFECT_END_NEW", zone->rot.prev, zone->rot.curr); + return ctx; +} + +static void +_effect_zone_rot_begin_free(Elm_Transit_Effect *effect, + Elm_Transit *transit) +{ + E_Comp_Zone_Rotation_Effect_Begin *ctx = (E_Comp_Zone_Rotation_Effect_Begin *)effect; + if (ctx->xim) ecore_x_image_free(ctx->xim); + if (ctx->xv_img) + { + evas_object_image_native_surface_set(ctx->xv_img, NULL); + evas_object_image_size_set(ctx->xv_img, 1, 1); + evas_object_image_data_set(ctx->xv_img, NULL); + + if (ctx->xv_pix) + { + ecore_x_pixmap_free(ctx->xv_pix); + ctx->xv_pix = 0; + } + + evas_object_hide(ctx->xv_img); + e_layout_unpack(ctx->xv_img); + evas_object_del(ctx->xv_img); + ctx->xv_img = NULL; + } + if (ctx->img) + { + evas_object_hide(ctx->img); + e_layout_unpack(ctx->img); + evas_object_del(ctx->img); + ctx->img = NULL; + } + + //evas_object_color_set(ctx->o, 255, 255, 255, 255); + + e_mod_comp_layer_effect_set(ctx->ly, EINA_FALSE); + + E_FREE(ctx); +} + +static void +_effect_zone_rot_end_free(Elm_Transit_Effect *effect, + Elm_Transit *transit) +{ + E_Comp_Zone_Rotation_Effect_End *ctx = (E_Comp_Zone_Rotation_Effect_End *)effect; + e_zone_rotation_block_set(ctx->zone, "comp-tizen", EINA_FALSE); + evas_object_color_set(ctx->o, 255, 255, 255, 255); + + if (ctx->xv_img) + { + evas_object_image_native_surface_set(ctx->xv_img, NULL); + evas_object_image_size_set(ctx->xv_img, 1, 1); + evas_object_image_data_set(ctx->xv_img, NULL); + + if (ctx->xv_pix) + { + ecore_x_pixmap_free(ctx->xv_pix); + ctx->xv_pix = 0; + } + + evas_object_hide(ctx->xv_img); + e_layout_unpack(ctx->xv_img); + evas_object_del(ctx->xv_img); + ctx->xv_img = NULL; + } + + if (ctx->send_msg) + { + ecore_x_client_message32_send(ecore_x_window_root_first_get(), + ATOM_XV_ROT_EFFECT_DONE, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, + ecore_x_window_root_first_get(), 0, 0, 0, 0); + } + + e_mod_comp_util_rr_prop_set(ATOM_RR_WM_STATE, "wm.effect.rotation.finish"); + + ELBF(ELBT_COMP, 0, 0, "%15.15s|", "ZONE_ROTATION_EFFECT_END_FREE"); + E_FREE(ctx); +} + +static void +_effect_zone_rot_begin_op(Elm_Transit_Effect *effect, + Elm_Transit *transit, + double progress) +{ + E_Comp_Zone_Rotation_Effect_Begin *ctx = (E_Comp_Zone_Rotation_Effect_Begin *)effect; + if (progress < 0.0) progress = 0.0; + double curr = (progress * ctx->target); + Evas_Coord x, y, w, h; + + double col = 255 - (255 * progress); + if (col <= 0) col = 0; + + evas_object_geometry_get(ctx->o, &x, &y, &w, &h); + + Evas_Map *m = evas_map_new(4); + evas_map_util_points_populate_from_object(m, ctx->o); + evas_map_util_rotate(m, curr, x + (w/2), y + (h/2)); + evas_map_alpha_set(m, EINA_TRUE); + evas_map_util_points_color_set(m, col, col, col, col); + evas_object_map_set(ctx->o, m); + evas_object_map_enable_set(ctx->o, EINA_TRUE); + evas_map_free(m); + + /* to notify beginning of xv rotation effect */ + if ((ctx->xv_img) && (!ctx->init) && (progress >= 0.1)) + { + E_Comp *c = e_mod_comp_util_get(); + ecore_x_client_message32_send(c->man->root, + ATOM_XV_ROT_EFFECT_BEGIN, + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, + c->man->root, 0, 0, 0, 0); + ctx->init = EINA_TRUE; + } + + +} + +static void +_effect_zone_rot_end_op(Elm_Transit_Effect *effect, + Elm_Transit *transit, + double progress) +{ + E_Comp_Zone_Rotation_Effect_End *ctx = (E_Comp_Zone_Rotation_Effect_End *)effect; + if (progress < 0.0) progress = 0.0; + double curr = ((-1.0f * progress * ctx->src) + ctx->src); + Evas_Coord x, y, w, h; + + evas_object_geometry_get(ctx->o, &x, &y, &w, &h); + + Evas_Map *m = evas_map_new(4); + evas_map_util_points_populate_from_object(m, ctx->o); + evas_map_util_rotate(m, curr, x + (w/2), y + (h/2)); + evas_object_map_set(ctx->o, m); + evas_object_map_enable_set(ctx->o, EINA_TRUE); + evas_map_free(m); + + /* to avoid exposing "comp" layer before rotation effect running */ + if ((ctx->xv_img) && (!ctx->init) && (progress >= 0.1)) + { + evas_object_show(ctx->xv_img); + ctx->init = EINA_TRUE; + } +} diff --git a/src/effect/effect_win_rotation.h b/src/effect/effect_win_rotation.h new file mode 100644 index 0000000..4dd4a81 --- /dev/null +++ b/src/effect/effect_win_rotation.h @@ -0,0 +1,17 @@ +#ifdef E_TYPEDEFS +#else +#ifndef EFFECT_WIN_ROTATION_H +#define EFFECT_WIN_ROTATION_H + +/* window rotation effect and handler functions */ +Eina_Bool _effect_mod_win_angle_get(E_Comp_Win *cw); + +E_Comp_Effect_Zone_Rotation *_effect_mod_zone_rotation_new(E_Comp_Canvas *canvas); +void _effect_mod_zone_rotation_free(E_Comp_Effect_Zone_Rotation *zr); +Eina_Bool _effect_mod_zone_rotation_begin(E_Comp_Effect_Zone_Rotation *zr); +Eina_Bool _effect_mod_zone_rotation_end(E_Comp_Effect_Zone_Rotation *zr); +Eina_Bool _effect_mod_zone_rotation_cancel(E_Comp_Effect_Zone_Rotation *zr); +Eina_Bool _effect_mod_zone_rotation_do(E_Comp_Effect_Zone_Rotation *zr); +Eina_Bool _effect_mod_zone_rotation_clear(E_Comp_Effect_Zone_Rotation *zr); +#endif +#endif diff --git a/src/hwcomp/Makefile.am b/src/hwcomp/Makefile.am new file mode 100644 index 0000000..24e52ed --- /dev/null +++ b/src/hwcomp/Makefile.am @@ -0,0 +1,35 @@ +MAINTAINERCLEANFILES = Makefile.in +MODULE = e17-mod-tizen-comp +SUB_MODULE = hwcomp + +#EDJE_CC = @edje_cc@ +#EDJE_FLAGS = -v \ +# @EDJE_DEF@ + +# data files for the module +filesdir = $(libdir)/enlightenment/modules/$(MODULE)/$(SUB_MODULE) + +EXTRA_DIST = $(files_DATA) + +# the module .so file +INCLUDES = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/effect \ + @HWC_CFLAGS@ \ + @ENLIGHTENMENT_CFLAGS@ + +pkgdir = $(filesdir) +pkg_LTLIBRARIES = common.la +common_la_SOURCES = hwcomp.h \ + hwcomp.c \ + hwcomp_debug.h \ + hwcomp_debug.c \ + hwcomp_util.h \ + hwcomp_util.c \ + hwcomp_mobile.h \ + hwcomp_mobile.c + +common_la_LIBADD = @ENLIGHTENMENT_LIBS@ @HWC_LIBS@ @dlopen_libs@ +common_la_LDFLAGS = -module -avoid-version +common_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/src/hwcomp/hwcomp.c b/src/hwcomp/hwcomp.c new file mode 100644 index 0000000..65bccaf --- /dev/null +++ b/src/hwcomp/hwcomp.c @@ -0,0 +1,1137 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_canvas.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +#include "hwcomp_debug.h" +#include "hwcomp.h" +#include + +#include "hwcomp_util.h" +#include "hwcomp_mobile.h" + +#define E_HWCOMP_FULL_PENDING_COUNT 2 +static Eina_Bool _hwcomp_mod_idle_timer_cb(const void *data); + +EAPI Eina_Bool e_mod_comp_hwcomp_mod_init(E_Comp *c) +{ + E_CHECK_RETURN(c, 0); +#ifdef USE_HWC + c->hwcomp_funcs.hwcomp_new = _hwcomp_mod_hwcomp_new; + c->hwcomp_funcs.hwcomp_free = _hwcomp_mod_hwcomp_free; + c->hwcomp_funcs.update_composite = _hwcomp_mod_update_composite; + c->hwcomp_funcs.set_full_composite = _hwcomp_mod_set_full_composite; + c->hwcomp_funcs.force_composite_set = _hwcomp_mod_force_composite_set; + c->hwcomp_funcs.force_composite_get = _hwcomp_mod_force_composite_get; + c->hwcomp_funcs.cb_update = _hwcomp_mod_cb_update; + c->hwcomp_funcs.process_event = _hwcomp_mod_process_event; + c->hwcomp_funcs.check_win_update = _hwcomp_mod_check_win_update; + c->hwcomp_funcs.win_update = _hwcomp_mod_win_update; + c->hwcomp_funcs.set_resize = _hwcomp_mod_set_resize; + c->hwcomp_funcs.reset_idle_timer = _hwcomp_mod_reset_idle_timer; + c->hwcomp_funcs.win_del = _hwcomp_mod_win_del; + c->hwcomp_funcs.mode_get = _hwcomp_mod_mode_get; + c->hwcomp_funcs.update_null_set_drawables = _hwcomp_mod_update_null_set_drawables; + c->hwcomp_funcs.fullcomp_pending_release = _hwcomp_mod_fullcomp_pending_release; + c->hwcomp_funcs.cb_rotation_begin = _hwcomp_mod_cb_rotation_begin; + c->hwcomp_funcs.cb_rotation_end = _hwcomp_mod_cb_rotation_end; + c->hwcomp_funcs.set_drawables = _hwcomp_mod_update_set_drawables; + c->hwcomp_funcs.verify_update_mode = _hwcomp_mod_verify_update_mode; + + _hwcomp_mod_mobile_mobile_init(c); +#else + c->hwcomp_funcs.hwcomp_new = NULL; + c->hwcomp_funcs.hwcomp_free = NULL; + c->hwcomp_funcs.update_composite = NULL; + c->hwcomp_funcs.set_full_composite = NULL; + c->hwcomp_funcs.force_composite_set = NULL; + c->hwcomp_funcs.force_composite_get = NULL; + c->hwcomp_funcs.cb_update = NULL; + c->hwcomp_funcs.process_event = NULL; + c->hwcomp_funcs.check_win_update = NULL; + c->hwcomp_funcs.win_update = NULL; + c->hwcomp_funcs.set_resize = NULL; + c->hwcomp_funcs.reset_idle_timer = NULL; + c->hwcomp_funcs.win_del = NULL; + c->hwcomp_funcs.mode_get = NULL; + c->hwcomp_funcs.update_null_set_drawables = NULL; + c->hwcomp_funcs.cb_rotation_begin = NULL; + c->hwcomp_funcs.cb_rotation_end = NULL; + c->hwcomp_funcs.set_drawables = NULL; + c->hwcomp_funcs.verify_update_mode = NULL; + + _hwcomp_mod_mobile_mobile_init(c); + +#endif + return EINA_TRUE; +} + +EAPI void e_mod_comp_hwcomp_mod_shutdown(E_Comp *c) +{ + E_CHECK(c); + + c->hwcomp_funcs.hwcomp_new = NULL; + c->hwcomp_funcs.hwcomp_free = NULL; + c->hwcomp_funcs.update_composite = NULL; + c->hwcomp_funcs.set_full_composite = NULL; + c->hwcomp_funcs.force_composite_set = NULL; + c->hwcomp_funcs.force_composite_get = NULL; + c->hwcomp_funcs.cb_update = NULL; + c->hwcomp_funcs.process_event = NULL; + c->hwcomp_funcs.check_win_update = NULL; + c->hwcomp_funcs.win_update = NULL; + c->hwcomp_funcs.set_resize = NULL; + c->hwcomp_funcs.reset_idle_timer = NULL; + c->hwcomp_funcs.win_del = NULL; + c->hwcomp_funcs.mode_get = NULL; + c->hwcomp_funcs.update_null_set_drawables = NULL; + c->hwcomp_funcs.cb_rotation_begin = NULL; + c->hwcomp_funcs.cb_rotation_end = NULL; +} + +#ifdef USE_HWC +static Eina_Bool +_hwcomp_mod_idle_timer_cb(const void *data) +{ + /* + * This call back means comp is entered real idle (nothing happened in 2 seconds) + * Almost of this timer may expired in _e_mod_comp_cb_update() + */ + E_Comp_HWComp *hwcomp = NULL; + E_Comp_HWComp_Update *update = NULL; + E_Comp *c = NULL; + + hwcomp = (E_Comp_HWComp *)data; + if (!hwcomp) return ECORE_CALLBACK_DONE; + + update = hwcomp->hwc_update; + c = hwcomp->c; + + if (!update || !c) + return ECORE_CALLBACK_DONE; + + if (update->update_mode != E_HWCOMP_USE_HYBRIDCOMP_MODE) + return ECORE_CALLBACK_DONE; + + /*1. expire self*/ + if (hwcomp->idle_timer) + { + ecore_timer_del(hwcomp->idle_timer); + hwcomp->idle_timer = NULL; + /*2. set flag comp-tizen is idle now*/ + hwcomp->idle_status = EINA_TRUE; + /*3. do compositing 1 time by GL*/ + if (c->hwcomp_funcs.set_full_composite) + c->hwcomp_funcs.set_full_composite(hwcomp); + + _hwcomp_dbg_print_update(update, "HWC:IdleTimerCB"); + } + + return ECORE_CALLBACK_DONE; +} + +static void +_hwcomp_mod_append_idle_timer(E_Comp_HWComp *hwcomp) +{ + E_Comp_HWComp_Update *update = NULL; + E_Comp_HWComp_Drawable *drawable = NULL; + int i; + int num_set_drawable = 0; + + E_CHECK(hwcomp); + + update = hwcomp->hwc_update; + E_CHECK(update); + + if (!hwcomp->idle_timer) + { + for (i = 0; i < update->num_drawable; i++) + { + drawable = update->hwc_drawable[i]; + if (drawable && drawable->set_drawable == EINA_TRUE) + num_set_drawable++; + } + + if (num_set_drawable > 1) + { + hwcomp->idle_timer = ecore_timer_add(2.0, (Ecore_Task_Cb)_hwcomp_mod_idle_timer_cb, hwcomp); + hwcomp->idle_status = EINA_FALSE; + } + } +} + +void +_hwcomp_mod_update_set_drawables(E_Comp_HWComp_Update *hwc_update, Ecore_X_Window win) +{ + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + Ecore_X_Drawable *d = NULL; + int count = 0, idx = 0; + int i; + XRectangle *src_rects = NULL; + XRectangle *dst_rects = NULL; + int *comp_method = NULL; + int zone_x = 0, zone_y = 0, zone_w = 0, zone_h = 0; + int zone_rot = 0; + + if (!hwc_update) return; + + for (i = 0; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + if (hwc_drawable->set_drawable) + count++; + } + + if (count <= 0) return; + + d = E_NEW(Ecore_X_Drawable, count); + if (!d) + return; + + src_rects = E_NEW(XRectangle, count); + if (!src_rects) + { + E_FREE(d); + return; + } + + dst_rects = E_NEW(XRectangle, count); + if (!dst_rects) + { + E_FREE(d); + E_FREE(src_rects); + return; + } + + comp_method = E_NEW(int, count); + if (!comp_method) + { + E_FREE(d); + E_FREE(src_rects); + E_FREE(dst_rects); + return; + } + + if (hwc_update->hwcomp->canvas && hwc_update->hwcomp->canvas->zone) + { + zone_x = hwc_update->hwcomp->canvas->zone->x; + zone_y = hwc_update->hwcomp->canvas->zone->y; + zone_w = hwc_update->hwcomp->canvas->zone->w; + zone_h = hwc_update->hwcomp->canvas->zone->h; + + zone_rot = e_zone_rotation_get(hwc_update->hwcomp->canvas->zone); + } + else + { + zone_x = 0; + zone_y = 0; + zone_w = hwc_update->hwcomp->screen_width; + zone_h = hwc_update->hwcomp->screen_height; + zone_rot = 0; + } + + for (i = 0; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + if (hwc_drawable->set_drawable) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|SET_DRAWABLES: id (%d) , cnt(%d), fu()", "HWC", + i, hwc_drawable->update_count); + hwc_drawable->update_count++; + + if (hwc_drawable->cw) + { + src_rects[idx].x = hwc_drawable->cw->x; + src_rects[idx].y = hwc_drawable->cw->y; + src_rects[idx].width = hwc_drawable->cw->w; + src_rects[idx].height = hwc_drawable->cw->h; + } + else + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + } + + memcpy(&dst_rects[idx], &src_rects[idx], sizeof(XRectangle)); + comp_method[idx] = HWC_COMPOSITE_METHOD_DEFAULT; + d[idx] = hwc_drawable->d; + idx++; + } + } + + for (i = 0; i < count; i++) + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%s|Sree : t:%d, c(%d) w:0x%08x: [%d,%d,%d,%d]=>[%d,%d,%d,%d]", "HWC", + count, i + 1, d[i], src_rects[i].x, src_rects[i].y, src_rects[i].width, src_rects[i].height, dst_rects[i].x, dst_rects[i].y, dst_rects[i].width, dst_rects[i].height); + + HWCSetDrawables(hwcomp_util_display_get(), 0, win, (Drawable *)d, (XRectangle *)src_rects, (XRectangle *)dst_rects, (int *) comp_method, count); + + E_FREE(d); + E_FREE(src_rects); + E_FREE(dst_rects); + E_FREE(comp_method); +} + +Eina_Bool +_hwcomp_mod_verify_update_mode(E_Comp_HWComp *hwcomp, E_Comp_HWComp_Update *hwc_update) +{ + E_Comp *c = NULL; + E_Comp_Canvas *canvas = NULL; + E_Zone *zone = NULL; + E_Comp_Layer *ly = NULL; + Eina_Bool effect_status = EINA_FALSE, move_status = EINA_FALSE, rotation_status = EINA_FALSE; + + E_Comp_Win *cw; + E_Comp_Object *co = NULL, *_co = NULL; + Eina_List *l; + Eina_Bool check_nocomp = EINA_TRUE; + int hybrid_idx = 0; + + c = hwcomp->c; + E_CHECK_RETURN(c, 0); + + canvas = hwcomp->canvas; + E_CHECK_RETURN(canvas, 0); + + zone = canvas->zone; + E_CHECK_RETURN(zone, 0); + + /* pre-check full composite condition */ + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + if (ly) + effect_status = evas_object_visible_get(ly->layout); + ly = e_mod_comp_canvas_layer_get(canvas, "move"); + if (ly) + move_status = evas_object_visible_get(ly->layout); + if ((canvas->zone) && (canvas->zone->rot.block_count)) + rotation_status = EINA_TRUE; + + /* + * basically canvas->ee_win always will be set at top layer0 + * this drawable drawn by GLES + */ + hwc_update->hwc_drawable[0]->cw = NULL; + hwc_update->hwc_drawable[0]->d = canvas->ee_win; + hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + hwc_update->hwc_drawable[0]->first_update = 0; + hwc_update->hwc_drawable[0]->update_count = 0; //for debugging + + if ((hwcomp_util_max_layer_get() == 1) || (hwcomp->force_composite)) + goto full_comp; + + if (effect_status || move_status || rotation_status) + goto full_comp; + +#if HWC_ROTATION_PATCH + if (hwcomp->doing_rotation) + goto full_comp; +#endif + /* + * I have 2 special cases + * + * CASE 1 : 1 full screen app overlapes full screen + * + * CASE 2: Some windows are can be set at HW layer + * - If num of windows are bigger than "hwcomp->num_overlays-1" additional algorithm should be used. + */ + + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (co->canvas != canvas) continue; + + _co = co; + break; + } + + if ((_co) && (cw->bd) && (cw->bd->client.win) && + (!cw->shaped) && (!cw->rects) && (cw->hwc.set_drawable)) + { + int abs_x, abs_y, abs_w, abs_h; + + abs_x = cw->x; + abs_y = cw->y; + abs_w = cw->w; + abs_h = cw->h; + + if (E_CONTAINS(zone->x, zone->y, zone->w, zone->h, abs_x, abs_y, abs_w, abs_h)) + { + /* check nocomp mode with the first cw once */ + + if (check_nocomp && REGION_EQUAL_TO_ZONE(cw, zone) && cw->use_dri2 && (!cw->argb) + && !cw->hwc.resize_pending) + { + if (!(cw->bd && e_border_transform_enable_get(cw->bd))) + { + hwc_update->update_mode = E_HWCOMP_USE_NOCOMP_MODE; + hwc_update->num_drawable = 1; + hwc_update->hwc_drawable[0]->cw = cw; + hwc_update->hwc_drawable[0]->d = cw->bd->client.win; + hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + hwc_update->hwc_drawable[0]->first_update = 0; + hwc_update->hwc_drawable[0]->update_count = 0; //for debugging + + ELBF(ELBT_COMP, 0, 0, "NO-COMP with canvas - 2"); + goto done; + } + } + + if (check_nocomp) check_nocomp = EINA_FALSE; + + + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x name:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.name); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x class:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.class); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x title:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.title); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x iconname:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.icon_name); + + /* skip the cw if the cw is not the use_dri2 */ + if (!cw->use_dri2 && !cw->argb) + continue; + + // skip condition add + + /* argb */ + if (cw->argb) goto full_comp; + + if (hybrid_idx < hwc_update->num_overlays-1) + { + hybrid_idx++; + + /* I think there are some windows which is no full screen */ + /* Mini app || Splited window || No magnifier of keypad */ + hwc_update->update_mode = E_HWCOMP_USE_HYBRIDCOMP_MODE; + hwc_update->num_drawable = hybrid_idx + 1; + hwc_update->hwc_drawable[hybrid_idx]->cw = cw; + hwc_update->hwc_drawable[hybrid_idx]->d = cw->bd->client.win; + hwc_update->hwc_drawable[hybrid_idx]->update_count = 0; //for debugging + + if ((REGION_EQUAL_TO_ZONE(cw, zone) && (!cw->argb))) break; + } + } + /* full composite */ + else if (E_INTERSECTS(zone->x, zone->y, zone->w, zone->h, abs_x, abs_y, abs_w, abs_h)) + goto full_comp; + + /* full composite */ + if (hwcomp_util_check_fullcomp_mode(cw) == EINA_TRUE) + goto full_comp; + + } + else if ((_co) && (cw->redirected) && (!cw->bd) && + (!cw->shaped) && (!cw->rects) && (cw->hwc.set_drawable)) + goto full_comp; + } + if (hwc_update->num_drawable == 0) + goto full_comp; +done: + return EINA_TRUE; +full_comp: + hwcomp_util_update_clear(hwc_update); + + hwc_update->update_mode = E_HWCOMP_USE_FULLCOMP_MODE; + hwc_update->num_drawable = 1; + hwc_update->hwc_drawable[0]->cw = NULL; + hwc_update->hwc_drawable[0]->d = canvas->ee_win; + hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + + return EINA_TRUE; +} + +E_Comp_HWComp* +_hwcomp_mod_hwcomp_new(E_Comp_Canvas *canvas) +{ + E_Comp_HWComp *hwcomp = NULL; + E_CHECK_RETURN(canvas, 0); + + hwcomp = E_NEW(E_Comp_HWComp, 1); + E_CHECK_RETURN(hwcomp, 0); + + hwcomp_util_hwcomp_enable(canvas->comp->man->root); + + hwcomp->c = canvas->comp; + hwcomp->canvas = canvas; + + if (hwcomp_util_hwcomp_query() == EINA_TRUE) + { + hwcomp->num_overlays = hwcomp_util_max_layer_get(); + if (hwcomp->num_overlays <= 0) goto fail; + } + + hwcomp->hwc_update = hwcomp_util_update_create(hwcomp, hwcomp->num_overlays); + if (!hwcomp->hwc_update) goto fail; + + //get the screen size + ecore_x_screen_size_get(ecore_x_default_screen_get(), &(hwcomp->screen_width), &(hwcomp->screen_height)); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|Default Screen Size : (%d, %d)", "HWC:SCREEN_SIZE", hwcomp->screen_width, hwcomp->screen_height); + + return hwcomp; + +fail: + if (hwcomp) + { + if (hwcomp->hwc_update) + hwcomp_util_update_destroy(hwcomp->hwc_update); + E_FREE(hwcomp); + } + return 0; +} + +void +_hwcomp_mod_hwcomp_free(E_Comp_HWComp *hwcomp) +{ + if (!hwcomp) return; + + hwcomp_util_update_destroy(hwcomp->hwc_update); + + if (hwcomp->idle_enterer) ecore_idle_enterer_del(hwcomp->idle_enterer); + if (hwcomp->idle_timer) ecore_timer_del(hwcomp->idle_timer); + + E_FREE(hwcomp); +} + +void +_hwcomp_mod_update_composite(E_Comp_HWComp *hwcomp) +{ + E_CHECK(hwcomp); + E_CHECK(hwcomp->hwc_update); + + E_Comp_HWComp_Update *hwc_update = hwcomp->hwc_update; + Ecore_X_Window root_win = hwcomp->canvas->comp->man->root; + + if (hwcomp_util_update_check_resized(hwc_update)) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|canvas->ee_win : %p", "HWC:SKIP(RESIZE)", hwcomp->canvas->ee_win); + _hwcomp_dbg_print_update(hwc_update, "HWC:SKIP(RESIZE)"); + return; + } + + if (hwcomp->fullcomp_pending) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|canvas->ee_win : %p", "HWC:PENDING(FULL)", hwcomp->canvas->ee_win); + _hwcomp_dbg_print_update(hwc_update, "HWC:PENDING(FULL)"); + return; + } + + if (hwcomp_util_update_check_comp(hwc_update)) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|canvas->ee_win : %p", "HWC:DRAW_DONE", hwcomp->canvas->ee_win); + _hwcomp_dbg_print_update(hwc_update, "HWC:Comp"); + + hwcomp_util_update_set_comp(hwc_update, EINA_FALSE); + + if (hwcomp->c && hwcomp->c->hwcomp_funcs.set_drawables) + hwcomp->c->hwcomp_funcs.set_drawables(hwc_update, root_win); + if (hwcomp->force_swap) + { + E_Comp_Canvas *canvas = hwcomp->canvas; + if ((canvas) && (canvas->evas) && (canvas->ee)) + { + evas_obscured_clear(canvas->evas); + evas_damage_rectangle_add(canvas->evas, 0, 0, canvas->w, canvas->h); + ecore_evas_manual_render(canvas->ee); + hwcomp->force_swap = 0; + } + } + } +} + +void +_hwcomp_mod_set_full_composite(E_Comp_HWComp *hwcomp) +{ + E_CHECK(hwcomp); + E_CHECK(hwcomp->hwc_update); + + E_Comp_HWComp_Update *hwc_update = hwcomp->hwc_update; + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + E_Comp_Win *hide_cw = NULL; + int i; + + /* do not change the update until ee_win has done the update */ + if (hwcomp_util_update_check_comp(hwcomp->hwc_update)) + return; + + _hwcomp_dbg_print_update(hwc_update, "HWC:Set Comp"); + + /* draw all hwc_drawables at the next ee_win update. + 1. hide mask objs + 2. trigger the compositing ee_win + */ + + /* hide mask objs */ + for (i = 1; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + hide_cw = hwc_drawable->cw; + e_mod_comp_win_hwcomp_mask_objs_hide(hide_cw); + hwcomp_util_reset_comp_countdown(hwc_drawable); + hwcomp_util_reset_set_countdown(hwc_drawable); + hwc_drawable->set_drawable = EINA_FALSE; + } + + hwcomp_util_update_set_comp(hwc_update, EINA_TRUE); + hwcomp_util_turn_composite(hwcomp, EINA_TRUE); + + hwc_update->hwc_drawable[0]->cw = NULL; + hwc_update->hwc_drawable[0]->d = hwcomp->canvas->ee_win; + hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + + // ecore_evas_manual_render(hwcomp->canvas->ee); +} + +Eina_Bool +_hwcomp_mod_cb_update(E_Comp_HWComp *hwcomp) +{ + E_CHECK_RETURN(hwcomp, 0); + + E_Comp *c = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_Win *show_cw = NULL; + E_Comp_Win *hide_cw = NULL; + E_Comp_HWComp_Update *cur_hwc_update = NULL; + E_Comp_HWComp_Update *new_hwc_update = NULL; + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + E_HWComp_Mode cur_mode = E_HWCOMP_USE_INVALID; + E_HWComp_Mode new_mode = E_HWCOMP_USE_INVALID; + int i = 0; + + c = hwcomp->c; + E_CHECK_RETURN(c, EINA_FALSE); + E_CHECK_RETURN(!(c->lock.locked), EINA_FALSE); + + canvas = hwcomp->canvas; + E_CHECK_RETURN(canvas, EINA_FALSE); + + cur_hwc_update = hwcomp->hwc_update; + if (!cur_hwc_update) + return EINA_FALSE; + + if (hwcomp->idle_timer) + { + ecore_timer_del(hwcomp->idle_timer); + hwcomp->idle_timer = NULL; + } + + new_hwc_update = hwcomp_util_update_create(hwcomp, hwcomp->num_overlays); + if (!new_hwc_update) + return EINA_FALSE; + + + if (c->hwcomp_funcs.verify_update_mode) + { + if (!c->hwcomp_funcs.verify_update_mode(hwcomp, new_hwc_update)) + { + if (c->hwcomp_funcs.update_null_set_drawables) + c->hwcomp_funcs.update_null_set_drawables(hwcomp); + hwcomp_util_update_destroy(new_hwc_update); + return EINA_FALSE; + } + } + else + { + hwcomp_util_update_destroy(new_hwc_update); + return EINA_FALSE; + } + + cur_mode = hwcomp->hwc_update->update_mode; + new_mode = new_hwc_update->update_mode; + + if (cur_mode != new_mode) + { + /* do not change the update until resized is done. */ + if (hwcomp_util_update_check_resized(cur_hwc_update)) + { + if (cur_hwc_update->update_mode != E_HWCOMP_USE_NOCOMP_MODE) + { + _hwcomp_dbg_print_update(cur_hwc_update, "HWC:SKIP(RESIZE)"); + hwcomp_util_update_destroy(new_hwc_update); + return EINA_TRUE; + } + } + + if ((cur_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE) && + (new_mode == E_HWCOMP_USE_FULLCOMP_MODE)) + { + hwcomp->fullcomp_pending = E_HWCOMP_FULL_PENDING_COUNT; + } + + + if ((cur_mode == E_HWCOMP_USE_NOCOMP_MODE) && + (new_mode == E_HWCOMP_USE_FULLCOMP_MODE)) + { + hwcomp->force_swap = 1; + } + + + _hwcomp_dbg_print_change_update(cur_hwc_update, new_hwc_update, "HWC:Mode Change"); + + if (cur_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE) + { + /* hide mask_objs */ + hwcomp_util_update_reset_maskobj(cur_hwc_update); + } + + + + /* change the new hwc_update */ + hwcomp_util_update_destroy(hwcomp->hwc_update); + hwcomp->hwc_update = new_hwc_update; + + /* set drawable is 1 at this case */ + hwcomp->hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + + /* reset count */ + for (i = 0; i < hwcomp->hwc_update->num_drawable; i++) + { + hwcomp_util_reset_comp_countdown(hwcomp->hwc_update->hwc_drawable[i]); + hwcomp_util_reset_set_countdown(hwcomp->hwc_update->hwc_drawable[i]); + } + + /* check ee_win update */ + if (hwcomp->hwc_update->update_mode == E_HWCOMP_USE_NOCOMP_MODE) + { + /* update client win. set_drawable */ + if (c->hwcomp_funcs.set_drawables) + c->hwcomp_funcs.set_drawables(hwcomp->hwc_update, hwcomp->canvas->comp->man->root); + hwcomp_util_turn_composite(hwcomp, EINA_FALSE); + } + else if (hwcomp->hwc_update->update_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE) + { +#if OPTIMIZED_HWC_MOBILE + hwcomp_util_set_hybrid_composite(hwcomp->hwc_update); +#endif + /* update ee_win at the next draw_done of the ee_win */ + hwcomp_util_update_set_comp(hwcomp->hwc_update, EINA_TRUE); + hwcomp_util_turn_composite(hwcomp, EINA_TRUE); + } + else if (hwcomp->hwc_update->update_mode == E_HWCOMP_USE_FULLCOMP_MODE) + { + /* update ee_win at the next draw_done of the ee_win */ + hwcomp_util_update_set_comp(hwcomp->hwc_update, EINA_TRUE); + hwcomp_util_turn_composite(hwcomp, EINA_TRUE); + } + } + else + { + Eina_Bool compare = hwcomp_util_update_compare_drawables(cur_hwc_update, new_hwc_update); + + if (!compare && cur_mode != E_HWCOMP_USE_FULLCOMP_MODE) + { + hwcomp_util_update_migrate_drawables(cur_hwc_update, new_hwc_update); + + if (cur_mode == E_HWCOMP_USE_NOCOMP_MODE) + { + _hwcomp_dbg_print_change_update(cur_hwc_update, new_hwc_update, "HWC:NOCOMP Draw Change"); + + if (c->hwcomp_funcs.set_drawables) + c->hwcomp_funcs.set_drawables(new_hwc_update, hwcomp->canvas->comp->man->root); + } + else if (cur_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE) + { + _hwcomp_dbg_print_change_update(cur_hwc_update, new_hwc_update, "HWC:HIB Draw Change"); + +#if OPTIMIZED_HWC_MOBILE + if (c->hwcomp_funcs.set_drawables) + c->hwcomp_funcs.set_drawables(new_hwc_update, hwcomp->canvas->comp->man->root); +#endif + } + + hwcomp_util_update_destroy(hwcomp->hwc_update); + hwcomp->hwc_update = new_hwc_update; + } + else + { + /* destory new hwc_update */ + hwcomp_util_update_destroy(new_hwc_update); + + if (cur_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE) + { + /* do not set/comp util the first update of ee_win has doen. */ + if (hwcomp_util_update_check_comp(cur_hwc_update)) + { + for (i = 1 ; i < cur_hwc_update->num_drawable ; ++i) + { + hwc_drawable = cur_hwc_update->hwc_drawable[i]; + if (!hwc_drawable) break; + hwcomp_util_reset_comp_countdown(hwc_drawable); + hwcomp_util_reset_set_countdown(hwc_drawable); + } + } + else + { + Eina_Bool partial_update = EINA_TRUE; + Eina_Bool set_flag = EINA_FALSE; + // index 0 id composite overlay window + for (i = 1 ; i < cur_hwc_update->num_drawable ; ++i) + { + hwc_drawable = cur_hwc_update->hwc_drawable[i]; + if (!hwc_drawable) break; + + if (hwc_drawable->set_drawable) + { + hwcomp_util_dec_comp_countdown(hwc_drawable); + /* composite */ + if (hwc_drawable->comp_countdown <= 0) + { + hwc_drawable->set_drawable = EINA_FALSE; + e_mod_comp_win_hwcomp_mask_objs_hide(hwc_drawable->cw); + } + partial_update = EINA_FALSE; + } + else + { + // set drawables + if (hwc_drawable->set_countdown <= 0) + { + ELBF(ELBT_COMP, 0, 0, "%15.15s|### [%d]: %p, %d, %d, %d", "HWC:BEFORE", + i, hwc_drawable->d, hwc_drawable->set_drawable, hwc_drawable->set_countdown, hwc_drawable->comp_countdown); + + hwc_drawable->set_drawable = EINA_TRUE; + hwcomp_util_reset_set_countdown(hwc_drawable); + + // show mask obj + e_mod_comp_win_hwcomp_mask_objs_show(hwc_drawable->cw); + + // set flags + set_flag = EINA_TRUE; + ELBF(ELBT_COMP, 0, 0, "%15.15s|### [%d]: %p, %d, %d, %d", "HWC:AFTER", + i, hwc_drawable->d, hwc_drawable->set_drawable, hwc_drawable->set_countdown, hwc_drawable->comp_countdown); + partial_update = EINA_FALSE; + + } + } + } + + if (set_flag) + { + _hwcomp_dbg_print_update(cur_hwc_update, "HWC:HIB State Change"); + /* update client win. set_drawable */ + if (c->hwcomp_funcs.set_drawables) + c->hwcomp_funcs.set_drawables(cur_hwc_update, canvas->comp->man->root); + } + + if (partial_update) return partial_update; + } + + } + } + } + if ((hwcomp) && (new_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE)) + _hwcomp_mod_append_idle_timer(hwcomp); + + return EINA_TRUE; +} + +void +_hwcomp_mod_process_event(E_Comp *c, Ecore_X_Event_Generic *e) +{ + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_HWComp *hwcomp = NULL; + int num_overlays = 0; + E_HWComp_Mode mode = E_HWCOMP_USE_INVALID; + int i; + + if (!c || !e) return; + if (hwcomp_util_hwcomp_query() == EINA_FALSE) return; + + if ((num_overlays = hwcomp_util_get_event_data(e)) != -1) + { + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas->hwcomp) continue; + + hwcomp = canvas->hwcomp; + if (hwcomp && hwcomp->hwc_update) + mode = hwcomp->hwc_update->update_mode; + + if (mode != E_HWCOMP_USE_FULLCOMP_MODE) + { + hwcomp_util_update_reset_maskobj(hwcomp->hwc_update); + hwcomp_util_update_destroy(hwcomp->hwc_update); + + /* recreate the hwc update with the updated overlays */ + hwcomp->hwc_update = hwcomp_util_update_create(hwcomp, num_overlays); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s| maxLayers = %d", "HWC:MAXLAYER CHANGE", num_overlays); + + if (c->hwcomp_funcs.set_full_composite) + c->hwcomp_funcs.set_full_composite(hwcomp); + e_mod_comp_render_queue(c); + } + hwcomp->num_overlays = num_overlays; + hwcomp_util_max_layer_set(num_overlays); + + _hwcomp_dbg_print_update(hwcomp->hwc_update, "HWC:Change MAX Layers"); + } + } +} + +void +_hwcomp_mod_check_win_update(E_Comp_Win *cw, int w, int h) +{ + E_CHECK(cw); + E_CHECK(w > 0); + E_CHECK(h > 0); + + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_HWComp *hwcomp = NULL; + E_Comp_HWComp_Update *hwc_update = NULL; + E_Comp *c = cw->c; + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + int i = 0; + int num_drawable = 0; + int max_w = 0, max_h = 0; + + const char *name=NULL; + name = hwcomp_util_border_name_get(cw->bd); + + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas->hwcomp) continue; + + hwcomp = canvas->hwcomp; + hwc_update = hwcomp->hwc_update; + + if (hwc_update->update_mode != E_HWCOMP_USE_HYBRIDCOMP_MODE) continue; + + max_w = canvas->zone->w; + max_h = canvas->zone->h; + num_drawable = hwc_update->num_drawable; + + for (i = 0; i < num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + + if (hwc_drawable && hwc_drawable->cw == cw) + { + /* Mini app */ + if (STATE_INSET_CHECK(cw) && name && !strcmp(name, "video-player")) + hwc_drawable->region_update = EINA_TRUE; + else + { + if (hwcomp_util_update_check_region(hwc_update, cw, w, h, max_w, max_h)) + hwc_drawable->region_update = EINA_TRUE; + else + hwc_drawable->region_update = EINA_FALSE; + } + } + } + } +} + + +void +_hwcomp_mod_win_update(E_Comp_Win *cw) +{ + E_CHECK(cw); + E_CHECK(cw->bd); + + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_HWComp *hwcomp = NULL; + E_Comp_HWComp_Update *hwc_update = NULL; + E_Comp *c = cw->c; + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas->hwcomp) continue; + + hwcomp = canvas->hwcomp; + hwc_update = hwcomp->hwc_update; + + /* unset the resized flag here */ + hwcomp_util_update_unset_resized(hwc_update, cw); + + /* do not update the countdown when there are the resized drawables */ + if (!hwcomp_util_update_check_resized(hwc_update)) + hwcomp_util_update_countdown(hwc_update, cw); + } +} + +void +_hwcomp_mod_set_resize(E_Comp_Win *cw) +{ + E_CHECK(cw); + E_CHECK(cw->bd); + + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_HWComp *hwcomp = NULL; + E_Comp_HWComp_Update *hwc_update = NULL; + E_Comp *c = cw->c; + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas->hwcomp) continue; + + hwcomp = canvas->hwcomp; + hwc_update = hwcomp->hwc_update; + + hwcomp_util_update_set_resized(hwc_update, cw); + } +} + +void +_hwcomp_mod_force_composite_set(E_Comp_HWComp *hwcomp, Eina_Bool set) +{ + E_CHECK(hwcomp); + + if (set) + { + hwcomp->comp_ref++; + if (!hwcomp->force_composite) + { + hwcomp->force_composite = set; + } + } + else + { + hwcomp->comp_ref--; + if (hwcomp->comp_ref <= 0) + { + hwcomp->comp_ref = 0; + hwcomp->force_composite = EINA_FALSE; + } + } +} + +Eina_Bool +_hwcomp_mod_force_composite_get(E_Comp_HWComp *hwcomp) +{ + E_CHECK_RETURN(hwcomp, 0); + return hwcomp->force_composite; +} + +void +_hwcomp_mod_reset_idle_timer(E_Comp_Canvas *canvas) +{ + + E_Comp_HWComp *hwcomp = NULL; + E_CHECK(canvas); + + hwcomp = canvas->hwcomp; + E_CHECK(hwcomp); + + if (hwcomp->idle_timer) + { + ecore_timer_del(hwcomp->idle_timer); + hwcomp->idle_timer = NULL; + } + + return; +} + +void +_hwcomp_mod_win_del(E_Comp_Win *cw) +{ + + E_CHECK(cw); + + Eina_List *l = NULL; + E_Comp_Canvas *canvas = NULL; + E_Comp_HWComp *hwcomp = NULL; + E_Comp_HWComp_Update *hwc_update = NULL; + E_Comp_HWComp_Drawable **drawables = NULL; + E_Comp *c = cw->c; + int i; + + EINA_LIST_FOREACH(c->canvases, l, canvas) + { + if (!canvas || !canvas->hwcomp) continue; + + hwcomp = canvas->hwcomp; + hwc_update = hwcomp->hwc_update; + drawables = hwc_update->hwc_drawable; + + for (i=0; i < hwc_update->num_drawable; i++) + { + if (drawables[i]->cw && (cw == drawables[i]->cw)) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s| cw : %p deleted", "HWC:CW DEL", cw); + hwcomp_util_update_clear(hwc_update); + return; + } + } + } + + return; +} + +E_HWComp_Mode +_hwcomp_mod_mode_get(E_Comp_HWComp *hwcomp) +{ + E_CHECK_RETURN(hwcomp, E_HWCOMP_USE_INVALID); + E_CHECK_RETURN(hwcomp->hwc_update, E_HWCOMP_USE_INVALID); + + return hwcomp->hwc_update->update_mode; +} + +void +_hwcomp_mod_update_null_set_drawables(E_Comp_HWComp *hwcomp) +{ + E_CHECK(hwcomp); + Ecore_X_Window root_win = hwcomp->canvas->comp->man->root; + E_CHECK(root_win); + + _hwcomp_dbg_elbf(ELBT_COMP,0, 0, "HWC|NULL DRAWABLE SET"); + + HWCSetDrawables(hwcomp_util_display_get(), 0, root_win, NULL, NULL, NULL, NULL, 0); +} + +void +_hwcomp_mod_fullcomp_pending_release(E_Comp_HWComp *hwcomp) +{ + E_CHECK(hwcomp); + + if (hwcomp->fullcomp_pending) + hwcomp->fullcomp_pending--; + + return; +} + +void +_hwcomp_mod_cb_rotation_begin(E_Comp_HWComp *hwcomp) +{ +#if HWC_ROTATION_PATCH + E_CHECK(hwcomp); + + ELBF(ELBT_COMP, 0, 0, "[ROTATION BEGIN]"); + hwcomp->doing_rotation = 1; + + if (hwcomp->hwc_update->update_mode != E_HWCOMP_USE_FULLCOMP_MODE) + { + if (hwcomp->c && hwcomp->c->hwcomp_funcs.cb_update) + hwcomp->c->hwcomp_funcs.cb_update(hwcomp); + + E_Comp_Canvas *canvas = hwcomp->canvas; + + ELBF(ELBT_COMP, 0, 0, "[OVERLAY Window Manual Render!]"); + + Eina_Bool back = ecore_evas_manual_render_get(canvas->ee); + ecore_evas_manual_render_set(canvas->ee, EINA_TRUE); + ecore_evas_manual_render(canvas->ee); + ecore_evas_manual_render_set(canvas->ee, back); + } +#endif +} + +void +_hwcomp_mod_cb_rotation_end(E_Comp_HWComp *hwcomp) +{ +#if HWC_ROTATION_PATCH + E_CHECK(hwcomp); + + ELBF(ELBT_COMP, 0, 0, "[ROTATION END]"); + hwcomp->doing_rotation = 0; +#endif +} + +#endif + + + diff --git a/src/hwcomp/hwcomp.h b/src/hwcomp/hwcomp.h new file mode 100644 index 0000000..a8c9452 --- /dev/null +++ b/src/hwcomp/hwcomp.h @@ -0,0 +1,34 @@ +#ifdef E_TYPEDEFS +#else +#ifndef HWCOMP_H +#define HWCOMP_H + +EAPI Eina_Bool e_mod_comp_hwcomp_mod_init(E_Comp *c); +EAPI void e_mod_comp_hwcomp_mod_shutdown(E_Comp *c); + +#ifdef USE_HWC +E_Comp_HWComp *_hwcomp_mod_hwcomp_new(E_Comp_Canvas *canvas); +void _hwcomp_mod_hwcomp_free(E_Comp_HWComp *hwcomp); +void _hwcomp_mod_update_composite(E_Comp_HWComp *hwcomp); +void _hwcomp_mod_set_full_composite(E_Comp_HWComp *hwcomp); +void _hwcomp_mod_force_composite_set(E_Comp_HWComp *hwcomp, Eina_Bool set); +Eina_Bool _hwcomp_mod_force_composite_get(E_Comp_HWComp *hwcomp); +Eina_Bool _hwcomp_mod_cb_update(E_Comp_HWComp *hwcomp); +void _hwcomp_mod_process_event(E_Comp *c, Ecore_X_Event_Generic *e); +void _hwcomp_mod_check_win_update(E_Comp_Win *cw, int w, int h); +void _hwcomp_mod_win_update(E_Comp_Win *cw); +void _hwcomp_mod_set_resize(E_Comp_Win *cw); +void _hwcomp_mod_reset_idle_timer(E_Comp_Canvas *canvas); +void _hwcomp_mod_win_del(E_Comp_Win *cw); +E_HWComp_Mode _hwcomp_mod_mode_get(E_Comp_HWComp *hwcomp); +void _hwcomp_mod_update_null_set_drawables(E_Comp_HWComp *hwcomp); +void _hwcomp_mod_fullcomp_pending_release(E_Comp_HWComp *hwcomp); + +void _hwcomp_mod_cb_rotation_begin(E_Comp_HWComp *hwcomp); +void _hwcomp_mod_cb_rotation_end(E_Comp_HWComp *hwcomp); + +Eina_Bool _hwcomp_mod_verify_update_mode(E_Comp_HWComp *hwcomp, E_Comp_HWComp_Update *hwc_update); +void _hwcomp_mod_update_set_drawables(E_Comp_HWComp_Update *hwc_update, Ecore_X_Window win); +#endif /* End of USE_HWC */ +#endif /* End of HWCOMP_H */ +#endif /* End of E_TYPEDEFS */ diff --git a/src/hwcomp/hwcomp_debug.c b/src/hwcomp/hwcomp_debug.c new file mode 100644 index 0000000..a9f8462 --- /dev/null +++ b/src/hwcomp/hwcomp_debug.c @@ -0,0 +1,84 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +#include "hwcomp_debug.h" + +#if DEBUG_HWC +void _hwcomp_debug_print_update(E_Comp_HWComp_Update *hwc_update, const char *str) +{ + E_Comp_HWComp_Drawable *cur_d = NULL; + int i; + + E_CHECK(hwc_update); + + ELBF(ELBT_COMP, 0, 0, "%15.15s| mode: %d num_d: %d ", + str, hwc_update->update_mode, hwc_update->num_drawable); + for (i = 0; i < hwc_update->num_overlays; i++) + { + cur_d = hwc_update->hwc_drawable[i]; + ELBF(ELBT_COMP, 0, 0, "%15.15s| cur {d[%d]:%p set:%d}", + str, + i, cur_d?cur_d->d:0x0,cur_d?cur_d->set_drawable:0); + } +} + +void _hwcomp_debug_print_change_update(E_Comp_HWComp_Update *cur_hwc_update, E_Comp_HWComp_Update *new_hwc_update, const char *str) +{ + E_Comp_HWComp_Drawable *cur_d = NULL; + E_Comp_HWComp_Drawable *new_d = NULL; + int i; + int diff; + int count=0; + + E_CHECK(cur_hwc_update); + E_CHECK(new_hwc_update); + + ELBF(ELBT_COMP, 0, 0, "%15.15s| mode: %d ===> %d num_d: %d ==> %d", + str, + cur_hwc_update->update_mode, new_hwc_update->update_mode, + cur_hwc_update->num_drawable, new_hwc_update->num_drawable); + + diff = cur_hwc_update->num_overlays - new_hwc_update->num_overlays; + if (!diff) count = cur_hwc_update->num_overlays; + else if (diff > 0) count = new_hwc_update->num_overlays; + else count = cur_hwc_update->num_overlays; + + for (i = 0; i < count; i++) + { + cur_d = cur_hwc_update->hwc_drawable[i]; + new_d = new_hwc_update->hwc_drawable[i]; + ELBF(ELBT_COMP, 0, 0, "%15.15s| cur {d[%d]:%p set:%d} new {d[%d]:%p set:%d}", + str, + i, cur_d?cur_d->d:0x0,cur_d?cur_d->set_drawable:0, + i, new_d?new_d->d:0x0,new_d?new_d->set_drawable:0); + } + + if (!diff) return; + else if (diff > 0) + { + for (i = 0; i < cur_hwc_update->num_overlays; i++) + { + cur_d = cur_hwc_update->hwc_drawable[i]; + ELBF(ELBT_COMP, 0, 0, "%15.15s| cur {d[%d]:%p set:%d} new {d[%d]:%s set:%d}", + str, + i, cur_d?cur_d->d:0x0,cur_d?cur_d->set_drawable:0, + i, "HWOV",0); + } + } + else + { + for (i = 0; i < new_hwc_update->num_overlays; i++) + { + new_d = new_hwc_update->hwc_drawable[i]; + ELBF(ELBT_COMP, 0, 0, "%15.15s| cur {d[%d]:%s set:%d} new {d[%d]:%p set:%d}", + str, + i, "HWOV",0, + i, new_d?new_d->d:0x0,new_d?new_d->set_drawable:0); + } + } +} +#endif /* End of DEBUG_HWC*/ + + diff --git a/src/hwcomp/hwcomp_debug.h b/src/hwcomp/hwcomp_debug.h new file mode 100644 index 0000000..adc4e32 --- /dev/null +++ b/src/hwcomp/hwcomp_debug.h @@ -0,0 +1,26 @@ +#ifdef E_TYPEDEFS +#else +#ifndef HWCOMP_DEBUG_H +#define HWCOMP_DEBUG_H + + +#if DEBUG_HWC + +void _hwcomp_debug_print_update(E_Comp_HWComp_Update *hwc_update, const char *str); +void _hwcomp_debug_print_change_update(E_Comp_HWComp_Update *cur_hwc_update, E_Comp_HWComp_Update *new_hwc_update, const char *str); + +#define _hwcomp_dbg_print_update(hwc_update, str) _hwcomp_debug_print_update(hwc_update, str) +#define _hwcomp_dbg_print_change_update(cur_hwc_update, new_hwc_update, str) _hwcomp_debug_print_change_update(cur_hwc_update, new_hwc_update, str) +#define _hwcomp_dbg_elbf(t, b, i, f, x...) ELBF(t, b, i, f, ##x) + +#else /* else of DEBUG_HWC */ + +#define _hwcomp_dbg_print_update(hwc_update, str) +#define _hwcomp_dbg_print_change_update(cur_hwc_update, new_hwc_update, str) +#define _hwcomp_dbg_elbf(t, b, i, f, x...) + +#endif /* End of DEBUG_HWC */ + + +#endif +#endif diff --git a/src/hwcomp/hwcomp_mobile.c b/src/hwcomp/hwcomp_mobile.c new file mode 100644 index 0000000..e696daa --- /dev/null +++ b/src/hwcomp/hwcomp_mobile.c @@ -0,0 +1,695 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_canvas.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +#include "hwcomp_debug.h" +#include "hwcomp.h" +#include + +#include "hwcomp_util.h" +#include "hwcomp_debug.h" +#include "hwcomp_mobile.h" + +#if OPTIMIZED_HWC_MOBILE +#define KEYBOARD_MAGNIFIER_WIDTH_PORTRAIT 200 +#define KEYBOARD_MAGNIFIER_WIDTH_LANDSCAPE 160 +#endif + +Eina_Bool _hwcomp_mod_mobile_mobile_init(E_Comp *c) +{ + E_CHECK_RETURN(c, EINA_FALSE); + +#ifdef USE_HWC + c->hwcomp_funcs.set_drawables = _hwcomp_mod_mobile_update_set_drawables; + c->hwcomp_funcs.verify_update_mode = _hwcomp_mod_mobile_verify_update_mode; +#endif + return EINA_TRUE; +} + +#ifdef USE_HWC +void +_hwcomp_mod_mobile_update_set_drawables(E_Comp_HWComp_Update *hwc_update, Ecore_X_Window win) +{ + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + Ecore_X_Drawable *d = NULL; + int count = 0, idx = 0; + int i; + +#if OPTIMIZED_HWC_MOBILE + XRectangle *src_rects = NULL; + XRectangle *dst_rects = NULL; + int *comp_method = NULL; + int zone_x = 0, zone_y = 0, zone_w = 0, zone_h = 0; + int zone_rot = 0; +#endif + + if (!hwc_update) return; + + for (i = 0; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + if (hwc_drawable->set_drawable) + count++; + } + + if (count <= 0) return; + + d = E_NEW(Ecore_X_Drawable, count); + if (!d) + return; + +#if OPTIMIZED_HWC_MOBILE + src_rects = E_NEW(XRectangle, count); + if (!src_rects) + { + E_FREE(d); + return; + } + + dst_rects = E_NEW(XRectangle, count); + if (!dst_rects) + { + E_FREE(d); + E_FREE(src_rects); + return; + } + + comp_method = E_NEW(int, count); + if (!comp_method) + { + E_FREE(d); + E_FREE(src_rects); + E_FREE(dst_rects); + return; + } + + if (hwc_update->hwcomp->canvas && hwc_update->hwcomp->canvas->zone) + { + zone_x = hwc_update->hwcomp->canvas->zone->x; + zone_y = hwc_update->hwcomp->canvas->zone->y; + zone_w = hwc_update->hwcomp->canvas->zone->w; + zone_h = hwc_update->hwcomp->canvas->zone->h; + } + else + { + zone_x = 0; + zone_y = 0; + zone_w = hwc_update->hwcomp->screen_width; + zone_h = hwc_update->hwcomp->screen_height; + } + + //check orientation + if (hwc_update->hwcomp->canvas && hwc_update->hwcomp->canvas->zone) + { + zone_rot = e_zone_rotation_get(hwc_update->hwcomp->canvas->zone); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|SET_DRAWABLES: Zone Rotation[%d]", "HWC:Zone", + zone_rot); + } + else + { + //if zone is not present then what to do ? + if (hwc_update->ime_present) + { + if (hwc_update->ime_rect.h == hwc_update->hwcomp->screen_height) + { + if (hwc_update->ime_rect.x == 0) + zone_rot = 270; + else + zone_rot = 90; + } + } + } +#endif + + for (i = 0; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + if (hwc_drawable->set_drawable) + { + +#if OPTIMIZED_HWC_MOBILE + + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|SET_DRAWABLES: id (%d) , cnt(%d), fu(%d)", "HWC", + i, hwc_drawable->update_count, hwc_drawable->first_update); + hwc_drawable->update_count++ ; //for debugging + + if (hwc_update->update_mode == E_HWCOMP_USE_FULLCOMP_MODE) + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + + hwc_drawable->first_update = 0; + } + else if (i == 0 && hwc_update->hwcomp->miniapp_present) + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + + hwc_drawable->first_update = 0; + } + else if (i == 0 && hwc_update->ime_present && hwc_update->split_launcher_rect_present) + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + + hwc_drawable->first_update = 0; + } + else if (i == 0 && hwc_update->ime_present) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|SET_DRAWABLES: kbgeo[%d, %d, %d, %d] zRot[%d]", "HWC:Zone-KB", + hwc_update->ime_rect.x,hwc_update->ime_rect.y, hwc_update->ime_rect.w, + hwc_update->ime_rect.h, zone_rot); +#if HWC_ROTATION_PATCH + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + + hwc_drawable->first_update = 0; +#else + if (zone_rot == 0 || (zone_rot != 0 && hwc_update->ime_rect.y != 0)) + { + if (hwc_drawable->first_update == 0) + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + + hwc_drawable->first_update = 1; + } + else + { + src_rects[idx].x = hwc_update->ime_rect.x; + src_rects[idx].y = hwc_update->ime_rect.y - KEYBOARD_MAGNIFIER_WIDTH_PORTRAIT; //includes magnifier + src_rects[idx].width = hwc_update->ime_rect.w; + src_rects[idx].height = hwc_update->ime_rect.h + KEYBOARD_MAGNIFIER_WIDTH_PORTRAIT; //includes magnifier + } + } + else + { + if (hwc_drawable->first_update == 0) + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + + hwc_drawable->first_update = 1; + } + else + { + if (zone_rot == 90) + { + src_rects[idx].x = hwc_update->ime_rect.x - KEYBOARD_MAGNIFIER_WIDTH_LANDSCAPE; + } + else //case (zone_rot == 270), as already zone angle 0 and 90 handled + { + src_rects[idx].x = hwc_update->ime_rect.x; + } + src_rects[idx].y = hwc_update->ime_rect.y; + src_rects[idx].width = hwc_update->ime_rect.w + KEYBOARD_MAGNIFIER_WIDTH_LANDSCAPE; + src_rects[idx].height = hwc_update->ime_rect.h; + } + } +#endif + } + else if (i == 0 && hwc_update->split_launcher_rect_present) + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + + hwc_drawable->first_update = 0; + } + else + { + if (hwc_drawable->cw) + { + src_rects[idx].x = hwc_drawable->cw->x; + src_rects[idx].y = hwc_drawable->cw->y; + src_rects[idx].width = hwc_drawable->cw->w; + src_rects[idx].height = hwc_drawable->cw->h; + } + else + { + src_rects[idx].x = zone_x; + src_rects[idx].y = zone_y; + src_rects[idx].width = zone_w; + src_rects[idx].height = zone_h; + } + } +#endif + + //check for keyboard intersection +#if OPTIMIZED_HWC_MOBILE + if (hwc_update->ime_present && i != 0 && hwc_drawable->cw && + E_INTERSECTS(hwc_drawable->cw->x, hwc_drawable->cw->y, + hwc_drawable->cw->w, hwc_drawable->cw->h, + hwc_update->ime_rect.x, hwc_update->ime_rect.y, + hwc_update->ime_rect.w, hwc_update->ime_rect.h) + && + !E_CONTAINS(hwc_update->ime_rect.x, hwc_update->ime_rect.y, + hwc_update->ime_rect.w, hwc_update->ime_rect.h, + hwc_drawable->cw->x, hwc_drawable->cw->y, + hwc_drawable->cw->w, hwc_drawable->cw->h)) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|SET_DRAWABLES:Drawable[%d] size [%d, %d, %d, %d]", "HWC:Reduce", i, hwc_drawable->cw->x, hwc_drawable->cw->y, + hwc_drawable->cw->w, hwc_drawable->cw->h); + + if (zone_rot == 0 || (zone_rot != 0 && hwc_update->ime_rect.y != 0)) + { + src_rects[idx].x = hwc_drawable->cw->x; + src_rects[idx].y = hwc_drawable->cw->y; + src_rects[idx].width = hwc_drawable->cw->w; + src_rects[idx].height = hwc_drawable->cw->h - (hwc_drawable->cw->y + + hwc_drawable->cw->h - hwc_update->ime_rect.y); + } + else + { + if (zone_rot == 90) + { + src_rects[idx].x = hwc_drawable->cw->x; + src_rects[idx].y = hwc_drawable->cw->y; + src_rects[idx].width = hwc_update->ime_rect.x - hwc_drawable->cw->x; + src_rects[idx].height = hwc_drawable->cw->h; + } + else // case (zone_rot == 270) as 0 and 90 zone angle already handled + { + int actualX = src_rects[idx].x; + src_rects[idx].x = hwc_update->ime_rect.x + hwc_update->ime_rect.w; + src_rects[idx].y = hwc_drawable->cw->y; + src_rects[idx].width = hwc_drawable->cw->w - (hwc_update->ime_rect.w - (actualX - hwc_update->ime_rect.x)); + src_rects[idx].height = hwc_drawable->cw->h; + } + } + } + + memcpy(&dst_rects[idx], &src_rects[idx], sizeof(XRectangle)); + comp_method[idx] = HWC_COMPOSITE_METHOD_DEFAULT; + + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|SET_DRAWABLES: id (%d) rect[%d, %d, %d, %d], cnt(%d), fu(%d)", "HWC", + i, dst_rects[i].x, dst_rects[i].y, dst_rects[i].width, dst_rects[i].height, hwc_drawable->update_count, hwc_drawable->first_update); +#endif + + d[idx] = hwc_drawable->d; + idx++; + } + } + + + + for (i = 0; i < count; i++) +#if OPTIMIZED_HWC_MOBILE + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|Sree : total:%d, count(%d) win:0x%08x: rect[%d, %d, %d, %d]", "HWC", + count, i + 1, d[i], dst_rects[i].x, dst_rects[i].y, dst_rects[i].width, dst_rects[i].height); +#else + for (i = 0; i < count; i++) + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|Sree : total:%d, count(%d) win:0x%08x:", "HWC", + count, i + 1, d[i]); +#endif + + +#if OPTIMIZED_HWC_MOBILE + if (count == 1) + { + dst_rects[0].x = src_rects[0].x = zone_x; + dst_rects[0].y = src_rects[0].y = zone_y; + dst_rects[0].width = src_rects[0].width = zone_w; + dst_rects[0].height = src_rects[0].height = zone_h; + comp_method[0] = HWC_COMPOSITE_METHOD_DEFAULT; + } + /*TODO: Get Active Crtc */ + HWCSetDrawables(hwcomp_util_display_get(), 0, win, (Drawable *)d, (XRectangle *)src_rects, (XRectangle *)dst_rects, (int *) comp_method, count); +#else + // Build Error. when OPTIMIZED_HWC_MOBILE is 0 + //HWCSetDrawables(hwcomp_util_display_get(), win, (Drawable *)d, count); +#endif + + E_FREE(d); + +#if OPTIMIZED_HWC_MOBILE + E_FREE(src_rects); + E_FREE(dst_rects); + E_FREE(comp_method); +#endif +} + +Eina_Bool +_hwcomp_mod_mobile_verify_update_mode(E_Comp_HWComp *hwcomp, E_Comp_HWComp_Update *hwc_update) +{ + E_Comp *c = NULL; + E_Comp_Canvas *canvas = NULL; + E_Zone *zone = NULL; + E_Comp_Layer *ly = NULL; + Eina_Bool effect_status = EINA_FALSE, move_status = EINA_FALSE, rotation_status = EINA_FALSE; + + E_Comp_Win *cw; + E_Comp_Object *co = NULL, *_co = NULL; + Eina_List *l; + Eina_Bool check_nocomp = EINA_TRUE; + int hybrid_idx = 0; + const char *name = NULL; + +#if OPTIMIZED_HWC_MOBILE + Eina_Rectangle total_rect = {0,}; + Eina_Bool miniapp = EINA_FALSE; + Eina_Bool keyboard = EINA_FALSE; + Eina_Bool magnifier = EINA_FALSE; + Eina_Bool clipboard = EINA_FALSE; + Eina_Bool split_launcher = EINA_FALSE; + Eina_Rectangle clipboard_rect = {0,}; + Eina_Rectangle zone_rect = {0,}; +#endif + + c = hwcomp->c; + E_CHECK_RETURN(c, 0); + + canvas = hwcomp->canvas; + E_CHECK_RETURN(canvas, 0); + + zone = canvas->zone; + E_CHECK_RETURN(zone, 0); + +#if OPTIMIZED_HWC_MOBILE + zone_rect.x = zone->x; + zone_rect.y = zone->y; + zone_rect.w = zone->h; + zone_rect.h = zone->h; +#endif + + /* pre-check full composite condition */ + ly = e_mod_comp_canvas_layer_get(canvas, "effect"); + if (ly) + effect_status = evas_object_visible_get(ly->layout); + ly = e_mod_comp_canvas_layer_get(canvas, "move"); + if (ly) + move_status = evas_object_visible_get(ly->layout); + if ((canvas->zone) && (canvas->zone->rot.block_count)) + rotation_status = EINA_TRUE; + + /* + * basically canvas->ee_win always will be set at top layer0 + * this drawable drawn by GLES + */ + hwc_update->hwc_drawable[0]->cw = NULL; + hwc_update->hwc_drawable[0]->d = canvas->ee_win; + hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + +#if OPTIMIZED_HWC_MOBILE + hwc_update->hwc_drawable[0]->first_update = 0; + +#if DEBUG_HWC + hwc_update->hwc_drawable[0]->update_count = 0; //for debugging +#endif + +#endif + + if (hwcomp_util_max_layer_get() == 1) + goto full_comp; + + if (hwcomp->force_composite) + goto full_comp; + +#if HWC_ROTATION_PATCH + if (hwcomp->doing_rotation) + goto full_comp; +#endif + + /* full composite */ + if (effect_status == EINA_TRUE) + goto full_comp; + if (move_status == EINA_TRUE) + goto full_comp; + if (rotation_status == EINA_TRUE) + goto full_comp; + + /* + * I have 2 special cases + * + * CASE 1 : 1 full screen app overlapes full screen + * + * CASE 2: Some windows are can be set at HW layer + * - If num of windows are bigger than "hwcomp->num_overlays-1" additional algorithm should be used. + */ + EINA_INLIST_REVERSE_FOREACH(c->wins, cw) + { + EINA_LIST_FOREACH(cw->objs, l, co) + { + if (!co) continue; + if (co->canvas != canvas) continue; + + _co = co; + break; + } + + if ((_co) && (cw->bd) && (cw->bd->client.win) && + (!cw->shaped) && (!cw->rects) && (cw->hwc.set_drawable)) + { + int abs_x, abs_y, abs_w, abs_h; + + name = hwcomp_util_border_name_get(cw->bd); + +#if OPTIMIZED_HWC_MOBILE + abs_x = cw->x; + abs_y = cw->y; + abs_w = cw->w; + abs_h = cw->h; +#else + ecore_x_window_geometry_get(cw->win, &abs_x, &abs_y, &abs_w, &abs_h); +#endif + + if (E_CONTAINS(zone->x, zone->y, zone->w, zone->h, abs_x, abs_y, abs_w, abs_h) || (name && !strcmp(name, "SPLIT_LAUNCHER"))) + { + /* check nocomp mode with the first cw once */ + if (check_nocomp && REGION_EQUAL_TO_ZONE(cw, zone) && cw->use_dri2 && (!cw->argb) + && !cw->hwc.resize_pending) + { + hwc_update->update_mode = E_HWCOMP_USE_NOCOMP_MODE; + hwc_update->num_drawable = 1; + hwc_update->hwc_drawable[0]->cw = cw; + hwc_update->hwc_drawable[0]->d = cw->bd->client.win; + hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + +#if OPTIMIZED_HWC_MOBILE + hwc_update->hwc_drawable[0]->first_update = 0; +#if DEBUG_HWC + hwc_update->hwc_drawable[0]->update_count = 0; //for debugging +#endif + +#endif + goto done; + } + else + { + if (check_nocomp) check_nocomp = EINA_FALSE; + } + + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x name:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.name); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x class:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.class); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x title:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.title); + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|VERIFY_UPDATE:win id:0x%08x iconname:%s", "HWC:NAME", cw->win, cw->bd->client.icccm.icon_name); + /* skip the cw if the cw is not the use_dri2 */ + if (!cw->use_dri2 && !cw->argb) + continue; + + /* skip the cw is the Key Magnifier */ +#if OPTIMIZED_HWC_MOBILE + if (name && !strcmp(name, "Key Magnifier")) + { + + magnifier = EINA_TRUE; + hwc_update->keymag_rect.x = cw->x; + hwc_update->keymag_rect.y = cw->y; + hwc_update->keymag_rect.w = cw->w; + hwc_update->keymag_rect.h = cw->h; + + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|KM_RECT rect(%d,%d,%d,%d)", "HWC:RECT", cw->x, cw->y, cw->w, cw->h); + + continue; + } +#else + if (cw->bd->client.icccm.name && !strcmp(cw->bd->client.icccm.name, "Key Magnifier")) + continue; +#endif + + /* skip the cw is the Prediction Window */ +#if OPTIMIZED_HWC_MOBILE + if (cw->argb && name && !strcmp(name, "Prediction Window")) + continue; +#else + if ( cw->argb && (cw->bd->client.icccm.name && !strcmp(cw->bd->client.icccm.name, "Prediction Window"))) + continue; +#endif + +#if OPTIMIZED_HWC_MOBILE + /* skip the cw is the Key Board / Clipboard */ + if (name && !strcmp(name, "Virtual Keyboard")) + { + keyboard = EINA_TRUE; + hwc_update->ime_rect.x = cw->x; + hwc_update->ime_rect.y = cw->y; + hwc_update->ime_rect.w = cw->w; + hwc_update->ime_rect.h = cw->h; + continue; + } + + if (name && !strcmp(name, "Clipboard History Manager")) + { + clipboard = EINA_TRUE; + clipboard_rect.x = cw->x; + clipboard_rect.y = cw->y; + clipboard_rect.w = cw->w; + clipboard_rect.h = cw->h; + continue; + } + + if (name && !strcmp(name, "SPLIT_LAUNCHER")) + { + split_launcher = EINA_TRUE; + hwc_update->split_launcher_rect.x = cw->x; + hwc_update->split_launcher_rect.y = cw->y; + hwc_update->split_launcher_rect.w = cw->w; + hwc_update->split_launcher_rect.h = cw->h; + eina_rectangle_intersection(&(hwc_update->split_launcher_rect), &zone_rect); + continue; + } + + if (STATE_INSET_CHECK(cw) || (!cw->argb && (cw->w < zone->w || cw->h < zone->h))) + { + if (hwcomp_util_check_fullcomp_mode(cw) != EINA_TRUE) + { + e_mod_comp_win_hwcomp_mask_objs_hide(cw); + miniapp = EINA_TRUE; + continue; + } + else + goto full_comp; + } +#endif + /* argb */ + if (cw->argb) + goto full_comp; + + if (hybrid_idx < hwc_update->num_overlays-1) + { + hybrid_idx++; + + /* I think there are some windows which is no full screen */ + /* Mini app || Splited window || No magnifier of keypad */ + hwc_update->update_mode = E_HWCOMP_USE_HYBRIDCOMP_MODE; + hwc_update->num_drawable = hybrid_idx + 1; + hwc_update->hwc_drawable[hybrid_idx]->cw = cw; + hwc_update->hwc_drawable[hybrid_idx]->d = cw->bd->client.win; +#if OPTIMIZED_HWC_MOBILE + +#if DEBUG_HWC + hwc_update->hwc_drawable[hybrid_idx]->update_count = 0; //for debugging +#endif + + if (hwc_update->keymag_present == EINA_FALSE && + hwc_update->ime_present == EINA_FALSE) + /* Calculate all rects with union */ + { + Eina_Rectangle this_rect; + this_rect.x = cw->x; + this_rect.y = cw->y; + this_rect.w = cw->w; + this_rect.h = cw->h; + + eina_rectangle_union(&total_rect, &this_rect); + } +#endif + + if ((REGION_EQUAL_TO_ZONE(cw, zone) && (!cw->argb))) break; + } + } + /* full composite */ + else if (E_INTERSECTS(zone->x, zone->y, zone->w, zone->h, abs_x, abs_y, abs_w, abs_h)) + goto full_comp; + + /* full composite */ + if (hwcomp_util_check_fullcomp_mode(cw) == EINA_TRUE) + goto full_comp; + + } + else if ((_co) && (cw->redirected) && (!cw->bd) && + (!cw->shaped) && (!cw->rects) && (cw->hwc.set_drawable)) + goto full_comp; + } + if (hwc_update->num_drawable == 0) + { +#if HWC_ROTATION_PATCH + goto full_comp; +#else + return EINA_FALSE; +#endif + } + +#if OPTIMIZED_HWC_MOBILE + + if (!magnifier && !keyboard && !clipboard + && !miniapp && !split_launcher && hwc_update->update_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE + && total_rect.x == zone->x && total_rect.y == zone->y + && total_rect.w == zone->w && total_rect.h == zone->h) + { + //update the drawables + int idx = 0; + for (idx = 0; idx < hwc_update->num_drawable - 1; idx++) + { + hwc_update->hwc_drawable[idx]->cw = hwc_update->hwc_drawable[idx+1]->cw; + hwc_update->hwc_drawable[idx]->d = hwc_update->hwc_drawable[idx+1]->d; + hwc_update->hwc_drawable[idx]->set_drawable = EINA_TRUE; + +#if DEBUG_HWC + hwc_update->hwc_drawable[idx]->update_count = hwc_update->hwc_drawable[idx+1]->update_count; //for debugging +#endif + } + hwc_update->num_drawable--; + } + +#endif + +done: +#if OPTIMIZED_HWC_MOBILE + hwc_update->hwcomp->miniapp_present = miniapp; + hwc_update->ime_present = keyboard; + hwc_update->keymag_present = magnifier; + hwc_update->split_launcher_rect_present = split_launcher; + + if (keyboard && clipboard) + { + if ((hwc_update->ime_rect.w * hwc_update->ime_rect.h) < (clipboard_rect.w * clipboard_rect.h)) + { + hwc_update->ime_rect.x = clipboard_rect.x; + hwc_update->ime_rect.y = clipboard_rect.y; + hwc_update->ime_rect.w = clipboard_rect.w; + hwc_update->ime_rect.h = clipboard_rect.h; + } + } +#endif + + return EINA_TRUE; + +full_comp: + hwcomp_util_update_clear(hwc_update); + + hwc_update->update_mode = E_HWCOMP_USE_FULLCOMP_MODE; + hwc_update->num_drawable = 1; + hwc_update->hwc_drawable[0]->cw = NULL; + hwc_update->hwc_drawable[0]->d = canvas->ee_win; + hwc_update->hwc_drawable[0]->set_drawable = EINA_TRUE; + + return EINA_TRUE; +} +#endif /* End of HWC */ + diff --git a/src/hwcomp/hwcomp_mobile.h b/src/hwcomp/hwcomp_mobile.h new file mode 100644 index 0000000..1e42332 --- /dev/null +++ b/src/hwcomp/hwcomp_mobile.h @@ -0,0 +1,13 @@ +#ifdef E_TYPEDEFS +#else +#ifndef HWCOMP_MOBILE_H +#define HWCOMP_MOBILE_H + +Eina_Bool _hwcomp_mod_mobile_mobile_init(E_Comp *c); + +#ifdef USE_HWC +void _hwcomp_mod_mobile_update_set_drawables(E_Comp_HWComp_Update *hwc_update, Ecore_X_Window win); +Eina_Bool _hwcomp_mod_mobile_verify_update_mode(E_Comp_HWComp *hwcomp, E_Comp_HWComp_Update *hwc_update); +#endif /* End of USE_HWC */ +#endif /* End of HWCOMP_MOBILE_H */ +#endif /* End of E_TYPEDEFS */ diff --git a/src/hwcomp/hwcomp_util.c b/src/hwcomp/hwcomp_util.c new file mode 100644 index 0000000..b8c9c59 --- /dev/null +++ b/src/hwcomp/hwcomp_util.c @@ -0,0 +1,517 @@ +#include "e_mod_comp_shared_types.h" +#include "e_mod_comp.h" +#include "e_mod_comp_atoms.h" +#include "e_mod_comp_debug.h" + +#include + +#include "hwcomp_debug.h" +#include "hwcomp_util.h" + +#ifdef USE_HWC + +#define E_HWCOMP_COMP_COUNTDOWN 30 +#define E_HWCOMP_SET_COUNTDOWN 1 + +static Eina_Bool _hwc_available = EINA_FALSE; +static int _hwc_max_layer; +static int _hwc_major, _hwc_minor; +static Ecore_X_Display *_display = NULL; +static int _hwc_op_code; + +EAPI void +hwcomp_util_hwcomp_enable(Ecore_X_Window win) +{ + int hwc_event, hwc_error; + _hwc_major = 2; + _hwc_minor = 0; + + if (!_display) _display = ecore_x_display_get(); + + if (XQueryExtension(_display, HWC_NAME, &_hwc_op_code, &hwc_event, &hwc_error)) + { + HWCQueryVersion(_display, &_hwc_major, &_hwc_minor); + if (!HWCOpen(_display, 0, &_hwc_max_layer)) /* TODO: Get active CRTC */ + { + _hwc_available = EINA_FALSE; + return; + } + HWCSelectInput(_display, win, HWCAllEvents); + _hwc_available = EINA_TRUE; + } + else + _hwc_available = EINA_FALSE; +} + +EAPI Ecore_X_Display* +hwcomp_util_display_get(void) +{ + return _display; +} + +EAPI Eina_Bool +hwcomp_util_hwcomp_query(void) +{ + return _hwc_available; +} + +EAPI int +hwcomp_util_max_layer_get(void) +{ + return _hwc_max_layer; +} + +EAPI void +hwcomp_util_max_layer_set(int maxLayer) +{ + _hwc_max_layer = maxLayer; +} + +EAPI int +hwcomp_util_get_event_data(Ecore_X_Event_Generic *e) +{ + if (!e) return -1; + + if (e->extension == _hwc_op_code && e->evtype == HWCConfigureNotify) + { + HWCConfigureNotifyCookie *data = (HWCConfigureNotifyCookie *)e->data; + return data->maxLayer; + } + return -1; +} + +EAPI void +hwcomp_util_turn_composite(E_Comp_HWComp *hwcomp, Eina_Bool on) +{ + + E_Comp_Canvas *canvas = hwcomp->canvas; + Eina_Bool manual_render_set = !on; + + if (ecore_evas_manual_render_get(canvas->ee) != manual_render_set) + ecore_evas_manual_render_set(canvas->ee, manual_render_set); +} + +EAPI Eina_Bool +hwcomp_util_check_fullcomp_mode(E_Comp_Win *cw) +{ + Eina_Bool ret = EINA_FALSE; + + /* Mini app */ + if (STATE_INSET_CHECK(cw) && cw->bd->lock_user_location) + ret = EINA_TRUE; + + /* Resizing of window */ + if (cw->needpix) + ret= EINA_TRUE; + + /* Moving of window */ + if ((STATE_INSET_CHECK(cw) || CLASS_ICONIC_CHECK(cw)) && + cw->hwc.geo_changed) + { + cw->hwc.geo_changed--; + ret= EINA_TRUE; + } + + /* split */ + if (cw->bd->client.e.state.ly.curr_ly) + ret= EINA_TRUE; + + return ret; +} + +EAPI const char* +hwcomp_util_border_name_get(E_Border *bd) +{ + if (!bd) return NULL; + + if (bd->client.icccm.name && strcmp(bd->client.icccm.name, "NORMAL_WINDOW")) + return bd->client.icccm.name; + else if (bd->client.netwm.name) + return bd->client.netwm.name; + else if (bd->client.icccm.class) + return bd->client.icccm.class; + else + return NULL; +} + +EAPI void +hwcomp_util_dec_set_countdown(E_Comp_HWComp_Drawable *d) +{ + if (d->set_countdown <= 0) return; + + d->set_countdown--; +} + +EAPI void +hwcomp_util_reset_set_countdown(E_Comp_HWComp_Drawable *d) +{ + d->set_countdown = E_HWCOMP_SET_COUNTDOWN; +} + +EAPI void +hwcomp_util_dec_comp_countdown(E_Comp_HWComp_Drawable *d) +{ + if (d->comp_countdown <= 0) return; + + d->comp_countdown--; +} + +EAPI void +hwcomp_util_reset_comp_countdown(E_Comp_HWComp_Drawable *d) +{ + d->comp_countdown = E_HWCOMP_COMP_COUNTDOWN; +} + +EAPI Eina_Bool +hwcomp_util_update_check_region(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw, int w, int h, int max_w, int max_h) +{ + Eina_Bool ret = EINA_FALSE; + int area = 0; + int max = max_w*max_h/2; + + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s| d:%p (%dx%d)", "HWC:WIN REGION", + cw->bd->client.win, w, h); + + area = w * h; + if (area > max) + ret = EINA_TRUE; + +#if OPTIMIZED_HWC_MOBILE + return EINA_TRUE; +#else + return ret; +#endif + +} + +EAPI void +hwcomp_util_update_countdown(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw) +{ + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + int i = 0; + int num_drawable = 0; + + if (hwc_update->update_mode != E_HWCOMP_USE_HYBRIDCOMP_MODE) return; + + num_drawable = hwc_update->num_drawable; + + for (i = 0; i < num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + + if (hwc_drawable && hwc_drawable->cw == cw) + { + if (hwc_drawable->set_drawable) + { + hwcomp_util_reset_comp_countdown(hwc_drawable); + + if (i != 0 && hwc_drawable->first_update) + { + hwc_drawable->set_drawable = EINA_FALSE; + hwc_drawable->first_update = 0; + } + } + else + { + if (hwc_drawable->region_update) + { + hwcomp_util_dec_set_countdown(hwc_drawable); + hwc_drawable->region_update = EINA_FALSE; + } + } + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s| client.win: %p set:%d set_cnt:%d comp_cnt:%d fu(%d)", + "HWC:CW Update", cw->bd->client.win, hwc_drawable->set_drawable, hwc_drawable->set_countdown, hwc_drawable->comp_countdown, hwc_drawable->first_update); + } + } +} + +EAPI Eina_Bool +hwcomp_util_update_check_resized(E_Comp_HWComp_Update *hwc_update) +{ + int i; + + for (i = 0; i < hwc_update->num_drawable; i++) + { + if (hwc_update->hwc_drawable[i]->resized) + return EINA_TRUE; + } + + return EINA_FALSE; +} + +EAPI void +hwcomp_util_update_unset_resized(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw) +{ + int i; + for (i = 0; i < hwc_update->num_drawable; i++) + { + if (cw == hwc_update->hwc_drawable[i]->cw) + { + if (hwc_update->hwc_drawable[i]->resized) + { + hwc_update->hwc_drawable[i]->resized = EINA_FALSE; + break; + } + } + } +} + +EAPI void +hwcomp_util_update_set_resized(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw) +{ + int i; + + for (i = 0; i < hwc_update->num_drawable; i++) + { + if (cw == hwc_update->hwc_drawable[i]->cw) + { + hwc_update->hwc_drawable[i]->resized = EINA_TRUE; + break; + } + } +} + +EAPI Eina_Bool +hwcomp_util_update_check_comp(E_Comp_HWComp_Update *hwc_update) +{ + return hwc_update->comp_update; +} + +EAPI void +hwcomp_util_update_set_comp(E_Comp_HWComp_Update *hwc_update, Eina_Bool comp_update) +{ + if (hwc_update->comp_update == comp_update) return; + + hwc_update->comp_update = comp_update; +} + + +EAPI Eina_Bool +hwcomp_util_update_compare_drawables(E_Comp_HWComp_Update *cur_hwc_update, E_Comp_HWComp_Update *new_hwc_update) +{ + E_Comp_HWComp_Drawable *cur_d = NULL; + E_Comp_HWComp_Drawable *new_d = NULL; + int i; + + if (cur_hwc_update->num_drawable != new_hwc_update->num_drawable) + return EINA_FALSE; + + for (i = 0; i < cur_hwc_update->num_drawable; i++) + { + cur_d = cur_hwc_update->hwc_drawable[i]; + new_d = new_hwc_update->hwc_drawable[i]; + + if (cur_d->d != new_d->d) + return EINA_FALSE; + +#if OPTIMIZED_HWC_MOBILE + if (cur_hwc_update->ime_present && new_hwc_update->ime_present) + { + _hwcomp_dbg_elbf(ELBT_COMP, 0, 0, "%15.15s|ime_old(%d,%d,%d,%d)->ime_new(%d,%d,%d,%d)", "HWC:IME", + cur_hwc_update->ime_rect.x, cur_hwc_update->ime_rect.y, cur_hwc_update->ime_rect.w, cur_hwc_update->ime_rect.h, + new_hwc_update->ime_rect.x, new_hwc_update->ime_rect.y, new_hwc_update->ime_rect.w, new_hwc_update->ime_rect.h); + + if (cur_hwc_update->ime_rect.x != new_hwc_update->ime_rect.x) + return EINA_FALSE; + + if (cur_hwc_update->ime_rect.y != new_hwc_update->ime_rect.y) + return EINA_FALSE; + + if (cur_hwc_update->ime_rect.w != new_hwc_update->ime_rect.w) + return EINA_FALSE; + + if (cur_hwc_update->ime_rect.h != new_hwc_update->ime_rect.h) + return EINA_FALSE; + } +#endif + } + return EINA_TRUE; +} + +EAPI void +hwcomp_util_update_migrate_drawables(E_Comp_HWComp_Update *cur_hwc_update, E_Comp_HWComp_Update *new_hwc_update) +{ + E_Comp_HWComp_Drawable *cur_d = NULL; + E_Comp_HWComp_Drawable *new_d = NULL; + int i, j; + + for (i = 0; i < new_hwc_update->num_drawable; i++) + { + new_d = new_hwc_update->hwc_drawable[i]; + for (j = 0; j < cur_hwc_update->num_drawable; j++) + { + cur_d = cur_hwc_update->hwc_drawable[i]; + if (cur_d->d == new_d->d) + { + new_d->comp_countdown = cur_d->comp_countdown; + new_d->set_countdown = cur_d->set_countdown; + new_d->set_drawable = cur_d->set_drawable; + new_d->first_update = cur_d->first_update; + new_d->update_count = cur_d->update_count; + + break; + } + } + } +} + +EAPI void +hwcomp_util_update_destroy_drawable(E_Comp_HWComp_Update *hwc_update) +{ + int i; + E_Comp_Win *hide_cw = NULL; + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + + for (i = 1; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + hide_cw = hwc_drawable->cw; + if (hwc_update->update_mode == E_HWCOMP_USE_HYBRIDCOMP_MODE && + hide_cw->hwc.set_drawable == EINA_FALSE) + e_mod_comp_win_hwcomp_mask_objs_hide(hide_cw); + } + + if (hwc_update->hwc_drawable) + { + for (i = 0; i < hwc_update->num_overlays; i++) + { + if (!hwc_update->hwc_drawable[i]) + { + E_FREE(hwc_update->hwc_drawable[i]); + hwc_update->hwc_drawable[i] = NULL; + } + } + E_FREE(hwc_update->hwc_drawable); + hwc_update->hwc_drawable = NULL; + } +} + +EAPI Eina_Bool +hwcomp_util_update_create_drawable(E_Comp_HWComp_Update *hwc_update) +{ + int i; + int num = hwc_update->num_overlays; + + hwc_update->hwc_drawable = E_NEW(E_Comp_HWComp_Drawable *, num); + E_CHECK_RETURN(hwc_update->hwc_drawable, 0); + memset(hwc_update->hwc_drawable, 0x0, num * sizeof(E_Comp_HWComp_Drawable *)); + + for (i = 0; i < num; i++) + { + hwc_update->hwc_drawable[i] = E_NEW(E_Comp_HWComp_Drawable, 1); + if (!hwc_update->hwc_drawable[i]) goto fail; + } + + return EINA_TRUE; +fail: + hwcomp_util_update_destroy_drawable(hwc_update); + + return EINA_FALSE; +} + +EAPI void +hwcomp_util_update_clear_drawable(E_Comp_HWComp_Update *hwc_update) +{ + int i; + + for (i = 0; i < hwc_update->num_overlays; i++) + { + memset(hwc_update->hwc_drawable[i], 0x0, sizeof(E_Comp_HWComp_Drawable)); + } +} + +EAPI void +hwcomp_util_update_destroy(E_Comp_HWComp_Update *hwc_update) +{ + if (!hwc_update) return; + + hwcomp_util_update_destroy_drawable(hwc_update); + + E_FREE(hwc_update); + hwc_update = NULL; +} + +EAPI E_Comp_HWComp_Update * +hwcomp_util_update_create(E_Comp_HWComp *hwcomp, int num) +{ + E_Comp_HWComp_Update *hwc_update = NULL; + Eina_Bool ret = EINA_FALSE; + + hwc_update = E_NEW(E_Comp_HWComp_Update, 1); + E_CHECK_RETURN(hwc_update, 0); + + hwc_update->update_mode = E_HWCOMP_USE_INVALID; + hwc_update->num_overlays = num; + ret = hwcomp_util_update_create_drawable(hwc_update); + if (ret == EINA_FALSE) + { + hwcomp_util_update_destroy(hwc_update); + return NULL; + } + hwc_update->num_drawable = 0; + hwc_update->comp_update = EINA_FALSE; + + hwc_update->hwcomp = hwcomp; + + return hwc_update; +} + +EAPI void +hwcomp_util_update_clear(E_Comp_HWComp_Update *hwc_update) +{ + int i; + E_Comp_Win *hide_cw = NULL; + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + + for (i = 1; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + hide_cw = hwc_drawable->cw; + e_mod_comp_win_hwcomp_mask_objs_hide(hide_cw); + } + + hwc_update->update_mode = E_HWCOMP_USE_INVALID; + hwc_update->num_drawable = 0; + hwc_update->comp_update = EINA_FALSE; + hwcomp_util_update_clear_drawable(hwc_update); +} + +EAPI void +hwcomp_util_update_reset_maskobj(E_Comp_HWComp_Update *hwc_update) +{ + E_CHECK(hwc_update); + int i; + E_Comp_Win *hide_cw = NULL; + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + + for (i = 1; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + hide_cw = hwc_drawable->cw; + if (hide_cw) + e_mod_comp_win_hwcomp_mask_objs_hide(hide_cw); + } +} + +EAPI void +hwcomp_util_set_hybrid_composite(E_Comp_HWComp_Update *hwc_update) +{ + E_CHECK(hwc_update); + + E_Comp_HWComp_Drawable *hwc_drawable = NULL; + int i; + + for (i = 1; i < hwc_update->num_drawable; i++) + { + hwc_drawable = hwc_update->hwc_drawable[i]; + hwc_drawable->set_drawable = EINA_TRUE; + hwc_drawable->first_update = 1; + hwcomp_util_reset_comp_countdown(hwc_drawable); + hwcomp_util_reset_set_countdown(hwc_drawable); + } +} +#endif /* End of USE_HWC */ + + + + diff --git a/src/hwcomp/hwcomp_util.h b/src/hwcomp/hwcomp_util.h new file mode 100644 index 0000000..a229d9a --- /dev/null +++ b/src/hwcomp/hwcomp_util.h @@ -0,0 +1,44 @@ +#ifdef E_TYPEDEFS +#else +#ifndef HWCOMP_UTIL_H +#define HWCOMP_UTIL_H + +#ifdef USE_HWC +EAPI void hwcomp_util_hwcomp_enable(Ecore_X_Window win); +EAPI Ecore_X_Display* hwcomp_util_display_get(void); +EAPI Eina_Bool hwcomp_util_hwcomp_query(void); +EAPI int hwcomp_util_max_layer_get(void); +EAPI void hwcomp_util_max_layer_set(int maxLayer); +EAPI int hwcomp_util_get_event_data(Ecore_X_Event_Generic *e); +EAPI void hwcomp_util_turn_composite(E_Comp_HWComp *hwcomp, Eina_Bool on); +EAPI Eina_Bool hwcomp_util_check_fullcomp_mode(E_Comp_Win *cw); + +EAPI const char* hwcomp_util_border_name_get(E_Border *bd); + +EAPI void hwcomp_util_dec_set_countdown(E_Comp_HWComp_Drawable *d); +EAPI void hwcomp_util_reset_set_countdown(E_Comp_HWComp_Drawable *d); +EAPI void hwcomp_util_dec_comp_countdown(E_Comp_HWComp_Drawable *d); +EAPI void hwcomp_util_reset_comp_countdown(E_Comp_HWComp_Drawable *d); + +EAPI void hwcomp_util_update_countdown(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw); +EAPI Eina_Bool hwcomp_util_update_check_region(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw, int w, int h, int max_w, int max_h); +EAPI Eina_Bool hwcomp_util_update_check_resized(E_Comp_HWComp_Update *hwc_update); +EAPI void hwcomp_util_update_unset_resized(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw); +EAPI void hwcomp_util_update_set_resized(E_Comp_HWComp_Update *hwc_update, E_Comp_Win *cw); +EAPI Eina_Bool hwcomp_util_update_check_comp(E_Comp_HWComp_Update *hwc_update); +EAPI void hwcomp_util_update_set_comp(E_Comp_HWComp_Update *hwc_update, Eina_Bool comp_update); + +EAPI Eina_Bool hwcomp_util_update_compare_drawables(E_Comp_HWComp_Update *cur_hwc_update, E_Comp_HWComp_Update *new_hwc_update); +EAPI void hwcomp_util_update_migrate_drawables(E_Comp_HWComp_Update *cur_hwc_update, E_Comp_HWComp_Update *new_hwc_update); +EAPI void hwcomp_util_update_destroy_drawable(E_Comp_HWComp_Update *hwc_update); +EAPI Eina_Bool hwcomp_util_update_create_drawable(E_Comp_HWComp_Update *hwc_update); +EAPI void hwcomp_util_update_clear_drawable(E_Comp_HWComp_Update *hwc_update); +EAPI void hwcomp_util_update_destroy(E_Comp_HWComp_Update *hwc_update); +EAPI E_Comp_HWComp_Update * hwcomp_util_update_create(E_Comp_HWComp *hwcomp, int num); +EAPI void hwcomp_util_update_clear(E_Comp_HWComp_Update *hwc_update); + +EAPI void hwcomp_util_update_reset_maskobj(E_Comp_HWComp_Update *hwc_update); +EAPI void hwcomp_util_set_hybrid_composite(E_Comp_HWComp_Update *hwc_update); +#endif /* End of USE_HWC */ +#endif /* End of HWCOMP_UTIL_H */ +#endif /* End of E_TYPEDEFS */ -- 2.7.4