OSDN Git Service

[Qt][MOVIE_SAVER] (MAYBE) Fix not running with Ubuntu 16.04 LTS.
[csp-qt/common_source_project-fm7.git] / source / src / qt / gui / qt_main.h
1 /*
2         Skelton for retropc emulator
3         Author : Takeda.Toshiya
4         Port to Qt : K.Ohta <whatisthis.sowhat _at_ gmail.com>
5         Date   : 2006.08.18 -
6         License : GPLv2
7         [ win32 main ] -> [ Qt main ]
8 */
9
10 #ifndef _CSP_QT_MAIN_H
11 #define _CSP_QT_MAIN_H
12
13 #include <string>
14 #include <qthread.h>
15 #include <QTimer>
16 #include <QIcon>
17 #include <QImage>
18 #include <QString>
19
20 #include <SDL.h>
21 //#include "sdl_cpuid.h"
22 #include "simd_types.h"
23 #include "common.h"
24 //#include "../../emu.h"
25
26 class META_MainWindow;
27 class EMU;
28 extern class META_MainWindow *rMainWindow;
29 extern EMU* emu;
30 // menu
31 extern std::string DLL_PREFIX cpp_homedir;
32 extern std::string DLL_PREFIX cpp_confdir;
33 extern std::string DLL_PREFIX my_procname;
34 extern std::string DLL_PREFIX sRssDir;
35 extern bool DLL_PREFIX now_menuloop;
36
37 extern const int DLL_PREFIX screen_mode_width[];
38 extern const int DLL_PREFIX screen_mode_height[];
39
40 #ifndef MAX_HISTORY
41 #define MAX_HISTORY 8
42 #endif
43
44 #ifndef UPDATE_HISTORY
45 #define UPDATE_HISTORY(path, recent, list) { \
46         int no = MAX_HISTORY - 1; \
47         bool found = false; \
48         for(int i = 0; i < MAX_HISTORY; i++) { \
49                 if(strcmp(recent[i], path) == 0) { \
50                         no = i; \
51                         found = true; \
52                         break; \
53                 } \
54         } \
55         if(found) { \
56                 strcpy(recent[MAX_HISTORY - 1], ""); \
57         } \
58         for(int i = no; i > 0; i--) { \
59                 strcpy(recent[i], recent[i - 1]); \
60         } \
61         strcpy(recent[0], path); \
62         list.clear(); \
63         for(int i = 0; i < MAX_HISTORY; i++) { \
64                 QString _tmps = QString::fromLocal8Bit(recent[i]); \
65                 list << _tmps; \
66         } \
67 }
68 #endif
69
70 #ifndef SETUP_HISTORY
71 #define SETUP_HISTORY(recent, list) { \
72         list.clear(); \
73         for(int i = 0; i < MAX_HISTORY; i++) { \
74                 QString _tmps = QString::fromLocal8Bit(recent[i]); \
75                 list << _tmps; \
76         } \
77 }
78 #endif
79
80 extern _TCHAR* DLL_PREFIX get_parent_dir(_TCHAR* file);
81 extern void DLL_PREFIX Convert_CP932_to_UTF8(char *dst, char *src, int n_limit, int i_limit);
82 extern void DLL_PREFIX get_long_full_path_name(_TCHAR* src, _TCHAR* dst);
83 extern void DLL_PREFIX get_short_filename(_TCHAR *dst, _TCHAR *file, int maxlen);
84
85 // Important Flags
86 //extern AGAR_CPUID *pCpuID;
87
88 #endif