From: WooHyun Jung Date: Tue, 8 Mar 2011 03:37:21 +0000 (+0900) Subject: [Rollback] X-Git-Tag: 2.0_alpha~229 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee5a1348527679ee449c114e80d683eb9c4ff79b;p=framework%2Fuifw%2Fecore.git [Rollback] --- diff --git a/AUTHORS b/AUTHORS index c8f7095..c86d644 100644 --- a/AUTHORS +++ b/AUTHORS @@ -36,5 +36,3 @@ Brett Nash Mike Blumenkrantz Leif Middelschulte Mike McCormack -Sangho Park -Jihoon Kim diff --git a/ChangeLog b/ChangeLog index dfbf4be..ee16b53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,83 +1,4 @@ -2011-01-29 Carsten Haitzler (The Rasterman) - - 1.0.0 release - -2011-01-29 Mike McCormack - - * Convert fd list to inlist to save allocs - -2011-01-29 Rui Miguel Silva Seabra - - * make https not fail (that's curl's responsibility, really). - -2011-01-31 Carsten Haitzler (The Rasterman) - - * Fix: ecore-evas CAN send "render done" messages even if not - waiting for sync counter when using gl engine. new semi-sync - mode to account for that. - -2011-02-01 Mike McCormack - - * Remove SIGRT from ecore's signals since it's unused and broken - -2011-02-09 Mathieu Taillefumier - - * Add xrandr backlight support to ecore_x - -2011-02-10 Mike Blumenkrantz - - * Added some more possibly useless safety checks to ecore_con_ares - - * Implement event-driven error message api for all non-curl ecore_con - +ECORE_CON_EVENT_CLIENT_ERROR, ECORE_CON_EVENT_SERVER_ERROR events - +Ecore_Con_Event_Server_Error, Ecore_Con_Event_Client_Error types - - * Unify event handler code - * Always increment server event count for client events - -2011-02-11 Mike Blumenkrantz - - * Added ecore_con_client_port_get - -2011-02-16 Sangho Park - - * Added ecore_file_download_full API. - -2011-02-20 Vincent Torri - - * Ecore_Win32: improve resize of windows and fix key up event for - the 'space' key. - * Ecore_WinCE: do not erase a window background - -2011-02-21 Jihoon Kim - - * Add get calls in ecore_imf for ecore_imf_context_canvas_get() and - ecore_imf_context_window_get(). - -2011-02-21 Raoul Hecky - - * Remove 300 second timeout so large downloads work in ecore_con. - -2011-02-22 Carsten Haitzler (The Rasterman) - - * Fix: ecore-file inotify fd would be duplicated in children - on fork. Have it detecti this on next monitor add and re-init the - inotify fd and fd handler. - -2011-02-24 Vincent Torri - - * Ecore_File: fix compilation when ecore_con and curl are not - available - -2011-02-27 Jihoon Kim - - * Add ecore_imf_context_preedit_string_with_attributes_get API. - -2011-03-01 Raoul Hecky - - * Add ecore_con_url_ssl_verify_peer_set API. - -2011-03-01 Guillaume Friloux - - * Fix detection of complete file write in ecore_file inotify. +Wed Jun 8 16:56:30 2005 Michael Jennings (mej) +Fix spec file. +---------------------------------------------------------------------- diff --git a/autogen.sh b/autogen.sh index 77515c5..0a59462 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,9 @@ #!/bin/sh +rm -rf autom4te.cache +rm -f aclocal.m4 ltmain.sh + touch README -touch ABOUT-NLS echo "Running autopoint..." ; autopoint -f || : echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1 @@ -11,5 +13,5 @@ echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --au echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1 if [ -z "$NOCONFIGURE" ]; then - ./configure -C "$@" + ./configure "$@" fi diff --git a/configure.ac b/configure.ac index d0f8d44..ff3d7c3 100644 --- a/configure.ac +++ b/configure.ac @@ -2,11 +2,11 @@ ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## m4_define([v_maj], [1]) m4_define([v_min], [0]) -m4_define([v_mic], [999]) +m4_define([v_mic], [0]) m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n'])) m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))]) ##-- When released, remove the dnl on the below line -dnl m4_undefine([v_rev]) +m4_undefine([v_rev]) ##-- When doing snapshots - change soname. remove dnl on below line dnl m4_define([relname], [ver-pre-svn-07]) dnl m4_define([v_rel], [-release relname]) @@ -18,7 +18,7 @@ m4_define([lt_age], v_min) ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## -AC_INIT([ecore], [v_ver], [enlightenment-devel@lists.sourceforge.net]) +AC_INIT([ecore], [v_ver.beta3], [enlightenment-devel@lists.sourceforge.net]) AC_PREREQ([2.52]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_MACRO_DIR([m4]) @@ -64,6 +64,7 @@ AM_GNU_GETTEXT_VERSION([0.12.1]) m4_ifdef([AM_GNU_GETTEXT], [ AM_GNU_GETTEXT([external]) +po_makefile_in=po/Makefile.in AM_CONDITIONAL([HAVE_PO], [true]) ],[ AM_CONDITIONAL([HAVE_PO], [false]) @@ -1369,6 +1370,8 @@ ECORE_EVAS_CHECK_MODULE([software-16-wince], [${have_ecore_wince}], [requirements_ecore_evas="ecore-wince >= 1.0.0 ${requirements_ecore_evas}"]) + + ### requirements AC_SUBST(requirements_ecore) @@ -1389,7 +1392,7 @@ AC_SUBST(requirements_ecore_x) AC_SUBST(requirements_ecore_win32) AC_SUBST(requirements_ecore_wince) -AC_CONFIG_FILES([ +AC_OUTPUT([ Makefile ecore-con.pc ecore-config.pc @@ -1435,12 +1438,9 @@ src/lib/ecore_x/xcb/Makefile src/tests/Makefile README ecore.spec +$po_makefile_in ]) -m4_ifdef([AM_GNU_GETTEXT], [AC_CONFIG_FILES([po/Makefile.in])]) - -AC_OUTPUT - echo echo "$PACKAGE $VERSION" echo diff --git a/doc/ecore.dox.in b/doc/ecore.dox.in index a92a2cb..07e0b15 100644 --- a/doc/ecore.dox.in +++ b/doc/ecore.dox.in @@ -11,47 +11,43 @@ These routines are used for Ecore Library interaction @image html e.png @version @PACKAGE_VERSION@ -@author Carsten Haitzler -@author Tom Gilbert -@author Burra -@author Chris Ross -@author Term -@author Tilman Sauerbeck -@author Ibukun Olumuyiwa -@author Yuri -@author Nicholas Curran -@author Howell Tam -@author Nathan Ingersoll -@author Andrew Elcock -@author Kim Woelders -@author Sebastian Dransfeld -@author Simon Poole -@author Jorge Luis Zapata Muga -@author dan sinclair -@author Michael 'Mickey' Lauer -@author David 'onefang' Seikel -@author Hisham 'CodeWarrior' Mardam Bey -@author Brian 'rephorm' Mattern -@author Tim Horton -@author Arnaud de Turckheim 'quarium' -@author Matt Barclay -@author Peter Wehrfritz -@author Albin "Lutin" Tonnerre -@author Vincent Torri -@author Lars Munch -@author Andre Dieb -@author Mathieu Taillefumier -@author Rui Miguel Silva Seabra -@author Samsung Electronics +@author Carsten Haitzler +@author Tom Gilbert +@author Burra +@author Chris Ross +@author Term +@author Tilman Sauerbeck +@author Ibukun Olumuyiwa +@author Yuri +@author Nicholas Curran +@author Howell Tam +@author Nathan Ingersoll +@author Andrew Elcock +@author Kim Woelders +@author Sebastian Dransfeld +@author Simon Poole +@author Jorge Luis Zapata Muga +@author dan sinclair +@author Michael 'Mickey' Lauer +@author David 'onefang' Seikel +@author Hisham 'CodeWarrior' Mardam Bey +@author Brian 'rephorm' Mattern +@author Tim Horton +@author Arnaud de Turckheim 'quarium' +@author Matt Barclay +@author Peter Wehrfritz +@author Albin "Lutin" Tonnerre +@author Vincent Torri +@author Lars Munch +@author Andre Dieb +@author Mathieu Taillefumier +@author Rui Miguel Silva Seabra +@author Saumsung Electronics @author Samsung SAIT -@author Nicolas Aguirre -@author Brett Nash -@author Mike Blumenkrantz -@author Leif Middelschulte -@author Mike McCormack -@author Sangho Park -@author Jihoon Kim -@date 2000-2011 +@author Nicolas Aguirre +@author Brett Nash +@author Mike Blumenkrantz +@date 2000-2010 @section intro Introduction diff --git a/ecore.spec.in b/ecore.spec.in index 3b5682e..49a4e6b 100644 --- a/ecore.spec.in +++ b/ecore.spec.in @@ -146,7 +146,7 @@ Requires: %{name} = %{version} Ecore functions for dealing with the X Windows System %prep -%setup -q +%setup -q -n %{name}-%{version} %build CFLAGS="-I/usr/kerberos/include -I/usr/X11R6/include/X11/extensions" @@ -186,7 +186,7 @@ test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT %{_libdir}/*.a %{_libdir}/pkgconfig/* #%{_datadir}/aclocal/* -%{_includedir}/ecore-1/*.h +%{_includedir}/*.h %files con %defattr(-, root, root) diff --git a/examples/ecore_file_download_example.c b/examples/ecore_file_download_example.c deleted file mode 100644 index c03940b..0000000 --- a/examples/ecore_file_download_example.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include - -/* - * ecore_file_download() example - * - * compile with: - * gcc ecore_file_download_example.c `pkg-config --libs --cflags ecore-file` \ - * -o ecore_file_download_example - * - */ - -#define URL "http://www.kernel.org/pub/linux/kernel/v1.0/linux-1.0.tar.gz" -#define DST "linux-1.0.tar.gz" -#define DST_MIME "[x-gzip]linux-1.0.tar.gz" - - -void -completion_cb(void *data, const char *file, int status) -{ - printf("Done (status: %d)\n", status); - ecore_main_loop_quit(); -} - -int -progress_cb(void *data, const char *file, - long int dltotal, long int dlnow, - long int ultotal, long int ulnow) -{ - printf("Progress: %ld/%ld\n", dlnow, dltotal); - return ECORE_FILE_PROGRESS_CONTINUE; // continue the download -} - - -int main(void) -{ - double start; - Eina_Hash *headers; - - eina_init(); - ecore_init(); - ecore_file_init(); - - if (ecore_file_exists(DST)) - ecore_file_unlink(DST); - - start = ecore_time_get(); - - if (ecore_file_download(URL, DST, completion_cb, progress_cb, NULL, NULL)) - { - printf("Download started successfully:\n URL: %s\n DEST: %s\n", URL, DST); - ecore_main_loop_begin(); - printf("\nTime elapsed: %f seconds\n", ecore_time_get() - start); - printf("Downloaded %lld bytes\n", ecore_file_size(DST)); - } - else - { - printf("Error, can't start download\n"); - goto done; - } - - headers = eina_hash_string_small_new(NULL); - eina_hash_add(headers, "Content-type", "application/x-gzip"); - - if (ecore_file_download_full(URL, DST_MIME, completion_cb, progress_cb, NULL, NULL, headers)) - { - printf("Download started successfully:\n URL: %s\n DEST: %s\n", URL, DST_MIME); - ecore_main_loop_begin(); - printf("\nTime elapsed: %f seconds\n", ecore_time_get() - start); - printf("Downloaded %lld bytes\n", ecore_file_size(DST)); - } - else - { - printf("Error, can't start download\n"); - goto done; - } - -done: - if (headers) eina_hash_free(headers); - ecore_file_shutdown(); - ecore_shutdown(); - eina_shutdown(); - return 0; -} diff --git a/po/LINGUAS b/po/LINGUAS index 5d0de31..6359957 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,2 +1,2 @@ -cs de el fr it pt sl +cs de el fr it pt diff --git a/po/cs.po b/po/cs.po index 0761c17..e9f1b2e 100644 --- a/po/cs.po +++ b/po/cs.po @@ -4,11 +4,10 @@ msgid "" msgstr "" "Project-Id-Version: ecore\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2011-01-30 13:29-0600\n" +"POT-Creation-Date: 2010-08-16 17:14+0900\n" "PO-Revision-Date: 2009-10-27 19:35+0100\n" "Last-Translator: quaker66 \n" "Language-Team: cs \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -67,16 +66,16 @@ msgstr "CHYBA: " #: src/lib/ecore/ecore_getopt.c:853 src/lib/ecore/ecore_getopt.c:969 #: src/lib/ecore/ecore_getopt.c:982 src/lib/ecore/ecore_getopt.c:994 #: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1052 -#: src/lib/ecore/ecore_getopt.c:1160 src/lib/ecore/ecore_getopt.c:1196 +#: src/lib/ecore/ecore_getopt.c:1161 src/lib/ecore/ecore_getopt.c:1198 msgid "value has no pointer set.\n" msgstr "hodnota nemá nastaven pointer.\n" -#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1071 +#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1072 #, c-format msgid "unknown boolean value %s.\n" msgstr "neznámá boolean hodnota %s.\n" -#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1151 +#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1152 #, c-format msgid "invalid number format %s\n" msgstr "neznámý číselný formát %s\n" @@ -90,82 +89,82 @@ msgstr "neznámá volba \"%s\". Možné hodnoty jsou: " msgid "missing parameter to append.\n" msgstr "chybějící parametr k připojení.\n" -#: src/lib/ecore/ecore_getopt.c:1141 +#: src/lib/ecore/ecore_getopt.c:1142 msgid "could not parse value.\n" msgstr "nemůžu parsovat hodnotu.\n" -#: src/lib/ecore/ecore_getopt.c:1190 +#: src/lib/ecore/ecore_getopt.c:1191 msgid "missing parameter.\n" msgstr "chybějící parametr.\n" -#: src/lib/ecore/ecore_getopt.c:1203 +#: src/lib/ecore/ecore_getopt.c:1205 msgid "missing callback function!\n" msgstr "chybějící callback funkce!\n" -#: src/lib/ecore/ecore_getopt.c:1226 +#: src/lib/ecore/ecore_getopt.c:1228 msgid "no version was defined.\n" msgstr "nebyla definována verze.\n" -#: src/lib/ecore/ecore_getopt.c:1240 +#: src/lib/ecore/ecore_getopt.c:1242 msgid "no copyright was defined.\n" msgstr "nebyl definován copyright.\n" -#: src/lib/ecore/ecore_getopt.c:1254 +#: src/lib/ecore/ecore_getopt.c:1256 msgid "no license was defined.\n" msgstr "nebyla definována licence.\n" -#: src/lib/ecore/ecore_getopt.c:1308 +#: src/lib/ecore/ecore_getopt.c:1310 #, c-format msgid "ERROR: unknown option --%s, ignored.\n" msgstr "CHYBA: neznámá volba --%s, ignoruji.\n" -#: src/lib/ecore/ecore_getopt.c:1341 +#: src/lib/ecore/ecore_getopt.c:1343 #, c-format msgid "ERROR: option --%s requires an argument!\n" msgstr "CHYBA: volba --%s vyžaduje argument!\n" -#: src/lib/ecore/ecore_getopt.c:1377 +#: src/lib/ecore/ecore_getopt.c:1379 #, c-format msgid "ERROR: unknown option -%c, ignored.\n" msgstr "CHYBA: neznámá volba -%c, ignoruji.\n" -#: src/lib/ecore/ecore_getopt.c:1415 +#: src/lib/ecore/ecore_getopt.c:1417 #, c-format msgid "ERROR: option -%c requires an argument!\n" msgstr "CHYBA: volba -%c vyžaduje argument!\n" -#: src/lib/ecore/ecore_getopt.c:1614 +#: src/lib/ecore/ecore_getopt.c:1620 msgid "ERROR: no parser provided.\n" msgstr "CHYBA: nebyl poskytnut parser.\n" -#: src/lib/ecore/ecore_getopt.c:1619 +#: src/lib/ecore/ecore_getopt.c:1625 msgid "ERROR: no values provided.\n" msgstr "CHYBA: nebyly poskytnuty hodnoty.\n" -#: src/lib/ecore/ecore_getopt.c:1628 +#: src/lib/ecore/ecore_getopt.c:1634 msgid "ERROR: no arguments provided.\n" msgstr "CHYBA: nebyly poskytnuty argumenty.\n" -#: src/lib/ecore/ecore_getopt.c:1654 +#: src/lib/ecore/ecore_getopt.c:1660 msgid "ERROR: invalid options found." msgstr "CHYBA: nalezeny neplatné volby." -#: src/lib/ecore/ecore_getopt.c:1660 +#: src/lib/ecore/ecore_getopt.c:1666 #, c-format msgid " See --%s.\n" msgstr " viz. --%s.\n" -#: src/lib/ecore/ecore_getopt.c:1662 +#: src/lib/ecore/ecore_getopt.c:1668 #, c-format msgid " See -%c.\n" msgstr " viz. -%c.\n" -#: src/lib/ecore/ecore_getopt.c:1699 +#: src/lib/ecore/ecore_getopt.c:1705 #, c-format msgid "ERROR: incorrect geometry value '%s'\n" msgstr "CHYBA: neplatná hodnota geometrie '%s'\n" -#: src/lib/ecore/ecore_getopt.c:1722 +#: src/lib/ecore/ecore_getopt.c:1728 #, c-format msgid "ERROR: incorrect size value '%s'\n" msgstr "CHYBA: neplatná hodnota velikosti '%s'\n" diff --git a/po/de.po b/po/de.po index d9fda10..ebd2d51 100644 --- a/po/de.po +++ b/po/de.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ecore 0.9.9.063-2\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2011-01-30 13:29-0600\n" +"POT-Creation-Date: 2010-11-23 23:14+0100\n" "PO-Revision-Date: 2010-01-03 21:52+GMT\n" "Last-Translator: Fabian Nowak \n" "Language-Team: German \n" diff --git a/po/el.po b/po/el.po index 6668cbc..82952cc 100644 --- a/po/el.po +++ b/po/el.po @@ -6,11 +6,10 @@ msgid "" msgstr "" "Project-Id-Version: Ecore\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2011-01-30 13:29-0600\n" +"POT-Creation-Date: 2010-08-16 17:14+0900\n" "PO-Revision-Date: 2009-12-15 00:56+0200\n" "Last-Translator: Giorgos Koutsikos \n" "Language-Team: Greek\n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -69,16 +68,16 @@ msgstr "ΣΦΑΛΜΑ:" #: src/lib/ecore/ecore_getopt.c:853 src/lib/ecore/ecore_getopt.c:969 #: src/lib/ecore/ecore_getopt.c:982 src/lib/ecore/ecore_getopt.c:994 #: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1052 -#: src/lib/ecore/ecore_getopt.c:1160 src/lib/ecore/ecore_getopt.c:1196 +#: src/lib/ecore/ecore_getopt.c:1161 src/lib/ecore/ecore_getopt.c:1198 msgid "value has no pointer set.\n" msgstr "η τιμή δεν έχει δείκτη ορισμένο.\n" -#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1071 +#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1072 #, c-format msgid "unknown boolean value %s.\n" msgstr "άγνωστη τιμή boolean %s.\n" -#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1151 +#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1152 #, c-format msgid "invalid number format %s\n" msgstr "άγνωστη μορφή αριθμού %s\n" @@ -92,82 +91,82 @@ msgstr "μη-έγκυρη επιλογή \"%s\". Οι τιμές είναι: " msgid "missing parameter to append.\n" msgstr "ελλιπής παράμετρος προς επισύναψη.\n" -#: src/lib/ecore/ecore_getopt.c:1141 +#: src/lib/ecore/ecore_getopt.c:1142 msgid "could not parse value.\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1190 +#: src/lib/ecore/ecore_getopt.c:1191 msgid "missing parameter.\n" msgstr "ελλιπής παράμετρος.\n" -#: src/lib/ecore/ecore_getopt.c:1203 +#: src/lib/ecore/ecore_getopt.c:1205 msgid "missing callback function!\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1226 +#: src/lib/ecore/ecore_getopt.c:1228 msgid "no version was defined.\n" msgstr "δεν έχει οριστεί έκδοση.\n" -#: src/lib/ecore/ecore_getopt.c:1240 +#: src/lib/ecore/ecore_getopt.c:1242 msgid "no copyright was defined.\n" msgstr "δεν έχουν οριστεί πνευματικά δικαιώματα.\n" -#: src/lib/ecore/ecore_getopt.c:1254 +#: src/lib/ecore/ecore_getopt.c:1256 msgid "no license was defined.\n" msgstr "δεν έχει οριστεί άδεια.\n" -#: src/lib/ecore/ecore_getopt.c:1308 +#: src/lib/ecore/ecore_getopt.c:1310 #, c-format msgid "ERROR: unknown option --%s, ignored.\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1341 +#: src/lib/ecore/ecore_getopt.c:1343 #, c-format msgid "ERROR: option --%s requires an argument!\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1377 +#: src/lib/ecore/ecore_getopt.c:1379 #, c-format msgid "ERROR: unknown option -%c, ignored.\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1415 +#: src/lib/ecore/ecore_getopt.c:1417 #, c-format msgid "ERROR: option -%c requires an argument!\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1614 +#: src/lib/ecore/ecore_getopt.c:1620 msgid "ERROR: no parser provided.\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1619 +#: src/lib/ecore/ecore_getopt.c:1625 msgid "ERROR: no values provided.\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1628 +#: src/lib/ecore/ecore_getopt.c:1634 msgid "ERROR: no arguments provided.\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1654 +#: src/lib/ecore/ecore_getopt.c:1660 msgid "ERROR: invalid options found." msgstr "" -#: src/lib/ecore/ecore_getopt.c:1660 +#: src/lib/ecore/ecore_getopt.c:1666 #, c-format msgid " See --%s.\n" msgstr " Δες --%s.\n" -#: src/lib/ecore/ecore_getopt.c:1662 +#: src/lib/ecore/ecore_getopt.c:1668 #, c-format msgid " See -%c.\n" msgstr " Δες -%c.\n" -#: src/lib/ecore/ecore_getopt.c:1699 +#: src/lib/ecore/ecore_getopt.c:1705 #, c-format msgid "ERROR: incorrect geometry value '%s'\n" msgstr "" -#: src/lib/ecore/ecore_getopt.c:1722 +#: src/lib/ecore/ecore_getopt.c:1728 #, c-format msgid "ERROR: incorrect size value '%s'\n" msgstr "" diff --git a/po/fr.po b/po/fr.po index aaa148a..7957a2f 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,11 +6,10 @@ msgid "" msgstr "" "Project-Id-Version: Ecore\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2011-01-30 13:29-0600\n" +"POT-Creation-Date: 2010-08-16 17:14+0900\n" "PO-Revision-Date: 2010-07-11 11:01+0400\n" "Last-Translator: batden \n" "Language-Team: Enlightenment French Team \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -73,16 +72,16 @@ msgstr "ERREUR :" #: src/lib/ecore/ecore_getopt.c:853 src/lib/ecore/ecore_getopt.c:969 #: src/lib/ecore/ecore_getopt.c:982 src/lib/ecore/ecore_getopt.c:994 #: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1052 -#: src/lib/ecore/ecore_getopt.c:1160 src/lib/ecore/ecore_getopt.c:1196 +#: src/lib/ecore/ecore_getopt.c:1161 src/lib/ecore/ecore_getopt.c:1198 msgid "value has no pointer set.\n" msgstr "la valeur n'a aucun pointeur défini.\n" -#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1071 +#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1072 #, c-format msgid "unknown boolean value %s.\n" msgstr "valeur booléenne inconnue %s.\n" -#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1151 +#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1152 #, c-format msgid "invalid number format %s\n" msgstr "format du nombre non valide %s\n" @@ -96,82 +95,82 @@ msgstr "choix non valide « %s ». Les valeurs valides sont : " msgid "missing parameter to append.\n" msgstr "paramètre manquant à ajouter.\n" -#: src/lib/ecore/ecore_getopt.c:1141 +#: src/lib/ecore/ecore_getopt.c:1142 msgid "could not parse value.\n" msgstr "analyse de la valeur impossible.\n" -#: src/lib/ecore/ecore_getopt.c:1190 +#: src/lib/ecore/ecore_getopt.c:1191 msgid "missing parameter.\n" msgstr "paramètre manquant.\n" -#: src/lib/ecore/ecore_getopt.c:1203 +#: src/lib/ecore/ecore_getopt.c:1205 msgid "missing callback function!\n" msgstr "fonction de rappel manquante !\n" -#: src/lib/ecore/ecore_getopt.c:1226 +#: src/lib/ecore/ecore_getopt.c:1228 msgid "no version was defined.\n" msgstr "aucune version n'est définie.\n" -#: src/lib/ecore/ecore_getopt.c:1240 +#: src/lib/ecore/ecore_getopt.c:1242 msgid "no copyright was defined.\n" msgstr "aucun copyright n'est défini.\n" -#: src/lib/ecore/ecore_getopt.c:1254 +#: src/lib/ecore/ecore_getopt.c:1256 msgid "no license was defined.\n" msgstr "aucune licence n'est définie.\n" -#: src/lib/ecore/ecore_getopt.c:1308 +#: src/lib/ecore/ecore_getopt.c:1310 #, c-format msgid "ERROR: unknown option --%s, ignored.\n" msgstr "ERREUR : option inconnue --%s, non prise en compte.\n" -#: src/lib/ecore/ecore_getopt.c:1341 +#: src/lib/ecore/ecore_getopt.c:1343 #, c-format msgid "ERROR: option --%s requires an argument!\n" msgstr "ERREUR : l'option --%s requiert un argument !\n" -#: src/lib/ecore/ecore_getopt.c:1377 +#: src/lib/ecore/ecore_getopt.c:1379 #, c-format msgid "ERROR: unknown option -%c, ignored.\n" msgstr "ERREUR : option inconnue -%c, non prise en compte.\n" -#: src/lib/ecore/ecore_getopt.c:1415 +#: src/lib/ecore/ecore_getopt.c:1417 #, c-format msgid "ERROR: option -%c requires an argument!\n" msgstr "ERREUR : l'option -%c requiert un argument !\n" -#: src/lib/ecore/ecore_getopt.c:1614 +#: src/lib/ecore/ecore_getopt.c:1620 msgid "ERROR: no parser provided.\n" msgstr "ERREUR : aucun analyseur n'est fourni.\n" -#: src/lib/ecore/ecore_getopt.c:1619 +#: src/lib/ecore/ecore_getopt.c:1625 msgid "ERROR: no values provided.\n" msgstr "ERREUR : aucune valeur n'est fournie.\n" -#: src/lib/ecore/ecore_getopt.c:1628 +#: src/lib/ecore/ecore_getopt.c:1634 msgid "ERROR: no arguments provided.\n" msgstr "ERREUR : aucun argument n'est fourni.\n" -#: src/lib/ecore/ecore_getopt.c:1654 +#: src/lib/ecore/ecore_getopt.c:1660 msgid "ERROR: invalid options found." msgstr "ERREUR : options non valides détectées." -#: src/lib/ecore/ecore_getopt.c:1660 +#: src/lib/ecore/ecore_getopt.c:1666 #, c-format msgid " See --%s.\n" msgstr " Voir --%s.\n" -#: src/lib/ecore/ecore_getopt.c:1662 +#: src/lib/ecore/ecore_getopt.c:1668 #, c-format msgid " See -%c.\n" msgstr " Voir -%c.\n" -#: src/lib/ecore/ecore_getopt.c:1699 +#: src/lib/ecore/ecore_getopt.c:1705 #, c-format msgid "ERROR: incorrect geometry value '%s'\n" msgstr "ERREUR : valeur géométrique incorrecte « %s »\n" -#: src/lib/ecore/ecore_getopt.c:1722 +#: src/lib/ecore/ecore_getopt.c:1728 #, c-format msgid "ERROR: incorrect size value '%s'\n" msgstr "ERREUR : valeur de taille incorrecte « %s »\n" diff --git a/po/it.po b/po/it.po index 8b46b5e..f3c43ef 100644 --- a/po/it.po +++ b/po/it.po @@ -6,11 +6,10 @@ msgid "" msgstr "" "Project-Id-Version: Ecore\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2011-01-30 13:29-0600\n" +"POT-Creation-Date: 2010-08-16 17:14+0900\n" "PO-Revision-Date: 2009-10-27 19:36+0100\n" "Last-Translator: quaker66 \n" "Language-Team: none\n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -69,16 +68,16 @@ msgstr "ERRORE:" #: src/lib/ecore/ecore_getopt.c:853 src/lib/ecore/ecore_getopt.c:969 #: src/lib/ecore/ecore_getopt.c:982 src/lib/ecore/ecore_getopt.c:994 #: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1052 -#: src/lib/ecore/ecore_getopt.c:1160 src/lib/ecore/ecore_getopt.c:1196 +#: src/lib/ecore/ecore_getopt.c:1161 src/lib/ecore/ecore_getopt.c:1198 msgid "value has no pointer set.\n" msgstr "il valore non ha puntatori impostati.\n" -#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1071 +#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1072 #, c-format msgid "unknown boolean value %s.\n" msgstr "valore booleano sconosciuto %s.\n" -#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1151 +#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1152 #, c-format msgid "invalid number format %s\n" msgstr "formato numero non valido %s\n" @@ -92,82 +91,82 @@ msgstr "scelta non valida \"%s\". I valori ammessi sono: " msgid "missing parameter to append.\n" msgstr "parametro da appendere mancante.\n" -#: src/lib/ecore/ecore_getopt.c:1141 +#: src/lib/ecore/ecore_getopt.c:1142 msgid "could not parse value.\n" msgstr "impossibile il parsing del valore.\n" -#: src/lib/ecore/ecore_getopt.c:1190 +#: src/lib/ecore/ecore_getopt.c:1191 msgid "missing parameter.\n" msgstr "parametro mancante.\n" -#: src/lib/ecore/ecore_getopt.c:1203 +#: src/lib/ecore/ecore_getopt.c:1205 msgid "missing callback function!\n" msgstr "funzione callback mancante!\n" -#: src/lib/ecore/ecore_getopt.c:1226 +#: src/lib/ecore/ecore_getopt.c:1228 msgid "no version was defined.\n" msgstr "nessuna versione definita.\n" -#: src/lib/ecore/ecore_getopt.c:1240 +#: src/lib/ecore/ecore_getopt.c:1242 msgid "no copyright was defined.\n" msgstr "nessun copyright definito.\n" -#: src/lib/ecore/ecore_getopt.c:1254 +#: src/lib/ecore/ecore_getopt.c:1256 msgid "no license was defined.\n" msgstr "nessuna licenza definita.\n" -#: src/lib/ecore/ecore_getopt.c:1308 +#: src/lib/ecore/ecore_getopt.c:1310 #, c-format msgid "ERROR: unknown option --%s, ignored.\n" msgstr "ERRORE: opzione sconosciuta --%s, ignorata.\n" -#: src/lib/ecore/ecore_getopt.c:1341 +#: src/lib/ecore/ecore_getopt.c:1343 #, c-format msgid "ERROR: option --%s requires an argument!\n" msgstr "ERRORE: l'opzione --%s richiede un argomento!\n" -#: src/lib/ecore/ecore_getopt.c:1377 +#: src/lib/ecore/ecore_getopt.c:1379 #, c-format msgid "ERROR: unknown option -%c, ignored.\n" msgstr "ERRORE: opzione sconosciuta -%c, ignorata.\n" -#: src/lib/ecore/ecore_getopt.c:1415 +#: src/lib/ecore/ecore_getopt.c:1417 #, c-format msgid "ERROR: option -%c requires an argument!\n" msgstr "ERRORE: l'opzione -%c richiede un argomento!\n" -#: src/lib/ecore/ecore_getopt.c:1614 +#: src/lib/ecore/ecore_getopt.c:1620 msgid "ERROR: no parser provided.\n" msgstr "ERRORE: nessun parser fornito.\n" -#: src/lib/ecore/ecore_getopt.c:1619 +#: src/lib/ecore/ecore_getopt.c:1625 msgid "ERROR: no values provided.\n" msgstr "ERRORE: nessun valore fornito.\n" -#: src/lib/ecore/ecore_getopt.c:1628 +#: src/lib/ecore/ecore_getopt.c:1634 msgid "ERROR: no arguments provided.\n" msgstr "ERRORE: nessun argomento fornito.\n" -#: src/lib/ecore/ecore_getopt.c:1654 +#: src/lib/ecore/ecore_getopt.c:1660 msgid "ERROR: invalid options found." msgstr "ERRORE: trovate opzioni non valide." -#: src/lib/ecore/ecore_getopt.c:1660 +#: src/lib/ecore/ecore_getopt.c:1666 #, c-format msgid " See --%s.\n" msgstr " Vedere --%s.\n" -#: src/lib/ecore/ecore_getopt.c:1662 +#: src/lib/ecore/ecore_getopt.c:1668 #, c-format msgid " See -%c.\n" msgstr " Vedere -%c.\n" -#: src/lib/ecore/ecore_getopt.c:1699 +#: src/lib/ecore/ecore_getopt.c:1705 #, c-format msgid "ERROR: incorrect geometry value '%s'\n" msgstr "ERRORE: valore geometrico non corretto '%s'\n" -#: src/lib/ecore/ecore_getopt.c:1722 +#: src/lib/ecore/ecore_getopt.c:1728 #, c-format msgid "ERROR: incorrect size value '%s'\n" msgstr "ERRORE: valore dimensione non corretto '%s'\n" diff --git a/po/pt.po b/po/pt.po index 4150405..2037dbb 100644 --- a/po/pt.po +++ b/po/pt.po @@ -6,11 +6,10 @@ msgid "" msgstr "" "Project-Id-Version: ecore\n" "Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2011-01-30 13:29-0600\n" +"POT-Creation-Date: 2010-08-16 17:14+0900\n" "PO-Revision-Date: 2010-10-06 12:37-0000\n" "Last-Translator: Sérgio Marques \n" "Language-Team: \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -69,19 +68,25 @@ msgstr "ERRO: opção desconhecida -%c.\n" msgid "ERROR: " msgstr "ERRO: " -#: src/lib/ecore/ecore_getopt.c:853 src/lib/ecore/ecore_getopt.c:969 -#: src/lib/ecore/ecore_getopt.c:982 src/lib/ecore/ecore_getopt.c:994 -#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1052 -#: src/lib/ecore/ecore_getopt.c:1160 src/lib/ecore/ecore_getopt.c:1196 +#: src/lib/ecore/ecore_getopt.c:853 +#: src/lib/ecore/ecore_getopt.c:969 +#: src/lib/ecore/ecore_getopt.c:982 +#: src/lib/ecore/ecore_getopt.c:994 +#: src/lib/ecore/ecore_getopt.c:1008 +#: src/lib/ecore/ecore_getopt.c:1052 +#: src/lib/ecore/ecore_getopt.c:1161 +#: src/lib/ecore/ecore_getopt.c:1198 msgid "value has no pointer set.\n" msgstr "o valor não está definido.\n" -#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1071 +#: src/lib/ecore/ecore_getopt.c:882 +#: src/lib/ecore/ecore_getopt.c:1072 #, c-format msgid "unknown boolean value %s.\n" msgstr "valor booleano desconhecido %s.\n" -#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1151 +#: src/lib/ecore/ecore_getopt.c:926 +#: src/lib/ecore/ecore_getopt.c:1152 #, c-format msgid "invalid number format %s\n" msgstr "formato do número inválido %s\n" @@ -95,82 +100,83 @@ msgstr "escolha inválida \"%s\". O valores possíveis são:" msgid "missing parameter to append.\n" msgstr "faltam os parâmetros a anexar.\n" -#: src/lib/ecore/ecore_getopt.c:1141 +#: src/lib/ecore/ecore_getopt.c:1142 msgid "could not parse value.\n" msgstr "incapaz de analisar o valor.\n" -#: src/lib/ecore/ecore_getopt.c:1190 +#: src/lib/ecore/ecore_getopt.c:1191 msgid "missing parameter.\n" msgstr "parâmetro em falta.\n" -#: src/lib/ecore/ecore_getopt.c:1203 +#: src/lib/ecore/ecore_getopt.c:1205 msgid "missing callback function!\n" msgstr "função de chamada em falta!\n" -#: src/lib/ecore/ecore_getopt.c:1226 +#: src/lib/ecore/ecore_getopt.c:1228 msgid "no version was defined.\n" msgstr "nenhuma versão definida.\n" -#: src/lib/ecore/ecore_getopt.c:1240 +#: src/lib/ecore/ecore_getopt.c:1242 msgid "no copyright was defined.\n" msgstr "direitos de autor não definidos.\n" -#: src/lib/ecore/ecore_getopt.c:1254 +#: src/lib/ecore/ecore_getopt.c:1256 msgid "no license was defined.\n" msgstr "licença não definida.\n" -#: src/lib/ecore/ecore_getopt.c:1308 +#: src/lib/ecore/ecore_getopt.c:1310 #, c-format msgid "ERROR: unknown option --%s, ignored.\n" msgstr "ERRO: opção desconhecida --%s, ignorada.\n" -#: src/lib/ecore/ecore_getopt.c:1341 +#: src/lib/ecore/ecore_getopt.c:1343 #, c-format msgid "ERROR: option --%s requires an argument!\n" msgstr "ERRO: a opção --%s requer um argumento!\n" -#: src/lib/ecore/ecore_getopt.c:1377 +#: src/lib/ecore/ecore_getopt.c:1379 #, c-format msgid "ERROR: unknown option -%c, ignored.\n" msgstr "ERRO: opção desconhecida --%c, ignorada.\n" -#: src/lib/ecore/ecore_getopt.c:1415 +#: src/lib/ecore/ecore_getopt.c:1417 #, c-format msgid "ERROR: option -%c requires an argument!\n" msgstr "ERRO: a opção --%c requer um argumento!\n" -#: src/lib/ecore/ecore_getopt.c:1614 +#: src/lib/ecore/ecore_getopt.c:1620 msgid "ERROR: no parser provided.\n" msgstr "ERRO: nenhum analisador fornecido.\n" -#: src/lib/ecore/ecore_getopt.c:1619 +#: src/lib/ecore/ecore_getopt.c:1625 msgid "ERROR: no values provided.\n" msgstr "ERRO: nenhum valor fornecido.\n" -#: src/lib/ecore/ecore_getopt.c:1628 +#: src/lib/ecore/ecore_getopt.c:1634 msgid "ERROR: no arguments provided.\n" msgstr "ERRO: nenhum argumento fornecido.\n" -#: src/lib/ecore/ecore_getopt.c:1654 +#: src/lib/ecore/ecore_getopt.c:1660 msgid "ERROR: invalid options found." msgstr "ERRO: encontradas opções inválidas." -#: src/lib/ecore/ecore_getopt.c:1660 +#: src/lib/ecore/ecore_getopt.c:1666 #, c-format msgid " See --%s.\n" msgstr " Veja --%s.\n" -#: src/lib/ecore/ecore_getopt.c:1662 +#: src/lib/ecore/ecore_getopt.c:1668 #, c-format msgid " See -%c.\n" msgstr " Veja -%c.\n" -#: src/lib/ecore/ecore_getopt.c:1699 +#: src/lib/ecore/ecore_getopt.c:1705 #, c-format msgid "ERROR: incorrect geometry value '%s'\n" msgstr "ERRO: valor geométrico incorreto \"%s\"\n" -#: src/lib/ecore/ecore_getopt.c:1722 +#: src/lib/ecore/ecore_getopt.c:1728 #, c-format msgid "ERROR: incorrect size value '%s'\n" msgstr "ERRO: tamanho incorreto \"%s\"\n" + diff --git a/po/sl.po b/po/sl.po deleted file mode 100644 index cedd65f..0000000 --- a/po/sl.po +++ /dev/null @@ -1,174 +0,0 @@ -# Slovenian translation of ecore. -# This file is put in the public domain. -# r1to , 2011. -# , fuzzy -# -# -msgid "" -msgstr "" -"Project-Id-Version: ecore 1.0\n" -"Report-Msgid-Bugs-To: http://trac.enlightenment.org/e/\n" -"POT-Creation-Date: 2011-02-22 20:00-0800\n" -"PO-Revision-Date: 2011-02-24 16:54+0100\n" -"Last-Translator: r1to \n" -"Language-Team: Slovenian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit" - -#: ../src/lib/ecore/ecore_getopt.c:87 -msgid "Version:" -msgstr "Različica" - -#: ../src/lib/ecore/ecore_getopt.c:95 -msgid "Usage:" -msgstr "Uporaba:" - -#: ../src/lib/ecore/ecore_getopt.c:100 -#, c-format -msgid "%s [options]\n" -msgstr "%s·[možnosti]\n" - -#: ../src/lib/ecore/ecore_getopt.c:248 -msgid "Copyright:" -msgstr "Avtorstvo:" - -#: ../src/lib/ecore/ecore_getopt.c:259 -msgid "License:" -msgstr "Licenca:" - -#: ../src/lib/ecore/ecore_getopt.c:411 -msgid "Type: " -msgstr "Vrsta:·" - -#: ../src/lib/ecore/ecore_getopt.c:478 -msgid "Default: " -msgstr "Privzeto:·" - -#: ../src/lib/ecore/ecore_getopt.c:501 -msgid "Choices: " -msgstr "Izbire:·" - -#: ../src/lib/ecore/ecore_getopt.c:598 -msgid "Options:\n" -msgstr "Možnosti:\n" - -#: ../src/lib/ecore/ecore_getopt.c:718 -#, c-format -msgid "ERROR: unknown option --%s.\n" -msgstr "NAPAKA:·Neznana možnost·--%s.\n" - -#: ../src/lib/ecore/ecore_getopt.c:720 -#, c-format -msgid "ERROR: unknown option -%c.\n" -msgstr "NAPAKA:·neznana možnost·-%c.\n" - -#: ../src/lib/ecore/ecore_getopt.c:776 -msgid "ERROR: " -msgstr "NAPAKA:" - -#: ../src/lib/ecore/ecore_getopt.c:853 ../src/lib/ecore/ecore_getopt.c:969 -#: ../src/lib/ecore/ecore_getopt.c:982 ../src/lib/ecore/ecore_getopt.c:994 -#: ../src/lib/ecore/ecore_getopt.c:1008 ../src/lib/ecore/ecore_getopt.c:1052 -#: ../src/lib/ecore/ecore_getopt.c:1160 ../src/lib/ecore/ecore_getopt.c:1196 -msgid "value has no pointer set.\n" -msgstr "vrednost nima nastavljenega kazalnika.\n" - -#: ../src/lib/ecore/ecore_getopt.c:882 ../src/lib/ecore/ecore_getopt.c:1071 -#, c-format -msgid "unknown boolean value %s.\n" -msgstr "neznana Boolova vrednost·%s.\n" - -#: ../src/lib/ecore/ecore_getopt.c:926 ../src/lib/ecore/ecore_getopt.c:1151 -#, c-format -msgid "invalid number format %s\n" -msgstr "napačen·format števila·%s\n" - -#: ../src/lib/ecore/ecore_getopt.c:1021 -#, c-format -msgid "invalid choice \"%s\". Valid values are: " -msgstr "napačna izbira·\"%s\".·Pravilne izbire so:·" - -#: ../src/lib/ecore/ecore_getopt.c:1046 -msgid "missing parameter to append.\n" -msgstr "manjka·parameter·za dodajo.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1141 -msgid "could not parse value.\n" -msgstr "vrednosti ni bilo možno razčleniti.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1190 -msgid "missing parameter.\n" -msgstr "manjkajoči·parameter.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1203 -msgid "missing callback function!\n" -msgstr "manjkajoča povratno-zasilna funkcija !\n" - -#: ../src/lib/ecore/ecore_getopt.c:1226 -msgid "no version was defined.\n" -msgstr "definirana ni bila nobena različica.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1240 -msgid "no copyright was defined.\n" -msgstr "definirano ni bilo nobeno avtorstvo.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1254 -msgid "no license was defined.\n" -msgstr "definirana ni bila nobena licenca.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1308 -#, c-format -msgid "ERROR: unknown option --%s, ignored.\n" -msgstr "NAPAKA:·neznana možnost·--%s,·prezrto.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1341 -#, c-format -msgid "ERROR: option --%s requires an argument!\n" -msgstr "NAPAKA:·možnost·--%s·zahteva argument!\n" - -#: ../src/lib/ecore/ecore_getopt.c:1377 -#, c-format -msgid "ERROR: unknown option -%c, ignored.\n" -msgstr "NAPAKA:·neznana možnost·-%c,·prezrto.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1415 -#, c-format -msgid "ERROR: option -%c requires an argument!\n" -msgstr "NAPAKA:·možnost·-%c zahteva argument!\n" - -#: ../src/lib/ecore/ecore_getopt.c:1614 -msgid "ERROR: no parser provided.\n" -msgstr "NAPAKA:·ni podan razčlenjevalnik.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1619 -msgid "ERROR: no values provided.\n" -msgstr "NAPAKA::·ni podanih vrednosti.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1628 -msgid "ERROR: no arguments provided.\n" -msgstr "NAPAKA::·ni podanih argumentov.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1654 -msgid "ERROR: invalid options found." -msgstr "NAPAKA::·najdene nepravilne možnosti" - -#: ../src/lib/ecore/ecore_getopt.c:1660 -#, c-format -msgid " See --%s.\n" -msgstr "·Glej·--%s.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1662 -#, c-format -msgid " See -%c.\n" -msgstr "·Glej·-%c.\n" - -#: ../src/lib/ecore/ecore_getopt.c:1699 -#, c-format -msgid "ERROR: incorrect geometry value '%s'\n" -msgstr "NAPAKA::·nepravilna geometrijska vrednost·'%s'\n" - -#: ../src/lib/ecore/ecore_getopt.c:1722 -#, c-format -msgid "ERROR: incorrect size value '%s'\n" -msgstr "NAPAKA::·nepravilna vrednost velikosti·'%s'\n" diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index 215545e..d39e71f 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -50,7 +50,6 @@ extern "C" { #endif /** - * @file Ecore.h * @defgroup Ecore_Group Ecore - Main Loop and Job Functions. * @brief The file that provides the program utility, main loop and timer * functions. @@ -117,7 +116,6 @@ extern "C" { enum _Ecore_Exe_Flags /* flags for executing a child with its stdin and/or stdout piped back */ { - ECORE_EXE_NONE = 0, /**< No exe flags at all */ ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */ ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */ ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */ @@ -266,9 +264,9 @@ extern "C" { struct _Ecore_Event_Signal_Exit /** Exit request event */ { - Eina_Bool interrupt : 1; /**< Set if the exit request was an interrupt signal*/ - Eina_Bool quit : 1; /**< set if the exit request was a quit signal */ - Eina_Bool terminate : 1; /**< Set if the exit request was a terminate singal */ + unsigned int interrupt : 1; /**< Set if the exit request was an interrupt signal*/ + unsigned int quit : 1; /**< set if the exit request was a quit signal */ + unsigned int terminate : 1; /**< Set if the exit request was a terminate singal */ void *ext_data; /**< Extension data - not used */ #ifndef _WIN32 @@ -306,8 +304,8 @@ extern "C" { int exit_code; /**< The exit code of the process */ Ecore_Exe *exe; /**< The handle to the exited process, or NULL if not found */ int exit_signal; /** < The signal that caused the process to exit */ - Eina_Bool exited : 1; /** < set to 1 if the process exited of its own accord */ - Eina_Bool signalled : 1; /** < set to 1 id the process exited due to uncaught signal */ + unsigned int exited : 1; /** < set to 1 if the process exited of its own accord */ + unsigned int signalled : 1; /** < set to 1 id the process exited due to uncaught signal */ void *ext_data; /**< Extension data - not used */ #ifndef _WIN32 siginfo_t data; /**< Signal info */ @@ -440,7 +438,7 @@ extern "C" { EAPI void ecore_main_loop_iterate(void); EAPI void ecore_main_loop_select_func_set(Ecore_Select_Function func); - EAPI Ecore_Select_Function ecore_main_loop_select_func_get(void); + EAPI void *ecore_main_loop_select_func_get(void); EAPI Eina_Bool ecore_main_loop_glib_integrate(void); EAPI void ecore_main_loop_glib_always_integrate_disable(void); diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index c9e9873..479beb5 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -61,7 +61,6 @@ struct _Ecore_Fd_Handler { EINA_INLIST; ECORE_MAGIC; - Ecore_Fd_Handler *next_ready; int fd; Ecore_Fd_Handler_Flags flags; Ecore_Fd_Cb func; @@ -120,9 +119,9 @@ static Eina_List *fd_handlers_with_prep = NULL; static Eina_List *fd_handlers_with_buffer = NULL; static Eina_List *fd_handlers_to_delete = NULL; -/* single linked list of ready fdhs, terminated by loop to self */ -static Ecore_Fd_Handler *fd_handlers_to_call; -static Ecore_Fd_Handler *fd_handlers_to_call_current; +static Eina_List *fd_handlers_to_call = NULL; +static Eina_List *fd_handlers_to_call_current; +static Eina_List *fd_handlers_to_call_current_next; #ifdef _WIN32 static Ecore_Win32_Handler *win32_handlers = NULL; @@ -167,24 +166,6 @@ _ecore_fd_valid(void) #endif } -static inline void -_ecore_try_add_to_call_list(Ecore_Fd_Handler *fdh) -{ - /* check if this fdh is already in the list */ - if (fdh->next_ready) - return; - if (fdh->read_active || fdh->write_active || fdh->error_active) - { - /* - * make sure next_ready is non-null by pointing to ourselves - * use that to indicate this fdh is in the ready list - * insert at the head of the list to avoid trouble - */ - fdh->next_ready = fd_handlers_to_call ? fd_handlers_to_call : fdh; - fd_handlers_to_call = fdh; - } -} - #ifdef HAVE_EPOLL static inline int _ecore_get_epoll_fd(void) @@ -351,6 +332,7 @@ static inline int _ecore_main_fdh_poll_mark_active(void) for (i = 0; i < ret; i++) { Ecore_Fd_Handler *fdh; + Eina_Bool pst, st; fdh = ev[i].data.ptr; if (!ECORE_MAGIC_CHECK(fdh, ECORE_MAGIC_FD_HANDLER)) @@ -364,15 +346,15 @@ static inline int _ecore_main_fdh_poll_mark_active(void) ERR("deleted fd in epoll"); continue; } - - if (ev[i].events & EPOLLIN) - fdh->read_active = EINA_TRUE; - if (ev[i].events & EPOLLOUT) - fdh->write_active = EINA_TRUE; - if (ev[i].events & EPOLLERR) - fdh->error_active = EINA_TRUE; - - _ecore_try_add_to_call_list(fdh); + pst = st = fdh->read_active | fdh->write_active | fdh->error_active; + if ((ev[i].events & EPOLLIN) && (!fdh->read_active)) + st = fdh->read_active = EINA_TRUE; + if ((ev[i].events & EPOLLOUT) && (!fdh->write_active)) + st = fdh->write_active = EINA_TRUE; + if ((ev[i].events & EPOLLERR) && (!fdh->error_active)) + st = fdh->error_active = EINA_TRUE; + if (pst != st) + fd_handlers_to_call = eina_list_append(fd_handlers_to_call, fdh); } return ret; @@ -383,6 +365,7 @@ static inline int _ecore_main_fdh_poll_mark_active(void) static inline int _ecore_main_fdh_poll_mark_active(void) { Ecore_Fd_Handler *fdh; + Eina_Bool pst, st; int ret = 0; /* call the prepare callback for all handlers */ @@ -391,15 +374,15 @@ static inline int _ecore_main_fdh_poll_mark_active(void) if (fdh->delete_me) continue; - if (fdh->gfd.revents & G_IO_IN) - fdh->read_active = EINA_TRUE; - if (fdh->gfd.revents & G_IO_OUT) - fdh->write_active = EINA_TRUE; - if (fdh->gfd.revents & G_IO_ERR) - fdh->error_active = EINA_TRUE; - - _ecore_try_add_to_call_list(fdh); - + pst = st = fdh->read_active | fdh->write_active | fdh->error_active; + if ((fdh->gfd.revents & G_IO_IN) && (!fdh->read_active)) + st = fdh->read_active = EINA_TRUE; + if ((fdh->gfd.revents & G_IO_OUT) && (!fdh->write_active)) + st = fdh->write_active = EINA_TRUE; + if ((fdh->gfd.revents & G_IO_ERR) && (!fdh->error_active)) + st = fdh->error_active = EINA_TRUE; + if (pst != st) + fd_handlers_to_call = eina_list_append(fd_handlers_to_call, fdh); if (fdh->gfd.revents & (G_IO_IN|G_IO_OUT|G_IO_ERR)) ret++; } @@ -725,7 +708,7 @@ ecore_main_loop_select_func_set(Ecore_Select_Function func) * or the native select function if none was set. * */ -EAPI Ecore_Select_Function +EAPI void * ecore_main_loop_select_func_get(void) { return main_loop_select; @@ -780,13 +763,11 @@ ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_Flags flags, Ecore_Fd_Cb func fdh = calloc(1, sizeof(Ecore_Fd_Handler)); if (!fdh) return NULL; ECORE_MAGIC_SET(fdh, ECORE_MAGIC_FD_HANDLER); - fdh->next_ready = NULL; fdh->fd = fd; fdh->flags = flags; if (_ecore_main_fdh_poll_add(fdh) < 0) { - int err = errno; - ERR("Failed to add poll on fd %d (errno = %d: %s)!", fd, err, strerror(err)); + ERR("Failed to add poll on fd %d (errno = %d)!", fd, errno); free(fdh); return NULL; } @@ -970,8 +951,6 @@ ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_ EAPI void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) { - int ret; - if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER)) { ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER, @@ -979,10 +958,9 @@ ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_ return; } fd_handler->flags = flags; - ret = _ecore_main_fdh_poll_modify(fd_handler); - if (ret < 0) + if (_ecore_main_fdh_poll_modify(fd_handler) < 0) { - ERR("Failed to mod epoll fd %d: %s!", fd_handler->fd, strerror(ret)); + ERR("Failed to mod epoll fd %d!", fd_handler->fd); } } @@ -1020,8 +998,9 @@ _ecore_main_shutdown(void) fd_handlers_with_prep = eina_list_free(fd_handlers_with_prep); if (fd_handlers_to_delete) fd_handlers_to_delete = eina_list_free(fd_handlers_to_delete); + if (fd_handlers_to_call) + fd_handlers_to_call = eina_list_free(fd_handlers_to_call); - fd_handlers_to_call = NULL; fd_handlers_to_call_current = NULL; fd_handlers_to_delete = NULL; fd_handler_current = NULL; @@ -1160,13 +1139,16 @@ _ecore_main_select(double timeout) { if (!fdh->delete_me) { - if (FD_ISSET(fdh->fd, &rfds)) - fdh->read_active = EINA_TRUE; - if (FD_ISSET(fdh->fd, &wfds)) - fdh->write_active = EINA_TRUE; - if (FD_ISSET(fdh->fd, &exfds)) - fdh->error_active = EINA_TRUE; - _ecore_try_add_to_call_list(fdh); + Eina_Bool pst, st; + pst = st = fdh->read_active | fdh->write_active | fdh->error_active; + if ((FD_ISSET(fdh->fd, &rfds)) && (!fdh->read_active)) + st = fdh->read_active = EINA_TRUE; + if ((FD_ISSET(fdh->fd, &wfds)) && (!fdh->write_active)) + st = fdh->write_active = EINA_TRUE; + if ((FD_ISSET(fdh->fd, &exfds)) && (!fdh->error_active)) + st = fdh->error_active = EINA_TRUE; + if (pst != st) + fd_handlers_to_call = eina_list_append(fd_handlers_to_call, fdh); } } #endif /* HAVE_EPOLL */ @@ -1303,16 +1285,22 @@ _ecore_main_win32_handlers_cleanup(void) static void _ecore_main_fd_handlers_call(void) { - /* grab a new list */ if (!fd_handlers_to_call_current) { + /* regular main loop, start from head */ fd_handlers_to_call_current = fd_handlers_to_call; - fd_handlers_to_call = NULL; + fd_handlers_to_call_current_next = eina_list_next(fd_handlers_to_call_current); + } + else + { + /* recursive main loop, continue from where we were */ + fd_handlers_to_call_current = fd_handlers_to_call_current_next; + fd_handlers_to_call_current_next = eina_list_next(fd_handlers_to_call_current); } while (fd_handlers_to_call_current) { - Ecore_Fd_Handler *fdh = fd_handlers_to_call_current; + Ecore_Fd_Handler *fdh = fd_handlers_to_call_current->data; if (!fdh->delete_me) { @@ -1339,16 +1327,9 @@ _ecore_main_fd_handlers_call(void) } } - /* stop when we point to ourselves */ - if (fdh->next_ready == fdh) - { - fdh->next_ready = NULL; - fd_handlers_to_call_current = NULL; - break; - } - - fd_handlers_to_call_current = fdh->next_ready; - fdh->next_ready = NULL; + fd_handlers_to_call = eina_list_remove_list(fd_handlers_to_call, fd_handlers_to_call_current); + fd_handlers_to_call_current = fd_handlers_to_call_current_next; + fd_handlers_to_call_current_next = eina_list_next(fd_handlers_to_call_current_next); } } @@ -1373,8 +1354,12 @@ _ecore_main_fd_handlers_buf_call(void) if (fdh->buf_func(fdh->buf_data, fdh)) { ret |= fdh->func(fdh->data, fdh); - fdh->read_active = EINA_TRUE; - _ecore_try_add_to_call_list(fdh); + if (!fdh->read_active) + { + fdh->read_active = EINA_TRUE; + if ((!fdh->write_active) && (!fdh->error_active)) + fd_handlers_to_call = eina_list_append(fd_handlers_to_call, fdh); + } } fdh->references--; } diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c index ad537a6..6ff8201 100644 --- a/src/lib/ecore/ecore_pipe.c +++ b/src/lib/ecore/ecore_pipe.c @@ -539,7 +539,7 @@ _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__) else if (ret == 0) { if (!p->delete_me) - p->handler((void *)p->data, NULL, 0); + p->handler((void *)p->data, NULL, 0); pipe_close(p->fd_read); p->fd_read = PIPE_FD_INVALID; p->fd_handler = NULL; @@ -547,7 +547,7 @@ _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__) return ECORE_CALLBACK_CANCEL; } #ifndef _WIN32 - else if ((ret == PIPE_FD_ERROR) && + else if ((ret == PIPE_FD_ERROR) && ((errno == EINTR) || (errno == EAGAIN))) { _ecore_pipe_unhandle(p); @@ -614,8 +614,8 @@ _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__) return ECORE_CALLBACK_CANCEL; } #ifndef _WIN32 - else if ((ret == PIPE_FD_ERROR) && - ((errno == EINTR) || (errno == EAGAIN))) + else if ((ret == PIPE_FD_ERROR) && + ((errno == EINTR) || (errno == EAGAIN))) return ECORE_CALLBACK_RENEW; else { diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c index 0053524..f072c06 100644 --- a/src/lib/ecore/ecore_signal.c +++ b/src/lib/ecore/ecore_signal.c @@ -15,6 +15,7 @@ /* make mono happy - this is evil though... */ #undef SIGPWR /* valgrind in some versions/setups uses SIGRT's... hmmm */ +#undef SIGRTMIN typedef void (*Signal_Handler)(int sig, siginfo_t *si, void *foo); @@ -31,6 +32,10 @@ static void _ecore_signal_callback_sigterm(int sig, siginfo_t *si, void *foo); static void _ecore_signal_callback_sigpwr(int sig, siginfo_t *si, void *foo); #endif +#ifdef SIGRTMIN +static void _ecore_signal_callback_sigrt(int sig, siginfo_t *si, void *foo); +#endif + static Eina_Bool _ecore_signal_exe_exit_delay(void *data); //#define MAXSIGQ 256 // 32k @@ -47,6 +52,9 @@ static volatile sig_atomic_t sigterm_count = 0; #ifdef SIGPWR static volatile sig_atomic_t sigpwr_count = 0; #endif +#ifdef SIGRTMIN +static volatile sig_atomic_t *sigrt_count = NULL; +#endif static volatile siginfo_t sigchld_info[MAXSIGQ]; static volatile siginfo_t sigusr1_info[MAXSIGQ]; @@ -58,10 +66,17 @@ static volatile siginfo_t sigterm_info[MAXSIGQ]; #ifdef SIGPWR static volatile siginfo_t sigpwr_info[MAXSIGQ]; #endif +#ifdef SIGRTMIN +static volatile siginfo_t *sigrt_info[MAXSIGQ]; +#endif void _ecore_signal_shutdown(void) { +#ifdef SIGRTMIN + int i, num = SIGRTMAX - SIGRTMIN; +#endif + _ecore_signal_callback_set(SIGPIPE, (Signal_Handler) SIG_DFL); _ecore_signal_callback_set(SIGALRM, (Signal_Handler) SIG_DFL); _ecore_signal_callback_set(SIGCHLD, (Signal_Handler) SIG_DFL); @@ -84,11 +99,37 @@ _ecore_signal_shutdown(void) sigterm_count = 0; sig_count = 0; +#ifdef SIGRTMIN + for (i = 0; i < num; i++) + { + _ecore_signal_callback_set(SIGRTMIN + i, (Signal_Handler) SIG_DFL); + sigrt_count[i] = 0; + } + + if (sigrt_count) + { + free((sig_atomic_t *) sigrt_count); + sigrt_count = NULL; + } + + for (i = 0; i < MAXSIGQ; i++) + { + if (sigrt_info[i]) + { + free((siginfo_t *) sigrt_info[i]); + sigrt_info[i] = NULL; + } + } +#endif } void _ecore_signal_init(void) { +#ifdef SIGRTMIN + int i, num = SIGRTMAX - SIGRTMIN; +#endif + _ecore_signal_callback_set(SIGPIPE, _ecore_signal_callback_ignore); _ecore_signal_callback_set(SIGALRM, _ecore_signal_callback_ignore); _ecore_signal_callback_set(SIGCHLD, _ecore_signal_callback_sigchld); @@ -101,6 +142,20 @@ _ecore_signal_init(void) #ifdef SIGPWR _ecore_signal_callback_set(SIGPWR, _ecore_signal_callback_sigpwr); #endif + +#ifdef SIGRTMIN + sigrt_count = calloc(1, sizeof(sig_atomic_t) * num); + assert(sigrt_count); + + for (i = 0; i < MAXSIGQ; i++) + { + sigrt_info[i] = calloc(1, sizeof(siginfo_t) * num); + assert(sigrt_info[i]); + } + + for (i = 0; i < num; i++) + _ecore_signal_callback_set(SIGRTMIN + i, _ecore_signal_callback_sigrt); +#endif } int @@ -112,6 +167,9 @@ _ecore_signal_count_get(void) void _ecore_signal_call(void) { +#ifdef SIGRTMIN + int i, num = SIGRTMAX - SIGRTMIN; +#endif volatile sig_atomic_t n; sigset_t oldset, newset; @@ -129,6 +187,10 @@ _ecore_signal_call(void) #ifdef SIGPWR sigaddset(&newset, SIGPWR); #endif +#ifdef SIGRTMIN + for (i = 0; i < num; i++) + sigaddset(&newset, SIGRTMIN + i); +#endif sigprocmask(SIG_BLOCK, &newset, &oldset); if (sigchld_count > MAXSIGQ) WRN("%i SIGCHLD in queue. max queue size %i. losing " @@ -350,6 +412,30 @@ _ecore_signal_call(void) sigpwr_count = 0; #endif +#ifdef SIGRTMIN + for (i = 0; i < num; i++) + { + if (sigrt_count[i] > MAXSIGQ) + WRN("%i SIGRT%i in queue. max queue size %i. losing " + "siginfo for extra signals.", i + 1, sigrt_count[i], MAXSIGQ); + for (n = 0; n < sigrt_count[i]; n++) + { + Ecore_Event_Signal_Realtime *e; + + if ((e = _ecore_event_signal_realtime_new())) + { + e->num = i; + + if ((n < MAXSIGQ) && (sigrt_info[n][i].si_signo)) + e->data = sigrt_info[n][i]; + + ecore_event_add(ECORE_EVENT_SIGNAL_REALTIME, e, NULL, NULL); + } + sig_count--; + } + sigrt_count[i] = 0; + } +#endif sigprocmask(SIG_SETMASK, &oldset, NULL); } @@ -500,6 +586,24 @@ _ecore_signal_callback_sigpwr(int sig __UNUSED__, siginfo_t *si, void *foo __UNU } #endif +#ifdef SIGRTMIN +static void +_ecore_signal_callback_sigrt(int sig, siginfo_t *si, void *foo __UNUSED__) +{ + volatile sig_atomic_t n; + n = sigrt_count[sig - SIGRTMIN]; + if (n < MAXSIGQ) + { + if (si) + sigrt_info[n][sig - SIGRTMIN] = *si; + else + sigrt_info[n][sig - SIGRTMIN].si_signo = 0; + } + sigrt_count[sig - SIGRTMIN]++; + sig_count++; +} +#endif + static Eina_Bool _ecore_signal_exe_exit_delay(void *data) { diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c index 49059b8..27f6252 100644 --- a/src/lib/ecore/ecore_thread.c +++ b/src/lib/ecore/ecore_thread.c @@ -1024,7 +1024,7 @@ ecore_thread_check(Ecore_Thread *thread) * @param func_end The function that will be called in the main loop if the thread terminate correctly. * @param func_cancel The function that will be called in the main loop if the thread is cancelled. * @param data User context data to pass to all callback. - * @param try_no_queue If you want to run outside of the thread pool. + * @param try_no_queue If you wan't to run outside of the thread pool. * @return A reference to the newly created thread instance, or NULL if it failed. * * ecore_thread_feedback_run provide a facility for easily managing heavy task in a @@ -1032,7 +1032,7 @@ ecore_thread_check(Ecore_Thread *thread) * that will do the heavy work in another thread (so you should not use the * EFL in it except Eina and Eet if you are careful). The second one, func_notify, * will receive the data send from the thread function (func_heavy) by ecore_thread_notify - * in the main loop (and so, can use all the EFL). The third, func_end, + * in the main loop (and so, can use all the EFL). Tje third, func_end, * that will be called in Ecore main loop when func_heavy is done. So you * can use all the EFL inside this function. The last one, func_cancel, will * be called in the main loop also, if the thread is cancelled or could not run at all. diff --git a/src/lib/ecore_con/Ecore_Con.h b/src/lib/ecore_con/Ecore_Con.h index b8fbad8..c8bc237 100644 --- a/src/lib/ecore_con/Ecore_Con.h +++ b/src/lib/ecore_con/Ecore_Con.h @@ -148,12 +148,6 @@ typedef struct _Ecore_Con_Event_Client_Add Ecore_Con_Event_Client_Add; typedef struct _Ecore_Con_Event_Client_Del Ecore_Con_Event_Client_Del; /** - * @typedef Ecore_Con_Event_Client_Error - * Used as the @p data param for the corresponding event - */ -typedef struct _Ecore_Con_Event_Client_Error Ecore_Con_Event_Client_Error; - -/** * @typedef Ecore_Con_Event_Server_Add * Used as the @p data param for the corresponding event */ @@ -166,12 +160,6 @@ typedef struct _Ecore_Con_Event_Server_Add Ecore_Con_Event_Server_Add; typedef struct _Ecore_Con_Event_Server_Del Ecore_Con_Event_Server_Del; /** - * @typedef Ecore_Con_Event_Server_Error - * Used as the @p data param for the corresponding event - */ -typedef struct _Ecore_Con_Event_Server_Error Ecore_Con_Event_Server_Error; - -/** * @typedef Ecore_Con_Event_Client_Data * Used as the @p data param for the corresponding event */ @@ -220,16 +208,6 @@ struct _Ecore_Con_Event_Client_Del }; /** - * @struct _Ecore_Con_Event_Client_Error - * Used as the @p data param for the @ref ECORE_CON_EVENT_CLIENT_ERROR event - */ -struct _Ecore_Con_Event_Client_Error -{ - Ecore_Con_Client *client; /** the client for which an error occurred */ - char *error; /**< the error string describing what happened */ -}; - -/** * @struct _Ecore_Con_Event_Server_Add * Used as the @p data param for the @ref ECORE_CON_EVENT_SERVER_ADD event */ @@ -248,16 +226,6 @@ struct _Ecore_Con_Event_Server_Del }; /** - * @struct _Ecore_Con_Event_Server_Error - * Used as the @p data param for the @ref ECORE_CON_EVENT_SERVER_ERROR event - */ -struct _Ecore_Con_Event_Server_Error -{ - Ecore_Con_Server *server; /** the server for which an error occurred */ - char *error; /**< the error string describing what happened */ -}; - -/** * @struct _Ecore_Con_Event_Client_Data * Used as the @p data param for the @ref ECORE_CON_EVENT_CLIENT_DATA event */ @@ -323,14 +291,10 @@ struct _Ecore_Con_Event_Url_Progress EAPI extern int ECORE_CON_EVENT_CLIENT_ADD; /** A client has disconnected from the server */ EAPI extern int ECORE_CON_EVENT_CLIENT_DEL; -/** A client experienced an error */ -EAPI extern int ECORE_CON_EVENT_CLIENT_ERROR; /** A server was created */ EAPI extern int ECORE_CON_EVENT_SERVER_ADD; /** A server connection was lost */ EAPI extern int ECORE_CON_EVENT_SERVER_DEL; -/** A server experienced an error */ -EAPI extern int ECORE_CON_EVENT_SERVER_ERROR; /** A client connected to the server has sent data */ EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; /** A server connection object has data */ @@ -485,7 +449,6 @@ EAPI double ecore_con_client_uptime_get(Ecore_Con_Client *cl); EAPI double ecore_con_client_timeout_get(Ecore_Con_Client *cl); EAPI void ecore_con_client_timeout_set(Ecore_Con_Client *cl, double timeout); EAPI Eina_Bool ecore_con_client_connected_get(Ecore_Con_Client *cl); -EAPI int ecore_con_client_port_get(Ecore_Con_Client *cl); /** * @} @@ -548,7 +511,9 @@ EAPI Eina_Bool ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, EINA_DEPRECATED EAPI Eina_Bool ecore_con_url_send(Ecore_Con_Url *url_con, const void *data, long length, const char *content_type); -EAPI Eina_Bool ecore_con_url_get(Ecore_Con_Url *url_con); +EAPI Eina_Bool ecore_con_url_get(Ecore_Con_Url *url_con, + const void *data, long length, + const char *content_type); EAPI Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con, const void *data, long length, const char *content_type); @@ -577,9 +542,6 @@ EAPI Eina_Bool ecore_con_url_cookies_jar_file_set(Ecore_Con_Url *url_con const char * const cookiejar_file); EAPI void ecore_con_url_cookies_jar_write(Ecore_Con_Url *url_con); -EAPI void ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url_con, - Eina_Bool verify); - /** * @} */ diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index dbf1039..64a0052 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -58,7 +58,6 @@ static void _ecore_con_cb_udp_listen(void *data, static void _ecore_con_server_free(Ecore_Con_Server *svr); static void _ecore_con_client_free(Ecore_Con_Client *cl); -static void _ecore_con_cl_read(Ecore_Con_Server *svr); static Eina_Bool _ecore_con_svr_tcp_handler(void *data, Ecore_Fd_Handler *fd_handler); static Eina_Bool _ecore_con_cl_handler(void *data, @@ -75,11 +74,11 @@ static Eina_Bool _ecore_con_svr_cl_handler(void *data, static void _ecore_con_server_flush(Ecore_Con_Server *svr); static void _ecore_con_client_flush(Ecore_Con_Client *cl); -static void _ecore_con_event_client_add_free(Ecore_Con_Server *svr, +static void _ecore_con_event_client_add_free(void *data, void *ev); -static void _ecore_con_event_client_del_free(Ecore_Con_Server *svr, +static void _ecore_con_event_client_del_free(void *data, void *ev); -static void _ecore_con_event_client_data_free(Ecore_Con_Server *svr, +static void _ecore_con_event_client_data_free(void *data, void *ev); static void _ecore_con_event_server_add_free(void *data, void *ev); @@ -87,10 +86,6 @@ static void _ecore_con_event_server_del_free(void *data, void *ev); static void _ecore_con_event_server_data_free(void *data, void *ev); -static void _ecore_con_event_server_error_free(void *data, - Ecore_Con_Event_Server_Error *e); -static void _ecore_con_event_client_error_free(Ecore_Con_Server *svr, - Ecore_Con_Event_Client_Error *e); static void _ecore_con_lookup_done(void *data, Ecore_Con_Info *infos); @@ -105,8 +100,6 @@ EAPI int ECORE_CON_EVENT_SERVER_ADD = 0; EAPI int ECORE_CON_EVENT_SERVER_DEL = 0; EAPI int ECORE_CON_EVENT_CLIENT_DATA = 0; EAPI int ECORE_CON_EVENT_SERVER_DATA = 0; -EAPI int ECORE_CON_EVENT_CLIENT_ERROR = 0; -EAPI int ECORE_CON_EVENT_SERVER_ERROR = 0; static Eina_List *servers = NULL; static int _ecore_con_init_count = 0; @@ -155,8 +148,6 @@ ecore_con_init(void) ECORE_CON_EVENT_SERVER_DEL = ecore_event_type_new(); ECORE_CON_EVENT_CLIENT_DATA = ecore_event_type_new(); ECORE_CON_EVENT_SERVER_DATA = ecore_event_type_new(); - ECORE_CON_EVENT_CLIENT_ERROR = ecore_event_type_new(); - ECORE_CON_EVENT_SERVER_ERROR = ecore_event_type_new(); eina_magic_string_set(ECORE_MAGIC_CON_SERVER, "Ecore_Con_Server"); @@ -1082,7 +1073,7 @@ ecore_con_client_data_get(Ecore_Con_Client *cl) } /** - * Gets the IP address of a client that has connected. + * Gets the IP address of a cleint that has connected. * * @param cl The given client. * @return A pointer to an internal string that contains the IP address of @@ -1105,25 +1096,6 @@ ecore_con_client_ip_get(Ecore_Con_Client *cl) } /** - * @brief Return the port that the client has connected to - * @param cl The client - * @return The port that @p cl has connected to, or -1 on error - * Use this function to return the port on which a given client has connected. - */ -EAPI int -ecore_con_client_port_get(Ecore_Con_Client *cl) -{ - if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) - { - ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, "ecore_con_client_port_get"); - return -1; - } - if (cl->client_addr->sa_family == AF_INET) - return ((struct sockaddr_in*)cl->client_addr)->sin_port; - return ((struct sockaddr_in6*)cl->client_addr)->sin6_port; -} - -/** * @brief Check how long a client has been connected * @param cl The client to check * @return The total time, in seconds, that the client has been connected to the server @@ -1162,173 +1134,26 @@ ecore_con_client_flush(Ecore_Con_Client *cl) * @} */ -void -ecore_con_event_server_add(Ecore_Con_Server *svr) -{ - /* we got our server! */ - Ecore_Con_Event_Server_Add *e; - - e = calloc(1, sizeof(Ecore_Con_Event_Server_Add)); - EINA_SAFETY_ON_NULL_RETURN(e); - - svr->event_count++; - e->server = svr; - ecore_event_add(ECORE_CON_EVENT_SERVER_ADD, e, - _ecore_con_event_server_add_free, NULL); -} - -void -ecore_con_event_server_del(Ecore_Con_Server *svr) -{ - Ecore_Con_Event_Server_Del *e; - - e = calloc(1, sizeof(Ecore_Con_Event_Server_Del)); - EINA_SAFETY_ON_NULL_RETURN(e); - - svr->event_count++; - e->server = svr; - ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e, - _ecore_con_event_server_del_free, NULL); -} - -void -ecore_con_event_server_data(Ecore_Con_Server *svr, unsigned char *buf, int num) -{ - Ecore_Con_Event_Server_Data *e; - - e = malloc(sizeof(Ecore_Con_Event_Server_Data)); - EINA_SAFETY_ON_NULL_RETURN(e); - - svr->event_count++; - e->server = svr; - e->data = malloc(num); - if (!e->data) - { - ERR("alloc!"); - free(e); - return; - } - memcpy(e->data, buf, num); - e->size = num; - ecore_event_add(ECORE_CON_EVENT_SERVER_DATA, e, - _ecore_con_event_server_data_free, NULL); -} - -void -ecore_con_event_client_add(Ecore_Con_Client *cl) -{ - Ecore_Con_Event_Client_Add *e; - - e = calloc(1, sizeof(Ecore_Con_Event_Client_Add)); - EINA_SAFETY_ON_NULL_RETURN(e); - - cl->event_count++; - cl->host_server->event_count++; - _ecore_con_cl_timer_update(cl); - e->client = cl; - ecore_event_add(ECORE_CON_EVENT_CLIENT_ADD, e, - (Ecore_End_Cb)_ecore_con_event_client_add_free, cl->host_server); - -} - -void -ecore_con_event_client_del(Ecore_Con_Client *cl) -{ - Ecore_Con_Event_Client_Del *e; - - e = calloc(1, sizeof(Ecore_Con_Event_Client_Del)); - EINA_SAFETY_ON_NULL_RETURN(e); - - if (cl) - { - cl->event_count++; - cl->host_server->event_count++; - _ecore_con_cl_timer_update(cl); - } - e->client = cl; - ecore_event_add(ECORE_CON_EVENT_CLIENT_DEL, e, - (Ecore_End_Cb)_ecore_con_event_client_del_free, cl->host_server); -} - -void -ecore_con_event_client_data(Ecore_Con_Client *cl, unsigned char *buf, int num) -{ - Ecore_Con_Event_Client_Data *e; - e = malloc(sizeof(Ecore_Con_Event_Client_Data)); - EINA_SAFETY_ON_NULL_RETURN(e); - - cl->host_server->event_count++; - cl->event_count++; - _ecore_con_cl_timer_update(cl); - e->client = cl; - e->data = malloc(num); - if (!e->data) - { - free(cl->client_addr); - free(cl); - return; - } - - memcpy(e->data, buf, num); - e->size = num; - ecore_event_add(ECORE_CON_EVENT_CLIENT_DATA, e, - (Ecore_End_Cb)_ecore_con_event_client_data_free, cl->host_server); -} - - -void -ecore_con_server_infos_del(Ecore_Con_Server *svr, void *info) -{ - svr->infos = eina_list_remove(svr->infos, info); -} - -void -ecore_con_event_server_error(Ecore_Con_Server *svr, const char *error) -{ - Ecore_Con_Event_Server_Error *e; - - e = calloc(1, sizeof(Ecore_Con_Event_Server_Error)); - EINA_SAFETY_ON_NULL_RETURN(e); - - e->server = svr; - e->error = strdup(error); - ERR("%s", error); - svr->event_count++; - ecore_event_add(ECORE_CON_EVENT_SERVER_ERROR, e, (Ecore_End_Cb)_ecore_con_event_server_error_free, NULL); -} - -void -ecore_con_event_client_error(Ecore_Con_Client *cl, const char *error) -{ - Ecore_Con_Event_Client_Error *e; - - e = calloc(1, sizeof(Ecore_Con_Event_Client_Error)); - EINA_SAFETY_ON_NULL_RETURN(e); - - e->client = cl; - e->error = strdup(error); - ERR("%s", error); - cl->event_count++; - cl->host_server->event_count++; - ecore_event_add(ECORE_CON_EVENT_CLIENT_ERROR, e, (Ecore_End_Cb)_ecore_con_event_client_error_free, cl->host_server); -} - static void _ecore_con_server_free(Ecore_Con_Server *svr) { Ecore_Con_Client *cl; double t_start, t; - while (svr->infos) - { - ecore_con_info_data_clear(svr->infos->data); - svr->infos = eina_list_remove_list(svr->infos, svr->infos); - } if ((!svr->write_buf) && svr->delete_me && (!svr->dead) && (svr->event_count < 1)) { /* this is a catch-all for cases when a server is not properly killed. */ + + Ecore_Con_Event_Server_Del *e; + svr->dead = EINA_TRUE; - ecore_con_event_server_del(svr); + e = calloc(1, sizeof(Ecore_Con_Event_Server_Del)); + EINA_SAFETY_ON_NULL_RETURN(e); + + svr->event_count++; + e->server = svr; + ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e, + _ecore_con_event_server_del_free, NULL); return; } @@ -1390,8 +1215,19 @@ _ecore_con_client_free(Ecore_Con_Client *cl) if (cl->delete_me && (!cl->dead) && (cl->event_count < 1)) { /* this is a catch-all for cases when a client is not properly killed. */ + + /* we lost our client! */ + Ecore_Con_Event_Client_Del *e; + cl->dead = EINA_TRUE; - ecore_con_event_client_del(cl); + e = calloc(1, sizeof(Ecore_Con_Event_Client_Del)); + EINA_SAFETY_ON_NULL_RETURN(e); + + cl->event_count++; + _ecore_con_cl_timer_update(cl); + e->client = cl; + ecore_event_add(ECORE_CON_EVENT_CLIENT_DEL, e, + _ecore_con_event_client_del_free, NULL); return; } @@ -1438,8 +1274,18 @@ static void _ecore_con_server_kill(Ecore_Con_Server *svr) { if (!svr->delete_me) - ecore_con_event_server_del(svr); - + { + Ecore_Con_Event_Server_Del *e; + + e = calloc(1, sizeof(Ecore_Con_Event_Server_Del)); + EINA_SAFETY_ON_NULL_RETURN(e); + + svr->event_count++; + e->server = svr; + ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e, + _ecore_con_event_server_del_free, NULL); + } + svr->dead = EINA_TRUE; if (svr->fd_handler) ecore_main_fd_handler_del(svr->fd_handler); @@ -1499,69 +1345,46 @@ _ecore_con_cb_tcp_listen(void *data, svr = data; - if (!net_info) /* error message has already been handled */ + if (!net_info) goto error; svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, net_info->info.ai_protocol); if (svr->fd < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } - + goto error; + if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } - + goto error; + lin.l_onoff = 1; lin.l_linger = 0; if (setsockopt(svr->fd, SOL_SOCKET, SO_LINGER, (const void *)&lin, sizeof(struct linger)) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } - + goto error; + if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY) { int flag = 1; if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; } if (bind(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; + if (listen(svr->fd, 4096) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; svr->fd_handler = ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ, _ecore_con_svr_tcp_handler, svr, NULL, NULL); if (!svr->fd_handler) - { - ecore_con_event_server_error(svr, "Memory allocation failure"); - goto error; - } + goto error; return; @@ -1584,16 +1407,13 @@ _ecore_con_cb_udp_listen(void *data, type = svr->type; type &= ECORE_CON_TYPE; - if (!net_info) /* error message has already been handled */ + if (!net_info) goto error; svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, net_info->info.ai_protocol); if (svr->fd < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (type == ECORE_CON_REMOTE_MCAST) { @@ -1601,69 +1421,45 @@ _ecore_con_cb_udp_listen(void *data, { if (!inet_pton(net_info->info.ai_family, net_info->ip, &mreq.imr_multiaddr)) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; mreq.imr_interface.s_addr = htonl(INADDR_ANY); if (setsockopt(svr->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) != 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; } else if (net_info->info.ai_family == AF_INET6) { if (!inet_pton(net_info->info.ai_family, net_info->ip, &mreq6.ipv6mr_multiaddr)) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; + mreq6.ipv6mr_interface = htonl(INADDR_ANY); if (setsockopt(svr->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void *)&mreq6, sizeof(mreq6)) != 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; } - } - if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&on, sizeof(on)) != 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; + if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&on, + sizeof(on)) != 0) + goto error; } if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; - if (bind(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + if (bind(svr->fd, net_info->info.ai_addr, + net_info->info.ai_addrlen) < 0) + goto error; svr->fd_handler = ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ, _ecore_con_svr_udp_handler, svr, NULL, NULL); if (!svr->fd_handler) - { - ecore_con_event_server_error(svr, "Memory allocation failure"); - goto error; - } + goto error; svr->ip = eina_stringshare_add(net_info->ip); @@ -1684,44 +1480,31 @@ _ecore_con_cb_tcp_connect(void *data, svr = data; - if (!net_info) /* error message has already been handled */ + if (!net_info) goto error; svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, net_info->info.ai_protocol); if (svr->fd < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; - if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, sizeof(curstate)) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, + sizeof(curstate)) < 0) + goto error; if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY) { int flag = 1; - if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, + sizeof(int)) < 0) + goto error; } res = connect(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen); @@ -1729,16 +1512,13 @@ _ecore_con_cb_tcp_connect(void *data, if (res == SOCKET_ERROR) { if (WSAGetLastError() != WSAEINPROGRESS) - goto error; /* FIXME: strerror on windows? */ + goto error; #else if (res < 0) { if (errno != EINPROGRESS) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; #endif svr->connecting = EINA_TRUE; @@ -1760,10 +1540,7 @@ _ecore_con_cb_tcp_connect(void *data, } if (!svr->fd_handler) - { - ecore_con_event_server_error(svr, "Memory allocation failure"); - goto error; - } + goto error; svr->ip = eina_stringshare_add(net_info->ip); @@ -1783,60 +1560,39 @@ _ecore_con_cb_udp_connect(void *data, int broadcast = 1; svr = data; - if (!net_info) /* error message has already been handled */ + if (!net_info) goto error; svr->fd = socket(net_info->info.ai_family, net_info->info.ai_socktype, net_info->info.ai_protocol); if (svr->fd < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_BROADCAST) { if (setsockopt(svr->fd, SOL_SOCKET, SO_BROADCAST, (const void *)&broadcast, sizeof(broadcast)) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; } else if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, sizeof(curstate)) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; if (connect(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + goto error; svr->fd_handler = ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ | ECORE_FD_WRITE, _ecore_con_cl_udp_handler, svr, NULL, NULL); if (!svr->fd_handler) - { - ecore_con_event_server_error(svr, "Memory allocation failure"); - goto error; - } + goto error; svr->ip = eina_stringshare_add(net_info->ip); @@ -1874,7 +1630,6 @@ svr_try_connect_plain(Ecore_Con_Server *svr) if (so_err) { /* we lost our server! */ - ecore_con_event_server_error(svr, strerror(errno)); ERR("Connection lost: %s", strerror(so_err)); _ecore_con_server_kill(svr); return ECORE_CON_DISCONNECTED; @@ -1882,9 +1637,18 @@ svr_try_connect_plain(Ecore_Con_Server *svr) if ((!svr->delete_me) && (!svr->handshaking) && svr->connecting) { + /* we got our server! */ + Ecore_Con_Event_Server_Add *e; + svr->connecting = EINA_FALSE; + e = calloc(1, sizeof(Ecore_Con_Event_Server_Add)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CON_CONNECTED); + + svr->event_count++; svr->start_time = ecore_time_get(); - ecore_con_event_server_add(svr); + e->server = svr; + ecore_event_add(ECORE_CON_EVENT_SERVER_ADD, e, + _ecore_con_event_server_add_free, NULL); } if (svr->fd_handler && (!svr->write_buf)) @@ -1922,7 +1686,7 @@ _ecore_con_pretty_ip(struct sockaddr *client_addr, if (getnameinfo(client_addr, size, ipbuf, sizeof (ipbuf), NULL, 0, NI_NUMERICHOST)) return eina_stringshare_add("0.0.0.0"); - ipbuf[sizeof(ipbuf) - 1] = 0; + ipbuf[sizeof (ipbuf) - 1] = 0; return eina_stringshare_add(ipbuf); } @@ -1951,37 +1715,22 @@ _ecore_con_svr_tcp_handler(void *data, memset(&client_addr, 0, client_addr_len); new_fd = accept(svr->fd, (struct sockaddr *)&client_addr, (socklen_t *)&client_addr_len); if (new_fd < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - return ECORE_CALLBACK_RENEW; - } + /* error! */ + return ECORE_CALLBACK_RENEW; if ((svr->client_limit >= 0) && (svr->reject_excess_clients) && (svr->client_count >= (unsigned int)svr->client_limit)) - { - ecore_con_event_server_error(svr, "Maximum client limit reached"); - goto error; - } + goto error; cl = calloc(1, sizeof(Ecore_Con_Client)); if (!cl) - { - ecore_con_event_server_error(svr, "Memory allocation failure when attempting to add a new client"); - goto error; - } + goto error; + fcntl(new_fd, F_SETFL, O_NONBLOCK); + fcntl(new_fd, F_SETFD, FD_CLOEXEC); cl->fd = new_fd; cl->host_server = svr; - if (fcntl(new_fd, F_SETFL, O_NONBLOCK) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } - if (fcntl(new_fd, F_SETFD, FD_CLOEXEC) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - goto error; - } + cl->fd_handler = ecore_main_fd_handler_add(cl->fd, ECORE_FD_READ, _ecore_con_svr_cl_handler, cl, NULL, NULL); ECORE_MAGIC_SET(cl, ECORE_MAGIC_CON_CLIENT); @@ -1996,10 +1745,7 @@ _ecore_con_svr_tcp_handler(void *data, cl->client_addr = malloc(client_addr_len); if (!cl->client_addr) - { - ecore_con_event_server_error(svr, "Memory allocation failure when attempting to add a new client"); - return ECORE_CALLBACK_RENEW; - } + goto error; cl->client_addr_len = client_addr_len; memcpy(cl->client_addr, &client_addr, client_addr_len); @@ -2007,8 +1753,20 @@ _ecore_con_svr_tcp_handler(void *data, svr->client_count++; if ((!cl->delete_me) && (!cl->handshaking)) - ecore_con_event_client_add(cl); - + { + Ecore_Con_Event_Client_Add *e; + + e = calloc(1, sizeof(Ecore_Con_Event_Client_Add)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + + cl->event_count++; + _ecore_con_cl_timer_update(cl); + e->client = cl; + ecore_event_add(ECORE_CON_EVENT_CLIENT_ADD, e, + _ecore_con_event_client_add_free, NULL); + + } + return ECORE_CALLBACK_RENEW; error: @@ -2046,8 +1804,6 @@ _ecore_con_cl_read(Ecore_Con_Server *svr) /* 0 is not a valid return value for a tcp socket */ if ((num > 0) || ((num < 0) && (errno == EAGAIN))) lost_server = EINA_FALSE; - else if (num < 0) - ecore_con_event_server_error(svr, strerror(errno)); } else { @@ -2058,7 +1814,26 @@ _ecore_con_cl_read(Ecore_Con_Server *svr) } if ((!svr->delete_me) && (num > 0)) - ecore_con_event_server_data(svr, buf, num); + { + Ecore_Con_Event_Server_Data *e; + + e = malloc(sizeof(Ecore_Con_Event_Server_Data)); + EINA_SAFETY_ON_NULL_RETURN(e); + + svr->event_count++; + e->server = svr; + e->data = malloc(num); + if (!e->data) + { + ERR("alloc!"); + free(e); + return; + } + memcpy(e->data, buf, num); + e->size = num; + ecore_event_add(ECORE_CON_EVENT_SERVER_DATA, e, + _ecore_con_event_server_data_free, NULL); + } if (lost_server) _ecore_con_server_kill(svr); @@ -2097,13 +1872,30 @@ _ecore_con_cl_handler(void *data, { ERR("ssl handshaking failed!"); svr->handshaking = EINA_FALSE; + Ecore_Con_Event_Server_Del *e; + + e = calloc(1, sizeof(Ecore_Con_Event_Server_Del)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + svr->event_count++; + e->server = svr; + ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e, + _ecore_con_event_server_del_free, NULL); } else if (!svr->ssl_state) { + /* we got our server! */ + Ecore_Con_Event_Server_Add *e; + svr->connecting = EINA_FALSE; + e = calloc(1, sizeof(Ecore_Con_Event_Server_Add)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + + svr->event_count++; svr->start_time = ecore_time_get(); - ecore_con_event_server_add(svr); + e->server = svr; + ecore_event_add(ECORE_CON_EVENT_SERVER_ADD, e, + _ecore_con_event_server_add_free, NULL); } } else if (want_read) @@ -2123,6 +1915,8 @@ static Eina_Bool _ecore_con_cl_udp_handler(void *data, Ecore_Fd_Handler *fd_handler) { + Ecore_Con_Event_Server_Data *e; + unsigned char *inbuf; unsigned char buf[READBUFSIZ]; int num; Ecore_Con_Server *svr; @@ -2144,14 +1938,26 @@ _ecore_con_cl_udp_handler(void *data, num = read(svr->fd, buf, READBUFSIZ); if ((!svr->delete_me) && (num > 0)) - ecore_con_event_server_data(svr, buf, num); - - if (num < 0 && (errno != EAGAIN) && (errno != EINTR)) { - ecore_con_event_server_error(svr, strerror(errno)); - _ecore_con_server_kill(svr); + inbuf = malloc(num); + EINA_SAFETY_ON_NULL_RETURN_VAL(inbuf, ECORE_CALLBACK_RENEW); + + memcpy(inbuf, buf, num); + + e = malloc(sizeof(Ecore_Con_Event_Server_Data)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + + svr->event_count++; + e->server = svr; + e->data = inbuf; + e->size = num; + ecore_event_add(ECORE_CON_EVENT_SERVER_DATA, e, + _ecore_con_event_server_data_free, NULL); } + if (num < 0 && (errno != EAGAIN) && (errno != EINTR)) + _ecore_con_server_kill(svr); + return ECORE_CALLBACK_RENEW; } @@ -2195,11 +2001,19 @@ _ecore_con_svr_udp_handler(void *data, if (num < 0 && (errno != EAGAIN) && (errno != EINTR)) { - ecore_con_event_server_error(svr, strerror(errno)); if (!svr->delete_me) { - svr->event_count++; - ecore_con_event_client_del(NULL); + /* we lost our client! */ + Ecore_Con_Event_Client_Del *e; + + e = calloc(1, sizeof(Ecore_Con_Event_Client_Del)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + + svr->event_count++; + /* be explicit here */ + e->client = NULL; + ecore_event_add(ECORE_CON_EVENT_CLIENT_DEL, e, + _ecore_con_event_client_del_free, NULL); } svr->dead = EINA_TRUE; @@ -2226,8 +2040,41 @@ _ecore_con_svr_udp_handler(void *data, svr->clients = eina_list_append(svr->clients, cl); svr->client_count++; - ecore_con_event_client_add(cl); - ecore_con_event_client_data(cl, buf, num); + { /* indent to keep it all nicely separated */ + Ecore_Con_Event_Client_Add *add; + + add = malloc(sizeof(Ecore_Con_Event_Client_Add)); + EINA_SAFETY_ON_NULL_RETURN_VAL(add, ECORE_CALLBACK_RENEW); + + /*cl->event_count++;*/ + add->client = cl; + _ecore_con_cl_timer_update(cl); + ecore_event_add(ECORE_CON_EVENT_CLIENT_ADD, add, + _ecore_con_event_client_add_free, NULL); + } + + + { + Ecore_Con_Event_Client_Data *e; + e = malloc(sizeof(Ecore_Con_Event_Client_Data)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + + svr->event_count++; + _ecore_con_cl_timer_update(cl); + e->client = cl; + e->data = malloc(num); + if (!e->data) + { + free(cl->client_addr); + free(cl); + return ECORE_CALLBACK_RENEW; + } + + memcpy(e->data, buf, num); + e->size = num; + ecore_event_add(ECORE_CON_EVENT_CLIENT_DATA, e, + _ecore_con_event_client_data_free, NULL); + } return ECORE_CALLBACK_RENEW; } @@ -2257,8 +2104,6 @@ _ecore_con_svr_cl_read(Ecore_Con_Client *cl) /* 0 is not a valid return value for a tcp socket */ if ((num > 0) || ((num < 0) && ((errno == EAGAIN) || (errno == EINTR)))) lost_client = EINA_FALSE; - else if (num < 0) - ecore_con_event_client_error(cl, strerror(errno)); } else { @@ -2269,12 +2114,44 @@ _ecore_con_svr_cl_read(Ecore_Con_Client *cl) } if ((!cl->delete_me) && (num > 0)) - ecore_con_event_client_data(cl, buf, num); + { + Ecore_Con_Event_Client_Data *e; + + e = malloc(sizeof(Ecore_Con_Event_Client_Data)); + EINA_SAFETY_ON_NULL_RETURN(e); + + cl->event_count++; + _ecore_con_cl_timer_update(cl); + e->client = cl; + e->data = malloc(num); + if (!e->data) + { + ERR("alloc!"); + free(e); + return; + } + memcpy(e->data, buf, num); + e->size = num; + ecore_event_add(ECORE_CON_EVENT_CLIENT_DATA, e, + _ecore_con_event_client_data_free, NULL); + } if (lost_client) { if (!cl->delete_me) - ecore_con_event_client_del(cl); + { + /* we lost our client! */ + Ecore_Con_Event_Client_Del *e; + + e = calloc(1, sizeof(Ecore_Con_Event_Client_Del)); + EINA_SAFETY_ON_NULL_RETURN(e); + + cl->event_count++; + _ecore_con_cl_timer_update(cl); + e->client = cl; + ecore_event_add(ECORE_CON_EVENT_CLIENT_DEL, e, + _ecore_con_event_client_del_free, NULL); + } INF("Lost client %s", (cl->ip) ? cl->ip : ""); cl->dead = EINA_TRUE; if (cl->fd_handler) @@ -2304,12 +2181,33 @@ _ecore_con_svr_cl_handler(void *data, { ERR("ssl handshaking failed!"); cl->handshaking = EINA_FALSE; + /* we lost our client! */ + Ecore_Con_Event_Client_Del *e; + cl->dead = EINA_TRUE; INF("Lost client %s", (cl->ip) ? cl->ip : ""); - ecore_con_event_client_del(cl); + e = calloc(1, sizeof(Ecore_Con_Event_Client_Del)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + + cl->event_count++; + _ecore_con_cl_timer_update(cl); + e->client = cl; + ecore_event_add(ECORE_CON_EVENT_CLIENT_DEL, e, + _ecore_con_event_client_del_free, NULL); } else if (!cl->ssl_state) - ecore_con_event_client_add(cl); + { + Ecore_Con_Event_Client_Add *e; + + e = calloc(1, sizeof(Ecore_Con_Event_Client_Add)); + EINA_SAFETY_ON_NULL_RETURN_VAL(e, ECORE_CALLBACK_RENEW); + + e->client = cl; + cl->event_count++; + _ecore_con_cl_timer_update(cl); + ecore_event_add(ECORE_CON_EVENT_CLIENT_ADD, e, + _ecore_con_event_client_add_free, NULL); + } } else if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ)) _ecore_con_svr_cl_read(cl); @@ -2326,10 +2224,7 @@ _ecore_con_server_flush(Ecore_Con_Server *svr) int count, num; if (!svr->write_buf) - { - ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ); - return; - } + return; num = svr->write_buf_size - svr->write_buf_offset; @@ -2358,10 +2253,7 @@ _ecore_con_server_flush(Ecore_Con_Server *svr) if (count < 0) { if ((errno != EAGAIN) && (errno != EINTR)) - { - ecore_con_event_server_error(svr, strerror(errno)); - _ecore_con_server_kill(svr); - } + _ecore_con_server_kill(svr); return; } @@ -2385,10 +2277,7 @@ _ecore_con_client_flush(Ecore_Con_Client *cl) int num, count = 0; if (!cl->buf) - { - ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ); - return; - } + return; if (cl->handshaking) { @@ -2412,8 +2301,18 @@ _ecore_con_client_flush(Ecore_Con_Client *cl) { if ((errno != EAGAIN) && (errno != EINTR) && (!cl->delete_me)) { - ecore_con_event_client_error(cl, strerror(errno)); - ecore_con_event_client_del(cl); + /* we lost our client! */ + Ecore_Con_Event_Client_Del *e; + + e = calloc(1, sizeof(Ecore_Con_Event_Client_Del)); + EINA_SAFETY_ON_NULL_RETURN(e); + + cl->event_count++; + _ecore_con_cl_timer_update(cl); + e->client = cl; + ecore_event_add(ECORE_CON_EVENT_CLIENT_DEL, e, + _ecore_con_event_client_del_free, NULL); + cl->dead = EINA_TRUE; INF("Lost client %s", (cl->ip) ? cl->ip : ""); if (cl->fd_handler) @@ -2440,24 +2339,22 @@ _ecore_con_client_flush(Ecore_Con_Client *cl) } static void -_ecore_con_event_client_add_free(Ecore_Con_Server *svr, +_ecore_con_event_client_add_free(void *data __UNUSED__, void *ev) { Ecore_Con_Event_Client_Add *e; e = ev; e->client->event_count--; - e->client->host_server->event_count--; - if ((e->client->event_count <= 0) && (e->client->delete_me)) + if ((e->client->event_count <= 0) && + (e->client->delete_me)) ecore_con_client_del(e->client); - if ((svr->event_count <= 0) && (svr->delete_me)) - _ecore_con_server_free(svr); free(e); } static void -_ecore_con_event_client_del_free(Ecore_Con_Server *svr, +_ecore_con_event_client_del_free(void *data __UNUSED__, void *ev) { Ecore_Con_Event_Client_Del *e; @@ -2466,24 +2363,20 @@ _ecore_con_event_client_del_free(Ecore_Con_Server *svr, if (!e->client) return; e->client->event_count--; - e->client->host_server->event_count--; if ((e->client->event_count <= 0) && (e->client->delete_me)) ecore_con_client_del(e->client); - if ((svr->event_count <= 0) && (svr->delete_me)) - _ecore_con_server_free(svr); free(e); } static void -_ecore_con_event_client_data_free(Ecore_Con_Server *svr, +_ecore_con_event_client_data_free(void *data __UNUSED__, void *ev) { Ecore_Con_Event_Client_Data *e; e = ev; e->client->event_count--; - e->client->host_server->event_count--; if (e->data) free(e->data); @@ -2492,8 +2385,6 @@ _ecore_con_event_client_data_free(Ecore_Con_Server *svr, ((e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP || (e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_MCAST)))) ecore_con_client_del(e->client); - if ((svr->event_count <= 0) && (svr->delete_me)) - _ecore_con_server_free(svr); free(e); } @@ -2506,7 +2397,8 @@ _ecore_con_event_server_add_free(void *data __UNUSED__, e = ev; e->server->event_count--; - if ((e->server->event_count <= 0) && (e->server->delete_me)) + if ((e->server->event_count <= 0) && + (e->server->delete_me)) _ecore_con_server_free(e->server); free(e); @@ -2520,7 +2412,8 @@ _ecore_con_event_server_del_free(void *data __UNUSED__, e = ev; e->server->event_count--; - if ((e->server->event_count <= 0) && (e->server->delete_me)) + if ((e->server->event_count <= 0) && + (e->server->delete_me)) _ecore_con_server_free(e->server); free(e); @@ -2537,37 +2430,13 @@ _ecore_con_event_server_data_free(void *data __UNUSED__, if (e->data) free(e->data); - if ((e->server->event_count <= 0) && (e->server->delete_me)) + if ((e->server->event_count <= 0) && + (e->server->delete_me)) _ecore_con_server_free(e->server); free(e); } - -static void -_ecore_con_event_server_error_free(void *data __UNUSED__, Ecore_Con_Event_Server_Error *e) -{ - e->server->event_count--; - if ((e->server->event_count <= 0) && (e->server->delete_me)) - _ecore_con_server_free(e->server); - if (e->error) free(e->error); - free(e); -} - -static void -_ecore_con_event_client_error_free(Ecore_Con_Server *svr, Ecore_Con_Event_Client_Error *e) -{ - e->client->event_count--; - e->client->host_server->event_count--; - if ((e->client->event_count <= 0) && (e->client->delete_me)) - _ecore_con_client_free(e->client); - if ((svr->event_count <= 0) && (svr->delete_me)) - _ecore_con_server_free(svr); - if (e->error) free(e->error); - free(e); - -} - static void _ecore_con_lookup_done(void *data, Ecore_Con_Info *infos) diff --git a/src/lib/ecore_con/ecore_con_ares.c b/src/lib/ecore_con/ecore_con_ares.c index ea8ec82..fd0d661 100644 --- a/src/lib/ecore_con/ecore_con_ares.c +++ b/src/lib/ecore_con/ecore_con_ares.c @@ -302,17 +302,9 @@ ecore_con_info_get(Ecore_Con_Server *svr, cares); } - svr->infos = eina_list_append(svr->infos, cares); return 1; } -void -ecore_con_info_data_clear(void *info) -{ - Ecore_Con_CAres *cares = info; - cares->data = NULL; -} - static Eina_Bool _ecore_con_info_cares_timeout_cb(void *data __UNUSED__) { @@ -523,12 +515,11 @@ _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg, case ARES_ENODATA: /* no data returned */ case ARES_ECONNREFUSED: /* connection refused */ case ARES_ETIMEOUT: /* connection timed out */ - ecore_con_event_server_error(arg->svr, ares_strerror(status)); goto on_error; default: - ERR("Unknown status returned by c-ares: %i assuming error", status); - ecore_con_event_server_error(arg->svr, ares_strerror(status)); + ERR("Unknown status returned by c-ares: %i assuming error", + status); goto on_error; } @@ -538,11 +529,7 @@ on_mem_error: ERR("Not enough memory"); on_error: - if (arg->data) - { - ecore_con_server_infos_del(arg->data, arg); - arg->done_cb(arg->data, NULL); - } + arg->done_cb(arg->data, NULL); free(arg); } @@ -566,7 +553,7 @@ _ecore_con_info_ares_nameinfo(Ecore_Con_CAres *arg, else *arg->result->service = '\0'; - if (arg->data) arg->done_cb(arg->data, arg->result); + arg->done_cb(arg->data, arg->result); break; case ARES_ENOTIMP: @@ -574,14 +561,12 @@ _ecore_con_info_ares_nameinfo(Ecore_Con_CAres *arg, case ARES_ENOMEM: case ARES_EDESTRUCTION: case ARES_EBADFLAGS: - ecore_con_event_server_error(arg->svr, ares_strerror(status)); - if (arg->data) arg->done_cb(arg->data, NULL); + arg->done_cb(arg->data, NULL); break; } free(arg->result->info.ai_addr); free(arg->result); - if (arg->data) ecore_con_server_infos_del(arg->data, arg); free(arg); } diff --git a/src/lib/ecore_con/ecore_con_info.c b/src/lib/ecore_con/ecore_con_info.c index 3cedb05..055218f 100644 --- a/src/lib/ecore_con/ecore_con_info.c +++ b/src/lib/ecore_con/ecore_con_info.c @@ -54,8 +54,6 @@ void *alloca(size_t); # include #endif -#include - #include "Ecore.h" #include "ecore_private.h" #include "ecore_con_private.h" @@ -206,10 +204,7 @@ ecore_con_info_get(Ecore_Con_Server *svr, int fd[2]; if (pipe(fd) < 0) - { - ecore_con_event_server_error(svr, strerror(errno)); - return 0; - } + return 0; cbdata = calloc(1, sizeof(CB_Data)); if (!cbdata) @@ -227,7 +222,6 @@ ecore_con_info_get(Ecore_Con_Server *svr, cbdata, NULL, NULL))) { - ecore_con_event_server_error(svr, "Memory allocation failure"); free(cbdata); close(fd[0]); close(fd[1]); @@ -312,17 +306,9 @@ ecore_con_info_get(Ecore_Con_Server *svr, info_slaves = (CB_Data *)eina_inlist_append(EINA_INLIST_GET( info_slaves), EINA_INLIST_GET(cbdata)); - svr->infos = eina_list_append(svr->infos, cbdata); return 1; } -void -ecore_con_info_data_clear(void *info) -{ - CB_Data *cbdata = info; - cbdata->data = NULL; -} - static void _ecore_con_info_readdata(CB_Data *cbdata) { @@ -361,32 +347,15 @@ _ecore_con_info_readdata(CB_Data *cbdata) recv->info.ai_next = NULL; - if (cbdata->data) - { - cbdata->cb_done(cbdata->data, recv); - ecore_con_server_infos_del(cbdata->data, cbdata); - } + cbdata->cb_done(cbdata->data, recv); free(torecv); } else - { - if (cbdata->data) - { - cbdata->cb_done(cbdata->data, NULL); - ecore_con_server_infos_del(cbdata->data, cbdata); - } - } + cbdata->cb_done(cbdata->data, NULL); } else - { - if (cbdata->data) - { - ecore_con_event_server_error(cbdata->data, strerror(errno)); - cbdata->cb_done(cbdata->data, NULL); - ecore_con_server_infos_del(cbdata->data, cbdata); - } - } + cbdata->cb_done(cbdata->data, NULL); cbdata->cb_done = NULL; } @@ -399,7 +368,6 @@ _ecore_con_info_slave_free(CB_Data *cbdata) ecore_main_fd_handler_del(cbdata->fdh); ecore_event_handler_del(cbdata->handler); close(ecore_main_fd_handler_fd_get(cbdata->fdh)); - if (cbdata->data) ecore_con_server_infos_del(cbdata->data, cbdata); free(cbdata); } @@ -417,12 +385,8 @@ _ecore_con_info_data_handler(void *data, _ecore_con_info_readdata(cbdata); else { - if (cbdata->data) - { - cbdata->cb_done(cbdata->data, NULL); - cbdata->cb_done = NULL; - ecore_con_server_infos_del(cbdata->data, cbdata); - } + cbdata->cb_done(cbdata->data, NULL); + cbdata->cb_done = NULL; } } diff --git a/src/lib/ecore_con/ecore_con_private.h b/src/lib/ecore_con/ecore_con_private.h index 0574341..d4b4a58 100644 --- a/src/lib/ecore_con/ecore_con_private.h +++ b/src/lib/ecore_con/ecore_con_private.h @@ -127,7 +127,6 @@ struct _Ecore_Con_Server int write_buf_size; int write_buf_offset; unsigned char *write_buf; - Eina_List *infos; int event_count; int client_limit; pid_t ppid; @@ -198,11 +197,6 @@ struct _Ecore_Con_Lookup const void *data; }; -/* from ecore_con.c */ -void ecore_con_server_infos_del(Ecore_Con_Server *svr, void *info); -void ecore_con_event_server_error(Ecore_Con_Server *svr, const char *error); -void ecore_con_event_client_error(Ecore_Con_Client *cl, const char *error); - /* from ecore_local.c */ int ecore_con_local_init(void); int ecore_con_local_shutdown(void); @@ -236,8 +230,6 @@ int ecore_con_info_udp_listen(Ecore_Con_Server *svr, int ecore_con_info_mcast_listen(Ecore_Con_Server *svr, Ecore_Con_Info_Cb done_cb, void *data); -void ecore_con_info_data_clear(void *info); - /* from ecore_con_ssl.c */ Ecore_Con_Ssl_Error ecore_con_ssl_init(void); Ecore_Con_Ssl_Error ecore_con_ssl_shutdown(void); diff --git a/src/lib/ecore_con/ecore_con_ssl.c b/src/lib/ecore_con/ecore_con_ssl.c index 95e22fe..c411312 100644 --- a/src/lib/ecore_con/ecore_con_ssl.c +++ b/src/lib/ecore_con/ecore_con_ssl.c @@ -46,17 +46,10 @@ static int _client_connected = 0; #if USE_GNUTLS static void -_gnutls_print_errors(void *conn, int type, int ret) -{ - char buf[1024]; - - if (!ret) return; - - snprintf(buf, sizeof(buf), "GNUTLS error: %s - %s", gnutls_strerror_name(ret), gnutls_strerror(ret)); - if (type == ECORE_CON_EVENT_CLIENT_ERROR) - ecore_con_event_client_error(conn, buf); - else - ecore_con_event_server_error(conn, buf); +_gnutls_print_errors(int ret) +{ + if (ret) + ERR("gnutls returned with error: %s - %s", gnutls_strerror_name(ret), gnutls_strerror(ret)); } #ifdef ISCOMFITOR @@ -115,21 +108,15 @@ SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_description_t status) #elif USE_OPENSSL static void -_openssl_print_errors(void *conn, int type) +_openssl_print_errors(void) { - char buf[1024]; do { unsigned long err; err = ERR_get_error(); if (!err) break; - snprintf(buf, sizeof(buf), "OpenSSL error: %s", ERR_reason_error_string(err)); - if (type == ECORE_CON_EVENT_CLIENT_ERROR) - ecore_con_event_client_error(conn, buf); - else - ecore_con_event_server_error(conn, buf); - + ERR("openssl error: %s", ERR_reason_error_string(err)); } while (1); } @@ -493,7 +480,7 @@ _ecore_con_ssl_server_prepare_gnutls(Ecore_Con_Server *svr, return ECORE_CON_SSL_ERROR_NONE; error: - _gnutls_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR, ret); + _gnutls_print_errors(ret); _ecore_con_ssl_server_shutdown_gnutls(svr); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } @@ -615,7 +602,7 @@ _ecore_con_ssl_server_init_gnutls(Ecore_Con_Server *svr) return ECORE_CON_SSL_ERROR_NONE; error: - _gnutls_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR, ret); + _gnutls_print_errors(ret); if ((ret == GNUTLS_E_WARNING_ALERT_RECEIVED) || (ret == GNUTLS_E_FATAL_ALERT_RECEIVED)) ERR("Also received alert: %s", gnutls_alert_get_name(gnutls_alert_get(svr->session))); if (svr->session && (svr->ssl_state != ECORE_CON_SSL_STATE_DONE)) @@ -917,7 +904,7 @@ _ecore_con_ssl_client_init_gnutls(Ecore_Con_Client *cl) return ECORE_CON_SSL_ERROR_NONE; error: - _gnutls_print_errors(cl, ECORE_CON_EVENT_CLIENT_ERROR, ret); + _gnutls_print_errors(ret); if ((ret == GNUTLS_E_WARNING_ALERT_RECEIVED) || (ret == GNUTLS_E_FATAL_ALERT_RECEIVED)) ERR("Also received alert: %s", gnutls_alert_get_name(gnutls_alert_get(cl->session))); if (cl->session && (cl->ssl_state != ECORE_CON_SSL_STATE_DONE)) @@ -1109,7 +1096,7 @@ error: ERR("openssl error: dh_params could not generate a safe prime!"); } else - _openssl_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR); + _openssl_print_errors(); _ecore_con_ssl_server_shutdown_openssl(svr); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } @@ -1189,7 +1176,7 @@ _ecore_con_ssl_server_init_openssl(Ecore_Con_Server *svr) return ECORE_CON_SSL_ERROR_NONE; error: - _openssl_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR); + _openssl_print_errors(); _ecore_con_ssl_server_shutdown_openssl(svr); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } @@ -1202,7 +1189,7 @@ _ecore_con_ssl_server_cafile_add_openssl(Ecore_Con_Server *svr, return EINA_TRUE; error: - _openssl_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR); + _openssl_print_errors(); return EINA_FALSE; } @@ -1226,7 +1213,7 @@ _ecore_con_ssl_server_crl_add_openssl(Ecore_Con_Server *svr, return EINA_TRUE; error: - _openssl_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR); + _openssl_print_errors(); return EINA_FALSE; } @@ -1251,7 +1238,7 @@ _ecore_con_ssl_server_privkey_add_openssl(Ecore_Con_Server *svr, error: if (fp) fclose(fp); - _openssl_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR); + _openssl_print_errors(); return EINA_FALSE; } @@ -1276,7 +1263,7 @@ _ecore_con_ssl_server_cert_add_openssl(Ecore_Con_Server *svr, error: if (fp) fclose(fp); - _openssl_print_errors(svr, ECORE_CON_EVENT_SERVER_ERROR); + _openssl_print_errors(); return EINA_FALSE; } @@ -1431,7 +1418,7 @@ _ecore_con_ssl_client_init_openssl(Ecore_Con_Client *cl) return ECORE_CON_SSL_ERROR_NONE; error: - _openssl_print_errors(cl, ECORE_CON_EVENT_CLIENT_ERROR); + _openssl_print_errors(); _ecore_con_ssl_client_shutdown_openssl(cl); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c index 075b7f0..d110538 100644 --- a/src/lib/ecore_con/ecore_con_url.c +++ b/src/lib/ecore_con/ecore_con_url.c @@ -19,7 +19,7 @@ * * Example Usage 1 (HTTP GET): * ecore_con_url_url_set(url_con, "http://www.google.com"); - * ecore_con_url_get(url_con); + * ecore_con_url_get(url_con, NULL, 0, NULL); * * Example usage 2 (HTTP POST): * ecore_con_url_url_set(url_con, "http://www.example.com/post_handler.cgi"); @@ -27,7 +27,7 @@ * * Example Usage 3 (FTP download): * ecore_con_url_url_set(url_con, "ftp://ftp.example.com/pub/myfile"); - * ecore_con_url_get(url_con); + * ecore_con_url_get(url_con, NULL, 0, NULL); * * Example Usage 4 (FTP upload as ftp://ftp.example.com/file): * ecore_con_url_url_set(url_con, "ftp://ftp.example.com"); @@ -304,7 +304,7 @@ ecore_con_url_new(const char *url) curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION, _ecore_con_url_progress_cb); curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSDATA, url_con); - curl_easy_setopt(url_con->curl_easy, CURLOPT_NOPROGRESS, EINA_FALSE); + curl_easy_setopt(url_con->curl_easy, CURLOPT_NOPROGRESS, EINA_TRUE); curl_easy_setopt(url_con->curl_easy, CURLOPT_HEADERFUNCTION, _ecore_con_url_header_cb); @@ -315,6 +315,7 @@ ecore_con_url_new(const char *url) * FIXME: Provide a means to change these timeouts */ curl_easy_setopt(url_con->curl_easy, CURLOPT_CONNECTTIMEOUT, 30); + curl_easy_setopt(url_con->curl_easy, CURLOPT_TIMEOUT, 300); curl_easy_setopt(url_con->curl_easy, CURLOPT_FOLLOWLOCATION, 1); return url_con; @@ -414,19 +415,19 @@ ecore_con_url_free(Ecore_Con_Url *url_con) { // FIXME: For an unknown reason, progress continue to arrive after destruction // this prevent any further call to the callback. - curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION, NULL); - - if (url_con->active) - { - url_con->active = EINA_FALSE; - - ret = curl_multi_remove_handle(_curlm, url_con->curl_easy); - if (ret != CURLM_OK) - ERR("curl_multi_remove_handle failed: %s", - curl_multi_strerror(ret)); - } - - curl_easy_cleanup(url_con->curl_easy); + curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION, NULL); + + if (url_con->active) + { + url_con->active = EINA_FALSE; + + ret = curl_multi_remove_handle(_curlm, url_con->curl_easy); + if (ret != CURLM_OK) + ERR("curl_multi_remove_handle failed: %s", + curl_multi_strerror(ret)); + } + + curl_easy_cleanup(url_con->curl_easy); } _url_con_list = eina_list_remove(_url_con_list, url_con); @@ -927,7 +928,12 @@ ecore_con_url_send(Ecore_Con_Url *url_con, * Sends a get request. * * @param url_con Connection object to perform a request on, previously created - * + * with ecore_con_url_new() or ecore_con_url_custom_new(). + * @param data Payload (data sent on the request) + * @param length Payload length. If @c -1, rely on automatic length + * calculation via @c strlen() on @p data. + * @param content_type Content type of the payload (e.g. text/xml) + * * @return #EINA_TRUE on success, #EINA_FALSE on error. * * @see ecore_con_url_custom_new() @@ -940,9 +946,12 @@ ecore_con_url_send(Ecore_Con_Url *url_con, * @see ecore_con_url_post() */ EAPI Eina_Bool -ecore_con_url_get(Ecore_Con_Url *url_con) +ecore_con_url_get(Ecore_Con_Url *url_con, + const void *data, + long length, + const char *content_type) { - return _ecore_con_url_send(url_con, MODE_GET, NULL, 0, NULL); + return _ecore_con_url_send(url_con, MODE_GET, data, length, content_type); } /** @@ -1403,43 +1412,6 @@ ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con, } /** - * Toggle libcurl's verify peer's certificate option. - * - * If @p verify is @c EINA_TRUE, libcurl will verify - * the authenticity of the peer's certificate, otherwise - * it will not. Default behavior of libcurl is to check - * peer's certificate. - * - * @param url_con Ecore_Con_Url instance which will be acted upon. - * @param verify Whether or not libcurl will check peer's certificate. - * @since 1.1.0 - */ -EAPI void -ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url_con, - Eina_Bool verify) -{ -#ifdef HAVE_CURL - if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL)) - { - ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, - "ecore_con_url_ssl_verify_peer_set"); - return; - } - - if (url_con->active) - return; - - if (!url_con->url) - return; - - curl_easy_setopt(url_con->curl_easy, CURLOPT_SSL_VERIFYPEER, (int)verify); -#else - (void)url_con; - (void)verify; -#endif -} - -/** * @} */ diff --git a/src/lib/ecore_config/ecore_config.c b/src/lib/ecore_config/ecore_config.c index d8b587e..ddfc64f 100644 --- a/src/lib/ecore_config/ecore_config.c +++ b/src/lib/ecore_config/ecore_config.c @@ -1636,7 +1636,7 @@ ecore_config_init_global(const char *name) snprintf(buf, PATH_MAX, "%s/.ecore/%s/.global", p, name); global = creat(buf, S_IRWXU); - if (global >= 0) + if (global) close(global); free(buf); diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 54bb215..de0c682 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -118,7 +118,7 @@ typedef struct _Ecore_Win32_Window Ecore_Win32_Window; #endif #ifndef __ECORE_WINCE_H__ -typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window; +typedef void Ecore_WinCE_Window; #endif #ifndef _ECORE_EVAS_PRIVATE_H diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index bc678ff..38a4776 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h @@ -351,7 +351,6 @@ struct _Ecore_Evas unsigned char manual_render : 1; unsigned char registered : 1; unsigned char no_comp_sync : 1; - unsigned char semi_sync : 1; int gl_sync_draw_done; // added by gl77.lee }; diff --git a/src/lib/ecore_evas/ecore_evas_x.c b/src/lib/ecore_evas/ecore_evas_x.c index beb3da9..62669b2 100644 --- a/src/lib/ecore_evas/ecore_evas_x.c +++ b/src/lib/ecore_evas/ecore_evas_x.c @@ -3065,9 +3065,8 @@ _ecore_evas_x_flush_pre(void *data, Evas *e __UNUSED__, void *event_info __UNUSE ee->engine.x.sync_val++; if (!ee->engine.x.sync_cancel) { - if (!ee->semi_sync) - ecore_x_sync_counter_val_wait(ee->engine.x.sync_counter, - ee->engine.x.sync_val); + ecore_x_sync_counter_val_wait(ee->engine.x.sync_counter, + ee->engine.x.sync_val); } } } @@ -3522,7 +3521,6 @@ ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func; ee->driver = "opengl_x11"; - ee->semi_sync = 0; // gl engine doesnt need to sync - its whole swaps ee->no_comp_sync = 0; // gl engine doesnt need to sync - its whole swaps if (disp_name) ee->name = strdup(disp_name); @@ -3620,8 +3618,8 @@ ecore_evas_gl_x11_new(const char *disp_name __UNUSED__, Ecore_X_Window parent __ return NULL; } EAPI Ecore_Evas * -ecore_evas_gl_x11_options_new(const char *disp_name __UNUSED__, Ecore_X_Window parent __UNUSED__, - int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, const int *opt __UNUSED__) +ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, + int x, int y, int w, int h, const int *opt) { return NULL; } @@ -3728,7 +3726,7 @@ ecore_evas_gl_x11_pre_post_swap_callback_set(const Ecore_Evas *ee, void *data, v } #else EAPI void -ecore_evas_gl_x11_pre_post_swap_callback_set(const Ecore_Evas *ee __UNUSED__, void *data __UNUSED__, void (*pre_cb) (void *data, Evas *e) __UNUSED__, void (*post_cb) (void *data, Evas *e) __UNUSED__) +ecore_evas_gl_x11_pre_post_swap_callback_set(const Ecore_Evas *ee, void *data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e)) { return; } diff --git a/src/lib/ecore_fb/ecore_fb_kbd.c b/src/lib/ecore_fb/ecore_fb_kbd.c index 8dcd29d..5d2a6a6 100644 --- a/src/lib/ecore_fb/ecore_fb_kbd.c +++ b/src/lib/ecore_fb/ecore_fb_kbd.c @@ -121,7 +121,7 @@ static const char *_ecore_fb_btn_syms[128] = "0x7e", "0x7f" }; -static int _ecore_fb_kbd_fd = -1; +static int _ecore_fb_kbd_fd = 0; static int _ecore_fb_ctrl = 0; static int _ecore_fb_alt = 0; static int _ecore_fb_shift = 0; @@ -296,7 +296,7 @@ ecore_fb_kbd_shutdown(void) if (_ecore_fb_kbd_fd_handler_handle) ecore_main_fd_handler_del(_ecore_fb_kbd_fd_handler_handle); if (_ecore_fb_kbd_fd >= 0) close(_ecore_fb_kbd_fd); - _ecore_fb_kbd_fd = -1; + _ecore_fb_kbd_fd = 0; _ecore_fb_kbd_fd_handler_handle = NULL; _ecore_fb_ctrl = 0; _ecore_fb_lock = 0; diff --git a/src/lib/ecore_file/Ecore_File.h b/src/lib/ecore_file/Ecore_File.h index e4b8851..8b843cb 100644 --- a/src/lib/ecore_file/Ecore_File.h +++ b/src/lib/ecore_file/Ecore_File.h @@ -44,7 +44,7 @@ extern "C" { #endif /** - * @defgroup Ecore_File_Group Ecore_File - Files and directories convenience functions + * @defgroup Ecore_File_Group Ecore_File - Files and direcotries convenience functions * * @{ */ @@ -73,8 +73,7 @@ typedef enum _Ecore_File_Event ECORE_FILE_EVENT_DELETED_FILE, /**< Deleted file event. */ ECORE_FILE_EVENT_DELETED_DIRECTORY, /**< Deleted directory event. */ ECORE_FILE_EVENT_DELETED_SELF, /**< Deleted monitored directory event. */ - ECORE_FILE_EVENT_MODIFIED, /**< Modified file or directory event. */ - ECORE_FILE_EVENT_CLOSED /**< Closed file event */ + ECORE_FILE_EVENT_MODIFIED /**< Modified file or directory event. */ } Ecore_File_Event; /** @@ -90,19 +89,8 @@ typedef void (*Ecore_File_Monitor_Cb)(void *data, Ecore_File_Monitor *em, Ecore_ typedef void (*Ecore_File_Download_Completion_Cb)(void *data, const char *file, int status); /** - * @typedef Ecore_File_Progress_Return - * What to do with the download as a return from the - * Ecore_File_Download_Progress_Cb function, if provided. - */ -typedef enum _Ecore_File_Progress_Return -{ - ECORE_FILE_PROGRESS_CONTINUE = 0, /**< Continue the download. */ - ECORE_FILE_PROGRESS_ABORT = 1 /**< Abort the download. */ -} Ecore_File_Progress_Return; - -/** * @typedef Ecore_File_Download_Progress_Cb - * Callback type used while a download is in progress. + * Callback type used when a download is finished. */ typedef int (*Ecore_File_Download_Progress_Cb)(void *data, const char *file, @@ -167,14 +155,6 @@ EAPI Eina_Bool ecore_file_download(const char *url, Ecore_File_Download_Progress_Cb progress_cb, void *data, Ecore_File_Download_Job **job_ret); -EAPI Eina_Bool ecore_file_download_full(const char *url, - const char *dst, - Ecore_File_Download_Completion_Cb completion_cb, - Ecore_File_Download_Progress_Cb progress_cb, - void *data, - Ecore_File_Download_Job **job_ret, - Eina_Hash *headers); - EAPI void ecore_file_download_abort_all(void); EAPI void ecore_file_download_abort(Ecore_File_Download_Job *job); EAPI Eina_Bool ecore_file_download_protocol_available(const char *protocol); diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c index cd29a33..7fff284 100644 --- a/src/lib/ecore_file/ecore_file.c +++ b/src/lib/ecore_file/ecore_file.c @@ -24,7 +24,7 @@ static int _ecore_file_init_count = 0; /* externally accessible functions */ /** - * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions + * @addtogroup Ecore_File_Group Ecore_File - Files and direcotries convenience functions * * @{ */ @@ -767,7 +767,7 @@ ecore_file_can_exec(const char *file) /** * @brief Get the path pointed by the given link. * - * @param lnk The name of the link. + * @param link The name of the link. * @return The path pointed by link or NULL. * * This function returns the path pointed by @p link as a newly @@ -776,12 +776,12 @@ ecore_file_can_exec(const char *file) * returned value must be freed. */ EAPI char * -ecore_file_readlink(const char *lnk) +ecore_file_readlink(const char *link) { char buf[PATH_MAX]; int count; - if ((count = readlink(lnk, buf, sizeof(buf) - 1)) < 0) return NULL; + if ((count = readlink(link, buf, sizeof(buf) - 1)) < 0) return NULL; buf[count] = 0; return strdup(buf); } diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c index ab8294a..3c2acfd 100644 --- a/src/lib/ecore_file/ecore_file_download.c +++ b/src/lib/ecore_file/ecore_file_download.c @@ -32,8 +32,7 @@ struct _Ecore_File_Download_Job Ecore_File_Download_Job *_ecore_file_download_curl(const char *url, const char *dst, Ecore_File_Download_Completion_Cb completion_cb, Ecore_File_Download_Progress_Cb progress_cb, - void *data, - Eina_Hash *headers); + void *data); static Eina_Bool _ecore_file_download_url_complete_cb(void *data, int type, void *event); static Eina_Bool _ecore_file_download_url_progress_cb(void *data, int type, void *event); @@ -78,44 +77,60 @@ ecore_file_download_shutdown(void) #endif /* BUILD_ECORE_CON */ } -#ifdef BUILD_ECORE_CON -# ifdef HAVE_CURL -static Eina_Bool -_ecore_file_download_headers_foreach_cb(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata) -{ - Ecore_File_Download_Job *job = fdata; - ecore_con_url_additional_header_add(job->url_con, key, data); - - return EINA_TRUE; -} -# endif -#endif +/** + * @addtogroup Ecore_File_Group Ecore_File - Files and direcotries convenience functions + * + * @{ + */ -static Eina_Bool -_ecore_file_download(const char *url, - const char *dst, - Ecore_File_Download_Completion_Cb completion_cb, - Ecore_File_Download_Progress_Cb progress_cb, - void *data, - Ecore_File_Download_Job **job_ret, - Eina_Hash *headers) +/** + * @brief Download the given url to the given destination. + * + * @param url The complete url to download. + * @param dst The local file to save the downloaded to. + * @param completion_cb A callback called on download complete. + * @param progress_cb A callback called during the download operation. + * @param data User data passed to both callbacks. + * @param job_ret Job used to abort the download. + * @return EINA_TRUE if the download start or EINA_FALSE on failure + * + * This function starts the download of the URL @p url and saves it to + * @p dst. @p url must provide the protocol, including 'http://', + * 'ftp://' or 'file://'. Ecore_File must be compiled with CURL to + * download using http and ftp protocols. If @p dst is ill-formed, or + * if it already exists, the function returns EINA_FALSE. When the + * download is complete, the callback @p completion_cb is called and + * @p data is passed to it. The @p status parameter of @p completion_cb + * will be filled with the status of the download (200, 404,...). The + * @p progress_cb is called during the download operation, each time a + * packet i received or when CURL wants. It can be used to display the + * percentage of the downloaded file. The only operations that can be + * aborted are those with protocol 'http' or 'ftp'. In that case @p job_ret + * can be filled. It can be used with ecore_file_download_abort() or + * ecore_file_download_abort_all() to respectively abort one or all + * download operations. This function returns EINA_TRUE if the + * download starts, EINA_FALSE otherwise. + */ +EAPI Eina_Bool +ecore_file_download(const char *url, + const char *dst, + Ecore_File_Download_Completion_Cb completion_cb, + Ecore_File_Download_Progress_Cb progress_cb, + void *data, + Ecore_File_Download_Job **job_ret) { #ifdef BUILD_ECORE_CON char *dir = ecore_file_dir_get(dst); if (!ecore_file_is_dir(dir)) { - EINA_LOG_ERR("%s is not a directory", dir); free(dir); return EINA_FALSE; } free(dir); - if (ecore_file_exists(dst)) - { - EINA_LOG_ERR("%s already exists", dst); - return EINA_FALSE; - } + if (ecore_file_exists(dst)) return EINA_FALSE; + /* FIXME: Add handlers for http and ftp! */ if (!strncmp(url, "file://", 7)) { /* FIXME: Maybe fork? Might take a while to copy. @@ -128,25 +143,18 @@ _ecore_file_download(const char *url, return ecore_file_cp(url, dst); } # ifdef HAVE_CURL - else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) || + else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "ftp://", 6))) { /* download */ Ecore_File_Download_Job *job; - job = _ecore_file_download_curl(url, dst, completion_cb, progress_cb, data, headers); + job = _ecore_file_download_curl(url, dst, completion_cb, progress_cb, data); if(job_ret) *job_ret = job; - if(job) - return EINA_TRUE; - else - { - EINA_LOG_ERR("no job returned\n"); - return EINA_FALSE; - } return job ? EINA_TRUE : EINA_FALSE; } # else - else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) || + else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "ftp://", 6))) { (void)completion_cb; @@ -169,76 +177,6 @@ _ecore_file_download(const char *url, } /** - * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions - * - * @{ - */ - -/** - * @brief Download the given url to the given destination. - * - * @param url The complete url to download. - * @param dst The local file to save the downloaded to. - * @param completion_cb A callback called on download complete. - * @param progress_cb A callback called during the download operation. - * @param data User data passed to both callbacks. - * @param job_ret Job used to abort the download. - * @return EINA_TRUE if the download start or EINA_FALSE on failure - * - * This function starts the download of the URL @p url and saves it to - * @p dst. @p url must provide the protocol, including 'http://', - * 'ftp://' or 'file://'. Ecore_File must be compiled with CURL to - * download using http and ftp protocols. If @p dst is ill-formed, or - * if it already exists, the function returns EINA_FALSE. When the - * download is complete, the callback @p completion_cb is called and - * @p data is passed to it. The @p status parameter of @p completion_cb - * will be filled with the status of the download (200, 404,...). The - * @p progress_cb is called during the download operation, each time a - * packet is received or when CURL wants. It can be used to display the - * percentage of the downloaded file. Return 0 from this callback, if provided, - * to continue the operation or anything else to abort the download. The only - * operations that can be aborted are those with protocol 'http' or 'ftp'. In - * that case @p job_ret can be filled. It can be used with - * ecore_file_download_abort() or ecore_file_download_abort_all() to - * respectively abort one or all download operations. This function returns - * EINA_TRUE if the download starts, EINA_FALSE otherwise. - */ -EAPI Eina_Bool -ecore_file_download(const char *url, - const char *dst, - Ecore_File_Download_Completion_Cb completion_cb, - Ecore_File_Download_Progress_Cb progress_cb, - void *data, - Ecore_File_Download_Job **job_ret) -{ - return _ecore_file_download(url, dst, completion_cb, progress_cb, data, job_ret, NULL); -} - -/** - * @brief Download the given url to the given destination with additional headers. - * - * @param url The complete url to download. - * @param dst The local file to save the downloaded to. - * @param completion_cb A callback called on download complete. - * @param progress_cb A callback called during the download operation. - * @param data User data passed to both callbacks. - * @param job_ret Job used to abort the download. - * @param headers pointer of header lists. - * @return EINA_TRUE if the download start or EINA_FALSE on failure - */ -EAPI Eina_Bool -ecore_file_download_full(const char *url, - const char *dst, - Ecore_File_Download_Completion_Cb completion_cb, - Ecore_File_Download_Progress_Cb progress_cb, - void *data, - Ecore_File_Download_Job **job_ret, - Eina_Hash *headers) -{ - return _ecore_file_download(url, dst, completion_cb, progress_cb, data, job_ret, headers); -} - -/** * @brief Check if the given protocol is available. * * @param protocol The protocol to check. @@ -328,8 +266,7 @@ Ecore_File_Download_Job * _ecore_file_download_curl(const char *url, const char *dst, Ecore_File_Download_Completion_Cb completion_cb, Ecore_File_Download_Progress_Cb progress_cb, - void *data, - Eina_Hash *headers) + void *data) { Ecore_File_Download_Job *job; @@ -352,7 +289,6 @@ _ecore_file_download_curl(const char *url, const char *dst, return NULL; } - if (headers) eina_hash_foreach(headers, _ecore_file_download_headers_foreach_cb, job); ecore_con_url_fd_set(job->url_con, fileno(job->file)); ecore_con_url_data_set(job->url_con, data); @@ -362,7 +298,7 @@ _ecore_file_download_curl(const char *url, const char *dst, job->progress_cb = progress_cb; _job_list = eina_list_append(_job_list, job); - ecore_con_url_get(job->url_con); + ecore_con_url_get(job->url_con, NULL, 0, NULL); return job; } diff --git a/src/lib/ecore_file/ecore_file_monitor.c b/src/lib/ecore_file/ecore_file_monitor.c index 7c334c0..15028fa 100644 --- a/src/lib/ecore_file/ecore_file_monitor.c +++ b/src/lib/ecore_file/ecore_file_monitor.c @@ -67,7 +67,7 @@ ecore_file_monitor_shutdown(void) } /** - * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions + * @addtogroup Ecore_File_Group Ecore_File - Files and direcotries convenience functions * * @{ */ diff --git a/src/lib/ecore_file/ecore_file_monitor_inotify.c b/src/lib/ecore_file/ecore_file_monitor_inotify.c index 255ca1b..e9bb595 100644 --- a/src/lib/ecore_file/ecore_file_monitor_inotify.c +++ b/src/lib/ecore_file/ecore_file_monitor_inotify.c @@ -47,7 +47,6 @@ struct _Ecore_File_Monitor_Inotify static Ecore_Fd_Handler *_fdh = NULL; static Ecore_File_Monitor *_monitors = NULL; -static pid_t _inotify_fd_pid = -1; static Eina_Bool _ecore_file_monitor_inotify_handler(void *data, Ecore_Fd_Handler *fdh); static Ecore_File_Monitor *_ecore_file_monitor_inotify_monitor_find(int wd); @@ -65,7 +64,7 @@ ecore_file_monitor_inotify_init(void) fd = inotify_init(); if (fd < 0) return 0; - + _fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _ecore_file_monitor_inotify_handler, NULL, NULL, NULL); if (!_fdh) @@ -74,7 +73,6 @@ ecore_file_monitor_inotify_init(void) return 0; } - _inotify_fd_pid = getpid(); return 1; } @@ -92,7 +90,6 @@ ecore_file_monitor_inotify_shutdown(void) ecore_main_fd_handler_del(_fdh); close(fd); } - _inotify_fd_pid = -1; return 1; } @@ -106,14 +103,6 @@ ecore_file_monitor_inotify_add(const char *path, Ecore_File_Monitor *em; int len; - if (_inotify_fd_pid == -1) return NULL; - - if (_inotify_fd_pid != getpid()) - { - ecore_file_monitor_inotify_shutdown(); - ecore_file_monitor_inotify_init(); - } - em = calloc(1, sizeof(Ecore_File_Monitor_Inotify)); if (!em) return NULL; @@ -218,7 +207,7 @@ _ecore_file_monitor_inotify_events(Ecore_File_Monitor *em, char *file, int mask) if (mask & IN_CLOSE_WRITE) { if (!isdir) - em->func(em->data, em, ECORE_FILE_EVENT_CLOSED, buf); + em->func(em->data, em, ECORE_FILE_EVENT_MODIFIED, buf); } if (mask & IN_MODIFY) { diff --git a/src/lib/ecore_file/ecore_file_path.c b/src/lib/ecore_file/ecore_file_path.c index d6e5ea6..6990250 100644 --- a/src/lib/ecore_file/ecore_file_path.c +++ b/src/lib/ecore_file/ecore_file_path.c @@ -77,7 +77,7 @@ _ecore_file_path_from_env(const char *env) } /** - * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions + * @addtogroup Ecore_File_Group Ecore_File - Files and direcotries convenience functions * * @{ */ diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h index 5e71c14..68a35ca 100644 --- a/src/lib/ecore_imf/Ecore_IMF.h +++ b/src/lib/ecore_imf/Ecore_IMF.h @@ -43,519 +43,1186 @@ # endif #endif +/** + * @file Ecore_IMF.h + * @brief The file that provides the ISF IMCONTROL Structures and APIs + * @version 1.0 + * @ingroup Ecore_IMF_Context_IMControl_Group + */ + #ifdef __cplusplus extern "C" { #endif -/* ecore_imf_context_input_panel_event_callback_add() flag */ -typedef enum -{ - ECORE_IMF_INPUT_PANEL_STATE_EVENT, /**< Input Panel STATE Event */ - ECORE_IMF_INPUT_PANEL_MODE_EVENT, /**< Input Panel MODE Event */ - ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, /**< Input Panel LANGUAGE Event */ - ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< Input Panel SHIFT MODE */ - ECORE_IMF_INPUT_PANEL_PREEDIT_MODE_EVENT, /**< Input Panel PREEDIT MODE */ - ECORE_IMF_INPUT_PANEL_COMPLETION_MODE_EVENT, /**< Input Panel COMPLETION MODE */ - ECORE_IMF_INPUT_PANEL_CUSTOM_INPUT_MODE_EVENT, /**< Input Panel CUSTOM INPUT MODE */ - - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_01, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_02, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_03, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_04, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_05, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_06, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_07, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_08, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_09, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_10, /**< Input Panel PRIVATE CONTEXT */ - ECORE_IMF_INPUT_PANEL_EVENT_INVALID -} Ecore_IMF_Input_Panel_Event; - -typedef enum -{ - ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Show Input panel */ - ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Hide Input panel */ - ECORE_IMF_INPUT_PANEL_STATE_INVALID -} Ecore_IMF_Input_Panel_State; - -typedef enum -{ - ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, /**< Default 4x4 layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_URL, /**< URL layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_1 = 100, /* Reserved for future use */ - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_2, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_3, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_4, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_5, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_6, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_7, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_8, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_9, - ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_10, - ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID -} Ecore_IMF_Input_Panel_Layout; - -typedef enum -{ - ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */ - ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */ -} Ecore_IMF_Input_Panel_Lang; - -typedef enum -{ - ECORE_IMF_KEYBOARD_LANG_NATIVE, /**< Native */ - ECORE_IMF_KEYBOARD_LANG_ALPHABET /**< Alphabet */ -} Ecore_IMF_Keyboard_Lang; - -typedef enum -{ - ECORE_IMF_AUTOCORRECTION_DEFAULT, - ECORE_IMF_AUTOCORRECTION_NO, - ECORE_IMF_AUTOCORRECTION_YES, - ECORE_IMF_AUTOCORRECTION_INVALID -} Ecore_IMF_Autocorrection; - -typedef enum -{ - ECORE_IMF_INPUT_PANEL_CAPS_MODE_OFF, /**< Off */ - ECORE_IMF_INPUT_PANEL_CAPS_MODE_ON, /**< On */ - ECORE_IMF_INPUT_PANEL_CAPS_MODE_LOCK, /**< Lock */ -} Ecore_IMF_Input_Panel_Caps_Mode; - -typedef enum -{ - ECORE_IMF_INPUT_PANEL_ORIENT_NONE, - ECORE_IMF_INPUT_PANEL_ORIENT_90_CW, /* Clockwise */ - ECORE_IMF_INPUT_PANEL_ORIENT_180, - ECORE_IMF_INPUT_PANEL_ORIENT_90_CCW /* CounterClockwise */ -} Ecore_IMF_Input_Panel_Orient; - -typedef struct -{ - int layout_idx; - int key_idx; - Eina_Bool disabled; -} Disable_Key_Item; - -typedef struct -{ - int layout_idx; - int key_idx; - int type; - char data[128]; // label or image path - int key_value; - char key_string[32]; -} Private_Key_Item; - -/* Events sent by the Input Method */ -typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start; -typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End; -typedef struct _Ecore_IMF_Event_Preedit_Changed Ecore_IMF_Event_Preedit_Changed; -typedef struct _Ecore_IMF_Event_Commit Ecore_IMF_Event_Commit; -typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding; - -/* Events to filter */ -typedef struct _Ecore_IMF_Event_Mouse_Down Ecore_IMF_Event_Mouse_Down; -typedef struct _Ecore_IMF_Event_Mouse_Up Ecore_IMF_Event_Mouse_Up; -typedef struct _Ecore_IMF_Event_Mouse_In Ecore_IMF_Event_Mouse_In; -typedef struct _Ecore_IMF_Event_Mouse_Out Ecore_IMF_Event_Mouse_Out; -typedef struct _Ecore_IMF_Event_Mouse_Move Ecore_IMF_Event_Mouse_Move; -typedef struct _Ecore_IMF_Event_Mouse_Wheel Ecore_IMF_Event_Mouse_Wheel; -typedef struct _Ecore_IMF_Event_Key_Down Ecore_IMF_Event_Key_Down; -typedef struct _Ecore_IMF_Event_Key_Up Ecore_IMF_Event_Key_Up; -typedef union _Ecore_IMF_Event Ecore_IMF_Event; - -typedef struct _Ecore_IMF_Context Ecore_IMF_Context; /**< An Input Method Context */ -typedef struct _Ecore_IMF_Context_Class Ecore_IMF_Context_Class; /**< An Input Method Context class */ -typedef struct _Ecore_IMF_Context_Info Ecore_IMF_Context_Info; /**< An Input Method Context info */ - -/* Preedit attribute info */ -typedef struct _Ecore_IMF_Preedit_Attr Ecore_IMF_Preedit_Attr; - -EAPI extern int ECORE_IMF_EVENT_PREEDIT_START; -EAPI extern int ECORE_IMF_EVENT_PREEDIT_END; -EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED; -EAPI extern int ECORE_IMF_EVENT_COMMIT; -EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING; - -typedef enum -{ - ECORE_IMF_EVENT_MOUSE_DOWN, - ECORE_IMF_EVENT_MOUSE_UP, - ECORE_IMF_EVENT_MOUSE_IN, - ECORE_IMF_EVENT_MOUSE_OUT, - ECORE_IMF_EVENT_MOUSE_MOVE, - ECORE_IMF_EVENT_MOUSE_WHEEL, - ECORE_IMF_EVENT_KEY_DOWN, - ECORE_IMF_EVENT_KEY_UP -} Ecore_IMF_Event_Type; - -typedef enum -{ - ECORE_IMF_KEYBOARD_MODIFIER_NONE = 0, /**< No active modifiers */ - ECORE_IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */ - ECORE_IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */ - ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */ - ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3 /**< "Win" (between "Ctrl" and "Alt") is pressed */ -} Ecore_IMF_Keyboard_Modifiers; - -typedef enum -{ - ECORE_IMF_KEYBOARD_LOCK_NONE = 0, /**< No locks are active */ - ECORE_IMF_KEYBOARD_LOCK_NUM = 1 << 0, /**< "Num" lock is active */ - ECORE_IMF_KEYBOARD_LOCK_CAPS = 1 << 1, /**< "Caps" lock is active */ - ECORE_IMF_KEYBOARD_LOCK_SCROLL = 1 << 2 /**< "Scroll" lock is active */ -} Ecore_IMF_Keyboard_Locks; - -typedef enum -{ - ECORE_IMF_MOUSE_NONE = 0, /**< A single click */ - ECORE_IMF_MOUSE_DOUBLE_CLICK = 1 << 0, /**< A double click */ - ECORE_IMF_MOUSE_TRIPLE_CLICK = 1 << 1 /**< A triple click */ -} Ecore_IMF_Mouse_Flags; - -typedef enum -{ - ECORE_IMF_INPUT_MODE_ALPHA = 1 << 0, - ECORE_IMF_INPUT_MODE_NUMERIC = 1 << 1, - ECORE_IMF_INPUT_MODE_SPECIAL = 1 << 2, - ECORE_IMF_INPUT_MODE_HEXA = 1 << 3, - ECORE_IMF_INPUT_MODE_TELE = 1 << 4, - ECORE_IMF_INPUT_MODE_FULL = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL), - ECORE_IMF_INPUT_MODE_INVISIBLE = 1 << 29, - ECORE_IMF_INPUT_MODE_AUTOCAP = 1 << 30 -} Ecore_IMF_Input_Mode; - -typedef enum -{ - ECORE_IMF_PREEDIT_TYPE_NONE, - ECORE_IMF_PREEDIT_TYPE_SUB1, - ECORE_IMF_PREEDIT_TYPE_SUB2, - ECORE_IMF_PREEDIT_TYPE_SUB3 -} Ecore_IMF_Preedit_Type; - -struct _Ecore_IMF_Event_Preedit_Start -{ - Ecore_IMF_Context *ctx; -}; - -struct _Ecore_IMF_Event_Preedit_End -{ - Ecore_IMF_Context *ctx; -}; - -struct _Ecore_IMF_Event_Preedit_Changed -{ - Ecore_IMF_Context *ctx; -}; - -struct _Ecore_IMF_Event_Commit -{ - Ecore_IMF_Context *ctx; - char *str; -}; - -struct _Ecore_IMF_Event_Delete_Surrounding -{ - Ecore_IMF_Context *ctx; - int offset; - int n_chars; -}; - -struct _Ecore_IMF_Event_Mouse_Down -{ - int button; /**< The button which has been pressed */ - struct { - int x, y; - } output; - struct { - int x, y; - } canvas; - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -struct _Ecore_IMF_Event_Mouse_Up -{ - int button; /**< The button which has been pressed */ - struct { - int x, y; - } output; - struct { - int x, y; - } canvas; - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -struct _Ecore_IMF_Event_Mouse_In -{ - int buttons; - struct { - int x, y; - } output; - struct { - int x, y; - } canvas; - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -struct _Ecore_IMF_Event_Mouse_Out -{ - int buttons; - struct { - int x, y; - } output; - struct { - int x, y; - } canvas; - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -struct _Ecore_IMF_Event_Mouse_Move -{ - int buttons; - struct { - struct { - int x, y; - } output; - struct { - int x, y; - } canvas; - } cur, prev; - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -struct _Ecore_IMF_Event_Mouse_Wheel -{ - int direction; /* 0 = default up/down wheel */ - int z; /* ...,-2,-1 = down, 1,2,... = up */ - struct { - int x, y; - } output; - struct { - int x, y; - } canvas; - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -struct _Ecore_IMF_Event_Key_Down -{ - const char *keyname; /**< The string name of the key pressed */ - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - const char *key; /**< The logical key : (eg shift+1 == exclamation) */ - const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */ - const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -struct _Ecore_IMF_Event_Key_Up -{ - const char *keyname; /**< The string name of the key pressed */ - Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ - Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ - const char *key; /**< The logical key : (eg shift+1 == exclamation) */ - const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */ - const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */ - unsigned int timestamp; /**< The timestamp when the event occurred */ -}; - -union _Ecore_IMF_Event -{ - Ecore_IMF_Event_Mouse_Down mouse_down; - Ecore_IMF_Event_Mouse_Up mouse_up; - Ecore_IMF_Event_Mouse_In mouse_in; - Ecore_IMF_Event_Mouse_Out mouse_out; - Ecore_IMF_Event_Mouse_Move mouse_move; - Ecore_IMF_Event_Mouse_Wheel mouse_wheel; - Ecore_IMF_Event_Key_Down key_down; - Ecore_IMF_Event_Key_Up key_up; -}; - -struct _Ecore_IMF_Preedit_Attr -{ - Ecore_IMF_Preedit_Type preedit_type; - unsigned int start_index; - unsigned int end_index; -}; - -struct _Ecore_IMF_Context_Class -{ - void (*add) (Ecore_IMF_Context *ctx); - void (*del) (Ecore_IMF_Context *ctx); - void (*client_window_set) (Ecore_IMF_Context *ctx, void *window); - void (*client_canvas_set) (Ecore_IMF_Context *ctx, void *canvas); - void (*show) (Ecore_IMF_Context *ctx); - void (*hide) (Ecore_IMF_Context *ctx); - void (*preedit_string_get) (Ecore_IMF_Context *ctx, char **str, int *cursor_pos); - void (*focus_in) (Ecore_IMF_Context *ctx); - void (*focus_out) (Ecore_IMF_Context *ctx); - void (*reset) (Ecore_IMF_Context *ctx); - void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos); - void (*use_preedit_set) (Ecore_IMF_Context *ctx, Eina_Bool use_preedit); - void (*input_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); - Eina_Bool (*filter_event) (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); - - /* Input Panel Control APIs */ - void (*control_panel_show) (Ecore_IMF_Context *ctx); - void (*control_panel_hide) (Ecore_IMF_Context *ctx); - - void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); - Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx); - - void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); - Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx); - - void (*input_panel_imdata_set) (Ecore_IMF_Context *ctx, const char* data, int len); - void (*input_panel_imdata_get) (Ecore_IMF_Context *ctx, char* data, int *len); - - void (*input_panel_use_effect_set) (Ecore_IMF_Context *ctx, Eina_Bool use_effect); - void (*input_panel_orient_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient orientation); - - void (*input_panel_move) (Ecore_IMF_Context *ctx, int x, int y); - void (*input_panel_geometry_get) (Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); - void (*input_panel_private_key_set) (Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, const char* value); - void (*input_panel_key_disabled_set) (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled); - - void (*input_panel_reset) (Ecore_IMF_Context *ctx); /* Same as reset to default property*/ - Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx); - - /* CallBack APIs */ - void (*input_panel_event_callback_add) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallBackFunc) (void *data, Ecore_IMF_Context *ctx, int value), void *data); - void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallbackFunc) (void *data, Ecore_IMF_Context *ctx, int value)); - - /* ISF related APIs */ - int (*ise_get_ise_language) (Ecore_IMF_Context *ctx, const char* input_panel_name, char*** langlist); - int (*ise_set_isf_language) (Ecore_IMF_Context *ctx, const char* lang); - int (*ise_get_active_isename) (Ecore_IMF_Context *ctx, char* name); /**< will be deprecated */ - int (*ise_set_active_ise_by_name) (Ecore_IMF_Context *ctx, const char* name); /**< will be deprecated */ - int (*ise_set_active_ise_by_uuid) (Ecore_IMF_Context *ctx, const char* uuid); /**< will be deprecated */ - int (*ise_get_iselist) (Ecore_IMF_Context *ctx, char*** iselist); /**< will be deprecated */ - void (*input_panel_caps_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode); - - void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); -}; - -struct _Ecore_IMF_Context_Info -{ - const char *id; /* ID */ - const char *description; /* Human readable description */ - const char *default_locales; /* Languages for which this context is the default, separated by : */ - const char *canvas_type; /* The canvas type used by the input method. Eg.: evas */ - int canvas_required; /* Whether the canvas usage is required for this input method */ -}; - -EAPI int ecore_imf_init(void); -EAPI int ecore_imf_shutdown(void); - -EAPI void ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void)); - -EAPI Eina_List *ecore_imf_context_available_ids_get(void); -EAPI Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type); -EAPI const char *ecore_imf_context_default_id_get(void); -EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type); -EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id); - -EAPI Ecore_IMF_Context *ecore_imf_context_add(const char *id); -EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_del(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window); -EAPI void *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas); -EAPI void *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_show(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_hide(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos); -EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); -EAPI void ecore_imf_context_focus_in(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_focus_out(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_reset(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos); -EAPI void ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit); -EAPI void ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data); -EAPI void ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); -EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx); -EAPI Eina_Bool ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); - -/* plugin specific functions */ -EAPI Ecore_IMF_Context *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc); -EAPI void ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data); -EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx); -EAPI Eina_Bool ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos); -EAPI void ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str); -EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars); - -EAPI void ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx); - -EAPI void ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); -EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); -EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const char * data, int len); -EAPI void ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, char *data, int *len); -EAPI void ecore_imf_context_input_panel_use_effect_set(Ecore_IMF_Context *ctx, Eina_Bool use_effect); -EAPI Eina_Bool ecore_imf_context_input_panel_use_effect_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); -EAPI void ecore_imf_context_input_panel_private_key_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, int key_value, const char* key_string); -EAPI Eina_List *ecore_imf_context_input_panel_private_key_list_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_reset(Ecore_IMF_Context *ctx); /* Same as reset to default property*/ -EAPI void ecore_imf_context_input_panel_orient_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient orientation); -EAPI Ecore_IMF_Input_Panel_Orient ecore_imf_context_input_panel_orient_get(Ecore_IMF_Context *ctx); -EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data); -EAPI void ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value)); -EAPI void ecore_imf_context_input_panel_key_disabled_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled); -EAPI Eina_List *ecore_imf_context_input_panel_key_disabled_list_get(Ecore_IMF_Context *ctx); -EAPI void ecore_imf_context_input_panel_move(Ecore_IMF_Context *ctx, int x, int y); -EAPI void ecore_imf_context_input_panel_caps_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode); - -EAPI void ecore_imf_context_keyboard_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Keyboard_Lang lang); -EAPI Ecore_IMF_Keyboard_Lang ecore_imf_context_keyboard_language_get(Ecore_IMF_Context *ctx); - -/* functions to control isf */ -EAPI int ecore_imf_context_ise_get_ise_language(Ecore_IMF_Context *ctx, const char* ise_name, char ***langlist); -EAPI void ecore_imf_context_ise_set_isf_language(Ecore_IMF_Context *ctx, const char* lang); -EAPI void ecore_imf_context_ise_get_active_isename(Ecore_IMF_Context *ctx, char* name); -EAPI void ecore_imf_context_ise_set_active_ise_by_name(Ecore_IMF_Context *ctx, const char* name); -EAPI void ecore_imf_context_ise_set_active_ise_by_uuid(Ecore_IMF_Context *ctx, const char* uuid); -EAPI int ecore_imf_context_ise_get_iselist(Ecore_IMF_Context *ctx, char*** iselist); - -/* The following entry points must be exported by each input method module - */ - -/* - * int imf_module_init (const Ecore_IMF_Context_Info **info); - * void imf_module_exit (void); - * Ecore_IMF_Context *imf_module_create (void); - */ + /* ecore_imf_context_input_panel_event_callback_add() flag */ + typedef enum + { + ECORE_IMF_INPUT_PANEL_STATE_EVENT, /**< Input Panel STATE Event */ + ECORE_IMF_INPUT_PANEL_MODE_EVENT, /**< Input Panel MODE Event */ + ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, /**< Input Panel LANGUAGE Event */ + ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< Input Panel SHIFT MODE */ + ECORE_IMF_INPUT_PANEL_PREEDIT_MODE_EVENT, /**< Input Panel PREEDIT MODE */ + ECORE_IMF_INPUT_PANEL_COMPLETION_MODE_EVENT, /**< Input Panel COMPLETION MODE */ + ECORE_IMF_INPUT_PANEL_CUSTOM_INPUT_MODE_EVENT, /**< Input Panel CUSTOM INPUT MODE */ + + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_01, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_02, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_03, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_04, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_05, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_06, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_07, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_08, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_09, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_PRIVATE_CONTEXT_10, /**< Input Panel PRIVATE CONTEXT */ + ECORE_IMF_INPUT_PANEL_EVENT_INVALID + } Ecore_IMF_Input_Panel_Event; + + typedef enum + { + ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Show Input panel */ + ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Hide Input panel */ + ECORE_IMF_INPUT_PANEL_STATE_INVALID + } Ecore_IMF_Input_Panel_State; + + typedef enum + { + ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, /**< Default 4x4 layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_URL, /**< URL layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_1 = 100, /* Reserved for future use */ + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_2, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_3, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_4, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_5, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_6, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_7, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_8, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_9, + ECORE_IMF_INPUT_PANEL_LAYOUT_CUSTOM_10, + ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID + } Ecore_IMF_Input_Panel_Layout; + + typedef enum + { + ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */ + ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */ + } Ecore_IMF_Input_Panel_Lang; + + typedef enum + { + ECORE_IMF_KEYBOARD_LANG_NATIVE, /**< Native */ + ECORE_IMF_KEYBOARD_LANG_ALPHABET /**< Alphabet */ + } Ecore_IMF_Keyboard_Lang; + + typedef enum + { + ECORE_IMF_AUTOCORRECTION_DEFAULT, + ECORE_IMF_AUTOCORRECTION_NO, + ECORE_IMF_AUTOCORRECTION_YES, + ECORE_IMF_AUTOCORRECTION_INVALID + } Ecore_IMF_Autocorrection; + + typedef enum + { + ECORE_IMF_INPUT_PANEL_CAPS_MODE_OFF, /**< Off */ + ECORE_IMF_INPUT_PANEL_CAPS_MODE_ON, /**< On */ + ECORE_IMF_INPUT_PANEL_CAPS_MODE_LOCK, /**< Lock */ + } Ecore_IMF_Input_Panel_Caps_Mode; + + typedef enum + { + ECORE_IMF_INPUT_PANEL_ORIENT_NONE, + ECORE_IMF_INPUT_PANEL_ORIENT_90_CW, /* Clockwise */ + ECORE_IMF_INPUT_PANEL_ORIENT_180, + ECORE_IMF_INPUT_PANEL_ORIENT_90_CCW /* CounterClockwise */ + } Ecore_IMF_Input_Panel_Orient; + + typedef struct + { + int layout_idx; + int key_idx; + Eina_Bool disabled; + } Disable_Key_Item; + + typedef struct + { + int layout_idx; + int key_idx; + int type; + char data[128]; // label or image path + int key_value; + char key_string[32]; + } Private_Key_Item; + + /* Events sent by the Input Method */ + typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start; + typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End; + typedef struct _Ecore_IMF_Event_Preedit_Changed Ecore_IMF_Event_Preedit_Changed; + typedef struct _Ecore_IMF_Event_Commit Ecore_IMF_Event_Commit; + typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding; + + /* Events to filter */ + typedef struct _Ecore_IMF_Event_Mouse_Down Ecore_IMF_Event_Mouse_Down; + typedef struct _Ecore_IMF_Event_Mouse_Up Ecore_IMF_Event_Mouse_Up; + typedef struct _Ecore_IMF_Event_Mouse_In Ecore_IMF_Event_Mouse_In; + typedef struct _Ecore_IMF_Event_Mouse_Out Ecore_IMF_Event_Mouse_Out; + typedef struct _Ecore_IMF_Event_Mouse_Move Ecore_IMF_Event_Mouse_Move; + typedef struct _Ecore_IMF_Event_Mouse_Wheel Ecore_IMF_Event_Mouse_Wheel; + typedef struct _Ecore_IMF_Event_Key_Down Ecore_IMF_Event_Key_Down; + typedef struct _Ecore_IMF_Event_Key_Up Ecore_IMF_Event_Key_Up; + typedef union _Ecore_IMF_Event Ecore_IMF_Event; + + typedef struct _Ecore_IMF_Context Ecore_IMF_Context; /**< An Input Method Context */ + typedef struct _Ecore_IMF_Context_Class Ecore_IMF_Context_Class; /**< An Input Method Context class */ + typedef struct _Ecore_IMF_Context_Info Ecore_IMF_Context_Info; /**< An Input Method Context info */ + + EAPI extern int ECORE_IMF_EVENT_PREEDIT_START; + EAPI extern int ECORE_IMF_EVENT_PREEDIT_END; + EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED; + EAPI extern int ECORE_IMF_EVENT_COMMIT; + EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING; + + typedef enum + { + ECORE_IMF_EVENT_MOUSE_DOWN, + ECORE_IMF_EVENT_MOUSE_UP, + ECORE_IMF_EVENT_MOUSE_IN, + ECORE_IMF_EVENT_MOUSE_OUT, + ECORE_IMF_EVENT_MOUSE_MOVE, + ECORE_IMF_EVENT_MOUSE_WHEEL, + ECORE_IMF_EVENT_KEY_DOWN, + ECORE_IMF_EVENT_KEY_UP + } Ecore_IMF_Event_Type; + + typedef enum + { + ECORE_IMF_KEYBOARD_MODIFIER_NONE = 0, /**< No active modifiers */ + ECORE_IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */ + ECORE_IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */ + ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */ + ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3 /**< "Win" (between "Ctrl" and "Alt") is pressed */ + } Ecore_IMF_Keyboard_Modifiers; + + typedef enum + { + ECORE_IMF_KEYBOARD_LOCK_NONE = 0, /**< No locks are active */ + ECORE_IMF_KEYBOARD_LOCK_NUM = 1 << 0, /**< "Num" lock is active */ + ECORE_IMF_KEYBOARD_LOCK_CAPS = 1 << 1, /**< "Caps" lock is active */ + ECORE_IMF_KEYBOARD_LOCK_SCROLL = 1 << 2 /**< "Scroll" lock is active */ + } Ecore_IMF_Keyboard_Locks; + + typedef enum + { + ECORE_IMF_MOUSE_NONE = 0, /**< A single click */ + ECORE_IMF_MOUSE_DOUBLE_CLICK = 1 << 0, /**< A double click */ + ECORE_IMF_MOUSE_TRIPLE_CLICK = 1 << 1 /**< A triple click */ + } Ecore_IMF_Mouse_Flags; + + typedef enum + { + ECORE_IMF_INPUT_MODE_ALPHA = 1 << 0, + ECORE_IMF_INPUT_MODE_NUMERIC = 1 << 1, + ECORE_IMF_INPUT_MODE_SPECIAL = 1 << 2, + ECORE_IMF_INPUT_MODE_HEXA = 1 << 3, + ECORE_IMF_INPUT_MODE_TELE = 1 << 4, + ECORE_IMF_INPUT_MODE_FULL = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL), + ECORE_IMF_INPUT_MODE_INVISIBLE = 1 << 29, + ECORE_IMF_INPUT_MODE_AUTOCAP = 1 << 30 + } Ecore_IMF_Input_Mode; + + struct _Ecore_IMF_Event_Preedit_Start + { + Ecore_IMF_Context *ctx; + }; + + struct _Ecore_IMF_Event_Preedit_End + { + Ecore_IMF_Context *ctx; + }; + + struct _Ecore_IMF_Event_Preedit_Changed + { + Ecore_IMF_Context *ctx; + }; + + struct _Ecore_IMF_Event_Commit + { + Ecore_IMF_Context *ctx; + char *str; + }; + + struct _Ecore_IMF_Event_Delete_Surrounding + { + Ecore_IMF_Context *ctx; + int offset; + int n_chars; + }; + + struct _Ecore_IMF_Event_Mouse_Down + { + int button; /**< The button which has been pressed */ + struct { + int x, y; + } output; + struct { + int x, y; + } canvas; + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + struct _Ecore_IMF_Event_Mouse_Up + { + int button; /**< The button which has been pressed */ + struct { + int x, y; + } output; + struct { + int x, y; + } canvas; + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + struct _Ecore_IMF_Event_Mouse_In + { + int buttons; + struct { + int x, y; + } output; + struct { + int x, y; + } canvas; + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + struct _Ecore_IMF_Event_Mouse_Out + { + int buttons; + struct { + int x, y; + } output; + struct { + int x, y; + } canvas; + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + struct _Ecore_IMF_Event_Mouse_Move + { + int buttons; + struct { + struct { + int x, y; + } output; + struct { + int x, y; + } canvas; + } cur, prev; + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + struct _Ecore_IMF_Event_Mouse_Wheel + { + int direction; /* 0 = default up/down wheel */ + int z; /* ...,-2,-1 = down, 1,2,... = up */ + struct { + int x, y; + } output; + struct { + int x, y; + } canvas; + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + struct _Ecore_IMF_Event_Key_Down + { + const char *keyname; /**< The string name of the key pressed */ + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + const char *key; /**< The logical key : (eg shift+1 == exclamation) */ + const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */ + const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + struct _Ecore_IMF_Event_Key_Up + { + const char *keyname; /**< The string name of the key pressed */ + Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */ + Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */ + const char *key; /**< The logical key : (eg shift+1 == exclamation) */ + const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */ + const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */ + unsigned int timestamp; /**< The timestamp when the event occured */ + }; + + union _Ecore_IMF_Event + { + Ecore_IMF_Event_Mouse_Down mouse_down; + Ecore_IMF_Event_Mouse_Up mouse_up; + Ecore_IMF_Event_Mouse_In mouse_in; + Ecore_IMF_Event_Mouse_Out mouse_out; + Ecore_IMF_Event_Mouse_Move mouse_move; + Ecore_IMF_Event_Mouse_Wheel mouse_wheel; + Ecore_IMF_Event_Key_Down key_down; + Ecore_IMF_Event_Key_Up key_up; + }; + + typedef enum + { + ECORE_IMF_PREEDIT_TYPE_NONE = 0, + ECORE_IMF_PREEDIT_TYPE_SUB1 = 1, + ECORE_IMF_PREEDIT_TYPE_SUB2 = 2, + ECORE_IMF_PREEDIT_TYPE_SUB3 = 3 + } Ecore_IMF_Preedit_Type; + + typedef struct _Ecore_IMF_Preedit_Attr Ecore_IMF_Preedit_Attr; + + struct _Ecore_IMF_Preedit_Attr + { + Ecore_IMF_Preedit_Type preedit_type; + unsigned int start_index; + unsigned int end_index; + }; + + struct _Ecore_IMF_Context_Class + { + void (*add) (Ecore_IMF_Context *ctx); + void (*del) (Ecore_IMF_Context *ctx); + void (*client_window_set) (Ecore_IMF_Context *ctx, void *window); + void (*client_canvas_set) (Ecore_IMF_Context *ctx, void *canvas); + void (*show) (Ecore_IMF_Context *ctx); + void (*hide) (Ecore_IMF_Context *ctx); + void (*preedit_string_get) (Ecore_IMF_Context *ctx, char **str, int *cursor_pos); + void (*focus_in) (Ecore_IMF_Context *ctx); + void (*focus_out) (Ecore_IMF_Context *ctx); + void (*reset) (Ecore_IMF_Context *ctx); + void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos); + void (*use_preedit_set) (Ecore_IMF_Context *ctx, Eina_Bool use_preedit); + void (*input_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); + Eina_Bool (*filter_event) (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); + + /* Input Panel Control APIs */ + void (*control_panel_show) (Ecore_IMF_Context *ctx); + void (*control_panel_hide) (Ecore_IMF_Context *ctx); + + void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); + Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx); + + void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); + Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx); + + void (*input_panel_imdata_set) (Ecore_IMF_Context *ctx, const char* data, int len); + void (*input_panel_imdata_get) (Ecore_IMF_Context *ctx, char* data, int *len); + + void (*input_panel_use_effect_set) (Ecore_IMF_Context *ctx, Eina_Bool use_effect); + void (*input_panel_orient_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient orientation); + + void (*input_panel_move) (Ecore_IMF_Context *ctx, int x, int y); + void (*input_panel_geometry_get) (Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); + void (*input_panel_private_key_set) (Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, const char* value); + void (*input_panel_key_disabled_set) (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled); + + void (*input_panel_reset) (Ecore_IMF_Context *ctx); /* Same as reset to default property*/ + Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx); + + /* CallBack APIs */ + void (*input_panel_event_callback_add) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallBackFunc) (void *data, Ecore_IMF_Context *ctx, int value), void *data); + void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallbackFunc) (void *data, Ecore_IMF_Context *ctx, int value)); + + /* ISF related APIs */ + int (*ise_get_ise_language) (Ecore_IMF_Context *ctx, const char* input_panel_name, char*** langlist); + int (*ise_set_isf_language) (Ecore_IMF_Context *ctx, const char* lang); + int (*ise_get_active_isename) (Ecore_IMF_Context *ctx, char* name); /**< will be deprecated */ + int (*ise_set_active_ise_by_name) (Ecore_IMF_Context *ctx, const char* name); /**< will be deprecated */ + int (*ise_set_active_ise_by_uuid) (Ecore_IMF_Context *ctx, const char* uuid); /**< will be deprecated */ + int (*ise_get_iselist) (Ecore_IMF_Context *ctx, char*** iselist); /**< will be deprecated */ + void (*input_panel_caps_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode); + + void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); + }; + + struct _Ecore_IMF_Context_Info + { + const char *id; /* ID */ + const char *description; /* Human readable description */ + const char *default_locales; /* Languages for which this context is the default, separated by : */ + const char *canvas_type; /* The canvas type used by the input method. Eg.: evas */ + int canvas_required; /* Whether the canvas usage is required for this input method */ + }; + + EAPI int ecore_imf_init(void); + EAPI int ecore_imf_shutdown(void); + + EAPI void ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void)); + + EAPI Eina_List *ecore_imf_context_available_ids_get(void); + EAPI Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type); + EAPI const char *ecore_imf_context_default_id_get(void); + EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type); + EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id); + + EAPI Ecore_IMF_Context *ecore_imf_context_add(const char *id); + EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_del(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window); + EAPI void* ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas); + EAPI void* ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx); + EINA_DEPRECATED EAPI void ecore_imf_context_show(Ecore_IMF_Context *ctx); + EINA_DEPRECATED EAPI void ecore_imf_context_hide(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos); + EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); + EAPI void ecore_imf_context_focus_in(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_focus_out(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_reset(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos); + EAPI void ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit); + EAPI void ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data); + EINA_DEPRECATED EAPI void ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); + EINA_DEPRECATED EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx); + EAPI Eina_Bool ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); + + /* plugin specific functions */ + EAPI Ecore_IMF_Context *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc); + EAPI void ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data); + EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx); + EAPI Eina_Bool ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos); + EAPI void ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx); + EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str); + EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars); + + /** + * Show the current active ISE with given state. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void entry_application(appdata * ad) + * { + * Evas_Object *en; + * en = elm_entry_add(ad->win_main); + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * if(imf_context) + * { + * // show input panel window + * ecore_imf_context_input_panel_show (imf_context); + * } + * } + * + * @endcode + */ + EAPI void ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx); + + /** + * Hide the current active ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void button_clicked_cb(void *data, Evas_Object *obj, void *event_info) + * { + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(obj); + * + * if(imf_context) + * { + * ecore_imf_context_input_panel_hide (imf_context); + * } + * } + * + * static void entry_application(appdata * ad) + * { + * Evas_Object *en; + * en = elm_entry_add(ad->win_main); + * evas_object_smart_callback_add(en, "clicked", button_clicked_cb, NULL); + * } + * + * @endcode + */ + EAPI void ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx); + + /** + * Show control panel. + * @param ctx context used to map real loaded APIs + * @ingroup Ecore_IMF_Context_IMControl_Group + * + * ISE control panel shows ISE list and provides setup of each ISE + */ + EAPI void ecore_imf_context_control_panel_show (Ecore_IMF_Context *ctx); + + /** + * Hide control panel. + * @param ctx context used to map real loaded APIs + * @ingroup Ecore_IMF_Context_IMControl_Group + * + * ISE control panel shows ISE list and provides setup of each ISE + */ + EAPI void ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx); + + /** + * Set ISE Language before show ISE. + * @param ctx context used to map real loaded APIs + * @param lang see Ecore_IMF_Input_Panel_Lang + * @ingroup Ecore_IMF_Context_IMControl_Group + * THIS API IS NOT SUPPORTED NOW + */ + EAPI void ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); + + /** + * Get ISE Language of current active ISE. + * @param ctx context used to map real loaded APIs + * @return Ecore_IMF_Input_Panel_Lang + * @ingroup Ecore_IMF_Context_IMControl_Group + * THIS API IS NOT SUPPORTED NOW + */ + EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get (Ecore_IMF_Context *ctx); + + /** + * Set keyboard language. + * @param ctx context used to map real loaded APIs + * @param lang see Ecore_IMF_Input_Panel_Lang + * @ingroup Ecore_IMF_Context_IMControl_Group + * THIS API IS NOT SUPPORTED NOW + */ + EAPI void ecore_imf_context_keyboard_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Keyboard_Lang lang); + + /** + * Get keyboard language. + * @param ctx context used to map real loaded APIs + * @return Ecore_IMF_Input_Panel_Lang + * @ingroup Ecore_IMF_Context_IMControl_Group + * THIS API IS NOT SUPPORTED NOW + */ + EAPI Ecore_IMF_Keyboard_Lang ecore_imf_context_keyboard_language_get (Ecore_IMF_Context *ctx); + + /** + * Get ISE Language of given ISE. -- Not supported for now -- + * @ingroup Ecore_IMF_Context_IMControl_Group + */ + EAPI int ecore_imf_context_ise_get_ise_language (Ecore_IMF_Context *ctx, const char* ise_name, char ***langlist); + + /** + * Set ISF Language. -- Not supported for now -- + * @ingroup Ecore_IMF_Context_IMControl_Group + */ + EAPI void ecore_imf_context_ise_set_isf_language (Ecore_IMF_Context *ctx, const char* lang); + + /** + * Set ISE Specific data before show ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param data data pointer + * @param len data length + * @ingroup Ecore_IMF_Context_IMControl_Group + * + * this API is used by applications to deliver specific data to ISE. + * the data format MUST be negotiated by both application and ISE negotiate. + * + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * char *im_data="application sample imdata"; + * Evas_Object *en; + * + * en = elm_entry_add(ad->layout_main); + * elm_layout_content_set(ad->layout_main, "entry", en); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_imdata_set (imf_context, im_data, strlen(im_data)+1); + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_imdata_set (Ecore_IMF_Context *ctx, const char * data, int len); + + /** + * Get ISE Specific data of current active ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param data data pointer + * @param len data length + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * int len = 256; + * char *im_data = (char*) malloc (len); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ad->entry); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_imdata_get (imf_context, im_data, &len); + * } + * + * free(im_data); + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_imdata_get (Ecore_IMF_Context *ctx, char *data, int *len); + + /** + * Set ISE whether animation effect is shown or not. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param use_effect whether animation effect is shown or not + * @ingroup Ecore_IMF_Context_IMControl_Group + * + * this API is used by applications to deliver specific data to ISE. + * the data format MUST be negotiated by both application and ISE negotiate. + * + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * Evas_Object *en; + * + * en = elm_entry_add(ad->layout_main); + * elm_layout_content_set(ad->layout_main, "entry", en); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_use_effect_set (imf_context, EINA_FALSE); // turn off the animation effect when input panel is appeared. + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_use_effect_set (Ecore_IMF_Context *ctx, Eina_Bool use_effect); + + /** + * Get whether ISE supports animation effect or not when it is shown or hidden. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param use_effect whether animation effect is shown or not + * @ingroup Ecore_IMF_Context_IMControl_Group + * + * this API is used by applications to deliver specific data to ISE. + * the data format MUST be negotiated by both application and ISE negotiate. + * + * @code + * #include + * + * static Eina_Bool get_effect_info(struct appdata *ad) + * { + * Eina_Bool use_effect = EINA_TRUE; + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ad->entry); + * + * if (imf_context) + * { + * use_effect = ecore_imf_context_input_panel_use_effect_get (imf_context); + * } + * + * return use_effect; + * } + * @endcode + */ + EAPI Eina_Bool ecore_imf_context_input_panel_use_effect_get (Ecore_IMF_Context *ctx); + + /** + * Get ISE position of current active ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param x top-left x co-ordinate of rectangle; + * @param y top-left y co-ordinate of rectangle; + * @param w width of rectangle ; + * @param h height of rectangle; + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * int get_geometry(struct appdata *ad) + * { + * Ecore_IMF_Context *imf_context = NULL; + * int x, y, w, h; + * imf_context = elm_entry_imf_context_get (ad->entry); + * if (imf_context) + * { + * ecore_imf_context_input_panel_geometry_get (imf_context, &x, &y, &w, &h); + * //here application can get window size rect + * printf ("x=%d \n", x); + * printf ("y=%d \n", y); + * printf ("width=%d \n", w); + * printf ("height=%d \n", h); + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_geometry_get (Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); + + /** + * Set ISE private key before show ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * Since the second parameter of this API requires a layout index, so before using this API application has to set a specific layout and that layout index + * should be passed in the 2nd argument of this API(see sample code). + * @param ctx context used to map real loaded APIs + * @param layout_index index of layout page to be set + * @param key_index index of key to be set + * @param label text label to be appeared on private key + * @param value value of key, If NULL it will use original value of key + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * + * #include + * + * static void create_entry(struct appdata *ad) + * { + * Evas_Object *en; + * + * en = elm_entry_add(ad->layout_main); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_private_key_set (imf_context, layout, 0, NULL, "www", -1, "www"); + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_private_key_set (Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, int key_value, const char* key_string); + + EAPI Eina_List *ecore_imf_context_input_panel_private_key_list_get (Ecore_IMF_Context *ctx); + + /** + * Set ISE Layout before show ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param layout see ECORE_IMF_INPUT_PANEL_LAYOUT + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * en = elm_entry_add(ad->layout_main); + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_layout_set (imf_context, ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL); + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); + + /** + * Get ISE Layout of current active ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @return layout see ECORE_IMF_INPUT_PANEL_LAYOUT + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void layout_get(struct appdata *ad) + * { + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ad->entry); + * + * if (imf_context) + * { + * layout = ecore_imf_context_input_panel_layout_get (imf_context); + * } + * } + * @endcode + */ + EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx); + + /** + * Reset ISE Context including its Style. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * This is special function that should be called before calling any ecore_imf_context_set*** APIs to restore all default properties of ISE. + * @ingroup Ecore_IMF_Context_IMControl_Group + * + * NOTE: This API MUST be called before calling ecore_imf_context_input_panel_show(). + */ + EAPI void ecore_imf_context_input_panel_reset (Ecore_IMF_Context *ctx); /* Same as reset to default property*/ + + /** + * Set ISE screen orientation. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * To show the keypad in landscape mode application should first call this API with 2nd parameter as 90 or 270. + * After then only application should call ecore_imf_context_input_panel_show() function. + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * en = elm_entry_add(ad->layout_main); + * elm_layout_content_set(ad->layout_main, "entry", en); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * int degree = 90; // the degree value can be either 90/270 for landscape mode and normal portrait mode 0/360. + * + * if (imf_context) + * { + * // the orient value can be + * // ECORE_IMF_INPUT_PANEL_ORIENT_NONE, + * // ECORE_IMF_INPUT_PANEL_ORIENT_90_CW // Clockwise + * // ECORE_IMF_INPUT_PANEL_ORIENT_180, + * // ECORE_IMF_INPUT_PANEL_ORIENT_90_CCW // CounterClockwise + * ecore_imf_context_input_panel_orient_set(imf_context, ECORE_IMF_INPUT_PANEL_ORIENT_90_CW); + * } + * } + */ + EAPI void ecore_imf_context_input_panel_orient_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient orientation); + + /** + * Get Input panel orientation. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * To show the keypad in landscape mode application should first call this API with 2nd parameter as 90 or 270. + * After then only application should call ecore_imf_context_input_panel_show() function. + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + + * void get_orient (struct appdata *ad) + * { + * Ecore_IMF_Input_Panel_Orient orient; + * ad->entry = elm_entry_add(ad->layout_main); + * elm_entry_input_panel_layout_set(ad->entry, ELM_INPUT_PANEL_LAYOUT_URL); + * imf_context = elm_entry_imf_context_get (ad->entry); + * if (imf_context) + * { + * orient = ecore_imf_context_input_panel_orient_get (imf_context); + * } + * + * switch (orient) + * { + * case ECORE_IMF_INPUT_PANEL_ORIENT_NONE: + * printf("0 degree\n"); + * break; + * case ECORE_IMF_INPUT_PANEL_ORIENT_90_CW: + * printf("90 degree clockwise\n"); + * break; + * case ECORE_IMF_INPUT_PANEL_ORIENT_180: + * printf("90 degree clockwise\n"); + * break; + * case ECORE_IMF_INPUT_PANEL_ORIENT_90_CCW: + * printf("90 degree counter-clockwise\n"); + * break; + * } + * } + */ + + EAPI Ecore_IMF_Input_Panel_Orient ecore_imf_context_input_panel_orient_get (Ecore_IMF_Context *ctx); + + /** + * Get name of current active ISE. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param name ISE name to be got + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * int len = 256; + * char *isename = (char*) malloc (len); + * memset(isename, '\0', sizeof(isename)); + * + * Ecore_IMF_Context *imf_context = NULL; + * imf_context = elm_entry_imf_context_get(obj); + * + * if (imf_context) + * { + * ecore_imf_context_ise_get_active_isename (imf_context, isename); + * printf("get isename=[%s]\n", isename); + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_ise_get_active_isename (Ecore_IMF_Context *ctx, char* name); + + /** + * Set ISE by its name. + * To use this API application should include Ecore_IMF.h header file. + * Before calling this API, every application should call ecore_imf_init() to initialize the ecore_imf shared library. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param name ISE name to be set + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * ecore_imf_init(); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(obj); + * + * if (imf_context) + * { + * ecore_imf_context_ise_set_active_ise_by_name (imf_context, "Input Pad"); + * } + * + * //do imf related things + * + * ecore_imf_shutdown(); + * + * //do imf irrelated things + * } + * @endcode + */ + EAPI void ecore_imf_context_ise_set_active_ise_by_name (Ecore_IMF_Context *ctx, const char* name); + + /** + * Set ISE by its uuid. + * To use this API application should include Ecore_IMF.h header file. + * Before calling this API, every application should call ecore_imf_init() to initialize the ecore_imf shared library. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param uuid ISE uuid to be set + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(obj); + * + * if (imf_context) + * { + * ecore_imf_context_ise_set_active_ise_by_uuid (imf_context, "ff110940-b8f0-4062-9ff6-a84f4f3575c0"); + * ecore_imf_context_input_panel_show (imf_context); + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_ise_set_active_ise_by_uuid (Ecore_IMF_Context *ctx, const char* uuid); + + /** + * Get list of ISEs. + * To use this API application should include Ecore_IMF.h header file. + * Before calling this API, every application should call ecore_imf_init() to initialize the ecore_imf shared library. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs + * @param iselist pointer to the list to be got. + * @return int ise counter of iselist + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * ecore_imf_init(); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(obj); + * + * if (imf_context) + * { + * char** iselist; + * int count,i; + * count = ecore_imf_context_input_panel_get_iselist(imf_context, &iselist); + * printf("get_iselist : count[%d] ", count); + * for (i=0;i + * + * static void input_panel_state_get(struct appdata *ad) + * { + * Ecore_IMF_Input_Panel_State state; + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ad->entry); + * + * if (imf_context) + * { + * state = ecore_imf_context_input_panel_state_get (imf_context); + * //here u can see what the current state is + * printf("the current state of ISE is %d", state); + * } + * } + * @endcode + */ + EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get (Ecore_IMF_Context *ctx); + + /** + * Application can register a callback function which will be called if there is change in ise state,language,mode etc. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * @param ctx context used to map real loaded APIs. + * @param pEventCallback the callback function to be called + * @param data application-ISE specific data. + * @return an integer unique to callabck registered. + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value) + * { + * if(value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) { + * // ISE state has changed to ECORE_IMF_INPUT_PANEL_STATE_SHOW status + * } else if(value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + * // ISE state has changed to ECORE_IMF_INPUT_PANEL_STATE_HIDE status + * } + * printf("value: %d\n", value); + * } + * + * static void create_entry(struct appdata *ad) + * { + * Evas_Object *en; + * en = elm_entry_add(ad->layout_main); + * elm_layout_content_set(ad->layout_main, "entry", en); + * + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_event_callback_add (imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_event_callback, data); + * } + * } + * @endcode + * In order to deregister the callback function registered application should follow the below step. + * ecore_imf_context_input_panel_event_callback_del (imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _ise_event_callback); + */ + EAPI void ecore_imf_context_input_panel_event_callback_add (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallbackFunc) (void *data, Ecore_IMF_Context *ctx, int value), const void *data); + + EAPI void ecore_imf_context_input_panel_event_callback_del (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallbackFunc) (void *data, Ecore_IMF_Context *ctx, int value)); + + /** + * Set the key to be disabled. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * Since the second parameter of this API requires a layout index, so before using this API application has to set a specific layout and that layout index + * should be passed in the 2nd argument of this API(see sample code). + * @param ctx context used to map real loaded APIs + * @param layout_index index of layout page to be set + * @param key_index index of key to be set + * @param disabled The state + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * Evas_Object *en; + * en = elm_entry_add(ad->layout_main); + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(en); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_key_disabled_set (imf_context, layout, ECORE_IMF_INPUT_PANEL_KEY_SPACE, EINA_TRUE); + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_key_disabled_set (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled); + + EAPI Eina_List *ecore_imf_context_input_panel_key_disabled_list_get (Ecore_IMF_Context *ctx); + + /** + * Move the soft keyboard to the new position. + * To use this API application should include Ecore_IMF.h header file. + * The first parameter i.e Ecore_IMF_Context *ctx is used to map the ecore_imf API into real implemented API which is inside ISF. + * Since the second parameter of this API requires a layout index, so before using this API application has to set a specific layout and that layout index + * should be passed in the 2nd argument of this API(see sample code). + * @param ctx context used to map real loaded APIs + * @param x X position to move the virtual keyboard to + * @param y Y position to move the virtual keyboard to + * @ingroup Ecore_IMF_Context_IMControl_Group + * @code + * #include + * + * static void create_entry(struct appdata *ad) + * { + * Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(obj); + * + * if (imf_context) + * { + * ecore_imf_context_input_panel_move (imf_context, 0, 400); + * } + * } + * @endcode + */ + EAPI void ecore_imf_context_input_panel_move (Ecore_IMF_Context *ctx, int x, int y); + + EAPI void ecore_imf_context_input_panel_caps_mode_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode); + + /* The following entry points must be exported by each input method module + */ + + /* + * int imf_module_init (const Ecore_IMF_Context_Info **info); + * void imf_module_exit (void); + * Ecore_IMF_Context *imf_module_create (void); + */ #ifdef __cplusplus } #endif #endif + +/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ diff --git a/src/lib/ecore_imf/Makefile.am b/src/lib/ecore_imf/Makefile.am index 358b4e7..bf6fe88 100644 --- a/src/lib/ecore_imf/Makefile.am +++ b/src/lib/ecore_imf/Makefile.am @@ -1,5 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in +if BUILD_ECORE_IMF AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib/ecore \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ @@ -24,5 +25,6 @@ $(top_builddir)/src/lib/ecore/libecore.la \ @EVIL_LIBS@ libecore_imf_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ +endif EXTRA_DIST = ecore_imf_private.h diff --git a/src/lib/ecore_imf/ecore_imf.c b/src/lib/ecore_imf/ecore_imf.c index a01dc17..060b8f2 100644 --- a/src/lib/ecore_imf/ecore_imf.c +++ b/src/lib/ecore_imf/ecore_imf.c @@ -34,11 +34,10 @@ EAPI int ecore_imf_init(void) { if (++_ecore_imf_init_count != 1) return _ecore_imf_init_count; - + if (!ecore_init()) return --_ecore_imf_init_count; - _ecore_imf_log_dom = eina_log_domain_register - ("ecore_imf", ECORE_IMF_DEFAULT_LOG_COLOR); - if (_ecore_imf_log_dom < 0) + _ecore_imf_log_dom = eina_log_domain_register("EcoreIMF", ECORE_IMF_DEFAULT_LOG_COLOR); + if (_ecore_imf_log_dom < 0) { EINA_LOG_ERR("Impossible to create a log domain for the Ecore IMF module."); ecore_shutdown(); diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c index b056df6..2919045 100644 --- a/src/lib/ecore_imf/ecore_imf_context.c +++ b/src/lib/ecore_imf/ecore_imf_context.c @@ -2,6 +2,7 @@ # include #endif +#include #include #include #include @@ -218,6 +219,7 @@ ecore_imf_context_del(Ecore_IMF_Context *ctx) "ecore_imf_context_del"); return; } + if (ctx->klass->del) ctx->klass->del(ctx); ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE); @@ -257,17 +259,7 @@ ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window) ctx->window = window; } -/** - * Get the client window of the Input Method Context - * - * See @ref ecore_imf_context_client_window_set for more details. - * - * @param ctx An #Ecore_IMF_Context. - * @return Return the client window. - * @ingroup Ecore_IMF_Context_Group - * @since 1.1.0 - */ -EAPI void * +EAPI void* ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) @@ -305,17 +297,7 @@ ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas) ctx->client_canvas = canvas; } -/** - * Get the client canvas of the Input Method Context. - * - * See @ref ecore_imf_context_client_canvas_set for more details. - * - * @param ctx An #Ecore_IMF_Context. - * @return Return the client canvas. - * @ingroup Ecore_IMF_Context_Group - * @since 1.1.0 - */ -EAPI void * +EAPI void* ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) @@ -333,7 +315,7 @@ ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx) * @param ctx An #Ecore_IMF_Context. * @ingroup Ecore_IMF_Context_Group */ -EAPI void +EINA_DEPRECATED EAPI void ecore_imf_context_show(Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) @@ -351,7 +333,7 @@ ecore_imf_context_show(Ecore_IMF_Context *ctx) * @param ctx An #Ecore_IMF_Context. * @ingroup Ecore_IMF_Context_Group */ -EAPI void +EINA_DEPRECATED EAPI void ecore_imf_context_hide(Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) @@ -392,19 +374,6 @@ ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cu } } -/** - * Retrieve the current preedit string, atrributes and - * cursor position for the Input Method Context. - * - * @param ctx An #Ecore_IMF_Context. - * @param str Location to store the retrieved string. The - * string retrieved must be freed with free(). - * @param attrs an Eina_List of attributes - * @param cursor_pos Location to store position of cursor (in characters) - * within the preedit string. - * @ingroup Ecore_IMF_Context_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos) { @@ -560,7 +529,7 @@ ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina * @param input_mode The input mode to be used by @p ctx. * @ingroup Ecore_IMF_Context_Group */ -EAPI void +EINA_DEPRECATED EAPI void ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) @@ -582,7 +551,7 @@ ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode in * @return The input mode being used by @p ctx. * @ingroup Ecore_IMF_Context_Group */ -EAPI Ecore_IMF_Input_Mode +EINA_DEPRECATED EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) @@ -758,7 +727,6 @@ _ecore_imf_event_free_preedit(void *data __UNUSED__, void *event) /** * Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue. - * * ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts. * * @param ctx An #Ecore_IMF_Context. @@ -784,7 +752,6 @@ ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx) /** * Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue. - * * ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled. * * @param ctx An #Ecore_IMF_Context. @@ -876,10 +843,8 @@ _ecore_imf_event_free_delete_surrounding(void *data __UNUSED__, void *event) } /** - * Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue. - * * Asks the widget that the input context is attached to to delete characters around the cursor position - * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue. + * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue. * Note that offset and n_chars are in characters not in bytes. * * @param ctx An #Ecore_IMF_Context. @@ -908,102 +873,60 @@ ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offse } /*** ImControl Related APIs */ - -/** - * Show the current active input panel (virtual keyboard). - * - * @param ctx An #Ecore_IMF_Context. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_show"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_show"); return; } if (ctx->klass->show) ctx->klass->show(ctx); } -/** - * Hide the current active input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_hide"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_hide"); return; } if (ctx->klass->hide) ctx->klass->hide(ctx); } -/** - * Show control panel. - * - * @param ctx An #Ecore_IMF_Context. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_control_panel_show (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_control_panel_show"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_control_panel_show"); return; } if (ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx); } -/** - * Hide control panel. - * - * @param ctx An #Ecore_IMF_Context. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_control_panel_hide"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_control_panel_hide"); return; } if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx); } -/** - * Set the language of input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @param lang the language to be set to the input panel. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_language_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_language_set"); return; } @@ -1011,44 +934,32 @@ ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_In ctx->input_panel_lang = lang; } -/** - * Get the language of input panel. - * - * See @ref ecore_imf_context_input_panel_language_set for more details. - * - * @param ctx An #Ecore_IMF_Context. - * @return Ecore_IMF_Input_Panel_Lang - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_language_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_language_get"); return ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC; } return ctx->input_panel_lang; } -/** - * Get ISE Language of given ISE. -- Not supported for now -- - * @ingroup Ecore_IMF_Context_IMControl_Group - */ EAPI int ecore_imf_context_ise_get_ise_language (Ecore_IMF_Context *ctx, const char* ise_name, char ***langlist) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_ise_get_ise_language"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_ise_get_ise_language"); return -1; } - if (!ise_name) return -1; + if (!ise_name) + { + printf ("input parameters error!!! \n"); + return -1; + } if (ctx->klass->ise_get_ise_language) return ctx->klass->ise_get_ise_language(ctx, ise_name, langlist); @@ -1056,36 +967,17 @@ ecore_imf_context_ise_get_ise_language (Ecore_IMF_Context *ctx, const char* ise_ return -1; } -/** - * Set keyboard language. - * - * @param ctx An #Ecore_IMF_Context. - * @param lang see Ecore_IMF_Input_Panel_Lang - * @ingroup Ecore_IMF_Context_IMControl_Group - * THIS API IS NOT SUPPORTED NOW - * @since 1.1.0 - */ EAPI void ecore_imf_context_keyboard_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Keyboard_Lang lang) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_keyboard_language_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_keyboard_language_set"); return; } // if (ctx->klass->ise_set_language) ctx->klass->ise_set_language(ctx, lang); } -/** - * Get keyboard language. - * - * @param ctx An #Ecore_IMF_Context. - * @return Ecore_IMF_Input_Panel_Lang - * @ingroup Ecore_IMF_Context_IMControl_Group - * THIS API IS NOT SUPPORTED NOW - * @since 1.1.0 - */ EAPI Ecore_IMF_Keyboard_Lang ecore_imf_context_keyboard_language_get (Ecore_IMF_Context *ctx) { @@ -1093,8 +985,7 @@ ecore_imf_context_keyboard_language_get (Ecore_IMF_Context *ctx) if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_keyboard_language_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_keyboard_language_get"); return lang; } /* @@ -1104,165 +995,99 @@ ecore_imf_context_keyboard_language_get (Ecore_IMF_Context *ctx) return lang; } -/** - * Set ISF Language. -- Not supported for now -- - * @ingroup Ecore_IMF_Context_IMControl_Group - */ EAPI void ecore_imf_context_ise_set_isf_language (Ecore_IMF_Context *ctx, const char* lang) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_ise_set_isf_language"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_ise_set_isf_language"); return; } - if (!lang) return; + if (!lang) + { + printf ("input parameters error!!! \n"); + return; + } - if (ctx->klass->ise_set_isf_language) - ctx->klass->ise_set_isf_language(ctx, lang); + if (ctx->klass->ise_set_isf_language) ctx->klass->ise_set_isf_language(ctx, lang); } -/** - * Set specific data to pass to input panel. - * this API is used by applications to deliver specific data to input panel. - * the data format MUST be negotiated by both application and input panel negotiate. - * - * @param ctx An #Ecore_IMF_Context. - * @param data The specific data to be set to the input panel. - * @param len the length of data - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_imdata_set (Ecore_IMF_Context *ctx, const char *data, int len) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_imdata_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_imdata_set"); return; } - if (!data || len <=0) return; + if (!data || len <=0) + { + printf ("input parameters error!!! \n"); + return; + } - if (ctx->klass->input_panel_imdata_set) - ctx->klass->input_panel_imdata_set(ctx, data, len); + if (ctx->klass->input_panel_imdata_set) ctx->klass->input_panel_imdata_set(ctx, data, len); } -/** - * Get specific data of the current active input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @param data The specific data to be got from the input panel - * @param len The length of data - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void -ecore_imf_context_input_panel_imdata_get (Ecore_IMF_Context *ctx, char *data, int *len) +ecore_imf_context_input_panel_imdata_get (Ecore_IMF_Context *ctx, char * data, int *len) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_get_imdata"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_get_imdata"); return; } - if (!data) return; + if (!data) + { + printf ("input parameters error!!! \n"); + return; + } - if (ctx->klass->input_panel_imdata_get) - ctx->klass->input_panel_imdata_get(ctx, data, len); + if (ctx->klass->input_panel_imdata_get) ctx->klass->input_panel_imdata_get(ctx, data, len); } -/** - * Set whether animation effect of the input panel is shown or not. - * - * @param ctx An #Ecore_IMF_Context. - * @param use_effect whether animation effect is shown or not - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_use_effect_set (Ecore_IMF_Context *ctx, Eina_Bool use_effect) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_use_effect_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_use_effect_set"); return; } - if (ctx->klass->input_panel_use_effect_set) - ctx->klass->input_panel_use_effect_set(ctx, use_effect); - + if (ctx->klass->input_panel_use_effect_set) ctx->klass->input_panel_use_effect_set(ctx, use_effect); ctx->use_effect = use_effect; } -/** - * Get whether input panel supports animation effect or not when it is shown or hidden. - * - * @param ctx An #Ecore_IMF_Context. - * @param use_effect whether animation effect is shown or not - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI Eina_Bool ecore_imf_context_input_panel_use_effect_get (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_use_effect_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_use_effect_get"); return EINA_TRUE; } return ctx->use_effect; } -/** - * Get position of current active input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @param x top-left x co-ordinate of rectangle; - * @param y top-left y co-ordinate of rectangle; - * @param w width of rectangle ; - * @param h height of rectangle; - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_geometry_get (Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_geometry_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_geometry_get"); return; } - if (ctx->klass->input_panel_geometry_get) - ctx->klass->input_panel_geometry_get(ctx, x, y, w, h); + if (ctx->klass->input_panel_geometry_get) ctx->klass->input_panel_geometry_get(ctx, x, y, w, h); } -/** - * Set the private key of input panel. - * Since the second parameter of this API requires a layout index, so before using this API - * application has to set a specific layout and that layout index should - * be passed in the 2nd argument of this API. - * - * @param ctx An #Ecore_IMF_Context. - * @param layout_index index of layout page to be set - * @param img_path the path of image file to be set - * @param key_index index of key to be set - * @param label text label to be appeared on private key - * @param value value of key, If NULL it will use original value of key - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void -ecore_imf_context_input_panel_private_key_set (Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char *label, int key_value, const char *key_string) +ecore_imf_context_input_panel_private_key_set (Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, int key_value, const char* key_string) { Private_Key_Item *key_item; Eina_List *l; @@ -1270,17 +1095,20 @@ ecore_imf_context_input_panel_private_key_set (Ecore_IMF_Context *ctx, int layou if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_private_key_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_private_key_set"); return; } - if ((!label) && (!img_path)) return; + if (label == NULL && img_path == NULL) + { + printf ("input parameters error!!! \n"); + return; + } EINA_LIST_FOREACH(ctx->private_key_list, l, key_item) { - if (key_item && (key_item->layout_idx == layout_index) && - (key_item->key_idx == key_index)) + if (key_item && key_item->layout_idx == layout_index && + key_item->key_idx == key_index) { // if exist in the list exist = EINA_TRUE; @@ -1319,7 +1147,9 @@ ecore_imf_context_input_panel_private_key_set (Ecore_IMF_Context *ctx, int layou key_item->key_value = key_value; if (key_string) - strcpy(key_item->key_string, key_string); + { + strcpy(key_item->key_string, key_string); + } ctx->private_key_list = eina_list_append(ctx->private_key_list, key_item); } @@ -1327,39 +1157,18 @@ ecore_imf_context_input_panel_private_key_set (Ecore_IMF_Context *ctx, int layou // if (ctx->klass->input_panel_private_key_set) ctx->klass->input_panel_private_key_set(ctx, layout_index, key_index, img_path, label, value); } -/** - * Get the list of private key. - * - * @param ctx An #Ecore_IMF_Context. - * @return Return the list of private key - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI Eina_List * ecore_imf_context_input_panel_private_key_list_get (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_private_key_list_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_private_key_list_get"); return NULL; } return ctx->private_key_list; } -/** - * Set the key to be disabled. - * Since the second parameter of this API requires a layout index, so before using this API application has to set a specific layout and that layout index - * should be passed in the 2nd argument of this API. - * - * @param ctx An #Ecore_IMF_Context. - * @param layout_index index of layout page to be set - * @param key_index index of key to be set - * @param disabled The state - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_key_disabled_set (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled) { @@ -1369,15 +1178,13 @@ ecore_imf_context_input_panel_key_disabled_set (Ecore_IMF_Context *ctx, int layo if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_key_disabled_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_key_disabled_set"); return; } EINA_LIST_FOREACH(ctx->disabled_key_list, l, key_item) { - if (key_item && (key_item->layout_idx == layout_index) && - (key_item->key_idx == key_index)) + if (key_item && key_item->layout_idx == layout_index && key_item->key_idx == key_index) { key_item->disabled = disabled; exist = EINA_TRUE; @@ -1399,59 +1206,31 @@ ecore_imf_context_input_panel_key_disabled_set (Ecore_IMF_Context *ctx, int layo // if (ctx->klass->input_panel_key_disabled_set) ctx->klass->input_panel_key_disabled_set(ctx, layout_index, key_index, disabled); } -/** - * Get the list of disabled keys. - * - * @param ctx An #Ecore_IMF_Context. - * @return Return the list of private key - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI Eina_List * -ecore_imf_context_input_panel_key_disabled_list_get (Ecore_IMF_Context *ctx) +ecore_imf_context_input_panel_key_disabled_list_get (Ecore_IMF_Context *ctx) { return ctx->disabled_key_list; } -/** - * Set the layout of input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @param layout see #ECORE_IMF_INPUT_PANEL_LAYOUT - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_layout_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_layout_set"); return; } - if (ctx->klass->input_panel_layout_set) - ctx->klass->input_panel_layout_set(ctx, layout); - + if (ctx->klass->input_panel_layout_set) ctx->klass->input_panel_layout_set(ctx, layout); ctx->input_panel_layout = layout; } -/** - * Get the layout of current active input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @return layout see #Ecore_IMF_Input_Panel_Layout - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_layout_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_layout_get"); return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID; } @@ -1464,157 +1243,103 @@ ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx) return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID; } -/** - * Restore all default properties of input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_reset (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_reset"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_reset"); return; } if (ctx->klass->input_panel_reset) ctx->klass->input_panel_reset(ctx); } -/** - * Set the screen orientation of input panel - * To show the keypad in landscape mode application should first call this API with 2nd parameter as 90 or 270. - * After then only application should call @ref ecore_imf_context_input_panel_show. - * - * @param ctx An #Ecore_IMF_Context. - * @param orientation the orientation of input panel - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_orient_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Orient orientation) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_orient_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_orient_set"); return; } - if (ctx->klass->input_panel_orient_set) - ctx->klass->input_panel_orient_set(ctx, orientation*90); - + if (ctx->klass->input_panel_orient_set) ctx->klass->input_panel_orient_set(ctx, orientation*90); ctx->input_panel_orient = orientation; } -/** - * Get the screen orientation of input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @return The screen orientation of input panel - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI Ecore_IMF_Input_Panel_Orient ecore_imf_context_input_panel_orient_get (Ecore_IMF_Context *ctx) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_orient_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_orient_get"); return ECORE_IMF_INPUT_PANEL_ORIENT_NONE; } return ctx->input_panel_orient; } -/** - * Get name of current active input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @param name input panel name to be got - * @ingroup Ecore_IMF_Context_IMControl_Group - */ EAPI void ecore_imf_context_ise_get_active_isename (Ecore_IMF_Context *ctx, char* name) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_ise_get_active_isename"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_ise_get_active_isename"); return; } - if (!name) return; + if (!name) + { + printf ("input parameters error!!! \n"); + return; + } - if (ctx->klass->ise_get_active_isename) - ctx->klass->ise_get_active_isename(ctx, name); + if (ctx->klass->ise_get_active_isename) ctx->klass->ise_get_active_isename(ctx, name); } -/** - * Choose the active input panel by its name. - * - * @param ctx An #Ecore_IMF_Context. - * @param name input panel name to be set - * @ingroup Ecore_IMF_Context_IMControl_Group - */ EAPI void ecore_imf_context_ise_set_active_ise_by_name (Ecore_IMF_Context *ctx, const char* name) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_ise_set_active_ise_by_name"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_ise_set_active_ise_by_name"); return; } - if (!name) return; + if (!name) + { + printf ("input parameters error!!! \n"); + return; + } - if (ctx->klass->ise_set_active_ise_by_name) - ctx->klass->ise_set_active_ise_by_name(ctx, name); + if (ctx->klass->ise_set_active_ise_by_name) ctx->klass->ise_set_active_ise_by_name(ctx, name); } -/** - * Set input panel by its uuid. - * - * @param ctx An #Ecore_IMF_Context. - * @param uuid input panel uuid to be set - * @ingroup Ecore_IMF_Context_IMControl_Group - */ EAPI void ecore_imf_context_ise_set_active_ise_by_uuid (Ecore_IMF_Context *ctx, const char* uuid) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_ise_set_active_ise_by_uuid"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_ise_set_active_ise_by_uuid"); return; } - if (!uuid) return; + if (!uuid) + { + printf ("input parameters error!!! \n"); + return; + } - if (ctx->klass->ise_set_active_ise_by_uuid) - ctx->klass->ise_set_active_ise_by_uuid(ctx, uuid); + if (ctx->klass->ise_set_active_ise_by_uuid) ctx->klass->ise_set_active_ise_by_uuid(ctx, uuid); } -/** - * Get list of input panels. - * - * @param ctx An #Ecore_IMF_Context. - * @param iselist pointer to the list to be got. - * @return int ise counter of iselist - * @ingroup Ecore_IMF_Context_IMControl_Group - */ EAPI int ecore_imf_context_ise_get_iselist (Ecore_IMF_Context *ctx, char*** iselist) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_ise_get_iselist"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_ise_get_iselist"); return -1; } @@ -1624,22 +1349,13 @@ ecore_imf_context_ise_get_iselist (Ecore_IMF_Context *ctx, char*** iselist) return -1; } -/** - * Get state of current active input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @param The state of input panel. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get (Ecore_IMF_Context *ctx) { Ecore_IMF_Input_Panel_State state = ECORE_IMF_INPUT_PANEL_STATE_INVALID; if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_state_get"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_state_get"); return ECORE_IMF_INPUT_PANEL_STATE_INVALID; } @@ -1649,80 +1365,47 @@ ecore_imf_context_input_panel_state_get (Ecore_IMF_Context *ctx) return state; } -/** - * Register a callback function which will be called if there is change in input panel state,language,mode etc. - * In order to deregister the callback function - * Use @ref ecore_imf_context_input_panel_event_callback_del. - * - * @param ctx An #Ecore_IMF_Context - * @param type event type - * @param func the callback function - * @param data application-input panel specific data. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_event_callback_add (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, - void (*func) (void *data, Ecore_IMF_Context *ctx, int value), + void (*pEventCallBackFunc) (void *data, Ecore_IMF_Context *ctx, int value), const void *data) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_event_callback_add"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_event_callback_add"); return; } if (ctx->klass->input_panel_event_callback_add) { - ctx->klass->input_panel_event_callback_add(ctx, type, func, data); + ctx->klass->input_panel_event_callback_add(ctx, type, pEventCallBackFunc, data); } } -/** - * Unregister a callback function which will be called if there is change in input panel state,language,mode etc. - * - * @param ctx An #Ecore_IMF_Context. - * @param func the callback function - * @param data application-input panel specific data. - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_event_callback_del (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, - void (*func) (void *data, Ecore_IMF_Context *ctx, int value)) + void (*pEventCallBackFunc) (void *data, Ecore_IMF_Context *ctx, int value)) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_event_callback_del"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_event_callback_del"); return; } if (ctx->klass->input_panel_event_callback_del) { - ctx->klass->input_panel_event_callback_del(ctx, type, func); + ctx->klass->input_panel_event_callback_del(ctx, type, pEventCallBackFunc); } } -/** - * Move the soft keyboard to the new position. - * - * @param ctx An #Ecore_IMF_Context. - * @param x X position to move the input panel to - * @param y Y position to move the input panel to - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_move (Ecore_IMF_Context *ctx, int x, int y) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_move"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_move"); return; } @@ -1731,22 +1414,13 @@ ecore_imf_context_input_panel_move (Ecore_IMF_Context *ctx, int x, int y) ctx->input_panel_y = y; } -/** - * Set the caps mode of the input panel. - * - * @param ctx An #Ecore_IMF_Context. - * @param mode the caps mode - * @ingroup Ecore_IMF_Context_IMControl_Group - * @since 1.1.0 - */ EAPI void ecore_imf_context_input_panel_caps_mode_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode) { if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) { - ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, - "ecore_imf_context_input_panel_caps_mode_set"); + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_caps_mode_set"); return; } diff --git a/src/lib/ecore_imf/ecore_imf_private.h b/src/lib/ecore_imf/ecore_imf_private.h index 1297275..8a40f5a 100644 --- a/src/lib/ecore_imf/ecore_imf_private.h +++ b/src/lib/ecore_imf/ecore_imf_private.h @@ -43,8 +43,8 @@ struct _Ecore_IMF_Context const Ecore_IMF_Context_Class *klass; void *data; int input_mode; - void *window; - void *client_canvas; + void* window; + void* client_canvas; Ecore_IMF_Input_Panel_Layout input_panel_layout; Ecore_IMF_Input_Panel_Lang input_panel_lang; int use_effect; diff --git a/src/lib/ecore_win32/ecore_win32.c b/src/lib/ecore_win32/ecore_win32.c index ef7187a..a44a52b 100644 --- a/src/lib/ecore_win32/ecore_win32.c +++ b/src/lib/ecore_win32/ecore_win32.c @@ -38,24 +38,6 @@ DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0); static int _ecore_win32_init_count = 0; -static void -_ecore_win32_size_check(Ecore_Win32_Window *win, int w, int h, int *dx, int *dy) -{ - int minimal_width; - int minimal_height; - - minimal_width = GetSystemMetrics(SM_CXMIN); - minimal_height = GetSystemMetrics(SM_CYMIN); - if ((w) < MAX(minimal_width, (int)win->min_width)) - *dx = 0; - if ((w) > (int)win->max_width) - *dx = 0; - if ((h) < MAX(minimal_height, (int)win->min_height)) - *dy = 0; - if ((h) > (int)win->max_height) - *dy = 0; -} - LRESULT CALLBACK _ecore_win32_window_procedure(HWND window, UINT message, @@ -63,7 +45,7 @@ _ecore_win32_window_procedure(HWND window, LPARAM data_param) { Ecore_Win32_Callback_Data *data; - POINTS point; + POINTS pt; DWORD coord; data = (Ecore_Win32_Callback_Data *)malloc(sizeof(Ecore_Win32_Callback_Data)); @@ -75,9 +57,9 @@ _ecore_win32_window_procedure(HWND window, data->data_param = data_param; data->time = GetMessageTime(); coord = GetMessagePos(); - point = MAKEPOINTS(coord); - data->x = point.x; - data->y = point.y; + pt = MAKEPOINTS(coord); + data->x = pt.x; + data->y = pt.y; switch (data->message) { @@ -86,10 +68,10 @@ _ecore_win32_window_procedure(HWND window, INF("keydown message"); _ecore_win32_event_handle_key_press(data, 1); return 0; - /* case WM_CHAR: */ - /* INF("char message"); */ - /* _ecore_win32_event_handle_key_press(data, 0); */ - /* return 0; */ + case WM_CHAR: + INF("char message"); + _ecore_win32_event_handle_key_press(data, 0); + return 0; case WM_KEYUP: INF("keyup message"); _ecore_win32_event_handle_key_release(data, 1); @@ -116,22 +98,9 @@ _ecore_win32_window_procedure(HWND window, _ecore_win32_event_handle_button_press(data, 3); return 0; case WM_LBUTTONUP: - { - Ecore_Win32_Window *w = NULL; - - INF("left button up message"); - - w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); - if (w->drag.dragging) - { - ReleaseCapture(); - w->drag.dragging = 0; - return 0; - } - - _ecore_win32_event_handle_button_release(data, 1); - return 0; - } + INF("left button up message"); + _ecore_win32_event_handle_button_release(data, 1); + return 0; case WM_MBUTTONUP: INF("middle button up message"); _ecore_win32_event_handle_button_release(data, 2); @@ -142,165 +111,12 @@ _ecore_win32_window_procedure(HWND window, return 0; case WM_MOUSEMOVE: { - RECT rect; - Ecore_Win32_Window *w = NULL; + RECT rect; + struct _Ecore_Win32_Window *w = NULL; INF("moue move message"); - w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); - - if (w->drag.dragging) - { - POINT pt; - - pt.x = GET_X_LPARAM(data_param); - pt.y = GET_Y_LPARAM(data_param); - if (ClientToScreen(window, &pt)) - { - if (w->drag.type == HTCAPTION) - { - int dx; - int dy; - - dx = pt.x - w->drag.px; - dy = pt.y - w->drag.py; - ecore_win32_window_move(w, w->drag.x + dx, w->drag.y + dy); - w->drag.x += dx; - w->drag.y += dy; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTLEFT) - { - int dw; - - dw = pt.x - w->drag.px; - ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h); - w->drag.x += dw; - w->drag.w -= dw; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTRIGHT) - { - int dw; - - dw = pt.x - w->drag.px; - ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h); - w->drag.w += dw; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTTOP) - { - int dh; - - dh = pt.y - w->drag.py; - ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w, w->drag.h - dh); - w->drag.y += dh; - w->drag.h -= dh; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTBOTTOM) - { - int dh; - - dh = pt.y - w->drag.py; - ecore_win32_window_resize(w, w->drag.w, w->drag.h + dh); - w->drag.h += dh; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTTOPLEFT) - { - int dx; - int dy; - int dh; - int dw; - - dw = pt.x - w->drag.px; - dh = pt.y - w->drag.py; - dx = dw; - dy = dh; - _ecore_win32_size_check(w, - w->drag.w - dw, w->drag.h - dh, - &dx, &dy); - - ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y + dy, w->drag.w - dw, w->drag.h - dh); - w->drag.x += dx; - w->drag.y += dy; - w->drag.w -= dw; - w->drag.h -= dh; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTTOPRIGHT) - { - int dx; - int dy; - int dh; - int dw; - - dw = pt.x - w->drag.px; - dh = pt.y - w->drag.py; - dx = dw; - dy = dh; - _ecore_win32_size_check(w, - w->drag.w, w->drag.h - dh, - &dx, &dy); - ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dy, w->drag.w, w->drag.h - dh); - w->drag.y += dy; - w->drag.w += dw; - w->drag.h -= dh; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTBOTTOMLEFT) - { - int dx; - int dy; - int dh; - int dw; - - dw = pt.x - w->drag.px; - dh = pt.y - w->drag.py; - dx = dw; - dy = dh; - _ecore_win32_size_check(w, - w->drag.w - dw, w->drag.h + dh, - &dx, &dy); - ecore_win32_window_move_resize(w, w->drag.x + dx, w->drag.y, w->drag.w - dw, w->drag.h + dh); - w->drag.x += dx; - w->drag.w -= dw; - w->drag.h += dh; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - if (w->drag.type == HTBOTTOMRIGHT) - { - int dh; - int dw; - - dw = pt.x - w->drag.px; - dh = pt.y - w->drag.py; - ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h + dh); - w->drag.w += dw; - w->drag.h += dh; - w->drag.px = pt.x; - w->drag.py = pt.y; - return 0; - } - } - } + w = (struct _Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); if (GetClientRect(window, &rect)) { @@ -403,7 +219,6 @@ _ecore_win32_window_procedure(HWND window, return 0; case WM_NCLBUTTONDOWN: INF("non client left button down window message"); - if (((DWORD)window_param == HTCAPTION) || ((DWORD)window_param == HTBOTTOM) || ((DWORD)window_param == HTBOTTOMLEFT) || @@ -418,10 +233,8 @@ _ecore_win32_window_procedure(HWND window, w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); ecore_win32_window_geometry_get(w, - NULL, NULL, + &w->drag.x, &w->drag.y, &w->drag.w, &w->drag.h); - SetCapture(window); - w->drag.type = (DWORD)window_param; w->drag.px = GET_X_LPARAM(data_param); w->drag.py = GET_Y_LPARAM(data_param); w->drag.dragging = 1; @@ -429,8 +242,7 @@ _ecore_win32_window_procedure(HWND window, } return DefWindowProc(window, message, window_param, data_param); case WM_SYSCOMMAND: - INF("sys command window message %d", (int)window_param); - + INF("sys command window message", (int)window_param); if ((((DWORD)window_param & 0xfff0) == SC_MOVE) || (((DWORD)window_param & 0xfff0) == SC_SIZE)) { @@ -443,9 +255,118 @@ _ecore_win32_window_procedure(HWND window, return 0; } return DefWindowProc(window, message, window_param, data_param); + case WM_NCMOUSEMOVE: + INF("non client mouse move window message"); + if ((DWORD)window_param == HTCAPTION) + { + Ecore_Win32_Window *w; + + w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); + if (w->drag.dragging) + { + int dx; + int dy; + + dx = GET_X_LPARAM(data_param) - w->drag.px; + dy = GET_Y_LPARAM(data_param) - w->drag.py; + ecore_win32_window_move(w, w->drag.x + dx, w->drag.y + dy); + w->drag.x += dx; + w->drag.y += dy; + w->drag.px = GET_X_LPARAM(data_param); + w->drag.py = GET_Y_LPARAM(data_param); + return 0; + } + } + if ((DWORD)window_param == HTLEFT) + { + Ecore_Win32_Window *w; + + w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); + if (w->drag.dragging) + { + int dw; + dw = GET_X_LPARAM(data_param) - w->drag.px; + ecore_win32_window_move_resize(w, w->drag.x + dw, w->drag.y, w->drag.w - dw, w->drag.h); + w->drag.x += dw; + w->drag.w -= dw; + w->drag.px = GET_X_LPARAM(data_param); + w->drag.py = GET_Y_LPARAM(data_param); + return 0; + } + } + if ((DWORD)window_param == HTRIGHT) + { + Ecore_Win32_Window *w; + + w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); + if (w->drag.dragging) + { + int dw; + dw = GET_X_LPARAM(data_param) - w->drag.px; + ecore_win32_window_resize(w, w->drag.w + dw, w->drag.h); + w->drag.w += dw; + w->drag.px = GET_X_LPARAM(data_param); + w->drag.py = GET_Y_LPARAM(data_param); + return 0; + } + } + if ((DWORD)window_param == HTTOP) + { + Ecore_Win32_Window *w; + + w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); + if (w->drag.dragging) + { + int dh; + dh = GET_Y_LPARAM(data_param) - w->drag.py; + ecore_win32_window_move_resize(w, w->drag.x, w->drag.y + dh, w->drag.w, w->drag.h - dh); + w->drag.y += dh; + w->drag.h -= dh; + w->drag.px = GET_X_LPARAM(data_param); + w->drag.py = GET_Y_LPARAM(data_param); + return 0; + } + } + if ((DWORD)window_param == HTBOTTOM) + { + Ecore_Win32_Window *w; + + w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); + if (w->drag.dragging) + { + int dh; + dh = GET_Y_LPARAM(data_param) - w->drag.py; + ecore_win32_window_resize(w, w->drag.w, w->drag.h + dh); + w->drag.h += dh; + w->drag.px = GET_X_LPARAM(data_param); + w->drag.py = GET_Y_LPARAM(data_param); + return 0; + } + } + return DefWindowProc(window, message, window_param, data_param); + case WM_NCLBUTTONUP: + INF("non client left button up window message"); + if (((DWORD)window_param == HTCAPTION) || + ((DWORD)window_param == HTBOTTOM) || + ((DWORD)window_param == HTBOTTOMLEFT) || + ((DWORD)window_param == HTBOTTOMRIGHT) || + ((DWORD)window_param == HTLEFT) || + ((DWORD)window_param == HTRIGHT) || + ((DWORD)window_param == HTTOP) || + ((DWORD)window_param == HTTOPLEFT) || + ((DWORD)window_param == HTTOPRIGHT)) + { + Ecore_Win32_Window *w; + + w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWL_USERDATA); + if (w->drag.dragging) + { + w->drag.dragging = 0; + return 0; + } + } + return DefWindowProc(window, message, window_param, data_param); /* GDI notifications */ - case WM_ERASEBKGND: - return 1; case WM_PAINT: { RECT rect; diff --git a/src/lib/ecore_win32/ecore_win32_dnd.c b/src/lib/ecore_win32/ecore_win32_dnd.c index a629c8b..7ac1083 100755 --- a/src/lib/ecore_win32/ecore_win32_dnd.c +++ b/src/lib/ecore_win32/ecore_win32_dnd.c @@ -185,7 +185,7 @@ EAPI Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window, Ecore_Win32_Dnd_DropTarget_Callback callback) { - Ecore_Win32_Window *wnd = (Ecore_Win32_Window *)window; + struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window; if (!window) return EINA_FALSE; @@ -207,7 +207,7 @@ ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window, EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window) { - Ecore_Win32_Window *wnd = (Ecore_Win32_Window *)window; + struct _Ecore_Win32_Window *wnd = (struct _Ecore_Win32_Window *)window; if (!window) return; diff --git a/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp b/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp index 75e26f5..6de1035 100644 --- a/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp +++ b/src/lib/ecore_win32/ecore_win32_dnd_data_object.cpp @@ -119,7 +119,7 @@ HRESULT DataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium) return S_OK; } -HRESULT DataObject::GetDataHere(FORMATETC *pFormatEtc __UNUSED__, STGMEDIUM *pmedium __UNUSED__) +HRESULT DataObject::GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pmedium) { return DATA_E_FORMATETC; } @@ -129,14 +129,14 @@ HRESULT DataObject::QueryGetData(FORMATETC *pFormatEtc) return (lookup_format_etc(pFormatEtc) == -1) ? DV_E_FORMATETC : S_OK; } -HRESULT DataObject::GetCanonicalFormatEtc(FORMATETC *pFormatEct __UNUSED__, FORMATETC *pFormatEtcOut) +HRESULT DataObject::GetCanonicalFormatEtc(FORMATETC *pFormatEct, FORMATETC *pFormatEtcOut) { // Apparently we have to set this field to NULL even though we don't do anything else pFormatEtcOut->ptd = NULL; return E_NOTIMPL; } -HRESULT DataObject::SetData(FORMATETC *pFormatEtc __UNUSED__, STGMEDIUM *pMedium __UNUSED__, BOOL fRelease __UNUSED__) +HRESULT DataObject::SetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium, BOOL fRelease) { return E_NOTIMPL; } @@ -157,17 +157,17 @@ HRESULT DataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumForm } } -HRESULT DataObject::DAdvise(FORMATETC *pFormatEtc __UNUSED__, DWORD advf __UNUSED__, IAdviseSink *, DWORD *) +HRESULT DataObject::DAdvise(FORMATETC *pFormatEtc, DWORD advf, IAdviseSink *, DWORD *) { return OLE_E_ADVISENOTSUPPORTED; } -HRESULT DataObject::DUnadvise(DWORD dwConnection __UNUSED__) +HRESULT DataObject::DUnadvise(DWORD dwConnection) { return OLE_E_ADVISENOTSUPPORTED; } -HRESULT DataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise __UNUSED__) +HRESULT DataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise) { return OLE_E_ADVISENOTSUPPORTED; } diff --git a/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp b/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp index bea7736..065ac6a 100644 --- a/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp +++ b/src/lib/ecore_win32/ecore_win32_dnd_drop_source.cpp @@ -67,7 +67,7 @@ HRESULT DropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) return S_OK; } -HRESULT DropSource::GiveFeedback(DWORD dwEffect __UNUSED__) +HRESULT DropSource::GiveFeedback(DWORD dwEffect) { return DRAGDROP_S_USEDEFAULTCURSORS; } diff --git a/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp b/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp index e19fb5d..5051316 100644 --- a/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp +++ b/src/lib/ecore_win32/ecore_win32_dnd_drop_target.cpp @@ -152,7 +152,7 @@ HRESULT DropTarget::Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, // internal helper function -DWORD DropTarget::DropEffect(DWORD grfKeyState, POINTL pt __UNUSED__, DWORD dwAllowed) +DWORD DropTarget::DropEffect(DWORD grfKeyState, POINTL pt, DWORD dwAllowed) { DWORD dwEffect = 0; diff --git a/src/lib/ecore_win32/ecore_win32_event.c b/src/lib/ecore_win32/ecore_win32_event.c index 4d69654..ed467d3 100644 --- a/src/lib/ecore_win32/ecore_win32_event.c +++ b/src/lib/ecore_win32/ecore_win32_event.c @@ -802,7 +802,6 @@ _ecore_win32_event_keystroke_get(int key, kn = "space"; ks = "space"; kc = "space"; - break; case VK_F1: kn = "F1"; ks = "F1"; diff --git a/src/lib/ecore_win32/ecore_win32_private.h b/src/lib/ecore_win32/ecore_win32_private.h index 1b609e5..41b07ca 100644 --- a/src/lib/ecore_win32/ecore_win32_private.h +++ b/src/lib/ecore_win32/ecore_win32_private.h @@ -6,15 +6,6 @@ extern "C" { #endif -#ifdef MIN -# undef MIN -#endif -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) - -#ifdef MAX -# undef MAX -#endif -#define MAX(a,b) (((a) < (b)) ? (b) : (a)) /* logging messages macros */ extern int _ecore_win32_log_dom_global; @@ -38,11 +29,6 @@ extern int _ecore_win32_log_dom_global; #endif #define INF(...) EINA_LOG_DOM_INFO(_ecore_win32_log_dom_global , __VA_ARGS__) -#ifdef WRN -# undef WRN -#endif -#define WRN(...) EINA_LOG_DOM_WARN(_ecore_win32_log_dom_global, __VA_ARGS__) - #define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class" typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data; @@ -114,14 +100,13 @@ struct _Ecore_Win32_Window } shape; struct { - DWORD type; - int x; - int y; - int w; - int h; - int px; - int py; - unsigned int dragging : 1; + unsigned int x; + unsigned int y; + unsigned int w; + unsigned int h; + unsigned int px; + unsigned int py; + unsigned int dragging : 1; } drag; void *dnd_drop_target; diff --git a/src/lib/ecore_win32/ecore_win32_window.c b/src/lib/ecore_win32/ecore_win32_window.c index 20edf81..6a655fa 100644 --- a/src/lib/ecore_win32/ecore_win32_window.c +++ b/src/lib/ecore_win32/ecore_win32_window.c @@ -40,12 +40,12 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, int height, DWORD style) { - RECT rect; - Ecore_Win32_Window *w; - int minimal_width; - int minimal_height; + RECT rect; + struct _Ecore_Win32_Window *w; + int minimal_width; + int minimal_height; - w = (Ecore_Win32_Window *)calloc(1, sizeof(Ecore_Win32_Window)); + w = (struct _Ecore_Win32_Window *)calloc(1, sizeof(struct _Ecore_Win32_Window)); if (!w) { ERR("malloc() failed"); @@ -56,7 +56,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, rect.top = 0; rect.right = width; rect.bottom = height; - if (!AdjustWindowRectEx(&rect, style, FALSE, 0)) + if (!AdjustWindowRect(&rect, style, FALSE)) { ERR("AdjustWindowRect() failed"); free(w); @@ -84,7 +84,7 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, x, y, rect.right - rect.left, rect.bottom - rect.top, - parent ? ((Ecore_Win32_Window *)parent)->window : NULL, + parent ? ((struct _Ecore_Win32_Window *)parent)->window : NULL, NULL, _ecore_win32_instance, NULL); if (!w->window) { @@ -230,7 +230,7 @@ ecore_win32_window_override_new(Ecore_Win32_Window *parent, EAPI void ecore_win32_window_free(Ecore_Win32_Window *window) { - Ecore_Win32_Window *wnd = window; + struct _Ecore_Win32_Window *wnd = window; if (!window) return; @@ -239,7 +239,7 @@ ecore_win32_window_free(Ecore_Win32_Window *window) if (wnd->shape.mask) free(wnd->shape.mask); - DestroyWindow(((Ecore_Win32_Window *)window)->window); + DestroyWindow(((struct _Ecore_Win32_Window *)window)->window); free(window); } @@ -256,7 +256,7 @@ ecore_win32_window_hwnd_get(Ecore_Win32_Window *window) { if (!window) return NULL; - return ((Ecore_Win32_Window *)window)->window; + return ((struct _Ecore_Win32_Window *)window)->window; } /* @@ -287,7 +287,7 @@ ecore_win32_window_configure(Ecore_Win32_Window *window, default: return; } - SetWindowPos((Ecore_Win32_Window *)window->window, w, x, y, width, height, ???); + SetWindowPos((struct _Ecore_Win32_Window *)window->window, w, x, y, width, height, ???); } */ @@ -315,7 +315,7 @@ ecore_win32_window_move(Ecore_Win32_Window *window, INF("moving window (%dx%d)", x, y); - w = ((Ecore_Win32_Window *)window)->window; + w = ((struct _Ecore_Win32_Window *)window)->window; if (!GetWindowRect(w, &rect)) { ERR("GetWindowRect() failed"); @@ -347,24 +347,18 @@ ecore_win32_window_resize(Ecore_Win32_Window *window, int width, int height) { - RECT rect; - Ecore_Win32_Window *w; - DWORD style; - int x; - int y; - int minimal_width; - int minimal_height; + RECT rect; + struct _Ecore_Win32_Window *w; + DWORD style; + int x; + int y; /* FIXME: on fullscreen, should not resize it */ if (!window) return; INF("resizing window (%dx%d)", width, height); - w = (Ecore_Win32_Window *)window; - - minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)w->min_width); - minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)w->min_height); - + w = (struct _Ecore_Win32_Window *)window; if (!GetWindowRect(w->window, &rect)) { ERR("GetWindowRect() failed"); @@ -375,10 +369,13 @@ ecore_win32_window_resize(Ecore_Win32_Window *window, y = rect.top; rect.left = 0; rect.top = 0; - if (width < minimal_width) width = minimal_width; - if (width > (int)w->max_width) width = w->max_width; - if (height < minimal_height) height = minimal_height; - if (height > (int)w->max_height) height = w->max_height; +/* if (width < w->min_width) width = w->min_width; */ +/* if (width > w->max_width) width = w->max_width; */ +/* printf ("ecore_win32_window_resize 1 : %d %d %d\n", w->min_height, w->max_height, height); */ +/* if (height < w->min_height) height = w->min_height; */ +/* printf ("ecore_win32_window_resize 2 : %d %d\n", w->max_height, height); */ +/* if (height > w->max_height) height = w->max_height; */ +/* printf ("ecore_win32_window_resize 3 : %d %d\n", w->max_height, height); */ rect.right = width; rect.bottom = height; if (!(style = GetWindowLong(w->window, GWL_STYLE))) @@ -421,28 +418,22 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window, int width, int height) { - RECT rect; - Ecore_Win32_Window *w; - DWORD style; - int minimal_width; - int minimal_height; + RECT rect; + struct _Ecore_Win32_Window *w; + DWORD style; /* FIXME: on fullscreen, should not move/resize it */ if (!window) return; INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height); - w = ((Ecore_Win32_Window *)window); - - minimal_width = MAX(GetSystemMetrics(SM_CXMIN), (int)w->min_width); - minimal_height = MAX(GetSystemMetrics(SM_CYMIN), (int)w->min_height); - + w = ((struct _Ecore_Win32_Window *)window); rect.left = 0; rect.top = 0; - if (width < minimal_width) width = minimal_width; - if (width > (int)w->max_width) width = w->max_width; - if (height < minimal_height) height = minimal_height; - if (height > (int)w->max_height) height = w->max_height; + if ((unsigned int)width < w->min_width) width = w->min_width; + if ((unsigned int)width > w->max_width) width = w->max_width; + if ((unsigned int)height < w->min_height) height = w->min_height; + if ((unsigned int)height > w->max_height) height = w->max_height; rect.right = width; rect.bottom = height; if (!(style = GetWindowLong(w->window, GWL_STYLE))) @@ -504,7 +495,7 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window, return; } - if (!GetClientRect(((Ecore_Win32_Window *)window)->window, + if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, &rect)) { ERR("GetClientRect() failed"); @@ -520,7 +511,7 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window, w = rect.right - rect.left; h = rect.bottom - rect.top; - if (!GetWindowRect(((Ecore_Win32_Window *)window)->window, + if (!GetWindowRect(((struct _Ecore_Win32_Window *)window)->window, &rect)) { ERR("GetWindowRect() failed"); @@ -570,7 +561,7 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window, return; } - if (!GetClientRect(((Ecore_Win32_Window *)window)->window, + if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window, &rect)) { ERR("GetClientRect() failed"); @@ -599,12 +590,12 @@ ecore_win32_window_size_min_set(Ecore_Win32_Window *window, unsigned int min_width, unsigned int min_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; if (!window) return; printf ("ecore_win32_window_size_min_set : %p %d %d\n", window, min_width, min_height); - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; w->min_width = min_width; w->min_height = min_height; } @@ -625,11 +616,11 @@ ecore_win32_window_size_min_get(Ecore_Win32_Window *window, unsigned int *min_width, unsigned int *min_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; if (!window) return; - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; printf ("ecore_win32_window_size_min_get : %p %d %d\n", window, w->min_width, w->min_height); if (min_width) *min_width = w->min_width; if (min_height) *min_height = w->min_height; @@ -651,12 +642,12 @@ ecore_win32_window_size_max_set(Ecore_Win32_Window *window, unsigned int max_width, unsigned int max_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; if (!window) return; printf ("ecore_win32_window_size_max_set : %p %d %d\n", window, max_width, max_height); - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; w->max_width = max_width; w->max_height = max_height; } @@ -677,11 +668,11 @@ ecore_win32_window_size_max_get(Ecore_Win32_Window *window, unsigned int *max_width, unsigned int *max_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; if (!window) return; - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; printf ("ecore_win32_window_size_max_get : %p %d %d\n", window, w->max_width, w->max_height); if (max_width) *max_width = w->max_width; if (max_height) *max_height = w->max_height; @@ -703,12 +694,12 @@ ecore_win32_window_size_base_set(Ecore_Win32_Window *window, unsigned int base_width, unsigned int base_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; printf ("ecore_win32_window_size_base_set : %p %d %d\n", window, base_width, base_height); if (!window) return; - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; w->base_width = base_width; w->base_height = base_height; } @@ -729,11 +720,11 @@ ecore_win32_window_size_base_get(Ecore_Win32_Window *window, unsigned int *base_width, unsigned int *base_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; if (!window) return; - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; printf ("ecore_win32_window_size_base_get : %p %d %d\n", window, w->base_width, w->base_height); if (base_width) *base_width = w->base_width; if (base_height) *base_height = w->base_height; @@ -755,12 +746,12 @@ ecore_win32_window_size_step_set(Ecore_Win32_Window *window, unsigned int step_width, unsigned int step_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; printf ("ecore_win32_window_size_step_set : %p %d %d\n", window, step_width, step_height); if (!window) return; - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; w->step_width = step_width; w->step_height = step_height; } @@ -781,11 +772,11 @@ ecore_win32_window_size_step_get(Ecore_Win32_Window *window, unsigned int *step_width, unsigned int *step_height) { - Ecore_Win32_Window *w; + struct _Ecore_Win32_Window *w; if (!window) return; - w = (Ecore_Win32_Window *)window; + w = (struct _Ecore_Win32_Window *)window; printf ("ecore_win32_window_size_step_get : %p %d %d\n", window, w->step_width, w->step_height); if (step_width) *step_width = w->step_width; if (step_height) *step_height = w->step_height; @@ -797,7 +788,7 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window, unsigned short height, unsigned char *mask) { - Ecore_Win32_Window *wnd; + struct _Ecore_Win32_Window *wnd; HRGN rgn; int x; int y; @@ -806,7 +797,7 @@ ecore_win32_window_shape_set(Ecore_Win32_Window *window, if (!window) return; - wnd = (Ecore_Win32_Window *)window; + wnd = (struct _Ecore_Win32_Window *)window; if (!mask) { @@ -943,8 +934,8 @@ ecore_win32_window_show(Ecore_Win32_Window *window) INF("showing window"); - ShowWindow(((Ecore_Win32_Window *)window)->window, SW_SHOWNORMAL); - if (!UpdateWindow(((Ecore_Win32_Window *)window)->window)) + ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_SHOWNORMAL); + if (!UpdateWindow(((struct _Ecore_Win32_Window *)window)->window)) { ERR("UpdateWindow() failed"); } @@ -966,7 +957,7 @@ ecore_win32_window_hide(Ecore_Win32_Window *window) INF("hiding window"); - ShowWindow(((Ecore_Win32_Window *)window)->window, SW_HIDE); + ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_HIDE); } /** @@ -984,7 +975,7 @@ ecore_win32_window_raise(Ecore_Win32_Window *window) INF("raising window"); - if (!SetWindowPos(((Ecore_Win32_Window *)window)->window, + if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)) { @@ -1007,7 +998,7 @@ ecore_win32_window_lower(Ecore_Win32_Window *window) INF("lowering window"); - if (!SetWindowPos(((Ecore_Win32_Window *)window)->window, + if (!SetWindowPos(((struct _Ecore_Win32_Window *)window)->window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)) { @@ -1035,7 +1026,7 @@ ecore_win32_window_title_set(Ecore_Win32_Window *window, INF("setting window title"); - if (!SetWindowText(((Ecore_Win32_Window *)window)->window, title)) + if (!SetWindowText(((struct _Ecore_Win32_Window *)window)->window, title)) { ERR("SetWindowText() failed"); } @@ -1056,7 +1047,7 @@ ecore_win32_window_focus_set(Ecore_Win32_Window *window) INF("focusing window"); - if (!SetFocus(((Ecore_Win32_Window *)window)->window)) + if (!SetFocus(((struct _Ecore_Win32_Window *)window)->window)) { ERR("SetFocus() failed"); } @@ -1078,11 +1069,11 @@ EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window, Eina_Bool on) { - Ecore_Win32_Window *ew; + struct _Ecore_Win32_Window *ew; if (!window) return; - ew = (Ecore_Win32_Window *)window; + ew = (struct _Ecore_Win32_Window *)window; if (((ew->iconified) && (on)) || ((!ew->iconified) && (!on))) return; @@ -1109,14 +1100,14 @@ EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window, Eina_Bool on) { - RECT rect; - DWORD style; - Ecore_Win32_Window *ew; - HWND w; + RECT rect; + DWORD style; + struct _Ecore_Win32_Window *ew; + HWND w; if (!window) return; - ew = (Ecore_Win32_Window *)window; + ew = (struct _Ecore_Win32_Window *)window; if (((ew->borderless) && (on)) || ((!ew->borderless) && (!on))) return; @@ -1187,12 +1178,12 @@ EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window, Eina_Bool on) { - Ecore_Win32_Window *ew; + struct _Ecore_Win32_Window *ew; HWND w; if (!window) return; - ew = (Ecore_Win32_Window *)window; + ew = (struct _Ecore_Win32_Window *)window; if (((ew->fullscreen) && (on)) || ((!ew->fullscreen) && (!on))) return; @@ -1285,7 +1276,7 @@ ecore_win32_window_cursor_set(Ecore_Win32_Window *window, if (!window || !cursor) return; - if (!SetClassLongPtr(((Ecore_Win32_Window *)window)->window, + if (!SetClassLongPtr(((struct _Ecore_Win32_Window *)window)->window, GCL_HCURSOR, (LONG_PTR)cursor)) { ERR("SetClassLong() failed"); @@ -1320,41 +1311,41 @@ ecore_win32_window_state_set(Ecore_Win32_Window *window, switch (state[i]) { case ECORE_WIN32_WINDOW_STATE_ICONIFIED: - ((Ecore_Win32_Window *)window)->state.iconified = 1; + ((struct _Ecore_Win32_Window *)window)->state.iconified = 1; break; case ECORE_WIN32_WINDOW_STATE_MODAL: - ((Ecore_Win32_Window *)window)->state.modal = 1; + ((struct _Ecore_Win32_Window *)window)->state.modal = 1; break; case ECORE_WIN32_WINDOW_STATE_STICKY: - ((Ecore_Win32_Window *)window)->state.sticky = 1; + ((struct _Ecore_Win32_Window *)window)->state.sticky = 1; break; case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT: - ((Ecore_Win32_Window *)window)->state.maximized_vert = 1; + ((struct _Ecore_Win32_Window *)window)->state.maximized_vert = 1; break; case ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ: - ((Ecore_Win32_Window *)window)->state.maximized_horz = 1; + ((struct _Ecore_Win32_Window *)window)->state.maximized_horz = 1; break; case ECORE_WIN32_WINDOW_STATE_MAXIMIZED: - ((Ecore_Win32_Window *)window)->state.maximized_horz = 1; - ((Ecore_Win32_Window *)window)->state.maximized_vert = 1; + ((struct _Ecore_Win32_Window *)window)->state.maximized_horz = 1; + ((struct _Ecore_Win32_Window *)window)->state.maximized_vert = 1; break; case ECORE_WIN32_WINDOW_STATE_SHADED: - ((Ecore_Win32_Window *)window)->state.shaded = 1; + ((struct _Ecore_Win32_Window *)window)->state.shaded = 1; break; case ECORE_WIN32_WINDOW_STATE_HIDDEN: - ((Ecore_Win32_Window *)window)->state.hidden = 1; + ((struct _Ecore_Win32_Window *)window)->state.hidden = 1; break; case ECORE_WIN32_WINDOW_STATE_FULLSCREEN: - ((Ecore_Win32_Window *)window)->state.fullscreen = 1; + ((struct _Ecore_Win32_Window *)window)->state.fullscreen = 1; break; case ECORE_WIN32_WINDOW_STATE_ABOVE: - ((Ecore_Win32_Window *)window)->state.above = 1; + ((struct _Ecore_Win32_Window *)window)->state.above = 1; break; case ECORE_WIN32_WINDOW_STATE_BELOW: - ((Ecore_Win32_Window *)window)->state.below = 1; + ((struct _Ecore_Win32_Window *)window)->state.below = 1; break; case ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION: - ((Ecore_Win32_Window *)window)->state.demands_attention = 1; + ((struct _Ecore_Win32_Window *)window)->state.demands_attention = 1; break; case ECORE_WIN32_WINDOW_STATE_UNKNOWN: /* nothing to be done */ @@ -1381,12 +1372,12 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window, Ecore_Win32_Window_State state, unsigned int set) { - Ecore_Win32_Window *ew; - HWND w; + struct _Ecore_Win32_Window *ew; + HWND w; if (!window) return; - ew = (Ecore_Win32_Window *)window; + ew = (struct _Ecore_Win32_Window *)window; w = ew->window; INF("sending cursor state"); @@ -1535,31 +1526,31 @@ ecore_win32_window_type_set(Ecore_Win32_Window *window, switch (type) { case ECORE_WIN32_WINDOW_TYPE_DESKTOP: - ((Ecore_Win32_Window *)window)->type.desktop = 1; + ((struct _Ecore_Win32_Window *)window)->type.desktop = 1; break; case ECORE_WIN32_WINDOW_TYPE_DOCK: - ((Ecore_Win32_Window *)window)->type.dock = 1; + ((struct _Ecore_Win32_Window *)window)->type.dock = 1; break; case ECORE_WIN32_WINDOW_TYPE_TOOLBAR: - ((Ecore_Win32_Window *)window)->type.toolbar = 1; + ((struct _Ecore_Win32_Window *)window)->type.toolbar = 1; break; case ECORE_WIN32_WINDOW_TYPE_MENU: - ((Ecore_Win32_Window *)window)->type.menu = 1; + ((struct _Ecore_Win32_Window *)window)->type.menu = 1; break; case ECORE_WIN32_WINDOW_TYPE_UTILITY: - ((Ecore_Win32_Window *)window)->type.utility = 1; + ((struct _Ecore_Win32_Window *)window)->type.utility = 1; break; case ECORE_WIN32_WINDOW_TYPE_SPLASH: - ((Ecore_Win32_Window *)window)->type.splash = 1; + ((struct _Ecore_Win32_Window *)window)->type.splash = 1; break; case ECORE_WIN32_WINDOW_TYPE_DIALOG: - ((Ecore_Win32_Window *)window)->type.dialog = 1; + ((struct _Ecore_Win32_Window *)window)->type.dialog = 1; break; case ECORE_WIN32_WINDOW_TYPE_NORMAL: - ((Ecore_Win32_Window *)window)->type.normal = 1; + ((struct _Ecore_Win32_Window *)window)->type.normal = 1; break; case ECORE_WIN32_WINDOW_TYPE_UNKNOWN: - ((Ecore_Win32_Window *)window)->type.normal = 1; + ((struct _Ecore_Win32_Window *)window)->type.normal = 1; break; } } diff --git a/src/lib/ecore_wince/Ecore_WinCE.h b/src/lib/ecore_wince/Ecore_WinCE.h index 027c4b4..6884e17 100644 --- a/src/lib/ecore_wince/Ecore_WinCE.h +++ b/src/lib/ecore_wince/Ecore_WinCE.h @@ -50,11 +50,9 @@ extern "C" { */ -/** - * @typedef Ecore_WinCE_Window - * Abstract type for a window. - */ -typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window; +#ifndef _ECORE_EVAS_H +typedef void Ecore_WinCE_Window; +#endif /** diff --git a/src/lib/ecore_wince/ecore_wince.c b/src/lib/ecore_wince/ecore_wince.c index 5638ad3..89b7906 100644 --- a/src/lib/ecore_wince/ecore_wince.c +++ b/src/lib/ecore_wince/ecore_wince.c @@ -81,10 +81,10 @@ _ecore_wince_window_procedure(HWND window, break; case WM_MOUSEMOVE: { - RECT rect; - Ecore_WinCE_Window *w = NULL; + RECT rect; + struct _Ecore_WinCE_Window *w = NULL; - w = (Ecore_WinCE_Window *)GetWindowLong(window, GWL_USERDATA); + w = (struct _Ecore_WinCE_Window *)GetWindowLong(window, GWL_USERDATA); if (GetClientRect(window, &rect)) { @@ -141,8 +141,6 @@ _ecore_wince_window_procedure(HWND window, _ecore_wince_event_handle_delete_request(data); break; /* GDI notifications */ - case WM_ERASEBKGND: - return 1; case WM_PAINT: { PAINTSTRUCT paint; diff --git a/src/lib/ecore_wince/ecore_wince_event.c b/src/lib/ecore_wince/ecore_wince_event.c index d5cda30..bbab07f 100644 --- a/src/lib/ecore_wince/ecore_wince_event.c +++ b/src/lib/ecore_wince/ecore_wince_event.c @@ -730,7 +730,7 @@ void _ecore_wince_event_handle_focus_in(Ecore_WinCE_Callback_Data *msg) { Ecore_WinCE_Event_Window_Focus_In *e; - Ecore_WinCE_Window *window; + struct _Ecore_WinCE_Window *window; INF("focus in"); @@ -759,7 +759,7 @@ void _ecore_wince_event_handle_focus_out(Ecore_WinCE_Callback_Data *msg) { Ecore_WinCE_Event_Window_Focus_Out *e; - Ecore_WinCE_Window *window; + struct _Ecore_WinCE_Window *window; INF("focus out"); diff --git a/src/lib/ecore_wince/ecore_wince_window.c b/src/lib/ecore_wince/ecore_wince_window.c index 747667d..db1af7f 100644 --- a/src/lib/ecore_wince/ecore_wince_window.c +++ b/src/lib/ecore_wince/ecore_wince_window.c @@ -99,13 +99,13 @@ ecore_wince_window_new(Ecore_WinCE_Window *parent, int width, int height) { - Ecore_WinCE_Window *w; - HWND window; - RECT rect; + struct _Ecore_WinCE_Window *w; + HWND window; + RECT rect; INF("creating window"); - w = (Ecore_WinCE_Window *)calloc(1, sizeof(Ecore_WinCE_Window)); + w = (struct _Ecore_WinCE_Window *)calloc(1, sizeof(struct _Ecore_WinCE_Window)); if (!w) { ERR("malloc() failed"); @@ -129,7 +129,7 @@ ecore_wince_window_new(Ecore_WinCE_Window *parent, WS_CAPTION | WS_SYSMENU | WS_VISIBLE, x, y, rect.right - rect.left, rect.bottom - rect.top, - parent ? ((Ecore_WinCE_Window *)parent)->window : NULL, + parent ? ((struct _Ecore_WinCE_Window *)parent)->window : NULL, NULL, _ecore_wince_instance, NULL); if (!window) { @@ -177,7 +177,7 @@ ecore_wince_window_free(Ecore_WinCE_Window *window) INF("destroying window"); - DestroyWindow(((Ecore_WinCE_Window *)window)->window); + DestroyWindow(((struct _Ecore_WinCE_Window *)window)->window); free(window); } @@ -195,7 +195,7 @@ ecore_wince_window_hwnd_get(Ecore_WinCE_Window *window) if (!window) return NULL; - return ((Ecore_WinCE_Window *)window)->window; + return ((struct _Ecore_WinCE_Window *)window)->window; } /** @@ -217,12 +217,12 @@ ecore_wince_window_move(Ecore_WinCE_Window *window, RECT rect; HWND w; - if (!window || ((Ecore_WinCE_Window *)window)->fullscreen) + if (!window || ((struct _Ecore_WinCE_Window *)window)->fullscreen) return; INF("moving window (%dx%d)", x, y); - w = ((Ecore_WinCE_Window *)window)->window; + w = ((struct _Ecore_WinCE_Window *)window)->window; if (!GetWindowRect(w, &rect)) { ERR("GetWindowRect() failed"); @@ -254,19 +254,19 @@ ecore_wince_window_resize(Ecore_WinCE_Window *window, int width, int height) { - RECT rect; - Ecore_WinCE_Window *w; - DWORD style; - DWORD exstyle; - int x; - int y; - - if (!window || ((Ecore_WinCE_Window *)window)->fullscreen) + RECT rect; + struct _Ecore_WinCE_Window *w; + DWORD style; + DWORD exstyle; + int x; + int y; + + if (!window || ((struct _Ecore_WinCE_Window *)window)->fullscreen) return; INF("resizing window (%dx%d)", width, height); - w = (Ecore_WinCE_Window *)window; + w = (struct _Ecore_WinCE_Window *)window; if (!GetWindowRect(w->window, &rect)) { ERR("GetWindowRect() failed"); @@ -324,17 +324,17 @@ ecore_wince_window_move_resize(Ecore_WinCE_Window *window, int width, int height) { - RECT rect; - Ecore_WinCE_Window *w; - DWORD style; - DWORD exstyle; + RECT rect; + struct _Ecore_WinCE_Window *w; + DWORD style; + DWORD exstyle; - if (!window || ((Ecore_WinCE_Window *)window)->fullscreen) + if (!window || ((struct _Ecore_WinCE_Window *)window)->fullscreen) return; INF("moving and resizing window (%dx%d %dx%d)", x, y, width, height); - w = ((Ecore_WinCE_Window *)window); + w = ((struct _Ecore_WinCE_Window *)window); rect.left = 0; rect.top = 0; rect.right = width; @@ -379,16 +379,16 @@ ecore_wince_window_show(Ecore_WinCE_Window *window) INF("showing window"); - if (!ShowWindow(((Ecore_WinCE_Window *)window)->window, SW_SHOWNORMAL)) + if (!ShowWindow(((struct _Ecore_WinCE_Window *)window)->window, SW_SHOWNORMAL)) { ERR("ShowWindow() failed"); return; } - if (!UpdateWindow(((Ecore_WinCE_Window *)window)->window)) + if (!UpdateWindow(((struct _Ecore_WinCE_Window *)window)->window)) { ERR("UpdateWindow() failed"); } - if (!SendMessage(((Ecore_WinCE_Window *)window)->window, WM_SHOWWINDOW, 1, 0)) + if (!SendMessage(((struct _Ecore_WinCE_Window *)window)->window, WM_SHOWWINDOW, 1, 0)) { ERR("SendMessage() failed"); } @@ -409,12 +409,12 @@ ecore_wince_window_hide(Ecore_WinCE_Window *window) INF("hiding window"); - if (!ShowWindow(((Ecore_WinCE_Window *)window)->window, SW_HIDE)) + if (!ShowWindow(((struct _Ecore_WinCE_Window *)window)->window, SW_HIDE)) { ERR("ShowWindow() failed"); return; } - if (!SendMessage(((Ecore_WinCE_Window *)window)->window, WM_SHOWWINDOW, 0, 0)) + if (!SendMessage(((struct _Ecore_WinCE_Window *)window)->window, WM_SHOWWINDOW, 0, 0)) { ERR("SendMessage() failed"); } @@ -445,7 +445,7 @@ ecore_wince_window_title_set(Ecore_WinCE_Window *window, wtitle = evil_char_to_wchar(title); if (!wtitle) return; - if (!SetWindowText(((Ecore_WinCE_Window *)window)->window, wtitle)) + if (!SetWindowText(((struct _Ecore_WinCE_Window *)window)->window, wtitle)) { ERR("SetWindowText() failed"); } @@ -477,14 +477,14 @@ EAPI void ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend) { - Ecore_WinCE_Window *w; + struct _Ecore_WinCE_Window *w; if (!window) return; INF("setting backend"); - w = (Ecore_WinCE_Window *)window; + w = (struct _Ecore_WinCE_Window *)window; w->backend = backend; } @@ -503,14 +503,14 @@ ecore_wince_window_backend_set(Ecore_WinCE_Window *window, EAPI void ecore_wince_window_suspend_cb_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int)) { - Ecore_WinCE_Window *w; + struct _Ecore_WinCE_Window *w; if (!window) return; INF("setting suspend callback"); - w = (Ecore_WinCE_Window *)window; + w = (struct _Ecore_WinCE_Window *)window; w->suspend_cb = suspend_cb; } @@ -529,14 +529,14 @@ ecore_wince_window_suspend_cb_set(Ecore_WinCE_Window *window, int (*suspend_cb)( EAPI void ecore_wince_window_resume_cb_set(Ecore_WinCE_Window *window, int (*resume_cb)(int)) { - Ecore_WinCE_Window *w; + struct _Ecore_WinCE_Window *w; if (!window) return; INF("setting resume callback"); - w = (Ecore_WinCE_Window *)window; + w = (struct _Ecore_WinCE_Window *)window; w->resume_cb = resume_cb; } @@ -579,7 +579,7 @@ ecore_wince_window_geometry_get(Ecore_WinCE_Window *window, return; } - if (!GetClientRect(((Ecore_WinCE_Window *)window)->window, + if (!GetClientRect(((struct _Ecore_WinCE_Window *)window)->window, &rect)) { ERR("GetClientRect() failed"); @@ -595,7 +595,7 @@ ecore_wince_window_geometry_get(Ecore_WinCE_Window *window, w = rect.right - rect.left; h = rect.bottom - rect.top; - if (!GetWindowRect(((Ecore_WinCE_Window *)window)->window, + if (!GetWindowRect(((struct _Ecore_WinCE_Window *)window)->window, &rect)) { ERR("GetWindowRect() failed"); @@ -645,7 +645,7 @@ ecore_wince_window_size_get(Ecore_WinCE_Window *window, return; } - if (!GetClientRect(((Ecore_WinCE_Window *)window)->window, + if (!GetClientRect(((struct _Ecore_WinCE_Window *)window)->window, &rect)) { ERR("GetClientRect() failed"); @@ -674,13 +674,13 @@ EAPI void ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window, Eina_Bool on) { - Ecore_WinCE_Window *ew; - HWND w; - HWND task_bar; + struct _Ecore_WinCE_Window *ew; + HWND w; + HWND task_bar; if (!window) return; - ew = (Ecore_WinCE_Window *)window; + ew = (struct _Ecore_WinCE_Window *)window; if (((ew->fullscreen) && (on)) || ((!ew->fullscreen) && (!on))) return; diff --git a/src/lib/ecore_x/xlib/ecore_x_image.c b/src/lib/ecore_x/xlib/ecore_x_image.c index 10cdfd8..151a61e 100644 --- a/src/lib/ecore_x/xlib/ecore_x_image.c +++ b/src/lib/ecore_x/xlib/ecore_x_image.c @@ -282,8 +282,7 @@ ecore_x_image_put(Ecore_X_Image *im, int h) { Ecore_X_GC tgc = 0; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!gc) { XGCValues gcv; @@ -293,8 +292,7 @@ ecore_x_image_put(Ecore_X_Image *im, gc = tgc; } if (!im->xim) _ecore_x_image_shm_create(im); - if (im->xim) - XShmPutImage(_ecore_x_disp, draw, gc, im->xim, sx, sy, x, y, w, h, False); + XShmPutImage(_ecore_x_disp, draw, gc, im->xim, sx, sy, x, y, w, h, False); if (tgc) ecore_x_gc_free(tgc); } /* ecore_x_image_put */ diff --git a/src/lib/ecore_x/xlib/ecore_x_randr_12.c b/src/lib/ecore_x/xlib/ecore_x_randr_12.c index 99cfb69..3607980 100644 --- a/src/lib/ecore_x/xlib/ecore_x_randr_12.c +++ b/src/lib/ecore_x/xlib/ecore_x_randr_12.c @@ -406,13 +406,11 @@ ecore_x_randr_mode_info_get(Ecore_X_Window root, Ecore_X_Randr_Mode mode) ret->vTotal = res->modes[i].vTotal; ret->name = NULL; ret->nameLength = 0; - if (res->modes[i].nameLength > 0) + if (res->modes[i].nameLength > 0) { ret->nameLength = res->modes[i].nameLength; - ret->name = malloc(res->modes[i].nameLength + 1); - if (ret->name) - memcpy(ret->name, res->modes[i].name, - res->modes[i].nameLength + 1); + ret->name = strndup(res->modes[i].name, + res->modes[i].nameLength); } ret->modeFlags = res->modes[i].modeFlags; break; @@ -1904,185 +1902,3 @@ ecore_x_randr_screen_reset(Ecore_X_Window root) Ecore_X_Randr_Unset); #endif } - -/** - * @brief set up the backlight level to the given level. - * @param root the window's screen which will be set. - * @param level of the backlight between 0 and 1 - */ - -EAPI void -ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root, - double level) -{ -#ifdef ECORE_XRANDR - RANDR_CHECK_1_2_RET(); - Atom _backlight; - XRRScreenResources *resources = NULL; - Ecore_X_Randr_Output output; - int o; - - if ((level < 0) || (level > 1)) - { - ERR("Wrong value for the backlight level. It should be between 0 and 1."); - return; - } - - /* - * To make sure that the _backlight atomic property still exists. - */ - _backlight = XInternAtom(_ecore_x_disp, RANDR_PROPERTY_BACKLIGHT, True); - if (_backlight == None) - { - WRN("Backlight setting is not supported on this server or driver"); - return; - } - - /* get the ressources */ - resources = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root); - if (!resources) return; - - for (o = 0; o < resources->noutput; o++) - { - output = resources->outputs[o]; - if (ecore_x_randr_output_backlight_level_get(root, output) >= 0) - { - ecore_x_randr_output_backlight_level_set(root, output, level); - } - } - XRRFreeScreenResources(resources); -#endif -} - -/* - * @brief get the backlight level of the given output - * @param root window which's screen should be queried - * @param output from which the backlight level should be retrieved - * @return the backlight level - */ - -EAPI double -ecore_x_randr_output_backlight_level_get(Ecore_X_Window root, - Ecore_X_Randr_Output output) -{ -#ifdef ECORE_XRANDR - RANDR_CHECK_1_2_RET(-1); - Atom actual_type; - Atom _backlight; - XRRPropertyInfo *info = NULL; - double dvalue; - int actual_format; - long value, max, min; - unsigned long nitems; - unsigned long bytes_after; - unsigned char *prop = NULL; - - /* set backlight variable if not already done */ - - _backlight = XInternAtom(_ecore_x_disp, RANDR_PROPERTY_BACKLIGHT, True); - if (_backlight == None) - { - ERR("Backlight property is not suppported on this server or driver"); - return -1; - } - - if (!_ecore_x_randr_output_validate(root, output)) - { - ERR("Invalid output"); - return -1; - } - - if (XRRGetOutputProperty(_ecore_x_disp, output, _backlight, - 0, 4, False, False, None, - &actual_type, &actual_format, - &nitems, &bytes_after, &prop) != Success) - { - WRN("Backlight not supported on this output"); - return -1; - } - - if ((actual_type != XA_INTEGER) || (nitems != 1) || (actual_format != 32)) return -1; - - value = *((long *)prop); - free (prop); - - /* I have the current value of the backlight */ - /* Now retrieve the min and max intensities of the output */ - info = XRRQueryOutputProperty(_ecore_x_disp, output, _backlight); - if (info) - { - dvalue = -1; - if ((info->range) && (info->num_values == 2)) - { - /* finally convert the current value in the interval [0..1] */ - min = info->values[0]; - max = info->values[1]; - dvalue = ((double)(value - min)) / ((double)(max - min)); - } - free(info); - return dvalue; - } -#endif - return -1; -} - -/* - * @brief set the backlight level of a given output - * @param root window which's screen should be queried - * @param output that should be set - * @param level for which the backlight should be set - * @return EINA_TRUE in case of success - */ - -EAPI Eina_Bool -ecore_x_randr_output_backlight_level_set(Ecore_X_Window root, - Ecore_X_Randr_Output output, - double level) -{ -#ifdef ECORE_XRANDR - RANDR_CHECK_1_2_RET(EINA_FALSE); - Atom _backlight; - XRRPropertyInfo *info = NULL; - double min, max, tmp; - long new; - - if ((level < 0) || (level > 1)) - { - ERR("Backlight level should be between 0 and 1"); - return EINA_FALSE; - } - - if (!_ecore_x_randr_output_validate(root, output)) - { - ERR("Wrong output value"); - return EINA_FALSE; - } - - _backlight = XInternAtom(_ecore_x_disp, RANDR_PROPERTY_BACKLIGHT, True); - if (_backlight == None) - { - WRN("Backlight property is not suppported on this server or driver"); - return EINA_FALSE; - } - - info = XRRQueryOutputProperty(_ecore_x_disp, output, _backlight); - if (info) - { - if ((info->range) && (info->num_values == 2)) - { - min = info->values[0]; - max = info->values[1]; - tmp = (level * (max - min)) + min; - new = tmp; - if (new > max) new = max; - if (new < min) new = min; - XRRChangeOutputProperty(_ecore_x_disp, output, _backlight, XA_INTEGER, 32, - PropModeReplace, (unsigned char *)&new, 1); - XFlush(_ecore_x_disp); - } - free(info); - return EINA_TRUE; - } -#endif - return EINA_FALSE; -} diff --git a/win32/MANIFEST.txt b/win32/MANIFEST.txt new file mode 100644 index 0000000..8663237 --- /dev/null +++ b/win32/MANIFEST.txt @@ -0,0 +1,18 @@ + + This folder content: + + common - common sources necessary to build efl with MSVC + config.h - configuration file + + vs9 - Visual Studio 9 project files + ecore.sln - Evil MSVC solution + libecore.vcproj - libecore project + libecore_evas.vcproj - libecore project + libecore_file.vcproj - libecore project + libecore_input.vcproj - libecore project + libecore_input_evas.vcproj - libecore project + libecore_win32.vcproj - libecore project + + start.bat - batch script to start work with the solution + MANIFEST.txt - this file + README.txt - about this folder diff --git a/win32/README.txt b/win32/README.txt new file mode 100644 index 0000000..27b3994 --- /dev/null +++ b/win32/README.txt @@ -0,0 +1,56 @@ + This folder contains Microsoft Visual Studio projects and some sources for + building Evil. + +Important: + + Do not launch manually any solutions or projects in the folder, to start + a solution run the start.bat script, it will setup environment for + projects and will check system requirements. start.bat will detect + automatically the version of Visual Studio which is installed. It + currently supports Visual Studio 2008, Visual Studio 2010 should convert + the files. + + Before start make sure that the EXT_DIR variable points to proper + extern directory. Extern directory layout and content (may be different, but + this is guaranteed to be enough): + + extern + bin + freetype6.dll + iconv.dll + jpeg62.dll + libpng14.dll + libtiff3.dll + libungif4.dll + zlib1.dll + + include + freetype + ... (freetype includes) + sys + param.h + + ft2build.h + gif_lib.h + iconv.h + jconfig.h + jerror.h + jmorecfg.h + jpeglib.h + png.h + pngconf.h + tiff.h + tiffconf.h + tiffio.h + tiffvers.h + zconf.h + zlib.h + + lib + freetype.lib + iconv.lib + jpeg.lib + libpng.lib + libtiff.lib + libungif.lib + zlib.lib diff --git a/win32/common/config.h b/win32/common/config.h new file mode 100644 index 0000000..2bc604f --- /dev/null +++ b/win32/common/config.h @@ -0,0 +1,417 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Build Ecore_Cocoa Module */ +/* #undef BUILD_ECORE_COCOA */ + +/* Build Ecore_Con Module */ +/* #undef BUILD_ECORE_CON */ + +/* Build Ecore_DirectFB Module */ +/* #undef BUILD_ECORE_DIRECTFB */ + +/* Build Ecore_Evas Module */ +#define BUILD_ECORE_EVAS 1 + +/* Support for Cocoa Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_COCOA */ + +/* Support for Direct3d Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_DIRECT3D */ + +/* Support for DirectFB Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_DIRECTFB */ + +/* Support for Linux Framebuffer Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_FB */ + +/* Support for Glew OpenGL Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_OPENGL_GLEW */ + +/* Support for OpenGL SDL Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_OPENGL_SDL */ + +/* Support for OpenGL Xlib Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_OPENGL_X11 */ + +/* Support for SVN SDL */ +/* #undef BUILD_ECORE_EVAS_SDL_130 */ + +/* Support for 16 bpp Software DirectDraw Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_16_DDRAW */ + +/* Support for 16 bpp Software Windows CE Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE */ + +/* Support for Software Xlib 16 bits Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_16_X11 */ + +/* Support for Software 8bit X11 Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_8_X11 */ + +/* Support for Software Buffer Engine in Ecore_Evas */ +#define BUILD_ECORE_EVAS_SOFTWARE_BUFFER 1 + +/* Support for Software DirectDraw Engine in Ecore_Evas */ +#define BUILD_ECORE_EVAS_SOFTWARE_DDRAW 1 + +/* Support for Software GDI Engine in Ecore_Evas */ +#define BUILD_ECORE_EVAS_SOFTWARE_GDI 1 + +/* Support for Software SDL Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_SDL */ + +/* Support for Software X11 Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_X11 */ + +/* Evas Software XCB Engine Support */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_XCB */ + +/* Evas Software Xlib Engine Support */ +/* #undef BUILD_ECORE_EVAS_SOFTWARE_XLIB */ + +/* Support for Win32 Engine in Ecore_Evas */ +#define BUILD_ECORE_EVAS_WIN32 1 + +/* Support for X Window Engines in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_X11 */ + +/* Support for XRender Xlib Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_XRENDER_X11 */ + +/* Support for XRender XCB Engine in Ecore_Evas */ +/* #undef BUILD_ECORE_EVAS_XRENDER_XCB */ + +/* Build Ecore_FB Module */ +/* #undef BUILD_ECORE_FB */ + +/* Build Ecore_File Module */ +#define BUILD_ECORE_FILE 1 + +/* Build Ecore_Imf Module */ +#define BUILD_ECORE_IMF 1 + +/* Build Ecore_Imf_Evas Module */ +#define BUILD_ECORE_IMF_EVAS 1 + +/* Build Ecore_Input Module */ +#define BUILD_ECORE_INPUT 1 + +/* Build Ecore_Input_Evas Module */ +#define BUILD_ECORE_INPUT_EVAS 1 + +/* Build Ecore_Ipc Module */ +/* #undef BUILD_ECORE_IPC */ + +/* Build Ecore_Sdl Module */ +/* #undef BUILD_ECORE_SDL */ + +/* Build Ecore_Win32 Module */ +#define BUILD_ECORE_WIN32 1 + +/* Build Ecore_WinCE Module */ +/* #undef BUILD_ECORE_WINCE */ + +/* Build Ecore_X Module */ +/* #undef BUILD_ECORE_X */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Build support for XCB composite */ +/* #undef ECORE_XCB_COMPOSITE */ + +/* Build support for XCB damage */ +/* #undef ECORE_XCB_DAMAGE */ + +/* Build support for XCB dpms */ +/* #undef ECORE_XCB_DPMS */ + +/* Build support for XCB xfixes */ +/* #undef ECORE_XCB_FIXES */ + +/* Build support for XCB randr */ +/* #undef ECORE_XCB_RANDR */ + +/* Build support for XCB render */ +/* #undef ECORE_XCB_RENDER */ + +/* Build support for XCB screensaver */ +/* #undef ECORE_XCB_SCREENSAVER */ + +/* Build support for XCB shape */ +/* #undef ECORE_XCB_SHAPE */ + +/* Build support for XCB sync */ +/* #undef ECORE_XCB_SYNC */ + +/* Build support for XCB xinerama */ +/* #undef ECORE_XCB_XINERAMA */ + +/* Build support for XCB xprint */ +/* #undef ECORE_XCB_XPRINT */ + +/* Build support for XCB xtest */ +/* #undef ECORE_XCB_XTEST */ + +/* Build support for Xcomposite */ +/* #undef ECORE_XCOMPOSITE */ + +/* Build support for Xcursor */ +/* #undef ECORE_XCURSOR */ + +/* Build support for Xdamage */ +/* #undef ECORE_XDAMAGE */ + +/* Build support for Xdpms */ +/* #undef ECORE_XDPMS */ + +/* Build support for Xfixes */ +/* #undef ECORE_XFIXES */ + +/* Build support for Xi2 */ +/* #undef ECORE_XI2 */ + +/* Build support for Xinerama */ +/* #undef ECORE_XINERAMA */ + +/* Build support for Xkb */ +/* #undef ECORE_XKB */ + +/* Build support for Xprint */ +/* #undef ECORE_XPRINT */ + +/* Build support for Xrandr */ +/* #undef ECORE_XRANDR */ + +/* Build support for Xrender */ +/* #undef ECORE_XRENDER */ + +/* Build support for Xss */ +/* #undef ECORE_XSS */ + +/* Build support for Xtest */ +/* #undef ECORE_XTEST */ + +/* Define to mention that POSIX threads are supported */ +/* #define EFL_HAVE_PTHREAD 1 */ + +/* Define to mention that POSIX threads spinlocks are supported */ +/* #undef EFL_HAVE_PTHREAD_SPINLOCK */ + +/* if set, logging is limited to this amount. */ +/* #undef EINA_LOG_LEVEL_MAXIMUM */ + +/* Enable X Input Method */ +#define ENABLE_XIM 1 + +/* Always integrate glib if support compiled */ +/* #undef GLIB_INTEGRATION_ALWAYS */ + +/* Have abstract sockets namespace */ +#define HAVE_ABSTRACT_SOCKETS 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_INET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_NAMESER_H */ + +/* mkdirat exists */ +/* #undef HAVE_ATFILE_SOURCE */ + +/* Build Ecore_Con_Info with c-ares support */ +/* #undef HAVE_CARES */ + +/* Downloading with CURL */ +/* #undef HAVE_CURL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Defined to 1 if XCB is enabled. */ +/* #undef HAVE_ECORE_X_XCB */ + +/* Defined to 1 if Xlib is enabled. */ +/* #undef HAVE_ECORE_X_XLIB */ + +/* Set to 1 if Evil library is installed */ +#define HAVE_EVIL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FEATURES_H */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Have GLib */ +/* #undef HAVE_GLIB */ + +/* File monitoring with Inotify */ +/* #undef HAVE_INOTIFY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LANGINFO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LOCALE_H */ + +/* Gather memory statistic */ +/* #undef HAVE_MALLINFO */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdirat' function. */ +/* #undef HAVE_MKDIRAT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* File monitoring with Windows notification */ +#define HAVE_NOTIFY_WIN32 1 + +/* File monitoring with polling */ +#define HAVE_POLL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SIGNAL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcpy' function. */ +/* #undef HAVE_STRLCPY */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_EPOLL_H */ + +/* File monitoring with Inotify - sys/inotify.h */ +/* #undef HAVE_SYS_INOTIFY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_RESOURCE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UN_H */ + +/* Define to 1 if you have that is POSIX.1 compatible. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Build Ecore_FB Touchscreen Code */ +/* #undef HAVE_TSLIB */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WS2TCPIP_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "ecore" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "enlightenment-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "ecore" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "ecore 1.0.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "ecore" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.0.0" + +/* default value since PATH_MAX is not defined */ +/* #undef PATH_MAX */ + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + + +/* Version number of package */ +#define VERSION "1.0.0" + +/* Major version */ +#define VERS_MAJ 1 + +/* Micro version */ +#define VERS_MIC 0 + +/* Minor version */ +#define VERS_MIN 0 + +/* Revison */ +#define VERS_REV 0 diff --git a/win32/start.bat b/win32/start.bat new file mode 100644 index 0000000..478c4a9 --- /dev/null +++ b/win32/start.bat @@ -0,0 +1,106 @@ +@echo off + +rem Set external libraries directory. +set EXT_DIR=%cd%\..\..\..\extern + +if not exist %EXT_DIR% ( + set EXT_DIR= + echo ERROR: External libs dir is not set. + pause + goto END +) + +if "%DXSDK_DIR%" == "" ( + echo ERROR: Microsoft DirectX SDK is not installed. + pause + goto END +) + +rem Check for basic requirements for Visual Studio 2008 +if "%VS90COMNTOOLS%" == "" ( + echo ERROR: Microsoft Visual Studio 2008 is not installed. + echo ERROR: Try to launch Microsoft Visual Studio 2005. + pause + goto NOVS9 +) + +set PROJECT_TYPE=vs9 +set VSCOMMONTOOLS=%VS90COMNTOOLS%vsvars32.bat + +goto STARTVS + +:NOVS9 + +rem Check for basic requirements for Visual Studio 2005 +if "%VS80COMNTOOLS%" == "" ( + echo ERROR: Microsoft Visual Studio 2005 is not installed. + pause + goto END +) + +set PROJECT_TYPE=vs8 +set VSCOMMONTOOLS=%VS80COMNTOOLS%vsvars32.bat + +rem Patching Eina +patch.exe --binary -p1 < %cd%\patch\eina.diff +echo INFO: Eina patched. + +pause + +:STARTVS + +rem Setup common Win32 environment variables + +rem Add DirectX includes and libraries dirs. +set INCLUDE=%DXSDK_DIR%Include;%INCLUDE% +set LIB=%DXSDK_DIR%Lib\x86;%LIB% + +rem Add Evil lib path +set EvilInclude=%cd%\..\..\evil\src\lib +set EvilCommon=%cd%\..\..\evil\win32\common +set EvilOut=%cd%\..\..\evil\win32\%PROJECT_TYPE%\out + +set INCLUDE=%EvilCommon%;%EvilInclude%;%EvilInclude%\dlfcn;%INCLUDE% +set LIB=%EvilOut%;%LIB% + +rem Add Eina lib path +set EinaInclude=%cd%\..\..\eina\src\include +set EinaCommon=%cd%\..\..\eina\win32\common +set EinaOut=%cd%\..\..\eina\win32\%PROJECT_TYPE%\out + +set INCLUDE=%EinaInclude%;%EinaCommon%;%INCLUDE% +set LIB=%EinaOut%;%LIB% + +rem Add Eet lib path +set EetInclude=%cd%\..\..\eet\src\lib +set EetOut=%cd%\..\..\eet\win32\%PROJECT_TYPE%\out + +set INCLUDE=%EetInclude%;%INCLUDE% +set LIB=%EetOut%;%LIB% + +rem Add Evas lib path +set EvasInclude=%cd%\..\..\evas\src\lib;%cd%\..\..\evas\src\modules\engines\buffer;%cd%\..\..\evas\src\modules\engines\software_gdi;%cd%\..\..\evas\src\modules\engines\software_ddraw +set EvasOut=%cd%\..\..\evas\win32\%PROJECT_TYPE%\out + +set INCLUDE=%EvasInclude%;%INCLUDE% +set LIB=%EvasOut%;%LIB% + +rem Add installation directory pathes. +set INCLUDE=%EXT_DIR%\include;%INCLUDE% +set LIB=%EXT_DIR%\lib;%LIB% + +set INCLUDE=%cd%\common;%cd%\..\src\lib\ecore;%cd%\..\src\lib\ecore_input;%cd%\..\src\lib\ecore_input_evas;%cd%\..\src\lib\ecore_win32;%INCLUDE% + +set SolutionDirectory=%cd%\%PROJECT_TYPE% +set DebugOutputDirectory=%SolutionDirectory%\out +set ReleaseOutputDirectory=%SolutionDirectory%\out +set DebugLibraryDirectory=%SolutionDirectory%\out +set ReleaseLibraryDirectory=%SolutionDirectory%\out +set TemporaryDirectory=%SolutionDirectory%\temp + +rem Setting environment for using Microsoft Visual Studio x86 tools. +call "%VSCOMMONTOOLS%" + +%PROJECT_TYPE%\ecore.sln + +:END diff --git a/win32/vs9/ecore.sln b/win32/vs9/ecore.sln new file mode 100644 index 0000000..bf713fe --- /dev/null +++ b/win32/vs9/ecore.sln @@ -0,0 +1,68 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libecore", "libecore.vcproj", "{689B4F2B-666D-439F-9BF3-1203D813DE3F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libecore_win32", "libecore_win32.vcproj", "{3266A791-E050-48C1-A114-798B98CAB12C}" + ProjectSection(ProjectDependencies) = postProject + {689B4F2B-666D-439F-9BF3-1203D813DE3F} = {689B4F2B-666D-439F-9BF3-1203D813DE3F} + {1EA2B2BF-E021-4611-AEEC-5EED621347B6} = {1EA2B2BF-E021-4611-AEEC-5EED621347B6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libecore_evas", "libecore_evas.vcproj", "{DE0016EC-1096-42FF-A2BA-BDCFD3A95E50}" + ProjectSection(ProjectDependencies) = postProject + {689B4F2B-666D-439F-9BF3-1203D813DE3F} = {689B4F2B-666D-439F-9BF3-1203D813DE3F} + {3F8D2B53-364C-40A4-9F0E-18C134010223} = {3F8D2B53-364C-40A4-9F0E-18C134010223} + {3266A791-E050-48C1-A114-798B98CAB12C} = {3266A791-E050-48C1-A114-798B98CAB12C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libecore_file", "libecore_file.vcproj", "{EAD9796F-A372-4505-8BF6-520AA6686F27}" + ProjectSection(ProjectDependencies) = postProject + {689B4F2B-666D-439F-9BF3-1203D813DE3F} = {689B4F2B-666D-439F-9BF3-1203D813DE3F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libecore_input", "libecore_input.vcproj", "{1EA2B2BF-E021-4611-AEEC-5EED621347B6}" + ProjectSection(ProjectDependencies) = postProject + {689B4F2B-666D-439F-9BF3-1203D813DE3F} = {689B4F2B-666D-439F-9BF3-1203D813DE3F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libecore_input_evas", "libecore_input_evas.vcproj", "{3F8D2B53-364C-40A4-9F0E-18C134010223}" + ProjectSection(ProjectDependencies) = postProject + {1EA2B2BF-E021-4611-AEEC-5EED621347B6} = {1EA2B2BF-E021-4611-AEEC-5EED621347B6} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {689B4F2B-666D-439F-9BF3-1203D813DE3F}.Debug|Win32.ActiveCfg = Debug|Win32 + {689B4F2B-666D-439F-9BF3-1203D813DE3F}.Debug|Win32.Build.0 = Debug|Win32 + {689B4F2B-666D-439F-9BF3-1203D813DE3F}.Release|Win32.ActiveCfg = Release|Win32 + {689B4F2B-666D-439F-9BF3-1203D813DE3F}.Release|Win32.Build.0 = Release|Win32 + {3266A791-E050-48C1-A114-798B98CAB12C}.Debug|Win32.ActiveCfg = Debug|Win32 + {3266A791-E050-48C1-A114-798B98CAB12C}.Debug|Win32.Build.0 = Debug|Win32 + {3266A791-E050-48C1-A114-798B98CAB12C}.Release|Win32.ActiveCfg = Release|Win32 + {3266A791-E050-48C1-A114-798B98CAB12C}.Release|Win32.Build.0 = Release|Win32 + {DE0016EC-1096-42FF-A2BA-BDCFD3A95E50}.Debug|Win32.ActiveCfg = Debug|Win32 + {DE0016EC-1096-42FF-A2BA-BDCFD3A95E50}.Debug|Win32.Build.0 = Debug|Win32 + {DE0016EC-1096-42FF-A2BA-BDCFD3A95E50}.Release|Win32.ActiveCfg = Release|Win32 + {DE0016EC-1096-42FF-A2BA-BDCFD3A95E50}.Release|Win32.Build.0 = Release|Win32 + {EAD9796F-A372-4505-8BF6-520AA6686F27}.Debug|Win32.ActiveCfg = Debug|Win32 + {EAD9796F-A372-4505-8BF6-520AA6686F27}.Debug|Win32.Build.0 = Debug|Win32 + {EAD9796F-A372-4505-8BF6-520AA6686F27}.Release|Win32.ActiveCfg = Release|Win32 + {EAD9796F-A372-4505-8BF6-520AA6686F27}.Release|Win32.Build.0 = Release|Win32 + {1EA2B2BF-E021-4611-AEEC-5EED621347B6}.Debug|Win32.ActiveCfg = Debug|Win32 + {1EA2B2BF-E021-4611-AEEC-5EED621347B6}.Debug|Win32.Build.0 = Debug|Win32 + {1EA2B2BF-E021-4611-AEEC-5EED621347B6}.Release|Win32.ActiveCfg = Release|Win32 + {1EA2B2BF-E021-4611-AEEC-5EED621347B6}.Release|Win32.Build.0 = Release|Win32 + {3F8D2B53-364C-40A4-9F0E-18C134010223}.Debug|Win32.ActiveCfg = Debug|Win32 + {3F8D2B53-364C-40A4-9F0E-18C134010223}.Debug|Win32.Build.0 = Debug|Win32 + {3F8D2B53-364C-40A4-9F0E-18C134010223}.Release|Win32.ActiveCfg = Release|Win32 + {3F8D2B53-364C-40A4-9F0E-18C134010223}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs9/libecore.vcproj b/win32/vs9/libecore.vcproj new file mode 100644 index 0000000..33f1aeb --- /dev/null +++ b/win32/vs9/libecore.vcproj @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/libecore_evas.vcproj b/win32/vs9/libecore_evas.vcproj new file mode 100644 index 0000000..692b8ce --- /dev/null +++ b/win32/vs9/libecore_evas.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/libecore_file.vcproj b/win32/vs9/libecore_file.vcproj new file mode 100644 index 0000000..66ec7d4 --- /dev/null +++ b/win32/vs9/libecore_file.vcproj @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/libecore_input.vcproj b/win32/vs9/libecore_input.vcproj new file mode 100644 index 0000000..de42faa --- /dev/null +++ b/win32/vs9/libecore_input.vcproj @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/libecore_input_evas.vcproj b/win32/vs9/libecore_input_evas.vcproj new file mode 100644 index 0000000..3fa8c41 --- /dev/null +++ b/win32/vs9/libecore_input_evas.vcproj @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs9/libecore_win32.vcproj b/win32/vs9/libecore_win32.vcproj new file mode 100644 index 0000000..9900ea7 --- /dev/null +++ b/win32/vs9/libecore_win32.vcproj @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +