OSDN Git Service

1075d83b46d8455fa26aed9258fe92f07dd259d4
[csp-qt/common_source_project-fm7.git] / source / src / qt / gui / commonclasses.h
1 /*
2  * Qt -> GUI -> CommonClasses
3  * commonclasses.h
4  * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
5  * Licence : GPLv2
6  * History : Jan 13 2015 : Split from x1turboz / menuclasses.h
7  */
8
9 #ifndef _CSP_QT_GUI_COMMONCLASSES_H
10 #define _CSP_QT_GUI_COMMONCLASSES_H
11
12 #if defined(_USE_QT5)
13 #include <QVariant>
14 #include <QAction>
15 #include <QApplication>
16 #include <QButtonGroup>
17 #include <QGraphicsView>
18 #include <QHeaderView>
19 #include <QMainWindow>
20 #include <QMenu>
21 #include <QMenuBar>
22 #include <QStatusBar>
23 #include <QWidget>
24 #include <QIcon>
25 #include <QString>
26 #else
27 #include <QtCore/QVariant>
28 #include <QtCore/QString>
29 #include <QtGui/QAction>
30 #include <QtGui/QApplication>
31 #include <QtGui/QButtonGroup>
32 #include <QtGui/QGraphicsView>
33 #include <QtGui/QHeaderView>
34 #include <QtGui/QMainWindow>
35 #include <QtGui/QMenu>
36 #include <QtGui/QMenuBar>
37 #include <QtGui/QStatusBar>
38 #include <QtGui/QWidget>
39 #include <QtGui/QIconSet>
40 #endif
41
42 #include "simd_types.h"
43 #include "common.h"
44 #include "config.h"
45 //#include "emu.h"
46 //#include "qt_main.h"
47 //#include "qt_gldraw.h"
48
49 class EMU;
50 class USING_FLAGS;
51 //extern class EMU* emu;
52
53 QT_BEGIN_NAMESPACE
54 typedef class DLL_PREFIX Object_Menu_Control: public QObject {
55         Q_OBJECT
56 public:
57         USING_FLAGS *using_flags;
58 Object_Menu_Control(QObject *parent, USING_FLAGS *p) : QObject(parent){
59                 bindValue = 0;
60                 drive = 0;
61                 s_num = 0;
62                 double_val = 0.0;
63                 using_flags = p;
64                 play = true; // Read
65                 write_protect = false; // Enable to write
66         }
67         ~Object_Menu_Control() {}
68 private:
69         int bindValue;
70         int drive;
71         int s_num;
72         bool play;
73         bool write_protect;
74         double double_val;
75 signals:
76         int on_boot_mode(int);   
77         int on_cpu_type(int);   
78         int on_cpu_power(int); 
79         int on_open_debugger(int);
80         
81         int sig_insert_fd(int);
82         int sig_eject_fd(int);
83         int set_d88_slot(int, int);
84         int set_recent_disk(int, int);
85         int sig_write_protect_fd(int, bool);
86         int sig_device_type(int);
87         int sig_sound_device(int);
88         int sig_printer_device(int);
89         int sig_drive_type(int);
90         int sig_emu_update_config(void);
91
92         int set_recent_quick_disk(int, int);
93         int sig_write_protect_Qd(int, bool);
94         int sig_eject_Qd(int);
95         int sig_insert_Qd(int);
96         
97         int sig_insert_cdrom(bool);
98         int sig_eject_cdrom(void);
99         int sig_recent_cdrom(int);
100                 
101         int sig_insert_play_cmt(bool);
102         int sig_eject_cmt(void);
103         int sig_recent_cmt(int);
104         int sig_set_write_protect_cmt(bool);
105         int sig_insert_cart(int);
106         int sig_eject_cart(int);
107         int set_recent_cart(int, int);
108
109         int sig_open_binary_file(int, QString, bool);
110         int sig_open_binary(int, bool);
111         int set_recent_binary_load(int, int);
112         int set_recent_binary_save(int, int);
113
114         // bubble
115         int sig_insert_bubble(int);
116         int sig_eject_bubble(int);
117         int set_b77_slot(int, int);
118         int set_recent_bubble(int, int);
119         int sig_write_protect_bubble(int, bool);
120         
121         int sig_freq(int);
122         int sig_latency(int);
123         int sig_sounddevice(int);
124         int sig_set_dipsw(int, bool);
125         int sig_screen_aspect(int);
126         int sig_screen_size(int, int);
127         int sig_screen_multiply(float);
128 public slots:
129         void set_boot_mode(void);
130         void set_cpu_type(void);
131         void set_cpupower(void);
132         void open_debugger(void);
133         void do_set_write_protect_cmt(void);
134         void do_unset_write_protect_cmt(void);
135         void insert_fd(void);
136         void eject_fd(void);
137         void on_d88_slot(void);
138         void on_recent_disk(void);
139         void write_protect_fd(void);
140         void no_write_protect_fd(void);
141         void do_set_ignore_crc_error(bool flag);
142         void do_set_correct_disk_timing(bool flag);
143         // Bubble
144         void insert_bubble(void);
145         void eject_bubble(void);
146         void on_b77_slot(void);
147         void on_recent_bubble(void);
148         void write_protect_bubble(void);
149         void no_write_protect_bubble(void);
150
151         void set_screen_aspect(void);
152         void set_screen_size(void);
153         void do_set_device_type(void);
154         void do_set_drive_type(void);
155         void do_set_sound_device(void);
156         void do_set_printer_device(void);
157         
158         void insert_Qd(void);
159         void eject_Qd(void);
160         void on_recent_quick_disk(void);
161         void write_protect_Qd(void);
162         void no_write_protect_Qd(void);
163         
164         void on_recent_binary_load(void);
165         void on_recent_binary_save(void);
166         void _open_binary(QString s);
167         void insert_binary_load(void);
168         void insert_binary_save(void);
169         
170         void insert_cdrom(void);
171         void eject_cdrom(void);
172         void on_recent_cdrom();
173
174         void start_insert_play_cmt(void);
175         void eject_cmt(void);
176         void on_recent_cmt(void);
177    
178         void on_set_freq(void);
179         void on_set_latency(void);
180
181         void insert_cart(void);
182         void eject_cart(void);
183         void on_recent_cart(void);
184      
185  public:
186         void setValue1(int v) {bindValue = v;}
187         int getValue1(void) {return bindValue;}
188         void setDrive(int num) { drive = num;}
189         int getDrive(void) { return drive;}
190         void setNumber(int num) { s_num = num;}
191         int getNumber(void) { return s_num;}
192         void setDoubleValue(double n) {double_val = n;}
193         double getDoubleValue(void) {return double_val;}
194         
195         bool isPlay(void) { return play; }
196         void setPlay(bool b) { play = b; }
197    
198         bool isWriteProtect(void) { return write_protect; }
199         void setWriteProtect(bool b) {write_protect = b;}
200 public slots:
201         void do_save_as_movie(void);
202         void do_stop_saving_movie(void);
203
204 signals:
205         int sig_stop_record_movie();
206         int sig_start_record_movie(int);
207 } Object_Menu_Control ;
208
209 typedef class DLL_PREFIX Action_Control: public QAction {
210         Q_OBJECT
211   protected:
212         //    virtual void addedTo ( QWidget * actionWidget, QWidget * container ){}
213         //   virtual void addedTo ( int index, QPopupMenu * menu ){}
214         QString bindString;
215  public:
216         Object_Menu_Control *binds;
217         Action_Control (QObject *parent, USING_FLAGS *p) : QAction(parent) {
218                 binds = new Object_Menu_Control(parent, p);
219                 bindString.clear();
220         }
221         ~Action_Control() {
222                 delete binds;
223         }
224 public slots:
225         void do_check_grab_mouse(bool);
226         void do_send_string(void);
227         void do_set_string(QString);
228 signals:
229         int quit_emu_thread(void);
230         int sig_send_string(QString);
231 } ActionControl;
232 QT_END_NAMESPACE
233
234 #endif
235
236
237