Skip to content

Commit 7eecf76

Browse files
committed
Merge branch 'maint16_2' into merge2to3
# Conflicts: # .github/workflows/tools.yml # src/core/list.h
2 parents 0bb6ddf + 6088b54 commit 7eecf76

8 files changed

Lines changed: 56 additions & 11 deletions

File tree

.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
- uses: msys2/setup-msys2@v2
8484
with:
8585
install: mingw-w64-x86_64-toolchain make automake autoconf
86-
- run: pacman -S --noconfirm mingw-w64-x86_64-wxmsw3.2
86+
- run: pacman -S --noconfirm mingw-w64-x86_64-wxwidgets3.2
8787
- run: aclocal
8888
- run: automake --add-missing
8989
- run: autoconf

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

doc/pygambit.api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Information about the game
130130
:toctree: api/
131131

132132
Outcome.label
133+
Outcome.number
133134
Outcome.game
134135

135136
.. autosummary::

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);

src/pygambit/outcome.pxi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class Outcome:
7272
warnings.warn("Another outcome with an identical label exists")
7373
self.outcome.deref().SetLabel(value.encode("ascii"))
7474

75+
@property
76+
def number(self) -> int:
77+
"""Returns the number of the outcome in the game.
78+
Outcomes are numbered starting with 0.
79+
"""
80+
return self.outcome.deref().GetNumber() - 1
81+
7582
def __getitem__(
7683
self, player: typing.Union[Player, str]
7784
) -> typing.Union[decimal.Decimal, Rational]:

0 commit comments

Comments
 (0)