[easytag/wip/application-window: 11/19] Remove old GTK+ 2 grid compatibility code



commit efea2f2c00a5567a4931043e16f976a6a48aa198
Author: David King <amigadave amigadave com>
Date:   Sat Aug 16 22:41:41 2014 +0100

    Remove old GTK+ 2 grid compatibility code

 Makefile.am              |    2 --
 src/application_window.c |    1 -
 src/browser.c            |    1 -
 src/easytag.c            |    1 -
 src/gtk2_compat.c        |   38 --------------------------------------
 src/gtk2_compat.h        |   32 --------------------------------
 src/load_files_dialog.c  |    1 -
 src/misc.c               |   30 +++++++++++++++++++++++++++++-
 src/misc.h               |    4 ++++
 src/playlist_dialog.c    |    1 -
 src/preferences_dialog.c |    1 -
 src/scan_dialog.c        |    1 -
 src/search_dialog.c      |    1 -
 src/tag_area.c           |    1 -
 14 files changed, 33 insertions(+), 82 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 44b87c0..ef45dc9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,7 +50,6 @@ easytag_SOURCES = \
        src/enums.c \
        src/et_core.c \
        src/file_area.c \
-       src/gtk2_compat.c \
        src/load_files_dialog.c \
        src/log.c \
        src/main.c \
@@ -104,7 +103,6 @@ easytag_headers = \
        src/et_core.h \
        src/file_area.h \
        src/genres.h \
-       src/gtk2_compat.h \
        src/load_files_dialog.h \
        src/log.h \
        src/misc.h \
diff --git a/src/application_window.c b/src/application_window.c
index 61d8a99..f7f3410 100644
--- a/src/application_window.c
+++ b/src/application_window.c
@@ -27,7 +27,6 @@
 #include "cddb_dialog.h"
 #include "easytag.h"
 #include "file_area.h"
-#include "gtk2_compat.h"
 #include "load_files_dialog.h"
 #include "log.h"
 #include "misc.h"
diff --git a/src/browser.c b/src/browser.c
index d1b7ba0..bd19efa 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -39,7 +39,6 @@
 #include <errno.h>
 
 #include "application_window.h"
-#include "gtk2_compat.h"
 #include "easytag.h"
 #include "et_core.h"
 #include "scan_dialog.h"
diff --git a/src/easytag.c b/src/easytag.c
index 7fcef3c..0ef3f3b 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -35,7 +35,6 @@
 #endif
 #include <sys/types.h>
 
-#include "gtk2_compat.h"
 #include "easytag.h"
 #include "application_window.h"
 #include "browser.h"
diff --git a/src/load_files_dialog.c b/src/load_files_dialog.c
index 038fb9c..8965503 100644
--- a/src/load_files_dialog.c
+++ b/src/load_files_dialog.c
@@ -27,7 +27,6 @@
 #include "browser.h"
 #include "charset.h"
 #include "easytag.h"
-#include "gtk2_compat.h"
 #include "log.h"
 #include "misc.h"
 #include "picture.h"
diff --git a/src/misc.c b/src/misc.c
index 0f15254..bed939d 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -27,7 +27,6 @@
 #include <errno.h>
 
 #include "application_window.h"
-#include "gtk2_compat.h"
 #include "misc.h"
 #include "easytag.h"
 #include "id3_tag.h"
@@ -630,3 +629,32 @@ et_on_child_exited (GPid pid, gint status, gpointer user_data)
 {
     g_spawn_close_pid (pid);
 }
+
+void
+et_grid_attach_full (GtkGrid *grid,
+                     GtkWidget *child,
+                     gint left_attach,
+                     gint top_attach,
+                     gint width,
+                     gint height,
+                     gboolean hexpand,
+                     gboolean vexpand,
+                     gint hmargin,
+                     gint vmargin)
+{
+    g_object_set (G_OBJECT(child),
+                  "hexpand", hexpand,
+                  "vexpand", vexpand,
+#if GTK_CHECK_VERSION (3, 12, 0)
+                  "margin-start", hmargin,
+                  "margin-end", hmargin,
+#else
+                  "margin-left", hmargin,
+                  "margin-right", hmargin,
+#endif
+                  "margin-top", vmargin,
+                  "margin-bottom", vmargin,
+                  NULL);
+
+    gtk_grid_attach (grid, child, left_attach, top_attach, width, height);
+}
diff --git a/src/misc.h b/src/misc.h
index b51b6ef..bf664d7 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -68,6 +68,10 @@ gchar * et_track_number_to_string (const guint track_number);
 
 void et_on_child_exited (GPid pid, gint status, gpointer user_data);
 
+void et_grid_attach_full (GtkGrid *grid, GtkWidget *child, gint left, gint top,
+                          gint width, gint height, gboolean hexpand,
+                          gboolean vexpand, gint hmargin, gint vmargin);
+
 G_END_DECLS
 
 #endif /* __MISC_H__ */
diff --git a/src/playlist_dialog.c b/src/playlist_dialog.c
index 39b6f26..b3c3b4e 100644
--- a/src/playlist_dialog.c
+++ b/src/playlist_dialog.c
@@ -26,7 +26,6 @@
 #include "browser.h"
 #include "charset.h"
 #include "easytag.h"
-#include "gtk2_compat.h"
 #include "log.h"
 #include "misc.h"
 #include "picture.h"
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index c2a3ec1..5de7ca8 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -31,7 +31,6 @@
 #include <unistd.h>
 
 #include "application_window.h"
-#include "gtk2_compat.h"
 #include "setting.h"
 #include "misc.h"
 #include "scan_dialog.h"
diff --git a/src/scan_dialog.c b/src/scan_dialog.c
index 27f8e72..2ec14c9 100644
--- a/src/scan_dialog.c
+++ b/src/scan_dialog.c
@@ -29,7 +29,6 @@
 #include <glib/gi18n.h>
 
 #include "application_window.h"
-#include "gtk2_compat.h"
 #include "easytag.h"
 #include "enums.h"
 #include "preferences_dialog.h"
diff --git a/src/search_dialog.c b/src/search_dialog.c
index 5e1cce4..c213fb7 100644
--- a/src/search_dialog.c
+++ b/src/search_dialog.c
@@ -26,7 +26,6 @@
 #include "browser.h"
 #include "charset.h"
 #include "easytag.h"
-#include "gtk2_compat.h"
 #include "log.h"
 #include "misc.h"
 #include "picture.h"
diff --git a/src/tag_area.c b/src/tag_area.c
index 1bce256..7c659d1 100644
--- a/src/tag_area.c
+++ b/src/tag_area.c
@@ -28,7 +28,6 @@
 #include "easytag.h"
 #include "et_core.h"
 #include "genres.h"
-#include "gtk2_compat.h"
 #include "log.h"
 #include "misc.h"
 #include "picture.h"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]