summaryrefslogtreecommitdiff
blob: ab283b3482fc9c1025636b99fa48d0da751231fc (plain)
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
diff -urN stardict-3.0.1/configure.in stardict-3.0.1-f/configure.in
--- stardict-3.0.1/configure.in	2007-11-01 15:37:15.000000000 +0800
+++ stardict-3.0.1-f/configure.in	2008-11-09 14:30:49.000000000 +0800
@@ -296,6 +296,8 @@
 AC_ARG_ENABLE(gnome-support, AC_HELP_STRING([--disable-gnome-support], [Disable gnome support]))
 AC_ARG_ENABLE(gpe-support, AC_HELP_STRING([--enable-gpe-support], [Enable gpe support]))
 AC_ARG_ENABLE(maemo-support, AC_HELP_STRING([--enable-maemo-support], [Enable maemo support]))
+AC_ARG_ENABLE(esd-support, AC_HELP_STRING([--enable-esd-support], [Enable esd support]))
+AM_CONDITIONAL(ESD_SUPPORT, test "x${enable_gpe_support}" != "xyes" && test "x${enable_maemo_support}" != "xyes" && test "x${enable_gnome_support}" != "xno" && test "x${enable_esd_support}" = "xyes" )
 AM_CONDITIONAL(GNOME_SUPPORT, test "x${enable_gpe_support}" != "xyes" && test "x${enable_maemo_support}" != "xyes" && test "x${enable_gnome_support}" != "xno")
 AM_CONDITIONAL(GPE_SUPPORT, test "x${enable_gpe_support}" = "xyes")
 AM_CONDITIONAL(MAEMO_SUPPORT, test "x${enable_maemo_support}" = "xyes")
@@ -307,7 +309,11 @@
 elif test "x${enable_gnome_support}" = "xno" ; then
   DEP_MODULES="gtk+-2.0 >= 2.12 gthread-2.0"
 else
-  DEP_MODULES="libgnomeui-2.0 >= 2.20"
+    if test "x${enable_esd_support}" = "xyes"; then
+        DEP_MODULES="libgnomeui-2.0 >= 2.20 esound >= 0.2"
+    else
+        DEP_MODULES="libgnomeui-2.0 >= 2.20"
+    fi
 fi
 
 dnl
@@ -338,6 +344,12 @@
 	echo "Enable gnome suppport";
 	AC_DEFINE([CONFIG_GNOME],[], [Compile with gnome support])
 
+dnl For esound support
+    if test "x${enable_esd_support}" = "xyes"; then
+	    echo "Enable esound suppport";
+	    AC_DEFINE([CONFIG_ESD],[], [Compile with esound support])
+    fi
+
 dnl *********************************************
 dnl for anything which calls gconftool-2 correctly
 dnl *********************************************
diff -urN stardict-3.0.1/src/conf.cpp stardict-3.0.1-f/src/conf.cpp
--- stardict-3.0.1/src/conf.cpp	2007-10-30 16:05:35.000000000 +0800
+++ stardict-3.0.1-f/src/conf.cpp	2008-11-09 14:11:51.000000000 +0800
@@ -108,7 +108,7 @@
 	add_entry("/apps/stardict/preferences/dictionary/enable_collation", false);
 	add_entry("/apps/stardict/preferences/dictionary/collate_function", 0);
 
-#if defined(CONFIG_GTK) || defined (CONFIG_GPE)
+#if defined(CONFIG_GTK) || defined (CONFIG_GPE) || (! defined(CONFIG_ESD))
 	add_entry("/apps/stardict/preferences/dictionary/play_command", std::string("play"));
 #endif
 #ifdef _WIN32
diff -urN stardict-3.0.1/src/desktop.cpp stardict-3.0.1-f/src/desktop.cpp
--- stardict-3.0.1/src/desktop.cpp	2007-08-31 15:27:59.000000000 +0800
+++ stardict-3.0.1-f/src/desktop.cpp	2008-11-09 13:51:51.000000000 +0800
@@ -37,7 +37,7 @@
 
 #include "desktop.hpp"
 
-#if defined(CONFIG_GTK) || defined(CONFIG_GPE) || defined(CONFIG_MAEMO)
+#if defined(CONFIG_GTK) || defined(CONFIG_GPE) || defined(CONFIG_MAEMO) || (! defined(CONFIG_ESD))
 static void spawn_command(const gchar *exe, const gchar *arg)
 {
   gchar *qarg = g_shell_quote(arg);
@@ -55,7 +55,7 @@
 #if !defined(_MSC_VER)
 	PlaySound(filename.c_str(), 0, SND_ASYNC | SND_FILENAME);
 #endif
-#elif defined(CONFIG_GNOME)
+#elif defined(CONFIG_ESD)
 	gnome_sound_play(filename.c_str());
 #else
 	const std::string &playcmd=
diff -urN stardict-3.0.1/src/prefsdlg.cpp stardict-3.0.1-f/src/prefsdlg.cpp
--- stardict-3.0.1/src/prefsdlg.cpp	2007-10-30 16:14:07.000000000 +0800
+++ stardict-3.0.1-f/src/prefsdlg.cpp	2008-11-09 14:13:38.000000000 +0800
@@ -734,7 +734,7 @@
 	g_signal_connect (G_OBJECT (check_button), "toggled", G_CALLBACK (on_setup_dictionary_sound_ckbutton_toggled), (gpointer)this);
 	gtk_box_pack_start(GTK_BOX(vbox1),check_button,false,false,0);
 	GtkWidget *label;
-#if defined(CONFIG_GTK) || defined(CONFIG_GPE)
+#if defined(CONFIG_GTK) || defined(CONFIG_GPE) || (! defined(CONFIG_ESD))
 	GtkWidget *hbox2 = gtk_hbox_new(FALSE, 6);
 	label=gtk_label_new(_("Command for playing wav files:"));
 	gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
@@ -1865,7 +1865,7 @@
 			port = 2628;
 		conf->set_int_at("network/port", port);
 		gpAppFrame->oStarDictClient.set_server(server, port);
-#if defined(CONFIG_GTK) || defined(CONFIG_GPE)
+#if defined(CONFIG_GTK) || defined(CONFIG_GPE) || (! defined(CONFIG_ESD))
 		ch = gtk_entry_get_text(ePlayCommand);
 		if (ch[0])
 			conf->set_string_at("dictionary/play_command", ch);
diff -urN stardict-3.0.1/src/prefsdlg.h stardict-3.0.1-f/src/prefsdlg.h
--- stardict-3.0.1/src/prefsdlg.h	2007-10-30 16:05:48.000000000 +0800
+++ stardict-3.0.1-f/src/prefsdlg.h	2008-11-09 14:43:43.000000000 +0800
@@ -32,7 +32,7 @@
   GtkButton *bAccount;
   std::string register_user;
   std::string register_hex;
-#if defined(CONFIG_GTK) || defined(CONFIG_GPE)
+#if defined(CONFIG_GTK) || defined(CONFIG_GPE) || (! defined(CONFIG_ESD))
   GtkEntry *ePlayCommand;
 #endif
 #ifndef CONFIG_GPE
diff -urN stardict-3.0.1/src/stardict.cpp stardict-3.0.1-f/src/stardict.cpp
--- stardict-3.0.1/src/stardict.cpp	2007-11-05 11:39:51.000000000 +0800
+++ stardict-3.0.1-f/src/stardict.cpp	2008-11-09 13:25:35.000000000 +0800
@@ -136,7 +136,7 @@
 	dict_manage_dlg = NULL;
 	plugin_manage_dlg = NULL;
 	prefs_dlg = NULL;
-#ifdef CONFIG_GNOME
+#ifdef CONFIG_ESD
 	gnome_sound_init(NULL);
 #endif
 }
@@ -144,7 +144,7 @@
 AppCore::~AppCore()
 {
 	stop_word_change_timer();
-#ifdef CONFIG_GNOME
+#ifdef CONFIG_ESD
 	gnome_sound_shutdown();
 #endif
 	delete dict_manage_dlg;