* Add entry,selection,all,request for signalling ctrl+a in an entry
* Add entry,selection,none,request for signalling ctrl+shift+a in an entry
* Fix entry,paste,request* to be emitted after cursor,changed (fixes middle mouse paste location)
-
+
2011-05-27 Carsten Haitzler (The Rasterman)
* Fix edje_shutdown() being called before all evas objects created
* Entry: Added changed,user signal. This signal indicates the entry
has changed because of user interaction, i.e not by code.
+
+2011-08-22 Cedric Bail
+
+ * Add collection.group.limits {
+ vertical: "name" value;
+ horizontal: "name" value;
+ }.
static void st_collections_group_data_item(void);
static void st_collections_group_orientation(void);
+static void st_collections_group_limits_vertical(void);
+static void st_collections_group_limits_horizontal(void);
+
static void ob_collections_group_script(void);
static void ob_collections_group_lua_script(void);
{"collections.group.max", st_collections_group_max},
{"collections.group.orientation", st_collections_group_orientation},
{"collections.group.data.item", st_collections_group_data_item},
+ {"collections.group.limits.horizontal", st_collections_group_limits_horizontal},
+ {"collections.group.limits.vertical", st_collections_group_limits_vertical},
{"collections.group.externals.external", st_externals_external}, /* dup */
{"collections.group.image", st_images_image}, /* dup */
{"collections.group.set.name", st_images_set_name},
/**
@page edcref
+ @property
+ group {
+ limits {
+ vertical: "limit_name" height_barrier;
+ ..
+ }
+ }
+ @parameters
+ [name] [height barrier]
+ @effect
+ This defines when to trigger some even when the Edje object is resized.
+ It will send a signal: "limit,name,over" when the object is resized and pass
+ the limit by growing over it. And it will send: "limit,name,below" when
+ it pass below that limit.
+ @endproperty
+*/
+static void
+st_collections_group_limits_vertical(void)
+{
+ Edje_Part_Collection *pc;
+ Edje_Limit *el;
+
+ check_arg_count(2);
+
+ el = mem_alloc(SZ(Edje_Limit));
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ pc->limits.vertical_count++;
+ pc->limits.vertical = realloc(pc->limits.vertical, pc->limits.vertical_count * sizeof (Edje_Limit *));
+ if (!pc->limits.vertical || el)
+ {
+ ERR("%s: Error. Not enough memory.", progname);
+ exit(-1);
+ }
+
+ pc->limits.vertical[pc->limits.vertical_count - 1] = el;
+
+ el->name = parse_str(0);
+ el->value = parse_int_range(1, 1, 0xffff);
+}
+
+/**
+ @page edcref
+ @property
+ group {
+ limits {
+ horizontal: "limit_name" width_barrier;
+ ..
+ }
+ }
+ @parameters
+ [name] [width barrier]
+ @effect
+ This defines when to trigger some signal when the Edje object is resized.
+ It will send a signal: "limit,name,over" when the object is resized and pass
+ the limit by growing over it. And it will send: "limit,name,below" when
+ it pass below that limit.
+ @endproperty
+*/
+static void
+st_collections_group_limits_horizontal(void)
+{
+ Edje_Part_Collection *pc;
+ Edje_Limit *el;
+
+ check_arg_count(2);
+
+ el = mem_alloc(SZ(Edje_Limit));
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ pc->limits.horizontal_count++;
+ pc->limits.horizontal = realloc(pc->limits.horizontal, pc->limits.horizontal_count * sizeof (Edje_Limit *));
+ if (!pc->limits.horizontal || el)
+ {
+ ERR("%s: Error. Not enough memory.", progname);
+ exit(-1);
+ }
+
+ pc->limits.horizontal[pc->limits.horizontal_count - 1] = el;
+
+ el->name = parse_str(0);
+ el->value = parse_int_range(1, 1, 0xffff);
+}
+
+/**
+ @page edcref
@block
parts
@context
Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry = NULL;
Eet_Data_Descriptor *_edje_edd_edje_image_directory_set = NULL;
Eet_Data_Descriptor *_edje_edd_edje_image_directory_set_entry = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_limit = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_limit_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_program = NULL;
Eet_Data_Descriptor *_edje_edd_edje_program_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_program_target = NULL;
FREED(_edje_edd_edje_font_directory_entry);
FREED(_edje_edd_edje_image_directory);
FREED(_edje_edd_edje_image_directory_entry);
+ FREED(_edje_edd_edje_limit);
+ FREED(_edje_edd_edje_limit_pointer);
FREED(_edje_edd_edje_program);
FREED(_edje_edd_edje_program_pointer);
FREED(_edje_edd_edje_program_target);
EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "fonts", fonts, _edje_edd_edje_font_directory_entry);
EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "collection", collection, _edje_edd_edje_part_collection_directory_entry);
- /* parts & programs - loaded induvidually */
+ /* parts & limit & programs - loaded induvidually */
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Limit);
+ _edje_edd_edje_limit = eet_data_descriptor_file_new(&eddc);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_limit, Edje_Limit, "name", name, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_limit, Edje_Limit, "value", value, EET_T_INT);
+
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Program_Target);
_edje_edd_edje_program_target =
eet_data_descriptor_file_new(&eddc);
EDJE_DEFINE_POINTER_TYPE(Part, part);
EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "parts", parts, _edje_edd_edje_part_pointer);
+ EDJE_DEFINE_POINTER_TYPE(Limit, limit);
+ EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "limits.vertical", limits.vertical, _edje_edd_edje_limit_pointer);
+ EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "limits.horizontal", limits.horizontal, _edje_edd_edje_limit_pointer);
+
EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_part_collection, Edje_Part_Collection, "data", data, _edje_edd_edje_string);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "id", id, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_HASH_STRING(_edje_edd_edje_part_collection, Edje_Part_Collection, "alias", alias);
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
typedef struct _Edje_Image_Directory_Set Edje_Image_Directory_Set;
typedef struct _Edje_Image_Directory_Set_Entry Edje_Image_Directory_Set_Entry;
+typedef struct _Edje_Limit Edje_Limit;
typedef struct _Edje_Program Edje_Program;
typedef struct _Edje_Program_Target Edje_Program_Target;
typedef struct _Edje_Program_After Edje_Program_After;
};
/*----------*/
+struct _Edje_Limit
+{
+ const char *name;
+ int value;
+};
+
+/*----------*/
#define PART_TYPE_FIELDS(TYPE) \
TYPE RECTANGLE; \
TYPE TEXT; \
unsigned int nocmp_count;
} programs;
+ struct { /* list of limit that need to be monitored */
+ Edje_Limit **vertical;
+ unsigned int vertical_count;
+
+ Edje_Limit **horizontal;
+ unsigned int horizontal_count;
+ } limits;
+
Edje_Part **parts; /* an array of Edje_Part */
unsigned int parts_count;
Eina_List *subobjs;
Eina_List *text_insert_filter_callbacks;
void *script_only_data;
+
int table_programs_size;
unsigned int table_parts_size;
void *data;
int num;
} message;
- int processing_messages;
+ int processing_messages;
int state;
int preload_count;
+ lua_State *L;
+ Eina_Inlist *lua_objs;
+ int lua_ref;
+
+ struct {
+ Edje_Item_Provider_Cb func;
+ void *data;
+ } item_provider;
+
unsigned int dirty : 1;
unsigned int recalc : 1;
unsigned int walking_callbacks : 1;
unsigned int all_part_change : 1;
#endif
unsigned int have_mapped_part : 1;
-
- lua_State *L;
- Eina_Inlist *lua_objs;
- int lua_ref;
-
- struct {
- Edje_Item_Provider_Cb func;
- void *data;
- } item_provider;
};
struct _Edje_Calc_Params
}
static void
+_edje_limit_emit(Edje *ed, const char *limit_name, Eina_Bool over)
+{
+ char *buffer;
+ unsigned int length;
+
+ if (!limit_name) return ;
+
+ length = strlen(limit_name) + 13;
+ buffer = alloca(length);
+ snprintf(buffer, length, "limit,%s,%s", limit_name, over ? "over" : "below");
+ _edje_emit(ed, buffer, NULL);
+}
+
+static void
+_edje_limit_get(Edje *ed, Edje_Limit **limits, unsigned int length, Evas_Coord size_current, Evas_Coord size_next)
+{
+ unsigned int i;
+
+ if (size_next == size_current) return ;
+
+ for (i = 0; i < length; ++i)
+ {
+ if ((size_current <= limits[i]->value) && (limits[i]->value < size_next))
+ {
+ _edje_limit_emit(ed, limits[i]->name, EINA_TRUE);
+ }
+ else if ((size_next <= limits[i]->value) && (limits[i]->value < size_current))
+ {
+ _edje_limit_emit(ed, limits[i]->name, EINA_FALSE);
+ }
+ }
+}
+
+static void
_edje_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h)
{
Edje *ed;
ed = evas_object_smart_data_get(obj);
if (!ed) return;
if ((w == ed->w) && (h == ed->h)) return;
+ if (ed->collection)
+ {
+ _edje_limit_get(ed, ed->collection->limits.horizontal, ed->collection->limits.horizontal_count, ed->w, w);
+ _edje_limit_get(ed, ed->collection->limits.vertical, ed->collection->limits.vertical_count, ed->h, h);
+ }
ed->w = w;
ed->h = h;
#ifdef EDJE_CALC_CACHE