mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 21:34:09 +00:00
cookbook: Made callback names more consistent
Changed callback function names so they are more consistent within this recipe and with other callback names used in other recipes.
This commit is contained in:
parent
c1e2658104
commit
a4db7746f2
@ -5,9 +5,9 @@ static const ClutterColor yellow = { 0xaa, 0x99, 0x00, 0xff };
|
|||||||
static const ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
|
static const ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_on_enter_cb (ClutterActor *actor,
|
_pointer_enter_cb (ClutterActor *actor,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterState *transitions = CLUTTER_STATE (user_data);
|
ClutterState *transitions = CLUTTER_STATE (user_data);
|
||||||
clutter_state_set_state (transitions, "fade-in");
|
clutter_state_set_state (transitions, "fade-in");
|
||||||
@ -15,9 +15,9 @@ _on_enter_cb (ClutterActor *actor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_on_leave_cb (ClutterActor *actor,
|
_pointer_leave_cb (ClutterActor *actor,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterState *transitions = CLUTTER_STATE (user_data);
|
ClutterState *transitions = CLUTTER_STATE (user_data);
|
||||||
clutter_state_set_state (transitions, "fade-out");
|
clutter_state_set_state (transitions, "fade-out");
|
||||||
@ -89,12 +89,12 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
g_signal_connect (box,
|
g_signal_connect (box,
|
||||||
"enter-event",
|
"enter-event",
|
||||||
G_CALLBACK (_on_enter_cb),
|
G_CALLBACK (_pointer_enter_cb),
|
||||||
transitions);
|
transitions);
|
||||||
|
|
||||||
g_signal_connect (box,
|
g_signal_connect (box,
|
||||||
"leave-event",
|
"leave-event",
|
||||||
G_CALLBACK (_on_leave_cb),
|
G_CALLBACK (_pointer_leave_cb),
|
||||||
transitions);
|
transitions);
|
||||||
|
|
||||||
/* bind the stage size to the box size + 50px in each axis */
|
/* bind the stage size to the box size + 50px in each axis */
|
||||||
|
@ -13,8 +13,8 @@ typedef struct {
|
|||||||
} Context;
|
} Context;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
convert_clutter_path_node_to_cogl_path (const ClutterPathNode *node,
|
_convert_clutter_path_node_to_cogl_path (const ClutterPathNode *node,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
g_return_if_fail (node != NULL);
|
g_return_if_fail (node != NULL);
|
||||||
|
|
||||||
@ -38,8 +38,8 @@ convert_clutter_path_node_to_cogl_path (const ClutterPathNode *node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_paint_cb (ClutterActor *actor,
|
_canvas_paint_cb (ClutterActor *actor,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
Context *context = (Context *)user_data;
|
Context *context = (Context *)user_data;
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ _paint_cb (ClutterActor *actor,
|
|||||||
|
|
||||||
cogl_set_path (context->cogl_path);
|
cogl_set_path (context->cogl_path);
|
||||||
|
|
||||||
clutter_path_foreach (context->path, convert_clutter_path_node_to_cogl_path, NULL);
|
clutter_path_foreach (context->path, _convert_clutter_path_node_to_cogl_path, NULL);
|
||||||
|
|
||||||
cogl_path_stroke_preserve ();
|
cogl_path_stroke_preserve ();
|
||||||
|
|
||||||
@ -59,9 +59,9 @@ _paint_cb (ClutterActor *actor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_motion_cb (ClutterActor *actor,
|
_pointer_motion_cb (ClutterActor *actor,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterMotionEvent *motion_event = (ClutterMotionEvent *)event;
|
ClutterMotionEvent *motion_event = (ClutterMotionEvent *)event;
|
||||||
Context *context = (Context *)user_data;
|
Context *context = (Context *)user_data;
|
||||||
@ -79,9 +79,9 @@ _motion_cb (ClutterActor *actor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_enter_cb (ClutterActor *actor,
|
_pointer_enter_cb (ClutterActor *actor,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterCrossingEvent *cross_event = (ClutterCrossingEvent *)event;
|
ClutterCrossingEvent *cross_event = (ClutterCrossingEvent *)event;
|
||||||
Context *context = (Context *)user_data;
|
Context *context = (Context *)user_data;
|
||||||
@ -136,17 +136,17 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
g_signal_connect (canvas,
|
g_signal_connect (canvas,
|
||||||
"motion-event",
|
"motion-event",
|
||||||
G_CALLBACK (_motion_cb),
|
G_CALLBACK (_pointer_motion_cb),
|
||||||
context);
|
context);
|
||||||
|
|
||||||
g_signal_connect (canvas,
|
g_signal_connect (canvas,
|
||||||
"enter-event",
|
"enter-event",
|
||||||
G_CALLBACK (_enter_cb),
|
G_CALLBACK (_pointer_enter_cb),
|
||||||
context);
|
context);
|
||||||
|
|
||||||
g_signal_connect (canvas,
|
g_signal_connect (canvas,
|
||||||
"paint",
|
"paint",
|
||||||
G_CALLBACK (_paint_cb),
|
G_CALLBACK (_canvas_paint_cb),
|
||||||
context);
|
context);
|
||||||
|
|
||||||
clutter_actor_show (stage);
|
clutter_actor_show (stage);
|
||||||
|
@ -4,9 +4,9 @@ static const ClutterColor stage_color = { 0x33, 0x33, 0x55, 0xff };
|
|||||||
static const ClutterColor rectangle_color = { 0xaa, 0x99, 0x00, 0xff };
|
static const ClutterColor rectangle_color = { 0xaa, 0x99, 0x00, 0xff };
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_pointer_moved_cb (ClutterActor *actor,
|
_pointer_motion_cb (ClutterActor *actor,
|
||||||
ClutterEvent *event,
|
ClutterEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterMotionEvent *motion_event = (ClutterMotionEvent *)event;
|
ClutterMotionEvent *motion_event = (ClutterMotionEvent *)event;
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
g_signal_connect (rectangle,
|
g_signal_connect (rectangle,
|
||||||
"motion-event",
|
"motion-event",
|
||||||
G_CALLBACK (_pointer_moved_cb),
|
G_CALLBACK (_pointer_motion_cb),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
clutter_actor_show (stage);
|
clutter_actor_show (stage);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user