Index: ChangeLog =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/ChangeLog,v retrieving revision 1.189 diff -u -p -r1.189 ChangeLog --- ChangeLog 14 Aug 2003 11:36:17 -0000 1.189 +++ ChangeLog 18 Aug 2003 01:21:50 -0000 @@ -1,3 +1,29 @@ +2003-08-17 Jason Long + + THIS IS THE GTK2 UPGRADE + + * configure.in: remove references to macros directory and + add checks for Gnome2 + * client/Makefile.am, common/Makefile.am, server/Makefile.am, + ai/Makefile.am, meta-server/Makefile.am: + use GNOME2_CFLAGS and GNOME2_LIBS or GLIB2_LIBS for INCLUDES + and LDADD + * client/connect.c: don't destroy cserver_dlg a second time + * client/gui.c (gui_draw_hex, gui_draw_edge, gui_highlight_chits, + expose_map_cb), client/guimap.c (redraw_node): fixed some + drawing issues (Gnocatan was trying to draw to the backing + store before it was created) + * client/gui.c (build_messages_panel), common/common_gtk.c, + server/gnocatan-server-gtk.c (build_interface): use + GtkTextView instead of deprecated GtkText + * client/gui.c (register_gnocatan_pixmaps): use GtkIconFactory + instead of deprecated gnome_stock_pixmap_register + * client/guimap.c (guimap_terrain), client/theme.c: use + GdkPixbuf instead of Imlib + * client/config-gnome.c, client/gui.c, client/i18n.c, + client/identity.c, server/gnocatan-server-gtk.c: miscellaneous + changes for Gnome2 + 2003-08-14 Bas Wijnen * server/gold.c, client/gold.c: fixed bug that gold was not taken out of the bank. Added support for giving out gold during setup. Fixed Index: Makefile.am =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/Makefile.am,v retrieving revision 1.7 diff -u -p -r1.7 Makefile.am --- Makefile.am 11 Jan 2003 03:50:54 -0000 1.7 +++ Makefile.am 18 Aug 2003 01:21:50 -0000 @@ -1,10 +1,4 @@ -SUBDIRS = po intl macros common client server meta-server ai docs - -## to automatically rebuild aclocal.m4 if any of the macros in -## `macros/' change -@MAINT@include macros/macros.dep -@MAINT@macros/macros.dep: macros/Makefile.am -@MAINT@ cd macros && $(MAKE) macros.dep +SUBDIRS = po intl common client server meta-server ai docs EXTRA_DIST = autogen.sh gnocatan.spec Index: configure.in =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/configure.in,v retrieving revision 1.28 diff -u -p -r1.28 configure.in --- configure.in 2 Aug 2003 18:12:25 -0000 1.28 +++ configure.in 18 Aug 2003 01:21:50 -0000 @@ -1,28 +1,21 @@ AC_INIT AC_PREREQ(2.50) AC_CONFIG_SRCDIR([client]) -AC_PREFIX_DEFAULT([`gnome-config --prefix 2>/dev/null || echo /usr/local`]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE([gnocatan], [0.8.0.0]) -PROTOCOL_VERSION=\"0.8.0\" -META_PROTOCOL_VERSION=\"1.0\" +PROTOCOL_VERSION="\"0.8.0\"" +META_PROTOCOL_VERSION="\"1.0\"" AM_MAINTAINER_MODE -AM_ACLOCAL_INCLUDE(macros) - AC_ISC_POSIX AC_PROG_CC AC_PROG_CPP AC_HEADER_STDC([]) AM_PROG_LIBTOOL -GNOME_INIT -GNOME_COMPILE_WARNINGS -AM_PATH_GLIB - AC_TRY_LINK_FUNC(g_rand_new_with_seed, [AC_DEFINE(HAVE_G_RAND_NEW_WITH_SEED, [], [Define if there is a g_rand() function in glib.])], @@ -48,14 +41,32 @@ AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, $PR AC_DEFINE_UNQUOTED(META_PROTOCOL_VERSION, $META_PROTOCOL_VERSION, [Protocol version used by the meta server]) -dnl GNOME_SUPPORT_CHECKS - ## internationalization support ALL_LINGUAS="de es" AM_GNU_GETTEXT(use-libtool) AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) AC_DEFINE_UNQUOTED(ALL_LINGUAS, "$ALL_LINGUAS", [Available languages]) -AC_CONFIG_FILES([Makefile po/Makefile.in intl/Makefile macros/Makefile common/Makefile client/Makefile client/help/Makefile client/help/C/Makefile server/Makefile meta-server/Makefile ai/Makefile docs/Makefile stamp.h]) +# gnome-2.0 support +PKG_CHECK_MODULES(GNOME2, libgnomeui-2.0) +AC_SUBST(GNOME2_CFLAGS) +AC_SUBST(GNOME2_LIBS) + +PKG_CHECK_MODULES(GLIB2, glib-2.0) +AC_SUBST(GLIB2_LIBS) + +AC_CONFIG_FILES([ + Makefile + po/Makefile.in + intl/Makefile + common/Makefile + client/Makefile + client/help/Makefile + client/help/C/Makefile + server/Makefile + meta-server/Makefile + ai/Makefile + docs/Makefile + stamp.h]) dnl AC_CONFIG_COMMANDS([default],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) AC_OUTPUT Index: ai/Makefile.am =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/ai/Makefile.am,v retrieving revision 1.4 diff -u -p -r1.4 Makefile.am --- ai/Makefile.am 12 Jan 2003 19:55:19 -0000 1.4 +++ ai/Makefile.am 18 Aug 2003 01:21:51 -0000 @@ -8,7 +8,8 @@ INCLUDES = \ -I$(srcdir)/../common -I. \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ $(ADMIN_GTK) \ - -I$(includedir) $(GNOME_INCLUDEDIR) + -I$(includedir) \ + $(GNOME2_CFLAGS) gnocatanai_SOURCES = \ ai.c \ @@ -33,7 +34,7 @@ gnocatanai_SOURCES = \ gnocatanai_LDADD = \ ../common/libgnocatan.a \ ../common/libgnocatan_gtk.a \ - $(GLIB_LIBS) + $(GLIB2_LIBS) config_DATA = \ computer_names Index: client/Makefile.am =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/Makefile.am,v retrieving revision 1.21 diff -u -p -r1.21 Makefile.am --- client/Makefile.am 14 Aug 2003 08:41:20 -0000 1.21 +++ client/Makefile.am 18 Aug 2003 01:21:51 -0000 @@ -3,8 +3,6 @@ appicondir=$(datadir)/pixmaps pixmapdir =$(datadir)/pixmaps/gnocatan Gamesdir=$(datadir)/gnome/apps/Games -CPPFLAGS += -DIMAGEDIR=\"$(imagedir)\" - SUBDIRS = help bin_PROGRAMS = gnocatan @@ -26,8 +24,10 @@ endif INCLUDES = \ -I$(srcdir)/../common -I. \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ + -DIMAGEDIR=\"$(imagedir)\" \ $(ADMIN_GTK) \ - -I$(includedir) $(GNOME_INCLUDEDIR) + -I$(includedir) \ + $(GNOME2_CFLAGS) EXTRA_gnocatan_SOURCES = $(ADMIN_GTK_FILES_INACTIVE) @@ -78,8 +78,7 @@ gnocatan_SOURCES = \ gnocatan_LDADD = \ ../common/libgnocatan.a \ ../common/libgnocatan_gtk.a \ - $(GNOME_LIBDIR) \ - $(GNOMEUI_LIBS) + $(GNOME2_LIBS) appicon_DATA = gnome-gnocatan.png Index: client/config-gnome.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/config-gnome.c,v retrieving revision 1.1 diff -u -p -r1.1 config-gnome.c --- client/config-gnome.c 19 Jul 2000 21:37:18 -0000 1.1 +++ client/config-gnome.c 18 Aug 2003 01:21:51 -0000 @@ -64,7 +64,6 @@ on the surface. */ #include -#include #include #include "config-gnome.h" Index: client/connect.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/connect.c,v retrieving revision 1.17 diff -u -p -r1.17 connect.c --- client/connect.c 24 Jan 2003 04:07:26 -0000 1.17 +++ client/connect.c 18 Aug 2003 01:21:51 -0000 @@ -215,7 +215,9 @@ static void meta_create_notify(NetEvent log_message( MSG_INFO, _("New game server started on %s port %s\n"), gtk_entry_get_text(GTK_ENTRY(server_entry)), gtk_entry_get_text(GTK_ENTRY(port_entry))); - gtk_widget_destroy(cserver_dlg); + /* cserver_dlg should already be deleted at this + * point */ + /*gtk_widget_destroy(cserver_dlg);*/ gtk_widget_destroy(meta_dlg); } else Index: client/gui.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/gui.c,v retrieving revision 1.30 diff -u -p -r1.30 gui.c --- client/gui.c 14 Aug 2003 08:41:20 -0000 1.30 +++ client/gui.c 18 Aug 2003 01:21:51 -0000 @@ -126,22 +126,26 @@ void gui_cursor_set(CursorType type, void gui_draw_hex(Hex *hex) { - guimap_draw_hex(gmap, hex); + if (gmap->pixmap != NULL) + guimap_draw_hex(gmap, hex); } void gui_draw_edge(Edge *edge) { - guimap_draw_edge(gmap, edge); + if (gmap->pixmap != NULL) + guimap_draw_edge(gmap, edge); } void gui_draw_node(Node *node) { - guimap_draw_node(gmap, node); + if (gmap->pixmap != NULL) + guimap_draw_node(gmap, node); } void gui_highlight_chits(gint roll) { - guimap_highlight_chits(gmap, roll); + if (gmap->pixmap != NULL) + guimap_highlight_chits(gmap, roll); } static gint expose_map_cb(GtkWidget *area, @@ -181,6 +185,7 @@ static gint configure_map_cb(GtkWidget * area->allocation.width, area->allocation.height); + gtk_widget_queue_draw(area); return FALSE; } @@ -260,7 +265,7 @@ static GtkWidget *build_messages_panel() GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - messages_txt = gtk_text_new(NULL, NULL); + messages_txt = gtk_text_view_new(); gtk_widget_show(messages_txt); gtk_container_add(GTK_CONTAINER(scroll_win), messages_txt); @@ -477,7 +482,7 @@ static void quit_cb(GtkWidget *widget, v static void settings_apply_cb(GnomePropertyBox *prop_box, gint page, gpointer data) { - GnomeDockItem *dock_item; + BonoboDockItem *dock_item; GtkWidget *toolbar; gint toolbar_style; gint color_chat; @@ -503,7 +508,7 @@ static void settings_apply_cb(GnomePrope dock_item = gnome_app_get_dock_item_by_name( GNOME_APP(app_window), GNOME_APP_TOOLBAR_NAME ); - toolbar = gnome_dock_item_get_child( dock_item ); + toolbar = bonobo_dock_item_get_child( dock_item ); gnome_config_set_int( "/gnocatan/settings/toolbar_style", toolbar_style ); @@ -901,10 +906,13 @@ static void help_about_cb(GtkWidget *wid about = gnome_about_new(_("The Gnocatan Game"), VERSION, _("(C) 2002 the Free Software Foundation"), - authors, _("Gnocatan is based upon the excellent" " Settlers of Catan board game"), - NULL); + authors, + NULL, /* documenters */ + NULL, /* translators */ + NULL /* logo */ + ); gtk_widget_show(about); } @@ -1099,16 +1107,23 @@ static void register_gnocatan_pixmaps() { gint idx; + GtkIconFactory *factory = gtk_icon_factory_new(); + for (idx = 0; idx < numElem(gnocatan_pixmaps); idx++) { - GnomeStockPixmapEntryPath *entry; + GtkIconSource *source; + GtkIconSet *icon; - entry = g_malloc0(sizeof(*entry)); - entry->type = GNOME_STOCK_PIXMAP_TYPE_PATH; - entry->pathname = gnome_pixmap_file(gnocatan_pixmaps[idx]); - gnome_stock_pixmap_register(gnocatan_pixmaps[idx], - GNOME_STOCK_PIXMAP_REGULAR, - (GnomeStockPixmapEntry *)entry); + source = gtk_icon_source_new(); + gtk_icon_source_set_filename(source, + gnome_pixmap_file(gnocatan_pixmaps[idx])); + icon = gtk_icon_set_new(); + gtk_icon_set_add_source(icon, source); + gtk_icon_factory_add(factory, + gnocatan_pixmaps[idx], + icon); } + + gtk_icon_factory_add_default(factory); } static gint hotkeys_handler (GtkWidget *w, GdkEvent *e, gpointer data) @@ -1165,7 +1180,7 @@ GtkWidget* gui_build_interface() { gint toolbar_style; gboolean default_returned; - GnomeDockItem *dock_item; + BonoboDockItem *dock_item; GtkWidget *toolbar; player_init(); @@ -1222,7 +1237,7 @@ GtkWidget* gui_build_interface() and set its style from what was saved. */ dock_item = gnome_app_get_dock_item_by_name( GNOME_APP(app_window), GNOME_APP_TOOLBAR_NAME ); - toolbar = gnome_dock_item_get_child( dock_item ); + toolbar = bonobo_dock_item_get_child( dock_item ); gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), toolbar_style ); /* Allow grow and shrink, but don't auto-shrink */ Index: client/guimap.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/guimap.c,v retrieving revision 1.8 diff -u -p -r1.8 guimap.c --- client/guimap.c 2 Aug 2003 18:12:25 -0000 1.8 +++ client/guimap.c 18 Aug 2003 01:21:51 -0000 @@ -43,20 +43,37 @@ GdkPixmap *guimap_terrain(Terrain terrai return get_theme()->terrain_tiles[terrain]; } -void load_pixmap(gchar *name, GdkPixmap **pixmap, GdkBitmap **mask) +void load_pixmap(gchar *name, GdkPixmap **pixmap_return, + GdkBitmap **mask_return) { - gchar *file = g_strconcat(IMAGEDIR "/", name, NULL); + GdkPixbuf *pixbuf; + gchar *file; - if (!g_file_exists(file)) { - g_error(_("Could not find \'%s\' pixmap file.\n"), file); - exit(1); - } - gdk_imlib_load_file_to_pixmap(file, pixmap, mask); - if (!*pixmap) { - g_error(_("Could not load \'%s\' pixmap file.\n"), file); - exit(1); - } - g_free(file); + g_return_if_fail(name != NULL); + g_return_if_fail(pixmap_return != NULL); + + /* check that file exists */ + file = g_strconcat(IMAGEDIR "/", name, NULL); + if (!g_file_exists(file)) { + g_error(_("Could not find \'%s\' pixmap file.\n"), file); + exit(1); + } + + /* load pixmap/mask */ + pixbuf = gdk_pixbuf_new_from_file(file, NULL); + if (pixbuf != NULL) { + *pixmap_return = NULL; + gdk_pixbuf_render_pixmap_and_mask(pixbuf, + pixmap_return, mask_return, 1); + gdk_pixbuf_unref(pixbuf); + } + + /* check result */ + if (pixbuf == NULL || *pixmap_return == NULL) { + g_error(_("Could not load \'%s\' pixmap file.\n"), file); + exit(1); + } + g_free(file); } GuiMap *guimap_new() @@ -1048,6 +1065,10 @@ static void redraw_node(GuiMap *gmap, No int idx; if (node == NULL) + return; + + /* don't do anything if pixmap is not ready */ + if (gmap->pixmap == NULL) return; poly_bound_rect(poly, 1, &rect); Index: client/i18n.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/i18n.c,v retrieving revision 1.1 diff -u -p -r1.1 i18n.c --- client/i18n.c 6 Jun 2002 21:13:37 -0000 1.1 +++ client/i18n.c 18 Aug 2003 01:21:51 -0000 @@ -56,7 +56,6 @@ void init_nls(void) } g_free(linguas); - gnome_i18n_init(); saved_lang = config_get_string("settings/language",&novar); if (!novar && (ld = find_lang_desc(saved_lang))) saved_lang = ld->localedef; @@ -67,6 +66,9 @@ void init_nls(void) set_locale = "C"; bindtextdomain(PACKAGE, GNOMELOCALEDIR); textdomain(PACKAGE); + + /* have gettext return strings in UTF-8 */ + bind_textdomain_codeset(PACKAGE, "UTF-8"); /* determine language setting after setlocale() * empty setting, "C", or "POSIX" are treated as English Index: client/identity.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/identity.c,v retrieving revision 1.2 diff -u -p -r1.2 identity.c --- client/identity.c 6 May 2000 13:02:30 -0000 1.2 +++ client/identity.c 18 Aug 2003 01:21:51 -0000 @@ -39,9 +39,9 @@ static int draw_building_and_count(GdkGC offset += 5 + rect.width; sprintf(buff, "%d", num); - gdk_text_extents(area->style->font, buff, strlen(buff), + gdk_text_extents(gtk_style_get_font(area->style), buff, strlen(buff), &lbearing, &rbearing, &width, &ascent, &descent); - gdk_draw_text(area->window, area->style->font, gc, + gdk_draw_text(area->window, gtk_style_get_font(area->style), gc, offset, area->allocation.height - 5, buff, strlen(buff)); Index: client/theme.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/theme.c,v retrieving revision 1.7 diff -u -p -r1.7 theme.c --- client/theme.c 2 Aug 2003 18:12:25 -0000 1.7 +++ client/theme.c 18 Aug 2003 01:21:51 -0000 @@ -225,24 +225,25 @@ static void theme_initialize(MapTheme *t load_pixmap(fname, &(t->terrain_tiles[i]), NULL); } else { - GdkImlibImage *im; + GdkPixbuf *pixbuf; gchar *file = g_strconcat(IMAGEDIR "/", fname, NULL); if (!g_file_exists(file)) { g_error(_("Could not find \'%s\' pixmap file.\n"), file); exit(1); } - ; - if (!(im = gdk_imlib_load_image(file))) { + pixbuf = gdk_pixbuf_new_from_file(file, NULL); + if (pixbuf == NULL) { g_error(_("Could not load \'%s\' pixmap file.\n"), file); exit(1); } g_free(file); - t->scaledata[i].image = im; - t->scaledata[i].native_width = im->rgb_width; - t->scaledata[i].aspect = (float)im->rgb_width / im->rgb_height; - gdk_imlib_render(im, im->rgb_width, im->rgb_height); - t->terrain_tiles[i] = gdk_imlib_move_image(im); + t->scaledata[i].image = pixbuf; + t->scaledata[i].native_width = gdk_pixbuf_get_width(pixbuf); + t->scaledata[i].aspect = (float)gdk_pixbuf_get_width(pixbuf) + / gdk_pixbuf_get_height(pixbuf); + gdk_pixbuf_render_pixmap_and_mask(pixbuf, + &t->terrain_tiles[i], NULL, 1); } g_free(fname); } @@ -307,11 +308,21 @@ void theme_rescale(int new_width) } for(i = 0; i < numElem(current_theme->terrain_tiles); ++i) { - gdk_imlib_render(current_theme->scaledata[i].image, - new_width, - new_width/current_theme->scaledata[i].aspect); - current_theme->terrain_tiles[i] = - gdk_imlib_move_image(current_theme->scaledata[i].image); + GdkPixbuf *scaled_pixbuf; + + /* rescale the pixbuf */ + scaled_pixbuf = gdk_pixbuf_scale_simple( + current_theme->scaledata[i].image, + new_width, + new_width / current_theme->scaledata[i].aspect, + GDK_INTERP_BILINEAR); + gdk_pixbuf_unref(current_theme->scaledata[i].image); + current_theme->scaledata[i].image = scaled_pixbuf; + + /* render a new pixmap */ + gdk_pixmap_unref(current_theme->terrain_tiles[i]); + gdk_pixbuf_render_pixmap_and_mask(scaled_pixbuf, + ¤t_theme->terrain_tiles[i], NULL, 1); } } Index: client/theme.h =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/client/theme.h,v retrieving revision 1.2 diff -u -p -r1.2 theme.h --- client/theme.h 2 Aug 2003 18:12:25 -0000 1.2 +++ client/theme.h 18 Aug 2003 01:21:51 -0000 @@ -18,7 +18,7 @@ typedef struct { } TColor; typedef struct { - GdkImlibImage *image; + GdkPixbuf *image; gint native_width; float aspect; } TScaleData; Index: common/Makefile.am =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/common/Makefile.am,v retrieving revision 1.10 diff -u -p -r1.10 Makefile.am --- common/Makefile.am 27 May 2002 18:10:40 -0000 1.10 +++ common/Makefile.am 18 Aug 2003 01:21:53 -0000 @@ -2,7 +2,7 @@ noinst_LIBRARIES = libgnocatan.a libgnoc INCLUDES = \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ - -I$(includedir) $(GNOME_INCLUDEDIR) + -I$(includedir) $(GNOME2_CFLAGS) libgnocatan_a_SOURCES = \ buildrec.c \ Index: common/common_gtk.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/common/common_gtk.c,v retrieving revision 1.13 diff -u -p -r1.13 common_gtk.c --- common/common_gtk.c 14 Aug 2003 08:41:20 -0000 1.13 +++ common/common_gtk.c 18 Aug 2003 01:21:53 -0000 @@ -152,45 +152,35 @@ void message_window_log_message_string( /* write a text message to the message window in the specified color. */ void message_window_add_text(gchar *text, GdkColor *color) { - GtkAdjustment* adj; + GtkTextTag *text_tag; + GtkTextBuffer *buffer; + GtkTextIter iter; + GtkTextMark *end_mark; if (message_txt == NULL) return; - adj = GTK_ADJUSTMENT(GTK_TEXT(message_txt)->vadj); + /* create an anonymous tag for the indicated color */ + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(message_txt)); + text_tag = gtk_text_buffer_create_tag(buffer, NULL, + "foreground-gdk", color, NULL); - gtk_widget_realize(message_txt); - gtk_text_freeze(GTK_TEXT(message_txt)); -#if MAX_LINES > 0 - n_lines++; - if (n_lines > MAX_LINES) { - /* find the first new-line */ - gint nl = 0; - gchar c; - while ( (c = GTK_TEXT_INDEX(GTK_TEXT(message_txt), nl)) ) { - if (c == '\n') break; - nl++; - } - /* Delete from the beginning to that new-line */ - gtk_text_set_point(GTK_TEXT(message_txt),0); - gtk_text_forward_delete(GTK_TEXT(message_txt), nl+1); - /* Hack: recount the number of new-lines. I don't understand - why I can't just decrement n_lines */ - n_lines = 0; - nl = 0; - while ( (c = GTK_TEXT_INDEX(GTK_TEXT(message_txt), nl)) ) { - if (c == '\n') n_lines++; - nl++; - } - /* Move to the end of the text, before inserting the message */ - gtk_text_set_point(GTK_TEXT(message_txt), - gtk_text_get_length(GTK_TEXT(message_txt))); - } -#endif - gtk_text_insert(GTK_TEXT(message_txt), NULL, color, NULL, text, -1); - gtk_text_thaw(GTK_TEXT(message_txt)); + /* insert text at the end */ + gtk_text_buffer_get_end_iter(buffer, &iter); + gtk_text_buffer_insert_with_tags(buffer, &iter, text, strlen(text), + text_tag, NULL); + + /* move cursor to the end */ + gtk_text_buffer_get_end_iter(buffer, &iter); + gtk_text_buffer_place_cursor(buffer, &iter); - gtk_adjustment_set_value(adj, adj->upper - adj->page_size); + end_mark = gtk_text_buffer_get_mark(buffer, "end-mark"); + if (end_mark == NULL) { + end_mark = gtk_text_buffer_create_mark(buffer, "end-mark", + &iter, FALSE); + } + gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(message_txt), end_mark, + 0.0, FALSE, 0.0, 0.0); } /* set the text in the message window to the specified color. */ Index: meta-server/Makefile.am =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/meta-server/Makefile.am,v retrieving revision 1.3 diff -u -p -r1.3 Makefile.am --- meta-server/Makefile.am 13 May 2002 20:39:48 -0000 1.3 +++ meta-server/Makefile.am 18 Aug 2003 01:21:53 -0000 @@ -1,13 +1,15 @@ bin_PROGRAMS = gnocatan-meta-server INCLUDES = \ - -I$(includedir) -I../common $(GNOME_INCLUDEDIR) + -I$(srcdir)/../common -I. \ + -I$(includedir) \ + $(GNOME2_CFLAGS) gnocatan_meta_server_SOURCES = \ gnocatan-meta-server.c gnocatan_meta_server_LDADD = \ - $(GLIB_LIBS) + $(GLIB2_LIBS) # We don't need this, do we? -- egnor # install-data-local: Index: server/Makefile.am =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/server/Makefile.am,v retrieving revision 1.21 diff -u -p -r1.21 Makefile.am --- server/Makefile.am 2 Aug 2003 18:12:25 -0000 1.21 +++ server/Makefile.am 18 Aug 2003 01:21:53 -0000 @@ -8,7 +8,8 @@ noinst_LIBRARIES = libgnocatan_server.a INCLUDES = \ -I$(srcdir)/../common -I. \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ - -I$(includedir) $(GNOME_INCLUDEDIR) + -I$(includedir) \ + $(GNOME2_CFLAGS) gnocatan_server_gtk_DEPENDENCIES = libgnocatan_server.a \ ../common/libgnocatan.a ../common/libgnocatan_gtk.a @@ -45,13 +46,12 @@ gnocatan_server_gtk_LDADD = \ libgnocatan_server.a \ ../common/libgnocatan.a \ ../common/libgnocatan_gtk.a \ - $(GNOME_LIBDIR) \ - $(GNOMEUI_LIBS) + $(GNOME2_LIBS) gnocatan_server_console_LDADD = \ libgnocatan_server.a \ ../common/libgnocatan.a \ - $(GLIB_LIBS) + $(GLIB2_LIBS) config_DATA = \ default.game \ Index: server/gnocatan-server-gtk.c =================================================================== RCS file: /cvsroot/gnocatan/gnocatan/server/gnocatan-server-gtk.c,v retrieving revision 1.13 diff -u -p -r1.13 gnocatan-server-gtk.c --- server/gnocatan-server-gtk.c 2 Aug 2003 18:12:25 -0000 1.13 +++ server/gnocatan-server-gtk.c 18 Aug 2003 01:21:53 -0000 @@ -57,10 +57,13 @@ static void help_about_cb(GtkWidget *wid about = gnome_about_new(_("The Gnocatan Game Server"), VERSION, _("(C) 2002 the Free Software Foundation"), - authors, _("Gnocatan is based upon the excellent" " Settlers of Catan board game"), - NULL); + authors, + NULL, /* documenters */ + NULL, /* translators */ + NULL /* logo */ + ); gtk_widget_show(about); } @@ -581,7 +584,7 @@ static GtkWidget *build_interface() GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - message_text = gtk_text_new(NULL, NULL); + message_text = gtk_text_view_new(); gtk_widget_show(message_text); gtk_container_add(GTK_CONTAINER(scroll_win), message_text); message_window_set_text(message_text); @@ -603,10 +606,14 @@ int main(int argc, char *argv[]) driver->player_removed = gui_player_remove; #ifdef ENABLE_NLS - gnome_i18n_init(); + /* FIXME: do I need to initialize i18n for Gnome2? */ + /*gnome_i18n_init();*/ setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, GNOMELOCALEDIR); textdomain(PACKAGE); + + /* tell gettext to return UTF-8 strings */ + bind_textdomain_codeset(PACKAGE, "UTF-8"); #endif gnome_init("gnocatan-server", VERSION, argc, argv);