svn update: 55979 (latest:55979)
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 19 Jan 2011 06:22:45 +0000 (15:22 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 19 Jan 2011 06:22:45 +0000 (15:22 +0900)
Makefile.am
configure.ac
src/bin/edje_external_inspector.c
src/lib/Edje.h
src/lib/edje_message_queue.c

index c78a8f1..e640b23 100644 (file)
@@ -8,14 +8,13 @@ aclocal.m4 \
 compile \
 config.guess \
 config.h.in \
+config.h.in~ \
 config.sub \
 configure \
 depcomp \
 install-sh \
 ltmain.sh \
 missing \
-mkinstalldirs \
-stamp-h.in \
 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \
index 88212bd..d259500 100644 (file)
@@ -22,12 +22,17 @@ AC_INIT([edje], [v_ver.beta3], [enlightenment-devel@lists.sourceforge.net])
 AC_PREREQ([2.52])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
-AC_CANONICAL_BUILD
-AC_CANONICAL_HOST
-AC_ISC_POSIX
+
+AC_CONFIG_HEADERS([config.h])
+AH_TOP([
+#ifndef EFL_CONFIG_H__
+#define EFL_CONFIG_H__
+])
+AH_BOTTOM([
+#endif /* EFL_CONFIG_H__ */
+])
 
 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
-AM_CONFIG_HEADER([config.h])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 AC_LIBTOOL_WIN32_DLL
@@ -54,9 +59,9 @@ AC_SUBST(VMAJ)
 
 AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["$shrext_cmds"], [Suffix for shared objects])
 
-EFL_CHECK_PATH_MAX
-
 ### Default options with respect to host
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
 
 case "$host_os" in
    mingw32ce* | cegcc*)
@@ -316,6 +321,8 @@ fi
 ### Checks for header files
 AC_CHECK_HEADERS([locale.h])
 
+EFL_CHECK_PATH_MAX
+
 
 ### Checks for types
 
@@ -352,6 +359,9 @@ AC_SUBST(lt_enable_auto_import)
 
 
 ### Checks for library functions
+
+AC_ISC_POSIX
+
 AC_FUNC_ALLOCA
 
 case "$host_os" in
index cb5a0c4..6bd9a35 100644 (file)
@@ -2,12 +2,13 @@
 # include "config.h"
 #endif
 
-#include "Edje.h"
+#include <locale.h>
+#include <fnmatch.h>
 
 #include <Ecore.h>
 #include <Ecore_Getopt.h>
-#include <locale.h>
-#include <fnmatch.h>
+
+#include "Edje.h"
 
 static int _log_dom;
 #define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
index 2000c18..506ed1d 100644 (file)
@@ -429,7 +429,9 @@ struct _Edje_External_Param_Info
 #define EDJE_EXTERNAL_PARAM_INFO_SENTINEL {NULL, 0, 0, {.s = {NULL, NULL, NULL}}}
 
 /**
- * @struct _Edje_External_Type information about an external type to be used.
+ * @struct _Edje_External_Type
+ *
+ * @brief Information about an external type to be used.
  *
  * This structure provides information on how to display and modify a
  * third party Evas_Object in Edje.
index b8a5f20..13387f7 100644 (file)
@@ -6,6 +6,8 @@ static Ecore_Timer *_job_loss_timer = NULL;
 
 static Eina_List *msgq = NULL;
 static Eina_List *tmp_msgq = NULL;
+static int tmp_msgq_processing = 0;
+static int tmp_msgq_restart = 0;
 
 /*============================================================================*
  *                                   API                                      *
@@ -97,6 +99,7 @@ edje_object_message_signal_process(Evas_Object *obj)
    Eina_List *l, *ln, *tmpq = NULL;
    Edje *ed;
    Edje_Message *em;
+   int gotos = 0;
 
    ed = _edje_fetch(obj);
    if (!ed) return;
@@ -127,16 +130,70 @@ edje_object_message_signal_process(Evas_Object *obj)
        tmpq = NULL;
      }
 
+#if 0   
    while (tmp_msgq)
      {
        Edje_Message *em;
 
        em = tmp_msgq->data;
        tmp_msgq = eina_list_remove_list(tmp_msgq, tmp_msgq);
-       em->edje->message.num--;
-       _edje_message_process(em);
-       _edje_message_free(em);
+        if (!ed->delete_me)
+          {
+             ed->processing_messages++;
+             _edje_message_process(em);
+             _edje_message_free(em);
+             ed->processing_messages--;
+          }
+        else
+           _edje_message_free(em);
      }
+#else
+   tmp_msgq_processing++;
+again:
+   EINA_LIST_FOREACH_SAFE(tmp_msgq, l, ln, em)
+     {
+        if (em->edje != ed) continue;
+       tmp_msgq = eina_list_remove_list(tmp_msgq, l);
+        if (!ed->delete_me)
+          {
+             ed->processing_messages++;
+             _edje_message_process(em);
+             _edje_message_free(em);
+             ed->processing_messages--;
+          }
+        else
+           _edje_message_free(em);
+        if (ed->processing_messages == 0)
+          {
+             if (ed->delete_me) _edje_del(ed);
+          }
+        // if some child callback in _edje_message_process called
+        // edje_object_message_signal_process() or
+        // edje_message_signal_process() then those will mark the restart
+        // flag when they finish - it mabsicammyt means tmp_msgq and
+        // any item in it has potentially become invalid - so that means l
+        // and ln could be rogue pointers, so start again from the beginning
+        // and skip anything that is not this object and process only what is.
+        // to avoid self-feeding loops allow a max of 1024 loops.
+        if (tmp_msgq_restart)
+          {
+             tmp_msgq_restart = 0;
+             gotos++;
+             if (gotos < 1024) goto again;
+             else
+               {
+                  WRN("Edje is in a self-feeding message loop (> 1024 gotos needed in a row)");
+                  goto end;
+               }
+          }
+     }
+end:
+   tmp_msgq_processing--;
+   if (tmp_msgq_processing == 0)
+      tmp_msgq_restart = 0;
+   else
+      tmp_msgq_restart = 1;
+#endif
 }
 
 /**
@@ -740,6 +797,7 @@ _edje_message_queue_process(void)
             msgq = NULL;
          }
 
+        tmp_msgq_processing++;
        while (tmp_msgq)
          {
             Edje_Message *em;
@@ -763,6 +821,11 @@ _edje_message_queue_process(void)
                  if (ed->delete_me) _edje_del(ed);
               }
          }
+        tmp_msgq_processing--;
+        if (tmp_msgq_processing == 0)
+           tmp_msgq_restart = 0;
+        else
+           tmp_msgq_restart = 1;
      }
 
    /* if the message queue filled again set a timer to expire in 0.0 sec */