grim/guifications3

1eb207f1d7ef
include gflib/gf_intl.h since it's no longer included via gf_lib.h
/*
* Guifications - The end-all, be-all notification framework
* Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GF_GC_H
#define GF_GC_H
typedef struct _GfGC GfGC;
typedef struct _GfGCClass GfGCClass;
typedef struct _GfGCValues GfGCValues;
#include <gflib/gf_enum.h>
#include <gflib/gf_object.h>
#include <gflib-ui/gf_color.h>
#include <gflib-ui/gf_font.h>
#define GF_TYPE_CAP_STYLE (gf_cap_style_get_gtype())
typedef enum _GfCapStyle {
GF_CAP_NOT_LAST = 0,
GF_CAP_BUTT,
GF_CAP_ROUND,
GF_CAP_PROJECTING
} GfCapStyle;
#define GF_TYPE_FILL (gf_fill_get_gtype())
typedef enum _GfFill {
GF_SOLID = 0,
GF_TILED,
GF_STIPPLED,
GF_OPAQUE_STIPPLED
} GfFill;
#define GF_TYPE_FUNCTION (gf_function_get_gtype())
typedef enum _GfFunction {
GF_COPY = 0,
GF_INVERT,
GF_XOR,
GF_CLEAR,
GF_AND,
GF_AND_REVERSE,
GF_AND_INVERT,
GF_NOOP,
GF_OR,
GF_EQUIV,
GF_OR_REVERSE,
GF_COPY_INVERT,
GF_OR_INVERT,
GF_NAND,
GF_NOR,
GF_SET
} GfFunction;
#define GF_TYPE_JOIN_STYLE (gf_join_style_get_gtype())
typedef enum _GfJoinStyle {
GF_JOIN_MITER = 0,
GF_JOIN_ROUND,
GF_JOIN_BEVEL
} GfJoinStyle;
#define GF_TYPE_LINE_STYLE (gf_line_style_get_gtype())
typedef enum _GfLineStyle {
GF_LINE_SOLID = 0,
GF_LINE_ON_OFF_DASH,
GF_LINE_DOUBLE_DASH
} GfLineStyle;
#define GF_TYPE_SUBWINDOW_MODE (gf_subwindow_mode_get_gtype())
typedef enum _GfSubwindowMode {
GF_CLIP_BY_CHILDREN = 0,
GF_INCLUDE_INFERIORS = 1
} GfSubwindowMode;
#define GF_TYPE_GC_VAULES_MASK (gf_gc_values_mask_get_gtype())
typedef enum _GfGCValuesMask {
GF_GC_FOREGROUND = 1 << 0,
GF_GC_BACKGROUND = 1 << 1,
GF_GC_FONT = 1 << 2,
GF_GC_FUNCTION = 1 << 3,
GF_GC_FILL = 1 << 4,
GF_GC_TILE = 1 << 5,
GF_GC_STIPPLE = 1 << 6,
GF_GC_CLIP_MASK = 1 << 7,
GF_GC_SUBWINDOW = 1 << 8,
GF_GC_TS_X_ORIGIN = 1 << 9,
GF_GC_TS_Y_ORIGIN = 1 << 10,
GF_GC_CLIP_X_ORIGIN = 1 << 11,
GF_GC_CLIP_Y_ORIGIN = 1 << 12,
GF_GC_EXPOSURES = 1 << 13,
GF_GC_LINE_WIDTH = 1 << 14,
GF_GC_LINE_STYLE = 1 << 15,
GF_GC_CAP_STYLE = 1 << 16,
GF_GC_JOIN_STYLE = 1 << 17
} GfGCValuesMask;
#include <gflib-ui/gf_drawable.h>
#define GF_TYPE_GF_GC_VALUES (gf_gc_values_get_gtype())
struct _GfGCValues {
GfColor foreground;
GfColor background;
GfFont *font;
GfFunction function;
GfFill fill;
GfDrawable *tile;
GfDrawable *stipple;
GfDrawable *clip_mask;
GfSubwindowMode subwindow_mode;
gint ts_x_origin;
gint ts_y_origin;
gint clip_x_origin;
gint clip_y_origin;
gint exposures;
gint line_width;
GfLineStyle line_style;
GfCapStyle cap_style;
GfJoinStyle join_style;
};
#define GF_TYPE_GC (gf_gc_get_gtype())
#define GF_GC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GF_TYPE_GC, GfGC))
#define GF_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GF_TYPE_GC, GfGCClass))
#define GF_IS_GC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GF_TYPE_GC))
#define GF_IS_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GF_TYPE_GC))
#define GF_GC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GF_TYPE_GC, GfGCClass))
struct _GfGC {
GfObject parent;
void (*_gf_reserved1)(void);
void (*_gf_reserved2)(void);
void (*_gf_reserved3)(void);
void (*_gf_reserved4)(void);
};
struct _GfGCClass {
GfObjectClass parent;
void (*get_values)(GfGC *gc, GfGCValues *values);
void (*set_values)(GfGC *gc, GfGCValues *values, GfGCValuesMask mask);
void (*_gf_reserved1)(void);
void (*_gf_reserved2)(void);
void (*_gf_reserved3)(void);
void (*_gf_reserved4)(void);
};
G_BEGIN_DECLS
GType gf_cap_style_get_gtype();
#define gf_cap_style_from_string(str) \
gf_enum_from_string(GF_TYPE_CAP_STYLE, (str))
#define gf_cap_style_to_string(cap_style, i18n) \
gf_enum_to_string(GF_TYPE_CAP_STYLE, (cap_style), (i18n))
GType gf_fill_get_gtype();
#define gf_fill_from_string(str) \
gf_enum_from_string(GF_TYPE_FILL, (str))
#define gf_fill_to_string(fill, i18n) \
gf_enum_to_string(GF_TYPE_FILL, (fill), (i18n))
GType gf_function_get_gtype();
#define gf_function_from_string(str) \
gf_enum_from_string(GF_TYPE_FUNCTION, (str))
#define gf_function_to_string(function, i18n) \
gf_enum_to_string(GF_TYPE_FUNCTION, (function), (i18n))
GType gf_join_style_get_gtype();
#define gf_join_style_from_string(str) \
gf_enum_from_string(GF_TYPE_JOIN_STYLE, (str))
#define gf_join_style_to_string(join_style, i18n) \
gf_enum_to_string(GF_TYPE_JOIN_STYLE, (join_style), (i18n))
GType gf_line_style_get_gtype();
#define gf_line_style_from_string(str) \
gf_enum_from_string(GF_TYPE_LINE_STYLE, (str))
#define gf_line_style_to_string(line_style, i18n) \
gf_enum_to_string(GF_TYPE_LINE_STYLE, (line_style), (i18n))
GType gf_subwindow_mode_get_gtype();
#define gf_subwindow_mode_from_string(str) \
gf_enum_from_string(GF_TYPE_SUBWINDOW_MODE, (str))
#define gf_subwindow_mode_to_string(mode, i18n) \
gf_enum_to_string(GF_TYPE_SUBWINDOW_MODE, (mode), (i18n))
GType gf_gc_values_mask_get_gtype();
#define gf_values_mask_from_string(str) \
gf_enum_from_string(GF_TYPE_VALUES_MASK, (str))
#define gf_values_mask_to_string(mask, i18n) \
gf_enum_to_string(GF_TYPE_VALUES_MASK, (mask), (i18n))
GType gf_gc_values_get_gtype();
GType gf_gc_get_gtype(void);
GfGC *gf_gc_new(GfDrawable *drawable);
GfGC *gf_gc_new_with_values(GfDrawable *drawable, GfGCValues *values, GfGCValuesMask mask);
void gf_gc_get_values(GfGC *gc, GfGCValues *values);
void gf_gc_set_values(GfGC *gc, GfGCValues *values, GfGCValuesMask mask);
void gf_gc_set_foreground(GfGC *gc, const GfColor *color);
void gf_gc_set_background(GfGC *gc, const GfColor *color);
void gf_gc_set_font(GfGC *gc, const GfFont *font);
void gf_gc_set_function(GfGC *gc, GfFunction function);
void gf_gc_set_fill(GfGC *gc, GfFill fill);
void gf_gc_set_tile(GfGC *gc, GfDrawable *tile);
void gf_gc_set_stipple(GfGC *gc, GfDrawable *stipple);
void gf_gc_set_ts_origin(GfGC *gc, gint x, gint y);
void gf_gc_set_clip_origin(GfGC *gc, gint x, gint y);
void gf_gc_set_clip_mask(GfGC *gc, GfDrawable *mask);
void gf_gc_set_subwindow(GfGC *gc, GfSubwindowMode mode);
void gf_gc_set_exposures(GfGC *gc, gboolean exposures);
void gf_gc_set_line_attributes(GfGC *gc, gint line_width, GfLineStyle line_style, GfCapStyle cap_style, GfJoinStyle join_style);
void gf_gc_set_colormap(GfGC *gc, GfColormap *colormap);
GfColormap *gf_gc_get_colormap(const GfGC *gc);
G_END_DECLS
#endif /* GF_GC_H */