Adding Eve webbrowser, based on WebKit-EFL.

This is a complete rewrite of the old Eve web browser, using the current WebKit-EFL port
(available from the official WebKit SVN; instructions on how to build it are here[1]).

The interface was designed for mobile devices and is based off the Efenniht theme for E17.

[1] http://trac.webkit.org/wiki/EFLWebKit



SVN revision: 51060
This commit is contained in:
Leandro Pereira 2010-08-12 20:08:35 +00:00
commit 73e055e1f9
83 changed files with 7742 additions and 0 deletions

3
AUTHORS Normal file
View File

@ -0,0 +1,3 @@
Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
Leandro Augusto Fogolin Pereira <leandro@profusion.mobi>
Lucas De Marchi <lucas.demarchi@profusion.mobi>

165
COPYING Normal file
View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

15
ChangeLog Normal file
View File

@ -0,0 +1,15 @@
release 0.2.0.0:
better zoom handing:
* auto fit (double-click some element) will keep whole object in
viewport.
* click over links will not go immediately, so it's possible to
click and zoom over links as well
* both auto-fit and interactive zoom modes will not choose or
allow levels of zoom that makes contents smaller than viewport.
release 0.1.0.0:
Initial release.

10
Makefile.am Normal file
View File

@ -0,0 +1,10 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src data po
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
ltconfig ltmain.sh missing mkinstalldirs \
stamp-h.in acconfig.h depcomp
EXTRA_DIST = README AUTHORS COPYING

0
NEWS Normal file
View File

6
README Normal file
View File

@ -0,0 +1,6 @@
eve
WebKit-EFL demo application
See INSTALL for help on how to install.
See COPYING for software usage, modification and redistribution license.

16
autogen.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
DIRNAME=`basename $PWD`
if test "x$DIRNAME" = "xelementary-skel"; then
echo "Do not run autogen.sh from inside elementary-skel"
exit 1
fi
find . -name Makefile -delete
find . -name Makefile.in -delete
autoreconf -f -i
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi

128
configure.ac Normal file
View File

@ -0,0 +1,128 @@
AC_INIT(eve, 0.2.0.0, barbieri@profusion.mobi)
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_GNU_SOURCE
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
AM_INIT_AUTOMAKE(1.6 dist-bzip2)
AM_CONFIG_HEADER(config.h)
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
AC_PROG_LIBTOOL
VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
AC_SUBST(VMAJ)
AC_SUBST(version_info)
AC_C_BIGENDIAN
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_C_CONST
AC_FUNC_ALLOCA
AC_C___ATTRIBUTE__
ALL_LINGUAS=`cat po/LINGUAS | grep -v '^[ ]*#'`
AC_SUBST(ALL_LINGUAS)
AM_GNU_GETTEXT_VERSION([0.12.1])
AM_GNU_GETTEXT([external])
PKG_CHECK_MODULES([ELEMENTARY], [elementary])
PKG_CHECK_MODULES([EWEBKIT], [ewebkit ecore-file])
AC_ARG_WITH([edje-cc],
[AC_HELP_STRING([--with-edje-cc=PATH],
[specify a specific path to edje_cc])],
[edje_cc=$withval;
AC_MSG_NOTICE([edje_cc explicitly set to $edje_cc])
],[edje_cc=$(pkg-config --variable=prefix edje)/bin/edje_cc])
AC_SUBST(edje_cc)
want_quicklaunch="auto"
AC_ARG_ENABLE([quicklaunch],
[AC_HELP_STRING([--disable-quicklaunch],
[disable build of quicklaunch (default=auto)])],
[if test "x${enableval}" = "xno"; then
want_quicklaunch="no"
elif test "x${enableval}" = "xyes"; then
want_quicklaunch="yes"
else
want_quicklaunch="auto"
fi
],
[want_quicklaunch="auto"])
if test "x${want_quicklaunch}" = "xauto"; then
AC_MSG_CHECKING([checking for elementary_quicklaunch binary...])
if test -x $(pkg-config --variable=prefix elementary)/bin/elementary_quicklaunch; then
AC_MSG_RESULT([found, enable quicklaunch.])
want_quicklaunch="yes"
else
AC_MSG_RESULT([not found, disable quicklaunch.])
want_quicklaunch="no"
fi
fi
if test "x${want_quicklaunch}" = "xyes"; then
AC_ARG_WITH([quicklauncher-libdir],
[AC_HELP_STRING([--with-quicklauncher-libdir=PATH],
[specify a specific path to install quicklauncher binaries])],
[quicklauncher_libdir=$withval;
AC_MSG_NOTICE([quicklauncher_libdir explicitly set to $quicklauncher_libdir])
],
[quicklauncher_libdir=$(pkg-config --variable=libdir elementary)])
AC_SUBST(quicklauncher_libdir)
fi
AM_CONDITIONAL(BUILD_QUICKLAUNCH, test "x${want_quicklaunch}" = "xyes")
AC_OUTPUT([
Makefile
src/Makefile
src/bin/Makefile
data/Makefile
data/desktop/Makefile
data/themes/Makefile
po/Makefile.in
])
cat << EOF
eve configured with:
Flags:
CFLAGS.....(C): $CFLAGS
CXXFLAGS.(C++): $CXXFLAGS
CPPFLAGS.(CPP): $CPPFLAGS
LDFLAGS...(LD): $LDFLAGS
Installation:
PREFIX..............: $prefix
Quick Launcher: ${want_quicklaunch}
EOF
if test "x${want_quicklaunch}" = "xyes"; then
cat << EOF_QL
quicklauncher_libdir: $quicklauncher_libdir
EOF_QL
fi
cat << EOF2
Now type 'make' ('gmake' on some systems) to compile eve, if it
builds successfully then you can 'make install', acquiring required
permissions with 'su' or 'sudo'.
EOF2

2
data/Makefile.am Normal file
View File

@ -0,0 +1,2 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = desktop themes

9
data/desktop/Makefile.am Normal file
View File

@ -0,0 +1,9 @@
MAINTAINERCLEANFILES = Makefile.in
desktopdir = $(datadir)/applications
desktop_DATA = eve.desktop
icondir = $(datadir)/icons
icon_DATA = eve.png
EXTRA_DIST = eve.desktop eve.png

9
data/desktop/eve.desktop Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Encoding=UTF-8
Name=eve
Comment=WebKit-EFL demo application
Exec=eve
Icon=eve
Terminal=false
Type=Application
Categories=Application;Utility;

BIN
data/desktop/eve.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

1
data/themes/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
default.edj

56
data/themes/Makefile.am Normal file
View File

@ -0,0 +1,56 @@
MAINTAINERCLEANFILES = Makefile.in
EDJE_CC = @edje_cc@
EDJE_FLAGS = -v -id $(top_srcdir)/data/themes -fd $(top_srcdir)/data/themes
filesdir = $(datadir)/$(PACKAGE)
files_DATA = ewebkit.edj default.edj
images = \
bookmark-list-back-button.png \
bookmark-list-title.png \
bt_back_normal.png \
bt_back_selected.png \
bt_bookmark_normal.png \
bt_bookmark_selected.png \
bt_fav_normal.png \
bt_fav_selected.png \
bt_forward_normal.png \
bt_forward_selected.png \
bt_home_normal.png \
bt_home_selected.png \
bt_reload_normal.png \
bt_reload_selected.png \
bt_tab_normal.png \
bt_tab_selected.png \
panel-top-triangle.png \
scrollbar-bg.png \
scrollbar-knob.png \
shadow-bottom.png \
tab-add.png \
tab-bg.png \
tab-bg-selected.png \
tab-close.png \
tab-header.png \
toolbar-background-bottom.png \
toolbar-background-top.png \
url-entry.png \
list-highlight.png \
cur_box.png \
cur_hi.png \
cur_shine.png \
cur_glow.png \
cur_shad.png \
progress-bar-background.png
fonts =
EXTRA_DIST = ewebkit.edj default.edc $(images) $(fonts)
default.edj: Makefile $(images) $(fonts) default.edc
$(EDJE_CC) $(EDJE_FLAGS) \
$(top_srcdir)/data/themes/default.edc \
$(top_builddir)/data/themes/default.edj
clean-local:
rm -f default.edj

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
data/themes/cur_box.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

BIN
data/themes/cur_glow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

BIN
data/themes/cur_hi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

BIN
data/themes/cur_shad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

BIN
data/themes/cur_shine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

1036
data/themes/default.edc Normal file

File diff suppressed because it is too large Load Diff

227
data/themes/elm-entry.edc Normal file
View File

@ -0,0 +1,227 @@
group { name: "elm/entry/base-single/ewebkit/url";
styles
{
style { name: "entry_single_textblock_style";
base: "font=Sans font_size=10 align=left color=#787878 wrap=none";
tag: "br" "\n";
tag: "tab" "\t";
tag: "em" "+ font=Sans:style=Oblique";
tag: "b" "+ font=Sans:style=Bold";
tag: "link" "+ color=#800 underline=on underline_color=#8008";
tag: "hilight" "+ font=Sans:style=Bold";
}
style { name: "entry_single_textblock_disabled_style";
base: "font=Sans font_size=10 align=left color=#00000080 wrap=none";
tag: "br" "\n";
tag: "tab" "\t";
tag: "em" "+ font=Sans:style=Oblique";
tag: "b" "+ font=Sans:style=Bold";
tag: "link" "+ color=#00000080 underline=on underline_color=#00000080";
tag: "hilight" "+ font=Sans:style=Bold";
}
}
parts {
part { name: "elm.text";
type: TEXTBLOCK;
mouse_events: 1;
scale: 1;
entry_mode: EDITABLE;
select_mode: EXPLICIT;
multiline: 0;
source: "elm/entry/selection/ewebkit/url"; // selection under
source4: "elm/entry/cursor/ewebkit/url"; // cursorover
source5: "elm/entry/anchor/default"; // anchor under
description { state: "default" 0.0;
text {
style: "entry_single_textblock_style";
min: 1 1;
max: 0 1;
}
}
description { state: "disabled" 0.0;
inherit: "default" 0.0;
text {
style: "entry_single_textblock_disabled_style";
}
}
}
}
programs {
program { name: "focus";
signal: "load";
source: "";
action: FOCUS_SET;
target: "elm.text";
}
program { name: "disable";
signal: "elm,state,disabled";
source: "elm";
action: STATE_SET "disabled" 0.0;
target: "elm.text";
}
program { name: "enable";
signal: "elm,state,enabled";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.text";
}
}
}
group { name: "elm/entry/selection/ewebkit/url";
parts {
part { name: "bg";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
color: 128 128 128 128;
}
}
}
}
group { name: "elm/entry/cursor/ewebkit/url";
images {
image: "cur_box.png" COMP;
image: "cur_hi.png" COMP;
image: "cur_shad.png" COMP;
image: "cur_shine.png" COMP;
image: "cur_glow.png" COMP;
}
parts {
part { name: "clip2";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "clip";
rel2.to: "clip";
visible: 0;
}
description { state: "focused" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "clip";
type: RECT;
mouse_events: 0;
clip_to: "clip2";
description { state: "default" 0.0;
rel1.offset: -10 0;
rel2.offset: 9 9;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "bg";
mouse_events: 0;
clip_to: "clip";
description { state: "default" 0.0;
rel1.to: "base";
rel1.offset: -2 0;
rel2.to: "base";
rel2.offset: 1 1;
image.border: 2 2 2 2;
image.normal: "cur_shad.png";
}
}
part { name: "base";
mouse_events: 0;
scale: 1;
clip_to: "clip";
description { state: "default" 0.0;
min: 2 2;
align: 0.5 1.0;
rel1.relative: 0.0 1.0;
rel1.offset: 0 -1;
rel2.relative: 1.0 1.0;
rel2.offset: -1 -1;
image.normal: "cur_box.png";
}
}
part { name: "hi";
mouse_events: 0;
clip_to: "clip";
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
rel2.relative: 1.0 0.5;
image.normal: "cur_hi.png";
}
}
part { name: "shine";
mouse_events: 0;
clip_to: "clip";
clip_to: "clip2";
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
rel2.relative: 1.0 0.75;
image.border: 2 2 1 0;
image.normal: "cur_shine.png";
fill.smooth: 0;
}
}
part { name: "glow";
mouse_events: 0;
clip_to: "clip2";
description { state: "default" 0.0;
rel1.to: "base";
rel1.relative: 0.0 -2.0;
rel1.offset: -2 0;
rel2.to: "base";
rel2.relative: 1.0 0.0;
rel2.offset: 1 1;
image.border: 2 2 0 4;
image.normal: "cur_glow.png";
fill.smooth: 0;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
}
}
}
programs {
program { name: "show";
signal: "show";
source: "";
action: STATE_SET "hidden" 0.0;
in: 1.0 0.0;
transition: DECELERATE 2.0;
target: "glow";
after: "show2";
}
program { name: "show2";
action: STATE_SET "hidden" 0.0;
in: 0.2 0.0;
target: "clip";
after: "show3";
}
program { name: "show3";
action: STATE_SET "default" 0.0;
in: 0.5 0.0;
target: "clip";
after: "show4";
}
program { name: "show4";
action: STATE_SET "default" 0.0;
in: 0.5 0.0;
transition: DECELERATE 0.5;
target: "glow";
after: "show";
}
program { name: "focused";
signal: "elm,action,focus";
source: "elm";
action: STATE_SET "focused" 0.0;
target: "clip2";
}
program { name: "unfocused";
signal: "elm,action,unfocus";
source: "elm";
action: STATE_SET "default" 0.0;
target: "clip2";
}
}
}

420
data/themes/elm-gengrid.edc Normal file
View File

@ -0,0 +1,420 @@
group { name: "elm/gengrid/item/default/ewebkit";
alias: "elm/gengrid/item/default_style/ewebkit";
data.item: "labels" "elm.text";
data.item: "icons" "elm.swallow.icon elm.swallow.end";
images {
image: "tab-bg.png" COMP;
image: "tab-bg-selected.png" COMP;
image: "tab-close.png" COMP;
}
parts {
part {
name: "event";
repeat_events: 1;
description {
state: "default" 0.0;
}
}
part { name: "bg";
clip_to: "disclip";
mouse_events: 0;
description { state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: -5 -5;
}
rel2 {
relative: 1.0 1.0;
offset: 4 4;
}
image {
normal: "tab-bg.png";
border: 28 28 20 20;
}
fill.smooth: 0;
}
}
part { name: "elm.swallow.pad";
type: SWALLOW;
description { state: "default" 0.0;
visible: 0;
fixed: 1 0;
align: 0.0 0.5;
rel1 {
relative: 0.0 1.0;
offset: 0 -10;
}
rel2 {
to_y: "elm.text";
relative: 0.0 0.0;
offset: -1 -1;
}
}
}
part { name: "elm.swallow.icon";
clip_to: "disclip";
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 0;
align: 0.5 0.5;
rel1 {
relative: 0.0 0.0;
offset: 22 13;
}
rel2 {
to_y: "elm.text";
relative: 1.0 0.0;
offset: -24 -4;
}
}
}
part { name: "elm.swallow.end";
clip_to: "disclip";
type: SWALLOW;
description { state: "default" 0.0;
visible: 0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 0.0 0.0;
offset: 0 0;
}
}
}
part { name: "elm.text";
clip_to: "disclip";
type: TEXT;
mouse_events: 0;
scale: 1;
description {
state: "default" 0.0;
rel1 {
relative: 0.0 1.0;
offset: 18 0;
}
rel2 {
relative: 1.0 1.0;
offset: -21 -44;
}
color: 120 120 120 255;
text {
font: "Sans";
size: 9;
min: 0 1;
align: 0.5 0.0;
}
}
}
part { name: "disclip";
type: RECT;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
}
description { state: "disabled" 0.0;
inherit: "default" 0.0;
color: 255 255 255 64;
}
}
part { name: "bg-selected-border";
clip_to: "disclip";
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
color: 255 255 255 0;
image {
normal: "tab-bg-selected.png";
border: 8 8 8 8;
}
fill.smooth: 0;
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
rel1 {
relative: 0.0 0.0;
offset: 15 5;
}
rel2 {
relative: 1.0 1.0;
offset: -16 -6;
}
image {
normal: "tab-bg-selected.png";
border: 8 8 8 8;
}
}
}
part { name: "close-button";
type: IMAGE;
description { state: "default" 0.0;
min: 15 15;
max: 15 15;
rel1 {
relative: 1.0 1.0;
offset: -40 1;
}
rel2 {
relative: 1.0 1.0;
offset: 29 -41;
}
image.normal: "tab-close.png";
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
color: 255 166 2 255;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "close-button-dedones";
type: RECT;
clip_to: "disclip";
description { state: "default" 0.0;
rel1 {
to: "close-button";
relative: 0.0 0.0;
offset: -10 -10;
}
rel2 {
to: "close-button";
relative: 1.0 1.0;
offset: 5 11;
}
color: 255 255 255 0;
}
}
}
programs {
// signal: elm,state,%s,active
// a "check" item named %s went active
// signal: elm,state,%s,passive
// a "check" item named %s went passive
// default is passive
program {
name: "tab_close_down";
signal: "tab,close,hide";
action: STATE_SET "hidden" 0.0;
target: "close-button";
}
program {
name: "tab_down";
signal: "mouse,down,*";
source: "close-button-dedones";
action: STATE_SET "selected" 0.0;
target: "close-button";
transition: ACCELERATE 0.2;
}
program {
name: "tab_clicked";
signal: "mouse,clicked,*";
source: "close-button-dedones";
action: SIGNAL_EMIT "tab,close" "";
}
program {
name: "tab_up";
signal: "mouse,up,*";
source: "close-button-dedones";
action: STATE_SET "default" 0.0;
target: "close-button";
transition: DECELERATE 0.2;
}
program {
name: "go_active";
signal: "elm,state,selected";
source: "elm";
action: STATE_SET "selected" 0.0;
target: "bg-selected-border";
transition: ACCELERATE 0.1;
}
program {
name: "go_passive";
signal: "elm,state,unselected";
source: "elm";
action: STATE_SET "default" 0.0;
target: "bg-selected-border";
transition: DECELERATE 0.1;
}
}
}
group { name: "elm/gengrid/item/new_page/ewebkit";
data.item: "labels" "elm.text";
data.item: "icons" "elm.swallow.icon elm.swallow.end";
images {
image: "tab-bg.png" COMP;
image: "tab-bg-selected.png" COMP;
image: "tab-add.png" COMP;
}
parts {
part {
name: "event";
repeat_events: 1;
description {
state: "default" 0.0;
}
}
part { name: "bg";
clip_to: "disclip";
mouse_events: 0;
description { state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: -5 -5;
}
rel2 {
relative: 1.0 1.0;
offset: 4 4;
}
image {
normal: "tab-bg.png";
border: 28 28 20 20;
}
fill.smooth: 0;
}
}
part { name: "elm.swallow.pad";
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 0;
align: 0.0 0.5;
rel1 {
relative: 0.0 1.0;
offset: 0 -10;
}
rel2 {
to_y: "elm.text";
relative: 0.0 0.0;
offset: -1 -1;
}
}
}
part { name: "elm.swallow.icon";
clip_to: "disclip";
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 0;
align: 0.5 0.5;
rel1 {
relative: 0.0 0.0;
offset: 20 11;
}
rel2 {
to_y: "elm.text";
relative: 1.0 0.0;
offset: -24 -4;
}
}
}
part { name: "elm.swallow.end";
clip_to: "disclip";
type: SWALLOW;
description { state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 0.0 0.0;
offset: 0 0;
}
}
}
part { name: "elm.text";
clip_to: "disclip";
type: RECT;
description { state: "default" 0.0;
visible: 0;
}
}
part { name: "disclip";
type: RECT;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
}
description { state: "disabled" 0.0;
inherit: "default" 0.0;
color: 255 255 255 64;
}
}
part { name: "add-img";
type: IMAGE;
description { state: "default" 0.0;
min: 23 23;
max: 23 23;
rel1 {
relative: 1.0 1.0;
offset: -54 1;
}
rel2 {
relative: 1.0 1.0;
offset: -6 -43;
}
image.normal: "tab-add.png";
}
}
part { name: "bg-selected-border";
clip_to: "disclip";
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
color: 255 255 255 0;
image {
normal: "tab-bg-selected.png";
border: 8 8 8 8;
}
fill.smooth: 0;
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
rel1 {
relative: 0.0 0.0;
offset: 15 5;
}
rel2 {
relative: 1.0 1.0;
offset: -16 -6;
}
image {
normal: "tab-bg-selected.png";
border: 8 8 8 8;
}
}
}
}
programs {
// signal: elm,state,%s,active
// a "check" item named %s went active
// signal: elm,state,%s,passive
// a "check" item named %s went passive
// default is passive
program {
name: "go_active";
signal: "elm,state,selected";
source: "elm";
action: STATE_SET "selected" 0.0;
target: "bg-selected-border";
transition: ACCELERATE 0.1;
}
program {
name: "go_passive";
signal: "elm,state,unselected";
source: "elm";
action: STATE_SET "default" 0.0;
target: "bg-selected-border";
transition: DECELERATE 0.1;
}
}
}

222
data/themes/elm-list.edc Normal file
View File

@ -0,0 +1,222 @@
group { name: "elm/list/item/ewebkit";
alias: "elm/list/item_odd/ewebkit";
data.item: "stacking" "above";
images {
image: "list-highlight.png" COMP;
}
parts {
part {
name: "event";
type: RECT;
repeat_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
}
}
part { name: "bg";
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
rel1 {
relative: 0.0 0.0;
offset: -10 -10;
}
rel2 {
relative: 1.0 1.0;
offset: 9 9;
}
image {
normal: "list-highlight.png";
border: 6 6 6 6;
}
image.middle: SOLID;
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
rel1 {
relative: 0.0 0.0;
offset: 0 -1;
}
rel2 {
relative: 1.0 1.0;
offset: -1 1;
}
}
}
part { name: "elm.swallow.icon";
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 0;
align: 0.0 0.5;
rel1 {
relative: 0.0 0.0;
offset: 4 4;
}
rel2 {
relative: 0.0 1.0;
offset: 4 -5;
}
}
}
part { name: "elm.swallow.end";
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 0;
align: 1.0 0.5;
rel1 {
relative: 1.0 0.0;
offset: -5 4;
}
rel2 {
relative: 1.0 1.0;
offset: -5 -5;
}
}
}
part { name: "elm.text";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
scale: 1;
description {
state: "default" 0.0;
// min: 16 16;
rel1 {
to_x: "elm.swallow.icon";
relative: 1.0 0.0;
offset: 38 0;
}
rel2 {
to_x: "elm.swallow.end";
relative: 0.0 1.0;
offset: -1 -1;
}
color: 190 190 190 255;
color3: 0 0 0 0;
text {
font: "Sans";
size: 11;
min: 1 1;
// min: 0 1;
align: 0.0 0.35;
}
}
description {
state: "selected" 0.0;
inherit: "default" 0.0;
}
}
}
programs {
program {
name: "go_active";
signal: "elm,state,selected";
source: "elm";
action: STATE_SET "selected" 0.0;
target: "bg";
target: "elm.text";
transition: ACCELERATE 0.2;
}
program {
name: "go_passive";
signal: "elm,state,unselected";
source: "elm";
action: STATE_SET "default" 0.0;
target: "bg";
target: "elm.text";
transition: DECELERATE 0.1;
}
}
}
group { name: "elm/list/separator/ewebkit";
data.item: "stacking" "above";
parts {
part {
name: "event";
type: RECT;
repeat_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
}
}
part { name: "bg";
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
rel1 {
relative: 0.0 0.0;
offset: -5 -5;
}
rel2 {
relative: 0.5 1.0;
offset: 4 4;
}
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 0;
color: 255 255 255 128;
rel1 {
relative: 0.0 0.0;
offset: -2 -2;
}
rel2 {
relative: 0.5 1.0;
offset: 1 1;
}
}
}
part { name: "elm.swallow.icon";
type: SWALLOW;
description { state: "default" 0.0;
visible: 0;
fixed: 1 0;
align: 0.0 0.5;
rel1 {
relative: 0.0 0.0;
offset: 4 4;
}
rel2 {
relative: 0.0 1.0;
offset: 4 -5;
}
}
}
part { name: "elm.swallow.end";
type: SWALLOW;
description { state: "default" 0.0;
visible: 0;
fixed: 1 0;
align: 1.0 0.5;
rel1 {
relative: 1.0 0.0;
offset: -5 4;
}
rel2 {
relative: 1.0 1.0;
offset: -5 -5;
}
}
}
part { name: "elm.text";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
scale: 1;
description {
state: "default" 0.0;
visible: 0;
}
description {
state: "selected" 0.0;
inherit: "default" 0.0;
}
}
}
}

146
data/themes/elm-notify.edc Normal file
View File

@ -0,0 +1,146 @@
group { name: "elm/notify/block_events/ewebkit";
images.image: "shadow-bottom.png" COMP;
images.image: "tab-header.png" COMP;
parts {
part { name: "bg";
type: RECT;
description { state: "default" 0.0;
rel1.relative: 0.0 1.0;
rel1.offset: 0 -310;
rel2.relative: 1.0 1.0;
rel2.offset: -1 -1;
color: 0 0 0 255;
}
}
part { name: "shadow";
type: IMAGE;
description { state: "default" 0.0;
image.normal: "shadow-bottom.png";
rel1 {
relative: 0.0 1.0;
offset: 0 -326;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -311;
}
}
}
part { name: "border";
type: IMAGE;
description { state: "default" 0.0;
image.normal: "tab-header.png";
max: 99999 14;
rel1 {
to: "shadow";
relative: 0.0 1.0;
offset: 0 -21;
}
rel2 {
to: "shadow";
relative: 1.0 1.0;
offset: -1 15;
}
}
}
part { name: "block_events";
type: RECT;
description { state: "default" 0.0;
color: 0 0 0 128;
visible: 1;
rel1.relative: 0.0 0.0;
rel1.offset: 0 0;
rel2.relative: 1.0 1.0;
rel2.offset: -1 -311;
}
}
}
programs {
program {
name: "block_clicked";
signal: "mouse,clicked,1";
source: "block_events";
action: SIGNAL_EMIT "elm,action,clicked" "elm";
}
}
}
group { name: "elm/notify/bottom/ewebkit";
min: 400 300;
parts {
part { name: "base";
type: RECT;
mouse_events: 0;
repeat_events: 1;
description { state: "default" 0.0;
visible: 0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
rel2.offset: -1 -1;
color: 0 0 0 0;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "shad";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "elm.swallow.content";
rel1.offset: -64 -64;
rel2.to: "elm.swallow.content";
rel2.offset: 63 63;
}
}
part { name: "pop";
mouse_events: 1;
description { state: "default" 0.0;
rel1.to: "elm.swallow.content";
rel1.offset: -5 -5;
rel2.to: "elm.swallow.content";
rel2.offset: 4 4;
}
}
part { name: "popover";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "pop";
rel2.to: "pop";
rel2.relative: 1.0 0.5;
}
}
part { name: "elm.swallow.content";
type: SWALLOW;
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
}
}
}
programs {
program { name: "show";
signal: "elm,action,show";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "base";
}
program { name: "show_2";
signal: "show";
action: STATE_SET "default" 0.0;
target: "base";
after: "show_3";
}
program { name: "show_3";
signal: "show";
action: STATE_SET "visible" 0.0;
target: "base";
transition: ACCELERATE 0.2;
}
program { name: "hide";
signal: "elm,action,hide";
source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
}
}
}

122
data/themes/elm-pager.edc Normal file
View File

@ -0,0 +1,122 @@
group { name: "elm/pager/base/ewebkit";
data.item: "onshow" "raise";
// other options
// data.item: "onhide" "lower";
// data.item: "onshow" "lower";
parts {
part { name: "clip";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
rel1 {
to: "base";
offset: -9999 -9999;
}
rel2 {
to: "base";
offset: 9999 9999;
}
color: 255 255 255 255;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
visible: 0;
}
}
part { name: "base";
mouse_events: 0;
clip_to: "clip";
description { state: "default" 0.0; }
description { state: "hidden" 0.0;
inherit: "default" 0.0;
rel1.relative: -1.0 0.0;
rel2.relative: 0.0 1.0;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
}
}
part { name: "elm.swallow.content";
type: SWALLOW;
clip_to: "clip";
description { state: "default" 0.0;
rel1 {
to: "base";
offset: 0 0;
}
rel2 {
to: "base";
offset: -1 -1;
}
}
}
}
programs {
program { name: "push_start";
signal: "elm,action,push";
source: "elm";
action: STATE_SET "hidden" 0.0;
target: "base";
target: "clip";
after: "show_start2";
}
program { name: "show_start";
signal: "elm,action,show";
source: "elm";
action: STATE_SET "hidden" 0.0;
target: "base";
target: "clip";
after: "show_start2";
}
program { name: "show_start2";
action: STATE_SET "visible" 0.0;
transition: DECELERATE 0.5;
target: "base";
target: "clip";
after: "show_end";
}
program { name: "show_end";
action: SIGNAL_EMIT "elm,action,show,finished" "";
}
program { name: "pop_start";
signal: "elm,action,pop";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "base";
target: "clip";
after: "hide_start2";
}
program { name: "hide_start";
signal: "elm,action,hide";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "base";
target: "clip";
after: "hide_start2";
}
program { name: "hide_start2";
action: STATE_SET "hidden" 0.0;
transition: DECELERATE 0.5;
target: "base";
target: "clip";
after: "hide_end";
}
program { name: "hide_end";
action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
program { name: "reset";
signal: "elm,action,reset";
source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
target: "clip";
}
}
}

View File

@ -0,0 +1,398 @@
group { name: "elm/scroller/base/ewebkit";
alias: "elm/list/base/ewebkit";
alias: "elm/genlist/base/ewebkit";
alias: "elm/carousel/base/ewebkit";
alias: "elm/gengrid/base/ewebkit";
images {
image: "scrollbar-knob.png" COMP;
image: "scrollbar-bg.png" COMP;
}
script {
public sbvis_v, sbvis_h, sbalways_v, sbalways_h;
}
parts {
part { name: "bg";
type: RECT;
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
color: 0 0 0 255;
}
}
part { name: "clipper";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
}
}
part { name: "elm.swallow.content";
clip_to: "clipper";
type: SWALLOW;
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
}
}
part { name: "conf_over";
mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: 0 0;
rel2.offset: -1 -1;
}
}
part { name: "sb_vbar_clip_master";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
}
description { state: "hidden" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "sb_vbar_clip";
clip_to: "sb_vbar_clip_master";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
}
description { state: "hidden" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "sb_vbar";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
fixed: 1 1;
visible: 0;
min: 2 32;
align: 1.0 0.0;
rel1 {
relative: 1.0 0.0;
offset: -8 25;
}
rel2 {
relative: 1.0 0.0;
offset: -7 -7;
to_y: "sb_hbar";
}
}
}
part { name: "sb_vbar_runner";
clip_to: "sb_vbar_clip";
mouse_events: 0;
description { state: "default" 0.0;
min: 3 3;
max: 3 99999;
rel1.to: "sb_vbar";
rel2.to: "sb_vbar";
fixed: 1 1;
}
}
part { name: "vknob-bg";
type: IMAGE;
mouse_events: 0;
clip_to: sb_vbar_clip;
description { state: "default" 0.0;
image.normal: "scrollbar-bg.png";
image.border: 1 1 3 2;
max: 3 99999;
rel1 {
relative: 1.0 0.0;
offset: -10 25;
}
rel2 {
relative: 1.0 1.0;
offset: -6 -25;
}
}
}
part { name: "elm.dragable.vbar";
clip_to: "sb_vbar_clip";
mouse_events: 0;
dragable {
x: 0 0 0;
y: 1 1 0;
confine: "sb_vbar";
}
description { state: "default" 0.0;
fixed: 1 1;
min: 2 12;
rel1 {
relative: 1.0 0.5;
offset: -3 0;
to: "sb_vbar";
}
rel2 {
relative: 1.0 0.5;
offset: -1 0;
to: "sb_vbar";
}
image {
normal: "scrollbar-knob.png";
}
}
}
part { name: "sb_hbar_clip_master";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
}
description { state: "hidden" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "sb_hbar_clip";
clip_to: "sb_hbar_clip_master";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
}
description { state: "hidden" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "sb_hbar";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
fixed: 1 1;
visible: 0;
min: 17 17;
align: 0.0 1.0;
rel1 {
relative: 0.0 1.0;
offset: 0 -2;
}
rel2 {
relative: 0.0 1.0;
offset: -1 -2;
to_x: "sb_vbar";
}
}
}
part { name: "sb_hbar_runner";
clip_to: "sb_hbar_clip";
mouse_events: 0;
description { state: "default" 0.0;
min: 3 3;
max: 99999 3;
rel1.to: "sb_hbar";
rel2.to: "sb_hbar";
}
}
part { name: "elm.dragable.hbar";
clip_to: "sb_hbar_clip";
mouse_events: 0;
dragable {
x: 1 1 0;
y: 0 0 0;
confine: "sb_hbar";
}
description { state: "default" 0.0;
fixed: 1 1;
min: 17 17;
rel1 {
relative: 0.5 0.5;
offset: 0 0;
to: "sb_hbar";
}
rel2 {
relative: 0.5 0.5;
offset: 0 0;
to: "sb_hbar";
}
}
}
part { name: "sb_hbar_over1";
clip_to: "sb_hbar_clip";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "elm.dragable.hbar";
rel2.relative: 1.0 0.5;
rel2.to: "elm.dragable.hbar";
}
}
part { name: "sb_hbar_over2";
clip_to: "sb_hbar_clip";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "elm.dragable.hbar";
rel2.to: "elm.dragable.hbar";
}
}
}
programs {
program { name: "load";
signal: "load";
source: "";
script {
set_state(PART:"sb_hbar_clip", "hidden", 0.0);
set_state(PART:"sb_vbar_clip", "hidden", 0.0);
set_int(sbvis_h, 0);
set_int(sbalways_v, 0);
set_int(sbalways_h, 0);
emit("do-show-vbar", "");
set_int(sbvis_v, 1);
}
}
program { name: "vbar_show";
signal: "elm,action,show,vbar";
source: "elm";
action: STATE_SET "default" 0.0;
target: "sb_vbar_clip_master";
}
program { name: "vbar_hide";
signal: "elm,action,hide,vbar";
source: "elm";
action: STATE_SET "hidden" 0.0;
target: "sb_vbar_clip_master";
}
program { name: "vbar_show_always";
signal: "elm,action,show_always,vbar";
source: "elm";
script {
new v;
v = get_int(sbvis_v);
v |= get_int(sbalways_v);
if (!v) {
set_int(sbalways_v, 1);
emit("do-show-vbar", "");
set_int(sbvis_v, 1);
}
}
}
program { name: "vbar_show_notalways";
signal: "elm,action,show_notalways,vbar";
source: "elm";
script {
new v;
v = get_int(sbalways_v);
if (v) {
set_int(sbalways_v, 0);
v = get_int(sbvis_v);
if (!v) {
emit("do-hide-vbar", "");
set_int(sbvis_v, 0);
}
}
}
}
program { name: "sb_vbar_show";
signal: "do-show-vbar";
source: "";
action: STATE_SET "default" 0.0;
transition: LINEAR 1.0;
target: "sb_vbar_clip";
}
program { name: "sb_vbar_hide";
signal: "do-hide-vbar";
source: "";
action: STATE_SET "hidden" 0.0;
transition: LINEAR 1.0;
target: "sb_vbar_clip";
}
program { name: "hbar_show";
signal: "elm,action,show,hbar";
source: "elm";
action: STATE_SET "default" 0.0;
target: "sb_hbar_clip_master";
}
program { name: "hbar_hide";
signal: "elm,action,hide,hbar";
source: "elm";
action: STATE_SET "hidden" 0.0;
target: "sb_hbar_clip_master";
}
program { name: "hbar_show_always";
signal: "elm,action,show_always,hbar";
source: "elm";
script {
new v;
v = get_int(sbvis_h);
v |= get_int(sbalways_h);
if (!v) {
set_int(sbalways_h, 1);
emit("do-show-hbar", "");
set_int(sbvis_h, 1);
}
}
}
program { name: "hbar_show_notalways";
signal: "elm,action,show_notalways,hbar";
source: "elm";
script {
new v;
v = get_int(sbalways_h);
if (v) {
set_int(sbalways_h, 0);
v = get_int(sbvis_h);
if (!v) {
emit("do-hide-hbar", "");
set_int(sbvis_h, 0);
}
}
}
}
program { name: "sb_hbar_show";
signal: "do-show-hbar";
source: "";
action: STATE_SET "default" 0.0;
transition: LINEAR 1.0;
target: "sb_hbar_clip";
}
program { name: "sb_hbar_hide";
signal: "do-hide-hbar";
source: "";
action: STATE_SET "hidden" 0.0;
transition: LINEAR 1.0;
target: "sb_hbar_clip";
}
}
}
group { name: "elm/scroller/base/ewebkit/url";
parts {
part { name: "bg";
type: RECT;
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
color: 255 255 255 0;
}
}
part { name: "clipper";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
}
}
part { name: "elm.swallow.content";
clip_to: "clipper";
type: SWALLOW;
description { state: "default" 0.0;
rel1.offset: 1 1;
rel2.offset: -2 -2;
color: 255 0 0 128;
}
}
part { name: "elm.dragable.vbar";
description { state: "default" 0.0; visible: 0; }
}
part { name: "elm.dragable.hbar";
description { state: "default" 0.0; visible: 0; }
}
}
}

BIN
data/themes/ewebkit.edj Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
data/themes/tab-add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 B

BIN
data/themes/tab-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

BIN
data/themes/tab-close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

BIN
data/themes/tab-header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

BIN
data/themes/url-entry.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

24
m4/.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
codeset.m4
gettext.m4
glibc21.m4
iconv.m4
intdiv0.m4
inttypes-pri.m4
inttypes.m4
inttypes_h.m4
isc-posix.m4
lcmessage.m4
lib-ld.m4
lib-link.m4
lib-prefix.m4
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
nls.m4
po.m4
progtest.m4
stdint_h.m4
uintmax_t.m4
ulonglong.m4

47
m4/ac_attribute.m4 Normal file
View File

@ -0,0 +1,47 @@
dnl Copyright (C) 2004-2008 Kim Woelders
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Originally snatched from somewhere...
dnl Macro for checking if the compiler supports __attribute__
dnl Usage: AC_C___ATTRIBUTE__
dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
dnl defined to nothing.
AC_DEFUN([AC_C___ATTRIBUTE__],
[
AC_MSG_CHECKING([for __attribute__])
AC_CACHE_VAL([ac_cv___attribute__],
[AC_TRY_COMPILE(
[
#include <stdlib.h>
int func(int x);
int foo(int x __attribute__ ((unused)))
{
exit(1);
}
],
[],
[ac_cv___attribute__="yes"],
[ac_cv___attribute__="no"]
)])
AC_MSG_RESULT($ac_cv___attribute__)
if test "x${ac_cv___attribute__}" = "xyes" ; then
AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
else
AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
fi
])
dnl End of ac_attribute.m4

12
po/.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
Makefile.in.in
Makevars.template
POTFILES
Rules-quot
boldquot.sed
en@boldquot.header
en@quot.header
insert-header.sin
quot.sed
remove-potcdate.sed
remove-potcdate.sin
stamp-po

0
po/LINGUAS Normal file
View File

7
po/Makevars Normal file
View File

@ -0,0 +1,7 @@
DOMAIN = eve
subdir = po
top_builddir = ..
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
COPYRIGHT_HOLDER = Gustavo Sverzut Barbieri
MSGID_BUGS_ADDRESS = barbieri@profusion.mobi
EXTRA_LOCALE_CATEGORIES =

1
po/POTFILES.in Normal file
View File

@ -0,0 +1 @@
src/bin/main.c

6
src/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.deps
.libs
*.o
*.a
*.lo
*.la

2
src/Makefile.am Normal file
View File

@ -0,0 +1,2 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = bin

2
src/bin/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
eve
eve_ql

40
src/bin/Makefile.am Normal file
View File

@ -0,0 +1,40 @@
MAINTAINERCLEANFILES = Makefile.in
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/bin \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
-DLOCALEDIR=\"$(localedir)\" \
@ELEMENTARY_CFLAGS@ \
@EWEBKIT_CFLAGS@
bin_PROGRAMS = eve
if BUILD_QUICKLAUNCH
bin_PROGRAMS += eve_ql
endif
eve_LDADD = @ELEMENTARY_LIBS@ @EWEBKIT_LIBS@
eve_SOURCES = main.c view.c chrome.c favorite.c history.c
if BUILD_QUICKLAUNCH
############################################################################
## Build quick launch binary, needs elementary_quicklaunch to be enabled. ##
## ##
## It is composed of a library with actual code and a binary that talks ##
## to server that will then fork() + dlopen() such library. ##
############################################################################
eve_qldir = $(quicklauncher_libdir)
eve_ql_LTLIBRARIES = eve_ql.la
eve_ql_la_SOURCES = main.c view.c chrome.c
eve_ql_la_LIBADD = @ELEMENTARY_LIBS@ @EWEBKIT_LIBS@
eve_ql_la_CFLAGS =
eve_ql_la_LDFLAGS = -module -avoid-version -no-undefined
eve_ql_SOURCES = main.c
eve_ql_LDADD = @ELEMENTARY_LIBS@
eve_ql_CFLAGS = -DELM_LIB_QUICKLAUNCH=1
eve_ql_LDFLAGS =
endif
noinst_HEADERS = gettext.h private.h favorite.h history.h
EXTRA_DIST = gettext.h private.h favorite.h history.h

1369
src/bin/chrome.c Normal file

File diff suppressed because it is too large Load Diff

295
src/bin/favorite.c Normal file
View File

@ -0,0 +1,295 @@
/* This file has been automatically generated by geneet.py */
/* DO NOT MODIFY */
#include <limits.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "favorite.h"
struct _Fav_Item {
const char * url;
const char * title;
unsigned int visit_count;
};
struct _Fav {
int version;
Eina_Hash * items;
const char *__eet_filename;
};
static const char FAV_ITEM_ENTRY[] = "fav_item";
static const char FAV_ENTRY[] = "fav";
static Eet_Data_Descriptor *_fav_item_descriptor = NULL;
static Eet_Data_Descriptor *_fav_descriptor = NULL;
static inline void
_fav_item_init(void)
{
Eet_Data_Descriptor_Class eddc;
if (_fav_item_descriptor) return;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Fav_Item);
_fav_item_descriptor = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_fav_item_descriptor, Fav_Item, "url", url, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_fav_item_descriptor, Fav_Item, "title", title, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_fav_item_descriptor, Fav_Item, "visit_count", visit_count, EET_T_UINT);
}
static inline void
_fav_item_shutdown(void)
{
if (!_fav_item_descriptor) return;
eet_data_descriptor_free(_fav_item_descriptor);
_fav_item_descriptor = NULL;
}
Fav_Item *
fav_item_new(const char * url, const char * title, unsigned int visit_count)
{
Fav_Item *fav_item = calloc(1, sizeof(Fav_Item));
if (!fav_item)
{
fprintf(stderr, "ERROR: could not calloc Fav_Item\n");
return NULL;
}
fav_item->url = eina_stringshare_add(url ? url : "about:blank");
fav_item->title = eina_stringshare_add(title ? title : "Untitled");
fav_item->visit_count = visit_count;
return fav_item;
}
void
fav_item_free(Fav_Item *fav_item)
{
eina_stringshare_del(fav_item->url);
eina_stringshare_del(fav_item->title);
free(fav_item);
}
inline const char *
fav_item_url_get(const Fav_Item *fav_item)
{
return fav_item->url;
}
inline void
fav_item_url_set(Fav_Item *fav_item, const char *url)
{
EINA_SAFETY_ON_NULL_RETURN(fav_item);
eina_stringshare_del(fav_item->url);
fav_item->url = eina_stringshare_add(url);
}
inline const char *
fav_item_title_get(const Fav_Item *fav_item)
{
return fav_item->title;
}
inline void
fav_item_title_set(Fav_Item *fav_item, const char *title)
{
EINA_SAFETY_ON_NULL_RETURN(fav_item);
eina_stringshare_del(fav_item->title);
fav_item->title = eina_stringshare_add(title);
}
inline unsigned int
fav_item_visit_count_get(const Fav_Item *fav_item)
{
return fav_item->visit_count;
}
inline void
fav_item_visit_count_set(Fav_Item *fav_item, unsigned int visit_count)
{
EINA_SAFETY_ON_NULL_RETURN(fav_item);
fav_item->visit_count = visit_count;
}
static inline void
_fav_init(void)
{
Eet_Data_Descriptor_Class eddc;
if (_fav_descriptor) return;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Fav);
_fav_descriptor = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_fav_descriptor, Fav, "version", version, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_HASH(_fav_descriptor, Fav, "items", items, _fav_item_descriptor);
}
static inline void
_fav_shutdown(void)
{
if (!_fav_descriptor) return;
eet_data_descriptor_free(_fav_descriptor);
_fav_descriptor = NULL;
}
Fav *
fav_new(int version)
{
Fav *fav = calloc(1, sizeof(Fav));
if (!fav)
{
fprintf(stderr, "ERROR: could not calloc Fav\n");
return NULL;
}
fav->version = version;
fav->items = eina_hash_stringshared_new(EINA_FREE_CB(fav_item_free));
return fav;
}
void
fav_free(Fav *fav)
{
eina_hash_free(fav->items);
free(fav);
}
inline int
fav_version_get(const Fav *fav)
{
return fav->version;
}
inline void
fav_version_set(Fav *fav, int version)
{
EINA_SAFETY_ON_NULL_RETURN(fav);
fav->version = version;
}
void
fav_items_add(Fav *fav, const char * url, Fav_Item *fav_item)
{
EINA_SAFETY_ON_NULL_RETURN(fav);
eina_hash_add(fav->items, url, fav_item);
}
void
fav_items_del(Fav *fav, const char * url)
{
EINA_SAFETY_ON_NULL_RETURN(fav);
eina_hash_del(fav->items, url, NULL);
}
inline Fav_Item *
fav_items_get(const Fav *fav, const char * url)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fav, NULL);
return eina_hash_find(fav->items, url);
}
inline Eina_Hash *
fav_items_hash_get(const Fav *fav)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fav, NULL);
return fav->items;
}
void
fav_items_modify(Fav *fav, const char * key, void *value)
{
EINA_SAFETY_ON_NULL_RETURN(fav);
eina_hash_modify(fav->items, key, value);
}
Fav *
fav_load(const char *filename)
{
Fav *fav;
Eet_File *ef = eet_open(filename, EET_FILE_MODE_READ);
if (!ef)
{
fprintf(stderr, "ERROR: could not open '%s' for read\n", filename);
return NULL;
}
fav = eet_data_read(ef, _fav_descriptor, FAV_ENTRY);
fav->__eet_filename = eina_stringshare_add(filename);
if (!fav->items) fav->items = eina_hash_stringshared_new(EINA_FREE_CB(fav_item_free));
eet_close(ef);
return fav;
}
Eina_Bool
fav_save(Fav *fav, const char *filename)
{
char tmp[PATH_MAX];
Eet_File *ef;
Eina_Bool ret;
unsigned int i, len;
struct stat st;
if (filename) fav->__eet_filename = eina_stringshare_add(filename);
else if (fav->__eet_filename) filename = fav->__eet_filename;
else return EINA_FALSE;
len = eina_strlcpy(tmp, filename, sizeof(tmp));
if (len + 12 >= (int)sizeof(tmp))
{
fprintf(stderr, "ERROR: filename is too big: %s\n", filename);
return EINA_FALSE;
}
i = 0;
do
{
snprintf(tmp + len, 12, ".%u", i);
i++;
}
while(stat(tmp, &st) == 0);
ef = eet_open(tmp, EET_FILE_MODE_WRITE);
if (!ef)
{
fprintf(stderr, "ERROR: could not open '%s' for write\n", tmp);
return EINA_FALSE;
}
ret = !!eet_data_write(ef, _fav_descriptor, FAV_ENTRY, fav, EINA_TRUE);
eet_close(ef);
if (ret)
{
unlink(filename);
rename(tmp, filename);
}
return ret;
}
void
favorite_init(void)
{
_fav_item_init();
_fav_init();
}
void
favorite_shutdown(void)
{
_fav_item_shutdown();
_fav_shutdown();
}

43
src/bin/favorite.h Normal file
View File

@ -0,0 +1,43 @@
/* This file has been automatically generated by geneet.py */
/* DO NOT MODIFY */
#ifndef __FAVORITE_H__
#define __FAVORITE_H__
#include <Eina.h>
#include <Eet.h>
typedef struct _Fav_Item Fav_Item;
typedef struct _Fav Fav;
/* Fav_Item */
Fav_Item *fav_item_new(const char * url, const char * title, unsigned int visit_count);
void fav_item_free(Fav_Item *fav_item);
void fav_item_url_set(Fav_Item *fav_item, const char * url);
const char * fav_item_url_get(const Fav_Item *fav_item);
void fav_item_title_set(Fav_Item *fav_item, const char * title);
const char * fav_item_title_get(const Fav_Item *fav_item);
void fav_item_visit_count_set(Fav_Item *fav_item, unsigned int visit_count);
unsigned int fav_item_visit_count_get(const Fav_Item *fav_item);
/* Fav */
Fav *fav_new(int version);
void fav_free(Fav *fav);
void fav_version_set(Fav *fav, int version);
int fav_version_get(const Fav *fav);
void fav_items_add(Fav *fav, const char * url, Fav_Item *fav_item);
void fav_items_del(Fav *fav, const char * url);
Fav_Item *fav_items_get(const Fav *fav, const char * key);
Eina_Hash *fav_items_hash_get(const Fav *fav);
void fav_items_modify(Fav *fav, const char * key, void *value);
Fav *fav_load(const char *filename);
Eina_Bool fav_save(Fav *fav, const char *filename);
/* Global initializer / shutdown functions */
void favorite_init(void);
void favorite_shutdown(void);
#endif /* __FAVORITE_H__ */

268
src/bin/gettext.h Normal file
View File

@ -0,0 +1,268 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004-2006 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 2, 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
#define _(x) gettext(x)
#define N_(x) gettext_noop(x)
/* NLS can be disabled through the configure --disable-nls option. */
#if ENABLE_NLS
/* 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 <locale.h> a NOP. We don't include <libintl.h>
as well because people using "gettext.h" will not include <libintl.h>,
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
is OK. */
#if defined(__sun)
# include <locale.h>
#endif
/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
<libintl.h>, which chokes if dcgettext is defined as a macro. So include
it now, to make later inclusions of <libintl.h> a NOP. */
#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
# include <cstdlib>
#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". */
# define gettext(Msgid) ((const char *) (Msgid))
# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
# define dcgettext(Domainname, Msgid, Category) \
((void) (Category), dgettext (Domainname, Msgid))
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 \
? ((void) (Msgid2), (const char *) (Msgid1)) \
: ((void) (Msgid1), (const char *) (Msgid2)))
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((void) (Domainname), ngettext (Msgid1, Msgid2, N))
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
# define textdomain(Domainname) ((const char *) (Domainname))
# define bindtextdomain(Domainname, Dirname) \
((void) (Domainname), (const char *) (Dirname))
# 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 <string.h>
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
(((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
/* || __STDC_VERSION__ >= 199901L */ )
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
#include <stdlib.h>
#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 */

311
src/bin/history.c Normal file
View File

@ -0,0 +1,311 @@
/* This file has been automatically generated by geneet.py */
/* DO NOT MODIFY */
#include <limits.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "history.h"
struct _Hist_Item {
const char * title;
const char * url;
unsigned int visit_count;
double last_visit;
};
struct _Hist {
int version;
Eina_Hash * items;
const char *__eet_filename;
};
static const char HIST_ITEM_ENTRY[] = "hist_item";
static const char HIST_ENTRY[] = "hist";
static Eet_Data_Descriptor *_hist_item_descriptor = NULL;
static Eet_Data_Descriptor *_hist_descriptor = NULL;
static inline void
_hist_item_init(void)
{
Eet_Data_Descriptor_Class eddc;
if (_hist_item_descriptor) return;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Hist_Item);
_hist_item_descriptor = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_hist_item_descriptor, Hist_Item, "title", title, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_hist_item_descriptor, Hist_Item, "url", url, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_hist_item_descriptor, Hist_Item, "visit_count", visit_count, EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_hist_item_descriptor, Hist_Item, "last_visit", last_visit, EET_T_DOUBLE);
}
static inline void
_hist_item_shutdown(void)
{
if (!_hist_item_descriptor) return;
eet_data_descriptor_free(_hist_item_descriptor);
_hist_item_descriptor = NULL;
}
Hist_Item *
hist_item_new(const char * title, const char * url, unsigned int visit_count, double last_visit)
{
Hist_Item *hist_item = calloc(1, sizeof(Hist_Item));
if (!hist_item)
{
fprintf(stderr, "ERROR: could not calloc Hist_Item\n");
return NULL;
}
hist_item->title = eina_stringshare_add(title ? title : "Untitled");
hist_item->url = eina_stringshare_add(url ? url : "about:blank");
hist_item->visit_count = visit_count;
hist_item->last_visit = last_visit;
return hist_item;
}
void
hist_item_free(Hist_Item *hist_item)
{
eina_stringshare_del(hist_item->title);
eina_stringshare_del(hist_item->url);
free(hist_item);
}
inline const char *
hist_item_title_get(const Hist_Item *hist_item)
{
return hist_item->title;
}
inline void
hist_item_title_set(Hist_Item *hist_item, const char *title)
{
EINA_SAFETY_ON_NULL_RETURN(hist_item);
eina_stringshare_del(hist_item->title);
hist_item->title = eina_stringshare_add(title);
}
inline const char *
hist_item_url_get(const Hist_Item *hist_item)
{
return hist_item->url;
}
inline void
hist_item_url_set(Hist_Item *hist_item, const char *url)
{
EINA_SAFETY_ON_NULL_RETURN(hist_item);
eina_stringshare_del(hist_item->url);
hist_item->url = eina_stringshare_add(url);
}
inline unsigned int
hist_item_visit_count_get(const Hist_Item *hist_item)
{
return hist_item->visit_count;
}
inline void
hist_item_visit_count_set(Hist_Item *hist_item, unsigned int visit_count)
{
EINA_SAFETY_ON_NULL_RETURN(hist_item);
hist_item->visit_count = visit_count;
}
inline double
hist_item_last_visit_get(const Hist_Item *hist_item)
{
return hist_item->last_visit;
}
inline void
hist_item_last_visit_set(Hist_Item *hist_item, double last_visit)
{
EINA_SAFETY_ON_NULL_RETURN(hist_item);
hist_item->last_visit = last_visit;
}
static inline void
_hist_init(void)
{
Eet_Data_Descriptor_Class eddc;
if (_hist_descriptor) return;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Hist);
_hist_descriptor = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_hist_descriptor, Hist, "version", version, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_HASH(_hist_descriptor, Hist, "items", items, _hist_item_descriptor);
}
static inline void
_hist_shutdown(void)
{
if (!_hist_descriptor) return;
eet_data_descriptor_free(_hist_descriptor);
_hist_descriptor = NULL;
}
Hist *
hist_new(int version)
{
Hist *hist = calloc(1, sizeof(Hist));
if (!hist)
{
fprintf(stderr, "ERROR: could not calloc Hist\n");
return NULL;
}
hist->version = version;
hist->items = eina_hash_stringshared_new(EINA_FREE_CB(hist_item_free));
return hist;
}
void
hist_free(Hist *hist)
{
eina_hash_free(hist->items);
free(hist);
}
inline int
hist_version_get(const Hist *hist)
{
return hist->version;
}
inline void
hist_version_set(Hist *hist, int version)
{
EINA_SAFETY_ON_NULL_RETURN(hist);
hist->version = version;
}
void
hist_items_add(Hist *hist, const char * url, Hist_Item *hist_item)
{
EINA_SAFETY_ON_NULL_RETURN(hist);
eina_hash_add(hist->items, url, hist_item);
}
void
hist_items_del(Hist *hist, const char * url)
{
EINA_SAFETY_ON_NULL_RETURN(hist);
eina_hash_del(hist->items, url, NULL);
}
inline Hist_Item *
hist_items_get(const Hist *hist, const char * url)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(hist, NULL);
return eina_hash_find(hist->items, url);
}
inline Eina_Hash *
hist_items_hash_get(const Hist *hist)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(hist, NULL);
return hist->items;
}
void
hist_items_modify(Hist *hist, const char * key, void *value)
{
EINA_SAFETY_ON_NULL_RETURN(hist);
eina_hash_modify(hist->items, key, value);
}
Hist *
hist_load(const char *filename)
{
Hist *hist;
Eet_File *ef = eet_open(filename, EET_FILE_MODE_READ);
if (!ef)
{
fprintf(stderr, "ERROR: could not open '%s' for read\n", filename);
return NULL;
}
hist = eet_data_read(ef, _hist_descriptor, HIST_ENTRY);
hist->__eet_filename = eina_stringshare_add(filename);
if (!hist->items) hist->items = eina_hash_stringshared_new(EINA_FREE_CB(hist_item_free));
eet_close(ef);
return hist;
}
Eina_Bool
hist_save(Hist *hist, const char *filename)
{
char tmp[PATH_MAX];
Eet_File *ef;
Eina_Bool ret;
unsigned int i, len;
struct stat st;
if (filename) hist->__eet_filename = eina_stringshare_add(filename);
else if (hist->__eet_filename) filename = hist->__eet_filename;
else return EINA_FALSE;
len = eina_strlcpy(tmp, filename, sizeof(tmp));
if (len + 12 >= (int)sizeof(tmp))
{
fprintf(stderr, "ERROR: filename is too big: %s\n", filename);
return EINA_FALSE;
}
i = 0;
do
{
snprintf(tmp + len, 12, ".%u", i);
i++;
}
while(stat(tmp, &st) == 0);
ef = eet_open(tmp, EET_FILE_MODE_WRITE);
if (!ef)
{
fprintf(stderr, "ERROR: could not open '%s' for write\n", tmp);
return EINA_FALSE;
}
ret = !!eet_data_write(ef, _hist_descriptor, HIST_ENTRY, hist, EINA_TRUE);
eet_close(ef);
if (ret)
{
unlink(filename);
rename(tmp, filename);
}
return ret;
}
void
history_init(void)
{
_hist_item_init();
_hist_init();
}
void
history_shutdown(void)
{
_hist_item_shutdown();
_hist_shutdown();
}

45
src/bin/history.h Normal file
View File

@ -0,0 +1,45 @@
/* This file has been automatically generated by geneet.py */
/* DO NOT MODIFY */
#ifndef __HISTORY_H__
#define __HISTORY_H__
#include <Eina.h>
#include <Eet.h>
typedef struct _Hist_Item Hist_Item;
typedef struct _Hist Hist;
/* Hist_Item */
Hist_Item *hist_item_new(const char * title, const char * url, unsigned int visit_count, double last_visit);
void hist_item_free(Hist_Item *hist_item);
void hist_item_title_set(Hist_Item *hist_item, const char * title);
const char * hist_item_title_get(const Hist_Item *hist_item);
void hist_item_url_set(Hist_Item *hist_item, const char * url);
const char * hist_item_url_get(const Hist_Item *hist_item);
void hist_item_visit_count_set(Hist_Item *hist_item, unsigned int visit_count);
unsigned int hist_item_visit_count_get(const Hist_Item *hist_item);
void hist_item_last_visit_set(Hist_Item *hist_item, double last_visit);
double hist_item_last_visit_get(const Hist_Item *hist_item);
/* Hist */
Hist *hist_new(int version);
void hist_free(Hist *hist);
void hist_version_set(Hist *hist, int version);
int hist_version_get(const Hist *hist);
void hist_items_add(Hist *hist, const char * url, Hist_Item *hist_item);
void hist_items_del(Hist *hist, const char * url);
Hist_Item *hist_items_get(const Hist *hist, const char * key);
Eina_Hash *hist_items_hash_get(const Hist *hist);
void hist_items_modify(Hist *hist, const char * key, void *value);
Hist *hist_load(const char *filename);
Eina_Bool hist_save(Hist *hist, const char *filename);
/* Global initializer / shutdown functions */
void history_init(void);
void history_shutdown(void);
#endif /* __HISTORY_H__ */

430
src/bin/main.c Normal file
View File

@ -0,0 +1,430 @@
/*
* eve
*
* Copyright (C) 2009, Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
*
* License LGPL-3, see COPYING file at project folder.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH
#include "favorite.h"
#include "private.h"
#include <Ecore_Getopt.h>
#include <Ecore_File.h>
#include <stdlib.h>
#include "gettext.h"
int _log_domain = -1;
Fav *fav = NULL;
Hist *hist = NULL;
App app;
static void
del_win(App * app, Evas_Object * win)
{
Browser_Window *win_data;
Eina_List *l;
EINA_LIST_FOREACH(app->windows, l, win_data) if (win_data->win == win)
break;
evas_object_del(win);
app->windows = eina_list_remove(app->windows, win_data);
free(win_data);
if (!app->windows)
elm_exit();
}
static void
on_win_del_req(void *data, Evas_Object * win, void *event_info __UNUSED__)
{
del_win(data, win);
}
/* this should be in elm_win... */
static void
win_mouse_disable(Evas_Object * win)
{
Evas *e = evas_object_evas_get(win);
Ecore_Evas *ee = evas_data_attach_get(e);
Evas_Object *cursor = evas_object_rectangle_add(e);
evas_object_color_set(cursor, 0, 0, 0, 0);
evas_object_resize(cursor, 1, 1);
ecore_evas_object_cursor_set(ee, cursor, EVAS_LAYER_MIN, 0, 0);
}
Eina_Bool
tab_add(Browser_Window * win, const char *url)
{
Evas_Object *chrome = chrome_add(win, url);
if (!chrome)
{
CRITICAL("Could not create chrome.");
goto error_chrome_create;
}
evas_object_size_hint_weight_set(chrome, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(chrome);
win->chromes = eina_list_append(win->chromes, chrome);
win->current_chrome = chrome;
win->current_view = evas_object_data_get(chrome, "view");
win->current_tab++;
return EINA_TRUE;
error_chrome_create:
evas_object_del(evas_object_data_get(chrome, "view"));
return EINA_FALSE;
}
Eina_Bool
tab_focus_chrome(Browser_Window * win, Evas_Object * chrome)
{
Eina_List *itr;
int n;
if (!chrome)
return EINA_FALSE;
for (n = 0, itr = win->chromes; itr->data != chrome; n++, itr = itr->next);
evas_object_hide(win->current_chrome);
win->current_chrome = chrome;
win->current_view = evas_object_data_get(chrome, "view");
win->current_tab = n;
evas_object_show(win->current_chrome);
evas_object_focus_set(win->current_view, EINA_TRUE);
elm_pager_content_promote(win->pager, win->current_chrome);
return EINA_TRUE;
}
Eina_Bool
tab_focus_nth(Browser_Window * win, unsigned int n)
{
return tab_focus_chrome(win, eina_list_nth(win->chromes, n));
}
Eina_Bool
tab_focus_next(Browser_Window * win)
{
unsigned int n_tabs = eina_list_count(win->chromes);
if (win->current_tab > n_tabs)
return EINA_FALSE;
return tab_focus_nth(win, win->current_tab + 1);
}
Eina_Bool
tab_focus_prev(Browser_Window * win)
{
if (win->current_tab == 0)
return EINA_FALSE;
return tab_focus_nth(win, win->current_tab - 1);
}
Eina_Bool
tab_close_chrome(Browser_Window * win, Evas_Object * chrome)
{
Evas_Object *edje;
EINA_SAFETY_ON_TRUE_RETURN_VAL(!win, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(!chrome, EINA_FALSE);
if (!win->chromes->next)
{
del_win(win->app, win->win);
return EINA_TRUE;
}
evas_object_del(chrome);
win->chromes = eina_list_remove(win->chromes, chrome);
if (win->current_chrome == chrome)
tab_focus_nth(win, 0);
edje = elm_layout_edje_get(win->current_chrome);
edje_object_signal_emit(edje, "hide,tab", "");
return EINA_TRUE;
}
Eina_Bool
tab_close_nth(Browser_Window * win, int n)
{
return tab_close_chrome(win, eina_list_nth(win->chromes, n));
}
Eina_Bool
tab_close_view(Browser_Window * win, Evas_Object *view)
{
return tab_close_chrome(win, evas_object_data_get(view, "chrome"));
}
static Browser_Window *
add_win(App * app, const char *url)
{
Browser_Window *win = malloc(sizeof(*win));
if (!win)
{
CRITICAL("Could not create window data.");
goto error_win_data;
}
win->app = app;
win->chromes = NULL;
win->current_chrome = NULL;
win->current_view = NULL;
win->current_tab = 0;
win->list_history = NULL;
win->list_history_titles = NULL;
win->win = elm_win_add(NULL, "eve", ELM_WIN_BASIC);
if (!win->win)
{
CRITICAL("Could not create window.");
goto error_win_create;
}
elm_win_title_set(win->win, PACKAGE_STRING);
elm_win_fullscreen_set(win->win, app->is_fullscreen);
if (app->disable_mouse)
win_mouse_disable(win->win);
win->bg = edje_object_add(evas_object_evas_get(win->win));
if (!win->bg)
{
CRITICAL("Could not create background.");
goto error_bg_create;
}
if (!edje_object_file_set(win->bg, PACKAGE_DATA_DIR "/default.edj", "bg"))
{
int err = edje_object_load_error_get(win->bg);
const char *msg = edje_load_error_str(err);
CRITICAL("Could not load background theme: %s", msg);
goto error_bg_theme_set;
}
evas_object_size_hint_weight_set(win->bg, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
elm_win_resize_object_add(win->win, win->bg);
evas_object_layer_set(win->bg, EVAS_LAYER_MIN);
evas_object_show(win->bg);
win->pager = elm_pager_add(win->win);
if (!win->pager)
{
CRITICAL("Could not create pager");
goto error_pager_create;
}
elm_object_style_set(win->pager, "ewebkit");
evas_object_size_hint_weight_set(win->pager, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
elm_win_resize_object_add(win->win, win->pager);
evas_object_show(win->pager);
if (!tab_add(win, url))
goto error_tab_add;
app->windows = eina_list_append(app->windows, win);
evas_object_smart_callback_add
(win->win, "delete-request", on_win_del_req, app);
evas_object_resize(win->win, 480, 800);
evas_object_show(win->win);
return win;
error_bg_theme_set:
evas_object_del(win->bg);
error_bg_create:
evas_object_del(win->win);
error_win_create:
free(win);
error_win_data:
error_tab_add:
error_pager_create:
return NULL;
}
/**
* Creates a new window, without any url to load, calling add_win().
*
* @return If a window was successfully created, it returns the correspondent view
* object.
*/
Evas_Object *
window_create()
{
Browser_Window *win = add_win(&app, NULL);
if (!win)
return NULL;
return win->current_view;
}
static const Ecore_Getopt options = {
PACKAGE_NAME,
"%prog [options] [url]",
PACKAGE_VERSION,
"(C) 2000 ProFUSION embedded systems",
"LGPL-3",
"WebKit-EFL demo browser for mobile systems with touchscreen.",
EINA_TRUE,
{
ECORE_GETOPT_STORE_DEF_BOOL('F', "fullscreen", "start in fullscreen.", 1),
ECORE_GETOPT_STORE_DEF_BOOL('P', "disable-plugins",
"disable plugins (flash, etc).", 1),
ECORE_GETOPT_STORE_DEF_BOOL('M', "disable-mouse",
"disable mouse (hide it).", 1),
ECORE_GETOPT_STORE_STR('U', "user-agent",
"user agent string to use. Special case=iphone."),
ECORE_GETOPT_VERSION('V', "version"),
ECORE_GETOPT_COPYRIGHT('R', "copyright"),
ECORE_GETOPT_LICENSE('L', "license"),
ECORE_GETOPT_HELP('h', "help"),
ECORE_GETOPT_SENTINEL}
};
EAPI int
elm_main(int argc, char **argv)
{
int r = 0, args;
const char *home;
const char *url;
char path[PATH_MAX];
Eina_Bool quit_option = EINA_FALSE;
char *user_agent = NULL;
Ecore_Getopt_Value values[] = {
ECORE_GETOPT_VALUE_BOOL(app.is_fullscreen),
ECORE_GETOPT_VALUE_BOOL(app.disable_plugins),
ECORE_GETOPT_VALUE_BOOL(app.disable_mouse),
ECORE_GETOPT_VALUE_STR(user_agent),
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(GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
#endif
_log_domain = eina_log_domain_register("eve", NULL);
if (_log_domain < 0)
{
EINA_LOG_CRIT("could not create log domain 'eve'.");
return -1;
}
args = ecore_getopt_parse(&options, values, argc, argv);
if (args < 0)
{
ERR("Could not parse command line options.");
return -1;
}
if (quit_option)
{
DBG("Command lines option requires quit.");
return 0;
}
if (args < argc)
url = argv[args];
else
url = DEFAULT_URL;
if (user_agent && strcasecmp(user_agent, "iphone") == 0)
user_agent =
"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3";
app.user_agent = eina_stringshare_add(user_agent);
elm_theme_extension_add(NULL, PACKAGE_DATA_DIR "/default.edj");
ewk_init();
favorite_init();
history_init();
home = getenv("HOME");
if (!home || !home[0])
{
CRITICAL("Could not get $HOME");
r = -1;
goto end;
}
snprintf(path, sizeof(path), "%s/.config/ewebkit", home);
if (!ecore_file_mkpath(path))
{
ERR("Could not create %s", path);
r = -1;
goto end;
}
if (!ewk_settings_icon_database_path_set(path))
{
ERR("Could not set icon database path to %s", path);
r = -1;
goto end;
}
snprintf(path, sizeof(path), "%s/.config/ewebkit/favorites.db", home);
fav = fav_load(path);
if (!fav)
{
fav = fav_new(0);
fav_save(fav, path);
}
snprintf(path, sizeof(path), "%s/.config/ewebkit/history.db", home);
hist = hist_load(path);
if (!hist)
{
hist = hist_new(0);
hist_save(hist, path);
}
if (!add_win(&app, url))
{
r = -1;
goto end;
}
elm_run();
end:
fav_save(fav, NULL);
fav_free(fav);
hist_save(hist, NULL);
hist_free(hist);
eina_stringshare_del(app.user_agent);
eina_log_domain_unregister(_log_domain);
_log_domain = -1;
elm_shutdown();
ewk_shutdown();
favorite_shutdown();
history_shutdown();
return r;
}
#endif
ELM_MAIN()

98
src/bin/private.h Normal file
View File

@ -0,0 +1,98 @@
#ifndef EWEBKIT_DEMO_PRIVATE_H
#define EWEBKIT_DEMO_PRIVATE_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <Elementary.h>
#include <EWebKit.h>
#include "favorite.h"
#include "history.h"
typedef struct _App App;
typedef struct _Browser_Window Browser_Window;
typedef struct _View_Zoom_Interactive View_Zoom_Interactive;
extern int _log_domain;
extern Fav *fav;
extern Hist *hist;
extern App app;
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
#define WRN(...) EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
#define DEFAULT_URL "http://www.google.com"
/* TODO: Move all tab related stuff to its own struct */
struct _Browser_Window
{
App *app;
Evas_Object *win;
Evas_Object *bg;
Evas_Object *pager;
Eina_List *chromes;
Eina_List *list_history;
Eina_List *list_history_titles;
Evas_Object *current_chrome;
Evas_Object *current_view;
unsigned int current_tab;
};
struct _App
{
Eina_List *windows;
const char *user_agent;
Eina_Bool is_fullscreen;
Eina_Bool disable_plugins;
Eina_Bool disable_mouse;
};
struct _View_Zoom_Interactive
{
Evas_Coord x, y;
float zoom;
};
/**
* Create new view object.
*
* Signals:
*
* * "zoom,interactive" View_Zoom_Interactive: zoom interactive
* requested a new level specified in given event information.
*
* * "zoom,interactive,start" void: report zoom interactive started.
* * "zoom,interactive,end" void: report zoom interactive is finished.
*/
Evas_Object *window_create();
Evas_Object *view_add(Evas_Object *parent);
void view_zoom_next_up(Evas_Object *view);
void view_zoom_next_down(Evas_Object *view);
Eina_Bool view_context_menu_set(Evas_Object *view, Evas_Object *widget, Ewk_Context_Menu *menu);
Evas_Object *view_context_menu_widget_get(Evas_Object *view);
Ewk_Context_Menu *view_context_menu_get(Evas_Object *view);
Evas_Object *chrome_add(Browser_Window *win, const char *url);
Eina_Bool tab_add(Browser_Window *win, const char *url);
Eina_Bool tab_focus_nth(Browser_Window *win, unsigned int n);
Eina_Bool tab_focus_chrome(Browser_Window * win, Evas_Object * chrome);
Eina_Bool tab_focus_next(Browser_Window *win);
Eina_Bool tab_focus_prev(Browser_Window *win);
Eina_Bool tab_close_nth(Browser_Window *win, int n);
Eina_Bool tab_close_view(Browser_Window *win, Evas_Object * view);
Eina_Bool tab_close_chrome(Browser_Window * win, Evas_Object * chrome);
#endif

1602
src/bin/view.c Normal file

File diff suppressed because it is too large Load Diff

18
test/test-combo.html Normal file
View File

@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Test combobox </title>
</head>
<body>
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</body>
</html>

25
test/test-js-alert.html Normal file
View File

@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Test JS alert message </title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function show_alert() {
name = alert("This is an alert message. <br>Only one \"Close\" button is used.");
}
alert("adasdas");
</SCRIPT>
</head>
<body>
<h1>test JS alert message</h1>
<br>
This test should send a message using alert() on javascript. This tipically means
a popup showing the message with a button to close it.
<p><input type='button' value='Show alert' onClick='show_alert()'></p>
</body>
</html>

26
test/test-js-confirm.html Normal file
View File

@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Test JS confirm message </title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function show_confirm() {
ret = confirm("I'm going to test ok button");
if (ret)
alert("chosen: OK");
else
alert("chosen: Cancel");
}
</SCRIPT>
</head>
<body>
<h1>test js confirm messsage</h1>
<br>
This test shows a confirm message, waiting for user to answer OK or CANCEL. Tipically it is implemented
as a dialog. The default handling function is to print to stdout and confirm.
<p><input type='button' value='Show confirm' onClick='show_confirm()'></p>
</body>
</html>

View File

@ -0,0 +1,21 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Test JS console message </title>
</head>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
var err = new Error();
err.name = 'My Console Message test';
err.message = 'Test error message';
throw(err);
</SCRIPT>
<body>
<h1>test js console messsage</h1>
<br>
This test should send a message to console. The default handling function is to print
to stdout.
</body>
</html>

23
test/test-js-prompt.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test JS prompt</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function show_prompt() {
var name;
name = prompt ("what's your name?", "my default value defined in html");
alert ("Your name is "+name);
}
</SCRIPT>
</head>
<body>
<h1>test JS prompt</h1>
<br>
This test shows a prompt message, asking for user to enter text. Tipically it is implemented
as a dialog. The default handling function is to print to stdout and answer 'test'.
<p><input type='button' value='Show prompt' onClick='show_prompt()'></p>
</body>
</html>

13
test/test-newindow.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Test -- Link will open a new window </title>
</head>
<body>
<a href="http://www.google.com" target="_blank">Go to Google</a>
</body>
</html>

View File

@ -0,0 +1,23 @@
<html>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function test_infinite_loop() {
var name;
document.write("Running stupid infinite loop...");
var i=1;
while(i) {
document.write("stupid script")
i++;
}
alert ("I should never reach this");
}
</SCRIPT>
<h1>test should interrupt javascript</h1>
<br>
This test shows a prompt message, asking for user to enter text. Tipically it is implemented
as a dialog. The default handling function is to print to stdout and answer 'test'.
<p><input type='button' value='Run infinite loop' onClick='test_infinite_loop()'></p>
</html>