📄 rcp2c.h
字号:
/*
* @(#)RCP2C.h
*
* Copyright 1997-1999, Wes Cherry (mailto:wesc@technosis.com)
* 2000-2001, Aaron Ardiri (mailto:aaron@ardiri.com)
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, please write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Revisions:
* ==========
*
* pre 18-Jun-2000 <numerous developers>
* creation
* 18-Jun-2000 Aaron Ardiri
* GNU GPL documentation additions
* 23-Jun-2000 Mark Garlanger
* Additions to support #ifdef/#ifndef/#else/#endif in
* both .rcp files and .h files.
* 20-Nov-2000 Renaud Malaval
* additions PalmOS 3.5 support
* additions to support LE32 resouces
*/
#include "std.h"
#include "util.h"
#include "lex.h"
#include "plex.h"
#include "font.h"
#ifndef _pilrc_h
#define _pilrc_h // RMA : multiples include protection
#ifdef WIN32 // little endian
#define HOST_LITTLE_ENDIAN
#else // big endian
#define HOST_BIG_ENDIAN
#endif
/*-----------------------------------------------------------------------------
| PILOT STRUCTS
|
|
| a note on the strings following some of the following structures:
|
| the strings define how to dump the structure out in the same format as the
| pilot structs. This way you do not have to include pilot include files
| which are definitely not compiler/processor independent.
|
| note: we make the assumption that sizeof(int) == sizeof(void *) -- the emitter
| moves through the structs as if they were an array of ints and emits the struct
| according to the template
|
| template syntax:
|
| base types:
| b : byte (8 bits)
| w : word (16 bits)
| l : long (32 bits)
| t : bit (1 bit of 8 bits)
| u : bits (1 bits of 16 bits) // RMa additions
| p : pointer (32 bits)
|
| prefixes: (optional)
| z : zero -- there is no corresponding field in our structs -- emit the
| base type filled w/ 0
|
| suffixes: (optional)
| # : (decimal numeric) -- number of times to repeat the previous type.
| For bits (t) this specifies the number of bits to shift in.
| Note that the bits must not cross byte boundaries in any one field emission.
-------------------------------------------------------------WESC------------*/
#define leftAlign 0
#define centerAlign 1
#define rightAlign 2
#define noButtonFrame 0
#define standardButtonFrame 1
#define boldButtonFrame 2
#define rectangleButtonFrame 3
#define Enum(type) typedef enum type
#define EndEnum
Enum(controlStyles)
{
buttonCtl, pushButtonCtl, checkboxCtl, popupTriggerCtl, selectorTriggerCtl, repeatingButtonCtl, sliderCtl, feedbackSliderCtl /* RMa add support sliders */
}
EndEnum ControlStyles;
Enum(alertTypes)
{
informationAlert, confirmationAlert, warningAlert, errorAlert}
EndEnum AlertType;
Enum(formObjects)
{
frmFieldObj, frmControlObj, frmListObj, frmTableObj, frmBitmapObj, frmLineObj, frmFrameObj, frmRectangleObj, frmLabelObj, frmTitleObj, frmPopupObj, frmGraffitiStateObj, frmGadgetObj, frmScrollbarObj, frmSliderObj, /* RMa add support sliders */
frmGraphicalControlObj /* RMa add support graphical control */
}
EndEnum FormObjectKind;
Enum(fontID)
{
stdFont, boldFont, largeFont, symbolFont, symbol11Font, symbol7Font, ledFont}
EndEnum FontID;
typedef struct _rcpoint
{
int x;
int y;
}
RCPOINT;
typedef struct _Rcrect
{
RCPOINT topLeft;
RCPOINT extent;
}
RCRECT;
/************************************************\
* RMa update all structure to be compleant with
* PalmOS 3.5
* LE32 ( 16 and 32 bits memory alignment)
\************************************************/
/*
* window.h
*/
typedef struct _rcframebits
{
int cornerDiam; /* u8 */
/*
* int reserved; zu3
*/
int threeD; /* u */
int shadowWidth; /* u2 */
int width; /* u2 */
}
RCFRAMEBITS; /* u8zu3uu2u2 */
typedef struct _rcwindowflags
{
/*
* Word format:1; zu
*/
/*
* Word offscreen:1; zu
*/
int modal; /* u */
int focusable; /* u */
/*
* Word enabled:1; zu
*/
/*
* Word visible:1; zu
*/
int dialog; /* u */
/*
* Word freeBitmap:1 zu
*/
/*
* Word reserved :8; zu8
*/
}
RCWINDOWFLAGS; /* zuzuuu zuzuuzu zu8 */
typedef struct _rcwindowBA16Type
{
int displayWidth; /* w */
int displayHeight; /* w */
/*
* int displayAddr; zl
*/
RCWINDOWFLAGS windowFlags; /* zuzuuu zuzuuzu zu8 */
RCRECT windowBounds; /* w4 */
/*
* RCRECT clippingBounds; zw4
*/
/*
* BitmapPtr bitmapP; zl
*/
RCFRAMEBITS frameType; /* u8zu3uu2u2 */
/*
* GraphicStatePtr drawStateP; zl
*/
/*
* struct RCWindowBA16Type *nextWindow; zl
*/
}
RCWindowBA16Type;
#define szRCWindowBA16 "w,w,zl,zuzuuuzuzuuzuzu8,w4,zw4,zl,u8zu3uu2u2,zl,zl"
typedef struct _rcwindowBA32Type
{
int displayWidth; /* w */
int displayHeight; /* w */
/*
* int displayAddr; zl
*/
RCRECT windowBounds; /* w4 */
/*
* RCRECT clippingBounds; zw4
*/
/*
* BitmapPtr bitmapP; zl
*/
RCWINDOWFLAGS windowFlags; /* zuzuuu zuzuuzu zu8 */
RCFRAMEBITS frameType; /* u8zu3uu2u2 */
/*
* GraphicStatePtr drawStateP; zl
*/
/*
* struct RCWindow32Type *nextWindow; zl
*/
}
RCWindowBA32Type;
#define szRCWindowBA32 "w,w,zl,w4,zw4,zl,zuzuuuzuzuuzuzu8,u8zu3uu2u2,zl,zl"
/*
* ------------------ List ------------------
*/
typedef struct _rclistattr
{
int usable; /* u */
int enabled; /* u */
int visible; /* u */
int poppedUp; /* u */
int hasScrollBar; /* u */
int search; /* u */
/*
* int reserved; zu10
*/
}
RCLISTATTR; /* uuuuuuzu10 */
typedef struct _rcListBA16Type
{
int id; /* w */
RCRECT bounds; /* w4 */
RCLISTATTR attr; /* uuuuuuzu10 */
char *itemsText; /* p */
int numItems; /* w */
/*
* Word currentItem; zw
*/
/*
* Word topItem; zw
*/
int font; /* b */
/*
* UInt8 reserved; zb
*/
/*
* WinHandle popupWin; zl
*/
/*
* ListDrawDataFuncPtr drawItemsCallback; zl
*/
/*
* private, not stored into file
*/
int cbListItems;
char *szIdName;
}
RCListBA16Type;
#define szRCListBA16 "w,w4,uuuuuuzu10,p,w,zw,zw,bzb,zl,zl"
typedef struct _rclistBA32Type
{
int id; /* w */
RCLISTATTR attr; /* uuuuuuzu10 */
RCRECT bounds; /* w4 */
char *itemsText; /* p */
int numItems; /* w */
/*
* Word currentItem; zw
*/
/*
* Word topItem; zw
*/
int font; /* b */
/*
* UInt8 reserved; zb
*/
/*
* WinHandle popupWin; zl
*/
/*
* ListDrawDataFuncPtr drawItemsCallback; zl
*/
/*
* private, not stored into file
*/
int cbListItems;
char *szIdName;
}
RCListBA32Type;
#define szRCListBA32 "w,uuuuuuzu10,w4,p,w,zw,zw,bzb,zl,zl"
typedef union _rcListType
{
RCListBA16Type s16;
RCListBA32Type s32;
}
RCListType;
/*
* ------------------ Field ------------------
*/
typedef struct _rcfieldattr
{
int usable; /* u */
int visible; /* u */
int editable; /* u */
int singleLine; /* u */
int hasFocus; /* u */
int dynamicSize; /* u */
int insPtVisible; /* u */
int dirty; /* u */
int underlined; /* u2 */
int justification; /* u2 */
int autoShift; /* u */
int hasScrollBar; /* u */
int numeric; /* u */
/*
* zu
*/
}
RCFIELDATTR; /* uuuuuuuu u2u2uuuzu */
typedef struct _rcFieldBA16Type
{
int id; /* w */
RCRECT rect; /* w4 */
RCFIELDATTR attr; /* uuuuuuuu u2u2uuuzu */
char *text; /* p */
/*
* VoidHand zl textHandle; block the contains the text string
*/
/*
* LineInfoPtr zl lines;
*/
/*
* Word zw textLen;
*/
/*
* Word zw textBlockSize;
*/
int maxChars; /* w */
/*
* int selFirstPos; zw
*/
/*
* int selLastPos; zw
*/
/*
* int insPtXPos; zw
*/
/*
* int insPtYPos; zw
*/
int fontID; /* b */
/*
* int reserved; zb
*/
char *szIdName;
}
RCFieldBA16Type;
#define szRCFieldBA16 "w,w4,uuuuuuuu,u2u2uuuzu,p,zl,zl,zw,zw,w,zw,zw,zw,zw,b,zb"
typedef struct _rcFieldBA32Type
{
RCRECT rect; /* w4 */
int id; /* w */
RCFIELDATTR attr; /* uuuuuuuu u2u2uuuzu */
char *text; /* p */
/*
* VoidHand zl textHandle; block the contains the text string
*/
/*
* LineInfoPtr zl lines;
*/
/*
* Word zw textLen;
*/
/*
* Word zw textBlockSize;
*/
int maxChars; /* w */
/*
* int selFirstPos; zw
*/
/*
* int selLastPos; zw
*/
/*
* int insPtXPos; zw
*/
/*
* int insPtYPos; zw
*/
int fontID; /* b */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -