<commit_before>#include "e.h"

#define SMART_NAME     "e_zoomap"
#define API_ENTRY      E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME)))
#define INTERNAL_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if (!sd) return;
typedef struct _E_Smart_Data E_Smart_Data;

struct _E_Smart_Data
{
   Evas_Object *smart_obj, *child_obj;
   Evas_Coord   x, y, w, h;
   Evas_Coord   child_w, child_h;
   unsigned int recurse;
   Eina_Bool    solid : 1;
   Eina_Bool    smooth : 1;
   Eina_Bool    always : 1;
};

/* local subsystem functions */
static void _e_zoomap_smart_child_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _e_zoomap_smart_child_resize_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);

static void _e_zoomap_smart_reconfigure(E_Smart_Data *sd);
static void _e_zoomap_smart_add(Evas_Object *obj);
static void _e_zoomap_smart_del(Evas_Object *obj);
static void _e_zoomap_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
static void _e_zoomap_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
static void _e_zoomap_smart_show(Evas_Object *obj);
static void _e_zoomap_smart_hide(Evas_Object *obj);
static void _e_zoomap_smart_color_set(Evas_Object *obj, int r, int g, int b, int a);
static void _e_zoomap_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
static void _e_zoomap_smart_clip_unset(Evas_Object *obj);
static void _e_zoomap_smart_init(void);

/* local subsystem globals */
static Evas_Smart *_e_smart = NULL;

/* externally accessible functions */
E_API Evas_Object *
e_zoomap_add(Evas *evas)
{
   _e_zoomap_smart_init();
   return evas_object_smart_add(evas, _e_smart);
}

E_API void
e_zoomap_child_set(Evas_Object *obj, Evas_Object *child)
{
   API_ENTRY return;
   if (child == sd->child_obj) return;
   if (sd->child_obj)
     {
        evas_object_clip_unset(sd->child_obj);
        evas_object_smart_member_del(sd->child_obj);
        evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_DEL,
                                       _e_zoomap_smart_child_del_hook);
        evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_RESIZE,
                                       _e_zoomap_smart_child_resize_hook);
        sd->child_obj = NULL;
     }
   if (child)
     {
        int r, g, b, a;

        sd->child_obj = child;
        evas_object_smart_member_add(sd->child_obj, sd->smart_obj);<commit_msg>disable map when unsetting zoomap child<commit_after>#include "e.h"

#define SMART_NAME     "e_zoomap"
#define API_ENTRY      E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME)))
#define INTERNAL_ENTRY E_Smart_Data * sd; sd = evas_object_smart_data_get(obj); if (!sd) return;
typedef struct _E_Smart_Data E_Smart_Data;

struct _E_Smart_Data
{
   Evas_Object *smart_obj, *child_obj;
   Evas_Coord   x, y, w, h;
   Evas_Coord   child_w, child_h;
   unsigned int recurse;
   Eina_Bool    solid : 1;
   Eina_Bool    smooth : 1;
   Eina_Bool    always : 1;
};

/* local subsystem functions */
static void _e_zoomap_smart_child_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _e_zoomap_smart_child_resize_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);

static void _e_zoomap_smart_reconfigure(E_Smart_Data *sd);
static void _e_zoomap_smart_add(Evas_Object *obj);
static void _e_zoomap_smart_del(Evas_Object *obj);
static void _e_zoomap_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
static void _e_zoomap_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
static void _e_zoomap_smart_show(Evas_Object *obj);
static void _e_zoomap_smart_hide(Evas_Object *obj);
static void _e_zoomap_smart_color_set(Evas_Object *obj, int r, int g, int b, int a);
static void _e_zoomap_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
static void _e_zoomap_smart_clip_unset(Evas_Object *obj);
static void _e_zoomap_smart_init(void);

/* local subsystem globals */
static Evas_Smart *_e_smart = NULL;

/* externally accessible functions */
E_API Evas_Object *
e_zoomap_add(Evas *evas)
{
   _e_zoomap_smart_init();
   return evas_object_smart_add(evas, _e_smart);
}

E_API void
e_zoomap_child_set(Evas_Object *obj, Evas_Object *child)
{
   API_ENTRY return;
   if (child == sd->child_obj) return;
   if (sd->child_obj)
     {
        evas_object_map_set(sd->child_obj, NULL);
        evas_object_map_enable_set(sd->child_obj, EINA_FALSE);
        evas_object_clip_unset(sd->child_obj);
        evas_object_smart_member_del(sd->child_obj);
        evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_DEL,
                                       _e_zoomap_smart_child_del_hook);
        evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_RESIZE,
                                       _e_zoomap_smart_child_resize_hook);
        sd->child_obj = NULL;
     }
   if (child)
     {
        int r, g, b, a;

        sd->child_obj = child;
        evas_object_smart_member_add(sd->child_obj, sd->smart_obj);
{'fraction_non_alphanumeric': 0.09477942592949336, 'fraction_numerical': 0.0011558466576767482, 'mean_word_length': 4.4423480083857445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6156739', 'n_tokens_mistral': 1998, 'n_tokens_neox': 1954, 'n_words': 392}