tGTK+-like library added to Windows graphical client - vaccinewars - be a docto… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 787438c63e3be440e14161b651b55e13ab135353 | |
parent 678b8137c3c8aa62655cff972ea4d9035476f65e | |
Author: Ben Webb <[email protected]> | |
Date: Sat, 9 Dec 2000 17:01:15 +0000 | |
GTK+-like library added to Windows graphical client | |
Diffstat: | |
M Makefile.in | 2 -- | |
M acconfig.h | 4 ++-- | |
M config.h.in | 7 ++----- | |
M configure | 429 +++++++++++++++--------------… | |
M configure.in | 34 +++++++++--------------------… | |
M doc/Makefile.in | 2 -- | |
M src/Makefile.am | 7 ++----- | |
M src/Makefile.in | 10 +++------- | |
A src/gtk.c | 3206 +++++++++++++++++++++++++++++… | |
A src/gtk.h | 571 +++++++++++++++++++++++++++++… | |
M src/gtk_client.c | 109 ++++++++++++++++++++---------… | |
M src/win32_client.c | 4 ++++ | |
12 files changed, 4074 insertions(+), 311 deletions(-) | |
--- | |
diff --git a/Makefile.in b/Makefile.in | |
t@@ -84,8 +84,6 @@ RANLIB = @RANLIB@ | |
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ | |
USE_NLS = @USE_NLS@ | |
VERSION = @VERSION@ | |
-WIN_RC = @WIN_RC@ | |
-WIN_RES = @WIN_RES@ | |
l = @l@ | |
localedir = @localedir@ | |
diff --git a/acconfig.h b/acconfig.h | |
t@@ -5,8 +5,8 @@ | |
/* Define if dopewars should use TCP/IP networking to connect to servers */ | |
#undef NETWORKING | |
-/* Use the GTK+ client? */ | |
-#undef GTK_CLIENT | |
+/* Use the graphical client? */ | |
+#undef GUI_CLIENT | |
/* Use the (n)curses client? */ | |
#undef CURSES_CLIENT | |
diff --git a/config.h.in b/config.h.in | |
t@@ -66,15 +66,12 @@ | |
/* Define if dopewars should use TCP/IP networking to connect to servers */ | |
#undef NETWORKING | |
-/* Use the GTK+ client? */ | |
-#undef GTK_CLIENT | |
+/* Use the graphical client? */ | |
+#undef GUI_CLIENT | |
/* Use the (n)curses client? */ | |
#undef CURSES_CLIENT | |
-/* Use the Win32 client? */ | |
-#undef WIN32_CLIENT | |
- | |
#undef ENABLE_NLS | |
#undef HAVE_CATGETS | |
#undef HAVE_GETTEXT | |
diff --git a/configure b/configure | |
t@@ -18,12 +18,10 @@ ac_help="$ac_help | |
ac_help="$ac_help | |
--with-catgets use catgets functions if available" | |
ac_help="$ac_help | |
- --enable-gtk-client include GTK+ client on Unix systems" | |
+ --enable-gui-client include graphical client (GTK+/Win32)" | |
ac_help="$ac_help | |
--enable-curses-client include curses client" | |
ac_help="$ac_help | |
- --enable-win32-client include graphical Win32 client on Windows systems" | |
-ac_help="$ac_help | |
--enable-nativewin32 build a native Win32 binary under Cygwin" | |
ac_help="$ac_help | |
--with-gtk-prefix=PFX Prefix where GTK is installed (optional)" | |
t@@ -575,7 +573,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus… | |
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
# ./install, which can be erroneously created by make from ./install.sh. | |
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 | |
-echo "configure:579: checking for a BSD compatible install" >&5 | |
+echo "configure:577: checking for a BSD compatible install" >&5 | |
if test -z "$INSTALL"; then | |
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -628,7 +626,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PRO… | |
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 | |
-echo "configure:632: checking whether build environment is sane" >&5 | |
+echo "configure:630: checking whether build environment is sane" >&5 | |
# Just in case | |
sleep 1 | |
echo timestamp > conftestfile | |
t@@ -685,7 +683,7 @@ test "$program_suffix" != NONE && | |
test "$program_transform_name" = "" && program_transform_name="s,x,x," | |
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 | |
-echo "configure:689: checking whether ${MAKE-make} sets \${MAKE}" >&5 | |
+echo "configure:687: checking whether ${MAKE-make} sets \${MAKE}" >&5 | |
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; t… | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -731,7 +729,7 @@ EOF | |
missing_dir=`cd $ac_aux_dir && pwd` | |
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 | |
-echo "configure:735: checking for working aclocal" >&5 | |
+echo "configure:733: checking for working aclocal" >&5 | |
# Run test in a subshell; some versions of sh will print an error if | |
# an executable is not found, even if stderr is redirected. | |
# Redirect stdin to placate older versions of autoconf. Sigh. | |
t@@ -744,7 +742,7 @@ else | |
fi | |
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 | |
-echo "configure:748: checking for working autoconf" >&5 | |
+echo "configure:746: checking for working autoconf" >&5 | |
# Run test in a subshell; some versions of sh will print an error if | |
# an executable is not found, even if stderr is redirected. | |
# Redirect stdin to placate older versions of autoconf. Sigh. | |
t@@ -757,7 +755,7 @@ else | |
fi | |
echo $ac_n "checking for working automake""... $ac_c" 1>&6 | |
-echo "configure:761: checking for working automake" >&5 | |
+echo "configure:759: checking for working automake" >&5 | |
# Run test in a subshell; some versions of sh will print an error if | |
# an executable is not found, even if stderr is redirected. | |
# Redirect stdin to placate older versions of autoconf. Sigh. | |
t@@ -770,7 +768,7 @@ else | |
fi | |
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 | |
-echo "configure:774: checking for working autoheader" >&5 | |
+echo "configure:772: checking for working autoheader" >&5 | |
# Run test in a subshell; some versions of sh will print an error if | |
# an executable is not found, even if stderr is redirected. | |
# Redirect stdin to placate older versions of autoconf. Sigh. | |
t@@ -783,7 +781,7 @@ else | |
fi | |
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 | |
-echo "configure:787: checking for working makeinfo" >&5 | |
+echo "configure:785: checking for working makeinfo" >&5 | |
# Run test in a subshell; some versions of sh will print an error if | |
# an executable is not found, even if stderr is redirected. | |
# Redirect stdin to placate older versions of autoconf. Sigh. | |
t@@ -804,7 +802,7 @@ fi | |
# Extract the first word of "gcc", so it can be a program name with args. | |
set dummy gcc; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:808: checking for $ac_word" >&5 | |
+echo "configure:806: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -834,7 +832,7 @@ if test -z "$CC"; then | |
# Extract the first word of "cc", so it can be a program name with args. | |
set dummy cc; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:838: checking for $ac_word" >&5 | |
+echo "configure:836: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -885,7 +883,7 @@ fi | |
# Extract the first word of "cl", so it can be a program name with args. | |
set dummy cl; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:889: checking for $ac_word" >&5 | |
+echo "configure:887: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -917,7 +915,7 @@ fi | |
fi | |
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... … | |
-echo "configure:921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) wo… | |
+echo "configure:919: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) wo… | |
ac_ext=c | |
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
t@@ -928,12 +926,12 @@ cross_compiling=$ac_cv_prog_cc_cross | |
cat > conftest.$ac_ext << EOF | |
-#line 932 "configure" | |
+#line 930 "configure" | |
#include "confdefs.h" | |
main(){return(0);} | |
EOF | |
-if { (eval echo configure:937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && … | |
+if { (eval echo configure:935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && … | |
ac_cv_prog_cc_works=yes | |
# If we can't run a trivial program, we are probably using a cross compiler. | |
if (./conftest; exit) 2>/dev/null; then | |
t@@ -959,12 +957,12 @@ if test $ac_cv_prog_cc_works = no; then | |
{ echo "configure: error: installation or configuration problem: C compiler … | |
fi | |
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-… | |
-echo "configure:963: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is… | |
+echo "configure:961: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is… | |
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 | |
cross_compiling=$ac_cv_prog_cc_cross | |
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 | |
-echo "configure:968: checking whether we are using GNU C" >&5 | |
+echo "configure:966: checking whether we are using GNU C" >&5 | |
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -973,7 +971,7 @@ else | |
yes; | |
#endif | |
EOF | |
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:977: \"$ac_try\")… | |
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:975: \"$ac_try\")… | |
ac_cv_prog_gcc=yes | |
else | |
ac_cv_prog_gcc=no | |
t@@ -992,7 +990,7 @@ ac_test_CFLAGS="${CFLAGS+set}" | |
ac_save_CFLAGS="$CFLAGS" | |
CFLAGS= | |
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 | |
-echo "configure:996: checking whether ${CC-cc} accepts -g" >&5 | |
+echo "configure:994: checking whether ${CC-cc} accepts -g" >&5 | |
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -1035,7 +1033,7 @@ fi | |
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
# ./install, which can be erroneously created by make from ./install.sh. | |
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 | |
-echo "configure:1039: checking for a BSD compatible install" >&5 | |
+echo "configure:1037: checking for a BSD compatible install" >&5 | |
if test -z "$INSTALL"; then | |
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -1090,7 +1088,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 6… | |
ALL_LINGUAS="de pl pt_BR" | |
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 | |
-echo "configure:1094: checking how to run the C preprocessor" >&5 | |
+echo "configure:1092: checking how to run the C preprocessor" >&5 | |
# On Suns, sometimes $CPP names a directory. | |
if test -n "$CPP" && test -d "$CPP"; then | |
CPP= | |
t@@ -1105,13 +1103,13 @@ else | |
# On the NeXT, cc -E runs the code through the compiler's parser, | |
# not just through cpp. | |
cat > conftest.$ac_ext <<EOF | |
-#line 1109 "configure" | |
+#line 1107 "configure" | |
#include "confdefs.h" | |
#include <assert.h> | |
Syntax Error | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:1113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
: | |
t@@ -1122,13 +1120,13 @@ else | |
rm -rf conftest* | |
CPP="${CC-cc} -E -traditional-cpp" | |
cat > conftest.$ac_ext <<EOF | |
-#line 1126 "configure" | |
+#line 1124 "configure" | |
#include "confdefs.h" | |
#include <assert.h> | |
Syntax Error | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:1132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:1130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
: | |
t@@ -1139,13 +1137,13 @@ else | |
rm -rf conftest* | |
CPP="${CC-cc} -nologo -E" | |
cat > conftest.$ac_ext <<EOF | |
-#line 1143 "configure" | |
+#line 1141 "configure" | |
#include "confdefs.h" | |
#include <assert.h> | |
Syntax Error | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:1147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
: | |
t@@ -1172,7 +1170,7 @@ echo "$ac_t""$CPP" 1>&6 | |
# Extract the first word of "ranlib", so it can be a program name with args. | |
set dummy ranlib; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:1176: checking for $ac_word" >&5 | |
+echo "configure:1174: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -1200,7 +1198,7 @@ else | |
fi | |
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 | |
-echo "configure:1204: checking for POSIXized ISC" >&5 | |
+echo "configure:1202: checking for POSIXized ISC" >&5 | |
if test -d /etc/conf/kconfig.d && | |
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 | |
then | |
t@@ -1221,12 +1219,12 @@ else | |
fi | |
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 | |
-echo "configure:1225: checking for ANSI C header files" >&5 | |
+echo "configure:1223: checking for ANSI C header files" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1230 "configure" | |
+#line 1228 "configure" | |
#include "confdefs.h" | |
#include <stdlib.h> | |
#include <stdarg.h> | |
t@@ -1234,7 +1232,7 @@ else | |
#include <float.h> | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
rm -rf conftest* | |
t@@ -1251,7 +1249,7 @@ rm -f conftest* | |
if test $ac_cv_header_stdc = yes; then | |
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. | |
cat > conftest.$ac_ext <<EOF | |
-#line 1255 "configure" | |
+#line 1253 "configure" | |
#include "confdefs.h" | |
#include <string.h> | |
EOF | |
t@@ -1269,7 +1267,7 @@ fi | |
if test $ac_cv_header_stdc = yes; then | |
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. | |
cat > conftest.$ac_ext <<EOF | |
-#line 1273 "configure" | |
+#line 1271 "configure" | |
#include "confdefs.h" | |
#include <stdlib.h> | |
EOF | |
t@@ -1290,7 +1288,7 @@ if test "$cross_compiling" = yes; then | |
: | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1294 "configure" | |
+#line 1292 "configure" | |
#include "confdefs.h" | |
#include <ctype.h> | |
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | |
t@@ -1301,7 +1299,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOU… | |
exit (0); } | |
EOF | |
-if { (eval echo configure:1305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:1303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
: | |
else | |
t@@ -1325,12 +1323,12 @@ EOF | |
fi | |
echo $ac_n "checking for working const""... $ac_c" 1>&6 | |
-echo "configure:1329: checking for working const" >&5 | |
+echo "configure:1327: checking for working const" >&5 | |
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1334 "configure" | |
+#line 1332 "configure" | |
#include "confdefs.h" | |
int main() { | |
t@@ -1379,7 +1377,7 @@ ccp = (char const *const *) p; | |
; return 0; } | |
EOF | |
-if { (eval echo configure:1383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
+if { (eval echo configure:1381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
rm -rf conftest* | |
ac_cv_c_const=yes | |
else | |
t@@ -1400,21 +1398,21 @@ EOF | |
fi | |
echo $ac_n "checking for inline""... $ac_c" 1>&6 | |
-echo "configure:1404: checking for inline" >&5 | |
+echo "configure:1402: checking for inline" >&5 | |
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
ac_cv_c_inline=no | |
for ac_kw in inline __inline__ __inline; do | |
cat > conftest.$ac_ext <<EOF | |
-#line 1411 "configure" | |
+#line 1409 "configure" | |
#include "confdefs.h" | |
int main() { | |
} $ac_kw foo() { | |
; return 0; } | |
EOF | |
-if { (eval echo configure:1418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
+if { (eval echo configure:1416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
rm -rf conftest* | |
ac_cv_c_inline=$ac_kw; break | |
else | |
t@@ -1440,12 +1438,12 @@ EOF | |
esac | |
echo $ac_n "checking for off_t""... $ac_c" 1>&6 | |
-echo "configure:1444: checking for off_t" >&5 | |
+echo "configure:1442: checking for off_t" >&5 | |
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1449 "configure" | |
+#line 1447 "configure" | |
#include "confdefs.h" | |
#include <sys/types.h> | |
#if STDC_HEADERS | |
t@@ -1473,12 +1471,12 @@ EOF | |
fi | |
echo $ac_n "checking for size_t""... $ac_c" 1>&6 | |
-echo "configure:1477: checking for size_t" >&5 | |
+echo "configure:1475: checking for size_t" >&5 | |
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1482 "configure" | |
+#line 1480 "configure" | |
#include "confdefs.h" | |
#include <sys/types.h> | |
#if STDC_HEADERS | |
t@@ -1508,19 +1506,19 @@ fi | |
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works | |
# for constant arguments. Useless! | |
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 | |
-echo "configure:1512: checking for working alloca.h" >&5 | |
+echo "configure:1510: checking for working alloca.h" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1517 "configure" | |
+#line 1515 "configure" | |
#include "confdefs.h" | |
#include <alloca.h> | |
int main() { | |
char *p = alloca(2 * sizeof(int)); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:1524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:1522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
ac_cv_header_alloca_h=yes | |
else | |
t@@ -1541,12 +1539,12 @@ EOF | |
fi | |
echo $ac_n "checking for alloca""... $ac_c" 1>&6 | |
-echo "configure:1545: checking for alloca" >&5 | |
+echo "configure:1543: checking for alloca" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1550 "configure" | |
+#line 1548 "configure" | |
#include "confdefs.h" | |
#ifdef __GNUC__ | |
t@@ -1574,7 +1572,7 @@ int main() { | |
char *p = (char *) alloca(1); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:1578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:1576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
ac_cv_func_alloca_works=yes | |
else | |
t@@ -1606,12 +1604,12 @@ EOF | |
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 | |
-echo "configure:1610: checking whether alloca needs Cray hooks" >&5 | |
+echo "configure:1608: checking whether alloca needs Cray hooks" >&5 | |
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1615 "configure" | |
+#line 1613 "configure" | |
#include "confdefs.h" | |
#if defined(CRAY) && ! defined(CRAY2) | |
webecray | |
t@@ -1636,12 +1634,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 | |
if test $ac_cv_os_cray = yes; then | |
for ac_func in _getb67 GETB67 getb67; do | |
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
-echo "configure:1640: checking for $ac_func" >&5 | |
+echo "configure:1638: checking for $ac_func" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1645 "configure" | |
+#line 1643 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char $ac_func(); below. */ | |
t@@ -1664,7 +1662,7 @@ $ac_func(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:1668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:1666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_$ac_func=yes" | |
else | |
t@@ -1691,7 +1689,7 @@ done | |
fi | |
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 | |
-echo "configure:1695: checking stack direction for C alloca" >&5 | |
+echo "configure:1693: checking stack direction for C alloca" >&5 | |
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -1699,7 +1697,7 @@ else | |
ac_cv_c_stack_direction=0 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1703 "configure" | |
+#line 1701 "configure" | |
#include "confdefs.h" | |
find_stack_direction () | |
{ | |
t@@ -1718,7 +1716,7 @@ main () | |
exit (find_stack_direction() < 0); | |
} | |
EOF | |
-if { (eval echo configure:1722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
ac_cv_c_stack_direction=1 | |
else | |
t@@ -1743,17 +1741,17 @@ for ac_hdr in unistd.h | |
do | |
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | |
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 | |
-echo "configure:1747: checking for $ac_hdr" >&5 | |
+echo "configure:1745: checking for $ac_hdr" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1752 "configure" | |
+#line 1750 "configure" | |
#include "confdefs.h" | |
#include <$ac_hdr> | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:1757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:1755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
rm -rf conftest* | |
t@@ -1782,12 +1780,12 @@ done | |
for ac_func in getpagesize | |
do | |
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
-echo "configure:1786: checking for $ac_func" >&5 | |
+echo "configure:1784: checking for $ac_func" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1791 "configure" | |
+#line 1789 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char $ac_func(); below. */ | |
t@@ -1810,7 +1808,7 @@ $ac_func(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:1814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:1812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_$ac_func=yes" | |
else | |
t@@ -1835,7 +1833,7 @@ fi | |
done | |
echo $ac_n "checking for working mmap""... $ac_c" 1>&6 | |
-echo "configure:1839: checking for working mmap" >&5 | |
+echo "configure:1837: checking for working mmap" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -1843,7 +1841,7 @@ else | |
ac_cv_func_mmap_fixed_mapped=no | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 1847 "configure" | |
+#line 1845 "configure" | |
#include "confdefs.h" | |
/* Thanks to Mike Haertel and Jim Avera for this test. | |
t@@ -1983,7 +1981,7 @@ main() | |
} | |
EOF | |
-if { (eval echo configure:1987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:1985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
ac_cv_func_mmap_fixed_mapped=yes | |
else | |
t@@ -2011,17 +2009,17 @@ unistd.h sys/param.h | |
do | |
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | |
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 | |
-echo "configure:2015: checking for $ac_hdr" >&5 | |
+echo "configure:2013: checking for $ac_hdr" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2020 "configure" | |
+#line 2018 "configure" | |
#include "confdefs.h" | |
#include <$ac_hdr> | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:2025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:2023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
rm -rf conftest* | |
t@@ -2051,12 +2049,12 @@ done | |
strdup __argz_count __argz_stringify __argz_next | |
do | |
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
-echo "configure:2055: checking for $ac_func" >&5 | |
+echo "configure:2053: checking for $ac_func" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2060 "configure" | |
+#line 2058 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char $ac_func(); below. */ | |
t@@ -2079,7 +2077,7 @@ $ac_func(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_$ac_func=yes" | |
else | |
t@@ -2108,12 +2106,12 @@ done | |
for ac_func in stpcpy | |
do | |
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
-echo "configure:2112: checking for $ac_func" >&5 | |
+echo "configure:2110: checking for $ac_func" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2117 "configure" | |
+#line 2115 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char $ac_func(); below. */ | |
t@@ -2136,7 +2134,7 @@ $ac_func(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_$ac_func=yes" | |
else | |
t@@ -2170,19 +2168,19 @@ EOF | |
if test $ac_cv_header_locale_h = yes; then | |
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 | |
-echo "configure:2174: checking for LC_MESSAGES" >&5 | |
+echo "configure:2172: checking for LC_MESSAGES" >&5 | |
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2179 "configure" | |
+#line 2177 "configure" | |
#include "confdefs.h" | |
#include <locale.h> | |
int main() { | |
return LC_MESSAGES | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
am_cv_val_LC_MESSAGES=yes | |
else | |
t@@ -2203,7 +2201,7 @@ EOF | |
fi | |
fi | |
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 | |
-echo "configure:2207: checking whether NLS is requested" >&5 | |
+echo "configure:2205: checking whether NLS is requested" >&5 | |
# Check whether --enable-nls or --disable-nls was given. | |
if test "${enable_nls+set}" = set; then | |
enableval="$enable_nls" | |
t@@ -2223,7 +2221,7 @@ fi | |
EOF | |
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1… | |
-echo "configure:2227: checking whether included gettext is requested" >&5 | |
+echo "configure:2225: checking whether included gettext is requested" >&5 | |
# Check whether --with-included-gettext or --without-included-gettext wa… | |
if test "${with_included_gettext+set}" = set; then | |
withval="$with_included_gettext" | |
t@@ -2242,17 +2240,17 @@ fi | |
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` | |
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 | |
-echo "configure:2246: checking for libintl.h" >&5 | |
+echo "configure:2244: checking for libintl.h" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2251 "configure" | |
+#line 2249 "configure" | |
#include "confdefs.h" | |
#include <libintl.h> | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:2256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:2254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
rm -rf conftest* | |
t@@ -2269,19 +2267,19 @@ fi | |
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
echo "$ac_t""yes" 1>&6 | |
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 | |
-echo "configure:2273: checking for gettext in libc" >&5 | |
+echo "configure:2271: checking for gettext in libc" >&5 | |
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2278 "configure" | |
+#line 2276 "configure" | |
#include "confdefs.h" | |
#include <libintl.h> | |
int main() { | |
return (int) gettext ("") | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
gt_cv_func_gettext_libc=yes | |
else | |
t@@ -2297,7 +2295,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 | |
if test "$gt_cv_func_gettext_libc" != "yes"; then | |
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 | |
-echo "configure:2301: checking for bindtextdomain in -lintl" >&5 | |
+echo "configure:2299: checking for bindtextdomain in -lintl" >&5 | |
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -2305,7 +2303,7 @@ else | |
ac_save_LIBS="$LIBS" | |
LIBS="-lintl $LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 2309 "configure" | |
+#line 2307 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -2316,7 +2314,7 @@ int main() { | |
bindtextdomain() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_lib_$ac_lib_var=yes" | |
else | |
t@@ -2332,12 +2330,12 @@ fi | |
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then | |
echo "$ac_t""yes" 1>&6 | |
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 | |
-echo "configure:2336: checking for gettext in libintl" >&5 | |
+echo "configure:2334: checking for gettext in libintl" >&5 | |
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 | |
-echo "configure:2341: checking for gettext in -lintl" >&5 | |
+echo "configure:2339: checking for gettext in -lintl" >&5 | |
ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -2345,7 +2343,7 @@ else | |
ac_save_LIBS="$LIBS" | |
LIBS="-lintl $LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 2349 "configure" | |
+#line 2347 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -2356,7 +2354,7 @@ int main() { | |
gettext() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_lib_$ac_lib_var=yes" | |
else | |
t@@ -2395,7 +2393,7 @@ EOF | |
# Extract the first word of "msgfmt", so it can be a program nam… | |
set dummy msgfmt; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2399: checking for $ac_word" >&5 | |
+echo "configure:2397: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2429,12 +2427,12 @@ fi | |
for ac_func in dcgettext | |
do | |
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
-echo "configure:2433: checking for $ac_func" >&5 | |
+echo "configure:2431: checking for $ac_func" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2438 "configure" | |
+#line 2436 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char $ac_func(); below. */ | |
t@@ -2457,7 +2455,7 @@ $ac_func(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_$ac_func=yes" | |
else | |
t@@ -2484,7 +2482,7 @@ done | |
# Extract the first word of "gmsgfmt", so it can be a program … | |
set dummy gmsgfmt; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2488: checking for $ac_word" >&5 | |
+echo "configure:2486: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2520,7 +2518,7 @@ fi | |
# Extract the first word of "xgettext", so it can be a program… | |
set dummy xgettext; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2524: checking for $ac_word" >&5 | |
+echo "configure:2522: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2552,7 +2550,7 @@ else | |
fi | |
cat > conftest.$ac_ext <<EOF | |
-#line 2556 "configure" | |
+#line 2554 "configure" | |
#include "confdefs.h" | |
int main() { | |
t@@ -2560,7 +2558,7 @@ extern int _nl_msg_cat_cntr; | |
return _nl_msg_cat_cntr | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
CATOBJEXT=.gmo | |
DATADIRNAME=share | |
t@@ -2583,7 +2581,7 @@ fi | |
if test "$CATOBJEXT" = "NONE"; then | |
echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 | |
-echo "configure:2587: checking whether catgets can be used" >&5 | |
+echo "configure:2585: checking whether catgets can be used" >&5 | |
# Check whether --with-catgets or --without-catgets was given. | |
if test "${with_catgets+set}" = set; then | |
withval="$with_catgets" | |
t@@ -2596,7 +2594,7 @@ fi | |
if test "$nls_cv_use_catgets" = "yes"; then | |
echo $ac_n "checking for main in -li""... $ac_c" 1>&6 | |
-echo "configure:2600: checking for main in -li" >&5 | |
+echo "configure:2598: checking for main in -li" >&5 | |
ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -2604,14 +2602,14 @@ else | |
ac_save_LIBS="$LIBS" | |
LIBS="-li $LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 2608 "configure" | |
+#line 2606 "configure" | |
#include "confdefs.h" | |
int main() { | |
main() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_lib_$ac_lib_var=yes" | |
else | |
t@@ -2639,12 +2637,12 @@ else | |
fi | |
echo $ac_n "checking for catgets""... $ac_c" 1>&6 | |
-echo "configure:2643: checking for catgets" >&5 | |
+echo "configure:2641: checking for catgets" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 2648 "configure" | |
+#line 2646 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char catgets(); below. */ | |
t@@ -2667,7 +2665,7 @@ catgets(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:2669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_catgets=yes" | |
else | |
t@@ -2689,7 +2687,7 @@ EOF | |
# Extract the first word of "gencat", so it can be a program na… | |
set dummy gencat; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2693: checking for $ac_word" >&5 | |
+echo "configure:2691: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2725,7 +2723,7 @@ fi | |
# Extract the first word of "gmsgfmt", so it can be a program… | |
set dummy gmsgfmt; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2729: checking for $ac_word" >&5 | |
+echo "configure:2727: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2762,7 +2760,7 @@ fi | |
# Extract the first word of "msgfmt", so it can be a progra… | |
set dummy msgfmt; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2766: checking for $ac_word" >&5 | |
+echo "configure:2764: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2797,7 +2795,7 @@ fi | |
# Extract the first word of "xgettext", so it can be a progra… | |
set dummy xgettext; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2801: checking for $ac_word" >&5 | |
+echo "configure:2799: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2855,7 +2853,7 @@ fi | |
# Extract the first word of "msgfmt", so it can be a program name with… | |
set dummy msgfmt; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2859: checking for $ac_word" >&5 | |
+echo "configure:2857: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2889,7 +2887,7 @@ fi | |
# Extract the first word of "gmsgfmt", so it can be a program name wit… | |
set dummy gmsgfmt; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2893: checking for $ac_word" >&5 | |
+echo "configure:2891: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -2925,7 +2923,7 @@ fi | |
# Extract the first word of "xgettext", so it can be a program name wi… | |
set dummy xgettext; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:2929: checking for $ac_word" >&5 | |
+echo "configure:2927: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -3018,7 +3016,7 @@ fi | |
LINGUAS= | |
else | |
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 | |
-echo "configure:3022: checking for catalogs to be installed" >&5 | |
+echo "configure:3020: checking for catalogs to be installed" >&5 | |
NEW_LINGUAS= | |
for lang in ${LINGUAS=$ALL_LINGUAS}; do | |
case "$ALL_LINGUAS" in | |
t@@ -3046,17 +3044,17 @@ echo "configure:3022: checking for catalogs to be inst… | |
if test "$CATOBJEXT" = ".cat"; then | |
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` | |
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 | |
-echo "configure:3050: checking for linux/version.h" >&5 | |
+echo "configure:3048: checking for linux/version.h" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3055 "configure" | |
+#line 3053 "configure" | |
#include "confdefs.h" | |
#include <linux/version.h> | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:3060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:3058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
rm -rf conftest* | |
t@@ -3127,12 +3125,12 @@ fi | |
localedir=${datadir}/locale | |
-# Check whether --enable-gtk-client or --disable-gtk-client was given. | |
-if test "${enable_gtk_client+set}" = set; then | |
- enableval="$enable_gtk_client" | |
- GTK_CLIENT="$enableval" | |
+# Check whether --enable-gui-client or --disable-gui-client was given. | |
+if test "${enable_gui_client+set}" = set; then | |
+ enableval="$enable_gui_client" | |
+ GUI_CLIENT="$enableval" | |
else | |
- GTK_CLIENT="yes" | |
+ GUI_CLIENT="yes" | |
fi | |
t@@ -3145,26 +3143,17 @@ else | |
fi | |
-# Check whether --enable-win32-client or --disable-win32-client was given. | |
-if test "${enable_win32_client+set}" = set; then | |
- enableval="$enable_win32_client" | |
- WIN32_CLIENT="$enableval" | |
-else | |
- WIN32_CLIENT="yes" | |
-fi | |
- | |
- | |
WIN_RC="" | |
WIN_RES="" | |
WIN_MAKE_RES="/dev/null" | |
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 | |
-echo "configure:3163: checking for Cygwin environment" >&5 | |
+echo "configure:3152: checking for Cygwin environment" >&5 | |
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3168 "configure" | |
+#line 3157 "configure" | |
#include "confdefs.h" | |
int main() { | |
t@@ -3175,7 +3164,7 @@ int main() { | |
return __CYGWIN__; | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
+if { (eval echo configure:3168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
rm -rf conftest* | |
ac_cv_cygwin=yes | |
else | |
t@@ -3206,23 +3195,19 @@ EOF | |
CFLAGS="$CFLAGS -mwindows -fnative-struct -mno-cygwin" | |
LIBS="$LIBS -lwsock32 -lcomctl32" | |
- if test "$WIN32_CLIENT" = "yes" ; then | |
- WIN_RC="dopewars.rc" | |
- WIN_RES="dopewars.res" | |
- WIN_MAKE_RES="$srcdir/cygwin.am" | |
+ if test "$GUI_CLIENT" = "yes" ; then | |
cat >> confdefs.h <<\EOF | |
-#define WIN32_CLIENT 1 | |
+#define GUI_CLIENT 1 | |
EOF | |
fi | |
- GTK_CLIENT="no" | |
LDFLAGS="$LDFLAGS -lglib-1.3" | |
else | |
echo "$ac_t"""Configuring for Unix binary"" 1>&6 | |
if test "$CURSES_CLIENT" = "yes" ; then | |
echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 | |
-echo "configure:3226: checking for initscr in -lncurses" >&5 | |
+echo "configure:3211: checking for initscr in -lncurses" >&5 | |
ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -3230,7 +3215,7 @@ else | |
ac_save_LIBS="$LIBS" | |
LIBS="-lncurses $LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 3234 "configure" | |
+#line 3219 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -3241,7 +3226,7 @@ int main() { | |
initscr() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_lib_$ac_lib_var=yes" | |
else | |
t@@ -3270,7 +3255,7 @@ fi | |
if test "$ac_cv_lib_ncurses_initscr" = "no" ; then | |
echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 | |
-echo "configure:3274: checking for initscr in -lcurses" >&5 | |
+echo "configure:3259: checking for initscr in -lcurses" >&5 | |
ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -3278,7 +3263,7 @@ else | |
ac_save_LIBS="$LIBS" | |
LIBS="-lcurses $LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 3282 "configure" | |
+#line 3267 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -3289,7 +3274,7 @@ int main() { | |
initscr() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_lib_$ac_lib_var=yes" | |
else | |
t@@ -3318,7 +3303,7 @@ fi | |
if test "$ac_cv_lib_curses_initscr" = "no" ; then | |
echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6 | |
-echo "configure:3322: checking for initscr in -lcur_colr" >&5 | |
+echo "configure:3307: checking for initscr in -lcur_colr" >&5 | |
ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -3326,7 +3311,7 @@ else | |
ac_save_LIBS="$LIBS" | |
LIBS="-lcur_colr $LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 3330 "configure" | |
+#line 3315 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -3337,7 +3322,7 @@ int main() { | |
initscr() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_lib_$ac_lib_var=yes" | |
else | |
t@@ -3372,7 +3357,7 @@ fi | |
fi | |
fi | |
- if test "$GTK_CLIENT" = "yes" ; then | |
+ if test "$GUI_CLIENT" = "yes" ; then | |
# Check whether --with-gtk-prefix or --without-gtk-prefix was give… | |
if test "${with_gtk_prefix+set}" = set; then | |
withval="$with_gtk_prefix" | |
t@@ -3423,7 +3408,7 @@ fi | |
# Extract the first word of "gtk-config", so it can be a program name with a… | |
set dummy gtk-config; ac_word=$2 | |
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
-echo "configure:3427: checking for $ac_word" >&5 | |
+echo "configure:3412: checking for $ac_word" >&5 | |
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -3458,7 +3443,7 @@ fi | |
min_gtk_version=1.2.0 | |
echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 | |
-echo "configure:3462: checking for GTK - version >= $min_gtk_version" >&5 | |
+echo "configure:3447: checking for GTK - version >= $min_gtk_version" >&5 | |
no_gtk="" | |
if test "$GTK_CONFIG" = "no" ; then | |
no_gtk=yes | |
t@@ -3481,7 +3466,7 @@ echo "configure:3462: checking for GTK - version >= $min… | |
echo $ac_n "cross compiling; assumed OK... $ac_c" | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3485 "configure" | |
+#line 3470 "configure" | |
#include "confdefs.h" | |
#include <gtk/gtk.h> | |
t@@ -3559,7 +3544,7 @@ main () | |
} | |
EOF | |
-if { (eval echo configure:3563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
: | |
else | |
t@@ -3593,7 +3578,7 @@ fi | |
CFLAGS="$CFLAGS $GTK_CFLAGS" | |
LIBS="$LIBS $GTK_LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 3597 "configure" | |
+#line 3582 "configure" | |
#include "confdefs.h" | |
#include <gtk/gtk.h> | |
t@@ -3603,7 +3588,7 @@ int main() { | |
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
echo "*** The test program compiled, but did not run. This usually means" | |
echo "*** that the run-time linker is not finding GTK or finding the… | |
t@@ -3643,15 +3628,13 @@ rm -f conftest* | |
if test "$gtk_found" = "no" ; then | |
echo "configure: warning: Cannot find GTK+" 1>&2 | |
- GTK_CLIENT="no" | |
+ GUI_CLIENT="no" | |
fi | |
fi | |
- WIN32_CLIENT="no" | |
- | |
- if test "$GTK_CLIENT" = "yes" ; then | |
+ if test "$GUI_CLIENT" = "yes" ; then | |
cat >> confdefs.h <<\EOF | |
-#define GTK_CLIENT 1 | |
+#define GUI_CLIENT 1 | |
EOF | |
fi | |
t@@ -3667,21 +3650,17 @@ EOF | |
fi | |
-if test "$CURSES_CLIENT" = "no" -a "$GTK_CLIENT" = "no" -a "$WIN32_CLIENT" = "… | |
+if test "$CURSES_CLIENT" = "no" -a "$GUI_CLIENT" = "no" ; then | |
echo "configure: warning: No clients will be compiled - binary will be serv… | |
fi | |
- | |
- | |
- | |
- | |
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 | |
-echo "configure:3680: checking for ANSI C header files" >&5 | |
+echo "configure:3659: checking for ANSI C header files" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3685 "configure" | |
+#line 3664 "configure" | |
#include "confdefs.h" | |
#include <stdlib.h> | |
#include <stdarg.h> | |
t@@ -3689,7 +3668,7 @@ else | |
#include <float.h> | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:3693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:3672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
rm -rf conftest* | |
t@@ -3706,7 +3685,7 @@ rm -f conftest* | |
if test $ac_cv_header_stdc = yes; then | |
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. | |
cat > conftest.$ac_ext <<EOF | |
-#line 3710 "configure" | |
+#line 3689 "configure" | |
#include "confdefs.h" | |
#include <string.h> | |
EOF | |
t@@ -3724,7 +3703,7 @@ fi | |
if test $ac_cv_header_stdc = yes; then | |
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. | |
cat > conftest.$ac_ext <<EOF | |
-#line 3728 "configure" | |
+#line 3707 "configure" | |
#include "confdefs.h" | |
#include <stdlib.h> | |
EOF | |
t@@ -3745,7 +3724,7 @@ if test "$cross_compiling" = yes; then | |
: | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3749 "configure" | |
+#line 3728 "configure" | |
#include "confdefs.h" | |
#include <ctype.h> | |
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | |
t@@ -3756,7 +3735,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOU… | |
exit (0); } | |
EOF | |
-if { (eval echo configure:3760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
: | |
else | |
t@@ -3780,12 +3759,12 @@ EOF | |
fi | |
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 | |
-echo "configure:3784: checking for sys/wait.h that is POSIX.1 compatible" >&5 | |
+echo "configure:3763: checking for sys/wait.h that is POSIX.1 compatible" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3789 "configure" | |
+#line 3768 "configure" | |
#include "confdefs.h" | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
t@@ -3801,7 +3780,7 @@ wait (&s); | |
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
+if { (eval echo configure:3784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
rm -rf conftest* | |
ac_cv_header_sys_wait_h=yes | |
else | |
t@@ -3825,17 +3804,17 @@ for ac_hdr in fcntl.h sys/time.h unistd.h | |
do | |
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | |
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 | |
-echo "configure:3829: checking for $ac_hdr" >&5 | |
+echo "configure:3808: checking for $ac_hdr" >&5 | |
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3834 "configure" | |
+#line 3813 "configure" | |
#include "confdefs.h" | |
#include <$ac_hdr> | |
EOF | |
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
-{ (eval echo configure:3839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
+{ (eval echo configure:3818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
if test -z "$ac_err"; then | |
rm -rf conftest* | |
t@@ -3863,12 +3842,12 @@ done | |
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $… | |
-echo "configure:3867: checking whether time.h and sys/time.h may both be inclu… | |
+echo "configure:3846: checking whether time.h and sys/time.h may both be inclu… | |
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3872 "configure" | |
+#line 3851 "configure" | |
#include "confdefs.h" | |
#include <sys/types.h> | |
#include <sys/time.h> | |
t@@ -3877,7 +3856,7 @@ int main() { | |
struct tm *tp; | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
+if { (eval echo configure:3860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
rm -rf conftest* | |
ac_cv_header_time=yes | |
else | |
t@@ -3898,12 +3877,12 @@ EOF | |
fi | |
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" … | |
-echo "configure:3902: checking whether struct tm is in sys/time.h or time.h" >… | |
+echo "configure:3881: checking whether struct tm is in sys/time.h or time.h" >… | |
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3907 "configure" | |
+#line 3886 "configure" | |
#include "confdefs.h" | |
#include <sys/types.h> | |
#include <time.h> | |
t@@ -3911,7 +3890,7 @@ int main() { | |
struct tm *tp; tp->tm_sec; | |
; return 0; } | |
EOF | |
-if { (eval echo configure:3915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
+if { (eval echo configure:3894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5… | |
rm -rf conftest* | |
ac_cv_struct_tm=time.h | |
else | |
t@@ -3933,7 +3912,7 @@ fi | |
echo $ac_n "checking size of long long""... $ac_c" 1>&6 | |
-echo "configure:3937: checking size of long long" >&5 | |
+echo "configure:3916: checking size of long long" >&5 | |
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -3941,7 +3920,7 @@ else | |
{ echo "configure: error: can not run test program while cross compiling" … | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3945 "configure" | |
+#line 3924 "configure" | |
#include "confdefs.h" | |
#include <stdio.h> | |
main() | |
t@@ -3952,7 +3931,7 @@ main() | |
exit(0); | |
} | |
EOF | |
-if { (eval echo configure:3956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
ac_cv_sizeof_long_long=`cat conftestval` | |
else | |
t@@ -3973,7 +3952,7 @@ EOF | |
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 | |
-echo "configure:3977: checking for 8-bit clean memcmp" >&5 | |
+echo "configure:3956: checking for 8-bit clean memcmp" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -3981,7 +3960,7 @@ else | |
ac_cv_func_memcmp_clean=no | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 3985 "configure" | |
+#line 3964 "configure" | |
#include "confdefs.h" | |
main() | |
t@@ -3991,7 +3970,7 @@ main() | |
} | |
EOF | |
-if { (eval echo configure:3995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:3974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
ac_cv_func_memcmp_clean=yes | |
else | |
t@@ -4009,7 +3988,7 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 | |
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" | |
echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 | |
-echo "configure:4013: checking whether setvbuf arguments are reversed" >&5 | |
+echo "configure:3992: checking whether setvbuf arguments are reversed" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
t@@ -4017,7 +3996,7 @@ else | |
{ echo "configure: error: can not run test program while cross compiling" … | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 4021 "configure" | |
+#line 4000 "configure" | |
#include "confdefs.h" | |
#include <stdio.h> | |
/* If setvbuf has the reversed format, exit 0. */ | |
t@@ -4031,7 +4010,7 @@ main () { | |
exit(0); /* Non-reversed systems segv here. */ | |
} | |
EOF | |
-if { (eval echo configure:4035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
then | |
ac_cv_func_setvbuf_reversed=yes | |
else | |
t@@ -4055,12 +4034,12 @@ EOF | |
fi | |
echo $ac_n "checking for strftime""... $ac_c" 1>&6 | |
-echo "configure:4059: checking for strftime" >&5 | |
+echo "configure:4038: checking for strftime" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 4064 "configure" | |
+#line 4043 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char strftime(); below. */ | |
t@@ -4083,7 +4062,7 @@ strftime(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_strftime=yes" | |
else | |
t@@ -4105,7 +4084,7 @@ else | |
echo "$ac_t""no" 1>&6 | |
# strftime is in -lintl on SCO UNIX. | |
echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 | |
-echo "configure:4109: checking for strftime in -lintl" >&5 | |
+echo "configure:4088: checking for strftime in -lintl" >&5 | |
ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` | |
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
t@@ -4113,7 +4092,7 @@ else | |
ac_save_LIBS="$LIBS" | |
LIBS="-lintl $LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 4117 "configure" | |
+#line 4096 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -4124,7 +4103,7 @@ int main() { | |
strftime() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_lib_$ac_lib_var=yes" | |
else | |
t@@ -4153,12 +4132,12 @@ fi | |
for ac_func in strdup strstr | |
do | |
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
-echo "configure:4157: checking for $ac_func" >&5 | |
+echo "configure:4136: checking for $ac_func" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 4162 "configure" | |
+#line 4141 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char $ac_func(); below. */ | |
t@@ -4181,7 +4160,7 @@ $ac_func(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_$ac_func=yes" | |
else | |
t@@ -4212,14 +4191,14 @@ if test "$CYGWIN" = "yes" ; then | |
else | |
echo $ac_n "checking for library containing socket""... $ac_c" 1>&6 | |
-echo "configure:4216: checking for library containing socket" >&5 | |
+echo "configure:4195: checking for library containing socket" >&5 | |
if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
ac_func_search_save_LIBS="$LIBS" | |
ac_cv_search_socket="no" | |
cat > conftest.$ac_ext <<EOF | |
-#line 4223 "configure" | |
+#line 4202 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -4230,7 +4209,7 @@ int main() { | |
socket() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
ac_cv_search_socket="none required" | |
else | |
t@@ -4241,7 +4220,7 @@ rm -f conftest* | |
test "$ac_cv_search_socket" = "no" && for i in socket; do | |
LIBS="-l$i $ac_func_search_save_LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 4245 "configure" | |
+#line 4224 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -4252,7 +4231,7 @@ int main() { | |
socket() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
ac_cv_search_socket="-l$i" | |
break | |
t@@ -4274,14 +4253,14 @@ else : | |
fi | |
echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6 | |
-echo "configure:4278: checking for library containing gethostbyname" >&5 | |
+echo "configure:4257: checking for library containing gethostbyname" >&5 | |
if eval "test \"`echo '$''{'ac_cv_search_gethostbyname'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
ac_func_search_save_LIBS="$LIBS" | |
ac_cv_search_gethostbyname="no" | |
cat > conftest.$ac_ext <<EOF | |
-#line 4285 "configure" | |
+#line 4264 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -4292,7 +4271,7 @@ int main() { | |
gethostbyname() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
ac_cv_search_gethostbyname="none required" | |
else | |
t@@ -4303,7 +4282,7 @@ rm -f conftest* | |
test "$ac_cv_search_gethostbyname" = "no" && for i in nsl socket; do | |
LIBS="-l$i $ac_func_search_save_LIBS" | |
cat > conftest.$ac_ext <<EOF | |
-#line 4307 "configure" | |
+#line 4286 "configure" | |
#include "confdefs.h" | |
/* Override any gcc2 internal prototype to avoid an error. */ | |
/* We use char because int might match the return type of a gcc2 | |
t@@ -4314,7 +4293,7 @@ int main() { | |
gethostbyname() | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
ac_cv_search_gethostbyname="-l$i" | |
break | |
t@@ -4337,12 +4316,12 @@ fi | |
for ac_func in socket gethostbyname select | |
do | |
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
-echo "configure:4341: checking for $ac_func" >&5 | |
+echo "configure:4320: checking for $ac_func" >&5 | |
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
echo $ac_n "(cached) $ac_c" 1>&6 | |
else | |
cat > conftest.$ac_ext <<EOF | |
-#line 4346 "configure" | |
+#line 4325 "configure" | |
#include "confdefs.h" | |
/* System header to define __stub macros and hopefully few prototypes, | |
which can conflict with char $ac_func(); below. */ | |
t@@ -4365,7 +4344,7 @@ $ac_func(); | |
; return 0; } | |
EOF | |
-if { (eval echo configure:4369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
+if { (eval echo configure:4348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&… | |
rm -rf conftest* | |
eval "ac_cv_func_$ac_func=yes" | |
else | |
t@@ -4599,10 +4578,6 @@ s%@localedir@%$localedir%g | |
s%@GTK_CONFIG@%$GTK_CONFIG%g | |
s%@GTK_CFLAGS@%$GTK_CFLAGS%g | |
s%@GTK_LIBS@%$GTK_LIBS%g | |
-s%@WIN_RC@%$WIN_RC%g | |
-s%@WIN_RES@%$WIN_RES%g | |
-/@WIN_MAKE_RES@/r $WIN_MAKE_RES | |
-s%@WIN_MAKE_RES@%%g | |
s%@LIBOBJS@%$LIBOBJS%g | |
CEOF | |
diff --git a/configure.in b/configure.in | |
t@@ -23,18 +23,14 @@ AC_SUBST(localedir) | |
dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) | |
dnl Process client options | |
-AC_ARG_ENABLE(gtk-client, | |
-[ --enable-gtk-client include GTK+ client on Unix systems], | |
-[ GTK_CLIENT="$enableval" ],[ GTK_CLIENT="yes" ]) | |
+AC_ARG_ENABLE(gui-client, | |
+[ --enable-gui-client include graphical client (GTK+/Win32)], | |
+[ GUI_CLIENT="$enableval" ],[ GUI_CLIENT="yes" ]) | |
AC_ARG_ENABLE(curses-client, | |
[ --enable-curses-client include curses client], | |
[ CURSES_CLIENT="$enableval" ],[ CURSES_CLIENT="yes" ]) | |
-AC_ARG_ENABLE(win32-client, | |
-[ --enable-win32-client include graphical Win32 client on Windows systems], | |
-[ WIN32_CLIENT="$enableval" ],[ WIN32_CLIENT="yes" ]) | |
- | |
WIN_RC="" | |
WIN_RES="" | |
WIN_MAKE_RES="/dev/null" | |
t@@ -51,13 +47,9 @@ if test "$CYGWIN" = "yes" ; then | |
AC_DEFINE(CYGWIN) | |
CFLAGS="$CFLAGS -mwindows -fnative-struct -mno-cygwin" | |
LIBS="$LIBS -lwsock32 -lcomctl32" | |
- if test "$WIN32_CLIENT" = "yes" ; then | |
- WIN_RC="dopewars.rc" | |
- WIN_RES="dopewars.res" | |
- WIN_MAKE_RES="$srcdir/cygwin.am" | |
- AC_DEFINE(WIN32_CLIENT) | |
+ if test "$GUI_CLIENT" = "yes" ; then | |
+ AC_DEFINE(GUI_CLIENT) | |
fi | |
- GTK_CLIENT="no" | |
dnl Glib stuff | |
LDFLAGS="$LDFLAGS -lglib-1.3" | |
t@@ -78,19 +70,17 @@ else | |
fi | |
fi | |
- if test "$GTK_CLIENT" = "yes" ; then | |
+ if test "$GUI_CLIENT" = "yes" ; then | |
dnl Tests for GTK | |
AM_PATH_GTK(1.2.0,gtk_found="yes",gtk_found="no") | |
if test "$gtk_found" = "no" ; then | |
AC_MSG_WARN(Cannot find GTK+) | |
- GTK_CLIENT="no" | |
+ GUI_CLIENT="no" | |
fi | |
fi | |
- WIN32_CLIENT="no" | |
- | |
- if test "$GTK_CLIENT" = "yes" ; then | |
- AC_DEFINE(GTK_CLIENT) | |
+ if test "$GUI_CLIENT" = "yes" ; then | |
+ AC_DEFINE(GUI_CLIENT) | |
fi | |
dnl Glib stuff | |
t@@ -102,14 +92,10 @@ if test "$CURSES_CLIENT" = "yes" ; then | |
AC_DEFINE(CURSES_CLIENT) | |
fi | |
-if test "$CURSES_CLIENT" = "no" -a "$GTK_CLIENT" = "no" -a "$WIN32_CLIENT" = "… | |
+if test "$CURSES_CLIENT" = "no" -a "$GUI_CLIENT" = "no" ; then | |
AC_MSG_WARN(No clients will be compiled - binary will be server/AI only!) | |
fi | |
-AC_SUBST(WIN_RC) | |
-AC_SUBST(WIN_RES) | |
-AC_SUBST_FILE(WIN_MAKE_RES) | |
- | |
dnl Checks for header files. | |
AC_HEADER_STDC | |
AC_HEADER_SYS_WAIT | |
diff --git a/doc/Makefile.in b/doc/Makefile.in | |
t@@ -84,8 +84,6 @@ RANLIB = @RANLIB@ | |
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ | |
USE_NLS = @USE_NLS@ | |
VERSION = @VERSION@ | |
-WIN_RC = @WIN_RC@ | |
-WIN_RES = @WIN_RES@ | |
l = @l@ | |
localedir = @localedir@ | |
diff --git a/src/Makefile.am b/src/Makefile.am | |
t@@ -1,11 +1,10 @@ | |
bin_PROGRAMS = dopewars | |
dopewars_SOURCES = AIPlayer.c serverside.c dopewars.c message.c \ | |
curses_client.c gtk_client.c win32_client.c \ | |
- dopeos.c tstring.c @WIN_RC@ | |
-dopewars_DEPENDENCIES = @WIN_RES@ | |
+ dopeos.c tstring.c | |
SUFFIXES = .rc .res | |
INCLUDES = @GTK_CFLAGS@ -I.. -I. | |
-LDADD = @GTK_LIBS@ @WIN_RES@ | |
+LDADD = @GTK_LIBS@ | |
DEFS = @DEFS@ -DLOCALEDIR=\"${localedir}\" | |
DOCPATH=/usr/doc/${PACKAGE}-${VERSION}/ | |
t@@ -13,8 +12,6 @@ DOCS= aiplayer.html configfile.html index.html server.html c… | |
credits.html installation.html servercommands.html commandline.html \ | |
developer.html metaserver.html windows.html README | |
-@WIN_MAKE_RES@ | |
- | |
install-exec-hook: | |
chown root.games ${bindir}/dopewars | |
chmod 2755 ${bindir}/dopewars | |
diff --git a/src/Makefile.in b/src/Makefile.in | |
t@@ -84,18 +84,15 @@ RANLIB = @RANLIB@ | |
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ | |
USE_NLS = @USE_NLS@ | |
VERSION = @VERSION@ | |
-WIN_RC = @WIN_RC@ | |
-WIN_RES = @WIN_RES@ | |
l = @l@ | |
localedir = @localedir@ | |
bin_PROGRAMS = dopewars | |
-dopewars_SOURCES = AIPlayer.c serverside.c dopewars.c message.c … | |
+dopewars_SOURCES = AIPlayer.c serverside.c dopewars.c message.c … | |
-dopewars_DEPENDENCIES = @WIN_RES@ | |
SUFFIXES = .rc .res | |
INCLUDES = @GTK_CFLAGS@ -I.. -I. | |
-LDADD = @GTK_LIBS@ @WIN_RES@ | |
+LDADD = @GTK_LIBS@ | |
DEFS = @DEFS@ -DLOCALEDIR=\"${localedir}\" | |
DOCPATH = /usr/doc/${PACKAGE}-${VERSION}/ | |
t@@ -112,6 +109,7 @@ LIBS = @LIBS@ | |
dopewars_OBJECTS = AIPlayer.o serverside.o dopewars.o message.o \ | |
curses_client.o gtk_client.o win32_client.o dopeos.o tstring.o | |
dopewars_LDADD = $(LDADD) | |
+dopewars_DEPENDENCIES = | |
dopewars_LDFLAGS = | |
CFLAGS = @CFLAGS@ | |
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(… | |
t@@ -342,8 +340,6 @@ mostlyclean-generic distclean-generic clean-generic \ | |
maintainer-clean-generic clean mostlyclean distclean maintainer-clean | |
-@WIN_MAKE_RES@ | |
- | |
install-exec-hook: | |
chown root.games ${bindir}/dopewars | |
chmod 2755 ${bindir}/dopewars | |
diff --git a/src/gtk.c b/src/gtk.c | |
t@@ -0,0 +1,3206 @@ | |
+#include <string.h> | |
+#include <windows.h> | |
+#include <winsock.h> | |
+#include <commctrl.h> | |
+#include <stdarg.h> | |
+#include "gtk.h" | |
+ | |
+#define LISTITEMVPACK 0 | |
+#define LISTITEMHPACK 2 | |
+ | |
+#define WM_SOCKETDATA (WM_USER+100) | |
+ | |
+static const gchar *WC_GTKSEP = "WC_GTKSEP"; | |
+ | |
+static BOOL GetTextSize(HWND hWnd,char *text,LPSIZE lpSize); | |
+static void gtk_button_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_entry_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_text_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_button_destroy(GtkWidget *widget); | |
+static void gtk_check_button_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_check_button_toggled(GtkCheckButton *check_button, | |
+ gpointer data); | |
+static void gtk_radio_button_clicked(GtkRadioButton *radio_button, | |
+ gpointer data); | |
+static void gtk_radio_button_toggled(GtkRadioButton *radio_button, | |
+ gpointer data); | |
+static void gtk_container_destroy(GtkWidget *widget); | |
+static void gtk_container_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_container_set_size(GtkWidget *widget,GtkAllocation *allocation… | |
+static void gtk_window_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_window_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+static void gtk_window_destroy(GtkWidget *widget); | |
+static void gtk_window_set_menu(GtkWindow *window,GtkMenuBar *menu_bar); | |
+static GtkWidget *gtk_window_get_menu_ID(GtkWindow *window,gint ID); | |
+static void gtk_table_destroy(GtkWidget *widget); | |
+static void gtk_table_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_table_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+static void gtk_table_realize(GtkWidget *widget); | |
+static void gtk_box_destroy(GtkWidget *widget); | |
+static void gtk_hbox_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_hbox_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+static void gtk_vbox_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_vbox_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+static gint gtk_window_delete_event(GtkWidget *widget,GdkEvent *event); | |
+static void gtk_window_realize(GtkWidget *widget); | |
+static void gtk_window_show(GtkWidget *widget); | |
+static void gtk_window_hide(GtkWidget *widget); | |
+static void gtk_container_realize(GtkWidget *widget); | |
+static void gtk_button_realize(GtkWidget *widget); | |
+static void gtk_entry_realize(GtkWidget *widget); | |
+static void gtk_text_realize(GtkWidget *widget); | |
+static void gtk_check_button_realize(GtkWidget *widget); | |
+static void gtk_radio_button_realize(GtkWidget *widget); | |
+static void gtk_radio_button_destroy(GtkWidget *widget); | |
+static void gtk_box_realize(GtkWidget *widget); | |
+ | |
+static HWND gtk_get_parent_hwnd(GtkWidget *widget); | |
+static void gtk_label_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_label_set_size(GtkWidget *widget, | |
+ GtkAllocation *allocation); | |
+static void gtk_label_destroy(GtkWidget *widget); | |
+static void gtk_label_realize(GtkWidget *widget); | |
+static void gtk_frame_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_frame_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+static void gtk_frame_destroy(GtkWidget *widget); | |
+static void gtk_frame_realize(GtkWidget *widget); | |
+static void gtk_clist_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_clist_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+static void gtk_clist_realize(GtkWidget *widget); | |
+static void gtk_clist_show(GtkWidget *widget); | |
+static void gtk_clist_hide(GtkWidget *widget); | |
+static void gtk_clist_draw_row(GtkCList *clist,LPDRAWITEMSTRUCT lpdis); | |
+static void gtk_container_show_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_box_show_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_table_show_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_widget_show_all_full(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_widget_show_full(GtkWidget *widget,gboolean recurse); | |
+static void gtk_container_hide_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_box_hide_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_table_hide_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_widget_hide_all_full(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_widget_hide_full(GtkWidget *widget,gboolean recurse); | |
+ | |
+static void gtk_marshal_BOOL__GPOIN(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args); | |
+static void gtk_marshal_BOOL__GINT(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args); | |
+static void gtk_marshal_VOID__VOID(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args); | |
+static void gtk_marshal_VOID__BOOL(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args); | |
+static void gtk_marshal_VOID__GPOIN(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args); | |
+static void gtk_menu_bar_realize(GtkWidget *widget); | |
+static void gtk_menu_item_realize(GtkWidget *widget); | |
+static void gtk_menu_item_enable(GtkWidget *widget); | |
+static void gtk_menu_item_disable(GtkWidget *widget); | |
+static void gtk_menu_realize(GtkWidget *widget); | |
+static void gtk_menu_shell_realize(GtkWidget *widget); | |
+static GtkWidget *gtk_menu_shell_get_menu_ID(GtkMenuShell *menu_shell,gint ID); | |
+static void gtk_widget_create(GtkWidget *widget); | |
+static void gtk_notebook_realize(GtkWidget *widget); | |
+static void gtk_notebook_destroy(GtkWidget *widget); | |
+static void gtk_notebook_set_size(GtkWidget *widget, | |
+ GtkAllocation *allocation); | |
+static void gtk_notebook_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_notebook_show_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_notebook_hide_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_spin_button_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_spin_button_set_size(GtkWidget *widget, | |
+ GtkAllocation *allocation); | |
+static void gtk_spin_button_realize(GtkWidget *widget); | |
+static void gtk_spin_button_destroy(GtkWidget *widget); | |
+static void gtk_spin_button_show(GtkWidget *widget); | |
+static void gtk_spin_button_hide(GtkWidget *widget); | |
+static void gtk_separator_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_separator_realize(GtkWidget *widget); | |
+static void gtk_paned_show_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_paned_hide_all(GtkWidget *widget,gboolean hWndOnly); | |
+static void gtk_paned_realize(GtkWidget *widget); | |
+static void gtk_vpaned_realize(GtkWidget *widget); | |
+static void gtk_hpaned_realize(GtkWidget *widget); | |
+static void gtk_vpaned_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_hpaned_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition); | |
+static void gtk_vpaned_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+static void gtk_hpaned_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+ | |
+typedef struct _GdkInput GdkInput; | |
+ | |
+struct _GdkInput { | |
+ gint source; | |
+ GdkInputCondition condition; | |
+ GdkInputFunction function; | |
+ gpointer data; | |
+}; | |
+ | |
+typedef struct _GtkItemFactoryChild GtkItemFactoryChild; | |
+ | |
+struct _GtkItemFactoryChild { | |
+ gchar *path; | |
+ GtkWidget *widget; | |
+}; | |
+ | |
+static GtkSignalType GtkObjectSignals[] = { | |
+ { "create",gtk_marshal_VOID__VOID,NULL }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkObjectClass = { | |
+ "object",NULL,sizeof(GtkObject),GtkObjectSignals | |
+}; | |
+ | |
+static GtkClass GtkAdjustmentClass = { | |
+ "adjustment",&GtkObjectClass,sizeof(GtkAdjustment),NULL | |
+}; | |
+ | |
+static GtkClass GtkItemFactoryClass = { | |
+ "itemfactory",&GtkObjectClass,sizeof(GtkItemFactory),NULL | |
+}; | |
+ | |
+static GtkSignalType GtkWidgetSignals[] = { | |
+ { "create",gtk_marshal_VOID__VOID,gtk_widget_create }, | |
+ { "size_request",gtk_marshal_VOID__GPOIN,NULL }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,NULL }, | |
+ { "realize",gtk_marshal_VOID__VOID,NULL }, | |
+ { "destroy",gtk_marshal_VOID__VOID,NULL }, | |
+ { "show",gtk_marshal_VOID__VOID,NULL }, | |
+ { "hide",gtk_marshal_VOID__VOID,NULL }, | |
+ { "show_all",gtk_marshal_VOID__BOOL,NULL }, | |
+ { "hide_all",gtk_marshal_VOID__BOOL,NULL }, | |
+ { "enable",gtk_marshal_VOID__VOID,NULL }, | |
+ { "disable",gtk_marshal_VOID__VOID,NULL }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkWidgetClass = { | |
+ "widget",&GtkObjectClass,sizeof(GtkWidget),GtkWidgetSignals | |
+}; | |
+ | |
+static GtkSignalType GtkSeparatorSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_separator_size_request }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_separator_realize }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkSeparatorClass = { | |
+ "separator",&GtkWidgetClass,sizeof(GtkSeparator),GtkSeparatorSignals | |
+}; | |
+ | |
+static GtkClass GtkHSeparatorClass = { | |
+ "hseparator",&GtkSeparatorClass,sizeof(GtkHSeparator),NULL | |
+}; | |
+ | |
+static GtkClass GtkVSeparatorClass = { | |
+ "vseparator",&GtkSeparatorClass,sizeof(GtkVSeparator),NULL | |
+}; | |
+ | |
+static GtkClass GtkMenuShellClass = { | |
+ "menushell",&GtkWidgetClass,sizeof(GtkMenuShell),NULL | |
+}; | |
+ | |
+static GtkSignalType GtkMenuBarSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_menu_bar_realize }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkMenuBarClass = { | |
+ "menubar",&GtkMenuShellClass,sizeof(GtkMenuBar),GtkMenuBarSignals | |
+}; | |
+ | |
+static GtkSignalType GtkMenuItemSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_menu_item_realize }, | |
+ { "activate",gtk_marshal_VOID__VOID,NULL }, | |
+ { "enable",gtk_marshal_VOID__VOID,gtk_menu_item_enable }, | |
+ { "disable",gtk_marshal_VOID__VOID,gtk_menu_item_disable }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkMenuItemClass = { | |
+ "menuitem",&GtkWidgetClass,sizeof(GtkMenuItem),GtkMenuItemSignals | |
+}; | |
+ | |
+static GtkSignalType GtkMenuSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_menu_realize }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkMenuClass = { | |
+ "menu",&GtkMenuShellClass,sizeof(GtkMenu),GtkMenuSignals | |
+}; | |
+ | |
+static GtkClass GtkEditableClass = { | |
+ "editable",&GtkWidgetClass,sizeof(GtkEditable),NULL | |
+}; | |
+ | |
+static GtkSignalType GtkEntrySignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_entry_size_request }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_entry_realize }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkEntryClass = { | |
+ "entry",&GtkEditableClass,sizeof(GtkEntry),GtkEntrySignals | |
+}; | |
+ | |
+static GtkSignalType GtkSpinButtonSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_spin_button_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_spin_button_set_size }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_spin_button_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_spin_button_destroy }, | |
+ { "hide",gtk_marshal_VOID__VOID,gtk_spin_button_hide }, | |
+ { "show",gtk_marshal_VOID__VOID,gtk_spin_button_show }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkSpinButtonClass = { | |
+ "spinbutton",&GtkEntryClass,sizeof(GtkSpinButton),GtkSpinButtonSignals | |
+}; | |
+ | |
+static GtkSignalType GtkTextSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_text_size_request }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_text_realize }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkTextClass = { | |
+ "text",&GtkEditableClass,sizeof(GtkText),GtkTextSignals | |
+}; | |
+ | |
+static GtkSignalType GtkLabelSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_label_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_label_set_size }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_label_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_label_destroy }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkLabelClass = { | |
+ "label",&GtkWidgetClass,sizeof(GtkLabel),GtkLabelSignals | |
+}; | |
+ | |
+static GtkSignalType GtkButtonSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_button_size_request }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_button_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_button_destroy }, | |
+ { "clicked",gtk_marshal_VOID__VOID,NULL }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkButtonClass = { | |
+ "button",&GtkWidgetClass,sizeof(GtkButton),GtkButtonSignals | |
+}; | |
+ | |
+static GtkSignalType GtkToggleButtonSignals[] = { | |
+ { "toggled",gtk_marshal_VOID__VOID,NULL }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkToggleButtonClass = { | |
+ "toggle",&GtkButtonClass,sizeof(GtkToggleButton),GtkToggleButtonSignals | |
+}; | |
+ | |
+static GtkSignalType GtkCheckButtonSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_check_button_size_request }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_check_button_realize }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkCheckButtonClass = { | |
+ "check",&GtkToggleButtonClass,sizeof(GtkCheckButton),GtkCheckButtonSignals | |
+}; | |
+ | |
+static GtkSignalType GtkRadioButtonSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_radio_button_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_radio_button_destroy }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkRadioButtonClass = { | |
+ "radio",&GtkCheckButtonClass,sizeof(GtkRadioButton),GtkRadioButtonSignals | |
+}; | |
+ | |
+static GtkSignalType GtkContainerSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_container_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_container_set_size }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_container_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_container_destroy }, | |
+ { "show_all",gtk_marshal_VOID__BOOL,gtk_container_show_all }, | |
+ { "hide_all",gtk_marshal_VOID__BOOL,gtk_container_hide_all }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkContainerClass = { | |
+ "container",&GtkWidgetClass,sizeof(GtkContainer),GtkContainerSignals | |
+}; | |
+ | |
+static GtkSignalType GtkPanedSignals[] = { | |
+ { "show_all",gtk_marshal_VOID__VOID,gtk_paned_show_all }, | |
+ { "hide_all",gtk_marshal_VOID__VOID,gtk_paned_hide_all }, | |
+ { "",NULL,NULL } | |
+}; | |
+static GtkClass GtkPanedClass = { | |
+ "paned",&GtkContainerClass,sizeof(GtkPaned),GtkPanedSignals | |
+}; | |
+ | |
+static GtkSignalType GtkVPanedSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_vpaned_realize }, | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_vpaned_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_vpaned_set_size }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkVPanedClass = { | |
+ "vpaned",&GtkPanedClass,sizeof(GtkVPaned),GtkVPanedSignals | |
+}; | |
+ | |
+static GtkSignalType GtkHPanedSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_hpaned_realize }, | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_hpaned_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_hpaned_set_size }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkHPanedClass = { | |
+ "hpaned",&GtkPanedClass,sizeof(GtkHPaned),GtkHPanedSignals | |
+}; | |
+ | |
+static GtkSignalType GtkBoxSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_box_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_box_destroy }, | |
+ { "show_all",gtk_marshal_VOID__BOOL,gtk_box_show_all }, | |
+ { "hide_all",gtk_marshal_VOID__BOOL,gtk_box_hide_all }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkBoxClass = { | |
+ "box",&GtkContainerClass,sizeof(GtkBox),GtkBoxSignals | |
+}; | |
+ | |
+static GtkSignalType GtkNotebookSignals[] = { | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_notebook_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_notebook_destroy }, | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_notebook_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_notebook_set_size }, | |
+ { "show_all",gtk_marshal_VOID__BOOL,gtk_notebook_show_all }, | |
+ { "hide_all",gtk_marshal_VOID__BOOL,gtk_notebook_hide_all }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkNotebookClass = { | |
+ "notebook",&GtkContainerClass,sizeof(GtkNotebook),GtkNotebookSignals | |
+}; | |
+ | |
+static GtkSignalType GtkTableSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_table_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_table_set_size }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_table_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_table_destroy }, | |
+ { "show_all",gtk_marshal_VOID__BOOL,gtk_table_show_all }, | |
+ { "hide_all",gtk_marshal_VOID__BOOL,gtk_table_hide_all }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkTableClass = { | |
+ "table",&GtkContainerClass,sizeof(GtkTable),GtkTableSignals | |
+}; | |
+ | |
+static GtkSignalType GtkCListSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_clist_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_clist_set_size }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_clist_realize }, | |
+ { "show",gtk_marshal_VOID__VOID,gtk_clist_show }, | |
+ { "hide",gtk_marshal_VOID__VOID,gtk_clist_hide }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkCListClass = { | |
+ "clist",&GtkContainerClass,sizeof(GtkCList),GtkCListSignals | |
+}; | |
+ | |
+static GtkSignalType GtkHBoxSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_hbox_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_hbox_set_size }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkHBoxClass = { | |
+ "hbox",&GtkBoxClass,sizeof(GtkHBox),GtkHBoxSignals | |
+}; | |
+ | |
+static GtkSignalType GtkVBoxSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_vbox_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_vbox_set_size }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkVBoxClass = { | |
+ "vbox",&GtkBoxClass,sizeof(GtkVBox),GtkVBoxSignals | |
+}; | |
+ | |
+static GtkClass GtkBinClass = { | |
+ "bin",&GtkContainerClass,sizeof(GtkBin),NULL | |
+}; | |
+ | |
+static GtkSignalType GtkFrameSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_frame_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_frame_set_size }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_frame_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_frame_destroy }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkFrameClass = { | |
+ "frame",&GtkBinClass,sizeof(GtkFrame),GtkFrameSignals | |
+}; | |
+ | |
+static GtkSignalType GtkWindowSignals[] = { | |
+ { "size_request",gtk_marshal_VOID__GPOIN,gtk_window_size_request }, | |
+ { "set_size",gtk_marshal_VOID__GPOIN,gtk_window_set_size }, | |
+ { "realize",gtk_marshal_VOID__VOID,gtk_window_realize }, | |
+ { "destroy",gtk_marshal_VOID__VOID,gtk_window_destroy }, | |
+ { "show",gtk_marshal_VOID__VOID,gtk_window_show }, | |
+ { "hide",gtk_marshal_VOID__VOID,gtk_window_hide }, | |
+ { "delete_event",gtk_marshal_BOOL__GPOIN, | |
+ GTK_SIGNAL_FUNC(gtk_window_delete_event) }, | |
+ { "",NULL,NULL } | |
+}; | |
+ | |
+static GtkClass GtkWindowClass = { | |
+ "window",&GtkBinClass,sizeof(GtkWindow),GtkWindowSignals | |
+}; | |
+ | |
+const GtkType GTK_TYPE_WINDOW=&GtkWindowClass; | |
+const GtkType GTK_TYPE_MENU_BAR=&GtkMenuBarClass; | |
+ | |
+static HINSTANCE hInst; | |
+static HFONT hFont; | |
+static GSList *WindowList=NULL; | |
+static GSList *GdkInputs=NULL; | |
+static HWND TopLevel=NULL; | |
+ | |
+static void gtk_set_default_font(HWND hWnd) { | |
+ SendMessage(hWnd,WM_SETFONT,(WPARAM)hFont,MAKELPARAM(FALSE,0)); | |
+} | |
+ | |
+static GtkObject *GtkNewObject(GtkClass *klass) { | |
+ GtkObject *newObj; | |
+ | |
+ newObj=g_malloc0(klass->Size); | |
+ newObj->klass=klass; | |
+ gtk_signal_emit(newObj,"create"); | |
+ | |
+ return newObj; | |
+} | |
+ | |
+static void DispatchSocketEvent(SOCKET sock,long event) { | |
+ GSList *list; | |
+ GdkInput *input; | |
+ for (list=GdkInputs;list;list=g_slist_next(list)) { | |
+ input=(GdkInput *)(list->data); | |
+ if (input->source==sock) { | |
+ (*input->function)(input->data,input->source, | |
+ (event&FD_READ ? GDK_INPUT_READ : 0) | | |
+ (event&FD_WRITE ? GDK_INPUT_WRITE : 0)); | |
+ break; | |
+ } | |
+ } | |
+} | |
+ | |
+LRESULT CALLBACK GtkSepProc(HWND hwnd,UINT msg,UINT wParam,LONG lParam) { | |
+ PAINTSTRUCT ps; | |
+ HPEN oldpen,dkpen,ltpen; | |
+ RECT rect; | |
+ HDC hDC; | |
+ if (msg==WM_PAINT) { | |
+ if (GetUpdateRect(hwnd,NULL,TRUE)) { | |
+ BeginPaint(hwnd,&ps); | |
+ GetClientRect(hwnd,&rect); | |
+ hDC=ps.hdc; | |
+ ltpen=CreatePen(PS_SOLID,0,(COLORREF)GetSysColor(COLOR_3DHILIGHT)); | |
+ dkpen=CreatePen(PS_SOLID,0,(COLORREF)GetSysColor(COLOR_3DSHADOW)); | |
+ | |
+ if (rect.right > rect.bottom) { | |
+ oldpen=SelectObject(hDC,dkpen); | |
+ MoveToEx(hDC,rect.left,rect.top,NULL); | |
+ LineTo(hDC,rect.right,rect.top); | |
+ | |
+ SelectObject(hDC,ltpen); | |
+ MoveToEx(hDC,rect.left,rect.top+1,NULL); | |
+ LineTo(hDC,rect.right,rect.top+1); | |
+ } else { | |
+ oldpen=SelectObject(hDC,dkpen); | |
+ MoveToEx(hDC,rect.left,rect.top,NULL); | |
+ LineTo(hDC,rect.left,rect.bottom); | |
+ | |
+ SelectObject(hDC,ltpen); | |
+ MoveToEx(hDC,rect.left+1,rect.top,NULL); | |
+ LineTo(hDC,rect.left+1,rect.bottom); | |
+ } | |
+ | |
+ SelectObject(hDC,oldpen); | |
+ DeleteObject(ltpen); DeleteObject(dkpen); | |
+ EndPaint(hwnd,&ps); | |
+ } | |
+ return TRUE; | |
+ } else return DefWindowProc(hwnd,msg,wParam,lParam); | |
+} | |
+ | |
+LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,UINT wParam,LONG lParam) { | |
+ GtkWidget *window,*widget; | |
+ RECT rect; | |
+ GtkAllocation alloc; | |
+ gboolean signal_return; | |
+ GdkEvent event=0; | |
+ LPMEASUREITEMSTRUCT lpmis; | |
+ HDC hDC; | |
+ TEXTMETRIC tm; | |
+ LPDRAWITEMSTRUCT lpdis; | |
+ HD_NOTIFY FAR* phdr; | |
+ NMHDR *nmhdr; | |
+ switch(msg) { | |
+ case WM_SIZE: | |
+ window=GTK_WIDGET(GetWindowLong(hwnd,GWL_USERDATA)); | |
+ GetWindowRect(hwnd,&rect); | |
+ alloc.x=rect.left; alloc.y=rect.top; | |
+ alloc.width=rect.right-rect.left; | |
+ alloc.height=rect.bottom-rect.top; | |
+ gtk_widget_set_size(window,&alloc); | |
+ break; | |
+ case WM_COMMAND: | |
+ if (lParam && HIWORD(wParam)==BN_CLICKED) { | |
+ gtk_signal_emit(GTK_OBJECT(GetWindowLong((HWND)lParam, | |
+ GWL_USERDATA)),"clicked"); | |
+ } else if (HIWORD(wParam)==0) { | |
+ widget=gtk_window_get_menu_ID( | |
+ GTK_WINDOW(GetWindowLong(hwnd,GWL_USERDATA)), | |
+ LOWORD(wParam)); | |
+ if (widget) gtk_signal_emit(GTK_OBJECT(widget),"activate"); | |
+ } else return TRUE; | |
+ break; | |
+ case WM_CLOSE: | |
+ gtk_signal_emit(GTK_OBJECT(GetWindowLong(hwnd,GWL_USERDATA)), | |
+ "delete_event",&event,&signal_return); | |
+ return TRUE; | |
+ break; | |
+ case WM_DRAWITEM: | |
+ lpdis=(LPDRAWITEMSTRUCT)lParam; | |
+ if (lpdis) { | |
+ gtk_clist_draw_row(GTK_CLIST(GetWindowLong(lpdis->hwndItem, | |
+ GWL_USERDATA)),lpdis); | |
+ return TRUE; | |
+ } | |
+ break; | |
+ case WM_MEASUREITEM: | |
+ lpmis=(LPMEASUREITEMSTRUCT)lParam; | |
+ hDC=GetDC(hwnd); | |
+ if (!GetTextMetrics(hDC,&tm)) g_warning("GetTextMetrics failed"); | |
+ ReleaseDC(hwnd,hDC); | |
+ if (lpmis) { | |
+ lpmis->itemHeight = tm.tmHeight + LISTITEMVPACK*2; | |
+ return TRUE; | |
+ } | |
+ break; | |
+ case WM_NOTIFY: | |
+ phdr=(HD_NOTIFY FAR *)lParam; | |
+ nmhdr=(NMHDR *)lParam; | |
+ if (!nmhdr) break; | |
+ if (nmhdr->code==HDN_ITEMCHANGED) { | |
+ gtk_clist_set_column_width( | |
+ GTK_CLIST(GetWindowLong(nmhdr->hwndFrom,GWL_USERDATA)), | |
+ phdr->iItem,phdr->pitem->cxy); | |
+ return FALSE; | |
+ } else if (nmhdr->code==TCN_SELCHANGE) { | |
+ gtk_notebook_set_page( | |
+ GTK_NOTEBOOK(GetWindowLong(nmhdr->hwndFrom,GWL_USERDATA)), | |
+ TabCtrl_GetCurSel(nmhdr->hwndFrom)); | |
+ return FALSE; | |
+ } | |
+ break; | |
+ case WM_SOCKETDATA: | |
+ DispatchSocketEvent((SOCKET)wParam,WSAGETSELECTEVENT(lParam)); | |
+ break; | |
+ default: | |
+ return DefWindowProc(hwnd,msg,wParam,lParam); | |
+ } | |
+ return FALSE; | |
+} | |
+ | |
+void win32_init(HINSTANCE hInstance,HINSTANCE hPrevInstance) { | |
+ WNDCLASS wc; | |
+ hInst=hInstance; | |
+ hFont=(HFONT)GetStockObject(DEFAULT_GUI_FONT); | |
+ WindowList=NULL; | |
+ if (!hPrevInstance) { | |
+ wc.style = CS_HREDRAW|CS_VREDRAW; | |
+ wc.lpfnWndProc = MainWndProc; | |
+ wc.cbClsExtra = 0; | |
+ wc.cbWndExtra = 0; | |
+ wc.hInstance = hInstance; | |
+ wc.hIcon = LoadIcon(NULL,IDI_APPLICATION); | |
+ wc.hCursor = LoadCursor(NULL,IDC_ARROW); | |
+ wc.hbrBackground = (HBRUSH)(1+COLOR_BTNFACE); | |
+ wc.lpszMenuName = NULL; | |
+ wc.lpszClassName = "mainwin"; | |
+ RegisterClass(&wc); | |
+ } | |
+ | |
+ wc.style = CS_HREDRAW|CS_VREDRAW; | |
+ wc.lpfnWndProc = GtkSepProc; | |
+ wc.cbClsExtra = 0; | |
+ wc.cbWndExtra = 0; | |
+ wc.hInstance = hInstance; | |
+ wc.hIcon = NULL; | |
+ wc.hCursor = LoadCursor(NULL,IDC_ARROW); | |
+ wc.hbrBackground = (HBRUSH)(1+COLOR_BTNFACE); | |
+ wc.lpszMenuName = NULL; | |
+ wc.lpszClassName = WC_GTKSEP; | |
+ RegisterClass(&wc); | |
+ | |
+ InitCommonControls(); | |
+} | |
+ | |
+void gtk_widget_show(GtkWidget *widget) { | |
+ gtk_widget_show_full(widget,TRUE); | |
+} | |
+ | |
+void gtk_widget_show_full(GtkWidget *widget,gboolean recurse) { | |
+ GtkAllocation alloc; | |
+ GtkRequisition req; | |
+ GtkWidget *window; | |
+ | |
+ GTK_WIDGET_SET_FLAGS(widget,GTK_VISIBLE); | |
+ if (recurse) gtk_widget_show_all_full(widget,TRUE); | |
+ else gtk_signal_emit(GTK_OBJECT(widget),"show"); | |
+ | |
+ if (!GTK_WIDGET_REALIZED(widget) && | |
+ GTK_OBJECT(widget)->klass==&GtkWindowClass) { | |
+ gtk_widget_realize(widget); | |
+ alloc.x=alloc.y=0; | |
+ alloc.width=widget->requisition.width; | |
+ alloc.height=widget->requisition.height; | |
+ gtk_widget_set_size(widget,&alloc); | |
+ ShowWindow(widget->hWnd,SW_SHOWNORMAL); | |
+ UpdateWindow(widget->hWnd); | |
+ } else if (GTK_WIDGET_REALIZED(widget)) { | |
+ gtk_widget_size_request(widget,&req); | |
+ if (!recurse) ShowWindow(widget->hWnd,SW_SHOWNORMAL); | |
+ window=gtk_widget_get_ancestor(widget,GTK_TYPE_WINDOW); | |
+ if (window) { | |
+ alloc.x=alloc.y=0; | |
+ alloc.width=window->requisition.width; | |
+ alloc.height=window->requisition.height; | |
+ if (alloc.width < window->allocation.width) { | |
+ alloc.width=window->allocation.width; | |
+ } | |
+ if (alloc.height < window->allocation.height) { | |
+ alloc.height=window->allocation.height; | |
+ } | |
+ gtk_widget_set_size(window,&alloc); | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_widget_hide(GtkWidget *widget) { | |
+ gtk_widget_hide_full(widget,TRUE); | |
+} | |
+ | |
+void gtk_widget_hide_full(GtkWidget *widget,gboolean recurse) { | |
+ GtkAllocation alloc; | |
+ GtkRequisition req; | |
+ GtkWidget *window; | |
+ | |
+ if (recurse) gtk_widget_hide_all_full(widget,TRUE); | |
+ else { | |
+ gtk_signal_emit(GTK_OBJECT(widget),"hide"); | |
+ if (widget->hWnd) ShowWindow(widget->hWnd,SW_HIDE); | |
+ } | |
+ | |
+ GTK_WIDGET_UNSET_FLAGS(widget,GTK_VISIBLE); | |
+ gtk_widget_size_request(widget,&req); | |
+ if (GTK_WIDGET_REALIZED(widget)) { | |
+ window=gtk_widget_get_ancestor(widget,GTK_TYPE_WINDOW); | |
+ if (window) { | |
+ alloc.x=alloc.y=0; | |
+ alloc.width=window->requisition.width; | |
+ alloc.height=window->requisition.height; | |
+ if (alloc.width < window->allocation.width) { | |
+ alloc.width=window->allocation.width; | |
+ } | |
+ if (alloc.height < window->allocation.height) { | |
+ alloc.height=window->allocation.height; | |
+ } | |
+ gtk_widget_set_size(window,&alloc); | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_widget_realize(GtkWidget *widget) { | |
+ GtkRequisition req; | |
+/* g_print("Realizing widget %p of class %s\n",widget,GTK_OBJECT(widget)->klas… | |
+ gtk_signal_emit(GTK_OBJECT(widget),"realize",&req); | |
+ if (widget->hWnd) SetWindowLong(widget->hWnd,GWL_USERDATA,(LONG)widget); | |
+ GTK_WIDGET_SET_FLAGS(widget,GTK_REALIZED); | |
+ gtk_widget_size_request(widget,&req); | |
+} | |
+ | |
+void gtk_widget_create(GtkWidget *widget) { | |
+ GTK_WIDGET_SET_FLAGS(widget,GTK_SENSITIVE); | |
+} | |
+ | |
+void gtk_widget_destroy(GtkWidget *widget) { | |
+ if (!widget) return; | |
+// g_print("gtk_widget_destroy on widget %p\n",widget); | |
+ gtk_signal_emit(GTK_OBJECT(widget),"destroy"); | |
+// g_print("Freeing widget\n"); | |
+ g_free(widget); | |
+// g_print("Widget freed\n"); | |
+} | |
+ | |
+void gtk_widget_set_sensitive(GtkWidget *widget,gboolean sensitive) { | |
+ if (widget->hWnd) EnableWindow(widget->hWnd,sensitive); | |
+ gtk_signal_emit(GTK_OBJECT(widget),sensitive ? "enable" : "disable"); | |
+ if (sensitive) GTK_WIDGET_SET_FLAGS(widget,GTK_SENSITIVE); | |
+ else GTK_WIDGET_UNSET_FLAGS(widget,GTK_SENSITIVE); | |
+ if (sensitive && widget->hWnd && GTK_OBJECT(widget)->klass==&GtkWindowClass) | |
+ SetActiveWindow(widget->hWnd); | |
+} | |
+ | |
+void gtk_widget_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ GtkRequisition req; | |
+ requisition->width=requisition->height=0; | |
+ if (GTK_WIDGET_VISIBLE(widget)) { | |
+ gtk_signal_emit(GTK_OBJECT(widget),"size_request",requisition); | |
+ } | |
+ memcpy(&widget->requisition,requisition,sizeof(GtkRequisition)); | |
+ if (widget->parent) gtk_widget_size_request(widget->parent,&req); | |
+} | |
+ | |
+void gtk_widget_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ gtk_signal_emit(GTK_OBJECT(widget),"set_size",allocation); | |
+ memcpy(&widget->allocation,allocation,sizeof(GtkAllocation)); | |
+/* g_print("Widget pos set to %d,%d, size %d,%d\n", | |
+ allocation->x,allocation->y, | |
+ allocation->width,allocation->height);*/ | |
+ if (widget->hWnd) { | |
+ SetWindowPos(widget->hWnd,HWND_TOP, | |
+ allocation->x,allocation->y, | |
+ allocation->width,allocation->height, | |
+ SWP_NOZORDER | | |
+ (GTK_OBJECT(widget)->klass==&GtkWindowClass ? SWP_NOMOVE : | |
+ 0)); | |
+ } | |
+} | |
+ | |
+GtkWidget *gtk_window_new(GtkWindowType type) { | |
+ GtkWindow *win; | |
+ | |
+ win=GTK_WINDOW(GtkNewObject(&GtkWindowClass)); | |
+// g_print("New window %p created\n",win); | |
+ | |
+ win->title=g_strdup(""); | |
+ win->type=type; | |
+ | |
+ return GTK_WIDGET(win); | |
+} | |
+ | |
+void gtk_window_set_title(GtkWindow *window,const gchar *title) { | |
+ g_free(window->title); | |
+ window->title=g_strdup(title); | |
+} | |
+ | |
+gint gtk_window_delete_event(GtkWidget *widget,GdkEvent *event) { | |
+ gtk_widget_destroy(widget); | |
+ return TRUE; | |
+} | |
+ | |
+void gtk_window_set_default_size(GtkWindow *window,gint width,gint height) { | |
+ window->default_width = width; | |
+ window->default_height = height; | |
+} | |
+ | |
+void gtk_window_set_transient_for(GtkWindow *window,GtkWindow *parent) { | |
+ if (window && parent) { | |
+ GTK_WIDGET(window)->parent = GTK_WIDGET(parent); | |
+ if (GTK_WIDGET(window)->hWnd && GTK_WIDGET(parent)->hWnd) { | |
+ SetParent(GTK_WIDGET(window)->hWnd,GTK_WIDGET(parent)->hWnd); | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_window_set_menu(GtkWindow *window,GtkMenuBar *menu_bar) { | |
+ HWND hWnd; | |
+ HMENU hMenu; | |
+ | |
+ hWnd=GTK_WIDGET(window)->hWnd; | |
+ hMenu=GTK_MENU_SHELL(menu_bar)->menu; | |
+ | |
+ if (hWnd && hMenu) SetMenu(hWnd,hMenu); | |
+ window->menu_bar=menu_bar; | |
+} | |
+ | |
+void gtk_container_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkContainer *container; | |
+ GtkAllocation child_alloc; | |
+ container=GTK_CONTAINER(widget); | |
+ if (container->child) { | |
+ child_alloc.x=allocation->x+container->border_width; | |
+ child_alloc.y=allocation->y+container->border_width; | |
+ child_alloc.width=allocation->width-container->border_width*2; | |
+ child_alloc.height=allocation->height-container->border_width*2; | |
+ gtk_widget_set_size(container->child,&child_alloc); | |
+ } | |
+} | |
+ | |
+void gtk_frame_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkFrame *frame; | |
+ GtkAllocation child_alloc; | |
+ | |
+ frame=GTK_FRAME(widget); | |
+ child_alloc.x = allocation->x+3; | |
+ child_alloc.y = allocation->y + 3 + frame->label_req.height; | |
+ child_alloc.width = allocation->width - 6; | |
+ child_alloc.height = allocation->height - frame->label_req.height - 6; | |
+ gtk_container_set_size(widget,&child_alloc); | |
+} | |
+ | |
+void gtk_container_size_request(GtkWidget *widget,GtkRequisition *requisition)… | |
+ GtkContainer *container; | |
+/*g_print("gtk_container_size_request\n");*/ | |
+ container=GTK_CONTAINER(widget); | |
+ if (container->child) { | |
+/*g_print("requesting size of child\n");*/ | |
+ requisition->width=container->child->requisition.width+ | |
+ container->border_width*2; | |
+ requisition->height=container->child->requisition.height+ | |
+ container->border_width*2; | |
+/* g_print("Container requesting size %d by %d\n",requisition->width, | |
+ requisition->height);*/ | |
+ } | |
+} | |
+ | |
+void gtk_window_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+/*g_print("gtk_window_size_request\n");*/ | |
+ gtk_container_size_request(widget,requisition); | |
+ requisition->width+=GetSystemMetrics(SM_CXSIZEFRAME)*2; | |
+ requisition->height+=GetSystemMetrics(SM_CYSIZEFRAME)*2+ | |
+ GetSystemMetrics(SM_CYCAPTION); | |
+ if (GTK_WINDOW(widget)->menu_bar) { | |
+ requisition->height+=GetSystemMetrics(SM_CYMENU); | |
+ } | |
+} | |
+ | |
+void gtk_window_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkAllocation child_alloc; | |
+ GtkWindow *window=GTK_WINDOW(widget); | |
+ if (allocation->width < window->default_width) { | |
+ allocation->width=window->default_width; | |
+ } | |
+ if (allocation->height < window->default_height) { | |
+ allocation->height=window->default_height; | |
+ } | |
+ child_alloc.x=child_alloc.y=0; | |
+ child_alloc.width=allocation->width-GetSystemMetrics(SM_CXSIZEFRAME)*2; | |
+ child_alloc.height=allocation->height-GetSystemMetrics(SM_CYSIZEFRAME)*2 | |
+ -GetSystemMetrics(SM_CYCAPTION); | |
+ if (window->menu_bar) { | |
+ child_alloc.height-=GetSystemMetrics(SM_CYMENU); | |
+ } | |
+ gtk_container_set_size(widget,&child_alloc); | |
+} | |
+ | |
+void gtk_button_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ SIZE size; | |
+ GtkButton *but=GTK_BUTTON(widget); | |
+ | |
+ gtk_container_size_request(widget,requisition); | |
+ | |
+ if (GetTextSize(widget->hWnd,but->text,&size)) { | |
+ requisition->width = size.cx + 15; | |
+ requisition->height = size.cy + 10; | |
+ } | |
+/* g_print("Button %p requesting size %d by %d\n",widget->hWnd, | |
+ requisition->width,requisition->height);*/ | |
+} | |
+ | |
+BOOL GetTextSize(HWND hWnd,char *text,LPSIZE lpSize) { | |
+ HDC hDC; | |
+ BOOL RetVal=0; | |
+ SIZE LineSize; | |
+ HFONT oldFont; | |
+ char *endpt,*startpt; | |
+ hDC=GetDC(hWnd); | |
+ oldFont=SelectObject(hDC,hFont); | |
+ | |
+ startpt=text; | |
+ lpSize->cx=lpSize->cy=0; | |
+ | |
+ while (startpt) { | |
+ endpt=startpt; | |
+ while (endpt && *endpt!='\n' && *endpt) endpt++; | |
+ if (endpt) { | |
+ if ((endpt==startpt && GetTextExtentPoint32(hDC,"W",1,&LineSize)) || | |
+ (endpt!=startpt && GetTextExtentPoint32(hDC,startpt, | |
+ endpt-startpt,&LineSize))) { | |
+ RetVal=1; | |
+ if (LineSize.cx > lpSize->cx) lpSize->cx=LineSize.cx; | |
+ lpSize->cy+=LineSize.cy; | |
+ } | |
+ if (*endpt=='\0') break; | |
+ startpt=endpt+1; | |
+ } else break; | |
+ } | |
+ SelectObject(hDC,oldFont); | |
+ ReleaseDC(hWnd,hDC); | |
+ return RetVal; | |
+} | |
+ | |
+void gtk_entry_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ SIZE size; | |
+ if (GetTextSize(widget->hWnd,"Sample text",&size)) { | |
+ requisition->width = size.cx; | |
+ requisition->height = size.cy+8; | |
+ } | |
+} | |
+ | |
+void gtk_text_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ SIZE size; | |
+ if (GetTextSize(widget->hWnd,"Sample text",&size)) { | |
+ requisition->width = size.cx; | |
+ requisition->height = size.cy*2+8; | |
+ } | |
+} | |
+ | |
+void gtk_frame_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ SIZE size; | |
+ GtkFrame *frame=GTK_FRAME(widget); | |
+ | |
+ gtk_container_size_request(widget,requisition); | |
+ | |
+ if (GetTextSize(widget->hWnd,frame->text,&size)) { | |
+ frame->label_req.width = size.cx; | |
+ frame->label_req.height = size.cy; | |
+ if (size.cx > requisition->width) requisition->width=size.cx; | |
+ requisition->width += 6; | |
+ requisition->height += size.cy+6; | |
+ } | |
+/* g_print("Frame requesting size %d by %d\n",requisition->width, | |
+ requisition->height);*/ | |
+} | |
+ | |
+ | |
+void gtk_check_button_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition) { | |
+ gtk_button_size_request(widget,requisition); | |
+ requisition->width += 10; | |
+} | |
+ | |
+GtkWidget *gtk_button_new_with_label(const gchar *label) { | |
+ GtkButton *but; | |
+ gint i; | |
+ | |
+ but=GTK_BUTTON(GtkNewObject(&GtkButtonClass)); | |
+ but->text = g_strdup(label); | |
+ for (i=0;i<strlen(but->text);i++) { | |
+ if (but->text[i]=='_') but->text[i]='&'; | |
+ } | |
+ | |
+ return GTK_WIDGET(but); | |
+} | |
+ | |
+GtkWidget *gtk_check_button_new_with_label(const gchar *label) { | |
+ GtkButton *but; | |
+ gint i; | |
+ | |
+ but=GTK_BUTTON(GtkNewObject(&GtkCheckButtonClass)); | |
+ but->text = g_strdup(label); | |
+ for (i=0;i<strlen(but->text);i++) { | |
+ if (but->text[i]=='_') but->text[i]='&'; | |
+ } | |
+ | |
+ return GTK_WIDGET(but); | |
+} | |
+ | |
+GtkWidget *gtk_radio_button_new_with_label_from_widget(GtkRadioButton *group, | |
+ const gchar *label) { | |
+ GSList *list; | |
+ | |
+ list=gtk_radio_button_group(group); | |
+ return (gtk_radio_button_new_with_label(list,label)); | |
+} | |
+ | |
+GtkWidget *gtk_radio_button_new_with_label(GSList *group,const gchar *label) { | |
+ GtkButton *but; | |
+ GtkRadioButton *radio; | |
+ GSList *listpt; | |
+ gint i; | |
+ | |
+ but=GTK_BUTTON(GtkNewObject(&GtkRadioButtonClass)); | |
+ but->text = g_strdup(label); | |
+ for (i=0;i<strlen(but->text);i++) { | |
+ if (but->text[i]=='_') but->text[i]='&'; | |
+ } | |
+ | |
+ if (group==NULL) GTK_TOGGLE_BUTTON(but)->toggled=TRUE; | |
+ | |
+ group=g_slist_append(group,GTK_RADIO_BUTTON(but)); | |
+ for (listpt=group;listpt;listpt=g_slist_next(listpt)) { | |
+ radio=GTK_RADIO_BUTTON(listpt->data); | |
+ radio->group = group; | |
+ } | |
+ | |
+ return GTK_WIDGET(but); | |
+} | |
+ | |
+GtkWidget *gtk_label_new(const gchar *text) { | |
+ GtkLabel *label; | |
+ gint i; | |
+ | |
+ label=GTK_LABEL(GtkNewObject(&GtkLabelClass)); | |
+ label->text = g_strdup(text); | |
+ for (i=0;i<strlen(label->text);i++) { | |
+ if (label->text[i]=='_') label->text[i]='&'; | |
+ } | |
+ | |
+ return GTK_WIDGET(label); | |
+} | |
+ | |
+GtkWidget *gtk_hbox_new(gboolean homogeneous,gint spacing) { | |
+ GtkBox *hbox; | |
+ | |
+ hbox=GTK_BOX(GtkNewObject(&GtkHBoxClass)); | |
+ | |
+ hbox->spacing=spacing; | |
+ hbox->homogeneous=homogeneous; | |
+ return GTK_WIDGET(hbox); | |
+} | |
+ | |
+GtkWidget *gtk_vbox_new(gboolean homogeneous,gint spacing) { | |
+ GtkBox *vbox; | |
+ | |
+ vbox=GTK_BOX(GtkNewObject(&GtkVBoxClass)); | |
+ | |
+ vbox->spacing=spacing; | |
+ vbox->homogeneous=homogeneous; | |
+ return GTK_WIDGET(vbox); | |
+} | |
+ | |
+GtkWidget *gtk_frame_new(const gchar *text) { | |
+ GtkFrame *frame; | |
+ | |
+ frame=GTK_FRAME(GtkNewObject(&GtkFrameClass)); | |
+ frame->text = g_strdup(text); | |
+/*g_print("Frame created with caption %s\n",frame->text);*/ | |
+ | |
+ return GTK_WIDGET(frame); | |
+} | |
+ | |
+GtkWidget *gtk_text_new(GtkAdjustment *hadj,GtkAdjustment *vadj) { | |
+ return GTK_WIDGET(GtkNewObject(&GtkTextClass)); | |
+} | |
+ | |
+GtkWidget *gtk_scrolled_text_new(GtkAdjustment *hadj,GtkAdjustment *vadj, | |
+ GtkWidget **pack_widg) { | |
+ GtkWidget *text; | |
+ text=gtk_text_new(hadj,vadj); | |
+ *pack_widg=text; | |
+ return text; | |
+} | |
+ | |
+GtkWidget *gtk_entry_new() { | |
+ return GTK_WIDGET(GtkNewObject(&GtkEntryClass)); | |
+} | |
+ | |
+GtkWidget *gtk_clist_new(gint columns) { | |
+ GtkCList *clist; | |
+ int i; | |
+ | |
+ clist=GTK_CLIST(GtkNewObject(&GtkCListClass)); | |
+ clist->ncols=columns; | |
+ clist->cols=g_new0(GtkCListColumn,columns); | |
+ for (i=0;i<columns;i++) { | |
+ clist->cols[i].width=46; | |
+ clist->cols[i].visible=TRUE; | |
+ clist->cols[i].resizeable=TRUE; | |
+ } | |
+ | |
+ return GTK_WIDGET(clist); | |
+} | |
+ | |
+GSList *gtk_radio_button_group(GtkRadioButton *radio_button) { | |
+ return radio_button->group; | |
+} | |
+ | |
+void gtk_editable_insert_text(GtkEditable *editable,const gchar *new_text, | |
+ gint new_text_length,gint *position) { | |
+ GtkWidget *widget=GTK_WIDGET(editable); | |
+ HWND hWnd; | |
+ if (!GTK_WIDGET_REALIZED(widget)) return; | |
+ hWnd=widget->hWnd; | |
+ SendMessage(hWnd,EM_SETSEL,(WPARAM)-1,(LPARAM)*position); | |
+ SendMessage(hWnd,EM_REPLACESEL,(WPARAM)FALSE,(LPARAM)new_text); | |
+ *position+=strlen(new_text); | |
+} | |
+ | |
+void gtk_editable_delete_text(GtkEditable *editable, | |
+ gint start_pos,gint end_pos) { | |
+ GtkWidget *widget=GTK_WIDGET(editable); | |
+ HWND hWnd; | |
+ if (!GTK_WIDGET_REALIZED(widget)) return; | |
+ hWnd=widget->hWnd; | |
+ SendMessage(hWnd,EM_SETSEL,(WPARAM)start_pos,(LPARAM)end_pos); | |
+ SendMessage(hWnd,EM_REPLACESEL,(WPARAM)FALSE,(LPARAM)""); | |
+} | |
+ | |
+gchar *gtk_editable_get_chars(GtkEditable *editable, | |
+ gint start_pos,gint end_pos) { | |
+ GtkWidget *widget=GTK_WIDGET(editable); | |
+ HWND hWnd; | |
+ LRESULT textlen; | |
+ gchar *buffer,*retbuf; | |
+ gint copylen; | |
+ if (!GTK_WIDGET_REALIZED(widget)) return NULL; | |
+ hWnd=widget->hWnd; | |
+ textlen=SendMessage(hWnd,WM_GETTEXTLENGTH,0,0); | |
+ buffer=g_new(gchar,textlen+1); | |
+ SendMessage(hWnd,WM_GETTEXT,(WPARAM)(textlen+1),(LPARAM)buffer); | |
+ if (start_pos==0 && end_pos<0) return buffer; | |
+ else { | |
+ copylen=end_pos-start_pos; | |
+ retbuf=g_new(gchar,copylen+1); | |
+ memcpy(retbuf,&buffer[start_pos],copylen+1); | |
+ g_free(buffer); | |
+ return retbuf; | |
+ } | |
+} | |
+ | |
+void gtk_editable_set_editable(GtkEditable *editable,gboolean is_editable) { | |
+ GtkWidget *widget=GTK_WIDGET(editable); | |
+ HWND hWnd; | |
+ if (!GTK_WIDGET_REALIZED(widget)) return; | |
+ hWnd=widget->hWnd; | |
+ SendMessage(hWnd,EM_SETREADONLY,(WPARAM)(!is_editable),(LPARAM)0); | |
+} | |
+ | |
+void gtk_editable_set_position(GtkEditable *editable,gint position) { | |
+ GtkWidget *widget=GTK_WIDGET(editable); | |
+ HWND hWnd; | |
+ if (!GTK_WIDGET_REALIZED(widget)) return; | |
+ hWnd=widget->hWnd; | |
+ SendMessage(hWnd,EM_SETSEL,(WPARAM)-1,(LPARAM)position); | |
+} | |
+ | |
+gint gtk_editable_get_position(GtkEditable *editable) { | |
+ GtkWidget *widget=GTK_WIDGET(editable); | |
+ HWND hWnd; | |
+ DWORD EndPos; | |
+ if (!GTK_WIDGET_REALIZED(widget)) return 0; | |
+ hWnd=widget->hWnd; | |
+ SendMessage(hWnd,EM_GETSEL,(WPARAM)NULL,(LPARAM)&EndPos); | |
+ return (gint)EndPos; | |
+} | |
+ | |
+guint gtk_text_get_length(GtkText *text) { | |
+ GtkWidget *widget=GTK_WIDGET(text); | |
+ HWND hWnd; | |
+ LRESULT textlen; | |
+ if (!GTK_WIDGET_REALIZED(widget)) return 0; | |
+ hWnd=widget->hWnd; | |
+ textlen=SendMessage(hWnd,WM_GETTEXTLENGTH,0,0); | |
+ return (guint)textlen; | |
+} | |
+ | |
+void gtk_box_pack_start(GtkBox *box,GtkWidget *child,gboolean Expand, | |
+ gboolean Fill,gint Padding) { | |
+ GtkBoxChild *newChild; | |
+ | |
+ newChild=g_new0(GtkBoxChild,1); | |
+ newChild->widget=child; | |
+ newChild->expand=Expand; | |
+ newChild->fill=Fill; | |
+ | |
+ box->children = g_list_append(box->children,(gpointer)newChild); | |
+ child->parent = GTK_WIDGET(box); | |
+} | |
+ | |
+void gtk_button_destroy(GtkWidget *widget) { | |
+/* g_print("Destroying button %p\n",widget);*/ | |
+ g_free(GTK_BUTTON(widget)->text); | |
+} | |
+ | |
+void gtk_frame_destroy(GtkWidget *widget) { | |
+ gtk_container_destroy(widget); | |
+ g_free(GTK_FRAME(widget)->text); | |
+} | |
+ | |
+void gtk_container_destroy(GtkWidget *widget) { | |
+ GtkWidget *child=GTK_CONTAINER(widget)->child; | |
+/* g_print("Destroying container %p\n",widget); | |
+ if (child) g_print("Destroying container child %p\n",child);*/ | |
+ if (child) gtk_widget_destroy(child); | |
+} | |
+ | |
+void gtk_box_destroy(GtkWidget *widget) { | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ gtk_container_destroy(widget); | |
+ | |
+ for (children=GTK_BOX(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+/* if (child && child->widget) g_print("Destroying box child %p\n",child->w… | |
+ if (child && child->widget) gtk_widget_destroy(child->widget); | |
+ g_free(child); | |
+ } | |
+ g_list_free(GTK_BOX(widget)->children); | |
+} | |
+ | |
+void gtk_window_destroy(GtkWidget *widget) { | |
+ GtkWindow *window=GTK_WINDOW(widget); | |
+// g_print("gtk_window_destroy on widget %p\n",widget); | |
+ WindowList=g_slist_remove(WindowList,(gpointer)widget->hWnd); | |
+ gtk_container_destroy(widget); | |
+ g_free(GTK_WINDOW(widget)->title); | |
+ if (window->modal && widget->parent) | |
+ gtk_widget_set_sensitive(widget->parent,TRUE); | |
+ if (widget->hWnd) DestroyWindow(widget->hWnd); | |
+ widget->hWnd=NULL; | |
+} | |
+ | |
+void gtk_window_show(GtkWidget *widget) { | |
+ GtkWindow *window=GTK_WINDOW(widget); | |
+ if (window->modal && widget->parent) | |
+ gtk_widget_set_sensitive(widget->parent,FALSE); | |
+} | |
+ | |
+void gtk_window_hide(GtkWidget *widget) { | |
+ GtkWindow *window=GTK_WINDOW(widget); | |
+ if (window->modal && widget->parent) | |
+ gtk_widget_set_sensitive(widget->parent,TRUE); | |
+} | |
+ | |
+void gtk_hbox_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition) { | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ GtkRequisition *child_req; | |
+ gint spacing=GTK_BOX(widget)->spacing; | |
+ gtk_container_size_request(widget,requisition); | |
+ for (children=GTK_BOX(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+ if (child && child->widget && GTK_WIDGET_VISIBLE(child->widget)) { | |
+ child_req=&child->widget->requisition; | |
+ requisition->width+=child_req->width; | |
+ if (g_list_next(children)) requisition->width+=spacing; | |
+ if (child_req->height > requisition->height) | |
+ requisition->height=child_req->height; | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_vbox_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition) { | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ GtkRequisition *child_req; | |
+ gint spacing=GTK_BOX(widget)->spacing; | |
+ gtk_container_size_request(widget,requisition); | |
+ for (children=GTK_BOX(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+ if (child && child->widget && GTK_WIDGET_VISIBLE(child->widget)) { | |
+ child_req=&child->widget->requisition; | |
+ requisition->height+=child_req->height; | |
+ if (g_list_next(children)) requisition->height+=spacing; | |
+ if (child_req->width > requisition->width) | |
+ requisition->width=child_req->width; | |
+ } | |
+ } | |
+} | |
+ | |
+static void gtk_box_count_children(GtkBox *box,gint16 allocation, | |
+ gint16 requisition,gint *extra) { | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ gint NumCanExpand=0; | |
+ | |
+ for (children=box->children;children;children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+ if (child && child->widget && GTK_WIDGET_VISIBLE(child->widget) && | |
+ child->expand) NumCanExpand++; | |
+ } | |
+ | |
+ *extra = allocation-requisition; | |
+ if (NumCanExpand>0) *extra /= NumCanExpand; | |
+} | |
+ | |
+static void gtk_box_size_child(GtkBox *box,GtkBoxChild *child, | |
+ gint extra,gint16 maxpos,gint16 requisition, | |
+ gint16 *pos,gint16 *size, | |
+ GList *listpt,gint16 *curpos) { | |
+ gboolean TooSmall=FALSE; | |
+ *pos=*curpos; | |
+ if (extra<0) { | |
+ extra=0; | |
+ TooSmall=TRUE; | |
+ } | |
+ if (child->expand && child->fill) { | |
+ *size=requisition+extra; | |
+ *curpos+=requisition+extra; | |
+ } else if (child->expand) { | |
+ *size=requisition; | |
+ *pos+=extra/2; | |
+ *curpos+=requisition+extra; | |
+ } else { | |
+ *size=requisition; | |
+ *curpos+=requisition; | |
+ } | |
+ if (g_list_next(listpt)) *curpos+=box->spacing; | |
+ if (TooSmall) { | |
+ if (*pos >= maxpos) { *pos=*size=0; } | |
+ else if (*pos+*size > maxpos) { *size=maxpos-*pos; } | |
+ } | |
+} | |
+ | |
+void gtk_hbox_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkBox *box; | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ GtkAllocation child_alloc; | |
+ gint extra; | |
+ gint16 curpos; | |
+ | |
+ box=GTK_BOX(widget); | |
+ gtk_container_set_size(widget,allocation); | |
+ | |
+ curpos = allocation->x; | |
+ gtk_box_count_children(box,allocation->width,widget->requisition.width, | |
+ &extra); | |
+ | |
+ for (children=box->children;children;children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+ if (child && child->widget && GTK_WIDGET_VISIBLE(child->widget)) { | |
+ gtk_box_size_child(box,child,extra,allocation->width, | |
+ child->widget->requisition.width, | |
+ &child_alloc.x,&child_alloc.width, | |
+ children,&curpos); | |
+ child_alloc.y = allocation->y; | |
+ child_alloc.height = allocation->height; | |
+ gtk_widget_set_size(child->widget,&child_alloc); | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_vbox_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkBox *box; | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ GtkAllocation child_alloc; | |
+ gint extra; | |
+ gint16 curpos; | |
+ | |
+ box=GTK_BOX(widget); | |
+ gtk_container_set_size(widget,allocation); | |
+ | |
+ curpos = allocation->y; | |
+ gtk_box_count_children(box,allocation->height,widget->requisition.height, | |
+ &extra); | |
+ | |
+ for (children=box->children;children;children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+ if (child && child->widget && GTK_WIDGET_VISIBLE(child->widget)) { | |
+ gtk_box_size_child(box,child,extra,allocation->height, | |
+ child->widget->requisition.height, | |
+ &child_alloc.y,&child_alloc.height, | |
+ children,&curpos); | |
+ child_alloc.x = allocation->x; | |
+ child_alloc.width = allocation->width; | |
+ gtk_widget_set_size(child->widget,&child_alloc); | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_window_realize(GtkWidget *widget) { | |
+ GtkWindow *win=GTK_WINDOW(widget); | |
+ HWND Parent; | |
+ Parent=gtk_get_parent_hwnd(widget->parent); | |
+ widget->hWnd = CreateWindow("mainwin",win->title, | |
+ win->type == GTK_WINDOW_TOPLEVEL ? | |
+ WS_OVERLAPPEDWINDOW|CS_HREDRAW|CS_VREDRAW|WS_SIZEBOX : | |
+ WS_CAPTION|CS_HREDRAW|CS_VREDRAW, | |
+ CW_USEDEFAULT,0, | |
+ widget->allocation.width,widget->allocation.height, | |
+ Parent,NULL,hInst,NULL); | |
+ if (win->type==GTK_WINDOW_TOPLEVEL && !TopLevel) TopLevel=widget->hWnd; | |
+ WindowList=g_slist_append(WindowList,(gpointer)widget->hWnd); | |
+ gtk_set_default_font(widget->hWnd); | |
+/* g_print("Window window %p created\n",widget->hWnd);*/ | |
+ gtk_container_realize(widget); | |
+} | |
+ | |
+void gtk_container_realize(GtkWidget *widget) { | |
+ GtkWidget *child=GTK_CONTAINER(widget)->child; | |
+/*g_print("Realizing container\n"); | |
+ if (child) g_print("Realizing container widget %p\n",child);*/ | |
+ if (child) gtk_widget_realize(child); | |
+} | |
+ | |
+void gtk_box_realize(GtkWidget *widget) { | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ | |
+/* g_print("Realizing box...\n");*/ | |
+ gtk_container_realize(widget); | |
+ | |
+ for (children=GTK_BOX(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+/* if (child) g_print("Realizing box widget %p\n",child);*/ | |
+ if (child && child->widget) gtk_widget_realize(child->widget); | |
+ } | |
+} | |
+ | |
+HWND gtk_get_parent_hwnd(GtkWidget *widget) { | |
+ widget=gtk_widget_get_ancestor(widget,GTK_TYPE_WINDOW); | |
+ if (widget) return widget->hWnd; else return NULL; | |
+} | |
+ | |
+void gtk_button_realize(GtkWidget *widget) { | |
+ GtkButton *but=GTK_BUTTON(widget); | |
+ HWND Parent; | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindow("BUTTON",but->text, | |
+ WS_CHILD|WS_TABSTOP|BS_PUSHBUTTON, | |
+ widget->allocation.x,widget->allocation.y, | |
+ widget->allocation.width,widget->allocation.height, | |
+ Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+} | |
+ | |
+void gtk_entry_realize(GtkWidget *widget) { | |
+ HWND Parent; | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", | |
+ WS_CHILD|WS_TABSTOP|ES_AUTOHSCROLL, | |
+ widget->allocation.x,widget->allocation.y, | |
+ widget->allocation.width,widget->allocation.height, | |
+ Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+} | |
+ | |
+void gtk_text_realize(GtkWidget *widget) { | |
+ HWND Parent; | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", | |
+ WS_CHILD|WS_TABSTOP|ES_AUTOHSCROLL| | |
+ ES_MULTILINE|ES_WANTRETURN|WS_VSCROLL, | |
+ 0,0,0,0,Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+} | |
+ | |
+void gtk_frame_realize(GtkWidget *widget) { | |
+ GtkFrame *frame=GTK_FRAME(widget); | |
+ HWND Parent; | |
+ gtk_container_realize(widget); | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+/*g_print("Creating frame window with caption %s\n",frame->text);*/ | |
+ widget->hWnd = CreateWindow("BUTTON",frame->text, | |
+ WS_CHILD|BS_GROUPBOX, | |
+ widget->allocation.x,widget->allocation.y, | |
+ widget->allocation.width,widget->allocation.height, | |
+ Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+} | |
+ | |
+void gtk_check_button_realize(GtkWidget *widget) { | |
+ GtkButton *but=GTK_BUTTON(widget); | |
+ HWND Parent; | |
+ gboolean toggled; | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindow("BUTTON",but->text, | |
+ WS_CHILD|WS_TABSTOP|BS_CHECKBOX, | |
+ widget->allocation.x,widget->allocation.y, | |
+ widget->allocation.width,widget->allocation.height, | |
+ Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+ gtk_signal_connect(GTK_OBJECT(widget),"clicked", | |
+ gtk_toggle_button_toggled,NULL); | |
+ gtk_signal_connect(GTK_OBJECT(widget),"toggled", | |
+ gtk_check_button_toggled,NULL); | |
+ toggled=GTK_TOGGLE_BUTTON(widget)->toggled; | |
+ GTK_TOGGLE_BUTTON(widget)->toggled = !toggled; | |
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),toggled); | |
+} | |
+ | |
+void gtk_radio_button_realize(GtkWidget *widget) { | |
+ GtkButton *but=GTK_BUTTON(widget); | |
+ HWND Parent; | |
+ gboolean toggled; | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindow("BUTTON",but->text, | |
+ WS_CHILD|WS_TABSTOP|BS_RADIOBUTTON, | |
+ widget->allocation.x,widget->allocation.y, | |
+ widget->allocation.width,widget->allocation.height, | |
+ Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+ gtk_signal_connect(GTK_OBJECT(widget),"clicked", | |
+ gtk_radio_button_clicked,NULL); | |
+ gtk_signal_connect(GTK_OBJECT(widget),"toggled", | |
+ gtk_radio_button_toggled,NULL); | |
+ toggled=GTK_TOGGLE_BUTTON(widget)->toggled; | |
+ GTK_TOGGLE_BUTTON(widget)->toggled = !toggled; | |
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),toggled); | |
+} | |
+ | |
+void gtk_radio_button_destroy(GtkWidget *widget) { | |
+ GSList *group,*listpt; | |
+ GtkRadioButton *radio; | |
+ | |
+ gtk_button_destroy(widget); | |
+ group=GTK_RADIO_BUTTON(widget)->group; | |
+ group=g_slist_remove(group,GTK_RADIO_BUTTON(widget)); | |
+ for (listpt=group;listpt;listpt=g_slist_next(listpt)) { | |
+ radio=GTK_RADIO_BUTTON(listpt->data); | |
+ radio->group = group; | |
+ } | |
+} | |
+ | |
+ | |
+void gtk_clist_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ SIZE size; | |
+ | |
+ if (GetTextSize(widget->hWnd,"Sample text",&size)) { | |
+ requisition->width = size.cx; | |
+ requisition->height = size.cy*6+12; | |
+ } | |
+} | |
+ | |
+void gtk_clist_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkCList *clist=GTK_CLIST(widget); | |
+ gtk_container_set_size(widget,allocation); | |
+ if (clist->header) { | |
+ SetWindowPos(clist->header,HWND_TOP, | |
+ allocation->x,allocation->y, | |
+ allocation->width,clist->header_size, | |
+ SWP_NOZORDER); | |
+ allocation->y+=clist->header_size-1; | |
+ allocation->height-=clist->header_size-1; | |
+ } | |
+} | |
+ | |
+void gtk_clist_realize(GtkWidget *widget) { | |
+ HWND Parent,header; | |
+ HD_LAYOUT hdl; | |
+ HD_ITEM hdi; | |
+ RECT rcParent; | |
+ WINDOWPOS wp; | |
+ GtkCList *clist=GTK_CLIST(widget); | |
+ GSList *rows; | |
+ GtkCListRow *row; | |
+ gint i; | |
+ | |
+ gtk_container_realize(widget); | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ rcParent.left = rcParent.top = 0; | |
+ rcParent.right = rcParent.bottom = 800; | |
+ header=CreateWindowEx(0,WC_HEADER,NULL, | |
+ WS_CHILD|WS_BORDER|HDS_HORZ | |
+ | (GTK_CLIST(widget)->cols[0].button_passive ? | |
+ 0 : HDS_BUTTONS), | |
+ 0,0,0,0,Parent,NULL,hInst,NULL); | |
+ SetWindowLong(header,GWL_USERDATA,(LONG)widget); | |
+ GTK_CLIST(widget)->header=header; | |
+ gtk_set_default_font(header); | |
+ hdl.prc = &rcParent; | |
+ hdl.pwpos = ℘ | |
+ SendMessage(header,HDM_LAYOUT,0,(LPARAM)&hdl); | |
+ GTK_CLIST(widget)->header_size=wp.cy; | |
+/* g_print("Header %p, size %d\n",header,wp.cy);*/ | |
+ widget->hWnd = CreateWindowEx(WS_EX_CLIENTEDGE,"LISTBOX","", | |
+ WS_CHILD|WS_TABSTOP|LBS_DISABLENOSCROLL| | |
+ WS_VSCROLL|LBS_USETABSTOPS|LBS_OWNERDRAWFIXED, | |
+ 0,0,0,0,Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+ | |
+ for (rows=clist->rows;rows;rows=g_slist_next(rows)) { | |
+ row=(GtkCListRow *)rows->data; | |
+ if (row) SendMessage(widget->hWnd,LB_ADDSTRING,0,(LPARAM)row->data); | |
+ } | |
+ | |
+ for (i=0;i<clist->ncols;i++) { | |
+ hdi.mask = HDI_TEXT|HDI_FORMAT|HDI_WIDTH; | |
+ hdi.pszText=clist->cols[i].title; | |
+ if (hdi.pszText) { | |
+ hdi.cxy=clist->cols[i].width; | |
+ hdi.cchTextMax=strlen(hdi.pszText); | |
+ hdi.fmt = HDF_LEFT|HDF_STRING; | |
+ SendMessage(header,HDM_INSERTITEM,i+1,(LPARAM)&hdi); | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_clist_show(GtkWidget *widget) { | |
+ if (GTK_WIDGET_REALIZED(widget)) { | |
+ ShowWindow(GTK_CLIST(widget)->header,SW_SHOWNORMAL); | |
+ } | |
+} | |
+ | |
+void gtk_clist_hide(GtkWidget *widget) { | |
+ if (GTK_WIDGET_REALIZED(widget)) { | |
+ ShowWindow(GTK_CLIST(widget)->header,SW_HIDE); | |
+ } | |
+} | |
+ | |
+void gtk_clist_draw_row(GtkCList *clist,LPDRAWITEMSTRUCT lpdis) { | |
+ HBRUSH bkgrnd; | |
+ COLORREF textcol,oldtextcol; | |
+ RECT rcCol; | |
+ gint i,CurrentX; | |
+ GtkCListRow *row; | |
+ | |
+ if (lpdis->itemState&ODS_SELECTED) { | |
+ bkgrnd=(HBRUSH)(1+COLOR_HIGHLIGHT); | |
+ textcol=(COLORREF)GetSysColor(COLOR_HIGHLIGHTTEXT); | |
+ } else { | |
+ bkgrnd=(HBRUSH)(1+COLOR_WINDOW); | |
+ textcol=(COLORREF)GetSysColor(COLOR_WINDOWTEXT); | |
+ } | |
+ oldtextcol=SetTextColor(lpdis->hDC,textcol); | |
+ SetBkMode(lpdis->hDC,TRANSPARENT); | |
+ FillRect(lpdis->hDC,&lpdis->rcItem,bkgrnd); | |
+ | |
+ if (lpdis->itemID >= 0 && lpdis->itemID < g_slist_length(clist->rows)) { | |
+ row=(GtkCListRow *)g_slist_nth_data(clist->rows,lpdis->itemID); | |
+ CurrentX=lpdis->rcItem.left; | |
+ rcCol.top=lpdis->rcItem.top; | |
+ rcCol.bottom=lpdis->rcItem.bottom; | |
+ if (row->text) for (i=0;i<clist->ncols;i++) { | |
+ rcCol.left=CurrentX+LISTITEMHPACK; | |
+ CurrentX+=clist->cols[i].width; | |
+ rcCol.right=CurrentX-LISTITEMHPACK; | |
+ if (rcCol.left > lpdis->rcItem.right) rcCol.left=lpdis->rcItem.right; | |
+ if (rcCol.right > lpdis->rcItem.right) rcCol.right=lpdis->rcItem.righ… | |
+ if (row->text[i]) DrawText(lpdis->hDC,row->text[i],-1,&rcCol, | |
+ DT_LEFT|DT_SINGLELINE|DT_VCENTER); | |
+ } | |
+ } | |
+ | |
+ SetTextColor(lpdis->hDC,oldtextcol); | |
+ SetBkMode(lpdis->hDC,OPAQUE); | |
+ if (lpdis->itemState&ODS_FOCUS) DrawFocusRect(lpdis->hDC,&lpdis->rcItem); | |
+} | |
+ | |
+gint gtk_clist_insert(GtkCList *clist,gint row,gchar *text[]) { | |
+ GtkWidget *widget=GTK_WIDGET(clist); | |
+ HWND hWnd; | |
+ GtkCListRow *new_row; | |
+ gint i; | |
+ | |
+ new_row=g_new0(GtkCListRow,1); | |
+ new_row->text=g_new0(gchar *,clist->ncols); | |
+ for (i=0;i<clist->ncols;i++) { | |
+ new_row->text[i]=g_strdup(text[i]); | |
+ } | |
+ clist->rows=g_slist_insert(clist->rows,(gpointer)new_row,row); | |
+ | |
+ if (GTK_WIDGET_REALIZED(widget)) { | |
+ hWnd=widget->hWnd; | |
+ SendMessage(hWnd,LB_INSERTSTRING,(WPARAM)row,(LPARAM)new_row->data); | |
+ } | |
+ | |
+ return row; | |
+} | |
+ | |
+GtkWidget *gtk_clist_new_with_titles(gint columns,gchar *titles[]) { | |
+ GtkWidget *widget; | |
+ GtkCList *clist; | |
+ gint i; | |
+ | |
+ widget=gtk_clist_new(columns); | |
+ clist=GTK_CLIST(widget); | |
+ for (i=0;i<clist->ncols;i++) { | |
+ gtk_clist_set_column_title(clist,i,titles[i]); | |
+ } | |
+ return widget; | |
+} | |
+ | |
+gint gtk_clist_append(GtkCList *clist,gchar *text[]) { | |
+ return gtk_clist_insert(clist,-1,text); | |
+} | |
+ | |
+void gtk_clist_set_column_title(GtkCList *clist,gint column, | |
+ const gchar *title) { | |
+ HWND hWnd; | |
+ if (column<0 || column>=clist->ncols) return; | |
+ g_free(clist->cols[column].title); | |
+ clist->cols[column].title=g_strdup(title); | |
+ if (GTK_WIDGET_REALIZED(GTK_WIDGET(clist))) { | |
+ hWnd=GTK_WIDGET(clist)->hWnd; | |
+ InvalidateRect(hWnd,NULL,FALSE); | |
+ UpdateWindow(hWnd); | |
+ } | |
+} | |
+ | |
+void gtk_clist_column_title_passive(GtkCList *clist,gint column) { | |
+ if (column>=0 && column<clist->ncols) | |
+ clist->cols[column].button_passive=TRUE; | |
+} | |
+ | |
+void gtk_clist_column_titles_passive(GtkCList *clist) { | |
+ gint i; | |
+ for (i=0;i<clist->ncols;i++) { | |
+ gtk_clist_column_title_passive(clist,i); | |
+ } | |
+} | |
+ | |
+void gtk_clist_set_column_width(GtkCList *clist,gint column,gint width) { | |
+ HWND hWnd; | |
+ if (column<0 || column>=clist->ncols) return; | |
+ clist->cols[column].width=width; | |
+ if (GTK_WIDGET_REALIZED(GTK_WIDGET(clist))) { | |
+ hWnd=GTK_WIDGET(clist)->hWnd; | |
+ InvalidateRect(hWnd,NULL,FALSE); | |
+ UpdateWindow(hWnd); | |
+ } | |
+} | |
+ | |
+void gtk_clist_set_selection_mode(GtkCList *clist,GtkSelectionMode mode) { | |
+ clist->mode=mode; | |
+} | |
+ | |
+void gtk_container_show_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GtkContainer *container=GTK_CONTAINER(widget); | |
+ | |
+ if (container->child) gtk_widget_show_all_full(container->child,hWndOnly); | |
+} | |
+ | |
+void gtk_container_hide_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GtkContainer *container=GTK_CONTAINER(widget); | |
+ | |
+ if (container->child) gtk_widget_hide_all_full(container->child,hWndOnly); | |
+} | |
+ | |
+void gtk_box_show_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ | |
+ gtk_container_show_all(widget,hWndOnly); | |
+ | |
+ for (children=GTK_BOX(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+ if (child && child->widget) | |
+ gtk_widget_show_all_full(child->widget,hWndOnly); | |
+ } | |
+} | |
+ | |
+void gtk_box_hide_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GtkBoxChild *child; | |
+ GList *children; | |
+ | |
+ gtk_container_hide_all(widget,hWndOnly); | |
+ | |
+ for (children=GTK_BOX(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkBoxChild *)(children->data); | |
+ if (child && child->widget) | |
+ gtk_widget_hide_all_full(child->widget,hWndOnly); | |
+ } | |
+} | |
+ | |
+void gtk_table_show_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GList *children; | |
+ GtkTableChild *child; | |
+ | |
+ gtk_container_show_all(widget,hWndOnly); | |
+ for (children=GTK_TABLE(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkTableChild *)(children->data); | |
+ if (child && child->widget) | |
+ gtk_widget_show_all_full(child->widget,hWndOnly); | |
+ } | |
+} | |
+ | |
+void gtk_table_hide_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GList *children; | |
+ GtkTableChild *child; | |
+ | |
+ gtk_container_hide_all(widget,hWndOnly); | |
+ for (children=GTK_TABLE(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkTableChild *)(children->data); | |
+ if (child && child->widget) | |
+ gtk_widget_hide_all_full(child->widget,hWndOnly); | |
+ } | |
+} | |
+ | |
+void gtk_widget_hide_all(GtkWidget *widget) { | |
+ gtk_widget_hide_all_full(widget,FALSE); | |
+} | |
+ | |
+void gtk_widget_hide_all_full(GtkWidget *widget,gboolean hWndOnly) { | |
+ gtk_signal_emit(GTK_OBJECT(widget),"hide_all",hWndOnly); | |
+ if (hWndOnly) { | |
+ gtk_signal_emit(GTK_OBJECT(widget),"hide"); | |
+ if (widget->hWnd) ShowWindow(widget->hWnd,SW_HIDE); | |
+ } else gtk_widget_hide_full(widget,FALSE); | |
+} | |
+ | |
+void gtk_widget_show_all(GtkWidget *widget) { | |
+ gtk_widget_show_all_full(widget,FALSE); | |
+} | |
+ | |
+void gtk_widget_show_all_full(GtkWidget *widget,gboolean hWndOnly) { | |
+ if (!GTK_WIDGET_REALIZED(widget) && | |
+ GTK_OBJECT(widget)->klass==&GtkWindowClass) { | |
+ gtk_widget_realize(widget); | |
+ } | |
+ gtk_signal_emit(GTK_OBJECT(widget),"show_all",hWndOnly); | |
+ if (hWndOnly) { | |
+ if (GTK_WIDGET_VISIBLE(widget)) { | |
+ gtk_signal_emit(GTK_OBJECT(widget),"show"); | |
+ if (widget->hWnd) ShowWindow(widget->hWnd,SW_SHOWNORMAL); | |
+ } | |
+ } else gtk_widget_show_full(widget,FALSE); | |
+} | |
+ | |
+GtkWidget *gtk_widget_get_ancestor(GtkWidget *widget,GtkType type) { | |
+ if (!widget) return NULL; | |
+ while (widget && GTK_OBJECT(widget)->klass!=type) { | |
+ widget=widget->parent; | |
+ } | |
+ return widget; | |
+} | |
+ | |
+void gtk_label_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ SIZE size; | |
+ GtkLabel *label=GTK_LABEL(widget); | |
+ | |
+ if (GetTextSize(widget->hWnd,label->text,&size)) { | |
+ requisition->width = size.cx; | |
+ requisition->height = size.cy; | |
+ } | |
+/* g_print("Label requesting size %d by %d\n",requisition->width, | |
+ requisition->height);*/ | |
+} | |
+ | |
+void gtk_label_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ gint yexcess; | |
+ yexcess=allocation->height-widget->requisition.height; | |
+ if (yexcess > 0) { | |
+ allocation->y += yexcess/2; | |
+ allocation->height -= yexcess; | |
+ } | |
+} | |
+ | |
+void gtk_label_destroy(GtkWidget *widget) { | |
+ g_free(GTK_LABEL(widget)->text); | |
+} | |
+ | |
+void gtk_label_realize(GtkWidget *widget) { | |
+ GtkLabel *label=GTK_LABEL(widget); | |
+ HWND Parent; | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindow("STATIC",label->text, | |
+ WS_CHILD|SS_CENTER, | |
+ widget->allocation.x,widget->allocation.y, | |
+ widget->allocation.width,widget->allocation.height, | |
+ Parent,NULL,hInst,NULL); | |
+ gtk_set_default_font(widget->hWnd); | |
+} | |
+ | |
+void gtk_container_add(GtkContainer *container,GtkWidget *widget) { | |
+ container->child=widget; | |
+ widget->parent=GTK_WIDGET(container); | |
+} | |
+ | |
+void gtk_container_set_border_width(GtkContainer *container, | |
+ guint border_width) { | |
+ container->border_width = border_width; | |
+} | |
+ | |
+GtkWidget *gtk_table_new(guint rows,guint cols,gboolean homogeneous) { | |
+ GtkTable *table; | |
+ | |
+ table=GTK_TABLE(GtkNewObject(&GtkTableClass)); | |
+ | |
+ table->nrows=rows; | |
+ table->ncols=cols; | |
+ table->homogeneous=homogeneous; | |
+ | |
+ table->rows = g_new0(GtkTableRowCol,rows); | |
+ table->cols = g_new0(GtkTableRowCol,cols); | |
+ | |
+ return GTK_WIDGET(table); | |
+} | |
+ | |
+void gtk_table_attach_defaults(GtkTable *table,GtkWidget *widget, | |
+ guint left_attach,guint right_attach, | |
+ guint top_attach,guint bottom_attach) { | |
+ gtk_table_attach(table,widget,left_attach,right_attach, | |
+ top_attach,bottom_attach,GTK_EXPAND,GTK_EXPAND,0,0); | |
+} | |
+ | |
+void gtk_table_attach(GtkTable *table,GtkWidget *widget, | |
+ guint left_attach,guint right_attach, | |
+ guint top_attach,guint bottom_attach, | |
+ GtkAttachOptions xoptions,GtkAttachOptions yoptions, | |
+ guint xpadding,guint ypadding) { | |
+ GtkTableChild *newChild; | |
+ | |
+ newChild=g_new0(GtkTableChild,1); | |
+ newChild->widget=widget; | |
+ newChild->left_attach=left_attach; | |
+ newChild->right_attach=right_attach; | |
+ newChild->top_attach=top_attach; | |
+ newChild->bottom_attach=bottom_attach; | |
+ | |
+ table->children=g_list_append(table->children,(gpointer)newChild); | |
+ widget->parent = GTK_WIDGET(table); | |
+} | |
+ | |
+void gtk_table_destroy(GtkWidget *widget) { | |
+ GList *children; | |
+ GtkTableChild *child; | |
+ | |
+ gtk_container_destroy(widget); | |
+ for (children=GTK_TABLE(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkTableChild *)(children->data); | |
+ if (child->widget) gtk_widget_destroy(child->widget); | |
+ g_free(child); | |
+ } | |
+ g_list_free(GTK_TABLE(widget)->children); | |
+} | |
+ | |
+void gtk_table_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ GList *children; | |
+ GtkTableChild *child; | |
+ GtkWidget *child_wid; | |
+ GtkRequisition child_req; | |
+ GtkTable *table; | |
+ gint16 MaxReq; | |
+ int i; | |
+ | |
+ table=GTK_TABLE(widget); | |
+ for (i=0;i<table->ncols;i++) table->cols[i].requisition=0; | |
+ for (i=0;i<table->nrows;i++) table->rows[i].requisition=0; | |
+ | |
+ gtk_container_size_request(widget,requisition); | |
+ for (children=table->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkTableChild *)(children->data); | |
+ if (!child) continue; | |
+ child_wid=child->widget; | |
+ if (child_wid && child->left_attach<child->right_attach && | |
+ child->top_attach<child->bottom_attach && | |
+ GTK_WIDGET_VISIBLE(child_wid)) { | |
+ child_req.width=child_wid->requisition.width; | |
+ child_req.height=child_wid->requisition.height; | |
+ child_req.width /= (child->right_attach-child->left_attach); | |
+ child_req.height /= (child->bottom_attach-child->top_attach); | |
+ for (i=child->left_attach;i<child->right_attach;i++) { | |
+ if (child_req.width > table->cols[i].requisition) | |
+ table->cols[i].requisition = child_req.width; | |
+ } | |
+ for (i=child->top_attach;i<child->bottom_attach;i++) { | |
+ if (child_req.height > table->rows[i].requisition) | |
+ table->rows[i].requisition = child_req.height; | |
+ } | |
+ } | |
+ } | |
+ | |
+ if (table->homogeneous) { | |
+ MaxReq=0; | |
+ for (i=0;i<table->ncols;i++) if (table->cols[i].requisition>MaxReq) { | |
+ MaxReq=table->cols[i].requisition; | |
+ } | |
+ for (i=0;i<table->ncols;i++) table->cols[i].requisition=MaxReq; | |
+ | |
+ MaxReq=0; | |
+ for (i=0;i<table->nrows;i++) if (table->rows[i].requisition>MaxReq) { | |
+ MaxReq=table->rows[i].requisition; | |
+ } | |
+ for (i=0;i<table->nrows;i++) table->rows[i].requisition=MaxReq; | |
+ } | |
+ | |
+ requisition->width=requisition->height=0; | |
+ | |
+ for (i=0;i<table->ncols;i++) requisition->width+=table->cols[i].requisition; | |
+ for (i=0;i<table->ncols-1;i++) requisition->width+=table->cols[i].spacing; | |
+ for (i=0;i<table->nrows;i++) requisition->height+=table->rows[i].requisitio… | |
+ for (i=0;i<table->nrows-1;i++) requisition->height+=table->rows[i].spacing; | |
+} | |
+ | |
+void gtk_table_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkTable *table; | |
+ gint row_extra=0,col_extra=0,i; | |
+ GtkAllocation child_alloc; | |
+ GList *children; | |
+ GtkTableChild *child; | |
+ | |
+ table=GTK_TABLE(widget); | |
+ gtk_container_set_size(widget,allocation); | |
+ | |
+ if (table->ncols) { | |
+ col_extra = (allocation->width-widget->requisition.width)/table->ncols; | |
+ } | |
+ if (table->nrows) { | |
+ row_extra = (allocation->height-widget->requisition.height)/table->nrows; | |
+ } | |
+ for (i=0;i<table->ncols;i++) { | |
+ table->cols[i].allocation = table->cols[i].requisition+col_extra; | |
+ } | |
+ for (i=0;i<table->nrows;i++) { | |
+ table->rows[i].allocation = table->rows[i].requisition+row_extra; | |
+ } | |
+ for (children=table->children;children;children=g_list_next(children)) { | |
+ child=(GtkTableChild *)(children->data); | |
+ if (!child || !child->widget || | |
+ !GTK_WIDGET_VISIBLE(child->widget)) continue; | |
+ child_alloc.x = allocation->x; | |
+ child_alloc.y = allocation->y; | |
+ child_alloc.width = child_alloc.height = 0; | |
+ for (i=0;i<child->left_attach;i++) { | |
+ child_alloc.x+=table->cols[i].allocation+table->cols[i].spacing; | |
+ } | |
+ for (i=0;i<child->top_attach;i++) { | |
+ child_alloc.y+=table->rows[i].allocation+table->rows[i].spacing; | |
+ } | |
+ for (i=child->left_attach;i<child->right_attach;i++) { | |
+ child_alloc.width+=table->cols[i].allocation; | |
+ } | |
+ for (i=child->top_attach;i<child->bottom_attach;i++) { | |
+ child_alloc.height+=table->rows[i].allocation; | |
+ } | |
+ gtk_widget_set_size(child->widget,&child_alloc); | |
+ } | |
+} | |
+ | |
+void gtk_table_realize(GtkWidget *widget) { | |
+ GList *children; | |
+ GtkTableChild *child; | |
+ | |
+ gtk_container_realize(widget); | |
+ for (children=GTK_TABLE(widget)->children;children; | |
+ children=g_list_next(children)) { | |
+ child=(GtkTableChild *)(children->data); | |
+ if (child->widget) gtk_widget_realize(child->widget); | |
+ } | |
+} | |
+ | |
+void gtk_table_set_row_spacing(GtkTable *table,guint row,guint spacing) { | |
+ if (table && row>=0 && row<table->nrows) { | |
+ table->rows[row].spacing=spacing; | |
+ } | |
+} | |
+ | |
+void gtk_table_set_col_spacing(GtkTable *table,guint column,guint spacing) { | |
+ if (table && column>=0 && column<table->ncols) { | |
+ table->cols[column].spacing=spacing; | |
+ } | |
+} | |
+ | |
+void gtk_table_set_row_spacings(GtkTable *table,guint spacing) { | |
+ int i; | |
+ table->row_spacing=spacing; | |
+ for (i=0;i<table->nrows;i++) table->rows[i].spacing=spacing; | |
+} | |
+ | |
+void gtk_table_set_col_spacings(GtkTable *table,guint spacing) { | |
+ int i; | |
+ table->column_spacing=spacing; | |
+ for (i=0;i<table->ncols;i++) table->cols[i].spacing=spacing; | |
+} | |
+ | |
+void gtk_toggle_button_toggled(GtkToggleButton *toggle_button) { | |
+ toggle_button->toggled = !toggle_button->toggled; | |
+ gtk_signal_emit(GTK_OBJECT(toggle_button),"toggled"); | |
+} | |
+ | |
+void gtk_check_button_toggled(GtkCheckButton *check_button,gpointer data) { | |
+ HWND hWnd; | |
+ gboolean is_active = GTK_TOGGLE_BUTTON(check_button)->toggled; | |
+ hWnd=GTK_WIDGET(check_button)->hWnd; | |
+ if (hWnd) { | |
+ SendMessage(hWnd,BM_SETCHECK,is_active ? BST_CHECKED : BST_UNCHECKED,0); | |
+ } | |
+} | |
+ | |
+void gtk_radio_button_clicked(GtkRadioButton *radio_button,gpointer data) { | |
+ GtkToggleButton *toggle=GTK_TOGGLE_BUTTON(radio_button); | |
+ | |
+ if (toggle->toggled) return; | |
+ else gtk_toggle_button_toggled(toggle); | |
+} | |
+ | |
+void gtk_radio_button_toggled(GtkRadioButton *radio_button,gpointer data) { | |
+ HWND hWnd; | |
+ GSList *group; | |
+ GtkRadioButton *radio; | |
+ gboolean is_active = GTK_TOGGLE_BUTTON(radio_button)->toggled; | |
+ hWnd=GTK_WIDGET(radio_button)->hWnd; | |
+ if (hWnd) { | |
+ SendMessage(hWnd,BM_SETCHECK,is_active ? BST_CHECKED : BST_UNCHECKED,0); | |
+ } | |
+ if (is_active) { | |
+ for (group=radio_button->group;group;group=g_slist_next(group)) { | |
+ radio=GTK_RADIO_BUTTON(group->data); | |
+ if (radio && radio!=radio_button) { | |
+ GTK_TOGGLE_BUTTON(radio)->toggled=FALSE; | |
+ hWnd=GTK_WIDGET(radio)->hWnd; | |
+ if (hWnd) SendMessage(hWnd,BM_SETCHECK,BST_UNCHECKED,0); | |
+ } | |
+ } | |
+ } | |
+} | |
+ | |
+gboolean gtk_toggle_button_get_active(GtkToggleButton *toggle_button) { | |
+ return (toggle_button->toggled); | |
+} | |
+ | |
+void gtk_toggle_button_set_active(GtkToggleButton *toggle_button, | |
+ gboolean is_active) { | |
+ if (toggle_button->toggled == is_active) return; | |
+ else gtk_toggle_button_toggled(toggle_button); | |
+} | |
+ | |
+void gtk_main_quit() { | |
+ PostQuitMessage(0); | |
+} | |
+ | |
+void gtk_main() { | |
+ MSG msg; | |
+ GSList *list; | |
+ BOOL MsgDone; | |
+ GtkWidget *widget; | |
+ HACCEL hAccel; | |
+ | |
+ while (GetMessage(&msg,NULL,0,0)) { | |
+ MsgDone=FALSE; | |
+ widget=GTK_WIDGET(GetWindowLong(msg.hwnd,GWL_USERDATA)); | |
+ for (list=WindowList;list && !MsgDone;list=g_slist_next(list)) { | |
+ if ((MsgDone=IsDialogMessage((HWND)list->data,&msg))==TRUE) break; | |
+ } | |
+ if (!MsgDone && GTK_OBJECT(widget)->klass==&GtkWindowClass) { | |
+ hAccel=GTK_WINDOW(widget)->hAccel; | |
+ if (hAccel) MsgDone=TranslateAccelerator(widget->hWnd,hAccel,&msg); | |
+ } | |
+ if (!MsgDone) { | |
+ TranslateMessage(&msg); | |
+ DispatchMessage(&msg); | |
+ } | |
+ } | |
+} | |
+ | |
+typedef struct _GtkSignal GtkSignal; | |
+ | |
+struct _GtkSignal { | |
+ GtkSignalFunc func; | |
+ GtkObject *slot_object; | |
+ gpointer func_data; | |
+}; | |
+ | |
+typedef gint (*GtkGIntSignalFunc) (); | |
+ | |
+void gtk_marshal_BOOL__GINT(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args) { | |
+ gboolean *retval; | |
+ gint arg1; | |
+ GtkSignal *signal; | |
+ GtkGIntSignalFunc sigfunc; | |
+ | |
+ arg1=va_arg(args,gint); | |
+ retval=va_arg(args,gboolean *); | |
+ if (!retval) { g_warning("gtk_marshal_BOOL__GINT: retval NULL"); return; } | |
+ | |
+ while (actions) { | |
+ signal=(GtkSignal*)actions->data; | |
+ sigfunc = (GtkGIntSignalFunc)signal->func; | |
+ if (signal->slot_object) { | |
+ *retval = (*sigfunc)(signal->slot_object,arg1); | |
+ } else *retval = (*sigfunc)(object,arg1,signal->func_data); | |
+ if (*retval) return; | |
+ actions=g_slist_next(actions); | |
+ } | |
+ sigfunc=(GtkGIntSignalFunc)default_action; | |
+ if (sigfunc) *retval = (*sigfunc)(object,arg1); | |
+} | |
+ | |
+void gtk_marshal_BOOL__GPOIN(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args) { | |
+ gboolean *retval; | |
+ gpointer arg1; | |
+ GtkSignal *signal; | |
+ GtkGIntSignalFunc sigfunc; | |
+ | |
+ arg1=va_arg(args,gpointer); | |
+ retval=va_arg(args,gboolean *); | |
+ if (!retval) { g_warning("gtk_marshal_BOOL__GPOIN: retval NULL"); return; } | |
+ | |
+ while (actions) { | |
+ signal=(GtkSignal*)actions->data; | |
+ sigfunc = (GtkGIntSignalFunc)signal->func; | |
+ if (signal->slot_object) { | |
+ *retval = (*sigfunc)(signal->slot_object,arg1); | |
+ } else *retval = (*sigfunc)(object,arg1,signal->func_data); | |
+ if (*retval) return; | |
+ actions=g_slist_next(actions); | |
+ } | |
+ sigfunc=(GtkGIntSignalFunc)default_action; | |
+ if (sigfunc) *retval = (*sigfunc)(object,arg1); | |
+} | |
+ | |
+void gtk_marshal_VOID__VOID(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args) { | |
+ GtkSignal *signal; | |
+ | |
+ while (actions) { | |
+// g_print("processing action...\n"); | |
+ signal=(GtkSignal*)actions->data; | |
+ if (signal->slot_object) { | |
+ (*signal->func)(signal->slot_object); | |
+ } else (*signal->func)(object,signal->func_data); | |
+ actions=g_slist_next(actions); | |
+ } | |
+ if (default_action) (*default_action)(object); | |
+} | |
+ | |
+void gtk_marshal_VOID__GPOIN(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args) { | |
+ gpointer arg1; | |
+ GtkSignal *signal; | |
+ | |
+ arg1=va_arg(args,gpointer); | |
+ | |
+ while (actions) { | |
+ signal=(GtkSignal*)actions->data; | |
+ if (signal->slot_object) { | |
+ (*signal->func)(signal->slot_object,arg1); | |
+ } else (*signal->func)(object,arg1,signal->func_data); | |
+ actions=g_slist_next(actions); | |
+ } | |
+ if (default_action) (*default_action)(object,arg1); | |
+} | |
+ | |
+void gtk_marshal_VOID__BOOL(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args) { | |
+ gboolean arg1; | |
+ GtkSignal *signal; | |
+ | |
+ arg1=va_arg(args,gboolean); | |
+ | |
+ while (actions) { | |
+ signal=(GtkSignal*)actions->data; | |
+ if (signal->slot_object) { | |
+ (*signal->func)(signal->slot_object,arg1); | |
+ } else (*signal->func)(object,arg1,signal->func_data); | |
+ actions=g_slist_next(actions); | |
+ } | |
+ if (default_action) (*default_action)(object,arg1); | |
+} | |
+ | |
+static GtkSignalType *gtk_get_signal_type(GtkObject *object, | |
+ const gchar *name) { | |
+ GtkClass *klass; | |
+ GtkSignalType *signals; | |
+ | |
+ for (klass=object->klass;klass;klass=klass->parent) { | |
+/* g_print("Searching for signal %s in class %s\n",name,klass->Name);*/ | |
+ for (signals=klass->signals;signals && signals->name[0];signals++) { | |
+ if (strcmp(signals->name,name)==0) return signals; | |
+ } | |
+ } | |
+ return NULL; | |
+} | |
+ | |
+void gtk_signal_emit(GtkObject *object,const gchar *name, ...) { | |
+ GSList *signal_list; | |
+ GtkSignalType *signal_type; | |
+ va_list ap; | |
+ | |
+/* g_print("gtk_signal_emit of signal %s on object %p, type %p\n", | |
+ name,object,object->klass);*/ | |
+ | |
+ if (!object) return; | |
+ | |
+// g_print("Initialising va_list\n"); | |
+ va_start(ap,name); | |
+// g_print("Getting signal list\n"); | |
+ signal_list=(GSList *)g_datalist_get_data(&object->signals,name); | |
+// g_print("Getting signal list %p\n",signal_list); | |
+ signal_type=gtk_get_signal_type(object,name); | |
+// g_print("Getting signal type %p\n",signal_type); | |
+ if (signal_type && signal_type->marshaller) { | |
+/* g_print("Calling marshaller %p with signal_list %p\n", | |
+ signal_type->marshaller,signal_list);*/ | |
+ (*signal_type->marshaller)(object,signal_list, | |
+ signal_type->default_action,ap); | |
+ } | |
+ va_end(ap); | |
+ if (!signal_type) g_warning("gtk_signal_emit: unknown signal %s",name); | |
+// g_print("Signal emission done\n"); | |
+} | |
+ | |
+guint gtk_signal_connect(GtkObject *object,const gchar *name, | |
+ GtkSignalFunc func,gpointer func_data) { | |
+ GtkSignal *signal; | |
+ GtkSignalType *signal_type; | |
+ GSList *signal_list; | |
+ | |
+// g_print("Attempting to connect signal %s to object %p\n",name,object); | |
+ if (!object) return 0; | |
+ signal_type=gtk_get_signal_type(object,name); | |
+ if (!signal_type) { | |
+ g_warning("gtk_signal_connect: unknown signal %s",name); | |
+ return 0; | |
+ } | |
+ signal_list=(GSList *)g_datalist_get_data(&object->signals,name); | |
+ signal=g_new0(GtkSignal,1); | |
+ signal->func=func; signal->func_data=func_data; | |
+ signal_list=g_slist_append(signal_list,signal); | |
+ g_datalist_set_data(&object->signals,name,signal_list); | |
+ return 0; | |
+} | |
+ | |
+guint gtk_signal_connect_object(GtkObject *object,const gchar *name, | |
+ GtkSignalFunc func,GtkObject *slot_object) { | |
+ GtkSignal *signal; | |
+ GtkSignalType *signal_type; | |
+ GSList *signal_list; | |
+ | |
+ if (!object) return 0; | |
+ signal_type=gtk_get_signal_type(object,name); | |
+ if (!signal_type) { | |
+ g_warning("gtk_signal_connect_object: unknown signal %s",name); | |
+ return 0; | |
+ } | |
+ signal_list=(GSList *)g_datalist_get_data(&object->signals,name); | |
+ signal=g_new0(GtkSignal,1); | |
+ signal->func=func; signal->slot_object=slot_object; | |
+ signal_list=g_slist_append(signal_list,signal); | |
+ g_datalist_set_data(&object->signals,name,signal_list); | |
+ return 0; | |
+} | |
+ | |
+GtkItemFactory *gtk_item_factory_new(GtkType container_type, | |
+ const gchar *path, | |
+ GtkAccelGroup *accel_group) { | |
+ GtkItemFactory *new_fac; | |
+ new_fac=(GtkItemFactory *)GtkNewObject(&GtkItemFactoryClass); | |
+ new_fac->path=g_strdup(path); | |
+ new_fac->top_widget=gtk_menu_bar_new(); | |
+ return new_fac; | |
+} | |
+ | |
+static gint PathCmp(const gchar *path1,const gchar *path2) { | |
+ gint Match=1; | |
+ | |
+ if (!path1 || !path2) return 0; | |
+ | |
+ while (*path1 && *path2 && Match) { | |
+ while (*path1=='_') path1++; | |
+ while (*path2=='_') path2++; | |
+ if (*path1==*path2) { path1++; path2++; } | |
+ else Match=0; | |
+ } | |
+ if (*path1 || *path2) Match=0; | |
+ return Match; | |
+} | |
+ | |
+static void gtk_item_factory_parse_path(GtkItemFactory *ifactory, | |
+ gchar *path, | |
+ GtkItemFactoryChild **parent, | |
+ gchar **menu_title) { | |
+ GSList *list; | |
+ GtkItemFactoryChild *child; | |
+ gchar *root,*pt,*title; | |
+ | |
+ pt=strrchr(path,'/'); | |
+ if (!pt) return; | |
+ title=g_strdup(pt+1); | |
+ root=g_strdup(path); | |
+ root[pt-path]='\0'; | |
+ | |
+ | |
+ for (list=ifactory->children;list;list=g_slist_next(list)) { | |
+ child=(GtkItemFactoryChild *)list->data; | |
+ if (PathCmp(child->path,root)==1) { *parent=child; break; } | |
+ } | |
+ *menu_title=title; | |
+ g_free(root); | |
+} | |
+ | |
+void gtk_item_factory_create_item(GtkItemFactory *ifactory, | |
+ GtkItemFactoryEntry *entry, | |
+ gpointer callback_data,guint callback_type) { | |
+ GtkItemFactoryChild *new_child,*parent=NULL; | |
+ gchar *menu_title=NULL; | |
+ GtkWidget *menu_item,*menu; | |
+ | |
+ new_child=g_new0(GtkItemFactoryChild,1); | |
+ new_child->path=g_strdup(entry->path); | |
+ | |
+ gtk_item_factory_parse_path(ifactory,new_child->path,&parent,&menu_title); | |
+ menu_item=gtk_menu_item_new_with_label(menu_title); | |
+ new_child->widget=menu_item; | |
+ if (entry->callback) { | |
+ gtk_signal_connect(GTK_OBJECT(menu_item),"activate", | |
+ entry->callback,callback_data); | |
+ } | |
+ | |
+ if (parent) { | |
+ menu=GTK_WIDGET(GTK_MENU_ITEM(parent->widget)->submenu); | |
+ if (!menu) { | |
+ menu=gtk_menu_new(); | |
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(parent->widget),menu); | |
+ } | |
+ gtk_menu_append(GTK_MENU(menu),menu_item); | |
+ } else { | |
+ gtk_menu_bar_append(GTK_MENU_BAR(ifactory->top_widget),menu_item); | |
+ } | |
+ | |
+ g_free(menu_title); | |
+ | |
+ ifactory->children=g_slist_append(ifactory->children,new_child); | |
+} | |
+ | |
+void gtk_item_factory_create_items(GtkItemFactory *ifactory,guint n_entries, | |
+ GtkItemFactoryEntry *entries, | |
+ gpointer callback_data) { | |
+ gint i; | |
+ for (i=0;i<n_entries;i++) { | |
+ gtk_item_factory_create_item(ifactory,&entries[i],callback_data,0); | |
+ } | |
+} | |
+ | |
+GtkWidget *gtk_item_factory_get_widget(GtkItemFactory *ifactory, | |
+ const gchar *path) { | |
+ gint root_len; | |
+ GSList *list; | |
+ GtkItemFactoryChild *child; | |
+ | |
+ root_len=strlen(ifactory->path); | |
+ if (!path || strlen(path)<root_len) return NULL; | |
+ | |
+ if (strncmp(ifactory->path,path,root_len)!=0) return NULL; | |
+ if (strlen(path)==root_len) return ifactory->top_widget; | |
+ | |
+ for (list=ifactory->children;list;list=g_slist_next(list)) { | |
+ child=(GtkItemFactoryChild *)list->data; | |
+ if (PathCmp(child->path,&path[root_len])==1) return child->widget; | |
+ } | |
+ return NULL; | |
+} | |
+ | |
+void gtk_menu_shell_insert(GtkMenuShell *menu_shell,GtkWidget *child, | |
+ gint position) { | |
+ menu_shell->children=g_slist_insert(menu_shell->children,(gpointer)child, | |
+ position); | |
+ child->parent=GTK_WIDGET(menu_shell); | |
+} | |
+ | |
+void gtk_menu_shell_append(GtkMenuShell *menu_shell,GtkWidget *child) { | |
+ gtk_menu_shell_insert(menu_shell,child,-1); | |
+} | |
+ | |
+void gtk_menu_shell_prepend(GtkMenuShell *menu_shell,GtkWidget *child) { | |
+ gtk_menu_shell_insert(menu_shell,child,0); | |
+} | |
+ | |
+GtkWidget *gtk_menu_bar_new() { | |
+ GtkMenuBar *menu_bar; | |
+ menu_bar=GTK_MENU_BAR(GtkNewObject(&GtkMenuBarClass)); | |
+ return GTK_WIDGET(menu_bar); | |
+} | |
+ | |
+void gtk_menu_bar_insert(GtkMenuBar *menu_bar,GtkWidget *child,gint position) { | |
+ gtk_menu_shell_insert(GTK_MENU_SHELL(menu_bar),child,position); | |
+} | |
+ | |
+void gtk_menu_bar_append(GtkMenuBar *menu_bar,GtkWidget *child) { | |
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar),child); | |
+} | |
+ | |
+void gtk_menu_bar_prepend(GtkMenuBar *menu_bar,GtkWidget *child) { | |
+ gtk_menu_shell_prepend(GTK_MENU_SHELL(menu_bar),child); | |
+} | |
+ | |
+GtkWidget *gtk_menu_new() { | |
+ GtkMenu *menu; | |
+ menu=GTK_MENU(GtkNewObject(&GtkMenuClass)); | |
+ return GTK_WIDGET(menu); | |
+} | |
+ | |
+void gtk_menu_insert(GtkMenu *menu,GtkWidget *child,gint position) { | |
+ gtk_menu_shell_insert(GTK_MENU_SHELL(menu),child,position); | |
+} | |
+ | |
+void gtk_menu_append(GtkMenu *menu,GtkWidget *child) { | |
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu),child); | |
+} | |
+ | |
+void gtk_menu_prepend(GtkMenu *menu,GtkWidget *child) { | |
+ gtk_menu_shell_prepend(GTK_MENU_SHELL(menu),child); | |
+} | |
+ | |
+GtkWidget *gtk_menu_item_new_with_label(const gchar *label) { | |
+ GtkMenuItem *menu_item; | |
+ gint i; | |
+ | |
+ menu_item=GTK_MENU_ITEM(GtkNewObject(&GtkMenuItemClass)); | |
+ menu_item->text=g_strdup(label); | |
+ for (i=0;i<strlen(menu_item->text);i++) { | |
+ if (menu_item->text[i]=='_') menu_item->text[i]='&'; | |
+ } | |
+ return GTK_WIDGET(menu_item); | |
+} | |
+ | |
+void gtk_menu_item_set_submenu(GtkMenuItem *menu_item,GtkWidget *submenu) { | |
+ menu_item->submenu=GTK_MENU(submenu); | |
+ submenu->parent=GTK_WIDGET(menu_item); | |
+} | |
+ | |
+static GtkWidget *gtk_menu_item_get_menu_ID(GtkMenuItem *menu_item,gint ID) { | |
+ if (menu_item->ID==ID) { | |
+ return GTK_WIDGET(menu_item); | |
+ } else if (menu_item->submenu) { | |
+ return gtk_menu_shell_get_menu_ID(GTK_MENU_SHELL(menu_item->submenu),ID); | |
+ } else return NULL; | |
+} | |
+ | |
+GtkWidget *gtk_menu_shell_get_menu_ID(GtkMenuShell *menu_shell,gint ID) { | |
+ GSList *list; | |
+ GtkWidget *menu_item; | |
+ for (list=menu_shell->children;list;list=list->next) { | |
+ menu_item=gtk_menu_item_get_menu_ID(GTK_MENU_ITEM(list->data),ID); | |
+ if (menu_item) return menu_item; | |
+ } | |
+ return NULL; | |
+} | |
+ | |
+GtkWidget *gtk_window_get_menu_ID(GtkWindow *window,gint ID) { | |
+ if (window->menu_bar) { | |
+ return gtk_menu_shell_get_menu_ID(GTK_MENU_SHELL(window->menu_bar),ID); | |
+ } else return NULL; | |
+} | |
+ | |
+void gtk_menu_bar_realize(GtkWidget *widget) { | |
+ GtkMenuBar *menu_bar=GTK_MENU_BAR(widget); | |
+ GtkWidget *window; | |
+ HMENU hMenu; | |
+ | |
+ hMenu=GTK_MENU_SHELL(widget)->menu=CreateMenu(); | |
+ menu_bar->LastID=1000; | |
+ | |
+ gtk_menu_shell_realize(widget); | |
+ | |
+ window=gtk_widget_get_ancestor(widget,GTK_TYPE_WINDOW); | |
+ gtk_window_set_menu(GTK_WINDOW(window),menu_bar); | |
+} | |
+ | |
+void gtk_menu_item_realize(GtkWidget *widget) { | |
+ GtkMenuItem *menu_item=GTK_MENU_ITEM(widget); | |
+ MENUITEMINFO mii; | |
+ GtkWidget *menu_bar; | |
+ HMENU parent_menu; | |
+ gint pos; | |
+ | |
+ menu_bar=gtk_widget_get_ancestor(widget,GTK_TYPE_MENU_BAR); | |
+ if (menu_bar) menu_item->ID=GTK_MENU_BAR(menu_bar)->LastID++; | |
+ | |
+ if (menu_item->submenu) gtk_widget_realize(GTK_WIDGET(menu_item->submenu)); | |
+ | |
+ parent_menu=GTK_MENU_SHELL(widget->parent)->menu; | |
+ pos=g_slist_index(GTK_MENU_SHELL(widget->parent)->children,widget); | |
+ | |
+ mii.cbSize=sizeof(MENUITEMINFO); | |
+ mii.fMask=MIIM_TYPE|MIIM_ID|MIIM_STATE; | |
+ if (menu_item->submenu) { | |
+ mii.fMask|=MIIM_SUBMENU; | |
+ mii.hSubMenu=GTK_MENU_SHELL(menu_item->submenu)->menu; | |
+ } | |
+ mii.fType=MFT_STRING; | |
+ if (GTK_WIDGET_SENSITIVE(widget)) mii.fState=MFS_ENABLED; | |
+ else mii.fState=MFS_GRAYED; | |
+ mii.wID=menu_item->ID; | |
+ mii.dwTypeData=(LPTSTR)menu_item->text; | |
+ mii.cch=strlen(menu_item->text); | |
+ InsertMenuItem(parent_menu,pos,TRUE,&mii); | |
+} | |
+ | |
+void gtk_menu_realize(GtkWidget *widget) { | |
+ GTK_MENU_SHELL(widget)->menu=CreatePopupMenu(); | |
+ gtk_menu_shell_realize(widget); | |
+} | |
+ | |
+void gtk_menu_shell_realize(GtkWidget *widget) { | |
+ GSList *children; | |
+ GtkMenuShell *menu=GTK_MENU_SHELL(widget); | |
+ for (children=menu->children;children;children=g_slist_next(children)) { | |
+ gtk_widget_realize(GTK_WIDGET(children->data)); | |
+ } | |
+} | |
+ | |
+void gtk_menu_item_enable(GtkWidget *widget) { | |
+ GtkWidget *parent; | |
+ HMENU hMenu; | |
+ HWND hWnd; | |
+ parent=widget->parent; | |
+ if (!parent) return; | |
+ hMenu=GTK_MENU_SHELL(parent)->menu; | |
+ if (hMenu) EnableMenuItem(hMenu,GTK_MENU_ITEM(widget)->ID, | |
+ MF_BYCOMMAND|MF_ENABLED); | |
+ hWnd=gtk_get_parent_hwnd(widget); | |
+ if (hWnd) DrawMenuBar(hWnd); | |
+} | |
+ | |
+void gtk_menu_item_disable(GtkWidget *widget) { | |
+ GtkWidget *parent; | |
+ HMENU hMenu; | |
+ HWND hWnd; | |
+ parent=widget->parent; | |
+ if (!parent) return; | |
+ hMenu=GTK_MENU_SHELL(parent)->menu; | |
+ if (hMenu) EnableMenuItem(hMenu,GTK_MENU_ITEM(widget)->ID, | |
+ MF_BYCOMMAND|MF_GRAYED); | |
+ hWnd=gtk_get_parent_hwnd(widget); | |
+ if (hWnd) DrawMenuBar(hWnd); | |
+} | |
+ | |
+GtkWidget *gtk_notebook_new() { | |
+ GtkNotebook *notebook; | |
+ | |
+ notebook=GTK_NOTEBOOK(GtkNewObject(&GtkNotebookClass)); | |
+ return GTK_WIDGET(notebook); | |
+} | |
+ | |
+void gtk_notebook_append_page(GtkNotebook *notebook,GtkWidget *child, | |
+ GtkWidget *tab_label) { | |
+ gtk_notebook_insert_page(notebook,child,tab_label,-1); | |
+} | |
+ | |
+void gtk_notebook_insert_page(GtkNotebook *notebook,GtkWidget *child, | |
+ GtkWidget *tab_label,gint position) { | |
+ GtkNotebookChild *note_child; | |
+ note_child=g_new0(GtkNotebookChild,1); | |
+ note_child->child=child; | |
+ note_child->tab_label=tab_label; | |
+ notebook->children=g_slist_insert(notebook->children,note_child,position); | |
+ child->parent=GTK_WIDGET(notebook); | |
+} | |
+ | |
+void gtk_notebook_set_page(GtkNotebook *notebook,gint page_num) { | |
+ GSList *children; | |
+ GtkNotebookChild *note_child; | |
+ GtkWidget *widget=GTK_WIDGET(notebook); | |
+ gint pos=0; | |
+ | |
+ if (page_num<0) page_num=g_slist_length(notebook->children)-1; | |
+ notebook->selection=page_num; | |
+ | |
+ if (GTK_WIDGET_REALIZED(widget)) { | |
+ if (widget->hWnd) TabCtrl_SetCurSel(widget->hWnd,page_num); | |
+ for (children=notebook->children;children; | |
+ children=g_slist_next(children)) { | |
+ note_child=(GtkNotebookChild *)(children->data); | |
+ if (note_child && note_child->child) { | |
+ if (pos==page_num) gtk_widget_show_all_full(note_child->child,TRUE… | |
+ else gtk_widget_hide_all_full(note_child->child,TRUE); | |
+ pos++; | |
+ } | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_notebook_realize(GtkWidget *widget) { | |
+ GSList *children; | |
+ GtkNotebookChild *note_child; | |
+ HWND Parent; | |
+ gint tab_pos=0; | |
+ TC_ITEM tie; | |
+ | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindow(WC_TABCONTROL,"", | |
+ WS_CHILD,0,0,0,0, | |
+ Parent,NULL,hInst,NULL); | |
+ if (widget->hWnd==NULL) g_print("Error creating window!\n"); | |
+ gtk_set_default_font(widget->hWnd); | |
+ | |
+ tie.mask = TCIF_TEXT | TCIF_IMAGE; | |
+ tie.iImage = -1; | |
+ | |
+ for (children=GTK_NOTEBOOK(widget)->children;children; | |
+ children=g_slist_next(children)) { | |
+ note_child=(GtkNotebookChild *)(children->data); | |
+ if (note_child) { | |
+ if (note_child->tab_label) | |
+ tie.pszText=GTK_LABEL(note_child->tab_label)->text; | |
+ else tie.pszText="No label"; | |
+ TabCtrl_InsertItem(widget->hWnd,tab_pos++,&tie); | |
+ if (note_child->child) { | |
+ gtk_widget_realize(note_child->child); | |
+ } | |
+ } | |
+ } | |
+ gtk_notebook_set_page(GTK_NOTEBOOK(widget),GTK_NOTEBOOK(widget)->selection); | |
+} | |
+ | |
+void gtk_notebook_show_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GSList *children; | |
+ GtkNotebookChild *note_child; | |
+ | |
+ if (!hWndOnly) for (children=GTK_NOTEBOOK(widget)->children;children; | |
+ children=g_slist_next(children)) { | |
+ note_child=(GtkNotebookChild *)(children->data); | |
+ if (note_child && note_child->child) | |
+ gtk_widget_show_all_full(note_child->child,hWndOnly); | |
+ } | |
+ gtk_notebook_set_page(GTK_NOTEBOOK(widget),GTK_NOTEBOOK(widget)->selection); | |
+} | |
+ | |
+void gtk_notebook_hide_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GSList *children; | |
+ GtkNotebookChild *note_child; | |
+ | |
+ for (children=GTK_NOTEBOOK(widget)->children;children; | |
+ children=g_slist_next(children)) { | |
+ note_child=(GtkNotebookChild *)(children->data); | |
+ if (note_child && note_child->child) | |
+ gtk_widget_hide_all_full(note_child->child,hWndOnly); | |
+ } | |
+} | |
+ | |
+void gtk_notebook_destroy(GtkWidget *widget) { | |
+ GSList *children; | |
+ GtkNotebookChild *note_child; | |
+ | |
+ for (children=GTK_NOTEBOOK(widget)->children;children; | |
+ children=g_slist_next(children)) { | |
+ note_child=(GtkNotebookChild *)(children->data); | |
+ if (note_child) { | |
+ gtk_widget_destroy(note_child->child); | |
+ gtk_widget_destroy(note_child->tab_label); | |
+ } | |
+ g_free(note_child); | |
+ } | |
+ g_slist_free(GTK_NOTEBOOK(widget)->children); | |
+} | |
+ | |
+void gtk_notebook_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GSList *children; | |
+ GtkNotebookChild *note_child; | |
+ RECT rect; | |
+ GtkAllocation child_alloc; | |
+ | |
+ gtk_container_set_size(widget,allocation); | |
+ rect.left=allocation->x; | |
+ rect.top=allocation->y; | |
+ rect.right=allocation->x+allocation->width; | |
+ rect.bottom=allocation->y+allocation->height; | |
+ TabCtrl_AdjustRect(widget->hWnd,FALSE,&rect); | |
+ child_alloc.x=rect.left+GTK_CONTAINER(widget)->border_width; | |
+ child_alloc.y=rect.top+GTK_CONTAINER(widget)->border_width; | |
+ child_alloc.width=rect.right-rect.left | |
+ -2*GTK_CONTAINER(widget)->border_width; | |
+ child_alloc.height=rect.bottom-rect.top | |
+ -2*GTK_CONTAINER(widget)->border_width; | |
+ | |
+ for (children=GTK_NOTEBOOK(widget)->children;children; | |
+ children=g_slist_next(children)) { | |
+ note_child=(GtkNotebookChild *)(children->data); | |
+ if (note_child && note_child->child) { | |
+ gtk_widget_set_size(note_child->child,&child_alloc); | |
+ } | |
+ } | |
+} | |
+ | |
+void gtk_notebook_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ GSList *children; | |
+ GtkNotebookChild *note_child; | |
+ GtkRequisition *child_req; | |
+ RECT rect; | |
+ | |
+ requisition->width=requisition->height=0; | |
+ for (children=GTK_NOTEBOOK(widget)->children;children; | |
+ children=g_slist_next(children)) { | |
+ note_child=(GtkNotebookChild *)(children->data); | |
+ if (note_child && note_child->child && | |
+ GTK_WIDGET_VISIBLE(note_child->child)) { | |
+ child_req=¬e_child->child->requisition; | |
+ if (child_req->width > requisition->width) | |
+ requisition->width=child_req->width; | |
+ if (child_req->height > requisition->height) | |
+ requisition->height=child_req->height; | |
+ } | |
+ } | |
+ requisition->width+=GTK_CONTAINER(widget)->border_width*2; | |
+ requisition->height+=GTK_CONTAINER(widget)->border_width*2; | |
+ rect.left=rect.top=0; | |
+ rect.right=requisition->width; | |
+ rect.bottom=requisition->height; | |
+ TabCtrl_AdjustRect(widget->hWnd,TRUE,&rect); | |
+ requisition->width=rect.right-rect.left; | |
+ requisition->height=rect.bottom-rect.top; | |
+} | |
+ | |
+GtkObject *gtk_adjustment_new(gfloat value,gfloat lower,gfloat upper, | |
+ gfloat step_increment,gfloat page_increment, | |
+ gfloat page_size) { | |
+ GtkAdjustment *adj; | |
+ | |
+ adj=(GtkAdjustment *)(GtkNewObject(&GtkAdjustmentClass)); | |
+ | |
+ adj->value=value; | |
+ adj->lower=lower; | |
+ adj->upper=upper; | |
+ adj->step_increment=step_increment; | |
+ adj->page_increment=page_increment; | |
+ adj->page_size=page_size; | |
+ | |
+ return GTK_OBJECT(adj); | |
+} | |
+ | |
+GtkWidget *gtk_spin_button_new(GtkAdjustment *adjustment,gfloat climb_rate, | |
+ guint digits) { | |
+ GtkSpinButton *spin; | |
+ | |
+ spin=GTK_SPIN_BUTTON(GtkNewObject(&GtkSpinButtonClass)); | |
+ spin->adj=adjustment; | |
+ | |
+ return GTK_WIDGET(spin); | |
+} | |
+ | |
+void gtk_spin_button_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition) { | |
+ gtk_entry_size_request(widget,requisition); | |
+// requisition->width += GetSystemMetrics(SM_CXVSCROLL); | |
+} | |
+ | |
+void gtk_spin_button_set_size(GtkWidget *widget, | |
+ GtkAllocation *allocation) { | |
+ int width=allocation->width,udwidth; | |
+ HWND updown; | |
+ | |
+ udwidth=GetSystemMetrics(SM_CXVSCROLL); | |
+ width=allocation->width; | |
+ allocation->width-=udwidth; | |
+ | |
+ updown=GTK_SPIN_BUTTON(widget)->updown; | |
+ if (updown) { | |
+ SetWindowPos(updown,HWND_TOP, | |
+ allocation->x+allocation->width,allocation->y, | |
+ udwidth,allocation->height, | |
+ SWP_NOZORDER); | |
+ } | |
+} | |
+ | |
+void gtk_spin_button_realize(GtkWidget *widget) { | |
+ GtkSpinButton *spin=GTK_SPIN_BUTTON(widget); | |
+ HWND Parent; | |
+ | |
+ gtk_entry_realize(widget); | |
+ | |
+ Parent=gtk_get_parent_hwnd(widget->parent); | |
+ spin->updown=CreateUpDownControl(WS_CHILD|WS_BORDER| | |
+ UDS_SETBUDDYINT|UDS_NOTHOUSANDS|UDS_ARROWKEYS, | |
+ 0,0,0,0,Parent,0,hInst,widget->hWnd, | |
+ (int)spin->adj->upper,(int)spin->adj->lower, | |
+ (int)spin->adj->value); | |
+ gtk_set_default_font(spin->updown); | |
+} | |
+ | |
+void gtk_spin_button_destroy(GtkWidget *widget) { | |
+ g_free(GTK_SPIN_BUTTON(widget)->adj); | |
+} | |
+ | |
+void gtk_spin_button_show(GtkWidget *widget) { | |
+ HWND updown; | |
+ updown=GTK_SPIN_BUTTON(widget)->updown; | |
+ if (updown) ShowWindow(updown,SW_SHOWNORMAL); | |
+} | |
+ | |
+void gtk_spin_button_hide(GtkWidget *widget) { | |
+ HWND updown; | |
+ updown=GTK_SPIN_BUTTON(widget)->updown; | |
+ if (updown) ShowWindow(updown,SW_HIDE); | |
+} | |
+ | |
+void gdk_input_remove(gint tag) { | |
+ GSList *list; | |
+ GdkInput *input; | |
+ for (list=GdkInputs;list;list=g_slist_next(list)) { | |
+ input=(GdkInput *)list->data; | |
+ if (input->source==tag) { | |
+ WSAAsyncSelect(input->source,TopLevel,0,0); | |
+ g_slist_remove(GdkInputs,input); | |
+ g_free(input); | |
+ break; | |
+ } | |
+ } | |
+} | |
+ | |
+gint gdk_input_add(gint source,GdkInputCondition condition, | |
+ GdkInputFunction function,gpointer data) { | |
+ GdkInput *input; | |
+ input=g_new(GdkInput,1); | |
+ input->source=source; | |
+ input->condition=condition; | |
+ input->function=function; | |
+ input->data=data; | |
+ WSAAsyncSelect(source,TopLevel,WM_SOCKETDATA, | |
+ (condition&GDK_INPUT_READ ? FD_READ : 0) | | |
+ (condition&GDK_INPUT_WRITE ? FD_WRITE : 0)); | |
+ GdkInputs=g_slist_append(GdkInputs,input); | |
+ return source; | |
+} | |
+ | |
+GtkWidget *gtk_hseparator_new() { | |
+ return GTK_WIDGET(GtkNewObject(&GtkHSeparatorClass)); | |
+} | |
+ | |
+GtkWidget *gtk_vseparator_new() { | |
+ return GTK_WIDGET(GtkNewObject(&GtkVSeparatorClass)); | |
+} | |
+ | |
+void gtk_separator_size_request(GtkWidget *widget, | |
+ GtkRequisition *requisition) { | |
+ requisition->height=requisition->width=2; | |
+} | |
+ | |
+void gtk_separator_realize(GtkWidget *widget) { | |
+ HWND Parent; | |
+ Parent=gtk_get_parent_hwnd(widget); | |
+ widget->hWnd = CreateWindow(WC_GTKSEP,"",WS_CHILD, | |
+ 0,0,0,0,Parent,NULL,hInst,NULL); | |
+} | |
+ | |
+void gtk_object_set_data(GtkObject *object,const gchar *key,gpointer data) { | |
+ g_datalist_set_data(&object->object_data,key,data); | |
+} | |
+ | |
+gpointer gtk_object_get_data(GtkObject *object,const gchar *key) { | |
+ return g_datalist_get_data(&object->object_data,key); | |
+} | |
+ | |
+GtkAccelGroup *gtk_accel_group_new() { | |
+ GtkAccelGroup *new_accel; | |
+ new_accel=g_new0(GtkAccelGroup,1); | |
+ return new_accel; | |
+} | |
+ | |
+void gtk_item_factory_set_translate_func(GtkItemFactory *ifactory, | |
+ GtkTranslateFunc func, | |
+ gpointer data, | |
+ GtkDestroyNotify notify) { | |
+} | |
+ | |
+void gtk_widget_grab_default(GtkWidget *widget) { | |
+} | |
+ | |
+void gtk_widget_grab_focus(GtkWidget *widget) { | |
+} | |
+ | |
+void gtk_window_set_modal(GtkWindow *window,gboolean modal) { | |
+ window->modal=modal; | |
+} | |
+ | |
+void gtk_window_add_accel_group(GtkWindow *window,GtkAccelGroup *accel_group) { | |
+ window->accel_group=accel_group; | |
+} | |
+ | |
+void gtk_entry_set_text(GtkEntry *entry,const gchar *text) { | |
+ int pos=0; | |
+ gtk_editable_insert_text(GTK_EDITABLE(entry),text,strlen(text),&pos); | |
+} | |
+ | |
+guint SetAccelerator(GtkWidget *labelparent,gchar *Text, | |
+ GtkWidget *sendto,gchar *signal, | |
+ GtkAccelGroup *accel_group) { | |
+ return 0; | |
+} | |
+ | |
+void gtk_widget_add_accelerator(GtkWidget *widget, | |
+ const gchar *accel_signal, | |
+ GtkAccelGroup *accel_group, | |
+ guint accel_key,guint accel_mods) { | |
+} | |
+ | |
+void gtk_widget_remove_accelerator(GtkWidget *widget, | |
+ GtkAccelGroup *accel_group, | |
+ guint accel_key,guint accel_mods) { | |
+} | |
+ | |
+GtkWidget *gtk_vpaned_new() { | |
+ return GTK_WIDGET(GtkNewObject(&GtkVPanedClass)); | |
+} | |
+ | |
+GtkWidget *gtk_hpaned_new() { | |
+ return GTK_WIDGET(GtkNewObject(&GtkHPanedClass)); | |
+} | |
+ | |
+static void gtk_paned_pack(GtkPaned *paned,gint pos,GtkWidget *child, | |
+ gboolean resize,gboolean shrink) { | |
+ paned->children[pos].widget=child; | |
+ paned->children[pos].resize=resize; | |
+ paned->children[pos].shrink=shrink; | |
+ child->parent=GTK_WIDGET(paned); | |
+} | |
+ | |
+void gtk_paned_pack1(GtkPaned *paned,GtkWidget *child,gboolean resize, | |
+ gboolean shrink) { | |
+ gtk_paned_pack(paned,0,child,resize,shrink); | |
+} | |
+ | |
+void gtk_paned_pack2(GtkPaned *paned,GtkWidget *child,gboolean resize, | |
+ gboolean shrink) { | |
+ gtk_paned_pack(paned,1,child,resize,shrink); | |
+} | |
+ | |
+void gtk_paned_add1(GtkPaned *paned,GtkWidget *child) { | |
+ gtk_paned_pack1(paned,child,FALSE,TRUE); | |
+} | |
+ | |
+void gtk_paned_add2(GtkPaned *paned,GtkWidget *child) { | |
+ gtk_paned_pack2(paned,child,FALSE,TRUE); | |
+} | |
+ | |
+void gtk_paned_show_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GtkPaned *paned=GTK_PANED(widget); | |
+ gint i; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) { | |
+ gtk_widget_show_all_full(paned->children[i].widget,hWndOnly); | |
+ } | |
+} | |
+ | |
+void gtk_paned_hide_all(GtkWidget *widget,gboolean hWndOnly) { | |
+ GtkPaned *paned=GTK_PANED(widget); | |
+ gint i; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) | |
+ gtk_widget_hide_all_full(paned->children[i].widget,hWndOnly); | |
+} | |
+ | |
+void gtk_paned_realize(GtkWidget *widget) { | |
+ GtkPaned *paned=GTK_PANED(widget); | |
+ gint i; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) { | |
+ gtk_widget_realize(paned->children[i].widget); | |
+ } | |
+} | |
+ | |
+void gtk_vpaned_realize(GtkWidget *widget) { | |
+ gtk_paned_realize(widget); | |
+} | |
+ | |
+void gtk_hpaned_realize(GtkWidget *widget) { | |
+ gtk_paned_realize(widget); | |
+} | |
+ | |
+void gtk_vpaned_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ GtkPaned *paned=GTK_PANED(widget); | |
+ gint i; | |
+ requisition->width=requisition->height=0; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) { | |
+ if (paned->children[i].widget->requisition.width > requisition->width) | |
+ requisition->width = paned->children[i].widget->requisition.width; | |
+ requisition->height += paned->children[i].widget->requisition.height; | |
+ } | |
+} | |
+ | |
+void gtk_hpaned_size_request(GtkWidget *widget,GtkRequisition *requisition) { | |
+ GtkPaned *paned=GTK_PANED(widget); | |
+ gint i; | |
+ requisition->width=requisition->height=0; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) { | |
+ if (paned->children[i].widget->requisition.height > requisition->height) | |
+ requisition->height = paned->children[i].widget->requisition.height; | |
+ requisition->width += paned->children[i].widget->requisition.width; | |
+ } | |
+} | |
+ | |
+void gtk_vpaned_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkPaned *paned=GTK_PANED(widget); | |
+ gint i,numchildren=0; | |
+ GtkAllocation child_alloc; | |
+ child_alloc.x=allocation->x; | |
+ child_alloc.y=allocation->y; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) numchildren++; | |
+ if (numchildren==0) return; | |
+ child_alloc.width=allocation->width; | |
+ child_alloc.height=allocation->height/numchildren; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) { | |
+ gtk_widget_set_size(paned->children[i].widget,&child_alloc); | |
+ child_alloc.y+=allocation->height/numchildren; | |
+ } | |
+} | |
+ | |
+void gtk_hpaned_set_size(GtkWidget *widget,GtkAllocation *allocation) { | |
+ GtkPaned *paned=GTK_PANED(widget); | |
+ gint i,numchildren=0; | |
+ GtkAllocation child_alloc; | |
+ child_alloc.x=allocation->x; | |
+ child_alloc.y=allocation->y; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) numchildren++; | |
+ if (numchildren==0) return; | |
+ child_alloc.height=allocation->height; | |
+ child_alloc.width=allocation->width/numchildren; | |
+ for (i=0;i<2;i++) if (paned->children[i].widget) { | |
+/* g_print("Setting size of child to %d,%d at %d,%d\n", | |
+ child_alloc.width,child_alloc.height,child_alloc.x,child_alloc.y);*/ | |
+ gtk_widget_set_size(paned->children[i].widget,&child_alloc); | |
+ child_alloc.x+=allocation->width/numchildren; | |
+ } | |
+} | |
+ | |
+void gtk_text_set_editable(GtkText *text,gboolean is_editable) { | |
+ gtk_editable_set_editable(GTK_EDITABLE(text),is_editable); | |
+} | |
+ | |
+void gtk_text_set_word_wrap(GtkText *text,gboolean word_wrap) { | |
+} | |
+ | |
+void gtk_text_freeze(GtkText *text) { | |
+} | |
+ | |
+void gtk_text_thaw(GtkText *text) { | |
+} | |
+ | |
+void gtk_clist_sort(GtkCList *clist) { | |
+} | |
+ | |
+void gtk_clist_freeze(GtkCList *clist) { | |
+} | |
+ | |
+void gtk_clist_thaw(GtkCList *clist) { | |
+} | |
+ | |
+void gtk_clist_clear(GtkCList *clist) { | |
+} | |
diff --git a/src/gtk.h b/src/gtk.h | |
t@@ -0,0 +1,571 @@ | |
+#ifndef __GTK_H__ | |
+#define __GTK_H__ | |
+ | |
+#include <windows.h> | |
+#include <glib.h> | |
+#include <stdarg.h> | |
+ | |
+typedef enum { | |
+ GTK_WINDOW_TOPLEVEL, GTK_WINDOW_DIALOG, GTK_WINDOW_POPUP | |
+} GtkWindowType; | |
+ | |
+typedef enum { | |
+ GTK_EXPAND = 1 << 0, | |
+ GTK_SHRINK = 1 << 1, | |
+ GTK_FILL = 1 << 2 | |
+} GtkAttachOptions; | |
+ | |
+typedef enum { | |
+ GTK_SELECTION_SINGLE, | |
+ GTK_SELECTION_BROWSE, | |
+ GTK_SELECTION_MULTIPLE, | |
+ GTK_SELECTION_EXTENDED | |
+} GtkSelectionMode; | |
+ | |
+typedef enum { | |
+ GDK_INPUT_READ = 1 << 0, | |
+ GDK_INPUT_WRITE = 1 << 1, | |
+ GDK_INPUT_EXCEPTION = 1 << 2 | |
+} GdkInputCondition; | |
+ | |
+typedef void (*GdkInputFunction)(gpointer data,gint source, | |
+ GdkInputCondition condition); | |
+typedef gchar* (*GtkTranslateFunc)(const gchar *path,gpointer func_data); | |
+typedef void (*GtkDestroyNotify)(gpointer data); | |
+ | |
+typedef enum { | |
+ GTK_REALIZED = 1 << 6, | |
+ GTK_VISIBLE = 1 << 8, | |
+ GTK_SENSITIVE = 1 << 10, | |
+ GTK_CAN_DEFAULT = 1 << 13 | |
+} GtkWidgetFlags; | |
+ | |
+#define GTK_VISIBLE 1 | |
+ | |
+typedef struct _GtkClass GtkClass; | |
+typedef struct _GtkObject GtkObject; | |
+ | |
+typedef struct _GtkRequisition GtkRequisition; | |
+typedef struct _GtkAllocation GtkAllocation; | |
+typedef struct _GtkWidget GtkWidget; | |
+typedef struct _GtkSignalType GtkSignalType; | |
+ | |
+typedef void (*GtkSignalFunc) (); | |
+typedef void (*GtkItemFactoryCallback) (); | |
+typedef void (*GtkSignalMarshaller)(GtkObject *object,GSList *actions, | |
+ GtkSignalFunc default_action, | |
+ va_list args); | |
+typedef struct _GtkMenuShell GtkMenuShell; | |
+typedef struct _GtkMenuBar GtkMenuBar; | |
+typedef struct _GtkMenuItem GtkMenuItem; | |
+typedef struct _GtkMenu GtkMenu; | |
+typedef struct _GtkAdjustment GtkAdjustment; | |
+typedef struct _GtkSeparator GtkSeparator; | |
+typedef struct _GtkHSeparator GtkHSeparator; | |
+typedef struct _GtkVSeparator GtkVSeparator; | |
+typedef struct _GtkAccelGroup GtkAccelGroup; | |
+typedef struct _GtkPanedChild GtkPanedChild; | |
+typedef struct _GtkPaned GtkPaned; | |
+typedef struct _GtkVPaned GtkVPaned; | |
+typedef struct _GtkHPaned GtkHPaned; | |
+ | |
+struct _GtkAccelGroup { | |
+ GSList *accel; | |
+}; | |
+ | |
+struct _GtkSignalType { | |
+ gchar *name; | |
+ GtkSignalMarshaller marshaller; | |
+ GtkSignalFunc default_action; | |
+}; | |
+ | |
+struct _GtkClass { | |
+ gchar *Name; | |
+ GtkClass *parent; | |
+ gint Size; | |
+ GtkSignalType *signals; | |
+}; | |
+ | |
+typedef GtkClass *GtkType; | |
+ | |
+struct _GtkObject { | |
+ GtkClass *klass; | |
+ GData *object_data; | |
+ GData *signals; | |
+ guint32 flags; | |
+}; | |
+ | |
+struct _GtkAdjustment { | |
+ GtkObject object; | |
+ gfloat value,lower,upper; | |
+ gfloat step_increment,page_increment,page_size; | |
+}; | |
+ | |
+struct _GtkRequisition { | |
+ gint16 width, height; | |
+}; | |
+ | |
+struct _GtkAllocation { | |
+ gint16 x,y,width,height; | |
+}; | |
+ | |
+struct _GtkWidget { | |
+ GtkObject object; | |
+ HWND hWnd; | |
+ GtkRequisition requisition; | |
+ GtkAllocation allocation; | |
+ GtkWidget *parent; | |
+}; | |
+ | |
+struct _GtkSeparator { | |
+ GtkWidget widget; | |
+}; | |
+ | |
+struct _GtkHSeparator { | |
+ GtkSeparator separator; | |
+}; | |
+ | |
+struct _GtkVSeparator { | |
+ GtkSeparator separator; | |
+}; | |
+ | |
+struct _GtkMenuItem { | |
+ GtkWidget widget; | |
+ GtkMenu *submenu; | |
+ gint ID; | |
+ gchar *text; | |
+}; | |
+ | |
+struct _GtkMenuShell { | |
+ GtkWidget widget; | |
+ HMENU menu; | |
+ GSList *children; | |
+}; | |
+ | |
+struct _GtkMenu { | |
+ GtkMenuShell menushell; | |
+}; | |
+ | |
+struct _GtkMenuBar { | |
+ GtkMenuShell menushell; | |
+ gint LastID; | |
+}; | |
+ | |
+typedef struct _GtkEditable GtkEditable; | |
+typedef struct _GtkEntry GtkEntry; | |
+typedef struct _GtkText GtkText; | |
+typedef struct _GtkSpinButton GtkSpinButton; | |
+ | |
+struct _GtkEditable { | |
+ GtkWidget widget; | |
+}; | |
+ | |
+struct _GtkEntry { | |
+ GtkEditable editable; | |
+}; | |
+ | |
+struct _GtkSpinButton { | |
+ GtkEntry entry; | |
+ GtkAdjustment *adj; | |
+ HWND updown; | |
+}; | |
+ | |
+struct _GtkText { | |
+ GtkEditable editable; | |
+}; | |
+ | |
+typedef struct _GtkLabel GtkLabel; | |
+ | |
+struct _GtkLabel { | |
+ GtkWidget widget; | |
+ gchar *text; | |
+}; | |
+ | |
+typedef struct _GtkContainer GtkContainer; | |
+ | |
+struct _GtkContainer { | |
+ GtkWidget widget; | |
+ GtkWidget *child; | |
+ guint border_width : 16; | |
+}; | |
+ | |
+struct _GtkPanedChild { | |
+ GtkWidget *widget; | |
+ gint resize : 1; | |
+ gint shrink : 1; | |
+}; | |
+ | |
+struct _GtkPaned { | |
+ GtkContainer container; | |
+ GtkPanedChild children[2]; | |
+ gint handle_size,gutter_size; | |
+ gint handle_pos; | |
+}; | |
+ | |
+struct _GtkVPaned { | |
+ GtkPaned paned; | |
+}; | |
+ | |
+struct _GtkHPaned { | |
+ GtkPaned paned; | |
+}; | |
+ | |
+typedef struct _GtkBox GtkBox; | |
+typedef struct _GtkBoxChild GtkBoxChild; | |
+typedef struct _GtkHBox GtkHBox; | |
+typedef struct _GtkVBox GtkVBox; | |
+typedef struct _GtkNotebookChild GtkNotebookChild; | |
+typedef struct _GtkNotebook GtkNotebook; | |
+typedef struct _GtkCList GtkCList; | |
+typedef struct _GtkCListRow GtkCListRow; | |
+typedef struct _GtkCListColumn GtkCListColumn; | |
+typedef struct _GtkItemFactoryEntry GtkItemFactoryEntry; | |
+typedef struct _GtkItemFactory GtkItemFactory; | |
+ | |
+struct _GtkItemFactoryEntry { | |
+ gchar *path; | |
+ gchar *accelerator; | |
+ GtkItemFactoryCallback callback; | |
+ guint callback_action; | |
+ gchar *item_type; | |
+}; | |
+ | |
+struct _GtkItemFactory { | |
+ GtkObject object; | |
+ GSList *children; | |
+ gchar *path; | |
+ GtkWidget *top_widget; | |
+}; | |
+ | |
+struct _GtkBoxChild { | |
+ GtkWidget *widget; | |
+ guint expand : 1; | |
+ guint fill : 1; | |
+}; | |
+ | |
+struct _GtkBox { | |
+ GtkContainer container; | |
+ GList *children; | |
+ guint16 spacing; | |
+ guint homogeneous : 1; | |
+}; | |
+ | |
+struct _GtkHBox { | |
+ GtkBox box; | |
+}; | |
+ | |
+struct _GtkVBox { | |
+ GtkBox box; | |
+}; | |
+ | |
+struct _GtkNotebookChild { | |
+ GtkWidget *child,*tab_label; | |
+}; | |
+ | |
+struct _GtkNotebook { | |
+ GtkContainer container; | |
+ GSList *children; | |
+ gint selection; | |
+}; | |
+ | |
+struct _GtkCListColumn { | |
+ gchar *title; | |
+ gint width; | |
+ guint visible : 1; | |
+ guint resizeable : 1; | |
+ guint auto_resize : 1; | |
+ guint button_passive : 1; | |
+}; | |
+ | |
+struct _GtkCListRow { | |
+ gpointer data; | |
+ gchar **text; | |
+}; | |
+ | |
+struct _GtkCList { | |
+ GtkContainer container; | |
+ gint ncols; | |
+ HWND header; | |
+ gint16 header_size; | |
+ GSList *rows; | |
+ GtkCListColumn *cols; | |
+ GtkSelectionMode mode; | |
+}; | |
+ | |
+typedef struct _GtkBin GtkBin; | |
+ | |
+struct _GtkBin { | |
+ GtkContainer container; | |
+ GtkWidget *child; | |
+}; | |
+ | |
+typedef struct _GtkFrame GtkFrame; | |
+typedef struct _GtkButton GtkButton; | |
+typedef struct _GtkToggleButton GtkToggleButton; | |
+typedef struct _GtkCheckButton GtkCheckButton; | |
+typedef struct _GtkRadioButton GtkRadioButton; | |
+ | |
+struct _GtkFrame { | |
+ GtkBin bin; | |
+ gchar *text; | |
+ GtkRequisition label_req; | |
+}; | |
+ | |
+struct _GtkButton { | |
+ GtkWidget widget; | |
+ gchar *text; | |
+}; | |
+ | |
+struct _GtkToggleButton { | |
+ GtkButton button; | |
+ gboolean toggled; | |
+}; | |
+ | |
+struct _GtkCheckButton { | |
+ GtkToggleButton toggle; | |
+}; | |
+ | |
+struct _GtkRadioButton { | |
+ GtkCheckButton check; | |
+ GSList *group; | |
+}; | |
+ | |
+typedef struct _GtkWindow GtkWindow; | |
+ | |
+struct _GtkWindow { | |
+ GtkBin bin; | |
+ GtkWindowType type; | |
+ gchar *title; | |
+ gint default_width,default_height; | |
+ GtkMenuBar *menu_bar; | |
+ GtkAccelGroup *accel_group; | |
+ HACCEL hAccel; | |
+ guint modal : 1; | |
+}; | |
+ | |
+typedef struct _GtkTable GtkTable; | |
+typedef struct _GtkTableChild GtkTableChild; | |
+typedef struct _GtkTableRowCol GtkTableRowCol; | |
+ | |
+struct _GtkTable { | |
+ GtkContainer container; | |
+ GList *children; | |
+ GtkTableRowCol *rows,*cols; | |
+ guint16 nrows,ncols; | |
+ guint16 column_spacing,row_spacing; | |
+ guint homogeneous : 1; | |
+}; | |
+ | |
+struct _GtkTableChild { | |
+ GtkWidget *widget; | |
+ guint16 left_attach,right_attach,top_attach,bottom_attach; | |
+}; | |
+ | |
+struct _GtkTableRowCol { | |
+ guint16 requisition; | |
+ guint16 allocation; | |
+ gint16 spacing; | |
+}; | |
+ | |
+#define GTK_OBJECT(obj) ((GtkObject *)(obj)) | |
+#define GTK_CONTAINER(obj) ((GtkContainer *)(obj)) | |
+#define GTK_PANED(obj) ((GtkPaned *)(obj)) | |
+#define GTK_VPANED(obj) ((GtkVPaned *)(obj)) | |
+#define GTK_HPANED(obj) ((GtkHPaned *)(obj)) | |
+#define GTK_BIN(obj) ((GtkBin *)(obj)) | |
+#define GTK_FRAME(obj) ((GtkFrame *)(obj)) | |
+#define GTK_BOX(obj) ((GtkBox *)(obj)) | |
+#define GTK_CLIST(obj) ((GtkCList *)(obj)) | |
+#define GTK_HBOX(obj) ((GtkHBox *)(obj)) | |
+#define GTK_VBOX(obj) ((GtkVBox *)(obj)) | |
+#define GTK_NOTEBOOK(obj) ((GtkNotebook *)(obj)) | |
+#define GTK_WIDGET(obj) ((GtkWidget *)(obj)) | |
+#define GTK_EDITABLE(obj) ((GtkEditable *)(obj)) | |
+#define GTK_ENTRY(obj) ((GtkEntry *)(obj)) | |
+#define GTK_SPIN_BUTTON(obj) ((GtkSpinButton *)(obj)) | |
+#define GTK_TEXT(obj) ((GtkText *)(obj)) | |
+#define GTK_WINDOW(obj) ((GtkWindow *)(obj)) | |
+#define GTK_BUTTON(obj) ((GtkButton *)(obj)) | |
+#define GTK_TOGGLE_BUTTON(obj) ((GtkToggleButton *)(obj)) | |
+#define GTK_RADIO_BUTTON(obj) ((GtkRadioButton *)(obj)) | |
+#define GTK_CHECK_BUTTON(obj) ((GtkCheckButton *)(obj)) | |
+#define GTK_LABEL(obj) ((GtkLabel *)(obj)) | |
+#define GTK_TABLE(obj) ((GtkTable *)(obj)) | |
+#define GTK_MENU_SHELL(obj) ((GtkMenuShell *)(obj)) | |
+#define GTK_MENU_BAR(obj) ((GtkMenuBar *)(obj)) | |
+#define GTK_MENU_ITEM(obj) ((GtkMenuItem *)(obj)) | |
+#define GTK_MENU(obj) ((GtkMenu *)(obj)) | |
+#define GTK_SIGNAL_FUNC(f) ((GtkSignalFunc) f) | |
+ | |
+#define GTK_OBJECT_FLAGS(obj) (GTK_OBJECT(obj)->flags) | |
+#define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS(wid)) | |
+#define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS(wid)>K_REALIZED) != 0) | |
+#define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS(wid)>K_VISIBLE) != 0) | |
+#define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS(wid)>K_SENSITIVE) != 0) | |
+#define GTK_WIDGET_SET_FLAGS(wid,flag) (GTK_WIDGET_FLAGS(wid) |= (flag)) | |
+#define GTK_WIDGET_UNSET_FLAGS(wid,flag) (GTK_WIDGET_FLAGS(wid) &= ~(flag)) | |
+ | |
+typedef int GdkEvent; | |
+ | |
+void gtk_widget_show(GtkWidget *widget); | |
+void gtk_widget_show_all(GtkWidget *widget); | |
+void gtk_widget_hide(GtkWidget *widget); | |
+void gtk_widget_destroy(GtkWidget *widget); | |
+void gtk_widget_realize(GtkWidget *widget); | |
+void gtk_widget_set_sensitive(GtkWidget *widget,gboolean sensitive); | |
+void gtk_widget_size_request(GtkWidget *widget,GtkRequisition *requisition); | |
+void gtk_widget_set_size(GtkWidget *widget,GtkAllocation *allocation); | |
+GtkWidget *gtk_widget_get_ancestor(GtkWidget *widget,GtkType type); | |
+GtkWidget *gtk_window_new(GtkWindowType type); | |
+void gtk_window_set_title(GtkWindow *window,const gchar *title); | |
+void gtk_window_set_default_size(GtkWindow *window,gint width,gint height); | |
+void gtk_window_set_transient_for(GtkWindow *window,GtkWindow *parent); | |
+void gtk_container_add(GtkContainer *container,GtkWidget *widget); | |
+void gtk_container_set_border_width(GtkContainer *container,guint border_width… | |
+GtkWidget *gtk_button_new_with_label(const gchar *label); | |
+GtkWidget *gtk_label_new(const gchar *text); | |
+GtkWidget *gtk_hbox_new(gboolean homogeneous,gint spacing); | |
+GtkWidget *gtk_vbox_new(gboolean homogeneous,gint spacing); | |
+GtkWidget *gtk_check_button_new_with_label(const gchar *label); | |
+GtkWidget *gtk_radio_button_new_with_label(GSList *group,const gchar *label); | |
+GtkWidget *gtk_radio_button_new_with_label_from_widget(GtkRadioButton *group, | |
+ const gchar *label); | |
+GtkWidget *gtk_frame_new(const gchar *text); | |
+GtkWidget *gtk_text_new(GtkAdjustment *hadj,GtkAdjustment *vadj); | |
+GtkWidget *gtk_scrolled_text_new(GtkAdjustment *hadj,GtkAdjustment *vadj, | |
+ GtkWidget **pack_widg); | |
+GtkWidget *gtk_entry_new(); | |
+GtkWidget *gtk_table_new(guint rows,guint cols,gboolean homogeneous); | |
+GtkItemFactory *gtk_item_factory_new(GtkType container_type, | |
+ const gchar *path, | |
+ GtkAccelGroup *accel_group); | |
+void gtk_item_factory_create_item(GtkItemFactory *ifactory, | |
+ GtkItemFactoryEntry *entry, | |
+ gpointer callback_data,guint callback_type); | |
+void gtk_item_factory_create_items(GtkItemFactory *ifactory,guint n_entries, | |
+ GtkItemFactoryEntry *entries, | |
+ gpointer callback_data); | |
+GtkWidget *gtk_item_factory_get_widget(GtkItemFactory *ifactory, | |
+ const gchar *path); | |
+GtkWidget *gtk_clist_new(gint columns); | |
+GtkWidget *gtk_clist_new_with_titles(gint columns,gchar *titles[]); | |
+gint gtk_clist_append(GtkCList *clist,gchar *text[]); | |
+void gtk_clist_set_column_title(GtkCList *clist,gint column,const gchar *title… | |
+gint gtk_clist_insert(GtkCList *clist,gint row,gchar *text[]); | |
+void gtk_clist_set_column_width(GtkCList *clist,gint column,gint width); | |
+void gtk_clist_column_title_passive(GtkCList *clist,gint column); | |
+void gtk_clist_column_titles_passive(GtkCList *clist); | |
+void gtk_clist_set_selection_mode(GtkCList *clist,GtkSelectionMode mode); | |
+void gtk_clist_sort(GtkCList *clist); | |
+void gtk_clist_freeze(GtkCList *clist); | |
+void gtk_clist_thaw(GtkCList *clist); | |
+void gtk_clist_clear(GtkCList *clist); | |
+GSList *gtk_radio_button_group(GtkRadioButton *radio_button); | |
+void gtk_editable_insert_text(GtkEditable *editable,const gchar *new_text, | |
+ gint new_text_length,gint *position); | |
+void gtk_editable_delete_text(GtkEditable *editable, | |
+ gint start_pos,gint end_pos); | |
+gchar *gtk_editable_get_chars(GtkEditable *editable, | |
+ gint start_pos,gint end_pos); | |
+void gtk_editable_set_editable(GtkEditable *editable,gboolean is_editable); | |
+void gtk_editable_set_position(GtkEditable *editable,gint position); | |
+gint gtk_editable_get_position(GtkEditable *editable); | |
+guint gtk_text_get_length(GtkText *text); | |
+void gtk_text_set_editable(GtkText *text,gboolean is_editable); | |
+void gtk_text_set_word_wrap(GtkText *text,gboolean word_wrap); | |
+void gtk_text_freeze(GtkText *text); | |
+void gtk_text_thaw(GtkText *text); | |
+void gtk_table_attach(GtkTable *table,GtkWidget *widget, | |
+ guint left_attach,guint right_attach, | |
+ guint top_attach,guint bottom_attach, | |
+ GtkAttachOptions xoptions,GtkAttachOptions yoptions, | |
+ guint xpadding,guint ypadding); | |
+void gtk_table_attach_defaults(GtkTable *table,GtkWidget *widget, | |
+ guint left_attach,guint right_attach, | |
+ guint top_attach,guint bottom_attach); | |
+void gtk_table_set_row_spacing(GtkTable *table,guint row,guint spacing); | |
+void gtk_table_set_col_spacing(GtkTable *table,guint column,guint spacing); | |
+void gtk_table_set_row_spacings(GtkTable *table,guint spacing); | |
+void gtk_table_set_col_spacings(GtkTable *table,guint spacing); | |
+void gtk_box_pack_start(GtkBox *box,GtkWidget *child,gboolean Expand, | |
+ gboolean Fill,gint Padding); | |
+void gtk_toggle_button_toggled(GtkToggleButton *toggle_button); | |
+gboolean gtk_toggle_button_get_active(GtkToggleButton *toggle_button); | |
+void gtk_toggle_button_set_active(GtkToggleButton *toggle_button, | |
+ gboolean is_active); | |
+void gtk_main_quit(); | |
+void gtk_main(); | |
+guint gtk_signal_connect(GtkObject *object,const gchar *name, | |
+ GtkSignalFunc func,gpointer func_data); | |
+guint gtk_signal_connect_object(GtkObject *object,const gchar *name, | |
+ GtkSignalFunc func,GtkObject *slot_object); | |
+void gtk_signal_emit(GtkObject *object,const gchar *name, ...); | |
+void win32_init(HINSTANCE hInstance,HINSTANCE hPrevInstance); | |
+void gtk_menu_shell_insert(GtkMenuShell *menu_shell,GtkWidget *child, | |
+ gint position); | |
+void gtk_menu_shell_append(GtkMenuShell *menu_shell,GtkWidget *child); | |
+void gtk_menu_shell_prepend(GtkMenuShell *menu_shell,GtkWidget *child); | |
+GtkWidget *gtk_menu_bar_new(); | |
+void gtk_menu_bar_insert(GtkMenuBar *menu_bar,GtkWidget *child,gint position); | |
+void gtk_menu_bar_append(GtkMenuBar *menu_bar,GtkWidget *child); | |
+void gtk_menu_bar_prepend(GtkMenuBar *menu_bar,GtkWidget *child); | |
+GtkWidget *gtk_menu_new(); | |
+void gtk_menu_insert(GtkMenu *menu,GtkWidget *child,gint position); | |
+void gtk_menu_append(GtkMenu *menu,GtkWidget *child); | |
+void gtk_menu_prepend(GtkMenu *menu,GtkWidget *child); | |
+GtkWidget *gtk_menu_item_new_with_label(const gchar *label); | |
+void gtk_menu_item_set_submenu(GtkMenuItem *menu_item,GtkWidget *submenu); | |
+GtkWidget *gtk_notebook_new(); | |
+void gtk_notebook_append_page(GtkNotebook *notebook,GtkWidget *child, | |
+ GtkWidget *tab_label); | |
+void gtk_notebook_insert_page(GtkNotebook *notebook,GtkWidget *child, | |
+ GtkWidget *tab_label,gint position); | |
+void gtk_notebook_set_page(GtkNotebook *notebook,gint page_num); | |
+GtkObject *gtk_adjustment_new(gfloat value,gfloat lower,gfloat upper, | |
+ gfloat step_increment,gfloat page_increment, | |
+ gfloat page_size); | |
+GtkWidget *gtk_spin_button_new(GtkAdjustment *adjustment,gfloat climb_rate, | |
+ guint digits); | |
+void gdk_input_remove(gint tag); | |
+gint gdk_input_add(gint source,GdkInputCondition condition, | |
+ GdkInputFunction function,gpointer data); | |
+GtkWidget *gtk_hseparator_new(); | |
+GtkWidget *gtk_vseparator_new(); | |
+void gtk_object_set_data(GtkObject *object,const gchar *key,gpointer data); | |
+gpointer gtk_object_get_data(GtkObject *object,const gchar *key); | |
+GtkAccelGroup *gtk_accel_group_new(); | |
+void gtk_item_factory_set_translate_func(GtkItemFactory *ifactory, | |
+ GtkTranslateFunc func, | |
+ gpointer data, | |
+ GtkDestroyNotify notify); | |
+void gtk_widget_grab_default(GtkWidget *widget); | |
+void gtk_widget_grab_focus(GtkWidget *widget); | |
+void gtk_window_set_modal(GtkWindow *window,gboolean modal); | |
+void gtk_window_add_accel_group(GtkWindow *window,GtkAccelGroup *accel_group); | |
+void gtk_entry_set_text(GtkEntry *entry,const gchar *text); | |
+void gtk_widget_add_accelerator(GtkWidget *widget, | |
+ const gchar *accel_signal, | |
+ GtkAccelGroup *accel_group, | |
+ guint accel_key,guint accel_mods); | |
+void gtk_widget_remove_accelerator(GtkWidget *widget, | |
+ GtkAccelGroup *accel_group, | |
+ guint accel_key,guint accel_mods); | |
+guint SetAccelerator(GtkWidget *labelparent,gchar *Text, | |
+ GtkWidget *sendto,gchar *signal, | |
+ GtkAccelGroup *accel_group); | |
+ | |
+extern const GtkType GTK_TYPE_WINDOW,GTK_TYPE_MENU_BAR; | |
+GtkWidget *gtk_vpaned_new(); | |
+GtkWidget *gtk_hpaned_new(); | |
+void gtk_paned_add1(GtkPaned *paned,GtkWidget *child); | |
+void gtk_paned_add2(GtkPaned *paned,GtkWidget *child); | |
+void gtk_paned_pack1(GtkPaned *paned,GtkWidget *child,gboolean resize, | |
+ gboolean shrink); | |
+void gtk_paned_pack2(GtkPaned *paned,GtkWidget *child,gboolean resize, | |
+ gboolean shrink); | |
+ | |
+#define gtk_container_border_width gtk_container_set_border_width | |
+#define gtk_hbutton_box_new() gtk_hbox_new(TRUE,5) | |
+#define gtk_vbutton_box_new() gtk_vbox_new(TRUE,5) | |
+ | |
+#endif | |
diff --git a/src/gtk_client.c b/src/gtk_client.c | |
t@@ -22,12 +22,17 @@ | |
#include <config.h> | |
#endif | |
-#ifdef GTK_CLIENT | |
+#ifdef GUI_CLIENT | |
#include <stdlib.h> | |
#include <string.h> | |
+ | |
+#ifdef CYGWIN | |
+#include "gtk.h" | |
+#else | |
#include <gtk/gtk.h> | |
#include <gdk/gdkkeysyms.h> | |
+#endif | |
#include "dopeos.h" | |
#include "dopewars.h" | |
t@@ -40,11 +45,19 @@ | |
#define BT_SELL (GINT_TO_POINTER(2)) | |
#define BT_DROP (GINT_TO_POINTER(3)) | |
+ | |
+#ifndef CYGWIN | |
#define MB_OK 1 | |
#define MB_CANCEL 2 | |
#define MB_YES 4 | |
#define MB_NO 8 | |
+#define MB_YESNO (MB_YES|MB_NO) | |
+#define IDOK 1 | |
+#define IDCANCEL 2 | |
+#define IDYES 4 | |
+#define IDNO 8 | |
#define MB_MAX 4 | |
+#endif | |
#define ET_SPY 0 | |
#define ET_TIPOFF 1 | |
t@@ -112,8 +125,10 @@ static void Jet(); | |
static void DealDrugs(GtkWidget *widget,gpointer data); | |
static void DealGuns(GtkWidget *widget,gpointer data); | |
static void QuestionDialog(char *Data,Player *From); | |
-static gint MessageBox(GtkWidget *parent,const gchar *Title, | |
- const gchar *Text,gint Options); | |
+#ifndef CYGWIN | |
+static gint MessageBox(GtkWidget *parent,const gchar *Text, | |
+ const gchar *Title,gint Options); | |
+#endif | |
static void TransferDialog(gboolean Debt); | |
static void ListPlayers(GtkWidget *widget,gpointer data); | |
static void TalkToAll(GtkWidget *widget,gpointer data); | |
t@@ -165,8 +180,9 @@ static gchar *MenuTranslate(const gchar *path,gpointer fun… | |
static void LogMessage(const gchar *log_domain,GLogLevelFlags log_level, | |
const gchar *message,gpointer user_data) { | |
- MessageBox(NULL,log_level&G_LOG_LEVEL_WARNING ? _("Warning") : _("Message"), | |
- message,MB_OK); | |
+ MessageBox(NULL,message, | |
+ log_level&G_LOG_LEVEL_WARNING ? _("Warning") : _("Message"), | |
+ MB_OK); | |
} | |
#ifndef CYGWIN | |
t@@ -185,8 +201,8 @@ static guint SetAccelerator(GtkWidget *labelparent,gchar *… | |
void QuitGame(GtkWidget *widget,gpointer data) { | |
if (!InGame || | |
- MessageBox(ClientData.window,_("Quit Game"),_("Abandon current game?"), | |
- MB_YES|MB_NO)==MB_YES) { | |
+ MessageBox(ClientData.window,_("Abandon current game?"),_("Quit Game"), | |
+ MB_YESNO)==IDYES) { | |
gtk_main_quit(); | |
} | |
} | |
t@@ -196,15 +212,15 @@ void DestroyGtk(GtkWidget *widget,gpointer data) { | |
} | |
gint MainDelete(GtkWidget *widget,GdkEvent *event,gpointer data) { | |
- return (InGame && MessageBox(ClientData.window,_("Quit Game"), | |
- _("Abandon current game?"),MB_YES|MB_NO)==MB_NO); | |
+ return (InGame && MessageBox(ClientData.window,_("Abandon current game?"), | |
+ _("Quit Game"),MB_YESNO)==IDNO); | |
} | |
void NewGame(GtkWidget *widget,gpointer data) { | |
if (InGame) { | |
- if (MessageBox(ClientData.window,_("Start new game"), | |
- _("Abandon current game?"),MB_YES|MB_NO)==MB_YES) EndGame(); | |
+ if (MessageBox(ClientData.window,_("Abandon current game?"), | |
+ _("Start new game"),MB_YESNO)==IDYES) EndGame(); | |
else return; | |
} | |
NewGameDialog(); | |
t@@ -519,6 +535,22 @@ static void FightCallback(GtkWidget *widget,gpointer data… | |
} | |
} | |
+#ifndef CYGWIN | |
+static GtkWidget *gtk_scrolled_text_new(GtkAdjustment *hadj,GtkAdjustment *vad… | |
+ GtkWidget **pack_widg) { | |
+ GtkWidget *hbox,*text,*vscroll; | |
+ GtkAdjustment *adj; | |
+ hbox=gtk_hbox_new(FALSE,0); | |
+ adj=(GtkAdjustment *)gtk_adjustment_new(0.0,0.0,100.0,1.0,10.0,10.0); | |
+ text=gtk_text_new(NULL,adj); | |
+ gtk_box_pack_start(GTK_BOX(hbox),text,TRUE,TRUE,0); | |
+ vscroll=gtk_vscrollbar_new(adj); | |
+ gtk_box_pack_start(GTK_BOX(hbox),vscroll,FALSE,FALSE,0); | |
+ *pack_widg=hbox; | |
+ return text; | |
+} | |
+#endif | |
+ | |
static GtkWidget *AddFightButton(gchar *Text,GtkAccelGroup *accel_group, | |
GtkBox *box,gint Answer) { | |
GtkWidget *button; | |
t@@ -532,8 +564,7 @@ static GtkWidget *AddFightButton(gchar *Text,GtkAccelGroup… | |
} | |
static void CreateFightDialog() { | |
- GtkWidget *dialog,*vbox,*button,*hbox,*hbbox,*hsep,*text,*vscroll; | |
- GtkAdjustment *adj; | |
+ GtkWidget *dialog,*vbox,*button,*hbox,*hbbox,*hsep,*text; | |
GtkAccelGroup *accel_group; | |
gchar *buf; | |
t@@ -552,16 +583,11 @@ static void CreateFightDialog() { | |
vbox=gtk_vbox_new(FALSE,7); | |
- hbox=gtk_hbox_new(FALSE,0); | |
- adj=(GtkAdjustment *)gtk_adjustment_new(0.0,0.0,100.0,1.0,10.0,10.0); | |
- text=gtk_text_new(NULL,adj); | |
- gtk_object_set_data(GTK_OBJECT(dialog),"text",text); | |
+ text=gtk_scrolled_text_new(NULL,NULL,&hbox); | |
+ | |
gtk_text_set_editable(GTK_TEXT(text),FALSE); | |
gtk_text_set_word_wrap(GTK_TEXT(text),TRUE); | |
gtk_object_set_data(GTK_OBJECT(dialog),"text",text); | |
- gtk_box_pack_start(GTK_BOX(hbox),text,TRUE,TRUE,0); | |
- vscroll=gtk_vscrollbar_new(adj); | |
- gtk_box_pack_start(GTK_BOX(hbox),vscroll,FALSE,FALSE,0); | |
gtk_widget_show_all(hbox); | |
gtk_box_pack_start(GTK_BOX(vbox),hbox,TRUE,TRUE,0); | |
t@@ -1130,24 +1156,24 @@ void DealGuns(GtkWidget *widget,gpointer data) { | |
if (data!=BT_BUY && TotalGunsCarried(ClientData.Play)==0) { | |
dpg_string_sprintf(text,_("You don't have any %tde!"),Names.Guns); | |
- MessageBox(dialog,Title,text->str,MB_OK); | |
+ MessageBox(dialog,text->str,Title,MB_OK); | |
} else if (data==BT_BUY && TotalGunsCarried(ClientData.Play) >= | |
ClientData.Play->Bitches.Carried+2) { | |
dpg_string_sprintf(text, | |
_("You'll need more %tde to carry any more %tde!"), | |
Names.Bitches,Names.Guns); | |
- MessageBox(dialog,Title,text->str,MB_OK); | |
+ MessageBox(dialog,text->str,Title,MB_OK); | |
} else if (data==BT_BUY && Gun[GunInd].Space > ClientData.Play->CoatSize) { | |
dpg_string_sprintf(text, | |
_("You don't have enough space to carry that %tde!"), | |
Names.Gun); | |
- MessageBox(dialog,Title,text->str,MB_OK); | |
+ MessageBox(dialog,text->str,Title,MB_OK); | |
} else if (data==BT_BUY && Gun[GunInd].Price > ClientData.Play->Cash) { | |
dpg_string_sprintf(text,_("You don't have enough cash to buy that %tde!"… | |
Names.Gun); | |
- MessageBox(dialog,Title,text->str,MB_OK); | |
+ MessageBox(dialog,text->str,Title,MB_OK); | |
} else if (data==BT_SELL && ClientData.Play->Guns[GunInd].Carried == 0) { | |
- MessageBox(dialog,Title,_("You don't have any to sell!"),MB_OK); | |
+ MessageBox(dialog,_("You don't have any to sell!"),Title,MB_OK); | |
} else { | |
g_string_sprintf(text,"gun^%d^%d",GunInd,data==BT_BUY ? 1 : -1); | |
SendClientMessage(ClientData.Play,C_NONE,C_BUYOBJECT,NULL,text->str); | |
t@@ -1375,7 +1401,11 @@ void SetJetButtonTitle(GtkAccelGroup *accel_group) { | |
_("_Fight") : _("_Jet!"),button,"clicked",accel_group); | |
} | |
+#ifdef CYGWIN | |
+char GtkLoop(HINST hInstance,HINST hPrevInstance) { | |
+#else | |
char GtkLoop(int *argc,char **argv[],char ReturnOnFail) { | |
+#endif | |
GtkWidget *window,*vbox,*vbox2,*hbox,*frame,*table,*menubar,*text, | |
*vpaned,*button,*vscroll,*clist; | |
GtkAccelGroup *accel_group; | |
t@@ -1383,9 +1413,13 @@ char GtkLoop(int *argc,char **argv[],char ReturnOnFail)… | |
GtkAdjustment *adj; | |
gint nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]); | |
+#ifdef CYGWIN | |
+ win32_init(hInstance,hPrevInstance); | |
+#else | |
gtk_set_locale(); | |
if (ReturnOnFail && !gtk_init_check(argc,argv)) return FALSE; | |
else if (!ReturnOnFail) gtk_init(argc,argv); | |
+#endif | |
/* Set up message handlers */ | |
ClientMessageHandlerPt = HandleClientMessage; | |
t@@ -1848,6 +1882,7 @@ void NewGameDialog() { | |
gtk_widget_show_all(widgets.dialog); | |
} | |
+#ifndef CYGWIN | |
static void DestroyMessageBox(GtkWidget *widget,gpointer data) { | |
gtk_main_quit(); | |
} | |
t@@ -1861,8 +1896,8 @@ static void MessageBoxCallback(GtkWidget *widget,gpointe… | |
gtk_widget_destroy(dialog); | |
} | |
-gint MessageBox(GtkWidget *parent,const gchar *Title, | |
- const gchar *Text,gint Options) { | |
+gint MessageBox(GtkWidget *parent,const gchar *Text, | |
+ const gchar *Title,gint Options) { | |
GtkWidget *dialog,*button,*label,*vbox,*hbbox,*hsep; | |
GtkAccelGroup *accel_group; | |
gint i; | |
t@@ -1912,6 +1947,7 @@ gint MessageBox(GtkWidget *parent,const gchar *Title, | |
gtk_main(); | |
return retval; | |
} | |
+#endif | |
static void SendDoneMessage(GtkWidget *widget,gpointer data) { | |
SendClientMessage(ClientData.Play,C_NONE,C_DONE,NULL,NULL); | |
t@@ -1946,15 +1982,14 @@ static void TransferOK(GtkWidget *widget,GtkWidget *di… | |
money=-money; | |
} | |
if (-money>ClientData.Play->Bank) { | |
- MessageBox(dialog,"Bank", | |
- _("There isn't that much money in the bank..."), | |
- MB_OK); | |
+ MessageBox(dialog,_("There isn't that much money in the bank..."), | |
+ "Bank",MB_OK); | |
return; | |
} | |
} | |
if (money>ClientData.Play->Cash) { | |
- MessageBox(dialog,Debt ? "Pay loan" : "Bank", | |
- _("You don't have that much money!"),MB_OK); | |
+ MessageBox(dialog,_("You don't have that much money!"), | |
+ Debt ? "Pay loan" : "Bank",MB_OK); | |
return; | |
} | |
text=pricetostr(money); | |
t@@ -2334,7 +2369,7 @@ void SackBitch(GtkWidget *widget,gpointer data) { | |
text=dpg_strdup_printf(_("Are you sure? (Any %tde or %tde carried\n" | |
"by this %tde may be lost!)"),Names.Guns, | |
Names.Drugs,Names.Bitch); | |
- if (MessageBox(ClientData.window,title,text,MB_YES|MB_NO)==MB_YES) { | |
+ if (MessageBox(ClientData.window,text,title,MB_YESNO)==IDYES) { | |
SendClientMessage(ClientData.Play,C_NONE,C_SACKBITCH,NULL,NULL); | |
} | |
g_free(text); g_free(title); | |
t@@ -2608,11 +2643,11 @@ void DisplaySpyReports(Player *Play) { | |
char GtkLoop(int *argc,char **argv[],char ReturnOnFail) { | |
if (!ReturnOnFail) { | |
- g_print(_("No GTK+ client available - rebuild the binary passing the\n" | |
- "--enable-gtk-client option to configure, or use the curses\n" | |
- "client (if available) instead!\n")); | |
+ g_print(_("No graphical client available - rebuild the binary passing\n" | |
+ "the --enable-gui-client option to configure, or use the\n" | |
+ "curses client (if available) instead!\n")); | |
} | |
return FALSE; | |
} | |
-#endif /* GTK_CLIENT */ | |
+#endif /* GUI_CLIENT */ | |
diff --git a/src/win32_client.c b/src/win32_client.c | |
t@@ -38,6 +38,8 @@ | |
#include "message.h" | |
#include "serverside.h" | |
+#include "gtk.c" | |
+ | |
#ifdef WIN32_CLIENT | |
#define WM_SOCKETDATA (WM_USER+100) | |
t@@ -1789,6 +1791,8 @@ int APIENTRY Win32Loop(HINSTANCE hInstance,HINSTANCE hPr… | |
StopNetworking(); | |
return msg.wParam; | |
} | |
+#elif GUI_CLIENT | |
+ GtkLoop(hInstance,hPrevInstance); | |
#else | |
g_print("No windowed client available - rebuild the binary passing the\n" | |
"--enable-win32-client option to configure, or use the curses\n" |