Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS (WIN) Kernel - Configuration.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 ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Functions                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* ---- tgKN_Set_GUI_Keyboard_Callback ---------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_GUI_Keyboard_Callback( TgVOID( *pfnCallback )(TgMS_HWND, TgUINT32, TgUINTPTR, TgSINTPTR) )
{
    g_pfnKN_GUI_Keyboard_Handler = pfnCallback;
}


/* ---- tgKN_Set_GUI_Mouse_Callback ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_GUI_Mouse_Callback( TgVOID( *pfnCallback )(TgMS_HWND, TgUINT32, TgUINTPTR, TgSINTPTR) )
{
    g_pfnKN_GUI_Mouse_Handler = pfnCallback;
}


/* ---- tgKN_Set_Exe_Title ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Exe_Title( CPC_TgCHAR sExeName )
{
    TgERROR( TgFALSE == tgKN_Query_Boot() );

    if (0 == sExeName)
    {
        g_szKN_ExeTitle[0] = 0;
    }
    else
    {
        tgSZ_Copy( g_szKN_ExeTitle, KTgKN_MAX_TITLE, sExeName );
    };
}


/* ---- tgKN_Set_Class_Name --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Class_Name( CPC_TgCHAR szClassName )
{
    TgERROR( TgFALSE == tgKN_Query_Boot() );

    if (0 == szClassName)
    {
        g_szKN_ClassName[0] = 0;
    }
    else
    {
        tgSZ_Copy( g_szKN_ClassName, KTgKN_MAX_TITLE, szClassName );
    };
}


/* ---- tgKN_Set_WndProc ------------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_WndProc( P_TgVOID pfnWndProc )
{
    TgERROR( TgFALSE == tgKN_Query_Boot() );
    g_pfnKN_WndProc = pfnWndProc;
}


/* ---- tgKN_Set_Window_PosX -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window_PosX( C_TgSINT32 iPosX )
{
    g_iKN_Window_X0 = iPosX;
}


/* ---- tgKN_Set_Window_PosY -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window_PosY( C_TgSINT32 iPosY )
{
    g_iKN_Window_Y0 = iPosY;
}


/* ---- tgKN_Set_Window_Style ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window_Style( C_TgUINT32 iStyle )
{
    g_uiKN_Window_Style = iStyle;
}


/* ---- tgKN_Set_Window_Width ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window_Width( C_TgSINT32 iWidth )
{
    g_iKN_Window_X1 = g_iKN_Window_X0 + iWidth;
}


/* ---- tgKN_Set_Window_Height ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window_Height( C_TgSINT32 iHeight )
{
    g_iKN_Window_Y1 = g_iKN_Window_Y0 + iHeight;
}


/* ---- tgKN_Set_Display_Width ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Display_Width( C_TgSINT32 iWidth )
{
    g_iKN_Display_W = iWidth;
}


/* ---- tgKN_Set_Display_Height ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Display_Height( C_TgSINT32 iHeight )
{
    g_iKN_Display_H = iHeight;
}


/* ---- tgKN_Set_FullScreen --------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_FullScreen( C_TgBOOL bFlag )
{
    g_bKN_FullScreen = bFlag;
}


/* ---- tgKN_Set_Window ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window( C_TgBOOL bFlag )
{
    g_bKN_FullScreen = !bFlag;
}


/* ---- tgKN_Set_Minimized ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Minimized( C_TgBOOL bFlag )
{
    g_bKN_Minimized = bFlag;
}


/* ---- tgKN_Set_Maximized ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Maximized( C_TgBOOL bFlag )
{
    g_bKN_Maximized = bFlag;
}


/* ---- tgKN_Set_Full_Screen_Lock --------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Full_Screen_Lock( C_TgBOOL bFlag )
{
    g_bKN_FullScreen_Lock = bFlag;
}


/* ---- tgKN_Set_Window_Size_Fixed -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window_Size_Fixed( C_TgBOOL bFlag )
{
    g_bKN_WindowSize_Fixed = bFlag;
}


/* ---- tgKN_Set_Window_Size_Lock --------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Window_Size_Lock( C_TgBOOL bFlag )
{
    g_bKN_WindowSize_Lock = bFlag;
}


/* ---- tgKN_Set_Mute_In_Background ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Mute_In_Background( C_TgBOOL bFlag )
{
    g_bKN_MuteInBackground = bFlag;
}


/* ---- tgKN_Set_Run_In_Background -------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Run_In_Background( C_TgBOOL bFlag )
{
    g_bKN_RunInBackground = bFlag;
}


/* ---- tgKN_Set_Menu --------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Menu( C_TgBOOL bFlag )
{
    g_bKN_HasGDIMenu = bFlag;
}


/* ---- tgKN_Set_Clear_Display ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Clear_Display( C_TgBOOL bFlag )
{
    g_bKN_ClearDisplay = bFlag;
}


/* ---- tgKN_Set_Pause_On_Size ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgVOID tgKN_Set_Pause_On_Size( C_TgBOOL bFlag )
{
    g_bKN_PauseOnSize = bFlag;
}


/* ---- tgKN_Query_Exe_Title -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
CPC_TgCHAR tgKN_Query_Exe_Title( TgVOID )
{
    return (g_szKN_ExeTitle);
}


/* ---- tgKN_Query_Class_Name ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
CPC_TgCHAR tgKN_Query_Class_Name( TgVOID )
{
    return (g_szKN_ClassName);
}


/* ---- tgKN_Query_WndProc ---------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
P_TgVOID tgKN_Query_WndProc( TgVOID )
{
    return (g_pfnKN_WndProc);
}


/* ---- tgKN_Query_Window_PosX ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgSINT32 tgKN_Query_Window_PosX( TgVOID )
{
    return (g_iKN_Window_X0);
}


/* ---- tgKN_Query_Window_PosY ------------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgSINT32 tgKN_Query_Window_PosY( TgVOID )
{
    return (g_iKN_Window_Y0);
}


/* ---- tgKN_Query_Window_Style ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgUINT32 tgKN_Query_Window_Style( TgVOID )
{
    return (g_uiKN_Window_Style);
}


/* ---- tgKN_Query_Window_Width ----------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgSINT32 tgKN_Query_Window_Width( TgVOID )
{
    return (g_iKN_Window_X1 - g_iKN_Window_X0);
}


/* ---- tgKN_Query_Window_Height ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgSINT32 tgKN_Query_Window_Height( TgVOID )
{
    return (g_iKN_Window_Y1 - g_iKN_Window_Y0);
}


/* ---- tgKN_Query_Display_Width ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgSINT32 tgKN_Query_Display_Width( TgVOID )
{
    return (g_iKN_Display_W);
}


/* ---- tgKN_Query_Display_Height --------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgSINT32 tgKN_Query_Display_Height( TgVOID )
{
    return (g_iKN_Display_H);
}


/* ---- tgKN_Query_FullScreen ------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_FullScreen( TgVOID )
{
    return (g_bKN_FullScreen);
}


/* ---- tgKN_Query_Window ----------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Window( TgVOID )
{
    return (!g_bKN_FullScreen);
}


/* ---- tgKN_Query_Minimized -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Minimized( TgVOID )
{
    return (g_bKN_Minimized);
}


/* ---- tgKN_Query_Maximized -------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Maximized( TgVOID )
{
    return (g_bKN_Maximized);
}


/* ---- tgKN_Query_Full_Screen_Lock ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Full_Screen_Lock( TgVOID )
{
    return (g_bKN_FullScreen_Lock);
}


/* ---- tgKN_Query_Window_Size_Fixed ------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Window_Size_Fixed( TgVOID )
{
    return (g_bKN_WindowSize_Fixed);
}


/* ---- tgKN_Query_Window_Size_Lock ------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Window_Size_Lock( TgVOID )
{
    return (g_bKN_WindowSize_Lock);
}


/* ---- tgKN_Query_Mute_In_Background ----------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Mute_In_Background( TgVOID )
{
    return (g_bKN_MuteInBackground);
}


/* ---- tgKN_Query_Run_In_Background ------------------------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Run_In_Background( TgVOID )
{
    return (g_bKN_RunInBackground);
}


/* ---- tgKN_Query_Menu ------------------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Menu( TgVOID )
{
    return (g_bKN_HasGDIMenu);
}


/* ---- tgKN_Query_Clear_Display ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Clear_Display( TgVOID )
{
    return (g_bKN_ClearDisplay);
}


/* ---- tgKN_Query_Pause_On_Size ---------------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgBOOL tgKN_Query_Pause_On_Size( TgVOID )
{
    return (g_bKN_PauseOnSize);
}