2
* Copyright (C) 2007 Zeeshan Ali <zeenix@gstreamer.net>
4
* Authors: Zeeshan Ali <zeenix@gstreamer.net>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* 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, write to the Free Software Foundation,
18
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
#include "playlist-treeview.h"
27
#include "renderer-combo.h"
28
#include "renderer-controls.h"
32
#define GLADE_FILE DATA_DIR "/gupnp-av-cp.glade"
33
#define ICON_FILE "pixmaps/av-cp.png"
35
static GladeXML *glade_xml;
36
static GtkWidget *main_window;
37
static GtkWidget *about_dialog;
40
on_delete_event (GtkWidget *widget,
50
setup_icons (GladeXML *glade_xml)
52
GdkPixbuf *icon_pixbuf;
53
GtkWidget *volume_min;
54
GtkWidget *volume_max;
58
icon_pixbuf = load_pixbuf_file (ICON_FILE);
59
g_assert (icon_pixbuf != NULL);
61
gtk_window_set_icon (GTK_WINDOW (main_window), icon_pixbuf);
62
gtk_window_set_icon (GTK_WINDOW (about_dialog), icon_pixbuf);
63
gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about_dialog),
65
g_object_unref (icon_pixbuf);
67
volume_min = glade_xml_get_widget (glade_xml, "volume-min-image");
68
g_assert (volume_min != NULL);
69
volume_max = glade_xml_get_widget (glade_xml, "volume-max-image");
70
g_assert (volume_max != NULL);
72
gtk_image_set_from_pixbuf (GTK_IMAGE (volume_min),
73
get_icon_by_id (ICON_MIN_VOLUME));
74
gtk_image_set_from_pixbuf (GTK_IMAGE (volume_max),
75
get_icon_by_id (ICON_MAX_VOLUME));
82
gint window_width, window_height;
84
gtk_init (argc, argv);
88
glade_xml = glade_xml_new (GLADE_FILE, NULL, NULL);
89
if (glade_xml == NULL) {
90
g_critical ("Unable to load the GUI file %s", GLADE_FILE);
94
main_window = glade_xml_get_widget (glade_xml, "main-window");
95
g_assert (main_window != NULL);
96
about_dialog = glade_xml_get_widget (glade_xml, "about-dialog");
97
g_assert (about_dialog != NULL);
99
/* 40% of the screen but don't get bigger than 1000x800 */
100
window_width = CLAMP ((gdk_screen_width () * 40 / 100), 10, 1000);
101
window_height = CLAMP ((gdk_screen_height () * 40 / 100), 10, 800);
102
gtk_window_set_default_size (GTK_WINDOW (main_window),
106
gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (about_dialog),
109
glade_xml_signal_autoconnect (glade_xml);
111
setup_icons (glade_xml);
112
setup_playlist_treeview (glade_xml);
113
setup_renderer_controls (glade_xml);
114
setup_renderer_combo (glade_xml);
116
gtk_widget_show_all (main_window);
124
g_object_unref (glade_xml);
125
gtk_widget_destroy (main_window);
126
gtk_widget_destroy (about_dialog);