26 #ifndef CAVESTORY_MOD_API_H_
27 #error "Please include CavestoryModAPI.h before including sub-classes."
269 bool Init(
const char* pTitle,
GUI_POINT* pPoint,
GUI_POINT pSize,
unsigned int iFlags = 0,
int iMagnification = -1,
bool bStartHidden =
false);
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
@ SURFACE_ID_MAX
Number of surfaces.
Definition: CSMAPI_enums.h:866
ExternalWindowFlags
Flags for ExternalWindow.
Definition: ExternalWindow.h:103
@ EXTERNAL_WINDOW_TOPMOST
Window is always topmost window.
Definition: ExternalWindow.h:133
@ EXTERNAL_WINDOW_MINIMIZED
Window is minimized.
Definition: ExternalWindow.h:105
@ EXTERNAL_WINDOW_BORDERLESS
Window has no border.
Definition: ExternalWindow.h:114
@ EXTERNAL_WINDOW_MAXIMIZED
Window is maximized.
Definition: ExternalWindow.h:108
@ EXTERNAL_WINDOW_HIDDEN
Window is hidden.
Definition: ExternalWindow.h:111
@ EXTERNAL_WINDOW_RESIZABLE
Window can be resized.
Definition: ExternalWindow.h:117
@ EXTERNAL_WINDOW_TOOLWINDOW
Window is a tooltip window.
Definition: ExternalWindow.h:130
@ EXTERNAL_WINDOW_HAS_INPUT_FOCUS
Window has input focus.
Definition: ExternalWindow.h:122
@ EXTERNAL_WINDOW_HAS_MOUSE_FOCUS
Window has mouse focus.
Definition: ExternalWindow.h:127
void(* ExternalWindow_OnResizeFunc)(ExternalWindow *pWindow, GUI_POINT pOldSize, GUI_POINT pNewSize, void *pUserData)
Callback for resizing the window.
Definition: ExternalWindow.h:96
ExternalWindow_HitResult(* ExternalWindow_HitTestFunc)(ExternalWindow *pWindow, GUI_POINT pPoint, void *pUserData)
Callback for hittesting.
Definition: ExternalWindow.h:89
ExternalWindow_HitResult
Hittest result.
Definition: ExternalWindow.h:52
@ EXTERNAL_WINDOW_HITTEST_RESIZE_RIGHT
Region is the right resizer.
Definition: ExternalWindow.h:69
@ EXTERNAL_WINDOW_HITTEST_RESIZE_TOP
Region is the top resizer.
Definition: ExternalWindow.h:63
@ EXTERNAL_WINDOW_HITTEST_RESIZE_LEFT
Region is the left resizer.
Definition: ExternalWindow.h:81
@ EXTERNAL_WINDOW_HITTEST_RESIZE_TOPLEFT
Region is the topleft resizer.
Definition: ExternalWindow.h:60
@ EXTERNAL_WINDOW_HITTEST_NORMAL
No special properties.
Definition: ExternalWindow.h:54
@ EXTERNAL_WINDOW_HITTEST_RESIZE_TOPRIGHT
Region is the topright resizer.
Definition: ExternalWindow.h:66
@ EXTERNAL_WINDOW_HITTEST_DRAGGABLE
Region can drag entire window.
Definition: ExternalWindow.h:57
@ EXTERNAL_WINDOW_HITTEST_RESIZE_BOTTOM
Region is the bottom resizer.
Definition: ExternalWindow.h:75
@ EXTERNAL_WINDOW_HITTEST_RESIZE_BOTTOMLEFT
Region is the bottomleft resizer.
Definition: ExternalWindow.h:78
@ EXTERNAL_WINDOW_HITTEST_RESIZE_BOTTOMRIGHT
Region is the bottomright resizer.
Definition: ExternalWindow.h:72
An external window to render stuff on.
Definition: ExternalWindow.h:151
GUI_POINT GetWindowSize()
Get the size of this window.
int WindowID
The window's ID.
Definition: ExternalWindow.h:244
void SetWindowMaximumSize(GUI_POINT pSize)
Set the maximum size for this window.
int m_iVideoTextureCount
The number of textures allocated to this window.
Definition: ExternalWindow.h:182
ExternalWindow_HitTestFunc m_pHitTestFunc
A pointer to the hit test function.
Definition: ExternalWindow.h:206
void SetWindowPosition(GUI_POINT pNewPosition)
Move this window.
const char * GetWindowTitle()
Get the title of this window.
void SetWindowOpacity(unsigned char iOpacity)
Set the opacity of this window.
static SDL_Window * mouse_focused
First entry in list.
Definition: ExternalWindow.h:156
GUI_POINT GetMousePosition()
Get the mouse position relative to this window.
void Maximize()
Maximize this window.
void * m_pHitTestUserData
The user data for the hitfunc.
Definition: ExternalWindow.h:210
void FlipWindow()
Flip this window.
void RegisterTexture(VideoTexture *pTexture)
Register a texture to this window.
void OnInputEvent(SDL_Event *pEvent)
Handle an input.
ExternalWindow * next
Next entry in list.
Definition: ExternalWindow.h:168
void * CallbackUserData
User data for callback.
Definition: ExternalWindow.h:192
static ExternalWindow * first
First entry in list.
Definition: ExternalWindow.h:160
GUI_POINT GetWindowPosition()
Get the position of this window.
void SetWindowMinimumSize(GUI_POINT pSize)
Set the minimum size for this window.
bool m_bInitialized
Whether this window is initialized already or not.
Definition: ExternalWindow.h:174
int m_iVideoTextureSize
The number of texture slots allocated.
Definition: ExternalWindow.h:186
unsigned int m_iFlags
The flags for this window.
Definition: ExternalWindow.h:222
void Minimize()
Minimize this window.
bool Init(const char *pTitle, GUI_POINT *pPoint, GUI_POINT pSize, unsigned int iFlags=0, int iMagnification=-1, bool bStartHidden=false)
Initialize this window.
GUI_RECT WindowRect
The window's rect.
Definition: ExternalWindow.h:240
~ExternalWindow()
Deconstructor.
bool IsInitialized()
Check to see if this window has been initialized.
Definition: ExternalWindow.h:278
void Free()
Reset this window and its memory.
static bool TestWindowInputFocus(ExternalWindow *pWindow)
Test a window's input focus.
void UnregisterTexture(VideoTexture *pTexture)
Unregister a texture from this window.
ExternalWindow * m_pParent
This window's parent window.
Definition: ExternalWindow.h:202
ExternalWindow * prev
Previous entry in list.
Definition: ExternalWindow.h:164
void FocusWindow()
Focus this window.
SDL_Window * m_pWindow
The SDL window pointer for this window.
Definition: ExternalWindow.h:218
ExternalWindow_OnResizeFunc OnResize
Called every time the window's size is changed.
Definition: ExternalWindow.h:196
SDL_Texture * GetSurfaceTexture(Surface_Ids iSurfaceId)
Get the texture specific to this window's renderer for a surface.
VideoTexture * m_pRendererTexture
The renderer texture for this external window.
Definition: ExternalWindow.h:230
void UpdateFlags()
Update a window's flags.
void SetWindowVisible(bool bVisible)
Set the visibility of this window.
SDL_Renderer * m_pRenderer
The SDL renderer pointer for this window.
Definition: ExternalWindow.h:214
void SetWindowSize(GUI_POINT pNewSize)
Resize this window.
void SetHitTestFunc(ExternalWindow_HitTestFunc pFunc, void *pUserData)
Set the hittest function.
void SetWindowTitle(const char *pNewTitle)
Rename this window.
unsigned char GetWindowOpacity()
Get the visibility of this window.
VideoTexture ** m_pVideoTextureList
Texture allocated to this window.
Definition: ExternalWindow.h:178
static bool TestWindowMouseFocus(ExternalWindow *pWindow)
Test a window's mouse focus.
bool IsWindowVisible()
Get the visibility of this window.
ExternalWindow()
Constructor.
An editable texture API.
Definition: VideoTexture.h:51
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30
Holds information for window-specific information pertaining to surf[].
Definition: ExternalWindow.h:140
SDL_Texture * texture
The texture object for this texture.
Definition: ExternalWindow.h:143
Manages points.
Definition: CSMAPI_types.h:546
Definition: CSMAPI_types.h:842