1
/* public-item.c generated by valac 0.12.0, the Vala compiler
2
* generated from public-item.vala, do not modify */
5
* Copyright (C) 2011 Canonical Ltd.
7
* This program is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License version 3, as published
9
* by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranties of
13
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
19
* Authored by Neil Jagdish Patel <njpatel@gmail.com>
23
#include <glib-object.h>
25
#include <gwibber-gtk.h>
32
#define TYPE_TAB_BAR_ITEM (tab_bar_item_get_type ())
33
#define TAB_BAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAB_BAR_ITEM, TabBarItem))
34
#define TAB_BAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAB_BAR_ITEM, TabBarItemClass))
35
#define IS_TAB_BAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAB_BAR_ITEM))
36
#define IS_TAB_BAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAB_BAR_ITEM))
37
#define TAB_BAR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAB_BAR_ITEM, TabBarItemClass))
39
typedef struct _TabBarItem TabBarItem;
40
typedef struct _TabBarItemClass TabBarItemClass;
41
typedef struct _TabBarItemPrivate TabBarItemPrivate;
43
#define TYPE_PUBLIC_ITEM (public_item_get_type ())
44
#define PUBLIC_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PUBLIC_ITEM, PublicItem))
45
#define PUBLIC_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PUBLIC_ITEM, PublicItemClass))
46
#define IS_PUBLIC_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PUBLIC_ITEM))
47
#define IS_PUBLIC_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PUBLIC_ITEM))
48
#define PUBLIC_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PUBLIC_ITEM, PublicItemClass))
50
typedef struct _PublicItem PublicItem;
51
typedef struct _PublicItemClass PublicItemClass;
52
typedef struct _PublicItemPrivate PublicItemPrivate;
53
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
56
GtkButton parent_instance;
57
TabBarItemPrivate * priv;
60
struct _TabBarItemClass {
61
GtkButtonClass parent_class;
62
GtkWidget* (*get_toolbar) (TabBarItem* self);
63
GtkWidget* (*get_view) (TabBarItem* self);
67
TabBarItem parent_instance;
68
PublicItemPrivate * priv;
71
struct _PublicItemClass {
72
TabBarItemClass parent_class;
75
struct _PublicItemPrivate {
76
GwibberGtkStreamView* _view;
80
static gpointer public_item_parent_class = NULL;
82
GType tab_bar_item_get_type (void) G_GNUC_CONST;
83
GType public_item_get_type (void) G_GNUC_CONST;
84
#define PUBLIC_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PUBLIC_ITEM, PublicItemPrivate))
86
PUBLIC_ITEM_DUMMY_PROPERTY
88
PublicItem* public_item_new (GeeHashMap* streams);
89
PublicItem* public_item_construct (GType object_type, GeeHashMap* streams);
90
static void public_item_on_row_added (PublicItem* self);
91
static GtkWidget* public_item_real_get_toolbar (TabBarItem* base);
92
static GtkWidget* public_item_real_get_view (TabBarItem* base);
93
static GObject * public_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
94
GeeHashMap* tab_bar_item_get_streams (TabBarItem* self);
95
const gchar* tab_bar_item_get_stream (TabBarItem* self);
96
static void _public_item_on_row_added_dee_model_row_added (DeeModel* _sender, DeeModelIter* iter, gpointer self);
97
static void public_item_finalize (GObject* obj);
100
PublicItem* public_item_construct (GType object_type, GeeHashMap* streams) {
101
PublicItem * self = NULL;
102
g_return_val_if_fail (streams != NULL, NULL);
103
self = (PublicItem*) g_object_new (object_type, "stream", "public", "icon-name", "web-browser", "tooltip", "Public", "streams", streams, NULL);
108
PublicItem* public_item_new (GeeHashMap* streams) {
109
return public_item_construct (TYPE_PUBLIC_ITEM, streams);
113
static void public_item_on_row_added (PublicItem* self) {
114
g_return_if_fail (self != NULL);
115
gtk_widget_set_no_show_all ((GtkWidget*) self, FALSE);
116
gtk_widget_show_all ((GtkWidget*) self);
120
static GtkWidget* public_item_real_get_toolbar (TabBarItem* base) {
122
GtkWidget* result = NULL;
123
self = (PublicItem*) base;
129
static gpointer _g_object_ref0 (gpointer self) {
130
return self ? g_object_ref (self) : NULL;
134
static GtkWidget* public_item_real_get_view (TabBarItem* base) {
136
GtkWidget* result = NULL;
138
self = (PublicItem*) base;
139
_tmp0_ = _g_object_ref0 ((GtkWidget*) self->priv->_view);
145
static void _public_item_on_row_added_dee_model_row_added (DeeModel* _sender, DeeModelIter* iter, gpointer self) {
146
public_item_on_row_added (self);
150
static GObject * public_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
152
GObjectClass * parent_class;
154
GwibberGtkStreamView* _tmp0_ = NULL;
155
GeeHashMap* _tmp1_ = NULL;
156
const gchar* _tmp2_ = NULL;
157
gpointer _tmp3_ = NULL;
159
const gchar* _tmp5_ = NULL;
160
DeeModel* _tmp6_ = NULL;
161
parent_class = G_OBJECT_CLASS (public_item_parent_class);
162
obj = parent_class->constructor (type, n_construct_properties, construct_properties);
163
self = PUBLIC_ITEM (obj);
164
_tmp0_ = gwibber_gtk_stream_view_new ();
165
_g_object_unref0 (self->priv->_view);
166
self->priv->_view = g_object_ref_sink (_tmp0_);
167
_tmp1_ = tab_bar_item_get_streams ((TabBarItem*) self);
168
_tmp2_ = tab_bar_item_get_stream ((TabBarItem*) self);
169
_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
170
_tmp4_ = (DeeModel*) _tmp3_;
171
gwibber_gtk_stream_view_set_model (self->priv->_view, _tmp4_);
172
_g_object_unref0 (_tmp4_);
173
_tmp5_ = tab_bar_item_get_stream ((TabBarItem*) self);
174
gwibber_gtk_stream_view_set_stream (self->priv->_view, _tmp5_);
175
gtk_widget_set_no_show_all ((GtkWidget*) self, TRUE);
176
_tmp6_ = gwibber_gtk_stream_view_get_model (self->priv->_view);
177
g_signal_connect_object (_tmp6_, "row-added", (GCallback) _public_item_on_row_added_dee_model_row_added, self, 0);
182
static void public_item_class_init (PublicItemClass * klass) {
183
public_item_parent_class = g_type_class_peek_parent (klass);
184
g_type_class_add_private (klass, sizeof (PublicItemPrivate));
185
TAB_BAR_ITEM_CLASS (klass)->get_toolbar = public_item_real_get_toolbar;
186
TAB_BAR_ITEM_CLASS (klass)->get_view = public_item_real_get_view;
187
G_OBJECT_CLASS (klass)->constructor = public_item_constructor;
188
G_OBJECT_CLASS (klass)->finalize = public_item_finalize;
192
static void public_item_instance_init (PublicItem * self) {
193
self->priv = PUBLIC_ITEM_GET_PRIVATE (self);
197
static void public_item_finalize (GObject* obj) {
199
self = PUBLIC_ITEM (obj);
200
_g_object_unref0 (self->priv->_view);
201
G_OBJECT_CLASS (public_item_parent_class)->finalize (obj);
205
GType public_item_get_type (void) {
206
static volatile gsize public_item_type_id__volatile = 0;
207
if (g_once_init_enter (&public_item_type_id__volatile)) {
208
static const GTypeInfo g_define_type_info = { sizeof (PublicItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) public_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublicItem), 0, (GInstanceInitFunc) public_item_instance_init, NULL };
209
GType public_item_type_id;
210
public_item_type_id = g_type_register_static (TYPE_TAB_BAR_ITEM, "PublicItem", &g_define_type_info, 0);
211
g_once_init_leave (&public_item_type_id__volatile, public_item_type_id);
213
return public_item_type_id__volatile;