{-# LINE 2 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}-- -*-haskell-*--- GIMP Toolkit (GTK) Widget Action---- Author : Duncan Coutts, Andy Stewart---- Created: 6 April 2005---- Copyright (C) 2005 Duncan Coutts-- 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 : gtk2hs-users@lists.sourceforge.net-- Stability : provisional-- Portability : portable (depends on GHC)---- An action which can be triggered by a menu or toolbar item---- * Module available since Gtk+ version 2.4--moduleGraphics.UI.Gtk.ActionMenuToolbar.Action(-- * Detail---- | Actions represent operations that the user can be perform, along with-- some information how it should be presented in the interface. Each action-- provides methods to create icons, menu items and toolbar items representing-- itself.---- As well as the callback that is called when the action gets activated,-- the following also gets associated with the action:---- * a name (not translated, for path lookup)---- * a label (translated, for display)---- * an accelerator---- * whether label indicates a stock id---- * a tooltip (optional, translated)---- * a toolbar label (optional, shorter than label)---- The action will also have some state information:---- * visible (shown\/hidden)---- * sensitive (enabled\/disabled)---- Apart from regular actions, there are toggle actions, which can be-- toggled between two states and radio actions, of which only one in a group-- can be in the \"active\" state. Other actions can be implemented as 'Action'-- subclasses.---- Each action can have one or more proxy menu item, toolbar button or other-- proxy widgets. Proxies mirror the state of the action (text label, tooltip,-- icon, visible, sensitive, etc), and should change when the action's state-- changes. When the proxy is activated, it should activate its action.-- * Class Hierarchy-- |-- @-- | 'GObject'-- | +----Action-- | +----'ToggleAction'-- @-- * TypesAction,ActionClass,castToAction,gTypeAction,toAction,-- * ConstructorsactionNew,-- * MethodsactionGetName,actionIsSensitive,actionGetSensitive,actionSetSensitive,actionIsVisible,actionGetVisible,actionSetVisible,actionActivate,actionCreateMenuItem,actionCreateToolItem,actionConnectProxy,actionDisconnectProxy,actionGetProxies,actionConnectAccelerator,actionDisconnectAccelerator,actionGetAccelPath,actionSetAccelPath,actionSetAccelGroup,-- * AttributesactionName,actionLabel,actionShortLabel,actionTooltip,actionStockId,actionVisibleHorizontal,actionVisibleOverflown,actionVisibleVertical,actionIsImportant,actionHideIfEmpty,actionSensitive,actionVisible,actionAccelPath,actionAlwaysShowImage,-- * SignalsactionActivated,-- * DeprecatedonActionActivate,afterActionActivate,)whereimportControl.Monad(liftM)importSystem.Glib.FFIimportSystem.Glib.UTFStringimportSystem.Glib.GListimportSystem.Glib.AttributesimportSystem.Glib.PropertiesimportSystem.Glib.GObject(wrapNewGObject)importGraphics.UI.Gtk.Abstract.Object(makeNewObject)importGraphics.UI.Gtk.Types{-# LINE 157 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}importGraphics.UI.Gtk.Signals{-# LINE 158 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}importGraphics.UI.Gtk.General.StockItems{-# LINE 161 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}---------------------- Constructors-- | Creates a new 'Action' object. To add the action to a 'ActionGroup' and-- set the accelerator for the action, call-- 'Graphics.UI.Gtk.ActionMenuToolbar.ActionGroup.actionGroupAddActionWithAccel'.-- See "Graphics.UI.Gtk.ActionMenuToolbar.UIManager#XML-UI" for information on-- allowed action names.--actionNew::String-- ^ @name@ - A unique name for the action->String-- ^ @label@ - the label displayed in menu items and on-- buttons->MaybeString-- ^ @tooltip@ - a tooltip for the action->MaybeStockId-- ^ @stockId@ - the stock icon to display in widgets-- representing the action->IOActionactionNewnamelabeltooltipstockId=wrapNewGObjectmkAction$maybeWithwithUTFStringstockId$\stockIdPtr->maybeWithwithUTFStringtooltip$\tooltipPtr->withUTFStringlabel$\labelPtr->withUTFStringname$\namePtr->gtk_action_new{-# LINE 187 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}namePtrlabelPtrtooltipPtrstockIdPtr---------------------- Methods-- | Returns the name of the action.--actionGetName::ActionClassself=>self->IOStringactionGetNameself=(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_get_nameargPtr1){-# LINE 200 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)>>=peekUTFString-- | Returns whether the action is effectively sensitive.--actionIsSensitive::ActionClassself=>self->IOBool-- ^ returns @True@ if the action and its associated action group-- are both sensitive.actionIsSensitiveself=liftMtoBool$(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_is_sensitiveargPtr1){-# LINE 211 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Returns whether the action itself is sensitive. Note that this doesn't-- necessarily mean effective sensitivity. See 'actionIsSensitive' for that.--actionGetSensitive::ActionClassself=>self->IOBool-- ^ returns @True@ if the action itself is sensitive.actionGetSensitiveself=liftMtoBool$(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_get_sensitiveargPtr1){-# LINE 221 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Sets the sensitive property of the action to @sensitive@. Note that-- this doesn't necessarily mean effective sensitivity. See 'actionIsSensitive'-- for that.---- * Available since Gtk+ version 2.6--actionSetSensitive::ActionClassself=>self->Bool-- ^ @sensitive@ - @True@ to make the action sensitive->IO()actionSetSensitiveselfsensitive=(\(Actionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_action_set_sensitiveargPtr1arg2){-# LINE 235 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)(fromBoolsensitive)-- | Returns whether the action is effectively visible.--actionIsVisible::ActionClassself=>self->IOBool-- ^ returns @True@ if the action and its associated action group-- are both visible.actionIsVisibleself=liftMtoBool$(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_is_visibleargPtr1){-# LINE 247 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Returns whether the action itself is visible. Note that this doesn't-- necessarily mean effective visibility. See 'actionIsSensitive' for that.--actionGetVisible::ActionClassself=>self->IOBool-- ^ returns @True@ if the action itself is visible.actionGetVisibleself=liftMtoBool$(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_get_visibleargPtr1){-# LINE 257 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Sets the visible property of the action to @visible@. Note that this-- doesn't necessarily mean effective visibility. See 'actionIsVisible' for-- that.---- * Available since Gtk+ version 2.6--actionSetVisible::ActionClassself=>self->Bool-- ^ @visible@ - @True@ to make the action visible->IO()actionSetVisibleselfvisible=(\(Actionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_action_set_visibleargPtr1arg2){-# LINE 271 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)(fromBoolvisible)-- | Emits the \"activate\" signal on the specified action, if it isn't-- insensitive. This gets called by the proxy widgets when they get activated.---- It can also be used to manually activate an action.--actionActivate::ActionClassself=>self->IO()actionActivateself=(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_activateargPtr1){-# LINE 283 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Creates a menu item widget that proxies for the given action.--actionCreateMenuItem::ActionClassself=>self->IOWidget-- ^ returns a menu item connected to the action.actionCreateMenuItemself=makeNewObjectmkWidget$(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_create_menu_itemargPtr1){-# LINE 292 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Creates a toolbar item widget that proxies for the given action.--actionCreateToolItem::ActionClassself=>self->IOWidget-- ^ returns a toolbar item connected to the action.actionCreateToolItemself=makeNewObjectmkWidget$(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_create_tool_itemargPtr1){-# LINE 301 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Connects a widget to an action object as a proxy. Synchronises various-- properties of the action with the widget (such as label text, icon, tooltip,-- etc), and attaches a callback so that the action gets activated when the-- proxy widget does.---- If the widget is already connected to an action, it is disconnected-- first.--actionConnectProxy::(ActionClassself,WidgetClassproxy)=>self->proxy-- ^ @proxy@ - the proxy widget->IO()actionConnectProxyselfproxy=(\(Actionarg1)(Widgetarg2)->withForeignPtrarg1$\argPtr1->withForeignPtrarg2$\argPtr2->gtk_action_connect_proxyargPtr1argPtr2){-# LINE 316 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)(toWidgetproxy)-- | Disconnects a proxy widget from an action.--actionDisconnectProxy::(ActionClassself,WidgetClassproxy)=>self->proxy-- ^ @proxy@ - the proxy widget->IO()actionDisconnectProxyselfproxy=(\(Actionarg1)(Widgetarg2)->withForeignPtrarg1$\argPtr1->withForeignPtrarg2$\argPtr2->gtk_action_disconnect_proxyargPtr1argPtr2){-# LINE 326 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)(toWidgetproxy)-- | Returns the proxy widgets for an action.--actionGetProxies::ActionClassself=>self->IO[Widget]actionGetProxiesself=(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_get_proxiesargPtr1){-# LINE 334 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)>>=readGSList>>=mapM(\elemPtr->makeNewObjectmkWidget(returnelemPtr))-- | Installs the accelerator for @action@ if @action@ has an accel path and-- group. See 'actionSetAccelPath' and 'actionSetAccelGroup'---- Since multiple proxies may independently trigger the installation of the-- accelerator, the @action@ counts the number of times this function has been-- called and doesn't remove the accelerator until-- 'actionDisconnectAccelerator' has been called as many times.--actionConnectAccelerator::ActionClassself=>self->IO()actionConnectAcceleratorself=(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_connect_acceleratorargPtr1){-# LINE 349 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Undoes the effect of one call to 'actionConnectAccelerator'.--actionDisconnectAccelerator::ActionClassself=>self->IO()actionDisconnectAcceleratorself=(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_disconnect_acceleratorargPtr1){-# LINE 356 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)-- | Returns the accel path for this action.---- * Available since Gtk+ version 2.6--actionGetAccelPath::ActionClassself=>self->IO(MaybeString)-- ^ returns the accel path for this action, or-- @Nothing@ if none is set.actionGetAccelPathself=(\(Actionarg1)->withForeignPtrarg1$\argPtr1->gtk_action_get_accel_pathargPtr1){-# LINE 368 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)>>=maybePeekpeekUTFString-- | Sets the accel path for this action. All proxy widgets associated with-- the action will have this accel path, so that their accelerators are-- consistent.--actionSetAccelPath::ActionClassself=>self->String-- ^ @accelPath@ - the accelerator path->IO()actionSetAccelPathselfaccelPath=withUTFStringaccelPath$\accelPathPtr->(\(Actionarg1)arg2->withForeignPtrarg1$\argPtr1->gtk_action_set_accel_pathargPtr1arg2){-# LINE 382 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)accelPathPtr-- | Sets the 'AccelGroup' in which the accelerator for this action will be-- installed.--actionSetAccelGroup::ActionClassself=>self->AccelGroup->IO()actionSetAccelGroupselfaccelGroup=(\(Actionarg1)(AccelGrouparg2)->withForeignPtrarg1$\argPtr1->withForeignPtrarg2$\argPtr2->gtk_action_set_accel_groupargPtr1argPtr2){-# LINE 391 "./Graphics/UI/Gtk/ActionMenuToolbar/Action.chs" #-}(toActionself)accelGroup---------------------- Attributes-- | A unique name for the action.---- Default value: \"\"--actionName::ActionClassself=>AttrselfStringactionName=newAttrFromStringProperty"name"-- | The label used for menu items and buttons that activate this action.---- Default value: \"\"--actionLabel::ActionClassself=>AttrselfStringactionLabel=newAttrFromStringProperty"label"-- | A shorter label that may be used on toolbar buttons.---- Default value: \"\"--actionShortLabel::ActionClassself=>AttrselfStringactionShortLabel=newAttrFromStringProperty"short-label"-- | A tooltip for this action.---- Default value: @Nothing@--actionTooltip::ActionClassself=>Attrself(MaybeString)actionTooltip=newAttrFromMaybeStringProperty"tooltip"-- | The stock icon displayed in widgets representing this action.---- Default value: @Nothing@--actionStockId::ActionClassself=>Attrself(MaybeString)actionStockId=newAttrFromMaybeStringProperty"stock_id"-- | Whether the toolbar item is visible when the toolbar is in a horizontal-- orientation.---- Default value: @True@--actionVisibleHorizontal::ActionClassself=>AttrselfBoolactionVisibleHorizontal=newAttrFromBoolProperty"visible-horizontal"-- | When @True@, toolitem proxies for this action are represented in the-- toolbar overflow menu.---- Default value: @True@---- * Available since Gtk+ version 2.6--actionVisibleOverflown::ActionClassself=>AttrselfBoolactionVisibleOverflown=newAttrFromBoolProperty"visible-overflown"-- | Whether the toolbar item is visible when the toolbar is in a vertical-- orientation.---- Default value: @True@--actionVisibleVertical::ActionClassself=>AttrselfBoolactionVisibleVertical=newAttrFromBoolProperty"visible-vertical"-- | Whether the action is considered important. When @True@, toolitem proxies-- for this action show text in-- 'Graphics.UI.Gtk.MenuComboToolbar.Toolbar.ToolbarBothHoriz' mode.---- Default value: @False@--actionIsImportant::ActionClassself=>AttrselfBoolactionIsImportant=newAttrFromBoolProperty"is-important"-- | When @True@, empty menu proxies for this action are hidden.---- Default value: @True@--actionHideIfEmpty::ActionClassself=>AttrselfBoolactionHideIfEmpty=newAttrFromBoolProperty"hide-if-empty"-- | Whether the action is enabled.---- Default value: @True@---- * Available since Gtk+ version 2.6--actionSensitive::ActionClassself=>AttrselfBoolactionSensitive=newAttractionGetSensitiveactionSetSensitive-- | Whether the action is visible.---- Default value: @True@---- * Available since Gtk+ version 2.6--actionVisible::ActionClassself=>AttrselfBoolactionVisible=newAttractionGetVisibleactionSetVisible-- | \'accelPath\' property. See 'actionGetAccelPath' and 'actionSetAccelPath'---- * Available since Gtk+ version 2.6--actionAccelPath::ActionClassself=>ReadWriteAttrself(MaybeString)StringactionAccelPath=newAttractionGetAccelPathactionSetAccelPath-- | If 'True', the action's menu item proxies will ignore the 'menuImages' setting and always show-- their image, if available.---- Use this property if the menu item would be useless or hard to use without their image.---- Default value: 'False'---- Since 2.20actionAlwaysShowImage::ActionClassself=>AttrselfBoolactionAlwaysShowImage=newAttrFromBoolProperty"always-show-image"---------------------- Signals-- %hash c:4608 d:49a3-- | The \"activate\" signal is emitted when the action is activated.--actionActivated::ActionClassself=>Signalself(IO())actionActivated=Signal(connect_NONE__NONE"activate")---------------------- Deprecated Signals-- | The \"activate\" signal is emitted when the action is activated.--onActionActivate,afterActionActivate::ActionClassself=>self->IO()->IO(ConnectIdself)onActionActivate=connect_NONE__NONE"activate"FalseafterActionActivate=connect_NONE__NONE"activate"Trueforeignimportccallsafe"gtk_action_new"gtk_action_new::((PtrCChar)->((PtrCChar)->((PtrCChar)->((PtrCChar)->(IO(PtrAction))))))foreignimportccallsafe"gtk_action_get_name"gtk_action_get_name::((PtrAction)->(IO(PtrCChar)))foreignimportccallsafe"gtk_action_is_sensitive"gtk_action_is_sensitive::((PtrAction)->(IOCInt))foreignimportccallsafe"gtk_action_get_sensitive"gtk_action_get_sensitive::((PtrAction)->(IOCInt))foreignimportccallsafe"gtk_action_set_sensitive"gtk_action_set_sensitive::((PtrAction)->(CInt->(IO())))foreignimportccallsafe"gtk_action_is_visible"gtk_action_is_visible::((PtrAction)->(IOCInt))foreignimportccallsafe"gtk_action_get_visible"gtk_action_get_visible::((PtrAction)->(IOCInt))foreignimportccallsafe"gtk_action_set_visible"gtk_action_set_visible::((PtrAction)->(CInt->(IO())))foreignimportccallsafe"gtk_action_activate"gtk_action_activate::((PtrAction)->(IO()))foreignimportccallsafe"gtk_action_create_menu_item"gtk_action_create_menu_item::((PtrAction)->(IO(PtrWidget)))foreignimportccallsafe"gtk_action_create_tool_item"gtk_action_create_tool_item::((PtrAction)->(IO(PtrWidget)))foreignimportccallsafe"gtk_action_connect_proxy"gtk_action_connect_proxy::((PtrAction)->((PtrWidget)->(IO())))foreignimportccallsafe"gtk_action_disconnect_proxy"gtk_action_disconnect_proxy::((PtrAction)->((PtrWidget)->(IO())))foreignimportccallsafe"gtk_action_get_proxies"gtk_action_get_proxies::((PtrAction)->(IO(Ptr())))foreignimportccallsafe"gtk_action_connect_accelerator"gtk_action_connect_accelerator::((PtrAction)->(IO()))foreignimportccallsafe"gtk_action_disconnect_accelerator"gtk_action_disconnect_accelerator::((PtrAction)->(IO()))foreignimportccallsafe"gtk_action_get_accel_path"gtk_action_get_accel_path::((PtrAction)->(IO(PtrCChar)))foreignimportccallsafe"gtk_action_set_accel_path"gtk_action_set_accel_path::((PtrAction)->((PtrCChar)->(IO())))foreignimportccallsafe"gtk_action_set_accel_group"gtk_action_set_accel_group::((PtrAction)->((PtrAccelGroup)->(IO())))