📄 cpw_event.h
字号:
/***************************************************************************/
/* */
/* cpw_event.h */
/* */
/* The Cpw library event stack interface and management. */
/* */
/* Copyright 2001-2002 by */
/* Jim Mathies, */
/* */
/* This file is part of the Cpw project, and may only be used, */
/* modified, and distributed under the terms of the Cpw project */
/* license. By continuing to use, modify, or distribute this file */
/* you indicate that you have read the license and understand and */
/* accept it fully. */
/* */
/* File Platform: cross */
/* */
/***************************************************************************/
#ifndef __cpw_event_h__
#define __cpw_event_h__
#include "cpw_config.h"
#include "cpw_state.h"
#include "cpw_keymouse.h"
#include "cpw_callbacks.h"
CPW_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Enum> */
/* CpwWindowEvent */
/* */
/* <Description> */
/* Every Cpw window receives events based on various things that */
/* happen to the window, or a user's interaction with a window. */
/* These are the event constants. */
/* */
enum _CpwWindowEvent
{
CPW_NO_EVENT = 0,
CPW_MOUSECLICK_EVENT = 1,
CPW_MOUSEMOTION_EVENT = 2,
CPW_MOUSEDRAG_EVENT = 3,
CPW_MOUSEENTRY_EVENT = 4,
CPW_KEYBOARD_EVENT = 5,
CPW_SYSKEYBOARD_EVENT = 6,
CPW_CREATE_EVENT = 7,
CPW_DESTROY_EVENT = 8,
CPW_POSITION_EVENT = 9,
CPW_DISPLAY_EVENT = 10,
CPW_VISIBILITY_EVENT = 11,
CPW_RESHAPE_EVENT = 12,
CPW_MENUSELECT_EVENT = 13,
};
typedef enum _CpwWindowEvent CpwWindowEvent;
#define CPW_EVENTCOUNT CPW_MENUSELECT_EVENT + 1
#define CPW_MAXEVENTVALUE CPW_MENUSELECT_EVENT
/* */
/*************************************************************************/
/***********************************/
/* window visibility changes */
/***********************************/
#define CPW_HIDE 0 /* if visible, now hidden */
#define CPW_SHOW 1 /* if hidden, now shown */
#define CPW_GAINEDFOCUS 2 /* now the foreground window */
#define CPW_LOSTFOCUS 3 /* lost foreground status */
#define CPW_ICONIC 4 /* was iconified */
#define CPW_RESTORED 5 /* was restored */
/*************************************************************************/
/* */
/* global event handler setter api. */
/* */
/*************************************************************************/
CPW_API bool cpwCreateCallback( pCpw cpw, CpwCreateCallback createCallback );
CPW_API bool cpwDisplayCallback( pCpw cpw, CpwDisplayCallback displayCallback );
CPW_API bool cpwReshapeCallback( pCpw cpw, CpwReshapeCallback reshapeCallback );
CPW_API bool cpwPositionCallback( pCpw cpw, CpwPositionCallback positionCallback );
CPW_API bool cpwKeyboardCallback( pCpw cpw, CpwKeyboardCallback keyCallback );
CPW_API bool cpwSystemKeyboardCallback( pCpw cpw, CpwSystemKeyboardCallback skeyCallback );
CPW_API bool cpwVisibilityCallback( pCpw cpw, CpwVisibilityCallback visibilityCallback );
CPW_API bool cpwMouseClickCallback( pCpw cpw, CpwMouseClickCallback mouseclickCallback );
CPW_API bool cpwMouseDragCallback( pCpw cpw, CpwMouseDragCallback mousedragCallback );
CPW_API bool cpwMouseMoveCallback( pCpw cpw, CpwMouseMoveCallback mousemoveCallback );
CPW_API bool cpwMouseEntryCallback( pCpw cpw, CpwMouseEntryCallback mouseentryCallback );
/*************************************************************************/
/* */
/* window specifc event handler setter api. */
/* */
/*************************************************************************/
CPW_API bool cpwWindowCreateCallback( pCpw cpw, CpwCreateCallback createCallback, uint_32 id );
CPW_API bool cpwWindowDisplayCallback( pCpw cpw, CpwDisplayCallback displayCallback, uint_32 id );
CPW_API bool cpwWindowReshapeCallback( pCpw cpw, CpwReshapeCallback reshapeCallback, uint_32 id );
CPW_API bool cpwWindowPositionCallback( pCpw cpw, CpwPositionCallback positionCallback, uint_32 id );
CPW_API bool cpwWindowKeyboardCallback( pCpw cpw, CpwKeyboardCallback keyCallback, uint_32 id );
CPW_API bool cpwWindowSystemKeyboardCallback( pCpw cpw, CpwSystemKeyboardCallback skeyCallback, uint_32 id );
CPW_API bool cpwWindowVisibilityCallback( pCpw cpw, CpwVisibilityCallback visibilityCallback, uint_32 id );
CPW_API bool cpwWindowMouseClickCallback( pCpw cpw, CpwMouseClickCallback mouseclickCallback, uint_32 id );
CPW_API bool cpwWindowMouseDragCallback( pCpw cpw, CpwMouseDragCallback mousedragCallback, uint_32 id );
CPW_API bool cpwWindowMouseMoveCallback( pCpw cpw, CpwMouseMoveCallback mousemoveCallback, uint_32 id );
CPW_API bool cpwWindowMouseEntryCallback( pCpw cpw, CpwMouseEntryCallback mouseentryCallback, uint_32 id );
/*************************************************************************/
/* */
/* event stack manipulation api functions */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwFilterEvent */
/* */
/* <Description> */
/* Turns event filtering for a specific event on or off. Returns */
/* the previous filter value for the particular event. */
/* */
CPW_API bool
cpwFilterEvent( pCpw cpw,
CpwWindowEvent eventType,
bool flag );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwNextEvent */
/* */
/* <Description> */
/* Returns a CpwWindowEvent constant indicating the next event */
/* to be delivered. */
/* */
CPW_API CpwWindowEvent
cpwNextEvent( pCpw cpw );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwNextWindowEvent */
/* */
/* <Description> */
/* Returns a CpwWindowEvent constant indicating the next event */
/* to be delivered for the specified window. */
/* */
CPW_API CpwWindowEvent
cpwNextWindowEvent( pCpw cpw,
uint_32 id );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwClearEvents */
/* */
/* <Description> */
/* Clears all events from the event stack. */
/* */
CPW_API bool
cpwClearEvents( pCpw cpw );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwClearEvent */
/* */
/* <Description> */
/* Clears all events of the type specified from the event stack. */
/* */
CPW_API bool
cpwClearEvent( pCpw cpw,
CpwWindowEvent event );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -