[gtkglarea/jjardon/gtk3: 5/9] Remove GdkPixmap related API



commit 1fe5d88a21957319d031c7247a419cab170927e6
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Mar 19 22:51:32 2014 +0000

    Remove GdkPixmap related API

 docs/gdkgl.txt      |   91 ----------------------
 examples/glpixmap.c |  109 --------------------------
 gtkgl/gdkgl.c       |  213 ---------------------------------------------------
 gtkgl/gdkgl.h       |   17 ----
 4 files changed, 0 insertions(+), 430 deletions(-)
---
diff --git a/docs/gdkgl.txt b/docs/gdkgl.txt
index ea23439..cf82ba6 100644
--- a/docs/gdkgl.txt
+++ b/docs/gdkgl.txt
@@ -249,94 +249,3 @@ DESCRIPTION
 SEE ALSO
        glXWaitGL
        gdk_gl_wait_gdk
-
-
----------------------------------------------------------------
-
-NAME
-       gdk_gl_pixmap_new - create an off screen rendering area
-
-C SPECIFICATION
-
-       GdkGLPixmap *gdk_gl_pixmap_new( GdkVisual *visual,
-                                       GdkPixmap *pixmap )
-
-DESCRIPTION
-       gdk_gl_pixmap_new returns pointer to new GdkGLPixmap with
-       reference count of 1. pixmap will become front left buffer
-       of GdkGLPixmap.
-
-SEE ALSO
-       glXCreateGLXPixmap
-       gdk_gl_pixmap_ref
-       gdk_gl_pixmap_unref
-
----------------------------------------------------------------
-
-NAME
-       gdk_gl_pixmap_ref - increase glpixmap reference count
-
-C SPECIFICATION
-       GdkGLPixmap *gdk_gl_pixmap_ref( GdkGLPixmap *glpixmap )
-
-PARAMETERS
-
-glpixmap
-       a pointer to GdkGLPixmap
-
-DESCRIPTION
-
-SEE ALSO
-       gdk_gl_pixmap_new
-       gdk_gl_pixmap_unref
-
-
----------------------------------------------------------------
-
-NAME
-       gdk_gl_pixmap_unref - decrease glpixmap reference count
-
-C SPECIFICATION
-       void gdk_gl_pixmap_unref( GdkGLPixmap *glpixmap )
-
-PARAMETERS
-
-glpixmap
-       a pointer to GdkGLPixmap
-
-DESCRIPTION
-       gdk_gl_pixmap_unref decreases reference count of
-       GdkGLPixmap by 1 and deletes pixmap if reference count
-       reaches 0.
-
-SEE ALSO
-       glXDestroyGLXPixmap
-       gdk_gl_pixmap_new
-       gdk_gl_pixmap_ref
-
-
----------------------------------------------------------------
-
-NAME
-       gdk_gl_pixmap_make_current - attach context to glpixmap
-
-C SPECIFICATION
-       gint gdk_gl_pixmap_make_current( GdkGLPixmap *glpixmap,
-                                        GdkGLContext *context )
-
-PARAMETERS
-
-glpixmap
-       a pointer to GdkGLPixmap
-
-context
-       a pointer to GdkGLContext
-
-DESCRIPTION
-       gdk_gl_pixmap_make_current make context current OpenGL
-       rendering context, and it attaches context to glpixmap.
-       gdk_gl_pixmap_make_current returns TRUE of successful.
-
-SEE ALSO
-       glXMakeCurrent
-       gdk_gl_make_current
diff --git a/gtkgl/gdkgl.c b/gtkgl/gdkgl.c
index 6e8613e..725fccd 100644
--- a/gtkgl/gdkgl.c
+++ b/gtkgl/gdkgl.c
@@ -66,31 +66,6 @@ static GObjectClass *glcontext_parent_class;
 static void gdk_gl_context_class_init (GdkGLContextClass *class);
 
 /*
- *  The GdkGLPixmap class
- */
-struct _GdkGLPixmap {
-  GObject   parent;
-#if defined GDK_WINDOWING_WIN32
-  gboolean  initialised;
-  HDC       hdc;
-  HBITMAP   hbitmap;
-  GdkPixmap *pixmap;
-#elif defined GDK_WINDOWING_X11
-  Display   *xdisplay;
-  GLXPixmap glxpixmap;
-  GdkPixmap *front_left;
-#endif
-};
-
-struct _GdkGLPixmapClass {
-  GObjectClass parent_class;
-};
-typedef struct _GdkGLPixmapClass GdkGLPixmapClass;
-
-static GObjectClass *glpixmap_parent_class;
-static void gdk_gl_pixmap_class_init (GdkGLPixmapClass *class);
-
-/*
  *  Local helper functions
  */
 #if defined GDK_WINDOWING_WIN32
@@ -485,194 +460,6 @@ void gdk_gl_wait_gl (void)
 #endif
 }
 
-
-/*
- *  Pixmap support
- */
-
-GType
-gdk_gl_pixmap_get_type (void)
-{
-  static GType object_type = 0;
-
-  if (!object_type)
-    {
-      static const GTypeInfo object_info =
-      {
-        sizeof (GdkGLPixmapClass),
-        (GBaseInitFunc) NULL,
-        (GBaseFinalizeFunc) NULL,
-        (GClassInitFunc) gdk_gl_pixmap_class_init,
-        NULL,           /* class_finalize */
-        NULL,           /* class_data */
-        sizeof (GdkGLPixmap),
-        0,              /* n_preallocs */
-        (GInstanceInitFunc) NULL,
-      };
-
-      object_type = g_type_register_static (G_TYPE_OBJECT,
-                                            "GdkGLPixmap",
-                                            &object_info, 0);
-    }
-  return object_type;
-}
-
-static void
-gdk_gl_pixmap_finalize(GObject *object)
-{
-  GdkGLPixmap *pixmap;
-
-  pixmap = GDK_GL_PIXMAP(object);
-
-#if defined GDK_WINDOWING_WIN32
-  glFinish ();
-  SelectObject (pixmap->hdc, pixmap->hbitmap);
-  gdk_pixmap_unref (pixmap->pixmap);
-#elif defined GDK_WINDOWING_X11
-  if (pixmap->glxpixmap != None) {
-    glXDestroyGLXPixmap(pixmap->xdisplay, pixmap->glxpixmap);
-    glXWaitGL();
-  }
-  pixmap->glxpixmap = None;
-  if (pixmap->front_left) {
-    gdk_pixmap_unref(pixmap->front_left);
-    glXWaitX();
-  }
-  pixmap->front_left = NULL;
-#endif
-
-  (* glcontext_parent_class->finalize)(object);
-}
-
-static void
-gdk_gl_pixmap_class_init(GdkGLPixmapClass *class)
-{
-  GObjectClass *gobject_class;
-
-  gobject_class = G_OBJECT_CLASS(class);
-  glpixmap_parent_class = g_type_class_peek_parent(class);
-
-  gobject_class->finalize = gdk_gl_pixmap_finalize;
-}
-
-GdkGLPixmap *
-gdk_gl_pixmap_new(GdkVisual *visual, GdkPixmap *pixmap)
-{
-  GdkGLPixmap *glpixmap;
-#ifndef GDK_WINDOWING_WIN32
-  Display *dpy;
-  XVisualInfo *vi;
-  Pixmap xpixmap;
-  GLXPixmap glxpixmap;
-  Window root_return;
-  unsigned int w_ret, h_ret, bw_ret, depth_ret;
-  int x_ret, y_ret;
-#elif defined GDK_WINDOWING_X11
-#else
-  g_warning ("gdk_gl_pixmap_new not implemented on " PLATFORM);
-  return NULL;
-#endif
-
-  g_return_val_if_fail(GDK_IS_VISUAL(visual), NULL);
-  g_return_val_if_fail(GDK_IS_PIXMAP(pixmap), NULL);
-
-  glpixmap = g_object_new(GDK_TYPE_GL_PIXMAP, NULL);
-  if (!glpixmap)
-    return NULL;
-
-#if defined GDK_WINDOWING_WIN32
-  glpixmap->initialised = FALSE;
-  glpixmap->hdc = NULL;
-  glpixmap->hbitmap = NULL;
-  glpixmap->pixmap = gdk_pixmap_ref (pixmap);
-#elif defined GDK_WINDOWING_X11
-  dpy = gdk_x11_get_default_xdisplay();
-  xpixmap = (Pixmap)GDK_DRAWABLE_XID(pixmap);
-
-  g_return_val_if_fail(XGetGeometry(dpy, xpixmap, &root_return,
-                                   &x_ret, &y_ret, &w_ret, &h_ret,
-                                    &bw_ret, &depth_ret), NULL);
-
-  g_return_val_if_fail((gdk_gl_get_config(visual, GDK_GL_RED_SIZE) +
-                       gdk_gl_get_config(visual, GDK_GL_GREEN_SIZE) +
-                       gdk_gl_get_config(visual, GDK_GL_BLUE_SIZE)) == depth_ret, NULL);
-
-  vi = get_xvisualinfo(visual);
-  glxpixmap = glXCreateGLXPixmap(dpy, vi, xpixmap);
-  XFree(vi);
-
-  g_return_val_if_fail(glxpixmap != None, NULL);
-
-  glpixmap->xdisplay   = dpy;
-  glpixmap->glxpixmap  = glxpixmap;
-  glpixmap->front_left = gdk_pixmap_ref(pixmap);
-#endif
-
-  return glpixmap;
-}
-
-
-gint gdk_gl_pixmap_make_current(GdkGLPixmap *glpixmap, GdkGLContext *context)
-{
-#ifndef GDK_WINDOWING_WIN32
-  Display  *dpy;
-  GLXPixmap glxpixmap;
-  GLXContext glxcontext;
-#elif defined GDK_WINDOWING_X11
-#else
-  g_warning ("gdk_gl_pixmap_make_current not implemented on " PLATFORM);
-  return 0;
-#endif
-
-  g_return_val_if_fail (GDK_IS_GL_PIXMAP(glpixmap), FALSE);
-  g_return_val_if_fail (GDK_IS_GL_CONTEXT(context), FALSE);
-
-#if defined GDK_WINDOWING_WIN32
-  if (!context->initialised)
-  {
-    int pf;
-
-    context->hdc = CreateCompatibleDC (NULL);
-    glpixmap->hdc = context->hdc;
-    glpixmap->hbitmap = SelectObject (context->hdc, (HBITMAP) gdk_win32_drawable_get_handle 
(glpixmap->pixmap));
-
-    pf = ChoosePixelFormat (context->hdc, &context->pfd);
-
-    if (pf != 0)
-      {
-        SetPixelFormat (context->hdc, pf, &context->pfd);
-        context->hglrc = wglCreateContext (context->hdc);
-      }
-
-    if (context->share)
-      {
-        if (context->share->hglrc)
-          {
-            if (wglShareLists (context->share->hglrc, context->hglrc) != TRUE)
-                g_warning ("failed sharing context");
-          }
-        gdk_gl_context_unref ((GdkGLContext*)context->share);
-      }
-
-    context->initialised = TRUE;
-  }
-
-  g_return_val_if_fail (context->hdc    != NULL, FALSE);
-  g_return_val_if_fail (context->hglrc  != NULL, FALSE);
-
-  wglMakeCurrent (context->hdc, context->hglrc);
-
-  return TRUE;
-#elif defined GDK_WINDOWING_X11
-  dpy        = context->xdisplay;
-  glxpixmap  = glpixmap->glxpixmap;
-  glxcontext = context->glxcontext;
-
-  return (glXMakeCurrent(dpy, glxpixmap, glxcontext) == True) ? TRUE : FALSE;
-#endif
-}
-
-
 /*
  *  Helper functions
  */
diff --git a/gtkgl/gdkgl.h b/gtkgl/gdkgl.h
index ad20bb8..4766bb3 100644
--- a/gtkgl/gdkgl.h
+++ b/gtkgl/gdkgl.h
@@ -98,23 +98,6 @@ void          gdk_gl_wait_gdk(void);
 void          gdk_gl_wait_gl(void);
 
 
-/* glpixmap stuff */
-
-#define GDK_TYPE_GL_PIXMAP            (gdk_gl_pixmap_get_type())
-#define GDK_GL_PIXMAP(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_PIXMAP, GdkGLPixmap))
-#define GDK_GL_PIXMAP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST (klass, GDK_TYPE_GL_PIXMAP, GdkGLPixmapClass))
-#define GDK_IS_GL_PIXMAP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_PIXMAP))
-#define GDK_IS_GL_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_PIXMAP))
-#define GDK_GL_PIXMAP_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_PIXMAP, GdkGLPixmap))
-
-typedef struct _GdkGLPixmap GdkGLPixmap;
-
-GType        gdk_gl_pixmap_get_type(void);
-GdkGLPixmap *gdk_gl_pixmap_new(GdkVisual *visual, GdkPixmap *pixmap);
-
-gint         gdk_gl_pixmap_make_current(GdkGLPixmap *glpixmap, GdkGLContext *context);
-
-
 #ifndef GTKGL_DISABLE_DEPRECATED
 #  define gdk_gl_context_ref(context)   g_object_ref(context)
 #  define gdk_gl_context_unref(context) g_object_unref(context)


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