mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
54735dec84
The coding style has for a long time said to avoid using redundant glib data types such as gint or gchar etc because we feel that they make the code look unnecessarily foreign to developers coming from outside of the Gnome developer community. Note: When we tried to find the historical rationale for the types we just found that they were apparently only added for consistent syntax highlighting which didn't seem that compelling. Up until now we have been continuing to use some of the platform specific type such as gint{8,16,32,64} and gsize but this patch switches us over to using the standard c99 equivalents instead so we can further ensure that our code looks familiar to the widest range of C developers who might potentially contribute to Cogl. So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this switches all Cogl code to instead use the int{8,16,32,64}_t and uint{8,16,32,64}_t c99 types instead. Instead of gsize we now use size_t For now we are not going to use the c99 _Bool type and instead we have introduced a new CoglBool type to use instead of gboolean. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
94 lines
2.7 KiB
C
94 lines
2.7 KiB
C
/*
|
|
* Clutter.
|
|
*
|
|
* An OpenGL based 'interactive canvas' library.
|
|
*
|
|
* Authored By Matthew Allum <mallum@openedhand.com>
|
|
*
|
|
* Copyright (C) 2008 OpenedHand
|
|
*
|
|
* 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_PANGO_GLYPH_CACHE_H__
|
|
#define __COGL_PANGO_GLYPH_CACHE_H__
|
|
|
|
#include <glib.h>
|
|
#include <cogl/cogl.h>
|
|
#include <pango/pango-font.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _CoglPangoGlyphCache CoglPangoGlyphCache;
|
|
typedef struct _CoglPangoGlyphCacheValue CoglPangoGlyphCacheValue;
|
|
|
|
struct _CoglPangoGlyphCacheValue
|
|
{
|
|
CoglTexture *texture;
|
|
|
|
float tx1;
|
|
float ty1;
|
|
float tx2;
|
|
float ty2;
|
|
|
|
int tx_pixel;
|
|
int ty_pixel;
|
|
|
|
int draw_x;
|
|
int draw_y;
|
|
int draw_width;
|
|
int draw_height;
|
|
|
|
/* This will be set to TRUE when the glyph atlas is reorganized
|
|
which means the glyph will need to be redrawn */
|
|
CoglBool dirty;
|
|
};
|
|
|
|
typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
|
|
PangoGlyph glyph,
|
|
CoglPangoGlyphCacheValue *value);
|
|
|
|
CoglPangoGlyphCache *
|
|
cogl_pango_glyph_cache_new (CoglBool use_mipmapping);
|
|
|
|
void
|
|
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
|
|
|
|
CoglPangoGlyphCacheValue *
|
|
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
|
|
CoglBool create,
|
|
PangoFont *font,
|
|
PangoGlyph glyph);
|
|
|
|
void
|
|
cogl_pango_glyph_cache_clear (CoglPangoGlyphCache *cache);
|
|
|
|
void
|
|
_cogl_pango_glyph_cache_add_reorganize_callback (CoglPangoGlyphCache *cache,
|
|
GHookFunc func,
|
|
void *user_data);
|
|
|
|
void
|
|
_cogl_pango_glyph_cache_remove_reorganize_callback (CoglPangoGlyphCache *cache,
|
|
GHookFunc func,
|
|
void *user_data);
|
|
|
|
void
|
|
_cogl_pango_glyph_cache_set_dirty_glyphs (CoglPangoGlyphCache *cache,
|
|
CoglPangoGlyphCacheDirtyFunc func);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __COGL_PANGO_GLYPH_CACHE_H__ */
|