mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00: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)
86 lines
4.0 KiB
C
86 lines
4.0 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 __PANGO_CLUTTER_H__
|
|
#define __PANGO_CLUTTER_H__
|
|
|
|
#include <glib-object.h>
|
|
#include <pango/pango.h>
|
|
#include <pango/pangocairo.h>
|
|
#include <cogl/cogl.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
/* It's too difficult to actually subclass the pango cairo font
|
|
* map. Instead we just make a fake set of macros that actually just
|
|
* directly use the original type
|
|
*/
|
|
#define COGL_PANGO_TYPE_FONT_MAP PANGO_TYPE_CAIRO_FONT_MAP
|
|
#define COGL_PANGO_FONT_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COGL_PANGO_TYPE_FONT_MAP, CoglPangoFontMap))
|
|
#define COGL_PANGO_IS_FONT_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COGL_PANGO_TYPE_FONT_MAP))
|
|
|
|
typedef PangoCairoFontMap CoglPangoFontMap;
|
|
|
|
PangoFontMap * cogl_pango_font_map_new (void);
|
|
PangoContext * cogl_pango_font_map_create_context (CoglPangoFontMap *fm);
|
|
void cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
|
|
double dpi);
|
|
void cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm);
|
|
void cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
|
|
void cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
|
|
CoglBool value);
|
|
CoglBool cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm);
|
|
PangoRenderer *cogl_pango_font_map_get_renderer (CoglPangoFontMap *fm);
|
|
|
|
#define COGL_PANGO_TYPE_RENDERER (cogl_pango_renderer_get_type ())
|
|
#define COGL_PANGO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COGL_PANGO_TYPE_RENDERER, CoglPangoRenderer))
|
|
#define COGL_PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), COGL_PANGO_TYPE_RENDERER, CoglPangoRendererClass))
|
|
#define COGL_PANGO_IS_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COGL_PANGO_TYPE_RENDERER))
|
|
#define COGL_PANGO_IS_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COGL_PANGO_TYPE_RENDERER))
|
|
#define COGL_PANGO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_PANGO_TYPE_RENDERER, CoglPangoRendererClass))
|
|
|
|
/* opaque types */
|
|
typedef struct _CoglPangoRenderer CoglPangoRenderer;
|
|
typedef struct _CoglPangoRendererClass CoglPangoRendererClass;
|
|
|
|
GType cogl_pango_renderer_get_type (void) G_GNUC_CONST;
|
|
|
|
void cogl_pango_render_layout_subpixel (PangoLayout *layout,
|
|
int x,
|
|
int y,
|
|
const CoglColor *color,
|
|
int flags);
|
|
void cogl_pango_render_layout (PangoLayout *layout,
|
|
int x,
|
|
int y,
|
|
const CoglColor *color,
|
|
int flags);
|
|
void cogl_pango_render_layout_line (PangoLayoutLine *line,
|
|
int x,
|
|
int y,
|
|
const CoglColor *color);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __PANGO_CLUTTER_H__ */
|