gtk: add enumeration modules and new widgets
authornheu <heu.nathan@courrier.uqam.ca>
Tue, 7 May 2013 20:06:14 +0000 (16:06 -0400)
committernathan.heu <heu.nathan@courrier.uqam.ca>
Wed, 15 May 2013 20:18:33 +0000 (16:18 -0400)
Add modules for gtk and gdk enumerations
New widgets dervied from button : ScaleButton, LinkButton,...

Signed-off-by: Nathan Heu <heu.nathan@courrier.uqam.ca>

lib/gtk/gdk_enums.nit [new file with mode: 0644]
lib/gtk/gtk.nit
lib/gtk/gtk_enums.nit [new file with mode: 0644]

diff --git a/lib/gtk/gdk_enums.nit b/lib/gtk/gdk_enums.nit
new file mode 100644 (file)
index 0000000..f21d354
--- /dev/null
@@ -0,0 +1,71 @@
+module gdk_enums
+
+in "C Header" `{
+       #include <gtk/gtk.h>
+
+`}
+
+#enum GdkGravity
+#Defines the reference point of a window and the meaning of coordinates passed to gtk_window_move().
+#@https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkGravity
+extern GdkGravity `{GdkGravity`}
+       #The reference point is at the top left corner.
+       new north_west `{ return GDK_GRAVITY_NORTH_WEST; `} 
+
+       #The reference point is in the middle of the top edge.  
+       new north `{ return GDK_GRAVITY_NORTH; `}       
+
+       #The reference point is at the top right corner.        
+       new north_east `{ return GDK_GRAVITY_NORTH_EAST; `} 
+
+       #The reference point is at the middle of the left edge.
+       new west `{ return GDK_GRAVITY_WEST; `}         
+
+       #The reference point is at the center of the window
+       new center `{ return GDK_GRAVITY_CENTER; `}     
+
+       #The reference point is at the middle of the right edge.
+       new east `{ return GDK_GRAVITY_EAST; `}         
+
+       #The reference point is at the lower left corner.
+       new south_west `{ return GDK_GRAVITY_SOUTH_WEST; `} 
+
+       #The reference point is at the middle of the lower edge.
+       new south `{ return GDK_GRAVITY_SOUTH; `} 
+
+       #The reference point is at the lower right corner.
+       new south_east `{ return GDK_GRAVITY_SOUTH_EAST; `} 
+
+       #The reference point is at the top left corner of the window itself, ignoring window manager decorations.       
+       new static `{ return GDK_GRAVITY_STATIC; `} 
+end
+
+#enum GdkGWindowEdge
+#Determines a window edge or corner.
+#@https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkWindowEdge
+extern GdkWindowEdge `{GdkWindowEdge`}
+       #The top left corner.
+       new north_west `{ return GDK_WINDOW_EDGE_NORTH_WEST; `} 
+
+       #The top edge.  
+       new north `{ return GDK_WINDOW_EDGE_NORTH; `}   
+
+       #The top right corner.  
+       new north_east `{ return GDK_WINDOW_EDGE_NORTH_EAST; `} 
+
+       #The left edge.
+       new west `{ return GDK_WINDOW_EDGE_WEST; `}             
+
+       #The right edge.
+       new east `{ return GDK_WINDOW_EDGE_EAST; `}     
+
+       #The lower left corner.
+       new south_west `{ return GDK_WINDOW_EDGE_SOUTH_WEST; `} 
+
+       #The lower edge.
+       new south `{ return GDK_WINDOW_EDGE_SOUTH; `} 
+
+       #The lower right corner.
+       new south_east `{ return GDK_WINDOW_EDGE_SOUTH_EAST; `} 
+end
+
index c72ebe7..17c62a4 100644 (file)
@@ -16,6 +16,8 @@
 
 # Classes and services to use libGTK widgets
 module gtk
+import gtk_enums
+import gdk_enums
 
 in "C Header" `{
        #include <gtk/gtk.h>
@@ -81,6 +83,16 @@ extern GtkWidget `{GtkWidget *`}
        fun request_size( width, height : Int ) `{
                gtk_widget_set_size_request( recv, width, height );
        `}
+
+       fun bg_color=( state : GtkStateType, color : GdkRGBA ) is extern `{
+               gtk_widget_override_background_color( recv, state, color);
+       `}
+
+       #with gtk it's possible to set fg_color to all widget : is it correct? is fg color inherited?   
+       #GdkColor color;
+       fun fg_color=( state : GtkStateType, color : GdkRGBA ) is extern `{
+               gtk_widget_override_color( recv, state, color);
+       `}
 end
 
 #Base class for widgets which contain other widgets
@@ -103,22 +115,6 @@ extern GtkBin `{GtkBin *`}
        `}      
 end
 
-#Pack widgets in a rows and columns
-#@https://developer.gnome.org/gtk3/3.3/GtkGrid.html
-extern GtkGrid `{GtkGrid *`}
-       super GtkContainer
-
-       # Create a grid with a fixed number of rows and columns
-       new ( rows : Int, columns : Int, homogeneous : Bool ) `{
-               return (GtkGrid*)gtk_grid_new(); // rows, columns, homogeneous );
-       `}
-
-       # Set a widget child inside the grid at a given position
-       fun attach( child : GtkWidget, left, top, width, height : Int ) `{
-               gtk_grid_attach( recv, child, left, top, width, height );
-       `}
-end
-
 #Toplevel which can contain other widgets
 #@https://developer.gnome.org/gtk3/stable/GtkWindow.html
 extern GtkWindow `{GtkWindow *`}
@@ -175,6 +171,22 @@ extern GtkWindow `{GtkWindow *`}
                return gtk_window_activate_default( recv );             
        `}
 
+       fun gravity : GdkGravity is extern `{
+               return gtk_window_get_gravity( recv );
+       `}
+
+       fun gravity=( window_grav : GdkGravity ) is extern `{
+               gtk_window_set_gravity( recv, window_grav );
+       `}
+
+#      fun position : GtkWindowPosition is extern `{
+#              return gtk_window_get_position( recv );
+#      `}
+#
+#      fun position=( window_pos : GtkWindowPosition ) is extern `{
+#              gtk_window_set_position( recv, window_pos );
+#      `}
+
        fun active : Bool is extern `{
                return gtk_window_is_active( recv );
        `}
@@ -225,6 +237,73 @@ extern GtkWindow `{GtkWindow *`}
        `}
 end
 
+#A bin with a decorative frame and optional label
+#https://developer.gnome.org/gtk3/stable/GtkFrame.html
+extern GtkFrame `{GtkFrame *`}
+       super GtkBin
+
+       new ( lbl : String ) is extern import String::to_cstring`{
+               return (GtkFrame *)gtk_frame_new( String_to_cstring( lbl ) );           
+       `}
+
+       fun frame_label : String is extern`{
+               return new_String_from_cstring( (char *)gtk_frame_get_label( recv ) );          
+       `}
+
+       fun frame_label=( lbl : String ) is extern import String::to_cstring`{
+               gtk_frame_set_label( recv, String_to_cstring( lbl ) );          
+       `}
+
+       fun label_widget : GtkWidget is extern `{
+               return gtk_frame_get_label_widget( recv );      
+       `}
+
+       fun label_widget=( widget : GtkWidget ) is extern `{
+               gtk_frame_set_label_widget( recv, widget );     
+       `}
+
+       fun shadow_type : GtkShadowType is extern `{
+               return gtk_frame_get_shadow_type( recv );       
+       `}
+
+       fun shadow_type=( stype : GtkShadowType ) is extern `{
+               gtk_frame_set_shadow_type( recv, stype );       
+       `}
+
+       #fun label_align : GtkShadowType is extern `{   
+       #`}
+
+       fun label_align=( xalign : Float, yalign : Float ) is extern `{
+               gtk_frame_set_label_align( recv, xalign, yalign );      
+       `}
+end
+
+#Pack widgets in a rows and columns
+#@https://developer.gnome.org/gtk3/3.3/GtkGrid.html
+extern GtkGrid `{GtkGrid *`}
+       super GtkContainer
+
+       # Create a grid with a fixed number of rows and columns
+       new ( rows : Int, columns : Int, homogeneous : Bool ) `{
+               return (GtkGrid*)gtk_grid_new(); // rows, columns, homogeneous );
+       `}
+
+       # Set a widget child inside the grid at a given position
+       fun attach( child : GtkWidget, left, top, width, height : Int ) `{
+               gtk_grid_attach( recv, child, left, top, width, height );
+       `}
+end
+
+#The tree interface used by GtkTreeView
+#@https://developer.gnome.org/gtk3/stable/GtkTreeModel.html
+extern GtkTreeModel `{GtkTreeModel *`}
+end
+
+#An abstract class for laying out GtkCellRenderers
+#@https://developer.gnome.org/gtk3/stable/GtkCellArea.html
+extern GtkCellArea `{GtkCellArea *`}
+end
+
 #Base class for widgets with alignments and padding
 #@https://developer.gnome.org/gtk3/3.2/GtkMisc.html
 extern GtkMisc `{GtkMisc *`}
@@ -340,17 +419,17 @@ end
 
 #Displays an arrow
 #@https://developer.gnome.org/gtk3/3.2/GtkArrow.html
-#extern GtkArrow `{GtkArrow *`}
-#      super GtkMisc
-#
-#      new ( arrow_type : GtkArrowType, shadow_type : GtkShadowType ) is extern `{
-#              return (GtkArrow *)gtk_arrow_new( arrow_type, shadow_type );
-#      `}
-#
-#      fun set( arrow_type : GtkArrowType, shadow_type : GtkShadowType ) is extern `{
-#              gtk_arrow_set( recv, arrow_type, shadow_type );
-#      `}
-#end
+extern GtkArrow `{GtkArrow *`}
+       super GtkMisc
+
+       new ( arrow_type : GtkArrowType, shadow_type : GtkShadowType ) is extern `{
+               return (GtkArrow *)gtk_arrow_new( arrow_type, shadow_type );
+       `}
+
+       fun set( arrow_type : GtkArrowType, shadow_type : GtkShadowType ) is extern `{
+               gtk_arrow_set( recv, arrow_type, shadow_type );
+       `}
+end
 
 #A widget that emits a signal when clicked on
 #@https://developer.gnome.org/gtk3/stable/GtkButton.html
@@ -384,6 +463,227 @@ extern GtkButton `{GtkButton *`}
 
 end
 
+#A button which pops up a scale
+#@https://developer.gnome.org/gtk3/stable/GtkScaleButton.html
+extern GtkScaleButton `{GtkScaleButton *`}
+       super GtkButton
+       
+       #const gchar **icons
+       new( size: GtkIconSize, min: Float, max: Float, step: Float ) is extern `{
+               return (GtkScaleButton *)gtk_scale_button_new( size, min, max, step, (const char **)0 );
+       `}
+end
+
+#Create buttons bound to a URL
+#@https://developer.gnome.org/gtk3/stable/GtkLinkButton.html
+extern GtkLinkButton `{GtkLinkButton *`}
+       super GtkButton
+       
+       new( uri: String ) is extern import String::to_cstring `{
+               return (GtkLinkButton *)gtk_link_button_new( String_to_cstring(uri) );
+       `}
+end
+
+#A container which can hide its child
+#https://developer.gnome.org/gtk3/stable/GtkExpander.html
+extern GtkExpander `{GtkExpander *`}
+       super GtkBin
+
+       new( lbl : String) is extern import String::to_cstring`{
+               return (GtkExpander *)gtk_expander_new( String_to_cstring( lbl ) );
+       `}
+
+       new with_mnemonic( lbl : String) is extern import String::to_cstring`{
+               return (GtkExpander *)gtk_expander_new_with_mnemonic(String_to_cstring( lbl ));
+       `}
+
+       fun expanded : Bool is extern `{
+               return gtk_expander_get_expanded( recv ); 
+       `}
+
+       fun expanded=( is_expanded : Bool ) is extern `{
+               gtk_expander_set_expanded( recv, is_expanded );
+       `}
+
+       fun spacing : Int is extern `{
+               return gtk_expander_get_spacing( recv );
+       `}
+
+       fun spacing=( pixels : Int ) is extern `{
+               gtk_expander_set_spacing( recv, pixels );
+       `}
+
+       fun label_text : String is extern `{
+               return new_String_from_cstring( (char *)gtk_expander_get_label( recv ) );
+       `}
+
+       fun label_text=( lbl : String ) is extern import String::to_cstring`{
+               gtk_expander_set_label( recv, String_to_cstring( lbl ) );
+       `}
+
+       fun use_underline : Bool is extern `{
+               return gtk_expander_get_use_underline( recv );
+       `}
+
+       fun use_underline=( used : Bool) is extern `{
+               gtk_expander_set_use_underline( recv, used );
+       `}
+
+       fun use_markup : Bool is extern `{
+               return gtk_expander_get_use_markup( recv );
+       `}
+
+       fun use_markup=( used : Bool) is extern `{
+                gtk_expander_set_use_markup( recv, used );
+       `}
+
+       fun label_widget : GtkWidget is extern `{
+               return gtk_expander_get_label_widget( recv );
+       `}
+
+       fun label_widget=( widget : GtkWidget ) is extern `{
+               gtk_expander_set_label_widget( recv, widget );
+       `}
+
+       fun label_fill : Bool is extern `{
+               return gtk_expander_get_label_fill( recv );
+       `}
+
+       fun label_fill=( fill : Bool ) is extern `{
+               gtk_expander_set_label_fill( recv, fill );
+       `}
+
+       fun resize_toplevel : Bool is extern `{
+               return gtk_expander_get_resize_toplevel( recv );
+       `}
+
+       fun resize_toplevel=( resize : Bool ) is extern `{
+               gtk_expander_set_resize_toplevel( recv, resize );
+       `}
+
+end
+
+#An abstract class for laying out GtkCellRenderers
+#@https://developer.gnome.org/gtk3/stable/GtkCellArea.html
+extern GtkComboBox `{GtkComboBox *`}
+       super GtkBin
+
+       new is extern `{
+               return (GtkComboBox *)gtk_combo_box_new( );
+       `}
+
+       new with_entry is extern `{
+               return (GtkComboBox *)gtk_combo_box_new_with_entry( );
+       `}
+
+       new with_model( model : GtkTreeModel ) is extern `{
+               return (GtkComboBox *)gtk_combo_box_new_with_model( model );
+       `}
+
+       new with_model_and_entry( model : GtkTreeModel ) is extern `{
+               return (GtkComboBox *)gtk_combo_box_new_with_model_and_entry( model );
+       `}
+
+       new with_area( area : GtkCellArea ) is extern `{
+               return (GtkComboBox *)gtk_combo_box_new_with_area( area );
+       `}
+
+       new with_area_and_entry( area : GtkCellArea ) is extern `{
+               return (GtkComboBox *)gtk_combo_box_new_with_area_and_entry( area );
+       `}
+
+       fun wrap_width : Int is extern `{
+               return gtk_combo_box_get_wrap_width( recv );
+       `}
+
+       fun wrap_width=( width : Int ) is extern `{
+               gtk_combo_box_set_wrap_width( recv, width );
+       `}
+
+       fun row_span_col : Int is extern `{
+               return gtk_combo_box_get_row_span_column( recv );
+       `}
+
+       fun row_span_col=( row_span : Int ) is extern `{
+               gtk_combo_box_set_row_span_column( recv, row_span );
+       `}
+
+       fun col_span_col : Int is extern `{
+               return gtk_combo_box_get_column_span_column( recv );
+       `}
+
+       fun col_span_col=( col_span : Int ) is extern `{
+               gtk_combo_box_set_column_span_column( recv, col_span );
+       `}
+
+       fun active_item : Int is extern `{
+               return gtk_combo_box_get_active( recv );
+       `}
+
+       fun active_item=( active : Int ) is extern `{
+               gtk_combo_box_set_active( recv, active ); 
+       `}
+
+       #fun active_iter : GtkTreeIter is extern `{
+       #`}
+       #
+       #fun active_iter=( active : Bool ) is extern `{
+       #`}
+
+       fun column_id : Int is extern `{
+               return gtk_combo_box_get_id_column( recv );
+       `}
+
+       fun column_id=( id_column : Int ) is extern `{
+               gtk_combo_box_set_id_column( recv, id_column );
+       `}
+
+       fun active_id : String is extern `{
+               return new_String_from_cstring( (char *)gtk_combo_box_get_active_id( recv ) );
+       `}
+
+       fun active_id=( id_active : String ) is extern import String::to_cstring`{
+               gtk_combo_box_set_active_id( recv, String_to_cstring( id_active ) );
+       `}
+
+       fun model : GtkTreeModel is extern `{
+               return gtk_combo_box_get_model( recv );
+       `}
+
+       fun model=( model : GtkTreeModel ) is extern `{
+               gtk_combo_box_set_model( recv, model );
+       `}
+
+       fun popup is extern `{
+               gtk_combo_box_popup( recv );
+       `}
+
+       fun popdown is extern `{
+               gtk_combo_box_popdown( recv );
+       `}
+
+       fun title : String is extern`{
+               return new_String_from_cstring( (char *)gtk_combo_box_get_title( recv ) );
+       `}
+
+       fun title=( t : String ) is extern import String::to_cstring`{
+               gtk_combo_box_set_title( recv, String_to_cstring( t ) );
+       `}
+
+       fun has_entry : Bool is extern `{
+               return gtk_combo_box_get_has_entry( recv );
+       `}
+
+       fun with_fixed : Bool is extern `{
+               return gtk_combo_box_get_popup_fixed_width( recv );
+       `}
+
+       fun with_fixed=( fixed : Bool ) is extern `{
+               gtk_combo_box_set_popup_fixed_width( recv, fixed );
+       `}
+end
+
+
 #Show a spinner animation
 #@https://developer.gnome.org/gtk3/3.2/GtkSpinner.html
 extern GtkSpinner `{GtkSpinner *`}
@@ -438,3 +738,8 @@ extern GtkAlignment `{GtkAlignment *`}
        #set_padding
 end
 
+extern GdkRGBA `{GdkRGBA*`}
+       new is extern `{
+       `}
+end
+
diff --git a/lib/gtk/gtk_enums.nit b/lib/gtk/gtk_enums.nit
new file mode 100644 (file)
index 0000000..e829562
--- /dev/null
@@ -0,0 +1,377 @@
+module gtk_enums
+
+in "C Header" `{
+       #include <gtk/gtk.h>
+
+`}
+
+#enum GtkArrowPlacement
+#Used to specify the placement of scroll arrows in scrolling menus.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkArrowPlacement
+extern GtkArrowPlacement `{GtkArrowPlacement`}
+       #Place one arrow on each end of the menu.       
+       new both `{ return GTK_ARROWS_BOTH; `} 
+
+       #Place both arrows at the top of the menu.
+       new top `{ return GTK_ARROWS_START; `}
+       
+       #Place both arrows at the bottom of the menu.   
+       new bottom `{ return GTK_ARROWS_END; `}
+end
+
+#enum GtkArrowType
+#Used to indicate the direction in which a GtkArrow should point.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkArrowType
+extern GtkArrowType `{GtkArrowType`}
+       #Represents an upward pointing arrow.   
+       new up `{ return GTK_ARROW_UP; `} 
+
+       #Represents an downward pointing arrow.
+       new down `{ return GTK_ARROW_DOWN; `}
+       
+       #Represents a left pointing arrow.      
+       new left `{ return GTK_ARROW_LEFT; `}
+
+       #Represents a right pointing arrow.
+       new right `{ return GTK_ARROW_RIGHT; `}
+
+       #No arrow
+       new none `{ return GTK_ARROW_NONE; `}
+end
+
+#enum GtkAttachOptions
+#Denotes the expansion properties that a widget will have when it (or its parent) is resized.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkAttachOptions
+extern GtkAttachOptions `{GtkAttachOptions`}
+       #The widget should expand to take up any extra space in its container that has been allocated.
+       new expan `{ return GTK_EXPAND; `} 
+
+       #The widget should shrink as and when possible.
+       new shrink `{ return GTK_SHRINK; `}
+       
+       #The widget should fill the space allocated to it.      
+       new fill `{ return GTK_FILL; `}
+end
+
+#enum GtkButtonBoxStyle
+#Used to dictate the style that a GtkButtonBox uses to layout the buttons it contains.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkButtonBoxStyle
+extern GtkButtonBoxStyle `{GtkButtonBoxStyle`}
+       #Buttons are evenly spread across the box.
+       new spread `{ return GTK_BUTTONBOX_SPREAD; `} 
+
+       #Buttons are placed at the edges of the box.
+       new edge `{ return GTK_BUTTONBOX_EDGE; `}
+       
+       #Buttons are grouped towards the start of the box.      
+       new start `{ return GTK_BUTTONBOX_START; `}
+
+       #Buttons are grouped towards the end of the box.
+       new end_of_box `{ return GTK_BUTTONBOX_END; `}
+
+       #Buttons are centered in the box
+       new center `{ return GTK_BUTTONBOX_CENTER; `}
+end
+
+#enum GtkCornerType
+#Specifies which corner a child widget should be placed in when packed into a GtkScrolledWindow. This is effectively the opposite of where the scroll bars are placed.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkCornerType
+extern GtkCornerType `{GtkCornerType`}
+       #Place the scrollbars on the right and bottom of the widget (default behaviour).
+       new top_left `{ return GTK_CORNER_TOP_LEFT; `} 
+
+       #Place the scrollbars on the right and bottom of the widget (default behaviour).
+       new bottom_left `{ return GTK_CORNER_BOTTOM_LEFT; `}
+       
+       #Place the scrollbars on the left and bottom of the widget.     
+       new top_right `{ return GTK_CORNER_TOP_RIGHT; `}
+
+       #Place the scrollbars on the top and left of the widget.
+       new bottom_right `{ return GTK_CORNER_BOTTOM_RIGHT; `}
+end
+
+#enum GtkExpanderStyle
+#Used to specify the style of the expanders drawn by a GtkTreeView.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkExpanderStyle
+extern GtkExpanderStyle `{GtkExpanderStyle`}
+       #The style used for a collapsed subtree.
+       new collapsed `{ return GTK_EXPANDER_COLLAPSED; `} 
+
+       #Intermediate style used during animation.
+       new semi_collapsed `{ return GTK_EXPANDER_SEMI_COLLAPSED; `}
+       
+       #Intermediate style used during animation.      
+       new semi_expanded `{ return GTK_EXPANDER_SEMI_EXPANDED; `}
+
+       #The style used for an expanded subtree.
+       new expanded `{ return GTK_EXPANDER_EXPANDED; `}
+end
+
+#enum GtkJustification
+#Used for justifying the text inside a GtkLabel widget.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkJustification
+extern GtkJustification `{GtkJustification`}
+       #The text is placed at the left edge of the label.
+       new left `{ return GTK_JUSTIFY_LEFT; `} 
+
+       #The text is placed at the right edge of the label.
+       new right `{ return GTK_JUSTIFY_RIGHT; `}
+       
+       #The text is placed in the center of the label. 
+       new center `{ return GTK_JUSTIFY_CENTER; `}
+
+       #The text is placed is distributed across the label.
+       new fill `{ return GTK_JUSTIFY_FILL; `}
+end
+
+#enum GtkOrientation
+#Represents the orientation of widgets.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkOrientation
+extern GtkOrientation `{GtkOrientation`}
+       #The widget is in horizontal orientation.
+       new horizontal `{ return GTK_ORIENTATION_HORIZONTAL; `} 
+
+       #The widget is in vertical orientation.
+       new vertical `{ return GTK_ORIENTATION_VERTICAL; `}
+end
+
+#enum GtkPackType
+#Represents the packing location GtkBox children. 
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkPackType
+extern GtkPackType `{GtkPackType`}
+       #The child is packed into the start of the box.
+       new start `{ return GTK_PACK_START; `} 
+
+       #The child is packed into the end of the box.
+       new end_of_box `{ return GTK_PACK_END; `}
+end
+
+#enum GtkPolicyType
+#Determines when a scroll bar will be visible. 
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkPolicyType
+extern GtkPolicyType `{GtkPolicyType`}
+       #The scrollbar is always visible.
+       new always `{ return GTK_POLICY_ALWAYS; `} 
+
+       #The scrollbar will appear and disappear as necessary.
+       new automatic `{ return GTK_POLICY_AUTOMATIC; `}
+
+       #The scrollbar will never appear.
+       new never `{ return GTK_POLICY_NEVER; `}
+end
+
+#enum GtkPositionType
+#Describes which edge of a widget a certain feature is positioned. 
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkPositionType
+extern GtkPositionType `{GtkPositionType`}
+       #The feature is at the left edge.
+       new left `{ return GTK_POS_LEFT; `} 
+
+       #The feature is at the right edge.
+       new right `{ return GTK_POS_RIGHT; `}
+
+       #The feature is at the top edge.
+       new top `{ return GTK_POS_TOP; `}
+
+       #The feature is at the bottom edge.
+       new bottom `{ return GTK_POS_BOTTOM; `}
+end
+
+#enum GtkReliefStyle
+#Indicates the relief to be drawn around a GtkButton. 
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkReliefStyle
+extern GtkReliefStyle `{GtkReliefStyle`}
+       #Draw a normal relief.
+       new normal `{ return GTK_RELIEF_NORMAL; `} 
+
+       #A half relief.
+       new half `{ return GTK_RELIEF_HALF; `}
+
+       #No relief.
+       new none `{ return GTK_RELIEF_NONE; `}
+end
+
+#enum GtkResizeMode
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkResizeMode
+extern GtkResizeMode `{GtkResizeMode`}
+       #Pass resize request to the parent.
+       new parent `{ return GTK_RESIZE_PARENT; `} 
+
+       #Queue resizes on this widget.
+       new queue `{ return GTK_RESIZE_QUEUE; `}
+end
+
+#enum GtkSelectionMode
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkSelectionMode
+extern GtkSelectionMode `{GtkResizeMode`}
+       #No selection is possible.
+       new none `{ return GTK_SELECTION_NONE; `} 
+
+       #Zero or one element may be selected.
+       new single `{ return GTK_SELECTION_SINGLE; `}
+
+       #Exactly one element is selected. 
+       new browse `{ return GTK_SELECTION_BROWSE; `}
+
+       #Any number of elements may be selected. 
+       new multiple `{ return GTK_SELECTION_MULTIPLE; `}
+end
+
+#enum GtkShadowType
+#Used to change the appearance of an outline typically provided by a GtkFrame.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkShadowType
+extern GtkShadowType `{GtkShadowType`}
+       #No outline.    
+       new none `{ return GTK_SHADOW_NONE; `} 
+
+       #The outline is bevelled inwards.
+       new shadow_in `{ return GTK_SHADOW_IN; `}
+       
+       #The outline is bevelled outwards like a button.        
+       new shadow_out `{ return GTK_SHADOW_OUT; `}
+
+       #The outline has a sunken 3d appearance.
+       new etched_id `{ return GTK_SHADOW_ETCHED_IN; `}
+
+       #The outline has a raised 3d appearance.
+       new etched_out `{ return GTK_SHADOW_ETCHED_OUT; `}
+end
+
+#enum GtkStateType
+#Indicates the current state of a widget; the state determines how the widget is drawn. 
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkStateType
+extern GtkStateType `{GtkStateType`}
+       #State during normal operation.
+       new normal `{ return GTK_STATE_NORMAL; `} 
+
+       #State of a currently active widget, such as a depressed button.
+       new active `{ return GTK_STATE_ACTIVE; `}
+       
+       #State indicating that the mouse pointer is over the widget and the widget will respond to mouse clicks.        
+       new prelight `{ return GTK_STATE_PRELIGHT; `}
+
+       #State of a selected item, such the selected row in a list.
+       new selected `{ return GTK_STATE_SELECTED; `}
+
+       #State indicating that the widget is unresponsive to user actions.
+       new insensitive `{ return GTK_STATE_INSENSITIVE; `}
+
+       #The widget is inconsistent, such as checkbuttons or radiobuttons that aren't either set to TRUE nor FALSE, or buttons requiring the user attention.
+       new inconsistent `{ return GTK_STATE_INCONSISTENT; `}
+
+       #The widget has the keyboard focus.
+       new focused `{ return GTK_STATE_FOCUSED; `}
+end
+
+#enum GtkStateFlags
+#Describes a widget state. 
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkStateFlags
+extern GtkStateFlags `{GtkStateFlags`}
+       #State during normal operation.
+       new normal `{ return GTK_STATE_FLAG_NORMAL; `} 
+
+       #Widget is active.
+       new active `{ return GTK_STATE_FLAG_ACTIVE; `}
+       
+       #Widget has a mouse pointer over it.    
+       new prelight `{ return GTK_STATE_FLAG_PRELIGHT; `}
+
+       #Widget is selected.
+       new selected `{ return GTK_STATE_FLAG_SELECTED; `}
+
+       #Widget is insensitive.
+       new insensitive `{ return GTK_STATE_INSENSITIVE; `}
+
+       #Widget is inconsistent.
+       new inconsistent `{ return GTK_STATE_FLAG_INCONSISTENT; `}
+
+       #Widget has the keyboard focus.
+       new focused `{ return GTK_STATE_FLAG_FOCUSED; `}
+end
+
+#enum GtkToolbarStyle
+#Used to customize the appearance of a GtkToolbar.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkToolbarStyle
+extern GtkToolbarStyle `{GtkToolbarStyle`}
+       #Buttons display only icons in the toolbar.
+       new icons `{ return GTK_TOOLBAR_ICONS; `} 
+
+       #Buttons display only text labels in the toolbar.
+       new text `{ return GTK_TOOLBAR_TEXT; `}
+       
+       #Buttons display text and icons in the toolbar. 
+       new both `{ return GTK_TOOLBAR_BOTH; `}
+
+       #Buttons display icons and text alongside each other, rather than vertically stacked
+       new both_horiz `{ return GTK_TOOLBAR_BOTH_HORIZ; `}
+end
+
+#enum GtkWindowPosition
+#Window placement can be influenced using this enumeration.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkWindowPosition
+extern GtkWindowPosition `{GtkWindowPosition`}
+       #No influence is made on placement.
+       new none `{ return GTK_WIN_POS_NONE; `} 
+
+       #Windows should be placed in the center of the screen.
+       new center `{ return GTK_WIN_POS_CENTER; `}
+       
+       #Windows should be placed at the current mouse position.
+       new mouse `{ return GTK_WIN_POS_MOUSE; `}
+
+       #Keep window centered as it changes size, etc.
+       new center_always `{ return GTK_WIN_POS_CENTER_ALWAYS; `}
+
+       #Center the window on its transient parent.
+       new center_on_parent `{ return GTK_WIN_POS_CENTER_ON_PARENT; `}
+end
+
+#enum GtkWindowType
+#A GtkWindow can be one of these types.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkWindowType
+extern GtkWindowType `{GtkWindowType`}
+       #A regular window, such as a dialog
+       new toplevel `{ return GTK_WINDOW_TOPLEVEL; `} 
+
+       #A special window such as a tooltip.
+       new popup `{ return GTK_WINDOW_POPUP; `}
+end
+
+#enum GtkSortType
+#Determines the direction of a sort.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkSortType
+extern GtkSortType `{GtkSortType`}
+       #Sorting is in ascending order.
+       new asc `{ return GTK_SORT_ASCENDING; `} 
+
+       #Sorting is in descending order.
+       new desc `{ return GTK_SORT_DESCENDING; `}
+end
+
+#enum GtkBorderStyle
+#Describes how the border of a UI element should be rendered.
+#@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkBorderStyle
+extern GtkBorderStyle `{GtkBorderStyle`}
+       #No visible border.
+       new none `{ return GTK_BORDER_STYLE_NONE; `} 
+
+       #An solid border.
+       new solid `{ return GTK_BORDER_STYLE_SOLID; `}
+
+       #An intset border.
+       new inset `{ return GTK_BORDER_STYLE_INSET; `}
+
+       #An outset border.
+       new outset `{ return GTK_BORDER_STYLE_OUTSET; `}
+end
+
+# Icon size enum
+extern GtkIconSize `{GtkIconSize`}
+       new invalid `{ return GTK_ICON_SIZE_INVALID; `}
+       new menu `{ return GTK_ICON_SIZE_MENU; `}
+       new small_toolbar `{ return GTK_ICON_SIZE_SMALL_TOOLBAR; `}
+       new large_toolbar `{ return GTK_ICON_SIZE_LARGE_TOOLBAR; `}
+       new button `{ return GTK_ICON_SIZE_BUTTON; `}
+       new dnd `{ return GTK_ICON_SIZE_DND; `}
+       new dialog `{ return GTK_ICON_SIZE_DIALOG;`}
+end