summaryrefslogtreecommitdiff
path: root/packages/extra/gtk2/gtk+/gtk/gtkfontsel.inc
blob: af045f25743fa864a8649e081f563c40088562c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// included by gtk2.pas

{$IFDEF read_forward_definitions}
{$ENDIF read_forward_definitions}

//------------------------------------------------------------------------------

{$IFDEF read_interface_types}
{ Current family  }
{ Current face  }
{ Cache for gdk_font_selection_get_font, so we can preserve
                                   refcounting behavior
                                  }
   PGtkFontSelection = ^TGtkFontSelection;
   TGtkFontSelection = record
        parent_instance : TGtkVBox;
        font_entry : PGtkWidget;
        family_list : PGtkWidget;
        font_style_entry : PGtkWidget;
        face_list : PGtkWidget;
        size_entry : PGtkWidget;
        size_list : PGtkWidget;
        pixels_button : PGtkWidget;
        points_button : PGtkWidget;
        filter_button : PGtkWidget;
        preview_entry : PGtkWidget;
        family : PPangoFontFamily;
        face : PPangoFontFace;
        size : gint;
        font : PGdkFont;
     end;

{ Padding for future expansion  }
   PGtkFontSelectionClass = ^TGtkFontSelectionClass;
   TGtkFontSelectionClass = record
        parent_class : TGtkVBoxClass;
        _gtk_reserved1 : procedure ; cdecl;
        _gtk_reserved2 : procedure ; cdecl;
        _gtk_reserved3 : procedure ; cdecl;
        _gtk_reserved4 : procedure ; cdecl;
     end;

{ The 'Apply' button is not shown by default but you can show/hide it.  }
{ If the user changes the width of the dialog, we turn auto-shrink off.  }
   PGtkFontSelectionDialog = ^TGtkFontSelectionDialog;
   TGtkFontSelectionDialog = record
        parent_instance : TGtkDialog;
        fontsel : PGtkWidget;
        main_vbox : PGtkWidget;
        action_area : PGtkWidget;
        ok_button : PGtkWidget;
        apply_button : PGtkWidget;
        cancel_button : PGtkWidget;
        dialog_width : gint;
        auto_resize : gboolean;
     end;

{ Padding for future expansion  }
   PGtkFontSelectionDialogClass = ^TGtkFontSelectionDialogClass;
   TGtkFontSelectionDialogClass = record
        parent_class : TGtkDialogClass;
        _gtk_reserved1 : procedure ; cdecl;
        _gtk_reserved2 : procedure ; cdecl;
        _gtk_reserved3 : procedure ; cdecl;
        _gtk_reserved4 : procedure ; cdecl;
     end;
{$ENDIF read_interface_types}

//------------------------------------------------------------------------------

{$IFDEF read_interface_rest}
function GTK_TYPE_FONT_SELECTION : GType;
function GTK_FONT_SELECTION(obj: pointer) : PGtkFontSelection;
function GTK_FONT_SELECTION_CLASS(klass: pointer) : PGtkFontSelectionClass;
function GTK_IS_FONT_SELECTION(obj: pointer) : boolean;
function GTK_IS_FONT_SELECTION_CLASS(klass: pointer) : boolean;
function GTK_FONT_SELECTION_GET_CLASS(obj: pointer) : PGtkFontSelectionClass;

function GTK_TYPE_FONT_SELECTION_DIALOG : GType;
function GTK_FONT_SELECTION_DIALOG(obj: pointer) : PGtkFontSelectionDialog;
function GTK_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : PGtkFontSelectionDialogClass;
function GTK_IS_FONT_SELECTION_DIALOG(obj: pointer) : boolean;
function GTK_IS_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : boolean;
function GTK_FONT_SELECTION_DIALOG_GET_CLASS(obj: pointer) : PGtkFontSelectionDialogClass;


{
   GtkFontSelection functions.
     see the comments in the GtkFontSelectionDialog functions.
                                                                              }

function gtk_font_selection_get_type:TGtkType; cdecl; external gtklib;
function gtk_font_selection_new:PGtkWidget; cdecl; external gtklib;
function gtk_font_selection_get_font_name(fontsel:PGtkFontSelection):Pgchar; cdecl; external gtklib;

{$ifndef GTK_DISABLE_DEPRECATED}
function gtk_font_selection_get_font(fontsel:PGtkFontSelection):PGdkFont; cdecl; external gtklib;
{$endif}
{ GTK_DISABLE_DEPRECATED  }

function gtk_font_selection_set_font_name(fontsel:PGtkFontSelection; fontname:Pgchar):gboolean; cdecl; external gtklib;
function gtk_font_selection_get_preview_text(fontsel:PGtkFontSelection):Pgchar; cdecl; external gtklib;
procedure gtk_font_selection_set_preview_text(fontsel:PGtkFontSelection; text:Pgchar); cdecl; external gtklib;
{
   GtkFontSelectionDialog functions.
     most of these functions simply call the corresponding function in the
     GtkFontSelection.
                                                                              }
function gtk_font_selection_dialog_get_type:TGtkType; cdecl; external gtklib;
function gtk_font_selection_dialog_new(title:Pgchar):PGtkWidget; cdecl; external gtklib;
{ This returns the X Logical Font Description fontname, or NULL if no font
   is selected. Note that there is a slight possibility that the font might not
   have been loaded OK. You should call gtk_font_selection_dialog_get_font()
   to see if it has been loaded OK.
   You should g_free() the returned font name after you're done with it.  }
function gtk_font_selection_dialog_get_font_name(fsd:PGtkFontSelectionDialog):Pgchar; cdecl; external gtklib;

{$ifndef GTK_DISABLE_DEPRECATED}
{ This will return the current GdkFont, or NULL if none is selected or there
   was a problem loading it. Remember to use gdk_font_ref/unref() if you want
   to use the font (in a style, for example).  }

function gtk_font_selection_dialog_get_font(fsd:PGtkFontSelectionDialog):PGdkFont; cdecl; external gtklib;
{$endif}
{ GTK_DISABLE_DEPRECATED  }


{ This sets the currently displayed font. It should be a valid X Logical
   Font Description font name (anything else will be ignored), e.g.
   "-adobe-courier-bold-o-normal--25- - - - - - - "
   It returns TRUE on success.  }
function gtk_font_selection_dialog_set_font_name(fsd:PGtkFontSelectionDialog; fontname:Pgchar):gboolean; cdecl; external gtklib;
{ This returns the text in the preview entry. You should copy the returned
   text if you need it.  }
function gtk_font_selection_dialog_get_preview_text(fsd:PGtkFontSelectionDialog):Pgchar; cdecl; external gtklib;
{ This sets the text in the preview entry. It will be copied by the entry,
   so there's no need to g_strdup() it first.  }
procedure gtk_font_selection_dialog_set_preview_text(fsd:PGtkFontSelectionDialog; text:Pgchar); cdecl; external gtklib;
{$ENDIF read_interface_rest}

//------------------------------------------------------------------------------

{$IFDEF read_implementation}
function GTK_TYPE_FONT_SELECTION : GType;
begin
   GTK_TYPE_FONT_SELECTION:=gtk_font_selection_get_type;
end;

function GTK_FONT_SELECTION(obj: pointer) : PGtkFontSelection;
begin
   GTK_FONT_SELECTION:=PGtkFontSelection(GTK_CHECK_CAST(obj,GTK_TYPE_FONT_SELECTION));
end;

function GTK_FONT_SELECTION_CLASS(klass: pointer) : PGtkFontSelectionClass;
begin
   GTK_FONT_SELECTION_CLASS:=PGtkFontSelectionClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_FONT_SELECTION));
end;

function GTK_IS_FONT_SELECTION(obj: pointer) : boolean;
begin
   GTK_IS_FONT_SELECTION:=GTK_CHECK_TYPE(obj,GTK_TYPE_FONT_SELECTION);
end;

function GTK_IS_FONT_SELECTION_CLASS(klass: pointer) : boolean;
begin
   GTK_IS_FONT_SELECTION_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_FONT_SELECTION);
end;

function GTK_FONT_SELECTION_GET_CLASS(obj: pointer) : PGtkFontSelectionClass;
begin
   GTK_FONT_SELECTION_GET_CLASS:=PGtkFontSelectionClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_FONT_SELECTION));
end;

function GTK_TYPE_FONT_SELECTION_DIALOG : GType;
begin
   GTK_TYPE_FONT_SELECTION_DIALOG:=gtk_font_selection_dialog_get_type;
end;

function GTK_FONT_SELECTION_DIALOG(obj: pointer) : PGtkFontSelectionDialog;
begin
   GTK_FONT_SELECTION_DIALOG:=PGtkFontSelectionDialog(GTK_CHECK_CAST(obj,GTK_TYPE_FONT_SELECTION_DIALOG));
end;

function GTK_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : PGtkFontSelectionDialogClass;
begin
   GTK_FONT_SELECTION_DIALOG_CLASS:=PGtkFontSelectionDialogClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_FONT_SELECTION_DIALOG));
end;

function GTK_IS_FONT_SELECTION_DIALOG(obj: pointer) : boolean;
begin
   GTK_IS_FONT_SELECTION_DIALOG:=GTK_CHECK_TYPE(obj,GTK_TYPE_FONT_SELECTION_DIALOG);
end;

function GTK_IS_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : boolean;
begin
   GTK_IS_FONT_SELECTION_DIALOG_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_FONT_SELECTION_DIALOG);
end;

function GTK_FONT_SELECTION_DIALOG_GET_CLASS(obj: pointer) : PGtkFontSelectionDialogClass;
begin
   GTK_FONT_SELECTION_DIALOG_GET_CLASS:=PGtkFontSelectionDialogClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_FONT_SELECTION_DIALOG));
end;

{$ENDIF read_implementation}
// included by gtk2.pas