oooh... i found a nasty mouse grab/count/accoutning/hold etc. issue with

events. fixed (thanks bart!) :)


SVN revision: 13023
This commit is contained in:
Carsten Haitzler 2005-01-20 06:54:45 +00:00
parent 0ebe699c37
commit 342f0b1ee2
6 changed files with 143 additions and 63 deletions

View File

@ -26,7 +26,7 @@
* @brief These routines are used for Evas library interaction.
*/
enum _Evas_Callback_Type
typedef enum _Evas_Callback_Type
{
EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
@ -44,16 +44,39 @@ enum _Evas_Callback_Type
EVAS_CALLBACK_MOVE, /**< Move Event */
EVAS_CALLBACK_RESIZE, /**< Resize Event */
EVAS_CALLBACK_RESTACK /**< Restack Event */
};
typedef enum _Evas_Callback_Type Evas_Callback_Type; /**< The type of event to trigger the callback */
} Evas_Callback_Type; /**< The type of event to trigger the callback */
enum _Evas_Button_Flags
typedef enum _Evas_Button_Flags
{
EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */
EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */
EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */
};
typedef enum _Evas_Button_Flags Evas_Button_Flags; /**< Flags for Mouse Button events */
} Evas_Button_Flags; /**< Flags for Mouse Button events */
typedef enum _Evas_Format_Type
{
EVAS_FORMAT_NONE = 0,
EVAS_FORMAT_FONT,
EVAS_FORMAT_SIZE,
EVAS_FORMAT_COLOR,
EVAS_FORMAT_COLOR2,
EVAS_FORMAT_COLOR3,
EVAS_FORMAT_ALIGN,
EVAS_FORMAT_STYLE,
EVAS_FORMAT_UNDERLINE,
EVAS_FORMAT_NEWLINE,
EVAS_FORMAT_TAB,
EVAS_FORMAT_L2R,
EVAS_FORMAT_R2L,
EVAS_FORMAT_ANCHOR
} Evas_Format_Type;
typedef enum _Evas_Format_Direction
{
EVAS_FORMAT_DIRECTION_VERTICAL = 0,
EVAS_FORMAT_DIRECTION_HORIZONTAL = 1
} Evas_Format_Direction;
typedef struct _Evas_List Evas_List; /**< A generic linked list node handle */
typedef struct _Evas_Rectangle Evas_Rectangle; /**< A generic rectangle handle */

View File

@ -166,16 +166,14 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
obj->cur.clipper = NULL;
}
/* clip me */
if (clip->clip.clipees == NULL && clip->cur.visible)
if ((clip->clip.clipees == NULL) && (clip->cur.visible))
{
/* Basically it just went invisible */
clip->changed = 1;
clip->layer->evas->changed = 1;
evas_damage_rectangle_add(clip->layer->evas,
clip->cur.geometry.x, clip->cur.geometry.y,
clip->cur.geometry.w, clip->cur.geometry.h);
/* Basically it just went invisible */
clip->changed = 1;
clip->layer->evas->changed = 1;
evas_damage_rectangle_add(clip->layer->evas,
clip->cur.geometry.x, clip->cur.geometry.y,
clip->cur.geometry.w, clip->cur.geometry.h);
}
obj->cur.clipper = clip;
clip->clip.clipees = evas_list_append(clip->clip.clipees, obj);

View File

@ -424,22 +424,25 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, const void *data)
obj = outs->data;
outs = evas_list_remove(outs, obj);
e->pointer.object.in = evas_list_remove(e->pointer.object.in, obj);
if (!obj->mouse_grabbed)
{
Evas_Event_Mouse_Out ev;
obj->mouse_in = 0;
ev.buttons = e->pointer.button;
ev.output.x = e->pointer.x;
ev.output.y = e->pointer.y;
ev.canvas.x = e->pointer.canvas_x;
ev.canvas.y = e->pointer.canvas_y;
ev.data = (void *)data;
ev.modifiers = &(e->modifiers);
ev.locks = &(e->locks);
if (!e->events_frozen)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
}
e->pointer.object.in = evas_list_remove(e->pointer.object.in, obj);
{
Evas_Event_Mouse_Out ev;
obj->mouse_in = 0;
ev.buttons = e->pointer.button;
ev.output.x = e->pointer.x;
ev.output.y = e->pointer.y;
ev.canvas.x = e->pointer.canvas_x;
ev.canvas.y = e->pointer.canvas_y;
ev.data = (void *)data;
ev.modifiers = &(e->modifiers);
ev.locks = &(e->locks);
if (!e->events_frozen)
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
}
}
}
}
else

View File

@ -429,9 +429,9 @@ evas_object_del(Evas_Object *obj)
obj->layer->evas->focused = NULL;
evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL);
}
evas_object_hide(obj);
evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL);
evas_object_grabs_cleanup(obj);
evas_object_hide(obj);
while (obj->clip.clipees) evas_object_clip_unset(obj->clip.clipees->data);
if (obj->cur.clipper) evas_object_clip_unset(obj);
if (obj->smart.smart) evas_object_smart_del(obj);
@ -671,12 +671,15 @@ evas_object_hide(Evas_Object *obj)
NULL);
if (obj->mouse_grabbed > 0)
{
if (obj->layer->evas->pointer.mouse_grabbed > 0)
if (obj->layer->evas->pointer.mouse_grabbed >= obj->mouse_grabbed)
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
}
{
obj->mouse_grabbed = 0;
obj->layer->evas->pointer.object.in = evas_list_remove(obj->layer->evas->pointer.object.in, obj);
if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
{
obj->layer->evas->pointer.object.in = evas_list_remove(obj->layer->evas->pointer.object.in, obj);
}
if (obj->layer->evas->events_frozen > 0)
{
obj->mouse_in = 0;

View File

@ -77,7 +77,7 @@ evas_object_textblock_add(Evas *e)
/* stubs of what we will need... */
void
evas_object_textblock_text_set(Evas_Object *obj, char *text)
evas_object_textblock_clear(Evas_Object *obj)
{
Evas_Object_Textblock *o;
@ -90,21 +90,6 @@ evas_object_textblock_text_set(Evas_Object *obj, char *text)
MAGIC_CHECK_END();
}
const char *
evas_object_textblock_text_get(Evas_Object *obj)
{
Evas_Object_Textblock *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
o = (Evas_Object_Textblock *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Textblock, MAGIC_OBJ_TEXT);
return NULL;
MAGIC_CHECK_END();
return NULL;
}
void
evas_object_textblock_cursor_pos_set(Evas_Object *obj, int pos)
{
@ -148,8 +133,62 @@ evas_object_textblock_text_insert(Evas_Object *obj, char *text)
MAGIC_CHECK_END();
}
Evas_Format *
evas_format_new(Evas *e)
{
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
return NULL;
}
void
evas_object_textblock_newline_use_set(Evas_Object *obj, Evas_Bool use)
evas_format_del(Evas_Format *fmt)
{
}
void
evas_format_retain_set(Evas_Format *fmt, Evas_Bool retain)
{
}
void
evas_format_resize(Evas_Format *fmt, Evas_Coord w, Evas_Coord h)
{
}
void
evas_format_type_set(Evas_Format *fmt, Evas_Format_Type ft)
{
}
void
evas_format_size_set(Evas_Format *fmt, Evas_Coord size)
{
}
void
evas_format_enabled_set(Evas_Format *fmt, Evas_Bool enabled)
{
}
void
evas_format_color_set(Evas_Format *fmt, int r, int g, int b, int a)
{
}
void
evas_format_string_set(Evas_Format *fmt, const char *str)
{
}
void
evas_format_align_set(Evas_Format *fmt, double align)
{
}
void
evas_object_textblock_format_insert(Evas_Object *obj, Evas_Format *fmt)
{
Evas_Object_Textblock *o;
@ -162,25 +201,14 @@ evas_object_textblock_newline_use_set(Evas_Object *obj, Evas_Bool use)
MAGIC_CHECK_END();
}
Evas_Bool
evas_object_textblock_newline_use_get(Evas_Object *obj)
void
evas_object_textblock_format_direction_set(Evas_Object *obj, Evas_Format_Direction dir)
{
Evas_Object_Textblock *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
o = (Evas_Object_Textblock *)(obj->object_data);
MAGIC_CHECK(o, Evas_Object_Textblock, MAGIC_OBJ_TEXT);
return 0;
MAGIC_CHECK_END();
return 0;
}
/* all nice and private */
static void
evas_object_textblock_init(Evas_Object *obj)

View File

@ -45,6 +45,30 @@ typedef enum _Evas_Button_Flags
EVAS_BUTTON_TRIPLE_CLICK = (1 << 1)
} Evas_Button_Flags;
typedef enum _Evas_Format_Type
{
EVAS_FORMAT_NONE = 0,
EVAS_FORMAT_FONT,
EVAS_FORMAT_SIZE,
EVAS_FORMAT_COLOR,
EVAS_FORMAT_COLOR2,
EVAS_FORMAT_COLOR3,
EVAS_FORMAT_ALIGN,
EVAS_FORMAT_STYLE,
EVAS_FORMAT_UNDERLINE,
EVAS_FORMAT_NEWLINE,
EVAS_FORMAT_TAB,
EVAS_FORMAT_L2R,
EVAS_FORMAT_R2L,
EVAS_FORMAT_ANCHOR
} Evas_Format_Type;
typedef enum _Evas_Format_Direction
{
EVAS_FORMAT_DIRECTION_VERTICAL = 0,
EVAS_FORMAT_DIRECTION_HORIZONTAL = 1
} Evas_Format_Direction;
typedef struct _Evas_Rectangle Evas_Rectangle;
typedef struct _Evas Evas;
@ -70,6 +94,7 @@ typedef struct _Evas_Intercept_Func_Int Evas_Intercept_Func_Int;
typedef struct _Evas_Key_Grab Evas_Key_Grab;
typedef struct _Evas_Callbacks Evas_Callbacks;
typedef struct _Evas_Smart_Class Evas_Smart_Class;
typedef struct _Evas_Format Evas_Format;
#if 0 /* able to change co-ordinate systems to remove all fp ops */
typedef double Evas_Coord;
typedef double Evas_Font_Size;