package Cell_Renderer_List is new Generic_List (Gtk.Cell_Renderer.Gtk_Cell_Renderer);
package Gtk_Cell_Renderer_State_Properties is new Generic_Internal_Discrete_Property (Gtk_Cell_Renderer_State);
package Gtk_Cell_Renderer_Mode_Properties is new Generic_Internal_Discrete_Property (Gtk_Cell_Renderer_Mode);
type Gtk_Cell_Renderer_Record is new GObject_Record with null record;
type Gtk_Cell_Renderer is access all Gtk_Cell_Renderer_Record'Class;
type Gtk_Cell_Renderer_Mode is ( Cell_Renderer_Mode_Inert, Cell_Renderer_Mode_Activatable, Cell_Renderer_Mode_Editable);
type Property_Gtk_Cell_Renderer_State is new Gtk_Cell_Renderer_State_Properties.Property;
type Property_Gtk_Cell_Renderer_Mode is new Gtk_Cell_Renderer_Mode_Properties.Property;
type Cb_Gtk_Cell_Renderer_Void is not null access procedure (Self : access Gtk_Cell_Renderer_Record'Class);
type Cb_GObject_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Cell_Renderer_Gtk_Cell_Editable_UTF8_String_Void is not null access procedure (Self : access Gtk_Cell_Renderer_Record'Class; Editable : Gtk.Cell_Editable.Gtk_Cell_Editable; Path : UTF8_String);
type Cb_GObject_Gtk_Cell_Editable_UTF8_String_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class; Editable : Gtk.Cell_Editable.Gtk_Cell_Editable; Path : UTF8_String);
Cell_Renderer_Selected : constant Gtk_Cell_Renderer_State := 1;
Cell_Renderer_Prelit : constant Gtk_Cell_Renderer_State := 2;
Cell_Renderer_Insensitive : constant Gtk_Cell_Renderer_State := 4;
Cell_Renderer_Sorted : constant Gtk_Cell_Renderer_State := 8;
Cell_Renderer_Focused : constant Gtk_Cell_Renderer_State := 16;
Cell_Renderer_Expandable : constant Gtk_Cell_Renderer_State := 32;
Cell_Renderer_Expanded : constant Gtk_Cell_Renderer_State := 64;
Cell_Background_Property : constant Glib.Properties.Property_String;
Cell_Background_Gdk_Property : constant Gdk.Color.Property_Gdk_Color;
Cell_Background_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Cell_Background_Set_Property : constant Glib.Properties.Property_Boolean;
Editing_Property : constant Glib.Properties.Property_Boolean;
Height_Property : constant Glib.Properties.Property_Int;
Is_Expanded_Property : constant Glib.Properties.Property_Boolean;
Is_Expander_Property : constant Glib.Properties.Property_Boolean;
Mode_Property : constant Gtk.Cell_Renderer.Property_Gtk_Cell_Renderer_Mode;
Sensitive_Property : constant Glib.Properties.Property_Boolean;
Visible_Property : constant Glib.Properties.Property_Boolean;
Width_Property : constant Glib.Properties.Property_Int;
Xalign_Property : constant Glib.Properties.Property_Float;
Xpad_Property : constant Glib.Properties.Property_Uint;
Yalign_Property : constant Glib.Properties.Property_Float;
Ypad_Property : constant Glib.Properties.Property_Uint;
Signal_Editing_Canceled : constant Glib.Signal_Name := "editing-canceled";
Signal_Editing_Started : constant Glib.Signal_Name := "editing-started";
function Convert
( | R | : Gtk.Cell_Renderer.Gtk_Cell_Renderer) return System.Address; |
function Convert
( | R | : System.Address) return Gtk.Cell_Renderer.Gtk_Cell_Renderer; |
function Get_Type return Glib.GType;
function Activate
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Event | : Gdk.Event.Gdk_Event; | |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Path | : UTF8_String; | |
Background_Area | : Gdk.Rectangle.Gdk_Rectangle; | |
Cell_Area | : Gdk.Rectangle.Gdk_Rectangle; | |
Flags | : Gtk_Cell_Renderer_State) return Boolean; |
procedure Get_Aligned_Area
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Flags | : Gtk_Cell_Renderer_State; | |
Cell_Area | : Gdk.Rectangle.Gdk_Rectangle; | |
Aligned_Area | : out Gdk.Rectangle.Gdk_Rectangle); |
procedure Get_Alignment
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Xalign | : out Gfloat; | |
Yalign | : out Gfloat); |
procedure Set_Alignment
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Xalign | : Gfloat; | |
Yalign | : Gfloat); |
procedure Get_Fixed_Size
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Width | : out Gint; | |
Height | : out Gint); |
procedure Set_Fixed_Size
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Width | : Gint; | |
Height | : Gint); |
procedure Get_Padding
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Xpad | : out Gint; | |
Ypad | : out Gint); |
procedure Set_Padding
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Xpad | : Gint; | |
Ypad | : Gint); |
procedure Get_Preferred_Height
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Minimum_Size | : out Gint; | |
Natural_Size | : out Gint); |
procedure Get_Preferred_Height_For_Width
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Width | : Gint; | |
Minimum_Height | : out Gint; | |
Natural_Height | : out Gint); |
procedure Get_Preferred_Size
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Minimum_Size | : out Gtk.Widget.Gtk_Requisition; | |
Natural_Size | : out Gtk.Widget.Gtk_Requisition); |
procedure Get_Preferred_Width
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Minimum_Size | : out Gint; | |
Natural_Size | : out Gint); |
procedure Get_Preferred_Width_For_Height
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Height | : Gint; | |
Minimum_Width | : out Gint; | |
Natural_Width | : out Gint); |
function Get_Request_Mode
( | Cell | : not null access Gtk_Cell_Renderer_Record) return Gtk.Enums.Gtk_Size_Request_Mode; |
function Get_Sensitive
( | Cell | : not null access Gtk_Cell_Renderer_Record) return Boolean; |
procedure Set_Sensitive
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Sensitive | : Boolean); |
procedure Get_Size
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Cell_Area | : in out Gdk.Rectangle.Gdk_Rectangle; | |
X_Offset | : out Gint; | |
Y_Offset | : out Gint; | |
Width | : out Gint; | |
Height | : out Gint); |
function Get_State
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Cell_State | : Gtk_Cell_Renderer_State) return Gtk.Enums.Gtk_State_Flags; |
function Get_Visible
( | Cell | : not null access Gtk_Cell_Renderer_Record) return Boolean; |
procedure Set_Visible
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Visible | : Boolean); |
function Is_Activatable
( | Cell | : not null access Gtk_Cell_Renderer_Record) return Boolean; |
procedure Render
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Cr | : Cairo.Cairo_Context; | |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Background_Area | : Gdk.Rectangle.Gdk_Rectangle; | |
Cell_Area | : Gdk.Rectangle.Gdk_Rectangle; | |
Flags | : Gtk_Cell_Renderer_State); |
function Start_Editing
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Event | : Gdk.Event.Gdk_Event; | |
Widget | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Path | : UTF8_String; | |
Background_Area | : Gdk.Rectangle.Gdk_Rectangle; | |
Cell_Area | : Gdk.Rectangle.Gdk_Rectangle; | |
Flags | : Gtk_Cell_Renderer_State) return Gtk.Cell_Editable.Gtk_Cell_Editable; |
procedure Stop_Editing
( | Cell | : not null access Gtk_Cell_Renderer_Record; |
Canceled | : Boolean); |
procedure On_Editing_Canceled
( | Self | : not null access Gtk_Cell_Renderer_Record; |
Call | : Cb_Gtk_Cell_Renderer_Void; | |
After | : Boolean := False); |
procedure On_Editing_Canceled
( | Self | : not null access Gtk_Cell_Renderer_Record; |
Call | : Cb_GObject_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
procedure On_Editing_Started
( | Self | : not null access Gtk_Cell_Renderer_Record; |
Call | : Cb_Gtk_Cell_Renderer_Gtk_Cell_Editable_UTF8_String_Void; | |
After | : Boolean := False); |
procedure On_Editing_Started
( | Self | : not null access Gtk_Cell_Renderer_Record; |
Call | : Cb_GObject_Gtk_Cell_Editable_UTF8_String_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
The Gtk.Cell_Renderer.Gtk_Cell_Renderer is a base class of a set of objects used for rendering a cell to a cairo_t. These objects are used primarily by the Gtk.Tree_View.Gtk_Tree_View widget, though they aren't tied to them in any specific way. It is worth noting that Gtk.Cell_Renderer.Gtk_Cell_Renderer is not a Gtk.Widget.Gtk_Widget and cannot be treated as such.
The primary use of a Gtk.Cell_Renderer.Gtk_Cell_Renderer is for drawing a certain graphical elements on a cairo_t. Typically, one cell renderer is used to draw many cells on the screen. To this extent, it isn't expected that a CellRenderer keep any permanent state around. Instead, any state is set just prior to use using GObjects property system. Then, the cell is measured using Gtk.Cell_Renderer.Get_Size. Finally, the cell is rendered in the correct location using Gtk.Cell_Renderer.Render.
There are a number of rules that must be followed when writing a new Gtk.Cell_Renderer.Gtk_Cell_Renderer. First and foremost, it's important that a certain set of properties will always yield a cell renderer of the same size, barring a Gtk.Style.Gtk_Style change. The Gtk.Cell_Renderer.Gtk_Cell_Renderer also has a number of generic properties that are expected to be honored by all children.
Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be 'activatable' like Gtk.Cell_Renderer_Toggle.Gtk_Cell_Renderer_Toggle, which toggles when it gets activated by a mouse click, or it can be 'editable' like Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text, which allows the user to edit the text using a Gtk.GEntry.Gtk_Entry. To make a cell renderer activatable or editable, you have to implement the Gtk.Cell_Renderer_Class.Gtk_Cell_Renderer_Class.activate or Gtk.Cell_Renderer_Class.Gtk_Cell_Renderer_Class.start_editing virtual functions, respectively.
Many properties of Gtk.Cell_Renderer.Gtk_Cell_Renderer and its subclasses have a corresponding "set" property, e.g. "cell-background-set" corresponds to "cell-background". These "set" properties reflect whether a property has been set or not. You should not set them independently.