Split out includes of <gtk/gtk.h> into a new header file so the GTK+ versioning macros can be included in all Go files, not just area_unix.go.
This commit is contained in:
parent
7b95e735d6
commit
63f8033f49
|
@ -10,12 +10,7 @@ import (
|
|||
)
|
||||
|
||||
// #cgo pkg-config: gtk+-3.0
|
||||
// /* GTK+ 3.8 deprecates gtk_scrolled_window_add_with_viewport(); we need 3.4 miniimum though
|
||||
// setting MIN_REQUIRED ensures nothing older; setting MAX_ALLOWED disallows newer functions - thanks to desrt in irc.gimp.net/#gtk+
|
||||
// TODO add this to the other files too */
|
||||
// #define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_4
|
||||
// #define GDK_VERSION_MAX_ALLOWED GDK_VERSION_3_4
|
||||
// #include <gtk/gtk.h>
|
||||
// #include "gtk_unix.h"
|
||||
// extern gboolean our_area_draw_callback(GtkWidget *, cairo_t *, gpointer);
|
||||
// extern gboolean our_area_button_press_event_callback(GtkWidget *, GdkEvent *, gpointer);
|
||||
// extern gboolean our_area_button_release_event_callback(GtkWidget *, GdkEvent *, gpointer);
|
||||
|
|
|
@ -15,7 +15,7 @@ while we're at it the callback for our idle function will be handled here too
|
|||
*/
|
||||
|
||||
// #cgo pkg-config: gtk+-3.0
|
||||
// #include <gtk/gtk.h>
|
||||
// #include "gtk_unix.h"
|
||||
// #include <stdlib.h>
|
||||
// extern gboolean our_window_delete_event_callback(GtkWidget *, GdkEvent *, gpointer);
|
||||
// extern gboolean our_window_configure_event_callback(GtkWidget *, GdkEvent *, gpointer);
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
// #cgo pkg-config: gtk+-3.0
|
||||
// #include <stdlib.h>
|
||||
// #include <gtk/gtk.h>
|
||||
// #include "gtk_unix.h"
|
||||
// /* because cgo seems to choke on ... */
|
||||
// /* TODO does NULL parent make the box application-global? docs are unclear */
|
||||
// GtkWidget *gtkNewMsgBox(GtkMessageType type, GtkButtonsType buttons, char *title, char *text) { GtkWidget *k = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, type, buttons, "%s", (gchar *) title); gtk_message_dialog_format_secondary_text((GtkMessageDialog *) k, "%s", (gchar *) text); return k; }
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/* 16 march 2014 */
|
||||
|
||||
/* This header file is a convenience to ensure that the compatibility flags below are included in all Go files that include <gtk/gtk.h> */
|
||||
|
||||
/*
|
||||
MIN_REQUIRED signals that programs are expected to run on at least GTK+ 3 .4 and thus deprectation warnings for newer versions (such as gtk_scrolled_window_add_with_viewport() being deprecated in GTK+ 3.8) should be suppressed.
|
||||
MAX_ALLOWED signals that programs will not use features introduced in newer versions of GTK+ and that the compiler should warn us if we slip.
|
||||
Thanks to desrt in irc.gimp.net/#gtk+
|
||||
*/
|
||||
#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_4
|
||||
#define GDK_VERSION_MAX_ALLOWED GDK_VERSION_3_4
|
||||
|
||||
/* TODO are there equivalent compatibility macros for the other components of GTK+? */
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
/* TODO include <stdlib.h> too */
|
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
// #cgo pkg-config: gtk+-3.0
|
||||
// #include <stdlib.h>
|
||||
// #include <gtk/gtk.h>
|
||||
// #include "gtk_unix.h"
|
||||
import "C"
|
||||
|
||||
type (
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
// Listbox casts are stored in listbox_unix.go
|
||||
|
||||
// #cgo pkg-config: gtk+-3.0
|
||||
// #include <gtk/gtk.h>
|
||||
// #include "gtk_unix.h"
|
||||
import "C"
|
||||
|
||||
func fromgbool(b C.gboolean) bool {
|
||||
|
|
|
@ -30,7 +30,7 @@ and the GTK+ reference documentation.
|
|||
|
||||
// #cgo pkg-config: gtk+-3.0
|
||||
// #include <stdlib.h>
|
||||
// #include <gtk/gtk.h>
|
||||
// #include "gtk_unix.h"
|
||||
// /* because cgo seems to choke on ... */
|
||||
// void gtkTreeModelGet(GtkTreeModel *model, GtkTreeIter *iter, gchar **gs)
|
||||
// {
|
||||
|
|
Loading…
Reference in New Issue