Freeciv-3.1: /fast/freeciv/nightly/S3_1/tools/ruledit/ruledit_qt.h Source File

Freeciv-3.1

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_good;
35class tab_gov;
36class tab_misc;
37class tab_multiplier;
38class tab_tech;
39class tab_unit;
40class tab_nation;
41class tab_enabler;
42class tab_extras;
43class tab_terrains;
44class req_edit;
45class req_vec_fix;
46class req_vec_fix_item;
47
48// Minimum initial size of the window
49#define RULEDIT_WINWIDTH 700
50#define RULEDIT_WINHEIGHT 650
51
52 class ruledit_main : public QMainWindow
53{
54 Q_OBJECT
55
56public:
57 ruledit_main(QApplication *qapp_in, QWidget *central_in);
58
59private:
60 void popup_quit_dialog();
61 QApplication *qapp;
62 QWidget *central;
63
64protected:
65 void closeEvent(QCloseEvent *cevent);
66};
67
68/* get 'struct req_edit_list' and related functions: */
69#define SPECLIST_TAG req_edit
70#define SPECLIST_TYPE class req_edit
71#include "speclist.h"
72
73#define req_edit_list_iterate(reqeditlist, preqedit) \
74 TYPED_LIST_ITERATE(class req_edit, reqeditlist, preqedit)
75#define req_edit_list_iterate_end LIST_ITERATE_END
76
77/* get 'struct effect_edit_list' and related functions: */
78#define SPECLIST_TAG effect_edit
79#define SPECLIST_TYPE class effect_edit
80#include "speclist.h"
81
82#define effect_edit_list_iterate(effecteditlist, peffectedit) \
83 TYPED_LIST_ITERATE(class effect_edit, effecteditlist, peffectedit)
84#define effect_edit_list_iterate_end LIST_ITERATE_END
85
86/* get 'struct req_vec_fix_list' and related functions: */
87#define SPECLIST_TAG req_vec_fix
88#define SPECLIST_TYPE class req_vec_fix
89#include "speclist.h"
90
91#define req_vec_fix_list_iterate(reqvecfixlist, preqvecfix) \
92 TYPED_LIST_ITERATE(class req_vec_fix, reqvecfixlist, preqvecfix)
93#define req_vec_fix_list_iterate_end LIST_ITERATE_END
94
95 class ruledit_gui : public QObject
96{
97 Q_OBJECT
98
99 public:
100 void setup(QWidget *central_in);
101 void display_msg(const char *msg);
102 requirers_dlg *create_requirers(const char *title);
103 void show_required(requirers_dlg *requirers, const char *msg);
104 void flush_widgets();
105
106 void open_req_edit(QString target, struct requirement_vector *preqs);
107 void unregister_req_edit(class req_edit *redit);
108
109 void open_req_vec_fix(req_vec_fix_item *item_info);
110 void unregister_req_vec_fix(req_vec_fix *fixer);
111
112 void open_effect_edit(QString target, struct universal *uni,
113 enum effect_filter_main_class efmc);
114 void unregister_effect_edit(class effect_edit *e_edit);
115 void refresh_effect_edits();
116
117 struct rule_data data;
118
119signals:
120 /********************************************************************/
124 void req_vec_may_have_changed(const requirement_vector *vec);
125
126 private:
127 void launch_now();
128
129 QLabel *msg_dspl;
130 QTabWidget *stack;
131 QLineEdit *ruleset_select;
132 QWidget *central;
133 QStackedLayout *main_layout;
134
135 tab_achievement *ach;
136 tab_building *bldg;
137 tab_misc *misc;
138 tab_tech *tech;
139 tab_unit *unit;
140 tab_good *good;
141 tab_gov *gov;
142 tab_enabler *enablers;
143 tab_extras *extras;
144 tab_multiplier *multipliers;
145 tab_terrains *terrains;
146 tab_nation *nation;
147
148 struct req_edit_list *req_edits;
149 struct req_vec_fix_list *req_vec_fixers;
150 struct effect_edit_list *effect_edits;
151
152 private slots:
153 void rulesetdir_given();
154 void incoming_req_vec_change(const requirement_vector *vec);
155};
156
157int ruledit_qt_run(int argc, char **argv);
158void ruledit_qt_display_requirers(const char *msg, void *data);
159
160#endif // FC__RULEDIT_QT_H
effect_edit
Definition effect_edit.h:47
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:96
ruledit_gui::nation
tab_nation * nation
Definition ruledit_qt.h:146
ruledit_gui::ach
tab_achievement * ach
Definition ruledit_qt.h:135
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:139
ruledit_gui::open_req_vec_fix
void open_req_vec_fix(req_vec_fix_item *item_info)
Definition ruledit_qt.cpp:364
ruledit_gui::good
tab_good * good
Definition ruledit_qt.h:140
ruledit_gui::enablers
tab_enabler * enablers
Definition ruledit_qt.h:142
ruledit_gui::unregister_effect_edit
void unregister_effect_edit(class effect_edit *e_edit)
Definition ruledit_qt.cpp:429
ruledit_gui::flush_widgets
void flush_widgets()
Definition ruledit_qt.cpp:322
ruledit_gui::multipliers
tab_multiplier * multipliers
Definition ruledit_qt.h:144
ruledit_gui::main_layout
QStackedLayout * main_layout
Definition ruledit_qt.h:133
ruledit_gui::data
struct rule_data data
Definition ruledit_qt.h:117
ruledit_gui::misc
tab_misc * misc
Definition ruledit_qt.h:137
ruledit_gui::effect_edits
struct effect_edit_list * effect_edits
Definition ruledit_qt.h:150
ruledit_gui::extras
tab_extras * extras
Definition ruledit_qt.h:143
ruledit_gui::incoming_req_vec_change
void incoming_req_vec_change(const requirement_vector *vec)
Definition ruledit_qt.cpp:281
ruledit_gui::terrains
tab_terrains * terrains
Definition ruledit_qt.h:145
ruledit_gui::display_msg
void display_msg(const char *msg)
Definition ruledit_qt.cpp:289
ruledit_gui::refresh_effect_edits
void refresh_effect_edits()
Definition ruledit_qt.cpp:437
ruledit_gui::setup
void setup(QWidget *central_in)
Definition ruledit_qt.cpp:106
ruledit_gui::open_req_edit
void open_req_edit(QString target, struct requirement_vector *preqs)
Definition ruledit_qt.cpp:331
ruledit_gui::gov
tab_gov * gov
Definition ruledit_qt.h:141
ruledit_gui::unregister_req_vec_fix
void unregister_req_vec_fix(req_vec_fix *fixer)
Definition ruledit_qt.cpp:392
ruledit_gui::bldg
tab_building * bldg
Definition ruledit_qt.h:136
ruledit_gui::create_requirers
requirers_dlg * create_requirers(const char *title)
Definition ruledit_qt.cpp:297
ruledit_gui::tech
tab_tech * tech
Definition ruledit_qt.h:138
ruledit_gui::launch_now
void launch_now()
Definition ruledit_qt.cpp:245
ruledit_gui::req_edits
struct req_edit_list * req_edits
Definition ruledit_qt.h:148
ruledit_gui::stack
QTabWidget * stack
Definition ruledit_qt.h:130
ruledit_gui::req_vec_fixers
struct req_vec_fix_list * req_vec_fixers
Definition ruledit_qt.h:149
ruledit_gui::show_required
void show_required(requirers_dlg *requirers, const char *msg)
Definition ruledit_qt.cpp:311
ruledit_gui::msg_dspl
QLabel * msg_dspl
Definition ruledit_qt.h:129
ruledit_gui::central
QWidget * central
Definition ruledit_qt.h:132
ruledit_gui::rulesetdir_given
void rulesetdir_given()
Definition ruledit_qt.cpp:230
ruledit_gui::open_effect_edit
void open_effect_edit(QString target, struct universal *uni, enum effect_filter_main_class efmc)
Definition ruledit_qt.cpp:400
ruledit_gui::ruleset_select
QLineEdit * ruleset_select
Definition ruledit_qt.h:131
ruledit_gui::unregister_req_edit
void unregister_req_edit(class req_edit *redit)
Definition ruledit_qt.cpp:356
ruledit_main
Definition ruledit_qt.h:53
ruledit_main::central
QWidget * central
Definition ruledit_qt.h:62
ruledit_main::popup_quit_dialog
void popup_quit_dialog()
Definition ruledit_qt.cpp:479
ruledit_main::closeEvent
void closeEvent(QCloseEvent *cevent)
Definition ruledit_qt.cpp:504
ruledit_main::qapp
QApplication * qapp
Definition ruledit_qt.h:61
tab_achievement
Definition tab_achievement.h:31
tab_building
Definition tab_building.h:31
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
effect_edit.h
effect_filter_main_class
effect_filter_main_class
Definition effect_edit.h:33
title
const char * title
Definition repodlgs.c:1313
slots
struct player_slot * slots
Definition player.c:50
ruledit_qt_display_requirers
void ruledit_qt_display_requirers(const char *msg, void *data)
Definition ruledit_qt.cpp:96
ruledit_qt_run
int ruledit_qt_run(int argc, char **argv)
Definition ruledit_qt.cpp:70
rulesave.h
speclist.h
rule_data
Definition rulesave.h:21
universal
Definition fc_types.h:756