[gtk+] gl: Move getters for context options to the public API



commit 6aaa6c337bc85913f0f898239cd678fef2a89b20
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Jan 28 14:37:26 2015 +0000

    gl: Move getters for context options to the public API
    
    They can be useful for third party code as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741946

 gdk/gdkglcontext.c        |   16 +++++++++++++---
 gdk/gdkglcontext.h        |    8 ++++++++
 gdk/gdkglcontextprivate.h |    5 -----
 3 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 360d0e9..55ee9f1 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -426,19 +426,23 @@ gdk_gl_context_set_debug_enabled (GdkGLContext *context,
   priv->debug_enabled = enabled;
 }
 
-/*< private >
+/**
  * gdk_gl_context_get_debug_enabled:
  * @context: a #GdkGLContext
  *
  * Retrieves the value set using gdk_gl_context_set_debug_enabled().
  *
  * Returns: %TRUE if debugging is enabled
+ *
+ * Since: 3.16
  */
 gboolean
 gdk_gl_context_get_debug_enabled (GdkGLContext *context)
 {
   GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
 
+  g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
+
   return priv->debug_enabled;
 }
 
@@ -472,19 +476,23 @@ gdk_gl_context_set_forward_compatible (GdkGLContext *context,
   priv->forward_compatible = compatible;
 }
 
-/*< private >
+/**
  * gdk_gl_context_get_forward_compatible:
  * @context: a #GdkGLContext
  *
  * Retrieves the value set using gdk_gl_context_set_forward_compatible().
  *
  * Returns: %TRUE if the context should be forward compatible
+ *
+ * Since: 3.16
  */
 gboolean
 gdk_gl_context_get_forward_compatible (GdkGLContext *context)
 {
   GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
 
+  g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), FALSE);
+
   return priv->forward_compatible;
 }
 
@@ -520,7 +528,7 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
   priv->minor = minor;
 }
 
-/*< private >
+/**
  * gdk_gl_context_get_required_version:
  * @context: a #GdkGLContext
  * @major: (out) (nullable): return location for the major version to request
@@ -528,6 +536,8 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
  *
  * Retrieves the major and minor version requested by calling
  * gdk_gl_context_set_required_version().
+ *
+ * Since: 3.16
  */
 void
 gdk_gl_context_get_required_version (GdkGLContext *context,
diff --git a/gdk/gdkglcontext.h b/gdk/gdkglcontext.h
index 0500317..dda7068 100644
--- a/gdk/gdkglcontext.h
+++ b/gdk/gdkglcontext.h
@@ -56,11 +56,19 @@ void                    gdk_gl_context_set_required_version     (GdkGLContext  *
                                                                  int            major,
                                                                  int            minor);
 GDK_AVAILABLE_IN_3_16
+void                    gdk_gl_context_get_required_version     (GdkGLContext  *context,
+                                                                 int           *major,
+                                                                 int           *minor);
+GDK_AVAILABLE_IN_3_16
 void                    gdk_gl_context_set_debug_enabled        (GdkGLContext  *context,
                                                                  gboolean       enabled);
 GDK_AVAILABLE_IN_3_16
+gboolean                gdk_gl_context_get_debug_enabled        (GdkGLContext  *context);
+GDK_AVAILABLE_IN_3_16
 void                    gdk_gl_context_set_forward_compatible   (GdkGLContext  *context,
                                                                  gboolean       compatible);
+GDK_AVAILABLE_IN_3_16
+gboolean                gdk_gl_context_get_forward_compatible   (GdkGLContext  *context);
 
 GDK_AVAILABLE_IN_3_16
 gboolean                gdk_gl_context_realize                  (GdkGLContext  *context,
diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h
index e579bf5..0bd5d14 100644
--- a/gdk/gdkglcontextprivate.h
+++ b/gdk/gdkglcontextprivate.h
@@ -74,11 +74,6 @@ typedef struct {
   GdkGLContextProgram *current_program;
 } GdkGLContextPaintData;
 
-void                    gdk_gl_context_get_required_version     (GdkGLContext   *context,
-                                                                 int            *major,
-                                                                 int            *minor);
-gboolean                gdk_gl_context_get_debug_enabled        (GdkGLContext   *context);
-gboolean                gdk_gl_context_get_forward_compatible   (GdkGLContext   *context);
 GdkGLContextPaintData * gdk_gl_context_get_paint_data           (GdkGLContext   *context);
 gboolean                gdk_gl_context_use_texture_rectangle    (GdkGLContext   *context);
 gboolean                gdk_gl_context_has_framebuffer_blit     (GdkGLContext   *context);


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