📄 editods.h
字号:
#define CDKEYWORD_FRAME_STANDARD 0x0010
#define CDKEYWORD_FRAME_NONE 0x0020
#define CDKEYWORD_FRAME_MASK 0x0030
#define CDKEYWORD_FRAME_SHIFT 4
#define CDKEYWORD_KEYWORD_RTL 0x0040
#define CDKEYWORD_RO_ACTIVE 0x0080
typedef struct {
WSIG Header; /* Tag and length */
FONTID FontID; /* Font ID */
WORD Keywords; /* number of keywords */
WORD Flags;
/* char OnOff[]; array of '1' or '0' indicating state */
/* char TextValues[]; packed buffer of keyword text, fab->pTextValues format */
} CDKEYWORD;
/* Here is a description of Notes bitmap encoding.
*
* COLOR FORMATS:
*
* Notes displays 3 types of bitmaps: monochrome, color and grey scale.
* All monochome bitmaps are one bit per pixel. Color bitmaps can be either 8 bits per Pel (color
* mapped) or 16 bits per pel "quasi true" color. Grey scale bitmaps
* are simply treated as "color" bitmaps, using the 8 bits per Pel format
* with a color table whose RGB tuples range from [0,0,0] through
* [255,255,255].
*
* GEOMETRY:
*
* All bitmaps are single plane encoding. 8 bit color/grey scale must have
* color tables provided. Monochome bitmaps and 16 bit "quasi true" color
* bitmaps don't need a color table.
*
* RASTER LINE ENCODING:
*
* For those programmers using Notes API, raster lines are encoded using
* a simple run-length encoding format, where each raster line of the
* bitmap is encoded separately (i.e. run length won't exceed length of
* a raster line). Also, each raster line is NOT padded to any particular
* boundary; each scanline ends on the byte boundary which is defined by the
* width of the bitmap. The following section describes how each raster line
* is encoded using a simple run-length encoding scheme.
*
*
* Notes bitmap compression scheme description
* --------------------------------------------
* We have devised a scheme which does a good job compressing
* monochrome, color (both mapped and RGB) and gray scale
* bitmaps, and a secondary encoding to allow "raw" uncompressed
* scanlines for those scanlines which actually "expand" by using
* the run-length scheme (this happens in dithered images).
* In the run length encoding scheme, there an escape codes followed by either
* a run length byte which is then followed by the
* byte(s) to repeat. Note that the byte(s) to repeat may be either
* one or two bytes depending on the color format. For monochrome,
* 8 bit color and 8 bit grey scale, use one byte. For 16 bit color
* the PEL is two bytes long, so the two byte quantity is repeated.
*
* MSB<---------->LSB
* +-----------------------------------+
* (1) | 1 1 c c c c c c | r r r r r r r r |
* +-----------------------------------+
* cccccc = six bit repeat count
* rrrrrrrr = PELS to repeat
*
*
* In the following non-compressed encoding, the escape code is
* followed by a 6 bit repeat count of raw PELs (one or two byte).
*
*
* MSB<---------->LSB
* +------------------------------------------------------
* (2) | 0 0 c c c c c c | r r r r r r r r |[r r r r r r r r]|...
* +------------------------------------------------------
* cccccc = 6 bit repeat count
* r[cccccc] = 1 or more raw uncompressed PELS
*
*/
/* A color table (used in CDBITMAPHEADER) is an array of packed colors.
Each color is stored in 3 bytes (Red,Green,Blue), packed without any
intervening pad bytes. */
#define CT_ENTRY_SIZE 3 /* Always 3 bytes, packed */
#define CT_RED_OFFSET 0
#define CT_GREEN_OFFSET 1
#define CT_BLUE_OFFSET 2
#define CT_REDVALUE(x) (x[CT_RED_OFFSET])
#define CT_GREENVALUE(x) (x[CT_GREEN_OFFSET])
#define CT_BLUEVALUE(x) (x[CT_BLUE_OFFSET])
#define CT_NEXT(x) (x+=CT_ENTRY_SIZE)
#define CT_ENTRY_PTR(x,ElmNum) (&x[CT_ENTRY_SIZE*ElmNum])
/* A pattern table is a fixed-size color table used for patterns by
CDBITMAPHEADER (patterns are used to compress the bitmap).
A entry in the pattern table is 8 (PELS_PER_PATTERN) packed colors
(3 bytes per color as above). */
#define PELS_PER_PATTERN 8
/* Maximum number of patterns we will ever store in a CDBITMAPHEADER. */
#define MAXPATTERNS 64
/* Maximum number of colors in a color table (8 bit mapped color) */
#define MAXCOLORS 256
/* The CDBITMAPHEADER record must be present for all bitmaps. It must
follow the CDGRAPHIC record, but come before any of the other bitmap
CD records. */
typedef struct
{
LSIG Header; /* Signature and Length */
RECTSIZE Dest; /* dest bitmap height and width in PELS */
RECTSIZE Crop; /* crop destination dimensions in PELS (UNUSED) */
WORD Flags; /* CDBITMAP_FLAGS Valid only in CDGRAPHIC_VERSION2 and later */
WORD wReserved; /* Reserved for future use */
DWORD lReserved; /* Reserved for future use */
WORD Width; /* Width of bitmap in PELS */
WORD Height; /* Height " " */
WORD BitsPerPixel; /* Bits per PEL, must be 1,8 or 16 */
WORD SamplesPerPixel; /* For 1 or 8 BPP, set to 1. For 16 BBP, set to 3 */
WORD BitsPerSample; /* For 1 BPP, set to 1. For 8 BPP, set to 8. For 16 BPP, set to 5 */
WORD SegmentCount; /* Number of CDBITMAPSEGMENTS */
WORD ColorCount; /* Number of entries in CDCOLORTABLE. 0-256 */
WORD PatternCount; /* Number of entries in CDPATTERNTABLE. Set to 0 if using Notes API. */
} CDBITMAPHEADER;
/* Bitmap Uses > 16 colors or > 4 grey scale levels */
#define CDBITMAP_FLAG_REQUIRES_PALETTE 1
/* Initialized by import code for "first time" importing of bitmaps
from clipboard or file, to tell Notes that it should compute whether
or not to use a color palette or not. All imports and API programs
should initially set this bit to let the Editor compute whether it
needs the palette or not. */
#define CDBITMAP_FLAG_COMPUTE_PALETTE 2
/* Bitmap Transparency Table (optionally one per bitmap). The colors
in this table specify the bitmap colors that are "transparent". The
pixels in the bitmap whose colors are in this table will not affect
the background; the background will "bleed through" into the bitmap.
The entries in the transparency table should be in the same format
as entries in the color table. If a transparency table is used
for a bitmap, it must immediately follow the CDBITMAPHEADER. */
typedef struct
{
LSIG Header; /* Signature and length */
WORD Reserved; /* Reserved for future use */
WORD TransparentCount; /* Count of entries that follow (0-256) */
/* One or more transparent color table entries */
} CDTRANSPARENTTABLE;
/* Alternate HTML text record (used with graphics and embedded applets) */
/* CDALTTEXT - Text string used for ALT= within <IMG> and <APPLET> HTML tags */
typedef struct {
WSIG Header; /* Tag and length */
WORD wLength; /* text length */
WORD Reserved1; /* Reserved for future use */
DWORD Reserved2; /* Reserved for future use */
/* The 8-bit text string follows... */
} CDALTTEXT;
/* CDHTMLFORMULA - Formula used to compute HTML Attributes and Alternate HTML
within <APPLET> HTML tags. May be used elsewhere in future. */
typedef struct {
WSIG Header; /* Tag and length */
DWORD dwFlags; /* Flags - denote what kind of formula this is */
BYTE cbLevel; /* */
BYTE cbReserved; /* Reserved for future use. */
WORD Reserved; /* Reserved for future use */
/* The formula follows... */
} CDHTMLFORMULA;
/* Flags for use in the dwFlags field of CDFORMULA */
#define CDHTMLFORMULA_FLAG_ATTR 0x00000001 /* formula is HTML attributes */
#define CDHTMLFORMULA_FLAG_ALT 0x00000002 /* formula is alternate HTML */
#define CDHTMLFORMULA_FLAG_ACTION_LABEL 0x00000004 /* formula is an action label formula. */
/* Each of the following CDBITMAP segments contains the compressed raster
data of the bitmap. It is recommended that each segment be no larger
than 10K for optimal use within Notes, but try to keep the segments as
large as possible to increase painting speed. A scanline must not
span a segment. A bitmap must contain at least one segment, but may have
many segments. */
typedef struct
{
LSIG Header; /* Signature and Length */
DWORD Reserved[2]; /* Reserved for future use */
WORD ScanlineCount; /* Number of compressed scanlines in seg */
WORD DataSize; /* Size, in bytes, of compressed data */
/* Comressed raster data for the segment follows right here */
} CDBITMAPSEGMENT;
/* Bitmap Color Table. If the bitmap is 8 bit color or grey scale, you
must have a color table. However, you only need as many entries as
you have colors, i.e. if a 16 color bitmap was converted to 8 bit
form for Notes, the color table would only require 16 entries even
though 8 bit color implies 256 entries. The number of entries must
match that specified in the CDBITMAPHEADER ColorCount. */
typedef struct
{
LSIG Header;
/* One or more color table entries go here */
} CDCOLORTABLE;
/* Bitmap Pattern Table (optionally one per bitmap) */
typedef struct
{
LSIG Header;
/* One or more pattern table entries */
} CDPATTERNTABLE;
/* Crop rectangle used in graphic run */
typedef struct
{
WORD left;
WORD top;
WORD right;
WORD bottom;
}CROPRECT;
/* The Graphic combination record is used to store one or more graphic objects.
This record marks the beginning of a graphic composite item, and MUST
be present for any graphic object to be loaded/displayed. A
graphic composite item can be one or more of the following CD
record types: BITMAPHEADER, BITMAPSEGMENT, COLORTABLE, CGMMETA,
WINMETA,WINMETASEG,PMMETAHEADER,PMMETASEG,MACMETAHEADER,MACMETASEG. If
there is more than one graphic object, Notes will display only one object
using the following order: CGM Metafile, Native Metafile (i.e. Windows,
PM,Mac),Bitmap. */
typedef struct
{
LSIG Header; /* Signature and Length */
RECTSIZE DestSize; /* Destination Display size in twips (1/1440 inch) */
RECTSIZE CropSize; /* Width and Height of crop rect in twips. Currently unused */
CROPRECT CropOffset;/* Crop rectangle offset from bottom left of Dest (in twips).Currently unused */
WORD fResize; /* Set to true if object has been resized by user. */
BYTE Version; /* CDGRAPHIC_VERSION */
BYTE bFlags; /* Ignored before CDGRAPHIC_VERSION3 */
WORD wReserved;
} CDGRAPHIC;
/* Version control of graphic header */
#define CDGRAPHIC_VERSION1 0 /* Created by Notes version 2 */
#define CDGRAPHIC_VERSION2 1 /* Created by Notes version 3 */
#define CDGRAPHIC_VERSION3 2 /* Created by Notes version 4.5 */
/* The following flag indicates that the DestSize field contains
pixel values instead of twips. */
#define CDGRAPHIC_FLAG_DESTSIZE_IS_PIXELS 0x01
#define CDGRAPHIC_FLAG_SPANSLINES 0x02
/* CGM Metafile Record. This record follows the CDGRAPHIC record. It can
contain the entire contents of a CGM metafile, and must be <= 64K Bytes
in length. */
typedef struct
{
LSIG Header; /* Signature and Length */
SWORD mm; /* see above CGM_MAPMODE_??? */
SWORD xExt,yExt; /* Extents of drawing in world coordinates */
RECTSIZE OriginalSize; /* Original display size of metafile in twips */
/* CGM Metafile Bits Follow, must be <= 64K bytes total */
} CDCGMMETA;
#define CGM_MAPMODE_ABSTRACT 0 /* Virtual coordinate system. This is default */
#define CGM_MAPMODE_METRIC 1 /* Currently unsupported */
/* Windows Metafile Record. This record follows the CDGRAPHIC record and
contains the entire contents of a Windows GDI metafile. Since these
metafiles tend to be large, they may be segmented in chunks of any
arbitrary size, as long as each segment is <= 64K bytes. */
typedef struct
{
LSIG Header; /* Signature and Length */
SWORD mm; /* Windows mapping mode */
SWORD xExt,yExt; /* size in mapping mode units */
RECTSIZE OriginalDisplaySize; /* Original display size of metafile in twips */
DWORD MetafileSize; /* Total size of metafile raw data in bytes */
WORD SegCount; /* Number of CDWINMETASEG records */
/* Metafile segments Follow */
} CDWINMETAHEADER;
typedef struct
{
LSIG Header; /* Signature and Length */
WORD DataSize; /* Actual Size of metafile bits in bytes, ignoring any filler */
WORD SegSize; /* Size of segment, is equal to or larger than DataSize
if filler byte added to maintain word boundary */
/* Windows Metafile Bits for this segment. Each segment must be
<= 64K bytes. */
} CDWINMETASEG;
/* PM Metafile Record. This record follows the CDGRAPHIC record and
contains the entire contents of a PM GPI metafile. Since these
metafiles tend to be large, they may be segmented in chunks of any
arbitrary size, as long as each segment is <= 64K bytes. */
typedef struct
{
LSIG Header; /* Signature and Length of this record */
SWORD mm; /* PM mapping mode, i.e. PU_??? */
SWORD xExt,yExt; /* size in mapping mode units */
RECTSIZE OriginalDisplaySize; /* Original display size of metafile in twips */
DWORD MetafileSize; /* Total size of metafile raw data in bytes */
WORD SegCount; /* Number of CDPMMETASEG records */
} CDPMMETAHEADER;
typedef struct
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -