[monkey-bubble] monkey bubble is GTK+ 3.x ready now
- From: Sven Herzberg <herzi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [monkey-bubble] monkey bubble is GTK+ 3.x ready now
- Date: Wed, 14 Jul 2010 22:34:48 +0000 (UTC)
commit 76be7756854e57fcfccdb2c9bc81cb41930b9ce4
Author: Sven Herzberg <herzi gnome-de org>
Date: Thu Jul 15 00:32:03 2010 +0200
monkey bubble is GTK+ 3.x ready now
* configure.in: add a check for GTK+ 2 vs 3
* src/input/player-input.c,
* src/ui/game-1-player.c,
* src/ui/game-2-player.c,
* src/ui/game-network-player.c,
* src/ui/main.c,
* src/ui/ui-main.c,
* src/ui/ui-network-client.c,
* src/ui/ui-network-server.c,
* src/view/monkey-canvas.c: remove obsolete code; replace deprecated
stuff with its current incarnation
configure.in | 19 +++++----
src/input/player-input.c | 4 +-
src/ui/game-1-player.c | 59 ++++++++++++---------------
src/ui/game-2-player.c | 91 ++++++++++++++++-------------------------
src/ui/game-network-player.c | 66 +++++++++++++-----------------
src/ui/main.c | 1 -
src/ui/ui-main.c | 37 +++++++----------
src/ui/ui-network-client.c | 10 ++---
src/ui/ui-network-server.c | 16 ++++----
src/view/monkey-canvas.c | 13 +++---
10 files changed, 136 insertions(+), 180 deletions(-)
---
diff --git a/configure.in b/configure.in
index 5b2a7e8..03738f4 100644
--- a/configure.in
+++ b/configure.in
@@ -81,28 +81,31 @@ dnl ----------------------
dnl Versions shared with the (upcoming) .spec file.
dnl GTK+ 2.14 comes with gtk_show_uri() support
-GTK_REQUIRED=2.12.0
+GTK_REQUIRED=2.14.0
G_THREAD_REQUIRED=2.0.0
AC_SUBST(GTK_REQUIRED)
AC_SUBST(G_THREAD_REQUIRED)
+dnl check whether GTK+ 3.x is available
+PKG_CHECK_EXISTS([gtk+-3.0],[mb_gtk=gtk+-3.0],[mb_gtk=gtk+-2.0])
+
PKG_CHECK_MODULES(LIBMONKEYUTIL_A,[
- gtk+-2.0
+ $mb_gtk
gthread-2.0
])
AC_SUBST(LIBMONKEYUTIL_A_CFLAGS)
AC_SUBST(LIBMONKEYUTIL_A_LIBS)
PKG_CHECK_MODULES(LIBMONKEY_A,[
- gtk+-2.0
+ $mb_gtk
gthread-2.0
])
AC_SUBST(LIBMONKEY_A_CFLAGS)
AC_SUBST(LIBMONKEY_A_LIBS)
PKG_CHECK_MODULES(LIBMBINPUT_A,[
- gtk+-2.0
+ $mb_gtk
gthread-2.0
gconf-2.0
])
@@ -110,7 +113,7 @@ AC_SUBST(LIBMBINPUT_A_CFLAGS)
AC_SUBST(LIBMBINPUT_A_LIBS)
PKG_CHECK_MODULES(LIBMONKEYVIEW_A,[
- gtk+-2.0
+ $mb_gtk
gthread-2.0
librsvg-2.0
])
@@ -118,7 +121,7 @@ AC_SUBST(LIBMONKEYVIEW_A_CFLAGS)
AC_SUBST(LIBMONKEYVIEW_A_LIBS)
PKG_CHECK_MODULES(LIBMONKEYAUDIO_A,[
- gtk+-2.0
+ $mb_gtk
gthread-2.0
libcanberra
libcanberra-gtk
@@ -127,7 +130,7 @@ AC_SUBST(LIBMONKEYAUDIO_A_CFLAGS)
AC_SUBST(LIBMONKEYAUDIO_A_LIBS)
PKG_CHECK_MODULES(MONKEY_SRV,[
- gtk+-2.0
+ $mb_gtk
gthread-2.0
libxml-2.0
])
@@ -137,7 +140,7 @@ AC_SUBST(MONKEY_SRV_LIBS)
PKG_CHECK_MODULES(UI,[
gconf-2.0
- gtk+-2.0 >= $GTK_REQUIRED
+ $mb_gtk >= $GTK_REQUIRED
gthread-2.0
librsvg-2.0
libcanberra
diff --git a/src/input/player-input.c b/src/input/player-input.c
index 2c2aba6..ee74ab6 100644
--- a/src/input/player-input.c
+++ b/src/input/player-input.c
@@ -113,12 +113,12 @@ mb_player_input_new (GtkWidget * window,
g_signal_connect( window ,
"key-press-event",
- GTK_SIGNAL_FUNC (key_pressed),
+ G_CALLBACK (key_pressed),
self);
g_signal_connect( window ,
"key-release-event",
- GTK_SIGNAL_FUNC (key_released),
+ G_CALLBACK (key_released),
self);
diff --git a/src/ui/game-1-player.c b/src/ui/game-1-player.c
index 6641fe0..c60d8a3 100644
--- a/src/ui/game-1-player.c
+++ b/src/ui/game-1-player.c
@@ -117,38 +117,35 @@ game_1_player_init (Game1Player* game)
game->private = g_new0 (Game1PlayerPrivate, 1);
}
-static void game_1_player_finalize(GObject* object) {
+static void
+game_1_player_finalize (GObject* object)
+{
+ Game1Player* game = GAME_1_PLAYER (object);
- Game1Player * game = GAME_1_PLAYER(object);
+ g_source_remove (PRIVATE (game)->timeout_id);
- gtk_timeout_remove( PRIVATE(game)->timeout_id);
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->input, pressed, game);
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->input, released, game);
- g_signal_handlers_disconnect_by_func( G_OBJECT(PRIVATE(game)->input) ,
- GTK_SIGNAL_FUNC (pressed),game);
+ g_signal_handlers_disconnect_matched( G_OBJECT( PRIVATE(game)->monkey ),
+ G_SIGNAL_MATCH_DATA,0,0,NULL,NULL,game);
- g_signal_handlers_disconnect_by_func( G_OBJECT(PRIVATE(game)->input) ,
- GTK_SIGNAL_FUNC (released),game);
- g_signal_handlers_disconnect_matched( G_OBJECT( PRIVATE(game)->monkey ),
- G_SIGNAL_MATCH_DATA,0,0,NULL,NULL,game);
-
+ g_object_unref( PRIVATE(game)->clock);
+ g_object_unref( PRIVATE(game)->display );
- g_object_unref( PRIVATE(game)->clock);
- g_object_unref( PRIVATE(game)->display );
+ g_object_unref( PRIVATE(game)->monkey);
+ monkey_canvas_unref_block(game->private->canvas,
+ game->private->paused_block);
- g_object_unref( PRIVATE(game)->monkey);
+ g_free(game->private);
- monkey_canvas_unref_block(game->private->canvas,
- game->private->paused_block);
-
- g_free(game->private);
-
- if (G_OBJECT_CLASS (parent_class)->finalize) {
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
- }
+ if (G_OBJECT_CLASS (parent_class)->finalize) {
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ }
}
@@ -240,10 +237,8 @@ Game1Player * game_1_player_new(GtkWidget * window,MonkeyCanvas * canvas, int le
PRIVATE(game)->clock = mb_clock_new();
- PRIVATE(game)->timeout_id =
- gtk_timeout_add (FRAME_DELAY, game_1_player_timeout, game);
-
-
+ PRIVATE (game)->timeout_id = g_timeout_add (FRAME_DELAY, game_1_player_timeout, game);
+
PRIVATE(game)->state = GAME_STOPPED;
PRIVATE(game)->lost = FALSE;
@@ -277,19 +272,15 @@ Game1Player * game_1_player_new(GtkWidget * window,MonkeyCanvas * canvas, int le
game_1_player_add_bubble(game);
-
-
mgs = mb_game_sound_new();
mb_game_sound_connect_monkey(mgs,PRIVATE(game)->monkey);
input_manager = mb_input_manager_get_instance();
PRIVATE(game)->input = mb_input_manager_get_left(input_manager);
- g_signal_connect(PRIVATE(game)->input ,"notify-pressed",
- GTK_SIGNAL_FUNC (pressed),game);
-
- g_signal_connect(PRIVATE(game)->input ,"notify-released",
- GTK_SIGNAL_FUNC (released),game);
-
+ g_signal_connect (PRIVATE (game)->input ,"notify-pressed",
+ G_CALLBACK (pressed),game);
+ g_signal_connect (PRIVATE (game)->input ,"notify-released",
+ G_CALLBACK (released),game);
return game;
}
@@ -572,3 +563,5 @@ static void game_1_player_bubble_shot( Monkey * monkey,
void game_1_player_fire_changed(Game1Player * game) {
game_notify_changed( GAME(game));
}
+
+/* vim:set et sw=2 cino=t0,f0,(0,{s,>2s,n-1s,^-1s,e2s: */
diff --git a/src/ui/game-2-player.c b/src/ui/game-2-player.c
index dc660f6..9d9ea0a 100644
--- a/src/ui/game-2-player.c
+++ b/src/ui/game-2-player.c
@@ -107,60 +107,47 @@ static void time_init(Game2Player * game);
G_DEFINE_TYPE (Game2Player, game_2_player, TYPE_GAME);
-static void
-game_2_player_finalize(GObject* object)
+static void
+game_2_player_finalize (GObject* object)
{
+ Game2Player* game = GAME_2_PLAYER(object);
- Game2Player * game = GAME_2_PLAYER(object);
-
-
- g_signal_handlers_disconnect_by_func( G_OBJECT(PRIVATE(game)->p1_input) ,
- GTK_SIGNAL_FUNC (pressed),game);
-
-
- g_signal_handlers_disconnect_by_func( G_OBJECT(PRIVATE(game)->p1_input) ,
- GTK_SIGNAL_FUNC (released),game);
+ /* FIXME: merge this part of 1player, 2player and network */
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->p1_input, pressed, game);
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->p1_input, released, game);
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->p2_input, pressed, game);
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->p2_input, released, game);
+ g_signal_handlers_disconnect_matched( G_OBJECT( PRIVATE(game)->monkey_left ),
+ G_SIGNAL_MATCH_DATA,0,0,NULL,NULL,game);
+ g_signal_handlers_disconnect_matched( G_OBJECT( PRIVATE(game)->monkey_right ),
+ G_SIGNAL_MATCH_DATA,0,0,NULL,NULL,game);
- g_signal_handlers_disconnect_by_func( G_OBJECT(PRIVATE(game)->p2_input) ,
- GTK_SIGNAL_FUNC (pressed),game);
+ g_object_unref (PRIVATE (game)->clock);
+ g_source_remove (PRIVATE (game)->timeout_id);
+ g_object_unref( PRIVATE(game)->display_left );
- g_signal_handlers_disconnect_by_func( G_OBJECT(PRIVATE(game)->p2_input) ,
- GTK_SIGNAL_FUNC (released),game);
+ g_object_unref( PRIVATE(game)->display_right );
- g_signal_handlers_disconnect_matched( G_OBJECT( PRIVATE(game)->monkey_left ),
- G_SIGNAL_MATCH_DATA,0,0,NULL,NULL,game);
- g_signal_handlers_disconnect_matched( G_OBJECT( PRIVATE(game)->monkey_right ),
- G_SIGNAL_MATCH_DATA,0,0,NULL,NULL,game);
+ g_object_unref( PRIVATE(game)->monkey_left);
- g_object_unref( PRIVATE(game)->clock);
- gtk_timeout_remove( PRIVATE(game)->timeout_id);
- g_object_unref( PRIVATE(game)->display_left );
+ g_object_unref( PRIVATE(game)->monkey_right);
+ monkey_canvas_unref_block(game->private->canvas,
+ game->private->paused_block);
- g_object_unref( PRIVATE(game)->display_right );
+ g_free(game->private);
-
- g_object_unref( PRIVATE(game)->monkey_left);
-
-
- g_object_unref( PRIVATE(game)->monkey_right);
- monkey_canvas_unref_block(game->private->canvas,
- game->private->paused_block);
-
- g_free(game->private);
-
-
- if (G_OBJECT_CLASS (parent_class)->finalize) {
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
- }
+ if (G_OBJECT_CLASS (parent_class)->finalize) {
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ }
}
@@ -240,11 +227,9 @@ game_2_player_new(GtkWidget * window,MonkeyCanvas * canvas,int score_left,int sc
monkey_canvas_get_root_layer( PRIVATE(game)->canvas),
PRIVATE(game)->background,
0,0);
-
- PRIVATE(game)->timeout_id =
- gtk_timeout_add (FRAME_DELAY, game_2_player_timeout, game);
-
-
+
+ PRIVATE (game)->timeout_id = g_timeout_add (FRAME_DELAY, game_2_player_timeout, game);
+
PRIVATE(game)->state = GAME_STOPPED;
@@ -312,19 +297,14 @@ game_2_player_new(GtkWidget * window,MonkeyCanvas * canvas,int score_left,int sc
PRIVATE(game)->p1_input = mb_input_manager_get_left(input_manager);
PRIVATE(game)->p2_input = mb_input_manager_get_right(input_manager);
-
-
- g_signal_connect(PRIVATE(game)->p1_input ,"notify-pressed",
- GTK_SIGNAL_FUNC (pressed),game);
-
- g_signal_connect(PRIVATE(game)->p1_input ,"notify-released",
- GTK_SIGNAL_FUNC (released),game);
-
- g_signal_connect(PRIVATE(game)->p2_input ,"notify-pressed",
- GTK_SIGNAL_FUNC (pressed),game);
-
- g_signal_connect(PRIVATE(game)->p2_input ,"notify-released",
- GTK_SIGNAL_FUNC (released),game);
+ g_signal_connect (PRIVATE (game)->p1_input ,"notify-pressed",
+ G_CALLBACK (pressed),game);
+ g_signal_connect (PRIVATE (game)->p1_input ,"notify-released",
+ G_CALLBACK (released),game);
+ g_signal_connect (PRIVATE (game)->p2_input ,"notify-pressed",
+ G_CALLBACK (pressed),game);
+ g_signal_connect (PRIVATE (game)->p2_input ,"notify-released",
+ G_CALLBACK (released),game);
return game;
}
@@ -696,3 +676,4 @@ game_2_player_class_init (Game2PlayerClass *klass)
i->get_state = game_2_player_get_state;
}
+/* vim:set et sw=2 cino=t0,f0,(0,{s,>2s,n-1s,^-1s,e2s: */
diff --git a/src/ui/game-network-player.c b/src/ui/game-network-player.c
index 12e16aa..420d1b4 100644
--- a/src/ui/game-network-player.c
+++ b/src/ui/game-network-player.c
@@ -135,48 +135,39 @@ static void
game_network_player_finalize (GObject * object)
{
- GameNetworkPlayer *game = GAME_NETWORK_PLAYER (object);
+ GameNetworkPlayer* game = GAME_NETWORK_PLAYER (object);
- gtk_timeout_remove (PRIVATE (game)->timeout_id);
+ g_source_remove (PRIVATE (game)->timeout_id);
- g_signal_handlers_disconnect_by_func (G_OBJECT
- (PRIVATE (game)->input),
- GTK_SIGNAL_FUNC (pressed),
- game);
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->input, pressed, game);
+ g_signal_handlers_disconnect_by_func (PRIVATE (game)->input, released, game);
+ g_signal_handlers_disconnect_matched (G_OBJECT
+ (PRIVATE (game)->monkey),
+ G_SIGNAL_MATCH_DATA, 0, 0, NULL,
+ NULL, game);
- g_signal_handlers_disconnect_by_func (G_OBJECT
- (PRIVATE (game)->input),
- GTK_SIGNAL_FUNC (released),
- game);
- g_signal_handlers_disconnect_matched (G_OBJECT
- (PRIVATE (game)->monkey),
- G_SIGNAL_MATCH_DATA, 0, 0, NULL,
- NULL, game);
-
-
-
- g_signal_handlers_disconnect_matched (G_OBJECT
- (PRIVATE (game)->handler),
- G_SIGNAL_MATCH_DATA, 0, 0, NULL,
- NULL, game);
+ g_signal_handlers_disconnect_matched (G_OBJECT
+ (PRIVATE (game)->handler),
+ G_SIGNAL_MATCH_DATA, 0, 0, NULL,
+ NULL, game);
#ifdef DEBUG
- g_print("finalized\n");
+ g_print("finalized\n");
#endif
- g_object_unref (PRIVATE (game)->clock);
- g_object_unref (PRIVATE (game)->display);
+ g_object_unref (PRIVATE (game)->clock);
+ g_object_unref (PRIVATE (game)->display);
- g_mutex_lock (PRIVATE (game)->lock);
- g_mutex_unlock (PRIVATE (game)->lock);
- g_object_unref (PRIVATE (game)->monkey);
- g_free (game->private);
+ g_mutex_lock (PRIVATE (game)->lock);
+ g_mutex_unlock (PRIVATE (game)->lock);
+ g_object_unref (PRIVATE (game)->monkey);
+ g_free (game->private);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- {
- (*G_OBJECT_CLASS (parent_class)->finalize) (object);
- }
+ if (G_OBJECT_CLASS (parent_class)->finalize)
+ {
+ (*G_OBJECT_CLASS (parent_class)->finalize) (object);
+ }
}
@@ -508,9 +499,7 @@ game_network_player_new (GtkWidget * window, MonkeyCanvas * canvas,
PRIVATE (game)->monkey_id = monkey_id;
PRIVATE (game)->clock = mb_clock_new ();
- PRIVATE (game)->timeout_id =
- gtk_timeout_add (FRAME_DELAY, game_network_player_timeout,
- game);
+ PRIVATE (game)->timeout_id = g_timeout_add (FRAME_DELAY, game_network_player_timeout, game);
PRIVATE (game)->state = GAME_STOPPED;
@@ -544,10 +533,9 @@ game_network_player_new (GtkWidget * window, MonkeyCanvas * canvas,
PRIVATE (game)->input = mb_input_manager_get_left (input_manager);
g_signal_connect (PRIVATE (game)->input, "notify-pressed",
- GTK_SIGNAL_FUNC (pressed), game);
-
+ G_CALLBACK (pressed), game);
g_signal_connect (PRIVATE (game)->input, "notify-released",
- GTK_SIGNAL_FUNC (released), game);
+ G_CALLBACK (released), game);
x=350;
@@ -817,3 +805,5 @@ game_network_player_fire_changed (GameNetworkPlayer * game)
{
game_notify_changed (GAME (game));
}
+
+/* vim:set et sw=2 cino=t0,f0,(0,{s,>2s,n-1s,^-1s,e2s: */
diff --git a/src/ui/main.c b/src/ui/main.c
index a323317..13217ab 100644
--- a/src/ui/main.c
+++ b/src/ui/main.c
@@ -121,7 +121,6 @@ int main(int argc, char **argv)
window = ui_main_get_window(ui_main);
mb_input_manager_instance_set_window(window);
- gdk_rgb_init ();
gtk_widget_show (window);
diff --git a/src/ui/ui-main.c b/src/ui/ui-main.c
index dc363fe..fafdd94 100644
--- a/src/ui/ui-main.c
+++ b/src/ui/ui-main.c
@@ -117,21 +117,21 @@ static void window_state_event (GtkWindow *window,
static void ui_main_new_1_player_game(UiMain * ui_main);
-struct UiMainPrivate {
- GtkAccelGroup * accel_group;
- GtkItemFactory * item_factory;
- GtkWidget * menu;
- GtkWidget * status_bar;
- MonkeyCanvas * canvas;
- GtkWidget * window;
- Block * main_image;
- Game * game;
- GameManager * manager;
- gboolean fullscreen;
- SoundManager * sm;
- GtkActionGroup* actions;
+struct UiMainPrivate
+{
+ GtkAccelGroup * accel_group;
+ GtkWidget * menu;
+ GtkWidget * status_bar;
+ MonkeyCanvas * canvas;
+ GtkWidget * window;
+ Block * main_image;
+ Game * game;
+ GameManager * manager;
+ gboolean fullscreen;
+ SoundManager * sm;
+ GtkActionGroup * actions;
#ifdef MAEMO
- ConIcConnection *ic;
+ ConIcConnection* ic;
#endif
};
@@ -397,18 +397,11 @@ ui_main_new (void)
ui_main_set_game( ui_main,NULL);
PRIVATE(ui_main)->manager = NULL;
- gtk_widget_push_visual (gdk_rgb_get_visual ());
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- gtk_widget_pop_visual ();
- gtk_widget_pop_colormap ();
-
ui_main_draw_main(ui_main);
PRIVATE(ui_main)->fullscreen = FALSE;
- gtk_window_set_policy (GTK_WINDOW (PRIVATE(ui_main)->window), TRUE, TRUE, FALSE);
-
+ gtk_window_set_resizable (GTK_WINDOW (PRIVATE(ui_main)->window), TRUE);
PRIVATE(ui_main)->sm = sound_manager_get_instance();
sound_manager_play_music(PRIVATE(ui_main)->sm,MB_MUSIC_SPLASH);
diff --git a/src/ui/ui-network-client.c b/src/ui/ui-network-client.c
index f641f78..e355550 100644
--- a/src/ui/ui-network-client.c
+++ b/src/ui/ui-network-client.c
@@ -182,18 +182,16 @@ ui_network_client_new (void)
item = GTK_WIDGET (gtk_builder_get_object (PRIVATE (ngl)->builder, "go_button"));
- g_signal_connect_swapped( item,"clicked",GTK_SIGNAL_FUNC(connect_server_signal),ngl);
-
+ g_signal_connect_swapped (item, "clicked", G_CALLBACK (connect_server_signal), ngl);
item = GTK_WIDGET (gtk_builder_get_object (PRIVATE (ngl)->builder, "quit_button"));
- g_signal_connect_swapped( item,"clicked",GTK_SIGNAL_FUNC(quit_server_signal),ngl);
+ g_signal_connect_swapped (item, "clicked", G_CALLBACK (quit_server_signal), ngl);
item = GTK_WIDGET (gtk_builder_get_object (PRIVATE (ngl)->builder, "network_window"));
- g_signal_connect_swapped( item,"delete_event",GTK_SIGNAL_FUNC(quit_signal),ngl);
-
+ g_signal_connect_swapped (item, "delete_event", G_CALLBACK (quit_signal), ngl);
item = GTK_WIDGET (gtk_builder_get_object (PRIVATE (ngl)->builder, "ready_button"));
- g_signal_connect_swapped( item,"clicked",GTK_SIGNAL_FUNC(ready_signal),ngl);
+ g_signal_connect_swapped (item, "clicked", G_CALLBACK (ready_signal), ngl);
PRIVATE(ngl)->connection_label = GTK_LABEL (gtk_builder_get_object (PRIVATE (ngl)->builder, "connection_state_label"));
diff --git a/src/ui/ui-network-server.c b/src/ui/ui-network-server.c
index b5e1f18..498bb47 100644
--- a/src/ui/ui-network-server.c
+++ b/src/ui/ui-network-server.c
@@ -151,16 +151,16 @@ ui_network_server_new (NetworkSimpleServer* server)
PRIVATE (ngl)->window = GTK_WIDGET (gtk_builder_get_object (PRIVATE (ngl)->builder, "network_window"));
item = GTK_WIDGET (gtk_builder_get_object ( PRIVATE(ngl)->builder, "quit_button"));
- g_signal_connect_swapped( item,"clicked",GTK_SIGNAL_FUNC(quit_server_signal),ngl);
+ g_signal_connect_swapped (item, "clicked", G_CALLBACK (quit_server_signal), ngl);
item = GTK_WIDGET (gtk_builder_get_object ( PRIVATE(ngl)->builder, "network_window"));
- g_signal_connect_swapped( item,"delete-event",GTK_SIGNAL_FUNC(quit_signal),ngl);
+ g_signal_connect_swapped (item, "delete-event", G_CALLBACK (quit_signal), ngl);
item = GTK_WIDGET (gtk_builder_get_object ( PRIVATE(ngl)->builder, "ready_button"));
- g_signal_connect_swapped( item,"clicked",GTK_SIGNAL_FUNC(ready_signal),ngl);
+ g_signal_connect_swapped (item, "clicked", G_CALLBACK (ready_signal), ngl);
item = GTK_WIDGET (gtk_builder_get_object ( PRIVATE(ngl)->builder, "start_button"));
- g_signal_connect_swapped( item,"clicked",GTK_SIGNAL_FUNC(start_signal),ngl);
+ g_signal_connect_swapped (item, "clicked", G_CALLBACK (start_signal), ngl);
item = GTK_WIDGET (gtk_builder_get_object ( PRIVATE(ngl)->builder,"players_treeview"));
list = gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_BOOLEAN,G_TYPE_BOOLEAN);
@@ -188,12 +188,12 @@ ui_network_server_new (NetworkSimpleServer* server)
gtk_tree_view_set_model( GTK_TREE_VIEW(item), GTK_TREE_MODEL(list));
item = GTK_WIDGET (gtk_builder_get_object ( PRIVATE(ngl)->builder,"number_of_players"));
- g_signal_connect_swapped( item, "value_changed", GTK_SIGNAL_FUNC(number_of_players_changed),
- ngl);
+ g_signal_connect_swapped (item, "value_changed",
+ G_CALLBACK (number_of_players_changed), ngl);
item = GTK_WIDGET (gtk_builder_get_object ( PRIVATE(ngl)->builder,"number_of_games"));
- g_signal_connect_swapped( item, "value_changed", GTK_SIGNAL_FUNC(number_of_games_changed),
- ngl);
+ g_signal_connect_swapped (item, "value_changed",
+ G_CALLBACK (number_of_games_changed), ngl);
PRIVATE(ngl)->players_list = list;
diff --git a/src/view/monkey-canvas.c b/src/view/monkey-canvas.c
index 149e0ac..dc111b7 100644
--- a/src/view/monkey-canvas.c
+++ b/src/view/monkey-canvas.c
@@ -174,14 +174,13 @@ MonkeyCanvas * monkey_canvas_new( void ) {
dp->scale_x= 1;
dp->scale_y = 1;
- gtk_drawing_area_size(GTK_DRAWING_AREA(monkey_canvas),640,480);
+ gtk_widget_set_size_request (GTK_WIDGET (monkey_canvas), 640, 480);
- g_signal_connect (GTK_OBJECT (monkey_canvas), "expose-event",
- GTK_SIGNAL_FUNC (monkey_canvas_expose), monkey_canvas);
+ g_signal_connect (monkey_canvas, "expose-event",
+ G_CALLBACK (monkey_canvas_expose), monkey_canvas);
- g_signal_connect( GTK_OBJECT(monkey_canvas), "configure-event",
- GTK_SIGNAL_FUNC (monkey_canvas_configure),monkey_canvas);
-
+ g_signal_connect (monkey_canvas, "configure-event",
+ G_CALLBACK (monkey_canvas_configure),monkey_canvas);
dp->buffer = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
dp->x_size,dp->y_size);
@@ -301,7 +300,7 @@ gint monkey_canvas_expose(GtkWidget *widget, GdkEventExpose *event, gpointer dat
layer_draw( (Layer*) next->data,
widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ widget->style->fg_gc[gtk_widget_get_state (widget)],
&rects[i] );
next = g_list_next( next );
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]