Author Topic: Patched Code::Blocks works with wxWidgets trunk 2.9  (Read 14354 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Patched Code::Blocks works with wxWidgets trunk 2.9
« on: September 18, 2008, 09:09:03 pm »
FYI:

I have gotten the Code::Blocks's SDK, main, and compiler plugin to compile, link, and run.

I have used that wx29 version of Code::Blocks to re-compile, link, and run itself, again.

I have stopped updating patches for these plugins
  codesnippets http://forums.codeblocks.org/index.php/topic,9210.msg66001.html#msg66001
  keybinder
  browsetracker

The reason is I am now testing with debug wxWidgets and these plugins give too many messages of problems.

Tim S

Edit: Found new link that should help converting to wxWidgets 2.9
http://docs.wxwidgets.org/trunk/overview_changes_since28.html

Status
  Testing patches for CB SVN 5319 and wx29/trunk SVN 56858 on 2008-11-24; worked TBD.

« Last Edit: February 23, 2009, 11:29:19 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #1 on: September 19, 2008, 08:27:37 am »
If so, please respond to this post and I will work on posting the patches in this thread.
...BerliOS / here? Your decision. Go ahead! :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #2 on: September 19, 2008, 09:01:49 am »
I will post the small patches here for comments.

Note 1: All patches for wxSmith are located here http://forums.codeblocks.org/index.php/topic,9210.msg65877.html#msg65877
 
Note 2: All patches for codesnippets are located here http://forums.codeblocks.org/index.php/topic,9210.msg66001.html#msg66001

1. Bugfix patches for Code::Blocks normal build under ANSI (non-Unicode)  build.
   Have put these patches on Hold; not needed for wx29 Unicode build


2. wxWidgets 2.8 compatible patches worth applying to Code::Blocks even if you don't wish to link to wxWidget 2.9

2A. Submitted wxWidgets 2.8 compatible patches
[ Patch #1907 ] Patch XRC files for wxW28 with disable_compat26 Applied to SVN


2B. New wxWidgets 2.8 compatible patches

2B1. New wxWidgets 2.8 compatible very simple patches
Reason for this group of patches; changed types and deprecated methods were removed in wx29

Removed wxColour::Ok() use instead wxColour::IsOk()
The type wxBitmapType was changed from int to enum.
Has Been Applied to Code::Blocks SVN

2B2. New wxWidgets 2.8 compatible slightly complex patches,
I need to verify these work the same as non-patched code does.

My Filename is wx280_simplify_clarify-unix.patch
Code: [Select]
Index: src/sdk/configmanager.cpp
===================================================================
--- src/sdk/configmanager.cpp (revision 5206)
+++ src/sdk/configmanager.cpp (working copy)
@@ -281,9 +281,9 @@
         {
             size_t size = is->GetSize();
             wxString str;
-            wxChar* c = str.GetWriteBuf(size);
-            is->Read(c, size);
-            str.UngetWriteBuf(size);
+            // wxChar* c = str.GetWriteBuf(size);
+            is->Read(wxStringBuffer(str, size), size);
+            // str.UngetWriteBuf(size);
 
             doc = new TiXmlDocument();
 
Index: src/sdk/projectfile.cpp
===================================================================
--- src/sdk/projectfile.cpp (revision 5206)
+++ src/sdk/projectfile.cpp (working copy)
@@ -56,7 +56,10 @@
 
     file.Assign(path + new_name);
     relativeFilename = relativeFilename.BeforeLast(wxFILE_SEP_PATH);
-    relativeFilename.IsEmpty() || relativeFilename.Append(wxFILE_SEP_PATH);
+    if (!relativeFilename.IsEmpty())
+    {
+        relativeFilename.Append(wxFILE_SEP_PATH);
+    }
     relativeFilename.Append(new_name);
 
     if (project)
Index: src/sdk/crc32.cpp
===================================================================
--- src/sdk/crc32.cpp (revision 5206)
+++ src/sdk/crc32.cpp (working copy)
@@ -67,7 +67,7 @@
     wxUint32 crc = 0;
     unsigned int i = 0;
 
-    if (text)
+    if (!text.IsEmpty())
     {
         // Get the crc table, on first call, generate, otherwise do nothing
         crc_table = GetCRC32Table( crc_table ) ;
Index: src/plugins/contrib/devpak_plugin/mytar.cpp
===================================================================
--- src/plugins/contrib/devpak_plugin/mytar.cpp (revision 5206)
+++ src/plugins/contrib/devpak_plugin/mytar.cpp (working copy)
@@ -19,7 +19,7 @@
     m_SkipBytes(0),
     m_Size(0)
 {
-    if (filename)
+    if (!filename.IsEmpty())
         Open(filename);
 }
 
Index: src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp
===================================================================
--- src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp (revision 5206)
+++ src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp (working copy)
@@ -1846,7 +1846,7 @@
            #endif
 
             delete filetype;
-            if ( open )
+            if ( !open.IsEmpty() )
                 ::wxExecute( open, wxEXEC_ASYNC);
         }
     }
Index: src/src/app.cpp
===================================================================
--- src/src/app.cpp (revision 5206)
+++ src/src/app.cpp (working copy)
@@ -379,7 +379,7 @@
 
     const wxLanguageInfo *info;
 
-    if(lang)
+    if(!lang.IsEmpty())
         info = wxLocale::FindLanguageInfo(lang);
     else
         info = wxLocale::GetLanguageInfo(wxLANGUAGE_DEFAULT);


3. wxWidgets 2.8 compatible patches NOT worth applying to Code::Blocks if you don't wish to link to wxWidget 2.9

3A. Submitted wxWidgets 2.8 compatible patches
  None at this Time.

3B. compiler major warning and error reduction patch, attached as an z7ip file.
   My file wx28Xplus_use_wx_str-unix.patch is attached to this message as an 7Zipped file.
   This patch can be applied to Code::Blocks linked to wxWidgets 2.8; for testing.

4. wxWidgets 2.9 only compiler major warning and error reduction patches
   My file wx290_core-unix.patch is attached to this message as an 7Zipped file.

5. wxWidgets 2.9 only compiler minor warning reduction patch.
  Attached to below to another message below
  http://forums.codeblocks.org/index.php/topic,9210.msg66013.html#msg66013


Tim S

[attachment deleted by admin]
« Last Edit: November 03, 2008, 08:01:56 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #3 on: September 19, 2008, 09:11:55 am »
How I compiled wxWidgets 2.9 trunk SVN 56032


Changes done to setup.h
Code: [Select]
#define wxUSE_STC 0

Note: I tried turning off wxUSE_PROPGRID in order to try compiling wxSmith and it still failed.
Not, sure if wxUSE_PROPGRID should be 0 or 1. I decided 0 is best for wxUSE_PROPGRID
With wxUSE_PROPGRID = 0, I upgraded wxPropertGrid to version 1.2.12; next, I added two small propgrid patches for wx29. wxSmith now compiles & links. But, it has this code will crash at runtime warnings.

NOTE: wxUSE_STC must be 0 unless you are willing to fix a lot of C::B code.
Testing with WXWIN_COMPATIBILITY_2_6 = 1 because it avoids some problem. Will turn it off at an later date.
I an now testing with WXWIN_COMPATIBILITY_2_6 = 0.


Code: [Select]
mingw32-make -f makefile.gcc USE_PROPGRID=1 USE_STC=0 USE_XRC=1 USE_OPENGL=0 BUILD=release MONOLITHIC=1 SHARED=1


Tim S
« Last Edit: October 17, 2008, 07:49:17 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #4 on: September 21, 2008, 01:58:49 am »
This message is where the patches to get wxSmith plug-in to compile against wxWidgets 2.9 will be posted.

I have decided to redo my patches for wxSmith using wxWidgets 2.9.x wxPropertyGrid.

This will be more work, but will be better in the long run when wxWidgets 3.0 is released.

My file wx28Xplus_wxSmith-unix.patch is attached as 7Zipped File and is needed to link with wx29.
This file can used with wxWidgets 2.8 branch for testing.

My file wx290_wxSmith-unix.patch is attached as 7Zipped File and is needed to link with wx29.

My file wx280_wxPropertyGrid-unix.patch is attached as 7Zipped File and is NOT needed to link with wx29.
This file can used with wxWidgets 2.8 branch for testing.


[attachment deleted by admin]
« Last Edit: November 03, 2008, 08:02:26 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #5 on: September 24, 2008, 01:23:23 pm »
Patch to enable wxPropertyGrid 1.2.10 to link against wx2.9
Notice that I have wxPropertyGrid already updated to 1.2.12 in my local copy. This update is pending until I get the OK from Byo.

For the rest:
I have applied quite some of your fixes concerning wx26 already into SVN. Probably it's time for an update...!?

In addition: I have also applied some wx26 fixes for the resource files you were proposing. But I forgot where you did that... wasn't this also a patch at BerliOS? Mind ponting me to it?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #6 on: September 24, 2008, 03:42:08 pm »
This message is where the patches to get codesnippets plug-in to compile against wxWidgets 2.9 will be posted. Note, I have stopped updating this patch; no plans to update it till after 2.9.0 is released.

My File name is wx290_codesnippets-unix.patch
Code: [Select]
Index: src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp
===================================================================
--- src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp (revision 5270)
+++ src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp (working copy)
@@ -112,7 +112,7 @@
     wxString path = ConfigManager::GetFolder(sdDataUser) + _T("/lexers/");
     if (dir.Open(path))
     {
-        Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.c_str()));
+        Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.wx_str()));
         bool ok = dir.GetFirst(&filename, _T("lexer_*.xml"), wxDIR_FILES);
         while(ok)
         {
@@ -128,7 +128,7 @@
     path = ConfigManager::GetFolder(sdDataGlobal) + _T("/lexers/");
     if (dir.Open(path))
     {
-        Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.c_str()));
+        Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.wx_str()));
         bool ok = dir.GetFirst(&filename, _T("lexer_*.xml"), wxDIR_FILES);
         while(ok)
         {
Index: src/plugins/contrib/codesnippets/codesnippetsapp.cpp
===================================================================
--- src/plugins/contrib/codesnippets/codesnippetsapp.cpp (revision 5207)
+++ src/plugins/contrib/codesnippets/codesnippetsapp.cpp (working copy)
@@ -58,6 +58,12 @@
 
 //#include "../Utils/ToolBox/ToolBox.h" //debugging
 
+#if wxCHECK_VERSION(2,9,0)
+    #define CMDLINE_WXT(str) str
+#else
+    #define CMDLINE_WXT(str) wxT(str)
+#endif
+
 #ifndef APP_PREFIX
 #define APP_PREFIX ""
 #endif
@@ -1396,11 +1402,11 @@
 #if wxUSE_CMDLINE_PARSER
 const wxCmdLineEntryDesc cmdLineDesc[] =
 {
-    { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("show this help message"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
-    { wxCMD_LINE_OPTION, _T(""), _T("prefix"),  _T("the shared data dir prefix"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
-    { wxCMD_LINE_OPTION, _T("p"), _T("personality"),  _T("the personality to use: \"ask\" or <personality-name>"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
-    { wxCMD_LINE_OPTION, _T(""), _T("profile"),  _T("synonym to personality"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
-    { wxCMD_LINE_OPTION, _T(""), _T("KeepAlivePid"),  _T("launchers pid"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
+    { wxCMD_LINE_SWITCH, CMDLINE_WXT("h"), CMDLINE_WXT("help"), CMDLINE_WXT("show this help message"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
+    { wxCMD_LINE_OPTION, CMDLINE_WXT(""), CMDLINE_WXT("prefix"),  CMDLINE_WXT("the shared data dir prefix"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
+    { wxCMD_LINE_OPTION, CMDLINE_WXT("p"), CMDLINE_WXT("personality"),  CMDLINE_WXT("the personality to use: \"ask\" or <personality-name>"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
+    { wxCMD_LINE_OPTION, CMDLINE_WXT(""), CMDLINE_WXT("profile"),  CMDLINE_WXT("synonym to personality"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
+    { wxCMD_LINE_OPTION, CMDLINE_WXT(""), CMDLINE_WXT("KeepAlivePid"),  CMDLINE_WXT("launchers pid"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
     { wxCMD_LINE_NONE }
 };
 #endif // wxUSE_CMDLINE_PARSER
Index: src/plugins/contrib/codesnippets/snippetsconfig.cpp
===================================================================
--- src/plugins/contrib/codesnippets/snippetsconfig.cpp (revision 5211)
+++ src/plugins/contrib/codesnippets/snippetsconfig.cpp (working copy)
@@ -232,7 +232,7 @@
  cfgFile.Write( wxT("SnippetFolder"),   SettingsSnippetsFolder ) ;
  cfgFile.Write( wxT("ViewSearchBox"),   SettingsSearchBox ) ;
  cfgFile.Write( wxT("casesensitive"),   m_SearchConfig.caseSensitive ) ;
- cfgFile.Write( wxT("scope"),           m_SearchConfig.scope );
+ cfgFile.Write( wxT("scope"),           int(m_SearchConfig.scope) );
  cfgFile.Write( wxT("EditorsStayOnTop"),SettingsEditorsStayOnTop );
  if ( IsPlugin() )
  {   // Write ExternalPersistent for plugin use only
Index: src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp
===================================================================
--- src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp (revision 5211)
+++ src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp (working copy)
@@ -724,7 +724,7 @@
         wxString tmp(_T(' '), keywords.length()); // faster than using Alloc()
 
         const wxChar *src = keywords.c_str();
-        wxChar *dst = (wxChar *) tmp.c_str();
+        wxChar *dst = (wxChar *)(const wxChar *) tmp.c_str(); //FIXME
         wxChar c;
         size_t len = 0;
 
« Last Edit: October 17, 2008, 06:34:09 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #7 on: September 24, 2008, 03:59:05 pm »
[ Patch #1907 ] Patch XRC files for wxW28 with disable_compat26
[ Patch #2043 ] Patch CB Core files for wxW28 with disable_compat26
[ Patch #2565 ] Patch to remove wxADJUST_MINSIZE for wxW28 with disable_compat26
I have closed them all. Thanks!

Hopefully I didn't miss anything. Any chance you verify this, please?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #8 on: September 24, 2008, 04:10:03 pm »
Deleted Message to save space and readers time. Tim S
« Last Edit: October 17, 2008, 06:35:12 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #9 on: September 24, 2008, 04:16:34 pm »
[ Patch #1907 ] Patch XRC files for wxW28 with disable_compat26
OK - so this remains closed.

[ Patch #2043 ] Patch CB Core files for wxW28 with disable_compat26
All this wxFD_XXX stuff I did in commit #5125.
(To be honest: I did it myself, not knowing there is a patch for it. ;-))
Could you verify again and tell me if I really missed anything?

Edit: Ah! You did this with a #define hack! OK so this is obsolete than. I did it the "right" way by renaming all the wx thingies accross the sources. We are already non wx26 conform anyways... so we should do all wx28 stuff "properly".

[ Patch #2565 ] Patch to remove wxADJUST_MINSIZE for wxW28 with disable_compat26
I have re-opened this one... Although I believe it is applied, too...?! I'll double-check...

Edit: OK - I don't get this: I have compiled wx 2.8.9 with:
#define WXWIN_COMPATIBILITY_2_6 0
But the compiler does not complain about wxADJUST_MINSIZE???
« Last Edit: September 24, 2008, 04:21:42 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #10 on: September 24, 2008, 04:23:42 pm »
[ Patch #1907 ] Patch XRC files for wxW28 with disable_compat26
OK - so this remains closed.

I agree.

[ Patch #2043 ] Patch CB Core files for wxW28 with disable_compat26
All this wxFD_XXX stuff I did in commit #5125.
(To be honest: I did it myself, not knowing there is a patch for it. ;-))
Could you verify again and tell me if I really missed anything?

I will verify that the patch is still needed for this.
This patch is no longer needed, but there is an couple of places in wxSmith that might needs fixing still. They might only be test code, compiling C::B to see if error happens.

[ Patch #2565 ] Patch to remove wxADJUST_MINSIZE for wxW28 with disable_compat26
I have re-opened this one... Although I believe it is applied, too...?! I'll double-check...


These were added in the last few months, so your patch might have been before that.
This patch is still not applied.
It is an wxWidgets 2.9 bug, I will submit patch to them.
They applied the patch to wxWidgets trunk/2.9

« Last Edit: October 17, 2008, 06:49:26 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6799
    • My Best Post
Re: Patched Code::Blocks works with wxWidgets trunk 2.9
« Reply #11 on: September 24, 2008, 05:06:07 pm »
This message holds patch NOT needed to Compile Code::Blocks against wxWidgets 2.9.
This Patch just reduces the minor warning that have no importance to fix at this time.

My Filename is wx290_deprecate-unix.patch is attached as 7Zip file


[attachment deleted by admin]
« Last Edit: October 17, 2008, 07:00:42 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org