~ubuntu-branches/ubuntu/precise/gwibber/precise

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/* home-item.c generated by valac 0.15.2, the Vala compiler
 * generated from home-item.vala, do not modify */

/*
 * Copyright (C) 2011 Canonical Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 3, as published
 * by the Free Software Foundation.

 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by Neil Jagdish Patel <njpatel@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "gwibber-gtk.h"
#include <gee.h>
#include <glib/gi18n-lib.h>


#define TYPE_TAB_BAR_ITEM (tab_bar_item_get_type ())
#define TAB_BAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAB_BAR_ITEM, TabBarItem))
#define TAB_BAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAB_BAR_ITEM, TabBarItemClass))
#define IS_TAB_BAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAB_BAR_ITEM))
#define IS_TAB_BAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAB_BAR_ITEM))
#define TAB_BAR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAB_BAR_ITEM, TabBarItemClass))

typedef struct _TabBarItem TabBarItem;
typedef struct _TabBarItemClass TabBarItemClass;
typedef struct _TabBarItemPrivate TabBarItemPrivate;

#define TYPE_STREAM_ENTRY (stream_entry_get_type ())
#define STREAM_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STREAM_ENTRY, StreamEntry))
#define STREAM_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STREAM_ENTRY, StreamEntryClass))
#define IS_STREAM_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STREAM_ENTRY))
#define IS_STREAM_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STREAM_ENTRY))
#define STREAM_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STREAM_ENTRY, StreamEntryClass))

typedef struct _StreamEntry StreamEntry;
typedef struct _StreamEntryClass StreamEntryClass;

#define TYPE_TAB_BAR_STREAM_ITEM (tab_bar_stream_item_get_type ())
#define TAB_BAR_STREAM_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAB_BAR_STREAM_ITEM, TabBarStreamItem))
#define TAB_BAR_STREAM_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAB_BAR_STREAM_ITEM, TabBarStreamItemClass))
#define IS_TAB_BAR_STREAM_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAB_BAR_STREAM_ITEM))
#define IS_TAB_BAR_STREAM_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAB_BAR_STREAM_ITEM))
#define TAB_BAR_STREAM_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAB_BAR_STREAM_ITEM, TabBarStreamItemClass))

typedef struct _TabBarStreamItem TabBarStreamItem;
typedef struct _TabBarStreamItemClass TabBarStreamItemClass;
typedef struct _TabBarStreamItemPrivate TabBarStreamItemPrivate;

#define TYPE_HOME_ITEM (home_item_get_type ())
#define HOME_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HOME_ITEM, HomeItem))
#define HOME_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HOME_ITEM, HomeItemClass))
#define IS_HOME_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HOME_ITEM))
#define IS_HOME_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HOME_ITEM))
#define HOME_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HOME_ITEM, HomeItemClass))

typedef struct _HomeItem HomeItem;
typedef struct _HomeItemClass HomeItemClass;
typedef struct _HomeItemPrivate HomeItemPrivate;

struct _TabBarItem {
	GtkButton parent_instance;
	TabBarItemPrivate * priv;
	StreamEntry* entry;
};

struct _TabBarItemClass {
	GtkButtonClass parent_class;
	GtkWidget* (*get_toolbar) (TabBarItem* self);
	GtkWidget* (*get_view) (TabBarItem* self);
};

struct _TabBarStreamItem {
	TabBarItem parent_instance;
	TabBarStreamItemPrivate * priv;
	GwibberGtkStreamView* view;
};

struct _TabBarStreamItemClass {
	TabBarItemClass parent_class;
};

struct _HomeItem {
	TabBarStreamItem parent_instance;
	HomeItemPrivate * priv;
};

struct _HomeItemClass {
	TabBarStreamItemClass parent_class;
};


static gpointer home_item_parent_class = NULL;

GType tab_bar_item_get_type (void) G_GNUC_CONST;
GType stream_entry_get_type (void) G_GNUC_CONST;
GType tab_bar_stream_item_get_type (void) G_GNUC_CONST;
GType home_item_get_type (void) G_GNUC_CONST;
enum  {
	HOME_ITEM_DUMMY_PROPERTY
};
HomeItem* home_item_new (GeeHashMap* streams_map);
HomeItem* home_item_construct (GType object_type, GeeHashMap* streams_map);
static GtkWidget* home_item_real_get_toolbar (TabBarItem* base);
static GtkWidget* home_item_real_get_view (TabBarItem* base);
static GObject * home_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);


HomeItem* home_item_construct (GType object_type, GeeHashMap* streams_map) {
	HomeItem * self = NULL;
	const gchar* _tmp0_ = NULL;
	GeeHashMap* _tmp1_;
#line 20 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	g_return_val_if_fail (streams_map != NULL, NULL);
#line 22 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	_tmp0_ = _ ("Home");
#line 22 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	_tmp1_ = streams_map;
#line 22 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	self = (HomeItem*) g_object_new (object_type, "stream", "home", "icon-name", "gwibber-stream-home", "tooltip", _tmp0_, "streams-map", _tmp1_, NULL);
#line 20 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	return self;
#line 136 "home-item.c"
}


HomeItem* home_item_new (GeeHashMap* streams_map) {
#line 20 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	return home_item_construct (TYPE_HOME_ITEM, streams_map);
#line 143 "home-item.c"
}


static GtkWidget* home_item_real_get_toolbar (TabBarItem* base) {
	HomeItem * self;
	GtkWidget* result = NULL;
#line 29 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	self = (HomeItem*) base;
#line 31 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	result = NULL;
#line 31 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	return result;
#line 156 "home-item.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 36 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	return self ? g_object_ref (self) : NULL;
#line 163 "home-item.c"
}


static GtkWidget* home_item_real_get_view (TabBarItem* base) {
	HomeItem * self;
	GtkWidget* result = NULL;
	GwibberGtkStreamView* _tmp0_;
	GtkWidget* _tmp1_;
#line 34 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	self = (HomeItem*) base;
#line 36 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	_tmp0_ = ((TabBarStreamItem*) self)->view;
#line 36 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	_tmp1_ = _g_object_ref0 ((GtkWidget*) _tmp0_);
#line 36 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	result = _tmp1_;
#line 36 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	return result;
#line 182 "home-item.c"
}


static GObject * home_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	HomeItem * self;
#line 25 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	parent_class = G_OBJECT_CLASS (home_item_parent_class);
#line 25 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 25 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	self = HOME_ITEM (obj);
#line 25 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	return obj;
#line 198 "home-item.c"
}


static void home_item_class_init (HomeItemClass * klass) {
#line 18 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	home_item_parent_class = g_type_class_peek_parent (klass);
#line 18 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	TAB_BAR_ITEM_CLASS (klass)->get_toolbar = home_item_real_get_toolbar;
#line 18 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	TAB_BAR_ITEM_CLASS (klass)->get_view = home_item_real_get_view;
#line 18 "/storage/1/src/gwibber/trunk/client/home-item.vala"
	G_OBJECT_CLASS (klass)->constructor = home_item_constructor;
#line 211 "home-item.c"
}


static void home_item_instance_init (HomeItem * self) {
}


GType home_item_get_type (void) {
	static volatile gsize home_item_type_id__volatile = 0;
	if (g_once_init_enter (&home_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (HomeItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) home_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HomeItem), 0, (GInstanceInitFunc) home_item_instance_init, NULL };
		GType home_item_type_id;
		home_item_type_id = g_type_register_static (TYPE_TAB_BAR_STREAM_ITEM, "HomeItem", &g_define_type_info, 0);
		g_once_init_leave (&home_item_type_id__volatile, home_item_type_id);
	}
	return home_item_type_id__volatile;
}