asparagus - finally

SVN revision: 44113
This commit is contained in:
Carsten Haitzler 2009-12-02 07:22:35 +00:00
parent d3bf1f01ec
commit 5fa2ec1bc5
8 changed files with 364 additions and 12 deletions

View File

@ -1,7 +1,8 @@
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT([elementary], [0.5.1.0], [enlightenment-devel@lists.sourceforge.net])
AC_INIT([elementary], [0.6.0.063], [enlightenment-devel@lists.sourceforge.net])
release="ver-svn-04"
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
@ -34,7 +35,6 @@ SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
AC_SUBST(version_info)
release="ver-pre-svn-04"
case "$host_os" in
mingw32ce* | cegcc*)
MODULE_ARCH="$host_os-$host_cpu"

View File

@ -67,7 +67,8 @@ test_slideshow.c \
test_menu.c \
test_panel.c \
test_map.c \
test_weather.c
test_weather.c \
test_flip.c
elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la @ELEMENTARY_EWEATHER_LIBS@
elementary_test_LDFLAGS =

View File

@ -55,7 +55,7 @@ void test_menu(void *data, Evas_Object *obj, void *event_info);
void test_panel(void *data, Evas_Object *obj, void *event_info);
void test_map(void *data, Evas_Object *obj, void *event_info);
void test_weather(void *data, Evas_Object *obj, void *event_info);
void test_flip(void *data, Evas_Object *obj, void *event_info);
static void
my_win_del(void *data, Evas_Object *obj, void *event_info)
@ -193,6 +193,7 @@ my_win_main(void)
elm_list_item_append(li, "Panel", NULL, NULL, test_panel, NULL);
elm_list_item_append(li, "Map", NULL, NULL, test_map, NULL);
elm_list_item_append(li, "Weather", NULL, NULL, test_weather, NULL);
elm_list_item_append(li, "Flip", NULL, NULL, test_flip, NULL);
elm_list_go(li);

View File

@ -0,0 +1,96 @@
#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH
void
my_fl_1(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *fl = data;
}
void
test_flip(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt;
win = elm_win_add(NULL, "flip", ELM_WIN_BASIC);
elm_win_title_set(win, "Flip");
elm_win_autodel_set(win, 1);
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
#if 0 // working on it
fl = elm_flip_add(win);
evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_box_pack_end(bx, fl);
o = elm_button_add(win);
elm_button_label_set(o, "Front");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_flip_content_front_set(fl, o);
evas_object_show(o);
o = elm_button_add(win);
elm_button_label_set(o, "Back");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_flip_content_front_set(fl, o);
evas_object_show(o);
evas_object_show(fl);
bx2 = elm_box_add(win);
evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
bt = elm_button_add(win);
elm_button_label_set(bt, "1");
evas_object_smart_callback_add(bt, "clicked", my_fl_1, fl);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx2, bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_button_label_set(bt, "2");
evas_object_smart_callback_add(bt, "clicked", my_fl_1, fl);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx2, bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_button_label_set(bt, "3");
evas_object_smart_callback_add(bt, "clicked", my_fl_1, fl);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx2, bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_button_label_set(bt, "4");
evas_object_smart_callback_add(bt, "clicked", my_fl_1, fl);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx2, bt);
evas_object_show(bt);
elm_box_pack_end(bx, bx2);
evas_object_show(bx2);
#endif
evas_object_show(win);
}
#endif

View File

@ -1112,15 +1112,51 @@ extern "C" {
typedef enum _Elm_Panel_Orient
{
ELM_PANEL_ORIENT_TOP,
ELM_PANEL_ORIENT_BOTTOM,
ELM_PANEL_ORIENT_LEFT,
ELM_PANEL_ORIENT_RIGHT,
ELM_PANEL_ORIENT_TOP,
ELM_PANEL_ORIENT_BOTTOM,
ELM_PANEL_ORIENT_LEFT,
ELM_PANEL_ORIENT_RIGHT,
} Elm_Panel_Orient;
EAPI Evas_Object *elm_panel_add(Evas_Object *parent);
EAPI void elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient);
EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content);
EAPI Evas_Object *elm_panel_add(Evas_Object *parent);
EAPI void elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient);
EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content);
#if 0 // working on it
// flip types:
// rotate around y axis 180 degrees
// rotate around x axis 180 degrees
//
// properties
// perspective focal dist, x, y
//
// FIXME:
// custom value
// map 1/0
//
// center x, y, z
// angle x, y, z
//
// light 1/0
// light rgb
// light ambient rgb
// light x, y, z
typedef enum _Elm_Flip_Mode
{
ELM_FLIP_ROTATE_Y CENTER_AXIS,
ELM_FLIP_ROTATE_X_CENTER_AXIS
} Elm_Flip_Mode;
EAPI Evas_Object *elm_flip_add(Evas_Object *parent);
EAPI void elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content);
EAPI void elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content);
EAPI Eina_Bool elm_flip_front_get(Evas_Object *obj);
EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y);
EAPI void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode);
/* smart callbacks called:
* "animate,done" - when a flip animation is finished
*/
#endif
#ifdef __cplusplus
}
#endif

View File

@ -67,6 +67,7 @@ elm_slideshow.c \
elm_menu.c \
elm_panel.c \
elm_map.c \
elm_flip.c \
\
elc_notepad.c \
elc_anchorview.c \

View File

@ -0,0 +1,218 @@
#include <Elementary.h>
#include "elm_priv.h"
#if 0 // working on it
// fixme: on configure of widget smart obj - reconfigure front + back and maps
/**
* @defgroup Flip Flip
*
* This holds 2 content objects, ont on the front and one on the back and
* allows you to flip from front to back and vice-versa given various effects
*/
typedef struct _Widget_Data Widget_Data;
struct _Widget_Data
{
struct {
Evas_Object *content;
} front, back;
};
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
free(wd);
}
static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
_sizing_eval(obj);
}
static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord minw = -1, minh = -1, minw2 = -1, minh2 = -1;
Evas_Coord maxw = -1, maxh = -1, maxw2 = -1, maxh2 = -1;
if (wd->front.content)
evas_object_size_hint_min_get(wd->front.content, &minw, &minh);
if (wd->back.content)
evas_object_size_hint_min_get(wd->back.content, &minw2, &minh2);
if (wd->front.content)
evas_object_size_hint_max_get(wd->front.content, &maxw, &maxh);
if (wd->back.content)
evas_object_size_hint_max_get(wd->back.content, &maxw2, &maxh2);
if (minw2 > minw) minw = minw2;
if (minh2 > minh) minh = minh2;
if ((maxw2 >= 0) && (maxw2 < maxw)) maxw = maxw2;
if ((maxh2 >= 0) && (maxh2 < maxh)) maxh = maxh2;
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
static void
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
_sizing_eval(data);
}
static void
_sub_del(void *data, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *sub = event_info;
if (sub == wd->front.content)
{
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
wd->front.content = NULL;
_sizing_eval(obj);
}
else if (sub == wd->back.content)
{
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
wd->back.content = NULL;
_sizing_eval(obj);
}
}
/**
* Add a new flip to the parent
*
* @param parent The parent object
* @return The new object or NULL if it cannot be created
*
* @ingroup Flip
*/
EAPI Evas_Object *
elm_flip_add(Evas_Object *parent)
{
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
elm_widget_type_set(obj, "flip");
elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
_sizing_eval(obj);
return obj;
}
/**
* Set the flip front content
*
* @param obj The flip object
* @param content The content will be filled in this flip object
*
* @ingroup Flip
*/
EAPI void
elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content)
{
Widget_Data *wd = elm_widget_data_get(obj);
if ((wd->front.content != content) && (wd->front.content))
{
elm_widget_sub_object_del(obj, wd->front.content);
evas_object_smart_member_del(wd->front.content);
}
wd->front.content = content;
if (content)
{
elm_widget_sub_object_add(content, obj);
evas_object_smart_member_add(obj, content);
evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
_sizing_eval(obj);
}
//XXX use clips
if (!elm_flip_front_get(obj)) evas_object_hide(wd->front.content);
}
/**
* Set the flip back content
*
* @param obj The flip object
* @param content The content will be filled in this flip object
*
* @ingroup Flip
*/
EAPI void
elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content)
{
Widget_Data *wd = elm_widget_data_get(obj);
if ((wd->back.content != content) && (wd->back.content))
{
elm_widget_sub_object_del(obj, wd->back.content);
evas_object_smart_member_del(wd->back.content);
}
wd->back.content = content;
if (content)
{
elm_widget_sub_object_add(content, obj);
evas_object_smart_member_add(obj, content);
evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
_sizing_eval(obj);
}
//XXX use clips
if (elm_flip_front_get(obj)) evas_object_hide(wd->back.content);
}
/**
* Get flip visibility state
*
* @param obj The flip object
* @return If front is showing or not currently
*
* @ingroup Flip
*/
EAPI Eina_Bool
elm_flip_front_get(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
//XXX retunr if front is showing or not
return 1;
}
EAPI void
elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
EAPI void
elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
#endif

View File

@ -26,7 +26,6 @@ static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_frame_content_set(obj, NULL);
free(wd);
}