This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
/
gtkglext.rb
131 lines (113 loc) · 4.6 KB
/
gtkglext.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
require 'formula'
class Gtkglext < Formula
url 'http://downloads.sourceforge.net/gtkglext/gtkglext-1.2.0.tar.gz'
homepage 'http://projects.gnome.org/gtkglext/'
sha1 'db9ce38ee555fd14f55083ec7f4ae30e5338d5cc'
depends_on 'pkg-config' => :build
depends_on 'glib'
depends_on 'gtk+'
depends_on :x11
def patches
# fixes an incompatibility with recent GTK versions
# patch from: <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585155>
DATA
end
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
end
end
__END__
diff --git a/examples/pixmap-mixed.c b/examples/pixmap-mixed.c
index 2346afd..3e53f14 100644
--- a/examples/pixmap-mixed.c
+++ b/examples/pixmap-mixed.c
@@ -154,7 +154,7 @@ expose_event (GtkWidget *widget,
gpointer data)
{
gdk_draw_drawable (widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
diff --git a/examples/pixmap.c b/examples/pixmap.c
index 10e6fc1..a14a1b7 100644
--- a/examples/pixmap.c
+++ b/examples/pixmap.c
@@ -137,7 +137,7 @@ expose_event (GtkWidget *widget,
gpointer data)
{
gdk_draw_drawable (widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
diff --git a/gtk/gtkglwidget.c b/gtk/gtkglwidget.c
index 76a93d6..ca60626 100644
--- a/gtk/gtkglwidget.c
+++ b/gtk/gtkglwidget.c
@@ -129,7 +129,7 @@ gtk_gl_widget_size_allocate (GtkWidget *widget,
* Synchronize OpenGL and window resizing request streams.
*/
- if (GTK_WIDGET_REALIZED (widget) && private->is_realized)
+ if (gtk_widget_get_realized (widget) && private->is_realized)
{
gldrawable = gdk_window_get_gl_drawable (widget->window);
gdk_gl_drawable_wait_gdk (gldrawable);
@@ -156,7 +156,7 @@ gtk_gl_widget_unrealize (GtkWidget *widget,
* Remove OpenGL-capability from widget->window.
*/
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
gdk_window_unset_gl_capability (widget->window);
private->is_realized = FALSE;
@@ -176,7 +176,7 @@ gtk_gl_widget_parent_set (GtkWidget *widget,
*/
toplevel = gtk_widget_get_toplevel (widget);
- if (GTK_WIDGET_TOPLEVEL (toplevel) && !GTK_WIDGET_REALIZED (toplevel))
+ if (gtk_widget_is_toplevel (toplevel) && !gtk_widget_get_realized (toplevel))
{
GTK_GL_NOTE (MISC,
g_message (" - Install colormap to the top-level window."));
@@ -196,7 +196,7 @@ gtk_gl_widget_style_set (GtkWidget *widget,
* Set a background of "None" on window to avoid AIX X server crash.
*/
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
GTK_GL_NOTE (MISC,
g_message (" - window->bg_pixmap = %p",
@@ -252,8 +252,8 @@ gtk_widget_set_gl_capability (GtkWidget *widget,
GTK_GL_NOTE_FUNC ();
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- g_return_val_if_fail (!GTK_WIDGET_NO_WINDOW (widget), FALSE);
- g_return_val_if_fail (!GTK_WIDGET_REALIZED (widget), FALSE);
+ g_return_val_if_fail (gtk_widget_get_has_window (widget), FALSE);
+ g_return_val_if_fail (!gtk_widget_get_realized (widget), FALSE);
g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), FALSE);
/*
@@ -434,7 +434,7 @@ gtk_widget_create_gl_context (GtkWidget *widget,
GTK_GL_NOTE_FUNC ();
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
gldrawable = gdk_window_get_gl_drawable (widget->window);
if (gldrawable == NULL)
@@ -476,7 +476,7 @@ gtk_widget_get_gl_context (GtkWidget *widget)
GLWidgetPrivate *private;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
private = g_object_get_qdata (G_OBJECT (widget), quark_gl_private);
if (private == NULL)
@@ -503,7 +503,7 @@ GdkGLWindow *
gtk_widget_get_gl_window (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
return gdk_window_get_gl_window (widget->window);
}