Move fullscreen display resolution control to the GUI with the rest of the fullscreen...
[dolphin.git] / Source / PluginSpecs / PluginSpecs.h
blob1e7d21076a74b47cc3ade974f6f8d62e88c3e955
2 //________________________________________________________________________________________
3 // File description: Common plugin spec, version #1.0 maintained by F|RES
5 #ifndef _PLUGINS_H_INCLUDED__
6 #define _PLUGINS_H_INCLUDED__
8 // Includes
9 // ------------
10 // TODO: See if we can get rid of the windows.h include.
11 #ifdef _WIN32
12 #include <windows.h>
13 #endif
14 #include "CommonTypes.h"
16 // Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed
17 // -----------------
18 enum PLUGIN_COMM
20 // Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
21 WM_USER_PAUSE = 10,
22 WM_USER_STOP,
23 WM_USER_CREATE,
24 WM_USER_SETCURSOR,
25 WM_USER_KEYDOWN,
26 WM_USER_VIDEO_STOP,
27 VIDEO_DESTROY, // The video debugging window was destroyed
28 AUDIO_DESTROY, // The audio debugging window was destroyed
29 WIIMOTE_DISCONNECT, // Disconnect Wiimote
30 INPUT_FRAME_COUNTER // Wind back the frame counter for rerecording
33 // System specific declarations and definitions
34 // ------------
36 #ifdef _WIN32
37 #define EXPORT __declspec(dllexport)
38 #define CALL __cdecl
39 #else
40 #define EXPORT __attribute__ ((visibility("default")))
41 #define __cdecl
42 #define CALL
43 #ifndef TRUE
44 #define TRUE 1
45 #define FALSE 0
46 #endif
48 // simulate something that looks like win32
49 // long term, kill these
50 #define HWND void*
51 #define HINSTANCE void*
52 #endif
54 #if defined(__cplusplus)
55 extern "C" {
56 #endif
60 // Global values
61 // ------------
63 // Plugin types
64 enum PLUGIN_TYPE {
65 PLUGIN_TYPE_VIDEO = 1,
66 PLUGIN_TYPE_DVD,
67 PLUGIN_TYPE_PAD,
68 PLUGIN_TYPE_AUDIO,
69 PLUGIN_TYPE_COMPILER,
70 PLUGIN_TYPE_DSP,
71 PLUGIN_TYPE_WIIMOTE,
74 #define STATE_MODE_READ 1
75 #define STATE_MODE_WRITE 2
76 #define STATE_MODE_MEASURE 3
78 // used for notification on emulation state
79 enum PLUGIN_EMUSTATE {
80 PLUGIN_EMUSTATE_PLAY = 1,
81 PLUGIN_EMUSTATE_PAUSE,
82 PLUGIN_EMUSTATE_STOP,
85 // Export structs
86 // ------------
87 typedef struct
89 u16 Version; // Set to 0x0100
90 PLUGIN_TYPE Type; // Set to PLUGIN_TYPE_DVD
91 char Name[100]; // Name of the DLL
92 } PLUGIN_INFO;
94 #ifndef MAX_PATH
95 // apparently a windows-ism.
96 #define MAX_PATH 260
97 #endif
99 // TODO: Remove, or at least remove the void pointers and replace with data.
100 // This design is just wrong and ugly - the plugins shouldn't have this much access.
101 typedef struct
103 void *eventHandler;
104 void *logManager;
105 char game_ini[MAX_PATH];
106 char unique_id[16];
107 } PLUGIN_GLOBALS;
109 // GLOBAL I N T E R F A C E
110 // ____________________________________________________________________________
111 // Function: GetDllInfo
112 // Purpose: This function allows the emulator to gather information
113 // about the DLL by filling in the PluginInfo structure.
114 // input: A pointer to a PLUGIN_INFO structure that needs to be
115 // filled by the function. (see def above)
116 // output: none
118 EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo);
120 // ___________________________________________________________________________
121 // Function: DllConfig
122 // Purpose: This function is optional function that is provided
123 // to allow the user to configure the DLL
124 // input: A handle to the window that calls this function
125 // output: none
127 EXPORT void CALL DllConfig(HWND _hParent);
129 // ___________________________________________________________________________
130 // Function: DllDebugger
131 // Purpose: Open the debugger
132 // input: a handle to the window that calls this function
133 // output: none
135 EXPORT void CALL DllDebugger(HWND _hParent, bool Show);
137 // ___________________________________________________________________________
138 // Function: DllSetGlobals
139 // Purpose: Set the pointer for globals variables
140 // input: a pointer to the global struct
141 // output: none
143 EXPORT void CALL SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals);
145 // ___________________________________________________________________________
146 // Function: Initialize
147 // Purpose: Initialize the plugin
148 // input: Init
149 // output: none
151 EXPORT void CALL Initialize(void *init);
153 // ___________________________________________________________________________
154 // Function: Shutdown
155 // Purpose: This function is called when the emulator is shutting down
156 // a game allowing the dll to de-initialise.
157 // input: none
158 // output: none
160 EXPORT void CALL Shutdown(void);
162 // ___________________________________________________________________________
163 // Function: DoState
164 // Purpose: Saves/load state
165 // input/output: ptr
166 // input: mode
168 EXPORT void CALL DoState(unsigned char **ptr, int mode);
170 // ___________________________________________________________________________
171 // Function: EmuStateChange
172 // Purpose: Notifies the plugin of a change in emulation state
173 // input: newState
174 // output: none
176 EXPORT void CALL EmuStateChange(PLUGIN_EMUSTATE newState);
179 #if defined(__cplusplus)
181 #endif
183 #endif // _PLUGINS_H_INCLUDED__