summaryrefslogtreecommitdiff
path: root/cogl
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-03-06 18:21:28 +0000
committerNeil Roberts <neil@linux.intel.com>2012-03-06 18:45:44 +0000
commit185630085ca76459b5f5a2613eef6c10b8b0ebf7 (patch)
tree3fb755b1564447696046e29ebd7a6762669ddc33 /cogl
parentf10ed2d1dc88ada2a2c90b1506ae2306c8e6d716 (diff)
downloadcogl-185630085ca76459b5f5a2613eef6c10b8b0ebf7.tar.gz
Add -Wmissing-declarations to maintainer flags and fix problems
This option to GCC makes it give a warning whenever a global function is defined without a declaration. This should catch cases were we've defined a function but forgot to put it in a header. In that case it is either only used within one file so we should make it static or we should declare it in a header. The following changes where made to fix problems: • Some functions were made static • cogl-path.h (the one containing the 1.0 API) was split into two files, one defining the functions and one defining the enums so that cogl-path.c can include the enum and function declarations from the 2.0 API as well as the function declarations from the 1.0 API. • cogl2-clip-state has been removed. This only had one experimental function called cogl_clip_push_from_path but as this is unstable we might as well remove it favour of the equivalent cogl_framebuffer_* API. • The GLX, SDL and WGL winsys's now have a private header to define their get_vtable function instead of directly declaring in the C file where it is called. • All places that were calling COGL_OBJECT_DEFINE need to have the cogl_is_whatever function declared so these have been added either as a public function or in a private header. • Some files that were not including the header containing their function declarations have been fixed to do so. • Any unused error quark functions have been removed. If we later want them we should add them back one by one and add a declaration for them in a header. • _cogl_is_framebuffer has been renamed to cogl_is_framebuffer and made a public function with a declaration in cogl-framebuffer.h • Similarly for CoglOnscreen. • cogl_vdraw_indexed_attributes is called cogl_framebuffer_vdraw_indexed_attributes in the header. The definition has been changed to match the header. • cogl_index_buffer_allocate has been removed. This had no declaration and I'm not sure what it's supposed to do. • CoglJournal has been changed to use the internal CoglObject macro so that it won't define an exported cogl_is_journal symbol. • The _cogl_blah_pointer_from_handle functions have been removed. CoglHandle isn't used much anymore anyway and in the few places where it is used I think it's safe to just use the implicit cast from void* to the right type. • The test-utils.h header for the conformance tests explicitly disables the -Wmissing-declaration option using a pragma because all of the tests declare their main function without a header. Any mistakes relating to missing declarations aren't really important for the tests. • cogl_quaternion_init_from_quaternion and init_from_matrix have been given declarations in cogl-quaternion.h Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl')
-rw-r--r--cogl/Makefile.am7
-rw-r--r--cogl/cogl-atlas-texture-private.h3
-rw-r--r--cogl/cogl-atlas.h3
-rw-r--r--cogl/cogl-blend-string.c4
-rw-r--r--cogl/cogl-clip-stack.c2
-rw-r--r--cogl/cogl-clip-state.c13
-rw-r--r--cogl/cogl-color.c1
-rw-r--r--cogl/cogl-config.c1
-rw-r--r--cogl/cogl-debug.c1
-rw-r--r--cogl/cogl-display.c6
-rw-r--r--cogl/cogl-display.h14
-rw-r--r--cogl/cogl-framebuffer.c26
-rw-r--r--cogl/cogl-framebuffer.h14
-rw-r--r--cogl/cogl-index-buffer.c8
-rw-r--r--cogl/cogl-indices.h14
-rw-r--r--cogl/cogl-journal-private.h3
-rw-r--r--cogl/cogl-journal.c2
-rw-r--r--cogl/cogl-matrix-stack.h3
-rw-r--r--cogl/cogl-meta-texture.c2
-rw-r--r--cogl/cogl-object-private.h6
-rw-r--r--cogl/cogl-onscreen-template.c6
-rw-r--r--cogl/cogl-onscreen-template.h14
-rw-r--r--cogl/cogl-onscreen.c6
-rw-r--r--cogl/cogl-onscreen.h14
-rw-r--r--cogl/cogl-path-functions.h430
-rw-r--r--cogl/cogl-path.c43
-rw-r--r--cogl/cogl-path.h390
-rw-r--r--cogl/cogl-pipeline-debug.c6
-rw-r--r--cogl/cogl-pipeline-fragend-arbfp.c2
-rw-r--r--cogl/cogl-pipeline-fragend-glsl.c3
-rw-r--r--cogl/cogl-pipeline-layer-state.c3
-rw-r--r--cogl/cogl-pipeline-progend-glsl.c1
-rw-r--r--cogl/cogl-pipeline-state.c6
-rw-r--r--cogl/cogl-pipeline.c6
-rw-r--r--cogl/cogl-point-in-poly.c1
-rw-r--r--cogl/cogl-primitives.c3
-rw-r--r--cogl/cogl-program-private.h2
-rw-r--r--cogl/cogl-program.c6
-rw-r--r--cogl/cogl-quaternion.c15
-rw-r--r--cogl/cogl-quaternion.h18
-rw-r--r--cogl/cogl-renderer.c15
-rw-r--r--cogl/cogl-shader-private.h2
-rw-r--r--cogl/cogl-shader.c8
-rw-r--r--cogl/cogl-sub-texture.c3
-rw-r--r--cogl/cogl-swap-chain.c6
-rw-r--r--cogl/cogl-swap-chain.h3
-rw-r--r--cogl/cogl-texture-2d-sliced.h14
-rw-r--r--cogl/cogl-texture-3d.c6
-rw-r--r--cogl/cogl-vertex-buffer-private.h6
-rw-r--r--cogl/cogl-vertex-buffer.c20
-rw-r--r--cogl/cogl.c9
-rw-r--r--cogl/cogl.h1
-rw-r--r--cogl/cogl2-clip-state.h53
-rw-r--r--cogl/driver/gles/cogl-gles.c1
-rw-r--r--cogl/winsys/cogl-winsys-egl-kms.c1
-rw-r--r--cogl/winsys/cogl-winsys-glx-private.h (renamed from cogl/cogl2-clip-state.c)18
-rw-r--r--cogl/winsys/cogl-winsys-glx.c1
-rw-r--r--cogl/winsys/cogl-winsys-sdl-private.h30
-rw-r--r--cogl/winsys/cogl-winsys-sdl.c1
-rw-r--r--cogl/winsys/cogl-winsys-stub.c1
-rw-r--r--cogl/winsys/cogl-winsys-wgl-private.h30
-rw-r--r--cogl/winsys/cogl-winsys-wgl.c1
62 files changed, 727 insertions, 611 deletions
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 6ba17608..68f20892 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -67,6 +67,7 @@ cogl_1_public_h = \
$(srcdir)/cogl-offscreen.h \
$(srcdir)/cogl-primitives.h \
$(srcdir)/cogl-path.h \
+ $(srcdir)/cogl-path-functions.h \
$(srcdir)/cogl-shader.h \
$(srcdir)/cogl-texture.h \
$(srcdir)/cogl-types.h \
@@ -89,7 +90,6 @@ cogl_experimental_h = \
$(srcdir)/cogl-pipeline-layer-state.h \
$(srcdir)/cogl-snippet.h \
$(srcdir)/cogl2-path.h \
- $(srcdir)/cogl2-clip-state.h \
$(srcdir)/cogl-index-buffer.h \
$(srcdir)/cogl-attribute-buffer.h \
$(srcdir)/cogl-indices.h \
@@ -219,8 +219,6 @@ cogl_sources_c = \
$(srcdir)/cogl-clip-state-private.h \
$(srcdir)/cogl-clip-state.h \
$(srcdir)/cogl-clip-state.c \
- $(srcdir)/cogl2-clip-state.h \
- $(srcdir)/cogl2-clip-state.c \
$(srcdir)/cogl-feature-private.h \
$(srcdir)/cogl-feature-private.c \
$(srcdir)/cogl-fixed.c \
@@ -382,6 +380,7 @@ cogl_sources_c += \
$(srcdir)/cogl-glx-renderer-private.h \
$(srcdir)/cogl-glx-display-private.h \
$(srcdir)/winsys/cogl-winsys-glx-feature-functions.h \
+ $(srcdir)/winsys/cogl-winsys-glx-private.h \
$(srcdir)/winsys/cogl-winsys-glx.c
endif
if SUPPORT_WGL
@@ -390,6 +389,7 @@ cogl_experimental_h += \
cogl_sources_c += \
$(srcdir)/cogl-win32-renderer.c \
+ $(srcdir)/winsys/cogl-winsys-wgl-private.h \
$(srcdir)/winsys/cogl-winsys-wgl.c \
$(srcdir)/winsys/cogl-winsys-wgl-feature-functions.h
endif
@@ -435,6 +435,7 @@ cogl_sources_c += \
endif
if SUPPORT_SDL
cogl_sources_c += \
+ $(srcdir)/winsys/cogl-winsys-sdl-private.h \
$(srcdir)/winsys/cogl-winsys-sdl.c
endif
diff --git a/cogl/cogl-atlas-texture-private.h b/cogl/cogl-atlas-texture-private.h
index 541cd3db..4387affe 100644
--- a/cogl/cogl-atlas-texture-private.h
+++ b/cogl/cogl-atlas-texture-private.h
@@ -74,4 +74,7 @@ void
_cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
void *user_data);
+gboolean
+_cogl_is_atlas_texture (void *object);
+
#endif /* __COGL_ATLAS_TEXTURE_H */
diff --git a/cogl/cogl-atlas.h b/cogl/cogl-atlas.h
index 7790cecc..95c4c11d 100644
--- a/cogl/cogl-atlas.h
+++ b/cogl/cogl-atlas.h
@@ -94,4 +94,7 @@ _cogl_atlas_remove_reorganize_callback (CoglAtlas *atlas,
GHookFunc post_callback,
void *user_data);
+gboolean
+_cogl_is_atlas (void *object);
+
#endif /* __COGL_ATLAS_H */
diff --git a/cogl/cogl-blend-string.c b/cogl/cogl-blend-string.c
index bcdbd15d..50d32f2f 100644
--- a/cogl/cogl-blend-string.c
+++ b/cogl/cogl-blend-string.c
@@ -950,6 +950,10 @@ struct _TestString
CoglBlendStringContext context;
};
+/* FIXME: this should probably be moved to a unit test */
+int
+_cogl_blend_string_test (void);
+
int
_cogl_blend_string_test (void)
{
diff --git a/cogl/cogl-clip-stack.c b/cogl/cogl-clip-stack.c
index 358c199c..ef648931 100644
--- a/cogl/cogl-clip-stack.c
+++ b/cogl/cogl-clip-stack.c
@@ -422,7 +422,7 @@ paint_primitive_silhouette (void *user_data)
COGL_DRAW_SKIP_LEGACY_STATE);
}
-void
+static void
add_stencil_clip_primitive (CoglFramebuffer *framebuffer,
CoglPrimitive *primitive,
float bounds_x1,
diff --git a/cogl/cogl-clip-state.c b/cogl/cogl-clip-state.c
index 649fbf31..ca34d783 100644
--- a/cogl/cogl-clip-state.c
+++ b/cogl/cogl-clip-state.c
@@ -38,12 +38,8 @@
#include "cogl-journal-private.h"
#include "cogl-util.h"
#include "cogl-matrix-private.h"
-
-#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
-#include <cogl/cogl2-clip-state.h>
-#else
-#include <cogl/cogl-clip-state.h>
-#endif
+#include "cogl-clip-state.h"
+#include "cogl1-context.h"
void
cogl_clip_push_window_rectangle (int x_offset,
@@ -92,7 +88,8 @@ void
cogl_clip_push_from_path_preserve (void)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
- cogl2_clip_push_from_path (ctx->current_path);
+ cogl_framebuffer_push_path_clip (cogl_get_draw_framebuffer (),
+ ctx->current_path);
}
#undef cogl_clip_push_from_path
@@ -101,7 +98,7 @@ cogl_clip_push_from_path (void)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
- cogl2_clip_push_from_path (ctx->current_path);
+ cogl_clip_push_from_path_preserve ();
cogl_object_unref (ctx->current_path);
ctx->current_path = cogl2_path_new ();
diff --git a/cogl/cogl-color.c b/cogl/cogl-color.c
index 9a78e53c..9359f444 100644
--- a/cogl/cogl-color.c
+++ b/cogl/cogl-color.c
@@ -30,6 +30,7 @@
#include "cogl-util.h"
#include "cogl-color.h"
#include "cogl-fixed.h"
+#include "cogl-color-private.h"
CoglColor *
cogl_color_new (void)
diff --git a/cogl/cogl-config.c b/cogl/cogl-config.c
index 8f0082ec..4678ce49 100644
--- a/cogl/cogl-config.c
+++ b/cogl/cogl-config.c
@@ -29,6 +29,7 @@
#endif
#include "cogl-debug.h"
+#include "cogl-config-private.h"
#include <glib.h>
diff --git a/cogl/cogl-debug.c b/cogl/cogl-debug.c
index bdbb1ff5..d838caeb 100644
--- a/cogl/cogl-debug.c
+++ b/cogl/cogl-debug.c
@@ -30,6 +30,7 @@
#include "cogl-private.h"
#include "cogl-debug.h"
+#include "cogl1-context.h"
/* XXX: If you add a debug option, please also add an option
* definition to cogl-debug-options.h. This will enable us - for
diff --git a/cogl/cogl-display.c b/cogl/cogl-display.c
index 651277f4..4818bda6 100644
--- a/cogl/cogl-display.c
+++ b/cogl/cogl-display.c
@@ -42,12 +42,6 @@ static void _cogl_display_free (CoglDisplay *display);
COGL_OBJECT_DEFINE (Display, display);
-GQuark
-cogl_display_error_quark (void)
-{
- return g_quark_from_static_string ("cogl-display-error-quark");
-}
-
static const CoglWinsysVtable *
_cogl_display_get_winsys (CoglDisplay *display)
{
diff --git a/cogl/cogl-display.h b/cogl/cogl-display.h
index d0b7e4b0..d4d47359 100644
--- a/cogl/cogl-display.h
+++ b/cogl/cogl-display.h
@@ -189,6 +189,20 @@ cogl_wayland_display_set_compositor_display (CoglDisplay *display,
struct wl_display *wayland_display);
#endif
+/**
+ * cogl_is_display:
+ * @object: A #CoglObject pointer
+ *
+ * Gets whether the given object references a #CoglDisplay.
+ *
+ * Return value: %TRUE if the object references a #CoglDisplay
+ * and %FALSE otherwise.
+ * Since: 1.10
+ * Stability: unstable
+ */
+gboolean
+cogl_is_display (void *object);
+
G_END_DECLS
#endif /* __COGL_DISPLAY_H__ */
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 999eccc3..f18abf1d 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -142,7 +142,7 @@ cogl_framebuffer_error_quark (void)
}
gboolean
-_cogl_is_framebuffer (void *object)
+cogl_is_framebuffer (void *object)
{
CoglObject *obj = object;
@@ -1177,8 +1177,8 @@ _cogl_set_framebuffers (CoglFramebuffer *draw_buffer,
CoglFramebuffer *current_draw_buffer;
CoglFramebuffer *current_read_buffer;
- _COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (draw_buffer));
- _COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (read_buffer));
+ _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (draw_buffer));
+ _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (read_buffer));
current_draw_buffer = cogl_get_draw_framebuffer ();
current_read_buffer = _cogl_get_read_framebuffer ();
@@ -1244,8 +1244,8 @@ _cogl_push_framebuffers (CoglFramebuffer *draw_buffer,
CoglContext *ctx;
CoglFramebuffer *old_draw_buffer, *old_read_buffer;
- _COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (draw_buffer));
- _COGL_RETURN_IF_FAIL (_cogl_is_framebuffer (read_buffer));
+ _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (draw_buffer));
+ _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (read_buffer));
ctx = draw_buffer->context;
_COGL_RETURN_IF_FAIL (ctx != NULL);
@@ -1956,7 +1956,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int height;
_COGL_RETURN_VAL_IF_FAIL (source == COGL_READ_PIXELS_COLOR_BUFFER, FALSE);
- _COGL_RETURN_VAL_IF_FAIL (_cogl_is_framebuffer (framebuffer), FALSE);
+ _COGL_RETURN_VAL_IF_FAIL (cogl_is_framebuffer (framebuffer), FALSE);
ctx = cogl_framebuffer_get_context (framebuffer);
@@ -3139,13 +3139,13 @@ cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
}
void
-cogl_vdraw_indexed_attributes (CoglFramebuffer *framebuffer,
- CoglPipeline *pipeline,
- CoglVerticesMode mode,
- int first_vertex,
- int n_vertices,
- CoglIndices *indices,
- ...)
+cogl_framebuffer_vdraw_indexed_attributes (CoglFramebuffer *framebuffer,
+ CoglPipeline *pipeline,
+ CoglVerticesMode mode,
+ int first_vertex,
+ int n_vertices,
+ CoglIndices *indices,
+ ...)
{
va_list ap;
int n_attributes;
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h
index 0dfdc48e..b3144266 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -1311,6 +1311,20 @@ typedef enum { /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
COGL_FRAMEBUFFER_ERROR_ALLOCATE
} CoglFramebufferError;
+/**
+ * cogl_is_framebuffer:
+ * @object: A #CoglObject pointer
+ *
+ * Gets whether the given object references a #CoglFramebuffer.
+ *
+ * Return value: %TRUE if the object references a #CoglFramebuffer
+ * and %FALSE otherwise.
+ * Since: 1.10
+ * Stability: unstable
+ */
+gboolean
+cogl_is_framebuffer (void *object);
+
G_END_DECLS
#endif /* __COGL_FRAMEBUFFER_H */
diff --git a/cogl/cogl-index-buffer.c b/cogl/cogl-index-buffer.c
index 7a6b196c..557d770e 100644
--- a/cogl/cogl-index-buffer.c
+++ b/cogl/cogl-index-buffer.c
@@ -73,14 +73,6 @@ _cogl_index_buffer_free (CoglIndexBuffer *indices)
g_slice_free (CoglIndexBuffer, indices);
}
-gboolean
-cogl_index_buffer_allocate (CoglIndexBuffer *indices,
- GError *error)
-{
- /* TODO */
- return TRUE;
-}
-
/* XXX: do we want a convenience function like this as an alternative
* to using cogl_buffer_set_data? The advantage of this is that we can
* track meta data such as the indices type and max_index_value for a
diff --git a/cogl/cogl-indices.h b/cogl/cogl-indices.h
index 010edd3f..23cc9115 100644
--- a/cogl/cogl-indices.h
+++ b/cogl/cogl-indices.h
@@ -126,6 +126,20 @@ cogl_indices_set_offset (CoglIndices *indices,
CoglIndices *
cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
+/**
+ * cogl_is_indices:
+ * @object: A #CoglObject pointer
+ *
+ * Gets whether the given object references a #CoglIndices.
+ *
+ * Return value: %TRUE if the object references a #CoglIndices
+ * and %FALSE otherwise.
+ * Since: 1.10
+ * Stability: unstable
+ */
+gboolean
+cogl_is_indices (void *object);
+
G_END_DECLS
#endif /* __COGL_INDICES_H__ */
diff --git a/cogl/cogl-journal-private.h b/cogl/cogl-journal-private.h
index bd0f6480..6e9764a4 100644
--- a/cogl/cogl-journal-private.h
+++ b/cogl/cogl-journal-private.h
@@ -109,4 +109,7 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
CoglBitmap *bitmap,
gboolean *found_intersection);
+gboolean
+_cogl_is_journal (void *object);
+
#endif /* __COGL_JOURNAL_PRIVATE_H */
diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c
index 0be94f59..b8191c0d 100644
--- a/cogl/cogl-journal.c
+++ b/cogl/cogl-journal.c
@@ -123,7 +123,7 @@ typedef gboolean (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
static void _cogl_journal_free (CoglJournal *journal);
-COGL_OBJECT_DEFINE (Journal, journal);
+COGL_OBJECT_INTERNAL_DEFINE (Journal, journal);
static void
_cogl_journal_free (CoglJournal *journal)
diff --git a/cogl/cogl-matrix-stack.h b/cogl/cogl-matrix-stack.h
index 834e5abe..7a1417ec 100644
--- a/cogl/cogl-matrix-stack.h
+++ b/cogl/cogl-matrix-stack.h
@@ -147,4 +147,7 @@ _cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
void
_cogl_matrix_stack_destroy_cache (CoglMatrixStackCache *cache);
+gboolean
+_cogl_is_matrix_stack (void *object);
+
#endif /* __COGL_MATRIX_STACK_H */
diff --git a/cogl/cogl-meta-texture.c b/cogl/cogl-meta-texture.c
index 6aa46267..f77a6c64 100644
--- a/cogl/cogl-meta-texture.c
+++ b/cogl/cogl-meta-texture.c
@@ -136,7 +136,7 @@ setup_padded_spans (CoglSpan *spans,
* together callbacks corresponding to the same underlying slice
* together.
*/
-void
+static void
create_grid_and_repeat_cb (CoglTexture *slice_texture,
const float *slice_texture_coords,
const float *meta_coords,
diff --git a/cogl/cogl-object-private.h b/cogl/cogl-object-private.h
index d7c3412b..be1e709d 100644
--- a/cogl/cogl-object-private.h
+++ b/cogl/cogl-object-private.h
@@ -182,12 +182,6 @@ _cogl_##type_name##_object_new (Cogl##TypeName *new_obj) \
_cogl_object_##type_name##_inc (); \
_COGL_OBJECT_DEBUG_NEW (TypeName, obj); \
return new_obj; \
-} \
- \
-Cogl##TypeName * \
-_cogl_##type_name##_pointer_from_handle (CoglHandle handle) \
-{ \
- return handle; \
}
#define COGL_OBJECT_DEFINE_WITH_CODE(TypeName, type_name, code) \
diff --git a/cogl/cogl-onscreen-template.c b/cogl/cogl-onscreen-template.c
index 4969a6eb..6aa1d103 100644
--- a/cogl/cogl-onscreen-template.c
+++ b/cogl/cogl-onscreen-template.c
@@ -39,12 +39,6 @@ static void _cogl_onscreen_template_free (CoglOnscreenTemplate *onscreen_templat
COGL_OBJECT_DEFINE (OnscreenTemplate, onscreen_template);
-GQuark
-cogl_onscreen_template_error_quark (void)
-{
- return g_quark_from_static_string ("cogl-onscreen-template-error-quark");
-}
-
static void
_cogl_onscreen_template_free (CoglOnscreenTemplate *onscreen_template)
{
diff --git a/cogl/cogl-onscreen-template.h b/cogl/cogl-onscreen-template.h
index 0d1f9a4d..64d9b74c 100644
--- a/cogl/cogl-onscreen-template.h
+++ b/cogl/cogl-onscreen-template.h
@@ -88,6 +88,20 @@ cogl_onscreen_template_set_swap_throttled (
CoglOnscreenTemplate *onscreen_template,
gboolean throttled);
+/**
+ * cogl_is_onscreen_template:
+ * @object: A #CoglObject pointer
+ *
+ * Gets whether the given object references a #CoglOnscreenTemplate.
+ *
+ * Return value: %TRUE if the object references a #CoglOnscreenTemplate
+ * and %FALSE otherwise.
+ * Since: 1.10
+ * Stability: unstable
+ */
+gboolean
+cogl_is_onscreen_template (void *object);
+
G_END_DECLS
#endif /* __COGL_ONSCREEN_TEMPLATE_H__ */
diff --git a/cogl/cogl-onscreen.c b/cogl/cogl-onscreen.c
index 4247de69..9a1d5836 100644
--- a/cogl/cogl-onscreen.c
+++ b/cogl/cogl-onscreen.c
@@ -35,9 +35,9 @@
static void _cogl_onscreen_free (CoglOnscreen *onscreen);
-COGL_OBJECT_INTERNAL_DEFINE_WITH_CODE (Onscreen, onscreen,
- _cogl_onscreen_class.virt_unref =
- _cogl_framebuffer_unref);
+COGL_OBJECT_DEFINE_WITH_CODE (Onscreen, onscreen,
+ _cogl_onscreen_class.virt_unref =
+ _cogl_framebuffer_unref);
static void
_cogl_onscreen_init_from_template (CoglOnscreen *onscreen,
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 66206bac..9d150b25 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -380,6 +380,20 @@ void
cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
unsigned int id);
+/**
+ * cogl_is_onscreen:
+ * @object: A #CoglObject pointer
+ *
+ * Gets whether the given object references a #CoglOnscreen.
+ *
+ * Return value: %TRUE if the object references a #CoglOnscreen
+ * and %FALSE otherwise.
+ * Since: 1.10
+ * Stability: unstable
+ */
+gboolean
+cogl_is_onscreen (void *object);
+
G_END_DECLS
#endif /* __COGL_ONSCREEN_H */
diff --git a/cogl/cogl-path-functions.h b/cogl/cogl-path-functions.h
new file mode 100644
index 00000000..2566fe18
--- /dev/null
+++ b/cogl/cogl-path-functions.h
@@ -0,0 +1,430 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2008,2009,2012 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
+#error "Only <cogl/cogl.h> can be included directly."
+#endif
+
+#ifndef __COGL_PATH_FUNCTIONS_H__
+#define __COGL_PATH_FUNCTIONS_H__
+
+/* The functions are declared separately because cogl-path.c needs to
+ get the function declarations from the old 1.0 API without
+ colliding with the enum declarations from the 2.0 API */
+
+#include <cogl/cogl-types.h>
+
+G_BEGIN_DECLS
+
+/**
+ * cogl_is_path:
+ * @handle: A CoglHandle
+ *
+ * Gets whether the given handle references an existing path object.
+ *
+ * Return value: %TRUE if the handle references a #CoglPath,
+ * %FALSE otherwise
+ */
+gboolean
+cogl_is_path (CoglHandle handle);
+
+/**
+ * cogl_path_set_fill_rule:
+ * @fill_rule: The new fill rule.
+ *
+ * Sets the fill rule of the current path to @fill_rule. This will
+ * affect how the path is filled when cogl_path_fill() is later
+ * called. Note that the fill rule state is attached to the path so
+ * calling cogl_get_path() will preserve the fill rule and calling
+ * cogl_path_new() will reset the fill rule back to the default.
+ *
+ * Since: 1.4
+ */
+void
+cogl_path_set_fill_rule (CoglPathFillRule fill_rule);
+
+/**
+ * cogl_path_get_fill_rule:
+ *
+ * Retrieves the fill rule set using cogl_path_set_fill_rule().
+ *
+ * Return value: the fill rule that is used for the current path.
+ *
+ * Since: 1.4
+ */
+CoglPathFillRule
+cogl_path_get_fill_rule (void);
+
+/**
+ * cogl_path_fill:
+ *
+ * Fills the interior of the constructed shape using the current
+ * drawing color. The current path is then cleared. To use the path
+ * again, call cogl_path_fill_preserve() instead.
+ *
+ * The interior of the shape is determined using the fill rule of the
+ * path. See %CoglPathFillRule for details.
+ **/
+void
+cogl_path_fill (void);
+
+/**
+ * cogl_path_fill_preserve:
+ *
+ * Fills the interior of the constructed shape using the current
+ * drawing color and preserves the path to be used again. See
+ * cogl_path_fill() for a description what is considered the interior
+ * of the shape.
+ *
+ * Since: 1.0
+ **/
+void
+cogl_path_fill_preserve (void);
+
+/**
+ * cogl_path_stroke:
+ *
+ * Strokes the constructed shape using the current drawing color and a
+ * width of 1 pixel (regardless of the current transformation
+ * matrix). To current path is then cleared. To use the path again,
+ * call cogl_path_stroke_preserve() instead.
+ **/
+void
+cogl_path_stroke (void);
+
+/**
+ * cogl_path_stroke_preserve:
+ *
+ * Strokes the constructed shape using the current drawing color and
+ * preserves the path to be used again.
+ *
+ * Since: 1.0
+ **/
+void
+cogl_path_stroke_preserve (void);
+
+/**
+ * cogl_path_new:
+ *
+ * Clears the current path and starts a new one. Creating a new path
+ * also resets the fill rule to the default which is
+ * %COGL_PATH_FILL_RULE_EVEN_ODD.
+ *
+ * Since: 1.0
+ */
+void
+cogl_path_new (void);
+
+/**
+ * cogl_path_move_to:
+ * @x: X coordinate of the pen location to move to.
+ * @y: Y coordinate of the pen location to move to.
+ *
+ * Moves the pen to the given location. If there is an existing path
+ * this will start a new disjoint subpath.
+ **/
+void
+cogl_path_move_to (float x,
+ float y);
+
+
+/**
+ * cogl_path_rel_move_to:
+ * @x: X offset from the current pen location to move the pen to.
+ * @y: Y offset from the current pen location to move the pen to.
+ *
+ * Moves the pen to the given offset relative to the current pen
+ * location. If there is an existing path this will start a new
+ * disjoint subpath.
+ **/
+void
+cogl_path_rel_move_to (float x,
+ float y);
+
+/**
+ * cogl_path_line_to:
+ * @x: X coordinate of the end line vertex
+ * @y: Y coordinate of the end line vertex
+ *
+ * Adds a straight line segment to the current path that ends at the
+ * given coordinates.
+ **/
+void
+cogl_path_line_to (float x,
+ float y);
+
+/**
+ * cogl_path_rel_line_to:
+ * @x: X offset from the current pen location of the end line vertex
+ * @y: Y offset from the current pen location of the end line vertex
+ *
+ * Adds a straight line segment to the current path that ends at the
+ * given coordinates relative to the current pen location.
+ **/
+void
+cogl_path_rel_line_to (float x,
+ float y);
+
+
+/**
+ * cogl_path_arc:
+ * @center_x: X coordinate of the elliptical arc center
+ * @center_y: Y coordinate of the elliptical arc center
+ * @radius_x: X radius of the elliptical arc
+ * @radius_y: Y radius of the elliptical arc
+ * @angle_1: Angle in degrees at which the arc begin
+ * @angle_2: Angle in degrees at which the arc ends
+ *
+ * Adds an elliptical arc segment to the current path. A straight line
+ * segment will link the current pen location with the first vertex
+ * of the arc. If you perform a move_to to the arcs start just before
+ * drawing it you create a free standing arc.
+ *
+ * The angles are measured in degrees where 0° is in the direction of
+ * the positive X axis and 90° is in the direction of the positive Y
+ * axis. The angle of the arc begins at @angle_1 and heads towards
+ * @angle_2 (so if @angle_2 is less than @angle_1 it will decrease,
+ * otherwise it will increase).
+ **/
+void
+cogl_path_arc (float center_x,
+ float center_y,
+ float radius_x,
+ float radius_y,
+ float angle_1,
+ float angle_2);
+
+/**
+ * cogl_path_curve_to:
+ * @x_1: X coordinate of the second bezier control point
+ * @y_1: Y coordinate of the second bezier control point
+ * @x_2: X coordinate of the third bezier control point
+ * @y_2: Y coordinate of the third bezier control point
+ * @x_3: X coordinate of the fourth bezier control point
+ * @y_3: Y coordinate of the fourth bezier control point
+ *
+ * Adds a cubic bezier curve segment to the current path with the given
+ * second, third and fourth control points and using current pen location
+ * as the first control point.
+ **/
+void
+cogl_path_curve_to (float x_1,
+ float y_1,
+ float x_2,
+ float y_2,
+ float x_3,
+ float y_3);
+
+/**
+ * cogl_path_rel_curve_to:
+ * @x_1: X coordinate of the second bezier control point
+ * @y_1: Y coordinate of the second bezier control point
+ * @x_2: X coordinate of the third bezier control point
+ * @y_2: Y coordinate of the third bezier control point
+ * @x_3: X coordinate of the fourth bezier control point
+ * @y_3: Y coordinate of the fourth bezier control point
+ *
+ * Adds a cubic bezier curve segment to the current path with the given
+ * second, third and fourth control points and using current pen location
+ * as the first control point. The given coordinates are relative to the
+ * current pen location.
+ */
+void
+cogl_path_rel_curve_to (float x_1,
+ float y_1,
+ float x_2,
+ float y_2,
+ float x_3,
+ float y_3);
+
+/**
+ * cogl_path_close:
+ *
+ * Closes the path being constructed by adding a straight line segment
+ * to it that ends at the first vertex of the path.
+ **/
+void
+cogl_path_close (void);
+
+/**
+ * cogl_path_line:
+ * @x_1: X coordinate of the start line vertex
+ * @y_1: Y coordinate of the start line vertex
+ * @x_2: X coordinate of the end line vertex
+ * @y_2: Y coordinate of the end line vertex
+ *
+ * Constructs a straight line shape starting and ending at the given
+ * coordinates. If there is an existing path this will start a new
+ * disjoint sub-path.
+ **/
+void
+cogl_path_line (float x_1,
+ float y_1,
+ float x_2,
+ float y_2);
+
+/**
+ * cogl_path_polyline:
+ * @coords: (in) (array) (transfer none): A pointer to the first element of an
+ * array of fixed-point values that specify the vertex coordinates.
+ * @num_points: The total number of vertices.
+ *
+ * Constructs a series of straight line segments, starting from the
+ * first given vertex coordinate. If there is an existing path this
+ * will start a new disjoint sub-path. Each subsequent segment starts
+ * where the previous one ended and ends at the next given vertex
+ * coordinate.
+ *
+ * The coords array must contain 2 * num_points values. The first value
+ * represents the X coordinate of the first vertex, the second value
+ * represents the Y coordinate of the first vertex, continuing in the same
+ * fashion for the rest of the vertices. (num_points - 1) segments will
+ * be constructed.
+ **/
+void
+cogl_path_polyline (const float *coords,
+ int num_points);
+
+
+/**
+ * cogl_path_polygon:
+ * @coords: (in) (array) (transfer none): A pointer to the first element of
+ * an array of fixed-point values that specify the vertex coordinates.
+ * @num_points: The total number of vertices.
+ *
+ * Constructs a polygonal shape of the given number of vertices. If
+ * there is an existing path this will start a new disjoint sub-path.
+ *
+ * The coords array must contain 2 * num_points values. The first value
+ * represents the X coordinate of the first vertex, the second value
+ * represents the Y coordinate of the first vertex, continuing in the same
+ * fashion for the rest of the vertices.
+ **/
+void
+cogl_path_polygon (const float *coords,
+ int num_points);
+
+
+/**
+ * cogl_path_rectangle:
+ * @x_1: X coordinate of the top-left corner.
+ * @y_1: Y coordinate of the top-left corner.
+ * @x_2: X coordinate of the bottom-right corner.
+ * @y_2: Y coordinate of the bottom-right corner.
+ *
+ * Constructs a rectangular shape at the given coordinates. If there
+ * is an existing path this will start a new disjoint sub-path.
+ **/
+void
+cogl_path_rectangle (float x_1,
+ float y_1,
+ float x_2,
+ float y_2);
+
+/**
+ * cogl_path_ellipse:
+ * @center_x: X coordinate of the ellipse center
+ * @center_y: Y coordinate of the ellipse center
+ * @radius_x: X radius of the ellipse
+ * @radius_y: Y radius of the ellipse
+ *
+ * Constructs an ellipse shape. If there is an existing path this will
+ * start a new disjoint sub-path.
+ **/
+void
+cogl_path_ellipse (float center_x,
+ float center_y,
+ float radius_x,
+ float radius_y);
+
+/**
+ * cogl_path_round_rectangle:
+ * @x_1: X coordinate of the top-left corner.
+ * @y_1: Y coordinate of the top-left corner.
+ * @x_2: X coordinate of the bottom-right corner.
+ * @y_2: Y coordinate of the bottom-right corner.
+ * @radius: Radius of the corner arcs.
+ * @arc_step: Angle increment resolution for subdivision of
+ * the corner arcs.
+ *
+ * Constructs a rectangular shape with rounded corners. If there is an
+ * existing path this will start a new disjoint sub-path.
+ **/
+void
+cogl_path_round_rectangle (float x_1,
+ float y_1,
+ float x_2,
+ float y_2,
+ float radius,
+ float arc_step);
+
+/**
+ * cogl_get_path: (skip)
+ *
+ * Gets a pointer to the current path. The path can later be used
+ * again by calling cogl_path_set(). Note that the path isn't copied
+ * so if you later call any functions to add to the path it will
+ * affect the returned object too. No reference is taken on the path
+ * so if you want to retain it you should take your own reference with
+ * cogl_object_ref().
+ *
+ * Return value: a pointer to the current path.
+ *
+ * Since: 1.4
+ */
+CoglPath *
+cogl_get_path (void);
+
+/**
+ * cogl_set_path: (skip)
+ * @path: A #CoglPath object
+ *
+ * Replaces the current path with @path. A reference is taken on the
+ * object so if you no longer need the path you should unref with
+ * cogl_object_unref().
+ *
+ * Since: 1.4
+ */
+void
+cogl_set_path (CoglPath *path);
+
+/**
+ * cogl_path_copy: (skip)
+ * @path: A #CoglPath object
+ *
+ * Returns a new copy of the path in @path. The new path has a
+ * reference count of 1 so you should unref it with
+ * cogl_object_unref() if you no longer need it.
+ *
+ * Internally the path will share the data until one of the paths is
+ * modified so copying paths should be relatively cheap.
+ *
+ * Return value: (transfer full): a copy of the path in @path.
+ */
+CoglPath *
+cogl_path_copy (CoglPath *path);
+
+G_END_DECLS
+
+#endif /* __COGL_PATH_FUNCTIONS_H__ */
+
diff --git a/cogl/cogl-path.c b/cogl/cogl-path.c
index 62d20f52..0eaed99d 100644
--- a/cogl/cogl-path.c
+++ b/cogl/cogl-path.c
@@ -36,6 +36,29 @@
#include <math.h>
#undef cogl_path_set_fill_rule
+#undef cogl_path_get_fill_rule
+#undef cogl_path_fill
+#undef cogl_path_fill_preserve
+#undef cogl_path_stroke
+#undef cogl_path_stroke_preserve
+#undef cogl_path_move_to
+#undef cogl_path_rel_move_to
+#undef cogl_path_line_to
+#undef cogl_path_rel_line_to
+#undef cogl_path_close
+#undef cogl_path_new
+#undef cogl_path_line
+#undef cogl_path_polyline
+#undef cogl_path_polygon
+#undef cogl_path_rectangle
+#undef cogl_path_arc
+#undef cogl_path_ellipse
+#undef cogl_path_round_rectangle
+#undef cogl_path_curve_to
+#undef cogl_path_rel_curve_to
+
+#include "cogl-path-functions.h"
+
void
cogl_path_set_fill_rule (CoglPathFillRule fill_rule)
{
@@ -44,7 +67,6 @@ cogl_path_set_fill_rule (CoglPathFillRule fill_rule)
cogl2_path_set_fill_rule (ctx->current_path, fill_rule);
}
-#undef cogl_path_get_fill_rule
CoglPathFillRule
cogl_path_get_fill_rule (void)
{
@@ -53,7 +75,6 @@ cogl_path_get_fill_rule (void)
return cogl2_path_get_fill_rule (ctx->current_path);
}
-#undef cogl_path_fill
void
cogl_path_fill (void)
{
@@ -65,7 +86,6 @@ cogl_path_fill (void)
ctx->current_path = cogl2_path_new ();
}
-#undef cogl_path_fill_preserve
void
cogl_path_fill_preserve (void)
{
@@ -74,7 +94,6 @@ cogl_path_fill_preserve (void)
cogl2_path_fill (ctx->current_path);
}
-#undef cogl_path_stroke
void
cogl_path_stroke (void)
{
@@ -86,7 +105,6 @@ cogl_path_stroke (void)
ctx->current_path = cogl2_path_new ();
}
-#undef cogl_path_stroke_preserve
void
cogl_path_stroke_preserve (void)
{
@@ -95,7 +113,6 @@ cogl_path_stroke_preserve (void)
cogl2_path_stroke (ctx->current_path);
}
-#undef cogl_path_move_to
void
cogl_path_move_to (float x,
float y)
@@ -105,7 +122,6 @@ cogl_path_move_to (float x,
cogl2_path_move_to (ctx->current_path, x, y);
}
-#undef cogl_path_rel_move_to
void
cogl_path_rel_move_to (float x,
float y)
@@ -115,7 +131,6 @@ cogl_path_rel_move_to (float x,
cogl2_path_rel_move_to (ctx->current_path, x, y);
}
-#undef cogl_path_line_to
void
cogl_path_line_to (float x,
float y)
@@ -125,7 +140,6 @@ cogl_path_line_to (float x,
cogl2_path_line_to (ctx->current_path, x, y);
}
-#undef cogl_path_rel_line_to
void
cogl_path_rel_line_to (float x,
float y)
@@ -135,7 +149,6 @@ cogl_path_rel_line_to (float x,
cogl2_path_rel_line_to (ctx->current_path, x, y);
}
-#undef cogl_path_close
void
cogl_path_close (void)
{
@@ -144,7 +157,6 @@ cogl_path_close (void)
cogl2_path_close (ctx->current_path);
}
-#undef cogl_path_new
void
cogl_path_new (void)
{
@@ -154,7 +166,6 @@ cogl_path_new (void)
ctx->current_path = cogl2_path_new ();
}
-#undef cogl_path_line
void
cogl_path_line (float x_1,
float y_1,
@@ -166,7 +177,6 @@ cogl_path_line (float x_1,
cogl2_path_line (ctx->current_path, x_1, y_1, x_2, y_2);
}
-#undef cogl_path_polyline
void
cogl_path_polyline (const float *coords,
int num_points)
@@ -176,7 +186,6 @@ cogl_path_polyline (const float *coords,
cogl2_path_polyline (ctx->current_path, coords, num_points);
}
-#undef cogl_path_polygon
void
cogl_path_polygon (const float *coords,
int num_points)
@@ -186,7 +195,6 @@ cogl_path_polygon (const float *coords,
cogl2_path_polygon (ctx->current_path, coords, num_points);
}
-#undef cogl_path_rectangle
void
cogl_path_rectangle (float x_1,
float y_1,
@@ -198,7 +206,6 @@ cogl_path_rectangle (float x_1,
cogl2_path_rectangle (ctx->current_path, x_1, y_1, x_2, y_2);
}
-#undef cogl_path_arc
void
cogl_path_arc (float center_x,
float center_y,
@@ -218,7 +225,6 @@ cogl_path_arc (float center_x,
angle_2);
}
-#undef cogl_path_ellipse
void
cogl_path_ellipse (float center_x,
float center_y,
@@ -234,7 +240,6 @@ cogl_path_ellipse (float center_x,
radius_y);
}
-#undef cogl_path_round_rectangle
void
cogl_path_round_rectangle (float x_1,
float y_1,
@@ -249,7 +254,6 @@ cogl_path_round_rectangle (float x_1,
x_1, y_1, x_2, y_2, radius, arc_step);
}
-#undef cogl_path_curve_to
void
cogl_path_curve_to (float x_1,
float y_1,
@@ -264,7 +268,6 @@ cogl_path_curve_to (float x_1,
x_1, y_2, x_2, y_2, x_3, y_3);
}
-#undef cogl_path_rel_curve_to
void
cogl_path_rel_curve_to (float x_1,
float y_1,
diff --git a/cogl/cogl-path.h b/cogl/cogl-path.h
index 30df7ef0..c3d0d450 100644
--- a/cogl/cogl-path.h
+++ b/cogl/cogl-path.h
@@ -97,395 +97,9 @@ typedef enum {
COGL_PATH_FILL_RULE_EVEN_ODD
} CoglPathFillRule;
-/**
- * cogl_is_path:
- * @handle: A CoglHandle
- *
- * Gets whether the given handle references an existing path object.
- *
- * Return value: %TRUE if the handle references a #CoglPath,
- * %FALSE otherwise
- */
-gboolean
-cogl_is_path (CoglHandle handle);
-
-/**
- * cogl_path_set_fill_rule:
- * @fill_rule: The new fill rule.
- *
- * Sets the fill rule of the current path to @fill_rule. This will
- * affect how the path is filled when cogl_path_fill() is later
- * called. Note that the fill rule state is attached to the path so
- * calling cogl_get_path() will preserve the fill rule and calling
- * cogl_path_new() will reset the fill rule back to the default.
- *
- * Since: 1.4
- */
-void
-cogl_path_set_fill_rule (CoglPathFillRule fill_rule);
-
-/**
- * cogl_path_get_fill_rule:
- *
- * Retrieves the fill rule set using cogl_path_set_fill_rule().
- *
- * Return value: the fill rule that is used for the current path.
- *
- * Since: 1.4
- */
-CoglPathFillRule
-cogl_path_get_fill_rule (void);
-
-/**
- * cogl_path_fill:
- *
- * Fills the interior of the constructed shape using the current
- * drawing color. The current path is then cleared. To use the path
- * again, call cogl_path_fill_preserve() instead.
- *
- * The interior of the shape is determined using the fill rule of the
- * path. See %CoglPathFillRule for details.
- **/
-void
-cogl_path_fill (void);
-
-/**
- * cogl_path_fill_preserve:
- *
- * Fills the interior of the constructed shape using the current
- * drawing color and preserves the path to be used again. See
- * cogl_path_fill() for a description what is considered the interior
- * of the shape.
- *
- * Since: 1.0
- **/
-void
-cogl_path_fill_preserve (void);
-
-/**
- * cogl_path_stroke:
- *
- * Strokes the constructed shape using the current drawing color and a
- * width of 1 pixel (regardless of the current transformation
- * matrix). To current path is then cleared. To use the path again,
- * call cogl_path_stroke_preserve() instead.
- **/
-void
-cogl_path_stroke (void);
-
-/**
- * cogl_path_stroke_preserve:
- *
- * Strokes the constructed shape using the current drawing color and
- * preserves the path to be used again.
- *
- * Since: 1.0
- **/
-void
-cogl_path_stroke_preserve (void);
-
-/**
- * cogl_path_new:
- *
- * Clears the current path and starts a new one. Creating a new path
- * also resets the fill rule to the default which is
- * %COGL_PATH_FILL_RULE_EVEN_ODD.
- *
- * Since: 1.0
- */
-void
-cogl_path_new (void);
-
-/**
- * cogl_path_move_to:
- * @x: X coordinate of the pen location to move to.
- * @y: Y coordinate of the pen location to move to.
- *
- * Moves the pen to the given location. If there is an existing path
- * this will start a new disjoint subpath.
- **/
-void
-cogl_path_move_to (float x,
- float y);
-
-
-/**
- * cogl_path_rel_move_to:
- * @x: X offset from the current pen location to move the pen to.
- * @y: Y offset from the current pen location to move the pen to.
- *
- * Moves the pen to the given offset relative to the current pen
- * location. If there is an existing path this will start a new
- * disjoint subpath.
- **/
-void
-cogl_path_rel_move_to (float x,
- float y);
-
-/**
- * cogl_path_line_to:
- * @x: X coordinate of the end line vertex
- * @y: Y coordinate of the end line vertex
- *
- * Adds a straight line segment to the current path that ends at the
- * given coordinates.
- **/
-void
-cogl_path_line_to (float x,
- float y);
-
-/**
- * cogl_path_rel_line_to:
- * @x: X offset from the current pen location of the end line vertex
- * @y: Y offset from the current pen location of the end line vertex
- *
- * Adds a straight line segment to the current path that ends at the
- * given coordinates relative to the current pen location.
- **/
-void
-cogl_path_rel_line_to (float x,
- float y);
-
-
-/**
- * cogl_path_arc:
- * @center_x: X coordinate of the elliptical arc center
- * @center_y: Y coordinate of the elliptical arc center
- * @radius_x: X radius of the elliptical arc
- * @radius_y: Y radius of the elliptical arc
- * @angle_1: Angle in degrees at which the arc begin
- * @angle_2: Angle in degrees at which the arc ends
- *
- * Adds an elliptical arc segment to the current path. A straight line
- * segment will link the current pen location with the first vertex
- * of the arc. If you perform a move_to to the arcs start just before
- * drawing it you create a free standing arc.
- *
- * The angles are measured in degrees where 0° is in the direction of
- * the positive X axis and 90° is in the direction of the positive Y
- * axis. The angle of the arc begins at @angle_1 and heads towards
- * @angle_2 (so if @angle_2 is less than @angle_1 it will decrease,
- * otherwise it will increase).
- **/
-void
-cogl_path_arc (float center_x,
- float center_y,
- float radius_x,
- float radius_y,
- float angle_1,
- float angle_2);
-
-/**
- * cogl_path_curve_to:
- * @x_1: X coordinate of the second bezier control point
- * @y_1: Y coordinate of the second bezier control point
- * @x_2: X coordinate of the third bezier control point
- * @y_2: Y coordinate of the third bezier control point
- * @x_3: X coordinate of the fourth bezier control point
- * @y_3: Y coordinate of the fourth bezier control point
- *
- * Adds a cubic bezier curve segment to the current path with the given
- * second, third and fourth control points and using current pen location
- * as the first control point.
- **/
-void
-cogl_path_curve_to (float x_1,
- float y_1,
- float x_2,
- float y_2,
- float x_3,
- float y_3);
-
-/**
- * cogl_path_rel_curve_to:
- * @x_1: X coordinate of the second bezier control point
- * @y_1: Y coordinate of the second bezier control point
- * @x_2: X coordinate of the third bezier control point
- * @y_2: Y coordinate of the third bezier control point
- * @x_3: X coordinate of the fourth bezier control point
- * @y_3: Y coordinate of the fourth bezier control point
- *
- * Adds a cubic bezier curve segment to the current path with the given
- * second, third and fourth control points and using current pen location
- * as the first control point. The given coordinates are relative to the
- * current pen location.
- */
-void
-cogl_path_rel_curve_to (float x_1,
- float y_1,
- float x_2,
- float y_2,
- float x_3,
- float y_3);
-
-/**
- * cogl_path_close:
- *
- * Closes the path being constructed by adding a straight line segment
- * to it that ends at the first vertex of the path.
- **/
-void
-cogl_path_close (void);
-
-/**
- * cogl_path_line:
- * @x_1: X coordinate of the start line vertex
- * @y_1: Y coordinate of the start line vertex
- * @x_2: X coordinate of the end line vertex
- * @y_2: Y coordinate of the end line vertex
- *
- * Constructs a straight line shape starting and ending at the given
- * coordinates. If there is an existing path this will start a new
- * disjoint sub-path.
- **/
-void
-cogl_path_line (float x_1,
- float y_1,
- float x_2,
- float y_2);
-
-/**
- * cogl_path_polyline:
- * @coords: (in) (array) (transfer none): A pointer to the first element of an
- * array of fixed-point values that specify the vertex coordinates.
- * @num_points: The total number of vertices.
- *
- * Constructs a series of straight line segments, starting from the
- * first given vertex coordinate. If there is an existing path this
- * will start a new disjoint sub-path. Each subsequent segment starts
- * where the previous one ended and ends at the next given vertex
- * coordinate.
- *
- * The coords array must contain 2 * num_points values. The first value
- * represents the X coordinate of the first vertex, the second value
- * represents the Y coordinate of the first vertex, continuing in the same
- * fashion for the rest of the vertices. (num_points - 1) segments will
- * be constructed.
- **/
-void
-cogl_path_polyline (const float *coords,
- int num_points);
-
-
-/**
- * cogl_path_polygon:
- * @coords: (in) (array) (transfer none): A pointer to the first element of
- * an array of fixed-point values that specify the vertex coordinates.
- * @num_points: The total number of vertices.
- *
- * Constructs a polygonal shape of the given number of vertices. If
- * there is an existing path this will start a new disjoint sub-path.
- *
- * The coords array must contain 2 * num_points values. The first value
- * represents the X coordinate of the first vertex, the second value
- * represents the Y coordinate of the first vertex, continuing in the same
- * fashion for the rest of the vertices.
- **/
-void
-cogl_path_polygon (const float *coords,
- int num_points);
-
-
-/**
- * cogl_path_rectangle:
- * @x_1: X coordinate of the top-left corner.
- * @y_1: Y coordinate of the top-left corner.
- * @x_2: X coordinate of the bottom-right corner.
- * @y_2: Y coordinate of the bottom-right corner.
- *
- * Constructs a rectangular shape at the given coordinates. If there
- * is an existing path this will start a new disjoint sub-path.
- **/
-void
-cogl_path_rectangle (float x_1,
- float y_1,
- float x_2,
- float y_2);
-
-/**
- * cogl_path_ellipse:
- * @center_x: X coordinate of the ellipse center
- * @center_y: Y coordinate of the ellipse center
- * @radius_x: X radius of the ellipse
- * @radius_y: Y radius of the ellipse
- *
- * Constructs an ellipse shape. If there is an existing path this will
- * start a new disjoint sub-path.
- **/
-void
-cogl_path_ellipse (float center_x,
- float center_y,
- float radius_x,
- float radius_y);
-
-/**
- * cogl_path_round_rectangle:
- * @x_1: X coordinate of the top-left corner.
- * @y_1: Y coordinate of the top-left corner.
- * @x_2: X coordinate of the bottom-right corner.
- * @y_2: Y coordinate of the bottom-right corner.
- * @radius: Radius of the corner arcs.
- * @arc_step: Angle increment resolution for subdivision of
- * the corner arcs.
- *
- * Constructs a rectangular shape with rounded corners. If there is an
- * existing path this will start a new disjoint sub-path.
- **/
-void
-cogl_path_round_rectangle (float x_1,
- float y_1,
- float x_2,
- float y_2,
- float radius,
- float arc_step);
-
-/**
- * cogl_get_path: (skip)
- *
- * Gets a pointer to the current path. The path can later be used
- * again by calling cogl_path_set(). Note that the path isn't copied
- * so if you later call any functions to add to the path it will
- * affect the returned object too. No reference is taken on the path
- * so if you want to retain it you should take your own reference with
- * cogl_object_ref().
- *
- * Return value: a pointer to the current path.
- *
- * Since: 1.4
- */
-CoglPath *
-cogl_get_path (void);
-
-/**
- * cogl_set_path: (skip)
- * @path: A #CoglPath object
- *
- * Replaces the current path with @path. A reference is taken on the
- * object so if you no longer need the path you should unref with
- * cogl_object_unref().
- *
- * Since: 1.4
- */
-void
-cogl_set_path (CoglPath *path);
-
-/**
- * cogl_path_copy: (skip)
- * @path: A #CoglPath object
- *
- * Returns a new copy of the path in @path. The new path has a
- * reference count of 1 so you should unref it with
- * cogl_object_unref() if you no longer need it.
- *
- * Internally the path will share the data until one of the paths is
- * modified so copying paths should be relatively cheap.
- *
- * Return value: (transfer full): a copy of the path in @path.
- */
-CoglPath *
-cogl_path_copy (CoglPath *path);
-
G_END_DECLS
+#include "cogl-path-functions.h"
+
#endif /* __COGL_PATH_H__ */
diff --git a/cogl/cogl-pipeline-debug.c b/cogl/cogl-pipeline-debug.c
index c9ca8e20..00d03c66 100644
--- a/cogl/cogl-pipeline-debug.c
+++ b/cogl/cogl-pipeline-debug.c
@@ -244,6 +244,12 @@ dump_pipeline_cb (CoglNode *node, void *user_data)
return TRUE;
}
+/* This function is just here to be called from GDB so we don't really
+ want to put a declaration in a header and we just add it here to
+ avoid a warning */
+void
+_cogl_debug_dump_pipelines_dot_file (const char *filename);
+
void
_cogl_debug_dump_pipelines_dot_file (const char *filename)
{
diff --git a/cogl/cogl-pipeline-fragend-arbfp.c b/cogl/cogl-pipeline-fragend-arbfp.c
index 5031fc31..2b580638 100644
--- a/cogl/cogl-pipeline-fragend-arbfp.c
+++ b/cogl/cogl-pipeline-fragend-arbfp.c
@@ -792,7 +792,7 @@ _cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
return TRUE;
}
-gboolean
+static gboolean
_cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
{
CoglPipelineShaderState *shader_state = get_shader_state (pipeline);
diff --git a/cogl/cogl-pipeline-fragend-glsl.c b/cogl/cogl-pipeline-fragend-glsl.c
index 1cc36cb9..1f447221 100644
--- a/cogl/cogl-pipeline-fragend-glsl.c
+++ b/cogl/cogl-pipeline-fragend-glsl.c
@@ -47,6 +47,7 @@
#include "cogl-shader-private.h"
#include "cogl-program-private.h"
#include "cogl-pipeline-cache.h"
+#include "cogl-pipeline-fragend-glsl-private.h"
#include <glib.h>
@@ -998,7 +999,7 @@ add_alpha_test_snippet (CoglPipeline *pipeline,
#endif /* HAVE_COGL_GLES2 */
-gboolean
+static gboolean
_cogl_pipeline_fragend_glsl_end (CoglPipeline *pipeline,
unsigned long pipelines_difference)
{
diff --git a/cogl/cogl-pipeline-layer-state.c b/cogl/cogl-pipeline-layer-state.c
index 4540dc67..785d1e46 100644
--- a/cogl/cogl-pipeline-layer-state.c
+++ b/cogl/cogl-pipeline-layer-state.c
@@ -36,6 +36,7 @@
#include "cogl-matrix.h"
#include "cogl-snippet-private.h"
#include "cogl-texture-private.h"
+#include "cogl-pipeline-layer-state-private.h"
#include "string.h"
#if 0
@@ -361,7 +362,7 @@ cogl_pipeline_set_layer_null_texture (CoglPipeline *pipeline,
_cogl_pipeline_set_layer_texture_data (pipeline, layer_index, NULL);
}
-void
+static void
_cogl_pipeline_set_layer_wrap_modes (CoglPipeline *pipeline,
CoglPipelineLayer *layer,
CoglPipelineLayer *authority,
diff --git a/cogl/cogl-pipeline-progend-glsl.c b/cogl/cogl-pipeline-progend-glsl.c
index 3bb6f797..6d7cf430 100644
--- a/cogl/cogl-pipeline-progend-glsl.c
+++ b/cogl/cogl-pipeline-progend-glsl.c
@@ -49,6 +49,7 @@
#include "cogl-pipeline-state-private.h"
#include "cogl-attribute-private.h"
#include "cogl-framebuffer-private.h"
+#include "cogl-pipeline-progend-glsl-private.h"
#ifdef HAVE_COGL_GLES2
diff --git a/cogl/cogl-pipeline-state.c b/cogl/cogl-pipeline-state.c
index a79494a3..4b18d239 100644
--- a/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl-pipeline-state.c
@@ -451,7 +451,7 @@ _cogl_pipeline_get_blend_enabled (CoglPipeline *pipeline)
return authority->blend_enable;
}
-gboolean
+static gboolean
_cogl_pipeline_blend_enable_equal (CoglPipeline *authority0,
CoglPipeline *authority1)
{
@@ -844,7 +844,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline)
return authority->big_state->alpha_state.alpha_func_reference;
}
-GLenum
+static GLenum
arg_to_gl_blend_factor (CoglBlendStringArgument *arg)
{
if (arg->source.is_zero)
@@ -914,7 +914,7 @@ arg_to_gl_blend_factor (CoglBlendStringArgument *arg)
return GL_ONE;
}
-void
+static void
setup_blend_state (CoglBlendStringStatement *statement,
GLenum *blend_equation,
GLint *blend_src_factor,
diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index 7545855a..cb708aa5 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -88,12 +88,6 @@ _cogl_pipeline_progends[MAX (COGL_PIPELINE_N_PROGENDS, 1)];
COGL_OBJECT_DEFINE (Pipeline, pipeline);
-GQuark
-_cogl_pipeline_error_quark (void)
-{
- return g_quark_from_static_string ("cogl-pipeline-error-quark");
-}
-
/*
* This initializes the first pipeline owned by the Cogl context. All
* subsequently instantiated pipelines created via the cogl_pipeline_new()
diff --git a/cogl/cogl-point-in-poly.c b/cogl/cogl-point-in-poly.c
index 87e090ec..71c6882e 100644
--- a/cogl/cogl-point-in-poly.c
+++ b/cogl/cogl-point-in-poly.c
@@ -39,6 +39,7 @@
#endif
#include "cogl-util.h"
+#include "cogl-point-in-poly-private.h"
#include <glib.h>
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index 1519c69d..d17051d5 100644
--- a/cogl/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
@@ -39,6 +39,7 @@
#include "cogl-meta-texture.h"
#include "cogl-framebuffer-private.h"
#include "cogl1-context.h"
+#include "cogl-primitives-private.h"
#include <string.h>
#include <math.h>
@@ -899,7 +900,7 @@ typedef struct _AppendTexCoordsState
float *vertices_out;
} AppendTexCoordsState;
-gboolean
+static gboolean
append_tex_coord_attributes_cb (CoglPipeline *pipeline,
int layer_index,
void *user_data)
diff --git a/cogl/cogl-program-private.h b/cogl/cogl-program-private.h
index 0474744a..5c33f61c 100644
--- a/cogl/cogl-program-private.h
+++ b/cogl/cogl-program-private.h
@@ -58,8 +58,6 @@ struct _CoglProgramUniform
unsigned int dirty : 1;
};
-CoglProgram *_cogl_program_pointer_from_handle (CoglHandle handle);
-
/* Internal function to flush the custom uniforms for the given use
program. This assumes the target GL program is already bound. The
gl_program still needs to be passed so that CoglProgram can query
diff --git a/cogl/cogl-program.c b/cogl/cogl-program.c
index d7f324b5..3d265ffd 100644
--- a/cogl/cogl-program.c
+++ b/cogl/cogl-program.c
@@ -102,8 +102,8 @@ cogl_program_attach_shader (CoglHandle program_handle,
if (!cogl_is_program (program_handle) || !cogl_is_shader (shader_handle))
return;
- program = _cogl_program_pointer_from_handle (program_handle);
- shader = _cogl_shader_pointer_from_handle (shader_handle);
+ program = program_handle;
+ shader = shader_handle;
/* Only one shader is allowed if the type is ARBfp */
if (shader->language == COGL_SHADER_LANGUAGE_ARBFP)
@@ -158,7 +158,7 @@ cogl_program_get_uniform_location (CoglHandle handle,
if (!cogl_is_program (handle))
return -1;
- program = _cogl_program_pointer_from_handle (handle);
+ program = handle;
/* We can't just ask the GL program object for the uniform location
directly because it will change every time the program is linked
diff --git a/cogl/cogl-quaternion.c b/cogl/cogl-quaternion.c
index 5a686110..cfb80310 100644
--- a/cogl/cogl-quaternion.c
+++ b/cogl/cogl-quaternion.c
@@ -60,6 +60,12 @@ static CoglQuaternion identity_quaternion =
1.0, 0.0, 0.0, 0.0,
};
+/* This function is just here to be called from GDB so we don't really
+ want to put a declaration in a header and we just add it here to
+ avoid a warning */
+void
+_cogl_quaternion_print (CoglQuaternion *quarternion);
+
void
_cogl_quaternion_print (CoglQuaternion *quaternion)
{
@@ -240,15 +246,6 @@ cogl_quaternion_init_from_quaternion (CoglQuaternion *quaternion,
#define COGL_MATRIX_READ(MATRIX, ROW, COLUMN) \
(((const float *)matrix)[COLUMN * 4 + ROW])
-/**
- * cogl_quaternion_init_from_matrix:
- * @quaternion: A Cogl Quaternion
- * @matrix: A rotation matrix with which to initialize the quaternion
- *
- * Initializes a quaternion from a rotation matrix.
- *
- * Since: 1.4
- */
void
cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
const CoglMatrix *matrix)
diff --git a/cogl/cogl-quaternion.h b/cogl/cogl-quaternion.h
index 874a4613..eb60bcd0 100644
--- a/cogl/cogl-quaternion.h
+++ b/cogl/cogl-quaternion.h
@@ -251,6 +251,24 @@ void
cogl_quaternion_init_from_euler (CoglQuaternion *quaternion,
const CoglEuler *euler);
+void
+cogl_quaternion_init_from_quaternion (CoglQuaternion *quaternion,
+ CoglQuaternion *src);
+
+/**
+ * cogl_quaternion_init_from_matrix:
+ * @quaternion: A Cogl Quaternion
+ * @matrix: A rotation matrix with which to initialize the quaternion
+ *
+ * Initializes a quaternion from a rotation matrix.
+ *
+ * Since: 1.10
+ * Stability: unstable
+ */
+void
+cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
+ const CoglMatrix *matrix);
+
/**
* cogl_quaternion_equal:
* @v1: A #CoglQuaternion
diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c
index 1c6a28b8..d07a3ca4 100644
--- a/cogl/cogl-renderer.c
+++ b/cogl/cogl-renderer.c
@@ -62,19 +62,18 @@
#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT
#include "cogl-winsys-egl-null-private.h"
#endif
-
-#if COGL_HAS_XLIB_SUPPORT
-#include "cogl-xlib-renderer.h"
-#endif
-
#ifdef COGL_HAS_GLX_SUPPORT
-extern const CoglWinsysVtable *_cogl_winsys_glx_get_vtable (void);
+#include "cogl-winsys-glx-private.h"
#endif
#ifdef COGL_HAS_WGL_SUPPORT
-extern const CoglWinsysVtable *_cogl_winsys_wgl_get_vtable (void);
+#include "cogl-winsys-wgl-private.h"
#endif
#ifdef COGL_HAS_SDL_SUPPORT
-extern const CoglWinsysVtable *_cogl_winsys_sdl_get_vtable (void);
+#include "cogl-winsys-sdl-private.h"
+#endif
+
+#if COGL_HAS_XLIB_SUPPORT
+#include "cogl-xlib-renderer.h"
#endif
typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void);
diff --git a/cogl/cogl-shader-private.h b/cogl/cogl-shader-private.h
index 486375d1..6c05b3fb 100644
--- a/cogl/cogl-shader-private.h
+++ b/cogl/cogl-shader-private.h
@@ -45,8 +45,6 @@ struct _CoglShader
char *source;
};
-CoglShader *_cogl_shader_pointer_from_handle (CoglHandle handle);
-
void
_cogl_shader_compile_real (CoglHandle handle, int n_tex_coord_attribs);
diff --git a/cogl/cogl-shader.c b/cogl/cogl-shader.c
index 9b09b107..cd8a7eda 100644
--- a/cogl/cogl-shader.c
+++ b/cogl/cogl-shader.c
@@ -130,7 +130,7 @@ cogl_shader_source (CoglHandle handle,
if (!cogl_is_shader (handle))
return;
- shader = _cogl_shader_pointer_from_handle (handle);
+ shader = handle;
#ifdef HAVE_COGL_GL
if (strncmp (source, "!!ARBfp1.0", 10) == 0)
@@ -399,7 +399,7 @@ cogl_shader_get_info_log (CoglHandle handle)
if (!cogl_is_shader (handle))
return NULL;
- shader = _cogl_shader_pointer_from_handle (handle);
+ shader = handle;
#ifdef HAVE_COGL_GL
if (shader->language == COGL_SHADER_LANGUAGE_ARBFP)
@@ -450,7 +450,7 @@ cogl_shader_get_type (CoglHandle handle)
return COGL_SHADER_TYPE_VERTEX;
}
- shader = _cogl_shader_pointer_from_handle (handle);
+ shader = handle;
return shader->type;
}
@@ -466,7 +466,7 @@ cogl_shader_is_compiled (CoglHandle handle)
if (!cogl_is_shader (handle))
return FALSE;
- shader = _cogl_shader_pointer_from_handle (handle);
+ shader = handle;
#ifdef HAVE_COGL_GL
if (shader->language == COGL_SHADER_LANGUAGE_ARBFP)
diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c
index 396c3b22..925a8784 100644
--- a/cogl/cogl-sub-texture.c
+++ b/cogl/cogl-sub-texture.c
@@ -237,8 +237,7 @@ cogl_sub_texture_new (CoglContext *ctx,
instead. */
if (cogl_is_sub_texture (next_texture))
{
- CoglSubTexture *other_sub_tex =
- _cogl_sub_texture_pointer_from_handle (next_texture);
+ CoglSubTexture *other_sub_tex = COGL_SUB_TEXTURE (next_texture);
full_texture = other_sub_tex->full_texture;
sub_x += other_sub_tex->sub_x;
sub_y += other_sub_tex->sub_y;
diff --git a/cogl/cogl-swap-chain.c b/cogl/cogl-swap-chain.c
index a487419f..51609fed 100644
--- a/cogl/cogl-swap-chain.c
+++ b/cogl/cogl-swap-chain.c
@@ -37,12 +37,6 @@ static void _cogl_swap_chain_free (CoglSwapChain *swap_chain);
COGL_OBJECT_DEFINE (SwapChain, swap_chain);
-GQuark
-cogl_swap_chain_error_quark (void)
-{
- return g_quark_from_static_string ("cogl-swap-chain-error-quark");
-}
-
static void
_cogl_swap_chain_free (CoglSwapChain *swap_chain)
{
diff --git a/cogl/cogl-swap-chain.h b/cogl/cogl-swap-chain.h
index 2f3ae587..04209354 100644
--- a/cogl/cogl-swap-chain.h
+++ b/cogl/cogl-swap-chain.h
@@ -46,6 +46,9 @@ void
cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
int length);
+gboolean
+cogl_is_swap_chain (void *object);
+
G_END_DECLS
#endif /* __COGL_SWAP_CHAIN_H__ */
diff --git a/cogl/cogl-texture-2d-sliced.h b/cogl/cogl-texture-2d-sliced.h
index b0e3136a..b64d0be3 100644
--- a/cogl/cogl-texture-2d-sliced.h
+++ b/cogl/cogl-texture-2d-sliced.h
@@ -99,4 +99,18 @@ cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
CoglPixelFormat internal_format,
GError **error);
+/**
+ * cogl_is_texture_2d_sliced:
+ * @object: A #CoglObject pointer
+ *
+ * Gets whether the given object references a #CoglTexture2dSliced.
+ *
+ * Return value: %TRUE if the object references a #CoglTexture2dSliced
+ * and %FALSE otherwise.
+ * Since: 1.10
+ * Stability: unstable
+ */
+gboolean
+cogl_is_texture_2d_sliced (void *object);
+
#endif /* __COGL_TEXURE_2D_SLICED_H */
diff --git a/cogl/cogl-texture-3d.c b/cogl/cogl-texture-3d.c
index 956d9b13..c2066f7b 100644
--- a/cogl/cogl-texture-3d.c
+++ b/cogl/cogl-texture-3d.c
@@ -395,12 +395,6 @@ cogl_texture_3d_new_from_data (CoglContext *context,
return ret;
}
-GQuark
-cogl_texture_3d_error_quark (void)
-{
- return g_quark_from_static_string ("cogl-texture-3d-error-quark");
-}
-
static int
_cogl_texture_3d_get_max_waste (CoglTexture *tex)
{
diff --git a/cogl/cogl-vertex-buffer-private.h b/cogl/cogl-vertex-buffer-private.h
index a7b23c85..a4143d29 100644
--- a/cogl/cogl-vertex-buffer-private.h
+++ b/cogl/cogl-vertex-buffer-private.h
@@ -154,11 +154,5 @@ typedef struct _CoglVertexBuffer
} CoglVertexBuffer;
-CoglVertexBuffer *
-_cogl_vertex_buffer_pointer_from_handle (CoglHandle handle);
-
-CoglVertexBufferIndices *
-_cogl_vertex_buffer_indices_pointer_from_handle (CoglHandle handle);
-
#endif /* __COGL_VERTEX_BUFFER_H */
diff --git a/cogl/cogl-vertex-buffer.c b/cogl/cogl-vertex-buffer.c
index 01793782..36c89e21 100644
--- a/cogl/cogl-vertex-buffer.c
+++ b/cogl/cogl-vertex-buffer.c
@@ -144,7 +144,7 @@ cogl_vertex_buffer_get_n_vertices (CoglHandle handle)
if (!cogl_is_vertex_buffer (handle))
return 0;
- buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+ buffer = handle;
return buffer->n_vertices;
}
@@ -451,7 +451,7 @@ cogl_vertex_buffer_add (CoglHandle handle,
if (!cogl_is_vertex_buffer (handle))
return;
- buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+ buffer = handle;
buffer->dirty_attributes = TRUE;
cogl_attribute_name = canonize_attribute_name (attribute_name);
@@ -577,7 +577,7 @@ cogl_vertex_buffer_delete (CoglHandle handle,
if (!cogl_is_vertex_buffer (handle))
return;
- buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+ buffer = handle;
buffer->dirty_attributes = TRUE;
/* The submit function works by diffing between submitted_attributes
@@ -618,7 +618,7 @@ set_attribute_enable (CoglHandle handle,
if (!cogl_is_vertex_buffer (handle))
return;
- buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+ buffer = handle;
buffer->dirty_attributes = TRUE;
/* NB: If a buffer is currently being edited, then there can be two seperate
@@ -1469,7 +1469,7 @@ cogl_vertex_buffer_submit (CoglHandle handle)
if (!cogl_is_vertex_buffer (handle))
return;
- buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+ buffer = handle;
cogl_vertex_buffer_submit_real (buffer);
}
@@ -1647,7 +1647,7 @@ cogl_vertex_buffer_draw (CoglHandle handle,
if (!cogl_is_vertex_buffer (handle))
return;
- buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+ buffer = handle;
update_primitive_and_draw (buffer, mode, first, count, NULL);
}
@@ -1683,8 +1683,7 @@ cogl_vertex_buffer_indices_get_type (CoglHandle indices_handle)
if (!cogl_is_vertex_buffer_indices (indices_handle))
return COGL_INDICES_TYPE_UNSIGNED_SHORT;
- buffer_indices =
- _cogl_vertex_buffer_indices_pointer_from_handle (indices_handle);
+ buffer_indices = indices_handle;
return cogl_indices_get_type (buffer_indices->indices);
}
@@ -1711,13 +1710,12 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle,
if (!cogl_is_vertex_buffer (handle))
return;
- buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
+ buffer = handle;
if (!cogl_is_vertex_buffer_indices (indices_handle))
return;
- buffer_indices =
- _cogl_vertex_buffer_indices_pointer_from_handle (indices_handle);
+ buffer_indices = indices_handle;
update_primitive_and_draw (buffer, mode, indices_offset, count,
buffer_indices);
diff --git a/cogl/cogl.c b/cogl/cogl.c
index bfd7ab5e..eece03d8 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -561,15 +561,6 @@ cogl_set_projection_matrix (CoglMatrix *matrix)
cogl_framebuffer_set_projection_matrix (cogl_get_draw_framebuffer (), matrix);
}
-CoglClipState *
-_cogl_get_clip_state (void)
-{
- CoglFramebuffer *framebuffer;
-
- framebuffer = cogl_get_draw_framebuffer ();
- return _cogl_framebuffer_get_clip_state (framebuffer);
-}
-
GQuark
_cogl_driver_error_quark (void)
{
diff --git a/cogl/cogl.h b/cogl/cogl.h
index e8b1eeb6..44778851 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -124,7 +124,6 @@
*/
#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
#include <cogl/cogl2-path.h>
-#include <cogl/cogl2-clip-state.h>
#endif
/*
diff --git a/cogl/cogl2-clip-state.h b/cogl/cogl2-clip-state.h
deleted file mode 100644
index 63b20eea..00000000
--- a/cogl/cogl2-clip-state.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Cogl
- *
- * An object oriented GL/GLES Abstraction/Utility Layer
- *
- * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- *
- */
-
-#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
-#error "Only <cogl/cogl.h> can be included directly."
-#endif
-
-#ifndef __COGL2_CLIP_STATE_H
-#define __COGL2_CLIP_STATE_H
-
-#include <cogl/cogl-types.h>
-
-G_BEGIN_DECLS
-
-#define cogl_clip_push_from_path cogl2_clip_push_from_path
-/**
- * cogl_clip_push_from_path:
- * @path: The path to clip with.
- *
- * Sets a new clipping area using the silhouette of the specified,
- * filled @path. The clipping area is intersected with the previous
- * clipping area. To restore the previous clipping area, call
- * call cogl_clip_pop().
- *
- * Since: 1.8
- * Stability: Unstable
- */
-void
-cogl_clip_push_from_path (CoglPath *path);
-
-G_END_DECLS
-
-#endif /* __COGL2_CLIP_STATE_H */
diff --git a/cogl/driver/gles/cogl-gles.c b/cogl/driver/gles/cogl-gles.c
index 2afdbebd..8087ae0e 100644
--- a/cogl/driver/gles/cogl-gles.c
+++ b/cogl/driver/gles/cogl-gles.c
@@ -31,6 +31,7 @@
#include "cogl-context-private.h"
#include "cogl-feature-private.h"
#include "cogl-renderer-private.h"
+#include "cogl-private.h"
gboolean
_cogl_gles_update_features (CoglContext *context,
diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c
index 1f42fe58..ecddb433 100644
--- a/cogl/winsys/cogl-winsys-egl-kms.c
+++ b/cogl/winsys/cogl-winsys-egl-kms.c
@@ -46,6 +46,7 @@
#include "cogl-renderer-private.h"
#include "cogl-framebuffer-private.h"
#include "cogl-onscreen-private.h"
+#include "cogl-kms-renderer.h"
static const CoglWinsysEGLVtable _cogl_winsys_egl_vtable;
diff --git a/cogl/cogl2-clip-state.c b/cogl/winsys/cogl-winsys-glx-private.h
index 57f18e26..5844e18a 100644
--- a/cogl/cogl2-clip-state.c
+++ b/cogl/winsys/cogl-winsys-glx-private.h
@@ -3,7 +3,7 @@
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
- * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
+ * Copyright (C) 2012 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,16 +21,10 @@
*
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#ifndef __COGL_WINSYS_GLX_PRIVATE_H
+#define __COGL_WINSYS_GLX_PRIVATE_H
-#include "cogl-clip-state-private.h"
-#include "cogl-framebuffer-private.h"
-#include "cogl-journal-private.h"
+const CoglWinsysVtable *
+_cogl_winsys_glx_get_vtable (void);
-void
-cogl2_clip_push_from_path (CoglPath *path)
-{
- cogl_framebuffer_push_path_clip (cogl_get_draw_framebuffer (), path);
-}
+#endif /* __COGL_WINSYS_GLX_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index 765191ba..79800ac9 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -47,6 +47,7 @@
#include "cogl-swap-chain-private.h"
#include "cogl-xlib-renderer.h"
#include "cogl-util.h"
+#include "cogl-winsys-glx-private.h"
#include <stdlib.h>
#include <sys/types.h>
diff --git a/cogl/winsys/cogl-winsys-sdl-private.h b/cogl/winsys/cogl-winsys-sdl-private.h
new file mode 100644
index 00000000..2f0066d0
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-sdl-private.h
@@ -0,0 +1,30 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2012 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_SDL_PRIVATE_H
+#define __COGL_WINSYS_SDL_PRIVATE_H
+
+const CoglWinsysVtable *
+_cogl_winsys_sdl_get_vtable (void);
+
+#endif /* __COGL_WINSYS_SDL_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-sdl.c b/cogl/winsys/cogl-winsys-sdl.c
index c71f402f..deda0452 100644
--- a/cogl/winsys/cogl-winsys-sdl.c
+++ b/cogl/winsys/cogl-winsys-sdl.c
@@ -36,6 +36,7 @@
#include "cogl-onscreen-template-private.h"
#include "cogl-context-private.h"
#include "cogl-onscreen-private.h"
+#include "cogl-winsys-sdl-private.h"
typedef struct _CoglRendererSdl
{
diff --git a/cogl/winsys/cogl-winsys-stub.c b/cogl/winsys/cogl-winsys-stub.c
index 3310cfe0..1801b66c 100644
--- a/cogl/winsys/cogl-winsys-stub.c
+++ b/cogl/winsys/cogl-winsys-stub.c
@@ -34,6 +34,7 @@
#include "cogl-context-private.h"
#include "cogl-framebuffer-private.h"
#include "cogl-private.h"
+#include "cogl-winsys-stub-private.h"
#include <string.h>
diff --git a/cogl/winsys/cogl-winsys-wgl-private.h b/cogl/winsys/cogl-winsys-wgl-private.h
new file mode 100644
index 00000000..fd41eb4d
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-wgl-private.h
@@ -0,0 +1,30 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2012 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_WGL_PRIVATE_H
+#define __COGL_WINSYS_WGL_PRIVATE_H
+
+const CoglWinsysVtable *
+_cogl_winsys_wgl_get_vtable (void);
+
+#endif /* __COGL_WINSYS_WGL_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-wgl.c b/cogl/winsys/cogl-winsys-wgl.c
index 66f9ed13..198b1d81 100644
--- a/cogl/winsys/cogl-winsys-wgl.c
+++ b/cogl/winsys/cogl-winsys-wgl.c
@@ -44,6 +44,7 @@
#include "cogl-private.h"
#include "cogl-feature-private.h"
#include "cogl-win32-renderer.h"
+#include "cogl-winsys-wgl-private.h"
typedef struct _CoglRendererWgl
{