static const char *elm_engine, *elm_scale, *elm_theme, *elm_prefix, *elm_data_dir;
static const char *elm_font_hinting, *elm_font_path, *elm_image_cache;
-static const char *elm_font_cache, *elm_finger_size;
+static const char *elm_font_cache, *elm_finger_size, *elm_fps;
EAPI void
elm_quicklaunch_init(int argc, char **argv)
elm_image_cache = getenv("ELM_IMAGE_CACHE");
elm_font_cache = getenv("ELM_FONT_CACHE");
elm_finger_size = getenv("ELM_FINGER_SIZE");
+ elm_fps = getenv("ELM_FPS");
if (!_elm_data_dir)
{
_elm_config->finger_size = 40;
_elm_config->bgpixmap = 0;
_elm_config->compositing = 1;
+ _elm_config->fps = 60.0;
if (elm_engine)
{
(double)_elm_config->finger_size * _elm_config->scale;
if (elm_finger_size)
_elm_config->finger_size = atoi(elm_finger_size);
+
+ if (elm_fps)
+ _elm_config->fps = atof(elm_fps);
+
+ if (_elm_config->fps < 1.0)
+ _elm_config->fps = 1.0;
+
+ ecore_animator_frametime_set(1.0 / _elm_config->fps);
}
EAPI void
--- /dev/null
+#include <Elementary.h>
+#include "elm_priv.h"
+
+typedef struct _Widget_Data Widget_Data;
+
+struct _Widget_Data
+{
+ Evas_Object *base;
+ Eina_List *stack;
+};
+
+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);
+ edje_object_scale_set(wd->base, elm_widget_scale_get(obj) * _elm_config->scale);
+ _sizing_eval(obj);
+}
+
+static void
+_sizing_eval(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
+
+ edje_object_size_min_calc(wd->base, &minw, &minh);
+ 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);
+}
+
+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;
+ // FIXME: if sub is top of stack
+}
+
+EAPI Evas_Object *
+elm_pager_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_data_set(obj, wd);
+ elm_widget_del_hook_set(obj, _del_hook);
+ elm_widget_theme_hook_set(obj, _theme_hook);
+
+ wd->base = edje_object_add(e);
+ elm_widget_resize_object_set(obj, wd->base);
+
+ evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+
+ _sizing_eval(obj);
+ return obj;
+}
+
+EAPI void
+elm_pager_content_push(Evas_Object *obj, Evas_Object *content)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ wd->stack = eina_list_append(wd->stack, content);
+ // FIXME: adjust min size, show new page
+}
+
+EAPI void
+elm_pager_content_pop(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ // FIXME actuall make pop animated - promote 2nd last in stack then
+ // when anim finished delete 2nd last (which was top).
+ Evas_Object *top = elm_pager_content_top_get(obj);
+ if (top) evas_object_del(top);
+}
+
+EAPI void
+elm_pager_content_promote(Evas_Object *obj, Evas_Object *content)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ // FIXME: add to end of stack list and animate
+}
+
+EAPI Evas_Object *
+elm_pager_content_bottom_get(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (wd->stack) return wd->stack->data;
+ return NULL;
+}
+
+EAPI Evas_Object *
+elm_pager_content_top_get(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (wd->stack) return eina_list_last(wd->stack)->data;
+ return NULL;
+}
+