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

file-place.c

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


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <clutk/clutk.h>
#include <clutter/clutter.h>
#include <gee.h>
#include <float.h>
#include <math.h>
#include <gobject/gvaluecollector.h>


#define UNITY_PLACES_FILE_TYPE_FILE_ICON (unity_places_file_file_icon_get_type ())
#define UNITY_PLACES_FILE_FILE_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PLACES_FILE_TYPE_FILE_ICON, UnityPlacesFileFileIcon))
#define UNITY_PLACES_FILE_FILE_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PLACES_FILE_TYPE_FILE_ICON, UnityPlacesFileFileIconClass))
#define UNITY_PLACES_FILE_IS_FILE_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PLACES_FILE_TYPE_FILE_ICON))
#define UNITY_PLACES_FILE_IS_FILE_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PLACES_FILE_TYPE_FILE_ICON))
#define UNITY_PLACES_FILE_FILE_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PLACES_FILE_TYPE_FILE_ICON, UnityPlacesFileFileIconClass))

typedef struct _UnityPlacesFileFileIcon UnityPlacesFileFileIcon;
typedef struct _UnityPlacesFileFileIconClass UnityPlacesFileFileIconClass;
typedef struct _UnityPlacesFileFileIconPrivate UnityPlacesFileFileIconPrivate;

#define UNITY_PLACES_BAR_TYPE_MODEL (unity_places_bar_model_get_type ())
#define UNITY_PLACES_BAR_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PLACES_BAR_TYPE_MODEL, UnityPlacesBarModel))
#define UNITY_PLACES_BAR_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PLACES_BAR_TYPE_MODEL, UnityPlacesBarModelClass))
#define UNITY_PLACES_BAR_IS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PLACES_BAR_TYPE_MODEL))
#define UNITY_PLACES_BAR_IS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PLACES_BAR_TYPE_MODEL))
#define UNITY_PLACES_BAR_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PLACES_BAR_TYPE_MODEL, UnityPlacesBarModelClass))

typedef struct _UnityPlacesBarModel UnityPlacesBarModel;
typedef struct _UnityPlacesBarModelClass UnityPlacesBarModelClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _UnityPlacesFileParamSpecFileIcon UnityPlacesFileParamSpecFileIcon;

#define UNITY_PLACES_FILE_TYPE_FILE_GROUP (unity_places_file_file_group_get_type ())
#define UNITY_PLACES_FILE_FILE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PLACES_FILE_TYPE_FILE_GROUP, UnityPlacesFileFileGroup))
#define UNITY_PLACES_FILE_FILE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PLACES_FILE_TYPE_FILE_GROUP, UnityPlacesFileFileGroupClass))
#define UNITY_PLACES_FILE_IS_FILE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PLACES_FILE_TYPE_FILE_GROUP))
#define UNITY_PLACES_FILE_IS_FILE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PLACES_FILE_TYPE_FILE_GROUP))
#define UNITY_PLACES_FILE_FILE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PLACES_FILE_TYPE_FILE_GROUP, UnityPlacesFileFileGroupClass))

typedef struct _UnityPlacesFileFileGroup UnityPlacesFileFileGroup;
typedef struct _UnityPlacesFileFileGroupClass UnityPlacesFileFileGroupClass;
typedef struct _UnityPlacesFileFileGroupPrivate UnityPlacesFileFileGroupPrivate;

#define UNITY_PLACES_CAIRO_DRAWING_TYPE_PLACES_HSEPARATOR (unity_places_cairo_drawing_places_hseparator_get_type ())
#define UNITY_PLACES_CAIRO_DRAWING_PLACES_HSEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PLACES_CAIRO_DRAWING_TYPE_PLACES_HSEPARATOR, UnityPlacesCairoDrawingPlacesHSeparator))
#define UNITY_PLACES_CAIRO_DRAWING_PLACES_HSEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PLACES_CAIRO_DRAWING_TYPE_PLACES_HSEPARATOR, UnityPlacesCairoDrawingPlacesHSeparatorClass))
#define UNITY_PLACES_CAIRO_DRAWING_IS_PLACES_HSEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PLACES_CAIRO_DRAWING_TYPE_PLACES_HSEPARATOR))
#define UNITY_PLACES_CAIRO_DRAWING_IS_PLACES_HSEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PLACES_CAIRO_DRAWING_TYPE_PLACES_HSEPARATOR))
#define UNITY_PLACES_CAIRO_DRAWING_PLACES_HSEPARATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PLACES_CAIRO_DRAWING_TYPE_PLACES_HSEPARATOR, UnityPlacesCairoDrawingPlacesHSeparatorClass))

typedef struct _UnityPlacesCairoDrawingPlacesHSeparator UnityPlacesCairoDrawingPlacesHSeparator;
typedef struct _UnityPlacesCairoDrawingPlacesHSeparatorClass UnityPlacesCairoDrawingPlacesHSeparatorClass;
#define _unity_places_file_file_icon_unref0(var) ((var == NULL) ? NULL : (var = (unity_places_file_file_icon_unref (var), NULL)))
typedef struct _UnityPlacesCairoDrawingPlacesHSeparatorPrivate UnityPlacesCairoDrawingPlacesHSeparatorPrivate;

#define UNITY_PLACES_FILE_TYPE_FILE_VIEW (unity_places_file_file_view_get_type ())
#define UNITY_PLACES_FILE_FILE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PLACES_FILE_TYPE_FILE_VIEW, UnityPlacesFileFileView))
#define UNITY_PLACES_FILE_FILE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PLACES_FILE_TYPE_FILE_VIEW, UnityPlacesFileFileViewClass))
#define UNITY_PLACES_FILE_IS_FILE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PLACES_FILE_TYPE_FILE_VIEW))
#define UNITY_PLACES_FILE_IS_FILE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PLACES_FILE_TYPE_FILE_VIEW))
#define UNITY_PLACES_FILE_FILE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PLACES_FILE_TYPE_FILE_VIEW, UnityPlacesFileFileViewClass))

typedef struct _UnityPlacesFileFileView UnityPlacesFileFileView;
typedef struct _UnityPlacesFileFileViewClass UnityPlacesFileFileViewClass;
typedef struct _UnityPlacesFileFileViewPrivate UnityPlacesFileFileViewPrivate;

struct _UnityPlacesFileFileIcon {
      GTypeInstance parent_instance;
      volatile int ref_count;
      UnityPlacesFileFileIconPrivate * priv;
      CtkImage* view;
      CtkText* label;
};

struct _UnityPlacesFileFileIconClass {
      GTypeClass parent_class;
      void (*finalize) (UnityPlacesFileFileIcon *self);
};

struct _UnityPlacesFileFileIconPrivate {
      UnityPlacesBarModel* model;
};

struct _UnityPlacesFileParamSpecFileIcon {
      GParamSpec parent_instance;
};

struct _UnityPlacesFileFileGroup {
      CtkBox parent_instance;
      UnityPlacesFileFileGroupPrivate * priv;
};

struct _UnityPlacesFileFileGroupClass {
      CtkBoxClass parent_class;
};

struct _UnityPlacesFileFileGroupPrivate {
      CtkText* GroupName;
      CtkImage* Star;
      UnityPlacesCairoDrawingPlacesHSeparator* Separator;
      CtkImage* maximize_button;
      CtkImage* minimize_button;
      gboolean is_open;
      GeeArrayList* file_icon_array;
};

struct _UnityPlacesCairoDrawingPlacesHSeparator {
      CtkBin parent_instance;
      UnityPlacesCairoDrawingPlacesHSeparatorPrivate * priv;
      gint Width;
      gint Height;
      ClutterCairoTexture* cairotxt;
};

struct _UnityPlacesCairoDrawingPlacesHSeparatorClass {
      CtkBinClass parent_class;
};

struct _UnityPlacesFileFileView {
      CtkBox parent_instance;
      UnityPlacesFileFileViewPrivate * priv;
      UnityPlacesFileFileGroup* recent_file_group;
      UnityPlacesFileFileGroup* favourite_folder_group;
      UnityPlacesFileFileGroup* downloaded_file_group;
};

struct _UnityPlacesFileFileViewClass {
      CtkBoxClass parent_class;
};


static gpointer unity_places_file_file_icon_parent_class = NULL;
static gpointer unity_places_file_file_group_parent_class = NULL;
static gpointer unity_places_file_file_view_parent_class = NULL;

#define UNITY_PLACES_FILE_FILES_FILE PKGDATADIR "/files.png"
#define UNITY_PLACES_FILE_FAVOURITES_ICON PKGDATADIR "/favourites.png"
#define UNITY_PLACES_FILE_MINIMIZE_ICON PKGDATADIR "/minimize_up.png"
#define UNITY_PLACES_FILE_MAXIMIZE_ICON PKGDATADIR "/maximize_up.png"
gpointer unity_places_file_file_icon_ref (gpointer instance);
void unity_places_file_file_icon_unref (gpointer instance);
GParamSpec* unity_places_file_param_spec_file_icon (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void unity_places_file_value_set_file_icon (GValue* value, gpointer v_object);
void unity_places_file_value_take_file_icon (GValue* value, gpointer v_object);
gpointer unity_places_file_value_get_file_icon (const GValue* value);
GType unity_places_file_file_icon_get_type (void);
GType unity_places_bar_model_get_type (void);
#define UNITY_PLACES_FILE_FILE_ICON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_PLACES_FILE_TYPE_FILE_ICON, UnityPlacesFileFileIconPrivate))
enum  {
      UNITY_PLACES_FILE_FILE_ICON_DUMMY_PROPERTY
};
UnityPlacesBarModel* unity_places_bar_model_new (const char* name, const char* icon_name, const char* tooltip);
UnityPlacesBarModel* unity_places_bar_model_construct (GType object_type, const char* name, const char* icon_name, const char* tooltip);
UnityPlacesFileFileIcon* unity_places_file_file_icon_new (gint width, const char* name, const char* icon_name, const char* tooltip);
UnityPlacesFileFileIcon* unity_places_file_file_icon_construct (GType object_type, gint width, const char* name, const char* icon_name, const char* tooltip);
static void unity_places_file_file_icon_finalize (UnityPlacesFileFileIcon* obj);
GType unity_places_file_file_group_get_type (void);
GType unity_places_cairo_drawing_places_hseparator_get_type (void);
#define UNITY_PLACES_FILE_FILE_GROUP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_PLACES_FILE_TYPE_FILE_GROUP, UnityPlacesFileFileGroupPrivate))
enum  {
      UNITY_PLACES_FILE_FILE_GROUP_DUMMY_PROPERTY
};
void unity_places_cairo_drawing_places_hseparator_CreateSeparator (UnityPlacesCairoDrawingPlacesHSeparator* self, gint W, gint H);
static void unity_places_file_file_group_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags);
static void unity_places_file_file_group_real_get_preferred_width (ClutterActor* base, float for_height, float* minimum_width, float* natural_width);
static void unity_places_file_file_group_real_get_preferred_height (ClutterActor* base, float for_width, float* minimum_height, float* natural_height);
UnityPlacesCairoDrawingPlacesHSeparator* unity_places_cairo_drawing_places_hseparator_new (void);
UnityPlacesCairoDrawingPlacesHSeparator* unity_places_cairo_drawing_places_hseparator_construct (GType object_type);
gboolean unity_places_file_file_group_on_maximize (UnityPlacesFileFileGroup* self, ClutterEvent* event);
static gboolean _unity_places_file_file_group_on_maximize_clutter_actor_button_release_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
gboolean unity_places_file_file_group_on_minimize (UnityPlacesFileFileGroup* self, ClutterEvent* event);
static gboolean _unity_places_file_file_group_on_minimize_clutter_actor_button_release_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
UnityPlacesFileFileGroup* unity_places_file_file_group_new (const char* group_name);
UnityPlacesFileFileGroup* unity_places_file_file_group_construct (GType object_type, const char* group_name);
static GObject * unity_places_file_file_group_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_places_file_file_group_finalize (GObject* obj);
GType unity_places_file_file_view_get_type (void);
enum  {
      UNITY_PLACES_FILE_FILE_VIEW_DUMMY_PROPERTY
};
static void unity_places_file_file_view_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags);
UnityPlacesFileFileView* unity_places_file_file_view_new (void);
UnityPlacesFileFileView* unity_places_file_file_view_construct (GType object_type);
static GObject * unity_places_file_file_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_places_file_file_view_finalize (GObject* obj);



UnityPlacesFileFileIcon* unity_places_file_file_icon_construct (GType object_type, gint width, const char* name, const char* icon_name, const char* tooltip) {
      UnityPlacesFileFileIcon* self;
      UnityPlacesBarModel* _tmp0_;
      CtkImage* _tmp1_;
      CtkText* _tmp2_;
      g_return_val_if_fail (name != NULL, NULL);
      g_return_val_if_fail (icon_name != NULL, NULL);
      g_return_val_if_fail (tooltip != NULL, NULL);
      self = (UnityPlacesFileFileIcon*) g_type_create_instance (object_type);
      self->priv->model = (_tmp0_ = unity_places_bar_model_new (name, icon_name, tooltip), _g_object_unref0 (self->priv->model), _tmp0_);
      self->view = (_tmp1_ = g_object_ref_sink ((CtkImage*) ctk_image_new_from_filename ((guint) width, icon_name)), _g_object_unref0 (self->view), _tmp1_);
      clutter_actor_set_reactive ((ClutterActor*) self->view, TRUE);
      self->label = (_tmp2_ = g_object_ref_sink ((CtkText*) ctk_text_new (name)), _g_object_unref0 (self->label), _tmp2_);
      return self;
}


UnityPlacesFileFileIcon* unity_places_file_file_icon_new (gint width, const char* name, const char* icon_name, const char* tooltip) {
      return unity_places_file_file_icon_construct (UNITY_PLACES_FILE_TYPE_FILE_ICON, width, name, icon_name, tooltip);
}


static void unity_places_file_value_file_icon_init (GValue* value) {
      value->data[0].v_pointer = NULL;
}


static void unity_places_file_value_file_icon_free_value (GValue* value) {
      if (value->data[0].v_pointer) {
            unity_places_file_file_icon_unref (value->data[0].v_pointer);
      }
}


static void unity_places_file_value_file_icon_copy_value (const GValue* src_value, GValue* dest_value) {
      if (src_value->data[0].v_pointer) {
            dest_value->data[0].v_pointer = unity_places_file_file_icon_ref (src_value->data[0].v_pointer);
      } else {
            dest_value->data[0].v_pointer = NULL;
      }
}


static gpointer unity_places_file_value_file_icon_peek_pointer (const GValue* value) {
      return value->data[0].v_pointer;
}


static gchar* unity_places_file_value_file_icon_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      if (collect_values[0].v_pointer) {
            UnityPlacesFileFileIcon* object;
            object = collect_values[0].v_pointer;
            if (object->parent_instance.g_class == NULL) {
                  return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
                  return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            }
            value->data[0].v_pointer = unity_places_file_file_icon_ref (object);
      } else {
            value->data[0].v_pointer = NULL;
      }
      return NULL;
}


static gchar* unity_places_file_value_file_icon_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      UnityPlacesFileFileIcon** object_p;
      object_p = collect_values[0].v_pointer;
      if (!object_p) {
            return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
      }
      if (!value->data[0].v_pointer) {
            *object_p = NULL;
      } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
            *object_p = value->data[0].v_pointer;
      } else {
            *object_p = unity_places_file_file_icon_ref (value->data[0].v_pointer);
      }
      return NULL;
}


GParamSpec* unity_places_file_param_spec_file_icon (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
      UnityPlacesFileParamSpecFileIcon* spec;
      g_return_val_if_fail (g_type_is_a (object_type, UNITY_PLACES_FILE_TYPE_FILE_ICON), NULL);
      spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
      G_PARAM_SPEC (spec)->value_type = object_type;
      return G_PARAM_SPEC (spec);
}


gpointer unity_places_file_value_get_file_icon (const GValue* value) {
      g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_PLACES_FILE_TYPE_FILE_ICON), NULL);
      return value->data[0].v_pointer;
}


void unity_places_file_value_set_file_icon (GValue* value, gpointer v_object) {
      UnityPlacesFileFileIcon* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_PLACES_FILE_TYPE_FILE_ICON));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_PLACES_FILE_TYPE_FILE_ICON));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
            unity_places_file_file_icon_ref (value->data[0].v_pointer);
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            unity_places_file_file_icon_unref (old);
      }
}


void unity_places_file_value_take_file_icon (GValue* value, gpointer v_object) {
      UnityPlacesFileFileIcon* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_PLACES_FILE_TYPE_FILE_ICON));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_PLACES_FILE_TYPE_FILE_ICON));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            unity_places_file_file_icon_unref (old);
      }
}


static void unity_places_file_file_icon_class_init (UnityPlacesFileFileIconClass * klass) {
      unity_places_file_file_icon_parent_class = g_type_class_peek_parent (klass);
      UNITY_PLACES_FILE_FILE_ICON_CLASS (klass)->finalize = unity_places_file_file_icon_finalize;
      g_type_class_add_private (klass, sizeof (UnityPlacesFileFileIconPrivate));
}


static void unity_places_file_file_icon_instance_init (UnityPlacesFileFileIcon * self) {
      self->priv = UNITY_PLACES_FILE_FILE_ICON_GET_PRIVATE (self);
      self->ref_count = 1;
}


static void unity_places_file_file_icon_finalize (UnityPlacesFileFileIcon* obj) {
      UnityPlacesFileFileIcon * self;
      self = UNITY_PLACES_FILE_FILE_ICON (obj);
      _g_object_unref0 (self->priv->model);
      _g_object_unref0 (self->view);
      _g_object_unref0 (self->label);
}


GType unity_places_file_file_icon_get_type (void) {
      static volatile gsize unity_places_file_file_icon_type_id__volatile = 0;
      if (g_once_init_enter (&unity_places_file_file_icon_type_id__volatile)) {
            static const GTypeValueTable g_define_type_value_table = { unity_places_file_value_file_icon_init, unity_places_file_value_file_icon_free_value, unity_places_file_value_file_icon_copy_value, unity_places_file_value_file_icon_peek_pointer, "p", unity_places_file_value_file_icon_collect_value, "p", unity_places_file_value_file_icon_lcopy_value };
            static const GTypeInfo g_define_type_info = { sizeof (UnityPlacesFileFileIconClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_places_file_file_icon_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPlacesFileFileIcon), 0, (GInstanceInitFunc) unity_places_file_file_icon_instance_init, &g_define_type_value_table };
            static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
            GType unity_places_file_file_icon_type_id;
            unity_places_file_file_icon_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UnityPlacesFileFileIcon", &g_define_type_info, &g_define_type_fundamental_info, 0);
            g_once_init_leave (&unity_places_file_file_icon_type_id__volatile, unity_places_file_file_icon_type_id);
      }
      return unity_places_file_file_icon_type_id__volatile;
}


gpointer unity_places_file_file_icon_ref (gpointer instance) {
      UnityPlacesFileFileIcon* self;
      self = instance;
      g_atomic_int_inc (&self->ref_count);
      return instance;
}


void unity_places_file_file_icon_unref (gpointer instance) {
      UnityPlacesFileFileIcon* self;
      self = instance;
      if (g_atomic_int_dec_and_test (&self->ref_count)) {
            UNITY_PLACES_FILE_FILE_ICON_GET_CLASS (self)->finalize (self);
            g_type_free_instance ((GTypeInstance *) self);
      }
}


static void unity_places_file_file_group_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags) {
      UnityPlacesFileFileGroup * self;
      gint IconWidth;
      gint IconHeight;
      gint FileIconSpacing;
      gint HeaderBorderPositionX;
      gint HeaderBorderPositionY;
      gint IconBorderPositionX;
      gint IconBorderPositionY;
      gint LineBorderPositionX;
      gint LineBorderPositionY;
      ClutterActorBox _tmp0_ = {0};
      ClutterActorBox child_box;
      gint i = 0;
      self = (UnityPlacesFileFileGroup*) base;
      IconWidth = 48;
      IconHeight = 48;
      FileIconSpacing = 100;
      HeaderBorderPositionX = 0;
      HeaderBorderPositionY = 60;
      IconBorderPositionX = 0;
      IconBorderPositionY = 100;
      LineBorderPositionX = 0;
      LineBorderPositionY = 90;
      child_box = (_tmp0_.x1 = 0.0f, _tmp0_.y1 = 0.0f, _tmp0_.x2 = 0.0f, _tmp0_.y2 = 0.0f, _tmp0_);
      CLUTTER_ACTOR_CLASS (unity_places_file_file_group_parent_class)->allocate ((ClutterActor*) CTK_BOX (self), box, flags);
      child_box.x1 = (float) IconBorderPositionX;
      child_box.x2 = (float) 0;
      child_box.y1 = (float) IconBorderPositionY;
      child_box.y2 = child_box.y1 + IconHeight;
      {
            gboolean _tmp1_;
            i = 0;
            _tmp1_ = TRUE;
            while (TRUE) {
                  UnityPlacesFileFileIcon* _tmp2_;
                  ClutterActorBox _tmp3_ = {0};
                  ClutterActorBox label_box;
                  UnityPlacesFileFileIcon* _tmp4_;
                  if (!_tmp1_) {
                        i++;
                  }
                  _tmp1_ = FALSE;
                  if (!(i < gee_collection_get_size ((GeeCollection*) self->priv->file_icon_array))) {
                        break;
                  }
                  child_box.x2 = child_box.x1 + IconWidth;
                  clutter_actor_allocate ((ClutterActor*) (_tmp2_ = (UnityPlacesFileFileIcon*) gee_abstract_list_get ((GeeAbstractList*) self->priv->file_icon_array, i))->view, &child_box, flags);
                  _unity_places_file_file_icon_unref0 (_tmp2_);
                  label_box = (_tmp3_.x1 = 0.0f, _tmp3_.y1 = 0.0f, _tmp3_.x2 = 0.0f, _tmp3_.y2 = 0.0f, _tmp3_);
                  label_box.x1 = child_box.x1;
                  label_box.x2 = child_box.x2;
                  label_box.y1 = (float) (IconBorderPositionY + IconHeight);
                  label_box.y2 = label_box.y1 + 64;
                  clutter_actor_allocate ((ClutterActor*) (_tmp4_ = (UnityPlacesFileFileIcon*) gee_abstract_list_get ((GeeAbstractList*) self->priv->file_icon_array, i))->label, &label_box, flags);
                  _unity_places_file_file_icon_unref0 (_tmp4_);
                  child_box.x1 = child_box.x1 + ((float) (IconWidth + FileIconSpacing));
            }
      }
      if (self->priv->Separator->Width != 800) {
            unity_places_cairo_drawing_places_hseparator_CreateSeparator (self->priv->Separator, 800, 5);
      }
      child_box.x1 = (float) LineBorderPositionX;
      child_box.x2 = child_box.x1 + 800;
      child_box.y1 = (float) LineBorderPositionY;
      child_box.y2 = (float) (LineBorderPositionY + 5);
      clutter_actor_allocate ((ClutterActor*) self->priv->Separator, &child_box, flags);
      child_box.x1 = (float) HeaderBorderPositionX;
      child_box.x2 = child_box.x1 + 22;
      child_box.y1 = (float) HeaderBorderPositionY;
      child_box.y2 = (float) (HeaderBorderPositionY + 23);
      clutter_actor_allocate ((ClutterActor*) self->priv->Star, &child_box, flags);
      child_box.x1 = (float) (HeaderBorderPositionX + 22);
      child_box.x2 = child_box.x1 + 100;
      child_box.y1 = (float) HeaderBorderPositionY;
      child_box.y2 = (float) (HeaderBorderPositionY + 23);
      clutter_actor_allocate ((ClutterActor*) self->priv->GroupName, &child_box, flags);
      child_box.x1 = child_box.x1 + ((float) 750);
      child_box.x2 = child_box.x1 + 16;
      child_box.y1 = (float) HeaderBorderPositionY;
      child_box.y2 = (float) (HeaderBorderPositionY + 19);
      clutter_actor_allocate ((ClutterActor*) self->priv->maximize_button, &child_box, flags);
      clutter_actor_allocate ((ClutterActor*) self->priv->minimize_button, &child_box, flags);
}


static void unity_places_file_file_group_real_get_preferred_width (ClutterActor* base, float for_height, float* minimum_width, float* natural_width) {
      UnityPlacesFileFileGroup * self;
      self = (UnityPlacesFileFileGroup*) base;
      *minimum_width = 800.0f;
      *natural_width = 800.0f;
}


static void unity_places_file_file_group_real_get_preferred_height (ClutterActor* base, float for_width, float* minimum_height, float* natural_height) {
      UnityPlacesFileFileGroup * self;
      self = (UnityPlacesFileFileGroup*) base;
      *minimum_height = 150.0f;
      *natural_height = 150.0f;
}


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


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


UnityPlacesFileFileGroup* unity_places_file_file_group_construct (GType object_type, const char* group_name) {
      UnityPlacesFileFileGroup * self;
      CtkText* _tmp0_;
      CtkImage* _tmp1_;
      UnityPlacesCairoDrawingPlacesHSeparator* _tmp2_;
      CtkImage* _tmp3_;
      CtkImage* _tmp4_;
      GeeArrayList* _tmp5_;
      g_return_val_if_fail (group_name != NULL, NULL);
      self = g_object_newv (object_type, 0, NULL);
      ctk_box_set_homogeneous ((CtkBox*) self, FALSE);
      ctk_box_set_orientation ((CtkBox*) self, (gint) CTK_ORIENTATION_HORIZONTAL);
      self->priv->GroupName = (_tmp0_ = g_object_ref_sink ((CtkText*) ctk_text_new (group_name)), _g_object_unref0 (self->priv->GroupName), _tmp0_);
      self->priv->Star = (_tmp1_ = g_object_ref_sink ((CtkImage*) ctk_image_new_from_filename ((guint) 23, UNITY_PLACES_FILE_FAVOURITES_ICON)), _g_object_unref0 (self->priv->Star), _tmp1_);
      self->priv->Separator = (_tmp2_ = g_object_ref_sink (unity_places_cairo_drawing_places_hseparator_new ()), _g_object_unref0 (self->priv->Separator), _tmp2_);
      self->priv->maximize_button = (_tmp3_ = g_object_ref_sink ((CtkImage*) ctk_image_new_from_filename ((guint) 16, UNITY_PLACES_FILE_MAXIMIZE_ICON)), _g_object_unref0 (self->priv->maximize_button), _tmp3_);
      self->priv->minimize_button = (_tmp4_ = g_object_ref_sink ((CtkImage*) ctk_image_new_from_filename ((guint) 16, UNITY_PLACES_FILE_MINIMIZE_ICON)), _g_object_unref0 (self->priv->minimize_button), _tmp4_);
      self->priv->file_icon_array = (_tmp5_ = gee_array_list_new (UNITY_PLACES_FILE_TYPE_FILE_ICON, (GBoxedCopyFunc) unity_places_file_file_icon_ref, unity_places_file_file_icon_unref, NULL), _g_object_unref0 (self->priv->file_icon_array), _tmp5_);
      {
            gint i;
            i = 0;
            {
                  gboolean _tmp6_;
                  _tmp6_ = TRUE;
                  while (TRUE) {
                        UnityPlacesFileFileIcon* file;
                        if (!_tmp6_) {
                              i++;
                        }
                        _tmp6_ = FALSE;
                        if (!(i < 5)) {
                              break;
                        }
                        file = unity_places_file_file_icon_new (48, "Files", UNITY_PLACES_FILE_FILES_FILE, "Your files stored locally");
                        gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->file_icon_array, file);
                        clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) file->view);
                        clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) file->label);
                        _unity_places_file_file_icon_unref0 (file);
                  }
            }
      }
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->Star);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->Separator);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->GroupName);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->maximize_button);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->minimize_button);
      self->priv->is_open = TRUE;
      clutter_actor_show_all ((ClutterActor*) self);
      clutter_actor_set_reactive ((ClutterActor*) self->priv->maximize_button, TRUE);
      clutter_actor_set_reactive ((ClutterActor*) self->priv->minimize_button, TRUE);
      clutter_actor_hide ((ClutterActor*) self->priv->maximize_button);
      clutter_actor_show ((ClutterActor*) self->priv->minimize_button);
      g_signal_connect_object ((ClutterActor*) self->priv->maximize_button, "button-release-event", (GCallback) _unity_places_file_file_group_on_maximize_clutter_actor_button_release_event, self, 0);
      g_signal_connect_object ((ClutterActor*) self->priv->minimize_button, "button-release-event", (GCallback) _unity_places_file_file_group_on_minimize_clutter_actor_button_release_event, self, 0);
      return self;
}


UnityPlacesFileFileGroup* unity_places_file_file_group_new (const char* group_name) {
      return unity_places_file_file_group_construct (UNITY_PLACES_FILE_TYPE_FILE_GROUP, group_name);
}


gboolean unity_places_file_file_group_on_minimize (UnityPlacesFileFileGroup* self, ClutterEvent* event) {
      gboolean result = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      clutter_actor_show ((ClutterActor*) self->priv->maximize_button);
      clutter_actor_hide ((ClutterActor*) self->priv->minimize_button);
      self->priv->is_open = FALSE;
      result = FALSE;
      return result;
}


gboolean unity_places_file_file_group_on_maximize (UnityPlacesFileFileGroup* self, ClutterEvent* event) {
      gboolean result = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      clutter_actor_hide ((ClutterActor*) self->priv->maximize_button);
      clutter_actor_show ((ClutterActor*) self->priv->minimize_button);
      self->priv->is_open = TRUE;
      result = FALSE;
      return result;
}


static GObject * unity_places_file_file_group_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityPlacesFileFileGroup * self;
      parent_class = G_OBJECT_CLASS (unity_places_file_file_group_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_PLACES_FILE_FILE_GROUP (obj);
      {
      }
      return obj;
}


static void unity_places_file_file_group_class_init (UnityPlacesFileFileGroupClass * klass) {
      unity_places_file_file_group_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityPlacesFileFileGroupPrivate));
      CLUTTER_ACTOR_CLASS (klass)->allocate = unity_places_file_file_group_real_allocate;
      CLUTTER_ACTOR_CLASS (klass)->get_preferred_width = unity_places_file_file_group_real_get_preferred_width;
      CLUTTER_ACTOR_CLASS (klass)->get_preferred_height = unity_places_file_file_group_real_get_preferred_height;
      G_OBJECT_CLASS (klass)->constructor = unity_places_file_file_group_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_places_file_file_group_finalize;
}


static void unity_places_file_file_group_instance_init (UnityPlacesFileFileGroup * self) {
      self->priv = UNITY_PLACES_FILE_FILE_GROUP_GET_PRIVATE (self);
}


static void unity_places_file_file_group_finalize (GObject* obj) {
      UnityPlacesFileFileGroup * self;
      self = UNITY_PLACES_FILE_FILE_GROUP (obj);
      _g_object_unref0 (self->priv->GroupName);
      _g_object_unref0 (self->priv->Star);
      _g_object_unref0 (self->priv->Separator);
      _g_object_unref0 (self->priv->maximize_button);
      _g_object_unref0 (self->priv->minimize_button);
      _g_object_unref0 (self->priv->file_icon_array);
      G_OBJECT_CLASS (unity_places_file_file_group_parent_class)->finalize (obj);
}


GType unity_places_file_file_group_get_type (void) {
      static volatile gsize unity_places_file_file_group_type_id__volatile = 0;
      if (g_once_init_enter (&unity_places_file_file_group_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityPlacesFileFileGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_places_file_file_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPlacesFileFileGroup), 0, (GInstanceInitFunc) unity_places_file_file_group_instance_init, NULL };
            GType unity_places_file_file_group_type_id;
            unity_places_file_file_group_type_id = g_type_register_static (CTK_TYPE_BOX, "UnityPlacesFileFileGroup", &g_define_type_info, 0);
            g_once_init_leave (&unity_places_file_file_group_type_id__volatile, unity_places_file_file_group_type_id);
      }
      return unity_places_file_file_group_type_id__volatile;
}


static void unity_places_file_file_view_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags) {
      UnityPlacesFileFileView * self;
      ClutterActorBox _tmp0_ = {0};
      ClutterActorBox child_box;
      float width = 0.0F;
      float height = 0.0F;
      float child_width = 0.0F;
      float child_height = 0.0F;
      self = (UnityPlacesFileFileView*) base;
      child_box = (_tmp0_.x1 = 0.0f, _tmp0_.y1 = 0.0f, _tmp0_.x2 = 0.0f, _tmp0_.y2 = 0.0f, _tmp0_);
      CLUTTER_ACTOR_CLASS (unity_places_file_file_view_parent_class)->allocate ((ClutterActor*) CTK_BOX (self), box, flags);
      width = (*box).x2 - (*box).x1;
      height = (*box).y2 - (*box).y1;
      clutter_actor_get_preferred_width ((ClutterActor*) self->recent_file_group, height, &child_width, &child_width);
      clutter_actor_get_preferred_height ((ClutterActor*) self->recent_file_group, width, &child_height, &child_height);
      child_box.x1 = (width - child_width) / 2.0f;
      child_box.x2 = child_box.x1 + child_width;
      child_box.y1 = 0.0f;
      child_box.y2 = child_height;
      clutter_actor_allocate ((ClutterActor*) self->recent_file_group, &child_box, flags);
      child_box.y1 = child_box.y1 + child_height;
      child_box.y2 = child_box.y1 + child_height;
      clutter_actor_allocate ((ClutterActor*) self->favourite_folder_group, &child_box, flags);
      child_box.y1 = child_box.y1 + child_height;
      child_box.y2 = child_box.y1 + child_height;
      clutter_actor_allocate ((ClutterActor*) self->downloaded_file_group, &child_box, flags);
}


UnityPlacesFileFileView* unity_places_file_file_view_construct (GType object_type) {
      UnityPlacesFileFileView * self;
      UnityPlacesFileFileGroup* _tmp0_;
      UnityPlacesFileFileGroup* _tmp1_;
      UnityPlacesFileFileGroup* _tmp2_;
      self = g_object_newv (object_type, 0, NULL);
      self->recent_file_group = (_tmp0_ = g_object_ref_sink (unity_places_file_file_group_new ("Recent Files")), _g_object_unref0 (self->recent_file_group), _tmp0_);
      self->favourite_folder_group = (_tmp1_ = g_object_ref_sink (unity_places_file_file_group_new ("Favourite Files")), _g_object_unref0 (self->favourite_folder_group), _tmp1_);
      self->downloaded_file_group = (_tmp2_ = g_object_ref_sink (unity_places_file_file_group_new ("Downloaded Files")), _g_object_unref0 (self->downloaded_file_group), _tmp2_);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->recent_file_group);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->favourite_folder_group);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->downloaded_file_group);
      clutter_actor_show_all ((ClutterActor*) self);
      return self;
}


UnityPlacesFileFileView* unity_places_file_file_view_new (void) {
      return unity_places_file_file_view_construct (UNITY_PLACES_FILE_TYPE_FILE_VIEW);
}


static GObject * unity_places_file_file_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityPlacesFileFileView * self;
      parent_class = G_OBJECT_CLASS (unity_places_file_file_view_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_PLACES_FILE_FILE_VIEW (obj);
      {
      }
      return obj;
}


static void unity_places_file_file_view_class_init (UnityPlacesFileFileViewClass * klass) {
      unity_places_file_file_view_parent_class = g_type_class_peek_parent (klass);
      CLUTTER_ACTOR_CLASS (klass)->allocate = unity_places_file_file_view_real_allocate;
      G_OBJECT_CLASS (klass)->constructor = unity_places_file_file_view_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_places_file_file_view_finalize;
}


static void unity_places_file_file_view_instance_init (UnityPlacesFileFileView * self) {
}


static void unity_places_file_file_view_finalize (GObject* obj) {
      UnityPlacesFileFileView * self;
      self = UNITY_PLACES_FILE_FILE_VIEW (obj);
      _g_object_unref0 (self->recent_file_group);
      _g_object_unref0 (self->favourite_folder_group);
      _g_object_unref0 (self->downloaded_file_group);
      G_OBJECT_CLASS (unity_places_file_file_view_parent_class)->finalize (obj);
}


GType unity_places_file_file_view_get_type (void) {
      static volatile gsize unity_places_file_file_view_type_id__volatile = 0;
      if (g_once_init_enter (&unity_places_file_file_view_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityPlacesFileFileViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_places_file_file_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPlacesFileFileView), 0, (GInstanceInitFunc) unity_places_file_file_view_instance_init, NULL };
            GType unity_places_file_file_view_type_id;
            unity_places_file_file_view_type_id = g_type_register_static (CTK_TYPE_BOX, "UnityPlacesFileFileView", &g_define_type_info, 0);
            g_once_init_leave (&unity_places_file_file_view_type_id__volatile, unity_places_file_file_view_type_id);
      }
      return unity_places_file_file_view_type_id__volatile;
}





Generated by  Doxygen 1.6.0   Back to index