📄 defaultlcdui.h
字号:
/*
* @(#)defaultLCDUI.h 1.41 01/06/19 @(#)
* Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*/
#ifndef DEFAULTLCDUI_H_INCLUDED
#define DEFAULTLCDUI_H_INCLUDED
typedef unsigned short unicode;
/* reference point locations, from Graphics.java */
#define HCENTER 1
#define VCENTER 2
#define LEFT 4
#define RIGHT 8
#define TOP 16
#define BOTTOM 32
#define BASELINE 64
/* flags for font descriptors */
#define STYLE_PLAIN 0
#define STYLE_BOLD 1
#define STYLE_ITALIC 2
#define STYLE_UNDERLINED 4
/* flags for line types */
#define SOLID 0
#define DOTTED 1
#define SIZE_SMALL 8
#define SIZE_MEDIUM 0
#define SIZE_LARGE 16
#define FACE_SYSTEM 0
#define FACE_MONOSPACE 32
#define FACE_PROPORTIONAL 64
/* flags for LCDUIgetDisplayParams */
#define SUPPORTS_COLOR 1
#define SUPPORTS_POINTER 2
#define SUPPORTS_MOTION 4
#define SUPPORTS_REPEAT 8
#define SUPPORTS_DOUBLEBUFFER 16
/* The type of events which can be generated. */
/* appStopKVMEvent is defined -1 in VmCommon/h/events.h in CLDC source code */
/* any definition here must not change or override that definition */
enum KVMEventTypes {
invalidKVMEvent = -2,
/* appStopKVMEvent = -1, */
keyDownKVMEvent = 0,
keyUpKVMEvent = 1,
keyRepeatKVMEvent = 2,
penDownKVMEvent = 3,
penUpKVMEvent = 4,
penMoveKVMEvent = 5,
timerKVMEvent = 6,
commandKVMEvent = 7,
repaintKVMEvent = 8,
keyTypedKVMEvent = 9,
#ifdef INCLUDE_I18N
imeKVMEvent = 10,
lastKVMEvent = 10
#else
lastKVMEvent = 9
#endif
};
/* The event record. */
typedef struct {
enum KVMEventTypes type;
int chr;
short screenX;
short screenY;
#ifdef INCLUDE_I18N
unicode* str;
short len;
#endif
} KVMEventType;
#define COMMAND_TYPE_SCREEN 1
#define COMMAND_TYPE_BACK 2
#define COMMAND_TYPE_CANCEL 3
#define COMMAND_TYPE_OK 4
#define COMMAND_TYPE_HELP 5
#define COMMAND_TYPE_STOP 6
#define COMMAND_TYPE_EXIT 7
#define COMMAND_TYPE_ITEM 8
typedef struct {
int priority;
unicode *chars;
unsigned int numChars:8;
unsigned int type:4;
unsigned int id:20;
} commandStruct;
typedef enum {
KEY_0 = '0',
KEY_1 = '1',
KEY_2 = '2',
KEY_3 = '3',
KEY_4 = '4',
KEY_5 = '5',
KEY_6 = '6',
KEY_7 = '7',
KEY_8 = '8',
KEY_9 = '9',
KEY_ASTERISK = '*',
KEY_POUND = '#',
KEY_UP = -1,
KEY_DOWN = -2,
KEY_LEFT = -3,
KEY_RIGHT = -4,
KEY_SELECT = -5,
KEY_SOFT1 = -6,
KEY_SOFT2 = -7,
KEY_CLEAR = -8,
/* these may not be available to java */
KEY_SEND = -10,
KEY_END = -11,
KEY_POWER = -12,
KEY_INVALID = 0
} KeyType;
#define FONTPARAMS face, style, size
#define FONTPARAMS_PROTO int face, int style, int size
/* translate rgb or grayscale to device-dependent pixel value */
extern int LCDUIgetPixel(int rgb, int gray, int isGray);
/*
* Schedule a timer of the given type, to go off millis in the future.
*/
extern void LCDUIscheduleTimer(int type, int millis);
/*
* Return the key code corresponding to the given abstract game action.
*/
extern int LCDUIgetKeyCode(int);
/*
* Return the system key corresponding to the given key code..
*/
extern int LCDUIgetSystemKey(int);
/*
* Return the abstract game action corresponding to the given key code.
*/
extern int LCDUIgetGameAction(int);
/*
* Return the key string to the given key code.
*/
extern char *LCDUIgetKeyName(int);
/*
* Draw a line between two points (x1,y1) and (x2,y2).
*/
extern void LCDUIdrawLine(int pixel, short *clip, void *dst, int dotted,
int x1, int y1, int x2, int y2);
/*
* Draw a rectangle at (x,y) with the given width and height.
*/
extern void LCDUIdrawRect(int pixel, short *clip, void *dst, int dotted,
int x, int y, int width, int height);
/*
* Fill a rectangle at (x,y) with the given width and height.
*/
extern void LCDUIfillRect(int pixel, short *clip, void *dst, int dotted,
int x, int y, int width, int height);
/*
* Draw a rectangle at (x,y) with the given width and height. arcWidth and
* arcHeight, if nonzero, indicate how much of the corners to round off.
*/
extern void LCDUIdrawRoundRect(int pixel, short *clip, void *dst,
int dotted,
int x, int y, int width, int height,
int arcWidth, int arcHeight);
/*
* Fill a rectangle at (x,y) with the given width and height. arcWidth and
* arcHeight, if nonzero, indicate how much of the corners to round off.
*/
extern void LCDUIfillRoundRect(int pixel, short *clip, void *dst,
int dotted,
int x, int y, int width, int height,
int arcWidth, int arcHeight);
/*
* Draw an elliptical arc centered in the given rectangle. If filled is
* true, fill the contents of the arc; otherwise just stroke it. The
* portion of the arc to be drawn starts at startAngle (with 0 at the
* 3 o'clock position) and proceeds counterclockwise by <arcAngle>
* degrees. arcAngle may not be negative.
*/
extern void LCDUIdrawArc(int pixel, short *clip, void *dst, int dotted,
int x, int y, int width, int height,
int startAngle, int arcAngle);
/*
* Fill an elliptical arc centered in the given rectangle. The
* portion of the arc to be drawn starts at startAngle (with 0 at the
* 3 o'clock position) and proceeds counterclockwise by <arcAngle>
* degrees. arcAngle may not be negative.
*/
extern void LCDUIfillArc(int pixel, short *clip, void *dst, int dotted,
int x, int y, int width, int height,
int startAngle, int arcAngle);
/*
* Draw the first n characters in chararray, with the anchor point of the
* entire (sub)string located at x, y.
*/
extern void LCDUIdrawChars(int pixel, short *clip, void *dst, int dotted,
FONTPARAMS_PROTO,
int x, int y, int anchor,
const unicode *chararray, int n);
/*
* Draw the given image data, locating its anchor point at x, y
*/
extern void LCDUIdrawImage(short *clip, void *dst,
int x, int y, int anchor, void *img);
/*
* Refresh the given area. For double buffering purposes.
*/
extern void LCDUIrefresh(int x, int y, int w, int h);
/*
* Get the ascent, descent and leading info for the font indicated
* by FONTPARAMS.
*/
extern void LCDUIgetFontInfo(FONTPARAMS_PROTO,
int *ascent, int *descent, int *leading);
/*
* Get the advance width for the first n characters in charArray if
* they were to be drawn in the font indicated by FONTPARAMS.
*/
extern int LCDUIcharsWidth(FONTPARAMS_PROTO, const unicode *charArray,
int n);
/*
* Get parameters describing the window system's capabilities
*/
extern void LCDUIgetDisplayParams(int *width, int *height,
int *eraseColor, int *depth, int *flags);
/*
* Set the softbuttons to handle the given list of abstract commands.
*/
extern void LCDUIupdateCommandSet(commandStruct *menu, int length);
/*
* Initialize the menu system
*/
extern void LCDUIinitMenus();
extern void LCDUIfinalizeMenus();
/*
* Handle an input event while the menu system is running
*/
extern int LCDUIhandleMenuEvent(enum KVMEventTypes t, int a, int b);
/*
* Handle an input event while the menu system is running, but
* without passing it through the event loop
*/
extern bool_t LCDUImenuInternalEvent(int button, KVMEventType *evt);
/*
* set a soft button label
*/
extern void LCDUIsetSoftButton(int index, const unicode *label, int numChars);
/*
* set horizontal scroll properties
*/
extern int LCDUIsetHorizontalScroll(int scrollPosition, int scrollProportion);
/*
* set vertical scroll properties
*/
extern int LCDUIsetVerticalScroll(int scrollPosition, int scrollProportion);
/*
* Play the indicated sound. Return a boolean value to indicate whether
* a sound was actually emitted.
*/
extern bool_t LCDUIplaySound(int soundType);
#define ALERT_INFO 1
#define ALERT_WARNING 2
#define ALERT_ERROR 3
#define ALERT_ALARM 4
#define ALERT_CONFIRMATION 5
/*
* set input mode
*/
extern void LCDUIsetInputMode(int mode);
/*
* set horizontal scroll properties
*/
extern int LCDUIsetHorizontalScroll(int scrollPosition, int scrollProportion);
/*
* set vertical scroll properties
*/
extern int LCDUIsetVerticalScroll(int scrollPosition, int scrollProportion);
/*
* destroy native image resources; called by cleanup handler
*/
extern void LCDUIdestroyNativeImage(void* imagePtr);
/*
* Private initialization and finalization for windows/graphics system
*/
extern void InitializeWindowSystem();
extern void FinalizeWindowSystem();
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -