Changed eval: bishop pair, dynamic rook and knight. Small cleanup.
[rattatechess.git] / search_gui.h
blob2a1ff811907f5090e25238dd14f78794f471c78a
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 public:
36 const static int Italic = 1<<0;
37 const static int Bold = 1<<1;
38 const static int NoItalic = 1<<2;
39 const static int NoBold = 1<<3;
40 const static int Gray = 1<<4;
41 const static int Red = 1<<5;
42 const static int Green = 1<<6;
43 const static int Blue = 1<<7;
44 const static int Magenta = 1<<8;
45 SearchGui(int& argc, char** argv);
46 ~SearchGui();
48 static void apply_flags(QTreeWidgetItem* w, int flags);
49 void init_root();
50 void new_root_level(int depth);
51 void notify(Move m, int ply, int depth, int heuval, int alpha, int beta, int flags);
52 void notify_value(int ply, int value, int nodecount, int newflags);
53 void notify_eval(int ply, int value, int alpha, int beta, int flags);
54 void notify_hash(int ply, int lower, int upper, int depth, int alpha, int beta, Move best, bool write, int flags);
55 void wait_input();
56 void process_events();
59 #define DIFF_NODES (processed_nodes-__nc)
60 #define GUI1(a) {uint64_t __nc = processed_nodes; if(search_gui) search_gui->a; else {}
61 #define GUI2(a) if(search_gui) search_gui->a; else {} }
62 #define GUI(a) if(search_gui) search_gui->a; else {}
63 #define IFGUI(a) a
65 #else
67 class SearchGui
69 public:
70 const static int Italic = 1<<0;
71 const static int Bold = 1<<1;
72 const static int NoItalic = 1<<2;
73 const static int NoBold = 1<<3;
74 const static int Gray = 1<<4;
75 const static int Red = 1<<5;
76 const static int Green = 1<<6;
77 const static int Blue = 1<<7;
78 const static int Magenta = 1<<8;
80 int max_ply;
82 SearchGui(int& argc, char** argv){}
83 ~SearchGui(){}
85 void init_root(){}
86 void new_root_level(int depth){}
87 void notify(Move m, int ply, int depth, int heuval, int alpha, int beta, int flags){}
88 void notify_value(int ply, int value, int nodecount, int newflags){}
89 void notify_eval(int ply, int value, int alpha, int beta, int flags){}
90 void notify_hash(int ply, int lower, int upper, int depth, int alpha, int beta, Move best, bool write, int flags){}
91 void wait_input(){}
92 void process_events(){}
95 #define GUI1(a)
96 #define GUI2(a)
97 #define GUI(a)
98 #define IFGUI(a)
100 #endif
102 #endif //__SEARCH_GUI_H__