efl_gfx_position_set(d.img, 0, 0);
efl_gfx_size_set(d.img, WIDTH, HEIGHT);
efl_gfx_visible_set(d.img, EINA_TRUE);
-
- const char *type = NULL;
- type = evas_obj_type_get(d.img);
- fprintf(stdout, "Image object added, type is: %s\n", type);
+ fprintf(stdout, "Image object added, class name is: %s\n",
+ eo_class_name_get(d.img));
}
/* border on the image's clipper, here just to emphasize its position */
# include <Evil.h>
#endif
+#define EVAS_OBJECT_PROTECTED
+
#include <Eina.h>
#include <Eet.h>
#include <Eo.h>
*/
#define ELM_CONFIG_ICON_THEME_ELEMENTARY "_Elementary_Icon_Theme"
-
+#define EVAS_OBJECT_PROTECTED
# include "config.h"
#endif
+#define EVAS_OBJECT_PROTECTED
+
#include <Evas.h>
#include <Ecore.h>
EAPI void evas_object_del(Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
+ * @brief Retrieves the type of the given Evas object.
+ *
+ * For Evas' builtin types, the return strings will be one of "rectangle",
+ * "line", "polygon", "text", "textblock" or "image".
+ *
+ * For Evas smart objects (see @ref Evas_Smart_Group), the name of the smart
+ * class itself is returned on this call. For the built-in smart objects, these
+ * names are "EvasObjectSmartClipped" for the clipped smart object,
+ * "Evas_Object_Box" for the box object and "Evas_Object_Table for the table
+ * object.
+ *
+ * @return The type of the object.
+ *
+ * @ingroup Evas_Object
+ */
+EAPI const char *evas_object_type_get(const Evas_Object *obj);
+
+/**
* Retrieves the position and (rectangular) size of the given Evas
* object.
*
legacy_ctor @protected {
[[Internal function. Do not use.]]
}
- @property type {
+ @property type @protected {
set {
- [[Sets the type of the given Evas object.]]
+ [[Sets the legacy type name of this Evas object.]]
legacy: null;
}
- get {
- [[Retrieves the type of the given Evas object.
-
- For Evas' builtin types, the return strings will be one of
- "rectangle", "line", "polygon", "text", "textblock" or "image".
-
- For Evas smart objects (see \@ref Evas_Smart_Group), the name
- of the smart class itself is returned on this call. For the
- built-in smart objects, these names are "EvasObjectSmartClipped"
- for the clipped smart object, "Evas_Object_Box" for the box
- object and "Evas_Object_Table for the table object.
- ]]
- /* FIXME-doc
- Example:
- @dontinclude evas-object-manipulation.c
- @skip d.img = evas_object_image_filled_add(d.canvas);
- @until border on the
-
- See the full @ref Example_Evas_Object_Manipulation "example".
- */
- }
values {
type: string; [[The type of the object.]]
}
}
}
}
+ constructors {
+ .type;
+ }
implements {
Eo.Base.constructor;
Eo.Base.destructor;
return in;
}
-EOLIAN static const char *
-_evas_object_type_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
-{
- if (obj->delete_me) return "";
- return obj->type;
-}
-
EOLIAN static void
-_evas_object_type_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const char *type)
+_evas_object_type_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, const char *type)
{
+ if (eo_finalized_get(eo_obj))
+ {
+ ERR("This function is only allowed during construction.");
+ return;
+ }
obj->type = type; // Store it as the top type of this class
}
/* legacy */
+EAPI const char *
+evas_object_type_get(const Evas_Object *eo_obj)
+{
+ Evas_Object_Protected_Data *obj = eo_isa(eo_obj, EVAS_OBJECT_CLASS) ?
+ eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS) : NULL;
+ if (!obj || obj->delete_me) return "";
+ return obj->type;
+}
+
EAPI void
evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h)
{
#ifdef BUILD_LOADER_EET
# include <Eet.h>
#endif
+
+#ifndef EVAS_OBJECT_PROTECTED
+# define EVAS_OBJECT_PROTECTED
+#endif
+
#include "Evas.h"
#ifdef EAPI
# include <config.h>
#endif
+#ifndef EVAS_OBJECT_PROTECTED
+# define EVAS_OBJECT_PROTECTED
+#endif
+
#include "Evas.h"
#include "Eet.h"