From: shelarcy <she...@gm...> - 2008-11-12 14:52:56
|
DarcsURL: C:/home/shelarcy/wxhaskell MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_" --=_ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Wed Nov 12 23:25:44 =93=8C=8B=9E (=95W=8F=80=8E=9E) 2008 shelarcy <shelarc= y...@gm...> * Add ByteString support. Wed Nov 12 23:26:35 =93=8C=8B=9E (=95W=8F=80=8E=9E) 2008 shelarcy <shelarc= y...@gm...> * Add Image / ByteString conversion functions (This is based on Jules Bea= n's work). --=_ Content-Type: text/x-darcs-patch; name="add-bytestring-support_.dpatch" Content-Transfer-Encoding: quoted-printable Content-Description: A darcs patch for your repository! New patches: [Add ByteString support. shelarcy <she...@gm...>**20081112142544] { hunk ./configure 676 +# Test if we can include the bytestring package explicitly +$hcpkg describe bytestring > /dev/null 2> /dev/null +case $? in + 0) bytestringpkgversion=3D`ghc-pkg field bytestring version | tail -n 1 = | sed 's/.* //'` + pkgbytestring=3D"-package bytestring-$bytestringpkgversion";; + *) pkgbytestring=3D"";; +esac + hunk ./configure 946 +PKG-BYTESTRING=3D$pkgbytestring hunk ./configure 1056 -depends: ${wxcoredepends}, haskell98-$haskell98pkgversion, stm-$stmpkgvers= ion +depends: ${wxcoredepends}, haskell98-$haskell98pkgversion, bytestring-$byt= estringpkgversion, stm-$stmpkgversion hunk ./makefile 525 -WXCORE-HCFLAGS =3D$(HCFLAGS) $(PKG-CONTAINERS) $(PKG-STM) -package-name $(= WXCORE)-$(VERSION) +WXCORE-HCFLAGS =3D$(HCFLAGS) $(PKG-BYTESTRING) $(PKG-CONTAINERS) $(PKG-STM= ) -package-name $(WXCORE)-$(VERSION) hunk ./wxc/include/wrapper.h 47 +#include "wx/mstream.h" hunk ./wxc/include/wxc_types.h 92 +=0D +#define TByteData char*=0D +#define TByteString TByteData* d, int n=0D +#define TByteStringLazy TByteData* d, int n=0D +#define TByteStringOut TByteData=0D +#define TByteStringLazyOut TByteData=0D +#define TByteStringLen int=0D hunk ./wxcore.cabal 18 - parsec, old-time, time, stm + bytestring, parsec, old-time, time, stm hunk ./wxcore.cabal 20 - build-depends: base < 3, parsec, time, stm + build-depends: base < 3, bytestring, parsec, time, stm hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 62 - , withArrayString, withArrayWString, withArrayInt, withArrayOb= ject + , withArray, withArrayString, withArrayWString, withArrayInt, = withArrayObject hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 97 + -- *** ByteString + , withByteStringResult, withLazyByteStringResult hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 101 + -- *** 8 bit Word + , Word8 hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 132 +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as LB +import qualified Data.ByteString.Char8 as BC (pack) +import qualified Data.ByteString.Lazy.Char8 as LBC (pack) + hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 141 +import Data.Word hunk ./wxcore/src/Graphics/UI/WXCore/WxcTypes.hs 657 +{-------------------------------------------------------------------------= ---------------- + ByteString +--------------------------------------------------------------------------= ---------------} +-- TODO: replace this by more efficient implementation. +-- e.g. use mmap when bytestring support mmap interface. +withByteStringResult :: (Ptr CChar -> IO CInt) -> IO B.ByteString +withByteStringResult f + =3D do len <- f nullPtr + if (len<=3D0) + then return $ BC.pack "" + else withCString (replicate (fromCInt len) ' ') $ \cstr -> + do f cstr + B.packCString cstr + +withLazyByteStringResult :: (Ptr CChar -> IO CInt) -> IO LB.ByteString +withLazyByteStringResult f + =3D do str <- withStringResult f + return $ LBC.pack str hunk ./wxdirect/src/CompileClasses.hs 108 + , "import qualified Data.ByteString as B (= ByteString, useAsCStringLen)" + , "import qualified Data.ByteString.Lazy a= s LB (ByteString, length, unpack)" hunk ./wxdirect/src/CompileClasses.hs 366 + ByteString Lazy -> "withLazyByteStringResult $ \\buffer -> " ++ nl += + call ++ " buffer" -- always last argument! + ByteString _ -> "withByteStringResult $ \\buffer -> " ++ nl ++ call = ++ " buffer" -- always last argument! hunk ./wxdirect/src/CompileClasses.hs 401 + ByteString Lazy -> "withArray (LB.unpack " ++ haskellName (argName a= rg) ++ ") $ \\" + ++ haskellByteStringName (argName arg) + ++ " -> " ++ nl + ByteString _ -> "B.useAsCStringLen " ++ haskellName (argName arg) ++= " $ \\" + ++ "(" ++ haskellByteStringName (argName arg) ++ ", = " ++ haskellByteStringLenName (argName arg) ++ ") " + ++ " -> " ++ nl hunk ./wxdirect/src/CompileClasses.hs 451 + ByteString Lazy -> haskellByteStringName name ++ " (fromIntegral $ L= B.length " ++ haskellName name ++ ")" + ByteString _ -> haskellByteStringName name ++ " " ++ haskellByteStri= ngLenName name hunk ./wxdirect/src/CompileClasses.hs 484 +haskellByteStringName name + =3D "bs_" ++ haskellName name + +haskellByteStringLenName name + =3D "bslen_" ++ haskellName name + hunk ./wxdirect/src/CompileClasses.hs 577 + ByteString Lazy -> "LB.ByteString" + ByteString _ -> "B.ByteString" hunk ./wxdirect/src/CompileClasses.hs 628 + ByteString _ -> "Ptr CChar -> IO CInt" hunk ./wxdirect/src/CompileClasses.hs 659 + ByteString Lazy -> "Ptr Word8 -> Int" + ByteString _ -> "Ptr CChar -> Int" hunk ./wxdirect/src/DeriveTypes.hs 396 + -- bytestring + (ByteStringLen,Arg name (ByteStringOut ctp) :args) + -> decl{ declRet =3D ByteString ctp, declArgs =3D reverse args } hunk ./wxdirect/src/ParseC.hs 146 + <|> do reserved "TByteData"; return Char + <|> do reserved "TByteStringOut"; return (ByteStringOut Strict) + <|> do reserved "TByteStringLazyOut"; return (ByteStringOut Lazy) + <|> do reserved "TByteStringLen"; return ByteStringLen hunk ./wxdirect/src/ParseC.hs 239 + <|> do reserved "TByteString"; return (ByteString Strict) + <|> do reserved "TByteStringLazy"; return (ByteString Lazy) hunk ./wxdirect/src/ParseC.hs 270 + ,"TByteData","TByteString","TByteStringOut","TByteSt= ringLen" hunk ./wxdirect/src/Types.hs 15 - , Decl(..), Arg(..), Type(..), CBaseType(..), argName + , Decl(..), Arg(..), Type(..), Strategy(..), CBaseType(..), ar= gName hunk ./wxdirect/src/Types.hs 88 + | ByteString Strategy + | ByteStringOut Strategy + | ByteStringLen hunk ./wxdirect/src/Types.hs 121 +data Strategy =3D Lazy | Strict + deriving (Eq,Show) } [Add Image / ByteString conversion functions (This is based on Jules Bean's= work). shelarcy <she...@gm...>**20081112142635] { hunk ./wxc/include/wxc_glue.h 2691 +TByteStringLen wxImage_ConvertToByteString( TSelf(wxImage) _obj, int type,= TByteStringOut data );=0D +TByteStringLen wxImage_ConvertToLazyByteString( TSelf(wxImage) _obj, int t= ype, TByteStringLazyOut data );=0D hunk ./wxc/include/wxc_glue.h 2696 +TClass(wxImage) wxImage_CreateFromByteString( TByteString(data,length), in= t type );=0D +TClass(wxImage) wxImage_CreateFromLazyByteString( TByteStringLazy(data,len= gth), int type );=0D hunk ./wxc/src/eljimage.cpp 15 +=0D +EWXWEXPORT(void*, wxImage_CreateFromByteString) (const char* data, size_t = length,int type)=0D +{=0D + wxMemoryInputStream in(data,length);=0D + return (void*) new wxImage(in, type);=0D +}=0D +=0D +EWXWEXPORT(void*, wxImage_CreateFromLazyByteString) (const char* data, siz= e_t length,int type)=0D +{=0D + wxMemoryInputStream in(data,length);=0D + return (void*) new wxImage(in, type);=0D +}=0D +=0D +EWXWEXPORT(size_t, wxImage_ConvertToByteString) (wxImage* _obj, int type, = char* data )=0D +{=0D + wxMemoryOutputStream out;=0D + _obj->SaveFile(out, type);=0D + size_t len =3D out.GetLength();=0D + return out.CopyTo(data, len);=0D +}=0D +=0D +EWXWEXPORT(size_t, wxImage_ConvertToLazyByteString) (wxImage* _obj, int ty= pe, char* data )=0D +{=0D + wxMemoryOutputStream out;=0D + _obj->SaveFile(out, type);=0D + size_t len =3D out.GetLength();=0D + return out.CopyTo(data, len);=0D +}=0D } Context: [small fix for searching haddock files. shelarcy <she...@gm...>**20081109135731] = [Use haddock-ghc as a haddock name, too. shelarcy <she...@gm...>**20081109053523 = Macports renames GHC's Haddock name to haddock-ghc. So, we use this name t= o detect haddock. If Macports and any other package system use haddock for GHC's haddock nam= e, we revert this change soonly. = This patch contains the following changes: = M ./configure +4 ] = [Use $hdoc instead of haddock to refer haddock name. shelarcy <she...@gm...>**20081109053154] = [Set Release version to 0.11.0 RC 1 shelarcy <she...@gm...>**20081108012347] = [Add GetOption / SetOption for Images (This is based on Jules Bean's work). shelarcy <she...@gm...>**20081107164839] = [Move -fvia-C compilation flag to configure option. This respect to GHC cha= nges. shelarcy <she...@gm...>**20081107125851] = [Add Cabal's short name to --enable-optimization and --enable-library-profi= ling option. shelarcy <she...@gm...>**20081107124417] = [Modernize FFI flags in source code. shelarcy <she...@gm...>**20081107065633] = [Fix: profiled version library doesn't use -dep-makefile option on GHC 6.10= .x. shelarcy <she...@gm...>**20081107065448] = [Add --enable-library-profiling option for respecting Cabal's option name. shelarcy <she...@gm...>**20081107061223] = [Fix: -hcprof option's argument can disable profiling options. shelarcy <she...@gm...>**20081107060448] = [Fix dropped optimization level and way to --enable-optimization option. shelarcy <she...@gm...>**20081107055743] = [Bump version number to 0.10.6 shelarcy <she...@gm...>**20081107035319] = [Fixed function name wxXmlResource_GetStyledTextCtrl mad...@ya...**20081107204215] = [Fix: undefined reference to wxXmlResource_GetStyledTextCtrl shelarcy <she...@gm...>**20081107021244] = [Fix: Camels sample don't run because of using undefined function since wxW= idgets 2.8.x support. shelarcy <she...@gm...>**20081028083424] = [Use DEPRECATED pragma instead of only haddock comment to describe deprecat= ed functions. shelarcy <she...@gm...>**20081028082515] = [Remove modification history from source code (Use darcs instead). shelarcy <she...@gm...>**20081028060925] = [Chnage source code's maintainer to be wxh...@li...= t. shelarcy <she...@gm...>**20081028060309] = [Fixed broken Haddock descriptions. shelarcy <she...@gm...>**20081028053650] = [Fix: BUILD_XRCGETCTRL_FN macro cause problem when using gcc. shelarcy <she...@gm...>**20081023141104] = [Small update to XRC support jer...@gm...**20081021104449] = [Add XRC support jer...@gm...**20081021095548] = [Use wxWidgets 2.8.9 in default when building on Windows. shelarcy <she...@gm...>**20081011042903] = [Bump version number to 0.10.5 shelarcy <she...@gm...>**20081011033152] = [Fix configure doesn't care about that users can install some version of pa= ckages. shelarcy <she...@gm...>**20081011032555] = [Use -dep-makefile instead of -optdep-f on GHC 6.10.x to avoid warning abou= t using dreprecated option message. shelarcy <she...@gm...>**20081010170230] = [Update changes.txt information by 0.10.4's changes. shelarcy <she...@gm...>**20081010160351] = [Update wx packages' description and dependency. shelarcy <she...@gm...>**20081010150113] = [Change SVG's auto-generated function name to be more friendly. shelarcy <she...@gm...>**20081010145951] = [Bump Cabal's version number to 0.10.4, too. shelarcy <she...@gm...>**20081009094345] = [Bump version number to 0.10.4 shelarcy <she...@gm...>**20081009092404] = [Fix make uninstall doesn't work well on GHC 6.10.x. shelarcy <she...@gm...>**20080930052522] = [Fix wxcore's depends field has two base package version. shelarcy <she...@gm...>**20080930052150] = [Only use wxEVT_MEDIA* when wxUSE_MEDIACTRL-flag is set mad...@ya...**20080919152917] = [Fix building with GHC 6.10.*. shelarcy <she...@gm...>**20080922155920] = [Change wxcAppUSleep to wxcMilliSleep (wxcAppUSleep is deprecated now). shelarcy <she...@gm...>**20080730094020] = [Removed unnecessary parameter from logSelect helper in Controls.hs WX samp= le jo...@gm...**20080812170441] = [Use meta tag for auto-redirect to Haskell wiki. Eric Kow <eri...@gm...>**20080805182057] = [Update links to homepage itself to point to Haskell wiki. Eric Kow <eri...@gm...>**20080805182031] = [Replace body of index.html with link to Haskell wiki Eric Kow <eri...@gm...>**20080805181958] = [Replace contents of pages which have been moved to Haskell wiki. Eric Kow <eri...@gm...>**20080805151503 Make these pages just a link to the WxHaskell part of the wiki. ] = [Update homepage menus to link to Haskell wiki. Eric Kow <eri...@gm...>**20080805150421] = [Fix typo in contribute.html Eric Kow <eri...@gm...>**20080805101258] = [Fix: we can't build wxc without wxGraphicsContext support. shelarcy <she...@gm...>**20080729111606] = [Use wxWidgets 2.8.8 in default when building on Windows. shelarcy <she...@gm...>**20080729105641] = [Fix building with old version of Visual Studio (according to John Lask). shelarcy <she...@gm...>**20080709063851] = [Fix: linking incorrect runtime on Visual Studio (pointed out by John Lask)= . shelarcy <she...@gm...>**20080709063820] = [Add download link to two GHC 6.8.3's binary. shelarcy <she...@gm...>**20080630144522] = [Fix Building without WXWIN_COMPATIBILITY_2_6 in eljrc.cpp. shelarcy <she...@gm...>**20080630120326] = [Fix: hardcoded keycode doesn't work well when using wxWidgets 2.8.x. shelarcy <she...@gm...>**20080630120118] = [Clean up duplicate ewxw_def.h file. shelarcy <she...@gm...>**20080628114449] = [Remove wxScintilla code (use wxStyledTextCtrl instead). shelarcy <she...@gm...>**20080626055907] = [Fix: eljdcsvg.cpp doesn't build other than Windows. shelarcy <she...@gm...>**20080625095858] = [Just reviving ELJ's wxXmlResource code. shelarcy <she...@gm...>**20080625052046] = [Use Int64 representing wxFileOffset type. shelarcy <she...@gm...>**20080624152015] = [Add dropped wxMedia's events to wxc. shelarcy <she...@gm...>**20080624140139] = [Add dropped wx*DCs. shelarcy <she...@gm...>**20080624122641] = [Update building information about --with-contrib option. shelarcy <she...@gm...>**20080624113243] = [Revive wxSVGFileDC code. shelarcy <she...@gm...>**20080624113214] = [Change --with-stc to --with-contrib for future contrib libraries support. shelarcy <she...@gm...>**20080624032429] = [Update information about builiding wxWidgets and wxc with Microsoft Visual= C++ Express Edition. shelarcy <she...@gm...>**20080624023628] = [Fix #1400488: Win install problem when path with spaces, e.g. "Program Fil= es". shelarcy <she...@gm...>**20080624020657] = [Partialy fix a bug in wxhaskell-register.bat. shelarcy <she...@gm...>**20080623152256] = [Add --enable-optimization opition for building library with optimization f= lags. shelarcy <she...@gm...>**20080531114050] = [Use CDouble and realToFrac instead of marshaling Double type directly. shelarcy <she...@gm...>**20080530024730] = [Remove unused make before-dist. shelarcy <she...@gm...>**20080529120234] = [Fix a bug in haddock documentation structure of Rectangle. shelarcy <she...@gm...>**20080529111415] = [Use putTraceMsg instead of hPutStrLn for Windows GUI-only program. shelarcy <she...@gm...>**20080526070627] = [Add very experimental wxGraphicsContext support. shelarcy <she...@gm...>**20080526063228] = [Change Point, Size, Vector and Rect to be type synonym for adding wxGraphi= csContext support. shelarcy <she...@gm...>**20080526055033] = [Fix: wxSound isn't managed object. shelarcy <she...@gm...>**20080524021436] = [Remove wxWidgets 2.4.x's wxWave code. shelarcy <she...@gm...>**20080430002921] = [Remove Wave type synonym. shelarcy <she...@gm...>**20080429233348] = [Change samples/contrib/PaintDirect to use withPixelBuffer instead of image= GetPixelBuffer. shelarcy <she...@gm...>**20080429232026] = [Change imageGetPixelArray and imageCreateFromPixelArray to be more flexibl= e. shelarcy <she...@gm...>**20080429183518] = [Fix: some samples don't run because of using undefined function since wxWi= dgets 2.8.x support. shelarcy <she...@gm...>**20080429145931] = [Add note about defaultButton's incompatible change since wxWidgets 2.8.x s= upport. shelarcy <she...@gm...>**20080429141545] = [Change Var type synonym from IORef to stm's TVar for thread safety. shelarcy <she...@gm...>**20080425114909] = [Fix: dists dropped two samples in samples/wx direcotory. shelarcy <she...@gm...>**20080425102416] = [Clean up wxWindows class's function declaration. shelarcy <she...@gm...>**20080425054152] = [Clean up #ifdef wxUSE_UNICODE flag by wxStrdup function. shelarcy <she...@gm...>**20080425051404] = [Replace _wcsdup with wxStrdup in wxWidgets 2.8 compat code. Eric Kow <eri...@gm...>**20080420115042 According to shelarcy and Jeremy, _wcsdup is Windows-specific. ] = [wxWidgets 2.8.7 on 0.10.3 release version jer...@gm...**20080410134132] = [TAG wxWidgets2.8.7_on_0.10.3rc1 jer...@gm...**20080410113256] = [Add TopLevelWindow for wxWidgets 2.8.7 support jer...@gm...**20080410113113] = [Preliminary wxWidgets 2.8.7 support jer...@gm...**20080410112559] = [Shifted to Pavel's Debian build system Mads Lindstroem <mad...@ya...>**20080413131752 = I have changed the current Debian build system to the one made by Pavel Shramov. It is a lot simpler than the current one. Also it is similar to what can normally be found in the Debian archieve, and I therefore assume that it will be easier to some day get an offecial WxHaskell Debian package. = All of the files in the debian directory is the work of Pavel. = I changed only one thing, as compared to Pavel's version. Namely that I removed the dependcy on libghc6-time-dev. I did it, as this dependency makes the package un-buildable on Debian unstable (GHC 6.8). At release 0.10.3, some users requested a GHC 6.8 version, and it is therefore important that we can provide one. = = ] = [Removed check for Data.Time Mads Lindstroem <mad...@ya...>**20080413114242 = Removed the check for Data.Time as it is not needed. I originally added it as I had somehow overlooked the Debian package libghc6-time-dev. Sorry about the unneccessary noise :( = ] = [Fix: samples/wx/makefile's "make clean" doesn't clean Windows things. shelarcy <she...@gm...>**20080409133446] = [Fix 1932640: samples/wx/FileBrowse is broken on Windows. = shelarcy <she...@gm...>**20080409132157] = [Add containers package dependency to wxcore.cabal. shelarcy <she...@gm...>**20080328131307] = [Remove IntMap from wxcore. Use the containers version instead. shelarcy <she...@gm...>**20080328131144] = [Add containers package to wxcore. shelarcy <she...@gm...>**20080328123744] = [Remove Set from wxdirect. Use the containers version instead. Eric Kow <eri...@gm...>**20080322140544] = [Remove Map from wxdirect. Use the containers version instead. Eric Kow <eri...@gm...>**20080322140245] = [Add containers package to wxdirect. Eric Kow <eri...@gm...>**20080322135933] = [Split makefile entry for wxdirect containers into separate lines. Eric Kow <eri...@gm...>**20080322135824 For more independence between patches which remove Map, Set and MultiSet in favour of the containers version. ] = [Use string comparison in haddockversion test. Eric Kow <eri...@gm...>**20080326224059 Again, for the case where haddock is not found. ] = [Fix bug in configure script if Haddock is not found. Eric Kow <eri...@gm...>**20080324155706 (discovered by S. Doaitse Swierstra) ] = [Add wx/license.txt to srcdist (to avoid build error). Eric Kow <eri...@gm...>**20080323125315] = [Fix download link typos. Eric Kow <eri...@gm...>**20080322130605] = [Kill a broken link (we no longer use CVS). Eric Kow <eri...@gm...>**20080322125822] = [Overwrite 0.10.3rc1 news with proper 0.10.3 news. Eric Kow <eri...@gm...>**20080322125032] = [TAG 0.10.3 Eric Kow <eri...@gm...>**20080321183613] = Patch bundle hash: 1f83b5c01f8b31a5ae0a3933787c3483dc97cc19 --=_-- . |