comparison src/gui_gtk_f.h @ 8218:3456e2ebebd4 v7.4.1402

commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 23 17:14:37 2016 +0100 patch 7.4.1402 Problem: GTK 3 is not supported. Solution: Add GTK 3 support. (Kazunobu Kuriyama)
author Christian Brabandt <cb@256bit.org>
date Tue, 23 Feb 2016 17:15:05 +0100
parents e4d849f4df03
children 4aead6a9b7a9
comparison
equal deleted inserted replaced
8217:c52abf35df88 8218:3456e2ebebd4
7 */ 7 */
8 8
9 #ifndef __GTK_FORM_H__ 9 #ifndef __GTK_FORM_H__
10 #define __GTK_FORM_H__ 10 #define __GTK_FORM_H__
11 11
12 #ifdef USE_GTK3
13 #include <gtk/gtk.h>
14 #else
12 #include <gdk/gdk.h> 15 #include <gdk/gdk.h>
13 #include <gtk/gtkcontainer.h> 16 #include <gtk/gtkcontainer.h>
17 #endif
14 18
15 19
16 #ifdef __cplusplus 20 #ifdef __cplusplus
17 extern "C" { 21 extern "C" {
18 #endif 22 #endif
19 23
20 #define GTK_TYPE_FORM (gtk_form_get_type ()) 24 #define GTK_TYPE_FORM (gtk_form_get_type ())
25 #ifdef USE_GTK3
26 #define GTK_FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FORM, GtkForm))
27 #define GTK_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_FORM, GtkFormClass))
28 #define GTK_IS_FORM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_FORM))
29 #define GTK_IS_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_FORM))
30 #else
21 #define GTK_FORM(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FORM, GtkForm)) 31 #define GTK_FORM(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FORM, GtkForm))
22 #define GTK_FORM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FORM, GtkFormClass)) 32 #define GTK_FORM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FORM, GtkFormClass))
23 #define GTK_IS_FORM(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FORM)) 33 #define GTK_IS_FORM(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FORM))
24 #define GTK_IS_FORM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FORM)) 34 #define GTK_IS_FORM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FORM))
35 #endif
25 36
26 37
27 typedef struct _GtkForm GtkForm; 38 typedef struct _GtkForm GtkForm;
28 typedef struct _GtkFormClass GtkFormClass; 39 typedef struct _GtkFormClass GtkFormClass;
29 40
31 { 42 {
32 GtkContainer container; 43 GtkContainer container;
33 44
34 GList *children; 45 GList *children;
35 46
47 #ifndef USE_GTK3
36 guint width; 48 guint width;
37 guint height; 49 guint height;
50 #endif
38 51
39 GdkWindow *bin_window; 52 GdkWindow *bin_window;
40 53
54 #ifndef USE_GTK3
41 GdkVisibilityState visibility; 55 GdkVisibilityState visibility;
42 gulong configure_serial; 56 gulong configure_serial;
57 #endif
43 58
44 gint freeze_count; 59 gint freeze_count;
45 }; 60 };
46 61
47 struct _GtkFormClass 62 struct _GtkFormClass
48 { 63 {
49 GtkContainerClass parent_class; 64 GtkContainerClass parent_class;
50 }; 65 };
51 66
67 #ifdef USE_GTK3
68 GType gtk_form_get_type(void);
69 #else
52 GtkType gtk_form_get_type(void); 70 GtkType gtk_form_get_type(void);
71 #endif
53 72
54 GtkWidget *gtk_form_new(void); 73 GtkWidget *gtk_form_new(void);
55 74
56 void gtk_form_put(GtkForm * form, GtkWidget * widget, 75 void gtk_form_put(GtkForm * form, GtkWidget * widget,
57 gint x, gint y); 76 gint x, gint y);