Skip to content

Commit 3185b11

Browse files
committed
Move UI-independent tree layout to game
1 parent 36ec9df commit 3185b11

5 files changed

Lines changed: 13 additions & 15 deletions

File tree

Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ game_SOURCES = \
313313
src/games/file.cc \
314314
src/games/writer.cc \
315315
src/games/writer.h \
316+
src/games/layout.cc \
317+
src/games/layout.h \
316318
${agg_SOURCES} \
317319
src/games/nash.h
318320

@@ -589,8 +591,6 @@ gambit_SOURCES = \
589591
src/gui/gamedoc.h \
590592
src/gui/gameframe.cc \
591593
src/gui/gameframe.h \
592-
src/gui/layout.cc \
593-
src/gui/layout.h \
594594
src/gui/menuconst.h \
595595
src/gui/nfgpanel.cc \
596596
src/gui/nfgpanel.h \
File renamed without changes.

src/gui/layout.h renamed to src/games/layout.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// This file is part of Gambit
33
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
44
//
5-
// FILE: src/gui/efglayout.h
6-
// Interface to tree layout representation
5+
// FILE: src/games/layout.h
6+
// Interface to generic tree layout representation
77
//
88
// This program is free software; you can redistribute it and/or modify
99
// it under the terms of the GNU General Public License as published by
@@ -20,13 +20,13 @@
2020
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2121
//
2222

23-
#ifndef GAMBIT_LAYOUT_H
24-
#define GAMBIT_LAYOUT_H
25-
26-
#include "gambit.h"
23+
#ifndef GAMBIT_GAMES_TREELAYOUT_H
24+
#define GAMBIT_GAMES_TREELAYOUT_H
2725

2826
#include <map>
2927

28+
#include "gambit.h"
29+
3030
namespace Gambit {
3131
struct LayoutEntry {
3232
friend class Layout;
@@ -59,4 +59,5 @@ class Layout {
5959
double GetMaxOffset() const { return m_maxOffset; }
6060
};
6161
} // namespace Gambit
62-
#endif // GAMBIT_LAYOUT_H
62+
63+
#endif // GAMBIT_GAMES_TREELAYOUT_H

src/gui/efglayout.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
#include <wx/wx.h>
3030
#endif // WX_PRECOMP
3131

32-
#include "gambit.h"
33-
#include "efgdisplay.h"
34-
35-
#include "layout.h"
32+
#include "efglayout.h"
3633

3734
namespace Gambit::GUI {
3835
namespace {

src/gui/efglayout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "gambit.h"
2727
#include "gamedoc.h"
2828

29-
#include "layout.h"
29+
#include "games/layout.h"
3030

3131
namespace Gambit::GUI {
3232
class NodeEntry {
@@ -118,7 +118,7 @@ class TreeLayout final : public GameView {
118118

119119
/// Based on node levels and information set sublevels, compute the depth
120120
/// (X coordinate) of all nodes
121-
void ComputeNodeDepths(const Gambit::Layout &) const;
121+
void ComputeNodeDepths(const Layout &) const;
122122
void ComputeRenderedParents() const;
123123

124124
wxString CreateNodeLabel(const std::shared_ptr<NodeEntry> &, int) const;

0 commit comments

Comments
 (0)