mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
cogl: Don't define the deprecated ref/unref accessors for new types
Previously COGL_OBJECT_DEFINE would always define deprecated cogl_$type_{ref,unref} functions even if the type is new or if the type is entirely internal. An application would still find it difficult to use these because they wouldn't be in the headers, but it still looks bad that they are exported from the shared library. This patch changes it so that the deprecated ref counting functions are defined using a separate macro and only the types that have these functions in the headers call this macro.
This commit is contained in:
parent
903560c6c8
commit
89cb325fd4
@ -115,6 +115,7 @@ static void _cogl_offscreen_free (CoglOffscreen *offscreen);
|
||||
|
||||
COGL_OBJECT_DEFINE (Onscreen, onscreen);
|
||||
COGL_OBJECT_DEFINE (Offscreen, offscreen);
|
||||
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (offscreen);
|
||||
|
||||
/* XXX:
|
||||
* The CoglObject macros don't support any form of inheritance, so for
|
||||
|
@ -112,6 +112,7 @@ static const CoglMaterialBackend *backends[COGL_MATERIAL_N_BACKENDS];
|
||||
#endif
|
||||
|
||||
COGL_OBJECT_DEFINE (Material, material);
|
||||
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (material);
|
||||
COGL_OBJECT_DEFINE (MaterialLayer, material_layer);
|
||||
|
||||
static void
|
||||
|
@ -166,7 +166,9 @@ cogl_is_##type_name (void *object) \
|
||||
\
|
||||
return (obj->klass->type == \
|
||||
_cogl_object_##type_name##_get_type ()); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING(type_name) \
|
||||
\
|
||||
void * G_GNUC_DEPRECATED \
|
||||
cogl_##type_name##_ref (void *object) \
|
||||
|
@ -212,6 +212,7 @@ static void _cogl_vertex_buffer_free (CoglVertexBuffer *buffer);
|
||||
static void _cogl_vertex_buffer_indices_free (CoglVertexBufferIndices *buffer_indices);
|
||||
|
||||
COGL_HANDLE_DEFINE (VertexBuffer, vertex_buffer);
|
||||
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (vertex_buffer);
|
||||
COGL_HANDLE_DEFINE (VertexBufferIndices, vertex_buffer_indices);
|
||||
|
||||
CoglHandle
|
||||
|
@ -43,6 +43,7 @@
|
||||
static void _cogl_shader_free (CoglShader *shader);
|
||||
|
||||
COGL_HANDLE_DEFINE (Shader, shader);
|
||||
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (shader);
|
||||
|
||||
static void
|
||||
_cogl_shader_free (CoglShader *shader)
|
||||
|
@ -37,6 +37,7 @@
|
||||
static void _cogl_shader_free (CoglShader *shader);
|
||||
|
||||
COGL_HANDLE_DEFINE (Shader, shader);
|
||||
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (shader);
|
||||
|
||||
static void
|
||||
_cogl_shader_free (CoglShader *shader)
|
||||
|
Loading…
Reference in New Issue
Block a user