[AdgText] Initial implementation
[adg.git] / src / adg / adg-internal.h
blob53d874420b21a81a4c2a8d47c307f925332ad1fe
1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009,2010,2011 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 * This header is included by every .c files of the library to
22 * enable the inclusion of the internal headers and initialize
23 * some common stuff.
25 * Among other things, it provides also:
27 * - an internal proxy type (AdgBestFontStyle) that resolves to
28 * AdgFontStyle or AdgPangoStyle, depending on wheter or not
29 * the pango support has been compiled;
30 * - an internal proxy type (AdgBestText) that resolves to
31 * AdgToyText or AdgText, depending on wheter or not the pango
32 * support has been compiled;
35 #ifndef __ADG_INTERNAL_H__
36 #define __ADG_INTERNAL_H__
39 /* The following define enables the inclusion of internal headers */
40 #define __ADG_H__
42 #include <config.h>
43 #define G_LOG_DOMAIN PACKAGE
44 #include <glib-object.h>
45 #include <cpml.h>
47 /* The following headers are autogenerated, so they could be hosted
48 * in a different directory on VPATH builds (in other words, angle
49 * brackets are used instead of quotes) */
50 #include <adg/adg-type-builtins.h>
51 #include <adg/adg-marshal.h>
53 /* ADG headers basically included by every source file */
54 #include "adg-enums.h"
55 #include "adg-utils.h"
56 #include "adg-pair.h"
57 #include "adg-matrix.h"
58 #include "adg-primitive.h"
59 #include "adg-segment.h"
60 #include "adg-entity.h"
63 #ifdef ENABLE_NLS
65 #include <libintl.h>
67 #ifndef GETTEXT_PACKAGE
68 #error You must define GETTEXT_PACKAGE before including adg-internal.h. Did you forget to include config.h?
69 #endif
71 #ifdef gettext_noop
72 #define N_(String) gettext_noop(String)
73 #else
74 #define N_(String) (String)
75 #endif
77 #define _(String) _adg_dgettext(GETTEXT_PACKAGE, String)
78 #define P_(String) _adg_dgettext(GETTEXT_PACKAGE "-properties", String)
79 #define Q_(String) _adg_dpgettext(GETTEXT_PACKAGE, String, 0)
80 #define C_(Context,String) _adg_dpgettext(GETTEXT_PACKAGE, Context "\004" String, strlen(Context) + 1)
81 #define NC_(Context,String) N_(String)
83 #else /* !ENABLE_NLS */
85 #define _(String) (String)
86 #define P_(String) (String)
87 #define Q_(String) (String)
88 #define N_(String) (String)
89 #define C_(Context,String) (String)
90 #define NC_(Context, String) (String)
92 #endif
95 #ifdef PANGO_ENABLED
97 #include <pango/pango.h>
99 #define ADG_TYPE_BEST_TEXT ADG_TYPE_TEXT
100 #define ADG_TYPE_BEST_FONT_STYLE ADG_TYPE_PANGO_STYLE
102 #else /* ! PANGO_ENABLED */
104 #define ADG_TYPE_BEST_TEXT ADG_TYPE_TOY_TEXT
105 #define ADG_TYPE_BEST_FONT_STYLE ADG_TYPE_FONT_STYLE
107 /* Prevent the inclusion of the pango specific headers */
108 #define __ADG_TEXT_H__ 1
109 #define __ADG_TEXT_PRIVATE_H__ 1
110 #define __ADG_PANGO_STYLE_H__ 1
111 #define __ADG_PANGO_STYLE_PRIVATE_H__ 1
113 #endif /* PANGO_ENABLED */
116 G_CONST_RETURN gchar * _adg_dgettext (const gchar *domain,
117 const gchar *msgid) G_GNUC_FORMAT(2);
118 G_CONST_RETURN gchar * _adg_dpgettext (const gchar *domain,
119 const gchar *msgctxtid,
120 gsize msgidoffset) G_GNUC_FORMAT(2);
123 #endif /* __ADG_INTERNAL_H__ */