OSDN Git Service

[BUILD] Set SOVERSION and GIT hash automatically.
[csp-qt/common_source_project-fm7.git] / source / src / qt / osd_base.h
index ec6f26d..40b4491 100644 (file)
 #define _QT_OSD_BASE_H_
 
 
-#include <QWidget>
+#include <QList>
 #include <QThread>
-#include <QMutex>
-#include <QSemaphore>
-#include <QPainter>
-#include <QElapsedTimer>
 #include <QString>
-#include <QQueue>
 #include <QImage>
-#include <QList>
-
 #include <SDL.h>
-#include "simd_types.h"
+//#include "simd_types.h"
 
-#include <ctime>
-#include <limits>
-#include <osd_base.h>
+//#include <ctime>
+//#include <limits>
+//#include <osd_base.h>
 
 //#include "../vm/vm.h"
 //#include "../emu.h"
 #include "../config.h"
-#include "../fileio.h"
-#include "../fifo.h"
-#if !defined(Q_OS_WIN32)
-#include "qt_input.h"
-#endif
+//#include "../fileio.h"
+//#include "../fifo.h"
+//#if !defined(Q_OS_WIN32)
+//#include "qt_input.h"
+//#endif
 #define SOCKET_MAX 4
 #define SOCKET_BUFFER_MAX 0x100000
 #include "osd_types.h"
@@ -53,9 +46,7 @@
 #define MAX_CAPTURE_DEVS 8
 //#endif
 
-#include "qt_main.h"
-//#include "mainwidget.h"
-#include "config.h"
+//#include "qt_main.h"
 
 class GLDrawClass;
 class EmuThreadClass;
@@ -64,9 +55,12 @@ class Ui_MainWindow;
 class EMU;
 class VM;
 class FIFO;
+class FILEIO;
 class CSP_KeyTables;
 class USING_FLAGS;
-class CSP_LOGGER;
+class CSP_logger;
+class QMutex;
+
 QT_BEGIN_NAMESPACE
 
 typedef struct {
@@ -87,15 +81,16 @@ class DLL_PREFIX OSD_BASE : public QThread
        Q_OBJECT
 protected:
        EmuThreadClass *parent_thread;
-       QSemaphore *VMSemaphore;
-       QSemaphore *DebugSemaphore;
        sdl_snddata_t snddata;
        USING_FLAGS *using_flags;
        config_t *p_config;
-       CSP_Logger *csp_logger;
+       CSP_Logger *p_logger;
 
        QList<supportedlist_t> SupportedFeatures;
        
+       bool __USE_AUTO_KEY;
+       bool __USE_SHIFT_NUMPAD_KEY;
+   
        _TCHAR app_path[_MAX_PATH];
        QElapsedTimer osd_timer;
        bool locked_vm;
@@ -127,13 +122,15 @@ protected:
        int joy_num;
        uint32_t joy_mask[4];
        
-       int mouse_status[3];    // x, y, button (b0 = left, b1 = right)
+       int32_t mouse_status[3];        // x, y, button (b0 = left, b1 = right)
        bool mouse_enabled;
        int mouse_ptrx;
        int mouse_ptry;
        int mouse_button;
        int mouse_oldx;
        int mouse_oldy;
+       int delta_x;
+       int delta_y;
        //Qt::CursorShape mouse_shape;
        
        QImage background_image;
@@ -196,7 +193,7 @@ protected:
        int sound_write_pos;
        bool sound_exit;
        bool sound_debug;
-       SDL_sem *snd_apply_sem;
+       bool sound_initialized;
        Sint16 *sound_buf_ptr;
        Uint8 snd_total_volume;
 #if defined(USE_SDL2)   
@@ -210,6 +207,10 @@ protected:
        virtual void initialize_video();
        virtual void release_video();
   
+       scrntype_t *mapped_screen_pointer;
+       int mapped_screen_width;
+       int mapped_screen_height;
+       bool mapped_screen_status;
        bitmap_t dshow_screen_buffer;
        int direct_show_width, direct_show_height;
        bool direct_show_mute[2];
@@ -274,6 +275,7 @@ public:
        class Ui_MainWindow *main_window_handle;
        GLDrawClass *glv;
        QMutex *screen_mutex;
+       QMutex *vm_mutex;
        
        int host_cpus;
        bool now_auto_key;
@@ -296,13 +298,13 @@ public:
        bool is_console_active();
        void set_console_text_attribute(unsigned short attr);
        void write_console(_TCHAR* buffer, unsigned int length);
-       int read_console_input(_TCHAR* buffer);
+       int read_console_input(_TCHAR* buffer, int length);
        bool is_console_key_pressed(uint32_t ch);
        
        // common input
        void update_input();
-       void key_down(int code, bool repeat);
-       void key_up(int code);
+       void key_down(int code, bool extended, bool repeat);
+       void key_up(int code, bool extended);
        void key_down_native(int code, bool repeat);
        void key_up_native(int code);
        void key_lost_focus();
@@ -323,7 +325,7 @@ public:
        void modify_key_buffer(int code, uint8_t val);
        uint8_t* get_key_buffer();
        uint32_t* get_joy_buffer();
-       int* get_mouse_buffer();
+       int32_t* get_mouse_buffer();
        // common printer
        void reset_printer();
        void update_printer();
@@ -340,6 +342,7 @@ public:
        int get_window_mode_height(int mode);
        void set_host_window_size(int window_width, int window_height, bool window_mode);
        void set_vm_screen_size(int width, int height, int width_aspect, int height_aspect, int window_width, int window_height);
+       void set_vm_screen_lines(int lines); // 20170118
        int get_vm_window_width();
        int get_vm_window_height();
        int get_vm_window_width_aspect();
@@ -441,6 +444,10 @@ public:
        virtual QString get_vm_config_name(void);
        virtual double vm_frame_rate(void);
        virtual void reset_vm_node(void);
+       virtual const _TCHAR *get_lib_common_vm_version() { return (const _TCHAR *)"\0"; }
+       virtual const _TCHAR *get_lib_common_vm_git_version() { return (const _TCHAR *)"\0"; }
+       virtual const _TCHAR *get_lib_osd_version() { return (const _TCHAR *)"\0"; }
+       
        virtual void set_device_name(int id, char *name);
        
        virtual void set_vm_node(int id, const _TCHAR *name);
@@ -466,7 +473,12 @@ public:
        void debug_log(int level, const char *fmt, ...);
        void debug_log(int level, int domain_num, const char *fmt, ...);
        virtual void debug_log(int level, int domain_num, char *strbuf);
+
+       USING_FLAGS *get_config_flags(void) { return using_flags; }
+
+       // Special
+       CSP_Logger *get_logger(void) { return p_logger; }
+       
 public slots:
        void do_write_inputdata(QString s);
        void do_set_input_string(QString s);
@@ -483,6 +495,7 @@ public slots:
        int draw_screen();
        int no_draw_screen();
        void do_draw(bool flag);
+       void do_set_screen_map_texture_address(scrntype_t *p, int width, int height);
 
 signals:
        int sig_update_screen(bitmap_t *);
@@ -490,6 +503,7 @@ signals:
        int sig_draw_frames(int);
        int sig_close_window(void);
        int sig_resize_vm_screen(QImage *, int, int);
+       int sig_resize_vm_lines(int);
        int sig_put_string_debugger(QString);
        int sig_console_input_string(QString);
        int sig_enqueue_video(int, int, int, QImage *); 
@@ -509,6 +523,10 @@ signals:
        int sig_update_device_node_name(int id, const _TCHAR *name);
        int sig_enable_mouse(void);
        int sig_disable_mouse(void);
+       int sig_close_console(void);
+
+       int sig_move_mouse_to_center(void);
+       
 };
 QT_END_NAMESPACE