summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Middelschulte <leif.middelschulte@gmail.com>2014-04-05 03:11:43 +0200
committerLeif Middelschulte <leif.middelschulte@gmail.com>2014-04-05 03:11:43 +0200
commit33614438539126474046bb20724db37f139d42e9 (patch)
treedc54052c5a867a3a6c835be95399635a6d2d8cfd
Welcome Espresso
-rw-r--r--AUTHORS1
-rw-r--r--COPYING32
-rw-r--r--COPYING-PLAIN33
-rw-r--r--ChangeLog2
-rw-r--r--INSTALL11
-rw-r--r--Makefile.am45
-rw-r--r--NEWS0
-rw-r--r--README3
-rwxr-xr-xautogen.sh17
-rw-r--r--configure.ac76
-rw-r--r--e-module-espresso.edc1
-rw-r--r--e_modules-espresso.spec.in48
-rw-r--r--espresso.edc55
-rw-r--r--images.LICENSE21
-rw-r--r--images/module_icon.pngbin0 -> 723 bytes
-rw-r--r--images/module_icon_off.pngbin0 -> 721 bytes
-rw-r--r--images/module_icon_on.pngbin0 -> 723 bytes
-rw-r--r--m4/.svnignore0
-rw-r--r--m4/ac_attribute.m447
-rw-r--r--module.desktop.in7
-rw-r--r--po/LINGUAS1
-rw-r--r--po/Makevars41
-rw-r--r--po/POTFILES.in2
-rw-r--r--po/de.po26
-rw-r--r--src/Makefile.am20
-rw-r--r--src/e_mod_main.c307
-rw-r--r--src/e_mod_main.h28
27 files changed, 824 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..7c4847a
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
Originally by Vincent 'caro' Torri, additions by various Enlightenment developers
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..9690c3f
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,32 @@
1
2Permission is hereby granted, free of charge, to any person obtaining a copy
3of this software and associated documentation files (the "Software"), to
4deal in the Software without restriction, including without limitation the
5rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6sell copies of the Software, and to permit persons to whom the Software is
7furnished to do so, subject to the following conditions:
8
9The above copyright notice and this permission notice shall be included in
10all copies of the Software and its Copyright notices. In addition publicly
11documented acknowledgment must be given that this software has been used if no
12source code of this software is made available publicly. Making the source
13available publicly means including the source for this software with the
14distribution, or a method to get this software via some reasonable mechanism
15(electronic transfer via a network or media) as well as making an offer to
16supply the source on request. This Copyright notice serves as an offer to
17supply the source on on request as well. Instead of this, supplying
18acknowledgments of use of this software in either Copyright notices, Manuals,
19Publicity and Marketing documents or any documentation provided with any
20product containing this software. This License does not apply to any software
21that links to the libraries provided by this software (statically or
22dynamically), but only to the software provided.
23
24Please see the COPYING-PLAIN for a plain-english explanation of this notice
25and its intent.
26
27THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
30THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
31IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/COPYING-PLAIN b/COPYING-PLAIN
new file mode 100644
index 0000000..b8e40d7
--- /dev/null
+++ b/COPYING-PLAIN
@@ -0,0 +1,33 @@
1Plain English Copyright Notice
2
3This file is not intended to be the actual License. The reason this file
4exists is that we here are programmers and engineers. We aren't lawyers. We
5provide licenses that we THINK say the right things, but we have our own
6intentions at heart. This is a plain-english explanation of what those
7intentions are, and if you follow them you will be within the "spirit" of
8the license.
9
10The intent is for us to enjoy writing software that is useful to us (the
11AUTHORS) and allow others to use it freely and also benefit from the work we
12put into making it. We don't want to restrict others using it. They should
13not *HAVE* to make the source code of the applications they write that
14simply link to these libraries (be that statically or dynamically), or for
15them to be limited as to what license they choose to use (be it open, closed
16or anything else). But we would like to know you are using these libraries.
17We simply would like to know that it has been useful to someone. This is why
18we ask for acknowledgement of some sort.
19
20You can do what you want with the source of this software - it doesn't
21matter. We still have it here for ourselves and it is open and free to use
22and download and play with. It can't be taken away. We don't really mind what
23you do with the source to your software. We would simply like to know that
24you are using it - especially if it makes it to a commerical product. If you
25simply e-mail all the AUTHORS (see COPYING and AUTHORS files) telling us, and
26then make sure you include a paragraph or page in the manual for the product
27with the copyright notice and state that you used this software, we will be
28very happy. If you want to contribute back modifications and fixes you may have
29made we will welcome those too with open arms (generally). If you want help
30with changes needed, ports needed or features to be added, arrangements can
31be easily made with some dialogue.
32
33Christopher Michael <devilhorns@comcast.net>
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..ffdfa1b
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,2 @@
109/06/2005 Christopher Michael <devilhorns@comcast.net>
2 * Added Support For Virtual Desktops
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..8919fc2
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,11 @@
1COMPILING and INSTALLING:
2
3If you got a official release tar archive do:
4 ./autogen.sh
5
6Then to compile:
7 make
8
9To install:
10 make install
11
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..2c1d4fa
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,45 @@
1ACLOCAL_AMFLAGS = -I m4
2
3MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
4 config.sub configure depcomp install-sh ltmain.sh \
5 missing module.desktop config.rpath mkinstalldirs \
6 ABOUT-NLS* m4/libtool.m4 m4/lt~obsolete.m4 \
7 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
8 m4/codeset.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 \
9 m4/intdiv0.m4 m4/inttypes_h.m4 m4/inttypes.m4 \
10 m4/inttypes-pri.m4 m4/isc-posix.m4 m4/lcmessage.m4 \
11 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 \
12 m4/nls.m4 m4/po.m4 m4/progtest.m4 m4/stdint_h.m4 \
13 m4/uintmax_t.m4 m4/ulonglong.m4 m4/intmax.m4 \
14 m4/longdouble.m4 m4/longlong.m4 m4/printf-posix.m4 \
15 m4/signed.m4 m4/size_max.m4 m4/wchar_t.m4 \
16 m4/wint_t.m4 m4/xsize.m4
17
18SUBDIRS = src
19
20if HAVE_PO
21
22SUBDIRS += po
23
24endif
25
26EDJE_FLAGS = -v \
27 -id $(top_srcdir)/images
28
29filesdir = $(datadir)
30files_DATA = module.desktop e-module-espresso.edj espresso.edj
31
32EXTRA_DIST = module.desktop.in \
33 e_modules-espresso.spec.in \
34 e-module-espresso.edc \
35 espresso.edc \
36 $(wildcard images/*.png)
37
38%.edj: %.edc
39 $(EDJE_CC) $(EDJE_FLAGS) $< $@
40
41clean-local:
42 rm -rf e-module-espresso.edj espresso.edj module.desktop e_modules-espresso.spec *~
43
44uninstall:
45 rm -rf $(DESTDIR)$(datadir)
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..718430f
--- /dev/null
+++ b/README
@@ -0,0 +1,3 @@
1Espresso is a simple presentation mode toggle.
2It enables the presentation mode temporaly for a configurable amount of time.
3The presentation mode itself is emediately toggleble by clicking the icon on the shelf. \ No newline at end of file
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..ae01364
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,17 @@
1#!/bin/sh
2
3rm -rf autom4te.cache
4rm -f aclocal.m4 ltmain.sh
5
6touch README
7
8echo "Running autopoint..." ; autopoint -f || :
9echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1
10echo "Running autoheader..." ; autoheader || exit 1
11echo "Running autoconf..." ; autoconf || exit 1
12echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
13echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
14
15if [ -z "$NOCONFIGURE" ]; then
16 ./configure "$@"
17fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..0dbb6c2
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,76 @@
1dnl Process this file with autoconf to produce a configure script.
2
3# get rid of that stupid cache mechanism
4rm -f config.cache
5
6AC_INIT(espresso, 0.0.1, leif.middelschulte@gmail.com)
7AC_PREREQ(2.52)
8AC_CONFIG_SRCDIR(configure.ac)
9AC_CANONICAL_BUILD
10AC_CANONICAL_HOST
11AC_ISC_POSIX
12
13AM_INIT_AUTOMAKE(1.6)
14AC_CONFIG_HEADERS(config.h)
15m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
16
17AC_PROG_CC
18AC_HEADER_STDC
19AC_HEADER_TIME
20AC_CHECK_HEADERS(sys/time.h locale.h)
21AC_C_CONST
22AC_C___ATTRIBUTE__
23
24define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
25define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
26AC_PROG_LIBTOOL
27
28m4_ifdef([AM_GNU_GETTEXT_VERSION], [
29AM_GNU_GETTEXT_VERSION([0.14])
30])
31
32m4_ifdef([AM_GNU_GETTEXT], [
33AM_GNU_GETTEXT([external])
34po_makefile_in=po/Makefile.in
35AM_CONDITIONAL([HAVE_PO], [true])
36],[
37AM_CONDITIONAL([HAVE_PO], [false])
38])
39AC_SUBST(LTLIBINTL)
40
41PKG_CHECK_MODULES(E, [enlightenment])
42release=$(pkg-config --variable=release enlightenment)
43MODULE_ARCH="$host_os-$host_cpu-$release"
44AC_SUBST(MODULE_ARCH)
45AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
46
47# Find edje_cc
48PKG_CHECK_MODULES(EDJE, [edje >= 0.5.0])
49AC_ARG_WITH(edje-cc,
50 AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc]),
51 [
52 v=$withval;
53 EDJE_CC=$v
54 ],[
55 EDJE_CC=$(pkg-config --variable=prefix edje)/bin/edje_cc
56 ]
57)
58AC_SUBST(EDJE_CC)
59AC_MSG_CHECKING([Which edje_cc to use])
60AC_MSG_RESULT(${EDJE_CC})
61
62datadir=$(pkg-config --variable=modules enlightenment)/${PACKAGE}
63AC_ARG_ENABLE(homedir-install,
64 AS_HELP_STRING([--enable-homedir-install], [Install module in homedir]),
65 [ datadir="${HOME}/.e/e/modules/${PACKAGE}" ]
66)
67
68AC_OUTPUT([
69Makefile
70src/Makefile
71e_modules-espresso.spec
72module.desktop
73$po_makefile_in
74], [
75])
76
diff --git a/e-module-espresso.edc b/e-module-espresso.edc
new file mode 100644
index 0000000..58d1340
--- /dev/null
+++ b/e-module-espresso.edc
@@ -0,0 +1 @@
images { image: module_icon.png COMP; } collections { group {name: icon; max: 128 128; parts { part { name: image; mouse_events: 0; description { state: default 0.0; aspect: 1.0 1.0; image.normal: module_icon.png; } } } } }
diff --git a/e_modules-espresso.spec.in b/e_modules-espresso.spec.in
new file mode 100644
index 0000000..3cc4b07
--- /dev/null
+++ b/e_modules-espresso.spec.in
@@ -0,0 +1,48 @@
1%define module_name espresso
2%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}}
3
4Summary: %{module_name} module for the Enlightenment window manager
5Name: e_modules-%{module_name}
6Version: @VERSION@
7Release: %{_rel}
8License: BSD
9Group: User Interface/Desktops
10URL: http://www.enlightenment.org/
11Source: ftp://ftp.enlightenment.org/pub/enlightenment/%{module_name}-%{version}.tar.gz
12Packager: %{?_packager:%{_packager}}%{!?_packager:Michael Jennings <mej@eterm.org>}
13Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:The Enlightenment Project (http://www.enlightenment.org/)}
14Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
15BuildRequires: ecore-devel, evas-devel, edje-bin
16BuildRequires: edje-devel, eet-devel, enlightenment-devel >= 0.19.999
17Requires: enlightenment >= 0.16.999
18BuildRoot: %{_tmppath}/%{name}-%{version}-root
19
20%description
21%{module_name} module for the Enlightenment window manager.
22
23%prep
24%setup -q -n %{module_name}-%{version}
25
26%build
27%{configure}
28%{__make} %{?_smp_mflags} %{?mflags}
29
30%install
31%{__make} %{?mflags_install} DESTDIR=$RPM_BUILD_ROOT install
32%{find_lang} %{module_name} || true > %{module_name}.lang
33
34%clean
35test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT
36
37%post
38/sbin/ldconfig
39
40%postun
41/sbin/ldconfig
42
43%files -f %{module_name}.lang
44%defattr(-, root, root)
45%doc AUTHORS ChangeLog COPYING* INSTALL NEWS README
46%{_libdir}/enlightenment/modules/%{module_name}*
47
48%changelog
diff --git a/espresso.edc b/espresso.edc
new file mode 100644
index 0000000..963022e
--- /dev/null
+++ b/espresso.edc
@@ -0,0 +1,55 @@
1collections
2{
3 images
4 {
5 image: "module_icon_on.png" COMP;
6 image: "module_icon_off.png" COMP;
7 }
8 group
9 {
10 name: "modules/espresso/main";
11 parts
12 {
13 part
14 {
15 name: "espresso";
16 type: IMAGE;
17 mouse_events: 1;
18 description
19 {
20 state: "default" 0.0;
21 align: 0.5 0.5;
22 image.normal: "module_icon_off.png";
23 min: 32 32;
24 aspect_preference: SOURCE;
25 }
26 description
27 {
28 state: "off" 0.0;
29 inherit: "default" 0.0;
30 image.normal: "module_icon_on.png";
31 }
32 }
33 }
34 /* Close Parts */
35 programs
36 {
37 program
38 {
39 name: "default";
40 signal: "off";
41 source: "e";
42 action: STATE_SET "default" 0.0;
43 target: "espresso";
44 }
45 program
46 {
47 name: "coffee_on";
48 signal: "on";
49 source: "e";
50 action: STATE_SET "off" 0.0;
51 target: "espresso";
52 }
53 }
54 }
55}
diff --git a/images.LICENSE b/images.LICENSE
new file mode 100644
index 0000000..f4a7107
--- /dev/null
+++ b/images.LICENSE
@@ -0,0 +1,21 @@
1The MIT License (MIT)
2
3Copyright (c) 2013 Drifty (http://drifty.com/)
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21THE SOFTWARE.
diff --git a/images/module_icon.png b/images/module_icon.png
new file mode 100644
index 0000000..6ec9499
--- /dev/null
+++ b/images/module_icon.png
Binary files differ
diff --git a/images/module_icon_off.png b/images/module_icon_off.png
new file mode 100644
index 0000000..f1dda37
--- /dev/null
+++ b/images/module_icon_off.png
Binary files differ
diff --git a/images/module_icon_on.png b/images/module_icon_on.png
new file mode 100644
index 0000000..6ec9499
--- /dev/null
+++ b/images/module_icon_on.png
Binary files differ
diff --git a/m4/.svnignore b/m4/.svnignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/m4/.svnignore
diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4
new file mode 100644
index 0000000..23479a9
--- /dev/null
+++ b/m4/ac_attribute.m4
@@ -0,0 +1,47 @@
1dnl Copyright (C) 2004-2008 Kim Woelders
2dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
3dnl That code is public domain and can be freely used or copied.
4dnl Originally snatched from somewhere...
5
6dnl Macro for checking if the compiler supports __attribute__
7
8dnl Usage: AC_C___ATTRIBUTE__
9dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
10dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
11dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
12dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
13dnl defined to nothing.
14
15AC_DEFUN([AC_C___ATTRIBUTE__],
16[
17
18AC_MSG_CHECKING([for __attribute__])
19
20AC_CACHE_VAL([ac_cv___attribute__],
21 [AC_TRY_COMPILE(
22 [
23#include <stdlib.h>
24
25int func(int x);
26int foo(int x __attribute__ ((unused)))
27{
28 exit(1);
29}
30 ],
31 [],
32 [ac_cv___attribute__="yes"],
33 [ac_cv___attribute__="no"]
34 )])
35
36AC_MSG_RESULT($ac_cv___attribute__)
37
38if test "x${ac_cv___attribute__}" = "xyes" ; then
39 AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
40 AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
41 else
42 AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
43fi
44
45])
46
47dnl End of ac_attribute.m4
diff --git a/module.desktop.in b/module.desktop.in
new file mode 100644
index 0000000..d81d87d
--- /dev/null
+++ b/module.desktop.in
@@ -0,0 +1,7 @@
1[Desktop Entry]
2Encoding=UTF-8
3Type=Link
4Name=Espresso
5Comment=Toggles presentation mode.
6Icon=e-module-espresso
7X-Enlightenment-ModuleType=utils
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..7673daa
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1 @@
de
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..9275c25
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,41 @@
1# Makefile variables for PO directory in any package using GNU gettext.
2
3# Usually the message domain is the same as the package name.
4DOMAIN = $(PACKAGE)
5
6# These two variables depend on the location of this directory.
7subdir = po
8top_builddir = ..
9
10# These options get passed to xgettext.
11XGETTEXT_OPTIONS = --keyword=N_ --keyword=D_ --from-code=UTF-8 --foreign-user
12
13# This is the copyright holder that gets inserted into the header of the
14# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
15# package. (Note that the msgstr strings, extracted from the package's
16# sources, belong to the copyright holder of the package.) Translators are
17# expected to transfer the copyright for their translations to this person
18# or entity, or to disclaim their copyright. The empty string stands for
19# the public domain; in this case the translators are expected to disclaim
20# their copyright.
21COPYRIGHT_HOLDER = Enlightenment development team
22
23# This is the email address or URL to which the translators shall report
24# bugs in the untranslated strings:
25# - Strings which are not entire sentences, see the maintainer guidelines
26# in the GNU gettext documentation, section 'Preparing Strings'.
27# - Strings which use unclear terms or require additional context to be
28# understood.
29# - Strings which make invalid assumptions about notation of date, time or
30# money.
31# - Pluralisation problems.
32# - Incorrect English spelling.
33# - Incorrect formatting.
34# It can be your email address, or a mailing list address where translators
35# can write to without being subscribed, or the URL of a web page through
36# which the translators can contact you.
37MSGID_BUGS_ADDRESS = enlightenment-devel@lists.sourceforge.net
38
39# This is the list of locale categories, beyond LC_MESSAGES, for which the
40# message catalogs shall be used. It is usually empty.
41EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..9a03bb8
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,2 @@
1src/e_mod_main.c
2src/e_mod_main.h
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..3dafbef
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,26 @@
1# translation of espresso.
2# Copyright (C) 2008 Enlightenment development team
3# This file is distributed under the same license as the espresso package.
4# Andreas Volz <andreas.volz@tux-style.de>, 2008.
5# MixCool <lars.thoms@mixcool.de>, 2009.
6# Fabian Nowak <timystery@arcor.de>, 2010.
7#
8#
9msgid ""
10msgstr ""
11"Project-Id-Version: espresso 0.0.1\n"
12"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
13"POT-Creation-Date: 2014-04-05 02:28+0200\n"
14"PO-Revision-Date: 2009-11-07 18:19+0000\n"
15"Last-Translator: Fabian Nowak <timystery@arcor.de>\n"
16"Language-Team: German\n"
17"Language: \n"
18"MIME-Version: 1.0\n"
19"Content-Type: text/plain; charset=UTF-8\n"
20"Content-Transfer-Encoding: 8bit\n"
21"X-Launchpad-Export-Date: 2009-11-12 04:52+0000\n"
22"X-Generator: Launchpad (build Unknown)\n"
23
24#: src/e_mod_main.c:125
25msgid "Espresso"
26msgstr "Espresso"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..d5b9527
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,20 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3ACLOCAL_AMFLAGS = -I m4
4
5INCLUDES = -I. \
6 -I$(top_srcdir) \
7 -I$(includedir) \
8 @E_CFLAGS@
9
10pkgdir = $(datadir)/$(MODULE_ARCH)
11pkg_LTLIBRARIES = module.la
12module_la_SOURCES = e_mod_main.c \
13 e_mod_main.h
14
15module_la_LIBADD = @E_LIBS@
16module_la_LDFLAGS = -module -avoid-version
17module_la_DEPENDENCIES = $(top_builddir)/config.h
18
19clean-local:
20 rm -rf *~
diff --git a/src/e_mod_main.c b/src/e_mod_main.c
new file mode 100644
index 0000000..4dd9989
--- /dev/null
+++ b/src/e_mod_main.c
@@ -0,0 +1,307 @@
1#include <e.h>
2#include "e_mod_main.h"
3#if TIME_WITH_SYS_TIME
4# include <sys/time.h>
5# include <time.h>
6#else
7# if HAVE_SYS_TIME_H
8# include <sys/time.h>
9# else
10# include <time.h>
11# endif
12#endif
13#if HAVE_LOCALE_H
14# include <locale.h>
15#endif
16
17// default timeout in minutes
18#define DEFAULT_TIMEOUT 20
19
20/* Func Proto Requirements for Gadcon */
21static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
22static void _gc_shutdown(E_Gadcon_Client *gcc);
23static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__);
24static const char *_gc_label(const E_Gadcon_Client_Class *client_class __UNUSED__);
25static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas);
26static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED);
27
28/* Module Protos */
29static void _espresso_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info);
30static void _espresso_menu_cb_timeout_set(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__);
31static void _espresso_menu_cb_post(void *data __UNUSED__, E_Menu *m __UNUSED__);
32static Eina_Bool _espresso_cb_timeout(void *data __UNUSED__);
33
34static E_Config_DD *conf_edd = NULL;
35static Ecore_Timer *coffee_timer;
36
37Config *espresso_config = NULL;
38
39/* Define the class and gadcon functions this module provides */
40static const E_Gadcon_Client_Class _gc_class =
41{
42 GADCON_CLIENT_CLASS_VERSION, "Espresso",
43 { _gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new,
44 NULL, NULL },
45 E_GADCON_CLIENT_STYLE_PLAIN
46};
47
48typedef struct _Instance Instance;
49struct _Instance
50{
51 E_Gadcon_Client *gcc;
52 Evas_Object *espresso, *o_tip;
53 E_Gadcon_Popup *tip;
54};
55
56typedef struct _Timer_Data Timer_Data;
57struct _Timer_Data
58{
59 int minutes;
60 Instance *inst;
61};
62
63static void _presentation_enable(Instance *inst, Eina_Bool enable);
64static void _espresso_config_updated(Instance *inst);
65
66static E_Gadcon_Client *
67_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
68{
69 Evas_Object *o;
70 E_Gadcon_Client *gcc;
71 Instance *inst;
72 char buf[PATH_MAX];
73
74 inst = E_NEW(Instance, 1);
75
76 o = edje_object_add(gc->evas);
77 snprintf(buf, sizeof(buf), "%s/espresso.edj", espresso_config->mod_dir);
78 if (!e_theme_edje_object_set(o, "base/theme/modules/espresso",
79 "modules/espresso/main"))
80 edje_object_file_set(o, buf, "modules/espresso/main");
81 evas_object_show(o);
82
83 gcc = e_gadcon_client_new(gc, name, id, style, o);
84 gcc->data = inst;
85 inst->gcc = gcc;
86 inst->espresso = o;
87
88 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
89 _espresso_cb_mouse_down, inst);
90
91 _presentation_enable(inst, e_config->mode.presentation);
92
93 return gcc;
94}
95
96static void
97_gc_shutdown(E_Gadcon_Client *gcc)
98{
99 Instance *inst;
100
101 if (!(inst = gcc->data)) return;
102
103 evas_object_event_callback_del(inst->espresso, EVAS_CALLBACK_MOUSE_DOWN,
104 _espresso_cb_mouse_down);
105
106 if (inst->espresso) evas_object_del(inst->espresso);
107
108 E_FREE(inst);
109}
110
111static void
112_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
113{
114 Instance *inst;
115 Evas_Coord mw;
116
117 if (!(inst = gcc->data)) return;
118 edje_object_size_min_calc(inst->espresso, &mw, NULL);
119 e_gadcon_client_min_size_set(gcc, mw, 16);
120}
121
122static const char *
123_gc_label(const E_Gadcon_Client_Class *client_class __UNUSED__)
124{
125 return D_("Espresso");
126}
127
128static Evas_Object *
129_gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
130{
131 Evas_Object *o;
132 char buf[PATH_MAX];
133
134 o = edje_object_add (evas);
135 snprintf(buf, sizeof(buf), "%s/e-module-espresso.edj", espresso_config->mod_dir);
136 edje_object_file_set(o, buf, "icon");
137 return o;
138}
139
140static const char *
141_gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED)
142{
143 return "espresso.1";
144}
145
146static void
147_espresso_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
148{
149 Instance *inst;
150 Evas_Event_Mouse_Down *ev;
151
152 inst = data;
153 ev = event_info;
154 if ((ev->button == 3) && (!espresso_config->menu))
155 {
156 E_Menu *m;
157 E_Menu_Item *mi;
158 Timer_Data *td = NULL;
159 int x = 0, y = 0;
160 m = e_menu_new();
161
162#define ADD_MENU_ITEM(label, timeout) \
163 td = E_NEW(Timer_Data, 1); \
164 td->minutes = timeout; \
165 td->inst = inst; \
166 mi = e_menu_item_new(m); \
167 e_menu_item_label_set(mi, label); \
168 e_menu_item_callback_set(mi, _espresso_menu_cb_timeout_set, (void*)td)
169 ADD_MENU_ITEM( D_("20 Minutes"), 20);
170 ADD_MENU_ITEM( D_("30 Minutes"), 30);
171 ADD_MENU_ITEM( D_("1 hour"), 60);
172 ADD_MENU_ITEM( D_("2 hour"), 120);
173#undef ADD_MENU_ITEM
174 m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
175 e_menu_post_deactivate_callback_set(m, _espresso_menu_cb_post, inst);
176 espresso_config->menu = m;
177
178 e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
179 e_menu_activate_mouse (m,
180 e_util_zone_current_get(e_manager_current_get()),
181 x + ev->output.x, y + ev->output.y, 1, 1,
182 E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
183 }
184 if (ev->button == 1)
185 {
186 _presentation_enable(inst, !e_config->mode.presentation);
187 }
188}
189
190static void
191_espresso_menu_cb_post(void *data __UNUSED__, E_Menu *m __UNUSED__)
192{
193 if (!espresso_config->menu) return;
194 e_object_del(E_OBJECT(espresso_config->menu));
195 espresso_config->menu = NULL;
196}
197
198static void _presentation_enable(Instance *inst, Eina_Bool enable)
199{
200 Evas_Object *icon = NULL;
201 const char *signal = "on";
202
203 if (!inst)
204 return;
205 icon = inst->espresso;
206 e_config->mode.presentation = enable;
207 e_config_mode_changed();
208 if (!e_config->mode.presentation)
209 {
210 signal = "off";
211 }
212 edje_object_signal_emit(icon, signal, "e");
213 _espresso_config_updated(inst);
214}
215
216static void
217_espresso_menu_cb_timeout_set(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
218{
219 Timer_Data *td = (Timer_Data*)data;
220 espresso_config->timeout = td->minutes;
221 _espresso_config_updated(td->inst);
222 _espresso_menu_cb_post(NULL, NULL);
223 E_FREE(td);
224}
225
226void
227_espresso_config_updated(Instance *inst)
228{
229 if (!espresso_config)
230 return;
231 if (coffee_timer)
232 {
233 ecore_timer_del(coffee_timer);
234 coffee_timer = NULL;
235 }
236 if (e_config->mode.presentation)
237 {
238 coffee_timer = ecore_timer_add((espresso_config->timeout * 60), _espresso_cb_timeout, inst);
239 }
240}
241
242static Eina_Bool
243_espresso_cb_timeout(void *data)
244{
245 Instance *inst = (Instance*)data;
246 _presentation_enable(inst, EINA_FALSE);
247 return EINA_TRUE;
248}
249
250EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "espresso" };
251
252EAPI void *
253e_modapi_init(E_Module *m)
254{
255 char buf[PATH_MAX];
256
257#if HAVE_LOCALE_H
258 setlocale(LC_ALL, "");
259#endif
260 snprintf(buf, sizeof(buf), "%s/locale", m->dir);
261 bindtextdomain(PACKAGE, buf);
262 bind_textdomain_codeset(PACKAGE, "UTF-8");
263
264
265 conf_edd = E_CONFIG_DD_NEW("espresso_Config", Config);
266#undef T
267#undef D
268#define T Config
269#define D conf_edd
270 E_CONFIG_VAL(D, T, timeout, INT);
271
272 espresso_config = e_config_domain_load("module.espresso", conf_edd);
273 if (!espresso_config)
274 {
275 espresso_config = E_NEW(Config, 1);
276 espresso_config->timeout = DEFAULT_TIMEOUT;
277 }
278 espresso_config->mod_dir = eina_stringshare_add(m->dir);
279
280 e_gadcon_provider_register(&_gc_class);
281 return m;
282}
283
284EAPI int
285e_modapi_shutdown(E_Module *m __UNUSED__)
286{
287 e_gadcon_provider_unregister(&_gc_class);
288
289 if (espresso_config->menu)
290 {
291 e_menu_post_deactivate_callback_set(espresso_config->menu, NULL, NULL);
292 e_object_del(E_OBJECT(espresso_config->menu));
293 espresso_config->menu = NULL;
294 }
295
296 if (espresso_config->mod_dir) eina_stringshare_del(espresso_config->mod_dir);
297 E_FREE(espresso_config);
298 E_CONFIG_DD_FREE(conf_edd);
299 return 1;
300}
301
302EAPI int
303e_modapi_save(E_Module *m __UNUSED__)
304{
305 e_config_domain_save("module.espresso", conf_edd, espresso_config);
306 return 1;
307}
diff --git a/src/e_mod_main.h b/src/e_mod_main.h
new file mode 100644
index 0000000..8d92fb1
--- /dev/null
+++ b/src/e_mod_main.h
@@ -0,0 +1,28 @@
1#ifndef E_MOD_MAIN_H
2#define E_MOD_MAIN_H
3
4#ifdef ENABLE_NLS
5# include <libintl.h>
6# define D_(string) dgettext(PACKAGE, string)
7#else
8# define bindtextdomain(domain,dir)
9# define bind_textdomain_codeset(domain,codeset)
10# define D_(string) (string)
11#endif
12
13typedef struct _Config Config;
14
15struct _Config
16{
17 const char *mod_dir;
18 E_Menu *menu;
19 int timeout;
20};
21
22EAPI extern E_Module_Api e_modapi;
23
24EAPI void *e_modapi_init(E_Module *m);
25EAPI int e_modapi_shutdown(E_Module *m);
26EAPI int e_modapi_save(E_Module *m);
27
28#endif