Eobj: Made eobj_class_new return a const class.

Once a class is created, we are no longer allowed to touch it.

SVN revision: 70260
This commit is contained in:
Tom Hacohen 2012-04-17 10:27:25 +00:00
parent 3d245132cc
commit 3f2c369c26
26 changed files with 27 additions and 27 deletions

View File

@ -8,7 +8,7 @@
EAPI Eobj_Op INHERIT_BASE_ID = 0; EAPI Eobj_Op INHERIT_BASE_ID = 0;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_prot_print(Eobj *obj, void *class_data __UNUSED__, va_list *list) _prot_print(Eobj *obj, void *class_data __UNUSED__, va_list *list)

View File

@ -13,7 +13,7 @@ typedef struct
EAPI const Eobj_Event_Description _SIG_A_CHANGED = EAPI const Eobj_Event_Description _SIG_A_CHANGED =
EOBJ_EVENT_DESCRIPTION("a,changed", "i", "Called when a has changed."); EOBJ_EVENT_DESCRIPTION("a,changed", "i", "Called when a has changed.");
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_set(Eobj *obj, void *class_data, va_list *list) _a_set(Eobj *obj, void *class_data, va_list *list)

View File

@ -8,7 +8,7 @@
EAPI Eobj_Op COMP_BASE_ID = 0; EAPI Eobj_Op COMP_BASE_ID = 0;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_get(Eobj *obj, void *class_data __UNUSED__, va_list *list) _a_get(Eobj *obj, void *class_data __UNUSED__, va_list *list)

View File

@ -8,7 +8,7 @@ EAPI Eobj_Op SIMPLE_BASE_ID = 0;
EAPI const Eobj_Event_Description _SIG_A_CHANGED = EAPI const Eobj_Event_Description _SIG_A_CHANGED =
EOBJ_EVENT_DESCRIPTION("a,changed", "i", "Called when a has changed."); EOBJ_EVENT_DESCRIPTION("a,changed", "i", "Called when a has changed.");
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_set(Eobj *obj, void *class_data, va_list *list) _a_set(Eobj *obj, void *class_data, va_list *list)

View File

@ -6,7 +6,7 @@
EAPI Eobj_Op MIXIN_BASE_ID = 0; EAPI Eobj_Op MIXIN_BASE_ID = 0;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_add_and_print_set(Eobj *obj, void *class_data __UNUSED__, va_list *list) _add_and_print_set(Eobj *obj, void *class_data __UNUSED__, va_list *list)

View File

@ -12,7 +12,7 @@ typedef struct
int b; int b;
} Private_Data; } Private_Data;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static char *class_var = NULL; static char *class_var = NULL;

View File

@ -4,7 +4,7 @@
#include "config.h" #include "config.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_constructor(Eobj *obj, void *class_data __UNUSED__) _constructor(Eobj *obj, void *class_data __UNUSED__)

View File

@ -4,7 +4,7 @@
#include "config.h" #include "config.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_constructor(Eobj *obj, void *class_data __UNUSED__) _constructor(Eobj *obj, void *class_data __UNUSED__)

View File

@ -3,7 +3,7 @@
#include "simple.h" #include "simple.h"
#include "simple4.h" #include "simple4.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
const Eobj_Class * const Eobj_Class *
simple4_class_get(void) simple4_class_get(void)

View File

@ -4,7 +4,7 @@
#include "config.h" #include "config.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_destructor(Eobj *obj, void *class_data __UNUSED__) _destructor(Eobj *obj, void *class_data __UNUSED__)

View File

@ -4,7 +4,7 @@
#include "config.h" #include "config.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_destructor(Eobj *obj, void *class_data __UNUSED__) _destructor(Eobj *obj, void *class_data __UNUSED__)

View File

@ -13,7 +13,7 @@ typedef struct
Evas_Object *bx; Evas_Object *bx;
} Widget_Data; } Widget_Data;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_pack_end(Eobj *obj __UNUSED__, void *class_data, va_list *list) _pack_end(Eobj *obj __UNUSED__, void *class_data, va_list *list)

View File

@ -13,7 +13,7 @@ typedef struct
// Evas_Object *bx; // Evas_Object *bx;
} Widget_Data; } Widget_Data;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_constructor(Eobj *obj, void *class_data __UNUSED__) _constructor(Eobj *obj, void *class_data __UNUSED__)

View File

@ -16,7 +16,7 @@ typedef struct
Evas_Object *bt; Evas_Object *bt;
} Widget_Data; } Widget_Data;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_position_set(Eobj *obj, void *class_data __UNUSED__, va_list *list) _position_set(Eobj *obj, void *class_data __UNUSED__, va_list *list)

View File

@ -10,7 +10,7 @@ typedef struct
Evas_Object *bg; Evas_Object *bg;
} Widget_Data; } Widget_Data;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
my_win_del(void *data, Evas_Object *obj, void *event_info) my_win_del(void *data, Evas_Object *obj, void *event_info)

View File

@ -5,7 +5,7 @@
#include "config.h" #include "config.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
EAPI Eobj_Op EVAS_OBJ_BASE_ID = 0; EAPI Eobj_Op EVAS_OBJ_BASE_ID = 0;

View File

@ -3,7 +3,7 @@
#include "inherit.h" #include "inherit.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
const Eobj_Class * const Eobj_Class *
inherit_class_get(void) inherit_class_get(void)

View File

@ -10,7 +10,7 @@
EAPI Eobj_Op INHERIT2_BASE_ID = 0; EAPI Eobj_Op INHERIT2_BASE_ID = 0;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_set(Eobj *obj, void *class_data __UNUSED__, va_list *list) _a_set(Eobj *obj, void *class_data __UNUSED__, va_list *list)

View File

@ -6,7 +6,7 @@
#include "config.h" #include "config.h"
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_set(Eobj *obj, void *class_data __UNUSED__, va_list *list) _a_set(Eobj *obj, void *class_data __UNUSED__, va_list *list)

View File

@ -5,7 +5,7 @@
EAPI Eobj_Op SIMPLE_BASE_ID = 0; EAPI Eobj_Op SIMPLE_BASE_ID = 0;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_set(Eobj *obj __UNUSED__, void *class_data, va_list *list) _a_set(Eobj *obj __UNUSED__, void *class_data, va_list *list)

View File

@ -6,7 +6,7 @@
EAPI Eobj_Op MIXIN_BASE_ID = 0; EAPI Eobj_Op MIXIN_BASE_ID = 0;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_add_and_print_set(Eobj *obj, void *class_data __UNUSED__, va_list *list) _add_and_print_set(Eobj *obj, void *class_data __UNUSED__, va_list *list)

View File

@ -12,7 +12,7 @@ typedef struct
int b; int b;
} Private_Data; } Private_Data;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
#define _GET_SET_FUNC(name) \ #define _GET_SET_FUNC(name) \
static void \ static void \

View File

@ -14,7 +14,7 @@ typedef struct
EAPI const Eobj_Event_Description _SIG_A_CHANGED = EAPI const Eobj_Event_Description _SIG_A_CHANGED =
EOBJ_EVENT_DESCRIPTION("a,changed", "i", "Called when a has changed."); EOBJ_EVENT_DESCRIPTION("a,changed", "i", "Called when a has changed.");
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_set(Eobj *obj, void *class_data, va_list *list) _a_set(Eobj *obj, void *class_data, va_list *list)

View File

@ -228,7 +228,7 @@ typedef struct _Eobj_Class_Description Eobj_Class_Description;
* @param ... A NULL terminated list of extensions (interfaces, mixins and the classes of any composite objects). * @param ... A NULL terminated list of extensions (interfaces, mixins and the classes of any composite objects).
* @return The new class's handle on success, or NULL otherwise. * @return The new class's handle on success, or NULL otherwise.
*/ */
EAPI Eobj_Class *eobj_class_new(const Eobj_Class_Description *desc, const Eobj_Class *parent, ...); EAPI const Eobj_Class *eobj_class_new(const Eobj_Class_Description *desc, const Eobj_Class *parent, ...);
/** /**
* @brief Sets the OP functions for a class. * @brief Sets the OP functions for a class.

View File

@ -592,7 +592,7 @@ _eobj_class_check_op_descs(const Eobj_Class *klass)
return EINA_TRUE; return EINA_TRUE;
} }
EAPI Eobj_Class * EAPI const Eobj_Class *
eobj_class_new(const Eobj_Class_Description *desc, const Eobj_Class *parent, ...) eobj_class_new(const Eobj_Class_Description *desc, const Eobj_Class *parent, ...)
{ {
Eobj_Class *klass; Eobj_Class *klass;
@ -1292,7 +1292,7 @@ eobj_event_callback_forwarder_del(Eobj *obj, const Eobj_Event_Description *desc,
} }
/* EOBJ_CLASS_BASE stuff */ /* EOBJ_CLASS_BASE stuff */
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
/* FIXME: Set proper type descriptions. */ /* FIXME: Set proper type descriptions. */
EAPI const Eobj_Event_Description _EOBJ_EV_CALLBACK_ADD = EAPI const Eobj_Event_Description _EOBJ_EV_CALLBACK_ADD =

View File

@ -5,7 +5,7 @@
EAPI Eobj_Op SIMPLE_BASE_ID = 0; EAPI Eobj_Op SIMPLE_BASE_ID = 0;
static Eobj_Class *_my_class = NULL; static const Eobj_Class *_my_class = NULL;
static void static void
_a_set(Eobj *obj __UNUSED__, void *class_data, va_list *list) _a_set(Eobj *obj __UNUSED__, void *class_data, va_list *list)