OCaml 4.14.0 rebuild
[arch-packages.git] / gtkglext / trunk / kill-pangox.patch
blob04d5eaa177bbd871abf134508115c631e12d5fe2
1 diff -ruN gtkglext-1.2.0.orig/configure.in gtkglext-1.2.0/configure.in
2 --- gtkglext-1.2.0.orig/configure.in 2006-02-05 03:17:19.000000000 +0000
3 +++ gtkglext-1.2.0/configure.in 2020-04-28 12:35:21.905828768 +0000
4 @@ -59,10 +59,6 @@
5 m4_define([pango_pkg], [pango])
6 m4_define([pango_required_version], [1.0.0])
8 -# Pangox
9 -m4_define([pangox_pkg], [pangox])
10 -m4_define([pangox_required_version], [1.0.0])
12 # PangoFT2
13 m4_define([pangoft2_pkg], [pangoft2])
14 m4_define([pangoft2_required_version], [1.0.0])
15 @@ -349,7 +345,6 @@
16 gtk_pkg >= gtk_required_version \
17 gdk_pkg >= gdk_required_version \
18 pango_pkg >= pango_required_version \
19 -pangox_pkg >= pangox_required_version \
20 gmodule_pkg >= gmodule_required_version \
23 @@ -794,7 +789,7 @@
24 # CFLAGS and LIBS
25 ##################################################
27 -GDKGLEXT_PACKAGES="gdk_pkg pango_pkg pangox_pkg gmodule_pkg"
28 +GDKGLEXT_PACKAGES="gdk_pkg pango_pkg gmodule_pkg"
29 GDKGLEXT_EXTRA_CFLAGS="$GL_CFLAGS $GDKGLEXT_WIN_CFLAGS"
30 GDKGLEXT_EXTRA_LIBS="$GL_LIBS $GDKGLEXT_WIN_LIBS"
31 GDKGLEXT_DEP_CFLAGS="$GDKGLEXT_EXTRA_CFLAGS `$PKG_CONFIG --cflags $GDKGLEXT_PACKAGES`"
32 diff -ruN gtkglext-1.2.0.orig/examples/font.c gtkglext-1.2.0/examples/font.c
33 --- gtkglext-1.2.0.orig/examples/font.c 2003-11-06 18:04:46.000000000 +0000
34 +++ gtkglext-1.2.0/examples/font.c 1970-01-01 00:00:00.000000000 +0000
35 @@ -1,349 +0,0 @@
36 -/*
37 - * font.c:
38 - * Simple bitmap font rendering example.
39 - *
40 - * written by Naofumi Yasufuku <naofumi@users.sourceforge.net>
41 - */
43 -#include <stdlib.h>
44 -#include <string.h>
46 -#include <gtk/gtk.h>
48 -#include <gtk/gtkgl.h>
50 -#ifdef G_OS_WIN32
51 -#define WIN32_LEAN_AND_MEAN 1
52 -#include <windows.h>
53 -#endif
55 -#include <GL/gl.h>
56 -#include <GL/glu.h>
58 -static gchar font_string[] = "courier 12";
59 -static GLuint font_list_base;
60 -static gint font_height;
62 -static void
63 -realize (GtkWidget *widget,
64 - gpointer data)
66 - GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
67 - GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
69 - PangoFontDescription *font_desc;
70 - PangoFont *font;
71 - PangoFontMetrics *font_metrics;
73 - /*** OpenGL BEGIN ***/
74 - if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext))
75 - return;
77 - /*
78 - * Generate font display lists.
79 - */
80 - font_list_base = glGenLists (128);
82 - font_desc = pango_font_description_from_string (font_string);
84 - font = gdk_gl_font_use_pango_font (font_desc, 0, 128, font_list_base);
85 - if (font == NULL)
86 - {
87 - g_print ("*** Can't load font '%s'\n", font_string);
88 - exit (1);
89 - }
91 - font_metrics = pango_font_get_metrics (font, NULL);
93 - font_height = pango_font_metrics_get_ascent (font_metrics) +
94 - pango_font_metrics_get_descent (font_metrics);
95 - font_height = PANGO_PIXELS (font_height);
97 - pango_font_description_free (font_desc);
98 - pango_font_metrics_unref (font_metrics);
100 - glClearColor (1.0, 1.0, 1.0, 1.0);
101 - glClearDepth (1.0);
103 - glViewport (0, 0,
104 - widget->allocation.width, widget->allocation.height);
106 - glMatrixMode (GL_PROJECTION);
107 - glLoadIdentity ();
108 - glOrtho (0.0, widget->allocation.width,
109 - 0.0, widget->allocation.height,
110 - -1.0, 1.0);
112 - glMatrixMode (GL_MODELVIEW);
113 - glLoadIdentity ();
115 - gdk_gl_drawable_gl_end (gldrawable);
116 - /*** OpenGL END ***/
119 -static gboolean
120 -configure_event (GtkWidget *widget,
121 - GdkEventConfigure *event,
122 - gpointer data)
124 - GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
125 - GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
127 - /*** OpenGL BEGIN ***/
128 - if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext))
129 - return FALSE;
131 - glViewport (0, 0,
132 - widget->allocation.width, widget->allocation.height);
134 - glMatrixMode (GL_PROJECTION);
135 - glLoadIdentity ();
136 - glOrtho (0.0, widget->allocation.width,
137 - 0.0, widget->allocation.height,
138 - -1.0, 1.0);
140 - glMatrixMode (GL_MODELVIEW);
141 - glLoadIdentity ();
143 - gdk_gl_drawable_gl_end (gldrawable);
144 - /*** OpenGL END ***/
146 - return TRUE;
149 -static gboolean
150 -expose_event (GtkWidget *widget,
151 - GdkEventExpose *event,
152 - gpointer data)
154 - GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
155 - GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
156 - int i, j;
158 - /*** OpenGL BEGIN ***/
159 - if (!gdk_gl_drawable_gl_begin (gldrawable, glcontext))
160 - return FALSE;
162 - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
164 - /*
165 - * Draw some text.
166 - */
167 - glColor3f (0.0, 0.0, 0.0);
168 - for (i = 2; i >= -2; i--)
170 - glRasterPos2f (10.0, 0.5*widget->allocation.height + i*font_height);
171 - for (j = ' '; j <= 'Z'; j++)
172 - glCallList (font_list_base+j);
175 - /*
176 - * Show font description string.
177 - */
178 - glColor3f (1.0, 0.0, 0.0);
179 - glRasterPos2f (10.0, 10.0);
180 - glListBase (font_list_base);
181 - glCallLists (strlen (font_string), GL_UNSIGNED_BYTE, font_string);
183 - if (gdk_gl_drawable_is_double_buffered (gldrawable))
184 - gdk_gl_drawable_swap_buffers (gldrawable);
185 - else
186 - glFlush ();
188 - gdk_gl_drawable_gl_end (gldrawable);
189 - /*** OpenGL END ***/
191 - return TRUE;
194 -static void
195 -print_gl_config_attrib (GdkGLConfig *glconfig,
196 - const gchar *attrib_str,
197 - int attrib,
198 - gboolean is_boolean)
200 - int value;
202 - g_print ("%s = ", attrib_str);
203 - if (gdk_gl_config_get_attrib (glconfig, attrib, &value))
205 - if (is_boolean)
206 - g_print ("%s\n", value == TRUE ? "TRUE" : "FALSE");
207 - else
208 - g_print ("%d\n", value);
210 - else
211 - g_print ("*** Cannot get %s attribute value\n", attrib_str);
214 -static void
215 -examine_gl_config_attrib (GdkGLConfig *glconfig)
217 - g_print ("\nOpenGL visual configurations :\n\n");
219 - g_print ("gdk_gl_config_is_rgba (glconfig) = %s\n",
220 - gdk_gl_config_is_rgba (glconfig) ? "TRUE" : "FALSE");
221 - g_print ("gdk_gl_config_is_double_buffered (glconfig) = %s\n",
222 - gdk_gl_config_is_double_buffered (glconfig) ? "TRUE" : "FALSE");
223 - g_print ("gdk_gl_config_is_stereo (glconfig) = %s\n",
224 - gdk_gl_config_is_stereo (glconfig) ? "TRUE" : "FALSE");
225 - g_print ("gdk_gl_config_has_alpha (glconfig) = %s\n",
226 - gdk_gl_config_has_alpha (glconfig) ? "TRUE" : "FALSE");
227 - g_print ("gdk_gl_config_has_depth_buffer (glconfig) = %s\n",
228 - gdk_gl_config_has_depth_buffer (glconfig) ? "TRUE" : "FALSE");
229 - g_print ("gdk_gl_config_has_stencil_buffer (glconfig) = %s\n",
230 - gdk_gl_config_has_stencil_buffer (glconfig) ? "TRUE" : "FALSE");
231 - g_print ("gdk_gl_config_has_accum_buffer (glconfig) = %s\n",
232 - gdk_gl_config_has_accum_buffer (glconfig) ? "TRUE" : "FALSE");
234 - g_print ("\n");
236 - print_gl_config_attrib (glconfig, "GDK_GL_USE_GL", GDK_GL_USE_GL, TRUE);
237 - print_gl_config_attrib (glconfig, "GDK_GL_BUFFER_SIZE", GDK_GL_BUFFER_SIZE, FALSE);
238 - print_gl_config_attrib (glconfig, "GDK_GL_LEVEL", GDK_GL_LEVEL, FALSE);
239 - print_gl_config_attrib (glconfig, "GDK_GL_RGBA", GDK_GL_RGBA, TRUE);
240 - print_gl_config_attrib (glconfig, "GDK_GL_DOUBLEBUFFER", GDK_GL_DOUBLEBUFFER, TRUE);
241 - print_gl_config_attrib (glconfig, "GDK_GL_STEREO", GDK_GL_STEREO, TRUE);
242 - print_gl_config_attrib (glconfig, "GDK_GL_AUX_BUFFERS", GDK_GL_AUX_BUFFERS, FALSE);
243 - print_gl_config_attrib (glconfig, "GDK_GL_RED_SIZE", GDK_GL_RED_SIZE, FALSE);
244 - print_gl_config_attrib (glconfig, "GDK_GL_GREEN_SIZE", GDK_GL_GREEN_SIZE, FALSE);
245 - print_gl_config_attrib (glconfig, "GDK_GL_BLUE_SIZE", GDK_GL_BLUE_SIZE, FALSE);
246 - print_gl_config_attrib (glconfig, "GDK_GL_ALPHA_SIZE", GDK_GL_ALPHA_SIZE, FALSE);
247 - print_gl_config_attrib (glconfig, "GDK_GL_DEPTH_SIZE", GDK_GL_DEPTH_SIZE, FALSE);
248 - print_gl_config_attrib (glconfig, "GDK_GL_STENCIL_SIZE", GDK_GL_STENCIL_SIZE, FALSE);
249 - print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_RED_SIZE", GDK_GL_ACCUM_RED_SIZE, FALSE);
250 - print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_GREEN_SIZE", GDK_GL_ACCUM_GREEN_SIZE, FALSE);
251 - print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_BLUE_SIZE", GDK_GL_ACCUM_BLUE_SIZE, FALSE);
252 - print_gl_config_attrib (glconfig, "GDK_GL_ACCUM_ALPHA_SIZE", GDK_GL_ACCUM_ALPHA_SIZE, FALSE);
254 - g_print ("\n");
257 -int
258 -main (int argc,
259 - char *argv[])
261 - GdkGLConfig *glconfig;
262 - gint major, minor;
264 - GtkWidget *window;
265 - GtkWidget *vbox;
266 - GtkWidget *drawing_area;
267 - GtkWidget *button;
269 - /*
270 - * Init GTK.
271 - */
273 - gtk_init (&argc, &argv);
275 - /*
276 - * Init GtkGLExt.
277 - */
279 - gtk_gl_init (&argc, &argv);
281 - /*
282 - * Query OpenGL extension version.
283 - */
285 - gdk_gl_query_version (&major, &minor);
286 - g_print ("\nOpenGL extension version - %d.%d\n",
287 - major, minor);
289 - /*
290 - * Configure OpenGL-capable visual.
291 - */
293 - /* Try double-buffered visual */
294 - glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGB |
295 - GDK_GL_MODE_DOUBLE);
296 - if (glconfig == NULL)
298 - g_print ("*** Cannot find the double-buffered visual.\n");
299 - g_print ("*** Trying single-buffered visual.\n");
301 - /* Try single-buffered visual */
302 - glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGB);
303 - if (glconfig == NULL)
305 - g_print ("*** No appropriate OpenGL-capable visual found.\n");
306 - exit (1);
310 - examine_gl_config_attrib (glconfig);
312 - /*
313 - * Top-level window.
314 - */
316 - window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
317 - gtk_window_set_title (GTK_WINDOW (window), "font");
319 - /* Get automatically redrawn if any of their children changed allocation. */
320 - gtk_container_set_reallocate_redraws (GTK_CONTAINER (window), TRUE);
322 - g_signal_connect (G_OBJECT (window), "delete_event",
323 - G_CALLBACK (gtk_main_quit), NULL);
325 - /*
326 - * VBox.
327 - */
329 - vbox = gtk_vbox_new (FALSE, 0);
330 - gtk_container_add (GTK_CONTAINER (window), vbox);
331 - gtk_widget_show (vbox);
333 - /*
334 - * Drawing area for drawing OpenGL scene.
335 - */
337 - drawing_area = gtk_drawing_area_new ();
338 - gtk_widget_set_size_request (drawing_area, 640, 240);
340 - /* Set OpenGL-capability to the widget. */
341 - gtk_widget_set_gl_capability (drawing_area,
342 - glconfig,
343 - NULL,
344 - TRUE,
345 - GDK_GL_RGBA_TYPE);
347 - g_signal_connect_after (G_OBJECT (drawing_area), "realize",
348 - G_CALLBACK (realize), NULL);
349 - g_signal_connect (G_OBJECT (drawing_area), "configure_event",
350 - G_CALLBACK (configure_event), NULL);
351 - g_signal_connect (G_OBJECT (drawing_area), "expose_event",
352 - G_CALLBACK (expose_event), NULL);
354 - gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
356 - gtk_widget_show (drawing_area);
358 - /*
359 - * Simple quit button.
360 - */
362 - button = gtk_button_new_with_label ("Quit");
364 - g_signal_connect (G_OBJECT (button), "clicked",
365 - G_CALLBACK (gtk_main_quit), NULL);
367 - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
369 - gtk_widget_show (button);
371 - /*
372 - * Show window.
373 - */
375 - gtk_widget_show (window);
377 - /*
378 - * Main loop.
379 - */
381 - gtk_main ();
383 - return 0;
385 diff -ruN gtkglext-1.2.0.orig/examples/Makefile.am gtkglext-1.2.0/examples/Makefile.am
386 --- gtkglext-1.2.0.orig/examples/Makefile.am 2003-09-09 09:50:04.000000000 +0000
387 +++ gtkglext-1.2.0/examples/Makefile.am 2020-04-28 12:38:52.422260365 +0000
388 @@ -45,7 +45,6 @@
389 pixmap-mixed \
390 share-lists \
391 color \
392 - font \
393 button \
394 shapes \
395 logo \
396 @@ -101,10 +100,6 @@
397 color_DEPENDENCIES = $(DEPS)
398 color_LDADD = $(LDADDS)
400 -font_SOURCES = font.c
401 -font_DEPENDENCIES = $(DEPS)
402 -font_LDADD = $(LDADDS)
404 button_SOURCES = button.c
405 button_DEPENDENCIES = $(DEPS)
406 button_LDADD = $(LDADDS)
407 diff -ruN gtkglext-1.2.0.orig/gdk/gdkglfont.h gtkglext-1.2.0/gdk/gdkglfont.h
408 --- gtkglext-1.2.0.orig/gdk/gdkglfont.h 2004-02-20 09:38:10.000000000 +0000
409 +++ gtkglext-1.2.0/gdk/gdkglfont.h 1970-01-01 00:00:00.000000000 +0000
410 @@ -1,44 +0,0 @@
411 -/* GdkGLExt - OpenGL Extension to GDK
412 - * Copyright (C) 2002-2004 Naofumi Yasufuku
414 - * This library is free software; you can redistribute it and/or
415 - * modify it under the terms of the GNU Lesser General Public
416 - * License as published by the Free Software Foundation; either
417 - * version 2.1 of the License, or (at your option) any later version.
419 - * This library is distributed in the hope that it will be useful,
420 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
421 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
422 - * Lesser General Public License for more details.
424 - * You should have received a copy of the GNU Lesser General Public
425 - * License along with this library; if not, write to the Free Software
426 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
427 - */
429 -#ifndef __GDK_GL_FONT_H__
430 -#define __GDK_GL_FONT_H__
432 -#include <gdk/gdkgldefs.h>
433 -#include <gdk/gdkgltypes.h>
435 -G_BEGIN_DECLS
437 -#ifndef GDK_MULTIHEAD_SAFE
438 -PangoFont *gdk_gl_font_use_pango_font (const PangoFontDescription *font_desc,
439 - int first,
440 - int count,
441 - int list_base);
442 -#endif /* GDK_MULTIHEAD_SAFE */
444 -#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
445 -PangoFont *gdk_gl_font_use_pango_font_for_display (GdkDisplay *display,
446 - const PangoFontDescription *font_desc,
447 - int first,
448 - int count,
449 - int list_base);
450 -#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */
452 -G_END_DECLS
454 -#endif /* __GDK_GL_FONT_H__ */
455 diff -ruN gtkglext-1.2.0.orig/gdk/gdkgl.h gtkglext-1.2.0/gdk/gdkgl.h
456 --- gtkglext-1.2.0.orig/gdk/gdkgl.h 2004-02-20 09:38:10.000000000 +0000
457 +++ gtkglext-1.2.0/gdk/gdkgl.h 2020-04-28 12:36:16.503298432 +0000
458 @@ -33,7 +33,6 @@
459 #include <gdk/gdkgldrawable.h>
460 #include <gdk/gdkglpixmap.h>
461 #include <gdk/gdkglwindow.h>
462 -#include <gdk/gdkglfont.h>
463 #include <gdk/gdkglshapes.h>
465 #endif /* __GDK_GL_H__ */
466 diff -ruN gtkglext-1.2.0.orig/gdk/Makefile.am gtkglext-1.2.0/gdk/Makefile.am
467 --- gtkglext-1.2.0.orig/gdk/Makefile.am 2003-08-15 09:10:38.000000000 +0000
468 +++ gtkglext-1.2.0/gdk/Makefile.am 2020-04-28 12:36:09.336526338 +0000
469 @@ -76,7 +76,6 @@
470 gdkgldrawable.h \
471 gdkglpixmap.h \
472 gdkglwindow.h \
473 - gdkglfont.h \
474 gdkglshapes.h \
475 gdkglglext.h
477 diff -ruN gtkglext-1.2.0.orig/gdk/win32/gdkglfont-win32.c gtkglext-1.2.0/gdk/win32/gdkglfont-win32.c
478 --- gtkglext-1.2.0.orig/gdk/win32/gdkglfont-win32.c 2004-02-20 09:38:13.000000000 +0000
479 +++ gtkglext-1.2.0/gdk/win32/gdkglfont-win32.c 1970-01-01 00:00:00.000000000 +0000
480 @@ -1,109 +0,0 @@
481 -/* GdkGLExt - OpenGL Extension to GDK
482 - * Copyright (C) 2002-2004 Naofumi Yasufuku
484 - * This library is free software; you can redistribute it and/or
485 - * modify it under the terms of the GNU Lesser General Public
486 - * License as published by the Free Software Foundation; either
487 - * version 2.1 of the License, or (at your option) any later version.
489 - * This library is distributed in the hope that it will be useful,
490 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
491 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
492 - * Lesser General Public License for more details.
494 - * You should have received a copy of the GNU Lesser General Public
495 - * License along with this library; if not, write to the Free Software
496 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
497 - */
499 -#include <pango/pangowin32.h>
501 -#include "gdkglwin32.h"
502 -#include "gdkglprivate-win32.h"
503 -#include "gdkglfont.h"
505 -#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
506 -#include <gdk/gdkdisplay.h>
507 -#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */
509 -PangoFont *
510 -gdk_gl_font_use_pango_font (const PangoFontDescription *font_desc,
511 - int first,
512 - int count,
513 - int list_base)
515 - PangoFontMap *font_map;
516 - PangoFont *font = NULL;
517 - LOGFONT *logfont = NULL;
518 - PangoWin32FontCache *font_cache;
519 - HFONT hfont;
520 - HDC hdc;
522 - g_return_val_if_fail (font_desc != NULL, NULL);
524 - GDK_GL_NOTE_FUNC ();
526 - font_map = pango_win32_font_map_for_display ();
528 - font = pango_font_map_load_font (font_map, NULL, font_desc);
529 - if (font == NULL)
531 - g_warning ("cannot load PangoFont");
532 - goto FAIL;
535 - logfont = pango_win32_font_logfont (font);
536 - if (logfont == NULL)
538 - g_warning ("cannot get LOGFONT struct");
539 - font = NULL;
540 - goto FAIL;
543 - font_cache = pango_win32_font_map_get_font_cache (font_map);
545 - hfont = pango_win32_font_cache_load (font_cache, logfont);
547 - hdc = CreateCompatibleDC (NULL);
548 - if (hdc == NULL)
550 - g_warning ("cannot create a memory DC");
551 - font = NULL;
552 - goto FAIL;
555 - SelectObject (hdc, hfont);
557 - if (!wglUseFontBitmaps (hdc, first, count, list_base))
559 - g_warning ("cannot create the font display lists");
560 - font = NULL;
561 - goto FAIL;
564 - if (!DeleteDC (hdc))
565 - g_warning ("cannot delete the memory DC");
567 - pango_win32_font_cache_unload (font_cache, hfont);
569 - FAIL:
571 - if (logfont != NULL)
572 - g_free (logfont);
574 - return font;
577 -#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
579 -PangoFont *
580 -gdk_gl_font_use_pango_font_for_display (GdkDisplay *display,
581 - const PangoFontDescription *font_desc,
582 - int first,
583 - int count,
584 - int list_base)
586 - return gdk_gl_font_use_pango_font (font_desc, first, count, list_base);
589 -#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */
590 diff -ruN gtkglext-1.2.0.orig/gdk/win32/Makefile.am gtkglext-1.2.0/gdk/win32/Makefile.am
591 --- gtkglext-1.2.0.orig/gdk/win32/Makefile.am 2003-08-15 01:39:54.000000000 +0000
592 +++ gtkglext-1.2.0/gdk/win32/Makefile.am 2020-04-28 12:36:35.270241212 +0000
593 @@ -36,7 +36,6 @@
594 gdkgldrawable-win32.c \
595 gdkglpixmap-win32.c \
596 gdkglwindow-win32.c \
597 - gdkglfont-win32.c \
598 gdkglwglext.c
600 gdkglext_win32_headers = \
601 diff -ruN gtkglext-1.2.0.orig/gdk/x11/gdkglfont-x11.c gtkglext-1.2.0/gdk/x11/gdkglfont-x11.c
602 --- gtkglext-1.2.0.orig/gdk/x11/gdkglfont-x11.c 2004-02-20 09:38:14.000000000 +0000
603 +++ gtkglext-1.2.0/gdk/x11/gdkglfont-x11.c 1970-01-01 00:00:00.000000000 +0000
604 @@ -1,196 +0,0 @@
605 -/* GdkGLExt - OpenGL Extension to GDK
606 - * Copyright (C) 2002-2004 Naofumi Yasufuku
608 - * This library is free software; you can redistribute it and/or
609 - * modify it under the terms of the GNU Lesser General Public
610 - * License as published by the Free Software Foundation; either
611 - * version 2.1 of the License, or (at your option) any later version.
613 - * This library is distributed in the hope that it will be useful,
614 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
615 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
616 - * Lesser General Public License for more details.
618 - * You should have received a copy of the GNU Lesser General Public
619 - * License along with this library; if not, write to the Free Software
620 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
621 - */
623 -#include <string.h>
625 -#include <pango/pangox.h>
627 -#include "gdkglx.h"
628 -#include "gdkglprivate-x11.h"
629 -#include "gdkglfont.h"
631 -#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
632 -#include <gdk/gdkdisplay.h>
633 -#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */
636 - * This code is ripped from gdk/x11/gdkfont-x11.c in GTK+.
637 - */
638 -static char *
639 -gdk_gl_font_charset_for_locale (void)
641 - static char *charset_map[][2] = {
642 - { "ANSI_X3.4-1968", "iso8859-1" },
643 - { "US-ASCII", "iso8859-1" },
644 - { "ISO-8859-1", "iso8859-1" },
645 - { "ISO-8859-2", "iso8859-2" },
646 - { "ISO-8859-3", "iso8859-3" },
647 - { "ISO-8859-4", "iso8859-4" },
648 - { "ISO-8859-5", "iso8859-5" },
649 - { "ISO-8859-6", "iso8859-6" },
650 - { "ISO-8859-7", "iso8859-7" },
651 - { "ISO-8859-8", "iso8859-8" },
652 - { "ISO-8859-9", "iso8859-9" },
653 - { "UTF-8", "iso8859-1" }
654 - };
656 - const char *codeset;
657 - char *result = NULL;
658 - gsize i;
660 - g_get_charset (&codeset);
662 - for (i = 0; i < G_N_ELEMENTS (charset_map); i++)
663 - if (strcmp (charset_map[i][0], codeset) == 0)
665 - result = charset_map[i][1];
666 - break;
669 - if (result != NULL)
670 - return g_strdup (result);
671 - else
672 - return g_strdup ("iso8859-1");
675 -static PangoFont *
676 -gdk_gl_font_use_pango_font_common (PangoFontMap *font_map,
677 - const PangoFontDescription *font_desc,
678 - int first,
679 - int count,
680 - int list_base)
682 - PangoFont *font = NULL;
683 - gchar *charset = NULL;
684 - PangoXSubfont subfont_id;
685 - gchar *xlfd = NULL;
686 - PangoXFontCache *font_cache;
687 - XFontStruct *fs;
689 - GDK_GL_NOTE_FUNC_PRIVATE ();
691 - font = pango_font_map_load_font (font_map, NULL, font_desc);
692 - if (font == NULL)
694 - g_warning ("cannot load PangoFont");
695 - goto FAIL;
698 - charset = gdk_gl_font_charset_for_locale ();
699 - if (!pango_x_find_first_subfont (font, &charset, 1, &subfont_id))
701 - g_warning ("cannot find PangoXSubfont");
702 - font = NULL;
703 - goto FAIL;
706 - xlfd = pango_x_font_subfont_xlfd (font, subfont_id);
707 - if (xlfd == NULL)
709 - g_warning ("cannot get XLFD");
710 - font = NULL;
711 - goto FAIL;
714 - font_cache = pango_x_font_map_get_font_cache (font_map);
716 - fs = pango_x_font_cache_load (font_cache, xlfd);
718 - glXUseXFont (fs->fid, first, count, list_base);
720 - pango_x_font_cache_unload (font_cache, fs);
722 - FAIL:
724 - if (charset != NULL)
725 - g_free (charset);
727 - if (xlfd != NULL)
728 - g_free (xlfd);
730 - return font;
733 -/**
734 - * gdk_gl_font_use_pango_font:
735 - * @font_desc: a #PangoFontDescription describing the font to use.
736 - * @first: the index of the first glyph to be taken.
737 - * @count: the number of glyphs to be taken.
738 - * @list_base: the index of the first display list to be generated.
740 - * Creates bitmap display lists from a #PangoFont.
742 - * Return value: the #PangoFont used, or NULL if no font matched.
743 - **/
744 -PangoFont *
745 -gdk_gl_font_use_pango_font (const PangoFontDescription *font_desc,
746 - int first,
747 - int count,
748 - int list_base)
750 - PangoFontMap *font_map;
752 - g_return_val_if_fail (font_desc != NULL, NULL);
754 - GDK_GL_NOTE_FUNC ();
756 -#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
757 - font_map = pango_x_font_map_for_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
758 -#else /* GDKGLEXT_MULTIHEAD_SUPPORT */
759 - font_map = pango_x_font_map_for_display (gdk_x11_get_default_xdisplay ());
760 -#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */
762 - return gdk_gl_font_use_pango_font_common (font_map, font_desc,
763 - first, count, list_base);
766 -#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
768 -/**
769 - * gdk_gl_font_use_pango_font_for_display:
770 - * @display: a #GdkDisplay.
771 - * @font_desc: a #PangoFontDescription describing the font to use.
772 - * @first: the index of the first glyph to be taken.
773 - * @count: the number of glyphs to be taken.
774 - * @list_base: the index of the first display list to be generated.
776 - * Creates bitmap display lists from a #PangoFont.
778 - * Return value: the #PangoFont used, or NULL if no font matched.
779 - **/
780 -PangoFont *
781 -gdk_gl_font_use_pango_font_for_display (GdkDisplay *display,
782 - const PangoFontDescription *font_desc,
783 - int first,
784 - int count,
785 - int list_base)
787 - PangoFontMap *font_map;
789 - g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
790 - g_return_val_if_fail (font_desc != NULL, NULL);
792 - GDK_GL_NOTE_FUNC ();
794 - font_map = pango_x_font_map_for_display (GDK_DISPLAY_XDISPLAY (display));
796 - return gdk_gl_font_use_pango_font_common (font_map, font_desc,
797 - first, count, list_base);
800 -#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */
801 diff -ruN gtkglext-1.2.0.orig/gdk/x11/Makefile.am gtkglext-1.2.0/gdk/x11/Makefile.am
802 --- gtkglext-1.2.0.orig/gdk/x11/Makefile.am 2003-05-07 18:18:42.000000000 +0000
803 +++ gtkglext-1.2.0/gdk/x11/Makefile.am 2020-04-28 12:37:19.780896258 +0000
804 @@ -38,7 +38,6 @@
805 gdkgldrawable-x11.c \
806 gdkglpixmap-x11.c \
807 gdkglwindow-x11.c \
808 - gdkglfont-x11.c \
809 gdkglglxext.c
811 gdkglext_x11_headers = \