From a6f59e16946ddd2f7d896f8cdbfb891aaedb73ef Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Sat, 24 Jan 2015 17:33:38 +0100 Subject: wip commit --- .gitignore | 1 + configure.ac | 4 +- data/desktop/eulogium.desktop | 12 ++ doc/eulogium.1 | 50 ++++++++ po/POTFILES.in | 3 +- po/eulogium.pot | 21 ++++ src/Makefile.am | 14 ++- src/bin/Makefile.am | 19 --- src/bin/eulogium_main.c | 118 ------------------ src/bin/eulogium_private.h | 6 - src/bin/gettext.h | 280 ------------------------------------------ src/eulogium | Bin 0 -> 17860 bytes src/eulogium.c | 61 +++++++++ src/gettext.h | 280 ++++++++++++++++++++++++++++++++++++++++++ src/lib/Eulogium.h | 111 ----------------- src/lib/Makefile.am | 18 --- src/lib/eulogium.c | 64 ---------- src/lib/eulogium_private.h | 27 ---- 18 files changed, 440 insertions(+), 649 deletions(-) create mode 100644 data/desktop/eulogium.desktop create mode 100644 doc/eulogium.1 create mode 100644 po/eulogium.pot delete mode 100644 src/bin/Makefile.am delete mode 100644 src/bin/eulogium_main.c delete mode 100644 src/bin/eulogium_private.h delete mode 100644 src/bin/gettext.h create mode 100755 src/eulogium create mode 100644 src/eulogium.c create mode 100644 src/gettext.h delete mode 100644 src/lib/Eulogium.h delete mode 100644 src/lib/Makefile.am delete mode 100644 src/lib/eulogium.c delete mode 100644 src/lib/eulogium_private.h diff --git a/.gitignore b/.gitignore index cd67ad2..29a9268 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # generated and tmp files *~ +*.swp *.edj *.exe *.o diff --git a/configure.ac b/configure.ac index 5af30e4..2671436 100644 --- a/configure.ac +++ b/configure.ac @@ -32,9 +32,9 @@ PKG_CHECK_MODULES([EFL], [ eina >= 1.8.0 evas >= 1.8.0 + ecore-evas >= 1.8.0 ecore >= 1.8.0 edje >= 1.8.0 - elementary >= 1.8.0 ]) # Check for tests and coverage @@ -72,8 +72,6 @@ packaging/slackware/Makefile packaging/pkgbuild/Makefile po/Makefile.in src/Makefile -src/bin/Makefile -src/lib/Makefile src/tests/Makefile doc/eulogium.1 ]) diff --git a/data/desktop/eulogium.desktop b/data/desktop/eulogium.desktop new file mode 100644 index 0000000..4b866e7 --- /dev/null +++ b/data/desktop/eulogium.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.0.1 +Type=Application +Name=eulogium +Name[fr]=eulogium +GenericName=Efl Application Skeletion +Comment=Efl Application Eulogium +Icon=eulogium +TryExec=eulogium +Exec=eulogium +Categories=Development;Utility; diff --git a/doc/eulogium.1 b/doc/eulogium.1 new file mode 100644 index 0000000..fb25823 --- /dev/null +++ b/doc/eulogium.1 @@ -0,0 +1,50 @@ +.TH EULOGIUM 1 "01 01 1970 FIXME" "eulogium 0.0.1" + +.SH NAME +eulogium \- a demo application + +.SH SYNOPSIS +.B eulogium +[-d] [-f] [-t=THEME] [-m=MINES] [-L] [-C] [-V] [-h] + +.SH DESCRIPTION + +Eulogium is a demo application to show how to integrate EFL and autotools into a +cross platform build. You should be able to generate an executable easily for all +target supported by EFL with this eulogium. + +With no option, the program starts and display an Hello World. + + +.SH OPTIONS + +.TP +.B -L, --license +Show license. + +.TP +.B -C, --copyright +Show copyright. + +.TP +.B -V, --version +Show program version. + +.TP +.B -h, --help +Print list of options with short description. + + +.SH BUGS + +Reports are welcome. Send them at enlightenment-devel@lists.sourceforge.net. + + +.SH HOMEPAGE + +http://enlightenment.org + + +.SH AUTHORS + +oliver and various contributors. diff --git a/po/POTFILES.in b/po/POTFILES.in index ff2ad76..79f7c5c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,2 +1 @@ -src/bin/eulogium_main.c -src/bin/eulogium_private.h +src/eulogium.c diff --git a/po/eulogium.pot b/po/eulogium.pot new file mode 100644 index 0000000..e6559b3 --- /dev/null +++ b/po/eulogium.pot @@ -0,0 +1,21 @@ +# SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: eulogium 0.0.1\n" +"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n" +"POT-Creation-Date: 2015-01-24 16:57+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/eulogium.c:57 +msgid "Could not parse arguments." +msgstr "" diff --git a/src/Makefile.am b/src/Makefile.am index 15871c9..6d27e95 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,16 @@ MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = lib bin tests +SUBDIRS = tests +bin_PROGRAMS = eulogium + +AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +-I$(top_builddir)/src/ \ +-I$(top_srcdir)/src/ \ +@EFL_CFLAGS@ + +eulogium_SOURCES = eulogium.c +eulogium_LDADD = @EFL_LIBS@ + +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am deleted file mode 100644 index 589f68d..0000000 --- a/src/bin/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -bin_PROGRAMS = eulogium - -AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ --I$(top_builddir)/src/bin/ \ --I$(top_srcdir)/src/bin/ \ --I$(top_builddir)/src/lib/ \ --I$(top_srcdir)/src/lib/ \ -@EFL_CFLAGS@ - -eulogium_SOURCES = eulogium_main.c -eulogium_LDADD = @EFL_LIBS@ $(top_builddir)/src/lib/libeulogium.la - -localedir = $(datadir)/locale -DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ - -EXTRA_DIST = eulogium_private.h - diff --git a/src/bin/eulogium_main.c b/src/bin/eulogium_main.c deleted file mode 100644 index b8a83e1..0000000 --- a/src/bin/eulogium_main.c +++ /dev/null @@ -1,118 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -/* NOTE: Respecting header order is important for portability. - * Always put system first, then EFL, then your public header, - * and finally your private one. */ - -#include -#include - -#include "gettext.h" - -#include "Eulogium.h" - -#include "eulogium_private.h" - -#define COPYRIGHT "Copyright © 2013 oliver and various contributors (see AUTHORS)." - -static void -_eulogium_win_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) -{ - elm_exit(); -} - -static Evas_Object * -eulogium_win_setup(void) -{ - Evas_Object *win; - Evas_Object *label; - - win = elm_win_util_standard_add("main", "Eulogium"); - if (!win) return NULL; - - elm_win_focus_highlight_enabled_set(win, EINA_TRUE); - evas_object_smart_callback_add(win, "delete,request", _eulogium_win_del, NULL); - - label = elm_label_add(win); - elm_object_text_set(label, " Hello World !"); - evas_object_size_hint_weight_set(label, 0.0, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(label, 0.0, EVAS_HINT_FILL); - evas_object_show(label); - - elm_win_resize_object_add(win, label); - - evas_object_show(win); - - return win; -} - -static const Ecore_Getopt optdesc = { - "eulogium", - "%prog [options]", - PACKAGE_VERSION, - COPYRIGHT, - "BSD with advertisement clause", - "An EFL eulogium program", - 0, - { - ECORE_GETOPT_LICENSE('L', "license"), - ECORE_GETOPT_COPYRIGHT('C', "copyright"), - ECORE_GETOPT_VERSION('V', "version"), - ECORE_GETOPT_HELP('h', "help"), - ECORE_GETOPT_SENTINEL - } -}; - -EAPI_MAIN int -elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) -{ - Evas_Object *win; - int args; - Eina_Bool quit_option = EINA_FALSE; - - Ecore_Getopt_Value values[] = { - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_BOOL(quit_option), - ECORE_GETOPT_VALUE_NONE - }; - -#if ENABLE_NLS - setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); - bind_textdomain_codeset(PACKAGE, "UTF-8"); - textdomain(PACKAGE); -#endif - - eulogium_init(); - - args = ecore_getopt_parse(&optdesc, values, argc, argv); - if (args < 0) - { - EINA_LOG_CRIT("Could not parse arguments."); - goto end; - } - else if (quit_option) - { - goto end; - } - - elm_app_info_set(elm_main, "eulogium", "images/eulogium.png"); - - if (!(win = eulogium_win_setup())) - goto end; - - eulogium_library_call(); - - elm_run(); - - end: - eulogium_shutdown(); - elm_shutdown(); - - return 0; -} -ELM_MAIN() diff --git a/src/bin/eulogium_private.h b/src/bin/eulogium_private.h deleted file mode 100644 index aa968c6..0000000 --- a/src/bin/eulogium_private.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef EULOGIUM_PRIVATE_H_ -# define EULOGIUM_PRIVATE_H_ - -// FIXME: put some private stuff related to your binary - -#endif diff --git a/src/bin/gettext.h b/src/bin/gettext.h deleted file mode 100644 index e76b592..0000000 --- a/src/bin/gettext.h +++ /dev/null @@ -1,280 +0,0 @@ -/* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ - -#ifndef _LIBGETTEXT_H -#define _LIBGETTEXT_H 1 - -/* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS - -/* Get declarations of GNU message catalog functions. */ -# include - -/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by - the gettext() and ngettext() macros. This is an alternative to calling - textdomain(), and is useful for libraries. */ -# ifdef DEFAULT_TEXT_DOMAIN -# undef gettext -# define gettext(Msgid) \ - dgettext (DEFAULT_TEXT_DOMAIN, Msgid) -# undef ngettext -# define ngettext(Msgid1, Msgid2, N) \ - dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) -# endif - -#else - -/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which - chokes if dcgettext is defined as a macro. So include it now, to make - later inclusions of a NOP. We don't include - as well because people using "gettext.h" will not include , - and also including would fail on SunOS 4, whereas - is OK. */ -#if defined(__sun) -# include -#endif - -/* Many header files from the libstdc++ coming with g++ 3.3 or newer include - , which chokes if dcgettext is defined as a macro. So include - it now, to make later inclusions of a NOP. */ -#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) -# include -# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H -# include -# endif -#endif - -/* Disabled NLS. - The casts to 'const char *' serve the purpose of producing warnings - for invalid uses of the value returned from these functions. - On pre-ANSI systems without 'const', the config.h file is supposed to - contain "#define const". */ -# undef gettext -# define gettext(Msgid) ((const char *) (Msgid)) -# undef dgettext -# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) -# undef dcgettext -# define dcgettext(Domainname, Msgid, Category) \ - ((void) (Category), dgettext (Domainname, Msgid)) -# undef ngettext -# define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 \ - ? ((void) (Msgid2), (const char *) (Msgid1)) \ - : ((void) (Msgid1), (const char *) (Msgid2))) -# undef dngettext -# define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) -# undef dcngettext -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) -# undef textdomain -# define textdomain(Domainname) ((const char *) (Domainname)) -# undef bindtextdomain -# define bindtextdomain(Domainname, Dirname) \ - ((void) (Domainname), (const char *) (Dirname)) -# undef bind_textdomain_codeset -# define bind_textdomain_codeset(Domainname, Codeset) \ - ((void) (Domainname), (const char *) (Codeset)) - -#endif - -/* A pseudo function call that serves as a marker for the automated - extraction of messages, but does not call gettext(). The run-time - translation is done at a different place in the code. - The argument, String, should be a literal string. Concatenated strings - and other string expressions won't work. - The macro's expansion is not parenthesized, so that it is suitable as - initializer for static 'char[]' or 'const char[]' variables. */ -#define gettext_noop(String) String - -/* The separator between msgctxt and msgid in a .mo file. */ -#define GETTEXT_CONTEXT_GLUE "\004" - -/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a - MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be - short and rarely need to change. - The letter 'p' stands for 'particular' or 'special'. */ -#ifdef DEFAULT_TEXT_DOMAIN -# define pgettext(Msgctxt, Msgid) \ - pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) -#else -# define pgettext(Msgctxt, Msgid) \ - pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) -#endif -#define dpgettext(Domainname, Msgctxt, Msgid) \ - pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) -#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ - pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) -#ifdef DEFAULT_TEXT_DOMAIN -# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) -#else -# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) -#endif -#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) -#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ - npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) - -#ifdef __GNUC__ -__inline -#else -#ifdef __cplusplus -inline -#endif -#endif -static const char * -pgettext_aux (const char *domain, - const char *msg_ctxt_id, const char *msgid, - int category) -{ - const char *translation = dcgettext (domain, msg_ctxt_id, category); - if (translation == msg_ctxt_id) - return msgid; - else - return translation; -} - -#ifdef __GNUC__ -__inline -#else -#ifdef __cplusplus -inline -#endif -#endif -static const char * -npgettext_aux (const char *domain, - const char *msg_ctxt_id, const char *msgid, - const char *msgid_plural, unsigned long int n, - int category) -{ - const char *translation = - dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); - if (translation == msg_ctxt_id || translation == msgid_plural) - return (n == 1 ? msgid : msgid_plural); - else - return translation; -} - -/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID - can be arbitrary expressions. But for string literals these macros are - less efficient than those above. */ - -#include - -#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ - (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ - /* || __STDC_VERSION__ >= 199901L */ ) - -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS -#include -#endif - -#define pgettext_expr(Msgctxt, Msgid) \ - dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) -#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ - dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) - -#ifdef __GNUC__ -__inline -#else -#ifdef __cplusplus -inline -#endif -#endif -static const char * -dcpgettext_expr (const char *domain, - const char *msgctxt, const char *msgid, - int category) -{ - size_t msgctxt_len = strlen (msgctxt) + 1; - size_t msgid_len = strlen (msgid) + 1; - const char *translation; -#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - char msg_ctxt_id[msgctxt_len + msgid_len]; -#else - char buf[1024]; - char *msg_ctxt_id = - (msgctxt_len + msgid_len <= sizeof (buf) - ? buf - : (char *) malloc (msgctxt_len + msgid_len)); - if (msg_ctxt_id != NULL) -#endif - { - memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); - msg_ctxt_id[msgctxt_len - 1] = '\004'; - memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); - translation = dcgettext (domain, msg_ctxt_id, category); -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - if (msg_ctxt_id != buf) - free (msg_ctxt_id); -#endif - if (translation != msg_ctxt_id) - return translation; - } - return msgid; -} - -#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ - dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) -#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ - dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) - -#ifdef __GNUC__ -__inline -#else -#ifdef __cplusplus -inline -#endif -#endif -static const char * -dcnpgettext_expr (const char *domain, - const char *msgctxt, const char *msgid, - const char *msgid_plural, unsigned long int n, - int category) -{ - size_t msgctxt_len = strlen (msgctxt) + 1; - size_t msgid_len = strlen (msgid) + 1; - const char *translation; -#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - char msg_ctxt_id[msgctxt_len + msgid_len]; -#else - char buf[1024]; - char *msg_ctxt_id = - (msgctxt_len + msgid_len <= sizeof (buf) - ? buf - : (char *) malloc (msgctxt_len + msgid_len)); - if (msg_ctxt_id != NULL) -#endif - { - memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); - msg_ctxt_id[msgctxt_len - 1] = '\004'; - memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); - translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - if (msg_ctxt_id != buf) - free (msg_ctxt_id); -#endif - if (!(translation == msg_ctxt_id || translation == msgid_plural)) - return translation; - } - return (n == 1 ? msgid : msgid_plural); -} - -#endif /* _LIBGETTEXT_H */ diff --git a/src/eulogium b/src/eulogium new file mode 100755 index 0000000..e6223a7 Binary files /dev/null and b/src/eulogium differ diff --git a/src/eulogium.c b/src/eulogium.c new file mode 100644 index 0000000..bbe259c --- /dev/null +++ b/src/eulogium.c @@ -0,0 +1,61 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#include "gettext.h" + +#define COPYRIGHT "Copyright © 2015 oliver and various contributors (see AUTHORS)." + +int main(int argc EINA_UNUSED, char **argv EINA_UNUSED) +{ +#if 0 + Eina_Bool quit_option = EINA_FALSE; + int args; + static const Ecore_Getopt optdesc = { + "eulogium", + "%prog [options]", + PACKAGE_VERSION, + COPYRIGHT, + "Affero GPLv3", + "eulogium program", + 0, + { + ECORE_GETOPT_LICENSE('L', "license"), + ECORE_GETOPT_COPYRIGHT('C', "copyright"), + ECORE_GETOPT_VERSION('V', "version"), + ECORE_GETOPT_HELP('h', "help"), + ECORE_GETOPT_SENTINEL + } + }; + + + Ecore_Getopt_Value values[] = { + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_BOOL(quit_option), + ECORE_GETOPT_VALUE_NONE + }; + args = ecore_getopt_parse(&optdesc, values, argc, argv); +#endif + +#if ENABLE_NLS + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + bind_textdomain_codeset(PACKAGE, "UTF-8"); + textdomain(PACKAGE); +#endif + + eina_init(); + + EINA_LOG_CRIT("Could not parse arguments."); + + eina_shutdown(); + + return 0; +} diff --git a/src/gettext.h b/src/gettext.h new file mode 100644 index 0000000..e76b592 --- /dev/null +++ b/src/gettext.h @@ -0,0 +1,280 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling + textdomain(), and is useful for libraries. */ +# ifdef DEFAULT_TEXT_DOMAIN +# undef gettext +# define gettext(Msgid) \ + dgettext (DEFAULT_TEXT_DOMAIN, Msgid) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +# endif + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +#if defined(__sun) +# include +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# undef gettext +# define gettext(Msgid) ((const char *) (Msgid)) +# undef dgettext +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# undef dcgettext +# define dcgettext(Domainname, Msgid, Category) \ + ((void) (Category), dgettext (Domainname, Msgid)) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 \ + ? ((void) (Msgid2), (const char *) (Msgid1)) \ + : ((void) (Msgid1), (const char *) (Msgid2))) +# undef dngettext +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# undef dcngettext +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) +# undef textdomain +# define textdomain(Domainname) ((const char *) (Domainname)) +# undef bindtextdomain +# define bindtextdomain(Domainname, Dirname) \ + ((void) (Domainname), (const char *) (Dirname)) +# undef bind_textdomain_codeset +# define bind_textdomain_codeset(Domainname, Codeset) \ + ((void) (Domainname), (const char *) (Codeset)) + +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +/* The separator between msgctxt and msgid in a .mo file. */ +#define GETTEXT_CONTEXT_GLUE "\004" + +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be + short and rarely need to change. + The letter 'p' stands for 'particular' or 'special'. */ +#ifdef DEFAULT_TEXT_DOMAIN +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#else +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#endif +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#ifdef DEFAULT_TEXT_DOMAIN +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#else +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#endif +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +pgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + int category) +{ + const char *translation = dcgettext (domain, msg_ctxt_id, category); + if (translation == msg_ctxt_id) + return msgid; + else + return translation; +} + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +npgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + const char *translation = + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + if (translation == msg_ctxt_id || translation == msgid_plural) + return (n == 1 ? msgid : msgid_plural); + else + return translation; +} + +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID + can be arbitrary expressions. But for string literals these macros are + less efficient than those above. */ + +#include + +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) + +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS +#include +#endif + +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext (domain, msg_ctxt_id, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (translation != msg_ctxt_id) + return translation; + } + return msgid; +} + +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcnpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (!(translation == msg_ctxt_id || translation == msgid_plural)) + return translation; + } + return (n == 1 ? msgid : msgid_plural); +} + +#endif /* _LIBGETTEXT_H */ diff --git a/src/lib/Eulogium.h b/src/lib/Eulogium.h deleted file mode 100644 index 7ef7c0d..0000000 --- a/src/lib/Eulogium.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef EULOGIUM_H_ -# define EULOGIUM_H_ - -#include - -#ifdef EAPI -# undef EAPI -#endif - -#ifdef _WIN32 -# ifdef EFL_EULOGIUM_BUILD -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) -# else -# define EAPI -# endif /* ! DLL_EXPORT */ -# else -# define EAPI __declspec(dllimport) -# endif /* ! EFL_EULOGIUM_BUILD */ -#else -# ifdef __GNUC__ -# if __GNUC__ >= 4 -# define EAPI __attribute__ ((visibility("default"))) -# else -# define EAPI -# endif -# else -# define EAPI -# endif -#endif /* ! _WIN32 */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file - * @brief These routines are used for Eulogium library interaction. - */ - -/** - * @brief Init / shutdown functions. - * @defgroup Init Init / Shutdown - * - * @{ - * - * Functions of obligatory usage, handling proper initialization - * and shutdown routines. - * - * Before the usage of any other function, Eulogium should be properly - * initialized with @ref eulogium_init() and the last call to Eulogium's - * functions should be @ref eulogium_shutdown(), so everything will - * be correctly freed. - * - * Eulogium logs everything with Eina Log, using the "eulogium" log domain. - * - */ - -/** - * Initialize Eulogium. - * - * Initializes Eulogium, its dependencies and modules. Should be the first - * function of Eulogium to be called. - * - * @return The init counter value. - * - * @see eulogium_shutdown(). - * - * @ingroup Init - */ -EAPI int eulogium_init(void); - -/** - * Shutdown Eulogium - * - * Shutdown Eulogium. If init count reaches 0, all the internal structures will - * be freed. Any Eulogium library call after this point will leads to an error. - * - * @return Eulogium's init counter value. - * - * @see eulogium_init(). - * - * @ingroup Init - */ -EAPI int eulogium_shutdown(void); - -/** - * @} - */ - -/** - * @brief Main group API that wont do anything - * @defgroup Main Main - * - * @{ - * - * @brief A function that doesn't do any good nor any bad - * - * @ingroup Main - */ -EAPI void eulogium_library_call(void); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* EULOGIUM_H_ */ diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am deleted file mode 100644 index 56d5c22..0000000 --- a/src/lib/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -AM_CPPFLAGS = \ --I$(top_srcdir)/src/lib \ --I$(top_builddir)/src/lib \ --DPACKAGE_LIB_DIR=\"$(libdir)\" \ --DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -@EFL_CFLAGS@ \ --DEFL_EFL_BUILD - -lib_LTLIBRARIES = libeulogium.la - -includes_HEADERS = Eulogium.h -includesdir = $(includedir)/eulogium-@VMAJ@ - -libeulogium_la_SOURCES = eulogium.c -libeulogium_la_LIBADD = @EFL_LIBS@ -lm -libeulogium_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ diff --git a/src/lib/eulogium.c b/src/lib/eulogium.c deleted file mode 100644 index 8e19356..0000000 --- a/src/lib/eulogium.c +++ /dev/null @@ -1,64 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "Eulogium.h" - -#include "eulogium_private.h" - -static int _eulogium_init = 0; -int _eulogium_lib_log_dom = -1; - -EAPI int -eulogium_init(void) -{ - _eulogium_init++; - if (_eulogium_init > 1) return _eulogium_init; - - eina_init(); - - _eulogium_lib_log_dom = eina_log_domain_register("eulogium", EINA_COLOR_CYAN); - if (_eulogium_lib_log_dom < 0) - { - EINA_LOG_ERR("Eulogium can not create its log domain."); - goto shutdown_eina; - } - - // Put here your initialization logic of your library - - eina_log_timing(_eulogium_lib_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); - - return _eulogium_init; - - shutdown_eina: - eina_shutdown(); - _eulogium_init--; - - return _eulogium_init; -} - -EAPI int -eulogium_shutdown(void) -{ - _eulogium_init--; - if (_eulogium_init != 0) return _eulogium_init; - - eina_log_timing(_eulogium_lib_log_dom, - EINA_LOG_STATE_START, - EINA_LOG_STATE_SHUTDOWN); - - // Put here your shutdown logic - - eina_log_domain_unregister(_eulogium_lib_log_dom); - _eulogium_lib_log_dom = -1; - - eina_shutdown(); - - return _eulogium_init; -} - -EAPI void -eulogium_library_call(void) -{ - INF("Not really doing anything useful."); -} diff --git a/src/lib/eulogium_private.h b/src/lib/eulogium_private.h deleted file mode 100644 index ff03439..0000000 --- a/src/lib/eulogium_private.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef EULOGIUM_PRIVATE_H -# define EULOGIUM_PRIVATE_H - -extern int _eulogium_lib_log_dom; - -#ifdef ERR -# undef ERR -#endif -#define ERR(...) EINA_LOG_DOM_ERR(_eulogium_lib_log_dom, __VA_ARGS__) -#ifdef INF -# undef INF -#endif -#define INF(...) EINA_LOG_DOM_INFO(_eulogium_lib_log_dom, __VA_ARGS__) -#ifdef WRN -# undef WRN -#endif -#define WRN(...) EINA_LOG_DOM_WARN(_eulogium_lib_log_dom, __VA_ARGS__) -#ifdef CRIT -# undef CRIT -#endif -#define CRIT(...) EINA_LOG_DOM_CRIT(_eulogium_lib_log_dom, __VA_ARGS__) -#ifdef DBG -# undef DBG -#endif -#define DBG(...) EINA_LOG_DOM_DBG(_eulogium_lib_log_dom, __VA_ARGS__) - -#endif -- cgit v0.12