From: Axel S. <as...@us...> - 2005-02-13 16:26:06
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/General In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21286/gtk/Graphics/UI/Gtk/General Modified Files: IconFactory.chs.pp Log Message: Make compile on Windows against Gtk 2.6.1. All functions that pass filenames were redefined to a name that ends in _utf8. Added preprocessor magic to circumvent this. Furthermore added --subsystem windows as a linker flag whenever the gtk package is used during linking. This prevents a console window from opening. Index: IconFactory.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/General/IconFactory.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- IconFactory.chs.pp 12 Feb 2005 17:19:23 -0000 1.2 +++ IconFactory.chs.pp 13 Feb 2005 16:25:57 -0000 1.3 @@ -295,7 +295,11 @@ -- iconSourceGetFilename :: IconSource -> IO (Maybe String) iconSourceGetFilename is = do +#if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) + strPtr <- {#call unsafe icon_source_get_filename_utf8#} is +#else strPtr <- {#call unsafe icon_source_get_filename#} is +#endif if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr -- | Retrieve the 'IconSize' of this @@ -372,7 +376,11 @@ -- iconSourceSetFilename :: IconSource -> FilePath -> IO () iconSourceSetFilename is name = - withUTFString name $ {#call unsafe icon_source_set_filename#} is +#if defined (WIN32) && GTK_CHECK_VERSION(2,6,0) + withUTFString name $ {# call unsafe icon_source_set_filename_utf8 #} is +#else + withUTFString name $ {# call unsafe icon_source_set_filename #} is +#endif -- | Retrieves the source pixbuf, or Nothing if none is set. -- |