summaryrefslogtreecommitdiff
blob: ab5a9973f4d6c5e1a1df67abab888abfe214b58f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/Windows/Assistant.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/Windows/Assistant.chs	2012-10-11 12:51:38.040935853 +1100
@@ -274,7 +274,7 @@
 {#pointer AssistantPageFunc#}
 
 foreign import ccall "wrapper" mkAssistantPageFunc ::
-  ({#type glong#} -> Ptr () -> IO {#type glong#})
+  ({#type gint#} -> Ptr () -> IO {#type gint#})
   -> IO AssistantPageFunc
 
 -- | Sets the page type for @page@. The page type determines the page behavior
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/Multiline/TextIter.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/Multiline/TextIter.chs	2012-10-11 12:50:59.510893025 +1100
@@ -797,7 +797,7 @@
 {#pointer TextCharPredicate#}
 
 foreign import ccall "wrapper" mkTextCharPredicate ::
-  ({#type gunichar#} -> Ptr () -> {#type gboolean#}) -> IO TextCharPredicate
+  ({#type gunichar#} -> Ptr () -> IO {#type gboolean#}) -> IO TextCharPredicate
 
 -- | Move 'TextIter' forward until a
 -- predicate function returns True.
@@ -810,7 +810,7 @@
 textIterForwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter ->
                            IO Bool
 textIterForwardFindChar ti pred limit = do
-  fPtr <- mkTextCharPredicate (\c _ -> fromBool $ pred (chr (fromIntegral c)))
+  fPtr <- mkTextCharPredicate (\c _ -> return $ fromBool $ pred (chr (fromIntegral c)))
   res <- liftM toBool $ {#call text_iter_forward_find_char#} 
     ti fPtr nullPtr (fromMaybe (TextIter nullForeignPtr) limit)
   freeHaskellFunPtr fPtr
@@ -827,7 +827,7 @@
 textIterBackwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter ->
                             IO Bool
 textIterBackwardFindChar ti pred limit = do
-  fPtr <- mkTextCharPredicate (\c _ -> fromBool $ pred (chr (fromIntegral c)))
+  fPtr <- mkTextCharPredicate (\c _ -> return $ fromBool $ pred (chr (fromIntegral c)))
   res <- liftM toBool $ {#call text_iter_backward_find_char#} 
     ti fPtr nullPtr (fromMaybe (TextIter nullForeignPtr) limit)
   freeHaskellFunPtr fPtr
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/ModelView/TreeView.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/ModelView/TreeView.chs	2012-10-11 12:50:02.711356413 +1100
@@ -582,7 +582,7 @@
 {#pointer TreeViewColumnDropFunc#}
 
 foreign import ccall "wrapper" mkTreeViewColumnDropFunc ::
-  (Ptr () -> Ptr TreeViewColumn -> Ptr TreeViewColumn -> Ptr TreeViewColumn ->
+  (Ptr TreeView -> Ptr TreeViewColumn -> Ptr TreeViewColumn -> Ptr TreeViewColumn ->
   Ptr () -> IO {#type gboolean#}) -> IO TreeViewColumnDropFunc
 
 -- | Scroll to a coordinate.
@@ -798,7 +798,7 @@
 {#pointer TreeViewMappingFunc#}
 
 foreign import ccall "wrapper" mkTreeViewMappingFunc ::
-  (Ptr () -> Ptr NativeTreePath -> Ptr () -> IO ()) ->
+  (Ptr TreeView -> Ptr NativeTreePath -> Ptr () -> IO ()) ->
   IO TreeViewMappingFunc
 
 -- | Check if row is expanded.
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/ModelView/TreeSelection.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/ModelView/TreeSelection.chs	2012-10-11 12:49:22.402264615 +1100
@@ -151,7 +151,7 @@
 treeSelectionSetSelectFunction :: TreeSelectionClass self => self
  -> TreeSelectionCB -> IO ()
 treeSelectionSetSelectFunction ts fun = do
-  fPtr <- mkTreeSelectionFunc (\_ _ tp _ -> do
+  fPtr <- mkTreeSelectionFunc (\_ _ tp _ _ -> do
     path <- peekTreePath (castPtr tp)
     liftM fromBool $ fun path
     )
@@ -168,7 +168,7 @@
 {#pointer TreeSelectionFunc#}
 
 foreign import ccall "wrapper"  mkTreeSelectionFunc ::
-  (Ptr () -> Ptr () -> Ptr TreePath -> Ptr () -> IO CInt)->
+  (Ptr TreeSelection -> Ptr TreeModel -> Ptr NativeTreePath -> {#type gint#} -> Ptr () -> IO CInt)->
   IO TreeSelectionFunc
 
 -- | Retrieve the 'TreeView' widget that this 'TreeSelection' works on.
@@ -199,7 +199,7 @@
  -> TreeSelectionForeachCB
  -> IO ()
 treeSelectionSelectedForeach self fun = do
-  fPtr <- mkTreeSelectionForeachFunc (\_ _ iterPtr -> do
+  fPtr <- mkTreeSelectionForeachFunc (\_ _ iterPtr _ -> do
     -- make a deep copy of the iterator. This makes it possible to store this
     -- iterator in Haskell land somewhere. The TreeModel parameter is not
     -- passed to the function due to performance reasons. But since it is
@@ -219,7 +219,7 @@
 {#pointer TreeSelectionForeachFunc#}
 
 foreign import ccall "wrapper"  mkTreeSelectionForeachFunc ::
-  (Ptr () -> Ptr () -> Ptr TreeIter -> IO ()) -> IO TreeSelectionForeachFunc
+  (Ptr TreeModel -> Ptr NativeTreePath -> Ptr TreeIter -> Ptr () -> IO ()) -> IO TreeSelectionForeachFunc
 
 #if GTK_CHECK_VERSION(2,2,0)
 -- | Creates a list of paths of all selected rows.
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/ModelView/TreeModelFilter.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/ModelView/TreeModelFilter.chs	2012-10-11 12:47:30.867237897 +1100
@@ -160,7 +160,7 @@
 {#pointer TreeModelFilterVisibleFunc #}
 
 foreign import ccall "wrapper" mkTreeModelFilterVisibleFunc ::
-  (Ptr TreeModelFilter -> Ptr TreeIter -> Ptr () -> IO {#type gboolean#}) ->
+  (Ptr TreeModel -> Ptr TreeIter -> Ptr () -> IO {#type gboolean#}) ->
   IO TreeModelFilterVisibleFunc
 
 -- %hash c:a56d d:b42e
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/ModelView/TreeModel.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/ModelView/TreeModel.chs	2012-10-11 12:47:06.478576590 +1100
@@ -427,7 +427,7 @@
 {#pointer TreeModelForeachFunc#}
 
 foreign import ccall "wrapper"  mkTreeModelForeachFunc ::
-  (Ptr () -> Ptr () -> Ptr TreeIter -> Ptr () -> IO CInt) ->
+  (Ptr TreeModel -> Ptr NativeTreePath -> Ptr TreeIter -> Ptr () -> IO CInt) ->
   IO TreeModelForeachFunc
 
 #if GTK_CHECK_VERSION(2,2,0)
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs	2012-10-11 12:46:41.970912216 +1100
@@ -493,17 +493,17 @@
   {# call gtk_combo_box_set_row_separator_func #}
     (toComboBox self) nullFunPtr nullPtr nullFunPtr
 comboBoxSetRowSeparatorSource self (Just (model, extract)) = do
-  funPtr <- mkRowSeparatorFunc $ \_ iterPtr -> do
+  funPtr <- mkRowSeparatorFunc $ \_ iterPtr _ -> do
         iter <- peek iterPtr
         value <- customStoreGetRow model iter
-        return (extract value)
+        return (fromBool $ extract value)
   {# call gtk_combo_box_set_row_separator_func #}
     (toComboBox self) funPtr (castFunPtrToPtr funPtr) destroyFunPtr
 
 {#pointer TreeViewRowSeparatorFunc#}
 
 foreign import ccall "wrapper" mkRowSeparatorFunc ::
-  (Ptr TreeModel -> Ptr TreeIter -> IO Bool) -> IO TreeViewRowSeparatorFunc
+  (Ptr TreeModel -> Ptr TreeIter -> Ptr () -> IO {#type gboolean #}) -> IO TreeViewRowSeparatorFunc
 
 -- %hash c:5bf8
 -- | Sets whether the popup menu should have a tearoff menu item.
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/General/Clipboard.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/General/Clipboard.chs	2012-10-11 12:45:41.325267512 +1100
@@ -260,7 +260,7 @@
                               -- data succeeded.
 clipboardSetWithData self targets getFunc clearFunc = do
   gFunPtr <- mkClipboardGetFunc
-    (\_ sPtr info -> runReaderT (getFunc info) sPtr >> return ())
+    (\_ sPtr info _ -> runReaderT (getFunc info) sPtr >> return ())
   cFunPtr <- mkClipboardClearFunc
     (\_ _ -> clearFunc)
   res <- withTargetEntries targets $ \nTargets targets ->
@@ -282,7 +282,7 @@
 {#pointer ClipboardClearFunc#}
 
 foreign import ccall "wrapper" mkClipboardGetFunc ::
-  (Ptr Clipboard -> Ptr () -> {#type guint#} -> IO ()) -> IO ClipboardGetFunc
+  (Ptr Clipboard -> Ptr () -> {#type guint#} -> Ptr () -> IO ()) -> IO ClipboardGetFunc
 
 foreign import ccall "wrapper" mkClipboardClearFunc ::
   (Ptr Clipboard -> Ptr () -> IO ()) -> IO ClipboardClearFunc
@@ -313,7 +313,7 @@
                               -- ignored.
 clipboardSetWithOwner self targets getFunc clearFunc owner = do
   gFunPtr <- mkClipboardGetFunc
-    (\_ sPtr info -> runReaderT (getFunc info) sPtr >> return ())
+    (\_ sPtr info _ -> runReaderT (getFunc info) sPtr >> return ())
   cFunPtr <- mkClipboardClearFunc
     (\_ _ -> clearFunc)
   res <- withTargetEntries targets $ \nTargets targets ->
@@ -404,7 +404,7 @@
 clipboardRequestContents self (Atom target) callback = do
   cbRef <- newIORef nullFunPtr
   cbPtr <- mkClipboardReceivedFunc
-    (\_ sPtr -> do
+    (\_ sPtr _ -> do
       freeHaskellFunPtr =<< readIORef cbRef
       runReaderT callback sPtr
       return ())
@@ -418,7 +418,7 @@
 {#pointer ClipboardReceivedFunc#}
 
 foreign import ccall "wrapper" mkClipboardReceivedFunc ::
-  (Ptr Clipboard -> Ptr () -> IO ()) -> IO ClipboardReceivedFunc
+  (Ptr Clipboard -> Ptr () -> Ptr () -> IO ()) -> IO ClipboardReceivedFunc
 
 -- %hash c:7bb1 d:4ef1
 -- | Requests the contents of the clipboard as text. When the text is later
@@ -439,7 +439,7 @@
 clipboardRequestText self callback = do
   cbRef <- newIORef nullFunPtr
   cbPtr <- mkClipboardTextReceivedFunc
-    (\_ sPtr -> do
+    (\_ sPtr _ -> do
       freeHaskellFunPtr =<< readIORef cbRef
       mStr <- if sPtr==nullPtr then return Nothing else
         liftM Just $ peekUTFString sPtr
@@ -453,7 +453,7 @@
 {#pointer ClipboardTextReceivedFunc#}
 
 foreign import ccall "wrapper" mkClipboardTextReceivedFunc ::
-  (Ptr Clipboard -> CString -> IO ()) -> IO ClipboardTextReceivedFunc
+  (Ptr Clipboard -> CString -> Ptr () -> IO ()) -> IO ClipboardTextReceivedFunc
 
 
 #if GTK_CHECK_VERSION(2,6,0)
@@ -477,7 +477,7 @@
 clipboardRequestImage self callback = do
   cbRef <- newIORef nullFunPtr
   cbPtr <- mkClipboardImageReceivedFunc
-    (\_ sPtr -> do
+    (\_ sPtr _ -> do
       freeHaskellFunPtr =<< readIORef cbRef
       mPixbuf <- maybeNull (makeNewGObject mkPixbuf) (return sPtr)
       callback mPixbuf)
@@ -490,7 +490,7 @@
 {#pointer ClipboardImageReceivedFunc#}
 
 foreign import ccall "wrapper" mkClipboardImageReceivedFunc ::
-  (Ptr Clipboard -> Ptr Pixbuf -> IO ()) -> IO ClipboardImageReceivedFunc
+  (Ptr Clipboard -> Ptr Pixbuf -> Ptr () -> IO ()) -> IO ClipboardImageReceivedFunc
 
 #endif
 
@@ -513,7 +513,7 @@
 clipboardRequestTargets self callback = do
   cbRef <- newIORef nullFunPtr
   cbPtr <- mkClipboardTargetsReceivedFunc
-    (\_ tPtr len -> do
+    (\_ tPtr len _ -> do
       -- We must free Haskell pointer *in* the callback to avoid segfault.
       freeHaskellFunPtr =<< readIORef cbRef
       mTargets <- if tPtr==nullPtr then return Nothing else
@@ -528,7 +528,7 @@
 {#pointer ClipboardTargetsReceivedFunc#}
 
 foreign import ccall "wrapper" mkClipboardTargetsReceivedFunc ::
-  (Ptr Clipboard -> Ptr (Ptr ()) -> {#type gint#} -> IO ()) -> IO ClipboardTargetsReceivedFunc
+  (Ptr Clipboard -> Ptr (Ptr ()) -> {#type gint#} -> Ptr () -> IO ()) -> IO ClipboardTargetsReceivedFunc
 
 #if GTK_CHECK_VERSION(2,10,0)
 -- %hash c:5601 d:d6a6
@@ -552,10 +552,10 @@
 clipboardRequestRichText self buffer callback = do
   cbRef <- newIORef nullFunPtr
   cbPtr <- mkClipboardRichTextReceivedFunc
-    (\_ tPtr sPtr len -> do
+    (\_ tPtr sPtr len _ -> do
       freeHaskellFunPtr =<< readIORef cbRef
       mRes <- if sPtr==nullPtr then return Nothing else liftM Just $ do
-        str <- peekUTFStringLen (sPtr,fromIntegral len)
+        str <- peekUTFStringLen (castPtr sPtr,fromIntegral len)
         return (Atom tPtr, str)
       callback mRes)
   writeIORef cbRef cbPtr
@@ -568,7 +568,7 @@
 {#pointer ClipboardRichTextReceivedFunc#}
 
 foreign import ccall "wrapper" mkClipboardRichTextReceivedFunc ::
-  (Ptr Clipboard -> Ptr () -> CString -> {#type gsize#} -> IO ()) ->
+  (Ptr Clipboard -> Ptr () -> Ptr CUChar -> {#type gsize#} -> Ptr () -> IO ()) ->
   IO ClipboardRichTextReceivedFunc
 #endif
 #endif
--- gtk-0.12.3.1-orig/Graphics/UI/Gtk/Abstract/Object.chs	2012-06-18 07:39:34.000000000 +1000
+++ gtk-0.12.3.1/Graphics/UI/Gtk/Abstract/Object.chs	2012-10-11 12:40:38.320051642 +1100
@@ -126,7 +126,8 @@
 
 {#pointer GWeakNotify#}
 
-foreign import ccall "wrapper" mkDestructor :: IO () -> IO GWeakNotify
+foreign import ccall "wrapper" mkDestructor
+  :: (Ptr () -> Ptr GObject -> IO ()) -> IO GWeakNotify
 
 -- | Attach a callback that will be called after the
 -- destroy hooks have been called
@@ -134,7 +135,7 @@
 objectWeakref :: ObjectClass o => o -> IO () -> IO GWeakNotify
 objectWeakref obj uFun = do
   funPtrContainer <- newIORef nullFunPtr
-  uFunPtr <- mkDestructor $ do
+  uFunPtr <- mkDestructor $ \_ _ -> do
     uFun
     funPtr <- readIORef funPtrContainer
     freeHaskellFunPtr funPtr