plugin-manager: Make the event an enum

This commit is contained in:
Jasper St. Pierre 2015-07-05 20:58:40 -07:00
parent fd443ecf2a
commit 7de1f3a7be
4 changed files with 25 additions and 24 deletions

View File

@ -149,7 +149,7 @@ meta_plugin_manager_kill_switch_workspace (MetaPluginManager *plugin_mgr)
gboolean
meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr,
MetaWindowActor *actor,
unsigned long event)
MetaPluginEffect event)
{
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
@ -196,7 +196,7 @@ meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr,
}
break;
default:
g_warning ("Incorrect handler called for event %lu", event);
g_warning ("Incorrect handler called for event %d", event);
}
return retval;
@ -214,7 +214,7 @@ meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr,
gboolean
meta_plugin_manager_event_maximize (MetaPluginManager *plugin_mgr,
MetaWindowActor *actor,
unsigned long event,
MetaPluginEffect event,
gint target_x,
gint target_y,
gint target_width,
@ -253,7 +253,7 @@ meta_plugin_manager_event_maximize (MetaPluginManager *plugin_mgr,
}
break;
default:
g_warning ("Incorrect handler called for event %lu", event);
g_warning ("Incorrect handler called for event %d", event);
}
return retval;

View File

@ -26,15 +26,15 @@
#include <meta/screen.h>
#include <meta/meta-plugin.h>
#define META_PLUGIN_MINIMIZE (1<<0)
#define META_PLUGIN_MAXIMIZE (1<<1)
#define META_PLUGIN_UNMAXIMIZE (1<<2)
#define META_PLUGIN_MAP (1<<3)
#define META_PLUGIN_DESTROY (1<<4)
#define META_PLUGIN_SWITCH_WORKSPACE (1<<5)
#define META_PLUGIN_UNMINIMIZE (1<<6)
#define META_PLUGIN_ALL_EFFECTS (~0)
typedef enum {
META_PLUGIN_MINIMIZE,
META_PLUGIN_MAXIMIZE,
META_PLUGIN_UNMAXIMIZE,
META_PLUGIN_MAP,
META_PLUGIN_DESTROY,
META_PLUGIN_SWITCH_WORKSPACE,
META_PLUGIN_UNMINIMIZE,
} MetaPluginEffect;
/**
* MetaPluginManager: (skip)
@ -48,11 +48,11 @@ void meta_plugin_manager_load (const gchar *plugin_name);
gboolean meta_plugin_manager_event_simple (MetaPluginManager *mgr,
MetaWindowActor *actor,
unsigned long event);
MetaPluginEffect event);
gboolean meta_plugin_manager_event_maximize (MetaPluginManager *mgr,
MetaWindowActor *actor,
unsigned long event,
MetaPluginEffect event,
gint target_x,
gint target_y,
gint target_width,

View File

@ -8,6 +8,7 @@
#include <X11/extensions/Xdamage.h>
#include <meta/compositor-mutter.h>
#include "meta-surface-actor.h"
#include "meta-plugin-manager.h"
MetaWindowActor *meta_window_actor_new (MetaWindow *window);
@ -55,8 +56,8 @@ void meta_window_actor_sync_updates_frozen (MetaWindowActor *self);
void meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
gboolean no_delay_frame);
void meta_window_actor_effect_completed (MetaWindowActor *actor,
gulong event);
void meta_window_actor_effect_completed (MetaWindowActor *actor,
MetaPluginEffect event);
MetaSurfaceActor *meta_window_actor_get_surface (MetaWindowActor *self);
void meta_window_actor_update_surface (MetaWindowActor *self);

View File

@ -1043,7 +1043,7 @@ meta_window_actor_effect_in_progress (MetaWindowActor *self)
}
static gboolean
is_freeze_thaw_effect (gulong event)
is_freeze_thaw_effect (MetaPluginEffect event)
{
switch (event)
{
@ -1058,8 +1058,8 @@ is_freeze_thaw_effect (gulong event)
}
static gboolean
start_simple_effect (MetaWindowActor *self,
gulong event)
start_simple_effect (MetaWindowActor *self,
MetaPluginEffect event)
{
MetaWindowActorPrivate *priv = self->priv;
MetaCompositor *compositor = priv->compositor;
@ -1123,8 +1123,8 @@ meta_window_actor_after_effects (MetaWindowActor *self)
}
void
meta_window_actor_effect_completed (MetaWindowActor *self,
gulong event)
meta_window_actor_effect_completed (MetaWindowActor *self,
MetaPluginEffect event)
{
MetaWindowActorPrivate *priv = self->priv;
@ -1300,7 +1300,7 @@ meta_window_actor_show (MetaWindowActor *self,
{
MetaWindowActorPrivate *priv = self->priv;
MetaCompositor *compositor = priv->compositor;
gulong event = 0;
MetaPluginEffect event;
g_return_if_fail (!priv->visible);
@ -1335,7 +1335,7 @@ meta_window_actor_hide (MetaWindowActor *self,
{
MetaWindowActorPrivate *priv = self->priv;
MetaCompositor *compositor = priv->compositor;
gulong event = 0;
MetaPluginEffect event = 0;
g_return_if_fail (priv->visible);