cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

SDL_windowsvideo.h (4933B)


      1/*
      2  Simple DirectMedia Layer
      3  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
      4
      5  This software is provided 'as-is', without any express or implied
      6  warranty.  In no event will the authors be held liable for any damages
      7  arising from the use of this software.
      8
      9  Permission is granted to anyone to use this software for any purpose,
     10  including commercial applications, and to alter it and redistribute it
     11  freely, subject to the following restrictions:
     12
     13  1. The origin of this software must not be misrepresented; you must not
     14     claim that you wrote the original software. If you use this software
     15     in a product, an acknowledgment in the product documentation would be
     16     appreciated but is not required.
     17  2. Altered source versions must be plainly marked as such, and must not be
     18     misrepresented as being the original software.
     19  3. This notice may not be removed or altered from any source distribution.
     20*/
     21#include "../../SDL_internal.h"
     22
     23#ifndef _SDL_windowsvideo_h
     24#define _SDL_windowsvideo_h
     25
     26#include "../../core/windows/SDL_windows.h"
     27
     28#include "../SDL_sysvideo.h"
     29
     30#if defined(_MSC_VER)
     31#include <msctf.h>
     32#else
     33#include "SDL_msctf.h"
     34#endif
     35
     36#include <imm.h>
     37
     38#define MAX_CANDLIST    10
     39#define MAX_CANDLENGTH  256
     40
     41#include "SDL_windowsclipboard.h"
     42#include "SDL_windowsevents.h"
     43#include "SDL_windowskeyboard.h"
     44#include "SDL_windowsmodes.h"
     45#include "SDL_windowsmouse.h"
     46#include "SDL_windowsopengl.h"
     47#include "SDL_windowsopengles.h"
     48#include "SDL_windowswindow.h"
     49#include "SDL_events.h"
     50#include "SDL_loadso.h"
     51
     52
     53#if WINVER < 0x0601
     54/* Touch input definitions */
     55#define TWF_FINETOUCH   1
     56#define TWF_WANTPALM    2
     57
     58#define TOUCHEVENTF_MOVE 0x0001
     59#define TOUCHEVENTF_DOWN 0x0002
     60#define TOUCHEVENTF_UP   0x0004
     61
     62DECLARE_HANDLE(HTOUCHINPUT);
     63
     64typedef struct _TOUCHINPUT {
     65    LONG      x;
     66    LONG      y;
     67    HANDLE    hSource;
     68    DWORD     dwID;
     69    DWORD     dwFlags;
     70    DWORD     dwMask;
     71    DWORD     dwTime;
     72    ULONG_PTR dwExtraInfo;
     73    DWORD     cxContact;
     74    DWORD     cyContact;
     75} TOUCHINPUT, *PTOUCHINPUT;
     76
     77#endif /* WINVER < 0x0601 */
     78
     79typedef BOOL  (*PFNSHFullScreen)(HWND, DWORD);
     80typedef void  (*PFCoordTransform)(SDL_Window*, POINT*);
     81
     82typedef struct
     83{
     84    void **lpVtbl;
     85    int refcount;
     86    void *data;
     87} TSFSink;
     88
     89/* Definition from Win98DDK version of IMM.H */
     90typedef struct tagINPUTCONTEXT2 {
     91    HWND hWnd;
     92    BOOL fOpen;
     93    POINT ptStatusWndPos;
     94    POINT ptSoftKbdPos;
     95    DWORD fdwConversion;
     96    DWORD fdwSentence;
     97    union {
     98        LOGFONTA A;
     99        LOGFONTW W;
    100    } lfFont;
    101    COMPOSITIONFORM cfCompForm;
    102    CANDIDATEFORM cfCandForm[4];
    103    HIMCC hCompStr;
    104    HIMCC hCandInfo;
    105    HIMCC hGuideLine;
    106    HIMCC hPrivate;
    107    DWORD dwNumMsgBuf;
    108    HIMCC hMsgBuf;
    109    DWORD fdwInit;
    110    DWORD dwReserve[3];
    111} INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
    112
    113/* Private display data */
    114
    115typedef struct SDL_VideoData
    116{
    117    int render;
    118
    119    DWORD clipboard_count;
    120
    121    /* Touch input functions */
    122    void* userDLL;
    123    BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
    124    BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
    125    BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
    126
    127    SDL_bool ime_com_initialized;
    128    struct ITfThreadMgr *ime_threadmgr;
    129    SDL_bool ime_initialized;
    130    SDL_bool ime_enabled;
    131    SDL_bool ime_available;
    132    HWND ime_hwnd_main;
    133    HWND ime_hwnd_current;
    134    HIMC ime_himc;
    135
    136    WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
    137    WCHAR ime_readingstring[16];
    138    int ime_cursor;
    139
    140    SDL_bool ime_candlist;
    141    WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH];
    142    DWORD ime_candcount;
    143    DWORD ime_candref;
    144    DWORD ime_candsel;
    145    UINT ime_candpgsize;
    146    int ime_candlistindexbase;
    147    SDL_bool ime_candvertical;
    148
    149    SDL_bool ime_dirty;
    150    SDL_Rect ime_rect;
    151    SDL_Rect ime_candlistrect;
    152    int ime_winwidth;
    153    int ime_winheight;
    154
    155    HKL ime_hkl;
    156    void* ime_himm32;
    157    UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
    158    BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
    159    LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
    160    BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
    161    LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
    162    BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
    163
    164    SDL_bool ime_uiless;
    165    struct ITfThreadMgrEx *ime_threadmgrex;
    166    DWORD ime_uielemsinkcookie;
    167    DWORD ime_alpnsinkcookie;
    168    DWORD ime_openmodesinkcookie;
    169    DWORD ime_convmodesinkcookie;
    170    TSFSink *ime_uielemsink;
    171    TSFSink *ime_ippasink;
    172} SDL_VideoData;
    173
    174extern SDL_bool g_WindowsEnableMessageLoop;
    175extern SDL_bool g_WindowFrameUsableWhileCursorHidden;
    176
    177typedef struct IDirect3D9 IDirect3D9;
    178extern SDL_bool D3D_LoadDLL( void **pD3DDLL, IDirect3D9 **pDirect3D9Interface );
    179
    180#endif /* _SDL_windowsvideo_h */
    181
    182/* vi: set ts=4 sw=4 expandtab: */