|
From: Andy S. <And...@co...> - 2010-09-08 13:54:34
|
diffing dir...
Wed Sep 8 09:52:46 EDT 2010 Andy Stewart <laz...@gm...>
* Update new ToolItem functions in Gtk+-2.20
Ignore-this: 86649baf6e89034ab23bcabb86ac864e
{
hunk ./TODO 61
-gtk_tool_item_get_ellipsize_mode, function in GtkToolItem
-gtk_tool_item_get_text_alignment, function in GtkToolItem
-gtk_tool_item_get_text_orientation, function in GtkToolItem
-gtk_tool_item_get_text_size_group, function in GtkToolItem
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolItem.chs 89
+#if GTK_CHECK_VERSION(2,20,0)
+ toolItemGetEllipsizeMode,
+ toolItemGetTextAlignment,
+ toolItemGetTextOrientation,
+ toolItemGetTextSizeGroup,
+#endif
+
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolItem.chs 112
+import Graphics.Rendering.Pango.Enums (EllipsizeMode (..))
+import Graphics.UI.Gtk.Misc.SizeGroup
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolItem.chs 353
+#if GTK_CHECK_VERSION(2,20,0)
+-- | Returns the ellipsize mode used for @toolItem@. Custom subclasses of 'ToolItem' should call this
+-- function to find out how text should be ellipsized.
+--
+-- * Available since Gtk+ version 2.20
+--
+toolItemGetEllipsizeMode :: ToolItemClass item => item
+ -> IO EllipsizeMode -- ^ returns a PangoEllipsizeMode indicating how text in @toolItem@ should be ellipsized.
+toolItemGetEllipsizeMode item = [_$_]
+ liftM (toEnum . fromIntegral) $
+ {#call gtk_tool_item_get_ellipsize_mode #}
+ (toToolItem item)
+
+-- | Returns the text alignment used for @toolItem@. Custom subclasses of 'ToolItem' should call this
+-- function to find out how text should be aligned.
+toolItemGetTextAlignment :: ToolItemClass item => item [_$_]
+ -> IO Double -- ^ returns a gfloat indicating the horizontal text alignment used for @toolItem@
+toolItemGetTextAlignment item =
+ liftM realToFrac $
+ {#call gtk_tool_item_get_text_alignment #}
+ (toToolItem item)
+
+-- | Returns the text orientation used for @toolItem@. Custom subclasses of 'ToolItem' should call this
+-- function to find out how text should be orientated.
+toolItemGetTextOrientation :: ToolItemClass item => item
+ -> IO Orientation -- ^ returns a 'Orientation' indicating the orientation used for @toolItem@ [_$_]
+toolItemGetTextOrientation item =
+ liftM (toEnum . fromIntegral) $
+ {#call gtk_tool_item_get_text_orientation #}
+ (toToolItem item)
+
+-- | Returns the size group used for labels in @toolItem@. Custom subclasses of 'ToolItem' should call
+-- this function and use the size group for labels.
+toolItemGetTextSizeGroup :: ToolItemClass item => item
+ -> IO SizeGroup
+toolItemGetTextSizeGroup item =
+ makeNewGObject mkSizeGroup $
+ {#call gtk_tool_item_get_text_size_group #}
+ (toToolItem item)
+#endif
+
}
|