cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so this is a first pass at tidying things up by giving them some consistency. These changes are all consistent with how new code in Cogl is being written, but the style isn't consistently applied across all code yet. There are two parts to this patch; but since each one required a large amount of effort to maintain tidy indenting it made sense to combine the changes to reduce the time spent re indenting the same lines. The first change is to use a consistent style for declaring function prototypes in headers. Cogl headers now consistently use this style for prototypes: return_type cogl_function_name (CoglType arg0, CoglType arg1); Not everyone likes this style, but it seems that most of the currently active Cogl developers agree on it. The second change is to constrain the use of redundant glib data types in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all been replaced with int, unsigned int, float, long, unsigned long and char respectively. When talking about pixel data; use of guchar has been replaced with guint8, otherwise unsigned char can be used. The glib types that we continue to use for portability are gboolean, gint{8,16,32,64}, guint{8,16,32,64} and gsize. The general intention is that Cogl should look palatable to the widest range of C programmers including those outside the Gnome community so - especially for the public API - we want to minimize the number of foreign looking typedefs.
This commit is contained in:
@ -70,7 +70,7 @@ cogl_is_buffer (CoglHandle handle);
|
||||
* Since: 1.2
|
||||
* Stability: Unstable
|
||||
*/
|
||||
guint
|
||||
unsigned int
|
||||
cogl_buffer_get_size (CoglHandle handle);
|
||||
|
||||
/**
|
||||
@ -85,7 +85,7 @@ cogl_buffer_get_size (CoglHandle handle);
|
||||
* Stability: Unstable
|
||||
*/
|
||||
typedef enum { /*< prefix=COGL_BUFFER_USAGE_HINT >*/
|
||||
COGL_BUFFER_USAGE_HINT_TEXTURE,
|
||||
COGL_BUFFER_USAGE_HINT_TEXTURE,
|
||||
} CoglBufferUsageHint;
|
||||
|
||||
/**
|
||||
@ -148,7 +148,7 @@ typedef enum { /*< prefix=COGL_BUFFER_UPDATE_HINT >*/
|
||||
* Stability: Unstable
|
||||
*/
|
||||
void
|
||||
cogl_buffer_set_update_hint (CoglHandle handle,
|
||||
cogl_buffer_set_update_hint (CoglHandle handle,
|
||||
CoglBufferUpdateHint hint);
|
||||
|
||||
/**
|
||||
@ -196,7 +196,7 @@ typedef enum { /*< prefix=COGL_BUFFER_ACCESS >*/
|
||||
* Since: 1.2
|
||||
* Stability: Unstable
|
||||
*/
|
||||
guchar *
|
||||
guint8 *
|
||||
cogl_buffer_map (CoglHandle handle,
|
||||
CoglBufferAccess access);
|
||||
|
||||
@ -230,9 +230,9 @@ cogl_buffer_unmap (CoglHandle handle);
|
||||
*/
|
||||
gboolean
|
||||
cogl_buffer_set_data (CoglHandle handle,
|
||||
gsize offset,
|
||||
const guchar *data,
|
||||
gsize size);
|
||||
gsize offset,
|
||||
const guint8 *data,
|
||||
gsize size);
|
||||
|
||||
/* the functions above are experimental, the actual symbols are suffixed by
|
||||
* _EXP so we can ensure ABI compatibility and leave the cogl_buffer namespace
|
||||
@ -242,7 +242,7 @@ cogl_buffer_set_data (CoglHandle handle,
|
||||
gboolean
|
||||
cogl_is_buffer_EXP (CoglHandle handle);
|
||||
|
||||
guint
|
||||
unsigned int
|
||||
cogl_buffer_get_size_EXP (CoglHandle handle);
|
||||
|
||||
void
|
||||
@ -253,13 +253,13 @@ CoglBufferUsageHint
|
||||
cogl_buffer_get_usage_hint_EXP (CoglHandle handle);
|
||||
|
||||
void
|
||||
cogl_buffer_set_update_hint_EXP (CoglHandle handle,
|
||||
cogl_buffer_set_update_hint_EXP (CoglHandle handle,
|
||||
CoglBufferUpdateHint hint);
|
||||
|
||||
CoglBufferUpdateHint
|
||||
cogl_buffer_get_update_hint_EXP (CoglHandle handle);
|
||||
|
||||
guchar *
|
||||
guint8 *
|
||||
cogl_buffer_map_EXP (CoglHandle handle,
|
||||
CoglBufferAccess access);
|
||||
|
||||
@ -268,9 +268,9 @@ cogl_buffer_unmap_EXP (CoglHandle handle);
|
||||
|
||||
gboolean
|
||||
cogl_buffer_set_data_EXP (CoglHandle handle,
|
||||
gsize offset,
|
||||
const guchar *data,
|
||||
gsize size);
|
||||
gsize offset,
|
||||
const guint8 *data,
|
||||
gsize size);
|
||||
|
||||
#define cogl_is_buffer cogl_is_buffer_EXP
|
||||
#define cogl_buffer_get_size cogl_buffer_get_size_EXP
|
||||
|
Reference in New Issue
Block a user