--- /dev/null
+[evas] Rebase is completed.
EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image as been preloaded */
-
/*
* The following events are only for use with canvas
* evas_event_callback_add():
*/
-
EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
-
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
+ /*
+ * More object event types - see evas_object_event_callback_add():
+ */
+ EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in evas that throws out original image data) */
+
/* the following id no event number, but a sentinel: */
EVAS_CALLBACK_LAST /**< keep as last element/sentinel -- not really an event */
} Evas_Callback_Type; /**< The type of event to trigger the callback */
#ifdef BUILD_ASYNC_PRELOAD
LKU(im->lock);
#endif
+ //FIXME: imagedataunload - inform owners
}
static Eina_Bool
#ifdef BUILD_ASYNC_EVENTS
-#include <unistd.h>
+#ifndef _MSC_VER
+# include <unistd.h>
+#endif
#include <fcntl.h>
#include <errno.h>
if (o->engine_data)
o->engine_data = obj->layer->evas->engine.func->image_dirty_region(obj->layer->evas->engine.data.output, o->engine_data, 0, 0, o->cur.image.w, o->cur.image.h);
evas_object_image_unload(obj, 1);
+ evas_object_inform_call_image_unloaded(obj);
evas_object_image_load(obj);
o->prev.file = NULL;
o->prev.key = NULL;
if (o->cur.file)
{
evas_object_image_unload(obj, 0);
+ evas_object_inform_call_image_unloaded(obj);
evas_object_image_load(obj);
o->changed = 1;
evas_object_change(obj);
if (o->cur.file)
{
evas_object_image_unload(obj, 0);
+ evas_object_inform_call_image_unloaded(obj);
evas_object_image_load(obj);
o->changed = 1;
evas_object_change(obj);
if (o->cur.file)
{
evas_object_image_unload(obj, 0);
+ evas_object_inform_call_image_unloaded(obj);
evas_object_image_load(obj);
o->changed = 1;
evas_object_change(obj);
if (o->cur.file)
{
evas_object_image_unload(obj, 0);
+ evas_object_inform_call_image_unloaded(obj);
evas_object_image_load(obj);
o->changed = 1;
evas_object_change(obj);
if (o->magic == MAGIC_OBJ_IMAGE)
{
evas_object_image_unload(obj, 1);
+ evas_object_inform_call_image_unloaded(obj);
}
}
}
o->cur.image.w, o->cur.image.h);
}
if (o->engine_data)
- obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
- o->engine_data);
+ {
+ obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
+ o->engine_data,
+ obj);
+ obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
+ o->engine_data);
+ }
o->engine_data = NULL;
o->load_error = EVAS_LOAD_ERROR_NONE;
o->cur.has_alpha = 1;
evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL);
_evas_post_event_callback_call(obj->layer->evas);
}
+
+void
+evas_object_inform_call_image_unloaded(Evas_Object *obj)
+{
+ _evas_object_event_new();
+
+ evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL);
+ _evas_post_event_callback_call(obj->layer->evas);
+}
EAPI int
evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur)
{
+ Evas_Object_Textblock *o;
+ Evas_Object_Textblock_Node_Text *n;
+ size_t npos = 0;
+
if (!cur) return -1;
- return cur->pos;
+ o = (Evas_Object_Textblock *)(cur->obj->object_data);
+ n = o->text_nodes;
+ while (n != cur->node)
+ {
+ npos += eina_ustrbuf_length_get(n->unicode);
+ n = _NODE_TEXT(EINA_INLIST_GET(n)->next);
+ }
+ return npos + cur->pos;
}
/**
EAPI void
evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int _pos)
{
- size_t len, pos;
+ Evas_Object_Textblock *o;
+ Evas_Object_Textblock_Node_Text *n;
+ size_t pos;
if (!cur) return;
- if (!cur->node) return;
- len = eina_ustrbuf_length_get(cur->node->unicode);
+ o = (Evas_Object_Textblock *)(cur->obj->object_data);
+
if (_pos < 0)
{
pos = 0;
pos = (size_t) _pos;
}
- if (pos > len)
+ n = o->text_nodes;
+ while (n && (pos >= eina_ustrbuf_length_get(n->unicode)))
{
- pos = len;
+ pos -= eina_ustrbuf_length_get(n->unicode);
+ n = _NODE_TEXT(EINA_INLIST_GET(n)->next);
+ }
+
+ if (n)
+ {
+ cur->node = n;
+ cur->pos = pos;
+ }
+ else
+ {
+ Evas_Object_Textblock_Node_Text *last_n;
+
+ last_n = _NODE_TEXT(EINA_INLIST_GET(o->text_nodes)->last);
+ cur->node = last_n;
+ cur->pos = 0;
+
+ evas_textblock_cursor_paragraph_char_last(cur);
}
- cur->pos = pos;
}
Evas_Object *obj;
EINA_INLIST_FOREACH(lay->objects, obj)
- _evas_render_dump_map_surfaces(obj);
+ {
+ if ((obj->type) && (!strcmp(obj->type, "image")))
+ evas_object_inform_call_image_unloaded(obj);
+ _evas_render_dump_map_surfaces(obj);
+ }
}
if ((e->engine.func) && (e->engine.func->output_dump) &&
(e->engine.data.output))
EAPI void evas_common_rgba_image_scalecache_size_set(unsigned int size);
EAPI unsigned int evas_common_rgba_image_scalecache_size_get(void);
EAPI void evas_common_rgba_image_scalecache_flush(void);
-
+EAPI void evas_common_rgba_image_scalecache_dump(void);
EAPI void
evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
RGBA_Draw_Context *dc, int smooth,
{
ie_dst->allocated.w = 0;
ie_dst->allocated.h = 0;
+#ifdef BUILD_ASYNC_PRELOAD
ie_dst->flags.preload_done = 0;
+#endif
ie_dst->flags.loaded = 0;
dst->image.data = NULL;
dst->image.no_free = 0;
im->image.data = NULL;
ie->allocated.w = 0;
ie->allocated.h = 0;
- ie->flags.preload_done = 0;
ie->flags.loaded = 0;
+#ifdef BUILD_ASYNC_PRELOAD
+ ie->flags.preload_done = 0;
+#endif
return;
}
#endif
im->image.data = NULL;
ie->allocated.w = 0;
ie->allocated.h = 0;
- ie->flags.preload_done = 0;
ie->flags.loaded = 0;
+#ifdef BUILD_ASYNC_PRELOAD
+ ie->flags.preload_done = 0;
+#endif
}
static int
im->image.data = NULL;
ie->allocated.w = 0;
ie->allocated.h = 0;
+#ifdef BUILD_ASYNC_PRELOAD
ie->flags.preload_done = 0;
+#endif
ie->flags.loaded = 0;
evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
}
if ((dounload) || (im->cache.orig_usage <
(im->cache.newest_usage / 20)))
{
+ //FIXME: imagedataunload - inform owners
evas_common_rgba_image_unload(&im->cache_entry);
}
}
void evas_object_inform_call_restack(Evas_Object *obj);
void evas_object_inform_call_changed_size_hints(Evas_Object *obj);
void evas_object_inform_call_image_preloaded(Evas_Object *obj);
+void evas_object_inform_call_image_unloaded(Evas_Object *obj);
void evas_object_intercept_cleanup(Evas_Object *obj);
int evas_object_intercept_call_show(Evas_Object *obj);
int evas_object_intercept_call_hide(Evas_Object *obj);
XID (*glsym_glXCreatePixmap) (Display *a, void *b, Pixmap c, const int *d) = NULL;
void (*glsym_glXDestroyPixmap) (Display *a, XID b) = NULL;
void (*glsym_glXQueryDrawable) (Display *a, XID b, int c, unsigned int *d) = NULL;
+void (*glsym_glxSwapInterval) (int a) = NULL;
#endif
static void
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawable", glsym_func_void);
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableEXT", glsym_func_void);
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableARB", glsym_func_void);
+
+ FINDSYM(glsym_glxSwapInterval, "glxSwapInterval", glsym_func_void);
+ FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalEXT", glsym_func_void);
+ FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalARB", glsym_func_void);
+ FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalSGI", glsym_func_void);
#endif
}
#ifdef VSYNC_TO_SCREEN
if ((re->info->vsync)/* || (1)*/)
{
- if ((glsym_glXGetVideoSync) && (glsym_glXWaitVideoSync))
+ if (glsym_glxSwapInterval)
{
- unsigned int rc;
-
- glsym_glXGetVideoSync(&rc);
- glsym_glXWaitVideoSync(1, 0, &rc);
+ if (!re->vsync)
+ {
+ if (re->info->vsync) glsym_glxSwapInterval(1);
+ else glsym_glxSwapInterval(0);
+ re->vsync = 1;
+ }
+ }
+ else
+ {
+ if ((glsym_glXGetVideoSync) && (glsym_glXWaitVideoSync))
+ {
+ unsigned int rc;
+
+ glsym_glXGetVideoSync(&rc);
+ glsym_glXWaitVideoSync(1, 0, &rc);
+ }
}
}
# endif