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

quicklist-view.c

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

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/*
 * 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 Gordon Allott <gord.allott@canonical.com>,
 *             Mirco "MacSlow" Müller <mirco.mueller@canonical.com>
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <float.h>
#include <math.h>
#include <clutk/clutk.h>
#include <clutter/clutter.h>
#include <cairo.h>
#include <unity.h>
#include <string.h>
#include <stdlib.h>
#include <gtk/gtk.h>


#define UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR (unity_launcher_quicklist_menu_seperator_get_type ())
#define UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR, UnityLauncherQuicklistMenuSeperator))
#define UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR, UnityLauncherQuicklistMenuSeperatorClass))
#define UNITY_LAUNCHER_IS_QUICKLIST_MENU_SEPERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR))
#define UNITY_LAUNCHER_IS_QUICKLIST_MENU_SEPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR))
#define UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR, UnityLauncherQuicklistMenuSeperatorClass))

typedef struct _UnityLauncherQuicklistMenuSeperator UnityLauncherQuicklistMenuSeperator;
typedef struct _UnityLauncherQuicklistMenuSeperatorClass UnityLauncherQuicklistMenuSeperatorClass;
typedef struct _UnityLauncherQuicklistMenuSeperatorPrivate UnityLauncherQuicklistMenuSeperatorPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))

#define UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM (unity_launcher_quicklist_menu_item_get_type ())
#define UNITY_LAUNCHER_QUICKLIST_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM, UnityLauncherQuicklistMenuItem))
#define UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM, UnityLauncherQuicklistMenuItemClass))
#define UNITY_LAUNCHER_IS_QUICKLIST_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM))
#define UNITY_LAUNCHER_IS_QUICKLIST_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM))
#define UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM, UnityLauncherQuicklistMenuItemClass))

typedef struct _UnityLauncherQuicklistMenuItem UnityLauncherQuicklistMenuItem;
typedef struct _UnityLauncherQuicklistMenuItemClass UnityLauncherQuicklistMenuItemClass;
typedef struct _UnityLauncherQuicklistMenuItemPrivate UnityLauncherQuicklistMenuItemPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define UNITY_LAUNCHER_TYPE_QUICKLIST_MENU (unity_launcher_quicklist_menu_get_type ())
#define UNITY_LAUNCHER_QUICKLIST_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU, UnityLauncherQuicklistMenu))
#define UNITY_LAUNCHER_QUICKLIST_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU, UnityLauncherQuicklistMenuClass))
#define UNITY_LAUNCHER_IS_QUICKLIST_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU))
#define UNITY_LAUNCHER_IS_QUICKLIST_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU))
#define UNITY_LAUNCHER_QUICKLIST_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU, UnityLauncherQuicklistMenuClass))

typedef struct _UnityLauncherQuicklistMenu UnityLauncherQuicklistMenu;
typedef struct _UnityLauncherQuicklistMenuClass UnityLauncherQuicklistMenuClass;
typedef struct _UnityLauncherQuicklistMenuPrivate UnityLauncherQuicklistMenuPrivate;

struct _UnityLauncherQuicklistMenuSeperator {
      CtkMenuSeperator parent_instance;
      UnityLauncherQuicklistMenuSeperatorPrivate * priv;
};

struct _UnityLauncherQuicklistMenuSeperatorClass {
      CtkMenuSeperatorClass parent_class;
};

struct _UnityLauncherQuicklistMenuSeperatorPrivate {
      CtkLayerActor* seperator_background;
      gint old_width;
      gint old_height;
};

struct _UnityLauncherQuicklistMenuItem {
      CtkActor parent_instance;
      UnityLauncherQuicklistMenuItemPrivate * priv;
};

struct _UnityLauncherQuicklistMenuItemClass {
      CtkActorClass parent_class;
};

struct _UnityLauncherQuicklistMenuItemPrivate {
      CtkLayerActor* item_background;
      gint old_width;
      gint old_height;
      char* old_label;
      char* _label;
};

struct _UnityLauncherQuicklistMenu {
      CtkMenu parent_instance;
      UnityLauncherQuicklistMenuPrivate * priv;
};

struct _UnityLauncherQuicklistMenuClass {
      CtkMenuClass parent_class;
};

struct _UnityLauncherQuicklistMenuPrivate {
      CtkLayerActor* ql_background;
      gint old_width;
      gint old_height;
      float cached_x;
      float cached_y;
};


static gpointer unity_launcher_quicklist_menu_seperator_parent_class = NULL;
static gpointer unity_launcher_quicklist_menu_item_parent_class = NULL;
static gpointer unity_launcher_quicklist_menu_parent_class = NULL;

#define UNITY_LAUNCHER_LINE_WIDTH 0.083f
#define UNITY_LAUNCHER_LINE_WIDTH_ABS 1.5f
#define UNITY_LAUNCHER_TEXT_HEIGHT 1.0f
#define UNITY_LAUNCHER_MAX_TEXT_WIDTH 15.0f
#define UNITY_LAUNCHER_GAP 0.25f
#define UNITY_LAUNCHER_MARGIN 0.5f
#define UNITY_LAUNCHER_BORDER 0.25f
#define UNITY_LAUNCHER_CORNER_RADIUS 0.3f
#define UNITY_LAUNCHER_CORNER_RADIUS_ABS 5.0f
#define UNITY_LAUNCHER_SHADOW_SIZE 1.25f
#define UNITY_LAUNCHER_ITEM_HEIGHT 2.0f
#define UNITY_LAUNCHER_ITEM_CORNER_RADIUS 0.3f
#define UNITY_LAUNCHER_ITEM_CORNER_RADIUS_ABS 4.0f
#define UNITY_LAUNCHER_ANCHOR_HEIGHT 1.5f
#define UNITY_LAUNCHER_ANCHOR_HEIGHT_ABS 18.0f
#define UNITY_LAUNCHER_ANCHOR_WIDTH 0.75f
#define UNITY_LAUNCHER_ANCHOR_WIDTH_ABS 10.0f
GType unity_launcher_quicklist_menu_seperator_get_type (void);
#define UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR, UnityLauncherQuicklistMenuSeperatorPrivate))
enum  {
      UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR_DUMMY_PROPERTY
};
static void unity_launcher_quicklist_menu_seperator_real_paint (ClutterActor* base);
static void unity_launcher_quicklist_menu_seperator_real_get_preferred_height (ClutterActor* base, float for_width, float* min_height_p, float* natural_height_p);
static void unity_launcher_quicklist_menu_seperator_real_get_preferred_width (ClutterActor* base, float for_height, float* min_width_p, float* natural_width_p);
static void unity_launcher_quicklist_menu_seperator_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags);
UnityLauncherQuicklistMenuSeperator* unity_launcher_quicklist_menu_seperator_new (void);
UnityLauncherQuicklistMenuSeperator* unity_launcher_quicklist_menu_seperator_construct (GType object_type);
static GObject * unity_launcher_quicklist_menu_seperator_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_launcher_quicklist_menu_seperator_finalize (GObject* obj);
GType unity_launcher_quicklist_menu_item_get_type (void);
#define UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM, UnityLauncherQuicklistMenuItemPrivate))
enum  {
      UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_DUMMY_PROPERTY,
      UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_LABEL
};
static void unity_launcher_quicklist_menu_item_real_paint (ClutterActor* base);
static void unity_launcher_quicklist_menu_item_real_get_preferred_height (ClutterActor* base, float for_width, float* min_height_p, float* natural_height_p);
const char* unity_launcher_quicklist_menu_item_get_label (UnityLauncherQuicklistMenuItem* self);
static void unity_launcher_quicklist_menu_item_real_get_preferred_width (ClutterActor* base, float for_height, float* min_width_p, float* natural_width_p);
static void unity_launcher_quicklist_menu_item_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags);
static gboolean _unity_launcher_quicklist_menu_item_on_enter (UnityLauncherQuicklistMenuItem* self, ClutterEvent* event);
static gboolean _unity_launcher_quicklist_menu_item_on_leave (UnityLauncherQuicklistMenuItem* self, ClutterEvent* event);
static void _unity_launcher_quicklist_menu_item_on_label_changed (UnityLauncherQuicklistMenuItem* self);
static void __unity_launcher_quicklist_menu_item_on_label_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean __unity_launcher_quicklist_menu_item_on_enter_clutter_actor_enter_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
static gboolean __unity_launcher_quicklist_menu_item_on_leave_clutter_actor_leave_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
static gboolean _unity_launcher_quicklist_menu_item_on_mouse_down (UnityLauncherQuicklistMenuItem* self, ClutterEvent* event);
static gboolean __unity_launcher_quicklist_menu_item_on_mouse_down_clutter_actor_button_press_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
UnityLauncherQuicklistMenuItem* unity_launcher_quicklist_menu_item_new (const char* label);
UnityLauncherQuicklistMenuItem* unity_launcher_quicklist_menu_item_construct (GType object_type, const char* label);
static void unity_launcher_quicklist_menu_item_set_label (UnityLauncherQuicklistMenuItem* self, const char* value);
static GObject * unity_launcher_quicklist_menu_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_launcher_quicklist_menu_item_finalize (GObject* obj);
static void unity_launcher_quicklist_menu_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void unity_launcher_quicklist_menu_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType unity_launcher_quicklist_menu_get_type (void);
#define UNITY_LAUNCHER_QUICKLIST_MENU_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_LAUNCHER_TYPE_QUICKLIST_MENU, UnityLauncherQuicklistMenuPrivate))
enum  {
      UNITY_LAUNCHER_QUICKLIST_MENU_DUMMY_PROPERTY
};
static void unity_launcher_quicklist_menu_real_paint (ClutterActor* base);
static void unity_launcher_quicklist_menu_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags);
UnityLauncherQuicklistMenu* unity_launcher_quicklist_menu_new (void);
UnityLauncherQuicklistMenu* unity_launcher_quicklist_menu_construct (GType object_type);
static GObject * unity_launcher_quicklist_menu_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_launcher_quicklist_menu_finalize (GObject* obj);
static int _vala_strcmp0 (const char * str1, const char * str2);



static void unity_launcher_quicklist_menu_seperator_real_paint (ClutterActor* base) {
      UnityLauncherQuicklistMenuSeperator * self;
      self = (UnityLauncherQuicklistMenuSeperator*) base;
      clutter_actor_paint ((ClutterActor*) self->priv->seperator_background);
}


static void unity_launcher_quicklist_menu_seperator_real_get_preferred_height (ClutterActor* base, float for_width, float* min_height_p, float* natural_height_p) {
      UnityLauncherQuicklistMenuSeperator * self;
      self = (UnityLauncherQuicklistMenuSeperator*) base;
      *min_height_p = (float) ctk_em_to_pixel ((double) UNITY_LAUNCHER_GAP);
      *natural_height_p = *min_height_p;
}


static void unity_launcher_quicklist_menu_seperator_real_get_preferred_width (ClutterActor* base, float for_height, float* min_width_p, float* natural_width_p) {
      UnityLauncherQuicklistMenuSeperator * self;
      self = (UnityLauncherQuicklistMenuSeperator*) base;
      *min_width_p = (float) ctk_em_to_pixel ((double) (2 * UNITY_LAUNCHER_MARGIN));
      *natural_width_p = *min_width_p;
}


static void unity_launcher_quicklist_menu_seperator_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags) {
      UnityLauncherQuicklistMenuSeperator * self;
      gint w = 0;
      gint h = 0;
      gboolean _tmp0_ = FALSE;
      CtkLayerActor* _tmp1_;
      CtkLayer* layer;
      cairo_surface_t* fill_surf;
      cairo_surface_t* image_surf;
      cairo_t* fill_cr;
      cairo_t* image_cr;
      self = (UnityLauncherQuicklistMenuSeperator*) base;
      CLUTTER_ACTOR_CLASS (unity_launcher_quicklist_menu_seperator_parent_class)->allocate ((ClutterActor*) CTK_MENU_SEPERATOR (self), box, flags);
      w = (gint) ((*box).x2 - (*box).x1);
      h = (gint) ((*box).y2 - (*box).y1);
      if (self->priv->old_width == w) {
            _tmp0_ = self->priv->old_height == h;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            return;
      }
      if (CTK_IS_LAYER_ACTOR (self->priv->seperator_background)) {
            clutter_actor_destroy ((ClutterActor*) self->priv->seperator_background);
      }
      self->priv->seperator_background = (_tmp1_ = g_object_ref_sink ((CtkLayerActor*) ctk_layer_actor_new ((guint) w, (guint) h)), _g_object_unref0 (self->priv->seperator_background), _tmp1_);
      layer = ctk_layer_new ((guint) w, (guint) h, CTK_LAYER_REPEAT_NONE, CTK_LAYER_REPEAT_NONE);
      fill_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
      image_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
      fill_cr = cairo_create (fill_surf);
      image_cr = cairo_create (image_surf);
      unity_quicklist_rendering_seperator_fill_mask (fill_cr);
      unity_quicklist_rendering_seperator_image_background (image_cr, w, h);
      ctk_layer_set_mask_from_surface (layer, fill_surf);
      ctk_layer_set_image_from_surface (layer, image_surf);
      ctk_layer_set_opacity (layer, (guchar) 255);
      ctk_layer_actor_add_layer (self->priv->seperator_background, layer);
      clutter_actor_set_opacity ((ClutterActor*) self->priv->seperator_background, (guint8) 255);
      clutter_actor_set_parent ((ClutterActor*) self->priv->seperator_background, (ClutterActor*) self);
      clutter_actor_map ((ClutterActor*) self->priv->seperator_background);
      clutter_actor_show ((ClutterActor*) self->priv->seperator_background);
      _g_object_unref0 (layer);
      _cairo_surface_destroy0 (fill_surf);
      _cairo_surface_destroy0 (image_surf);
      _cairo_destroy0 (fill_cr);
      _cairo_destroy0 (image_cr);
}


UnityLauncherQuicklistMenuSeperator* unity_launcher_quicklist_menu_seperator_construct (GType object_type) {
      UnityLauncherQuicklistMenuSeperator * self;
      self = g_object_newv (object_type, 0, NULL);
      return self;
}


UnityLauncherQuicklistMenuSeperator* unity_launcher_quicklist_menu_seperator_new (void) {
      return unity_launcher_quicklist_menu_seperator_construct (UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_SEPERATOR);
}


static GObject * unity_launcher_quicklist_menu_seperator_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityLauncherQuicklistMenuSeperator * self;
      parent_class = G_OBJECT_CLASS (unity_launcher_quicklist_menu_seperator_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR (obj);
      {
            CtkPadding _tmp0_ = {0};
            CtkPadding padding;
            padding = (memset (&_tmp0_, 0, sizeof (CtkPadding)), _tmp0_.left = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp0_.right = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp0_.top = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp0_.bottom = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp0_);
            ctk_actor_set_padding ((CtkActor*) self, &padding);
            self->priv->old_width = 0;
            self->priv->old_height = 0;
      }
      return obj;
}


static void unity_launcher_quicklist_menu_seperator_class_init (UnityLauncherQuicklistMenuSeperatorClass * klass) {
      unity_launcher_quicklist_menu_seperator_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityLauncherQuicklistMenuSeperatorPrivate));
      CLUTTER_ACTOR_CLASS (klass)->paint = unity_launcher_quicklist_menu_seperator_real_paint;
      CLUTTER_ACTOR_CLASS (klass)->get_preferred_height = unity_launcher_quicklist_menu_seperator_real_get_preferred_height;
      CLUTTER_ACTOR_CLASS (klass)->get_preferred_width = unity_launcher_quicklist_menu_seperator_real_get_preferred_width;
      CLUTTER_ACTOR_CLASS (klass)->allocate = unity_launcher_quicklist_menu_seperator_real_allocate;
      G_OBJECT_CLASS (klass)->constructor = unity_launcher_quicklist_menu_seperator_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_launcher_quicklist_menu_seperator_finalize;
}


static void unity_launcher_quicklist_menu_seperator_instance_init (UnityLauncherQuicklistMenuSeperator * self) {
      self->priv = UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR_GET_PRIVATE (self);
}


static void unity_launcher_quicklist_menu_seperator_finalize (GObject* obj) {
      UnityLauncherQuicklistMenuSeperator * self;
      self = UNITY_LAUNCHER_QUICKLIST_MENU_SEPERATOR (obj);
      _g_object_unref0 (self->priv->seperator_background);
      G_OBJECT_CLASS (unity_launcher_quicklist_menu_seperator_parent_class)->finalize (obj);
}


GType unity_launcher_quicklist_menu_seperator_get_type (void) {
      static volatile gsize unity_launcher_quicklist_menu_seperator_type_id__volatile = 0;
      if (g_once_init_enter (&unity_launcher_quicklist_menu_seperator_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityLauncherQuicklistMenuSeperatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_launcher_quicklist_menu_seperator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityLauncherQuicklistMenuSeperator), 0, (GInstanceInitFunc) unity_launcher_quicklist_menu_seperator_instance_init, NULL };
            GType unity_launcher_quicklist_menu_seperator_type_id;
            unity_launcher_quicklist_menu_seperator_type_id = g_type_register_static (CTK_TYPE_MENU_SEPERATOR, "UnityLauncherQuicklistMenuSeperator", &g_define_type_info, 0);
            g_once_init_leave (&unity_launcher_quicklist_menu_seperator_type_id__volatile, unity_launcher_quicklist_menu_seperator_type_id);
      }
      return unity_launcher_quicklist_menu_seperator_type_id__volatile;
}


static void unity_launcher_quicklist_menu_item_real_paint (ClutterActor* base) {
      UnityLauncherQuicklistMenuItem * self;
      self = (UnityLauncherQuicklistMenuItem*) base;
      clutter_actor_paint ((ClutterActor*) self->priv->item_background);
}


static void unity_launcher_quicklist_menu_item_real_get_preferred_height (ClutterActor* base, float for_width, float* min_height_p, float* natural_height_p) {
      UnityLauncherQuicklistMenuItem * self;
      self = (UnityLauncherQuicklistMenuItem*) base;
      *min_height_p = (float) ctk_em_to_pixel ((double) UNITY_LAUNCHER_ITEM_HEIGHT);
      *natural_height_p = *min_height_p;
}


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


static void unity_launcher_quicklist_menu_item_real_get_preferred_width (ClutterActor* base, float for_height, float* min_width_p, float* natural_width_p) {
      UnityLauncherQuicklistMenuItem * self;
      gint width = 0;
      gint height = 0;
      GtkSettings* settings;
      char* _tmp1_;
      char* _tmp0_ = NULL;
      self = (UnityLauncherQuicklistMenuItem*) base;
      settings = _g_object_ref0 (gtk_settings_get_default ());
      unity_quicklist_rendering_item_get_text_extents (_tmp1_ = (g_object_get (settings, "gtk-font-name", &_tmp0_, NULL), _tmp0_), self->priv->_label, &width, &height);
      _g_free0 (_tmp1_);
      *min_width_p = ((float) width) + ((float) ctk_em_to_pixel ((double) (2 * UNITY_LAUNCHER_MARGIN)));
      *natural_width_p = *min_width_p;
      _g_object_unref0 (settings);
}


static void unity_launcher_quicklist_menu_item_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags) {
      UnityLauncherQuicklistMenuItem * self;
      gint w = 0;
      gint h = 0;
      ClutterColor _tmp0_ = {0};
      ClutterColor white_color;
      gboolean _tmp1_ = FALSE;
      CtkLayerActor* _tmp2_;
      CtkLayer* normal_layer;
      CtkLayer* selected_layer;
      cairo_surface_t* normal_surf;
      cairo_surface_t* selected_surf;
      cairo_t* normal_cr;
      cairo_t* selected_cr;
      GtkSettings* settings;
      char* _tmp4_;
      char* _tmp3_ = NULL;
      char* _tmp6_;
      char* _tmp5_ = NULL;
      self = (UnityLauncherQuicklistMenuItem*) base;
      white_color = (memset (&_tmp0_, 0, sizeof (ClutterColor)), _tmp0_.red = (guint8) 255, _tmp0_.green = (guint8) 255, _tmp0_.blue = (guint8) 255, _tmp0_.alpha = (guint8) 255, _tmp0_);
      CLUTTER_ACTOR_CLASS (unity_launcher_quicklist_menu_item_parent_class)->allocate ((ClutterActor*) CTK_ACTOR (self), box, flags);
      w = (gint) ((*box).x2 - (*box).x1);
      h = (gint) ((*box).y2 - (*box).y1);
      if (self->priv->old_width == w) {
            _tmp1_ = self->priv->old_height == h;
      } else {
            _tmp1_ = FALSE;
      }
      if (_tmp1_) {
            return;
      }
      self->priv->old_width = w;
      self->priv->old_height = h;
      if (CTK_IS_LAYER_ACTOR (self->priv->item_background)) {
            clutter_actor_unparent ((ClutterActor*) self->priv->item_background);
      }
      self->priv->item_background = (_tmp2_ = g_object_ref_sink ((CtkLayerActor*) ctk_layer_actor_new ((guint) w, (guint) h)), _g_object_unref0 (self->priv->item_background), _tmp2_);
      normal_layer = ctk_layer_new ((guint) w, (guint) h, CTK_LAYER_REPEAT_NONE, CTK_LAYER_REPEAT_NONE);
      selected_layer = ctk_layer_new ((guint) w, (guint) h, CTK_LAYER_REPEAT_NONE, CTK_LAYER_REPEAT_NONE);
      normal_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
      selected_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
      normal_cr = cairo_create (normal_surf);
      selected_cr = cairo_create (selected_surf);
      settings = _g_object_ref0 (gtk_settings_get_default ());
      unity_quicklist_rendering_item_normal_mask (normal_cr, w, h, _tmp4_ = (g_object_get (settings, "gtk-font-name", &_tmp3_, NULL), _tmp3_), self->priv->_label);
      _g_free0 (_tmp4_);
      unity_quicklist_rendering_item_selected_mask (selected_cr, w, h, _tmp6_ = (g_object_get (settings, "gtk-font-name", &_tmp5_, NULL), _tmp5_), self->priv->_label);
      _g_free0 (_tmp6_);
      ctk_layer_set_mask_from_surface (normal_layer, normal_surf);
      ctk_layer_set_color (normal_layer, &white_color);
      ctk_layer_set_mask_from_surface (selected_layer, selected_surf);
      ctk_layer_set_color (selected_layer, &white_color);
      ctk_layer_actor_add_layer (self->priv->item_background, normal_layer);
      ctk_layer_actor_add_layer (self->priv->item_background, selected_layer);
      ctk_layer_set_enabled (ctk_layer_actor_get_layer (self->priv->item_background, (guint) 0), TRUE);
      ctk_layer_set_enabled (ctk_layer_actor_get_layer (self->priv->item_background, (guint) 1), FALSE);
      clutter_actor_queue_redraw ((ClutterActor*) self->priv->item_background);
      clutter_actor_set_parent ((ClutterActor*) self->priv->item_background, (ClutterActor*) self);
      clutter_actor_map ((ClutterActor*) self->priv->item_background);
      clutter_actor_show ((ClutterActor*) self->priv->item_background);
      _g_object_unref0 (normal_layer);
      _g_object_unref0 (selected_layer);
      _cairo_surface_destroy0 (normal_surf);
      _cairo_surface_destroy0 (selected_surf);
      _cairo_destroy0 (normal_cr);
      _cairo_destroy0 (selected_cr);
      _g_object_unref0 (settings);
}


static gboolean _unity_launcher_quicklist_menu_item_on_enter (UnityLauncherQuicklistMenuItem* self, ClutterEvent* event) {
      gboolean result = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (UNITY_LAUNCHER_IS_QUICKLIST_MENU_ITEM (self), FALSE);
      ctk_layer_set_enabled (ctk_layer_actor_get_layer (self->priv->item_background, (guint) 0), FALSE);
      ctk_layer_set_enabled (ctk_layer_actor_get_layer (self->priv->item_background, (guint) 1), TRUE);
      result = FALSE;
      return result;
}


static gboolean _unity_launcher_quicklist_menu_item_on_leave (UnityLauncherQuicklistMenuItem* self, ClutterEvent* event) {
      gboolean result = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (UNITY_LAUNCHER_IS_QUICKLIST_MENU_ITEM (self), FALSE);
      ctk_layer_set_enabled (ctk_layer_actor_get_layer (self->priv->item_background, (guint) 0), TRUE);
      ctk_layer_set_enabled (ctk_layer_actor_get_layer (self->priv->item_background, (guint) 1), FALSE);
      result = FALSE;
      return result;
}


static void _unity_launcher_quicklist_menu_item_on_label_changed (UnityLauncherQuicklistMenuItem* self) {
      char* _tmp0_;
      g_return_if_fail (self != NULL);
      if (_vala_strcmp0 (self->priv->old_label, self->priv->_label) == 0) {
            return;
      }
      self->priv->old_label = (_tmp0_ = g_strdup (self->priv->_label), _g_free0 (self->priv->old_label), _tmp0_);
}


static void __unity_launcher_quicklist_menu_item_on_label_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      _unity_launcher_quicklist_menu_item_on_label_changed (self);
}


static gboolean __unity_launcher_quicklist_menu_item_on_enter_clutter_actor_enter_event (ClutterActor* _sender, ClutterEvent* event, gpointer self) {
      gboolean result;
      result = _unity_launcher_quicklist_menu_item_on_enter (self, event);
      return result;
}


static gboolean __unity_launcher_quicklist_menu_item_on_leave_clutter_actor_leave_event (ClutterActor* _sender, ClutterEvent* event, gpointer self) {
      gboolean result;
      result = _unity_launcher_quicklist_menu_item_on_leave (self, event);
      return result;
}


static gboolean __unity_launcher_quicklist_menu_item_on_mouse_down_clutter_actor_button_press_event (ClutterActor* _sender, ClutterEvent* event, gpointer self) {
      gboolean result;
      result = _unity_launcher_quicklist_menu_item_on_mouse_down (self, event);
      return result;
}


static gboolean _unity_launcher_quicklist_menu_item_on_mouse_down (UnityLauncherQuicklistMenuItem* self, ClutterEvent* event) {
      gboolean result = FALSE;
      GQuark _tmp1_;
      guint _tmp0_;
      guint _tmp2_;
      guint _tmp3_;
      guint _tmp4_;
      g_return_val_if_fail (self != NULL, FALSE);
      g_signal_parse_name ("notify::label", G_TYPE_OBJECT, &_tmp0_, &_tmp1_, TRUE);
      g_signal_handlers_disconnect_matched ((GObject*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, _tmp1_, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_label_changed_g_object_notify, self);
      g_signal_parse_name ("enter-event", CLUTTER_TYPE_ACTOR, &_tmp2_, NULL, FALSE);
      g_signal_handlers_disconnect_matched ((ClutterActor*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_enter_clutter_actor_enter_event, self);
      g_signal_parse_name ("leave-event", CLUTTER_TYPE_ACTOR, &_tmp3_, NULL, FALSE);
      g_signal_handlers_disconnect_matched ((ClutterActor*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_leave_clutter_actor_leave_event, self);
      g_signal_parse_name ("button-press-event", CLUTTER_TYPE_ACTOR, &_tmp4_, NULL, FALSE);
      g_signal_handlers_disconnect_matched ((ClutterActor*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_mouse_down_clutter_actor_button_press_event, self);
      g_signal_emit_by_name (self, "activated");
      result = TRUE;
      return result;
}


UnityLauncherQuicklistMenuItem* unity_launcher_quicklist_menu_item_construct (GType object_type, const char* label) {
      UnityLauncherQuicklistMenuItem * self;
      g_return_val_if_fail (label != NULL, NULL);
      self = (UnityLauncherQuicklistMenuItem*) g_object_new (object_type, "label", label, NULL);
      return self;
}


UnityLauncherQuicklistMenuItem* unity_launcher_quicklist_menu_item_new (const char* label) {
      return unity_launcher_quicklist_menu_item_construct (UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM, label);
}


const char* unity_launcher_quicklist_menu_item_get_label (UnityLauncherQuicklistMenuItem* self) {
      const char* result;
      g_return_val_if_fail (self != NULL, NULL);
      result = self->priv->_label;
      return result;
}


static void unity_launcher_quicklist_menu_item_set_label (UnityLauncherQuicklistMenuItem* self, const char* value) {
      char* _tmp0_;
      g_return_if_fail (self != NULL);
      self->priv->_label = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_label), _tmp0_);
      g_object_notify ((GObject *) self, "label");
}


static GObject * unity_launcher_quicklist_menu_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityLauncherQuicklistMenuItem * self;
      parent_class = G_OBJECT_CLASS (unity_launcher_quicklist_menu_item_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_LAUNCHER_QUICKLIST_MENU_ITEM (obj);
      {
            CtkPadding _tmp1_ = {0};
            CtkPadding padding;
            char* _tmp2_;
            padding = (memset (&_tmp1_, 0, sizeof (CtkPadding)), _tmp1_.left = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp1_.right = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp1_.top = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp1_.bottom = (float) ((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_MARGIN)), _tmp1_);
            ctk_actor_set_padding ((CtkActor*) self, &padding);
            g_signal_connect_object ((GObject*) self, "notify::label", (GCallback) __unity_launcher_quicklist_menu_item_on_label_changed_g_object_notify, self, 0);
            g_signal_connect_object ((ClutterActor*) self, "enter-event", (GCallback) __unity_launcher_quicklist_menu_item_on_enter_clutter_actor_enter_event, self, 0);
            g_signal_connect_object ((ClutterActor*) self, "leave-event", (GCallback) __unity_launcher_quicklist_menu_item_on_leave_clutter_actor_leave_event, self, 0);
            g_signal_connect_object ((ClutterActor*) self, "button-press-event", (GCallback) __unity_launcher_quicklist_menu_item_on_mouse_down_clutter_actor_button_press_event, self, 0);
            clutter_actor_set_reactive ((ClutterActor*) self, TRUE);
            self->priv->old_width = 0;
            self->priv->old_height = 0;
            self->priv->old_label = (_tmp2_ = g_strdup (""), _g_free0 (self->priv->old_label), _tmp2_);
      }
      return obj;
}


static void unity_launcher_quicklist_menu_item_class_init (UnityLauncherQuicklistMenuItemClass * klass) {
      unity_launcher_quicklist_menu_item_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityLauncherQuicklistMenuItemPrivate));
      CLUTTER_ACTOR_CLASS (klass)->paint = unity_launcher_quicklist_menu_item_real_paint;
      CLUTTER_ACTOR_CLASS (klass)->get_preferred_height = unity_launcher_quicklist_menu_item_real_get_preferred_height;
      CLUTTER_ACTOR_CLASS (klass)->get_preferred_width = unity_launcher_quicklist_menu_item_real_get_preferred_width;
      CLUTTER_ACTOR_CLASS (klass)->allocate = unity_launcher_quicklist_menu_item_real_allocate;
      G_OBJECT_CLASS (klass)->get_property = unity_launcher_quicklist_menu_item_get_property;
      G_OBJECT_CLASS (klass)->set_property = unity_launcher_quicklist_menu_item_set_property;
      G_OBJECT_CLASS (klass)->constructor = unity_launcher_quicklist_menu_item_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_launcher_quicklist_menu_item_finalize;
      g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_LABEL, g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
      g_signal_new ("activated", UNITY_LAUNCHER_TYPE_QUICKLIST_MENU_ITEM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void unity_launcher_quicklist_menu_item_instance_init (UnityLauncherQuicklistMenuItem * self) {
      self->priv = UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_GET_PRIVATE (self);
}


static void unity_launcher_quicklist_menu_item_finalize (GObject* obj) {
      UnityLauncherQuicklistMenuItem * self;
      self = UNITY_LAUNCHER_QUICKLIST_MENU_ITEM (obj);
      {
            GQuark _tmp4_;
            guint _tmp3_;
            guint _tmp5_;
            guint _tmp6_;
            guint _tmp7_;
            g_signal_parse_name ("notify::label", G_TYPE_OBJECT, &_tmp3_, &_tmp4_, TRUE);
            g_signal_handlers_disconnect_matched ((GObject*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, _tmp4_, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_label_changed_g_object_notify, self);
            g_signal_parse_name ("enter-event", CLUTTER_TYPE_ACTOR, &_tmp5_, NULL, FALSE);
            g_signal_handlers_disconnect_matched ((ClutterActor*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_enter_clutter_actor_enter_event, self);
            g_signal_parse_name ("leave-event", CLUTTER_TYPE_ACTOR, &_tmp6_, NULL, FALSE);
            g_signal_handlers_disconnect_matched ((ClutterActor*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_leave_clutter_actor_leave_event, self);
            g_signal_parse_name ("button-press-event", CLUTTER_TYPE_ACTOR, &_tmp7_, NULL, FALSE);
            g_signal_handlers_disconnect_matched ((ClutterActor*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) __unity_launcher_quicklist_menu_item_on_mouse_down_clutter_actor_button_press_event, self);
      }
      _g_object_unref0 (self->priv->item_background);
      _g_free0 (self->priv->old_label);
      _g_free0 (self->priv->_label);
      G_OBJECT_CLASS (unity_launcher_quicklist_menu_item_parent_class)->finalize (obj);
}


GType unity_launcher_quicklist_menu_item_get_type (void) {
      static volatile gsize unity_launcher_quicklist_menu_item_type_id__volatile = 0;
      if (g_once_init_enter (&unity_launcher_quicklist_menu_item_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityLauncherQuicklistMenuItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_launcher_quicklist_menu_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityLauncherQuicklistMenuItem), 0, (GInstanceInitFunc) unity_launcher_quicklist_menu_item_instance_init, NULL };
            GType unity_launcher_quicklist_menu_item_type_id;
            unity_launcher_quicklist_menu_item_type_id = g_type_register_static (CTK_TYPE_ACTOR, "UnityLauncherQuicklistMenuItem", &g_define_type_info, 0);
            g_once_init_leave (&unity_launcher_quicklist_menu_item_type_id__volatile, unity_launcher_quicklist_menu_item_type_id);
      }
      return unity_launcher_quicklist_menu_item_type_id__volatile;
}


static void unity_launcher_quicklist_menu_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
      UnityLauncherQuicklistMenuItem * self;
      self = UNITY_LAUNCHER_QUICKLIST_MENU_ITEM (object);
      switch (property_id) {
            case UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_LABEL:
            g_value_set_string (value, unity_launcher_quicklist_menu_item_get_label (self));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static void unity_launcher_quicklist_menu_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
      UnityLauncherQuicklistMenuItem * self;
      self = UNITY_LAUNCHER_QUICKLIST_MENU_ITEM (object);
      switch (property_id) {
            case UNITY_LAUNCHER_QUICKLIST_MENU_ITEM_LABEL:
            unity_launcher_quicklist_menu_item_set_label (self, g_value_get_string (value));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static void unity_launcher_quicklist_menu_real_paint (ClutterActor* base) {
      UnityLauncherQuicklistMenu * self;
      float x = 0.0F;
      float y = 0.0F;
      self = (UnityLauncherQuicklistMenu*) base;
      ctk_menu_refresh_background_texture (CTK_MENU (self));
      clutter_actor_get_position ((ClutterActor*) self, &x, &y);
      if (self->priv->cached_x == 0.0f) {
            self->priv->cached_x = x;
      }
      if (self->priv->cached_x != x) {
            clutter_actor_set_position ((ClutterActor*) self, self->priv->cached_x, y);
      }
      if (!ctk_layer_actor_is_flattened (self->priv->ql_background)) {
            ctk_layer_actor_flatten (self->priv->ql_background);
      }
      CLUTTER_ACTOR_CLASS (unity_launcher_quicklist_menu_parent_class)->paint ((ClutterActor*) CTK_MENU (self));
}


static void unity_launcher_quicklist_menu_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags) {
      UnityLauncherQuicklistMenu * self;
      gint w = 0;
      gint h = 0;
      guint blurred_id;
      gboolean _tmp0_ = FALSE;
      CtkLayerActor* _tmp1_;
      CtkLayer* main_layer;
      CtkLayer* blurred_layer;
      cairo_surface_t* full_surf;
      cairo_surface_t* fill_surf;
      cairo_surface_t* main_surf;
      cairo_t* full_cr;
      cairo_t* fill_cr;
      cairo_t* main_cr;
      self = (UnityLauncherQuicklistMenu*) base;
      blurred_id = (guint) 0;
      w = (gint) ((*box).x2 - (*box).x1);
      h = (gint) ((*box).y2 - (*box).y1);
      if (self->priv->old_width == w) {
            _tmp0_ = self->priv->old_height == h;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            return;
      }
      CLUTTER_ACTOR_CLASS (unity_launcher_quicklist_menu_parent_class)->allocate ((ClutterActor*) CTK_MENU (self), box, flags);
      if (ctk_menu_get_num_items ((CtkMenu*) self) == 1) {
            self->priv->cached_y = ((float) h) / 2.0f;
      }
      blurred_id = ctk_menu_get_framebuffer_background (CTK_MENU (self));
      self->priv->old_width = w;
      self->priv->old_height = h;
      if (CTK_IS_LAYER_ACTOR (self->priv->ql_background)) {
            clutter_actor_destroy ((ClutterActor*) self->priv->ql_background);
      }
      self->priv->ql_background = (_tmp1_ = g_object_ref_sink ((CtkLayerActor*) ctk_layer_actor_new ((guint) w, (guint) h)), _g_object_unref0 (self->priv->ql_background), _tmp1_);
      main_layer = ctk_layer_new ((guint) w, (guint) h, CTK_LAYER_REPEAT_NONE, CTK_LAYER_REPEAT_NONE);
      blurred_layer = ctk_layer_new ((guint) w, (guint) h, CTK_LAYER_REPEAT_NONE, CTK_LAYER_REPEAT_NONE);
      full_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
      fill_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
      main_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
      full_cr = cairo_create (full_surf);
      fill_cr = cairo_create (fill_surf);
      main_cr = cairo_create (main_surf);
      unity_quicklist_rendering_menu_full_mask (full_cr, w, h, self->priv->cached_y);
      unity_quicklist_rendering_menu_fill_mask (fill_cr, w, h, self->priv->cached_y);
      unity_quicklist_rendering_menu_background (main_cr, w, h, self->priv->cached_y);
      ctk_layer_set_mask_from_surface (main_layer, full_surf);
      ctk_layer_set_image_from_surface (main_layer, main_surf);
      ctk_layer_set_opacity (main_layer, (guchar) 255);
      ctk_layer_set_mask_from_surface (blurred_layer, fill_surf);
      ctk_layer_set_image_from_id (blurred_layer, blurred_id);
      ctk_layer_set_opacity (blurred_layer, (guchar) 255);
      ctk_layer_actor_add_layer (self->priv->ql_background, blurred_layer);
      ctk_layer_actor_add_layer (self->priv->ql_background, main_layer);
      ctk_menu_set_background ((CtkMenu*) self, (ClutterActor*) self->priv->ql_background);
      clutter_actor_set_opacity ((ClutterActor*) self->priv->ql_background, (guint8) 255);
      _g_object_unref0 (main_layer);
      _g_object_unref0 (blurred_layer);
      _cairo_surface_destroy0 (full_surf);
      _cairo_surface_destroy0 (fill_surf);
      _cairo_surface_destroy0 (main_surf);
      _cairo_destroy0 (full_cr);
      _cairo_destroy0 (fill_cr);
      _cairo_destroy0 (main_cr);
}


UnityLauncherQuicklistMenu* unity_launcher_quicklist_menu_construct (GType object_type) {
      UnityLauncherQuicklistMenu * self;
      self = g_object_newv (object_type, 0, NULL);
      return self;
}


UnityLauncherQuicklistMenu* unity_launcher_quicklist_menu_new (void) {
      return unity_launcher_quicklist_menu_construct (UNITY_LAUNCHER_TYPE_QUICKLIST_MENU);
}


static GObject * unity_launcher_quicklist_menu_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityLauncherQuicklistMenu * self;
      parent_class = G_OBJECT_CLASS (unity_launcher_quicklist_menu_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_LAUNCHER_QUICKLIST_MENU (obj);
      {
            CtkPadding _tmp8_ = {0};
            CtkPadding padding;
            padding = (memset (&_tmp8_, 0, sizeof (CtkPadding)), _tmp8_.left = (float) ((gint) (ctk_em_to_pixel ((double) (UNITY_LAUNCHER_BORDER + UNITY_LAUNCHER_SHADOW_SIZE)) + UNITY_LAUNCHER_ANCHOR_WIDTH_ABS)), _tmp8_.right = (float) (((gint) ctk_em_to_pixel ((double) (UNITY_LAUNCHER_BORDER + UNITY_LAUNCHER_SHADOW_SIZE))) - 1), _tmp8_.top = (float) ((gint) ctk_em_to_pixel ((double) (UNITY_LAUNCHER_BORDER + UNITY_LAUNCHER_SHADOW_SIZE))), _tmp8_.bottom = (float) (((gint) ctk_em_to_pixel ((double) UNITY_LAUNCHER_SHADOW_SIZE)) + 1), _tmp8_);
            ctk_actor_set_padding ((CtkActor*) self, &padding);
            self->priv->old_width = 0;
            self->priv->old_height = 0;
            self->priv->cached_x = 0.0f;
            self->priv->cached_y = 0.0f;
      }
      return obj;
}


static void unity_launcher_quicklist_menu_class_init (UnityLauncherQuicklistMenuClass * klass) {
      unity_launcher_quicklist_menu_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityLauncherQuicklistMenuPrivate));
      CLUTTER_ACTOR_CLASS (klass)->paint = unity_launcher_quicklist_menu_real_paint;
      CLUTTER_ACTOR_CLASS (klass)->allocate = unity_launcher_quicklist_menu_real_allocate;
      G_OBJECT_CLASS (klass)->constructor = unity_launcher_quicklist_menu_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_launcher_quicklist_menu_finalize;
}


static void unity_launcher_quicklist_menu_instance_init (UnityLauncherQuicklistMenu * self) {
      self->priv = UNITY_LAUNCHER_QUICKLIST_MENU_GET_PRIVATE (self);
}


static void unity_launcher_quicklist_menu_finalize (GObject* obj) {
      UnityLauncherQuicklistMenu * self;
      self = UNITY_LAUNCHER_QUICKLIST_MENU (obj);
      _g_object_unref0 (self->priv->ql_background);
      G_OBJECT_CLASS (unity_launcher_quicklist_menu_parent_class)->finalize (obj);
}


GType unity_launcher_quicklist_menu_get_type (void) {
      static volatile gsize unity_launcher_quicklist_menu_type_id__volatile = 0;
      if (g_once_init_enter (&unity_launcher_quicklist_menu_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityLauncherQuicklistMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_launcher_quicklist_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityLauncherQuicklistMenu), 0, (GInstanceInitFunc) unity_launcher_quicklist_menu_instance_init, NULL };
            GType unity_launcher_quicklist_menu_type_id;
            unity_launcher_quicklist_menu_type_id = g_type_register_static (CTK_TYPE_MENU, "UnityLauncherQuicklistMenu", &g_define_type_info, 0);
            g_once_init_leave (&unity_launcher_quicklist_menu_type_id__volatile, unity_launcher_quicklist_menu_type_id);
      }
      return unity_launcher_quicklist_menu_type_id__volatile;
}


static int _vala_strcmp0 (const char * str1, const char * str2) {
      if (str1 == NULL) {
            return -(str1 != str2);
      }
      if (str2 == NULL) {
            return str1 != str2;
      }
      return strcmp (str1, str2);
}





Generated by  Doxygen 1.6.0   Back to index