From: Andy S. <And...@co...> - 2010-03-28 02:39:42
|
Sat Mar 27 22:38:46 EDT 2010 Andy Stewart <laz...@gm...> * Fix all mk.*Func functions. Ignore-this: 2c2dd04dc0c5a2a903fae72f08e44419 hunk ./gtk/Graphics/UI/Gtk.hs.pp 457 - destory ) + destroy ) hunk ./gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp 72 - destory, + destroy, hunk ./gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp 159 -destory :: ObjectClass self => Signal self (IO ()) -destory = Signal (connect_NONE__NONE "destroy") +destroy :: ObjectClass self => Signal self (IO ()) +destroy = Signal (connect_NONE__NONE "destroy") hunk ./gtk/Graphics/UI/Gtk/Buttons/LinkButton.chs.pp 66 - LinkButtonUri, hunk ./gtk/Graphics/UI/Gtk/Buttons/LinkButton.chs.pp 74 - linkButtonSetURIHook, + linkButtonSetUriHook, hunk ./gtk/Graphics/UI/Gtk/Buttons/LinkButton.chs.pp 106 --------------------- --- Types [_$_] -type LinkButtonUri = String -> () - -{#pointer LinkButtonUriFunc#} - -foreign import ccall "wrapper" mkLinkButtonUriFunc :: - (Ptr LinkButton -> CString -> Ptr () -> IO ()) - -> IO LinkButtonUriFunc - hunk ./gtk/Graphics/UI/Gtk/Buttons/LinkButton.chs.pp 166 -linkButtonSetURIHook :: Maybe LinkButtonUri - -> DestroyNotify [_$_] - -> IO () -linkButtonSetURIHook func destroy = do - pfPtr <- case func of - Just pf -> mkLinkButtonUriFunc $ \_ cstr _ -> do +linkButtonSetUriHook :: (String -> IO ()) -> IO () +linkButtonSetUriHook func = do + pfPtr <- mkLinkButtonUriFunc $ \_ cstr _ -> do hunk ./gtk/Graphics/UI/Gtk/Buttons/LinkButton.chs.pp 170 - return (pf str) - Nothing -> return nullFunPtr - {# call gtk_link_button_set_uri_hook #} pfPtr nullPtr destroy - unless (pfPtr == nullFunPtr) $ freeHaskellFunPtr pfPtr - [_$_] + func str + {# call link_button_set_uri_hook #} pfPtr (castFunPtrToPtr pfPtr) destroyFunPtr + freeHaskellFunPtr pfPtr + [_$_] +{#pointer LinkButtonUriFunc#} + +foreign import ccall "wrapper" mkLinkButtonUriFunc :: + (Ptr LinkButton -> CString -> Ptr () -> IO ()) + -> IO LinkButtonUriFunc + hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 71 - NotebookWindowCreation, hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 202 --------------------- --- Types. --- | A function used by 'Notebook' when a detachable tab is dropped in the root window, it's used to --- create a window containing a notebook where the tab will be attached. This function will also be --- responsible of moving/resizing the window and adding the necessary properties to the notebook (i.e.: --- group-id) -type NotebookWindowCreation = Widget -> Int -> Int -> Notebook - -{#pointer NotebookWindowCreationFunc#} - -foreign import ccall "wrapper" mkNotebookWindowCreationFunc :: - (Ptr Notebook -> Ptr Widget -> {#type glong#} -> {#type glong#} -> Ptr () -> IO (Ptr Notebook)) - -> IO NotebookWindowCreationFunc - hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 984 -notebookSetWindowCreationHook :: [_$_] - Maybe NotebookWindowCreation - -> DestroyNotify [_$_] - -> IO () -notebookSetWindowCreationHook func destroy = do - funcPtr <- case func of - Just fc -> mkNotebookWindowCreationFunc $ \_ widgetPtr x y _ -> do - widget <- makeNewObject mkWidget (return widgetPtr) - return (unsafeForeignPtrToPtr $ unNotebook (fc widget (fromIntegral x) (fromIntegral y))) - Nothing -> return nullFunPtr - {#call notebook_set_window_creation_hook#} funcPtr nullPtr destroy - unless (funcPtr == nullFunPtr) $ freeHaskellFunPtr funcPtr +notebookSetWindowCreationHook :: (Widget -> Int -> Int -> IO Notebook) -> IO () +notebookSetWindowCreationHook func = do + funcPtr <- mkNotebookWindowCreationFunc $ \_ widgetPtr x y _ -> do + widget <- makeNewObject mkWidget (return widgetPtr) + notebook <- func widget (fromIntegral x) (fromIntegral y) + return (unsafeForeignPtrToPtr $ unNotebook notebook) + {#call notebook_set_window_creation_hook#} funcPtr (castFunPtrToPtr funcPtr) destroyFunPtr + freeHaskellFunPtr funcPtr + +{#pointer NotebookWindowCreationFunc#} + +foreign import ccall "wrapper" mkNotebookWindowCreationFunc :: + (Ptr Notebook -> Ptr Widget -> {#type glong#} -> {#type glong#} -> Ptr () -> IO (Ptr Notebook)) + -> IO NotebookWindowCreationFunc hunk ./gtk/Graphics/UI/Gtk/Misc/Calendar.chs.pp 70 -#if GTK_CHECK_VERSION(2,14,0) - CalendarDetail, -#endif hunk ./gtk/Graphics/UI/Gtk/Misc/Calendar.chs.pp 153 --------------------- --- Types -#if GTK_CHECK_VERSION(2,14,0) -type CalendarDetail = Int -> Int -> Int -> String - -{#pointer CalendarDetailFunc#} - -foreign import ccall "wrapper" mkCalendarDetailFunc :: [_$_] - (Ptr Calendar -> {#type guint#} -> {#type guint#} -> {#type guint#} -> Ptr () -> IO CString) - -> IO CalendarDetailFunc -#endif - hunk ./gtk/Graphics/UI/Gtk/Misc/Calendar.chs.pp 300 - -> CalendarDetail [_$_] - -> DestroyNotify + -> (Int -> Int -> Int -> IO String) hunk ./gtk/Graphics/UI/Gtk/Misc/Calendar.chs.pp 302 -calendarSetDetailFunc self function notify = do - func <- mkCalendarDetailFunc $ \_ year month day _ -> - newCString (function (fromIntegral year) (fromIntegral month) (fromIntegral day)) +calendarSetDetailFunc self function = do + func <- mkCalendarDetailFunc $ \_ year month day _ -> do + str <- function (fromIntegral year) (fromIntegral month) (fromIntegral day) + newCString str hunk ./gtk/Graphics/UI/Gtk/Misc/Calendar.chs.pp 309 - nullPtr - notify + (castFunPtrToPtr func) + destroyFunPtr + freeHaskellFunPtr func + +{#pointer CalendarDetailFunc#} + +foreign import ccall "wrapper" mkCalendarDetailFunc :: [_$_] + (Ptr Calendar -> {#type guint#} -> {#type guint#} -> {#type guint#} -> Ptr () -> IO CString) + -> IO CalendarDetailFunc hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 343 - func path - ) + func path) hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 347 - nullPtr + (castFunPtrToPtr funcPtr) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp 430 - liftM (fromIntegral.fromBool) $ fun iter - ) + liftM (fromIntegral.fromBool) $ fun iter) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp 434 - nullPtr + (castFunPtrToPtr fPtr) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 67 - TreeSelectionCB, - TreeSelectionForeachCB, hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 149 - -> TreeSelectionCB -> IO () + -> (TreePath -> IO Bool) -> IO () hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 153 - liftM fromBool $ fun path - ) + liftM fromBool $ fun path) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 159 + freeHaskellFunPtr fPtr hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 164 -type TreeSelectionCB = TreePath -> IO Bool hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 195 - -> TreeSelectionForeachCB + -> (TreeIter -> IO ()) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 204 - fun iter - ) + fun iter) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 208 - nullPtr + (castFunPtrToPtr fPtr) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp 213 -type TreeSelectionForeachCB = TreeIter -> IO () hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 75 - TextBufferDeserialize, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 231 -import System.Glib.GObject (DestroyNotify, constructNewGObject, +import System.Glib.GObject (constructNewGObject, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 243 --------------------- --- Types -type TextBufferDeserialize = TextBuffer -> TextIter -> Int -> Int -> Bool -> Bool - -{#pointer TextBufferDeserializeFunc#} - -foreign import ccall "wrapper" mkTextBufferDeserializeFunc :: - (Ptr TextBuffer -> Ptr TextBuffer -> Ptr TextIter -> {#type guint#} -> {#type glong#} -> {#type gboolean#} -> Ptr () -> IO {#type gboolean#}) - -> IO TextBufferDeserializeFunc - -type TextBufferSerialize = TextBuffer -> TextIter -> TextIter -> Int -> String - -{#pointer TextBufferSerializeFunc#} - -foreign import ccall "wrapper" mkTextBufferSerializeFunc :: - (Ptr TextBuffer -> Ptr TextBuffer -> Ptr TextIter -> Ptr TextIter -> {#type glong#} -> Ptr () -> IO CString) - -> IO TextBufferSerializeFunc - hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1229 - -> TextBufferDeserialize -- ^ @function@ - the deserialize + -> (TextBuffer -> TextIter -> Int -> Int -> Bool -> IO Bool) -- ^ @function@ - the deserialize hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1231 - -> DestroyNotify -- ^ @userDataDestroy@ - a function to - -- call when @userData@ is no longer - -- needed hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1233 -textBufferRegisterDeserializeFormat self mimeType function notify = +textBufferRegisterDeserializeFormat self mimeType function = hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1238 - return (fromBool (function buffer iter (fromIntegral dat) (fromIntegral length) (toBool tags))) + liftM fromBool $ function buffer iter (fromIntegral dat) (fromIntegral length) (toBool tags) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1243 - nullPtr - notify + (castFunPtrToPtr func) + destroyFunPtr hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1247 +{#pointer TextBufferDeserializeFunc#} + +foreign import ccall "wrapper" mkTextBufferDeserializeFunc :: + (Ptr TextBuffer -> Ptr TextBuffer -> Ptr TextIter -> {#type guint#} -> {#type glong#} -> {#type gboolean#} -> Ptr () -> IO {#type gboolean#}) + -> IO TextBufferDeserializeFunc + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1277 - -> TextBufferSerialize -- ^ @function@ - the serialize function to + -> (TextBuffer -> TextIter -> TextIter -> Int -> IO String) -- ^ @function@ - the serialize function to hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1279 - -> DestroyNotify -- ^ @userDataDestroy@ - a function to call - -- when @userData@ is no longer needed hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1281 -textBufferRegisterSerializeFormat self mimeType function notify = +textBufferRegisterSerializeFormat self mimeType function = hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1287 - newCString $ function buffer startIter endIter (fromIntegral length) + str <- function buffer startIter endIter (fromIntegral length) + newCString str hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1293 - nullPtr - notify + (castFunPtrToPtr func) + destroyFunPtr hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1297 +{#pointer TextBufferSerializeFunc#} + +foreign import ccall "wrapper" mkTextBufferSerializeFunc :: + (Ptr TextBuffer -> Ptr TextBuffer -> Ptr TextIter -> Ptr TextIter -> {#type glong#} -> Ptr () -> IO CString) + -> IO TextBufferSerializeFunc + hunk ./gtk/Graphics/UI/Gtk/Windows/Assistant.chs.pp 62 - AssistantPage, hunk ./gtk/Graphics/UI/Gtk/Windows/Assistant.chs.pp 125 --------------------- --- Types [_$_] -type AssistantPage = Int -> Int - -{#pointer AssistantPageFunc#} - -foreign import ccall "wrapper" mkAssistantPageFunc :: - (Ptr Assistant -> {#type glong#} -> Ptr () -> IO {#type glong#}) - -> IO AssistantPageFunc - hunk ./gtk/Graphics/UI/Gtk/Windows/Assistant.chs.pp 229 - -> Maybe AssistantPage -- ^ @pageFunc@ - the 'AssistantPage' - -> DestroyNotify -- ^ @destroy@ - destroy notifier for @data@ + -> (Int -> IO Int) -- ^ @pageFunc@ - the 'AssistantPage' hunk ./gtk/Graphics/UI/Gtk/Windows/Assistant.chs.pp 231 -assistantSetForwardPageFunc self pageFunc destroy = do - pfPtr <- case pageFunc of - Just pf -> mkAssistantPageFunc $ \_ c _ -> - return (fromIntegral (pf (fromIntegral c))) - Nothing -> return nullFunPtr +assistantSetForwardPageFunc self pageFunc = do + pfPtr <- mkAssistantPageFunc $ \_ c _ -> do + result <- pageFunc (fromIntegral c) + return $ fromIntegral result hunk ./gtk/Graphics/UI/Gtk/Windows/Assistant.chs.pp 238 - nullPtr - destroy - unless (pfPtr == nullFunPtr) $ freeHaskellFunPtr pfPtr + (castFunPtrToPtr pfPtr) + destroyFunPtr + freeHaskellFunPtr pfPtr + +{#pointer AssistantPageFunc#} + +foreign import ccall "wrapper" mkAssistantPageFunc :: + (Ptr Assistant -> {#type glong#} -> Ptr () -> IO {#type glong#}) + -> IO AssistantPageFunc |