From: Andy S. <And...@co...> - 2010-03-26 20:07:46
|
Fri Mar 26 16:06:17 EDT 2010 Andy Stewart <laz...@gm...> * Update all `ModelView` modules to Gtk+ 2.18.3 Ignore-this: 6bf56ab0074d24542c2d825ee3c0f074 hunk ./ApiUpdateTodoList.txt 31 -*** TODO CellEditable.chs -*** TODO CellRendererAccel.chs -*** TODO CellRendererSpin.chs +*** DONE CellEditable.chs +*** DONE CellRendererAccel.chs +*** DONE CellRendererSpin.chs hunk ./ApiUpdateTodoList.txt 283 + hunk ./ApiUpdateTodoList.txt 285 -*** TODO CellLayout.chs.pp -*** TODO CellRendererCombo.chs.pp -*** TODO CellRendererProgress.chs.pp -*** TODO TreeSortable.chs.pp +*** DONE CellLayout.chs.pp +*** TODO CellRenderer.chs.pp +*** DONE CellRendererCombo.chs.pp +*** TODO CellRendererPixbuf.chs.pp +*** DONE CellRendererProgress.chs.pp +*** TODO CellRendererText.chs.pp +*** DONE CellRendererToggle.chs.pp +*** DONE CellView.chs.pp +*** DONE CustomStore.chs +*** TODO IconView.chs.pp +*** TODO ListStore.hs.pp +*** TODO ListStoreStatic.hs +*** DONE Sequence.hs.pp +*** DONE TreeDrag.chs +*** DONE TreeModel.chs.pp +*** DONE TreeModelFilter.chs.pp +*** DONE TreeModelSort.chs.pp +*** DONE TreeRowReference.chs.pp +*** DONE TreeSelection.chs.pp +*** DONE TreeSortable.chs.pp +*** TODO TreeStore.hs +*** TODO TreeStoreStatic.hs +*** TODO TreeView.chs.pp +*** DONE TreeViewColumn.chs.pp hunk ./ApiUpdateTodoList.txt 342 -** TODO Directory: gtk-modules/Graphics/UI/Gtk/TreeList -*** TODO CellRenderer.hs -*** TODO CellRendererPixbuf.chs -*** TODO CellRendererText.chs -*** TODO CellRendererToggle.chs -*** TODO CellView.chs.pp -*** TODO IconView.chs.pp -*** TODO ListStore.chs.pp -*** TODO TreeIter.chs.pp -*** TODO TreeModel.chs.pp -*** TODO TreeModelSort.chs.pp -*** TODO TreePath.chs.pp -*** TODO TreeRowReference.chs.pp -*** TODO TreeSelection.chs.pp -*** TODO TreeStore.chs.pp -*** TODO TreeView.chs.pp -*** TODO TreeViewColumn.chs.pp +** DEPRECATED Directory: gtk-modules/Graphics/UI/Gtk/TreeList +*** DEPRECATED CellRenderer.hs +*** DEPRECATED CellRendererPixbuf.chs +*** DEPRECATED CellRendererText.chs +*** DEPRECATED CellRendererToggle.chs +*** DEPRECATED CellView.chs.pp +*** DEPRECATED IconView.chs.pp +*** DEPRECATED ListStore.chs.pp +*** DEPRECATED TreeIter.chs.pp +*** DEPRECATED TreeModel.chs.pp +*** DEPRECATED TreeModelSort.chs.pp +*** DEPRECATED TreePath.chs.pp +*** DEPRECATED TreeRowReference.chs.pp +*** DEPRECATED TreeSelection.chs.pp +*** DEPRECATED TreeStore.chs.pp +*** DEPRECATED TreeView.chs.pp +*** DEPRECATED TreeViewColumn.chs.pp hunk ./Makefile.am 757 + gtk/Graphics/UI/Gtk/ModelView/CellRendererAccel.chs.pp \ + gtk/Graphics/UI/Gtk/ModelView/CellRendererSpin.chs.pp \ hunk ./Makefile.am 760 + gtk/Graphics/UI/Gtk/ModelView/CellEditable.chs.pp \ hunk ./gtk/Graphics/UI/Gtk.hs.pp 116 + module Graphics.UI.Gtk.ModelView.CellRendererAccel, + module Graphics.UI.Gtk.ModelView.CellRendererSpin, hunk ./gtk/Graphics/UI/Gtk.hs.pp 119 + module Graphics.UI.Gtk.ModelView.CellEditable, hunk ./gtk/Graphics/UI/Gtk.hs.pp 331 +import Graphics.UI.Gtk.ModelView.CellRendererAccel +import Graphics.UI.Gtk.ModelView.CellRendererSpin hunk ./gtk/Graphics/UI/Gtk.hs.pp 334 +import Graphics.UI.Gtk.ModelView.CellEditable addfile ./gtk/Graphics/UI/Gtk/ModelView/CellEditable.chs.pp hunk ./gtk/Graphics/UI/Gtk/ModelView/CellEditable.chs.pp 1 +-- -*-haskell-*- +-- GIMP Toolkit (GTK) Interface CellEditable +-- +-- Author : Andy Stewart +-- +-- Created: 26 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) +-- +-- Interface for widgets which can are used for editing cells +-- +module Graphics.UI.Gtk.ModelView.CellEditable ( + +-- * Detail +-- +-- | The 'CellEditable' interface must be implemented for widgets to be usable +-- when editing the contents of a 'TreeView' cell. + +-- * Class Hierarchy +-- +-- | +-- @ +-- | 'GInterface' +-- | +----CellEditable +-- @ + +-- * Types + CellEditable, + CellEditableClass, + castToCellEditable, + toCellEditable, + +-- * Methods + -- cellEditableStartEditing, + cellEditableEditingDone, + cellEditableRemoveWidget, + +-- * Signals + editingDone, + removeWidget, + ) where + +import Control.Monad (liftM) + +import System.Glib.FFI +import System.Glib.Attributes +import System.Glib.Properties +{#import Graphics.UI.Gtk.Types#} +{#import Graphics.UI.Gtk.Signals#} + +{# context lib="gtk" prefix="gtk" #} + +-------------------- +-- Methods + +-- | Begins editing on a @cellEditable@. @event@ is the {GdkEvent, FIXME: +-- unknown type\/value} that began the editing process. It may be {@NULL@, +-- FIXME: this should probably be converted to a Maybe data type}, in the +-- instance that editing was initiated through programatic means. +-- +-- cellEditableStartEditing :: CellEditableClass self => self +-- -> {-GdkEvent*-} -- ^ @event@ - A {GdkEvent, FIXME: unknown type\/value}, or +-- -- {@NULL@, FIXME: this should probably be converted to a +-- -- Maybe data type} +-- -> IO () +-- cellEditableStartEditing self event = +-- {# call gtk_cell_editable_start_editing #} +-- (toCellEditable self) +-- {-event-} + +-- | Emits the {\"editing-done\", FIXME: unknown type\/value} signal. +-- +cellEditableEditingDone :: CellEditableClass self => self -> IO () +cellEditableEditingDone self = + {# call gtk_cell_editable_editing_done #} + (toCellEditable self) + +-- | Emits the {\"remove-widget\", FIXME: unknown type\/value} signal. +-- +cellEditableRemoveWidget :: CellEditableClass self => self -> IO () +cellEditableRemoveWidget self = + {# call gtk_cell_editable_remove_widget #} + (toCellEditable self) + +-------------------- +-- Signals + +-- | This signal is a sign for the cell renderer to update its value from the +-- @cellEditable@. +-- +-- Implementations of 'CellEditable' are responsible for emitting this +-- signal when they are done editing, e.g. 'Entry' is emitting it when the user +-- presses Enter. +-- +-- 'cellEditableEditingDone' is a convenience method for emitting +-- ::editing-done. +-- +editingDone :: CellEditableClass self => Signal self (IO ()) +editingDone = Signal (connect_NONE__NONE "editing-done") + +-- | This signal is meant to indicate that the cell is finished editing, and +-- the widget may now be destroyed. +-- +-- Implementations of 'CellEditable' are responsible for emitting this +-- signal when they are done editing. It must be emitted after the +-- {\"editing-done\", FIXME: unknown type\/value} signal, to give the cell +-- renderer a chance to update the cell's value before the widget is removed. +-- +-- 'cellEditableRemoveWidget' is a convenience method for emitting +-- ::remove-widget. +-- +removeWidget :: CellEditableClass self => Signal self (IO ()) +removeWidget = Signal (connect_NONE__NONE "remove-widget") hunk ./gtk/Graphics/UI/Gtk/ModelView/CellLayout.chs.pp 8 --- Copyright (C) 2006 Axel Simon +-- Copyright (C) 2006-2009 Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/CellLayout.chs.pp 33 + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellLayout.chs.pp 40 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 27 +-- The following functoins don't bind, use corresponding attributes instead +-- gtk_cell_renderer_get_visible +-- gtk_cell_renderer_set_visible +-- gtk_cell_renderer_get_sensitive +-- gtk_cell_renderer_set_sensitive +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 73 - CellRendererMode, + +-- * Enums + CellRendererState(..), + CellRendererMode(..), hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 84 + cellRendererGetSize, + cellRendererRender, + -- cellRendererActivate, + -- cellRendererStartEditing, +#if GTK_CHECK_VERSION(2,18,0) + cellRendererGetAlignment, + cellRendererSetAlignment, + cellRendererGetPadding, + cellRendererSetPadding, +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 108 + cellBackgroundGdk, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 111 + cellRendererEditing, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 134 +import Control.Monad (liftM) + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 137 -import System.Glib.Attributes ( Attr, WriteAttr ) +import System.Glib.Attributes ( Attr, WriteAttr, ReadAttr ) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 139 +import System.Glib.UTFString +import Graphics.UI.Gtk.General.Structs (Rectangle) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 148 -{# enum CellRendererMode {underscoreToCase} deriving (Eq) #} - +{# enum CellRendererState {underscoreToCase} deriving (Bounded, Eq, Show) #} +{# enum CellRendererMode {underscoreToCase} deriving (Bounded,Eq,Show) #} hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 197 +-- | Obtains the width and height needed to render the cell. Used by view widgets to determine the +-- appropriate size for the @cellArea@ passed to 'cellRendererRender'. [_$_] +-- [_$_] +-- Please note that the values set in width and height, as well as those in @xOffset@ and @yOffset@ are +-- inclusive of the xpad and ypad properties. +cellRendererGetSize :: (CellRendererClass self, WidgetClass widget) => self -> widget + -> Rectangle + -> IO (Int, Int, Int, Int) +cellRendererGetSize self widget area = [_$_] + with area $ \ areaPtr -> [_$_] + alloca $ \xPtr -> + alloca $ \yPtr -> + alloca $ \wPtr -> + alloca $ \hPtr -> do + {#call cell_renderer_get_size#} + (toCellRenderer self) + (toWidget widget) + (castPtr areaPtr) + (castPtr xPtr) + (castPtr yPtr) + (castPtr wPtr) + (castPtr hPtr) + x <- peek xPtr + y <- peek yPtr + w <- peek wPtr + h <- peek hPtr + return (x, y, w, h) + +-- | Invokes the virtual render function of the 'CellRenderer'. The three passed-in rectangles are areas +-- of window. Most renderers will draw within @cellArea@; the xalign, yalign, xpad, and ypad fields of +-- the 'CellRenderer' should be honored with respect to @cellArea@. @backgroundArea@ includes the blank +-- space around the cell, and also the area containing the tree expander; so the @backgroundArea@ +-- rectangles for all cells tile to cover the entire window. @exposeArea@ is a clip rectangle. +cellRendererRender :: (CellRendererClass self, WidgetClass widget) => + self + -> DrawWindow + -> widget + -> Rectangle + -> Rectangle + -> Rectangle + -> CellRendererState + -> IO () +cellRendererRender self win widget background cell expose flags = [_$_] + with background $ \backgroundPtr -> + with cell $ \cellPtr -> + with expose $ \exposePtr -> + {#call cell_renderer_render#} + (toCellRenderer self) + win + (toWidget widget) + (castPtr backgroundPtr) + (castPtr cellPtr) + (castPtr exposePtr) + ((fromIntegral . fromEnum) flags) + +-- | Passes an activate event to the cell renderer for possible processing. Some cell renderers may use +-- events; for example, 'CellRendererToggle' toggles when it gets a mouse click. +-- cellRendererActivate :: (CellRendererClass self, WidgetClass widget) => [_$_] +-- cell +-- -> Event +-- -> widget +-- -> String +-- -> Rectangle +-- -> Rectangle +-- -> CellRendererState +-- -> IO Bool +-- cellRendererActivate self event widget path background cell flags = +-- liftM toBool $ +-- withUTFString path $ \ pathPtr -> [_$_] +-- with background $ \ backgroundPtr -> [_$_] +-- with cell $ \ cellPtr -> [_$_] +-- {#call cell_renderer_activate#} +-- (toCellRenderer self) +-- event +-- (toWidget widget) +-- pathPtr +-- backgroundPtr +-- cellPtr +-- ((fromIntegral . fromEnum) flags) + +-- | Passes an activate event to the cell renderer for possible processing. +-- cellRendererStartEditing + +#if GTK_CHECK_VERSION(2,18,0) +-- | Fills in @xalign@ and @yalign@ with the appropriate values of @cell@. +-- +-- * Available since Gtk+ version 2.18 +-- +cellRendererGetAlignment :: CellRendererClass self => self + -> IO (Float, Float) -- ^ @(xalign, yalign)@ {FIXME: merge return value docs} + -- @xalign@ - location to fill in with the x alignment of + -- the cell, or {@NULL@, FIXME: this should probably be + -- converted to a Maybe data type}@yalign@ - location to + -- fill in with the y alignment of the cell, or {@NULL@, + -- FIXME: this should probably be converted to a Maybe + -- data type} +cellRendererGetAlignment self = + alloca $ \xalignPtr -> + alloca $ \yalignPtr -> do + {# call gtk_cell_renderer_get_alignment #} + (toCellRenderer self) + xalignPtr + yalignPtr + xalign <- peek xalignPtr + yalign <- peek yalignPtr + return (realToFrac xalign, realToFrac yalign) + +-- | Sets the renderer's alignment within its available space. +-- +-- * Available since Gtk+ version 2.18 +-- +cellRendererSetAlignment :: CellRendererClass self => self + -> Float -- ^ @xalign@ - the x alignment of the cell renderer + -> Float -- ^ @yalign@ - the y alignment of the cell renderer + -> IO () +cellRendererSetAlignment self xalign yalign = + {# call gtk_cell_renderer_set_alignment #} + (toCellRenderer self) + (realToFrac xalign) + (realToFrac yalign) + +-- | Fills in @xpad@ and @ypad@ with the appropriate values of @cell@. +-- +-- * Available since Gtk+ version 2.18 +-- +cellRendererGetPadding :: CellRendererClass self => self + -> IO (Int, Int) -- ^ @(xpad, ypad)@ {FIXME: merge return value docs} @xpad@ + -- - location to fill in with the x padding of the cell, or + -- {@NULL@, FIXME: this should probably be converted to a + -- Maybe data type}@ypad@ - location to fill in with the y + -- padding of the cell, or {@NULL@, FIXME: this should + -- probably be converted to a Maybe data type} +cellRendererGetPadding self = + alloca $ \xpadPtr -> + alloca $ \ypadPtr -> do + {# call gtk_cell_renderer_get_padding #} + (toCellRenderer self) + xpadPtr + ypadPtr + xpad <- peek xpadPtr + ypad <- peek ypadPtr + return (fromIntegral xpad, fromIntegral ypad) + +-- | Sets the renderer's padding. +-- +-- * Available since Gtk+ version 2.18 +-- +cellRendererSetPadding :: CellRendererClass self => self + -> Int -- ^ @xpad@ - the x padding of the cell renderer + -> Int -- ^ @ypad@ - the y padding of the cell renderer + -> IO () +cellRendererSetPadding self xpad ypad = + {# call gtk_cell_renderer_set_padding #} + (toCellRenderer self) + (fromIntegral xpad) + (fromIntegral ypad) +#endif + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 451 +-- | Cell background color as a 'Color'. +cellBackgroundGdk :: CellRendererClass self => Attr self Color +cellBackgroundGdk = newAttrFromBoxedStorableProperty "cell-background-gdk" + {# call pure unsafe gdk_color_get_type #} + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp 471 +-- | Whether the cell renderer is currently in editing mode. +-- [_$_] +-- Default value: 'False' +cellRendererEditing :: CellRendererClass self => ReadAttr self Bool +cellRendererEditing = readAttrFromBoolProperty "editing" addfile ./gtk/Graphics/UI/Gtk/ModelView/CellRendererAccel.chs.pp hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererAccel.chs.pp 1 +-- -*-haskell-*- +-- GIMP Toolkit (GTK) Widget CellRendererAccel +-- +-- Author : Andy Stewart +-- +-- Created: 25 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) +-- +-- Renders a keyboard accelerator in a cell +-- +-- * Module available since Gtk+ version 2.10 +-- +module Graphics.UI.Gtk.ModelView.CellRendererAccel ( + +-- * Detail +-- +-- | 'CellRendererAccel' displays a keyboard accelerator (i.e. a key +-- combination like \<Control>-a). If the cell renderer is editable, the +-- accelerator can be changed by simply typing the new combination. +-- +-- The 'CellRendererAccel' cell renderer was added in Gtk+ 2.10. + +-- * Class Hierarchy +-- +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'CellRenderer' +-- | +----'CellRendererText' +-- | +----CellRendererAccel +-- @ + +#if GTK_CHECK_VERSION(2,10,0) +-- * Types + CellRendererAccel, + CellRendererAccelClass, + castToCellRendererAccel, + toCellRendererAccel, + +-- * Enums + CellRendererAccelMode(..), + +-- * Constructors + cellRendererAccelNew, + +-- * Attributes + cellRendererAccelAccelKey, + cellRendererAccelAccelMods, + cellRendererAccelKeycode, + cellRendererAccelAccelMode, + +-- * Signals + accelEdited, + accelCleared, +#endif + ) where + +import Control.Monad (liftM) + +import System.Glib.FFI +import System.Glib.Attributes +import System.Glib.Properties +import Graphics.UI.Gtk.Gdk.Enums (Modifier) +import Graphics.UI.Gtk.Abstract.Object (makeNewObject) +{#import Graphics.UI.Gtk.Signals#} +{#import Graphics.UI.Gtk.Types#} + +{# context lib="gtk" prefix="gtk" #} + +#if GTK_CHECK_VERSION(2,10,0) +-------------------- +-- Enums +{#enum CellRendererAccelMode {underscoreToCase} deriving (Bounded,Eq,Show)#} + +-------------------- +-- Constructors + +-- | Creates a new 'CellRendererAccel'. +-- +cellRendererAccelNew :: IO CellRendererAccel +cellRendererAccelNew = + makeNewObject mkCellRendererAccel $ liftM castPtr $ + {# call gtk_cell_renderer_accel_new #} + +-------------------- +-- Attributes + +-- | +-- +cellRendererAccelAccelKey :: CellRendererAccelClass self => Attr self Int +cellRendererAccelAccelKey = newAttrFromUIntProperty "accel-key" + +-- | +-- +cellRendererAccelAccelMods :: CellRendererAccelClass self => Attr self [Modifier] +cellRendererAccelAccelMods = newAttrFromFlagsProperty "accel-mods" + {# call pure unsafe gdk_modifier_type_get_type #} + +-- | +-- +cellRendererAccelKeycode :: CellRendererAccelClass self => Attr self Int +cellRendererAccelKeycode = newAttrFromUIntProperty "keycode" + +-- | +-- +cellRendererAccelAccelMode :: CellRendererAccelClass self => Attr self CellRendererAccelMode +cellRendererAccelAccelMode = newAttrFromEnumProperty "accel-mode" + {# call pure unsafe gtk_cell_renderer_accel_mode_get_type #} + +-------------------- +-- Signals + +-- | Gets emitted when the user has selected a new accelerator. +-- +accelEdited :: CellRendererAccelClass self => Signal self (String -> Int -> Modifier -> Int -> IO ()) +accelEdited = Signal (connect_STRING_INT_ENUM_INT__NONE "accel-edited") + +-- | Gets emitted when the user has removed the accelerator. +-- +accelCleared :: CellRendererAccelClass self => Signal self (String -> IO ()) +accelCleared = Signal (connect_STRING__NONE "accel-cleared") +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 30 + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 48 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 69 - cellComboHasEntry, - cellComboTextModel + cellRendererCombHasEntry, + cellRendererCombTextModel, + cellRendererComboModel, + +-- * Signal +#if GTK_CHECK_VERSION(2,14,0) + cellRendererComboChanged, +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 83 -import System.Glib.Attributes (Attr, WriteAttr, writeAttr) +import System.Glib.Attributes (Attr, WriteAttr, ReadWriteAttr, writeAttr) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 88 +{#import Graphics.UI.Gtk.Signals#} hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 115 -cellComboHasEntry :: CellRendererComboClass self => Attr self Bool -cellComboHasEntry = newAttrFromBoolProperty "has-entry" +cellRendererCombHasEntry :: CellRendererComboClass self => Attr self Bool +cellRendererCombHasEntry = newAttrFromBoolProperty "has-entry" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 125 -cellComboTextModel :: ( TreeModelClass (model row), +cellRendererCombTextModel :: ( TreeModelClass (model row), hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 129 -cellComboTextModel = writeAttr setter +cellRendererCombTextModel = writeAttr setter hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp 137 +-- | Holds a tree model containing the possible values for the combo box. Use the @textColumn@ property to +-- specify the column holding the values. +-- [_$_] +-- Since 2.6 +cellRendererComboModel :: (CellRendererComboClass self, TreeModelClass treeModel) => ReadWriteAttr self TreeModel treeModel +cellRendererComboModel = newAttrFromObjectProperty "model" + {# call pure unsafe gtk_tree_model_get_type #} + +#endif + +----------------- +-- Signal + +#if GTK_CHECK_VERSION(2,14,0) +-- | This signal is emitted each time after the user selected an item in the +-- combo box, either by using the mouse or the arrow keys. Contrary to +-- 'ComboBox', 'CellRendererCombo'::changed is not emitted for changes made to +-- a selected item in the entry. The argument @newIter@ corresponds to the +-- newly selected item in the combo box and it is relative to the 'TreeModel' +-- set via the model property on 'CellRendererCombo'. +-- +-- Note that as soon as you change the model displayed in the tree view, the +-- tree view will immediately cease the editing operating. This means that you +-- most probably want to refrain from changing the model until the combo cell +-- renderer emits the edited or editing_canceled signal. +-- +-- * Available since Gtk+ version 2.14 +-- +cellRendererComboChanged :: CellRendererComboClass self => Signal self (String -> TreeIter -> IO ()) +cellRendererComboChanged = Signal (connect_STRING_BOXED__NONE "changed" peekTreeIter) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererPixbuf.chs.pp 8 --- Copyright (C) 1999-2005 Axel Simon +-- Copyright (C) 1999-2009 Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererPixbuf.chs.pp 44 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 30 + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 38 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 58 - cellProgressValue, - cellProgressText, + cellRendererProgressValue, + cellRendererProgressText, + cellRendererProgressPulse, + cellRendererProgressTextXAlign, + cellRendererProgressTextYAlign, + cellRendererProgressOrientation, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 72 +import Graphics.UI.Gtk.General.Enums (ProgressBarOrientation(..)) hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 75 +{#import Graphics.UI.Gtk.Signals#} hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 94 --- | The \"value\" property determines the percentage to which the progress --- bar will be \"filled in\". --- --- Allowed values: @[0,100]@ --- --- Default value: @0@ --- -cellProgressValue :: CellRendererProgressClass self => Attr self Int -cellProgressValue = newAttrFromIntProperty "value" +-- | The "value" property determines the percentage to which the progress bar will be "filled in". +-- [_$_] +-- Allowed values: [0,100] +-- [_$_] +-- Default value: 0 +-- [_$_] +-- Since 2.6 +cellRendererProgressValue :: CellRendererProgressClass self => Attr self Int +cellRendererProgressValue = newAttrFromIntProperty "value" hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 104 --- | The 'cellProgressText' attribute determines the label which will be drawn --- over the progress bar. Setting this property to @Nothing@ causes the --- default label to be displayed. Setting this property to an empty string +-- | The "text" property determines the label which will be drawn over the progress bar. Setting this +-- property to 'Nothing' causes the default label to be displayed. Setting this property to an empty string hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp 107 --- --- Default value: @Nothing@ --- -cellProgressText :: CellRendererProgressClass self => Attr self (Maybe String) -cellProgressText = newAttrFromMaybeStringProperty "text" +-- [_$_] +-- Default value: 'Nothing' +-- [_$_] +-- Since 2.6 +cellRendererProgressText :: CellRendererProgressClass self => Attr self String +cellRendererProgressText = newAttrFromStringProperty "text" + +-- | Setting this to a non-negative value causes the cell renderer to enter "activity mode", where a +-- block bounces back and forth to indicate that some progress is made, without specifying exactly how +-- much. +-- [_$_] +-- Each increment of the property causes the block to move by a little bit. +-- [_$_] +-- To indicate that the activity has not started yet, set the property to zero. To indicate completion, +-- set the property to 'GMaxint'. +-- [_$_] +-- Allowed values: >= 'GMaxulong' +-- [_$_] +-- Default value: -1 +-- [_$_] +-- Since 2.12 +cellRendererProgressPulse :: CellRendererProgressClass self => Attr self Int +cellRendererProgressPulse = newAttrFromIntProperty "pulse" + +-- | The 'textXalign' property controls the horizontal alignment of the text in the progress bar. Valid +-- values range from 0 (left) to 1 (right). Reserved for RTL layouts. +-- [_$_] +-- Allowed values: [0,1] +-- [_$_] +-- Default value: 0.5 +-- [_$_] +-- Since 2.12 +cellRendererProgressTextXAlign :: CellRendererProgressClass self => Attr self Float +cellRendererProgressTextXAlign = newAttrFromFloatProperty "text-xalign" + +-- | The 'textYalign' property controls the vertical alignment of the text in the progress bar. Valid +-- values range from 0 (top) to 1 (bottom). +-- [_$_] +-- Allowed values: [0,1] +-- [_$_] +-- Default value: 0.5 +-- [_$_] +-- Since 2.12 +cellRendererProgressTextYAlign :: CellRendererProgressClass self => Attr self Float +cellRendererProgressTextYAlign = newAttrFromFloatProperty "text-yalign" + +-- | The "orientation" property controls the direction and growth direction of the progress bar +-- (left-to-right, right-to-left, top-to-bottom or bottom-to-top). +-- [_$_] +-- Default value: ''ProgressLeftToRight'' +-- [_$_] +-- Since 2.12 +cellRendererProgressOrientation :: CellRendererProgressClass self => Attr self ProgressBarOrientation +cellRendererProgressOrientation = newAttrFromEnumProperty "orientation" + {# call pure unsafe gtk_progress_bar_orientation_get_type #} + addfile ./gtk/Graphics/UI/Gtk/ModelView/CellRendererSpin.chs.pp hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererSpin.chs.pp 1 +-- -*-haskell-*- +-- GIMP Toolkit (GTK) Widget CellRendererSpin +-- +-- Author : Andy Stewart +-- +-- Created: 25 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) +-- +-- Renders a spin button in a cell +-- +-- * Module available since Gtk+ version 2.10 +-- +module Graphics.UI.Gtk.ModelView.CellRendererSpin ( + +-- * Detail +-- +-- | 'CellRendererSpin' renders text in a cell like 'CellRendererText' from +-- which it is derived. But while 'CellRendererText' offers a simple entry to +-- edit the text, 'CellRendererSpin' offers a 'SpinButton' widget. Of course, +-- that means that the text has to be parseable as a floating point number. +-- +-- The range of the spinbutton is taken from the adjustment property of the +-- cell renderer, which can be set explicitly or mapped to a column in the tree +-- model, like all properties of cell renders. 'CellRendererSpin' also has +-- properties for the climb rate and the number of digits to display. Other +-- 'SpinButton' properties can be set in a handler for the start-editing +-- signal. +-- +-- The 'CellRendererSpin' cell renderer was added in Gtk+ 2.10. + +-- * Class Hierarchy +-- +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'CellRenderer' +-- | +----'CellRendererText' +-- | +----CellRendererSpin +-- @ + +#if GTK_CHECK_VERSION(2,10,0) +-- * Types + CellRendererSpin, + CellRendererSpinClass, + castToCellRendererSpin, + toCellRendererSpin, + +-- * Constructors + cellRendererSpinNew, + +-- * Attributes + cellRendererSpinAdjustment, + cellRendererSpinClimbRate, + cellRendererSpinDigits, +#endif + ) where + +import Control.Monad (liftM) + +import System.Glib.FFI +import System.Glib.Attributes +import System.Glib.Properties +import Graphics.UI.Gtk.Abstract.Object (makeNewObject) +{#import Graphics.UI.Gtk.Types#} + +{# context lib="gtk" prefix="gtk" #} + +#if GTK_CHECK_VERSION(2,10,0) +-------------------- +-- Constructors + +-- | Creates a new 'CellRendererSpin'. +-- +cellRendererSpinNew :: IO CellRendererSpin +cellRendererSpinNew = + makeNewObject mkCellRendererSpin $ liftM castPtr + {# call gtk_cell_renderer_spin_new #} + +-------------------- +-- Attributes + +-- | +-- +cellRendererSpinAdjustment :: CellRendererSpinClass self => Attr self Adjustment +cellRendererSpinAdjustment = newAttrFromObjectProperty "adjustment" + {# call pure unsafe gtk_adjustment_get_type #} + +-- | +-- +cellRendererSpinClimbRate :: CellRendererSpinClass self => Attr self Double +cellRendererSpinClimbRate = newAttrFromDoubleProperty "climb-rate" + +-- | +-- +cellRendererSpinDigits :: CellRendererSpinClass self => Attr self Int +cellRendererSpinDigits = newAttrFromUIntProperty "digits" +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 8 --- Copyright (C) 1999-2006 Axel Simon +-- Copyright (C) 1999-2009 Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 38 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 61 + cellTextAlignSet, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 64 - --cellTextAttributes, + -- cellTextAttributes, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 131 +-- {#import Graphics.UI.Gtk.Pango.Types#} hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp 286 +-- | A list of style attributes to apply to the text of the renderer. +-- cellTextAttributes :: CellRendererClass cr => Attr cr PangoAttrList +-- cellTextAttributes = newAttrFromObjectProperty "attributes" + +-- | Whether this tag affects the alignment mode. +-- [_$_] +-- Default value: 'False' +cellTextAlignSet :: CellRendererTextClass self => Attr self Bool +cellTextAlignSet = newAttrFromBoolProperty "align-set" + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 8 --- Copyright (C) 1999-2005 Axel Simon +-- Copyright (C) 1999-2009 Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 27 +-- The following functions don't bind, use corresponding attributes instead: +-- gtk_cell_renderer_toggle_get_activatable +-- gtk_cell_renderer_toggle_set_activatable +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp 39 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 8 --- Copyright (C) 2005 Duncan Coutts +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 29 +-- The following functions don't bind, use corresponding attributes instead: +-- gtk_cell_view_set_displayed_row +-- gtk_cell_view_get_displayed_row +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 41 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 65 +#if GTK_CHECK_VERSION(2,16,0) + cellViewGetModel, +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 73 - cellViewBackground + cellViewBackground, + cellViewBackgroundColor, + cellViewBackgroundSet, + cellViewModel, hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 84 -import System.Glib.Properties (writeAttrFromStringProperty) +import System.Glib.Properties hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 159 +#if GTK_CHECK_VERSION(2,16,0) +cellViewGetModel :: CellViewClass self => self + -> IO TreeModel -- ^ returns a 'TreeModel' used or {@NULL@, FIXME: this + -- should probably be converted to a Maybe data type} +cellViewGetModel self = + makeNewGObject mkTreeModel $ + {# call gtk_cell_view_get_model #} + (toCellView self) +#endif + hunk ./gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp 214 +-- | Background color as a 'Color'. +cellViewBackgroundColor :: CellViewClass self => Attr self Color +cellViewBackgroundColor = newAttrFromBoxedStorableProperty "background-gdk" + {# call pure unsafe gdk_color_get_type #} + +-- | Whether this tag affects the background color. +-- [_$_] +-- Default value: 'False' +cellViewBackgroundSet :: CellViewClass self => Attr self Bool +cellViewBackgroundSet = newAttrFromBoolProperty "background-set" + +-- | The model for cell view +-- [_$_] +-- since 2.10 +cellViewModel :: (CellViewClass self, TreeModelClass treeModel) => ReadWriteAttr self TreeModel treeModel +cellViewModel = newAttrFromObjectProperty "model" + {# call pure unsafe gtk_tree_model_get_type #} + hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 8 --- Copyright (C) 2005-2007 Duncan Coutts, Axel Simon +-- Copyright (C) 2005-2009 Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 29 +-- The following functions don't bind, use corresponding attributes instead: +-- gtk_icon_view_set_tooltip_column +-- gtk_icon_view_get_tooltip_column +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 61 +-- * Enums + IconViewDropPosition(..), + hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 117 +#if GTK_CHECK_VERSION(2,12,0) + iconViewConvertWidgetToBinWindowCoords, + iconViewSetTooltipItem, + iconViewSetTooltipCell, + -- iconViewGetTooltipContext, +#endif + iconViewSetDragDestItem, + -- iconViewGetDragDestItem, + -- iconViewGetDestItemAtPos, + iconViewCreateDragIcon, hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 144 +#if GTK_CHECK_VERSION(2,18,0) + iconViewItemPadding, +#endif + iconViewTooltipColumn, hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 152 - selectionChanged + selectionChanged, + activateCursorItem, + iconViewMoveCursor, [_$_] + iconViewSelectAllSignal, [_$_] + selectCursorItem, + toggleCursorItem, + unselectAll, [_$_] hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 173 +import Graphics.UI.Gtk.General.Enums (DeleteType(..), MovementStep(..)) hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 192 +-------------------- +-- Enums +{#enum GtkIconViewDropPosition as IconViewDropPosition {underscoreToCase} deriving (Bounded,Eq,Show)#} + hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 856 +#if GTK_CHECK_VERSION(2,12,0) +-- | Converts widget coordinates to coordinates for the bin_window, as +-- expected by e.g. 'iconViewGetPathAtPos'. +-- +-- * Available since Gtk+ version 2.12 +-- +iconViewConvertWidgetToBinWindowCoords :: IconViewClass self => self + -> Int -- ^ @wx@ - X coordinate relative to the widget + -> Int -- ^ @wy@ - Y coordinate relative to the widget + -> IO (Int, Int) -- ^ @(bx, by)@ {FIXME: merge return value docs} @bx@ - + -- return location for bin_window X coordinate @by@ - return + -- location for bin_window Y coordinate +iconViewConvertWidgetToBinWindowCoords self wx wy = + alloca $ \bxPtr -> + alloca $ \byPtr -> do + {# call gtk_icon_view_convert_widget_to_bin_window_coords #} + (toIconView self) + (fromIntegral wx) + (fromIntegral wy) + bxPtr + byPtr + bx <- peek bxPtr + by <- peek byPtr + return (fromIntegral bx, fromIntegral by) +-- | Sets the tip area of @tooltip@ to be the area covered by the item at +-- @path@. See also 'iconViewSetTooltipColumn' for a simpler alternative. See +-- also 'tooltipSetTipArea'. +-- +-- * Available since Gtk+ version 2.12 +-- +iconViewSetTooltipItem :: (IconViewClass self, TooltipClass tooltip) => self + -> tooltip -- ^ @tooltip@ - a 'Tooltip' + -> TreePath -- ^ @path@ - a 'TreePath' + -> IO () +iconViewSetTooltipItem self tooltip path = + withTreePath path $ \path -> + {# call gtk_icon_view_set_tooltip_item #} + (toIconView self) + (toTooltip tooltip) + path + +-- | Sets the tip area of @tooltip@ to the area which @cell@ occupies in the +-- item pointed to by @path@. See also 'tooltipSetTipArea'. +-- +-- See also 'iconViewSetTooltipColumn' for a simpler alternative. +-- +-- * Available since Gtk+ version 2.12 +-- +iconViewSetTooltipCell :: (IconViewClass self, TooltipClass tooltip, CellRendererClass cell) => self + -> tooltip -- ^ @tooltip@ - a 'Tooltip' + -> TreePath -- ^ @path@ - a 'TreePath' + -> cell -- ^ @cell@ - a 'CellRenderer' or {@NULL@, FIXME: this should + -- probably be converted to a Maybe data type} + -> IO () +iconViewSetTooltipCell self tooltip path cell = + withTreePath path $ \path -> + {# call gtk_icon_view_set_tooltip_cell #} + (toIconView self) + (toTooltip tooltip) + path + (toCellRenderer cell) + +-- | This function is supposed to be used in a {\"query-tooltip\", FIXME: +-- unknown type\/value} signal handler for 'IconView'. The @x@, @y@ and +-- @keyboardTip@ values which are received in the signal handler, should be +-- passed to this function without modification. +-- +-- The return value indicates whether there is an icon view item at the +-- given coordinates (@True@) or not (@False@) for mouse tooltips. For keyboard +-- tooltips the item returned will be the cursor item. When @True@, then any of +-- @model@, @path@ and @iter@ which have been provided will be set to point to +-- that row and the corresponding model. @x@ and @y@ will always be converted +-- to be relative to @iconView@'s bin_window if @keyboardTooltip@ is @False@. +-- +-- * Available since Gtk+ version 2.12 +-- +-- iconViewGetTooltipContext :: (IconViewClass self, TreeModelClass model) => self +-- -> Bool -- ^ @keyboardTip@ - whether this is a keyboard +-- -- tooltip or not +-- -> model -- ^ @model@ - a pointer to receive a 'TreeModel' or +-- -- {@NULL@, FIXME: this should probably be converted to +-- -- a Maybe data type} +-- -> TreePath -- ^ @path@ - a pointer to receive a 'TreePath' or +-- -- {@NULL@, FIXME: this should probably be converted to +-- -- a Maybe data type} +-- -> TreeIter -- ^ @iter@ - a pointer to receive a 'TreeIter' or +-- -- {@NULL@, FIXME: this should probably be converted to +-- -- a Maybe data type} +-- -> IO (Bool, Int, Int) -- ^ @(_, x, y)@ {FIXME: merge return value docs} +-- -- returns whether or not the given tooltip context +-- -- points to a item @x@ - the x coordinate (relative to +-- -- widget coordinates) @y@ - the y coordinate (relative +-- -- to widget coordinates) +-- iconViewGetTooltipContext self keyboardTip model path iter = [_$_] +-- alloca $ \xPtr -> +-- alloca $ \yPtr -> +-- withTreePath path $ \pathPtr -> do +-- with iter $ \iterPtr -> do +-- success <- liftM toBool $ [_$_] +-- {# call gtk_icon_view_get_tooltip_context #} +-- (toIconView self) +-- xPtr +-- yPtr +-- (fromBool keyboardTip) +-- model +-- path +-- iterPtr +-- x <- peek xPtr +-- y <- peek yPtr +-- return (success, fromIntegral x, fromIntegral y) + +#endif + +-- | Sets the item that is highlighted for feedback. +-- +-- * Available since Gtk+ version 2.8 +-- +iconViewSetDragDestItem :: IconViewClass self => self + -> TreePath -- ^ @path@ - The path of the item to highlight, or + -- {@NULL@, FIXME: this should probably be converted + -- to a Maybe data type}. + -> IconViewDropPosition -- ^ @pos@ - Specifies where to drop, relative to the + -- item + -> IO () +iconViewSetDragDestItem self path pos = + withTreePath path $ \path -> + {# call gtk_icon_view_set_drag_dest_item #} + (toIconView self) + path + ((fromIntegral . fromEnum) pos) + +-- | Gets information about the item that is highlighted for feedback. +-- +-- * Available since Gtk+ version 2.8 +-- +-- iconViewGetDragDestItem :: IconViewClass self => self +-- -> TreePath -- ^ @path@ - Return location for the path of +-- -- the highlighted item, or {@NULL@, FIXME: +-- -- this should probably be converted to a +-- -- Maybe data type}. +-- -> IconViewDropPosition -- ^ @pos@ - Return location for the drop +-- -- position, or {@NULL@, FIXME: this should +-- -- probably be converted to a Maybe data type} +-- -> IO () +-- iconViewGetDragDestItem self path pos = +-- withTreePath path $ \pathPtr -> do +-- {# call gtk_icon_view_get_drag_dest_item #} +-- (toIconView self) +-- pathPtr +-- ((fromIntegral . fromEnum) pos) + +-- | Determines the destination item for a given position. +-- +-- * Available since Gtk+ version 2.8 +-- +-- iconViewGetDestItemAtPos :: IconViewClass self => self +-- -> Int -- ^ @dragX@ - the position to determine the +-- -- destination item for +-- -> Int -- ^ @dragY@ - the position to determine the +-- -- destination item for +-- -> TreePath -- ^ @path@ - Return location for the path of +-- -- the item, or {@NULL@, FIXME: this should +-- -- probably be converted to a Maybe data +-- -- type}. +-- -> IconViewDropPosition -- ^ @pos@ - Return location for the drop +-- -- position, or {@NULL@, FIXME: this should +-- -- probably be converted to a Maybe data type} +-- -> IO Bool -- ^ returns whether there is an item at the +-- -- given position. +-- iconViewGetDestItemAtPos self dragX dragY path pos = +-- liftM toBool $ +-- withTreePath path $ \path -> +-- {# call gtk_icon_view_get_dest_item_at_pos #} +-- (toIconView self) +-- (fromIntegral dragX) +-- (fromIntegral dragY) +-- path +-- ((fromIntegral . fromEnum) pos) + +-- | Creates a 'Pixmap' representation of the item at @path@. This image is +-- used for a drag icon. +-- +-- * Available since Gtk+ version 2.8 +-- +iconViewCreateDragIcon :: IconViewClass self => self + -> TreePath -- ^ @path@ - a 'TreePath' in @iconView@ + -> IO Pixmap -- ^ returns a newly-allocated pixmap of the drag icon. +iconViewCreateDragIcon self path = + makeNewGObject mkPixmap $ + withTreePath path $ \path -> + {# call gtk_icon_view_create_drag_icon #} + (toIconView self) + path + hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 1201 +#if GTK_CHECK_VERSION(2,18,0) +-- | The item-padding property specifies the padding around each of the icon view's item. +-- [_$_] +-- Allowed values: >= 0 +-- [_$_] +-- Default value: 6 +-- [_$_] +-- Since 2.18 +iconViewItemPadding :: IconViewClass self => Attr self Int +iconViewItemPadding = newAttrFromIntProperty "item-padding" +#endif + +-- | The column in the model containing the tooltip texts for the items. +-- [_$_] +-- Allowed values: >= 'GMaxulong' +-- [_$_] +-- Default value: -1 +iconViewTooltipColumn :: IconViewClass self => Attr self Int +iconViewTooltipColumn = newAttrFromIntProperty "tooltip-column" + hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 1242 +-- | A keybinding signal which gets emitted when the user activates the currently focused item. +-- [_$_] +-- Applications should not connect to it, but may emit it with 'signalEmitByName' if they need to +-- control activation programmatically. +-- [_$_] +-- The default bindings for this signal are Space, Return and Enter. +activateCursorItem :: IconViewClass self => Signal self (IO Bool) +activateCursorItem = Signal (connect_NONE__BOOL "activate-cursor-item") + [_$_] + +-- | The 'iconViewMoveCursor' signal is a keybinding signal which gets emitted when the user initiates a cursor +-- movement. +-- [_$_] +-- Applications should not connect to it, but may emit it with 'signalEmitByName' if they need to +-- control the cursor programmatically. +-- [_$_] +-- The default bindings for this signal include +-- [_$_] +-- [_\e2_][_\97_][_\8f_] Arrow keys which move by individual steps [_$_] +-- [_\e2_][_\97_][_\8f_] Home/End keys which move to the first/last item [_$_] +-- [_\e2_][_\97_][_\8f_] PageUp/PageDown which move by "pages" +-- [_$_] +-- All of these will extend the selection when combined with the Shift modifier. +iconViewMoveCursor :: IconViewClass self => Signal self (MovementStep -> Int -> IO Bool) +iconViewMoveCursor = Signal (connect_ENUM_INT__BOOL "move-cursor") + [_$_] +-- | A keybinding signal which gets emitted when the user selects all items. +-- [_$_] +-- Applications should not connect to it, but may emit it with 'signalEmitByName' if they need to +-- control selection programmatically. +-- [_$_] +-- The default binding for this signal is Ctrl-a. +iconViewSelectAllSignal :: IconViewClass self => Signal self (IO ()) +iconViewSelectAllSignal = Signal (connect_NONE__NONE "select-all") + +-- | A keybinding signal which gets emitted when the user selects the item that is currently focused. +-- [_$_] +-- Applications should not connect to it, but may emit it with 'signalEmitByName' if they need to +-- control selection programmatically. +-- [_$_] +-- There is no default binding for this signal. +selectCursorItem :: IconViewClass self => Signal self (IO ()) +selectCursorItem = Signal (connect_NONE__NONE "select-cursor-item") + [_$_] + +-- | A keybinding signal which gets emitted when the user toggles whether the currently focused item is +-- selected or not. The exact effect of this depend on the selection mode. +-- [_$_] +-- Applications should not connect to it, but may emit it with 'signalEmitByName' if they need to +-- control selection programmatically. +-- [_$_] +-- There is no default binding for this signal is Ctrl-Space. +toggleCursorItem :: IconViewClass self => Signal self (IO ()) +toggleCursorItem = Signal (connect_NONE__NONE "toggle-cursor-item") + [_$_] +-- | A keybinding signal which gets emitted when the user unselects all items. +-- [_$_] +-- Applications should not connect to it, but may emit it with 'signalEmitByName' if they need to +-- control selection programmatically. +-- [_$_] +-- The default binding for this signal is Ctrl-Shift-a. +unselectAll :: IconViewClass self => Signal self (IO ()) +unselectAll = Signal (connect_NONE__NONE "unselect-all") hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp 8 --- Copyright (C) 1999-2007 Axel Simon +-- Copyright (C) 1999-2009 Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp 27 +-- Current FFI don't support varargs functions: +-- gtk_tree_model_get +-- gtk_tree_model_get_valist +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp 95 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp 129 + treeModelGetNColumns, hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp 244 +-- | Returns the number of columns supported by @treeModel@. +treeModelGetNColumns :: TreeModelClass self => self -> IO Int +treeModelGetNColumns self = + liftM fromIntegral $ + {#call tree_model_get_n_columns#} (toTreeModel self) + hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModelFilter.chs.pp 66 + treeModelFilterSetModifyFunc, hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModelFilter.chs.pp 88 +import System.Glib.GValue (GValue) +import System.Glib.GType hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModelFilter.chs.pp 172 +-- | With the @nColumns@ and types parameters, you give an array of column types for this model (which +-- will be exposed to the parent model/ view). The func, data and destroy parameters are for specifying +-- the modify function. The modify function will get called for each data access, the goal of the +-- modify function is to return the data which should be displayed at the location specified using the +-- parameters of the modify function. +treeModelFilterSetModifyFunc :: TreeModelFilterClass self => self [_$_] + -> Int [_$_] + -> [GType] + -> Maybe (TreeIter -> GValue -> Int -> IO ()) + -> IO () +treeModelFilterSetModifyFunc self column typ Nothing = [_$_] + withArray typ $ \typPtr -> [_$_] + {#call gtk_tree_model_filter_set_modify_func#} + (toTreeModelFilter self) (fromIntegral column) typPtr nullFunPtr nullPtr nullFunPtr +treeModelFilterSetModifyFunc self column typ (Just func) = do [_$_] + funcPtr <- mkTreeModelFilterModifyFunc $ \_ tiPtr value col _ -> do + ti <- peekTreeIter tiPtr + func ti value (fromIntegral col) + withArray typ $ \typPtr -> + {#call gtk_tree_model_filter_set_modify_func#} [_$_] + (toTreeModelFilter self) (fromIntegral column) typPtr funcPtr (castFunPtrToPtr funcPtr) destroyFunPtr + +{#pointer TreeModelFilterModifyFunc #} + +foreign import ccall "wrapper" mkTreeModelFilterModifyFunc :: + (Ptr TreeModelFilter -> Ptr TreeIter -> GValue -> {#type gint#} -> Ptr () -> IO ()) + -> IO TreeModelFilterModifyFunc + hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModelSort.chs.pp 8 --- Copyright (C) 2004-2005 Duncan Coutts, Axel Simon +-- Copyright (C) 2004-2009 Duncan Coutts, Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModelSort.chs.pp 38 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeRowReference.chs.pp 8 --- Copyright (C) 2005 Axel Simon, Duncan Coutts +-- Copyright (C) 2005-2009 Axel Simon, Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 8 --- Copyright (C) 1999-2005 Axel Simon +-- Copyright (C) 1999-2009 Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 54 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 98 + treeSelectionSelectionChanged, + +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 103 +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 380 +-- | Emitted whenever the selection has (possibly) changed. Please note that +-- this signal is mostly a hint. It may only be emitted once when a range of +-- rows are selected, and it may occasionally be emitted when nothing has +-- happened. +-- +treeSelectionSelectionChanged :: TreeSelectionClass self => Signal self (IO ()) +treeSelectionSelectionChanged = Signal (connect_NONE__NONE "changed") [_$_] hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 388 +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 399 - +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSortable.chs.pp 8 --- Copyright (C) 1999-2007 Duncan Coutts, Axel Simon +-- Copyright (C) 1999-2009 Duncan Coutts, Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 8 --- Copyright (C) 2001-2005 Axel Simon +-- Copyright (C) 2001-2009 Axel Simon hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 20 --- TODO +-- The following functions don't bind, use corresponding attributes instead: [_$_] +-- gtk_tree_view_get_level_indentation +-- gtk_tree_view_set_level_indentation +-- gtk_tree_view_get_show_expanders +-- gtk_tree_view_set_show_expanders +-- gtk_tree_view_get_tooltip_column +-- gtk_tree_view_set_tooltip_column hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 28 --- gtk_tree_view_get_bin_window is to compare the GDK window from incoming --- events. We don't marshal that window parameter, so this function is not --- bound either. +-- Current FFI don't support varages functions: +-- gtk_tree_view_insert_column_with_attributes +-- +-- The following function not useful don't bind: +-- gtk_tree_view_get_search_equal_func +-- gtk_tree_view_get_search_position_func +-- gtk_tree_view_set_destroy_count_func +-- gtk_tree_view_get_row_separator_func +-- +-- NOTE: hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 45 --- get_search_equal_func is missing: proper memory management is impossible --- --- gtk_tree_view_set_destroy_count_func is not meant to be useful --- --- expand-collapse-cursor-row needs to be bound if it is useful to expand --- and collapse rows in a user-defined manner. Would only work on Gtk 2.2 --- and higher since the return parameter changed --- --- move_cursor, select_all, select_cursor_parent, select_cursor_row --- toggle_cursor_row, unselect_all are not bound. --- These functions are only useful to change the widgets --- behaviour for these actions. Everything else can be done with --- cursor_changed and columns_changed --- --- set_scroll_adjustment makes sense if the user monitors the scroll bars --- and the scroll bars can be replaced anytime (the latter is odd) --- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 65 +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 107 + treeV... [truncated message content] |