18
18
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
19
* Boston, MA 02110-1301, USA.
23
#include <webkit/webkit.h>
24
#include "u1-music-store.h"
26
struct _U1MusicStorePrivate {
27
GtkWidget *web_viewer;
30
G_DEFINE_TYPE(U1MusicStore, u1_music_store, GTK_TYPE_VBOX)
33
u1_music_store_finalize (GObject *object)
35
U1MusicStore *music_store = U1_MUSIC_STORE (object);
37
if (music_store->priv != NULL) {
38
g_free (music_store->priv);
39
music_store->priv = NULL;
42
G_OBJECT_CLASS (u1_music_store_parent_class)->finalize (object);
46
u1_music_store_class_init (U1MusicStoreClass *klass)
48
GObjectClass *object_class = G_OBJECT_CLASS (klass);
50
object_class->finalize = u1_music_store_finalize;
54
u1_music_store_init (U1MusicStore *music_store)
58
music_store->priv = g_new0 (U1MusicStorePrivate, 1);
60
/* Create web viewer object */
61
scroll = gtk_scrolled_window_new (NULL, NULL);
62
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
64
GTK_POLICY_AUTOMATIC);
65
gtk_widget_show (scroll);
67
music_store->priv->web_viewer = webkit_web_view_new ();
68
webkit_web_view_open (WEBKIT_WEB_VIEW (music_store->priv->web_viewer), U1_STORE_URL);
69
gtk_widget_show (music_store->priv->web_viewer);
70
gtk_container_add (GTK_SCROLLED_WINDOW (scroll), music_store->priv->web_viewer);
72
gtk_box_pack_start (GTK_BOX (music_store), scroll, TRUE, TRUE, 3);
78
* Create a new #U1MusicStore widget.
80
* Return value: the newly created widget.
83
u1_music_store_new (void)
85
U1MusicStore *music_store;
87
music_store = g_object_new (U1_TYPE_MUSIC_STORE, NULL);
89
return (GtkWidget *) music_store;