OSDN Git Service

Add PuTTY 0.61 to contrib directory.
[ffftp/ffftp.git] / contrib / putty / UNIX / GTKFONT.H
diff --git a/contrib/putty/UNIX/GTKFONT.H b/contrib/putty/UNIX/GTKFONT.H
new file mode 100644 (file)
index 0000000..41c0505
--- /dev/null
@@ -0,0 +1,67 @@
+/*\r
+ * Header file for gtkfont.c. Has to be separate from unix.h\r
+ * because it depends on GTK data types, hence can't be included\r
+ * from cross-platform code (which doesn't go near GTK).\r
+ */\r
+\r
+#ifndef PUTTY_GTKFONT_H\r
+#define PUTTY_GTKFONT_H\r
+\r
+/*\r
+ * Exports from gtkfont.c.\r
+ */\r
+struct unifont_vtable;                /* contents internal to gtkfont.c */\r
+typedef struct unifont {\r
+    const struct unifont_vtable *vt;\r
+    /*\r
+     * `Non-static data members' of the `class', accessible to\r
+     * external code.\r
+     */\r
+\r
+    /*\r
+     * public_charset is the charset used when the user asks for\r
+     * `Use font encoding'.\r
+     * \r
+     * real_charset is the charset used when translating text into\r
+     * a form suitable for sending to unifont_draw_text().\r
+     * \r
+     * They can differ. For example, public_charset might be\r
+     * CS_ISO8859_1 while real_charset is CS_ISO8859_1_X11.\r
+     */\r
+    int public_charset, real_charset;\r
+\r
+    /*\r
+     * Font dimensions needed by clients.\r
+     */\r
+    int width, height, ascent, descent;\r
+} unifont;\r
+\r
+unifont *unifont_create(GtkWidget *widget, const char *name,\r
+                       int wide, int bold,\r
+                       int shadowoffset, int shadowalways);\r
+void unifont_destroy(unifont *font);\r
+void unifont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,\r
+                      int x, int y, const char *string, int len,\r
+                      int wide, int bold, int cellwidth);\r
+\r
+/*\r
+ * Unified font selector dialog. I can't be bothered to do a\r
+ * proper GTK subclassing today, so this will just be an ordinary\r
+ * data structure with some useful members.\r
+ * \r
+ * (Of course, these aren't the only members; this structure is\r
+ * contained within a bigger one which holds data visible only to\r
+ * the implementation.)\r
+ */\r
+typedef struct unifontsel {\r
+    void *user_data;                  /* settable by the user */\r
+    GtkWindow *window;\r
+    GtkWidget *ok_button, *cancel_button;\r
+} unifontsel;\r
+\r
+unifontsel *unifontsel_new(const char *wintitle);\r
+void unifontsel_destroy(unifontsel *fontsel);\r
+void unifontsel_set_name(unifontsel *fontsel, const char *fontname);\r
+char *unifontsel_get_name(unifontsel *fontsel);\r
+\r
+#endif /* PUTTY_GTKFONT_H */\r