Logo Search packages:      
Sourcecode: unity version File versions  Download package

plugin.c

/* plugin.c generated by valac, the Vala compiler
 * generated from plugin.vala, do not modify */

/*
 * Copyright (C) 2009 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by Neil Jagdish Patel <neil.patel@canonical.com>
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <clutk/clutk.h>
#include <clutter/clutter.h>
#include <float.h>
#include <math.h>
#include <unity.h>
#include <mutter-plugins.h>
#include <unity-private.h>
#include <gee.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib.h>
#include <unity-utils.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/Xregion.h>


#define UNITY_TYPE_DRAG_DEST (unity_drag_dest_get_type ())
#define UNITY_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_DRAG_DEST, UnityDragDest))
#define UNITY_DRAG_DEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_DRAG_DEST, UnityDragDestClass))
#define UNITY_IS_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_DRAG_DEST))
#define UNITY_IS_DRAG_DEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_DRAG_DEST))
#define UNITY_DRAG_DEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_DRAG_DEST, UnityDragDestClass))

typedef struct _UnityDragDest UnityDragDest;
typedef struct _UnityDragDestClass UnityDragDestClass;
typedef struct _UnityDragDestPrivate UnityDragDestPrivate;

#define UNITY_TYPE_INPUT_STATE (unity_input_state_get_type ())

#define UNITY_TYPE_ACTOR_BLUR (unity_actor_blur_get_type ())
#define UNITY_ACTOR_BLUR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_ACTOR_BLUR, UnityActorBlur))
#define UNITY_ACTOR_BLUR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_ACTOR_BLUR, UnityActorBlurClass))
#define UNITY_IS_ACTOR_BLUR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_ACTOR_BLUR))
#define UNITY_IS_ACTOR_BLUR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_ACTOR_BLUR))
#define UNITY_ACTOR_BLUR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_ACTOR_BLUR, UnityActorBlurClass))

typedef struct _UnityActorBlur UnityActorBlur;
typedef struct _UnityActorBlurClass UnityActorBlurClass;
typedef struct _UnityActorBlurPrivate UnityActorBlurPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define UNITY_TYPE_PLUGIN (unity_plugin_get_type ())
#define UNITY_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_PLUGIN, UnityPlugin))
#define UNITY_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_PLUGIN, UnityPluginClass))
#define UNITY_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_PLUGIN))
#define UNITY_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_PLUGIN))
#define UNITY_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_PLUGIN, UnityPluginClass))

typedef struct _UnityPlugin UnityPlugin;
typedef struct _UnityPluginClass UnityPluginClass;
typedef struct _UnityPluginPrivate UnityPluginPrivate;

#define UNITY_TYPE_WINDOW_MANAGEMENT (unity_window_management_get_type ())
#define UNITY_WINDOW_MANAGEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_WINDOW_MANAGEMENT, UnityWindowManagement))
#define UNITY_WINDOW_MANAGEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_WINDOW_MANAGEMENT, UnityWindowManagementClass))
#define UNITY_IS_WINDOW_MANAGEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_WINDOW_MANAGEMENT))
#define UNITY_IS_WINDOW_MANAGEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_WINDOW_MANAGEMENT))
#define UNITY_WINDOW_MANAGEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_WINDOW_MANAGEMENT, UnityWindowManagementClass))

typedef struct _UnityWindowManagement UnityWindowManagement;
typedef struct _UnityWindowManagementClass UnityWindowManagementClass;

#define UNITY_TYPE_MAXIMUS (unity_maximus_get_type ())
#define UNITY_MAXIMUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_MAXIMUS, UnityMaximus))
#define UNITY_MAXIMUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_MAXIMUS, UnityMaximusClass))
#define UNITY_IS_MAXIMUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_MAXIMUS))
#define UNITY_IS_MAXIMUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_MAXIMUS))
#define UNITY_MAXIMUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_MAXIMUS, UnityMaximusClass))

typedef struct _UnityMaximus UnityMaximus;
typedef struct _UnityMaximusClass UnityMaximusClass;

#define UNITY_TYPE_EXPOSE_MANAGER (unity_expose_manager_get_type ())
#define UNITY_EXPOSE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_EXPOSE_MANAGER, UnityExposeManager))
#define UNITY_EXPOSE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_EXPOSE_MANAGER, UnityExposeManagerClass))
#define UNITY_IS_EXPOSE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_EXPOSE_MANAGER))
#define UNITY_IS_EXPOSE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_EXPOSE_MANAGER))
#define UNITY_EXPOSE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_EXPOSE_MANAGER, UnityExposeManagerClass))

typedef struct _UnityExposeManager UnityExposeManager;
typedef struct _UnityExposeManagerClass UnityExposeManagerClass;
#define _dbus_g_connection_unref0(var) ((var == NULL) ? NULL : (var = (dbus_g_connection_unref (var), NULL)))
#define __g_slist_free_g_object_unref0(var) ((var == NULL) ? NULL : (var = (_g_slist_free_g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _UnityDragDest {
      GtkWindow parent_instance;
      UnityDragDestPrivate * priv;
};

struct _UnityDragDestClass {
      GtkWindowClass parent_class;
};

typedef enum  {
      UNITY_INPUT_STATE_NONE,
      UNITY_INPUT_STATE_FULLSCREEN,
      UNITY_INPUT_STATE_UNITY,
      UNITY_INPUT_STATE_ZERO
} UnityInputState;

struct _UnityActorBlur {
      CtkBin parent_instance;
      UnityActorBlurPrivate * priv;
};

struct _UnityActorBlurClass {
      CtkBinClass parent_class;
};

struct _UnityActorBlurPrivate {
      ClutterClone* clone;
};

struct _UnityPlugin {
      GObject parent_instance;
      UnityPluginPrivate * priv;
};

struct _UnityPluginClass {
      GObjectClass parent_class;
};

struct _UnityPluginPrivate {
      MutterPlugin* _plugin;
      ClutterStage* stage;
      UnityApplication* app;
      UnityWindowManagement* wm;
      UnityMaximus* maximus;
      UnityExposeManager* expose_manager;
      UnityLauncherLauncher* launcher;
      UnityPlacesController* places_controller;
      UnityPlacesView* places;
      UnityPanelView* panel;
      UnityActorBlur* actor_blur;
      ClutterRectangle* dark_box;
      MetaWindow* focus_window;
      MetaDisplay* display;
      gboolean places_enabled;
      UnityDragDest* drag_dest;
      gboolean places_showing;
      gboolean _fullscreen_obstruction;
      UnityInputState last_input_state;
      GeeArrayList* fullscreen_requests;
      gboolean grab_enabled;
      DBusGConnection* screensaver_conn;
      DBusGProxy* screensaver;
};


extern char* boot_logging_filename;
char* boot_logging_filename = NULL;
static gpointer unity_drag_dest_parent_class = NULL;
static gpointer unity_actor_blur_parent_class = NULL;
static gpointer unity_plugin_parent_class = NULL;
static UnityShellIface* unity_plugin_unity_shell_parent_iface = NULL;

GType unity_drag_dest_get_type (void);
enum  {
      UNITY_DRAG_DEST_DUMMY_PROPERTY
};
UnityDragDest* unity_drag_dest_new (void);
UnityDragDest* unity_drag_dest_construct (GType object_type);
static GObject * unity_drag_dest_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
GType unity_input_state_get_type (void);
GType unity_actor_blur_get_type (void);
#define UNITY_ACTOR_BLUR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_ACTOR_BLUR, UnityActorBlurPrivate))
enum  {
      UNITY_ACTOR_BLUR_DUMMY_PROPERTY
};
UnityActorBlur* unity_actor_blur_new (ClutterActor* actor);
UnityActorBlur* unity_actor_blur_construct (GType object_type, ClutterActor* actor);
static GObject * unity_actor_blur_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_actor_blur_finalize (GObject* obj);
GType unity_plugin_get_type (void);
GType unity_window_management_get_type (void);
GType unity_maximus_get_type (void);
GType unity_expose_manager_get_type (void);
#define UNITY_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_PLUGIN, UnityPluginPrivate))
enum  {
      UNITY_PLUGIN_DUMMY_PROPERTY,
      UNITY_PLUGIN_PLUGIN,
      UNITY_PLUGIN_MENUS_SWALLOW_EVENTS,
      UNITY_PLUGIN_EXPOSE_SHOWING
};
#define UNITY_PLUGIN_PANEL_HEIGHT 24
#define UNITY_PLUGIN_QUICKLAUNCHER_WIDTH 58
UnityWindowManagement* unity_window_management_new (UnityPlugin* p);
UnityWindowManagement* unity_window_management_construct (GType object_type, UnityPlugin* p);
UnityMaximus* unity_maximus_new (void);
UnityMaximus* unity_maximus_construct (GType object_type);
MutterPlugin* unity_plugin_get_plugin (UnityPlugin* self);
static void _lambda0_ (ClutterActor* a, UnityPlugin* self);
static void __lambda0__clutter_container_actor_added (ClutterContainer* _sender, ClutterActor* actor, gpointer self);
static void _lambda1_ (ClutterActor* a, UnityPlugin* self);
static void __lambda1__clutter_container_actor_removed (ClutterContainer* _sender, ClutterActor* actor, gpointer self);
static gboolean unity_plugin_envvar_is_enabled (UnityPlugin* self, const char* name);
UnityExposeManager* unity_expose_manager_new (UnityPlugin* plugin, UnityLauncherLauncher* launcher);
UnityExposeManager* unity_expose_manager_construct (GType object_type, UnityPlugin* plugin, UnityLauncherLauncher* launcher);
void unity_expose_manager_set_hovered_opacity (UnityExposeManager* self, guint8 value);
void unity_expose_manager_set_unhovered_opacity (UnityExposeManager* self, guint8 value);
void unity_expose_manager_set_darken (UnityExposeManager* self, guint8 value);
void unity_expose_manager_set_right_buffer (UnityExposeManager* self, gint value);
void unity_expose_manager_set_bottom_buffer (UnityExposeManager* self, gint value);
gint unity_expose_manager_get_bottom_buffer (UnityExposeManager* self);
void unity_expose_manager_set_top_buffer (UnityExposeManager* self, gint value);
void unity_expose_manager_set_coverflow (UnityExposeManager* self, gboolean value);
static void unity_plugin_relayout (UnityPlugin* self);
static void _unity_plugin_relayout_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean _lambda2_ (UnityPlugin* self);
static gboolean __lambda2__gsource_func (gpointer self);
static gboolean unity_plugin_real_construct (UnityPlugin* self);
static void unity_plugin_check_fullscreen_obstruction (UnityPlugin* self);
static void unity_plugin_on_focus_window_fullscreen_changed (UnityPlugin* self);
static void _unity_plugin_on_focus_window_fullscreen_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void unity_plugin_on_focus_window_changed (UnityPlugin* self);
static void unity_plugin_set_fullscreen_obstruction (UnityPlugin* self, gboolean value);
static void unity_plugin_got_screensaver_changed (UnityPlugin* self, DBusGProxy* screensaver, gboolean changed);
static void unity_plugin_real_add_fullscreen_request (UnityShell* base, GObject* o);
static gboolean unity_plugin_real_remove_fullscreen_request (UnityShell* base, GObject* o);
static gboolean unity_plugin_get_fullscreen_obstruction (UnityPlugin* self);
static void unity_plugin_real_ensure_input_region (UnityShell* base);
gboolean unity_expose_manager_get_expose_showing (UnityExposeManager* self);
void unity_plugin_dexpose_windows (UnityPlugin* self);
void unity_plugin_expose_windows (UnityPlugin* self, GSList* windows, gint left_buffer);
static void _g_slist_free_g_object_unref (GSList* self);
static void unity_plugin_real_show_window_picker (UnityShell* base);
static ClutterStage* unity_plugin_real_get_stage (UnityShell* base);
static void unity_plugin_real_close_xids (UnityShell* base, GArray* xids);
static void unity_plugin_real_expose_xids (UnityShell* base, GArray* xids);
static void unity_plugin_real_stop_expose (UnityShell* base);
static void unity_plugin_real_show_window (UnityShell* base, guint32 xid);
static UnityShellMode unity_plugin_real_get_mode (UnityShell* base);
static gint unity_plugin_real_get_indicators_width (UnityShell* base);
void unity_expose_manager_set_left_buffer (UnityExposeManager* self, gint value);
void unity_expose_manager_start_expose (UnityExposeManager* self, GSList* windows);
void unity_expose_manager_end_expose (UnityExposeManager* self);
static void unity_plugin_real_show_unity (UnityShell* base);
static void unity_plugin_real_grab_keyboard (UnityShell* base, gboolean grab, guint32 timestamp);
void unity_plugin_minimize (UnityPlugin* self, MutterWindow* window);
void unity_plugin_maximize (UnityPlugin* self, MutterWindow* window, gint x, gint y, gint width, gint height);
void unity_plugin_unmaximize (UnityPlugin* self, MutterWindow* window, gint x, gint y, gint width, gint height);
gboolean unity_maximus_process_window (UnityMaximus* self, MutterWindow* window);
static void _unity_plugin_on_focus_window_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
void unity_plugin_map (UnityPlugin* self, MutterWindow* window);
void unity_plugin_destroy (UnityPlugin* self, MutterWindow* window);
void unity_plugin_switch_workspace (UnityPlugin* self, GList* windows, gint from, gint to, gint direction);
void unity_plugin_kill_effect (UnityPlugin* self, MutterWindow* window, gulong events);
gint unity_plugin_get_panel_height (UnityPlugin* self);
gint unity_plugin_get_launcher_width (UnityPlugin* self);
static gint unity_plugin_real_get_panel_height_foobar (UnityShell* base);
static gint unity_plugin_real_get_launcher_width_foobar (UnityShell* base);
UnityPlugin* unity_plugin_new (void);
UnityPlugin* unity_plugin_construct (GType object_type);
static gboolean _unity_plugin_real_construct_gsource_func (gpointer self);
void unity_plugin_set_plugin (UnityPlugin* self, MutterPlugin* value);
gboolean unity_plugin_get_expose_showing (UnityPlugin* self);
static void _unity_plugin_got_screensaver_changed_dynamic_ActiveChanged0_ (DBusGProxy* _sender, gboolean changed, gpointer self);
void _dynamic_ActiveChanged1_connect (gpointer obj, const char * signal_name, GCallback handler, gpointer data);
static GObject * unity_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_plugin_finalize (GObject* obj);
static void unity_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void unity_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_INT_INT_INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_ULONG (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_POINTER_INT_INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);

UnityDragDest* unity_drag_dest_construct (GType object_type) {
      UnityDragDest * self;
      self = (UnityDragDest*) g_object_new (object_type, "type", GTK_WINDOW_TOPLEVEL, "type-hint", GDK_WINDOW_TYPE_HINT_DOCK, "opacity", 0.0, NULL);
      return self;
}


UnityDragDest* unity_drag_dest_new (void) {
      return unity_drag_dest_construct (UNITY_TYPE_DRAG_DEST);
}


static GObject * unity_drag_dest_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityDragDest * self;
      parent_class = G_OBJECT_CLASS (unity_drag_dest_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_DRAG_DEST (obj);
      {
            ;
      }
      return obj;
}


static void unity_drag_dest_class_init (UnityDragDestClass * klass) {
      unity_drag_dest_parent_class = g_type_class_peek_parent (klass);
      G_OBJECT_CLASS (klass)->constructor = unity_drag_dest_constructor;
}


static void unity_drag_dest_instance_init (UnityDragDest * self) {
}


GType unity_drag_dest_get_type (void) {
      static volatile gsize unity_drag_dest_type_id__volatile = 0;
      if (g_once_init_enter (&unity_drag_dest_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityDragDestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_drag_dest_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityDragDest), 0, (GInstanceInitFunc) unity_drag_dest_instance_init, NULL };
            GType unity_drag_dest_type_id;
            unity_drag_dest_type_id = g_type_register_static (GTK_TYPE_WINDOW, "UnityDragDest", &g_define_type_info, 0);
            g_once_init_leave (&unity_drag_dest_type_id__volatile, unity_drag_dest_type_id);
      }
      return unity_drag_dest_type_id__volatile;
}


GType unity_input_state_get_type (void) {
      static volatile gsize unity_input_state_type_id__volatile = 0;
      if (g_once_init_enter (&unity_input_state_type_id__volatile)) {
            static const GEnumValue values[] = {{UNITY_INPUT_STATE_NONE, "UNITY_INPUT_STATE_NONE", "none"}, {UNITY_INPUT_STATE_FULLSCREEN, "UNITY_INPUT_STATE_FULLSCREEN", "fullscreen"}, {UNITY_INPUT_STATE_UNITY, "UNITY_INPUT_STATE_UNITY", "unity"}, {UNITY_INPUT_STATE_ZERO, "UNITY_INPUT_STATE_ZERO", "zero"}, {0, NULL, NULL}};
            GType unity_input_state_type_id;
            unity_input_state_type_id = g_enum_register_static ("UnityInputState", values);
            g_once_init_leave (&unity_input_state_type_id__volatile, unity_input_state_type_id);
      }
      return unity_input_state_type_id__volatile;
}


UnityActorBlur* unity_actor_blur_construct (GType object_type, ClutterActor* actor) {
      UnityActorBlur * self;
      ClutterClone* _tmp0_;
      g_return_val_if_fail (actor != NULL, NULL);
      self = g_object_newv (object_type, 0, NULL);
      self->priv->clone = (_tmp0_ = g_object_ref_sink ((ClutterClone*) clutter_clone_new (actor)), _g_object_unref0 (self->priv->clone), _tmp0_);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->clone);
      clutter_actor_show ((ClutterActor*) self->priv->clone);
      clutter_actor_set_position ((ClutterActor*) self->priv->clone, (float) 0, (float) 0);
      return self;
}


UnityActorBlur* unity_actor_blur_new (ClutterActor* actor) {
      return unity_actor_blur_construct (UNITY_TYPE_ACTOR_BLUR, actor);
}


static GObject * unity_actor_blur_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityActorBlur * self;
      parent_class = G_OBJECT_CLASS (unity_actor_blur_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_ACTOR_BLUR (obj);
      {
      }
      return obj;
}


static void unity_actor_blur_class_init (UnityActorBlurClass * klass) {
      unity_actor_blur_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityActorBlurPrivate));
      G_OBJECT_CLASS (klass)->constructor = unity_actor_blur_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_actor_blur_finalize;
}


static void unity_actor_blur_instance_init (UnityActorBlur * self) {
      self->priv = UNITY_ACTOR_BLUR_GET_PRIVATE (self);
}


static void unity_actor_blur_finalize (GObject* obj) {
      UnityActorBlur * self;
      self = UNITY_ACTOR_BLUR (obj);
      _g_object_unref0 (self->priv->clone);
      G_OBJECT_CLASS (unity_actor_blur_parent_class)->finalize (obj);
}


GType unity_actor_blur_get_type (void) {
      static volatile gsize unity_actor_blur_type_id__volatile = 0;
      if (g_once_init_enter (&unity_actor_blur_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityActorBlurClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_actor_blur_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityActorBlur), 0, (GInstanceInitFunc) unity_actor_blur_instance_init, NULL };
            GType unity_actor_blur_type_id;
            unity_actor_blur_type_id = g_type_register_static (CTK_TYPE_BIN, "UnityActorBlur", &g_define_type_info, 0);
            g_once_init_leave (&unity_actor_blur_type_id__volatile, unity_actor_blur_type_id);
      }
      return unity_actor_blur_type_id__volatile;
}


static gpointer _g_object_ref0 (gpointer self) {
      return self ? g_object_ref (self) : NULL;
}


static void _lambda0_ (ClutterActor* a, UnityPlugin* self) {
      g_return_if_fail (a != NULL);
      unity_shell_ensure_input_region ((UnityShell*) self);
}


static void __lambda0__clutter_container_actor_added (ClutterContainer* _sender, ClutterActor* actor, gpointer self) {
      _lambda0_ (actor, self);
}


static void _lambda1_ (ClutterActor* a, UnityPlugin* self) {
      g_return_if_fail (a != NULL);
      unity_shell_ensure_input_region ((UnityShell*) self);
}


static void __lambda1__clutter_container_actor_removed (ClutterContainer* _sender, ClutterActor* actor, gpointer self) {
      _lambda1_ (actor, self);
}


static void _unity_plugin_relayout_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      unity_plugin_relayout (self);
}


static gboolean _lambda2_ (UnityPlugin* self) {
      gboolean result = FALSE;
      unity_timeline_logger_write_log (unity_timeline_logger_get_default (), boot_logging_filename);
      result = FALSE;
      return result;
}


static gboolean __lambda2__gsource_func (gpointer self) {
      gboolean result;
      result = _lambda2_ (self);
      return result;
}


static gboolean unity_plugin_real_construct (UnityPlugin* self) {
      gboolean result = FALSE;
      UnityWindowManagement* _tmp0_;
      UnityMaximus* _tmp1_;
      GeeArrayList* _tmp2_;
      ClutterStage* _tmp3_;
      UnityDragDest* _tmp4_;
      GtkTargetEntry* _tmp12_;
      gint _target_list_size_;
      gint target_list_length1;
      GtkTargetEntry* _tmp11_ = NULL;
      GtkTargetEntry _tmp5_ = {0};
      GtkTargetEntry _tmp6_ = {0};
      GtkTargetEntry _tmp7_ = {0};
      GtkTargetEntry _tmp8_ = {0};
      GtkTargetEntry _tmp9_ = {0};
      GtkTargetEntry _tmp10_ = {0};
      GtkTargetEntry* target_list;
      ClutterGroup* window_group;
      UnityLauncherLauncher* _tmp13_;
      ClutterActor* _tmp14_;
      UnityExposeManager* _tmp15_;
      ClutterActor* _tmp16_;
      ClutterActor* _tmp17_;
      ClutterActor* _tmp18_;
      UnityPanelView* _tmp22_;
      ClutterActor* _tmp23_;
      g_return_val_if_fail (self != NULL, FALSE);
      START_FUNCTION ();
      self->priv->wm = (_tmp0_ = unity_window_management_new (self), _g_object_unref0 (self->priv->wm), _tmp0_);
      self->priv->maximus = (_tmp1_ = unity_maximus_new (), _g_object_unref0 (self->priv->maximus), _tmp1_);
      self->priv->fullscreen_requests = (_tmp2_ = gee_array_list_new (G_TYPE_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL), _g_object_unref0 (self->priv->fullscreen_requests), _tmp2_);
      self->priv->stage = (_tmp3_ = _g_object_ref0 (CLUTTER_STAGE (mutter_plugin_get_stage (unity_plugin_get_plugin (self)))), _g_object_unref0 (self->priv->stage), _tmp3_);
      g_signal_connect_object ((ClutterContainer*) self->priv->stage, "actor-added", (GCallback) __lambda0__clutter_container_actor_added, self, 0);
      g_signal_connect_object ((ClutterContainer*) self->priv->stage, "actor-removed", (GCallback) __lambda1__clutter_container_actor_removed, self, 0);
      self->priv->drag_dest = (_tmp4_ = g_object_ref_sink (unity_drag_dest_new ()), _g_object_unref0 (self->priv->drag_dest), _tmp4_);
      gtk_widget_show ((GtkWidget*) self->priv->drag_dest);
      target_list = (_tmp12_ = (_tmp11_ = g_new0 (GtkTargetEntry, 6), _tmp11_[0] = (memset (&_tmp5_, 0, sizeof (GtkTargetEntry)), _tmp5_.target = "STRING", _tmp5_.flags = (guint) 0, _tmp5_.info = (guint) UNITY_DND_TARGETS_TARGET_STRING, _tmp5_), _tmp11_[1] = (memset (&_tmp6_, 0, sizeof (GtkTargetEntry)), _tmp6_.target = "text/plain", _tmp6_.flags = (guint) 0, _tmp6_.info = (guint) UNITY_DND_TARGETS_TARGET_STRING, _tmp6_), _tmp11_[2] = (memset (&_tmp7_, 0, sizeof (GtkTargetEntry)), _tmp7_.target = "text/uri-list", _tmp7_.flags = (guint) 0, _tmp7_.info = (guint) UNITY_DND_TARGETS_TARGET_URL, _tmp7_), _tmp11_[3] = (memset (&_tmp8_, 0, sizeof (GtkTargetEntry)), _tmp8_.target = "x-url/http", _tmp8_.flags = (guint) 0, _tmp8_.info = (guint) UNITY_DND_TARGETS_TARGET_URL, _tmp8_), _tmp11_[4] = (memset (&_tmp9_, 0, sizeof (GtkTargetEntry)), _tmp9_.target = "x-url/ftp", _tmp9_.flags = (guint) 0, _tmp9_.info = (guint) UNITY_DND_TARGETS_TARGET_URL, _tmp9_), _tmp11_[5] = (memset (&_tmp10_, 0, sizeof (GtkTargetEntry)), _tmp10_.target = "_NETSCAPE_URL", _tmp10_.flags = (guint) 0, _tmp10_.info = (guint) UNITY_DND_TARGETS_TARGET_URL, _tmp10_), _tmp11_), target_list_length1 = 6, _target_list_size_ = target_list_length1, _tmp12_);
      ctk_dnd_init (GTK_WIDGET (self->priv->drag_dest), target_list, target_list_length1);
      self->priv->places_enabled = unity_plugin_envvar_is_enabled (self, "UNITY_ENABLE_PLACES");
      window_group = _g_object_ref0 (CLUTTER_GROUP (mutter_plugin_get_window_group (unity_plugin_get_plugin (self))));
      self->priv->launcher = (_tmp13_ = unity_launcher_launcher_new ((UnityShell*) self), _g_object_unref0 (self->priv->launcher), _tmp13_);
      clutter_actor_set_opacity (_tmp14_ = unity_launcher_launcher_get_view (self->priv->launcher), (guint8) 0);
      _g_object_unref0 (_tmp14_);
      self->priv->expose_manager = (_tmp15_ = unity_expose_manager_new (self, self->priv->launcher), _g_object_unref0 (self->priv->expose_manager), _tmp15_);
      unity_expose_manager_set_hovered_opacity (self->priv->expose_manager, (guint8) 255);
      unity_expose_manager_set_unhovered_opacity (self->priv->expose_manager, (guint8) 255);
      unity_expose_manager_set_darken (self->priv->expose_manager, (guint8) 25);
      unity_expose_manager_set_right_buffer (self->priv->expose_manager, 10);
      unity_expose_manager_set_top_buffer (self->priv->expose_manager, (unity_expose_manager_set_bottom_buffer (self->priv->expose_manager, 20), unity_expose_manager_get_bottom_buffer (self->priv->expose_manager)));
      unity_expose_manager_set_coverflow (self->priv->expose_manager, FALSE);
      clutter_container_add_actor ((ClutterContainer*) window_group, _tmp16_ = unity_launcher_launcher_get_view (self->priv->launcher));
      _g_object_unref0 (_tmp16_);
      clutter_container_raise_child ((ClutterContainer*) window_group, _tmp17_ = unity_launcher_launcher_get_view (self->priv->launcher), mutter_plugin_get_normal_window_group (unity_plugin_get_plugin (self)));
      _g_object_unref0 (_tmp17_);
      clutter_actor_animate (_tmp18_ = unity_launcher_launcher_get_view (self->priv->launcher), (gulong) CLUTTER_EASE_IN_SINE, (guint) 400, "opacity", 255, NULL);
      _g_object_unref0 (_tmp18_);
      if (self->priv->places_enabled) {
            UnityPlacesController* _tmp19_;
            UnityPlacesView* _tmp20_;
            ClutterActor* _tmp21_;
            self->priv->places_controller = (_tmp19_ = unity_places_controller_new ((UnityShell*) self), _g_object_unref0 (self->priv->places_controller), _tmp19_);
            self->priv->places = (_tmp20_ = unity_places_controller_get_view (self->priv->places_controller), _g_object_unref0 (self->priv->places), _tmp20_);
            clutter_container_add_actor ((ClutterContainer*) window_group, (ClutterActor*) self->priv->places);
            clutter_container_raise_child ((ClutterContainer*) window_group, (ClutterActor*) self->priv->places, _tmp21_ = unity_launcher_launcher_get_view (self->priv->launcher));
            _g_object_unref0 (_tmp21_);
            clutter_actor_set_opacity ((ClutterActor*) self->priv->places, (guint8) 0);
            clutter_actor_set_reactive ((ClutterActor*) self->priv->places, FALSE);
            clutter_actor_hide ((ClutterActor*) self->priv->places);
            self->priv->places_showing = FALSE;
      }
      self->priv->panel = (_tmp22_ = g_object_ref_sink (unity_panel_view_new ((UnityShell*) self)), _g_object_unref0 (self->priv->panel), _tmp22_);
      clutter_container_add_actor ((ClutterContainer*) window_group, (ClutterActor*) self->priv->panel);
      clutter_container_raise_child ((ClutterContainer*) window_group, (ClutterActor*) self->priv->panel, _tmp23_ = unity_launcher_launcher_get_view (self->priv->launcher));
      _g_object_unref0 (_tmp23_);
      clutter_actor_show ((ClutterActor*) self->priv->panel);
      g_signal_connect_object ((GObject*) self->priv->stage, "notify::width", (GCallback) _unity_plugin_relayout_g_object_notify, self, 0);
      g_signal_connect_object ((GObject*) self->priv->stage, "notify::height", (GCallback) _unity_plugin_relayout_g_object_notify, self, 0);
      unity_plugin_relayout (self);
      END_FUNCTION ();
      if (boot_logging_filename != NULL) {
            g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, __lambda2__gsource_func, g_object_ref (self), g_object_unref);
      }
      unity_shell_ensure_input_region ((UnityShell*) self);
      result = FALSE;
      target_list = (g_free (target_list), NULL);
      _g_object_unref0 (window_group);
      return result;
}


static void _unity_plugin_on_focus_window_fullscreen_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      unity_plugin_on_focus_window_fullscreen_changed (self);
}


static void unity_plugin_on_focus_window_changed (UnityPlugin* self) {
      g_return_if_fail (self != NULL);
      unity_plugin_check_fullscreen_obstruction (self);
      if (self->priv->focus_window != NULL) {
            GQuark _tmp1_;
            guint _tmp0_;
            g_signal_parse_name ("notify::fullscreen", G_TYPE_OBJECT, &_tmp0_, &_tmp1_, TRUE);
            g_signal_handlers_disconnect_matched ((GObject*) self->priv->focus_window, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, _tmp1_, NULL, (GCallback) _unity_plugin_on_focus_window_fullscreen_changed_g_object_notify, self);
      }
      g_object_get ((GObject*) self->priv->display, "focus-window", &self->priv->focus_window, NULL);
      g_signal_connect_object ((GObject*) self->priv->focus_window, "notify::fullscreen", (GCallback) _unity_plugin_on_focus_window_fullscreen_changed_g_object_notify, self, 0);
}


static void unity_plugin_on_focus_window_fullscreen_changed (UnityPlugin* self) {
      g_return_if_fail (self != NULL);
      g_warning ("plugin.vala:306: FOCUS WINDOW FULLSCREEN CHANGED");
      unity_plugin_check_fullscreen_obstruction (self);
}


static void unity_plugin_got_screensaver_changed (UnityPlugin* self, DBusGProxy* screensaver, gboolean changed) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (screensaver != NULL);
      if (changed) {
            ClutterActor* _tmp0_;
            UnityLauncherQuicklistController* menu;
            clutter_actor_hide (_tmp0_ = unity_launcher_launcher_get_view (self->priv->launcher));
            _g_object_unref0 (_tmp0_);
            clutter_actor_hide ((ClutterActor*) self->priv->panel);
            menu = _g_object_ref0 (unity_launcher_quicklist_controller_get_default ());
            if (unity_launcher_quicklist_controller_menu_is_open (menu)) {
                  unity_launcher_quicklist_controller_close_menu (menu);
            }
            unity_plugin_set_fullscreen_obstruction (self, TRUE);
            _g_object_unref0 (menu);
      } else {
            ClutterActor* _tmp1_;
            clutter_actor_show (_tmp1_ = unity_launcher_launcher_get_view (self->priv->launcher));
            _g_object_unref0 (_tmp1_);
            clutter_actor_show ((ClutterActor*) self->priv->panel);
            unity_plugin_set_fullscreen_obstruction (self, FALSE);
      }
}


static void unity_plugin_check_fullscreen_obstruction (UnityPlugin* self) {
      MutterWindow* focus;
      gboolean fullscreen;
      gboolean _tmp0_ = FALSE;
      GList* mutter_windows;
      MetaWindow* _tmp3_;
      g_return_if_fail (self != NULL);
      focus = NULL;
      fullscreen = FALSE;
      if (!UNITY_LAUNCHER_IS_LAUNCHER (self->priv->launcher)) {
            _tmp0_ = TRUE;
      } else {
            _tmp0_ = !CLUTTER_IS_ACTOR (self->priv->panel);
      }
      if (_tmp0_) {
            _g_object_unref0 (focus);
            return;
      }
      mutter_windows = mutter_plugin_get_windows (unity_plugin_get_plugin (self));
      {
            GList* w_collection;
            GList* w_it;
            w_collection = mutter_windows;
            for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
                  MutterWindow* w;
                  w = _g_object_ref0 ((MutterWindow*) w_it->data);
                  {
                        MetaWindow* meta;
                        gboolean _tmp1_ = FALSE;
                        meta = mutter_window_get_meta_window (w);
                        if (meta != NULL) {
                              _tmp1_ = meta_window_has_focus (mutter_window_get_meta_window (w));
                        } else {
                              _tmp1_ = FALSE;
                        }
                        if (_tmp1_) {
                              MutterWindow* _tmp2_;
                              focus = (_tmp2_ = _g_object_ref0 (w), _g_object_unref0 (focus), _tmp2_);
                              _g_object_unref0 (w);
                              break;
                        }
                        _g_object_unref0 (w);
                  }
            }
      }
      if (focus == NULL) {
            _g_object_unref0 (focus);
            return;
      }
      g_object_get ((_tmp3_ = mutter_window_get_meta_window (focus), G_IS_OBJECT (_tmp3_) ? ((GObject*) _tmp3_) : NULL), "fullscreen", &fullscreen, NULL);
      if (fullscreen) {
            ClutterActor* _tmp4_;
            clutter_actor_animate (_tmp4_ = unity_launcher_launcher_get_view (self->priv->launcher), (gulong) CLUTTER_EASE_IN_SINE, (guint) 200, "x", -100.f, NULL);
            _g_object_unref0 (_tmp4_);
            clutter_actor_animate ((ClutterActor*) self->priv->panel, (gulong) CLUTTER_EASE_IN_SINE, (guint) 200, "opacity", 0, NULL);
            unity_plugin_set_fullscreen_obstruction (self, TRUE);
      } else {
            ClutterActor* _tmp5_;
            clutter_actor_animate (_tmp5_ = unity_launcher_launcher_get_view (self->priv->launcher), (gulong) CLUTTER_EASE_IN_SINE, (guint) 200, "x", 0.f, NULL);
            _g_object_unref0 (_tmp5_);
            clutter_actor_animate ((ClutterActor*) self->priv->panel, (gulong) CLUTTER_EASE_IN_SINE, (guint) 200, "opacity", 255, NULL);
            unity_plugin_set_fullscreen_obstruction (self, FALSE);
      }
      _g_object_unref0 (focus);
}


static void unity_plugin_relayout (UnityPlugin* self) {
      float width = 0.0F;
      float height = 0.0F;
      ClutterActor* _tmp0_;
      ClutterActor* _tmp1_;
      ClutterActor* _tmp2_;
      g_return_if_fail (self != NULL);
      START_FUNCTION ();
      clutter_actor_get_size ((ClutterActor*) self->priv->stage, &width, &height);
      gtk_window_resize ((GtkWindow*) self->priv->drag_dest, UNITY_PLUGIN_QUICKLAUNCHER_WIDTH, ((gint) height) - UNITY_PLUGIN_PANEL_HEIGHT);
      gtk_window_move ((GtkWindow*) self->priv->drag_dest, 0, UNITY_PLUGIN_PANEL_HEIGHT);
      clutter_actor_set_size (_tmp0_ = unity_launcher_launcher_get_view (self->priv->launcher), (float) UNITY_PLUGIN_QUICKLAUNCHER_WIDTH, height - UNITY_PLUGIN_PANEL_HEIGHT);
      _g_object_unref0 (_tmp0_);
      clutter_actor_set_position (_tmp1_ = unity_launcher_launcher_get_view (self->priv->launcher), (float) 0, (float) UNITY_PLUGIN_PANEL_HEIGHT);
      _g_object_unref0 (_tmp1_);
      clutter_actor_set_clip (_tmp2_ = unity_launcher_launcher_get_view (self->priv->launcher), (float) 0, (float) 0, (float) UNITY_PLUGIN_QUICKLAUNCHER_WIDTH, height - UNITY_PLUGIN_PANEL_HEIGHT);
      _g_object_unref0 (_tmp2_);
      utils_set_strut (GTK_WINDOW (self->priv->drag_dest), (guint32) (UNITY_PLUGIN_QUICKLAUNCHER_WIDTH - 1), (guint32) 0, (guint32) height, (guint32) UNITY_PLUGIN_PANEL_HEIGHT, (guint32) 0, (guint32) width);
      if (self->priv->places_enabled) {
            clutter_actor_set_size ((ClutterActor*) self->priv->places, width, height);
            clutter_actor_set_position ((ClutterActor*) self->priv->places, (float) 0, (float) 0);
      }
      clutter_actor_set_size ((ClutterActor*) self->priv->panel, width, (float) 24);
      clutter_actor_set_position ((ClutterActor*) self->priv->panel, (float) 0, (float) 0);
      END_FUNCTION ();
}


static void unity_plugin_real_add_fullscreen_request (UnityShell* base, GObject* o) {
      UnityPlugin * self;
      self = (UnityPlugin*) base;
      g_return_if_fail (o != NULL);
      gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->fullscreen_requests, o);
      unity_shell_ensure_input_region ((UnityShell*) self);
}


static gboolean unity_plugin_real_remove_fullscreen_request (UnityShell* base, GObject* o) {
      UnityPlugin * self;
      gboolean result = FALSE;
      gboolean _result_;
      self = (UnityPlugin*) base;
      g_return_val_if_fail (o != NULL, FALSE);
      _result_ = gee_abstract_collection_remove ((GeeAbstractCollection*) self->priv->fullscreen_requests, o);
      unity_shell_ensure_input_region ((UnityShell*) self);
      result = _result_;
      return result;
}


static void unity_plugin_real_ensure_input_region (UnityShell* base) {
      UnityPlugin * self;
      self = (UnityPlugin*) base;
      if (unity_plugin_get_fullscreen_obstruction (self)) {
            if (self->priv->last_input_state == UNITY_INPUT_STATE_ZERO) {
                  return;
            }
            self->priv->last_input_state = UNITY_INPUT_STATE_ZERO;
            mutter_plugin_set_stage_input_area (unity_plugin_get_plugin (self), 0, 0, 0, 0);
            unity_shell_grab_keyboard ((UnityShell*) self, FALSE, clutter_get_current_event_time ());
      } else {
            gboolean _tmp0_ = FALSE;
            if (gee_collection_get_size ((GeeCollection*) self->priv->fullscreen_requests) > 0) {
                  _tmp0_ = TRUE;
            } else {
                  _tmp0_ = self->priv->places_showing;
            }
            if (_tmp0_) {
                  gpointer _tmp1_;
                  if (self->priv->last_input_state == UNITY_INPUT_STATE_FULLSCREEN) {
                        return;
                  }
                  self->priv->last_input_state = UNITY_INPUT_STATE_FULLSCREEN;
                  g_signal_emit_by_name (self, "restore-input-region", TRUE);
                  clutter_stage_set_key_focus (self->priv->stage, (_tmp1_ = NULL, CLUTTER_IS_ACTOR (_tmp1_) ? ((ClutterActor*) _tmp1_) : NULL));
                  unity_shell_grab_keyboard ((UnityShell*) self, TRUE, clutter_get_current_event_time ());
            } else {
                  if (self->priv->last_input_state == UNITY_INPUT_STATE_UNITY) {
                        return;
                  }
                  self->priv->last_input_state = UNITY_INPUT_STATE_UNITY;
                  g_signal_emit_by_name (self, "restore-input-region", FALSE);
                  unity_shell_grab_keyboard ((UnityShell*) self, FALSE, clutter_get_current_event_time ());
            }
      }
}


static void _g_slist_free_g_object_unref (GSList* self) {
      g_slist_foreach (self, (GFunc) g_object_unref, NULL);
      g_slist_free (self);
}


static void unity_plugin_real_show_window_picker (UnityShell* base) {
      UnityPlugin * self;
      GSList* windows;
      GList* mutter_windows;
      self = (UnityPlugin*) base;
      if (self->priv->places_enabled == TRUE) {
            unity_shell_show_unity ((UnityShell*) self);
            return;
      }
      if (unity_expose_manager_get_expose_showing (self->priv->expose_manager) == TRUE) {
            unity_plugin_dexpose_windows (self);
            return;
      }
      windows = NULL;
      mutter_windows = mutter_plugin_get_windows (unity_plugin_get_plugin (self));
      {
            GList* window_collection;
            GList* window_it;
            window_collection = mutter_windows;
            for (window_it = window_collection; window_it != NULL; window_it = window_it->next) {
                  MutterWindow* window;
                  window = _g_object_ref0 ((MutterWindow*) window_it->data);
                  {
                        MutterWindow* _tmp0_;
                        windows = g_slist_append (windows, _g_object_ref0 ((_tmp0_ = window, CLUTTER_IS_ACTOR (_tmp0_) ? ((ClutterActor*) _tmp0_) : NULL)));
                        _g_object_unref0 (window);
                  }
            }
      }
      unity_plugin_expose_windows (self, windows, 80);
      __g_slist_free_g_object_unref0 (windows);
}


static ClutterStage* unity_plugin_real_get_stage (UnityShell* base) {
      UnityPlugin * self;
      ClutterStage* result = NULL;
      self = (UnityPlugin*) base;
      result = _g_object_ref0 (self->priv->stage);
      return result;
}


static void unity_plugin_real_close_xids (UnityShell* base, GArray* xids) {
      UnityPlugin * self;
      self = (UnityPlugin*) base;
      g_return_if_fail (xids != NULL);
      {
            gint i;
            i = 0;
            {
                  gboolean _tmp0_;
                  _tmp0_ = TRUE;
                  while (TRUE) {
                        guint32 xid;
                        GList* mutter_windows;
                        if (!_tmp0_) {
                              i++;
                        }
                        _tmp0_ = FALSE;
                        if (!(i < xids->len)) {
                              break;
                        }
                        xid = g_array_index (xids, guint32, (guint) i);
                        mutter_windows = mutter_plugin_get_windows (unity_plugin_get_plugin (self));
                        {
                              GList* window_collection;
                              GList* window_it;
                              window_collection = mutter_windows;
                              for (window_it = window_collection; window_it != NULL; window_it = window_it->next) {
                                    MutterWindow* window;
                                    window = _g_object_ref0 ((MutterWindow*) window_it->data);
                                    {
                                          guint32 wxid;
                                          wxid = (guint32) meta_window_get_xwindow (mutter_window_get_meta_window (window));
                                          if (wxid == xid) {
                                                meta_window_delete (mutter_window_get_meta_window (window), clutter_get_current_event_time ());
                                          }
                                          _g_object_unref0 (window);
                                    }
                              }
                        }
                  }
            }
      }
}


static void unity_plugin_real_expose_xids (UnityShell* base, GArray* xids) {
      UnityPlugin * self;
      GSList* windows;
      self = (UnityPlugin*) base;
      g_return_if_fail (xids != NULL);
      windows = NULL;
      {
            gint i;
            i = 0;
            {
                  gboolean _tmp0_;
                  _tmp0_ = TRUE;
                  while (TRUE) {
                        guint32 xid;
                        GList* mutter_windows;
                        if (!_tmp0_) {
                              i++;
                        }
                        _tmp0_ = FALSE;
                        if (!(i < xids->len)) {
                              break;
                        }
                        xid = g_array_index (xids, guint32, (guint) i);
                        mutter_windows = mutter_plugin_get_windows (unity_plugin_get_plugin (self));
                        {
                              GList* w_collection;
                              GList* w_it;
                              w_collection = mutter_windows;
                              for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
                                    MutterWindow* w;
                                    w = _g_object_ref0 ((MutterWindow*) w_it->data);
                                    {
                                          guint32 wxid;
                                          wxid = (guint32) meta_window_get_xwindow (mutter_window_get_meta_window (w));
                                          if (wxid == xid) {
                                                windows = g_slist_append (windows, _g_object_ref0 ((ClutterActor*) w));
                                                _g_object_unref0 (w);
                                                break;
                                          }
                                          _g_object_unref0 (w);
                                    }
                              }
                        }
                  }
            }
      }
      unity_plugin_expose_windows (self, windows, 250);
      __g_slist_free_g_object_unref0 (windows);
}


static void unity_plugin_real_stop_expose (UnityShell* base) {
      UnityPlugin * self;
      self = (UnityPlugin*) base;
      unity_plugin_dexpose_windows (self);
}


static void unity_plugin_real_show_window (UnityShell* base, guint32 xid) {
      UnityPlugin * self;
      GList* mutter_windows;
      self = (UnityPlugin*) base;
      mutter_windows = mutter_plugin_get_windows (unity_plugin_get_plugin (self));
      {
            GList* mutter_window_collection;
            GList* mutter_window_it;
            mutter_window_collection = mutter_windows;
            for (mutter_window_it = mutter_window_collection; mutter_window_it != NULL; mutter_window_it = mutter_window_it->next) {
                  MutterWindow* mutter_window;
                  mutter_window = _g_object_ref0 ((MutterWindow*) mutter_window_it->data);
                  {
                        gulong window_xid;
                        gint type;
                        gboolean _tmp0_ = FALSE;
                        gboolean _tmp1_ = FALSE;
                        guint32 time_ = 0U;
                        MetaWindow* meta;
                        window_xid = (gulong) meta_window_get_xwindow (mutter_window_get_meta_window (mutter_window));
                        if (window_xid != xid) {
                              _g_object_unref0 (mutter_window);
                              continue;
                        }
                        type = (gint) mutter_window_get_window_type (mutter_window);
                        if (type != META_WINDOW_NORMAL) {
                              _tmp1_ = type != META_WINDOW_DIALOG;
                        } else {
                              _tmp1_ = FALSE;
                        }
                        if (_tmp1_) {
                              _tmp0_ = type != META_WINDOW_MODAL_DIALOG;
                        } else {
                              _tmp0_ = FALSE;
                        }
                        if (_tmp0_) {
                              _g_object_unref0 (mutter_window);
                              continue;
                        }
                        meta = mutter_window_get_meta_window (mutter_window);
                        time_ = meta_display_get_current_time (meta_window_get_display (meta));
                        meta_workspace_activate (meta_window_get_workspace (meta), time_);
                        meta_window_activate (meta, time_);
                        _g_object_unref0 (mutter_window);
                  }
            }
      }
}


static UnityShellMode unity_plugin_real_get_mode (UnityShell* base) {
      UnityPlugin * self;
      UnityShellMode result = 0;
      self = (UnityPlugin*) base;
      result = UNITY_SHELL_MODE_UNDERLAY;
      return result;
}


static gint unity_plugin_real_get_indicators_width (UnityShell* base) {
      UnityPlugin * self;
      gint result = 0;
      self = (UnityPlugin*) base;
      result = unity_panel_view_get_indicators_width (self->priv->panel);
      return result;
}


void unity_plugin_expose_windows (UnityPlugin* self, GSList* windows, gint left_buffer) {
      g_return_if_fail (self != NULL);
      unity_expose_manager_set_left_buffer (self->priv->expose_manager, left_buffer);
      unity_expose_manager_start_expose (self->priv->expose_manager, windows);
}


void unity_plugin_dexpose_windows (UnityPlugin* self) {
      g_return_if_fail (self != NULL);
      unity_expose_manager_end_expose (self->priv->expose_manager);
}


static void unity_plugin_real_show_unity (UnityShell* base) {
      UnityPlugin * self;
      self = (UnityPlugin*) base;
      if (self->priv->places_enabled == FALSE) {
            unity_shell_show_window_picker ((UnityShell*) self);
            return;
      }
      if (self->priv->places_showing) {
            self->priv->places_showing = FALSE;
            clutter_actor_hide ((ClutterActor*) self->priv->places);
            clutter_actor_set_opacity ((ClutterActor*) self->priv->places, (guint8) 0);
            clutter_actor_set_reactive ((ClutterActor*) self->priv->places, FALSE);
            clutter_actor_destroy ((ClutterActor*) self->priv->actor_blur);
            clutter_actor_destroy ((ClutterActor*) self->priv->dark_box);
            unity_panel_view_set_indicator_mode (self->priv->panel, FALSE);
            unity_shell_ensure_input_region ((UnityShell*) self);
      } else {
            UnityActorBlur* _tmp0_;
            ClutterActor* _tmp1_;
            UnityActorBlur* _tmp2_;
            ClutterRectangle* _tmp5_;
            ClutterColor _tmp4_;
            ClutterColor _tmp3_ = {0};
            ClutterActor* _tmp6_;
            self->priv->places_showing = TRUE;
            clutter_actor_show ((ClutterActor*) self->priv->places);
            clutter_actor_set_opacity ((ClutterActor*) self->priv->places, (guint8) 255);
            clutter_actor_set_reactive ((ClutterActor*) self->priv->places, TRUE);
            self->priv->actor_blur = (_tmp0_ = g_object_ref_sink (unity_actor_blur_new (mutter_plugin_get_normal_window_group (unity_plugin_get_plugin (self)))), _g_object_unref0 (self->priv->actor_blur), _tmp0_);
            clutter_container_add_actor ((_tmp1_ = mutter_plugin_get_window_group (unity_plugin_get_plugin (self)), CLUTTER_IS_CONTAINER (_tmp1_) ? ((ClutterContainer*) _tmp1_) : NULL), (ClutterActor*) self->priv->actor_blur);
            clutter_actor_raise ((_tmp2_ = self->priv->actor_blur, CLUTTER_IS_ACTOR (_tmp2_) ? ((ClutterActor*) _tmp2_) : NULL), mutter_plugin_get_normal_window_group (unity_plugin_get_plugin (self)));
            clutter_actor_set_position ((ClutterActor*) self->priv->actor_blur, (float) 0, (float) 0);
            self->priv->dark_box = (_tmp5_ = g_object_ref_sink ((ClutterRectangle*) clutter_rectangle_new_with_color ((_tmp4_ = (_tmp3_.red = (guint8) 0, _tmp3_.green = (guint8) 0, _tmp3_.blue = (guint8) 0, _tmp3_.alpha = (guint8) 255, _tmp3_), &_tmp4_))), _g_object_unref0 (self->priv->dark_box), _tmp5_);
            clutter_container_add_actor ((_tmp6_ = mutter_plugin_get_window_group (unity_plugin_get_plugin (self)), CLUTTER_IS_CONTAINER (_tmp6_) ? ((ClutterContainer*) _tmp6_) : NULL), (ClutterActor*) self->priv->dark_box);
            clutter_actor_raise ((ClutterActor*) self->priv->dark_box, (ClutterActor*) self->priv->actor_blur);
            clutter_actor_set_position ((ClutterActor*) self->priv->dark_box, (float) 0, (float) 0);
            clutter_actor_set_size ((ClutterActor*) self->priv->dark_box, clutter_actor_get_width ((ClutterActor*) self->priv->stage), clutter_actor_get_height ((ClutterActor*) self->priv->stage));
            clutter_actor_show ((ClutterActor*) self->priv->dark_box);
            clutter_actor_show ((ClutterActor*) self->priv->actor_blur);
            unity_panel_view_set_indicator_mode (self->priv->panel, TRUE);
            unity_shell_ensure_input_region ((UnityShell*) self);
            XFlush (XOpenDisplay (NULL));
            clutter_actor_set_opacity ((ClutterActor*) self->priv->dark_box, (guint8) 0);
            clutter_actor_set_opacity ((ClutterActor*) self->priv->actor_blur, (guint8) 255);
            clutter_actor_animate ((ClutterActor*) self->priv->dark_box, (gulong) CLUTTER_EASE_IN_SINE, (guint) 250, "opacity", 180, NULL);
      }
}


static void unity_plugin_real_grab_keyboard (UnityShell* base, gboolean grab, guint32 timestamp) {
      UnityPlugin * self;
      self = (UnityPlugin*) base;
      if (self->priv->grab_enabled == grab) {
            return;
      }
      if (grab) {
            mutter_plugin_begin_modal (unity_plugin_get_plugin (self), utils_get_stage_window (self->priv->stage), (guint) 0, 0, timestamp);
      } else {
            mutter_plugin_end_modal (unity_plugin_get_plugin (self), timestamp);
      }
      self->priv->grab_enabled = grab;
}


static gboolean unity_plugin_envvar_is_enabled (UnityPlugin* self, const char* name) {
      gboolean result = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (name != NULL, FALSE);
      result = g_getenv (name) != NULL;
      return result;
}


void unity_plugin_minimize (UnityPlugin* self, MutterWindow* window) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      g_signal_emit_by_name (self, "window-minimized", self, window);
}


void unity_plugin_maximize (UnityPlugin* self, MutterWindow* window, gint x, gint y, gint width, gint height) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      g_signal_emit_by_name (self, "window-maximized", self, window, x, y, width, height);
}


void unity_plugin_unmaximize (UnityPlugin* self, MutterWindow* window, gint x, gint y, gint width, gint height) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      g_signal_emit_by_name (self, "window-unmaximized", self, window, x, y, width, height);
}


static void _unity_plugin_on_focus_window_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      unity_plugin_on_focus_window_changed (self);
}


void unity_plugin_map (UnityPlugin* self, MutterWindow* window) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      unity_maximus_process_window (self->priv->maximus, window);
      g_signal_emit_by_name (self, "window-mapped", self, window);
      if (self->priv->display == NULL) {
            self->priv->display = meta_window_get_display (mutter_window_get_meta_window (window));
            g_signal_connect_object ((GObject*) self->priv->display, "notify::focus-window", (GCallback) _unity_plugin_on_focus_window_changed_g_object_notify, self, 0);
      }
}


void unity_plugin_destroy (UnityPlugin* self, MutterWindow* window) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      g_signal_emit_by_name (self, "window-destroyed", self, window);
}


void unity_plugin_switch_workspace (UnityPlugin* self, GList* windows, gint from, gint to, gint direction) {
      g_return_if_fail (self != NULL);
      g_signal_emit_by_name (self, "workspace-switch-event", self, windows, from, to, direction);
}


void unity_plugin_kill_effect (UnityPlugin* self, MutterWindow* window, gulong events) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      g_signal_emit_by_name (self, "window-kill-effect", self, window, events);
}


gint unity_plugin_get_panel_height (UnityPlugin* self) {
      gint result = 0;
      g_return_val_if_fail (self != NULL, 0);
      result = UNITY_PLUGIN_PANEL_HEIGHT;
      return result;
}


gint unity_plugin_get_launcher_width (UnityPlugin* self) {
      gint result = 0;
      g_return_val_if_fail (self != NULL, 0);
      result = UNITY_PLUGIN_QUICKLAUNCHER_WIDTH;
      return result;
}


static gint unity_plugin_real_get_panel_height_foobar (UnityShell* base) {
      UnityPlugin * self;
      gint result = 0;
      self = (UnityPlugin*) base;
      result = unity_plugin_get_panel_height (self);
      return result;
}


static gint unity_plugin_real_get_launcher_width_foobar (UnityShell* base) {
      UnityPlugin * self;
      gint result = 0;
      self = (UnityPlugin*) base;
      result = unity_plugin_get_launcher_width (self);
      return result;
}


UnityPlugin* unity_plugin_construct (GType object_type) {
      UnityPlugin * self;
      self = g_object_newv (object_type, 0, NULL);
      return self;
}


UnityPlugin* unity_plugin_new (void) {
      return unity_plugin_construct (UNITY_TYPE_PLUGIN);
}


MutterPlugin* unity_plugin_get_plugin (UnityPlugin* self) {
      MutterPlugin* result;
      g_return_val_if_fail (self != NULL, NULL);
      result = self->priv->_plugin;
      return result;
}


static gboolean _unity_plugin_real_construct_gsource_func (gpointer self) {
      gboolean result;
      result = unity_plugin_real_construct (self);
      return result;
}


void unity_plugin_set_plugin (UnityPlugin* self, MutterPlugin* value) {
      MutterPlugin* _tmp0_;
      g_return_if_fail (self != NULL);
      self->priv->_plugin = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_plugin), _tmp0_);
      g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _unity_plugin_real_construct_gsource_func, g_object_ref (self), g_object_unref);
      g_object_notify ((GObject *) self, "plugin");
}


static gboolean unity_plugin_real_get_menus_swallow_events (UnityShell* base) {
      gboolean result;
      UnityPlugin* self;
      self = (UnityPlugin*) base;
      result = FALSE;
      return result;
}


gboolean unity_plugin_get_expose_showing (UnityPlugin* self) {
      gboolean result;
      g_return_val_if_fail (self != NULL, FALSE);
      result = unity_expose_manager_get_expose_showing (self->priv->expose_manager);
      return result;
}


static gboolean unity_plugin_get_fullscreen_obstruction (UnityPlugin* self) {
      gboolean result;
      g_return_val_if_fail (self != NULL, FALSE);
      result = self->priv->_fullscreen_obstruction;
      return result;
}


static void unity_plugin_set_fullscreen_obstruction (UnityPlugin* self, gboolean value) {
      g_return_if_fail (self != NULL);
      self->priv->_fullscreen_obstruction = value;
      unity_shell_ensure_input_region ((UnityShell*) self);
}


static void _unity_plugin_got_screensaver_changed_dynamic_ActiveChanged0_ (DBusGProxy* _sender, gboolean changed, gpointer self) {
      unity_plugin_got_screensaver_changed (self, _sender, changed);
}


void _dynamic_ActiveChanged1_connect (gpointer obj, const char * signal_name, GCallback handler, gpointer data) {
      dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, G_TYPE_BOOLEAN, G_TYPE_INVALID);
      dbus_g_proxy_add_signal (obj, "ActiveChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
      dbus_g_proxy_connect_signal (obj, signal_name, handler, data, NULL);
}


static GObject * unity_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityPlugin * self;
      GError * _inner_error_;
      parent_class = G_OBJECT_CLASS (unity_plugin_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_PLUGIN (obj);
      _inner_error_ = NULL;
      {
            UnityShell* _tmp0_;
            char* _tmp1_;
            char** _tmp3_;
            gint _args_size_;
            gint args_length1;
            char** _tmp2_ = NULL;
            char** args;
            UnityApplication* _tmp4_;
            unity_global_shell = (_tmp0_ = _g_object_ref0 ((UnityShell*) self), _g_object_unref0 (unity_global_shell), _tmp0_);
            unity_timeline_logger_get_default ();
            boot_logging_filename = (_tmp1_ = g_strdup (g_getenv ("UNITY_BOOTLOG_FILENAME")), _g_free0 (boot_logging_filename), _tmp1_);
            if (boot_logging_filename != NULL) {
                  unity_is_logging = TRUE;
            } else {
                  unity_is_logging = FALSE;
            }
            START_FUNCTION ();
            args = (_tmp3_ = (_tmp2_ = g_new0 (char*, 1 + 1), _tmp2_[0] = g_strdup ("mutter"), _tmp2_), args_length1 = 1, _args_size_ = args_length1, _tmp3_);
            LOGGER_START_PROCESS ("ctk_init");
            ctk_init_after (&args_length1, &args);
            LOGGER_END_PROCESS ("ctk_init");
            g_object_set (gtk_settings_get_default (), "gtk-icon-theme-name", "ubuntu-mono-dark", NULL);
            LOGGER_START_PROCESS ("unity_application_constructor");
            self->priv->app = (_tmp4_ = unity_application_new (), _g_object_unref0 (self->priv->app), _tmp4_);
            unity_application_set_shell (self->priv->app, (UnityShell*) self);
            LOGGER_END_PROCESS ("unity_application_constructor");
            {
                  DBusGConnection* _tmp5_;
                  DBusGConnection* _tmp6_;
                  DBusGProxy* _tmp7_;
                  _tmp5_ = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_);
                  if (_inner_error_ != NULL) {
                        goto __catch0_g_error;
                  }
                  self->priv->screensaver_conn = (_tmp6_ = _tmp5_, _dbus_g_connection_unref0 (self->priv->screensaver_conn), _tmp6_);
                  self->priv->screensaver = (_tmp7_ = dbus_g_proxy_new_for_name (self->priv->screensaver_conn, "org.gnome.ScreenSaver", "/org/gnome/ScreenSaver", "org.gnome.ScreenSaver"), _g_object_unref0 (self->priv->screensaver), _tmp7_);
                  _dynamic_ActiveChanged1_connect (self->priv->screensaver, "ActiveChanged", (GCallback) _unity_plugin_got_screensaver_changed_dynamic_ActiveChanged0_, self);
            }
            goto __finally0;
            __catch0_g_error:
            {
                  GError * e;
                  e = _inner_error_;
                  _inner_error_ = NULL;
                  {
                        g_warning ("plugin.vala:194: %s", e->message);
                        _g_error_free0 (e);
                  }
            }
            __finally0:
            if (_inner_error_ != NULL) {
                  args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
                  g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                  g_clear_error (&_inner_error_);
            }
            END_FUNCTION ();
            args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
      }
      return obj;
}


static void unity_plugin_class_init (UnityPluginClass * klass) {
      unity_plugin_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityPluginPrivate));
      G_OBJECT_CLASS (klass)->get_property = unity_plugin_get_property;
      G_OBJECT_CLASS (klass)->set_property = unity_plugin_set_property;
      G_OBJECT_CLASS (klass)->constructor = unity_plugin_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_plugin_finalize;
      g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLUGIN_PLUGIN, g_param_spec_object ("plugin", "plugin", "plugin", MUTTER_TYPE_PLUGIN, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
      g_object_class_override_property (G_OBJECT_CLASS (klass), UNITY_PLUGIN_MENUS_SWALLOW_EVENTS, "menus-swallow-events");
      g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PLUGIN_EXPOSE_SHOWING, g_param_spec_boolean ("expose-showing", "expose-showing", "expose-showing", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
      g_signal_new ("window_minimized", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, UNITY_TYPE_PLUGIN, MUTTER_TYPE_WINDOW);
      g_signal_new ("window_maximized", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_INT_INT_INT_INT, G_TYPE_NONE, 6, UNITY_TYPE_PLUGIN, MUTTER_TYPE_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
      g_signal_new ("window_unmaximized", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_INT_INT_INT_INT, G_TYPE_NONE, 6, UNITY_TYPE_PLUGIN, MUTTER_TYPE_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
      g_signal_new ("window_mapped", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, UNITY_TYPE_PLUGIN, MUTTER_TYPE_WINDOW);
      g_signal_new ("window_destroyed", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, UNITY_TYPE_PLUGIN, MUTTER_TYPE_WINDOW);
      g_signal_new ("window_kill_effect", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_ULONG, G_TYPE_NONE, 3, UNITY_TYPE_PLUGIN, MUTTER_TYPE_WINDOW, G_TYPE_ULONG);
      g_signal_new ("workspace_switch_event", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_POINTER_INT_INT_INT, G_TYPE_NONE, 5, UNITY_TYPE_PLUGIN, G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
      g_signal_new ("restore_input_region", UNITY_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}


static void unity_plugin_unity_shell_interface_init (UnityShellIface * iface) {
      unity_plugin_unity_shell_parent_iface = g_type_interface_peek_parent (iface);
      iface->add_fullscreen_request = unity_plugin_real_add_fullscreen_request;
      iface->remove_fullscreen_request = unity_plugin_real_remove_fullscreen_request;
      iface->ensure_input_region = unity_plugin_real_ensure_input_region;
      iface->show_window_picker = unity_plugin_real_show_window_picker;
      iface->get_stage = unity_plugin_real_get_stage;
      iface->close_xids = unity_plugin_real_close_xids;
      iface->expose_xids = unity_plugin_real_expose_xids;
      iface->stop_expose = unity_plugin_real_stop_expose;
      iface->show_window = unity_plugin_real_show_window;
      iface->get_mode = unity_plugin_real_get_mode;
      iface->get_indicators_width = unity_plugin_real_get_indicators_width;
      iface->show_unity = unity_plugin_real_show_unity;
      iface->grab_keyboard = unity_plugin_real_grab_keyboard;
      iface->get_panel_height_foobar = unity_plugin_real_get_panel_height_foobar;
      iface->get_launcher_width_foobar = unity_plugin_real_get_launcher_width_foobar;
      iface->get_menus_swallow_events = unity_plugin_real_get_menus_swallow_events;
}


static void unity_plugin_instance_init (UnityPlugin * self) {
      self->priv = UNITY_PLUGIN_GET_PRIVATE (self);
      self->priv->focus_window = NULL;
      self->priv->display = NULL;
      self->priv->places_enabled = FALSE;
      self->priv->last_input_state = UNITY_INPUT_STATE_NONE;
      self->priv->grab_enabled = FALSE;
}


static void unity_plugin_finalize (GObject* obj) {
      UnityPlugin * self;
      self = UNITY_PLUGIN (obj);
      _g_object_unref0 (self->priv->_plugin);
      _g_object_unref0 (self->priv->stage);
      _g_object_unref0 (self->priv->app);
      _g_object_unref0 (self->priv->wm);
      _g_object_unref0 (self->priv->maximus);
      _g_object_unref0 (self->priv->expose_manager);
      _g_object_unref0 (self->priv->launcher);
      _g_object_unref0 (self->priv->places_controller);
      _g_object_unref0 (self->priv->places);
      _g_object_unref0 (self->priv->panel);
      _g_object_unref0 (self->priv->actor_blur);
      _g_object_unref0 (self->priv->dark_box);
      _g_object_unref0 (self->priv->drag_dest);
      _g_object_unref0 (self->priv->fullscreen_requests);
      _dbus_g_connection_unref0 (self->priv->screensaver_conn);
      _g_object_unref0 (self->priv->screensaver);
      G_OBJECT_CLASS (unity_plugin_parent_class)->finalize (obj);
}


GType unity_plugin_get_type (void) {
      static volatile gsize unity_plugin_type_id__volatile = 0;
      if (g_once_init_enter (&unity_plugin_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPlugin), 0, (GInstanceInitFunc) unity_plugin_instance_init, NULL };
            static const GInterfaceInfo unity_shell_info = { (GInterfaceInitFunc) unity_plugin_unity_shell_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
            GType unity_plugin_type_id;
            unity_plugin_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityPlugin", &g_define_type_info, 0);
            g_type_add_interface_static (unity_plugin_type_id, UNITY_TYPE_SHELL, &unity_shell_info);
            g_once_init_leave (&unity_plugin_type_id__volatile, unity_plugin_type_id);
      }
      return unity_plugin_type_id__volatile;
}


static void unity_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
      UnityPlugin * self;
      self = UNITY_PLUGIN (object);
      switch (property_id) {
            case UNITY_PLUGIN_PLUGIN:
            g_value_set_object (value, unity_plugin_get_plugin (self));
            break;
            case UNITY_PLUGIN_MENUS_SWALLOW_EVENTS:
            g_value_set_boolean (value, unity_shell_get_menus_swallow_events ((UnityShell*) self));
            break;
            case UNITY_PLUGIN_EXPOSE_SHOWING:
            g_value_set_boolean (value, unity_plugin_get_expose_showing (self));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static void unity_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
      UnityPlugin * self;
      self = UNITY_PLUGIN (object);
      switch (property_id) {
            case UNITY_PLUGIN_PLUGIN:
            unity_plugin_set_plugin (self, g_value_get_object (value));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      if ((array != NULL) && (destroy_func != NULL)) {
            int i;
            for (i = 0; i < array_length; i = i + 1) {
                  if (((gpointer*) array)[i] != NULL) {
                        destroy_func (((gpointer*) array)[i]);
                  }
            }
      }
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      _vala_array_destroy (array, array_length, destroy_func);
      g_free (array);
}



static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
      typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
      register GMarshalFunc_VOID__OBJECT_OBJECT callback;
      register GCClosure * cc;
      register gpointer data1, data2;
      cc = (GCClosure *) closure;
      g_return_if_fail (n_param_values == 3);
      if (G_CCLOSURE_SWAP_DATA (closure)) {
            data1 = closure->data;
            data2 = param_values->data[0].v_pointer;
      } else {
            data1 = param_values->data[0].v_pointer;
            data2 = closure->data;
      }
      callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
      callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), data2);
}


static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_INT_INT_INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
      typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_INT_INT_INT_INT) (gpointer data1, gpointer arg_1, gpointer arg_2, gint arg_3, gint arg_4, gint arg_5, gint arg_6, gpointer data2);
      register GMarshalFunc_VOID__OBJECT_OBJECT_INT_INT_INT_INT callback;
      register GCClosure * cc;
      register gpointer data1, data2;
      cc = (GCClosure *) closure;
      g_return_if_fail (n_param_values == 7);
      if (G_CCLOSURE_SWAP_DATA (closure)) {
            data1 = closure->data;
            data2 = param_values->data[0].v_pointer;
      } else {
            data1 = param_values->data[0].v_pointer;
            data2 = closure->data;
      }
      callback = (GMarshalFunc_VOID__OBJECT_OBJECT_INT_INT_INT_INT) (marshal_data ? marshal_data : cc->callback);
      callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), g_value_get_int (param_values + 3), g_value_get_int (param_values + 4), g_value_get_int (param_values + 5), g_value_get_int (param_values + 6), data2);
}


static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_ULONG (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
      typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_ULONG) (gpointer data1, gpointer arg_1, gpointer arg_2, gulong arg_3, gpointer data2);
      register GMarshalFunc_VOID__OBJECT_OBJECT_ULONG callback;
      register GCClosure * cc;
      register gpointer data1, data2;
      cc = (GCClosure *) closure;
      g_return_if_fail (n_param_values == 4);
      if (G_CCLOSURE_SWAP_DATA (closure)) {
            data1 = closure->data;
            data2 = param_values->data[0].v_pointer;
      } else {
            data1 = param_values->data[0].v_pointer;
            data2 = closure->data;
      }
      callback = (GMarshalFunc_VOID__OBJECT_OBJECT_ULONG) (marshal_data ? marshal_data : cc->callback);
      callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), g_value_get_ulong (param_values + 3), data2);
}


static void g_cclosure_user_marshal_VOID__OBJECT_POINTER_INT_INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
      typedef void (*GMarshalFunc_VOID__OBJECT_POINTER_INT_INT_INT) (gpointer data1, gpointer arg_1, gpointer arg_2, gint arg_3, gint arg_4, gint arg_5, gpointer data2);
      register GMarshalFunc_VOID__OBJECT_POINTER_INT_INT_INT callback;
      register GCClosure * cc;
      register gpointer data1, data2;
      cc = (GCClosure *) closure;
      g_return_if_fail (n_param_values == 6);
      if (G_CCLOSURE_SWAP_DATA (closure)) {
            data1 = closure->data;
            data2 = param_values->data[0].v_pointer;
      } else {
            data1 = param_values->data[0].v_pointer;
            data2 = closure->data;
      }
      callback = (GMarshalFunc_VOID__OBJECT_POINTER_INT_INT_INT) (marshal_data ? marshal_data : cc->callback);
      callback (data1, g_value_get_object (param_values + 1), g_value_get_pointer (param_values + 2), g_value_get_int (param_values + 3), g_value_get_int (param_values + 4), g_value_get_int (param_values + 5), data2);
}




Generated by  Doxygen 1.6.0   Back to index