Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS (WIN) Kernel - Data.c
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/* == Kernel ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Private Data                                                                                                                                                          */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* user32 */
TgUINT16                                    (__stdcall *g_pfnRegisterClassEx)( P_TgVOID ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnUnregisterClass)( CP_TgCHAR, TgMS_HINSTANCE ) = nullptr;
TgMS_HWND                                   (__stdcall *g_pfnCreateWindowEx)( DWORD, CP_TgCHAR, CP_TgCHAR, DWORD, TgSINT32, TgSINT32, TgSINT32, TgSINT32, TgMS_HWND,
                                                                              TgMS_HMENU, TgMS_HINSTANCE, P_TgVOID ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnDestroyWindow)( TgMS_HWND ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnShowWindow)( TgMS_HWND, TgSINT32 ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnUpdateWindow)( TgMS_HWND ) = nullptr;
TgMS_HDC                                    (__stdcall *g_pfnGetDC)( TgMS_HWND ) = nullptr;
TgSINT32                                    (__stdcall *g_pfnReleaseDC)( TgMS_HWND, TgMS_HDC ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnSetWindowText)( TgMS_HWND, CP_TgCHAR ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnGetWindowRect)( TgMS_HWND, P_TgVOID ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnGetClientRect)( TgMS_HWND, P_TgVOID ) = nullptr;
TgMS_HWND                                   (__stdcall *g_pfnFindWindow)( CP_TgCHAR, CP_TgCHAR ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnIsIconic)( TgMS_HWND ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnSetForegroundWindow)( TgMS_HWND ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnScreenToClient)( TgMS_HWND, P_TgVOID ) = nullptr;
TgMS_HCURSOR                                (__stdcall *g_pfnSetCursor)( TgMS_HCURSOR ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnPeekMessage)( P_TgVOID, TgMS_HWND, TgUINT32, TgUINT32, TgUINT32 ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnGetMessage)( P_TgVOID, TgMS_HWND, TgUINT32, TgUINT32 ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnTranslateMessage)( CP_TgVOID ) = nullptr;
TgVOID                                      (__stdcall *g_pfnPostQuitMessage)( TgSINT32 ) = nullptr;
TgMS_HMONITOR                               (__stdcall *g_pfnMonitorFromWindow)( TgMS_HWND, DWORD ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnEnumDisplaySettings)( CP_TgCHAR, DWORD, P_TgVOID ) = nullptr;
TgSINT64                                    (__stdcall *g_pfnDefWindowProc)( TgMS_HWND, TgUINT32, TgUINT64, TgSINT64 ) = nullptr;
TgSINT64                                    (__stdcall *g_pfnDispatchMessage)( CP_TgVOID ) = nullptr;
TgSINT64                                    (__stdcall *g_pfnSendMessage)( TgMS_HWND, TgUINT32, TgUINT64, TgSINT64 ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnPostMessage)( TgMS_HWND, TgUINT32, TgUINT64, TgSINT64 ) = nullptr;
TgSINT64                                    (__stdcall *g_pfnGetWindowLong)( TgMS_HWND, TgSINT32 ) = nullptr;
TgSINT64                                    (__stdcall *g_pfnSetWindowLong)( TgMS_HWND, TgSINT32, TgSINT64 ) = nullptr;
TgBOOL                                      (__stdcall *g_pfnSetWindowPos)( TgMS_HWND, TgMS_HWND, TgSINT32, TgSINT32, TgSINT32, TgSINT32, TgUINT32 ) = nullptr;

TgCHAR                                      g_szKN_ExeTitle[KTgKN_MAX_TITLE];
TgCHAR                                      g_szKN_ClassName[KTgKN_MAX_TITLE];
P_TgVOID                                    g_pfnKN_WndProc;
TgSINT32                                    g_iKN_Display_W;
TgSINT32                                    g_iKN_Display_H;
TgSINT32                                    g_iKN_Window_X0;
TgSINT32                                    g_iKN_Window_Y0;
TgSINT32                                    g_iKN_Window_X1;
TgSINT32                                    g_iKN_Window_Y1;
TgSINT32                                    g_iKN_Window_PadX;
TgSINT32                                    g_iKN_Window_PadY;
TgUINT32                                    g_uiKN_Window_Style;
TgBOOL                                      g_bKN_Minimized;
TgBOOL                                      g_bKN_Maximized;
TgBOOL                                      g_bKN_FullScreen;
TgBOOL                                      g_bKN_FullScreen_Lock;
TgBOOL                                      g_bKN_WindowSize_Fixed;
TgBOOL                                      g_bKN_WindowSize_Lock;
TgBOOL                                      g_bKN_MuteInBackground;
TgBOOL                                      g_bKN_RunInBackground;
TgBOOL                                      g_bKN_HasGDIMenu;
TgBOOL                                      g_bKN_ClearDisplay;
TgBOOL                                      g_bKN_PauseOnSize;
TgSINT32                                    g_bKN_Monitor_Index;
TgBOOL                                      g_bKN_Monitor_Portrait;

TgVOID                                      (*g_pfnKN_GUI_Keyboard_Handler)( TgMS_HWND, TgUINT32, TgUINTPTR, TgSINTPTR ) = nullptr;
TgVOID                                      (*g_pfnKN_GUI_Mouse_Handler)( TgMS_HWND, TgUINT32, TgUINTPTR, TgSINTPTR ) = nullptr;

TgVOID                                      (*g_pfnDevice_Change_Check)( C_TgSINT32, C_TgSINT32, C_TgSINT32 ) = nullptr;
TgVOID                                      (*g_pfnQuery_Render_Display_Rect)( P_TgSINT32, P_TgSINT32, C_TgSINT32, C_TgBOOL ) = nullptr;
TgVOID                                      (*g_pfnQuery_Render_Display_Min_Rect)( P_TgSINT32, P_TgSINT32, C_TgSINT32, C_TgBOOL ) = nullptr;
TgVOID                                      (*g_pfnQuery_Render_Display_Max_Rect)( P_TgSINT32, P_TgSINT32, C_TgSINT32, C_TgBOOL ) = nullptr;
TgVOID                                      (*g_pfnQuery_Render_Select_Rect)( P_TgSINT32, P_TgSINT32, C_TgSINT32, C_TgBOOL ) = nullptr;
TgSINT32                                    (*g_pfnQuery_Monitor_Index)( TgVOID ) = nullptr;




/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Private Functions                                                                                                                                                     */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* ---- tgKN_PM_Query_Fixed_Memory -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgSIZE tgKN_PM_Query_Fixed_Memory( TgVOID )
{
    return (0
            + sizeof( g_pfnRegisterClassEx )
            + sizeof( g_pfnUnregisterClass )
            + sizeof( g_pfnCreateWindowEx )
            + sizeof( g_pfnDestroyWindow )
            + sizeof( g_pfnShowWindow )
            + sizeof( g_pfnUpdateWindow )
            + sizeof( g_pfnGetDC )
            + sizeof( g_pfnReleaseDC )
            + sizeof( g_pfnSetWindowText )
            + sizeof( g_pfnGetWindowRect )
            + sizeof( g_pfnGetClientRect )
            + sizeof( g_pfnFindWindow )
            + sizeof( g_pfnIsIconic )
            + sizeof( g_pfnSetForegroundWindow )
            + sizeof( g_pfnScreenToClient )
            + sizeof( g_pfnSetCursor )
            + sizeof( g_pfnPeekMessage )
            + sizeof( g_pfnGetMessage )
            + sizeof( g_pfnTranslateMessage )
            + sizeof( g_pfnPostQuitMessage )
            + sizeof( g_pfnMonitorFromWindow )
            + sizeof( g_pfnEnumDisplaySettings )
            + sizeof( g_pfnDefWindowProc )
            + sizeof( g_pfnDispatchMessage )
            + sizeof( g_pfnSendMessage )
            + sizeof( g_pfnPostMessage )
            + sizeof( g_pfnGetWindowLong )
            + sizeof( g_pfnSetWindowLong )
            + sizeof( g_pfnSetWindowPos )
            + sizeof( g_szKN_ExeTitle )
            + sizeof( g_szKN_ClassName)
            + sizeof( g_pfnKN_WndProc )
            + sizeof( g_iKN_Display_W )
            + sizeof( g_iKN_Display_H )
            + sizeof( g_iKN_Window_X0 )
            + sizeof( g_iKN_Window_Y0 )
            + sizeof( g_iKN_Window_X1 )
            + sizeof( g_iKN_Window_Y1 )
            + sizeof( g_iKN_Window_PadX )
            + sizeof( g_iKN_Window_PadY )
            + sizeof( g_uiKN_Window_Style )
            + sizeof( g_bKN_Minimized )
            + sizeof( g_bKN_Maximized )
            + sizeof( g_bKN_FullScreen )
            + sizeof( g_bKN_FullScreen_Lock )
            + sizeof( g_bKN_WindowSize_Fixed )
            + sizeof( g_bKN_WindowSize_Lock )
            + sizeof( g_bKN_MuteInBackground )
            + sizeof( g_bKN_RunInBackground )
            + sizeof( g_bKN_HasGDIMenu )
            + sizeof( g_bKN_ClearDisplay )
            + sizeof( g_bKN_PauseOnSize )
            + sizeof( g_bKN_Monitor_Index )
            + sizeof( g_bKN_Monitor_Portrait )
            + sizeof( g_pfnKN_GUI_Keyboard_Handler )
            + sizeof( g_pfnKN_GUI_Mouse_Handler )
            + sizeof( g_pfnDevice_Change_Check )
            + sizeof( g_pfnQuery_Render_Display_Rect )
            + sizeof( g_pfnQuery_Render_Display_Min_Rect )
            + sizeof( g_pfnQuery_Render_Display_Max_Rect )
            + sizeof( g_pfnQuery_Render_Select_Rect )
            + sizeof( g_pfnQuery_Monitor_Index )
    );
}