Debian Codegraph @

src/sgfpreview.cpp

raw symbols SCIP
1 #cxx . . $ `<file>/src/sgfpreview.cpp`/include "sgfpreview.h"cxx . . $ `<file>/src/sgfpreview.h`/
2 #include "ui_sgfpreview.h"cxx . . $ `<file>/build/ui/ui_sgfpreview.h`/
3 #include "displayboard.h"cxx . . $ `<file>/src/displayboard.h`/
4 #include "sgfparser.h"cxx . . $ `<file>/src/sgf/sgfparser.h`/
5 #include "gamedata.h"cxx . . $ `<file>/src/gamedata.h`/
6 #include "defines.h"cxx . . $ `<file>/src/defines.h`/
7 #include "mainwindow.h"cxx . . $ `<file>/src/mainwindow.h`/
8 #include "boardwindow.h"cxx . . $ `<file>/src/board/boardwindow.h`/
9
10 SGFPreviewcxx . . $ SGFPreview#::SGFPreviewcxx . . $ SGFPreview#SGFPreview(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent) :
11 QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent),
12 uicxx . . $ SGFPreview#ui.(new Uicxx . . $ Ui/::SGFPreviewcxx . . $ Ui/SGFPreview#)
13 {
14 MW_SGFparsercxx . . $ SGFPreview#MW_SGFparser. = new SGFParsercxx . . $ SGFParser#SGFParser(ed4f44641ad95fbd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
15 GameLoadedcxx . . $ SGFPreview#GameLoaded. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
16 uicxx . . $ SGFPreview#ui.->setupUicxx . . $ Ui_SGFPreview#setupUi(108f35f7aa7f3cf9).(this);
17 }
18
19 SGFPreviewcxx . . $ SGFPreview#::~cxx . . $ SGFPreview#`~SGFPreview`(ced63f7c635d850d).SGFPreviewcxx . . $ SGFPreview#()
20 {
21 if (GameLoadedcxx . . $ SGFPreview#GameLoaded. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
22 {
23 delete GameLoadedcxx . . $ SGFPreview#GameLoaded.;
24 GameLoadedcxx . . $ SGFPreview#GameLoaded. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
25 }
26 delete uicxx . . $ SGFPreview#ui.;
27 delete MW_SGFparsercxx . . $ SGFPreview#MW_SGFparser.;
28 }
29
30 void SGFPreviewcxx . . $ SGFPreview#::clearDatacxx . . $ SGFPreview#clearData(49f6e7a06ebc5aa8).()
31 {
32 if (GameLoadedcxx . . $ SGFPreview#GameLoaded. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
33 {
34 delete GameLoadedcxx . . $ SGFPreview#GameLoaded.;
35 GameLoadedcxx . . $ SGFPreview#GameLoaded. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
36 }
37 uicxx . . $ SGFPreview#ui.->displayBoardcxx . . $ Ui_SGFPreview#displayBoard.->clearDatacxx . . $ Board#clearData(49f6e7a06ebc5aa8).();
38
39 uicxx . . $ SGFPreview#ui.->File_WhitePlayercxx . . $ Ui_SGFPreview#File_WhitePlayer.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
40 uicxx . . $ SGFPreview#ui.->File_BlackPlayercxx . . $ Ui_SGFPreview#File_BlackPlayer.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
41 uicxx . . $ SGFPreview#ui.->File_Datecxx . . $ Ui_SGFPreview#File_Date.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
42 uicxx . . $ SGFPreview#ui.->File_Handicapcxx . . $ Ui_SGFPreview#File_Handicap.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
43 uicxx . . $ SGFPreview#ui.->File_Resultcxx . . $ Ui_SGFPreview#File_Result.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
44 uicxx . . $ SGFPreview#ui.->File_Komicxx . . $ Ui_SGFPreview#File_Komi.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
45 uicxx . . $ SGFPreview#ui.->File_Sizecxx . . $ Ui_SGFPreview#File_Size.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
46 }
47
48 void SGFPreviewcxx . . $ SGFPreview#::setPathcxx . . $ SGFPreview#setPath(7df51288a9ebd664).(QStringcxx . . $ QString# path)
49 {
50 //if (QFileInfo("path").isFile() == false)
51 // return;
52 clearDatacxx . . $ SGFPreview#clearData(49f6e7a06ebc5aa8).();
53
54 //fileLoaded = path.toLatin1().constData();
55 SGFloadedcxx . . $ SGFPreview#SGFloaded. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). MW_SGFparsercxx . . $ SGFPreview#MW_SGFparser.->loadFilecxx . . $ SGFParser#loadFile(fd988a2ab94d906b).(path);
56 if (SGFloadedcxx . . $ SGFPreview#SGFloaded. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
57 {
58 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! isValidSGFcxx . . $ SGFPreview#isValidSGF(b45ddcbc8423892c).(false);
59 return;
60 }
61
62 GameLoadedcxx . . $ SGFPreview#GameLoaded. = MW_SGFparsercxx . . $ SGFPreview#MW_SGFparser.->initGamecxx . . $ SGFParser#initGame(a4526618b9a7c13a).(SGFloadedcxx . . $ SGFPreview#SGFloaded., path);
63 if (GameLoadedcxx . . $ SGFPreview#GameLoaded. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
64 {
65 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! isValidSGFcxx . . $ SGFPreview#isValidSGF(b45ddcbc8423892c).(false);
66 return;
67 }
68
69 GameLoadedcxx . . $ SGFPreview#GameLoaded.->gameModecxx . . $ GameData#gameMode. = modeEditcxx . . $ modeEdit.;
70
71 QStringcxx . . $ QString# komicxx . . $ QString#QString(ced63f7c635d850d)., hcpcxx . . $ QString#QString(ced63f7c635d850d)., szcxx . . $ QString#QString(ced63f7c635d850d).;
72 komi.setNumcxx . . $ QString#setNum(2a15175f7e5f7b33).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->komicxx . . $ GameData#komi.);
73 hcp.setNumcxx . . $ QString#setNum(f2f57eac52a15405).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->handicapcxx . . $ GameData#handicap.);
74 sz.setNumcxx . . $ QString#setNum(f2f57eac52a15405).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->board_sizecxx . . $ GameData#board_size.);
75
76 uicxx . . $ SGFPreview#ui.->File_WhitePlayercxx . . $ Ui_SGFPreview#File_WhitePlayer.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->white_namecxx . . $ GameData#white_name.);
77 uicxx . . $ SGFPreview#ui.->File_BlackPlayercxx . . $ Ui_SGFPreview#File_BlackPlayer.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->black_namecxx . . $ GameData#black_name.);
78 uicxx . . $ SGFPreview#ui.->File_Datecxx . . $ Ui_SGFPreview#File_Date.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->datecxx . . $ GameData#date.);
79 uicxx . . $ SGFPreview#ui.->File_Handicapcxx . . $ Ui_SGFPreview#File_Handicap.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(hcp);
80 uicxx . . $ SGFPreview#ui.->File_Resultcxx . . $ Ui_SGFPreview#File_Result.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->resultcxx . . $ GameData#result.);
81 uicxx . . $ SGFPreview#ui.->File_Komicxx . . $ Ui_SGFPreview#File_Komi.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(komi);
82 uicxx . . $ SGFPreview#ui.->File_Sizecxx . . $ Ui_SGFPreview#File_Size.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(sz);
83
84 DisplayBoardcxx . . $ DisplayBoard#* board = uicxx . . $ SGFPreview#ui.->displayBoardcxx . . $ Ui_SGFPreview#displayBoard.;
85 board->clearDatacxx . . $ Board#clearData(49f6e7a06ebc5aa8).();
86 if (board->getSizecxx . . $ Board#getSize(db52760e79bf9054).() != GameLoadedcxx . . $ SGFPreview#GameLoaded.->board_sizecxx . . $ GameData#board_size.)
87 board->initcxx . . $ Board#init(d4f767463ce0a6b3).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->board_sizecxx . . $ GameData#board_size.);
88
89 board->displayHandicapcxx . . $ DisplayBoard#displayHandicap(d4f767463ce0a6b3).(GameLoadedcxx . . $ SGFPreview#GameLoaded.->handicapcxx . . $ GameData#handicap.);
90
91 QStringcxx . . $ QString# s = SGFloadedcxx . . $ SGFPreview#SGFloaded..trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
92 int end_main = s.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(")("cxx . . $ QString#QString(85c52e162fed56f9).);
93 if (end_main == -1)
94 end_main = s.sizecxx . . $ QString#size(455f465bc33b4cdf).();
95 int a_offset = QCharcxx . . $ QChar#::fromLatin1cxx . . $ QChar#fromLatin1(b9892872559b4892).('a').unicodecxx . . $ QChar#unicode(36716fbdc4fec2be).() - 1 ;
96 int cursor = 0;
97 int x,y;
98 int nb_displayed = 20;
99 QStringcxx . . $ QString# coordscxx . . $ QString#QString(ced63f7c635d850d).;
100
101 cursor = s.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(";B["cxx . . $ QString#QString(85c52e162fed56f9).);
102
103 while ((cursor >0) && (cursor < end_main) && (nb_displayed--) )
104 {
105 x = s.atcxx . . $ QString#at(13af7ae5a875439e).(cursor+3).unicodecxx . . $ QChar#unicode(fdddb4f32d8ba90f).() - a_offset;
106 y = s.atcxx . . $ QString#at(13af7ae5a875439e).(cursor+4).unicodecxx . . $ QChar#unicode(fdddb4f32d8ba90f).() - a_offset;
107 board->updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneBlackcxx . . $ stoneBlack.,x,y);
108 cursor = s.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(";B["cxx . . $ QString#QString(85c52e162fed56f9).,cursor +1);
109
110 }
111
112 cursor = s.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(";W["cxx . . $ QString#QString(85c52e162fed56f9).);
113 nb_displayed = 20;
114
115 while ( (cursor >0) && (cursor < end_main) && (nb_displayed--) )
116 {
117 x = s.atcxx . . $ QString#at(13af7ae5a875439e).(cursor+3).unicodecxx . . $ QChar#unicode(fdddb4f32d8ba90f).() - a_offset;
118 y = s.atcxx . . $ QString#at(13af7ae5a875439e).(cursor+4).unicodecxx . . $ QChar#unicode(fdddb4f32d8ba90f).() - a_offset;
119 board->updateStonecxx . . $ Board#updateStone(615937dc839e801b).(stoneWhitecxx . . $ stoneWhite.,x,y);
120 cursor = s.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(";W["cxx . . $ QString#QString(85c52e162fed56f9).,cursor +1);
121
122 }
123 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! isValidSGFcxx . . $ SGFPreview#isValidSGF(b45ddcbc8423892c).(true);
124 }
125
126 // Maybe handle computer games separately.
127 // Here is the old code that was supposed to do that.
128 /*void MainWindow::slot_loadComputerFile(const QModelIndex & topLeft, const QModelIndex & bottomRight )
129 {
130 QVariant v = topLeft.data(QDirModel::FilePathRole);
131
132 if (!selectFile(topLeft))
133 {
134 ui.button_loadComputerGame->setDisabled(true);
135 } else {
136 GameLoaded->gameMode = modeComputer;
137 ui.button_loadComputerGame->setEnabled(true);
138
139 QString komi, hcp, sz;
140 komi.setNum(GameLoaded->komi);
141 hcp.setNum(GameLoaded->handicap);
142 sz.setNum(GameLoaded->board_size);
143
144 ui.File_WhitePlayer->setText(GameLoaded->white_name);
145 ui.File_BlackPlayer->setText(GameLoaded->black_name);
146 ui.File_Date->setText(GameLoaded->date);
147 ui.File_Handicap->setText(hcp);
148 ui.File_Result->setText(GameLoaded->result);
149 ui.File_Komi->setText(komi);
150 ui.File_Size->setText(sz);
151
152 displayGame(ui.displayBoard);
153 }
154 }*/