whitespace cleanup; use g_slice in scratch plugin.

This commit is contained in:
Tomas Frydrych 2008-10-16 23:29:24 +01:00
parent 1e59d63e31
commit 30ece059cf
2 changed files with 148 additions and 148 deletions

View File

@ -504,8 +504,7 @@ on_map_effect_complete (ClutterActor *actor, gpointer data)
mutter_plugin.running--; mutter_plugin.running--;
/* Now notify the manager that we are done with this effect */ /* Now notify the manager that we are done with this effect */
mutter_plugin_effect_completed (&mutter_plugin, mc_window, mutter_plugin_effect_completed (&mutter_plugin, mc_window, MUTTER_PLUGIN_MAP);
MUTTER_PLUGIN_MAP);
} }
/* /*

View File

@ -42,7 +42,8 @@
#define PANEL_SLIDE_THRESHOLD 2 #define PANEL_SLIDE_THRESHOLD 2
#define PANEL_HEIGHT 40 #define PANEL_HEIGHT 40
#define ACTOR_DATA_KEY "MCCP-Moblin-actor-data" #define ACTOR_DATA_KEY "MCCP-scratch-actor-data"
static GQuark actor_data_quark = 0;
typedef struct PluginPrivate PluginPrivate; typedef struct PluginPrivate PluginPrivate;
typedef struct ActorPrivate ActorPrivate; typedef struct ActorPrivate ActorPrivate;
@ -55,14 +56,10 @@ static void maximize (MutterWindow *actor,
gint x, gint y, gint width, gint height); gint x, gint y, gint width, gint height);
static void unmaximize (MutterWindow *actor, static void unmaximize (MutterWindow *actor,
gint x, gint y, gint width, gint height); gint x, gint y, gint width, gint height);
static void switch_workspace (const GList **actors, gint from, gint to, static void switch_workspace (const GList **actors, gint from, gint to,
MetaMotionDirection direction); MetaMotionDirection direction);
static void kill_effect (MutterWindow *actor, gulong event); static void kill_effect (MutterWindow *actor, gulong event);
static gboolean xevent_filter (XEvent *xev); static gboolean xevent_filter (XEvent *xev);
static gboolean reload (const char *params); static gboolean reload (const char *params);
/* /*
@ -154,15 +151,28 @@ struct ActorPrivate
/* /*
* Actor private data accessor * Actor private data accessor
*/ */
static void
free_actor_private (gpointer data)
{
if (G_LIKELY (data != NULL))
g_slice_free (ActorPrivate, data);
}
static ActorPrivate * static ActorPrivate *
get_actor_private (MutterWindow *actor) get_actor_private (MutterWindow *actor)
{ {
ActorPrivate * priv = g_object_get_data (G_OBJECT (actor), ACTOR_DATA_KEY); ActorPrivate *priv = g_object_get_qdata (G_OBJECT (actor), actor_data_quark);
if (!priv) if (G_UNLIKELY (actor_data_quark == 0))
actor_data_quark = g_quark_from_static_string (ACTOR_DATA_KEY);
if (G_UNLIKELY (!priv))
{ {
priv = g_new0 (ActorPrivate, 1); priv = g_slice_new0 (ActorPrivate);
g_object_set_data_full (G_OBJECT (actor), ACTOR_DATA_KEY, priv, g_free);
g_object_set_qdata_full (G_OBJECT (actor),
actor_data_quark, priv,
free_actor_private);
} }
return priv; return priv;
@ -373,8 +383,7 @@ minimize (MutterWindow *mcw)
NULL); NULL);
} }
else else
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_MINIMIZE);
MUTTER_PLUGIN_MINIMIZE);
} }
/* /*
@ -401,8 +410,7 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data)
plugin->running--; plugin->running--;
/* Now notify the manager that we are done with this effect */ /* Now notify the manager that we are done with this effect */
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_MAXIMIZE);
MUTTER_PLUGIN_MAXIMIZE);
} }
/* /*
@ -465,8 +473,7 @@ maximize (MutterWindow *mcw,
return; return;
} }
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_MAXIMIZE);
MUTTER_PLUGIN_MAXIMIZE);
} }
/* /*
@ -491,8 +498,7 @@ unmaximize (MutterWindow *mcw,
} }
/* Do this conditionally, if the effect requires completion callback. */ /* Do this conditionally, if the effect requires completion callback. */
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_UNMAXIMIZE);
MUTTER_PLUGIN_UNMAXIMIZE);
} }
static void static void
@ -514,8 +520,7 @@ on_map_effect_complete (ClutterActor *actor, gpointer data)
plugin->running--; plugin->running--;
/* Now notify the manager that we are done with this effect */ /* Now notify the manager that we are done with this effect */
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_MAP);
MUTTER_PLUGIN_MAP);
} }
/* /*
@ -556,8 +561,7 @@ map (MutterWindow *mcw)
} }
else else
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_MAP);
MUTTER_PLUGIN_MAP);
} }
/* /*
@ -576,8 +580,7 @@ on_destroy_effect_complete (ClutterActor *actor, gpointer data)
plugin->running--; plugin->running--;
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_DESTROY);
MUTTER_PLUGIN_DESTROY);
} }
/* /*
@ -611,8 +614,7 @@ destroy (MutterWindow *mcw)
NULL); NULL);
} }
else else
mutter_plugin_effect_completed (plugin, mcw, mutter_plugin_effect_completed (plugin, mcw, MUTTER_PLUGIN_DESTROY);
MUTTER_PLUGIN_DESTROY);
} }
static void static void
@ -633,8 +635,7 @@ on_panel_effect_complete (ClutterActor *panel, gpointer data)
else else
{ {
priv->panel_back_in_progress = FALSE; priv->panel_back_in_progress = FALSE;
mutter_plugin_set_stage_input_area (plugin, 0, 0, mutter_plugin_set_stage_input_area (plugin, 0, 0, screen_width, 1);
screen_width, 1);
} }
} }