summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2012-11-09 21:01:23 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2012-11-09 21:01:23 +0100
commit8c8d4f583a460904350b81cf38fed48fd5712cb2 (patch)
tree02ebced09ae047d193b35aa5e22b6aaa7ee1c2bd /examples
parent36c055ca75773ce36cc286afe00a1ceefc2449f6 (diff)
downloadlibrcc-8c8d4f583a460904350b81cf38fed48fd5712cb2.tar.gz
librcc-8c8d4f583a460904350b81cf38fed48fd5712cb2.tar.bz2
librcc-8c8d4f583a460904350b81cf38fed48fd5712cb2.tar.xz
librcc-8c8d4f583a460904350b81cf38fed48fd5712cb2.zip
Initial GTK3 support
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile.am8
-rw-r--r--examples/rcc-gtk-config.c19
2 files changed, 27 insertions, 0 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 710b7dc..9d6331b 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -18,6 +18,14 @@ rcc_gtk2_config_LDADD=../ui/librccgtk2.la @GTK2_LIBS@
rcc_gtk2_config_CPPFLAGS = @GTK2_CFLAGS@ -I../src -I../ui
endif
+if HAVE_GTK3
+bin_PROGRAMS+= rcc-gtk3-config
+rcc_gtk3_config_SOURCES = rcc-gtk-config.c
+rcc_gtk3_config_LDADD=../ui/librccgtk3.la @GTK3_LIBS@
+rcc_gtk3_config_CPPFLAGS = @GTK3_CFLAGS@ -I../src -I../ui
+endif
+
+
EXTRA_DIST= input-russian.txt rcc.xml rcc-example.xml mpg123-rcc.patch
test: example2
diff --git a/examples/rcc-gtk-config.c b/examples/rcc-gtk-config.c
index 6886afd..00d70a3 100644
--- a/examples/rcc-gtk-config.c
+++ b/examples/rcc-gtk-config.c
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <string.h>
+#include <locale.h>
#include <gtk/gtk.h>
#include <librcc.h>
@@ -66,7 +67,12 @@ int main (int argc, char *argv[])
if (i==1)
printf("Usage: rcc-config [ --all ] [ <config name> ]\n");
+#if GTK_MAJOR_VERSION > 2
+ setlocale(LC_ALL, "");
+#else /* GTK_MAJOR_VERSION < 3 */
gtk_set_locale ();
+#endif /* GTK_MAJOR_VERSION */
+
gtk_init (&argc, &argv);
rccInit();
@@ -77,7 +83,11 @@ int main (int argc, char *argv[])
if (all_mode) rccUiUnHideOption(uictx, RCC_OPTION_ALL);
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+#if GTK_MAJOR_VERSION > 2
+ gtk_window_set_resizable(GTK_WINDOW(window1), FALSE);
+#else /* GTK_MAJOR_VERSION < 3 */
gtk_window_set_policy(GTK_WINDOW (window1), FALSE, FALSE, TRUE);
+#endif /* GTK_MAJOR_VERSION */
gtk_window_set_title (GTK_WINDOW (window1), "LibRCC Config");
gtk_window_set_wmclass (GTK_WINDOW(window1), "librcc", "libRCC");
gtk_widget_show(window1);
@@ -92,13 +102,22 @@ int main (int argc, char *argv[])
close = gtk_button_new_with_label("Close");
gtk_widget_show (close);
+#if GTK_MAJOR_VERSION > 2
+ g_signal_connect (G_OBJECT (window1), "destroy", G_CALLBACK(gtk_main_quit), NULL);
+ g_signal_connect (G_OBJECT (close), "clicked", G_CALLBACK(gtk_main_quit), NULL);
+#else /* GTK_MAJOR_VERSION < 3 */
gtk_signal_connect (GTK_OBJECT (window1), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_signal_connect (GTK_OBJECT (close), "clicked", GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
+#endif /* GTK_MAJOR_VERSION */
gtk_box_pack_start (GTK_BOX (hbox), close, FALSE, FALSE, 0);
save = gtk_button_new_with_label("Save");
gtk_widget_show (save);
+#if GTK_MAJOR_VERSION > 2
+ g_signal_connect(G_OBJECT(save), "clicked", G_CALLBACK(apply_cb), NULL);
+#else /* GTK_MAJOR_VERSION < 3 */
gtk_signal_connect(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(apply_cb), NULL);
+#endif /* GTK_MAJOR_VERSION */
gtk_box_pack_start (GTK_BOX (hbox), save, FALSE, FALSE, 0);
gtk_main ();