gtkfontsel.inc 8.2 KB

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