2 * Header file for gtkfont.c. Has to be separate from unix.h
\r
3 * because it depends on GTK data types, hence can't be included
\r
4 * from cross-platform code (which doesn't go near GTK).
\r
7 #ifndef PUTTY_GTKFONT_H
\r
8 #define PUTTY_GTKFONT_H
\r
11 * Exports from gtkfont.c.
\r
13 struct unifont_vtable; /* contents internal to gtkfont.c */
\r
14 typedef struct unifont {
\r
15 const struct unifont_vtable *vt;
\r
17 * `Non-static data members' of the `class', accessible to
\r
22 * public_charset is the charset used when the user asks for
\r
23 * `Use font encoding'.
\r
25 * real_charset is the charset used when translating text into
\r
26 * a form suitable for sending to unifont_draw_text().
\r
28 * They can differ. For example, public_charset might be
\r
29 * CS_ISO8859_1 while real_charset is CS_ISO8859_1_X11.
\r
31 int public_charset, real_charset;
\r
34 * Font dimensions needed by clients.
\r
36 int width, height, ascent, descent;
\r
39 unifont *unifont_create(GtkWidget *widget, const char *name,
\r
41 int shadowoffset, int shadowalways);
\r
42 void unifont_destroy(unifont *font);
\r
43 void unifont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
\r
44 int x, int y, const char *string, int len,
\r
45 int wide, int bold, int cellwidth);
\r
48 * Unified font selector dialog. I can't be bothered to do a
\r
49 * proper GTK subclassing today, so this will just be an ordinary
\r
50 * data structure with some useful members.
\r
52 * (Of course, these aren't the only members; this structure is
\r
53 * contained within a bigger one which holds data visible only to
\r
54 * the implementation.)
\r
56 typedef struct unifontsel {
\r
57 void *user_data; /* settable by the user */
\r
59 GtkWidget *ok_button, *cancel_button;
\r
62 unifontsel *unifontsel_new(const char *wintitle);
\r
63 void unifontsel_destroy(unifontsel *fontsel);
\r
64 void unifontsel_set_name(unifontsel *fontsel, const char *fontname);
\r
65 char *unifontsel_get_name(unifontsel *fontsel);
\r
67 #endif /* PUTTY_GTKFONT_H */
\r