2007-10-10 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c: * clutter/clutter-actor.h: Add missing enter/leave event signals * clutter/clutter-main.c: (clutter_do_event): Set time in crossing events. Protect against do_pick() failing.
This commit is contained in:
parent
475fcc64a7
commit
8faf9b9964
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2007-10-10 Matthew Allum <mallum@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/clutter-actor.c:
|
||||||
|
* clutter/clutter-actor.h:
|
||||||
|
Add missing enter/leave event signals
|
||||||
|
|
||||||
|
* clutter/clutter-main.c: (clutter_do_event):
|
||||||
|
Set time in crossing events.
|
||||||
|
Protect against do_pick() failing.
|
||||||
|
|
||||||
2007-10-09 Emmanuele Bassi <ebassi@openedhand.com>
|
2007-10-09 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
* clutter/clutter-script.c (resolve_alpha_func): Fix the
|
* clutter/clutter-script.c (resolve_alpha_func): Fix the
|
||||||
|
@ -31,6 +31,17 @@
|
|||||||
* stage. Every object that must appear on the main #ClutterStage must also
|
* stage. Every object that must appear on the main #ClutterStage must also
|
||||||
* be a #ClutterActor, either by using one of the classes provided by
|
* be a #ClutterActor, either by using one of the classes provided by
|
||||||
* Clutter, or by implementing a new #ClutterActor subclass.
|
* Clutter, or by implementing a new #ClutterActor subclass.
|
||||||
|
*
|
||||||
|
* Ordering of tranformations. FIXME.
|
||||||
|
*
|
||||||
|
* Notes on clutter actor events: FIXME.
|
||||||
|
*
|
||||||
|
* - Actors emit pointer events if set reactive (#clutter_actor_set_reactive)
|
||||||
|
* - Keyboard events are emitted if actor has focus (#clutter_stage_set_focus)
|
||||||
|
* - Motion events (motion, enter, leave) are only emitted per actor if
|
||||||
|
* #clutter_enable_motion_events called with TRUE. If set to FALSE (default)
|
||||||
|
* then only the stage emits events.
|
||||||
|
* - One emitted an event emission has two phases - capture and bubble.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -93,6 +104,7 @@ enum
|
|||||||
HIDE,
|
HIDE,
|
||||||
DESTROY,
|
DESTROY,
|
||||||
PARENT_SET,
|
PARENT_SET,
|
||||||
|
|
||||||
EVENT,
|
EVENT,
|
||||||
EVENT_AFTER,
|
EVENT_AFTER,
|
||||||
BUTTON_PRESS_EVENT,
|
BUTTON_PRESS_EVENT,
|
||||||
@ -103,6 +115,9 @@ enum
|
|||||||
MOTION_EVENT,
|
MOTION_EVENT,
|
||||||
FOCUS_IN,
|
FOCUS_IN,
|
||||||
FOCUS_OUT,
|
FOCUS_OUT,
|
||||||
|
ENTER_EVENT,
|
||||||
|
LEAVE_EVENT,
|
||||||
|
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1430,7 +1445,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
*
|
*
|
||||||
* The ::focus-out signal is emitted when @actor loses key focus.
|
* The ::focus-out signal is emitted when @actor loses key focus.
|
||||||
*
|
*
|
||||||
* Source: 0.6
|
* Since: 0.6
|
||||||
*/
|
*/
|
||||||
actor_signals[FOCUS_OUT] =
|
actor_signals[FOCUS_OUT] =
|
||||||
g_signal_new ("focus-out",
|
g_signal_new ("focus-out",
|
||||||
@ -1441,6 +1456,40 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
clutter_marshal_VOID__VOID,
|
clutter_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterActor::enter:
|
||||||
|
* @actor: the actor which the pointer has entered.
|
||||||
|
*
|
||||||
|
* The ::enter signal is emitted when the pointer enters the @actor
|
||||||
|
*
|
||||||
|
* Since: 0.6
|
||||||
|
*/
|
||||||
|
actor_signals[ENTER_EVENT] =
|
||||||
|
g_signal_new ("enter-event",
|
||||||
|
G_TYPE_FROM_CLASS (object_class),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
G_STRUCT_OFFSET (ClutterActorClass, enter),
|
||||||
|
NULL, NULL,
|
||||||
|
clutter_marshal_VOID__VOID,
|
||||||
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClutterActor::leave:
|
||||||
|
* @actor: the actor which the pointer has left
|
||||||
|
*
|
||||||
|
* The ::leave signal is emitted when the pointer leaves the @actor.
|
||||||
|
*
|
||||||
|
* Since: 0.6
|
||||||
|
*/
|
||||||
|
actor_signals[LEAVE_EVENT] =
|
||||||
|
g_signal_new ("leave-event",
|
||||||
|
G_TYPE_FROM_CLASS (object_class),
|
||||||
|
G_SIGNAL_RUN_LAST,
|
||||||
|
G_STRUCT_OFFSET (ClutterActorClass, leave),
|
||||||
|
NULL, NULL,
|
||||||
|
clutter_marshal_VOID__VOID,
|
||||||
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
|
|
||||||
klass->show = clutter_actor_real_show;
|
klass->show = clutter_actor_real_show;
|
||||||
klass->show_all = clutter_actor_show;
|
klass->show_all = clutter_actor_show;
|
||||||
@ -2975,6 +3024,12 @@ clutter_actor_event (ClutterActor *actor,
|
|||||||
case CLUTTER_MOTION:
|
case CLUTTER_MOTION:
|
||||||
signal_num = MOTION_EVENT;
|
signal_num = MOTION_EVENT;
|
||||||
break;
|
break;
|
||||||
|
case CLUTTER_ENTER:
|
||||||
|
signal_num = ENTER_EVENT;
|
||||||
|
break;
|
||||||
|
case CLUTTER_LEAVE:
|
||||||
|
signal_num = LEAVE_EVENT;
|
||||||
|
break;
|
||||||
case CLUTTER_DELETE:
|
case CLUTTER_DELETE:
|
||||||
case CLUTTER_DESTROY_NOTIFY:
|
case CLUTTER_DESTROY_NOTIFY:
|
||||||
case CLUTTER_CLIENT_MESSAGE:
|
case CLUTTER_CLIENT_MESSAGE:
|
||||||
|
@ -207,6 +207,10 @@ struct _ClutterActorClass
|
|||||||
ClutterKeyEvent *event);
|
ClutterKeyEvent *event);
|
||||||
gboolean (* motion_event) (ClutterActor *actor,
|
gboolean (* motion_event) (ClutterActor *actor,
|
||||||
ClutterMotionEvent *event);
|
ClutterMotionEvent *event);
|
||||||
|
void (* enter) (ClutterActor *actor,
|
||||||
|
ClutterCrossingEvent *event);
|
||||||
|
void (* leave) (ClutterActor *actor,
|
||||||
|
ClutterCrossingEvent *event);
|
||||||
void (* focus_in) (ClutterActor *actor);
|
void (* focus_in) (ClutterActor *actor);
|
||||||
void (* focus_out) (ClutterActor *actor);
|
void (* focus_out) (ClutterActor *actor);
|
||||||
|
|
||||||
|
@ -1173,6 +1173,8 @@ clutter_do_event (ClutterEvent *event)
|
|||||||
|
|
||||||
actor = event->crossing.source;
|
actor = event->crossing.source;
|
||||||
|
|
||||||
|
g_return_if_fail (actor != NULL);
|
||||||
|
|
||||||
while (actor)
|
while (actor)
|
||||||
{
|
{
|
||||||
if (clutter_actor_is_reactive (actor) ||
|
if (clutter_actor_is_reactive (actor) ||
|
||||||
@ -1247,6 +1249,8 @@ clutter_do_event (ClutterEvent *event)
|
|||||||
CLUTTER_NOTE (EVENT, "Reactive event received at %i, %i - actor: %p",
|
CLUTTER_NOTE (EVENT, "Reactive event received at %i, %i - actor: %p",
|
||||||
x, y, actor);
|
x, y, actor);
|
||||||
|
|
||||||
|
g_return_if_fail (actor != NULL);
|
||||||
|
|
||||||
if (event->type == CLUTTER_SCROLL)
|
if (event->type == CLUTTER_SCROLL)
|
||||||
event->scroll.source = g_object_ref (actor);
|
event->scroll.source = g_object_ref (actor);
|
||||||
else
|
else
|
||||||
@ -1262,7 +1266,7 @@ clutter_do_event (ClutterEvent *event)
|
|||||||
ClutterEvent cev;
|
ClutterEvent cev;
|
||||||
|
|
||||||
cev.crossing.type = CLUTTER_LEAVE;
|
cev.crossing.type = CLUTTER_LEAVE;
|
||||||
cev.crossing.time = 0; /* FIXME */
|
cev.crossing.time = event->any.time;
|
||||||
cev.crossing.flags = 0;
|
cev.crossing.flags = 0;
|
||||||
cev.crossing.x = x;
|
cev.crossing.x = x;
|
||||||
cev.crossing.y = y;
|
cev.crossing.y = y;
|
||||||
@ -1272,7 +1276,7 @@ clutter_do_event (ClutterEvent *event)
|
|||||||
clutter_event_put (&cev); /* copys */
|
clutter_event_put (&cev); /* copys */
|
||||||
|
|
||||||
cev.crossing.type = CLUTTER_ENTER;
|
cev.crossing.type = CLUTTER_ENTER;
|
||||||
cev.crossing.time = 0; /* FIXME */
|
cev.crossing.time = event->any.time;
|
||||||
cev.crossing.flags = 0;
|
cev.crossing.flags = 0;
|
||||||
cev.crossing.x = x;
|
cev.crossing.x = x;
|
||||||
cev.crossing.y = y;
|
cev.crossing.y = y;
|
||||||
|
Loading…
Reference in New Issue
Block a user