Fix typo
[rattatechess.git] / search_gui.h
blob476b4d605b662204bb29b5075c3249c85d32ef55
1 /***************************************************************************
2 search_gui.h - Gui to view the search tree
3 -------------------
4 begin : Sat Oct 06 2007
5 copyright : (C) 2007 by Maurizio Monge
6 email : monge@linuz.sns.it
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef __SEARCH_GUI_H__
19 #define __SEARCH_GUI_H__
21 #ifndef NO_GUI
23 #include "engine.h"
24 #include <QObject>
25 class QTreeWidget;
26 class QTreeWidgetItem;
27 class QApplication;
29 class SearchGui : public QObject
31 Q_OBJECT
32 QApplication *app;
33 QTreeWidget *tree_widget;
35 int max_ply;
37 public:
38 const static int Italic = 1<<0;
39 const static int Bold = 1<<1;
40 const static int NoItalic = 1<<2;
41 const static int NoBold = 1<<3;
42 const static int Gray = 1<<4;
43 const static int Red = 1<<5;
44 const static int Green = 1<<6;
45 const static int Blue = 1<<7;
46 const static int Magenta = 1<<8;
47 SearchGui(int& argc, char** argv);
48 ~SearchGui();
50 static void apply_flags(QTreeWidgetItem* w, int flags);
51 void init_root();
52 void new_root_level(int depth);
53 void notify_msg(int ply, const char*, int flags);
54 void notify(const Board *board, Move m, int ply, int depth, int heuval, int alpha, int beta, int flags);
55 void notify_value(int ply, int value, int nodecount, int newflags);
56 void notify_eval(int ply, int value, int alpha, int beta, int flags);
57 void notify_hash(int ply, int lower, int upper, int depth, int alpha, int beta, Move best, bool write, int flags);
58 void wait_input();
59 void process_events();
62 #define DIFF_NODES (engine->processed_nodes-__nc)
63 #define GUI1(a) {uint64_t __nc = engine->processed_nodes; if(search_gui) { search_gui->a; } else {}
64 #define GUI2(a) if(search_gui) { search_gui->a; } else {} }
65 #define GUI(a) if(search_gui) search_gui->a; else {}
66 #define IFGUI(a) a
68 // #define GUI1(a)
69 // #define GUI2(a)
71 #else
73 class SearchGui
75 public:
76 const static int Italic = 1<<0;
77 const static int Bold = 1<<1;
78 const static int NoItalic = 1<<2;
79 const static int NoBold = 1<<3;
80 const static int Gray = 1<<4;
81 const static int Red = 1<<5;
82 const static int Green = 1<<6;
83 const static int Blue = 1<<7;
84 const static int Magenta = 1<<8;
86 SearchGui(int& argc, char** argv){}
87 ~SearchGui(){}
89 void init_root(){}
90 void new_root_level(int depth){}
91 void notify(Board *board, Move m, int ply, int depth, int heuval, int alpha, int beta, int flags){}
92 void notify_value(int ply, int value, int nodecount, int newflags){}
93 void notify_eval(int ply, int value, int alpha, int beta, int flags){}
94 void notify_hash(int ply, int lower, int upper, int depth, int alpha, int beta, Move best, bool write, int flags){}
95 void wait_input(){}
96 void process_events(){}
99 #define GUI1(a)
100 #define GUI2(a)
101 #define GUI(a)
102 #define IFGUI(a)
104 #endif
106 #endif //__SEARCH_GUI_H__