From: Jeremy O'D. <jer...@gm...> - 2008-10-21 10:59:59
Attachments:
xrc.patch
|
Hi all, Attached is a set of patches to enable XRC support in wxHaskell Darcs head, along with a couple of samples (in the samples/test/XRCControls directory) showing how to use the new functionality. They have only really been tested on Windows, so it would help if people can look for bugs on other platforms. I have some text ready for the wxHaskell wiki to help people to try this stuff for themselves, which I'll put in once the patch has been pushed. I'm also in the process of translating the 'Real World Haskell' HPodder example from GtkHs to wxHaskell, with some accompanying tutorial text, in the hope that it will help us to showcase wxHaskell when RWH becomes available. I should have the wxHPodder sample finished in a few days, but I want to talk to the RWH authors to see how they would prefer us to make this available (they may prefer that it is not distributed as part of wxHaskell, for example). Regards Jeremy -- Jeremy O'Donoghue jer...@gm... |
From: shelarcy <she...@gm...> - 2008-10-23 12:59:58
|
Hi, On Tue, 21 Oct 2008 19:59:52 +0900, Jeremy O'Donoghue <jer...@gm...> wrote: > Attached is a set of patches to enable XRC support in wxHaskell Darcs > head, along with a couple of samples (in the samples/test/XRCControls > directory) showing how to use the new functionality. They have only > really been tested on Windows, so it would help if people can look for > bugs on other platforms. I got error when building wxc with xrc.patch on Mac OS X platform. g++ -c wxc/src/eljrc.cpp -o dist/wxc/eljrc.o -MD -DwxcREFUSE_MEDIACTRL -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -DwxUSE_STC=1 -DwxUSE_SVG=1 -fPIC -Iwxc/include wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a valid preprocessing token wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a valid preprocessing token wxc/src/eljrc.cpp:438:1: error: pasting "wxBoxSizer" and "*" does not give a valid preprocessing token (snip) make: *** [dist/wxc/eljrc.o] Error 1 Build Failed. It seems that BUILD_XRCGETCTRL_FN macro causes problem. Does anyone knows how to solve this problem? My Mac's gcc version is 4.0.1. shelarcy$ gcc -v Using built-in specs. Target: i686-apple-darwin9 Configured with: /var/tmp/gcc/gcc-5484~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9 Thread model: posix gcc version 4.0.1 (Apple Inc. build 5484) Best Regards, -- shelarcy <shelarcy hotmail.co.jp> http://page.freett.com/shelarcy/ |
From: shelarcy <she...@gm...> - 2008-10-23 14:44:10
|
On Thu, 23 Oct 2008 21:59:36 +0900, shelarcy <she...@gm...> wrote: > I got error when building wxc with xrc.patch on Mac OS X platform. > > g++ -c wxc/src/eljrc.cpp -o dist/wxc/eljrc.o -MD -DwxcREFUSE_MEDIACTRL -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -DwxUSE_STC=1 -DwxUSE_SVG=1 -fPIC -Iwxc/include > wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a valid preprocessing token > wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a valid preprocessing token > wxc/src/eljrc.cpp:438:1: error: pasting "wxBoxSizer" and "*" does not give a valid preprocessing token > (snip) > make: *** [dist/wxc/eljrc.o] Error 1 > Build Failed. > > It seems that BUILD_XRCGETCTRL_FN macro causes problem. Does anyone knows > how to solve this problem? I fixed problem by below way. hunk ./wxc/src/eljrc.cpp 432 - EWXWEXPORT(wx##_typ##*, wxXmlResource_Get##_typ)(wxWindow* _win, wxString* _str_id) \ + EWXWEXPORT(wx##_typ *, wxXmlResource_Get##_typ)(wxWindow* _win, wxString* _str_id) \ hunk ./wxc/src/eljrc.cpp 434 - return reinterpret_cast<wx##_typ##*>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id))); \ + return reinterpret_cast<wx##_typ *>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id))); \ After modifying this part, samples work on Mac OS X, too. -- shelarcy <shelarcy hotmail.co.jp> http://page.freett.com/shelarcy/ |
From: Jeremy O'D. <jer...@gm...> - 2008-10-23 16:58:24
|
Hi Shelarcy, I'll try it on my Mac when I get home - could prove to be a pre-processor difference between Visual Studio and GCC. In the two cases given, I'd expect the BUILD_XRCGETCTRL_FN macro to expand as follows: Where _typ is Sizer EWXWEXPORT(wxSizer*, wxXmlResource_GetSizer)(wxWindow* _win, wxString* _str_id) { return reinterpret_cast<wxSizer*>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id)); } Where _typ is BoxSizer EWXWEXPORT(wxBoxSizer*, wxXmlResource_GetBoxSizer)(wxWindow* _win, wxString* _str_id) { return reinterpret_cast<wxBoxSizer*>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id)); } One thing to try: does adding a space after the paste tokens and before the '*' tokens help? (i.e. #define BUILD_XRCGETCTRL_FN(_typ) \ EWXWEXPORT(wx##_typ## *, wxXmlResource_Get##_typ)(wxWindow* _win, wxString* _str_id) \ { \ return reinterpret_cast<wx##_typ## *>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id))); \ } Alternatively, it's pretty easy to replace the auto-generated functions with the manually created versions. If you find that the extra space suggestion above does not work, I'll do a patch tomorrow with each of the functions implemented in full. Regards Jeremy On Thu, 23 Oct 2008 21:59:36 +0900, "shelarcy" <she...@gm...> said: > Hi, > > On Tue, 21 Oct 2008 19:59:52 +0900, Jeremy O'Donoghue > <jer...@gm...> wrote: > > Attached is a set of patches to enable XRC support in wxHaskell Darcs > > head, along with a couple of samples (in the samples/test/XRCControls > > directory) showing how to use the new functionality. They have only > > really been tested on Windows, so it would help if people can look for > > bugs on other platforms. > > I got error when building wxc with xrc.patch on Mac OS X platform. > > g++ -c wxc/src/eljrc.cpp -o dist/wxc/eljrc.o -MD -DwxcREFUSE_MEDIACTRL > -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/include/wx-2.8 > -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ > -DwxUSE_STC=1 -DwxUSE_SVG=1 -fPIC -Iwxc/include > wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a > valid preprocessing token > wxc/src/eljrc.cpp:437:1: error: pasting "wxSizer" and "*" does not give a > valid preprocessing token > wxc/src/eljrc.cpp:438:1: error: pasting "wxBoxSizer" and "*" does not > give a valid preprocessing token > (snip) > make: *** [dist/wxc/eljrc.o] Error 1 > Build Failed. > > It seems that BUILD_XRCGETCTRL_FN macro causes problem. Does anyone knows > how to solve this problem? > > My Mac's gcc version is 4.0.1. > > shelarcy$ gcc -v > Using built-in specs. > Target: i686-apple-darwin9 > Configured with: /var/tmp/gcc/gcc-5484~1/src/configure --disable-checking > -enable-werror --prefix=/usr --mandir=/share/man > --enable-languages=c,objc,c++,obj-c++ > --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ > --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib > --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic > --host=i686-apple-darwin9 --target=i686-apple-darwin9 > Thread model: posix > gcc version 4.0.1 (Apple Inc. build 5484) > > > Best Regards, > > -- > shelarcy <shelarcy hotmail.co.jp> > http://page.freett.com/shelarcy/ -- Jeremy O'Donoghue jer...@gm... |
From: shelarcy <she...@gm...> - 2008-10-24 01:57:11
Attachments:
fix_macro.dpatch
|
Hi Jeremy, On Fri, 24 Oct 2008 01:58:18 +0900, Jeremy O'Donoghue <jer...@gm...> wrote: > One thing to try: does adding a space after the paste tokens and before > the '*' tokens help? I fixed problem by this definition that I sent before mail. #define BUILD_XRCGETCTRL_FN(_typ) \ EWXWEXPORT(wx##_typ *, wxXmlResource_Get##_typ)(wxWindow* _win, wxString* _str_id) \ { \ return reinterpret_cast<wx##_typ *>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id))); \ } http://sourceforge.net/mailarchive/message.php?msg_name=op.ujhe65qag8rhh0%40shelarcywin.localdomain But your definition doesn't solve this problem. > (i.e. > > #define BUILD_XRCGETCTRL_FN(_typ) > \ > EWXWEXPORT(wx##_typ## *, wxXmlResource_Get##_typ)(wxWindow* _win, > wxString* _str_id) \ > { > \ > return reinterpret_cast<wx##_typ## > *>(_win->FindWindow(wxXmlResource::GetXRCID(*_str_id))); \ > } > > Alternatively, it's pretty easy to replace the auto-generated functions > with the manually created versions. If you find that the extra space > suggestion above does not work, I'll do a patch tomorrow with each of > the functions implemented in full. Anyway, I fixed this problem now. So you don't have to replace auto-generated functions with the manually created versions. I attached the newer patch in this mail. Best Regards, -- shelarcy <shelarcy hotmail.co.jp> http://page.freett.com/shelarcy/ |
From: shelarcy <she...@gm...> - 2008-10-28 02:48:21
|
On Tue, 21 Oct 2008 19:59:52 +0900, Jeremy O'Donoghue <jer...@gm...> wrote: > Attached is a set of patches to enable XRC support in wxHaskell Darcs > head, along with a couple of samples (in the samples/test/XRCControls > directory) showing how to use the new functionality. A week past from your mail. So, I pushed that with my patch for gcc's. > I have some text ready for the wxHaskell wiki to help people to try this > stuff for themselves, which I'll put in once the patch has been pushed. Go ahead, please. Best Regards, -- shelarcy <shelarcy hotmail.co.jp> http://page.freett.com/shelarcy/ |