gdkvisual.inc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // included by gdk2.pp
  2. {$IFDEF read_forward_definitions}
  3. { Types of visuals.
  4. StaticGray:
  5. Grayscale:
  6. StaticColor:
  7. PseudoColor:
  8. TrueColor:
  9. DirectColor:
  10. }
  11. PGdkVisualType = ^TGdkVisualType;
  12. TGdkVisualType = (
  13. GDK_VISUAL_STATIC_GRAY,
  14. GDK_VISUAL_GRAYSCALE,
  15. GDK_VISUAL_STATIC_COLOR,
  16. GDK_VISUAL_PSEUDO_COLOR,
  17. GDK_VISUAL_TRUE_COLOR,
  18. GDK_VISUAL_DIRECT_COLOR
  19. );
  20. { The visual type.
  21. "type" is the type of visual this is (PseudoColor, TrueColor, etc).
  22. "depth" is the bit depth of this visual.
  23. "colormap_size" is the size of a colormap for this visual.
  24. "bits_per_rgb" is the number of significant bits per red, green and blue.
  25. The red, green and blue masks, shifts and precisions refer
  26. to value needed to calculate pixel values in TrueColor and DirectColor
  27. visuals. The "mask" is the significant bits within the pixel. The
  28. "shift" is the number of bits left we must shift a primary for it
  29. to be in position (according to the "mask"). "prec" refers to how
  30. much precision the pixel value contains for a particular primary.
  31. }
  32. PGdkVisual = ^TGdkVisual;
  33. TGdkVisual = record
  34. parent_instance : TGObject;
  35. TheType : TGdkVisualType;
  36. depth : gint;
  37. byte_order : TGdkByteOrder;
  38. colormap_size : gint;
  39. bits_per_rgb : gint;
  40. red_mask : guint32;
  41. red_shift : gint;
  42. red_prec : gint;
  43. green_mask : guint32;
  44. green_shift : gint;
  45. green_prec : gint;
  46. blue_mask : guint32;
  47. blue_shift : gint;
  48. blue_prec : gint;
  49. screen : PGdkScreen;
  50. end;
  51. {$ENDIF read_forward_definitions}
  52. //------------------------------------------------------------------------------
  53. {$IFDEF read_interface_types}
  54. {$ENDIF read_interface_types}
  55. //------------------------------------------------------------------------------
  56. {$IFDEF read_interface_rest}
  57. function GDK_TYPE_VISUAL : GType;
  58. function GDK_VISUAL(anObject : Pointer) : PGdkVisual;
  59. function GDK_VISUAL_CLASS(klass : Pointer) : PGdkVisualClass;
  60. function GDK_IS_VISUAL(anObject : Pointer) : boolean;
  61. function GDK_IS_VISUAL_CLASS(klass : Pointer) : boolean;
  62. function GDK_VISUAL_GET_CLASS(obj : Pointer) : PGdkVisualClass;
  63. function gdk_visual_get_type:GType; cdecl; external gdklib;
  64. {$ifndef GDK_MULTIHEAD_SAFE}
  65. function gdk_visual_get_best_depth:gint; cdecl; external gdklib;
  66. function gdk_visual_get_best_type:TGdkVisualType; cdecl; external gdklib;
  67. function gdk_visual_get_system:PGdkVisual; cdecl; external gdklib;
  68. function gdk_visual_get_best:PGdkVisual; cdecl; external gdklib;
  69. function gdk_visual_get_best_with_depth(depth:gint):PGdkVisual; cdecl; external gdklib;
  70. function gdk_visual_get_best_with_type(visual_type:TGdkVisualType):PGdkVisual; cdecl; external gdklib;
  71. function gdk_visual_get_best_with_both(depth:gint; visual_type:TGdkVisualType):PGdkVisual; cdecl; external gdklib;
  72. procedure gdk_query_depths(var depths:Pgint; count:Pgint); cdecl; external gdklib;
  73. procedure gdk_query_visual_types(var visual_types:PGdkVisualType; count:Pgint); cdecl; external gdklib;
  74. function gdk_list_visuals:PGList; cdecl; external gdklib;
  75. {$endif}
  76. {$ifndef GDK_DISABLE_DEPRECATED}
  77. procedure gdk_visual_ref(v : PGdkVisual);
  78. procedure gdk_visual_unref(v : PGdkVisual);
  79. {$endif}
  80. {$endif read_interface_rest}
  81. //------------------------------------------------------------------------------
  82. {$IFDEF read_implementation}
  83. function GDK_TYPE_VISUAL : GType;
  84. begin
  85. GDK_TYPE_VISUAL:=gdk_visual_get_type;
  86. end;
  87. function GDK_VISUAL(anObject : Pointer) : PGdkVisual;
  88. begin
  89. GDK_VISUAL:=PGdkVisual(G_TYPE_CHECK_INSTANCE_CAST(anObject,GDK_TYPE_VISUAL));
  90. end;
  91. function GDK_VISUAL_CLASS(klass : Pointer) : PGdkVisualClass;
  92. begin
  93. GDK_VISUAL_CLASS:=PGdkVisualClass(G_TYPE_CHECK_CLASS_CAST(klass,
  94. GDK_TYPE_VISUAL));
  95. end;
  96. function GDK_IS_VISUAL(anObject : Pointer) : boolean;
  97. begin
  98. GDK_IS_VISUAL:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,GDK_TYPE_VISUAL);
  99. end;
  100. function GDK_IS_VISUAL_CLASS(klass : Pointer) : boolean;
  101. begin
  102. GDK_IS_VISUAL_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GDK_TYPE_VISUAL);
  103. end;
  104. function GDK_VISUAL_GET_CLASS(obj : Pointer) : PGdkVisualClass;
  105. begin
  106. GDK_VISUAL_GET_CLASS:=PGdkVisualClass(G_TYPE_INSTANCE_GET_CLASS(obj,
  107. GDK_TYPE_VISUAL));
  108. end;
  109. procedure gdk_visual_ref(v : PGdkVisual);
  110. begin
  111. g_object_ref(v);
  112. end;
  113. procedure gdk_visual_unref(v : PGdkVisual);
  114. begin
  115. g_object_unref(v);
  116. end;
  117. {$ENDIF}