📄 cpw_window.h
字号:
/***************************************************************************/
/* */
/* cpw_window.h */
/* */
/* Window management and adapter event interface. */
/* */
/* 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_window_h__
#define __cpw_window_h__
#include "cpw_config.h"
#include "cpw_state.h"
#include "cpw_callbacks.h"
CPW_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* CpwCursor */
/* */
/* <Description> */
/* The default Cpw cursor identifiers. Custom is not supported yet. */
/* */
enum _CpwCursor
{
CursorArrow = 1,
CursorHand = 2,
CursorNo = 3,
CursorQuestion = 4,
CursorBeam = 5,
CursorWait = 6,
CursorCrosshair = 7,
CursorNone = 8,
CursorSizeNSEW = 9,
CursorSizeNS = 10,
CursorSizeNeSw = 11,
CursorSizeEW = 12,
CursorSizeSeNw = 13,
CursorCustom = 14
};
typedef enum _CpwCursor CpwCursor;
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* CpwWindowInfo */
/* */
struct _CpwWindowInfo
{
uint_32 id;
uint_32 x;
uint_32 y;
uint_32 width;
uint_32 height;
bool foreground;
bool fullscreen;
};
typedef struct _CpwWindowInfo CpwWindowInfo;
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* CpwWindowList */
/* */
#define CPW_MAX_WINLIST 30
struct _CpwWindowList
{
CpwWindowInfo list[CPW_MAX_WINLIST]; /* todo: make dynamic */
uint_32 size;
};
typedef struct _CpwWindowList CpwWindowList;
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwCreateWindow */
/* */
/* <Description> */
/* Creates a new window using the properties specified in the last */
/* call to cpwInitWindowPosition and cpwInitWindowSize. Returns the */
/* window's id used in subsequent calls. */
/* */
/* Window id's start at 1. By default, when the user closes the */
/* window with this id value, cpwMainLoop returns. A window id of */
/* 0 can be passed to window management calls indicating the action */
/* should effect the current foreground window, regardless of it's */
/* id value. */
/* */
CPW_API uint_32
cpwCreateWindow( pCpw cpw,
char * title );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwCreateWindowEx */
/* */
/* <Description> */
/* Creates a new window with the specified properties. Returns the */
/* window's id used in subsequent calls. */
/* */
CPW_API uint_32
cpwCreateWindowEx( pCpw cpw,
char * title,
uint_32 x,
uint_32 y,
uint_32 width,
uint_32 height );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwCreateFullscreenWindow */
/* */
/* <Description> */
/* Creates a new fullscreen window suitable for a game. Fullscreen */
/* windows are just like any other Cpw window and receive all of the */
/* same events. */
/* */
/* You can create as many fullscreen windows as you like. A */
/* fullscreen window is simply a Cpw window a few minor changes */
/* in the way it is created. */
/* */
/* - Fullscreen windows will minimize automatically if they */
/* loose focus. */
/* */
/* - Fullscreen windows have CursorNone as their default cursor. */
/* */
CPW_API uint_32
cpwCreateFullscreenWindow( pCpw cpw );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwFullscreenWindow */
/* */
/* <Description> */
/* Converts an existing window to a fullscreen window. To create a */
/* new fullscreen window use cpwCreateFullscreenWindow. */
/* */
/* - Fullscreen windows will minimize automatically if they */
/* loose focus. */
/* */
CPW_API bool
cpwFullscreenWindow( pCpw cpw,
uint_32 id );
/* */
/*************************************************************************/
CPW_API bool cpwMaximizeWindow( pCpw cpw, uint_32 id );
CPW_API bool cpwStandardWindow( pCpw cpw, uint_32 id );
/*************************************************************************/
/* */
/* <Function> */
/* cpwDestroyWindow */
/* */
/* <Description> */
/* Destroy's an existing window and all of it's resources. This call */
/* does not generate a destroy window event for the user's window */
/* callback. It is excepted practive to call this function for a */
/* when the destroy window event is received. */
/* */
CPW_API bool
cpwDestroyWindow( pCpw cpw,
uint_32 id );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwSetWindowTitle */
/* */
/* <Description> */
/* Changes the title text of the window specified. */
/* */
CPW_API bool
cpwSetWindowTitle( pCpw cpw,
pChar title,
uint_32 id );
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* cpwPositionWindow */
/* */
/* <Description> */
/* Positions the window frame on the desktop. Origin is upper left. */
/* */
CPW_API bool
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -