From: Andy S. <And...@co...> - 2010-03-24 10:29:36
|
Wed Mar 24 06:28:58 EDT 2010 Andy Stewart <laz...@gm...> * Update all `ActionmenuToolbar` modules to Gtk+ 2.18.3 Ignore-this: dd177bf35acbcab3d75686df3f2f3c39 hunk ./ApiUpdateTodoList.txt 23 -*** TODO Activatable.chs +*** DONE Activatable.chs hunk ./ApiUpdateTodoList.txt 196 -*** TODO ActionGroup.chs.pp -*** TODO RadioAction.chs.pp -*** TODO ToggleAction.chs.pp -*** TODO UIManager.chs.pp +*** DONE ActionGroup.chs.pp +*** DONE RadioAction.chs.pp +*** DONE ToggleAction.chs.pp +*** DONE UIManager.chs.pp hunk ./Makefile.am 689 + gtk/Graphics/UI/Gtk/ActionMenuToolbar/RecentAction.chs.pp \ + gtk/Graphics/UI/Gtk/ActionMenuToolbar/Activatable.chs.pp \ hunk ./gtk/Graphics/UI/Gtk.hs.pp 155 + module Graphics.UI.Gtk.ActionMenuToolbar.RecentAction, hunk ./gtk/Graphics/UI/Gtk.hs.pp 158 + module Graphics.UI.Gtk.ActionMenuToolbar.Activatable, hunk ./gtk/Graphics/UI/Gtk.hs.pp 365 +import Graphics.UI.Gtk.ActionMenuToolbar.RecentAction hunk ./gtk/Graphics/UI/Gtk.hs.pp 368 +import Graphics.UI.Gtk.ActionMenuToolbar.Activatable hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 28 +-- [_$_] +-- The following don't need bind, use corresponding attributes instead: +-- [_$_] +-- gtk_action_set_label [_$_] +-- gtk_action_get_label [_$_] +-- gtk_action_set_short_label [_$_] +-- gtk_action_get_short_label [_$_] +-- gtk_action_set_tooltip [_$_] +-- gtk_action_get_tooltip [_$_] +-- gtk_action_set_stock_id [_$_] +-- gtk_action_get_stock_id [_$_] +-- gtk_action_set_gicon [_$_] +-- gtk_action_get_gicon [_$_] +-- gtk_action_set_icon_name [_$_] +-- gtk_action_get_icon_name [_$_] +-- gtk_action_set_visible_horizontal [_$_] +-- gtk_action_get_visible_horizontal [_$_] +-- gtk_action_set_visible_vertical [_$_] +-- gtk_action_get_visible_vertical [_$_] +-- gtk_action_set_is_important [_$_] +-- gtk_action_get_is_important [_$_] hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 51 + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 91 +-- hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 97 +-- | +----'RecentAction' hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 123 + actionCreateIcon, +#if GTK_CHECK_VERSION(2,12,0) + actionCreateMenu, +#endif hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 139 +#if GTK_CHECK_VERSION(2,16,0) + actionBlockActivate, + actionUnblockActivate, +#endif +#if GTK_CHECK_VERSION(2,8,0) + -- actionGetAccelClosure, +#endif hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 165 +#if GTK_CHECK_VERSION(2,10,0) + actionActionGroup, +#endif hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 192 +import Graphics.UI.Gtk.General.Structs (IconSize(..), Rectangle) hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 319 +-- | This function is intended for use by action implementations to create icons displayed in the proxy +-- widgets. +-- [_$_] +-- Since 2.4 +actionCreateIcon :: ActionClass self => self [_$_] + -> IconSize + -> IO Widget +actionCreateIcon self size = + makeNewObject mkWidget $ + {#call action_create_icon#} + (toAction self) + ((fromIntegral . fromEnum) size) + +#if GTK_CHECK_VERSION(2,12,0) +-- | If @action@ provides a 'Menu' widget as a submenu for the menu item or +-- the toolbar item it creates, this function returns an instance of that menu. +-- +-- * Available since Gtk+ version 2.12 +-- +actionCreateMenu :: ActionClass self => self + -> IO Widget -- ^ returns the menu item provided by the action, or {@NULL@, + -- FIXME: this should probably be converted to a Maybe data + -- type}. +actionCreateMenu self = + makeNewObject mkWidget $ + {# call gtk_action_create_menu #} + (toAction self) +#endif + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 457 +#if GTK_CHECK_VERSION(2,16,0) +-- | Disable activation signals from the action +-- +-- This is needed when updating the state of your proxy 'Activatable' widget +-- could result in calling 'actionActivate', this is a convenience function to +-- avoid recursing in those cases (updating toggle state for instance). +-- +-- * Available since Gtk+ version 2.16 +-- +actionBlockActivate :: ActionClass self => self -> IO () +actionBlockActivate self = + {# call gtk_action_block_activate #} + (toAction self) + +-- | Reenable activation signals from the action +-- +-- * Available since Gtk+ version 2.16 +-- +actionUnblockActivate :: ActionClass self => self -> IO () +actionUnblockActivate self = + {# call gtk_action_unblock_activate #} + (toAction self) +#endif + +#if GTK_CHECK_VERSION(2,8,0) +-- | Returns the accel closure for this action. +-- +-- * Available since Gtk+ version 2.8 +-- +-- actionGetAccelClosure :: ActionClass self => self +-- -> IO {-GClosure*-} -- ^ returns the accel closure for this action. The +-- -- returned closure is owned by Gtk+ and must not be +-- -- unreffed or modified. +-- actionGetAccelClosure self = +-- {# call gtk_action_get_accel_closure #} +-- (toAction self) +#endif + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp 610 +-- | The 'ActionGroup' this 'Action' is associated with. +actionActionGroup :: ActionClass self => Attr self ActionGroup +actionActionGroup = newAttrFromObjectProperty "action-group" + {# call pure unsafe gtk_action_group_get_type #} + +-- | The name of the icon from the icon theme. +-- [_$_] +-- Note that the stock icon is preferred, if the 'stockId' property holds the id of an existing stock +-- icon, and the GIcon is preferred if the "gicon" property is set. +-- [_$_] +-- This is an appearance property and thus only applies if 'useActionAppearance' is 'True'. +-- [_$_] +-- Default value: 'Nothing' +-- [_$_] +-- Since 2.10 +actionIconName :: ActionClass self => Attr self String +actionIconName = newAttrFromStringProperty "icon-name" + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup.chs.pp 30 + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup.chs.pp 53 +-- hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup.chs.pp 99 + connectProxy, + disconnectProxy, + postActivate, + preActivate, + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup.chs.pp 125 +{#import Graphics.UI.Gtk.Signals#} hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup.chs.pp 447 +-- | The 'connectProxy' signal is emitted after connecting a proxy to an action in the group. Note that +-- the proxy may have been connected to a different action before. +-- [_$_] +-- This is intended for simple customizations for which a custom action class would be too clumsy, +-- e.g. showing tooltips for menuitems in the statusbar. +-- [_$_] +-- 'UIManager' proxies the signal and provides global notification just before any action is connected +-- to a proxy, which is probably more convenient to use. +connectProxy :: ActionGroupClass self => Signal self (Action -> Widget -> IO ()) +connectProxy = Signal (connect_OBJECT_OBJECT__NONE "connect-proxy") + [_$_] +-- | The 'disconnectProxy' signal is emitted after disconnecting a proxy from an action in the group. +-- [_$_] +-- 'UIManager' proxies the signal and provides global notification just before any action is connected +-- to a proxy, which is probably more convenient to use. +-- [_$_] +-- Since 2.4 +disconnectProxy :: ActionGroupClass self => Signal self (Action -> Widget -> IO ()) +disconnectProxy = Signal (connect_OBJECT_OBJECT__NONE "disconnect-proxy") + +-- | The 'postActivate' signal is emitted just after the action in the @actionGroup@ is activated +-- [_$_] +-- This is intended for 'UIManager' to proxy the signal and provide global notification just after any +-- action is activated. +-- [_$_] +-- Since 2.4 +postActivate :: ActionGroupClass self => Signal self (Action -> IO ()) +postActivate = Signal (connect_OBJECT__NONE "post-activate") + [_$_] + +-- | The 'preActivate' signal is emitted just before the action in the @actionGroup@ is activated +-- [_$_] +-- This is intended for 'UIManager' to proxy the signal and provide global notification just before +-- any action is activated. +-- [_$_] +-- Since 2.4 +preActivate :: ActionGroupClass self => Signal self (Action -> IO ()) +preActivate = Signal (connect_OBJECT__NONE "pre-activate") + addfile ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Activatable.chs.pp hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Activatable.chs.pp 1 +-- -*-haskell-*- +-- GIMP Toolkit (GTK) Interface Activatable +-- +-- Author : Andy Stewart +-- +-- Created: 24 Mar 2010 +-- +-- Copyright (C) 2010 Andy Stewart +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- | +-- Maintainer : gtk...@li... +-- Stability : provisional +-- Portability : portable (depends on GHC) +-- +-- An interface for activatable widgets +-- +-- * Module available since Gtk+ version 2.16 +-- +-- The following functons don't bind, use corresponding attributes instead: +-- gtk_activatable_set_related_action +-- gtk_activatable_get_related_action +-- gtk_activatable_set_use_action_appearance +-- gtk_activatable_get_use_action_appearance +-- +module Graphics.UI.Gtk.ActionMenuToolbar.Activatable ( + +-- * Detail +-- +-- | Activatable widgets can be connected to a 'Action' and reflects the state +-- of its action. A 'Activatable' can also provide feedback through its action, +-- as they are responsible for activating their related actions. +-- +-- '{FIXME: gtk-doc cross reference to:}' + +-- * Class Hierarchy +-- +-- | +-- @ +-- | 'GInterface' +-- | +----Activatable +-- @ + +#if GTK_CHECK_VERSION(2,16,0) +-- * Types + Activatable, + ActivatableClass, + castToActivatable, + toActivatable, + +-- * Methods + activatableDoSetRelatedAction, + activatableSyncActionProperties, + +-- * Attributes + activatableRelatedAction, + activatableUseActionAppearance, +#endif + ) where + +import Control.Monad (liftM) + +import System.Glib.FFI +import System.Glib.Attributes +import System.Glib.Properties +{#import Graphics.UI.Gtk.Types#} + +{# context lib="gtk" prefix="gtk" #} + +#if GTK_CHECK_VERSION(2,16,0) +-------------------- +-- Methods + +-- | This is a utility function for 'Activatable' implementors. +-- +-- When implementing 'Activatable' you must call this when handling changes +-- of the {\"related-action\", FIXME: unknown type\/value}, and you must also +-- use this to break references in {GObject-, FIXME: unknown +-- type\/value}>'dispose'. +-- +-- This function adds a reference to the currently set related action for +-- you, it also makes sure the {GtkActivatable-, FIXME: unknown +-- type\/value}>'update' method is called when the related 'Action' properties +-- change and registers to the action's proxy list. +-- +activatableDoSetRelatedAction :: (ActivatableClass self, ActionClass action) => self + -> action -- ^ @action@ - the 'Action' to set + -> IO () +activatableDoSetRelatedAction self action = + {# call gtk_activatable_do_set_related_action #} + (toActivatable self) + (toAction action) + +-- | This is called to update the activatable completely, this is called +-- internally when the {\"related-action\", FIXME: unknown type\/value} +-- property is set or unset and by the implementing class when +-- {\"use-action-appearance\", FIXME: unknown type\/value} changes. +-- +activatableSyncActionProperties :: (ActivatableClass self, ActionClass action) => self + -> action -- ^ @action@ - the related 'Action' or {@NULL@, FIXME: this should + -- probably be converted to a Maybe data type} + -> IO () +activatableSyncActionProperties self action = + {# call gtk_activatable_sync_action_properties #} + (toActivatable self) + (toAction action) + +-------------------- +-- Attributes + +-- | +-- +activatableRelatedAction :: (ActivatableClass self, ActionClass action) => ReadWriteAttr self Action action +activatableRelatedAction = newAttrFromObjectProperty "related-action" + {# call pure unsafe gtk_action_get_type #} + +-- | +-- +activatableUseActionAppearance :: ActivatableClass self => Attr self Bool +activatableUseActionAppearance = newAttrFromBoolProperty "use-action-appearance" +#endif hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp 20 --- TODO --- I don't know what the elemnt type of the group GSList is for --- radioActionSetGroup / radioActionGetGroup --- --- Also, the signals clash with those from other modules +-- The following function don't need bind, use corresponding attributes instead: +-- gtk_radio_action_set_current_value hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp 33 + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp 40 +-- hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp 71 +-- * Signal + radioActionChanged, + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp 90 +{#import Graphics.UI.Gtk.Signals#} hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp 198 +-------------------- +-- Signals. +radioActionChanged :: RadioActionClass self => Signal self (RadioAction -> IO ()) +radioActionChanged = Signal (connect_OBJECT__NONE "changed") + addfile ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RecentAction.chs.pp hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/RecentAction.chs.pp 1 +-- -*-haskell-*- +-- GIMP Toolkit (GTK) Widget RecentAction +-- +-- Author : Andy Stewart +-- +-- Created: 24 Mar 2010 +-- +-- Copyright (C) 2010 Andy Stewart +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- | +-- Maintainer : gtk...@li... +-- Stability : provisional +-- Portability : portable (depends on GHC) +-- +-- An action of which represents a list of recently used files +-- +-- * Module available since Gtk+ version 2.12 +-- +-- The following functons don't bind, use corresponding attributes instead: +-- gtk_recent_action_get_show_numbers +-- gtk_recent_action_set_show_numbers +-- +module Graphics.UI.Gtk.ActionMenuToolbar.RecentAction ( + +-- * Detail +-- +-- | A 'RecentAction' represents a list of recently used files, which can be +-- shown by widgets such as 'RecentChooserDialog' or 'RecentChooserMenu'. +-- +-- To construct a submenu showing recently used files, use a 'RecentAction' +-- as the action for a \<menuitem>. To construct a menu toolbutton showing the +-- recently used files in the popup menu, use a 'RecentAction' as the action +-- for a \<toolitem> element. + +-- * Class Hierarchy +-- +-- | +-- @ +-- | 'GObject' +-- | +----'Action' +-- | +----RecentAction +-- @ + +#if GTK_CHECK_VERSION(2,12,0) +-- * Types + RecentAction, + RecentActionClass, + castToRecentAction, + toRecentAction, + +-- * Constructors + recentActionNew, + -- recentActionNewForManager, + +-- * Attributes + recentActionShowNumbers, +#endif + ) where + +import Control.Monad (liftM) + +import System.Glib.FFI +import System.Glib.Attributes +import System.Glib.Properties +import System.Glib.UTFString +import System.Glib.GObject (constructNewGObject) +{#import Graphics.UI.Gtk.Types#} + +{# context lib="gtk" prefix="gtk" #} + +#if GTK_CHECK_VERSION(2,12,0) +-------------------- +-- Constructors + +-- | Creates a new 'RecentAction' object. To add the action to a 'ActionGroup' +-- and set the accelerator for the action, call +-- 'actionGroupAddActionWithAccel'. +-- +recentActionNew :: + String -- ^ @name@ - a unique name for the action + -> String -- ^ @label@ - the label displayed in menu items and on buttons, or + -- {@NULL@, FIXME: this should probably be converted to a Maybe data + -- type} + -> String -- ^ @tooltip@ - a tooltip for the action, or {@NULL@, FIXME: this + -- should probably be converted to a Maybe data type} + -> String -- ^ @stockId@ - the stock icon to display in widgets representing + -- the action, or {@NULL@, FIXME: this should probably be converted + -- to a Maybe data type} + -> IO RecentAction +recentActionNew name label tooltip stockId = + constructNewGObject mkRecentAction $ [_$_] + liftM castPtr $ + withUTFString stockId $ \stockIdPtr -> + withUTFString tooltip $ \tooltipPtr -> + withUTFString label $ \labelPtr -> + withUTFString name $ \namePtr -> + {# call gtk_recent_action_new #} + namePtr + labelPtr + tooltipPtr + stockIdPtr + +-- | Creates a new 'RecentAction' object. To add the action to a 'ActionGroup' +-- and set the accelerator for the action, call +-- 'actionGroupAddActionWithAccel'. +-- +-- recentActionNewForManager :: RecentManagerClass manager => +-- String -- ^ @name@ - a unique name for the action +-- -> String -- ^ @label@ - the label displayed in menu items and on buttons, +-- -- or {@NULL@, FIXME: this should probably be converted to a Maybe +-- -- data type} +-- -> String -- ^ @tooltip@ - a tooltip for the action, or {@NULL@, FIXME: this +-- -- should probably be converted to a Maybe data type} +-- -> String -- ^ @stockId@ - the stock icon to display in widgets representing +-- -- the action, or {@NULL@, FIXME: this should probably be converted +-- -- to a Maybe data type} +-- -> manager -- ^ @manager@ - a 'RecentManager', or {@NULL@, FIXME: this should +-- -- probably be converted to a Maybe data type} for using the +-- -- default 'RecentManager' +-- -> IO RecentAction +-- recentActionNewForManager name label tooltip stockId manager = +-- constructNewGObject mkRecentAction $ +-- withUTFString stockId $ \stockIdPtr -> +-- withUTFString tooltip $ \tooltipPtr -> +-- withUTFString label $ \labelPtr -> +-- withUTFString name $ \namePtr -> +-- {# call gtk_recent_action_new_for_manager #} +-- namePtr +-- labelPtr +-- tooltipPtr +-- stockIdPtr +-- (toRecentAction manager) + +-------------------- +-- Attributes + +-- | +-- +recentActionShowNumbers :: RecentActionClass self => Attr self Bool +recentActionShowNumbers = newAttrFromBoolProperty "show-numbers" +#endif hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ToggleAction.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ToggleAction.chs.pp 30 + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/ToggleAction.chs.pp 37 +-- hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/UIManager.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/UIManager.chs.pp 34 + hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/UIManager.chs.pp 194 +-- hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/UIManager.chs.pp 238 + uiManagerConnectProxy, + uiManagerDisconnectProxy, + uiManagerPostActivate, + uiManagerPreActivate, hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/UIManager.chs.pp 583 +-- | The @connectProxy@ signal is emitted after connecting a proxy to an action in the group. +-- [_$_] +-- This is intended for simple customizations for which a custom action class would be too clumsy, +-- e.g. showing tooltips for menuitems in the statusbar. +uiManagerConnectProxy :: UIManagerClass self => Signal self (Action -> Widget -> IO ()) +uiManagerConnectProxy = Signal (connect_OBJECT_OBJECT__NONE "connect-proxy") + [_$_] +-- | The @disconnectProxy@ signal is emitted after disconnecting a proxy from an action in the group. +uiManagerDisconnectProxy :: UIManagerClass self => Signal self (Action -> Widget -> IO ()) +uiManagerDisconnectProxy = Signal (connect_OBJECT_OBJECT__NONE "disconnect-proxy") + [_$_] +-- | The @postActivate@ signal is emitted just after the action is activated. +-- [_$_] +-- This is intended for applications to get notification just after any action is activated. +uiManagerPostActivate :: UIManagerClass self => Signal self (Action -> IO ()) +uiManagerPostActivate = Signal (connect_OBJECT__NONE "post-activate") + [_$_] +-- | The @preActivate@ signal is emitted just before the action is activated. +-- [_$_] +-- This is intended for applications to get notification just before any action is activated. +uiManagerPreActivate :: UIManagerClass self => Signal self (Action -> IO ()) +uiManagerPreActivate = Signal (connect_OBJECT__NONE "pre-activate") + hunk ./tools/hierarchyGen/hierarchy.list 206 + GtkRecentAction hunk ./tools/hierarchyGen/hierarchy.list 349 + +# For ActionMenuToolbar + GtkActivatable |