1// included by gtk2.pas 2 3{$IFDEF read_forward_definitions} 4{$ENDIF read_forward_definitions} 5 6//------------------------------------------------------------------------------ 7 8{$IFDEF read_interface_types} 9{ Current family } 10{ Current face } 11{ Cache for gdk_font_selection_get_font, so we can preserve 12 refcounting behavior 13 } 14 PGtkFontSelection = ^TGtkFontSelection; 15 TGtkFontSelection = record 16 parent_instance : TGtkVBox; 17 font_entry : PGtkWidget; 18 family_list : PGtkWidget; 19 font_style_entry : PGtkWidget; 20 face_list : PGtkWidget; 21 size_entry : PGtkWidget; 22 size_list : PGtkWidget; 23 pixels_button : PGtkWidget; 24 points_button : PGtkWidget; 25 filter_button : PGtkWidget; 26 preview_entry : PGtkWidget; 27 family : PPangoFontFamily; 28 face : PPangoFontFace; 29 size : gint; 30 font : PGdkFont; 31 end; 32 33{ Padding for future expansion } 34 PGtkFontSelectionClass = ^TGtkFontSelectionClass; 35 TGtkFontSelectionClass = record 36 parent_class : TGtkVBoxClass; 37 _gtk_reserved1 : procedure ; cdecl; 38 _gtk_reserved2 : procedure ; cdecl; 39 _gtk_reserved3 : procedure ; cdecl; 40 _gtk_reserved4 : procedure ; cdecl; 41 end; 42 43{ The 'Apply' button is not shown by default but you can show/hide it. } 44{ If the user changes the width of the dialog, we turn auto-shrink off. } 45 PGtkFontSelectionDialog = ^TGtkFontSelectionDialog; 46 TGtkFontSelectionDialog = record 47 parent_instance : TGtkDialog; 48 fontsel : PGtkWidget; 49 main_vbox : PGtkWidget; 50 action_area : PGtkWidget; 51 ok_button : PGtkWidget; 52 apply_button : PGtkWidget; 53 cancel_button : PGtkWidget; 54 dialog_width : gint; 55 auto_resize : gboolean; 56 end; 57 58{ Padding for future expansion } 59 PGtkFontSelectionDialogClass = ^TGtkFontSelectionDialogClass; 60 TGtkFontSelectionDialogClass = record 61 parent_class : TGtkDialogClass; 62 _gtk_reserved1 : procedure ; cdecl; 63 _gtk_reserved2 : procedure ; cdecl; 64 _gtk_reserved3 : procedure ; cdecl; 65 _gtk_reserved4 : procedure ; cdecl; 66 end; 67{$ENDIF read_interface_types} 68 69//------------------------------------------------------------------------------ 70 71{$IFDEF read_interface_rest} 72function GTK_TYPE_FONT_SELECTION : GType; 73function GTK_FONT_SELECTION(obj: pointer) : PGtkFontSelection; 74function GTK_FONT_SELECTION_CLASS(klass: pointer) : PGtkFontSelectionClass; 75function GTK_IS_FONT_SELECTION(obj: pointer) : boolean; 76function GTK_IS_FONT_SELECTION_CLASS(klass: pointer) : boolean; 77function GTK_FONT_SELECTION_GET_CLASS(obj: pointer) : PGtkFontSelectionClass; 78 79function GTK_TYPE_FONT_SELECTION_DIALOG : GType; 80function GTK_FONT_SELECTION_DIALOG(obj: pointer) : PGtkFontSelectionDialog; 81function GTK_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : PGtkFontSelectionDialogClass; 82function GTK_IS_FONT_SELECTION_DIALOG(obj: pointer) : boolean; 83function GTK_IS_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : boolean; 84function GTK_FONT_SELECTION_DIALOG_GET_CLASS(obj: pointer) : PGtkFontSelectionDialogClass; 85 86 87{ 88 GtkFontSelection functions. 89 see the comments in the GtkFontSelectionDialog functions. 90 } 91 92function gtk_font_selection_get_type:TGtkType; cdecl; external gtklib; 93function gtk_font_selection_new:PGtkWidget; cdecl; external gtklib; 94function gtk_font_selection_get_font_name(fontsel:PGtkFontSelection):Pgchar; cdecl; external gtklib; 95 96{$ifndef GTK_DISABLE_DEPRECATED} 97function gtk_font_selection_get_font(fontsel:PGtkFontSelection):PGdkFont; cdecl; external gtklib; 98{$endif} 99{ GTK_DISABLE_DEPRECATED } 100 101function gtk_font_selection_set_font_name(fontsel:PGtkFontSelection; fontname:Pgchar):gboolean; cdecl; external gtklib; 102function gtk_font_selection_get_preview_text(fontsel:PGtkFontSelection):Pgchar; cdecl; external gtklib; 103procedure gtk_font_selection_set_preview_text(fontsel:PGtkFontSelection; text:Pgchar); cdecl; external gtklib; 104{ 105 GtkFontSelectionDialog functions. 106 most of these functions simply call the corresponding function in the 107 GtkFontSelection. 108 } 109function gtk_font_selection_dialog_get_type:TGtkType; cdecl; external gtklib; 110function gtk_font_selection_dialog_new(title:Pgchar):PGtkWidget; cdecl; external gtklib; 111{ This returns the X Logical Font Description fontname, or NULL if no font 112 is selected. Note that there is a slight possibility that the font might not 113 have been loaded OK. You should call gtk_font_selection_dialog_get_font() 114 to see if it has been loaded OK. 115 You should g_free() the returned font name after you're done with it. } 116function gtk_font_selection_dialog_get_font_name(fsd:PGtkFontSelectionDialog):Pgchar; cdecl; external gtklib; 117 118{$ifndef GTK_DISABLE_DEPRECATED} 119{ This will return the current GdkFont, or NULL if none is selected or there 120 was a problem loading it. Remember to use gdk_font_ref/unref() if you want 121 to use the font (in a style, for example). } 122 123function gtk_font_selection_dialog_get_font(fsd:PGtkFontSelectionDialog):PGdkFont; cdecl; external gtklib; 124{$endif} 125{ GTK_DISABLE_DEPRECATED } 126 127 128{ This sets the currently displayed font. It should be a valid X Logical 129 Font Description font name (anything else will be ignored), e.g. 130 "-adobe-courier-bold-o-normal--25- - - - - - - " 131 It returns TRUE on success. } 132function gtk_font_selection_dialog_set_font_name(fsd:PGtkFontSelectionDialog; fontname:Pgchar):gboolean; cdecl; external gtklib; 133{ This returns the text in the preview entry. You should copy the returned 134 text if you need it. } 135function gtk_font_selection_dialog_get_preview_text(fsd:PGtkFontSelectionDialog):Pgchar; cdecl; external gtklib; 136{ This sets the text in the preview entry. It will be copied by the entry, 137 so there's no need to g_strdup() it first. } 138procedure gtk_font_selection_dialog_set_preview_text(fsd:PGtkFontSelectionDialog; text:Pgchar); cdecl; external gtklib; 139{$ENDIF read_interface_rest} 140 141//------------------------------------------------------------------------------ 142 143{$IFDEF read_implementation} 144function GTK_TYPE_FONT_SELECTION : GType; 145begin 146 GTK_TYPE_FONT_SELECTION:=gtk_font_selection_get_type; 147end; 148 149function GTK_FONT_SELECTION(obj: pointer) : PGtkFontSelection; 150begin 151 GTK_FONT_SELECTION:=PGtkFontSelection(GTK_CHECK_CAST(obj,GTK_TYPE_FONT_SELECTION)); 152end; 153 154function GTK_FONT_SELECTION_CLASS(klass: pointer) : PGtkFontSelectionClass; 155begin 156 GTK_FONT_SELECTION_CLASS:=PGtkFontSelectionClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_FONT_SELECTION)); 157end; 158 159function GTK_IS_FONT_SELECTION(obj: pointer) : boolean; 160begin 161 GTK_IS_FONT_SELECTION:=GTK_CHECK_TYPE(obj,GTK_TYPE_FONT_SELECTION); 162end; 163 164function GTK_IS_FONT_SELECTION_CLASS(klass: pointer) : boolean; 165begin 166 GTK_IS_FONT_SELECTION_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_FONT_SELECTION); 167end; 168 169function GTK_FONT_SELECTION_GET_CLASS(obj: pointer) : PGtkFontSelectionClass; 170begin 171 GTK_FONT_SELECTION_GET_CLASS:=PGtkFontSelectionClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_FONT_SELECTION)); 172end; 173 174function GTK_TYPE_FONT_SELECTION_DIALOG : GType; 175begin 176 GTK_TYPE_FONT_SELECTION_DIALOG:=gtk_font_selection_dialog_get_type; 177end; 178 179function GTK_FONT_SELECTION_DIALOG(obj: pointer) : PGtkFontSelectionDialog; 180begin 181 GTK_FONT_SELECTION_DIALOG:=PGtkFontSelectionDialog(GTK_CHECK_CAST(obj,GTK_TYPE_FONT_SELECTION_DIALOG)); 182end; 183 184function GTK_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : PGtkFontSelectionDialogClass; 185begin 186 GTK_FONT_SELECTION_DIALOG_CLASS:=PGtkFontSelectionDialogClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_FONT_SELECTION_DIALOG)); 187end; 188 189function GTK_IS_FONT_SELECTION_DIALOG(obj: pointer) : boolean; 190begin 191 GTK_IS_FONT_SELECTION_DIALOG:=GTK_CHECK_TYPE(obj,GTK_TYPE_FONT_SELECTION_DIALOG); 192end; 193 194function GTK_IS_FONT_SELECTION_DIALOG_CLASS(klass: pointer) : boolean; 195begin 196 GTK_IS_FONT_SELECTION_DIALOG_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_FONT_SELECTION_DIALOG); 197end; 198 199function GTK_FONT_SELECTION_DIALOG_GET_CLASS(obj: pointer) : PGtkFontSelectionDialogClass; 200begin 201 GTK_FONT_SELECTION_DIALOG_GET_CLASS:=PGtkFontSelectionDialogClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_FONT_SELECTION_DIALOG)); 202end; 203 204{$ENDIF read_implementation} 205// included by gtk2.pas 206 207