From 640bc7546d4d8ad5228e09ed2d280ea12b0690e9 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 25 Jun 2011 07:58:03 +1000 Subject: Initial implementation of RGBA images. --- doc/ScintillaDoc.html | 69 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index a156897c7..5f36dbd9f 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -79,7 +79,7 @@

Scintilla Documentation

-

Last edited 18/June/2011 NH

+

Last edited 24/June/2011 NH

There is an overview of the internal design of Scintilla.
@@ -3306,6 +3306,10 @@ struct Sci_TextToFind { markerSymbols)
SCI_MARKERDEFINEPIXMAP(int markerNumber, const char *xpm)
+ SCI_RGBAIMAGESETWIDTH(int width)
+ SCI_RGBAIMAGESETHEIGHT(int height)
+ SCI_MARKERDEFINERGBAIMAGE(int markerNumber, + const char *pixels)
SCI_MARKERSYMBOLDEFINED(int markerNumber)
SCI_MARKERSETFORE(int markerNumber, int @@ -3487,12 +3491,23 @@ struct Sci_TextToFind {

SCI_MARKERDEFINEPIXMAP(int markerNumber, const char *xpm)
Markers can be set to pixmaps with this message. The -
XPM format is used for the pixmap. + XPM format is used for the pixmap. Pixmaps use the SC_MARK_PIXMAP marker symbol.

+

+ SCI_RGBAIMAGESETWIDTH(int width)
+ SCI_RGBAIMAGESETHEIGHT(int height)
+ SCI_MARKERDEFINERGBAIMAGE(int markerNumber, const char *pixels)
+ Markers can be set to translucent pixmaps with this message. The + RGBA format is used for the pixmap. + The width and height must previously been set with the SCI_RGBAIMAGESETWIDTH and + SCI_RGBAIMAGESETHEIGHT messages. + Pixmaps use the SC_MARK_RGBAIMAGE marker symbol.

+

SCI_MARKERSYMBOLDEFINED(int markerNumber)
Returns the symbol defined for a markerNumber with SCI_MARKERDEFINE - or SC_MARK_PIXMAP if defined with SCI_MARKERDEFINEPIXMAP.

+ or SC_MARK_PIXMAP if defined with SCI_MARKERDEFINEPIXMAP + or SC_MARK_RGBAIMAGE if defined with SCI_MARKERDEFINERGBAIMAGE.

SCI_MARKERSETFORE(int markerNumber, int colour)
@@ -3882,7 +3897,8 @@ struct Sci_TextToFind { SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord)
SCI_AUTOCGETDROPRESTOFWORD
- SCI_REGISTERIMAGE
+ SCI_REGISTERIMAGE(int type, const char *xpmData)
+ SCI_REGISTERRGBAIMAGE(int type, const char *pixels)
SCI_CLEARREGISTEREDIMAGES
SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)
SCI_AUTOCGETTYPESEPARATOR
@@ -3995,6 +4011,7 @@ struct Sci_TextToFind {

SCI_REGISTERIMAGE(int type, const char *xpmData)
+ SCI_REGISTERRGBAIMAGE(int type, const char *pixels)
SCI_CLEARREGISTEREDIMAGES
SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)
SCI_AUTOCGETTYPESEPARATOR
@@ -4002,7 +4019,11 @@ struct Sci_TextToFind { Autocompletion list items may display an image as well as text. Each image is first registered with an integer type. Then this integer is included in the text of the list separated by a '?' from the text. For example, "fclose?2 fopen" displays image 2 before the string "fclose" and no image before "fopen". - The images are in XPM format. + The images are in either the XPM format (SCI_REGISTERIMAGE) or + RGBA format (SCI_REGISTERRGBAIMAGE). + For SCI_REGISTERRGBAIMAGE the width and height must previously been set with + the SCI_RGBAIMAGESETWIDTH and + SCI_RGBAIMAGESETHEIGHT messages. The set of registered images can be cleared with SCI_CLEARREGISTEREDIMAGES and the '?' separator changed with SCI_AUTOCSETTYPESEPARATOR.

@@ -6595,8 +6616,40 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next There is no other information in SCNotification.

Images

-

The XPM format is supported for images. - This format is described here. + +

Two formats are supported for images used in margin markers and autocompletion lists, RGBA and XPM.

+ +

RGBA

+ +

The RGBA format allows translucency with an alpha + value for each pixel. It is simpler than + XPM and more capable.

+ +

The data is a sequence of 4 byte pixel values starting with the pixels for the top line, with the + leftmost pixel first, then continuing with the pixels for subsequent lines. There is no gap between + lines for alignment reasons.

+ +

Each pixel consists of, in order, a red byte, a green byte, a blue byte and an alpha byte. + The colour bytes are not premultiplied by the alpha value. That is, a fully red pixel that is + 25% opaque will be [FF, 00, 00, 3F]

+ +

Since the RGBA pixel data does not include any size information the + width and height must previously been set with the + SCI_RGBAIMAGESETWIDTH and + SCI_RGBAIMAGESETHEIGHT messages.

+ +

GUI platforms often include functions for reading image file formats like PNG into memory + in the RGBA form or a similar form. + If there is no suitable platform support, the LodePNG and picoPNG libraries are small libraries + for loading and decoding PNG files available under a BSD-style license.

+ +

RGBA format is supported on Windows, GTK+ and OS X Cocoa. + It is not supported on OS X Carbon.

+ +

XPM

+ +

The XPM format is + described here. Scintilla is only able to handle XPM pixmaps that use one character per pixel with no named colours. There may be a completely transparent colour named "None".

There are two forms of data structure used for XPM images, the first "lines form" format is well suited @@ -6609,6 +6662,8 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next to determine which format: if the bytes start with "/* XPM */" then it is treated as text form, otherwise it is treated as lines form.

+

XPM format is supported on on all platforms.

+

GTK+

On GTK+, the following functions create a Scintilla widget, communicate with it and allow resources to be released after all Scintilla widgets have been destroyed.

-- cgit v1.2.3