/* unified-privacy-applications.c generated by valac 0.56.19, the Vala compiler
 * generated from unified-privacy-applications.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; intend-tabs-mode: t -*- */
/* alm
 *
 * Copyright (C) 2012 Seif Lotfy <seif@lotfy.com>
 * Copyright (C) 2012 Stefano Candori <stefano.candori@gmail.com>
 * Copyright (C) 2012 Manish Sinha <manishsinha@ubuntu.com>
 * Copyright (C) 2012 Intel Corp.
 *               Authored by: Seif Lotfy <seif.lotfy@collabora.co.uk>
 *
 * alm is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 * 
 * alm 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 Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.";
 */

#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <zeitgeist-datamodel.h>
#include <gtk/gtk.h>
#include <gobject/gvaluecollector.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>
#include <gio/gio.h>
#include <gio/gdesktopappinfo.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.h>

#define ALM_USAGE_CELL_RENDERER_RECT_NUM 10
#define ALM_USAGE_CELL_RENDERER_RECT_WIDTH 5
#define ALM_USAGE_CELL_RENDERER_RECT_HEIGHT 20
#define ALM_USAGE_CELL_RENDERER_RECT_SPACING 3
#define ALM_USAGE_CELL_RENDERER_xpadding 25
#define ALM_USAGE_CELL_RENDERER_ypadding 10
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define ALM_TYPE_APPLICATION_BLACKLIST (alm_application_blacklist_get_type ())
#define ALM_APPLICATION_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_APPLICATION_BLACKLIST, AlmApplicationBlacklist))
#define ALM_APPLICATION_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_APPLICATION_BLACKLIST, AlmApplicationBlacklistClass))
#define ALM_IS_APPLICATION_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_APPLICATION_BLACKLIST))
#define ALM_IS_APPLICATION_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_APPLICATION_BLACKLIST))
#define ALM_APPLICATION_BLACKLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_APPLICATION_BLACKLIST, AlmApplicationBlacklistClass))

typedef struct _AlmApplicationBlacklist AlmApplicationBlacklist;
typedef struct _AlmApplicationBlacklistClass AlmApplicationBlacklistClass;
typedef struct _AlmApplicationBlacklistPrivate AlmApplicationBlacklistPrivate;

#define ALM_TYPE_BLACKLIST (alm_blacklist_get_type ())
#define ALM_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_BLACKLIST, AlmBlacklist))
#define ALM_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_BLACKLIST, AlmBlacklistClass))
#define ALM_IS_BLACKLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_BLACKLIST))
#define ALM_IS_BLACKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_BLACKLIST))
#define ALM_BLACKLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_BLACKLIST, AlmBlacklistClass))

typedef struct _AlmBlacklist AlmBlacklist;
typedef struct _AlmBlacklistClass AlmBlacklistClass;
#define _alm_blacklist_unref0(var) ((var == NULL) ? NULL : (var = (alm_blacklist_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG (alm_applications_chooser_dialog_get_type ())
#define ALM_APPLICATIONS_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG, AlmApplicationsChooserDialog))
#define ALM_APPLICATIONS_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG, AlmApplicationsChooserDialogClass))
#define ALM_IS_APPLICATIONS_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG))
#define ALM_IS_APPLICATIONS_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG))
#define ALM_APPLICATIONS_CHOOSER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG, AlmApplicationsChooserDialogClass))

typedef struct _AlmApplicationsChooserDialog AlmApplicationsChooserDialog;
typedef struct _AlmApplicationsChooserDialogClass AlmApplicationsChooserDialogClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _AlmParamSpecApplicationBlacklist AlmParamSpecApplicationBlacklist;
enum  {
	ALM_APPLICATION_BLACKLIST_APPLICATION_ADDED_SIGNAL,
	ALM_APPLICATION_BLACKLIST_APPLICATION_REMOVED_SIGNAL,
	ALM_APPLICATION_BLACKLIST_NUM_SIGNALS
};
static guint alm_application_blacklist_signals[ALM_APPLICATION_BLACKLIST_NUM_SIGNALS] = {0};

#define ALM_TYPE_APPLICATIONS_TREE_VIEW (alm_applications_tree_view_get_type ())
#define ALM_APPLICATIONS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_APPLICATIONS_TREE_VIEW, AlmApplicationsTreeView))
#define ALM_APPLICATIONS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_APPLICATIONS_TREE_VIEW, AlmApplicationsTreeViewClass))
#define ALM_IS_APPLICATIONS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_APPLICATIONS_TREE_VIEW))
#define ALM_IS_APPLICATIONS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_APPLICATIONS_TREE_VIEW))
#define ALM_APPLICATIONS_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_APPLICATIONS_TREE_VIEW, AlmApplicationsTreeViewClass))

typedef struct _AlmApplicationsTreeView AlmApplicationsTreeView;
typedef struct _AlmApplicationsTreeViewClass AlmApplicationsTreeViewClass;
typedef struct _AlmApplicationsTreeViewPrivate AlmApplicationsTreeViewPrivate;

#define ALM_TYPE_APP_CHOOSE_INFO (alm_app_choose_info_get_type ())
#define ALM_APP_CHOOSE_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_APP_CHOOSE_INFO, AlmAppChooseInfo))
#define ALM_APP_CHOOSE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_APP_CHOOSE_INFO, AlmAppChooseInfoClass))
#define ALM_IS_APP_CHOOSE_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_APP_CHOOSE_INFO))
#define ALM_IS_APP_CHOOSE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_APP_CHOOSE_INFO))
#define ALM_APP_CHOOSE_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_APP_CHOOSE_INFO, AlmAppChooseInfoClass))

typedef struct _AlmAppChooseInfo AlmAppChooseInfo;
typedef struct _AlmAppChooseInfoClass AlmAppChooseInfoClass;
enum  {
	ALM_APPLICATIONS_TREE_VIEW_0_PROPERTY,
	ALM_APPLICATIONS_TREE_VIEW_LISTSTORE_PROPERTY,
	ALM_APPLICATIONS_TREE_VIEW_NUM_PROPERTIES
};
static GParamSpec* alm_applications_tree_view_properties[ALM_APPLICATIONS_TREE_VIEW_NUM_PROPERTIES];
typedef enum  {
	ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_APP_NAME,
	ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_ICON,
	ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_DESKTOP_FILE,
	ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_N_COLS
} AlmApplicationsTreeViewTreeViewCols;

#define ALM_APPLICATIONS_TREE_VIEW_TYPE_TREE_VIEW_COLS (alm_applications_tree_view_tree_view_cols_get_type ())
#define _alm_application_blacklist_unref0(var) ((var == NULL) ? NULL : (var = (alm_application_blacklist_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

#define ALM_TYPE_APP_SELECTION_TREE_VIEW (alm_app_selection_tree_view_get_type ())
#define ALM_APP_SELECTION_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_APP_SELECTION_TREE_VIEW, AlmAppSelectionTreeView))
#define ALM_APP_SELECTION_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_APP_SELECTION_TREE_VIEW, AlmAppSelectionTreeViewClass))
#define ALM_IS_APP_SELECTION_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_APP_SELECTION_TREE_VIEW))
#define ALM_IS_APP_SELECTION_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_APP_SELECTION_TREE_VIEW))
#define ALM_APP_SELECTION_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_APP_SELECTION_TREE_VIEW, AlmAppSelectionTreeViewClass))

typedef struct _AlmAppSelectionTreeView AlmAppSelectionTreeView;
typedef struct _AlmAppSelectionTreeViewClass AlmAppSelectionTreeViewClass;
typedef struct _AlmAppSelectionTreeViewPrivate AlmAppSelectionTreeViewPrivate;
enum  {
	ALM_APP_SELECTION_TREE_VIEW_0_PROPERTY,
	ALM_APP_SELECTION_TREE_VIEW_TREE_PROPERTY,
	ALM_APP_SELECTION_TREE_VIEW_LISTSTORE_PROPERTY,
	ALM_APP_SELECTION_TREE_VIEW_NUM_PROPERTIES
};
static GParamSpec* alm_app_selection_tree_view_properties[ALM_APP_SELECTION_TREE_VIEW_NUM_PROPERTIES];
typedef enum  {
	ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_APP_NAME,
	ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_ICON,
	ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_DESKTOP_FILE,
	ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_LAST_ACCESSED_STRING,
	ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_LAST_ACCESSED_INT,
	ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_USAGE,
	ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_N_COLS
} AlmAppSelectionTreeViewTreeViewCols;

#define ALM_APP_SELECTION_TREE_VIEW_TYPE_TREE_VIEW_COLS (alm_app_selection_tree_view_tree_view_cols_get_type ())

#define ALM_TYPE_USAGE_CELL_RENDERER (alm_usage_cell_renderer_get_type ())
#define ALM_USAGE_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ALM_TYPE_USAGE_CELL_RENDERER, AlmUsageCellRenderer))
#define ALM_USAGE_CELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALM_TYPE_USAGE_CELL_RENDERER, AlmUsageCellRendererClass))
#define ALM_IS_USAGE_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ALM_TYPE_USAGE_CELL_RENDERER))
#define ALM_IS_USAGE_CELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALM_TYPE_USAGE_CELL_RENDERER))
#define ALM_USAGE_CELL_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALM_TYPE_USAGE_CELL_RENDERER, AlmUsageCellRendererClass))

typedef struct _AlmUsageCellRenderer AlmUsageCellRenderer;
typedef struct _AlmUsageCellRendererClass AlmUsageCellRendererClass;
typedef struct _AlmApplicationsChooserDialogPrivate AlmApplicationsChooserDialogPrivate;
enum  {
	ALM_APPLICATIONS_CHOOSER_DIALOG_0_PROPERTY,
	ALM_APPLICATIONS_CHOOSER_DIALOG_TREE_PROPERTY,
	ALM_APPLICATIONS_CHOOSER_DIALOG_LISTSTORE_PROPERTY,
	ALM_APPLICATIONS_CHOOSER_DIALOG_NUM_PROPERTIES
};
static GParamSpec* alm_applications_chooser_dialog_properties[ALM_APPLICATIONS_CHOOSER_DIALOG_NUM_PROPERTIES];
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _alm_app_choose_info_unref0(var) ((var == NULL) ? NULL : (var = (alm_app_choose_info_unref (var), NULL)))
typedef struct _AlmUsageCellRendererPrivate AlmUsageCellRendererPrivate;
enum  {
	ALM_USAGE_CELL_RENDERER_0_PROPERTY,
	ALM_USAGE_CELL_RENDERER_USAGE_PROPERTY,
	ALM_USAGE_CELL_RENDERER_NUM_PROPERTIES
};
static GParamSpec* alm_usage_cell_renderer_properties[ALM_USAGE_CELL_RENDERER_NUM_PROPERTIES];
typedef struct _AlmAppChooseInfoPrivate AlmAppChooseInfoPrivate;
typedef struct _AlmParamSpecAppChooseInfo AlmParamSpecAppChooseInfo;

struct _AlmApplicationBlacklist {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AlmApplicationBlacklistPrivate * priv;
};

struct _AlmApplicationBlacklistClass {
	GTypeClass parent_class;
	void (*finalize) (AlmApplicationBlacklist *self);
};

struct _AlmApplicationBlacklistPrivate {
	AlmBlacklist* blacklist_interface;
	GeeHashSet* all_blocked_apps;
};

struct _AlmParamSpecApplicationBlacklist {
	GParamSpec parent_instance;
};

struct _AlmApplicationsTreeView {
	GtkBox parent_instance;
	AlmApplicationsTreeViewPrivate * priv;
};

struct _AlmApplicationsTreeViewClass {
	GtkBoxClass parent_class;
};

struct _AlmApplicationsTreeViewPrivate {
	AlmApplicationBlacklist* app_blacklist;
	GtkListStore* store;
	GtkTreeView* treeview;
	GHashTable* blocked_apps;
	GHashTable* unblocked_apps;
};

struct _AlmAppSelectionTreeView {
	GtkBox parent_instance;
	AlmAppSelectionTreeViewPrivate * priv;
};

struct _AlmAppSelectionTreeViewClass {
	GtkBoxClass parent_class;
};

struct _AlmAppSelectionTreeViewPrivate {
	AlmApplicationBlacklist* app_blacklist;
	GtkListStore* store;
	GtkTreeView* treeview;
};

struct _AlmApplicationsChooserDialog {
	GtkDialog parent_instance;
	AlmApplicationsChooserDialogPrivate * priv;
};

struct _AlmApplicationsChooserDialogClass {
	GtkDialogClass parent_class;
};

struct _AlmApplicationsChooserDialogPrivate {
	AlmApplicationBlacklist* app_blacklist;
	AlmAppSelectionTreeView* treeview;
	GHashTable* all_actors_list;
	GHashTable* actors_iter;
	GHashTable* blocked_apps;
	GHashTable* unblocked_apps;
};

struct _AlmUsageCellRenderer {
	GtkCellRenderer parent_instance;
	AlmUsageCellRendererPrivate * priv;
};

struct _AlmUsageCellRendererClass {
	GtkCellRendererClass parent_class;
};

struct _AlmUsageCellRendererPrivate {
	gint usage_num;
};

struct _AlmAppChooseInfo {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AlmAppChooseInfoPrivate * priv;
};

struct _AlmAppChooseInfoClass {
	GTypeClass parent_class;
	void (*finalize) (AlmAppChooseInfo *self);
};

struct _AlmAppChooseInfoPrivate {
	gchar* app_id;
	gchar* app_name;
	GdkPixbuf* app_icon;
	gchar* last_accessed_time_s;
	gint64 last_accessed_time_i;
	guint usage_rating;
};

struct _AlmParamSpecAppChooseInfo {
	GParamSpec parent_instance;
};

static gint AlmApplicationBlacklist_private_offset;
static gpointer alm_application_blacklist_parent_class = NULL;
VALA_EXTERN gchar* alm_application_blacklist_interpretation_prefix;
gchar* alm_application_blacklist_interpretation_prefix = NULL;
VALA_EXTERN gchar* alm_application_blacklist_launcher_prefix;
gchar* alm_application_blacklist_launcher_prefix = NULL;
static gint AlmApplicationsTreeView_private_offset;
static gpointer alm_applications_tree_view_parent_class = NULL;
static gint AlmAppSelectionTreeView_private_offset;
static gpointer alm_app_selection_tree_view_parent_class = NULL;
static gint AlmApplicationsChooserDialog_private_offset;
static gpointer alm_applications_chooser_dialog_parent_class = NULL;
static gint AlmUsageCellRenderer_private_offset;
static gpointer alm_usage_cell_renderer_parent_class = NULL;
static gint AlmAppChooseInfo_private_offset;
static gpointer alm_app_choose_info_parent_class = NULL;

VALA_EXTERN gpointer alm_application_blacklist_ref (gpointer instance);
VALA_EXTERN void alm_application_blacklist_unref (gpointer instance);
VALA_EXTERN GParamSpec* alm_param_spec_application_blacklist (const gchar* name,
                                                  const gchar* nick,
                                                  const gchar* blurb,
                                                  GType object_type,
                                                  GParamFlags flags);
VALA_EXTERN void alm_value_set_application_blacklist (GValue* value,
                                          gpointer v_object);
VALA_EXTERN void alm_value_take_application_blacklist (GValue* value,
                                           gpointer v_object);
VALA_EXTERN gpointer alm_value_get_application_blacklist (const GValue* value);
VALA_EXTERN GType alm_application_blacklist_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmApplicationBlacklist, alm_application_blacklist_unref)
VALA_EXTERN gpointer alm_blacklist_ref (gpointer instance);
VALA_EXTERN void alm_blacklist_unref (gpointer instance);
VALA_EXTERN GParamSpec* alm_param_spec_blacklist (const gchar* name,
                                      const gchar* nick,
                                      const gchar* blurb,
                                      GType object_type,
                                      GParamFlags flags);
VALA_EXTERN void alm_value_set_blacklist (GValue* value,
                              gpointer v_object);
VALA_EXTERN void alm_value_take_blacklist (GValue* value,
                               gpointer v_object);
VALA_EXTERN gpointer alm_value_get_blacklist (const GValue* value);
VALA_EXTERN GType alm_blacklist_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmBlacklist, alm_blacklist_unref)
VALA_EXTERN AlmApplicationBlacklist* alm_application_blacklist_new (AlmBlacklist* blacklist);
VALA_EXTERN AlmApplicationBlacklist* alm_application_blacklist_construct (GType object_type,
                                                              AlmBlacklist* blacklist);
static void alm_application_blacklist_on_blacklist_added (AlmApplicationBlacklist* self,
                                                   const gchar* blacklist_id,
                                                   ZeitgeistEvent* ev);
static void _alm_application_blacklist_on_blacklist_added_alm_blacklist_template_added (AlmBlacklist* _sender,
                                                                                 const gchar* blacklist_id,
                                                                                 ZeitgeistEvent* blacklist_template,
                                                                                 gpointer self);
static void alm_application_blacklist_on_blacklist_removed (AlmApplicationBlacklist* self,
                                                     const gchar* blacklist_id,
                                                     ZeitgeistEvent* ev);
static void _alm_application_blacklist_on_blacklist_removed_alm_blacklist_template_removed (AlmBlacklist* _sender,
                                                                                     const gchar* blacklist_id,
                                                                                     ZeitgeistEvent* blacklist_template,
                                                                                     gpointer self);
static GeeHashSet* alm_application_blacklist_get_blocked_apps (AlmApplicationBlacklist* self);
VALA_EXTERN GType alm_applications_chooser_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmApplicationsChooserDialog, g_object_unref)
VALA_EXTERN void alm_application_blacklist_get_all_applications (AlmApplicationBlacklist* self,
                                                     AlmApplicationsChooserDialog* dialog);
VALA_EXTERN void alm_blacklist_get_all_applications (AlmBlacklist* self,
                                         AlmApplicationsChooserDialog* dialog);
VALA_EXTERN void alm_application_blacklist_get_count_for_app (AlmApplicationBlacklist* self,
                                                  const gchar* id,
                                                  GtkTreeIter* iter,
                                                  GtkListStore* store);
VALA_EXTERN void alm_blacklist_get_count_for_app (AlmBlacklist* self,
                                      const gchar* app_id,
                                      GtkTreeIter* iter,
                                      GtkListStore* store);
VALA_EXTERN GHashTable* alm_blacklist_get_all_templates (AlmBlacklist* self);
VALA_EXTERN GeeHashSet* alm_application_blacklist_get_all_apps (AlmApplicationBlacklist* self);
VALA_EXTERN void alm_application_blacklist_block (AlmApplicationBlacklist* self,
                                      const gchar* application);
VALA_EXTERN void alm_blacklist_add_template (AlmBlacklist* self,
                                 const gchar* blacklist_id,
                                 ZeitgeistEvent* blacklist_template);
VALA_EXTERN void alm_application_blacklist_unblock (AlmApplicationBlacklist* self,
                                        const gchar* application);
VALA_EXTERN void alm_blacklist_remove_template (AlmBlacklist* self,
                                    const gchar* blacklist_id);
static void g_cclosure_user_marshal_VOID__STRING_OBJECT (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void alm_application_blacklist_finalize (AlmApplicationBlacklist * obj);
static GType alm_application_blacklist_get_type_once (void);
VALA_EXTERN GType alm_applications_tree_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmApplicationsTreeView, g_object_unref)
VALA_EXTERN gpointer alm_app_choose_info_ref (gpointer instance);
VALA_EXTERN void alm_app_choose_info_unref (gpointer instance);
VALA_EXTERN GParamSpec* alm_param_spec_app_choose_info (const gchar* name,
                                            const gchar* nick,
                                            const gchar* blurb,
                                            GType object_type,
                                            GParamFlags flags);
VALA_EXTERN void alm_value_set_app_choose_info (GValue* value,
                                    gpointer v_object);
VALA_EXTERN void alm_value_take_app_choose_info (GValue* value,
                                     gpointer v_object);
VALA_EXTERN gpointer alm_value_get_app_choose_info (const GValue* value);
VALA_EXTERN GType alm_app_choose_info_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmAppChooseInfo, alm_app_choose_info_unref)
static GType alm_applications_tree_view_tree_view_cols_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN AlmApplicationsTreeView* alm_applications_tree_view_new (AlmApplicationBlacklist* app_blacklist,
                                                         GHashTable* blocked,
                                                         GHashTable* unblocked);
VALA_EXTERN AlmApplicationsTreeView* alm_applications_tree_view_construct (GType object_type,
                                                               AlmApplicationBlacklist* app_blacklist,
                                                               GHashTable* blocked,
                                                               GHashTable* unblocked);
static void alm_applications_tree_view_set_up_ui (AlmApplicationsTreeView* self);
VALA_EXTERN GdkPixbuf* alm_applications_tree_view_get_pixbuf_from_gio_icon (GIcon* icon,
                                                                gint size);
VALA_EXTERN gchar* alm_applications_tree_view_markup_for_app (GDesktopAppInfo* app_info);
VALA_EXTERN void alm_applications_tree_view_add_application_to_view (AlmApplicationsTreeView* self,
                                                         const gchar* app);
VALA_EXTERN GtkListStore* alm_applications_tree_view_get_liststore (AlmApplicationsTreeView* self);
VALA_EXTERN AlmAppChooseInfo* alm_app_choose_info_new (const gchar* id,
                                           const gchar* app_name,
                                           GdkPixbuf* app_icon,
                                           const gchar* last_accessed_time_s,
                                           gint64 last_accessed_time_i,
                                           guint usage_rating);
VALA_EXTERN AlmAppChooseInfo* alm_app_choose_info_construct (GType object_type,
                                                 const gchar* id,
                                                 const gchar* app_name,
                                                 GdkPixbuf* app_icon,
                                                 const gchar* last_accessed_time_s,
                                                 gint64 last_accessed_time_i,
                                                 guint usage_rating);
VALA_EXTERN void alm_applications_tree_view_remove_app_from_view (AlmApplicationsTreeView* self,
                                                      const gchar* app);
VALA_EXTERN gchar* alm_applications_tree_view_remove_selected_app (AlmApplicationsTreeView* self);
static void alm_applications_tree_view_finalize (GObject * obj);
static GType alm_applications_tree_view_get_type_once (void);
static void _vala_alm_applications_tree_view_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
VALA_EXTERN GType alm_app_selection_tree_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmAppSelectionTreeView, g_object_unref)
static GType alm_app_selection_tree_view_tree_view_cols_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN AlmAppSelectionTreeView* alm_app_selection_tree_view_new (AlmApplicationBlacklist* app_blacklist);
VALA_EXTERN AlmAppSelectionTreeView* alm_app_selection_tree_view_construct (GType object_type,
                                                                AlmApplicationBlacklist* app_blacklist);
static void alm_app_selection_tree_view_set_up_ui (AlmAppSelectionTreeView* self);
VALA_EXTERN GType alm_usage_cell_renderer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AlmUsageCellRenderer, g_object_unref)
VALA_EXTERN AlmUsageCellRenderer* alm_usage_cell_renderer_new (void);
VALA_EXTERN AlmUsageCellRenderer* alm_usage_cell_renderer_construct (GType object_type);
VALA_EXTERN GtkTreeView* alm_app_selection_tree_view_get_tree (AlmAppSelectionTreeView* self);
VALA_EXTERN GtkListStore* alm_app_selection_tree_view_get_liststore (AlmAppSelectionTreeView* self);
static void alm_app_selection_tree_view_finalize (GObject * obj);
static GType alm_app_selection_tree_view_get_type_once (void);
static void _vala_alm_app_selection_tree_view_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
VALA_EXTERN AlmApplicationsChooserDialog* alm_applications_chooser_dialog_new (AlmApplicationBlacklist* app_blacklist,
                                                                   GHashTable* blocked_list,
                                                                   GHashTable* unblocked_list);
VALA_EXTERN AlmApplicationsChooserDialog* alm_applications_chooser_dialog_construct (GType object_type,
                                                                         AlmApplicationBlacklist* app_blacklist,
                                                                         GHashTable* blocked_list,
                                                                         GHashTable* unblocked_list);
static void _g_free0_ (gpointer var);
static void _vala_GtkTreeIter_free (GtkTreeIter* self);
static void __vala_GtkTreeIter_free0_ (gpointer var);
static void alm_applications_chooser_dialog_set_up_ui (AlmApplicationsChooserDialog* self);
static gint alm_applications_chooser_dialog_compare_dates (AlmApplicationsChooserDialog* self,
                                                    GDateTime* now,
                                                    GDateTime* time);
VALA_EXTERN void alm_applications_chooser_dialog_handle_app_population (AlmApplicationsChooserDialog* self,
                                                            GHashTable* all_actors);
static gint64* _int64_dup (gint64* self);
VALA_EXTERN void alm_applications_chooser_dialog_insert_liststore (AlmApplicationsChooserDialog* self,
                                                       GAppInfo* app_info,
                                                       const gchar* last_accessed,
                                                       gint64 last_accessed_time,
                                                       guint usage);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN void alm_app_choose_info_set_last_accessed (AlmAppChooseInfo* self,
                                            const gchar* value);
VALA_EXTERN void alm_app_choose_info_set_usage (AlmAppChooseInfo* self,
                                    guint value);
VALA_EXTERN void alm_applications_chooser_dialog_insert_app_liststore (AlmApplicationsChooserDialog* self,
                                                           const gchar* app);
VALA_EXTERN const gchar* alm_app_choose_info_get_name (AlmAppChooseInfo* self);
VALA_EXTERN GdkPixbuf* alm_app_choose_info_get_icon (AlmAppChooseInfo* self);
VALA_EXTERN const gchar* alm_app_choose_info_get_last_accessed (AlmAppChooseInfo* self);
VALA_EXTERN gint64 alm_app_choose_info_get_last_accessed_time (AlmAppChooseInfo* self);
VALA_EXTERN gchar* alm_app_choose_info_get_id (AlmAppChooseInfo* self);
VALA_EXTERN GtkTreeView* alm_applications_chooser_dialog_get_tree (AlmApplicationsChooserDialog* self);
VALA_EXTERN GtkListStore* alm_applications_chooser_dialog_get_liststore (AlmApplicationsChooserDialog* self);
static void alm_applications_chooser_dialog_finalize (GObject * obj);
static GType alm_applications_chooser_dialog_get_type_once (void);
static void _vala_alm_applications_chooser_dialog_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void alm_usage_cell_renderer_real_get_size (GtkCellRenderer* base,
                                            GtkWidget* widget,
                                            GdkRectangle* cell_area,
                                            gint* x_offset,
                                            gint* y_offset,
                                            gint* width,
                                            gint* height);
static void alm_usage_cell_renderer_real_render (GtkCellRenderer* base,
                                          cairo_t* ctx,
                                          GtkWidget* widget,
                                          GdkRectangle* background_area,
                                          GdkRectangle* cell_area,
                                          GtkCellRendererState flags);
VALA_EXTERN gint alm_usage_cell_renderer_get_usage (AlmUsageCellRenderer* self);
VALA_EXTERN void alm_usage_cell_renderer_set_usage (AlmUsageCellRenderer* self,
                                        gint value);
static void alm_usage_cell_renderer_finalize (GObject * obj);
static GType alm_usage_cell_renderer_get_type_once (void);
static void _vala_alm_usage_cell_renderer_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_alm_usage_cell_renderer_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
VALA_EXTERN void alm_app_choose_info_set_name (AlmAppChooseInfo* self,
                                   const gchar* value);
VALA_EXTERN void alm_app_choose_info_set_icon (AlmAppChooseInfo* self,
                                   GdkPixbuf* value);
VALA_EXTERN void alm_app_choose_info_set_last_accessed_time (AlmAppChooseInfo* self,
                                                 gint64 value);
VALA_EXTERN guint alm_app_choose_info_get_usage (AlmAppChooseInfo* self);
static void alm_app_choose_info_finalize (AlmAppChooseInfo * obj);
static GType alm_app_choose_info_get_type_once (void);

static inline gpointer
alm_application_blacklist_get_instance_private (AlmApplicationBlacklist* self)
{
	return G_STRUCT_MEMBER_P (self, AlmApplicationBlacklist_private_offset);
}

static gpointer
_alm_blacklist_ref0 (gpointer self)
{
	return self ? alm_blacklist_ref (self) : NULL;
}

static void
_alm_application_blacklist_on_blacklist_added_alm_blacklist_template_added (AlmBlacklist* _sender,
                                                                            const gchar* blacklist_id,
                                                                            ZeitgeistEvent* blacklist_template,
                                                                            gpointer self)
{
	alm_application_blacklist_on_blacklist_added ((AlmApplicationBlacklist*) self, blacklist_id, blacklist_template);
}

static void
_alm_application_blacklist_on_blacklist_removed_alm_blacklist_template_removed (AlmBlacklist* _sender,
                                                                                const gchar* blacklist_id,
                                                                                ZeitgeistEvent* blacklist_template,
                                                                                gpointer self)
{
	alm_application_blacklist_on_blacklist_removed ((AlmApplicationBlacklist*) self, blacklist_id, blacklist_template);
}

AlmApplicationBlacklist*
alm_application_blacklist_construct (GType object_type,
                                     AlmBlacklist* blacklist)
{
	AlmApplicationBlacklist* self = NULL;
	AlmBlacklist* _tmp0_;
	AlmBlacklist* _tmp1_;
	AlmBlacklist* _tmp2_;
	GeeHashSet* _tmp3_;
	GeeHashSet* _tmp4_;
	g_return_val_if_fail (blacklist != NULL, NULL);
	self = (AlmApplicationBlacklist*) g_type_create_instance (object_type);
	_tmp0_ = _alm_blacklist_ref0 (blacklist);
	_alm_blacklist_unref0 (self->priv->blacklist_interface);
	self->priv->blacklist_interface = _tmp0_;
	_tmp1_ = self->priv->blacklist_interface;
	g_signal_connect (_tmp1_, "template-added", (GCallback) _alm_application_blacklist_on_blacklist_added_alm_blacklist_template_added, self);
	_tmp2_ = self->priv->blacklist_interface;
	g_signal_connect (_tmp2_, "template-removed", (GCallback) _alm_application_blacklist_on_blacklist_removed_alm_blacklist_template_removed, self);
	_tmp3_ = alm_application_blacklist_get_blocked_apps (self);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp4_);
	return self;
}

AlmApplicationBlacklist*
alm_application_blacklist_new (AlmBlacklist* blacklist)
{
	return alm_application_blacklist_construct (ALM_TYPE_APPLICATION_BLACKLIST, blacklist);
}

void
alm_application_blacklist_get_all_applications (AlmApplicationBlacklist* self,
                                                AlmApplicationsChooserDialog* dialog)
{
	AlmBlacklist* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dialog != NULL);
	_tmp0_ = self->priv->blacklist_interface;
	alm_blacklist_get_all_applications (_tmp0_, dialog);
}

void
alm_application_blacklist_get_count_for_app (AlmApplicationBlacklist* self,
                                             const gchar* id,
                                             GtkTreeIter* iter,
                                             GtkListStore* store)
{
	AlmBlacklist* _tmp0_;
	GtkTreeIter _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	g_return_if_fail (iter != NULL);
	g_return_if_fail (store != NULL);
	_tmp0_ = self->priv->blacklist_interface;
	_tmp1_ = *iter;
	alm_blacklist_get_count_for_app (_tmp0_, id, &_tmp1_, store);
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

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

static GeeHashSet*
alm_application_blacklist_get_blocked_apps (AlmApplicationBlacklist* self)
{
	GeeHashSet* _tmp0_;
	AlmBlacklist* _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	GList* _tmp4_;
	GeeHashSet* _tmp12_;
	GeeHashSet* _tmp13_;
	GeeHashSet* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->all_blocked_apps);
	self->priv->all_blocked_apps = _tmp0_;
	_tmp1_ = self->priv->blacklist_interface;
	_tmp2_ = alm_blacklist_get_all_templates (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_hash_table_get_keys (_tmp3_);
	{
		GList* key_collection = NULL;
		GList* key_it = NULL;
		key_collection = _tmp4_;
		for (key_it = key_collection; key_it != NULL; key_it = key_it->next) {
			gchar* _tmp5_;
			gchar* key = NULL;
			_tmp5_ = g_strdup ((const gchar*) key_it->data);
			key = _tmp5_;
			{
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				_tmp6_ = key;
				_tmp7_ = alm_application_blacklist_interpretation_prefix;
				if (g_str_has_prefix (_tmp6_, _tmp7_)) {
					gchar* app = NULL;
					const gchar* _tmp8_;
					gchar* _tmp9_;
					GeeHashSet* _tmp10_;
					const gchar* _tmp11_;
					_tmp8_ = key;
					_tmp9_ = string_substring (_tmp8_, (glong) 4, (glong) -1);
					app = _tmp9_;
					_tmp10_ = self->priv->all_blocked_apps;
					_tmp11_ = app;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, _tmp11_);
					_g_free0 (app);
				}
				_g_free0 (key);
			}
		}
		(key_collection == NULL) ? NULL : (key_collection = (g_list_free (key_collection), NULL));
	}
	_tmp12_ = self->priv->all_blocked_apps;
	_tmp13_ = _g_object_ref0 (_tmp12_);
	result = _tmp13_;
	return result;
}

static void
alm_application_blacklist_on_blacklist_added (AlmApplicationBlacklist* self,
                                              const gchar* blacklist_id,
                                              ZeitgeistEvent* ev)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (blacklist_id != NULL);
	g_return_if_fail (ev != NULL);
	_tmp0_ = alm_application_blacklist_interpretation_prefix;
	if (g_str_has_prefix (blacklist_id, _tmp0_)) {
		gchar* app = NULL;
		gchar* _tmp1_;
		const gchar* _tmp2_;
		GeeHashSet* _tmp3_;
		GeeHashSet* _tmp4_;
		const gchar* _tmp5_;
		_tmp1_ = string_substring (blacklist_id, (glong) 4, (glong) -1);
		app = _tmp1_;
		_tmp2_ = app;
		g_signal_emit (self, alm_application_blacklist_signals[ALM_APPLICATION_BLACKLIST_APPLICATION_ADDED_SIGNAL], 0, _tmp2_, ev);
		_tmp3_ = alm_application_blacklist_get_all_apps (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = app;
		if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp4_, _tmp5_)) {
			GeeHashSet* _tmp6_;
			GeeHashSet* _tmp7_;
			const gchar* _tmp8_;
			_tmp6_ = alm_application_blacklist_get_all_apps (self);
			_tmp7_ = _tmp6_;
			_tmp8_ = app;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, _tmp8_);
		}
		_g_free0 (app);
	}
}

static void
alm_application_blacklist_on_blacklist_removed (AlmApplicationBlacklist* self,
                                                const gchar* blacklist_id,
                                                ZeitgeistEvent* ev)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (blacklist_id != NULL);
	g_return_if_fail (ev != NULL);
	_tmp0_ = alm_application_blacklist_interpretation_prefix;
	if (g_str_has_prefix (blacklist_id, _tmp0_)) {
		gchar* app = NULL;
		gchar* _tmp1_;
		const gchar* _tmp2_;
		GeeHashSet* _tmp3_;
		GeeHashSet* _tmp4_;
		const gchar* _tmp5_;
		_tmp1_ = string_substring (blacklist_id, (glong) 4, (glong) -1);
		app = _tmp1_;
		_tmp2_ = app;
		g_signal_emit (self, alm_application_blacklist_signals[ALM_APPLICATION_BLACKLIST_APPLICATION_REMOVED_SIGNAL], 0, _tmp2_, ev);
		_tmp3_ = alm_application_blacklist_get_all_apps (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = app;
		if (gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp4_, _tmp5_)) {
			GeeHashSet* _tmp6_;
			GeeHashSet* _tmp7_;
			const gchar* _tmp8_;
			_tmp6_ = alm_application_blacklist_get_all_apps (self);
			_tmp7_ = _tmp6_;
			_tmp8_ = app;
			gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp7_, _tmp8_);
		}
		_g_free0 (app);
	}
}

void
alm_application_blacklist_block (AlmApplicationBlacklist* self,
                                 const gchar* application)
{
	ZeitgeistEvent* ev = NULL;
	ZeitgeistEvent* _tmp0_;
	ZeitgeistEvent* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	ZeitgeistSubject* sub = NULL;
	ZeitgeistSubject* _tmp4_;
	ZeitgeistEvent* _tmp5_;
	ZeitgeistSubject* _tmp6_;
	ZeitgeistEvent* launch_ev = NULL;
	ZeitgeistEvent* _tmp7_;
	ZeitgeistSubject* launch_sub = NULL;
	ZeitgeistSubject* _tmp8_;
	ZeitgeistSubject* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	ZeitgeistEvent* _tmp12_;
	ZeitgeistSubject* _tmp13_;
	AlmBlacklist* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	ZeitgeistEvent* _tmp18_;
	AlmBlacklist* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	ZeitgeistEvent* _tmp23_;
	GeeHashSet* _tmp24_;
	GeeHashSet* _tmp25_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (application != NULL);
	_tmp0_ = zeitgeist_event_new ();
	ev = _tmp0_;
	_tmp1_ = ev;
	_tmp2_ = g_strdup_printf ("application://%s", application);
	_tmp3_ = _tmp2_;
	zeitgeist_event_set_actor (_tmp1_, _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = zeitgeist_subject_new ();
	sub = _tmp4_;
	_tmp5_ = ev;
	_tmp6_ = sub;
	zeitgeist_event_add_subject (_tmp5_, _tmp6_);
	_tmp7_ = zeitgeist_event_new ();
	launch_ev = _tmp7_;
	_tmp8_ = zeitgeist_subject_new ();
	launch_sub = _tmp8_;
	_tmp9_ = launch_sub;
	_tmp10_ = g_strdup_printf ("application://%s", application);
	_tmp11_ = _tmp10_;
	zeitgeist_subject_set_uri (_tmp9_, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp12_ = launch_ev;
	_tmp13_ = launch_sub;
	zeitgeist_event_add_subject (_tmp12_, _tmp13_);
	_tmp14_ = self->priv->blacklist_interface;
	_tmp15_ = alm_application_blacklist_interpretation_prefix;
	_tmp16_ = g_strdup_printf ("%s%s", _tmp15_, application);
	_tmp17_ = _tmp16_;
	_tmp18_ = ev;
	alm_blacklist_add_template (_tmp14_, _tmp17_, _tmp18_);
	_g_free0 (_tmp17_);
	_tmp19_ = self->priv->blacklist_interface;
	_tmp20_ = alm_application_blacklist_launcher_prefix;
	_tmp21_ = g_strdup_printf ("%s%s", _tmp20_, application);
	_tmp22_ = _tmp21_;
	_tmp23_ = launch_ev;
	alm_blacklist_add_template (_tmp19_, _tmp22_, _tmp23_);
	_g_free0 (_tmp22_);
	_tmp24_ = alm_application_blacklist_get_all_apps (self);
	_tmp25_ = _tmp24_;
	if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp25_, application)) {
		GeeHashSet* _tmp26_;
		GeeHashSet* _tmp27_;
		_tmp26_ = alm_application_blacklist_get_all_apps (self);
		_tmp27_ = _tmp26_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp27_, application);
	}
	_g_object_unref0 (launch_sub);
	_g_object_unref0 (launch_ev);
	_g_object_unref0 (sub);
	_g_object_unref0 (ev);
}

void
alm_application_blacklist_unblock (AlmApplicationBlacklist* self,
                                   const gchar* application)
{
	AlmBlacklist* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	AlmBlacklist* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GeeHashSet* _tmp8_;
	GeeHashSet* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (application != NULL);
	_tmp0_ = self->priv->blacklist_interface;
	_tmp1_ = alm_application_blacklist_interpretation_prefix;
	_tmp2_ = g_strdup_printf ("%s%s", _tmp1_, application);
	_tmp3_ = _tmp2_;
	alm_blacklist_remove_template (_tmp0_, _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = self->priv->blacklist_interface;
	_tmp5_ = alm_application_blacklist_launcher_prefix;
	_tmp6_ = g_strdup_printf ("%s%s", _tmp5_, application);
	_tmp7_ = _tmp6_;
	alm_blacklist_remove_template (_tmp4_, _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = alm_application_blacklist_get_all_apps (self);
	_tmp9_ = _tmp8_;
	if (gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp9_, application)) {
		GeeHashSet* _tmp10_;
		GeeHashSet* _tmp11_;
		_tmp10_ = alm_application_blacklist_get_all_apps (self);
		_tmp11_ = _tmp10_;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp11_, application);
	}
}

GeeHashSet*
alm_application_blacklist_get_all_apps (AlmApplicationBlacklist* self)
{
	GeeHashSet* result;
	GeeHashSet* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->all_blocked_apps;
	result = _tmp0_;
	return result;
}

static void
g_cclosure_user_marshal_VOID__STRING_OBJECT (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_OBJECT) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer 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__STRING_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_object (param_values + 2), data2);
}

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

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

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

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

static gchar*
alm_value_application_blacklist_collect_value (GValue* value,
                                               guint n_collect_values,
                                               GTypeCValue* collect_values,
                                               guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		AlmApplicationBlacklist * 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 = alm_application_blacklist_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
alm_value_application_blacklist_lcopy_value (const GValue* value,
                                             guint n_collect_values,
                                             GTypeCValue* collect_values,
                                             guint collect_flags)
{
	AlmApplicationBlacklist ** 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 = alm_application_blacklist_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
alm_param_spec_application_blacklist (const gchar* name,
                                      const gchar* nick,
                                      const gchar* blurb,
                                      GType object_type,
                                      GParamFlags flags)
{
	AlmParamSpecApplicationBlacklist* spec;
	g_return_val_if_fail (g_type_is_a (object_type, ALM_TYPE_APPLICATION_BLACKLIST), 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
alm_value_get_application_blacklist (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ALM_TYPE_APPLICATION_BLACKLIST), NULL);
	return value->data[0].v_pointer;
}

void
alm_value_set_application_blacklist (GValue* value,
                                     gpointer v_object)
{
	AlmApplicationBlacklist * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ALM_TYPE_APPLICATION_BLACKLIST));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, ALM_TYPE_APPLICATION_BLACKLIST));
		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;
		alm_application_blacklist_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		alm_application_blacklist_unref (old);
	}
}

void
alm_value_take_application_blacklist (GValue* value,
                                      gpointer v_object)
{
	AlmApplicationBlacklist * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ALM_TYPE_APPLICATION_BLACKLIST));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, ALM_TYPE_APPLICATION_BLACKLIST));
		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) {
		alm_application_blacklist_unref (old);
	}
}

static void
alm_application_blacklist_class_init (AlmApplicationBlacklistClass * klass,
                                      gpointer klass_data)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	alm_application_blacklist_parent_class = g_type_class_peek_parent (klass);
	((AlmApplicationBlacklistClass *) klass)->finalize = alm_application_blacklist_finalize;
	g_type_class_adjust_private_offset (klass, &AlmApplicationBlacklist_private_offset);
	alm_application_blacklist_signals[ALM_APPLICATION_BLACKLIST_APPLICATION_ADDED_SIGNAL] = g_signal_new ("application-added", ALM_TYPE_APPLICATION_BLACKLIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_OBJECT, G_TYPE_NONE, 2, G_TYPE_STRING, ZEITGEIST_TYPE_EVENT);
	alm_application_blacklist_signals[ALM_APPLICATION_BLACKLIST_APPLICATION_REMOVED_SIGNAL] = g_signal_new ("application-removed", ALM_TYPE_APPLICATION_BLACKLIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_OBJECT, G_TYPE_NONE, 2, G_TYPE_STRING, ZEITGEIST_TYPE_EVENT);
	_tmp0_ = g_strdup ("app-");
	alm_application_blacklist_interpretation_prefix = _tmp0_;
	_tmp1_ = g_strdup ("launch-");
	alm_application_blacklist_launcher_prefix = _tmp1_;
}

static void
alm_application_blacklist_instance_init (AlmApplicationBlacklist * self,
                                         gpointer klass)
{
	self->priv = alm_application_blacklist_get_instance_private (self);
	self->ref_count = 1;
}

static void
alm_application_blacklist_finalize (AlmApplicationBlacklist * obj)
{
	AlmApplicationBlacklist * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_APPLICATION_BLACKLIST, AlmApplicationBlacklist);
	g_signal_handlers_destroy (self);
	_alm_blacklist_unref0 (self->priv->blacklist_interface);
	_g_object_unref0 (self->priv->all_blocked_apps);
}

static GType
alm_application_blacklist_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { alm_value_application_blacklist_init, alm_value_application_blacklist_free_value, alm_value_application_blacklist_copy_value, alm_value_application_blacklist_peek_pointer, "p", alm_value_application_blacklist_collect_value, "p", alm_value_application_blacklist_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (AlmApplicationBlacklistClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_application_blacklist_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmApplicationBlacklist), 0, (GInstanceInitFunc) alm_application_blacklist_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 alm_application_blacklist_type_id;
	alm_application_blacklist_type_id = g_type_register_fundamental (g_type_fundamental_next (), "AlmApplicationBlacklist", &g_define_type_info, &g_define_type_fundamental_info, 0);
	AlmApplicationBlacklist_private_offset = g_type_add_instance_private (alm_application_blacklist_type_id, sizeof (AlmApplicationBlacklistPrivate));
	return alm_application_blacklist_type_id;
}

GType
alm_application_blacklist_get_type (void)
{
	static volatile gsize alm_application_blacklist_type_id__once = 0;
	if (g_once_init_enter (&alm_application_blacklist_type_id__once)) {
		GType alm_application_blacklist_type_id;
		alm_application_blacklist_type_id = alm_application_blacklist_get_type_once ();
		g_once_init_leave (&alm_application_blacklist_type_id__once, alm_application_blacklist_type_id);
	}
	return alm_application_blacklist_type_id__once;
}

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

void
alm_application_blacklist_unref (gpointer instance)
{
	AlmApplicationBlacklist * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		ALM_APPLICATION_BLACKLIST_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
alm_applications_tree_view_get_instance_private (AlmApplicationsTreeView* self)
{
	return G_STRUCT_MEMBER_P (self, AlmApplicationsTreeView_private_offset);
}

static GType
alm_applications_tree_view_tree_view_cols_get_type_once (void)
{
	static const GEnumValue values[] = {{ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_APP_NAME, "ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_APP_NAME", "app-name"}, {ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_ICON, "ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_ICON", "icon"}, {ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_DESKTOP_FILE, "ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_DESKTOP_FILE", "desktop-file"}, {ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_N_COLS, "ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_N_COLS", "n-cols"}, {0, NULL, NULL}};
	GType alm_applications_tree_view_tree_view_cols_type_id;
	alm_applications_tree_view_tree_view_cols_type_id = g_enum_register_static ("AlmApplicationsTreeViewTreeViewCols", values);
	return alm_applications_tree_view_tree_view_cols_type_id;
}

static GType
alm_applications_tree_view_tree_view_cols_get_type (void)
{
	static volatile gsize alm_applications_tree_view_tree_view_cols_type_id__once = 0;
	if (g_once_init_enter (&alm_applications_tree_view_tree_view_cols_type_id__once)) {
		GType alm_applications_tree_view_tree_view_cols_type_id;
		alm_applications_tree_view_tree_view_cols_type_id = alm_applications_tree_view_tree_view_cols_get_type_once ();
		g_once_init_leave (&alm_applications_tree_view_tree_view_cols_type_id__once, alm_applications_tree_view_tree_view_cols_type_id);
	}
	return alm_applications_tree_view_tree_view_cols_type_id__once;
}

static gpointer
_alm_application_blacklist_ref0 (gpointer self)
{
	return self ? alm_application_blacklist_ref (self) : NULL;
}

static gpointer
_g_hash_table_ref0 (gpointer self)
{
	return self ? g_hash_table_ref (self) : NULL;
}

AlmApplicationsTreeView*
alm_applications_tree_view_construct (GType object_type,
                                      AlmApplicationBlacklist* app_blacklist,
                                      GHashTable* blocked,
                                      GHashTable* unblocked)
{
	AlmApplicationsTreeView * self = NULL;
	AlmApplicationBlacklist* _tmp0_;
	GHashTable* _tmp1_;
	GHashTable* _tmp2_;
	GtkListStore* _tmp3_;
	GtkListStore* _tmp4_;
	GtkTreeView* _tmp5_;
	GtkTreeView* _tmp6_;
	GtkTreeView* _tmp7_;
	g_return_val_if_fail (app_blacklist != NULL, NULL);
	g_return_val_if_fail (blocked != NULL, NULL);
	g_return_val_if_fail (unblocked != NULL, NULL);
	self = (AlmApplicationsTreeView*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
	_tmp0_ = _alm_application_blacklist_ref0 (app_blacklist);
	_alm_application_blacklist_unref0 (self->priv->app_blacklist);
	self->priv->app_blacklist = _tmp0_;
	_tmp1_ = _g_hash_table_ref0 (blocked);
	_g_hash_table_unref0 (self->priv->blocked_apps);
	self->priv->blocked_apps = _tmp1_;
	_tmp2_ = _g_hash_table_ref0 (unblocked);
	_g_hash_table_unref0 (self->priv->unblocked_apps);
	self->priv->unblocked_apps = _tmp2_;
	_tmp3_ = gtk_list_store_new ((gint) ALM_APPLICATIONS_TREE_VIEW_TREE_VIEW_COLS_N_COLS, G_TYPE_STRING, gdk_pixbuf_get_type (), G_TYPE_STRING, -1);
	_g_object_unref0 (self->priv->store);
	self->priv->store = _tmp3_;
	_tmp4_ = self->priv->store;
	_tmp5_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp4_);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->treeview);
	self->priv->treeview = _tmp5_;
	_tmp6_ = self->priv->treeview;
	gtk_tree_view_set_headers_visible (_tmp6_, FALSE);
	_tmp7_ = self->priv->treeview;
	gtk_tree_view_set_rules_hint (_tmp7_, TRUE);
	alm_applications_tree_view_set_up_ui (self);
	return self;
}

AlmApplicationsTreeView*
alm_applications_tree_view_new (AlmApplicationBlacklist* app_blacklist,
                                GHashTable* blocked,
                                GHashTable* unblocked)
{
	return alm_applications_tree_view_construct (ALM_TYPE_APPLICATIONS_TREE_VIEW, app_blacklist, blocked, unblocked);
}

static void
alm_applications_tree_view_set_up_ui (AlmApplicationsTreeView* self)
{
	GtkTreeViewColumn* column_pix_name = NULL;
	GtkTreeViewColumn* _tmp0_;
	GtkTreeView* _tmp1_;
	GtkCellRendererPixbuf* pix_rend = NULL;
	GtkCellRendererPixbuf* _tmp2_;
	GtkCellRendererText* name_rend = NULL;
	GtkCellRendererText* _tmp3_;
	GValue _tmp4_ = {0};
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp5_;
	GtkTreeView* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_tree_view_column_new ();
	g_object_ref_sink (_tmp0_);
	column_pix_name = _tmp0_;
	gtk_tree_view_column_set_title (column_pix_name, _ ("Name"));
	_tmp1_ = self->priv->treeview;
	gtk_tree_view_append_column (_tmp1_, column_pix_name);
	_tmp2_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	g_object_ref_sink (_tmp2_);
	pix_rend = _tmp2_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) pix_rend, FALSE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) pix_rend, "pixbuf", 1);
	_tmp3_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp3_);
	name_rend = _tmp3_;
	g_value_init (&_tmp4_, pango_ellipsize_mode_get_type ());
	g_value_set_enum (&_tmp4_, PANGO_ELLIPSIZE_END);
	g_object_set_property ((GObject*) name_rend, "ellipsize", &_tmp4_);
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) name_rend, TRUE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) name_rend, "markup", 0);
	gtk_tree_view_column_set_resizable (column_pix_name, TRUE);
	_tmp5_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp5_);
	scroll = _tmp5_;
	_tmp6_ = self->priv->treeview;
	gtk_container_add ((GtkContainer*) scroll, (GtkWidget*) _tmp6_);
	gtk_scrolled_window_set_policy (scroll, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN);
	gtk_container_set_border_width ((GtkContainer*) scroll, (guint) 1);
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) scroll, TRUE, TRUE, (guint) 0);
	_g_object_unref0 (scroll);
	_g_object_unref0 (name_rend);
	_g_object_unref0 (pix_rend);
	_g_object_unref0 (column_pix_name);
}

GdkPixbuf*
alm_applications_tree_view_get_pixbuf_from_gio_icon (GIcon* icon,
                                                     gint size)
{
	GdkPixbuf* pix = NULL;
	GtkIconTheme* theme = NULL;
	GtkIconTheme* _tmp0_;
	GtkIconTheme* _tmp1_;
	GtkIconInfo* icon_info = NULL;
	GError* _inner_error0_ = NULL;
	GdkPixbuf* result;
	pix = NULL;
	_tmp0_ = gtk_icon_theme_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	theme = _tmp1_;
	icon_info = NULL;
	if (icon == NULL) {
		GtkIconTheme* _tmp2_;
		GtkIconInfo* _tmp3_;
		_tmp2_ = theme;
		_tmp3_ = gtk_icon_theme_lookup_icon (_tmp2_, "gtk-execute", size, GTK_ICON_LOOKUP_FORCE_SIZE);
		_g_object_unref0 (icon_info);
		icon_info = _tmp3_;
	} else {
		GtkIconTheme* _tmp4_;
		GtkIconInfo* _tmp5_;
		GtkIconInfo* _tmp6_;
		_tmp4_ = theme;
		_tmp5_ = gtk_icon_theme_lookup_by_gicon (_tmp4_, icon, size, GTK_ICON_LOOKUP_FORCE_SIZE);
		_g_object_unref0 (icon_info);
		icon_info = _tmp5_;
		_tmp6_ = icon_info;
		if (_tmp6_ == NULL) {
			GtkIconTheme* _tmp7_;
			GtkIconInfo* _tmp8_;
			_tmp7_ = theme;
			_tmp8_ = gtk_icon_theme_lookup_icon (_tmp7_, "gtk-execute", size, GTK_ICON_LOOKUP_FORCE_SIZE);
			_g_object_unref0 (icon_info);
			icon_info = _tmp8_;
		}
	}
	{
		GdkPixbuf* _tmp9_ = NULL;
		GtkIconInfo* _tmp10_;
		GdkPixbuf* _tmp11_;
		GdkPixbuf* _tmp12_;
		_tmp10_ = icon_info;
		_tmp11_ = gtk_icon_info_load_icon (_tmp10_, &_inner_error0_);
		_tmp9_ = _tmp11_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp12_ = _tmp9_;
		_tmp9_ = NULL;
		_g_object_unref0 (pix);
		pix = _tmp12_;
		_g_object_unref0 (_tmp9_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = NULL;
		_g_object_unref0 (icon_info);
		_g_object_unref0 (theme);
		_g_object_unref0 (pix);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (icon_info);
		_g_object_unref0 (theme);
		_g_object_unref0 (pix);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = pix;
	_g_object_unref0 (icon_info);
	_g_object_unref0 (theme);
	return result;
}

gchar*
alm_applications_tree_view_markup_for_app (GDesktopAppInfo* app_info)
{
	gchar* app_name = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* description = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* result;
	g_return_val_if_fail (app_info != NULL, NULL);
	_tmp0_ = g_app_info_get_name ((GAppInfo*) app_info);
	_tmp1_ = g_strdup (_tmp0_);
	app_name = _tmp1_;
	_tmp2_ = g_app_info_get_description ((GAppInfo*) app_info);
	_tmp3_ = g_strdup (_tmp2_);
	description = _tmp3_;
	_tmp5_ = description;
	if (_tmp5_ != NULL) {
		const gchar* _tmp6_;
		_tmp6_ = description;
		_tmp4_ = _tmp6_;
	} else {
		_tmp4_ = _ ("No description available");
	}
	_tmp7_ = g_strdup (_tmp4_);
	_g_free0 (description);
	description = _tmp7_;
	_tmp8_ = app_name;
	_tmp9_ = g_markup_escape_text (_tmp8_, (gssize) -1);
	_tmp10_ = _tmp9_;
	_tmp11_ = description;
	_tmp12_ = g_markup_escape_text (_tmp11_, (gssize) -1);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strdup_printf ("<b>%s</b>\n%s", _tmp10_, _tmp13_);
	_tmp15_ = _tmp14_;
	_g_free0 (_tmp13_);
	_g_free0 (_tmp10_);
	result = _tmp15_;
	_g_free0 (description);
	_g_free0 (app_name);
	return result;
}

void
alm_applications_tree_view_add_application_to_view (AlmApplicationsTreeView* self,
                                                    const gchar* app)
{
	GDesktopAppInfo* app_info = NULL;
	GDesktopAppInfo* _tmp0_;
	GDesktopAppInfo* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (app != NULL);
	_tmp0_ = g_desktop_app_info_new (app);
	app_info = _tmp0_;
	_tmp1_ = app_info;
	if (_tmp1_ != NULL) {
		GdkPixbuf* pix = NULL;
		GDesktopAppInfo* _tmp2_;
		GIcon* _tmp3_;
		GdkPixbuf* _tmp4_;
		gchar* markup = NULL;
		GDesktopAppInfo* _tmp5_;
		gchar* _tmp6_;
		GtkTreeIter iter = {0};
		GtkListStore* _tmp7_;
		GtkListStore* _tmp8_;
		GtkTreeIter _tmp9_ = {0};
		GtkListStore* _tmp10_;
		GtkListStore* _tmp11_;
		GtkTreeIter _tmp12_;
		const gchar* _tmp13_;
		GdkPixbuf* _tmp14_;
		GHashTable* _tmp15_;
		gconstpointer _tmp16_;
		_tmp2_ = app_info;
		_tmp3_ = g_app_info_get_icon ((GAppInfo*) _tmp2_);
		_tmp4_ = alm_applications_tree_view_get_pixbuf_from_gio_icon (_tmp3_, 32);
		pix = _tmp4_;
		_tmp5_ = app_info;
		_tmp6_ = alm_applications_tree_view_markup_for_app (_tmp5_);
		markup = _tmp6_;
		_tmp7_ = alm_applications_tree_view_get_liststore (self);
		_tmp8_ = _tmp7_;
		gtk_list_store_append (_tmp8_, &_tmp9_);
		iter = _tmp9_;
		_tmp10_ = alm_applications_tree_view_get_liststore (self);
		_tmp11_ = _tmp10_;
		_tmp12_ = iter;
		_tmp13_ = markup;
		_tmp14_ = pix;
		gtk_list_store_set (_tmp11_, &_tmp12_, 0, _tmp13_, 1, _tmp14_, 2, app, -1, -1);
		_tmp15_ = self->priv->blocked_apps;
		_tmp16_ = g_hash_table_lookup (_tmp15_, app);
		if (((AlmAppChooseInfo*) _tmp16_) == NULL) {
			GHashTable* _tmp17_;
			gchar* _tmp18_;
			GDesktopAppInfo* _tmp19_;
			const gchar* _tmp20_;
			GDesktopAppInfo* _tmp21_;
			const gchar* _tmp22_;
			GdkPixbuf* _tmp23_;
			AlmAppChooseInfo* _tmp24_;
			_tmp17_ = self->priv->blocked_apps;
			_tmp18_ = g_strdup (app);
			_tmp19_ = app_info;
			_tmp20_ = g_app_info_get_id ((GAppInfo*) _tmp19_);
			_tmp21_ = app_info;
			_tmp22_ = g_app_info_get_name ((GAppInfo*) _tmp21_);
			_tmp23_ = pix;
			_tmp24_ = alm_app_choose_info_new (_tmp20_, _tmp22_, _tmp23_, "", (gint64) 0, (guint) 0);
			g_hash_table_insert (_tmp17_, _tmp18_, _tmp24_);
		}
		_g_free0 (markup);
		_g_object_unref0 (pix);
	}
	_g_object_unref0 (app_info);
}

void
alm_applications_tree_view_remove_app_from_view (AlmApplicationsTreeView* self,
                                                 const gchar* app)
{
	GtkTreeModel* model = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeModel* _tmp2_;
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (app != NULL);
	_tmp0_ = self->priv->treeview;
	_tmp1_ = gtk_tree_view_get_model (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	model = _tmp2_;
	_tmp3_ = model;
	gtk_tree_model_get_iter_first (_tmp3_, &_tmp4_);
	iter = _tmp4_;
	while (TRUE) {
		GValue can_app_value = {0};
		GtkTreeModel* _tmp5_;
		GtkTreeIter _tmp6_;
		GValue _tmp7_ = {0};
		gchar* can_app = NULL;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		const gchar* _tmp10_;
		gboolean more_entires = FALSE;
		GtkTreeModel* _tmp12_;
		gboolean _tmp13_;
		_tmp5_ = model;
		_tmp6_ = iter;
		gtk_tree_model_get_value (_tmp5_, &_tmp6_, 2, &_tmp7_);
		G_IS_VALUE (&can_app_value) ? (g_value_unset (&can_app_value), NULL) : NULL;
		can_app_value = _tmp7_;
		_tmp8_ = g_value_get_string (&can_app_value);
		_tmp9_ = g_strdup (_tmp8_);
		can_app = _tmp9_;
		_tmp10_ = can_app;
		if (g_strcmp0 (app, _tmp10_) == 0) {
			GtkListStore* _tmp11_;
			_tmp11_ = self->priv->store;
			gtk_list_store_remove (_tmp11_, &iter);
			_g_free0 (can_app);
			G_IS_VALUE (&can_app_value) ? (g_value_unset (&can_app_value), NULL) : NULL;
			break;
		}
		_tmp12_ = model;
		_tmp13_ = gtk_tree_model_iter_next (_tmp12_, &iter);
		more_entires = _tmp13_;
		if (!more_entires) {
			_g_free0 (can_app);
			G_IS_VALUE (&can_app_value) ? (g_value_unset (&can_app_value), NULL) : NULL;
			break;
		}
		_g_free0 (can_app);
		G_IS_VALUE (&can_app_value) ? (g_value_unset (&can_app_value), NULL) : NULL;
	}
	_g_object_unref0 (model);
}

gchar*
alm_applications_tree_view_remove_selected_app (AlmApplicationsTreeView* self)
{
	GtkTreeSelection* selection = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreeModel* model = NULL;
	GtkTreeIter iter = {0};
	gchar* app = NULL;
	GtkTreeSelection* _tmp3_;
	GtkTreeModel* _tmp4_ = NULL;
	GtkTreeIter _tmp5_ = {0};
	gboolean _tmp6_;
	GtkTreeModel* _tmp7_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->treeview;
	_tmp1_ = gtk_tree_view_get_selection (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	selection = _tmp2_;
	app = NULL;
	_tmp3_ = selection;
	_tmp6_ = gtk_tree_selection_get_selected (_tmp3_, &_tmp4_, &_tmp5_);
	_g_object_unref0 (model);
	_tmp7_ = _g_object_ref0 (_tmp4_);
	model = _tmp7_;
	iter = _tmp5_;
	if (_tmp6_) {
		GtkTreeModel* _tmp8_;
		GtkTreeIter _tmp9_;
		gchar* _tmp10_ = NULL;
		GtkListStore* _tmp11_;
		GtkListStore* _tmp12_;
		_tmp8_ = model;
		_tmp9_ = iter;
		gtk_tree_model_get (_tmp8_, &_tmp9_, 2, &_tmp10_, -1);
		_g_free0 (app);
		app = _tmp10_;
		_tmp11_ = alm_applications_tree_view_get_liststore (self);
		_tmp12_ = _tmp11_;
		gtk_list_store_remove (_tmp12_, &iter);
	}
	result = app;
	_g_object_unref0 (model);
	_g_object_unref0 (selection);
	return result;
}

GtkListStore*
alm_applications_tree_view_get_liststore (AlmApplicationsTreeView* self)
{
	GtkListStore* result;
	GtkListStore* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->store;
	result = _tmp0_;
	return result;
}

static void
alm_applications_tree_view_class_init (AlmApplicationsTreeViewClass * klass,
                                       gpointer klass_data)
{
	alm_applications_tree_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AlmApplicationsTreeView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_alm_applications_tree_view_get_property;
	G_OBJECT_CLASS (klass)->finalize = alm_applications_tree_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ALM_APPLICATIONS_TREE_VIEW_LISTSTORE_PROPERTY, alm_applications_tree_view_properties[ALM_APPLICATIONS_TREE_VIEW_LISTSTORE_PROPERTY] = g_param_spec_object ("liststore", "liststore", "liststore", gtk_list_store_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
alm_applications_tree_view_instance_init (AlmApplicationsTreeView * self,
                                          gpointer klass)
{
	self->priv = alm_applications_tree_view_get_instance_private (self);
}

static void
alm_applications_tree_view_finalize (GObject * obj)
{
	AlmApplicationsTreeView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_APPLICATIONS_TREE_VIEW, AlmApplicationsTreeView);
	_alm_application_blacklist_unref0 (self->priv->app_blacklist);
	_g_object_unref0 (self->priv->store);
	_g_object_unref0 (self->priv->treeview);
	_g_hash_table_unref0 (self->priv->blocked_apps);
	_g_hash_table_unref0 (self->priv->unblocked_apps);
	G_OBJECT_CLASS (alm_applications_tree_view_parent_class)->finalize (obj);
}

static GType
alm_applications_tree_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AlmApplicationsTreeViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_applications_tree_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmApplicationsTreeView), 0, (GInstanceInitFunc) alm_applications_tree_view_instance_init, NULL };
	GType alm_applications_tree_view_type_id;
	alm_applications_tree_view_type_id = g_type_register_static (gtk_box_get_type (), "AlmApplicationsTreeView", &g_define_type_info, 0);
	AlmApplicationsTreeView_private_offset = g_type_add_instance_private (alm_applications_tree_view_type_id, sizeof (AlmApplicationsTreeViewPrivate));
	return alm_applications_tree_view_type_id;
}

GType
alm_applications_tree_view_get_type (void)
{
	static volatile gsize alm_applications_tree_view_type_id__once = 0;
	if (g_once_init_enter (&alm_applications_tree_view_type_id__once)) {
		GType alm_applications_tree_view_type_id;
		alm_applications_tree_view_type_id = alm_applications_tree_view_get_type_once ();
		g_once_init_leave (&alm_applications_tree_view_type_id__once, alm_applications_tree_view_type_id);
	}
	return alm_applications_tree_view_type_id__once;
}

static void
_vala_alm_applications_tree_view_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	AlmApplicationsTreeView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ALM_TYPE_APPLICATIONS_TREE_VIEW, AlmApplicationsTreeView);
	switch (property_id) {
		case ALM_APPLICATIONS_TREE_VIEW_LISTSTORE_PROPERTY:
		g_value_set_object (value, alm_applications_tree_view_get_liststore (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
alm_app_selection_tree_view_get_instance_private (AlmAppSelectionTreeView* self)
{
	return G_STRUCT_MEMBER_P (self, AlmAppSelectionTreeView_private_offset);
}

static GType
alm_app_selection_tree_view_tree_view_cols_get_type_once (void)
{
	static const GEnumValue values[] = {{ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_APP_NAME, "ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_APP_NAME", "app-name"}, {ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_ICON, "ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_ICON", "icon"}, {ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_DESKTOP_FILE, "ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_DESKTOP_FILE", "desktop-file"}, {ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_LAST_ACCESSED_STRING, "ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_LAST_ACCESSED_STRING", "last-accessed-string"}, {ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_LAST_ACCESSED_INT, "ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_LAST_ACCESSED_INT", "last-accessed-int"}, {ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_USAGE, "ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_USAGE", "usage"}, {ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_N_COLS, "ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_N_COLS", "n-cols"}, {0, NULL, NULL}};
	GType alm_app_selection_tree_view_tree_view_cols_type_id;
	alm_app_selection_tree_view_tree_view_cols_type_id = g_enum_register_static ("AlmAppSelectionTreeViewTreeViewCols", values);
	return alm_app_selection_tree_view_tree_view_cols_type_id;
}

static GType
alm_app_selection_tree_view_tree_view_cols_get_type (void)
{
	static volatile gsize alm_app_selection_tree_view_tree_view_cols_type_id__once = 0;
	if (g_once_init_enter (&alm_app_selection_tree_view_tree_view_cols_type_id__once)) {
		GType alm_app_selection_tree_view_tree_view_cols_type_id;
		alm_app_selection_tree_view_tree_view_cols_type_id = alm_app_selection_tree_view_tree_view_cols_get_type_once ();
		g_once_init_leave (&alm_app_selection_tree_view_tree_view_cols_type_id__once, alm_app_selection_tree_view_tree_view_cols_type_id);
	}
	return alm_app_selection_tree_view_tree_view_cols_type_id__once;
}

AlmAppSelectionTreeView*
alm_app_selection_tree_view_construct (GType object_type,
                                       AlmApplicationBlacklist* app_blacklist)
{
	AlmAppSelectionTreeView * self = NULL;
	AlmApplicationBlacklist* _tmp0_;
	GtkListStore* _tmp1_;
	GtkListStore* _tmp2_;
	GtkTreeView* _tmp3_;
	GtkTreeView* _tmp4_;
	GtkTreeView* _tmp5_;
	g_return_val_if_fail (app_blacklist != NULL, NULL);
	self = (AlmAppSelectionTreeView*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
	_tmp0_ = _alm_application_blacklist_ref0 (app_blacklist);
	_alm_application_blacklist_unref0 (self->priv->app_blacklist);
	self->priv->app_blacklist = _tmp0_;
	_tmp1_ = gtk_list_store_new ((gint) ALM_APP_SELECTION_TREE_VIEW_TREE_VIEW_COLS_N_COLS, G_TYPE_STRING, gdk_pixbuf_get_type (), G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT64, G_TYPE_UINT, -1);
	_g_object_unref0 (self->priv->store);
	self->priv->store = _tmp1_;
	_tmp2_ = self->priv->store;
	_tmp3_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp2_);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->treeview);
	self->priv->treeview = _tmp3_;
	_tmp4_ = self->priv->treeview;
	gtk_tree_view_set_headers_visible (_tmp4_, TRUE);
	_tmp5_ = self->priv->treeview;
	gtk_tree_view_set_rules_hint (_tmp5_, TRUE);
	alm_app_selection_tree_view_set_up_ui (self);
	return self;
}

AlmAppSelectionTreeView*
alm_app_selection_tree_view_new (AlmApplicationBlacklist* app_blacklist)
{
	return alm_app_selection_tree_view_construct (ALM_TYPE_APP_SELECTION_TREE_VIEW, app_blacklist);
}

static void
alm_app_selection_tree_view_set_up_ui (AlmAppSelectionTreeView* self)
{
	GtkTreeViewColumn* column_pix_name = NULL;
	GtkTreeViewColumn* _tmp0_;
	GtkTreeView* _tmp1_;
	GtkCellRendererPixbuf* pix_rend = NULL;
	GtkCellRendererPixbuf* _tmp2_;
	GtkCellRendererText* name_rend = NULL;
	GtkCellRendererText* _tmp3_;
	GValue _tmp4_ = {0};
	GtkTreeViewColumn* column_used_name = NULL;
	GtkTreeViewColumn* _tmp5_;
	GtkTreeView* _tmp6_;
	GtkCellRendererText* used_rend = NULL;
	GtkCellRendererText* _tmp7_;
	GValue _tmp8_ = {0};
	GValue _tmp9_ = {0};
	GtkTreeViewColumn* column_usage_name = NULL;
	GtkTreeViewColumn* _tmp10_;
	GtkTreeView* _tmp11_;
	AlmUsageCellRenderer* usage_rend = NULL;
	AlmUsageCellRenderer* _tmp12_;
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp13_;
	GtkTreeView* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_tree_view_column_new ();
	g_object_ref_sink (_tmp0_);
	column_pix_name = _tmp0_;
	gtk_tree_view_column_set_title (column_pix_name, _ ("Name"));
	_tmp1_ = self->priv->treeview;
	gtk_tree_view_append_column (_tmp1_, column_pix_name);
	_tmp2_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
	g_object_ref_sink (_tmp2_);
	pix_rend = _tmp2_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) pix_rend, FALSE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) pix_rend, "pixbuf", 1);
	_tmp3_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp3_);
	name_rend = _tmp3_;
	g_value_init (&_tmp4_, pango_ellipsize_mode_get_type ());
	g_value_set_enum (&_tmp4_, PANGO_ELLIPSIZE_END);
	g_object_set_property ((GObject*) name_rend, "ellipsize", &_tmp4_);
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) name_rend, TRUE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_pix_name, (GtkCellRenderer*) name_rend, "text", 0);
	gtk_tree_view_column_set_resizable (column_pix_name, TRUE);
	gtk_tree_view_column_set_min_width (column_pix_name, 200);
	gtk_tree_view_column_set_max_width (column_pix_name, 400);
	gtk_tree_view_column_set_sort_column_id (column_pix_name, 0);
	_tmp5_ = gtk_tree_view_column_new ();
	g_object_ref_sink (_tmp5_);
	column_used_name = _tmp5_;
	gtk_tree_view_column_set_title (column_used_name, _ ("Last Used"));
	_tmp6_ = self->priv->treeview;
	gtk_tree_view_append_column (_tmp6_, column_used_name);
	_tmp7_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp7_);
	used_rend = _tmp7_;
	g_value_init (&_tmp8_, pango_ellipsize_mode_get_type ());
	g_value_set_enum (&_tmp8_, PANGO_ELLIPSIZE_END);
	g_object_set_property ((GObject*) used_rend, "ellipsize", &_tmp8_);
	G_IS_VALUE (&_tmp8_) ? (g_value_unset (&_tmp8_), NULL) : NULL;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column_used_name, (GtkCellRenderer*) used_rend, TRUE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_used_name, (GtkCellRenderer*) used_rend, "text", 3);
	gtk_tree_view_column_set_resizable (column_used_name, TRUE);
	gtk_tree_view_column_set_min_width (column_used_name, 200);
	gtk_tree_view_column_set_max_width (column_used_name, 400);
	gtk_tree_view_column_set_sort_column_id (column_used_name, 4);
	g_value_init (&_tmp9_, G_TYPE_INT);
	g_value_set_int (&_tmp9_, 0);
	g_object_set_property ((GObject*) used_rend, "xalign", &_tmp9_);
	G_IS_VALUE (&_tmp9_) ? (g_value_unset (&_tmp9_), NULL) : NULL;
	_tmp10_ = gtk_tree_view_column_new ();
	g_object_ref_sink (_tmp10_);
	column_usage_name = _tmp10_;
	gtk_tree_view_column_set_title (column_usage_name, _ ("Activity"));
	_tmp11_ = self->priv->treeview;
	gtk_tree_view_append_column (_tmp11_, column_usage_name);
	_tmp12_ = alm_usage_cell_renderer_new ();
	g_object_ref_sink (_tmp12_);
	usage_rend = _tmp12_;
	gtk_cell_layout_pack_start ((GtkCellLayout*) column_usage_name, (GtkCellRenderer*) usage_rend, TRUE);
	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_usage_name, (GtkCellRenderer*) usage_rend, "usage", 5);
	gtk_tree_view_column_set_sort_column_id (column_usage_name, 5);
	gtk_tree_view_column_clicked (column_usage_name);
	gtk_tree_view_column_clicked (column_usage_name);
	_tmp13_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp13_);
	scroll = _tmp13_;
	_tmp14_ = self->priv->treeview;
	gtk_container_add ((GtkContainer*) scroll, (GtkWidget*) _tmp14_);
	gtk_scrolled_window_set_policy (scroll, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN);
	gtk_container_set_border_width ((GtkContainer*) scroll, (guint) 1);
	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) scroll, TRUE, TRUE, (guint) 0);
	_g_object_unref0 (scroll);
	_g_object_unref0 (usage_rend);
	_g_object_unref0 (column_usage_name);
	_g_object_unref0 (used_rend);
	_g_object_unref0 (column_used_name);
	_g_object_unref0 (name_rend);
	_g_object_unref0 (pix_rend);
	_g_object_unref0 (column_pix_name);
}

GtkTreeView*
alm_app_selection_tree_view_get_tree (AlmAppSelectionTreeView* self)
{
	GtkTreeView* result;
	GtkTreeView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->treeview;
	result = _tmp0_;
	return result;
}

GtkListStore*
alm_app_selection_tree_view_get_liststore (AlmAppSelectionTreeView* self)
{
	GtkListStore* result;
	GtkListStore* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->store;
	result = _tmp0_;
	return result;
}

static void
alm_app_selection_tree_view_class_init (AlmAppSelectionTreeViewClass * klass,
                                        gpointer klass_data)
{
	alm_app_selection_tree_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AlmAppSelectionTreeView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_alm_app_selection_tree_view_get_property;
	G_OBJECT_CLASS (klass)->finalize = alm_app_selection_tree_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ALM_APP_SELECTION_TREE_VIEW_TREE_PROPERTY, alm_app_selection_tree_view_properties[ALM_APP_SELECTION_TREE_VIEW_TREE_PROPERTY] = g_param_spec_object ("tree", "tree", "tree", gtk_tree_view_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ALM_APP_SELECTION_TREE_VIEW_LISTSTORE_PROPERTY, alm_app_selection_tree_view_properties[ALM_APP_SELECTION_TREE_VIEW_LISTSTORE_PROPERTY] = g_param_spec_object ("liststore", "liststore", "liststore", gtk_list_store_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
alm_app_selection_tree_view_instance_init (AlmAppSelectionTreeView * self,
                                           gpointer klass)
{
	self->priv = alm_app_selection_tree_view_get_instance_private (self);
}

static void
alm_app_selection_tree_view_finalize (GObject * obj)
{
	AlmAppSelectionTreeView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_APP_SELECTION_TREE_VIEW, AlmAppSelectionTreeView);
	_alm_application_blacklist_unref0 (self->priv->app_blacklist);
	_g_object_unref0 (self->priv->store);
	_g_object_unref0 (self->priv->treeview);
	G_OBJECT_CLASS (alm_app_selection_tree_view_parent_class)->finalize (obj);
}

static GType
alm_app_selection_tree_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AlmAppSelectionTreeViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_app_selection_tree_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmAppSelectionTreeView), 0, (GInstanceInitFunc) alm_app_selection_tree_view_instance_init, NULL };
	GType alm_app_selection_tree_view_type_id;
	alm_app_selection_tree_view_type_id = g_type_register_static (gtk_box_get_type (), "AlmAppSelectionTreeView", &g_define_type_info, 0);
	AlmAppSelectionTreeView_private_offset = g_type_add_instance_private (alm_app_selection_tree_view_type_id, sizeof (AlmAppSelectionTreeViewPrivate));
	return alm_app_selection_tree_view_type_id;
}

GType
alm_app_selection_tree_view_get_type (void)
{
	static volatile gsize alm_app_selection_tree_view_type_id__once = 0;
	if (g_once_init_enter (&alm_app_selection_tree_view_type_id__once)) {
		GType alm_app_selection_tree_view_type_id;
		alm_app_selection_tree_view_type_id = alm_app_selection_tree_view_get_type_once ();
		g_once_init_leave (&alm_app_selection_tree_view_type_id__once, alm_app_selection_tree_view_type_id);
	}
	return alm_app_selection_tree_view_type_id__once;
}

static void
_vala_alm_app_selection_tree_view_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	AlmAppSelectionTreeView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ALM_TYPE_APP_SELECTION_TREE_VIEW, AlmAppSelectionTreeView);
	switch (property_id) {
		case ALM_APP_SELECTION_TREE_VIEW_TREE_PROPERTY:
		g_value_set_object (value, alm_app_selection_tree_view_get_tree (self));
		break;
		case ALM_APP_SELECTION_TREE_VIEW_LISTSTORE_PROPERTY:
		g_value_set_object (value, alm_app_selection_tree_view_get_liststore (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
alm_applications_chooser_dialog_get_instance_private (AlmApplicationsChooserDialog* self)
{
	return G_STRUCT_MEMBER_P (self, AlmApplicationsChooserDialog_private_offset);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_vala_GtkTreeIter_free (GtkTreeIter* self)
{
	g_boxed_free (gtk_tree_iter_get_type (), self);
}

static void
__vala_GtkTreeIter_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (_vala_GtkTreeIter_free (var), NULL));
}

AlmApplicationsChooserDialog*
alm_applications_chooser_dialog_construct (GType object_type,
                                           AlmApplicationBlacklist* app_blacklist,
                                           GHashTable* blocked_list,
                                           GHashTable* unblocked_list)
{
	AlmApplicationsChooserDialog * self = NULL;
	AlmApplicationBlacklist* _tmp0_;
	GHashTable* _tmp1_;
	GHashTable* _tmp2_;
	GHashFunc _tmp3_;
	GEqualFunc _tmp4_;
	GHashTable* _tmp5_;
	AlmApplicationBlacklist* _tmp6_;
	g_return_val_if_fail (app_blacklist != NULL, NULL);
	g_return_val_if_fail (blocked_list != NULL, NULL);
	g_return_val_if_fail (unblocked_list != NULL, NULL);
	self = (AlmApplicationsChooserDialog*) g_object_new (object_type, NULL);
	_tmp0_ = _alm_application_blacklist_ref0 (app_blacklist);
	_alm_application_blacklist_unref0 (self->priv->app_blacklist);
	self->priv->app_blacklist = _tmp0_;
	_tmp1_ = _g_hash_table_ref0 (blocked_list);
	_g_hash_table_unref0 (self->priv->blocked_apps);
	self->priv->blocked_apps = _tmp1_;
	_tmp2_ = _g_hash_table_ref0 (unblocked_list);
	_g_hash_table_unref0 (self->priv->unblocked_apps);
	self->priv->unblocked_apps = _tmp2_;
	_tmp3_ = g_str_hash;
	_tmp4_ = g_str_equal;
	_tmp5_ = g_hash_table_new_full (_tmp3_, _tmp4_, _g_free0_, __vala_GtkTreeIter_free0_);
	_g_hash_table_unref0 (self->priv->actors_iter);
	self->priv->actors_iter = _tmp5_;
	gtk_window_set_title ((GtkWindow*) self, _ ("Select Application"));
	gtk_window_set_destroy_with_parent ((GtkWindow*) self, TRUE);
	gtk_widget_set_size_request ((GtkWidget*) self, 600, 400);
	gtk_window_set_skip_taskbar_hint ((GtkWindow*) self, TRUE);
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 12);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	alm_applications_chooser_dialog_set_up_ui (self);
	_tmp6_ = self->priv->app_blacklist;
	alm_application_blacklist_get_all_applications (_tmp6_, self);
	return self;
}

AlmApplicationsChooserDialog*
alm_applications_chooser_dialog_new (AlmApplicationBlacklist* app_blacklist,
                                     GHashTable* blocked_list,
                                     GHashTable* unblocked_list)
{
	return alm_applications_chooser_dialog_construct (ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG, app_blacklist, blocked_list, unblocked_list);
}

static gint
alm_applications_chooser_dialog_compare_dates (AlmApplicationsChooserDialog* self,
                                               GDateTime* now,
                                               GDateTime* time)
{
	gint res = 0;
	gint now_y = 0;
	gint now_m = 0;
	gint now_d = 0;
	gint time_y = 0;
	gint time_m = 0;
	gint time_d = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (now != NULL, -1);
	g_return_val_if_fail (time != NULL, -1);
	res = -1;
	g_date_time_get_ymd (now, &_tmp0_, &_tmp1_, &_tmp2_);
	now_y = _tmp0_;
	now_m = _tmp1_;
	now_d = _tmp2_;
	g_date_time_get_ymd (time, &_tmp3_, &_tmp4_, &_tmp5_);
	time_y = _tmp3_;
	time_m = _tmp4_;
	time_d = _tmp5_;
	if (now_y == time_y) {
		_tmp7_ = now_m == time_m;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		_tmp6_ = now_d == time_d;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		result = 0;
		return result;
	} else {
		gboolean _tmp8_ = FALSE;
		gboolean _tmp9_ = FALSE;
		if (now_y == time_y) {
			_tmp9_ = now_m == time_m;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			_tmp8_ = now_d == (time_d + 1);
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			result = 1;
			return result;
		}
	}
	result = res;
	return result;
}

static gint64*
_int64_dup (gint64* self)
{
	gint64* dup;
	dup = g_new0 (gint64, 1);
	memcpy (dup, self, sizeof (gint64));
	return dup;
}

static gpointer
__int64_dup0 (gpointer self)
{
	return self ? _int64_dup (self) : NULL;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

void
alm_applications_chooser_dialog_handle_app_population (AlmApplicationsChooserDialog* self,
                                                       GHashTable* all_actors)
{
	GHashTable* _tmp0_;
	GList* all_infos = NULL;
	GList* _tmp1_;
	GList* other_appinfo = NULL;
	GList* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (all_actors != NULL);
	_tmp0_ = _g_hash_table_ref0 (all_actors);
	_g_hash_table_unref0 (self->priv->all_actors_list);
	self->priv->all_actors_list = _tmp0_;
	_tmp1_ = g_app_info_get_all ();
	all_infos = _tmp1_;
	other_appinfo = NULL;
	_tmp2_ = all_infos;
	{
		GList* app_info_collection = NULL;
		GList* app_info_it = NULL;
		app_info_collection = _tmp2_;
		for (app_info_it = app_info_collection; app_info_it != NULL; app_info_it = app_info_it->next) {
			GAppInfo* _tmp3_;
			GAppInfo* app_info = NULL;
			_tmp3_ = _g_object_ref0 ((GAppInfo*) app_info_it->data);
			app_info = _tmp3_;
			{
				gchar* id = NULL;
				GAppInfo* _tmp4_;
				const gchar* _tmp5_;
				gchar* _tmp6_;
				gint64* last_accessed_time = NULL;
				const gchar* _tmp7_;
				gconstpointer _tmp8_;
				gint64* _tmp9_;
				gint64* _tmp10_;
				_tmp4_ = app_info;
				_tmp5_ = g_app_info_get_id (_tmp4_);
				_tmp6_ = g_strdup (_tmp5_);
				id = _tmp6_;
				_tmp7_ = id;
				_tmp8_ = g_hash_table_lookup (all_actors, _tmp7_);
				_tmp9_ = __int64_dup0 ((gint64*) _tmp8_);
				last_accessed_time = _tmp9_;
				_tmp10_ = last_accessed_time;
				if (_tmp10_ != NULL) {
					GDateTime* time = NULL;
					gint64* _tmp11_;
					GDateTime* _tmp12_;
					GDateTime* now = NULL;
					GDateTime* _tmp13_;
					gint res = 0;
					GDateTime* _tmp14_;
					GDateTime* _tmp15_;
					gchar* last_accessed = NULL;
					gchar* _tmp16_;
					GAppInfo* _tmp23_;
					const gchar* _tmp24_;
					gint64* _tmp25_;
					_tmp11_ = last_accessed_time;
					_tmp12_ = g_date_time_new_from_unix_local ((*_tmp11_) / 1000);
					time = _tmp12_;
					_tmp13_ = g_date_time_new_now_local ();
					now = _tmp13_;
					_tmp14_ = now;
					_tmp15_ = time;
					res = alm_applications_chooser_dialog_compare_dates (self, _tmp14_, _tmp15_);
					_tmp16_ = g_strdup ("");
					last_accessed = _tmp16_;
					if (res == 0) {
						GDateTime* _tmp17_;
						gchar* _tmp18_;
						_tmp17_ = time;
						_tmp18_ = g_date_time_format (_tmp17_, _ ("Today, %H:%M"));
						_g_free0 (last_accessed);
						last_accessed = _tmp18_;
					} else {
						if (res == 1) {
							GDateTime* _tmp19_;
							gchar* _tmp20_;
							_tmp19_ = time;
							_tmp20_ = g_date_time_format (_tmp19_, _ ("Yesterday, %H:%M"));
							_g_free0 (last_accessed);
							last_accessed = _tmp20_;
						} else {
							GDateTime* _tmp21_;
							gchar* _tmp22_;
							_tmp21_ = time;
							_tmp22_ = g_date_time_format (_tmp21_, _ ("%e %B %Y, %H:%M"));
							_g_free0 (last_accessed);
							last_accessed = _tmp22_;
						}
					}
					_tmp23_ = app_info;
					_tmp24_ = last_accessed;
					_tmp25_ = last_accessed_time;
					alm_applications_chooser_dialog_insert_liststore (self, _tmp23_, _tmp24_, *_tmp25_, (guint) 0);
					_g_free0 (last_accessed);
					_g_date_time_unref0 (now);
					_g_date_time_unref0 (time);
				} else {
					GAppInfo* _tmp26_;
					GAppInfo* _tmp27_;
					GAppInfo* _tmp28_;
					_tmp26_ = app_info;
					_tmp27_ = _g_object_ref0 (_tmp26_);
					other_appinfo = g_list_append (other_appinfo, _tmp27_);
					_tmp28_ = app_info;
					alm_applications_chooser_dialog_insert_liststore (self, _tmp28_, _ ("Never"), (gint64) 0, (guint) 0);
				}
				_g_free0 (last_accessed_time);
				_g_free0 (id);
				_g_object_unref0 (app_info);
			}
		}
	}
	(other_appinfo == NULL) ? NULL : (other_appinfo = (_g_list_free__g_object_unref0_ (other_appinfo), NULL));
	(all_infos == NULL) ? NULL : (all_infos = (_g_list_free__g_object_unref0_ (all_infos), NULL));
}

static gpointer
_alm_app_choose_info_ref0 (gpointer self)
{
	return self ? alm_app_choose_info_ref (self) : NULL;
}

void
alm_applications_chooser_dialog_insert_liststore (AlmApplicationsChooserDialog* self,
                                                  GAppInfo* app_info,
                                                  const gchar* last_accessed,
                                                  gint64 last_accessed_time,
                                                  guint usage)
{
	gchar* id = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* name = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GIcon* icon = NULL;
	GIcon* _tmp4_;
	GIcon* _tmp5_;
	GdkPixbuf* pix = NULL;
	GIcon* _tmp6_;
	GdkPixbuf* _tmp7_;
	AlmAppChooseInfo* app_choose_info = NULL;
	GHashTable* _tmp8_;
	const gchar* _tmp9_;
	gconstpointer _tmp10_;
	AlmAppChooseInfo* _tmp11_;
	AlmAppChooseInfo* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (app_info != NULL);
	g_return_if_fail (last_accessed != NULL);
	_tmp0_ = g_app_info_get_id (app_info);
	_tmp1_ = g_strdup (_tmp0_);
	id = _tmp1_;
	_tmp2_ = g_app_info_get_name (app_info);
	_tmp3_ = g_strdup (_tmp2_);
	name = _tmp3_;
	_tmp4_ = g_app_info_get_icon (app_info);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	icon = _tmp5_;
	_tmp6_ = icon;
	_tmp7_ = alm_applications_tree_view_get_pixbuf_from_gio_icon (_tmp6_, 32);
	pix = _tmp7_;
	_tmp8_ = self->priv->blocked_apps;
	_tmp9_ = id;
	_tmp10_ = g_hash_table_lookup (_tmp8_, _tmp9_);
	_tmp11_ = _alm_app_choose_info_ref0 ((AlmAppChooseInfo*) _tmp10_);
	app_choose_info = _tmp11_;
	_tmp12_ = app_choose_info;
	if (_tmp12_ == NULL) {
		GtkTreeIter iter = {0};
		AlmAppSelectionTreeView* _tmp13_;
		GtkListStore* _tmp14_;
		GtkListStore* _tmp15_;
		GtkTreeIter _tmp16_ = {0};
		AlmAppSelectionTreeView* _tmp17_;
		GtkListStore* _tmp18_;
		GtkListStore* _tmp19_;
		GtkTreeIter _tmp20_;
		const gchar* _tmp21_;
		GdkPixbuf* _tmp22_;
		const gchar* _tmp23_;
		GHashTable* _tmp24_;
		const gchar* _tmp25_;
		gchar* _tmp26_;
		const gchar* _tmp27_;
		const gchar* _tmp28_;
		GdkPixbuf* _tmp29_;
		AlmAppChooseInfo* _tmp30_;
		_tmp13_ = self->priv->treeview;
		_tmp14_ = alm_app_selection_tree_view_get_liststore (_tmp13_);
		_tmp15_ = _tmp14_;
		gtk_list_store_append (_tmp15_, &_tmp16_);
		iter = _tmp16_;
		_tmp17_ = self->priv->treeview;
		_tmp18_ = alm_app_selection_tree_view_get_liststore (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = iter;
		_tmp21_ = name;
		_tmp22_ = pix;
		_tmp23_ = id;
		gtk_list_store_set (_tmp19_, &_tmp20_, 0, _tmp21_, 1, _tmp22_, 2, _tmp23_, 3, last_accessed, 4, last_accessed_time, 5, 0, -1, -1);
		_tmp24_ = self->priv->blocked_apps;
		_tmp25_ = id;
		_tmp26_ = g_strdup (_tmp25_);
		_tmp27_ = id;
		_tmp28_ = name;
		_tmp29_ = pix;
		_tmp30_ = alm_app_choose_info_new (_tmp27_, _tmp28_, _tmp29_, last_accessed, last_accessed_time, usage);
		g_hash_table_insert (_tmp24_, _tmp26_, _tmp30_);
		if (last_accessed_time > ((gint64) 0)) {
			AlmApplicationBlacklist* _tmp31_;
			const gchar* _tmp32_;
			GtkTreeIter _tmp33_;
			AlmAppSelectionTreeView* _tmp34_;
			GtkListStore* _tmp35_;
			GtkListStore* _tmp36_;
			_tmp31_ = self->priv->app_blacklist;
			_tmp32_ = id;
			_tmp33_ = iter;
			_tmp34_ = self->priv->treeview;
			_tmp35_ = alm_app_selection_tree_view_get_liststore (_tmp34_);
			_tmp36_ = _tmp35_;
			alm_application_blacklist_get_count_for_app (_tmp31_, _tmp32_, &_tmp33_, _tmp36_);
		}
	} else {
		AlmAppChooseInfo* _tmp37_;
		AlmAppChooseInfo* _tmp38_;
		_tmp37_ = app_choose_info;
		alm_app_choose_info_set_last_accessed (_tmp37_, last_accessed);
		_tmp38_ = app_choose_info;
		alm_app_choose_info_set_usage (_tmp38_, (guint) 0);
	}
	_alm_app_choose_info_unref0 (app_choose_info);
	_g_object_unref0 (pix);
	_g_object_unref0 (icon);
	_g_free0 (name);
	_g_free0 (id);
}

void
alm_applications_chooser_dialog_insert_app_liststore (AlmApplicationsChooserDialog* self,
                                                      const gchar* app)
{
	AlmAppChooseInfo* app_choose_info = NULL;
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	AlmAppChooseInfo* _tmp2_;
	AlmAppChooseInfo* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (app != NULL);
	_tmp0_ = self->priv->unblocked_apps;
	_tmp1_ = g_hash_table_lookup (_tmp0_, app);
	_tmp2_ = _alm_app_choose_info_ref0 ((AlmAppChooseInfo*) _tmp1_);
	app_choose_info = _tmp2_;
	_tmp3_ = app_choose_info;
	if (_tmp3_ != NULL) {
		GtkTreeIter iter = {0};
		AlmAppSelectionTreeView* _tmp4_;
		GtkListStore* _tmp5_;
		GtkListStore* _tmp6_;
		GtkTreeIter _tmp7_ = {0};
		AlmAppSelectionTreeView* _tmp8_;
		GtkListStore* _tmp9_;
		GtkListStore* _tmp10_;
		GtkTreeIter _tmp11_;
		AlmAppChooseInfo* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		AlmAppChooseInfo* _tmp15_;
		GdkPixbuf* _tmp16_;
		GdkPixbuf* _tmp17_;
		AlmAppChooseInfo* _tmp18_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		AlmAppChooseInfo* _tmp21_;
		gint64 _tmp22_;
		gint64 _tmp23_;
		AlmApplicationBlacklist* _tmp24_;
		AlmAppChooseInfo* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		GtkTreeIter _tmp28_;
		AlmAppSelectionTreeView* _tmp29_;
		GtkListStore* _tmp30_;
		GtkListStore* _tmp31_;
		_tmp4_ = self->priv->treeview;
		_tmp5_ = alm_app_selection_tree_view_get_liststore (_tmp4_);
		_tmp6_ = _tmp5_;
		gtk_list_store_insert (_tmp6_, &_tmp7_, 1);
		iter = _tmp7_;
		_tmp8_ = self->priv->treeview;
		_tmp9_ = alm_app_selection_tree_view_get_liststore (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = iter;
		_tmp12_ = app_choose_info;
		_tmp13_ = alm_app_choose_info_get_name (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = app_choose_info;
		_tmp16_ = alm_app_choose_info_get_icon (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = app_choose_info;
		_tmp19_ = alm_app_choose_info_get_last_accessed (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = app_choose_info;
		_tmp22_ = alm_app_choose_info_get_last_accessed_time (_tmp21_);
		_tmp23_ = _tmp22_;
		gtk_list_store_set (_tmp10_, &_tmp11_, 0, _tmp14_, 1, _tmp17_, 2, app, 3, _tmp20_, 4, _tmp23_, -1, -1);
		_tmp24_ = self->priv->app_blacklist;
		_tmp25_ = app_choose_info;
		_tmp26_ = alm_app_choose_info_get_id (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = iter;
		_tmp29_ = self->priv->treeview;
		_tmp30_ = alm_app_selection_tree_view_get_liststore (_tmp29_);
		_tmp31_ = _tmp30_;
		alm_application_blacklist_get_count_for_app (_tmp24_, _tmp27_, &_tmp28_, _tmp31_);
		_g_free0 (_tmp27_);
	}
	_alm_app_choose_info_unref0 (app_choose_info);
}

static void
alm_applications_chooser_dialog_set_up_ui (AlmApplicationsChooserDialog* self)
{
	AlmApplicationBlacklist* _tmp0_;
	AlmAppSelectionTreeView* _tmp1_;
	GtkBox* area = NULL;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	AlmAppSelectionTreeView* _tmp4_;
	AlmAppSelectionTreeView* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app_blacklist;
	_tmp1_ = alm_app_selection_tree_view_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->treeview);
	self->priv->treeview = _tmp1_;
	_tmp2_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_box_get_type ()) ? ((GtkBox*) _tmp2_) : NULL);
	area = _tmp3_;
	_tmp4_ = self->priv->treeview;
	gtk_box_pack_start (area, (GtkWidget*) _tmp4_, TRUE, TRUE, (guint) 0);
	gtk_dialog_add_buttons ((GtkDialog*) self, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
	_tmp5_ = self->priv->treeview;
	gtk_widget_show_all ((GtkWidget*) _tmp5_);
	_g_object_unref0 (area);
}

GtkTreeView*
alm_applications_chooser_dialog_get_tree (AlmApplicationsChooserDialog* self)
{
	GtkTreeView* result;
	AlmAppSelectionTreeView* _tmp0_;
	GtkTreeView* _tmp1_;
	GtkTreeView* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->treeview;
	_tmp1_ = alm_app_selection_tree_view_get_tree (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

GtkListStore*
alm_applications_chooser_dialog_get_liststore (AlmApplicationsChooserDialog* self)
{
	GtkListStore* result;
	AlmAppSelectionTreeView* _tmp0_;
	GtkListStore* _tmp1_;
	GtkListStore* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->treeview;
	_tmp1_ = alm_app_selection_tree_view_get_liststore (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
alm_applications_chooser_dialog_class_init (AlmApplicationsChooserDialogClass * klass,
                                            gpointer klass_data)
{
	alm_applications_chooser_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AlmApplicationsChooserDialog_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_alm_applications_chooser_dialog_get_property;
	G_OBJECT_CLASS (klass)->finalize = alm_applications_chooser_dialog_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ALM_APPLICATIONS_CHOOSER_DIALOG_TREE_PROPERTY, alm_applications_chooser_dialog_properties[ALM_APPLICATIONS_CHOOSER_DIALOG_TREE_PROPERTY] = g_param_spec_object ("tree", "tree", "tree", gtk_tree_view_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ALM_APPLICATIONS_CHOOSER_DIALOG_LISTSTORE_PROPERTY, alm_applications_chooser_dialog_properties[ALM_APPLICATIONS_CHOOSER_DIALOG_LISTSTORE_PROPERTY] = g_param_spec_object ("liststore", "liststore", "liststore", gtk_list_store_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
alm_applications_chooser_dialog_instance_init (AlmApplicationsChooserDialog * self,
                                               gpointer klass)
{
	self->priv = alm_applications_chooser_dialog_get_instance_private (self);
}

static void
alm_applications_chooser_dialog_finalize (GObject * obj)
{
	AlmApplicationsChooserDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG, AlmApplicationsChooserDialog);
	_alm_application_blacklist_unref0 (self->priv->app_blacklist);
	_g_object_unref0 (self->priv->treeview);
	_g_hash_table_unref0 (self->priv->all_actors_list);
	_g_hash_table_unref0 (self->priv->actors_iter);
	_g_hash_table_unref0 (self->priv->blocked_apps);
	_g_hash_table_unref0 (self->priv->unblocked_apps);
	G_OBJECT_CLASS (alm_applications_chooser_dialog_parent_class)->finalize (obj);
}

static GType
alm_applications_chooser_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AlmApplicationsChooserDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_applications_chooser_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmApplicationsChooserDialog), 0, (GInstanceInitFunc) alm_applications_chooser_dialog_instance_init, NULL };
	GType alm_applications_chooser_dialog_type_id;
	alm_applications_chooser_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "AlmApplicationsChooserDialog", &g_define_type_info, 0);
	AlmApplicationsChooserDialog_private_offset = g_type_add_instance_private (alm_applications_chooser_dialog_type_id, sizeof (AlmApplicationsChooserDialogPrivate));
	return alm_applications_chooser_dialog_type_id;
}

GType
alm_applications_chooser_dialog_get_type (void)
{
	static volatile gsize alm_applications_chooser_dialog_type_id__once = 0;
	if (g_once_init_enter (&alm_applications_chooser_dialog_type_id__once)) {
		GType alm_applications_chooser_dialog_type_id;
		alm_applications_chooser_dialog_type_id = alm_applications_chooser_dialog_get_type_once ();
		g_once_init_leave (&alm_applications_chooser_dialog_type_id__once, alm_applications_chooser_dialog_type_id);
	}
	return alm_applications_chooser_dialog_type_id__once;
}

static void
_vala_alm_applications_chooser_dialog_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	AlmApplicationsChooserDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ALM_TYPE_APPLICATIONS_CHOOSER_DIALOG, AlmApplicationsChooserDialog);
	switch (property_id) {
		case ALM_APPLICATIONS_CHOOSER_DIALOG_TREE_PROPERTY:
		g_value_set_object (value, alm_applications_chooser_dialog_get_tree (self));
		break;
		case ALM_APPLICATIONS_CHOOSER_DIALOG_LISTSTORE_PROPERTY:
		g_value_set_object (value, alm_applications_chooser_dialog_get_liststore (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
alm_usage_cell_renderer_get_instance_private (AlmUsageCellRenderer* self)
{
	return G_STRUCT_MEMBER_P (self, AlmUsageCellRenderer_private_offset);
}

AlmUsageCellRenderer*
alm_usage_cell_renderer_construct (GType object_type)
{
	AlmUsageCellRenderer * self = NULL;
	self = (AlmUsageCellRenderer*) g_object_new (object_type, NULL);
	self->priv->usage_num = 0;
	return self;
}

AlmUsageCellRenderer*
alm_usage_cell_renderer_new (void)
{
	return alm_usage_cell_renderer_construct (ALM_TYPE_USAGE_CELL_RENDERER);
}

static void
alm_usage_cell_renderer_real_get_size (GtkCellRenderer* base,
                                       GtkWidget* widget,
                                       GdkRectangle* cell_area,
                                       gint* x_offset,
                                       gint* y_offset,
                                       gint* width,
                                       gint* height)
{
	AlmUsageCellRenderer * self;
	gint _vala_x_offset = 0;
	gint _vala_y_offset = 0;
	gint _vala_width = 0;
	gint _vala_height = 0;
	self = (AlmUsageCellRenderer*) base;
	g_return_if_fail (widget != NULL);
	_vala_x_offset = ALM_USAGE_CELL_RENDERER_xpadding;
	_vala_y_offset = ALM_USAGE_CELL_RENDERER_ypadding;
	_vala_width = ((ALM_USAGE_CELL_RENDERER_RECT_WIDTH * ALM_USAGE_CELL_RENDERER_RECT_NUM) + (ALM_USAGE_CELL_RENDERER_xpadding * 2)) + (ALM_USAGE_CELL_RENDERER_RECT_SPACING * 9);
	_vala_height = ALM_USAGE_CELL_RENDERER_RECT_HEIGHT + (ALM_USAGE_CELL_RENDERER_ypadding * 2);
	if (x_offset) {
		*x_offset = _vala_x_offset;
	}
	if (y_offset) {
		*y_offset = _vala_y_offset;
	}
	if (width) {
		*width = _vala_width;
	}
	if (height) {
		*height = _vala_height;
	}
}

static void
alm_usage_cell_renderer_real_render (GtkCellRenderer* base,
                                     cairo_t* ctx,
                                     GtkWidget* widget,
                                     GdkRectangle* background_area,
                                     GdkRectangle* cell_area,
                                     GtkCellRendererState flags)
{
	AlmUsageCellRenderer * self;
	gint x = 0;
	GdkRectangle _tmp0_;
	gint y = 0;
	GdkRectangle _tmp1_;
	self = (AlmUsageCellRenderer*) base;
	g_return_if_fail (ctx != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (background_area != NULL);
	g_return_if_fail (cell_area != NULL);
	_tmp0_ = *cell_area;
	x = _tmp0_.x + ALM_USAGE_CELL_RENDERER_xpadding;
	_tmp1_ = *cell_area;
	y = _tmp1_.y + ALM_USAGE_CELL_RENDERER_ypadding;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_;
				gint _tmp5_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = alm_usage_cell_renderer_get_usage (self);
				_tmp5_ = _tmp4_;
				if (!(i < _tmp5_)) {
					break;
				}
				cairo_set_source_rgb (ctx, 0.4, 0.4, 0.4);
				cairo_rectangle (ctx, (gdouble) x, (gdouble) y, (gdouble) ALM_USAGE_CELL_RENDERER_RECT_WIDTH, (gdouble) ALM_USAGE_CELL_RENDERER_RECT_HEIGHT);
				cairo_fill (ctx);
				x += ALM_USAGE_CELL_RENDERER_RECT_SPACING + ALM_USAGE_CELL_RENDERER_RECT_WIDTH;
			}
		}
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				gint _tmp8_;
				gint _tmp9_;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				_tmp8_ = alm_usage_cell_renderer_get_usage (self);
				_tmp9_ = _tmp8_;
				if (!(i < (ALM_USAGE_CELL_RENDERER_RECT_NUM - _tmp9_))) {
					break;
				}
				cairo_set_source_rgb (ctx, 0.7, 0.7, 0.7);
				cairo_rectangle (ctx, (gdouble) x, (gdouble) y, (gdouble) ALM_USAGE_CELL_RENDERER_RECT_WIDTH, (gdouble) ALM_USAGE_CELL_RENDERER_RECT_HEIGHT);
				cairo_fill (ctx);
				x += ALM_USAGE_CELL_RENDERER_RECT_SPACING + ALM_USAGE_CELL_RENDERER_RECT_WIDTH;
			}
		}
	}
}

gint
alm_usage_cell_renderer_get_usage (AlmUsageCellRenderer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->usage_num;
	return result;
}

void
alm_usage_cell_renderer_set_usage (AlmUsageCellRenderer* self,
                                   gint value)
{
	g_return_if_fail (self != NULL);
	if (value > 10) {
		self->priv->usage_num = 10;
	} else {
		self->priv->usage_num = value;
	}
	g_object_notify_by_pspec ((GObject *) self, alm_usage_cell_renderer_properties[ALM_USAGE_CELL_RENDERER_USAGE_PROPERTY]);
}

static void
alm_usage_cell_renderer_class_init (AlmUsageCellRendererClass * klass,
                                    gpointer klass_data)
{
	alm_usage_cell_renderer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AlmUsageCellRenderer_private_offset);
	((GtkCellRendererClass *) klass)->get_size = (void (*) (GtkCellRenderer*, GtkWidget*, GdkRectangle*, gint*, gint*, gint*, gint*)) alm_usage_cell_renderer_real_get_size;
	((GtkCellRendererClass *) klass)->render = (void (*) (GtkCellRenderer*, cairo_t*, GtkWidget*, GdkRectangle*, GdkRectangle*, GtkCellRendererState)) alm_usage_cell_renderer_real_render;
	G_OBJECT_CLASS (klass)->get_property = _vala_alm_usage_cell_renderer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_alm_usage_cell_renderer_set_property;
	G_OBJECT_CLASS (klass)->finalize = alm_usage_cell_renderer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ALM_USAGE_CELL_RENDERER_USAGE_PROPERTY, alm_usage_cell_renderer_properties[ALM_USAGE_CELL_RENDERER_USAGE_PROPERTY] = g_param_spec_int ("usage", "usage", "usage", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
alm_usage_cell_renderer_instance_init (AlmUsageCellRenderer * self,
                                       gpointer klass)
{
	self->priv = alm_usage_cell_renderer_get_instance_private (self);
}

static void
alm_usage_cell_renderer_finalize (GObject * obj)
{
	AlmUsageCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_USAGE_CELL_RENDERER, AlmUsageCellRenderer);
	G_OBJECT_CLASS (alm_usage_cell_renderer_parent_class)->finalize (obj);
}

static GType
alm_usage_cell_renderer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AlmUsageCellRendererClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_usage_cell_renderer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmUsageCellRenderer), 0, (GInstanceInitFunc) alm_usage_cell_renderer_instance_init, NULL };
	GType alm_usage_cell_renderer_type_id;
	alm_usage_cell_renderer_type_id = g_type_register_static (gtk_cell_renderer_get_type (), "AlmUsageCellRenderer", &g_define_type_info, 0);
	AlmUsageCellRenderer_private_offset = g_type_add_instance_private (alm_usage_cell_renderer_type_id, sizeof (AlmUsageCellRendererPrivate));
	return alm_usage_cell_renderer_type_id;
}

GType
alm_usage_cell_renderer_get_type (void)
{
	static volatile gsize alm_usage_cell_renderer_type_id__once = 0;
	if (g_once_init_enter (&alm_usage_cell_renderer_type_id__once)) {
		GType alm_usage_cell_renderer_type_id;
		alm_usage_cell_renderer_type_id = alm_usage_cell_renderer_get_type_once ();
		g_once_init_leave (&alm_usage_cell_renderer_type_id__once, alm_usage_cell_renderer_type_id);
	}
	return alm_usage_cell_renderer_type_id__once;
}

static void
_vala_alm_usage_cell_renderer_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	AlmUsageCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ALM_TYPE_USAGE_CELL_RENDERER, AlmUsageCellRenderer);
	switch (property_id) {
		case ALM_USAGE_CELL_RENDERER_USAGE_PROPERTY:
		g_value_set_int (value, alm_usage_cell_renderer_get_usage (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_alm_usage_cell_renderer_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	AlmUsageCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ALM_TYPE_USAGE_CELL_RENDERER, AlmUsageCellRenderer);
	switch (property_id) {
		case ALM_USAGE_CELL_RENDERER_USAGE_PROPERTY:
		alm_usage_cell_renderer_set_usage (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
alm_app_choose_info_get_instance_private (AlmAppChooseInfo* self)
{
	return G_STRUCT_MEMBER_P (self, AlmAppChooseInfo_private_offset);
}

AlmAppChooseInfo*
alm_app_choose_info_construct (GType object_type,
                               const gchar* id,
                               const gchar* app_name,
                               GdkPixbuf* app_icon,
                               const gchar* last_accessed_time_s,
                               gint64 last_accessed_time_i,
                               guint usage_rating)
{
	AlmAppChooseInfo* self = NULL;
	gchar* _tmp0_;
	GdkPixbuf* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (app_name != NULL, NULL);
	g_return_val_if_fail (last_accessed_time_s != NULL, NULL);
	self = (AlmAppChooseInfo*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (app_name);
	_g_free0 (self->priv->app_name);
	self->priv->app_name = _tmp0_;
	_tmp1_ = _g_object_ref0 (app_icon);
	_g_object_unref0 (self->priv->app_icon);
	self->priv->app_icon = _tmp1_;
	_tmp2_ = g_strdup (last_accessed_time_s);
	_g_free0 (self->priv->last_accessed_time_s);
	self->priv->last_accessed_time_s = _tmp2_;
	self->priv->last_accessed_time_i = last_accessed_time_i;
	self->priv->usage_rating = usage_rating;
	_tmp3_ = g_strdup (id);
	_g_free0 (self->priv->app_id);
	self->priv->app_id = _tmp3_;
	return self;
}

AlmAppChooseInfo*
alm_app_choose_info_new (const gchar* id,
                         const gchar* app_name,
                         GdkPixbuf* app_icon,
                         const gchar* last_accessed_time_s,
                         gint64 last_accessed_time_i,
                         guint usage_rating)
{
	return alm_app_choose_info_construct (ALM_TYPE_APP_CHOOSE_INFO, id, app_name, app_icon, last_accessed_time_s, last_accessed_time_i, usage_rating);
}

gchar*
alm_app_choose_info_get_id (AlmAppChooseInfo* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->app_id;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

const gchar*
alm_app_choose_info_get_name (AlmAppChooseInfo* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->app_name;
	result = _tmp0_;
	return result;
}

void
alm_app_choose_info_set_name (AlmAppChooseInfo* self,
                              const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->app_name);
	self->priv->app_name = _tmp0_;
}

GdkPixbuf*
alm_app_choose_info_get_icon (AlmAppChooseInfo* self)
{
	GdkPixbuf* result;
	GdkPixbuf* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->app_icon;
	result = _tmp0_;
	return result;
}

void
alm_app_choose_info_set_icon (AlmAppChooseInfo* self,
                              GdkPixbuf* value)
{
	GdkPixbuf* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->app_icon);
	self->priv->app_icon = _tmp0_;
}

const gchar*
alm_app_choose_info_get_last_accessed (AlmAppChooseInfo* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->last_accessed_time_s;
	result = _tmp0_;
	return result;
}

void
alm_app_choose_info_set_last_accessed (AlmAppChooseInfo* self,
                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->last_accessed_time_s);
	self->priv->last_accessed_time_s = _tmp0_;
}

gint64
alm_app_choose_info_get_last_accessed_time (AlmAppChooseInfo* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->last_accessed_time_i;
	return result;
}

void
alm_app_choose_info_set_last_accessed_time (AlmAppChooseInfo* self,
                                            gint64 value)
{
	g_return_if_fail (self != NULL);
	self->priv->last_accessed_time_i = value;
}

guint
alm_app_choose_info_get_usage (AlmAppChooseInfo* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->usage_rating;
	return result;
}

void
alm_app_choose_info_set_usage (AlmAppChooseInfo* self,
                               guint value)
{
	g_return_if_fail (self != NULL);
	self->priv->usage_rating = value;
}

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

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

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

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

static gchar*
alm_value_app_choose_info_collect_value (GValue* value,
                                         guint n_collect_values,
                                         GTypeCValue* collect_values,
                                         guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		AlmAppChooseInfo * 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 = alm_app_choose_info_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
alm_value_app_choose_info_lcopy_value (const GValue* value,
                                       guint n_collect_values,
                                       GTypeCValue* collect_values,
                                       guint collect_flags)
{
	AlmAppChooseInfo ** 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 = alm_app_choose_info_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
alm_param_spec_app_choose_info (const gchar* name,
                                const gchar* nick,
                                const gchar* blurb,
                                GType object_type,
                                GParamFlags flags)
{
	AlmParamSpecAppChooseInfo* spec;
	g_return_val_if_fail (g_type_is_a (object_type, ALM_TYPE_APP_CHOOSE_INFO), 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
alm_value_get_app_choose_info (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ALM_TYPE_APP_CHOOSE_INFO), NULL);
	return value->data[0].v_pointer;
}

void
alm_value_set_app_choose_info (GValue* value,
                               gpointer v_object)
{
	AlmAppChooseInfo * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ALM_TYPE_APP_CHOOSE_INFO));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, ALM_TYPE_APP_CHOOSE_INFO));
		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;
		alm_app_choose_info_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		alm_app_choose_info_unref (old);
	}
}

void
alm_value_take_app_choose_info (GValue* value,
                                gpointer v_object)
{
	AlmAppChooseInfo * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, ALM_TYPE_APP_CHOOSE_INFO));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, ALM_TYPE_APP_CHOOSE_INFO));
		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) {
		alm_app_choose_info_unref (old);
	}
}

static void
alm_app_choose_info_class_init (AlmAppChooseInfoClass * klass,
                                gpointer klass_data)
{
	alm_app_choose_info_parent_class = g_type_class_peek_parent (klass);
	((AlmAppChooseInfoClass *) klass)->finalize = alm_app_choose_info_finalize;
	g_type_class_adjust_private_offset (klass, &AlmAppChooseInfo_private_offset);
}

static void
alm_app_choose_info_instance_init (AlmAppChooseInfo * self,
                                   gpointer klass)
{
	self->priv = alm_app_choose_info_get_instance_private (self);
	self->ref_count = 1;
}

static void
alm_app_choose_info_finalize (AlmAppChooseInfo * obj)
{
	AlmAppChooseInfo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ALM_TYPE_APP_CHOOSE_INFO, AlmAppChooseInfo);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->app_id);
	_g_free0 (self->priv->app_name);
	_g_object_unref0 (self->priv->app_icon);
	_g_free0 (self->priv->last_accessed_time_s);
}

static GType
alm_app_choose_info_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { alm_value_app_choose_info_init, alm_value_app_choose_info_free_value, alm_value_app_choose_info_copy_value, alm_value_app_choose_info_peek_pointer, "p", alm_value_app_choose_info_collect_value, "p", alm_value_app_choose_info_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (AlmAppChooseInfoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) alm_app_choose_info_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AlmAppChooseInfo), 0, (GInstanceInitFunc) alm_app_choose_info_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 alm_app_choose_info_type_id;
	alm_app_choose_info_type_id = g_type_register_fundamental (g_type_fundamental_next (), "AlmAppChooseInfo", &g_define_type_info, &g_define_type_fundamental_info, 0);
	AlmAppChooseInfo_private_offset = g_type_add_instance_private (alm_app_choose_info_type_id, sizeof (AlmAppChooseInfoPrivate));
	return alm_app_choose_info_type_id;
}

GType
alm_app_choose_info_get_type (void)
{
	static volatile gsize alm_app_choose_info_type_id__once = 0;
	if (g_once_init_enter (&alm_app_choose_info_type_id__once)) {
		GType alm_app_choose_info_type_id;
		alm_app_choose_info_type_id = alm_app_choose_info_get_type_once ();
		g_once_init_leave (&alm_app_choose_info_type_id__once, alm_app_choose_info_type_id);
	}
	return alm_app_choose_info_type_id__once;
}

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

void
alm_app_choose_info_unref (gpointer instance)
{
	AlmAppChooseInfo * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		ALM_APP_CHOOSE_INFO_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

