gtkcolorsel.pp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. {
  2. $Id$
  3. }
  4. {****************************************************************************
  5. Interface
  6. ****************************************************************************}
  7. {$ifdef read_interface}
  8. type
  9. PGtkColorSelection = ^TGtkColorSelection;
  10. TGtkColorSelection = record
  11. vbox : TGtkVBox;
  12. wheel_area : PGtkWidget;
  13. value_area : PGtkWidget;
  14. sample_area : PGtkWidget;
  15. sample_area_eb : PGtkWidget;
  16. scales : array[0..7] of PGtkWidget;
  17. entries : array[0..7] of PGtkWidget;
  18. opacity_label : PGtkWidget;
  19. wheel_gc : PGdkGC;
  20. value_gc : PGdkGC;
  21. sample_gc : PGdkGC;
  22. policy : TGtkUpdateType;
  23. use_opacity : gint;
  24. timer_active : gint;
  25. timer_tag : gint;
  26. values : array[0..7] of gdouble;
  27. old_values : array[0..7] of gdouble;
  28. wheel_buf : Pguchar;
  29. value_buf : Pguchar;
  30. sample_buf : Pguchar;
  31. end;
  32. PGtkColorSelectionClass = ^TGtkColorSelectionClass;
  33. TGtkColorSelectionClass = record
  34. parent_class : TGtkVBoxClass;
  35. color_changed : procedure (colorsel:PGtkColorSelection); cdecl;
  36. end;
  37. PGtkColorSelectionDialog = ^TGtkColorSelectionDialog;
  38. TGtkColorSelectionDialog = record
  39. window : TGtkWindow;
  40. colorsel : PGtkWidget;
  41. main_vbox : PGtkWidget;
  42. ok_button : PGtkWidget;
  43. reset_button : PGtkWidget;
  44. cancel_button : PGtkWidget;
  45. help_button : PGtkWidget;
  46. end;
  47. PGtkColorSelectionDialogClass = ^TGtkColorSelectionDialogClass;
  48. TGtkColorSelectionDialogClass = record
  49. parent_class : TGtkWindowClass;
  50. end;
  51. Type
  52. GTK_COLOR_SELECTION=PGtkColorSelection;
  53. GTK_COLOR_SELECTION_CLASS=PGtkColorSelectionClass;
  54. GTK_COLOR_SELECTION_DIALOG=PGtkColorSelectionDialog;
  55. GTK_COLOR_SELECTION_DIALOG_CLASS=PGtkColorSelectionDialogClass;
  56. { ColorSelection }
  57. function GTK_COLOR_SELECTION_TYPE:TGtkType;cdecl;external gtkdll name 'gtk_color_selection_get_type';
  58. function GTK_IS_COLOR_SELECTION(obj:pointer):boolean;
  59. function GTK_IS_COLOR_SELECTION_CLASS(klass:pointer):boolean;
  60. function gtk_color_selection_get_type:TGtkType;cdecl;external gtkdll name 'gtk_color_selection_get_type';
  61. function gtk_color_selection_new:PGtkWidget;cdecl;external gtkdll name 'gtk_color_selection_new';
  62. procedure gtk_color_selection_set_update_policy(colorsel:PGtkColorSelection; policy:TGtkUpdateType);cdecl;external gtkdll name 'gtk_color_selection_set_update_policy';
  63. procedure gtk_color_selection_set_opacity(colorsel:PGtkColorSelection; use_opacity:gint);cdecl;external gtkdll name 'gtk_color_selection_set_opacity';
  64. procedure gtk_color_selection_set_color(colorsel:PGtkColorSelection; color:Pgdouble);cdecl;external gtkdll name 'gtk_color_selection_set_color';
  65. procedure gtk_color_selection_get_color(colorsel:PGtkColorSelection; color:Pgdouble);cdecl;external gtkdll name 'gtk_color_selection_get_color';
  66. { ColorSelectionDialog }
  67. function gtk_color_selection_dialog_get_type:guint;cdecl;external gtkdll name 'gtk_color_selection_dialog_get_type';
  68. function gtk_color_selection_dialog_new (title:Pgchar):PGtkWidget;cdecl;external gtkdll name 'gtk_color_selection_dialog_new';
  69. {$endif read_interface}
  70. {****************************************************************************
  71. Implementation
  72. ****************************************************************************}
  73. {$ifdef read_implementation}
  74. function GTK_IS_COLOR_SELECTION(obj:pointer):boolean;
  75. begin
  76. GTK_IS_COLOR_SELECTION:=(obj<>nil) and GTK_IS_COLOR_SELECTION_CLASS(PGtkTypeObject(obj)^.klass);
  77. end;
  78. function GTK_IS_COLOR_SELECTION_CLASS(klass:pointer):boolean;
  79. begin
  80. GTK_IS_COLOR_SELECTION_CLASS:=(klass<>nil) and (PGtkTypeClass(klass)^.thetype=GTK_COLOR_SELECTION_TYPE);
  81. end;
  82. {$endif read_implementation}
  83. {
  84. $Log$
  85. Revision 1.1 1999-11-24 23:36:35 peter
  86. * moved to packages dir
  87. Revision 1.10 1999/10/21 08:42:01 florian
  88. * some changes to get it work with gtk 1.3 under Windows 98:
  89. - removed some trailing space after the import name
  90. - In gtkbindings.h is
  91. #define gtk_binding_entry_add gtk_binding_entry_clear
  92. so in the pascal headers the import name of gtk_bindings_entry_add should be
  93. gtk_binding_entry_clear!
  94. - removed the declaration of
  95. gtk_drag_source_unset in gtkdnd.pp it isn't in gtk-1.3.dll!
  96. - in gdk.pp glibdll must be set to gdk-1.3:
  97. const
  98. gdkdll='gdk-1.3';
  99. glibdll='gdk-1.3';
  100. else the whole gdk_* calls are imported from glib-1.3.dll which is wrong!
  101. Revision 1.9 1999/10/06 17:42:48 peter
  102. * external is now only in the interface
  103. * removed gtk 1.0 support
  104. Revision 1.8 1999/07/23 16:12:07 peter
  105. * use packrecords C
  106. Revision 1.7 1999/05/11 00:38:18 peter
  107. * win32 fixes
  108. Revision 1.6 1999/05/10 15:19:06 peter
  109. * cdecl fixes
  110. Revision 1.5 1999/05/07 17:40:16 peter
  111. * more updates
  112. Revision 1.4 1998/11/09 10:09:41 peter
  113. + C type casts are now correctly handled
  114. Revision 1.3 1998/10/21 20:22:16 peter
  115. * cdecl, packrecord fixes (from the gtk.tar.gz)
  116. * win32 support
  117. * gtk.pp,gdk.pp for an all in one unit
  118. }