[atomix/wip/gtk3-port] Completed file rename
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atomix/wip/gtk3-port] Completed file rename
- Date: Mon, 12 Jan 2015 20:01:09 +0000 (UTC)
commit fef85e287d7873ddffff8639cebe80b60f99f04a
Author: Robert Roth <robert roth off gmail com>
Date: Mon Jan 12 22:00:46 2015 +0200
Completed file rename
src/Makefile.am | 4 ++--
src/board-gtk.c | 52 +++++++++++++++++++++++++++++-----------------------
src/board-test.c | 2 +-
src/main.c | 2 +-
4 files changed, 33 insertions(+), 27 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2647872..955874a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,7 +16,7 @@ noinst_PROGRAMS = pf-test board-test
atomix_SOURCES = \
main.c main.h \
- board_gtk.c board_gtk.h \
+ board-gtk.c board-gtk.h \
undo.c undo.h \
goal.c goal.h \
goal-view.c goal-view.h \
@@ -51,7 +51,7 @@ board_test_SOURCES = \
playfield.h playfield.c \
tile.c tile.h \
theme.c theme.h \
- board_gtk.c board_gtk.h \
+ board-gtk.c board-gtk.h \
undo.c undo.h \
goal.c goal.h \
theme-manager.c theme-manager.h \
diff --git a/src/board-gtk.c b/src/board-gtk.c
index f3ce730..f8c73dc 100644
--- a/src/board-gtk.c
+++ b/src/board-gtk.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include "board_gtk.h"
+#include "board-gtk.h"
#define ANIM_TIMEOUT 1000 /* time in milliseconds between
two atom movements */
@@ -56,11 +56,6 @@ typedef enum
RIGHT
} ItemDirection;
-typedef struct
-{
- GSList *moveables;
-} LevelItems;
-
// FIXME get rid of static variables
/* Static declarations, to be removed */
@@ -516,7 +511,6 @@ GtkWidget* create_tile (double x, double y,
item = gtk_image_new_from_pixbuf (pixbuf);
-// TODO handle button click
if (tile_get_tile_type (tile) == TILE_TYPE_ATOM) {
event_box = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (event_box), item);
@@ -536,19 +530,6 @@ GtkWidget* create_tile (double x, double y,
return item;
}
-static void remove_items (GSList **list)
-{
- GSList *to_free = NULL;
-
- while (*list != NULL) {
- to_free = *list;
- gtk_container_remove (GTK_CONTAINER (board_canvas), GTK_WIDGET ((*list)->data));
- *list = g_slist_next (*list);
- g_slist_free_1 (to_free);
- }
-
-}
-
void board_gtk_init_level (PlayField * base_env, PlayField * sce, Goal * goal)
{
gint row, col;
@@ -587,8 +568,6 @@ void board_gtk_init_level (PlayField * base_env, PlayField * sce, Goal * goal)
void board_gtk_destroy (void)
{
- g_slist_free_full (board_canvas_items, (GDestroyNotify)gtk_widget_destroy);
-
if (board_env)
g_object_unref (board_env);
if (board_sce)
@@ -611,7 +590,34 @@ void board_gtk_destroy (void)
void board_gtk_clear (void)
{
- remove_items (&(board_canvas_items));
+ g_slist_foreach (board_canvas_items, (GFunc) gtk_widget_destroy, NULL);
+ g_slist_free (board_canvas_items);
+ board_canvas_items = NULL;
+
+/* clear board */
+ if (board_env)
+ {
+ g_object_unref (board_env);
+ board_env = NULL;
+ }
+ if (board_sce)
+ {
+ g_object_unref (board_sce);
+ board_sce = NULL;
+ }
+ if (board_goal)
+ {
+ g_object_unref (board_goal);
+ board_goal = NULL;
+ }
+ if (board_shadow)
+ {
+ g_object_unref (board_shadow);
+ board_shadow = NULL;
+ }
+
+ selector_hide (selector_data);
+
}
void board_gtk_print (void)
diff --git a/src/board-test.c b/src/board-test.c
index ddb6d62..4aa63a5 100644
--- a/src/board-test.c
+++ b/src/board-test.c
@@ -1,6 +1,6 @@
#include <gtk/gtk.h>
-#include "board_gtk.h"
+#include "board-gtk.h"
#include "theme-manager.h"
#include "level-manager.h"
diff --git a/src/main.c b/src/main.c
index a23266d..37edb9c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,7 +26,7 @@
#include <unistd.h>
#include <errno.h>
-#include "board_gtk.h"
+#include "board-gtk.h"
#include "playfield.h"
#include "main.h"
#include "goal.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]