Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-01-29 19:13:07 +09:00
commit 05e0fa5459
246 changed files with 4461 additions and 2489 deletions

View File

@ -25,6 +25,10 @@ if [ "$BUILDSYSTEM" = "ninja" ] ; then
OPTS="$OPTS $DISABLED_LINUX_COPTS"
fi
if [ "$1" = "wayland" ]; then
OPTS="$OPTS $WAYLAND_LINUX_COPTS"
fi
if [ "$1" = "release-ready" ]; then
OPTS="$OPTS $RELEASE_READY_LINUX_COPTS"
fi
@ -95,6 +99,10 @@ else
OPTS="$OPTS $DISABLED_LINUX_COPTS"
fi
if [ "$1" = "wayland" ]; then
OPTS="$OPTS $WAYLAND_LINUX_COPTS"
fi
if [ "$1" = "release-ready" ]; then
OPTS="$OPTS $RELEASE_READY_LINUX_COPTS"
fi

View File

@ -21,7 +21,7 @@ if [ "$BUILDSYSTEM" = "ninja" ] ; then
if [ "$DISTRO" != "" ] ; then
# disable them for this distros, after meson 0.49 is out, this can be removed
# https://github.com/mesonbuild/meson/commit/253c581412d7f2b09af353dd83d943454bd555be
if [ "$DISTRO" != "Ubuntu1804" ] && [ "$DISTRO" != "Debian91" ]; then
if [ "$DISTRO" != "Ubuntu1810" ] && [ "$DISTRO" != "Debian96" ]; then
for tries in $(seq 1 ${NUM_TRIES}); do
(docker exec --env EINA_LOG_BACKTRACE="0" --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) ninja -C build test) && break
docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) cat src/test-suite.log

View File

@ -7,10 +7,6 @@ cache:
sudo: required
dist: trusty
os:
- linux
- osx
env:
global:
- MAKEFLAGS="-j5 -rR"
@ -20,59 +16,46 @@ env:
jobs:
include:
- env:
- os: linux
- DISTRO=Fedora28-mingw
- CI_BUILD_TYPE=mingw
- env:
- os: linux
- DISTRO=Fedora28
- CI_BUILD_TYPE=options-enabled
- env:
- os: linux
- DISTRO=Fedora28
- CI_BUILD_TYPE=options-disabled
- env:
- os: linux
- DISTRO=Fedora28
- CI_BUILD_TYPE=options-enabled
- BUILDSYSTEM=ninja
- env:
- os: linux
- DISTRO=Fedora28
- CI_BUILD_TYPE=options-disabled
- BUILDSYSTEM=ninja
- if: type = cron
env:
- os: linux
- DISTRO=Ubuntu1804
- if: type = cron
env:
- os: linux
- DISTRO=Fedora28
- CI_BUILD_TYPE=release-ready
- if: type = cron
env:
- os: linux
- DISTRO=Debian91
- if: type = cron
env:
- os: linux
- DISTRO=Ubuntu1804
- BUILDSYSTEM=ninja
- if: type = cron
env:
- os: linux
- DISTRO=Fedora28
- CI_BUILD_TYPE=release-ready
- BUILDSYSTEM=ninja
- if: type = cron
env:
- os: linux
- DISTRO=Debian91
- BUILDSYSTEM=ninja
exclude:
- os: osx
env: BUILDSYSTEM=ninja
- os: linux
env: DISTRO=Fedora28-mingw CI_BUILD_TYPE=mingw
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=options-enabled
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=options-disabled
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=wayland
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=default
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=options-enabled BUILDSYSTEM=ninja
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=options-disabled BUILDSYSTEM=ninja
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=wayland BUILDSYSTEM=ninja
- os: linux
env: DISTRO=Fedora29 CI_BUILD_TYPE=default BUILDSYSTEM=ninja
- os: osx
if: type = cron
- os: linux
if: type = cron
env: DISTRO=Fedora29 CI_BUILD_TYPE=release-ready
- os: linux
if: type = cron
env: DISTRO=Fedora29 CI_BUILD_TYPE=release-ready BUILDSYSTEM=ninja
- os: linux
if: type = cron
env: DISTRO=Ubuntu1810
- os: linux
if: type = cron
env: DISTRO=Debian96
- os: linux
if: type = cron
env: DISTRO=Ubuntu1810 BUILDSYSTEM=ninja
- os: linux
if: type = cron
env: DISTRO=Debian96 BUILDSYSTEM=ninja
services:
- docker
@ -139,15 +122,6 @@ before_cache:
mv $HOME/Library/Caches/Homebrew $HOME/cachedir/Homebrew
fi
after_success:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
docker login -u stefanschmidt1 -p "$DOCKER_PASSWORD"
docker tag stefanschmidt1/ci-support-files:$DISTRO stefanschmidt1/ci-support-files:$DISTRO-$TRAVIS_BUILD_NUMBER
docker push stefanschmidt1/ci-support-files:$DISTRO
docker push stefanschmidt1/ci-support-files:$DISTRO-$TRAVIS_BUILD_NUMBER
fi
notifications:
irc:
channels:

View File

@ -225,6 +225,7 @@ elementary/objects/cursors.edj \
elementary/objects/font_preview.edj \
elementary/objects/postit_ent.edj \
elementary/objects/multibuttonentry.edj \
elementary/objects/test_pager.edj \
elementary/objects/test_prefs.edj \
elementary/objects/test_prefs.epb \
elementary/objects/test_focus_style.edj \
@ -276,6 +277,11 @@ elementary/objects/multibuttonentry.edj: elementary/objects/multibuttonentry.edc
$(MKDIR_P) elementary/objects/; \
$(EDJE_CC) $(EDJE_CC_FLAGS) $< $@
elementary/objects/test_pager.edj: elementary/objects/test_pager.edc
$(AM_V_EDJ) \
$(MKDIR_P) elementary/objects/; \
$(EDJE_CC) $(EDJE_CC_FLAGS) $< $@
elementary/objects/test_prefs.edj: elementary/objects/test_prefs.edc
$(AM_V_EDJ) \
$(MKDIR_P) elementary/objects/; \

View File

@ -1,7 +1,7 @@
custom_target('edje_cc_edje_externals',
input : 'icons.edc',
output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta',
command : edje_cc_exe + [ '-beta', '-fastcomp',
'-id', join_paths(meson.current_source_dir()),
'-id', elm_themes_image_include,
'@INPUT@', '@OUTPUT@'],

View File

@ -4,6 +4,7 @@ EXTRA_DIST += \
elementary/objects/test.edc \
elementary/objects/test_external.edc \
elementary/objects/test_masking.edc \
elementary/objects/test_pager.edc \
elementary/objects/test_prefs.edc \
elementary/objects/test_prefs.epc \
elementary/objects/test_tab_pager.edc \

View File

@ -5,6 +5,7 @@ edc_files = [
'test_masking.edc',
'test_tab_pager.edc',
'test_tooltip.edc',
'test_pager.edc',
'test_prefs.edc',
'cursors.edc',
'font_preview.edc',
@ -19,7 +20,7 @@ foreach edc_file : edc_files
elm_themes += custom_target('edje_cc_elm_' + edc_file,
input : edc_file,
output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta',
command : edje_cc_exe + [ '-beta', '-fastcomp',
'-sd', join_paths(meson.current_source_dir()),
'-id', elm_themes_image_include,
'-id', join_paths(meson.current_source_dir()),

View File

@ -0,0 +1,96 @@
collections {
group {
name: "pager";
parts {
rect { "bg";
desc { "default";
color: 0 0 0 0;
}
}
swallow { "pager";
desc { "default";
}
}
swallow { "prev_btn";
desc { "default";
rel1.relative: 0.0 0.5;
rel1.offset: 10 0;
rel2.relative: 0.0 0.5;
rel2.offset: 10 0;
align: 0.0 0.5;
min: 30 30;
}
}
swallow { "next_btn";
desc { "default";
rel1.relative: 1.0 0.5;
rel1.offset: -10 0;
rel2.relative: 1.0 0.5;
rel2.offset: -10 0;
align: 1.0 0.5;
min: 30 30;
}
}
}
}
group {
name: "page";
parts {
rect { "bg";
desc { "default";
}
}
text { "tl";
desc { "default";
rel1.relative: 0 0;
rel2.relative: 0 0;
align: 0 0;
color: 0 0 0 255;
text { size: 10;
min: 1 1;
}
}
}
text { "tr";
desc { "default";
rel1.relative: 1 0;
rel2.relative: 1 0;
align: 1 0;
color: 0 0 0 255;
text { size: 10;
min: 1 1;
}
}
}
text { "bl";
desc { "default";
rel1.relative: 0 1;
rel2.relative: 0 1;
align: 0 1;
color: 0 0 0 255;
text { size: 10;
min: 1 1;
}
}
}
text { "br";
desc { "default";
rel1.relative: 1 1;
rel2.relative: 1 1;
align: 1 1;
color: 0 0 0 255;
text { size: 10;
min: 1 1;
}
}
}
text { "text";
desc { "default";
color: 0 0 0 255;
text { size: 20;
}
}
}
}
}
}

View File

@ -6,7 +6,7 @@ EDJE_CC_ELM_FLAGS = \
-sd $(top_srcdir)/data/elementary/themes/snd \
-l $(top_srcdir)/COPYING \
-a $(top_srcdir)/AUTHORS \
-fastdecomp
-fastcomp
elementary_themes_files = \

View File

@ -13,8 +13,6 @@ group { "efl/pager";
swallow { "efl.page_root";
scale;
desc { "default";
rel1.relative: 0.0 1.0;
rel1.to: "efl.indicator";
}
}
swallow { "efl.indicator";

View File

@ -541,6 +541,21 @@ group { name: "elm/panel/left/default";
set_state(PART:"icn", "hidden", 0.0);
}
}
program {
signal: "elm,action,show,no_animate"; source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.event";
target: "base";
}
program {
signal: "elm,action,show,no_animate"; source: "elm";
script {
if (get_int(is_rtl) == 0)
set_state(PART:"icn", "default", 0.0);
else
set_state(PART:"icn", "hidden", 0.0);
}
}
program {
signal: "edje,state,rtl";
source: "edje";
@ -611,6 +626,46 @@ group { name: "elm/panel/left/default";
transition: ACCELERATE 0.3;
target: "base";
}
program {
signal: "elm,action,hide,no_animate"; source: "elm";
action: STATE_SET "hidden" 0.0;
target: "elm.swallow.event";
}
program {
signal: "elm,action,hide,no_animate"; source: "elm";
script {
if (get_int(is_rtl) == 0)
set_state(PART:"icn", "hidden", 0.0);
else
set_state(PART:"icn", "default", 0.0);
}
}
program { name: "hide1_no_animate";
signal: "elm,action,hide,no_animate"; source: "elm";
script {
new x, y, w, h;
if (get_int(is_rtl) == 0)
{
custom_state(PART:"base", "default", 0.0);
set_state_val(PART:"base", STATE_REL1, -1.0, 0.0);
get_geometry(PART:"elm.swallow.event", x, y, w, h);
set_state_val(PART:"base", STATE_REL1_OFFSET, w, 0);
}
else
{
custom_state(PART:"base", "default", 0.0);
set_state_val(PART:"base", STATE_REL1, -1.0, 0.0);
set_state_val(PART:"base", STATE_REL2, -2.0, 1.0);
get_geometry(PART:"elm.swallow.event", x, y, w, h);
set_state_val(PART:"base", STATE_REL2_OFFSET, -w, 0);
}
}
after: "hide2_no_animate";
}
program { name: "hide2_no_animate";
action: STATE_SET "custom" 0.0;
target: "base";
}
program {
signal: "elm,action,focus_highlight,show"; source: "elm";
action: STATE_SET "focused" 0.0;

View File

@ -11,7 +11,7 @@ foreach edc_file : edc_files
input : edc_file,
depfile: '@BASENAME@.edj.d',
output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta',
command : edje_cc_exe + [ '-beta', '-fastcomp',
'-deps', '@DEPFILE@',
'-sd', join_paths(meson.current_source_dir(), 'snd'),
'-id', elm_themes_image_include,

View File

@ -3,7 +3,7 @@ ethumb_frame = files('default.edc')
custom_target('edje_cc_ethumb_frame',
input : ethumb_frame,
output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta',
command : edje_cc_exe + [ '-beta', '-fastcomp',
'-sd', join_paths(meson.current_source_dir()),
'-id', join_paths(meson.current_source_dir()),
'-fd', join_paths(meson.current_source_dir()),

View File

@ -228,7 +228,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
EXTENSION_MAPPING =
EXTENSION_MAPPING = x=C
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
@ -1457,7 +1457,10 @@ PREDEFINED = EINA_MAGIC_DEBUG \
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code.
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED = EINA_VALUE_CONVERT \
EINA_VALUE_GET \
EINA_VALUE_INIT \
EINA_VALUE_NEW
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all references to function-like macros

View File

@ -1575,7 +1575,7 @@
* @skip ecore_main_fd_handler_add
* @until ;
*
* If you don't remenber the parameters of @ref ecore_main_fd_handler_add,
* If you don't remember the parameters of @ref ecore_main_fd_handler_add,
* please check its documentation.
*
* Now that we have our handler registered we will start the ecore's main loop:

View File

@ -617,7 +617,7 @@
* project's build system, we're assuming they are the canonical ones.
*
* After the program starts, elm_app_info_set() will actually run and
* then you'll see an intrincasy: Elementary does the prefix lookup @b
* then you'll see a problem: Elementary does the prefix lookup @b
* twice. This is so because of the quicklaunch infrastructure in
* Elementary (@ref Start), which will register a predefined prefix
* for possible users of the launch schema. We're not hooking into a
@ -2112,7 +2112,7 @@
* We'll start this example in the same way
* @ref map_example_01 "Map Example 1". Adding a map with buttons to control
* zoom, so if you didn't read it yet, just do it now. Actually there is
* a change, that we're aligning buttons to the top, since we wan't a
* a change, that we're aligning buttons to the top, since we want a
* vertical control box this time.
* @dontinclude map_example_03.c
* @skipline elm_map_add
@ -2125,8 +2125,8 @@
* @skipline horizontal_set
* @until align_set
*
* We'll add an entry with a preliminar address, that I know will
* find a coordinate, to examplify names work. But you can try
* We'll add an entry with a preliminary address, that I know will
* find a coordinate, to exemplify how names work. But you can try
* lots of addresses. From city or country names to pubs, or whatever
* you want. To try is enough to run the example, type the address and
* press "Route" button. This button will call a function that will
@ -2220,7 +2220,7 @@
* We are just adding the diskselector, so as you can see, defaults for it are:
* @li Only 3 items visible each time.
* @li Only 3 characters are displayed for labels on side positions.
* @li The first added item remains centeres, i.e., it's the selected item.
* @li The first added item remains centered, i.e., it's the selected item.
*
* To add items, we are just appending it on a loop, using function
* elm_diskselector_item_append(), that will be better explained on
@ -2307,7 +2307,7 @@
* The first parameter of elm_diskselector_item_append() is the diskselector
* object, that we are receiving as data on our callback function.
* The second one is a label, the string that will be placed in the center
* of our item. As we don't wan't icons or callback functions, we can
* of our item. As we don't want icons or callback functions, we can
* send NULL as third, fourth and fifth parameters.
*
* <b> Appending an item with icon: </b>
@ -2543,7 +2543,7 @@
* The first parameter of elm_list_item_prepend() is the list
* object, that we are receiving as data on our callback function.
* The second one is a label, the string that will be placed in the center
* of our item. As we don't wan't icons or callback functions, we can
* of our item. As we don't want icons or callback functions, we can
* send NULL as third, fourth, fifth and sixth parameters.
*
* <b> Appending an item: </b>
@ -3033,7 +3033,7 @@
* Note that we set on it both icon and label decorations. It's set to
* list the contents of the @c "/tmp" directory, too, with
* elm_fileselector_button_path_set(). What follows are checkboxes to
* exercise some of its API funtions:
* exercise some of its API functions:
* @dontinclude fileselector_button_example.c
* @skip ck = elm_check_add
* @until evas_object_show(en)
@ -3107,7 +3107,7 @@
* decorations. It's set to exhibit the path of (and list the contents
* of, when internal file selector is launched) the @c "/tmp"
* directory, also, with elm_fileselector_entry_path_set(). What
* follows are checkboxes to exercise some of its API funtions:
* follows are checkboxes to exercise some of its API functions:
* @dontinclude fileselector_entry_example.c
* @skip ck = elm_check_add
* @until callback_add(fs_entry
@ -3370,7 +3370,7 @@
* and what to do when the layout theme has its size changed. The full source
* code for this example can be found at @ref layout_example_03_c.
*
* In this exmaple we will use another group from the same layout theme file
* In this example we will use another group from the same layout theme file
* used in @ref layout_example_01. Its instantiation and loading happens in the
* following lines:
*
@ -3909,7 +3909,7 @@
* It will get the last index item selected's data and find the
* respective index item handle(#Elm_Object_Item) with elm_index_item_find().
* We need the latter to query the indexing letter string from, with
* elm_index_item_letter_get(). Next, comes the delition, itself,
* elm_index_item_letter_get(). Next, comes the deletion itself,
* which will also trigger the @c _index_item_del callback function,
* as said above.
*
@ -4450,7 +4450,7 @@
*
* We'll begin by showing a few structures used throught the program. First,
* the application owns data that holds the main window and the main entry
* where the editting happens. Then, an auxiliar structure we'll use later
* where the editting happens. Then, an auxiliary structure we'll use later
* when inserting icons in our text.
* @dontinclude entry_example.c
* @skip typedef
@ -5451,7 +5451,7 @@
* controls will exercise most of the slideshow's API functions.
*
* We create the slideshow, itself, first, making it @b loop on its
* image itens, when in slideshow mode:
* image items, when in slideshow mode:
* @dontinclude slideshow_example.c
* @skip slideshow = elm_slideshow_add
* @until evas_object_show
@ -6218,7 +6218,7 @@
* @skipline }
* @skipline }
*
* Other @c INT type widget implementations may exist, as is exemplifyed
* Other @c INT type widget implementations may exist, as is exemplified
* on the item that follows.
*
* @skip item {
@ -6877,4 +6877,4 @@
* @image latex screenshots/combobox_example_01.eps width=\textwidth
*
* @example combobox_example_01.c
*/
*/

View File

@ -60,7 +60,7 @@
* With this tutorial we'll give you a better view of how the lambda
* function can and will be constantly use in the C++ bindings. For a
* more broad aproach you should do a little web research.
* more broad approach you should do a little web research.
* The syntax adopted for these examples:
@ -200,7 +200,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -323,7 +323,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -488,7 +488,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -660,7 +660,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -837,7 +837,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -1030,13 +1030,13 @@
* For the up button, we'll set to @p true the autorepeat,
* autorepeat_initial_timeout, autoreapet_gap_timeout, the size hints
* for weight and alignement, choose our packing method and making out
* for weight and alignment, choose our packing method and making out
* up button visible.
* @skip up
* @until visibility
* For this directional buttons we'll have a diferent repeated
* For this directional buttons we'll have a different repeated
* callback that will insure the timeouts of our middle button in the
* gap and initial timeout that is current setted.
@ -1123,7 +1123,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -1258,7 +1258,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -1441,7 +1441,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -1580,7 +1580,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -1825,7 +1825,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -1992,7 +1992,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -2127,7 +2127,7 @@
* @skip pack_end
* @until visibility
* The second clock shows ther am/pm time, that we also create with
* The second clock shows the am/pm time, that we also create with
* the C++ binding method, passing our window object as
* parent. Setting show_am_pm to true and again choosing the packing
* method and making clock visible.
@ -2205,7 +2205,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -2419,7 +2419,7 @@
* @until visibility
* For our second datetime, we'll also set the size hints weight and
* align, but in this case, the filds YEAR, MONTH and DATE will be not
* align, but in this case, the fields YEAR, MONTH and DATE will be not
* visible, and thus displaying in our datetime the hour, minute and
* AM/PM. Finally we choose it's packing method and set the visibility
* of datetime to @p true.
@ -2513,7 +2513,7 @@
* @until linked
* In this function we load the vertex/fragment shaders, create the
* program object and finish our funtion.
* program object and finish our function.
* @skip gld
* @until return 1;
@ -2585,7 +2585,7 @@
* @skipline elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -2883,7 +2883,7 @@
* @skipline elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -3031,7 +3031,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -3248,7 +3248,7 @@
* @skipline elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -3462,7 +3462,7 @@
* @skipline elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -3604,7 +3604,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -3736,7 +3736,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -3997,7 +3997,7 @@
* @dontinclude separator_cxx_example_01.cc
* Separator is a very thin object used to separate other objects,
* wich can be vertical or horizontal.
* which can be vertical or horizontal.
* This example shows how to create a window and separate in two
* parts, each one will be filled with a background color to show the
@ -4031,7 +4031,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -4268,7 +4268,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -4573,7 +4573,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -4874,7 +4874,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -4958,15 +4958,15 @@
* @li row - Row number
* @li colspan - Number of columns that the subobj will occuppy
* @li colspan - Number of columns that the subobj will occupy
* @li rowspan - Number of rows that the subobj will occuppy
* @li rowspan - Number of rows that the subobj will occupy
* @note All positioning inside the table is relative to rows and
* columns, so a value of 0 for @a column and @a row, means the top
* left cell of the table. And for example, value of 2 for @a colspan and @a
* rowspan indicates that the subobj will occuppy two column and two rows,
* thus occuppying 4 cells in total.
* rowspan indicates that the subobj will occupy two columns and two rows,
* thus occupying 4 cells in total.
* Finally we just have to make our window visible. Then run the elm
* mainloop, starting to handle events and drawing operations.
@ -5018,7 +5018,7 @@
* @until elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -5075,7 +5075,7 @@
* @until homogeneous
* For each cell of this table we are going to create a unique @p
* evas::rectangle, each with diferent colors and sizes.
* evas::rectangle, each with different colors and sizes.
* Let's see a snip of the code on how we constructed our rectangles
* and setted the colors.
@ -5120,15 +5120,15 @@
* @li row - Row number
* @li colspan - Number of columns that the subobj will occuppy
* @li colspan - Number of columns that the subobj will occupy
* @li rowspan - Number of rows that the subobj will occuppy
* @li rowspan - Number of rows that the subobj will occupy
* @note All positioning inside the table is relative to rows and
* columns, so a value of 0 for @a column and @a row, means the top
* left cell of the table. And for example, value of 2 for @a colspan
* and @a rowspan indicates that the subobj will occuppy two column
* and two rows, thus occuppying 4 cells in total.
* and @a rowspan indicates that the subobj will occupy two column
* and two rows, thus occupying 4 cells in total.
* So for each rectangle we are setting a specific location and how
* many cells it's occupying, better seem below:
@ -5202,7 +5202,7 @@
* @skipline elm_policy_set
* As you can see, the policy we chose was to quit when the last win
* is hidden as opose to examples with the C bindings where we
* is hidden as opposed to examples with the C bindings where we
* perpetually set it to quit when last win was closed. This changed
* was necessary because in C++ binding as the elm mainloop stop
* running all object are destroyed, references are unreferenced and
@ -5329,4 +5329,4 @@
* @image latex screenshots/thumb_cxx_example_01.eps width=\textwidth
* @example thumb_cxx_example_01.cc
*/
*/

View File

@ -627,7 +627,7 @@
* @skip pack_end
* @until visible
* The second clock shows ther am/pm time, that we also create with
* The second clock shows the am/pm time, that we also create with
* the JS binding method, passing our window object as
* parent. Setting show_am_pm to true and again choosing the packing
* method and making clock visible.
@ -701,7 +701,7 @@
* @dontinclude separator_example_01.js
* Separator is a very thin object used to separate other objects,
* wich can be vertical or horizontal.
* which can be vertical or horizontal.
* This example shows how to create a window and separate in two
* parts, each one will be filled with a background color to show the
@ -1019,4 +1019,4 @@
* @image latex screenshots/icon_example_01.eps width=\textwidth
* @example icon_example_01.js
*/
*/

View File

@ -5,7 +5,8 @@ ecore_eolian_files_legacy = \
lib/ecore/ecore_exe.eo \
lib/ecore/ecore_event_message.eo \
lib/ecore/ecore_event_message_handler.eo \
lib/ecore/efl_loop_timer.eo
lib/ecore/efl_loop_timer.eo \
tests/ecore/ecore_audio_out_test.eo
ecore_eolian_files_public = \
lib/ecore/efl_app.eo \

View File

@ -57,8 +57,10 @@ efl_eolian_files = \
lib/efl/interfaces/efl_pack_table.eo \
lib/efl/interfaces/efl_ui_i18n.eo \
lib/efl/interfaces/efl_ui_direction.eo \
lib/efl/interfaces/efl_ui_direction_readonly.eo \
lib/efl/interfaces/efl_ui_drag.eo \
lib/efl/interfaces/efl_ui_range.eo \
lib/efl/interfaces/efl_ui_range_display.eo \
lib/efl/interfaces/efl_ui_range_interactive.eo \
lib/efl/interfaces/efl_ui_view.eo \
lib/efl/interfaces/efl_ui_model_connect.eo \
lib/efl/interfaces/efl_ui_factory.eo \
@ -131,6 +133,7 @@ lib/efl/interfaces/efl_file.c \
lib/efl/interfaces/efl_ui_format.c \
lib/efl/interfaces/efl_gfx_color.c \
lib/efl/interfaces/efl_text_markup_util.c \
lib/efl/interfaces/efl_ui_direction_readonly.c \
$(NULL)
lib_efl_libefl_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_srcdir)/src/lib/efl @EFL_CFLAGS@ -DEFL_GFX_FILTER_BETA

View File

@ -397,14 +397,20 @@ tests/efl_mono/libefl_mono_native_test.c: \
tests/efl_mono/dummy_child.eo.h \
tests/efl_mono/dummy_child.eo.c \
tests/efl_mono/dummy_numberwrapper.eo.h \
tests/efl_mono/dummy_numberwrapper.eo.c
tests/efl_mono/dummy_numberwrapper.eo.c \
tests/efl_mono/dummy_inherit_iface.eo.h \
tests/efl_mono/dummy_inherit_iface.eo.c \
tests/efl_mono/dummy_inherit_helper.eo.h \
tests/efl_mono/dummy_inherit_helper.eo.c
# Intermediate C Sharp test DLL
efl_mono_test_eolian_mono_files = tests/efl_mono/dummy_test_object.eo.cs \
tests/efl_mono/dummy_test_iface.eo.cs \
tests/efl_mono/dummy_another_iface.eo.cs \
tests/efl_mono/dummy_child.eo.cs \
tests/efl_mono/dummy_numberwrapper.eo.cs
tests/efl_mono/dummy_numberwrapper.eo.cs \
tests/efl_mono/dummy_inherit_iface.eo.cs \
tests/efl_mono/dummy_inherit_helper.eo.cs
tests/efl_mono/libefl_mono_test.dll: $(efl_mono_test_eolian_mono_files) tests/efl_mono/$(am__dirstamp) lib/efl_mono/libefl_mono.dll tests/efl_mono/libefl_mono_native_test.la tests/efl_mono/libefl_mono_test.dll.config
@rm -f tests/efl_mono/libefl_mono_test.dll

View File

@ -81,8 +81,6 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_list_view.eo \
lib/elementary/efl_ui_list_view_model.eo \
lib/elementary/efl_ui_list_view_pan.eo \
lib/elementary/efl_ui_list_view_seg_array.eo \
lib/elementary/efl_ui_list_view_relayout.eo \
lib/elementary/efl_ui_item.eo \
lib/elementary/efl_ui_list_item.eo \
lib/elementary/efl_ui_list_default_item_part_icon.eo \
@ -175,6 +173,8 @@ elm_private_eolian_files = \
tests/elementary/focus_test_sub_main.eo \
lib/elementary/efl_ui_selection_manager.eo \
lib/elementary/efl_datetime_manager.eo \
lib/elementary/efl_ui_list_view_relayout.eo \
lib/elementary/efl_ui_list_view_precise_layouter.eo \
$(NULL)
# Legacy classes - not part of public EO API
@ -285,7 +285,6 @@ elm_legacy_eolian_files = \
lib/elementary/elm_slideshow_item.eo \
lib/elementary/elm_table.eo \
lib/elementary/elm_thumb.eo \
lib/elementary/efl_ui_list_view_precise_layouter.eo \
$(NULL)
elm_eolian_type_files = \
@ -1108,6 +1107,8 @@ bin/elementary/test_win_stack.c \
bin/elementary/test_win_indicator.c \
bin/elementary/test_gesture_framework.c \
bin/elementary/test_ui_tab_pager.c \
bin/elementary/test_ui_pager.c \
bin/elementary/test_ui_pager_scroll.c \
bin/elementary/test.h
bin_elementary_elementary_test_LDADD = @USE_ELEMENTARY_LIBS@

View File

@ -105,6 +105,8 @@ tests/eolian/data/function_types.eot \
tests/eolian/data/import_types.eot \
tests/eolian/data/class_requires.eo \
tests/eolian/data/mixins_require.eo \
tests/eolian/data/iface.eo \
tests/eolian/data/unimpl.eo \
tests/eolian/data_aux/aux_a.eo \
tests/eolian/data_aux/aux_b.eo \
tests/eolian/data_aux/aux_c.eo

View File

@ -2219,7 +2219,8 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
return;
}
fseek(f, 0, SEEK_END);
if (fseek(f, 0, SEEK_END) < 0)
ERR("Error seeking");
size = ftell(f);
rewind(f);

View File

@ -63,9 +63,11 @@ source_fetch_file(const char *fil, const char *filname)
exit(-1);
}
fseek(f, 0, SEEK_END);
if (fseek(f, 0, SEEK_END) < 0)
ERR("Error seeking");
sz = ftell(f);
fseek(f, 0, SEEK_SET);
if (fseek(f, 0, SEEK_SET) < 0)
ERR("Error seeking");
sf = mem_alloc(SZ(SrcFile));
sf->name = mem_strdup(filname);
sf->file = mem_alloc(sz + 1);
@ -80,7 +82,8 @@ source_fetch_file(const char *fil, const char *filname)
}
sf->file[sz] = '\0';
fseek(f, 0, SEEK_SET);
if (fseek(f, 0, SEEK_SET) < 0)
ERR("Error seeking");
srcfiles.list = eina_list_append(srcfiles.list, sf);
while (fgets(buf, sizeof(buf), f))

View File

@ -7405,7 +7405,7 @@ static void
cpp_pedwarn_with_line(cpp_reader * pfile, int line, int column, const char *msg)
{
if (CPP_OPTIONS(pfile)->pedantic_errors)
cpp_error_with_line(pfile, column, line, msg);
cpp_error_with_line(pfile, line, column, msg);
else
cpp_warning_with_line(pfile, line, column, msg);
}

View File

@ -161,6 +161,8 @@ test_win_wm_rotation.c \
test_win_dialog.c \
test_gesture_framework.c \
test_ui_tab_pager.c \
test_ui_pager.c \
test_ui_pager_scroll.c \
test.h
elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \

View File

@ -99,6 +99,8 @@ elementary_test_src = [
'test_panes.c',
'test_ui_panes.c',
'test_ui_panel.c',
'test_ui_pager.c',
'test_ui_pager_scroll.c',
'test_part_bg.c',
'test_part_shadow.c',
'test_photo.c',

View File

@ -374,6 +374,8 @@ void test_efl_anim_interpolator(void *data, Evas_Object *obj, void *event_info);
void test_gesture_framework(void *data, Evas_Object *obj, void *event_info);
void test_ui_tab_pager(void *data, Evas_Object *obj, void *event_info);
void test_ui_pager(void *data, Evas_Object *obj, void *event_info);
void test_ui_pager_scroll(void *data, Evas_Object *obj, void *event_info);
static void _list_udpate(void);
@ -1092,6 +1094,8 @@ add_tests:
//------------------------------//
ADD_TEST_EO(NULL, "Tab Pager", "Efl.Ui.Tab_Pager", test_ui_tab_pager);
ADD_TEST_EO(NULL, "Pager", "Efl.Ui.Pager", test_ui_pager);
ADD_TEST_EO(NULL, "Scroll Pager", "Efl.Ui.Pager (Scroll)", test_ui_pager_scroll);
//------------------------------//
ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup);

View File

@ -0,0 +1,737 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#define EO_BETA_API
#define EFL_UI_WIDGET_PROTECTED
#include <Elementary.h>
#define PAGE_NUM 3
/** |----------panes----------|
* ||--left---| |---right---||
* || | | layout ||
* || | ||---------|||
* ||naviframe| || pager |||
* || | || |||
* || | ||---------|||
* ||---------| |-----------||
* |-------------------------|
*
*/
typedef enum _Page_Type {
LAYOUT,
LIST,
BUTTON
} Page_Type;
typedef enum _Pack_Type {
PACK_BEGIN,
PACK_END,
PACK_BEFORE,
PACK_AFTER,
PACK_AT,
UNPACK_AT
} Pack_Type;
typedef struct _Params {
Evas_Object *navi;
Eo *pager;
Eo *indicator;
int w, h;
Eina_Bool wfill, hfill;
} Params;
typedef struct _Page_Set_Params {
Eo *pager;
Eo *spinner;
} Page_Set_Params;
typedef struct _Pack_Params {
Pack_Type type;
Eo *pager;
Eo *pack_sp;
Eo *unpack_sp;
Eo *unpack_btn;
} Pack_Params;
typedef struct _Size_Params {
Eo *pager;
Eo *slider;
Params *params;
} Size_Params;
static Eo *page_add(Page_Type p, Eo *parent)
{
Eo *page;
char buf[PATH_MAX];
int i;
switch (p) {
case LAYOUT:
snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
elm_app_data_dir_get());
page = efl_add(EFL_UI_LAYOUT_CLASS, parent,
efl_file_set(efl_added, buf, "page"),
efl_text_set(efl_part(efl_added, "text"), "Layout Page"));
efl_gfx_size_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
break;
case LIST:
page = elm_list_add(parent);
elm_list_select_mode_set(page, ELM_OBJECT_SELECT_MODE_ALWAYS);
evas_object_show(page);
for (i = 0; i < 20; i++) {
snprintf(buf, sizeof(buf), "List Page - Item #%d", i);
elm_list_item_append(page, buf, NULL, NULL, NULL, NULL);
}
evas_object_size_hint_weight_set(page, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(page, EVAS_HINT_FILL,
EVAS_HINT_FILL);
break;
case BUTTON:
page = efl_add(EFL_UI_BUTTON_CLASS, parent,
efl_text_set(efl_added, "Button Page"));
efl_gfx_size_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
break;
default:
snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
elm_app_data_dir_get());
page = efl_add(EFL_UI_LAYOUT_CLASS, parent,
efl_file_set(efl_added, buf, "page"),
efl_text_set(efl_part(efl_added, "text"), "Layout Page"));
efl_gfx_size_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
break;
}
return page;
}
static void prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *pager = data;
int curr_page = efl_ui_pager_current_page_get(pager);
efl_ui_pager_current_page_set(pager, (curr_page - 1));
}
static void next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *pager = data;
int curr_page = efl_ui_pager_current_page_get(pager);
efl_ui_pager_current_page_set(pager, (curr_page + 1));
}
static void back_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
elm_naviframe_item_pop(data);
}
static void list_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void width_slider_cb(void *data, const Efl_Event *ev)
{
Params *params = data;
int h;
if (params->hfill) h = -1;
else h = params->h;
params->w = efl_ui_range_value_get(ev->object);
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(params->w, h));
}
static void height_slider_cb(void *data, const Efl_Event *ev)
{
Params *params = data;
int w;
if (params->wfill) w = -1;
else w = params->w;
params->h = efl_ui_range_value_get(ev->object);
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, params->h));
}
static void width_check_cb(void *data, const Efl_Event *ev)
{
Size_Params *params = data;
Eina_Bool ck = elm_check_selected_get(ev->object);
int w, h;
elm_object_disabled_set(params->slider, ck);
params->params->wfill = ck;
if (params->params->wfill) w = -1;
else w = params->params->w;
if (params->params->hfill) h = -1;
else h = params->params->h;
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h));
}
static void height_check_cb(void *data, const Efl_Event *ev)
{
Size_Params *params = data;
Eina_Bool ck = elm_check_selected_get(ev->object);
int w, h;
elm_object_disabled_set(params->slider, ck);
params->params->hfill = ck;
if (params->params->wfill) w = -1;
else w = params->params->w;
if (params->params->hfill) h = -1;
else h = params->params->h;
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h));
}
static void check_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Pack_Params *param = data;
Eo *pager = param->pager;
Eo *page, *curr_page;
int index, cnt;
if (param->type != UNPACK_AT) {
index = efl_content_count(pager);
switch (index % 3) {
case 0:
page = page_add(LAYOUT, pager);
break;
case 1:
page = page_add(LIST, pager);
break;
case 2:
page = page_add(BUTTON, pager);
break;
default:
page = page_add(LAYOUT, pager);
break;
}
}
switch (param->type) {
case PACK_BEGIN:
efl_pack_begin(pager, page);
break;
case PACK_END:
efl_pack_end(pager, page);
break;
case PACK_BEFORE:
index = efl_ui_pager_current_page_get(pager);
curr_page = efl_pack_content_get(pager, index);
efl_pack_before(pager, page, curr_page);
break;
case PACK_AFTER:
index = efl_ui_pager_current_page_get(pager);
curr_page = efl_pack_content_get(pager, index);
efl_pack_after(pager, page, curr_page);
break;
case PACK_AT:
index = efl_ui_range_value_get(param->pack_sp);
efl_pack_at(pager, page, index);
break;
case UNPACK_AT:
index = efl_ui_range_value_get(param->unpack_sp);
page = efl_pack_content_get(pager, index);
efl_pack_unpack(pager, page);
efl_del(page);
break;
}
cnt = efl_content_count(pager);
index = efl_ui_range_value_get(param->pack_sp);
if (index > cnt)
efl_ui_range_value_set(param->pack_sp, cnt);
efl_ui_range_min_max_set(param->pack_sp, 0, cnt);
if (cnt > 0)
{
elm_object_disabled_set(param->unpack_btn, EINA_FALSE);
elm_object_disabled_set(param->unpack_sp, EINA_FALSE);
cnt -= 1;
index = efl_ui_range_value_get(param->unpack_sp);
if (index > cnt)
efl_ui_range_value_set(param->unpack_sp, cnt);
efl_ui_range_min_max_set(param->unpack_sp, 0, cnt);
}
else
{
elm_object_disabled_set(param->unpack_btn, EINA_TRUE);
elm_object_disabled_set(param->unpack_sp, EINA_TRUE);
}
}
static void pack_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void page_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Page_Set_Params *psp = data;
efl_ui_pager_current_page_set(psp->pager,
efl_ui_range_value_get(psp->spinner));
}
static void page_set_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void indicator_icon_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Params *params = data;
params->indicator = efl_add(EFL_PAGE_INDICATOR_ICON_CLASS, params->pager);
efl_ui_pager_indicator_set(params->pager, params->indicator);
}
static void indicator_none_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Params *params = data;
efl_ui_pager_indicator_set(params->pager, NULL);
}
static void page_size_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = data;
Size_Params *size_params;
Evas_Object *navi = params->navi;
Eo *btn, *box, *fr, *inbox, *ck, *sl;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
elm_naviframe_item_push(navi, "Page Size", btn, NULL,
efl_added, NULL));
// Width
fr = elm_frame_add(box);
elm_object_text_set(fr, "Width");
efl_gfx_size_hint_align_set(fr, -1, -1);
efl_gfx_size_hint_weight_set(fr, 1, 1);
efl_pack(box, fr);
efl_gfx_entity_visible_set(fr, 1);
inbox = efl_add(EFL_UI_BOX_CLASS, fr,
efl_content_set(fr, efl_added));
ck = elm_check_add(inbox);
elm_object_text_set(ck, "Fill");
efl_pack_end(inbox, ck);
efl_gfx_entity_visible_set(ck, 1);
sl = efl_add(EFL_UI_SLIDER_CLASS, inbox,
efl_ui_range_min_max_set(efl_added, 100, 200),
efl_ui_range_value_set(efl_added, params->w),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 0)),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED,
width_slider_cb, params),
efl_pack_end(inbox, efl_added));
size_params = calloc(1, sizeof(Size_Params));
size_params->slider = sl;
size_params->pager = params->pager;
size_params->params = params;
efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, width_check_cb,
size_params);
efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params);
if (params->wfill)
{
elm_check_state_set(ck, EINA_TRUE);
elm_object_disabled_set(sl, EINA_TRUE);
}
// Height
fr = elm_frame_add(box);
elm_object_text_set(fr, "Height");
efl_gfx_size_hint_align_set(fr, -1, -1);
efl_gfx_size_hint_weight_set(fr, 1, 1);
efl_pack(box, fr);
efl_gfx_entity_visible_set(fr, 1);
inbox = efl_add(EFL_UI_BOX_CLASS, fr,
efl_content_set(fr, efl_added));
ck = elm_check_add(inbox);
elm_object_text_set(ck, "Fill");
efl_pack_end(inbox, ck);
efl_gfx_entity_visible_set(ck, 1);
sl = efl_add(EFL_UI_SLIDER_CLASS, inbox,
efl_ui_range_min_max_set(efl_added, 100, 300),
efl_ui_range_value_set(efl_added, params->h),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 0)),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED,
height_slider_cb, params),
efl_pack_end(inbox, efl_added));
size_params = calloc(1, sizeof(Size_Params));
size_params->slider = sl;
size_params->pager = params->pager;
size_params->params = params;
efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, height_check_cb,
size_params);
efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params);
if (params->hfill)
{
elm_check_state_set(ck, EINA_TRUE);
elm_object_disabled_set(sl, EINA_TRUE);
}
}
static void pack_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *pager = params->pager;
Eo *btn, *box, *in_box1, *in_box2, *sp1, *sp2;
Pack_Params *pack_param;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL,
efl_added, NULL));
in_box1 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1,
efl_ui_range_min_max_set(efl_added, 0,
efl_content_count(pager)),
efl_ui_range_value_set(efl_added,
efl_ui_pager_current_page_get(pager)));
in_box2 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2);
btn = efl_add(EFL_UI_BUTTON_CLASS, in_box2,
efl_text_set(efl_added, "Unpack At"));
// Pack Begin
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_BEGIN;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack Begin"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack End
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_END;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack End"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack Before
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_BEFORE;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack Before Current Page"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack After
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_AFTER;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack After Current Page"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack At
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_AT;
efl_add(EFL_UI_BUTTON_CLASS, in_box1,
efl_text_set(efl_added, "Pack At"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(in_box1, efl_added));
efl_pack_end(box, in_box1);
efl_pack_end(in_box1, sp1);
// Unpack At
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = UNPACK_AT;
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param);
efl_event_callback_add(btn, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param);
if (efl_content_count(pager) > 0)
{
efl_ui_range_min_max_set(sp2, 0,
(efl_content_count(pager) - 1));
efl_ui_range_value_set(sp2,
efl_ui_pager_current_page_get(pager));
}
else
{
elm_object_disabled_set(btn, EINA_TRUE);
elm_object_disabled_set(sp2, EINA_TRUE);
}
efl_pack_end(box, in_box2);
efl_pack_end(in_box2, btn);
efl_pack_end(in_box2, sp2);
}
static void current_page_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *pager = params->pager;
Eo *btn, *box, *sp;
Page_Set_Params *psp = calloc(1, sizeof(Page_Set_Params));
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current Page", btn, NULL,
efl_added, NULL));
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Set Current Page As"),
efl_pack_end(box, efl_added));
sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box,
efl_gfx_size_hint_align_set(efl_added, -1, -1),
efl_pack_end(box, efl_added));
if (efl_content_count(pager) > 0)
{
efl_ui_range_min_max_set(sp, 0,
(efl_content_count(pager) - 1));
efl_ui_range_value_set(sp,
efl_ui_pager_current_page_get(pager));
}
else
{
elm_object_disabled_set(btn, EINA_TRUE);
elm_object_disabled_set(sp, EINA_TRUE);
}
psp->pager = pager;
psp->spinner = sp;
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, page_set_btn_cb, psp);
efl_event_callback_add(btn, EFL_EVENT_DEL, page_set_btn_del_cb, psp);
}
static void indicator_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *btn, *box;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Indicator", btn, NULL,
efl_added, NULL));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Icon Type"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
indicator_icon_btn_cb, params),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "None"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
indicator_none_btn_cb, params),
efl_pack_end(box, efl_added));
}
void test_ui_pager(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Eo *win, *panes, *navi, *list, *layout, *pager, *page;
Params *params = NULL;
char buf[PATH_MAX];
int i;
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Pager"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
panes = efl_add(EFL_UI_PANES_CLASS, win,
efl_gfx_size_hint_weight_set(efl_added, 1, 1),
efl_ui_panes_split_ratio_set(efl_added, 0.3),
efl_content_set(win, efl_added));
navi = elm_naviframe_add(panes);
evas_object_show(navi);
efl_content_set(efl_part(panes, "first"), navi);
list = elm_list_add(navi);
elm_list_horizontal_set(list, EINA_FALSE);
elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
elm_naviframe_item_push(navi, "Properties", NULL, NULL, list, NULL);
evas_object_show(list);
snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
elm_app_data_dir_get());
layout = efl_add(EFL_UI_LAYOUT_CLASS, panes,
efl_file_set(efl_added, buf, "pager"),
efl_content_set(efl_part(panes, "second"), efl_added));
pager = efl_add(EFL_UI_PAGER_CLASS, layout,
efl_content_set(efl_part(layout, "pager"), efl_added),
efl_ui_pager_page_size_set(efl_added, EINA_SIZE2D(200, 300)));
efl_add(EFL_UI_BUTTON_CLASS, layout,
efl_text_set(efl_added, "Prev"),
efl_event_callback_add(efl_added,
EFL_UI_EVENT_CLICKED, prev_btn_cb, pager),
efl_content_set(efl_part(layout, "prev_btn"), efl_added));
efl_add(EFL_UI_BUTTON_CLASS, layout,
efl_text_set(efl_added, "Next"),
efl_event_callback_add(efl_added,
EFL_UI_EVENT_CLICKED, next_btn_cb, pager),
efl_content_set(efl_part(layout, "next_btn"), efl_added));
params = calloc(1, sizeof(Params));
params->navi = navi;
params->pager = pager;
params->indicator = NULL;
params->w = 200;
params->h = 300;
params->wfill = EINA_FALSE;
params->hfill = EINA_FALSE;
elm_list_item_append(list, "Page Size", NULL, NULL, page_size_cb, params);
elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params);
elm_list_item_append(list, "Current Page", NULL, NULL, current_page_cb, params);
elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params);
elm_list_go(list);
efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params);
for (i = 0; i < PAGE_NUM; i++) {
switch (i % 3) {
case 0:
page = page_add(LAYOUT, pager);
break;
case 1:
page = page_add(LIST, pager);
break;
case 2:
page = page_add(BUTTON, pager);
break;
default:
page = page_add(LAYOUT, pager);
break;
}
efl_pack_end(pager, page);
}
efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320));
}

View File

@ -0,0 +1,934 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#define EO_BETA_API
#define EFL_UI_WIDGET_PROTECTED
#include <Elementary.h>
#define PAGE_NUM 3
/** |----------panes----------|
* ||--left---| |---right---||
* || | | layout ||
* || | ||---------|||
* ||naviframe| || pager |||
* || | || |||
* || | ||---------|||
* ||---------| |-----------||
* |-------------------------|
*
*/
typedef enum _Page_Type {
LAYOUT,
LIST,
BUTTON
} Page_Type;
typedef enum _Pack_Type {
PACK_BEGIN,
PACK_END,
PACK_BEFORE,
PACK_AFTER,
PACK_AT,
UNPACK_AT
} Pack_Type;
typedef struct _Params {
Evas_Object *navi;
Eo *pager;
Eo *transition;
Eo *indicator;
int w, h;
int padding;
int side_page_num;
int curr_page;
Eina_Bool prev_block, next_block;
Eina_Bool wfill, hfill;
} Params;
typedef struct _Page_Set_Params {
Eo *pager;
Eo *spinner;
} Page_Set_Params;
typedef struct _Pack_Params {
Pack_Type type;
Eo *pager;
Eo *pack_sp;
Eo *unpack_sp;
Eo *unpack_btn;
} Pack_Params;
typedef struct _Size_Params {
Eo *pager;
Eo *slider;
Params *params;
} Size_Params;
static Eo *page_add(Page_Type p, Eo *parent)
{
Eo *page;
char buf[PATH_MAX];
int i;
switch (p) {
case LAYOUT:
snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
elm_app_data_dir_get());
page = efl_add(EFL_UI_LAYOUT_CLASS, parent,
efl_file_set(efl_added, buf, "page"),
efl_text_set(efl_part(efl_added, "text"), "Layout Page"));
efl_gfx_size_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
break;
case LIST:
page = elm_list_add(parent);
elm_list_select_mode_set(page, ELM_OBJECT_SELECT_MODE_ALWAYS);
evas_object_show(page);
for (i = 0; i < 20; i++) {
snprintf(buf, sizeof(buf), "List Page - Item #%d", i);
elm_list_item_append(page, buf, NULL, NULL, NULL, NULL);
}
evas_object_size_hint_weight_set(page, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(page, EVAS_HINT_FILL,
EVAS_HINT_FILL);
break;
case BUTTON:
page = efl_add(EFL_UI_BUTTON_CLASS, parent,
efl_text_set(efl_added, "Button Page"));
efl_gfx_size_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
break;
default:
snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
elm_app_data_dir_get());
page = efl_add(EFL_UI_LAYOUT_CLASS, parent,
efl_file_set(efl_added, buf, "page"),
efl_text_set(efl_part(efl_added, "text"), "Layout Page"));
efl_gfx_size_hint_fill_set(page, EINA_TRUE, EINA_TRUE);
break;
}
return page;
}
static void prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *pager = data;
int curr_page = efl_ui_pager_current_page_get(pager);
efl_ui_pager_current_page_set(pager, (curr_page - 1));
}
static void next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Eo *pager = data;
int curr_page = efl_ui_pager_current_page_get(pager);
efl_ui_pager_current_page_set(pager, (curr_page + 1));
}
static void back_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
elm_naviframe_item_pop(data);
}
static void list_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void width_slider_cb(void *data, const Efl_Event *ev)
{
Params *params = data;
int h;
if (params->hfill) h = -1;
else h = params->h;
params->w = efl_ui_range_value_get(ev->object);
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(params->w, h));
}
static void height_slider_cb(void *data, const Efl_Event *ev)
{
Params *params = data;
int w;
if (params->wfill) w = -1;
else w = params->w;
params->h = efl_ui_range_value_get(ev->object);
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, params->h));
}
static void width_check_cb(void *data, const Efl_Event *ev)
{
Size_Params *params = data;
Eina_Bool ck = elm_check_selected_get(ev->object);
int w, h;
elm_object_disabled_set(params->slider, ck);
params->params->wfill = ck;
if (params->params->wfill) w = -1;
else w = params->params->w;
if (params->params->hfill) h = -1;
else h = params->params->h;
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h));
}
static void height_check_cb(void *data, const Efl_Event *ev)
{
Size_Params *params = data;
Eina_Bool ck = elm_check_selected_get(ev->object);
int w, h;
elm_object_disabled_set(params->slider, ck);
params->params->hfill = ck;
if (params->params->wfill) w = -1;
else w = params->params->w;
if (params->params->hfill) h = -1;
else h = params->params->h;
efl_ui_pager_page_size_set(params->pager, EINA_SIZE2D(w, h));
}
static void check_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void padding_slider_cb(void *data, const Efl_Event *ev)
{
Params *params = (Params *) data;
params->padding = efl_ui_range_value_get(ev->object);
efl_ui_pager_padding_set(params->pager, params->padding);
}
static void side_page_num_slider_cb(void *data, const Efl_Event *ev)
{
Params *params = (Params *) data;
params->side_page_num = efl_ui_range_value_get(ev->object);
efl_page_transition_scroll_side_page_num_set(params->transition,
params->side_page_num);
}
static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Pack_Params *param = data;
Eo *pager = param->pager;
Eo *page, *curr_page;
int index, cnt;
if (param->type != UNPACK_AT) {
index = efl_content_count(pager);
switch (index % 3) {
case 0:
page = page_add(LAYOUT, pager);
break;
case 1:
page = page_add(LIST, pager);
break;
case 2:
page = page_add(BUTTON, pager);
break;
default:
page = page_add(LAYOUT, pager);
break;
}
}
switch (param->type) {
case PACK_BEGIN:
efl_pack_begin(pager, page);
break;
case PACK_END:
efl_pack_end(pager, page);
break;
case PACK_BEFORE:
index = efl_ui_pager_current_page_get(pager);
curr_page = efl_pack_content_get(pager, index);
efl_pack_before(pager, page, curr_page);
break;
case PACK_AFTER:
index = efl_ui_pager_current_page_get(pager);
curr_page = efl_pack_content_get(pager, index);
efl_pack_after(pager, page, curr_page);
break;
case PACK_AT:
index = efl_ui_range_value_get(param->pack_sp);
efl_pack_at(pager, page, index);
break;
case UNPACK_AT:
index = efl_ui_range_value_get(param->unpack_sp);
page = efl_pack_content_get(pager, index);
efl_pack_unpack(pager, page);
efl_del(page);
break;
}
cnt = efl_content_count(pager);
index = efl_ui_range_value_get(param->pack_sp);
if (index > cnt)
efl_ui_range_value_set(param->pack_sp, cnt);
efl_ui_range_min_max_set(param->pack_sp, 0, cnt);
if (cnt > 0)
{
elm_object_disabled_set(param->unpack_btn, EINA_FALSE);
elm_object_disabled_set(param->unpack_sp, EINA_FALSE);
cnt -= 1;
index = efl_ui_range_value_get(param->unpack_sp);
if (index > cnt)
efl_ui_range_value_set(param->unpack_sp, cnt);
efl_ui_range_min_max_set(param->unpack_sp, 0, cnt);
}
else
{
elm_object_disabled_set(param->unpack_btn, EINA_TRUE);
elm_object_disabled_set(param->unpack_sp, EINA_TRUE);
}
}
static void pack_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void page_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Page_Set_Params *psp = data;
efl_ui_pager_current_page_set(psp->pager,
efl_ui_range_value_get(psp->spinner));
}
static void page_set_btn_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
free(data);
}
static void prev_block_check_cb(void *data, const Efl_Event *ev)
{
Eo *pager = data;
Eina_Bool prev, next;
prev = efl_ui_nstate_value_get(ev->object);
efl_ui_pager_scroll_block_get(pager, NULL, &next);
efl_ui_pager_scroll_block_set(pager, prev, next);
}
static void next_block_check_cb(void *data, const Efl_Event *ev)
{
Eo *pager = data;
Eina_Bool prev, next;
next = efl_ui_nstate_value_get(ev->object);
efl_ui_pager_scroll_block_get(pager, &prev, NULL);
efl_ui_pager_scroll_block_set(pager, prev, next);
}
static void loop_check_cb(void *data, const Efl_Event *ev)
{
Eo *pager = data;
int state = efl_ui_nstate_value_get(ev->object);
//FIXME use other widget (i.e. radio) than check
// since loop might not be enabled according to the number of items
efl_ui_pager_loop_mode_set(pager, state);
}
static void indicator_icon_btn_cb(void *data,
const Efl_Event *ev EINA_UNUSED)
{
Params *params = data;
params->indicator = efl_add(EFL_PAGE_INDICATOR_ICON_CLASS, params->pager);
efl_ui_pager_indicator_set(params->pager, params->indicator);
}
static void indicator_none_btn_cb(void *data,
const Efl_Event *ev EINA_UNUSED)
{
Params *params = data;
efl_ui_pager_indicator_set(params->pager, NULL);
}
static void page_size_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = data;
Size_Params *size_params;
Evas_Object *navi = params->navi;
Eo *btn, *box, *fr, *inbox, *ck, *sl;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
elm_naviframe_item_push(navi, "Page Size", btn, NULL,
efl_added, NULL));
// Width
fr = elm_frame_add(box);
elm_object_text_set(fr, "Width");
efl_gfx_size_hint_align_set(fr, -1, -1);
efl_gfx_size_hint_weight_set(fr, 1, 1);
efl_pack(box, fr);
efl_gfx_entity_visible_set(fr, 1);
inbox = efl_add(EFL_UI_BOX_CLASS, fr,
efl_content_set(fr, efl_added));
ck = elm_check_add(inbox);
elm_object_text_set(ck, "Fill");
efl_pack_end(inbox, ck);
efl_gfx_entity_visible_set(ck, 1);
sl = efl_add(EFL_UI_SLIDER_CLASS, inbox,
efl_ui_range_min_max_set(efl_added, 100, 200),
efl_ui_range_value_set(efl_added, params->w),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 0)),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED,
width_slider_cb, params),
efl_pack_end(inbox, efl_added));
size_params = calloc(1, sizeof(Size_Params));
size_params->slider = sl;
size_params->pager = params->pager;
size_params->params = params;
efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, width_check_cb,
size_params);
efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params);
if (params->wfill)
{
elm_check_state_set(ck, EINA_TRUE);
elm_object_disabled_set(sl, EINA_TRUE);
}
// Height
fr = elm_frame_add(box);
elm_object_text_set(fr, "Height");
efl_gfx_size_hint_align_set(fr, -1, -1);
efl_gfx_size_hint_weight_set(fr, 1, 1);
efl_pack(box, fr);
efl_gfx_entity_visible_set(fr, 1);
inbox = efl_add(EFL_UI_BOX_CLASS, fr,
efl_content_set(fr, efl_added));
ck = elm_check_add(inbox);
elm_object_text_set(ck, "Fill");
efl_pack_end(inbox, ck);
efl_gfx_entity_visible_set(ck, 1);
sl = efl_add(EFL_UI_SLIDER_CLASS, inbox,
efl_ui_range_min_max_set(efl_added, 100, 300),
efl_ui_range_value_set(efl_added, params->h),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 0)),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED,
height_slider_cb, params),
efl_pack_end(inbox, efl_added));
size_params = calloc(1, sizeof(Size_Params));
size_params->slider = sl;
size_params->pager = params->pager;
size_params->params = params;
efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, height_check_cb,
size_params);
efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params);
if (params->hfill)
{
elm_check_state_set(ck, EINA_TRUE);
elm_object_disabled_set(sl, EINA_TRUE);
}
}
static void padding_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *btn, *box;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Padding Size", btn, NULL,
efl_added, NULL));
efl_add(EFL_UI_SLIDER_CLASS, box,
efl_ui_range_min_max_set(efl_added, 0, 50),
efl_ui_range_value_set(efl_added, params->padding),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 0)),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED,
padding_slider_cb, params),
efl_pack_end(box, efl_added));
}
static void side_page_num_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *btn, *box;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Side Page Num", btn, NULL,
efl_added, NULL));
efl_add(EFL_UI_SLIDER_CLASS, box,
efl_text_set(efl_added, "side page num"),
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
efl_ui_range_min_max_set(efl_added, 0, 3),
efl_ui_range_value_set(efl_added, params->side_page_num),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_gfx_size_hint_weight_set(efl_added, 1, 1),
efl_gfx_size_hint_align_set(efl_added, -1, -1),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED,
side_page_num_slider_cb, params),
efl_pack_end(box, efl_added));
}
static void pack_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *pager = params->pager;
Eo *btn, *box, *in_box1, *in_box2, *sp1, *sp2;
Pack_Params *pack_param;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL,
efl_added, NULL));
in_box1 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1,
efl_ui_range_min_max_set(efl_added, 0,
efl_content_count(pager)),
efl_ui_range_value_set(efl_added,
efl_ui_pager_current_page_get(pager)));
in_box2 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2);
btn = efl_add(EFL_UI_BUTTON_CLASS, in_box2,
efl_text_set(efl_added, "Unpack At"));
// Pack Begin
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_BEGIN;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack Begin"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack End
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_END;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack End"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack Before
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_BEFORE;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack Before Current Page"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack After
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_AFTER;
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Pack After Current Page"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(box, efl_added));
// Pack At
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = PACK_AT;
efl_add(EFL_UI_BUTTON_CLASS, in_box1,
efl_text_set(efl_added, "Pack At"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param),
efl_event_callback_add(efl_added, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param),
efl_pack_end(in_box1, efl_added));
efl_pack_end(box, in_box1);
efl_pack_end(in_box1, sp1);
// Unpack At
pack_param = calloc(1, sizeof(Pack_Params));
pack_param->pager = pager;
pack_param->pack_sp = sp1;
pack_param->unpack_sp = sp2;
pack_param->unpack_btn = btn;
pack_param->type = UNPACK_AT;
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED,
pack_btn_cb, pack_param);
efl_event_callback_add(btn, EFL_EVENT_DEL,
pack_btn_del_cb, pack_param);
if (efl_content_count(pager) > 0)
{
efl_ui_range_min_max_set(sp2, 0,
(efl_content_count(pager) - 1));
efl_ui_range_value_set(sp2,
efl_ui_pager_current_page_get(pager));
}
else
{
elm_object_disabled_set(btn, EINA_TRUE);
elm_object_disabled_set(sp2, EINA_TRUE);
}
efl_pack_end(box, in_box2);
efl_pack_end(in_box2, btn);
efl_pack_end(in_box2, sp2);
}
static void current_page_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *pager = params->pager;
Eo *btn, *box, *sp;
Page_Set_Params *psp = calloc(1, sizeof(Page_Set_Params));
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current Page", btn, NULL,
efl_added, NULL));
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Set Current Page As"),
efl_pack_end(box, efl_added));
sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box,
efl_gfx_size_hint_align_set(efl_added, -1, -1),
efl_pack_end(box, efl_added));
if (efl_content_count(pager) > 0)
{
efl_ui_range_min_max_set(sp, 0,
(efl_content_count(pager) - 1));
efl_ui_range_value_set(sp,
efl_ui_pager_current_page_get(pager));
}
else
{
elm_object_disabled_set(btn, EINA_TRUE);
elm_object_disabled_set(sp, EINA_TRUE);
}
psp->pager = pager;
psp->spinner = sp;
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, page_set_btn_cb, psp);
efl_event_callback_add(btn, EFL_EVENT_DEL, page_set_btn_del_cb, psp);
}
static void scroll_block_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *pager = params->pager;
Eo *btn, *box;
Eina_Bool prev, next;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Scroll Block", btn, NULL,
efl_added, NULL));
efl_ui_pager_scroll_block_get(pager, &prev, &next);
efl_add(EFL_UI_CHECK_CLASS, box,
efl_ui_widget_style_set(efl_added, "toggle"),
efl_text_set(efl_added, "Prev Block"),
efl_ui_nstate_value_set(efl_added, prev),
efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED,
prev_block_check_cb, pager),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_CHECK_CLASS, box,
efl_ui_widget_style_set(efl_added, "toggle"),
efl_text_set(efl_added, "Next Block"),
efl_ui_nstate_value_set(efl_added, next),
efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED,
next_block_check_cb, pager),
efl_pack_end(box, efl_added));
}
static void loop_cb(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *pager = params->pager;
Eo *btn, *box;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Loop", btn, NULL,
efl_added, NULL));
efl_add(EFL_UI_CHECK_CLASS, box,
efl_ui_widget_style_set(efl_added, "toggle"),
efl_text_set(efl_added, "Loop"),
efl_ui_nstate_value_set(efl_added, efl_ui_pager_loop_mode_get(pager)),
efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED,
loop_check_cb, pager),
efl_pack_end(box, efl_added));
}
static void indicator_cb(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Params *params = (Params *)data;
Evas_Object *navi = params->navi;
Eo *btn, *box;
btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
efl_text_set(efl_added, "Back"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Indicator", btn, NULL,
efl_added, NULL));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Icon Type"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
indicator_icon_btn_cb, params),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "None"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
indicator_none_btn_cb, params),
efl_pack_end(box, efl_added));
}
void test_ui_pager_scroll(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Eo *win, *panes, *navi, *list, *layout, *pager, *page, *tran;
Params *params = NULL;
char buf[PATH_MAX];
int i;
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Pager"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
panes = efl_add(EFL_UI_PANES_CLASS, win,
efl_gfx_size_hint_weight_set(efl_added, 1, 1),
efl_ui_panes_split_ratio_set(efl_added, 0.3),
efl_content_set(win, efl_added));
navi = elm_naviframe_add(panes);
evas_object_show(navi);
efl_content_set(efl_part(panes, "first"), navi);
list = elm_list_add(navi);
elm_list_horizontal_set(list, EINA_FALSE);
elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
elm_naviframe_item_push(navi, "Properties", NULL, NULL, list, NULL);
evas_object_show(list);
snprintf(buf, sizeof(buf), "%s/objects/test_pager.edj",
elm_app_data_dir_get());
layout = efl_add(EFL_UI_LAYOUT_CLASS, panes,
efl_file_set(efl_added, buf, "pager"),
efl_content_set(efl_part(panes, "second"), efl_added));
pager = efl_add(EFL_UI_PAGER_CLASS, layout,
efl_content_set(efl_part(layout, "pager"), efl_added),
efl_ui_pager_page_size_set(efl_added, EINA_SIZE2D(200, 300)),
efl_ui_pager_padding_set(efl_added, 20));
efl_add(EFL_UI_BUTTON_CLASS, layout,
efl_text_set(efl_added, "Prev"),
efl_event_callback_add(efl_added,
EFL_UI_EVENT_CLICKED, prev_btn_cb, pager),
efl_content_set(efl_part(layout, "prev_btn"), efl_added));
efl_add(EFL_UI_BUTTON_CLASS, layout,
efl_text_set(efl_added, "Next"),
efl_event_callback_add(efl_added,
EFL_UI_EVENT_CLICKED, next_btn_cb, pager),
efl_content_set(efl_part(layout, "next_btn"), efl_added));
tran = efl_add(EFL_PAGE_TRANSITION_SCROLL_CLASS, pager,
efl_ui_pager_transition_set(pager, efl_added));
params = calloc(1, sizeof(Params));
params->navi = navi;
params->pager = pager;
params->transition = NULL;
params->indicator = NULL;
params->w = 200;
params->h = 300;
params->padding = 20;
params->side_page_num = efl_page_transition_scroll_side_page_num_get(tran);
params->curr_page = 0;
params->wfill = EINA_FALSE;
params->hfill = EINA_FALSE;
params->prev_block = EINA_FALSE;
params->next_block = EINA_FALSE;
params->transition = tran;
elm_list_item_append(list, "Page Size", NULL, NULL, page_size_cb, params);
elm_list_item_append(list, "Padding", NULL, NULL, padding_cb, params);
elm_list_item_append(list, "Side Page Num", NULL, NULL, side_page_num_cb, params);
elm_list_item_append(list, "Pack / Unpack", NULL, NULL, pack_cb, params);
elm_list_item_append(list, "Current Page", NULL, NULL, current_page_cb, params);
elm_list_item_append(list, "Scroll Block", NULL, NULL, scroll_block_cb, params);
elm_list_item_append(list, "Loop", NULL, NULL, loop_cb, params);
elm_list_item_append(list, "Indicator", NULL, NULL, indicator_cb, params);
elm_list_go(list);
efl_event_callback_add(list, EFL_EVENT_DEL, list_del_cb, params);
for (i = 0; i < PAGE_NUM; i++) {
switch (i % 3) {
case 0:
page = page_add(LAYOUT, pager);
break;
case 1:
page = page_add(LIST, pager);
break;
case 2:
page = page_add(BUTTON, pager);
break;
default:
page = page_add(LAYOUT, pager);
break;
}
efl_pack_end(pager, page);
}
efl_gfx_entity_size_set(win, EINA_SIZE2D(580, 320));
}

View File

@ -156,7 +156,7 @@ typedef struct __s_symbol
/* Possible entries for "usage"
*
* This byte is used as a serie of bits, the syntax is different for
* This byte is used as a series of bits, the syntax is different for
* functions and other symbols:
*
* VARIABLE

View File

@ -258,6 +258,18 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia
eina_strbuf_append_buffer(*buf, param);
eina_strbuf_append(*buf, ");\n");
}
else if (t == EOLIAN_TYPE_BUILTIN_ARRAY)
{
eina_strbuf_append_printf(*buf, " while((");
eina_strbuf_append_buffer(*buf, iter_param);
eina_strbuf_append_printf(*buf, " = eina_array_pop(");
eina_strbuf_append_buffer(*buf, param);
eina_strbuf_append_printf(*buf, ")))\n");
_generate_loop_content(buf, inner_type, iter_param);
eina_strbuf_append_printf(*buf, " eina_array_free(");
eina_strbuf_append_buffer(*buf, param);
eina_strbuf_append_printf(*buf, ");\n");
}
else
{
printf("Error, container unknown?! %d\n", (int)t);

View File

@ -34,6 +34,10 @@ template <>
struct in_traits<eina::stringshare> { typedef eina::stringshare type; };
template <>
struct in_traits<eina::stringshare const> { typedef eina::stringshare const type; };
template <>
struct in_traits<efl::eina::strbuf> { typedef efl::eina::strbuf type; };
template <>
struct in_traits<efl::eina::strbuf const> { typedef efl::eina::strbuf const type; };
template <typename T>
struct in_traits<T&> { typedef T& type; };
template <typename T>
@ -531,6 +535,10 @@ inline const char* convert_to_c_impl(efl::eina::stringshare x, tag<const char*,
{
return eina_stringshare_ref(x.c_str());
}
inline Eina_Strbuf* convert_to_c_impl(efl::eina::strbuf& x, tag<Eina_Strbuf*, efl::eina::strbuf, false>)
{
return x.native_handle();
}
template <typename T, typename U, typename Deleter>
T* convert_to_c_impl(std::unique_ptr<U, Deleter>& v, tag<T*, std::unique_ptr<U, Deleter>>)
{

View File

@ -58,7 +58,7 @@ _promise_ctx_new(Efl_Loop *loop, Eina_Value *v)
Ctx *ctx;
ctx = calloc(1, sizeof(Ctx));
EINA_SAFETY_ON_NULL_GOTO(ctx, err_ctx);
ctx->p = efl_loop_promise_new(loop, NULL);
ctx->p = efl_loop_promise_new(loop);
EINA_SAFETY_ON_NULL_GOTO(ctx->p, err_timer);
ctx->value = v;
return ctx;

View File

@ -62,7 +62,7 @@ foreach edc_file : edc_files
themes += custom_target('edje_cc_' + edc_file,
input : edc_file,
output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta',
command : edje_cc_exe + [ '-beta', '-fastcomp',
'-id', meson.current_source_dir(),
'-fd', meson.current_source_dir(),
'-sd', meson.current_source_dir(),
@ -77,7 +77,7 @@ endforeach
codegen = custom_target('edje_cc_codegen_edc',
input : 'codegen.edc',
output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta',
command : edje_cc_exe + [ '-beta', '-fastcomp',
'-id', meson.current_source_dir(),
'-fd', meson.current_source_dir(),
'-sd', meson.current_source_dir(),

View File

@ -17,14 +17,14 @@ main(int argc, char **argv)
eina_init();
list = eina_list_append(list, "caprica");
list = eina_list_append(list, "sagitarius");
list = eina_list_append(list, "sagittarius");
list = eina_list_append(list, "aerilon");
list = eina_list_append(list, "gemenon");
list = eina_list_promote_list(list, eina_list_nth_list(list, 2));
list = eina_list_demote_list(list, eina_list_nth_list(list, 2));
list = eina_list_remove(list, "sagitarius");
list = eina_list_remove(list, "sagittarius");
l = eina_list_data_find_list(list, "aerilon");
eina_list_data_set(l, "aquarius");

View File

@ -35,7 +35,7 @@ group {
}
program {
signal: "efl,state,odd"; source: "efl";
action: STATE_SET "odd" 1.0;
action: STATE_SET "odd" 0.0;
target: "base";
}
program {

View File

@ -166,6 +166,9 @@ group { name: "elm/scroller/base/evas3d";
inherit: "default" 0.0;
min: 0 0;
}
description { state: "clicked" 0.0;
inherit: "default" 0.0;
}
}
part { name: "sb_vbar_a1"; type: RECT;
clip_to: "sb_vbar";
@ -224,7 +227,6 @@ group { name: "elm/scroller/base/evas3d";
program {
signal: "mouse,down,1*"; source: "sb_vbar_a1";
action: STATE_SET "clicked" 0.0;
target: "sb_vbar_a1";
target: "arrow1_vbar";
}
program {
@ -235,13 +237,11 @@ group { name: "elm/scroller/base/evas3d";
program {
signal: "mouse,up,1"; source: "sb_vbar_a1";
action: STATE_SET "default" 0.0;
target: "sb_vbar_a1";
target: "arrow1_vbar";
}
program {
signal: "mouse,down,1*"; source: "sb_vbar_a2";
action: STATE_SET "clicked" 0.0;
target: "sb_vbar_a2";
target: "arrow2_vbar";
}
program {
@ -252,7 +252,6 @@ group { name: "elm/scroller/base/evas3d";
program {
signal: "mouse,up,1"; source: "sb_vbar_a2";
action: STATE_SET "default" 0.0;
target: "sb_vbar_a2";
target: "arrow2_vbar";
}
program {
@ -344,6 +343,9 @@ group { name: "elm/scroller/base/evas3d";
inherit: "default" 0.0;
min: 0 0;
}
description { state: "clicked" 0.0;
inherit: "default" 0.0;
}
}
part { name: "sb_hbar_a1"; type: RECT;
clip_to: "sb_hbar";
@ -402,7 +404,6 @@ group { name: "elm/scroller/base/evas3d";
program {
signal: "mouse,down,1*"; source: "sb_hbar_a1";
action: STATE_SET "clicked" 0.0;
target: "sb_hbar_a1";
target: "arrow1_hbar";
}
program {
@ -413,13 +414,11 @@ group { name: "elm/scroller/base/evas3d";
program {
signal: "mouse,up,1"; source: "sb_hbar_a1";
action: STATE_SET "default" 0.0;
target: "sb_hbar_a1";
target: "arrow1_hbar";
}
program {
signal: "mouse,down,1*"; source: "sb_hbar_a2";
action: STATE_SET "clicked" 0.0;
target: "sb_hbar_a2";
target: "arrow2_hbar";
}
program {
@ -430,7 +429,6 @@ group { name: "elm/scroller/base/evas3d";
program {
signal: "mouse,up,1"; source: "sb_hbar_a2";
action: STATE_SET "default" 0.0;
target: "sb_hbar_a2";
target: "arrow2_hbar";
}
program {

View File

@ -27,16 +27,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
efl::ui::Slider sl2(instantiate, win);
efl::ui::Image ic(instantiate, win);
ic.icon_set("home");
ic.icon_set("folder");
ic.scalable_set(false, false);
sl2.content_set(ic);
efl::ui::Image ic2(instantiate, win);
ic2.icon_set("folder");
ic2.scalable_set(false, false);
// FIXME: C++ part API needs special reference handling! This will show ERR!
efl::eo::downcast<efl::Content>(sl2.part_get("elm.swallow.end"))
.content_set(ic2);
.content_set(ic);
sl2.hint_fill_set(true, false);
bx.pack_end(sl2);

View File

@ -1115,7 +1115,7 @@ EAPI int ecore_exe_run_priority_get(void);
* @param data Data to attach to the returned process handle.
* @return A process handle to the spawned process.
* @note When you use this function you will have no permissions
* to write or read on the pipe that connects you with the spwaned process.
* to write or read on the pipe that connects you with the spawned process.
* If you need to do that use ecore_exe_pipe_run() with the
* appropriated flags.
*
@ -2507,9 +2507,9 @@ EAPI void ecore_pipe_freeze(Ecore_Pipe *p);
* @brief Waits from another thread on the read side of a pipe.
*
* @param p The pipe to watch on.
* @param message_count The minimal number of message to wait before exiting.
* @param wait The amount of time in second to wait before exiting.
* @return the number of message catched during that wait call.
* @param message_count The minimum number of messages to wait for before exiting.
* @param wait The amount of time in seconds to wait before exiting.
* @return The number of message caught during the wait call.
* @since 1.1
*
* Negative value for @p wait means infite wait.
@ -2908,7 +2908,7 @@ EAPI double ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, dou
* @li ECORE_POS_MAP_SPRING - Start at 0.0 then "wobble" like a spring rest
* position 1.0, and wobble v2 times, with decay factor of v[0]
* @li ECORE_POS_MAP_CUBIC_BEZIER - Use an interpolated cubic-bezier curve
* ajusted with parameters from v[0] to v[3].
* adjusted with parameters from v[0] to v[3].
* @note When not listed v has no effect.
*
* @image html ecore-pos-map.png

View File

@ -2,10 +2,6 @@
# include <config.h>
#endif
#define EFL_IO_READER_PROTECTED 1
#define EFL_IO_WRITER_PROTECTED 1
#define EFL_IO_CLOSER_PROTECTED 1
#include <Ecore.h>
#include "ecore_private.h"
@ -16,24 +12,8 @@
#define MY_CLASS EFL_APP_CLASS
typedef struct _Efl_App_Data Efl_App_Data;
struct _Efl_App_Data
{
struct {
int in, out;
Eo *in_handler, *out_handler;
Eina_Bool can_read : 1;
Eina_Bool eos_read : 1;
Eina_Bool can_write : 1;
} fd;
int read_listeners;
};
Efl_Version _app_efl_version = { 0, 0, 0, 0, NULL, NULL };
//////////////////////////////////////////////////////////////////////////
EOLIAN static Efl_App*
_efl_app_app_main_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
@ -43,81 +23,14 @@ _efl_app_app_main_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
return _mainloop_singleton;
}
//////////////////////////////////////////////////////////////////////////
static void
_parent_read_listeners_modify(Efl_App_Data *pd, int mod)
{
pd->read_listeners += mod;
if (pd->fd.out_handler)
{
if ((pd->read_listeners == 0) && (mod < 0))
efl_loop_handler_active_set
(pd->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_NONE);
else if ((pd->read_listeners == 1) && (mod > 0))
efl_loop_handler_active_set
(pd->fd.out_handler, EFL_LOOP_HANDLER_FLAGS_READ);
}
}
static void
_cb_event_callback_add(void *data, const Efl_Event *event)
{
Efl_App_Data *pd = data;
const Efl_Callback_Array_Item_Full *array = event->info;
int i;
for (i = 0; array[i].desc != NULL; i++)
{
if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
_parent_read_listeners_modify(pd, 1);
}
}
static void
_cb_event_callback_del(void *data, const Efl_Event *event)
{
Efl_App_Data *pd = data;
const Efl_Callback_Array_Item_Full *array = event->info;
int i;
for (i = 0; array[i].desc != NULL; i++)
{
if (array[i].desc == EFL_IO_READER_EVENT_CAN_READ_CHANGED)
_parent_read_listeners_modify(pd, -1);
}
}
static void
_cb_out(void *data, const Efl_Event *event EINA_UNUSED)
{
Eo *obj = data;
efl_io_reader_can_read_set(obj, EINA_TRUE);
}
static void
_cb_in(void *data, const Efl_Event *event EINA_UNUSED)
{
Eo *obj = data;
efl_io_writer_can_write_set(obj, EINA_TRUE);
}
EFL_CALLBACKS_ARRAY_DEFINE(_event_callback_watch,
{ EFL_EVENT_CALLBACK_ADD, _cb_event_callback_add },
{ EFL_EVENT_CALLBACK_DEL, _cb_event_callback_del });
//////////////////////////////////////////////////////////////////////////
EOLIAN static const Efl_Version *
_efl_app_build_efl_version_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd EINA_UNUSED)
_efl_app_build_efl_version_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
return &_app_efl_version;
}
EOLIAN static const Efl_Version *
_efl_app_efl_version_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd EINA_UNUSED)
_efl_app_efl_version_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
/* vanilla EFL: flavor = NULL */
static const Efl_Version version = {
@ -131,217 +44,6 @@ _efl_app_efl_version_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd EINA_UNUSED
return &version;
}
EOLIAN static Efl_Object *
_efl_app_efl_object_constructor(Eo *obj, Efl_App_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_event_callback_array_add(obj, _event_callback_watch(), pd);
pd->fd.in = 1;
pd->fd.out = 0;
pd->fd.can_write = EINA_TRUE;
pd->fd.in_handler =
efl_add(EFL_LOOP_HANDLER_CLASS, obj,
efl_loop_handler_fd_set(efl_added, pd->fd.in),
efl_event_callback_add(efl_added, EFL_LOOP_HANDLER_EVENT_WRITE, _cb_in, obj));
pd->fd.out_handler =
efl_add(EFL_LOOP_HANDLER_CLASS, obj,
efl_loop_handler_fd_set(efl_added, pd->fd.out),
efl_event_callback_add(efl_added, EFL_LOOP_HANDLER_EVENT_READ, _cb_out, obj));
return obj;
}
EOLIAN static void
_efl_app_efl_object_invalidate(Eo *obj, Efl_App_Data *pd)
{
pd->fd.in_handler = NULL;
pd->fd.out_handler = NULL;
pd->fd.in = -1;
pd->fd.out = -1;
efl_invalidate(efl_super(obj, MY_CLASS));
}
EOLIAN static Eina_Error
_efl_app_efl_io_closer_close(Eo *obj, Efl_App_Data *pd)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(obj), EBADF);
efl_io_writer_can_write_set(obj, EINA_FALSE);
efl_io_reader_can_read_set(obj, EINA_FALSE);
efl_io_reader_eos_set(obj, EINA_TRUE);
if (pd->fd.in_handler) efl_del(pd->fd.in_handler);
if (pd->fd.out_handler) efl_del(pd->fd.out_handler);
pd->fd.in = -1;
pd->fd.out = -1;
pd->fd.in_handler = NULL;
pd->fd.out_handler = NULL;
return 0;
}
EOLIAN static Eina_Bool
_efl_app_efl_io_closer_closed_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
{
if ((pd->fd.in == -1) && (pd->fd.out == -1)) return EINA_TRUE;
return EINA_FALSE;
}
EOLIAN static Eina_Error
_efl_app_efl_io_reader_read(Eo *obj, Efl_App_Data *pd, Eina_Rw_Slice *rw_slice)
{
ssize_t r;
errno = 0;
if (pd->fd.out == -1) goto err;
do
{
errno = 0;
r = read(pd->fd.out, rw_slice->mem, rw_slice->len);
if (r == -1)
{
if (errno == EINTR) continue;
goto err;
}
}
while (r == -1);
rw_slice->len = r;
if (r == 0)
{
efl_io_reader_can_read_set(obj, EINA_FALSE);
efl_io_reader_eos_set(obj, EINA_TRUE);
close(pd->fd.out);
pd->fd.out = -1;
efl_del(pd->fd.out_handler);
pd->fd.out_handler = NULL;
return EPIPE;
}
return 0;
err:
if ((pd->fd.out != -1) && (errno != EAGAIN))
{
close(pd->fd.out);
pd->fd.out = -1;
efl_del(pd->fd.out_handler);
pd->fd.out_handler = NULL;
}
rw_slice->len = 0;
rw_slice->mem = NULL;
efl_io_reader_can_read_set(obj, EINA_FALSE);
return EINVAL;
}
EOLIAN static void
_efl_app_efl_io_reader_can_read_set(Eo *obj, Efl_App_Data *pd, Eina_Bool can_read)
{
Eina_Bool old = efl_io_reader_can_read_get(obj);
if (old == can_read) return;
pd->fd.can_read = can_read;
if (can_read)
efl_loop_handler_active_set(pd->fd.in_handler, 0);
else
efl_loop_handler_active_set(pd->fd.in_handler,
EFL_LOOP_HANDLER_FLAGS_READ);
efl_event_callback_call(obj, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
}
EOLIAN static Eina_Bool
_efl_app_efl_io_reader_can_read_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
{
return pd->fd.can_read;
}
EOLIAN static void
_efl_app_efl_io_reader_eos_set(Eo *obj, Efl_App_Data *pd, Eina_Bool is_eos)
{
Eina_Bool old = efl_io_reader_eos_get(obj);
if (old == is_eos) return;
pd->fd.eos_read = is_eos;
if (!is_eos) return;
if (pd->fd.out_handler)
efl_loop_handler_active_set(pd->fd.out_handler, 0);
efl_event_callback_call(obj, EFL_IO_READER_EVENT_EOS, NULL);
}
EOLIAN static Eina_Bool
_efl_app_efl_io_reader_eos_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
{
return pd->fd.eos_read;
}
EOLIAN static Eina_Error
_efl_app_efl_io_writer_write(Eo *obj, Efl_App_Data *pd, Eina_Slice *slice, Eina_Slice *remaining)
{
ssize_t r;
errno = 0;
if (pd->fd.in == -1) goto err;
do
{
errno = 0;
r = write(pd->fd.in, slice->mem, slice->len);
if (r == -1)
{
if (errno == EINTR) continue;
goto err;
}
}
while (r == -1);
if (remaining)
{
remaining->len = slice->len - r;
remaining->bytes = slice->bytes + r;
}
slice->len = r;
if ((slice) && (slice->len > 0))
efl_io_writer_can_write_set(obj, EINA_FALSE);
if (r == 0)
{
close(pd->fd.in);
pd->fd.in = -1;
efl_del(pd->fd.in_handler);
pd->fd.in_handler = NULL;
return EPIPE;
}
return 0;
err:
if ((pd->fd.in != -1) && (errno != EAGAIN))
{
close(pd->fd.in);
pd->fd.in = -1;
efl_del(pd->fd.in_handler);
pd->fd.in_handler = NULL;
}
if (remaining) *remaining = *slice;
slice->len = 0;
slice->mem = NULL;
efl_io_writer_can_write_set(obj, EINA_FALSE);
return EINVAL;
}
EOLIAN static void
_efl_app_efl_io_writer_can_write_set(Eo *obj, Efl_App_Data *pd, Eina_Bool can_write)
{
Eina_Bool old = efl_io_writer_can_write_get(obj);
if (old == can_write) return;
pd->fd.can_write = can_write;
if (can_write)
efl_loop_handler_active_set(pd->fd.in_handler, 0);
else
efl_loop_handler_active_set(pd->fd.in_handler,
EFL_LOOP_HANDLER_FLAGS_WRITE);
efl_event_callback_call(obj, EFL_IO_WRITER_EVENT_CAN_WRITE_CHANGED, NULL);
}
EOLIAN static Eina_Bool
_efl_app_efl_io_writer_can_write_get(const Eo *obj EINA_UNUSED, Efl_App_Data *pd)
{
return pd->fd.can_write;
}
#ifdef _WIN32
#else
static const signed char primap[EFL_TASK_PRIORITY_ULTRA + 1] =
@ -355,7 +57,7 @@ static const signed char primap[EFL_TASK_PRIORITY_ULTRA + 1] =
#endif
EOLIAN static void
_efl_app_efl_task_priority_set(Eo *obj, Efl_App_Data *pd EINA_UNUSED, Efl_Task_Priority priority)
_efl_app_efl_task_priority_set(Eo *obj, void *pd EINA_UNUSED, Efl_Task_Priority priority)
{
efl_task_priority_set(efl_super(obj, MY_CLASS), priority);
#ifdef _WIN32
@ -371,7 +73,7 @@ _efl_app_efl_task_priority_set(Eo *obj, Efl_App_Data *pd EINA_UNUSED, Efl_Task_P
}
EOLIAN static Efl_Task_Priority
_efl_app_efl_task_priority_get(const Eo *obj, Efl_App_Data *pd EINA_UNUSED)
_efl_app_efl_task_priority_get(const Eo *obj, void *pd EINA_UNUSED)
{
Efl_Task_Priority pri = EFL_TASK_PRIORITY_NORMAL;
#ifdef _WIN32

View File

@ -3,6 +3,7 @@ import efl_types;
class Efl.App extends Efl.Loop
{
[[ ]]
data: null;
methods {
@property app_main @class {
[[ Returns the app object that is representing this process
@ -46,15 +47,6 @@ class Efl.App extends Efl.Loop
signal,hup: void; [[System specific, but on unix maps to SIGHUP signal to the process - only called on main loop object]]
}
implements {
Efl.Object.constructor;
Efl.Object.invalidate;
Efl.Io.Closer.close;
Efl.Io.Closer.closed { get; }
Efl.Io.Reader.read;
Efl.Io.Reader.can_read { get; set; }
Efl.Io.Reader.eos { get; set; }
Efl.Io.Writer.write;
Efl.Io.Writer.can_write { get; set; }
Efl.Task.priority { get; set; }
}
}

View File

@ -1,4 +1,4 @@
class Efl.Appthread extends Efl.Loop implements Efl.ThreadIO
class Efl.Appthread extends Efl.Loop implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer
{
[[ ]]
methods {

View File

@ -19,7 +19,7 @@ enum Efl.Exe_Flags {
hide_io = 4
}
class Efl.Exe extends Efl.Task
class Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer
{
[[ ]]
methods {

View File

@ -173,6 +173,7 @@ efl_loop_exit_code_process(Eina_Value *value)
out = stderr;
}
fprintf(out, "%s\n", msg);
free(msg);
}
return r;
}
@ -361,6 +362,8 @@ _efl_loop_efl_object_destructor(Eo *obj, Efl_Loop_Data *pd)
pd->env.environ_copy = NULL;
eina_lock_release(&_environ_lock);
eina_value_flush(&pd->exit_code);
efl_destructor(efl_super(obj, EFL_LOOP_CLASS));
}

View File

@ -1,4 +1,4 @@
class Efl.Model_Loop extends Efl.Loop_Consumer implements Efl.Model
abstract Efl.Model_Loop extends Efl.Loop_Consumer implements Efl.Model
{
data: null;
implements {

View File

@ -15,7 +15,7 @@ enum Efl.Task_Flags {
no_exit_code_error = 4,
}
abstract Efl.Task extends Efl.Object implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer
abstract Efl.Task extends Efl.Object
{
[[ ]]
methods {

View File

@ -1,4 +1,4 @@
class Efl.Thread extends Efl.Task implements Efl.ThreadIO
class Efl.Thread extends Efl.Task implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer
{
methods {
}

View File

@ -156,6 +156,8 @@ class Ecore.Audio.In extends Ecore.Audio
@empty .length {set;}
@empty .preloaded {set; get;}
@empty .seek;
@empty Ecore.Audio.source {set; get;}
@empty Ecore.Audio.format {set; get;}
}
events {
in,looped: void; [[Called when an input has looped.]]

View File

@ -1,4 +1,4 @@
class Ecore.Audio.Out extends Ecore.Audio
abstract Ecore.Audio.Out extends Ecore.Audio
{
[[Ecore Audio output object.]]

View File

@ -7,6 +7,8 @@ class Ecore.Audio.Out.Pulse extends Ecore.Audio.Out
Efl.Object.constructor;
Efl.Object.destructor;
Ecore.Audio.volume { set; }
@empty Ecore.Audio.format { set; get; }
@empty Ecore.Audio.source { set; get; }
Ecore.Audio.Out.input_attach;
Ecore.Audio.Out.input_detach;
}

View File

@ -7,6 +7,8 @@ class Ecore.Audio.Out.Wasapi extends Ecore.Audio.Out
Efl.Object.constructor;
Efl.Object.destructor;
Ecore.Audio.volume { set;}
@empty Ecore.Audio.format { set; get; }
@empty Ecore.Audio.source { set; get; }
Ecore.Audio.Out.input_attach;
Ecore.Audio.Out.input_detach;
}

View File

@ -1300,6 +1300,12 @@ _efl_net_dialer_websocket_efl_io_reader_can_read_set(Eo *o, Efl_Net_Dialer_Webso
efl_event_callback_call(o, EFL_IO_READER_EVENT_CAN_READ_CHANGED, NULL);
}
EOLIAN static void
_efl_net_dialer_websocket_efl_io_reader_eos_set(Eo *obj EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd EINA_UNUSED, Eina_Bool is_eos EINA_UNUSED)
{
/* NOP Does not need to be implemented, someone else cannot tell this class to be at the eos. This is done internally and decided within the state of the websocket.*/
}
EOLIAN static Eina_Bool
_efl_net_dialer_websocket_efl_io_reader_eos_get(const Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
{

View File

@ -325,7 +325,7 @@ class Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Net.Dial
Efl.Net.Socket.address_remote { get; set; }
Efl.Io.Reader.read;
Efl.Io.Reader.can_read { get; set; }
Efl.Io.Reader.eos { get; }
Efl.Io.Reader.eos { get; set; }
Efl.Io.Writer.write;
Efl.Io.Writer.can_write { get; set; }
Efl.Io.Closer.close;

View File

@ -1,4 +1,4 @@
class Efl.Net.Server_Ip extends Efl.Net.Server_Fd {
abstract Efl.Net.Server_Ip extends Efl.Net.Server_Fd {
[[An IP server.
@since 1.20

View File

@ -99,5 +99,8 @@ class Efl.Net.Server_Udp extends Efl.Net.Server_Ip {
Efl.Net.Server.serve;
Efl.Net.Server_Fd.process_incoming_data;
Efl.Net.Server_Fd.socket_activate;
//These functions are not used, udp emits the there defined events from its internals
@empty Efl.Net.Server_Fd.client_add;
@empty Efl.Net.Server_Fd.client_reject;
}
}

View File

@ -925,6 +925,20 @@ _output_destroy(Ecore_Drm2_Device *dev EINA_UNUSED, Ecore_Drm2_Output *output)
free(output);
}
/* this function is used to indicate if we are in a multi-gpu situation
* and need to calculate vblank sync with high crtc mask */
static unsigned int
_output_vblank_pipe(Ecore_Drm2_Output *output)
{
if (output->pipe > 1)
return ((output->pipe << DRM_VBLANK_HIGH_CRTC_SHIFT) &
DRM_VBLANK_HIGH_CRTC_MASK);
else if (output->pipe > 0)
return DRM_VBLANK_SECONDARY;
else
return 0;
}
EAPI Eina_Bool
ecore_drm2_outputs_create(Ecore_Drm2_Device *device)
{
@ -1619,6 +1633,7 @@ ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *s
memset(&v, 0, sizeof(v));
v.request.type = DRM_VBLANK_RELATIVE;
v.request.type |= _output_vblank_pipe(output);
v.request.sequence = sequence;
ret = sym_drmWaitVBlank(output->fd, &v);
success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0);

View File

@ -100,10 +100,6 @@ abstract Ector.Renderer extends Efl.Object
[[Prepare for rendering]]
return: bool; [[$true on success, $false otherwise]]
}
done @pure_virtual {
[[Done with rendering]]
return: bool; [[$true on success, $false otherwise]]
}
}
implements {
Efl.Object.destructor;

View File

@ -2187,10 +2187,10 @@ EAPI void *edje_object_text_insert_filter_callback_del_full(Evas_Object *obj, co
* text is to be rejected, freeing it and setting the pointer to @c null will
* make Edje break out of the filter cycle and reject the inserted text. This
* function is different from edje_object_text_insert_filter_callback_add() in
* that the text parameter in the fucn filter is always markup.
* that the text parameter in the func filter is always markup.
*
* @warning If you use this function with
* edje_object_text_insert_filter_callback_add() togehter, all
* edje_object_text_insert_filter_callback_add() together, all
* Edje_Text_Filter_Cb functions and Edje_Markup_Filter_Cb functions will be
* executed, and then filtered text will be inserted.
*

View File

@ -3397,6 +3397,82 @@ _efl_canvas_layout_efl_container_content_remove(Eo *obj EINA_UNUSED, Edje *ed, E
return EINA_TRUE;
}
typedef struct _Content_Part_Iterator Content_Part_Iterator;
struct _Content_Part_Iterator
{
Eina_Iterator iterator;
Eo *object;
Edje *ed;
unsigned index;
};
static Eina_Bool
_content_part_iterator_next(Content_Part_Iterator *it, void **data)
{
for (; it->index < it->ed->table_parts_size; it->index++)
{
Edje_Real_Part *rp = it->ed->table_parts[it->index];
if (rp->part && rp->part->type == EDJE_PART_TYPE_SWALLOW)
{
if (data) *data = (void*) rp->typedata.swallow->swallowed_object;
it->index++;
return EINA_TRUE;
}
}
return EINA_FALSE;
}
static Eo *
_content_part_iterator_get_container(Content_Part_Iterator *it)
{
return it->object;
}
static void
_content_part_iterator_free(Content_Part_Iterator *it)
{
free(it);
}
EOLIAN Eina_Iterator*
_efl_canvas_layout_efl_container_content_iterate(Eo *obj, Edje *ed)
{
Content_Part_Iterator *it;
it = calloc(1, sizeof(*it));
if (!it) return NULL;
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
it->iterator.version = EINA_ITERATOR_VERSION;
it->iterator.next = FUNC_ITERATOR_NEXT(_content_part_iterator_next);
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_content_part_iterator_get_container);
it->iterator.free = FUNC_ITERATOR_FREE(_content_part_iterator_free);
it->object = obj;
it->ed = ed;
it->index = 0;
return &it->iterator;
}
EOLIAN int
_efl_canvas_layout_efl_container_content_count(Eo *obj EINA_UNUSED, Edje *pd)
{
Edje_Real_Part *rp;
int result = 0;
for (int i = 0; i < pd->table_parts_size; ++i)
{
rp = pd->table_parts[i];
if (rp->part && rp->part->type == EDJE_PART_TYPE_SWALLOW)
result ++;
}
return result;
}
Efl_Gfx_Entity *
_edje_efl_content_content_get(Edje *ed, const char *part)
{

View File

@ -116,6 +116,8 @@ class Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.Contai
Efl.File.load_error { get; }
Efl.File.mmap { get; set; }
Efl.Container.content_remove;
Efl.Container.content_iterate;
Efl.Container.content_count;
Efl.Part.part_get; [[Returns @Efl.Canvas.Layout_Part]]
Efl.Observer.update;
Efl.Player.playable { get; }

View File

@ -1,5 +1,5 @@
class Efl.Canvas.Layout_Part_Box extends Efl.Canvas.Layout_Part implements Efl.Pack_Linear,
Efl.Ui.Direction
Efl.Ui.Direction_Readonly
{
[[Represents a Box created as part of a layout.

View File

@ -1,5 +1,5 @@
class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements Efl.Content,
Efl.Pack_Linear, Efl.Ui.Direction,
Efl.Pack_Linear, Efl.Ui.Direction_Readonly,
Efl.Pack_Table, Efl.Text,
Efl.Text_Markup
{

View File

@ -430,7 +430,7 @@ eet_clearcache(void);
* @until printf
*
* More cheating follows. Just like we knew this was an Eet file, we also know
* what key to read from, and ontop of that we know that the data in it is not
* what key to read from, and on top of that we know that the data in it is not
* compressed.
* Knowing all this allows us to take some shortcuts.
* @until read_direct
@ -1604,7 +1604,7 @@ eet_data_image_read_to_surface_cipher(Eet_File *ef,
* @param w The expected width in pixels of the pixel surface to decode.
* @param h The expected height in pixels of the pixel surface to decode.
* @param row_stride The length of a pixels line in the destination surface.
* @param cspace The color space of the pixels bsurface.
* @param cspace The color space of the pixels surface.
* @param alpha A pointer to the int to hold the alpha flag.
* @param comp A pointer to the int to hold the compression amount.
* @param quality A pointer to the int to hold the quality amount.
@ -2080,7 +2080,7 @@ eet_identity_print(Eet_Key *key,
* file path to a 'pem' format file (the same used for siging with
* eet_identity_open() as a certificate file).
*
* @note This function can not be used to provide any security mecanism. You
* @note This function can not be used to provide any security mechanism. You
* need to check your x509 certificate against a chain of trust to have a proper
* security. This is just a convenience test function.
* @warning You need to compile signature support in EET.
@ -3350,7 +3350,7 @@ eet_data_undump(Eet_File *ef,
*
* The data to be decoded is stored at the memory pointed to by @p data_in,
* and is described by the descriptor pointed to by @p edd. The data size is
* passed in as the value to @p size_in, ande must be greater than 0 to
* passed in as the value to @p size_in, and must be greater than 0 to
* succeed.
*
* This function is useful for decoding data structures delivered to the
@ -4193,7 +4193,7 @@ eet_data_undump_cipher(Eet_File *ef,
*
* The data to be decoded is stored at the memory pointed to by @p data_in,
* and is described by the descriptor pointed to by @p edd. The data size is
* passed in as the value to @p size_in, ande must be greater than 0 to
* passed in as the value to @p size_in, and must be greater than 0 to
* succeed.
*
* This function is useful for decoding data structures delivered to the

View File

@ -306,7 +306,7 @@ eet_2_emile_compressor(int comp)
switch (comp)
{
case EET_COMPRESSION_VERYFAST: return EMILE_LZ4HC;
case EET_COMPRESSION_SUPERFAST: return EMILE_LZ4HC;
case EET_COMPRESSION_SUPERFAST: return EMILE_LZ4;
default: return EMILE_ZLIB;
}
}

View File

@ -96,8 +96,10 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_orientation.eo.h"
#include "interfaces/efl_ui_i18n.eo.h"
#include "interfaces/efl_ui_direction.eo.h"
#include "interfaces/efl_ui_direction_readonly.eo.h"
#include "interfaces/efl_ui_drag.eo.h"
#include "interfaces/efl_ui_range.eo.h"
#include "interfaces/efl_ui_range_display.eo.h"
#include "interfaces/efl_ui_range_interactive.eo.h"
#include "interfaces/efl_ui_autorepeat.eo.h"
#include "interfaces/efl_ui_draggable.eo.h"
#include "interfaces/efl_ui_clickable.eo.h"
@ -182,6 +184,8 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_text_markup.eo.h"
#include "interfaces/efl_text_markup_util.eo.h"
EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple);
/**
* @brief Get a proxy object referring to a part of an object.
*

View File

@ -116,6 +116,7 @@ struct _Efl_Input_Focus_Data
Efl_Input_Device *device; //The seat
Eo *object_wref; // wref on the focused object - Efl.Canvas.Object or Efl.Canvas.
double timestamp;
Efl_Input_Flags event_flags;
};
/* Internal helpers */

View File

@ -3,7 +3,7 @@ interface Efl.Config
[[A generic configuration interface, that holds key-value pairs.]]
methods {
@property config {
[[A generic configuration value, refered to by name.]]
[[A generic configuration value, referred to by name.]]
get {
keys {
name: string; [[Configuration option name.]]

View File

@ -9,36 +9,6 @@ interface Efl.Gfx.Size_Hint
[[Efl graphics size hint interface]]
event_prefix: efl_gfx_entity;
methods {
@property hint_base {
[[Base size for objects with sizing restrictions.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
@.hint_base + N x @.hint_step is what is calculated for object
sizing restrictions.
See also @.hint_step.
]]
values {
sz: Eina.Size2D; [[Base size (hint) in pixels.]]
}
}
@property hint_step {
[[Step size for objects with sizing restrictions.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
Set this to for an object to scale up by steps and not continuously.
@.hint_base + N x @.hint_step is what is calculated for object
sizing restrictions.
]]
values {
sz: Eina.Size2D; [[Step size (hint) in pixels.]]
}
}
@property hint_aspect {
[[Defines the aspect ratio to respect when scaling this object.

View File

@ -66,7 +66,8 @@
#include "interfaces/efl_ui_i18n.eo.c"
#include "interfaces/efl_ui_direction.eo.c"
#include "interfaces/efl_ui_drag.eo.c"
#include "interfaces/efl_ui_range.eo.c"
#include "interfaces/efl_ui_range_display.eo.c"
#include "interfaces/efl_ui_range_interactive.eo.c"
#include "interfaces/efl_ui_autorepeat.eo.c"
#include "interfaces/efl_ui_view.eo.c"
#include "interfaces/efl_ui_model_connect.eo.c"

View File

@ -257,5 +257,12 @@ _efl_observable_iterator_tuple_new(Eo *obj, Efl_Observable_Data *pd)
return &it->iterator;
}
EAPI void
efl_observable_tuple_free(Efl_Observable_Tuple *tuple)
{
//key is not owned
eina_iterator_free(tuple->data);
}
#include "interfaces/efl_observable.eo.c"
#include "interfaces/efl_observer.eo.c"

View File

@ -39,7 +39,7 @@ struct Efl.Version
build_id: string; [[Contains $EFL_BUILD_ID.]]
}
struct Efl.Observable_Tuple
struct @free(efl_observable_tuple_free) Efl.Observable_Tuple
{
[[This type describes an observable touple]]
key: string; [[Touple key]]

View File

@ -0,0 +1,17 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Efl.h>
typedef struct {
} Efl_Ui_Direction_Readonly_Data;
EOLIAN static void
_efl_ui_direction_readonly_efl_ui_direction_direction_set(Eo *obj EINA_UNUSED, Efl_Ui_Direction_Readonly_Data *pd EINA_UNUSED, Efl_Ui_Dir dir EINA_UNUSED)
{
EINA_LOG_ERR("This object does not allow setting of a direction");
}
#include "efl_ui_direction_readonly.eo.c"

View File

@ -0,0 +1,6 @@
mixin Efl.Ui.Direction_Readonly extends Efl.Ui.Direction
{
implements {
Efl.Ui.Direction.direction { set; [[This will always print and error that this is a readonly object]]}
}
}

View File

@ -1,6 +1,7 @@
interface Efl.Ui.Range
interface Efl.Ui.Range_Display
{
[[Efl UI progress interface]]
[[Interface that contains properties regarding the displaying of a range.]]
eo_prefix: efl_ui_range;
methods {
@property range_value {
[[Control the range value (in percentage) on a given range widget
@ -26,7 +27,7 @@ interface Efl.Ui.Range
If actual value is less than $min, it will be updated to $min.
If it is bigger then $max, will be updated to $max. The actual value
can be obtained with @Efl.Ui.Range.range_value.get
can be obtained with @Efl.Ui.Range_Display.range_value.get
The minimum and maximum values may be different for each class.
@ -46,21 +47,5 @@ interface Efl.Ui.Range
max: double; [[The maximum value.]]
}
}
@property range_step {
[[Control the step used to increment or decrement values for given widget.
This value will be incremented or decremented to the displayed value.
By default step value is equal to 1.
Warning: The step value should be bigger than 0.]]
set {
}
get {
}
values {
step: double; [[The step value.]]
}
}
}
}

View File

@ -0,0 +1,26 @@
interface Efl.Ui.Range_Interactive extends Efl.Ui.Range_Display
{
[[Interface that extends the normal displaying properties with usage properties.
The properties defined here are used to manipulate the way a user interacts with a displayed range.
]]
eo_prefix: efl_ui_range;
methods {
@property range_step {
[[Control the step used to increment or decrement values for given widget.
This value will be incremented or decremented to the displayed value.
By default step value is equal to 1.
Warning: The step value should be bigger than 0.]]
set {
}
get {
}
values {
step: double; [[The step value.]]
}
}
}
}

View File

@ -109,7 +109,7 @@ interface Efl.Ui.Scrollable_Interactive extends Efl.Ui.Scrollable
The scroller will adjust the view to glue itself as follows.
x=0.0, for staying where it is relative to the left edge of the content
x=1.0, for staying where it is relative to the rigth edge of the content
x=1.0, for staying where it is relative to the right edge of the content
y=0.0, for staying where it is relative to the top edge of the content
y=1.0, for staying where it is relative to the bottom edge of the content

View File

@ -17,23 +17,14 @@ interface Efl.Ui.Zoom
methods {
@property zoom_animation {
set {
[[Enable zoom animation
This sets the zoom animation state to on or off for zoomable. The
default is off. This will stop zooming using animation on
zoom level changes and change instantly. This will stop any
existing animations that are running.
]]
}
get {
[[Disable zoom animation
This gets the current zoom animation state for the zoomable object.
]]
}
[[This sets the zoom animation state to on or off for zoomable. The
default is off. When $paused is $true, it will stop zooming using
animation on zoom level changes and change instantly, stopping any
existing animations that are running.]]
set {}
get {}
values {
paused: bool; [[The pause state.]]
paused: bool; [[The paused state.]]
}
}
@property zoom_level {

View File

@ -83,8 +83,10 @@ pub_eo_files = [
'efl_pack_table.eo',
'efl_ui_i18n.eo',
'efl_ui_direction.eo',
'efl_ui_direction_readonly.eo',
'efl_ui_drag.eo',
'efl_ui_range.eo',
'efl_ui_range_display.eo',
'efl_ui_range_interactive.eo',
'efl_ui_view.eo',
'efl_ui_model_connect.eo',
'efl_ui_factory.eo',
@ -171,6 +173,7 @@ efl_src += files([
'efl_observer.c',
'efl_file.c',
'efl_ui_format.c',
'efl_ui_direction_readonly.c',
'efl_text_markup_util.c',
])

View File

@ -147,7 +147,7 @@ EAPI Eina_Error eina_error_msg_static_register(const char *msg) EINA_ARG_NONNUL
* @details This function modifies the message associated with @p error and changes
* it to @p msg. If the error is previously registered by @ref eina_error_msg_static_register
* then the string is not duplicated, otherwise the previous message
* is unrefed and @p msg is copied.
* is unref'ed and @p msg is copied.
*
* @param[in] error The Eina_Error to change the message of
* @param[in] msg The description of the error \n

File diff suppressed because it is too large Load Diff

View File

@ -350,7 +350,7 @@ EAPI Eina_Iterator *eina_carray_length_iterator_new(void** array, unsigned int s
EAPI Eina_Iterator* eina_iterator_filter_new(Eina_Iterator *original, Eina_Each_Cb filter, Eina_Free_Cb free_cb, void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Creates an Eina_Iterator that iterates through a serie
* @brief Creates an Eina_Iterator that iterates through a series
* of Eina_Iterator.
*
* @param[in] it The first Eina_Iterator to iterate over
@ -367,7 +367,7 @@ EAPI Eina_Iterator *eina_multi_iterator_internal_new(Eina_Iterator *it, ...) EIN
/**
* @def eina_multi_iterator_new
* @brief Creates an Eina_Iterator that iterates through a serie
* @brief Creates an Eina_Iterator that iterates through a series
* of Eina_Iterator.
*
* @param[in] it The first Eina_Iterator to iterate over

View File

@ -167,7 +167,7 @@
* @until demote
*
* Removing elements from a list can be done with ease:
* @until sagitarius
* @until sagittarius
*
* To replace an element in the list it is not necessary to remove it and then
* re-add with the new value, it is possible to just change the value of a node:

View File

@ -635,6 +635,11 @@ _eina_promise_clean_dispatch(Eina_Promise *p, Eina_Value v)
// This function is called on a promise created with a scheduler, not a continue one.
_eina_future_dispatch(p->scheduler, f, v);
}
else
{
// Nobody is going to flush this value if we don't
eina_value_flush(&v);
}
eina_mempool_free(_promise_mp, p);
}

View File

@ -594,7 +594,7 @@ EAPI Eio_File *eio_file_xattr(const char *path,
const void *data);
/**
* @brief Define an extented attribute on a file/directory.
* @brief Define an extended attribute on a file/directory.
* @param path The path to set the attribute on.
* @param attribute The name of the attribute to define.
* @param xattr_int The value to link the attribute with.
@ -616,7 +616,7 @@ EAPI Eio_File *eio_file_xattr_int_set(const char *path,
const void *data);
/**
* @brief Define an extented attribute on a file/directory.
* @brief Define an extended attribute on a file/directory.
* @param path The path to set the attribute on.
* @param attribute The name of the attribute to define.
* @param xattr_double The value to link the attribute with.
@ -637,7 +637,7 @@ EAPI Eio_File *eio_file_xattr_double_set(const char *path,
Eio_Error_Cb error_cb,
const void *data);
/**
* @brief Define a string extented attribute on a file/directory.
* @brief Define a string extended attribute on a file/directory.
* @param path The path to set the attribute on.
* @param attribute The name of the attribute to define.
* @param xattr_string The string to link the attribute with.
@ -658,7 +658,7 @@ EAPI Eio_File *eio_file_xattr_string_set(const char *path,
Eio_Error_Cb error_cb,
const void *data);
/**
* @brief Define an extented attribute on a file/directory.
* @brief Define an extended attribute on a file/directory.
* @param path The path to set the attribute on.
* @param attribute The name of the attribute to define.
* @param xattr_data The data to link the attribute with.
@ -1220,7 +1220,7 @@ EAPI Eio_Monitor *eio_monitor_add(const char *path);
* @warning Do NOT pass non-stringshared strings to this function!
* If you don't know what this means, use eio_monitor_add().
*
* This fuction is just like eio_monitor_add(), however the string passed by
* This function is just like eio_monitor_add(), however the string passed by
* argument must be created using eina_stringshare_add().
*/
EAPI Eio_Monitor *eio_monitor_stringshared_add(const char *path);

View File

@ -153,8 +153,10 @@ EAPI extern Elm_Version *elm_version;
typedef Eo Efl_Ui_Focus_Manager;
#define _EFL_UI_FOCUS_MANAGER_EO_CLASS_TYPE
# include <efl_ui_focus_object.eo.h>
# include <efl_ui_focus_manager.eo.h>
EAPI void efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel);
# include <efl_ui_focus_manager_window_root.eo.h>
# include <efl_ui_focus_manager_calc.eo.h>
# include <efl_ui_focus_manager_sub.eo.h>
@ -342,10 +344,7 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_ui_grid_default_item.eo.h>
# include <efl_ui_grid.eo.h>
# include <efl_ui_list_view_types.eot.h>
# include <efl_ui_list_view_seg_array.h>
# include <efl_ui_list_view_seg_array.eo.h>
# include <efl_ui_list_view_model.eo.h>
# include <efl_ui_list_view_relayout.eo.h>
# include <efl_ui_list_view.eo.h>
# include <efl_ui_list_view_pan.eo.h>
# include <efl_ui_caching_factory.eo.h>

View File

@ -383,14 +383,20 @@ _efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Da
return eina_list_iterator_new(pd->relations);
}
EAPI void
efl_access_attribute_free(Efl_Access_Attribute *attr)
{
eina_stringshare_del(attr->key);
eina_stringshare_del(attr->value);
free(attr);
}
EAPI void efl_access_attributes_list_free(Eina_List *list)
{
Efl_Access_Attribute *attr;
EINA_LIST_FREE(list, attr)
{
eina_stringshare_del(attr->key);
eina_stringshare_del(attr->value);
free(attr);
efl_access_attribute_free(attr);
}
}
@ -443,7 +449,7 @@ _efl_access_object_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED
return ret;
}
EOLIAN void
EOLIAN void
_efl_access_object_event_handler_del(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Access_Event_Handler *handler)
{
Eina_List *l, *l2;

View File

@ -225,7 +225,7 @@ struct Efl.Access.Event.Children_Changed.Data
child: Efl.Object; [[Child object]]
}
struct Efl.Access.Attribute
struct @free(efl_access_attribute_free) Efl.Access.Attribute
{
[[Accessibility Attribute]]
key: string; [[Attribute key]]
@ -376,7 +376,7 @@ mixin Efl.Access.Object requires Efl.Object
properties.
Translation domain should be set if the application wants to support i18n
for accessibily "name" and "description" properties.
for accessibility "name" and "description" properties.
When translation domain is set, values of "name" and "description"
properties will be translated with the dgettext function using the

View File

@ -30,6 +30,12 @@
*/
EAPI void efl_access_attributes_list_free(Eina_List *list);
/**
* Free the Efl_Access_Attribute type
*/
EAPI void
efl_access_attribute_free(Efl_Access_Attribute *attr);
#ifdef EFL_EO_API_SUPPORT
/**

View File

@ -17,4 +17,11 @@ EAPI elm_atspi_text_text_attribute_free(Efl_Access_Text_Attribute *attr)
free(attr);
}
EAPI void
elm_atspi_text_text_range_free(Efl_Access_Text_Range *range)
{
free(range->content);
free(range);
}
#include "efl_access_text.eo.c"

View File

@ -20,14 +20,14 @@ enum Efl.Access.Text_Clip_Type
both [[Both clip types]]
}
struct Efl.Access.Text_Attribute
struct @free(elm_atspi_text_text_attribute_free) Efl.Access.Text_Attribute
{
[[Text attribute]]
name: string; [[Text attribute name]]
value: string; [[Text attribute value]]
}
struct Efl.Access.Text_Range
struct @free(elm_atspi_text_text_range_free) Efl.Access.Text_Range
{
[[Text range]]
start_offset: int; [[Range start offset]]

View File

@ -15,5 +15,10 @@
*/
EAPI void elm_atspi_text_text_attribute_free(Efl_Access_Text_Attribute *attr);
/**
* @brief Free Efl_Access_Text_Range structure
*/
EAPI void elm_atspi_text_text_range_free(Efl_Access_Text_Range *range);
#endif
#endif

View File

@ -14,18 +14,32 @@
EOLIAN static void
_efl_page_indicator_update(Eo *obj EINA_UNUSED,
Efl_Page_Indicator_Data *pd EINA_UNUSED,
Efl_Page_Indicator_Data *pd,
double pos EINA_UNUSED)
{
pd->curr_idx = efl_ui_pager_current_page_get(pd->pager.obj);
}
EOLIAN static void
_efl_page_indicator_pack(Eo *obj EINA_UNUSED,
Efl_Page_Indicator_Data *pd,
int index EINA_UNUSED)
int index)
{
pd->cnt++;
if ((pd->curr_idx == -1) || (pd->curr_idx >= index)) pd->curr_idx++;
}
EOLIAN static void
_efl_page_indicator_unpack(Eo *obj EINA_UNUSED,
Efl_Page_Indicator_Data *pd,
int index)
{
pd->cnt--;
if ((pd->cnt == 0) ||
((index == pd->curr_idx) && (index != 0)) ||
(index < pd->curr_idx))
pd->curr_idx--;
}
EOLIAN static void
@ -40,7 +54,15 @@ _efl_page_indicator_bind(Eo *obj EINA_UNUSED,
pd->idbox = idbox;
if (pager)
pd->cnt = efl_content_count(pd->pager.obj);
{
pd->cnt = efl_content_count(pd->pager.obj);
pd->curr_idx = efl_ui_pager_current_page_get(pd->pager.obj);
}
else
{
pd->cnt = 0;
pd->curr_idx = -1;
}
}
@ -48,11 +70,15 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_update,
EFL_FUNC_CALL(pos), double pos)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_pack,
EFL_FUNC_CALL(index), int index)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_unpack,
EFL_FUNC_CALL(index), int index)
#define EFL_PAGE_INDICATOR_EXTRA_OPS \
EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \
_efl_page_indicator_update), \
EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
_efl_page_indicator_pack)
_efl_page_indicator_pack), \
EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \
_efl_page_indicator_unpack)
#include "efl_page_indicator.eo.c"

View File

@ -14,6 +14,7 @@ struct _Efl_Page_Indicator_Data
Efl_Ui_Box *idbox;
int cnt;
int curr_idx;
};
#define EFL_PAGE_INDICATOR_DATA_GET(o, pd) \

View File

@ -19,8 +19,6 @@ _efl_page_indicator_icon_update(Eo *obj,
double pos)
{
EFL_PAGE_INDICATOR_DATA_GET(obj, spd);
Eo *item;
int page = efl_ui_pager_current_page_get(spd->pager.obj);
double delta = fabs(pos);
if (pd->curr)
@ -30,19 +28,23 @@ _efl_page_indicator_icon_update(Eo *obj,
if (pd->adj) efl_layout_signal_message_send(pd->adj, 1, *(pd->v));
}
item = eina_list_nth(pd->items, page);
efl_page_indicator_update(efl_super(obj, MY_CLASS), pos);
pd->curr = eina_list_nth(pd->items, spd->curr_idx);
eina_value_set(pd->v, (1.0 - delta));
efl_layout_signal_message_send(item, 1, *(pd->v));
pd->curr = item;
efl_layout_signal_message_send(pd->curr, 1, *(pd->v));
if (pos < 0)
item = eina_list_nth(pd->items, (page - 1 + spd->cnt) % spd->cnt);
else
item = eina_list_nth(pd->items, (page + 1 + spd->cnt) % spd->cnt);
pd->adj = eina_list_nth(pd->items, (spd->curr_idx - 1 + spd->cnt) % spd->cnt);
else if (pos > 0)
pd->adj = eina_list_nth(pd->items, (spd->curr_idx + 1 + spd->cnt) % spd->cnt);
else pd->adj = NULL;
eina_value_set(pd->v, delta);
efl_layout_signal_message_send(item, 1, *(pd->v));
pd->adj = item;
if (pd->adj)
{
eina_value_set(pd->v, delta);
efl_layout_signal_message_send(pd->adj, 1, *(pd->v));
}
}
EOLIAN static void
@ -53,20 +55,14 @@ _efl_page_indicator_icon_pack(Eo *obj,
EFL_PAGE_INDICATOR_DATA_GET(obj, spd);
Eo *item, *existing;
efl_page_indicator_pack(efl_super(obj, MY_CLASS), index);
item = efl_add(EFL_CANVAS_LAYOUT_CLASS, spd->idbox);
elm_widget_theme_object_set(spd->idbox, item,
"pager", "indicator", "default");
efl_gfx_size_hint_align_set(item, 0.5, 0.5);
efl_gfx_size_hint_weight_set(item, 0, 0);
efl_gfx_size_hint_fill_set(item, 0, 0);
if (index == 0)
{
pd->items = eina_list_prepend(pd->items, item);
efl_pack_begin(spd->idbox, item);
}
else if (index == (spd->cnt - 1))
if (index == spd->cnt)
{
pd->items = eina_list_append(pd->items, item);
efl_pack_end(spd->idbox, item);
@ -77,6 +73,40 @@ _efl_page_indicator_icon_pack(Eo *obj,
pd->items = eina_list_prepend_relative(pd->items, item, existing);
efl_pack_before(spd->idbox, item, existing);
}
efl_page_indicator_pack(efl_super(obj, MY_CLASS), index);
if (!pd->curr)
{
pd->curr = eina_list_nth(pd->items, spd->curr_idx);
eina_value_set(pd->v, 1.0);
efl_layout_signal_message_send(pd->curr, 1, *(pd->v));
}
}
EOLIAN static void
_efl_page_indicator_icon_unpack(Eo *obj,
Efl_Page_Indicator_Icon_Data *pd,
int index)
{
EFL_PAGE_INDICATOR_DATA_GET(obj, spd);
Eo *item;
item = eina_list_nth(pd->items, index);
pd->items = eina_list_remove(pd->items, item);
efl_pack_unpack(spd->idbox, item);
efl_del(item);
if (index == spd->curr_idx) pd->curr = NULL;
efl_page_indicator_unpack(efl_super(obj, MY_CLASS), index);
if ((pd->curr == NULL) && (spd->curr_idx != -1))
{
pd->curr = eina_list_nth(pd->items, spd->curr_idx);
eina_value_set(pd->v, 1.0);
efl_layout_signal_message_send(pd->curr, 1, *(pd->v));
}
}
EOLIAN static void
@ -117,6 +147,7 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
"pager", "indicator", "default");
efl_gfx_size_hint_align_set(item, 0.5, 0.5);
efl_gfx_size_hint_weight_set(item, 0, 0);
efl_gfx_size_hint_fill_set(item, 0, 0);
efl_pack_end(spd->idbox, item);
}
@ -130,23 +161,13 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
}
}
EOLIAN static void
_efl_page_indicator_icon_efl_object_invalidate(Eo *obj,
Efl_Page_Indicator_Icon_Data *pd)
{
Eo *item;
EINA_LIST_FREE(pd->items, item)
efl_del(item);
efl_invalidate(efl_super(obj, MY_CLASS));
}
#define EFL_PAGE_INDICATOR_ICON_EXTRA_OPS \
EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \
_efl_page_indicator_icon_update), \
EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
_efl_page_indicator_icon_pack)
_efl_page_indicator_icon_pack), \
EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \
_efl_page_indicator_icon_unpack)
#include "efl_page_indicator_icon.eo.c"

View File

@ -7,7 +7,6 @@ class Efl.Page.Indicator_Icon extends Efl.Page.Indicator
arrange them in a linear order. An icon has two states: default and selected.
]]
implements {
Efl.Object.invalidate;
Efl.Page.Indicator.bind;
}
}

View File

@ -71,12 +71,14 @@ _efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED,
}
EOLIAN static void
EOLIAN static Eina_Bool
_efl_page_transition_loop_set(Eo *obj EINA_UNUSED,
Efl_Page_Transition_Data *pd,
Efl_Ui_Pager_Loop loop)
{
pd->loop = loop;
return EINA_TRUE;
}
@ -88,7 +90,7 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_page_size_set,
EFL_FUNC_CALL(sz), Eina_Size2D sz)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_padding_size_set,
EFL_FUNC_CALL(padding), int padding)
EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_loop_set,
EOAPI EFL_FUNC_BODYV(efl_page_transition_loop_set, Eina_Bool, 0,
EFL_FUNC_CALL(loop), Efl_Ui_Pager_Loop loop)

View File

@ -64,72 +64,17 @@ _page_info_allocate(Efl_Page_Transition_Scroll_Data *pd,
pd->tail->next = pd->head;
}
static void
_content_show(Efl_Page_Transition_Scroll_Data *pd,
Efl_Page_Transition_Data *spd)
{
Eina_List *list;
Page_Info *pi;
int tmp_id;
Eo *tmp;
int curr_page, cnt;
curr_page = efl_ui_pager_current_page_get(spd->pager.obj);
cnt = efl_content_count(spd->pager.obj);
// at this point, the number of visible pages might have been changed,
// so empty all boxes and refill them with the right contents.
// FIXME make logic efficient: don't have to empty all and fill all the time
EINA_LIST_FOREACH(pd->page_infos, list, pi)
{
if (pi->content)
{
efl_pack_unpack(pi->obj, pi->content);
efl_canvas_object_clip_set(pi->content, pd->backclip);
pi->content_num = -1;
pi->content = NULL;
pi->visible = EINA_FALSE;
}
efl_canvas_object_clip_set(pi->obj, pd->backclip);
}
EINA_LIST_FOREACH(pd->page_infos, list, pi)
{
if (pi->vis_page)
{
tmp_id = (curr_page + pi->pos + cnt) % cnt;
if ((spd->loop == EFL_UI_PAGER_LOOP_DISABLED)
&& ((pi->pos) * (tmp_id - curr_page) < 0)) continue;
tmp = efl_pack_content_get(spd->pager.obj, tmp_id);
if (tmp)
{
efl_canvas_object_clip_set(pi->obj, pd->foreclip);
efl_pack(pi->obj, tmp);
efl_canvas_object_clip_set(tmp, pd->foreclip);
pi->content_num = tmp_id;
pi->content = tmp;
pi->visible = EINA_TRUE;
}
}
}
}
//FIXME use ecore_job
static void
_page_info_geometry_change(Efl_Page_Transition_Scroll_Data *pd,
Efl_Page_Transition_Data *spd)
{
Eina_List *list;
Page_Info *pi;
int content_w;
Page_Info *curr;
Eo *tmp;
int content_w, tmp_id, curr_page, cnt;
content_w = spd->page_spec.sz.w
+ ((spd->page_spec.sz.w + spd->page_spec.padding) * pd->side_page_num * 2);
content_w = (spd->page_spec.sz.w * (pd->side_page_num * 2 + 1))
+ (spd->page_spec.padding * pd->side_page_num * 2);
if (content_w < spd->pager.w)
{
@ -150,36 +95,76 @@ _page_info_geometry_change(Efl_Page_Transition_Scroll_Data *pd,
efl_gfx_entity_geometry_set(pd->foreclip, (Eina_Rect) pd->viewport);
// this loop resets the geometry of each page based on the geometry of
// the pager object, the page size, and the padding size.
EINA_LIST_FOREACH(pd->page_infos, list, pi)
curr_page = efl_ui_pager_current_page_get(spd->pager.obj);
cnt = efl_content_count(spd->pager.obj);
curr = pd->head;
do
{
EINA_RECTANGLE_SET(&pi->geometry,
EINA_RECTANGLE_SET(&curr->geometry,
spd->pager.x + (spd->pager.w / 2)
+ pi->pos * (spd->page_spec.sz.w + spd->page_spec.padding)
+ curr->pos * (spd->page_spec.sz.w + spd->page_spec.padding)
- (spd->page_spec.sz.w / 2),
spd->pager.y + (spd->pager.h / 2) - (spd->page_spec.sz.h / 2),
spd->page_spec.sz.w,
spd->page_spec.sz.h);
if (eina_rectangles_intersect(&pi->geometry, &pd->viewport) &&
((pi->id != 0) && (pi->id != (pd->page_info_num - 1))))
efl_gfx_entity_geometry_set(curr->obj, (Eina_Rect) curr->geometry);
if (!eina_rectangles_intersect(&curr->geometry, &pd->viewport))
{
pi->vis_page = EINA_TRUE;
pi->visible = EINA_TRUE;
efl_canvas_object_clip_set(pi->obj, pd->foreclip);
if (curr->visible)
{
efl_canvas_object_clip_set(curr->obj, pd->backclip);
efl_pack_unpack(curr->obj, curr->content);
efl_canvas_object_clip_set(curr->content, pd->backclip);
curr->content_num = -1;
curr->content = NULL;
curr->visible = EINA_FALSE;
}
}
else
{
pi->vis_page = EINA_FALSE;
pi->visible = EINA_FALSE;
efl_canvas_object_clip_set(pi->obj, pd->backclip);
tmp_id = curr_page + curr->pos;
if (spd->loop == EFL_UI_PAGER_LOOP_ENABLED)
tmp_id = (tmp_id + cnt) % cnt;
if ((abs(curr->pos) < cnt) &&
(tmp_id >= 0) &&
(tmp_id < cnt))
{
if (curr->content_num != tmp_id)
{
tmp = efl_pack_content_get(spd->pager.obj, tmp_id);
efl_canvas_object_clip_set(curr->obj, pd->foreclip);
efl_pack(curr->obj, tmp);
efl_canvas_object_clip_set(tmp, pd->foreclip);
curr->content_num = tmp_id;
curr->content = tmp;
curr->visible = EINA_TRUE;
}
}
else if (curr->content)
{
efl_canvas_object_clip_set(curr->obj, pd->backclip);
efl_pack_unpack(curr->obj, curr->content);
efl_canvas_object_clip_set(curr->content, pd->backclip);
curr->content_num = -1;
curr->content = NULL;
curr->visible = EINA_FALSE;
}
}
efl_gfx_entity_geometry_set(pi->obj, (Eina_Rect) pi->geometry);
}
curr = curr->next;
if (efl_content_count(spd->pager.obj) > 0) _content_show(pd, spd);
} while (curr != pd->head);
}
static void
@ -299,11 +284,10 @@ _efl_page_transition_scroll_update(Eo *obj,
{
EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
Page_Info *start, *dummy, *curr, *target;
Eo *tmp;
double t;
int tmp_id, curr_page, cnt;
Eo *tmp;
Eina_List *list;
Page_Info *pi, *tpi;
t = pos;
if (t < 0) t *= (-1);
@ -315,70 +299,102 @@ _efl_page_transition_scroll_update(Eo *obj,
// 1. the geometry of each page needs to be changed
// 2. if a page gets out of the viewport, it needs to be hidden
// 3. if a page gets into the viewport, it needs to be shown
EINA_LIST_FOREACH(pd->page_infos, list, pi)
if (pos < 0) // if scrolled right, each page takes next page's position
{
if (pos < 0) // if scrolled right, each page takes next page's position
tpi = pi->next;
else // else if scrolled left, each page takes prev page's position
tpi = pi->prev;
start = pd->head;
dummy = pd->tail;
}
else // if scrolled left, each page takes prev page's position
{
start = pd->tail;
dummy = pd->head;
}
EINA_RECTANGLE_SET(&pi->temp,
tpi->geometry.x * t + pi->geometry.x * (1 - t),
tpi->geometry.y,
tpi->geometry.w,
tpi->geometry.h);
if (dummy->visible)
{
efl_canvas_object_clip_set(dummy->obj, pd->backclip);
efl_pack_unpack(dummy->obj, dummy->content);
efl_canvas_object_clip_set(dummy->content, pd->backclip);
efl_gfx_entity_geometry_set(pi->obj, (Eina_Rect) pi->temp);
dummy->content_num = -1;
dummy->content = NULL;
dummy->visible = EINA_FALSE;
}
if (!pi->vis_page && !tpi->vis_page) continue;
curr = start;
do
{
if (pos < 0) target = curr->next;
else target = curr->prev;
if (!eina_rectangles_intersect(&pi->temp, &pd->viewport))
EINA_RECTANGLE_SET(&curr->temp,
target->geometry.x * t + curr->geometry.x * (1 - t),
target->geometry.y,
target->geometry.w,
target->geometry.h);
efl_gfx_entity_geometry_set(curr->obj, (Eina_Rect) curr->temp);
if (!eina_rectangles_intersect(&curr->temp, &pd->viewport))
{
if (pi->content)
if (curr->visible)
{
efl_canvas_object_clip_set(pi->obj, pd->backclip);
efl_canvas_object_clip_set(curr->obj, pd->backclip);
efl_pack_unpack(pi->obj, pi->content);
efl_canvas_object_clip_set(pi->content, pd->backclip);
pi->content_num = -1;
pi->content = NULL;
pi->visible = EINA_FALSE;
efl_pack_unpack(curr->obj, curr->content);
efl_canvas_object_clip_set(curr->content, pd->backclip);
curr->content_num = -1;
curr->content = NULL;
curr->visible = EINA_FALSE;
}
}
else
{
tmp_id = (curr_page + pi->pos + cnt) % cnt;
if (pi->content_num != tmp_id)
tmp_id = curr_page + curr->pos;
if (spd->loop == EFL_UI_PAGER_LOOP_ENABLED)
tmp_id = (tmp_id + cnt) % cnt;
if ((abs(curr->pos) < cnt) &&
(tmp_id >= 0) &&
(tmp_id < cnt))
{
if (pi->content) //FIXME if the content num is the same, do nothing
{
efl_pack_unpack(pi->obj, pi->content);
efl_canvas_object_clip_set(pi->content, pd->backclip);
pi->content_num = -1;
pi->content = NULL;
}
if ((spd->loop == EFL_UI_PAGER_LOOP_DISABLED)
&& ((pi->pos) * (tmp_id - curr_page) < 0)) continue;
tmp = efl_pack_content_get(spd->pager.obj, tmp_id);
if (tmp)
if (curr->content != tmp)
{
efl_canvas_object_clip_set(pi->obj, pd->foreclip);
if (curr->content)
{
efl_pack_unpack(curr->obj, curr->content);
efl_canvas_object_clip_set(curr->content, pd->backclip);
}
efl_pack(pi->obj, tmp);
efl_canvas_object_clip_set(curr->obj, pd->foreclip);
efl_pack(curr->obj, tmp);
efl_canvas_object_clip_set(tmp, pd->foreclip);
pi->content_num = tmp_id;
pi->content = tmp;
pi->visible = EINA_TRUE;
curr->content_num = tmp_id;
curr->content = tmp;
curr->visible = EINA_TRUE;
}
}
else if (curr->content)
{
efl_canvas_object_clip_set(curr->obj, pd->backclip);
efl_pack_unpack(curr->obj, curr->content);
efl_canvas_object_clip_set(curr->content, pd->backclip);
curr->content_num = -1;
curr->content = NULL;
curr->visible = EINA_FALSE;
}
}
}
curr = target;
} while (target != dummy);
}
EOLIAN static void
@ -405,32 +421,20 @@ _efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED,
}
pi->pos = pi->id - (pd->side_page_num + 1);
if (!target) return;
EINA_RECTANGLE_SET(&pi->temp,
target->geometry.x,
target->geometry.y,
target->geometry.w,
target->geometry.h);
}
if (eina_rectangles_intersect(&pi->temp, &pd->viewport) &&
(pi->id != 0) && (pi->id != (pd->page_info_num - 1)))
{
pi->vis_page = EINA_TRUE;
pi->visible = EINA_TRUE;
efl_canvas_object_clip_set(pi->obj, pd->foreclip);
}
else
{
pi->vis_page = EINA_FALSE;
pi->visible = EINA_FALSE;
efl_canvas_object_clip_set(pi->obj, pd->backclip);
if (pi->content)
{
efl_pack_unpack(pi->obj, pi->content);
efl_canvas_object_clip_set(pi->content, pd->backclip);
}
}
EINA_LIST_FOREACH(pd->page_infos, list, pi)
{
EINA_RECTANGLE_SET(&pi->geometry,
pi->temp.x,
pi->temp.y,
pi->temp.w,
pi->temp.h);
}
if (EINA_DBL_EQ(pos, 1.0))
@ -443,15 +447,6 @@ _efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED,
pd->head = pd->head->prev;
pd->tail = pd->tail->prev;
}
EINA_LIST_FOREACH(pd->page_infos, list, pi)
{
EINA_RECTANGLE_SET(&pi->geometry,
pi->temp.x,
pi->temp.y,
pi->temp.w,
pi->temp.h);
}
}
EOLIAN static int
@ -551,18 +546,66 @@ _efl_page_transition_scroll_side_page_num_set(Eo *obj,
_page_info_geometry_change(pd, spd);
}
EOLIAN static void
EOLIAN static Eina_Bool
_efl_page_transition_scroll_loop_set(Eo *obj,
Efl_Page_Transition_Scroll_Data *pd,
Efl_Ui_Pager_Loop loop)
{
EFL_PAGE_TRANSITION_DATA_GET(obj, spd);
int tmp_id, curr_page, cnt;
Page_Info *curr;
Eo *tmp;
if (spd->loop == loop) return;
if (loop == efl_ui_pager_loop_mode_get(spd->pager.obj))
return EINA_TRUE;
if ((loop == EFL_UI_PAGER_LOOP_ENABLED) &&
(efl_content_count(spd->pager.obj) < (pd->page_info_num - 1)))
return EINA_FALSE;
efl_page_transition_loop_set(efl_super(obj, MY_CLASS), loop);
_content_show(pd, spd);
curr_page = efl_ui_pager_current_page_get(spd->pager.obj);
cnt = efl_content_count(spd->pager.obj);
curr = pd->head->next;
do
{
tmp_id = curr_page + curr->pos;
if ((tmp_id < 0) || (tmp_id >= cnt))
{
switch (loop)
{
case EFL_UI_PAGER_LOOP_ENABLED:
tmp_id = (tmp_id + cnt) % cnt;
tmp = efl_pack_content_get(spd->pager.obj, tmp_id);
efl_pack(curr->obj, tmp);
efl_canvas_object_clip_set(tmp, pd->foreclip);
curr->content_num = tmp_id;
curr->content = tmp;
curr->visible = EINA_TRUE;
break;
case EFL_UI_PAGER_LOOP_DISABLED:
efl_pack_unpack(curr->obj, curr->content);
efl_canvas_object_clip_set(curr->content, pd->backclip);
curr->content_num = -1;
curr->content = NULL;
curr->visible = EINA_FALSE;
break;
}
}
curr = curr->next;
} while (curr != pd->tail);
return EINA_TRUE;
}
EOLIAN static Eo *
@ -585,7 +628,6 @@ _efl_page_transition_scroll_efl_object_invalidate(Eo *obj,
EINA_LIST_FREE(pd->page_infos, pi)
{
efl_del(pi->obj);
free(pi);
}

View File

@ -66,7 +66,6 @@ typedef struct _Page_Info
struct _Page_Info *prev, *next;
Eina_Bool visible;
Eina_Bool vis_page;
} Page_Info;

Some files were not shown because too many files have changed in this diff Show More