Freeciv-3.2: /fast/freeciv/nightly/S3_2/tools/ruledit/ruledit_qt.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
ruledit_qt.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifndef FC__RULEDIT_QT_H
15#define FC__RULEDIT_QT_H
16
17// Qt
18#include <QApplication>
19#include <QMainWindow>
20#include <QObject>
21#include <QLabel>
22#include <QTabWidget>
23
24// ruledit
25#include "effect_edit.h"
26#include "rulesave.h"
27
28class QLineEdit;
29class QStackedLayout;
30
31class requirers_dlg;
32class tab_achievement;
33class tab_building;
34class tab_counter;
35class tab_good;
36class tab_gov;
37class tab_misc;
38class tab_multiplier;
39class tab_tech;
40class tab_unit;
41class tab_nation;
42class tab_enabler;
43class tab_extras;
44class tab_terrains;
45class req_edit;
46class req_vec_fix;
47class req_vec_fix_item;
48
49// Minimum initial size of the window
50#define RULEDIT_WINWIDTH 700
51#define RULEDIT_WINHEIGHT 650
52
53 class ruledit_main : public QMainWindow
54{
55 Q_OBJECT
56
57public:
58 ruledit_main(QApplication *qapp_in, QWidget *central_in);
59
60private:
61 void popup_quit_dialog();
62 QApplication *qapp;
63 QWidget *central;
64
65protected:
66 void closeEvent(QCloseEvent *cevent);
67};
68
69// get 'struct req_edit_list' and related functions:
70#define SPECLIST_TAG req_edit
71#define SPECLIST_TYPE class req_edit
72#include "speclist.h"
73
74#define req_edit_list_iterate(reqeditlist, preqedit) \
75 TYPED_LIST_ITERATE(class req_edit, reqeditlist, preqedit)
76#define req_edit_list_iterate_end LIST_ITERATE_END
77
78// get 'struct effect_edit_list' and related functions:
79#define SPECLIST_TAG effect_edit
80#define SPECLIST_TYPE class effect_edit
81#include "speclist.h"
82
83#define effect_edit_list_iterate(effecteditlist, peffectedit) \
84 TYPED_LIST_ITERATE(class effect_edit, effecteditlist, peffectedit)
85#define effect_edit_list_iterate_end LIST_ITERATE_END
86
87// get 'struct req_vec_fix_list' and related functions:
88#define SPECLIST_TAG req_vec_fix
89#define SPECLIST_TYPE class req_vec_fix
90#include "speclist.h"
91
92#define req_vec_fix_list_iterate(reqvecfixlist, preqvecfix) \
93 TYPED_LIST_ITERATE(class req_vec_fix, reqvecfixlist, preqvecfix)
94#define req_vec_fix_list_iterate_end LIST_ITERATE_END
95
96 class ruledit_gui : public QObject
97{
98 Q_OBJECT
99
100 public:
101 void setup(QWidget *central_in);
102 void display_msg(const char *msg);
103 requirers_dlg *create_requirers(const char *title);
104 void show_required(requirers_dlg *requirers, const char *msg);
105 void flush_widgets();
106
107 void open_req_edit(QString target, struct requirement_vector *preqs);
108 void unregister_req_edit(class req_edit *redit);
109
110 void open_req_vec_fix(req_vec_fix_item *item_info);
111 void unregister_req_vec_fix(req_vec_fix *fixer);
112
113 void open_effect_edit(QString target, struct universal *uni,
114 enum effect_filter_main_class efmc);
115 void unregister_effect_edit(class effect_edit *e_edit);
116 void refresh_effect_edits();
117
118 struct rule_data data;
119
120signals:
121 /********************************************************************/
125 void req_vec_may_have_changed(const requirement_vector *vec);
126
127 private:
128 void launch_now();
129
130 QLabel *msg_dspl;
131 QTabWidget *stack;
132 QLineEdit *ruleset_select;
133 QWidget *central;
134 QStackedLayout *main_layout;
135
136 tab_achievement *ach;
137 tab_building *bldg;
138 tab_counter *counter;
139 tab_misc *misc;
140 tab_tech *tech;
141 tab_unit *unit;
142 tab_good *good;
143 tab_gov *gov;
144 tab_enabler *enablers;
145 tab_extras *extras;
146 tab_multiplier *multipliers;
147 tab_terrains *terrains;
148 tab_nation *nation;
149
150 struct req_edit_list *req_edits;
151 struct req_vec_fix_list *req_vec_fixers;
152 struct effect_edit_list *effect_edits;
153
154 private slots:
155 void rulesetdir_given();
156 void incoming_req_vec_change(const requirement_vector *vec);
157};
158
159int ruledit_qt_run(int argc, char **argv);
160void ruledit_qt_display_requirers(const char *msg, void *data);
161
162#endif // FC__RULEDIT_QT_H
effect_edit
Definition effect_edit.h:48
req_edit
Definition req_edit.h:36
req_vec_fix_item
Definition req_vec_fix.h:49
req_vec_fix
Definition req_vec_fix.h:158
requirers_dlg
Definition requirers_dlg.h:28
ruledit_gui
Definition ruledit_qt.h:97
ruledit_gui::nation
tab_nation * nation
Definition ruledit_qt.h:148
ruledit_gui::ach
tab_achievement * ach
Definition ruledit_qt.h:136
ruledit_gui::req_vec_may_have_changed
void req_vec_may_have_changed(const requirement_vector *vec)
ruledit_gui::unit
tab_unit * unit
Definition ruledit_qt.h:141
ruledit_gui::open_req_vec_fix
void open_req_vec_fix(req_vec_fix_item *item_info)
Definition ruledit_qt.cpp:368
ruledit_gui::good
tab_good * good
Definition ruledit_qt.h:142
ruledit_gui::enablers
tab_enabler * enablers
Definition ruledit_qt.h:144
ruledit_gui::unregister_effect_edit
void unregister_effect_edit(class effect_edit *e_edit)
Definition ruledit_qt.cpp:433
ruledit_gui::flush_widgets
void flush_widgets()
Definition ruledit_qt.cpp:326
ruledit_gui::multipliers
tab_multiplier * multipliers
Definition ruledit_qt.h:146
ruledit_gui::main_layout
QStackedLayout * main_layout
Definition ruledit_qt.h:134
ruledit_gui::data
struct rule_data data
Definition ruledit_qt.h:118
ruledit_gui::misc
tab_misc * misc
Definition ruledit_qt.h:139
ruledit_gui::effect_edits
struct effect_edit_list * effect_edits
Definition ruledit_qt.h:152
ruledit_gui::extras
tab_extras * extras
Definition ruledit_qt.h:145
ruledit_gui::incoming_req_vec_change
void incoming_req_vec_change(const requirement_vector *vec)
Definition ruledit_qt.cpp:285
ruledit_gui::terrains
tab_terrains * terrains
Definition ruledit_qt.h:147
ruledit_gui::display_msg
void display_msg(const char *msg)
Definition ruledit_qt.cpp:293
ruledit_gui::refresh_effect_edits
void refresh_effect_edits()
Definition ruledit_qt.cpp:441
ruledit_gui::setup
void setup(QWidget *central_in)
Definition ruledit_qt.cpp:107
ruledit_gui::open_req_edit
void open_req_edit(QString target, struct requirement_vector *preqs)
Definition ruledit_qt.cpp:335
ruledit_gui::gov
tab_gov * gov
Definition ruledit_qt.h:143
ruledit_gui::unregister_req_vec_fix
void unregister_req_vec_fix(req_vec_fix *fixer)
Definition ruledit_qt.cpp:396
ruledit_gui::bldg
tab_building * bldg
Definition ruledit_qt.h:137
ruledit_gui::create_requirers
requirers_dlg * create_requirers(const char *title)
Definition ruledit_qt.cpp:301
ruledit_gui::tech
tab_tech * tech
Definition ruledit_qt.h:140
ruledit_gui::launch_now
void launch_now()
Definition ruledit_qt.cpp:248
ruledit_gui::req_edits
struct req_edit_list * req_edits
Definition ruledit_qt.h:150
ruledit_gui::stack
QTabWidget * stack
Definition ruledit_qt.h:131
ruledit_gui::req_vec_fixers
struct req_vec_fix_list * req_vec_fixers
Definition ruledit_qt.h:151
ruledit_gui::show_required
void show_required(requirers_dlg *requirers, const char *msg)
Definition ruledit_qt.cpp:315
ruledit_gui::counter
tab_counter * counter
Definition ruledit_qt.h:138
ruledit_gui::msg_dspl
QLabel * msg_dspl
Definition ruledit_qt.h:130
ruledit_gui::central
QWidget * central
Definition ruledit_qt.h:133
ruledit_gui::rulesetdir_given
void rulesetdir_given()
Definition ruledit_qt.cpp:233
ruledit_gui::open_effect_edit
void open_effect_edit(QString target, struct universal *uni, enum effect_filter_main_class efmc)
Definition ruledit_qt.cpp:404
ruledit_gui::ruleset_select
QLineEdit * ruleset_select
Definition ruledit_qt.h:132
ruledit_gui::unregister_req_edit
void unregister_req_edit(class req_edit *redit)
Definition ruledit_qt.cpp:360
ruledit_main
Definition ruledit_qt.h:54
ruledit_main::central
QWidget * central
Definition ruledit_qt.h:63
ruledit_main::popup_quit_dialog
void popup_quit_dialog()
Definition ruledit_qt.cpp:483
ruledit_main::closeEvent
void closeEvent(QCloseEvent *cevent)
Definition ruledit_qt.cpp:508
ruledit_main::qapp
QApplication * qapp
Definition ruledit_qt.h:62
tab_achievement
Definition tab_achievement.h:31
tab_building
Definition tab_building.h:31
tab_counter
Definition tab_counters.h:36
tab_enabler
Definition tab_enablers.h:37
tab_extras
Definition tab_extras.h:31
tab_good
Definition tab_good.h:31
tab_gov
Definition tab_gov.h:31
tab_misc
Definition tab_misc.h:27
tab_multiplier
Definition tab_multiplier.h:31
tab_nation
Definition tab_nation.h:26
tab_tech
Definition tab_tech.h:38
tab_terrains
Definition tab_terrains.h:31
tab_unit
Definition tab_unit.h:31
incite_cost
char * incite_cost
Definition comments.c:74
effect_edit.h
effect_filter_main_class
effect_filter_main_class
Definition effect_edit.h:34
title
const char * title
Definition repodlgs.c:1314
slots
struct player_slot * slots
Definition player.c:51
ruledit_qt_display_requirers
void ruledit_qt_display_requirers(const char *msg, void *data)
Definition ruledit_qt.cpp:97
ruledit_qt_run
int ruledit_qt_run(int argc, char **argv)
Definition ruledit_qt.cpp:71
rulesave.h
speclist.h
rule_data
Definition rulesave.h:21
universal
Definition fc_types.h:901