Skip to content

Commit 5cbca2d

Browse files
committed
Backport support for wxWidgets 3.3, bump minimum to 3.2
This updates to support wxWidgets 3.3. This amounts to replacing an obsolete version of the `wxDropTarget` constructor with a version that also works under 3.2. This also bumps the minimum wxWidgets version to 3.2 from 3.1.
1 parent 0340314 commit 5cbca2d

7 files changed

Lines changed: 50 additions & 15 deletions

File tree

.clang-tidy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ Checks: |
1010
-modernize-concat-nested-namespaces,
1111
cppcoreguidelines-pro-type-cstyle-cast,
1212
cppcoreguidelines-pro-type-member-init,
13-
cppcoreguidelines-prefer-member-initializer,
14-
misc-const-correctness
13+
cppcoreguidelines-prefer-member-initializer
1514
WarningsAsErrors: '*'
1615
# Don't bother with wxWidgets headers
1716
HeaderFilterRegex: '^((?!labenski).)*$'
18-
AnalyzeTemporaryDtors: false
1917
FormatStyle: none
2018
User: arbiter
2119
CheckOptions:

.github/workflows/osxbinary.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: MacOS static GUI binary
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
schedule:
8+
- cron: '0 6 * * 4'
9+
10+
jobs:
11+
macos-13:
12+
runs-on: macos-13
13+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Install dependencies
17+
run: |
18+
brew install automake autoconf
19+
curl -L -O https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.8/wxWidgets-3.2.8.tar.bz2
20+
tar xjf wxWidgets-3.2.8.tar.bz2
21+
cd wxWidgets-3.2.8
22+
mkdir build-release
23+
cd build-release
24+
../configure --disable-shared --disable-sys-libs
25+
make -j4
26+
sudo make install
27+
- run: aclocal
28+
- run: automake --add-missing
29+
- run: autoconf
30+
- run: ./configure
31+
- run: make
32+
- run: sudo make install
33+
- run: make osx-dmg
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
name: artifact-osx-13
37+
path: "*.dmg"

.github/workflows/tools.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
steps:
4141
- uses: actions/checkout@v4
4242
- name: Install dependencies
43-
run: brew install automake autoconf wxwidgets@3.2
43+
run: brew install automake autoconf wxwidgets
4444
- run: aclocal
4545
- run: automake --add-missing
4646
- run: autoconf
47-
- run: ./configure --with-wx-config=wx-config-3.2
47+
- run: ./configure
4848
- run: make
4949
- run: sudo make install
5050
- run: make osx-dmg

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ if test x$with_gui = xtrue; then
6363
dnl------------------------
6464

6565
dnl check for wx-config
66-
AM_PATH_WXCONFIG(3.1.0, WXCONFIG=1)
66+
AM_PATH_WXCONFIG(3.2.0, WXCONFIG=1)
6767
if test "$WXCONFIG" != 1; then
6868
AC_MSG_WARN([
6969
Did not find a new enough version of wxWidgets; disabling build of
7070
graphical interface. If you want to build the graphical interface,
7171
please check that wx-config is in path, the directory
7272
where wxWidgets libraries are installed (returned by
7373
'wx-config --libs' command) is in LD_LIBRARY_PATH or
74-
equivalent variable and wxWidgets is version 3.1.0 or above.
74+
equivalent variable and wxWidgets is version 3.2.0 or above.
7575
])
7676
AM_CONDITIONAL(WITH_GUI, test x0 = x1)
7777
fi

src/gui/efgdisplay.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ void gbtEfgDisplay::OnMouseMotion(wxMouseEvent &p_event)
866866
// Copy subtree
867867
wxBitmap bitmap(tree_xpm);
868868
#if defined(__WXMSW__) or defined(__WXMAC__)
869-
wxImage image = bitmap.ConvertToImage();
869+
const auto image = wxCursor(bitmap.ConvertToImage());
870870
#else
871871
wxIcon image;
872872
image.CopyFromBitmap(bitmap);
@@ -881,7 +881,7 @@ void gbtEfgDisplay::OnMouseMotion(wxMouseEvent &p_event)
881881
// This should be the pawn icon!
882882
wxBitmap bitmap(move_xpm);
883883
#if defined(__WXMSW__) or defined(__WXMAC__)
884-
wxImage image = bitmap.ConvertToImage();
884+
const auto image = wxCursor(bitmap.ConvertToImage());
885885
#else
886886
wxIcon image;
887887
image.CopyFromBitmap(bitmap);
@@ -896,7 +896,7 @@ void gbtEfgDisplay::OnMouseMotion(wxMouseEvent &p_event)
896896
// Move subtree
897897
wxBitmap bitmap(tree_xpm);
898898
#if defined(__WXMSW__) or defined(__WXMAC__)
899-
wxImage image = bitmap.ConvertToImage();
899+
const auto image = wxCursor(bitmap.ConvertToImage());
900900
#else
901901
wxIcon image;
902902
image.CopyFromBitmap(bitmap);
@@ -915,7 +915,7 @@ void gbtEfgDisplay::OnMouseMotion(wxMouseEvent &p_event)
915915
if (node && node->GetOutcome()) {
916916
wxBitmap bitmap = MakeOutcomeBitmap();
917917
#if defined(__WXMSW__) or defined(__WXMAC__)
918-
wxImage image = bitmap.ConvertToImage();
918+
const auto image = wxCursor(bitmap.ConvertToImage());
919919
#else
920920
wxIcon image;
921921
image.CopyFromBitmap(bitmap);

src/gui/efgpanel.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ gbtTreePlayerIcon::gbtTreePlayerIcon(wxWindow *p_parent, int p_player)
198198

199199
void gbtTreePlayerIcon::OnLeftClick(wxMouseEvent &)
200200
{
201-
wxBitmap bitmap(person_xpm);
201+
const wxBitmap bitmap(person_xpm);
202202

203203
#if defined(__WXMSW__) or defined(__WXMAC__)
204-
wxImage image = bitmap.ConvertToImage();
204+
const auto image = wxCursor(bitmap.ConvertToImage());
205205
#else
206206
wxIcon image;
207207
image.CopyFromBitmap(bitmap);
@@ -460,7 +460,7 @@ void gbtTreeChanceIcon::OnLeftClick(wxMouseEvent &)
460460
wxBitmap bitmap(dice_xpm);
461461

462462
#if defined(__WXMSW__) or defined(__WXMAC__)
463-
wxImage image = bitmap.ConvertToImage();
463+
const auto image = wxCursor(bitmap.ConvertToImage());
464464
#else
465465
wxIcon image;
466466
image.CopyFromBitmap(bitmap);

src/gui/nfgpanel.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void gbtTablePlayerIcon::OnLeftClick(wxMouseEvent &)
6969
wxBitmap bitmap(person_xpm);
7070

7171
#if defined(__WXMSW__) or defined(__WXMAC__)
72-
wxImage image = bitmap.ConvertToImage();
72+
const auto image = wxCursor(bitmap.ConvertToImage());
7373
#else
7474
wxIcon image;
7575
image.CopyFromBitmap(bitmap);

0 commit comments

Comments
 (0)