aardappel / treesheets

TreeSheets : Free Form Data Organizer (see strlen.com/treesheets)
zlib License
2.49k stars 184 forks source link

Possible to support wxGTK 3.0? #670

Open barracuda156 opened 3 weeks ago

barracuda156 commented 3 weeks ago

@aardappel Would it be possible to fix it for wxGTK 3.0? Currently the build reaches 94% and the breaks down:

[ 94%] Building CXX object CMakeFiles/treesheets.dir/src/main.cpp.o
/opt/local/bin/g++-mp-13 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -isystem /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/lib/wx/include/gtk3-unicode-3.0 -isystem /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/include/wx-3.0 -pipe -Os -DNDEBUG -I/opt/local/include -I/opt/local/libexec/dispatch/usr/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++20 -arch ppc -mmacosx-version-min=10.6 -MD -MT CMakeFiles/treesheets.dir/src/main.cpp.o -MF CMakeFiles/treesheets.dir/src/main.cpp.o.d -o CMakeFiles/treesheets.dir/src/main.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp:2:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/stdafx.h:29:10: fatal error: wx/bmpbndl.h: No such file or directory
   29 | #include <wx/bmpbndl.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

Dropping the header does not help, expectedly:

[ 94%] Building CXX object CMakeFiles/treesheets.dir/src/main.cpp.o
/opt/local/bin/g++-mp-13 -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -isystem /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/lib/wx/include/gtk3-unicode-3.0 -isystem /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/include/wx-3.0 -pipe -Os -DNDEBUG -I/opt/local/include -I/opt/local/libexec/dispatch/usr/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++20 -arch ppc -mmacosx-version-min=10.6 -MD -MT CMakeFiles/treesheets.dir/src/main.cpp.o -MF CMakeFiles/treesheets.dir/src/main.cpp.o.d -o CMakeFiles/treesheets.dir/src/main.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/include/wx-3.0/wx/defs.h:193,
                 from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/include/wx-3.0/wx/aboutdlg.h:13,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/stdafx.h:3,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp:2:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp:4:15: error: static assertion failed: wxWidgets < 3.2.3 is not supported.
    4 | static_assert(wxCHECK_VERSION(3, 2, 3), "wxWidgets < 3.2.3 is not supported.");
      |               ^~~~~~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp:320:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h:1102:23: error: 'wxDPIChangedEvent' has not been declared
 1102 |     void OnDPIChanged(wxDPIChangedEvent &dce) {
      |                       ^~~~~~~~~~~~~~~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp:318:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In constructor 'treesheets::ColorDropdown::ColorDropdown(wxWindow*, wxWindowID, int)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:88:52: error: 'FromDIP' was not declared in this scope
   88 |         Create(parent, id, L"", wxDefaultPosition, FromDIP(wxSize(44, 22)), as,
      |                                                    ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In member function 'virtual wxCoord treesheets::ColorDropdown::OnMeasureItem(size_t) const':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:95:55: error: 'FromDIP' was not declared in this scope
   95 |     wxCoord OnMeasureItem(size_t item) const { return FromDIP(22); }
      |                                                       ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In member function 'virtual wxCoord treesheets::ColorDropdown::OnMeasureItemWidth(size_t) const':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:96:60: error: 'FromDIP' was not declared in this scope
   96 |     wxCoord OnMeasureItemWidth(size_t item) const { return FromDIP(40); }
      |                                                            ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In constructor 'treesheets::ImageDropdown::ImageDropdown(wxWindow*, const wxString&)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:131:16: error: 'FromDIP' was not declared in this scope
  131 |                FromDIP(wxSize(image_space * 2, image_space)), as,
      |                ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In member function 'virtual wxCoord treesheets::ImageDropdown::OnMeasureItem(size_t) const':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:138:55: error: 'FromDIP' was not declared in this scope
  138 |     wxCoord OnMeasureItem(size_t item) const { return FromDIP(image_space); }
      |                                                       ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In member function 'virtual wxCoord treesheets::ImageDropdown::OnMeasureItemWidth(size_t) const':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:139:60: error: 'FromDIP' was not declared in this scope
  139 |     wxCoord OnMeasureItemWidth(size_t item) const { return FromDIP(image_space); }
      |                                                            ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In member function 'virtual void treesheets::ImageDropdown::OnDrawItem(wxDC&, const wxRect&, int, int) const':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:146:41: error: 'FromDIP' was not declared in this scope
  146 |         sys->ImageDraw(bm, dc, rect.x + FromDIP(3), rect.y + FromDIP(3));
      |                                         ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h: In member function 'void treesheets::ImageDropdown::FillBitmapVector(const wxString&)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/mywxtools.h:156:33: error: 'FromDIP' was not declared in this scope
  156 |                 ScaleBitmap(bm, FromDIP(1.0) / dd_icon_res_scale, *dbm);
      |                                 ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h: In constructor 'treesheets::MyFrame::MyFrame(wxString, treesheets::MyApp*)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h:92:15: error: 'FromDIP' was not declared in this scope
   92 |           csf(FromDIP(1.0)),
      |               ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h:643:46: warning: bitwise operation between different enumeration types 'wxBorder' and '<unnamed enum>' is deprecated [-Wdeprecated-enum-enum-conversion]
  643 |             tb = CreateToolBar(wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_FLAT | wxTB_NODIVIDER);
      |                                ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h: In lambda function:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h:655:43: error: 'wxBitmapBundle' has not been declared
  655 |                 tb->AddTool(action, name, wxBitmapBundle::FromSVGFile(file, wxSize(24, 24)), name,
      |                                           ^~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h: In member function 'void treesheets::MyFrame::RenderFolderIcon()':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h:1094:31: error: 'FromDIP' was not declared in this scope
 1094 |         ScaleBitmap(foldicon, FromDIP(1.0) / 3.0, foldicon);
      |                               ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h: In member function 'void treesheets::MyFrame::SetDPIAwareStatusWidths()':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h:1098:31: error: 'FromDIP' was not declared in this scope
 1098 |         int swidths[] = { -1, FromDIP(240), FromDIP(120), FromDIP(100) };
      |                               ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h: In member function 'void treesheets::MyFrame::OnDPIChanged(int&)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myframe.h:1106:19: error: 'FromDIP' was not declared in this scope
 1106 |             csf = FromDIP(1.0);
      |                   ^~~~~~~
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/main.cpp:329:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myevents.h: At global scope:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myevents.h:3:40: error: invalid use of non-static member function 'void treesheets::MyFrame::OnDPIChanged(int&)'
    3 |   EVT_DPI_CHANGED(treesheets::MyFrame::OnDPIChanged)
      |                                        ^~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myevents.h:3:3: error: 'EVT_DPI_CHANGED' was not declared in this scope; did you mean 'EVT_DISPLAY_CHANGED'?
    3 |   EVT_DPI_CHANGED(treesheets::MyFrame::OnDPIChanged)
      |   ^~~~~~~~~~~~~~~
      |   EVT_DISPLAY_CHANGED
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/include/wx-3.0/wx/app.h:19,
                 from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0-cxx11/include/wx-3.0/wx/aboutdlg.h:17:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myevents.h:4:3: error: expected '}' before 'wxEventTableEntry'
    4 |   EVT_SIZING(treesheets::MyFrame::OnSizing)
      |   ^~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myevents.h:2:1: note: to match this '{'
    2 | BEGIN_EVENT_TABLE(treesheets::MyFrame, wxFrame)
      | ^~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myevents.h:4:3: error: expected ',' or ';' before 'wxEventTableEntry'
    4 |   EVT_SIZING(treesheets::MyFrame::OnSizing)
      |   ^~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/treesheets-9435739325/src/myevents.h:19:1: error: expected declaration before '}' token
   19 | END_EVENT_TABLE()
      | ^~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/treesheets.dir/src/main.cpp.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_editors_treesheets/treesheets/work/build'
make[1]: *** [CMakeFiles/treesheets.dir/all] Error 2
aardappel commented 3 weeks ago

We rely on all sorts of features and fixes from more recent wxWidgets.. 3.0 was released over 10 years ago, it would not make sense to try and support old versions that far back.

barracuda156 commented 3 weeks ago

We rely on all sorts of features and fixes from more recent wxWidgets.. 3.0 was released over 10 years ago, it would not make sense to try and support old versions that far back.

@aardappel Will it be possible with limited functionality, i.e. instead of trying to actively support it, just conditionally disable some features?

If not, maybe you could refer me to the version which was last to support wxGTK 3.0? Or time frame at least, when support was dropped.

MacPorts has a rather old treesheets from 2021, and that one builds with no patches with wxGTK 3.0. I would like to update it, but I need to know which one to pick.

barracuda156 commented 3 weeks ago

Not too bad, actually. Save for a bug with redefined ssize_t which seems unfixed for years (but it is in a lobster library), 2023 version builds fine with wxGTK 3.0.

So perhaps it was not dropped long back, just too many tags are there to find out manually.

UPD. This might be the first breaking commit: https://github.com/aardappel/treesheets/commit/1e9f110bf876eed7bd9f17e8c3badf2c9c0be589

barracuda156 commented 3 weeks ago

@aardappel If you could recommend which version to pick, it would be helpful. Very likely that some number of initial breaking changes could be trivially reverted, and the app gonna work. But I cannot try every tag between April 8, 2023 (last version which builds) and the current master (which fails). Is there some sensible pick, which you think may still work with minimal changes to the code (I can handle that on my side, provided no rewriting is needed, and we can keep it locally in MacPorts).

aardappel commented 3 weeks ago

Even if it builds, we've run into many issues which were fixed on their side over the years (for which we may or may not have workarounds that may have been removed), meaning even it builds, random things may misbehave or crash.

We are also a very small project, and it is not worth our effort to try and have backwards compatibility.

Much better to build with newer libraries. You generally don't want to build against libraries in a package manager, instead use the latest from github.

barracuda156 commented 3 weeks ago

@aardappel Well, it is not that I do not like wxWidgets 3.2 for no reason :) It is just broken on older versions of macOS, native perhaps hopelessly, while the current wxGTK is just broken on any macOS: https://github.com/wxWidgets/wxWidgets/issues/24460

Of course a better way would be to fix wxGTK, but I have only that much time.

We are also a very small project, and it is not worth our effort to try and have backwards compatibility.

I perfectly understand. I only meant that if adding some macros once gonna fix it, it is worth doing. Ongoing rebasing is unmaintainable, of course, and neither I ask for that nor gonna do it myself for MacPorts.

I tried reverting a few breaking commits, but there are a lot, apparently, so for now I did this: https://github.com/macports/macports-ports/blob/e70331f4f156e4667bfcbdd513db9d11bcc84d7e/editors/treesheets/Portfile It allows a decently recent version to run on 10.6 on a PowerPC :)