From: Axel S. <si...@co...> - 2008-09-06 18:50:25
|
Sat Sep 6 14:40:45 EDT 2008 A....@ke... * Add function to Selection. hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 68 --- selectionOwnerSetForDisplay, + selectionOwnerSetForDisplay, hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 73 - selectionDataGetLength, + selectionDataIsValid, hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 196 - TargetTag -> InfoId -> IO () + TargetTag -> InfoId -> IO () hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 218 - TimeStamp -> IO Bool + TimeStamp -> IO Bool hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 227 --- [_$_] +-- | Set the ownership of a given selection and display. hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 229 ---selectionOwnerSetForDisplay :: WidgetClass widget => Display -> widget -> {-GdkAtom-} -> Word32 -> IO Bool ---selectionOwnerSetForDisplay display widget selection time = --- liftM toBool $ --- {#call unsafe gtk_selection_owner_set_for_display #} --- display --- (toWidget widget) --- {-selection-} --- (fromIntegral time) +selectionOwnerSetForDisplay :: WidgetClass widget => Display -> Maybe widget -> + SelectionTag -> TimeStamp -> IO Bool +selectionOwnerSetForDisplay display widget (Atom selection) time = + liftM toBool $ + {#call unsafe gtk_selection_owner_set_for_display #} + display + (maybe (mkWidget nullForeignPtr) toWidget widget) + selection + (fromIntegral time) hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 284 +-- | Check if the currently stored data is valid. +-- +-- * If this function returns @False@, no data is set in this selection +-- and 'selectionDataGet' will return @Nothing@ no matter what type +-- is requested. +-- +selectionDataIsValid :: SelectionDataM Bool +selectionDataIsValid = do + len <- selectionDataGetLength + return (len>=0) + [_$_] |