Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        Edje.h edje_load.c edje_private.h 


Log Message:


load error fetching

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/Edje.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- Edje.h      18 Oct 2003 03:34:54 -0000      1.21
+++ Edje.h      20 Oct 2003 06:10:09 -0000      1.22
@@ -8,6 +8,14 @@
 #define EDJE_DRAG_DIR_Y    2
 #define EDJE_DRAG_DIR_XY   3
 
+#define EDJE_LOAD_ERROR_NONE                       0
+#define EDJE_LOAD_ERROR_GENERIC                    1
+#define EDJE_LOAD_ERROR_DOES_NOT_EXIST             2
+#define EDJE_LOAD_ERROR_PERMISSION_DENIED          3
+#define EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED 4
+#define EDJE_LOAD_ERROR_CORRUPT_FILE               5
+#define EDJE_LOAD_ERROR_UNKNOWN_FORMAT             6
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -29,6 +37,7 @@
    const char  *edje_object_data_get            (Evas_Object *obj, const char *key);
    int          edje_object_file_set            (Evas_Object *o, const char *file, 
const char *part);
    void         edje_object_file_get            (Evas_Object *o, const char **file, 
const char **part);
+   int          edje_object_load_error_get      (Evas_Object *o);
    void         edje_object_signal_callback_add (Evas_Object *o, const char 
*emission, const char *source, void (*func) (void *data, Evas_Object *o, const char 
*emission, const char *source), void *data);
    void        *edje_object_signal_callback_del (Evas_Object *o, const char 
*emission, const char *source, void (*func) (void *data, Evas_Object *o, const char 
*emission, const char *source));
    void         edje_object_signal_emit         (Evas_Object *o, const char 
*emission, const char *source);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_load.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- edje_load.c 19 Oct 2003 02:11:06 -0000      1.28
+++ edje_load.c 20 Oct 2003 06:10:09 -0000      1.29
@@ -18,7 +18,7 @@
    if (!part) part = "";
    if (((ed->path) && (!strcmp(file, ed->path))) &&
        (ed->part) && (!strcmp(part, ed->part)))
-     return 0;
+     return 1;
    
    _edje_file_del(ed);
    
@@ -27,6 +27,7 @@
    if (ed->part) free(ed->part);
    ed->part = strdup(part);
    
+   ed->load_error = EDJE_LOAD_ERROR_NONE;
    _edje_file_add(ed);
 
    if (ed->collection)
@@ -188,11 +189,15 @@
        _edje_thaw(ed);
        _edje_unblock(ed);
        _edje_unref(ed);
+       ed->load_error = EDJE_LOAD_ERROR_NONE;
        return 1;
      }
-     else return 0;
-
-     return 1;
+   else
+     {
+       return 0;
+     }
+   ed->load_error = EDJE_LOAD_ERROR_NONE;
+   return 1;
 }
 
 void
@@ -211,6 +216,16 @@
    if (part) *part = ed->part;
 }
 
+int
+edje_object_load_error_get(Evas_Object *obj)
+{
+   Edje *ed;
+   
+   ed = _edje_fetch(obj);
+   if (!ed) return EDJE_LOAD_ERROR_NONE;
+   return ed->load_error;
+}
+
 Evas_List *
 edje_file_collection_list(const char *file)
 {
@@ -320,10 +335,18 @@
    else
      {
        ef = eet_open(ed->path, EET_FILE_MODE_READ);
-       if (!ef) return;
+       if (!ef)
+         {
+            ed->load_error = EDJE_LOAD_ERROR_UNKNOWN_FORMAT;
+            return;
+         }
    
        ed->file = eet_data_read(ef, _edje_edd_edje_file, "edje_file");
-       if (!ed->file) goto out;
+       if (!ed->file)
+         {
+            ed->load_error = EDJE_LOAD_ERROR_CORRUPT_FILE;
+            goto out;
+         }
 
        ed->file->references = 1;   
        ed->file->path = strdup(ed->path);
@@ -331,6 +354,7 @@
          {
             _edje_file_free(ed->file);
             ed->file = NULL;
+            ed->load_error = EDJE_LOAD_ERROR_CORRUPT_FILE;
             goto out;
          }
        _edje_file_hash = evas_hash_add(_edje_file_hash, ed->file->path, ed->file);
@@ -360,11 +384,19 @@
             
             snprintf(buf, sizeof(buf), "collections/%i", id);
             if (!ef) ef = eet_open(ed->path, EET_FILE_MODE_READ);
-            if (!ef) goto out;
+            if (!ef)
+              {
+                 ed->load_error = EDJE_LOAD_ERROR_CORRUPT_FILE;
+                 goto out;
+              }
             ed->collection = eet_data_read(ef, 
                                            _edje_edd_edje_part_collection, 
                                            buf);
-            if (!ed->collection) goto out;
+            if (!ed->collection)
+              {
+                 ed->load_error = EDJE_LOAD_ERROR_CORRUPT_FILE;
+                 goto out;
+              }
             ed->collection->references = 1;
             ed->file->collection_hash = evas_hash_add(ed->file->collection_hash, 
ed->part, ed->collection);
          }
@@ -372,6 +404,7 @@
          {
             _edje_file_free(ed->file);
             ed->file = NULL;
+            ed->load_error = EDJE_LOAD_ERROR_CORRUPT_FILE;          
          }
      }
    out:
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- edje_private.h      18 Sep 2003 00:43:02 -0000      1.45
+++ edje_private.h      20 Oct 2003 06:10:09 -0000      1.46
@@ -393,6 +393,7 @@
    int                   references;
    int                   block;
    Evas_List            *emissions;
+   int                   load_error;
 };
 
 struct _Edje_Real_Part




-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to