JurassicParkTrespasser/jp2_pc/Source/Shell/WinEvent.hpp
2018-01-01 23:07:24 +01:00

94 lines
3.1 KiB
C++

/***********************************************************************************************
*
* Copyright © DreamWorks Interactive. 1996
*
* Contents:
* WindowsEvent handler interface.
*
* Bugs:
*
* To do:
*
***********************************************************************************************
*
* $Log:: /JP2_PC/Source/Shell/WinEvent.hpp $
*
* 6 96/10/28 14:52 Speter
* Updated comments for new CAppShell functionality.
*
* 5 10/08/96 9:15p Agrant
* Always use WinInclude.hpp
*
* 4 8/14/96 10:24a Pkeet
* Added 'AM_DESTROY' message.
*
* 3 96/05/22 19:36 Speter
* Created AM_INIT event, made WinShell::Create() generate it.
*
* 2 96/05/16 18:20 Speter
* Added lots of comments.
*
* 1 96/05/16 16:46 Speter
*
**********************************************************************************************/
#ifndef HEADER_LIB_W95_WINEVENT_HPP
#define HEADER_LIB_W95_WINEVENT_HPP
#include "Lib\W95\WinInclude.hpp"
//******************************************************************************************
//
void WindowsEvent
(
uint u_message, // The message ID, usually based on a #define in <windows.h>.
WPARAM wp_param = 0, // The first descriptive parameter passed with the windows message.
LPARAM lp_param = 0 // The second descriptive parameter passed with the windows message.
);
//
// Handle a Windows message.
//
// Notes:
// This is an interface only. The function is NOT implemented by this module. It must be
// implemented by another module.
//
// This function is the main interface between WinShell and the rest of the application.
// A variety of applications can be built, each having their own WindowsEvent handler.
// This function handles raw Windows events for maximum flexibility.
//
// Cross-references:
// Called by WinShell for every Windows event, as well as some synthetic events defined below.
//
// Currently, AppShell.cpp contains the default library implementation of WindowsEvent, but
// WindowsEvent can be redefined in a non-library module. AppShell's WindowsEvent receives
// Windows events, and provides a callback facility to handle events in a more abstract, non-
// Windows-specific way.
//
//**********************************
//
// Define codes for synthetic events generated by WinShell. These will be passed as the
// first parameter of WindowsEvent above.
//
// I use an anonymous enum to have the convenience of consecutive values, even though there is
// not a distinct type.
//
// The prefix AM_ stands for "Application Message".
//
enum
{
AM_START = WM_USER, // This is the standard place to insert user events.
AM_INIT, // Called by WinShell after setting up all screen structures.
AM_STEP, // Generated repeatedly when the app is in continuous mode
// (see CAppShell::SetContinuous)
AM_PAUSED, // Sent when the user has paused or unpaused the app.
// wparam is 1 when paused, 0 when unpaused.
AM_PAINT, // Sent when the app should repaint prasMainScreen.
// WinShell has already done raster setup, the app should just draw.
AM_NEWRASTER, //
AM_DESTROY
};
#endif