annotate Visualization/libvisual-proxy/about.c @ 54:25e69f085ad9 trunk

[svn] This commit does the following: - Changes out static timings for a dynamic implementation which works via actively detecting how long it takes to render a frame - Cleans up a few warnings.
author nenolod
date Thu, 27 Oct 2005 16:49:50 -0700
parents 639f07a07590
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
1 #include <gtk/gtk.h>
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
2
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
3 #include "config.h"
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
4
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
5 #include "about.h"
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
6
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
7 #if 0
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
8 static GtkWidget *about_window = NULL;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
9
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
10 static void on_button_close_clicked (GtkButton *button, gpointer user_data);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
11 static GtkWidget* create_window_about (void);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
12
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
13
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
14 void lv_xmms_about_show ()
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
15 {
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
16 if (about_window != NULL) {
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
17 gtk_widget_show (about_window);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
18 return;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
19 }
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
20
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
21 about_window = create_window_about ();
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
22 gtk_widget_show (about_window);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
23 }
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
24
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
25
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
26 /*
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
27 *
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
28 * Private methods
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
29 *
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
30 */
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
31
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
32 static void on_button_close_clicked (GtkButton *button, gpointer user_data)
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
33 {
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
34 gtk_widget_hide (about_window);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
35 }
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
36
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
37 GtkWidget* create_window_about (void)
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
38 {
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
39 GtkWidget *window_about;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
40 GtkWidget *vbox1;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
41 GtkWidget *notebook_about;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
42 GtkWidget *scrolledwindow1;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
43 GtkWidget *text_about;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
44 GtkWidget *label_credits;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
45 GtkWidget *scrolledwindow2;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
46 GtkWidget *text_about_translators;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
47 GtkWidget *label_about_translators;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
48 GtkWidget *hseparator1;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
49 GtkWidget *hbox_buttons;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
50 GtkWidget *button_close;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
51
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
52 window_about = gtk_window_new (GTK_WINDOW_DIALOG);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
53 gtk_object_set_data (GTK_OBJECT (window_about), "window_about", window_about);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
54 gtk_window_set_title (GTK_WINDOW (window_about), _("About Libvisual XMMS Plugin"));
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
55 gtk_window_set_position (GTK_WINDOW (window_about), GTK_WIN_POS_CENTER);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
56 gtk_window_set_default_size (GTK_WINDOW (window_about), 457, 230);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
57
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
58 vbox1 = gtk_vbox_new (FALSE, 0);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
59 gtk_widget_ref (vbox1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
60 gtk_object_set_data_full (GTK_OBJECT (window_about), "vbox1", vbox1,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
61 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
62 gtk_widget_show (vbox1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
63 gtk_container_add (GTK_CONTAINER (window_about), vbox1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
64 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 6);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
65
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
66 notebook_about = gtk_notebook_new ();
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
67 gtk_widget_ref (notebook_about);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
68 gtk_object_set_data_full (GTK_OBJECT (window_about), "notebook_about", notebook_about,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
69 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
70 gtk_widget_show (notebook_about);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
71 gtk_box_pack_start (GTK_BOX (vbox1), notebook_about, TRUE, TRUE, 0);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
72
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
73 scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
74 gtk_widget_ref (scrolledwindow1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
75 gtk_object_set_data_full (GTK_OBJECT (window_about), "scrolledwindow1", scrolledwindow1,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
76 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
77 gtk_widget_show (scrolledwindow1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
78 gtk_container_add (GTK_CONTAINER (notebook_about), scrolledwindow1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
79 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
80
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
81 text_about = gtk_text_new (NULL, NULL);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
82 gtk_widget_ref (text_about);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
83 gtk_object_set_data_full (GTK_OBJECT (window_about), "text_about", text_about,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
84 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
85 gtk_widget_show (text_about);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
86 gtk_container_add (GTK_CONTAINER (scrolledwindow1), text_about);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
87 gtk_text_insert (GTK_TEXT (text_about), NULL, NULL, NULL,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
88 _("Libvisual XMMS Plugin\n\nCopyright (C) 2004, Duilio Protti <dprotti@users.sourceforge.net>\nDennis Smit <ds@nerds-incorporated.org>\n\nThe Libvisual XMMS Plugin, more information about Libvisual can be found at\nhttp://libvisual.sf.net\n"), -1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
89
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
90 label_credits = gtk_label_new (_("Credits"));
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
91 gtk_widget_ref (label_credits);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
92 gtk_object_set_data_full (GTK_OBJECT (window_about), "label_credits", label_credits,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
93 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
94 gtk_widget_show (label_credits);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
95 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_about), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_about), 0), label_credits);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
96
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
97 scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
98 gtk_widget_ref (scrolledwindow2);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
99 gtk_object_set_data_full (GTK_OBJECT (window_about), "scrolledwindow2", scrolledwindow2,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
100 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
101 gtk_widget_show (scrolledwindow2);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
102 gtk_container_add (GTK_CONTAINER (notebook_about), scrolledwindow2);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
103 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
104
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
105 text_about_translators = gtk_text_new (NULL, NULL);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
106 gtk_widget_ref (text_about_translators);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
107 gtk_object_set_data_full (GTK_OBJECT (window_about), "text_about_translators", text_about_translators,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
108 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
109 gtk_widget_show (text_about_translators);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
110 gtk_container_add (GTK_CONTAINER (scrolledwindow2), text_about_translators);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
111 gtk_text_insert (GTK_TEXT (text_about_translators), NULL, NULL, NULL,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
112 _("Brazilian Portuguese: Gustavo Sverzut Barbieri\nDutch: Dennis Smit\nFrench: Jean-Christophe Hoelt\nSpanish: Duilio Protti\n"), -1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
113
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
114 label_about_translators = gtk_label_new (_("Translators"));
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
115 gtk_widget_ref (label_about_translators);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
116 gtk_object_set_data_full (GTK_OBJECT (window_about), "label_about_translators", label_about_translators,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
117 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
118 gtk_widget_show (label_about_translators);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
119 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_about), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_about), 1), label_about_translators);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
120
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
121 hseparator1 = gtk_hseparator_new ();
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
122 gtk_widget_ref (hseparator1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
123 gtk_object_set_data_full (GTK_OBJECT (window_about), "hseparator1", hseparator1,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
124 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
125 gtk_widget_show (hseparator1);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
126 gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, FALSE, 6);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
127
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
128 hbox_buttons = gtk_hbox_new (FALSE, 0);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
129 gtk_widget_ref (hbox_buttons);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
130 gtk_object_set_data_full (GTK_OBJECT (window_about), "hbox_buttons", hbox_buttons,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
131 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
132 gtk_widget_show (hbox_buttons);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
133 gtk_box_pack_start (GTK_BOX (vbox1), hbox_buttons, FALSE, FALSE, 0);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
134
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
135 button_close = gtk_button_new_with_label (_("Close"));
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
136 gtk_widget_ref (button_close);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
137 gtk_object_set_data_full (GTK_OBJECT (window_about), "button_close", button_close,
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
138 (GtkDestroyNotify) gtk_widget_unref);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
139 gtk_widget_show (button_close);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
140 gtk_box_pack_start (GTK_BOX (hbox_buttons), button_close, FALSE, FALSE, 0);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
141 GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
142
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
143 gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
144 GTK_SIGNAL_FUNC (on_button_close_clicked),
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
145 NULL);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
146
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
147 gtk_widget_grab_default (button_close);
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
148 return window_about;
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
149 }
639f07a07590 [svn] Merge libvisual-proxy.
nenolod
parents:
diff changeset
150 #endif