RasterWindow

Implements a subraster using a window. Has the capability of skipping over individual layers.

Constructors

this
this(int x, int y, Color* paletteShared, dstring documentName, MapDocument document)

Creates a new RasterWindow.

Members

Functions

addLayer
void addLayer(int p)

Adds a new layer then reorders the display list.

addPaletteChunk
Color[] addPaletteChunk(Color[] paletteChunk)

Adds a palette chunk to the end of the main palette.

armSelection
void armSelection()

Called when selection needs to be armed.

clearPaletteChunk
Color[] clearPaletteChunk(ushort lenght, ushort offset)

Clears an area of the palette with zeroes. Returns the original area.

close
void close()

Overrides the original onExit function for safe close.

disarmSelection
void disarmSelection()

Called when selection needs to be disarmed.

draw
void draw(bool drawHeaderOnly)
Undocumented in source. Be warned that the author may not have intended to support it.
getPaletteIndex
Color getPaletteIndex(ushort index)

Returns the given palette index.

helperFunc
void helperFunc(void* src, size_t length)

Copies and sets all alpha values to 255 to avoid transparency issues

isSelectionArmed
bool isSelectionArmed()

Returns true if selection is armed

loadLayers
void loadLayers()
Undocumented in source. Be warned that the author may not have intended to support it.
loadPalette
Color[] loadPalette(Color[] palette)

Loads a palette into the object. Returns the new palette of the object.

loadPaletteChunk
Color[] loadPaletteChunk(Color[] paletteChunk, ushort offset)

Loads a palette chunk into the object. The offset determines where the palette should be loaded. If it points to an existing place, the indices after that will be overwritten until the whole palette will be copied. If it points to the end or after it, then the palette will be made longer, and will pad with values #00000000 if needed. Returns the new palette of the object.

moveEn
bool moveEn(bool val)

Enables or disables move

onDocSettings
void onDocSettings(Event ev)

Called when the document settings window is needed to be opened.

onModeToggle
void onModeToggle(Event ev)

Called when any of the modes are selected.

passMCE
void passMCE(MouseEventCommons mec, MouseClickEvent mce)

Passes mouse click event

passMME
void passMME(MouseEventCommons mec, MouseMotionEvent mme)

Passes mouse move event

removeLayer
void removeLayer(int p)

Removes a layer then reorders the display list.

setPaletteIndex
Color setPaletteIndex(ushort index, Color value)

Sets the given palette index to the given value.

updateRaster
void updateRaster()

Updates the raster of the window.

Properties

getOutput
ABitmap getOutput [@property getter]

Overrides the original getOutput function to return a 32 bit bitmap instead.

palette
Color[] palette [@property getter]

Returns the palette of the object.

Static variables

CLOSE_PROTECT
enum CLOSE_PROTECT;
Undocumented in source.
MOVE_ARMED
enum MOVE_ARMED;

Redirect mouse events to document

SELECTION_ARMED
enum SELECTION_ARMED;

Selection is armed, draw box, and redirect event to document

Variables

document
MapDocument document;
Undocumented in source.
documentName
dstring documentName;
Undocumented in source.
layerList
int[] layerList;
Undocumented in source.
modeSel
RadioButtonGroup modeSel;
Undocumented in source.
paletteLocal
Color[] paletteLocal;
Undocumented in source.
paletteShared
Color* paletteShared;
rasterOutput
Bitmap32Bit rasterOutput;
Undocumented in source.
rasterX
int rasterX;
rasterY
int rasterY;
Undocumented in source.
selection
Box selection;
Undocumented in source.
statusFlags
uint statusFlags;
Undocumented in source.
trueOutput
Bitmap32Bit trueOutput;
Undocumented in source.

Inherited Members

From Window

FocusableSet
alias FocusableSet = LinkedList!(Focusable, false, "a is b")
Undocumented in source.
WESet
alias WESet = LinkedList!(WindowElement, false, "a is b")
Undocumented in source.
SBSet
alias SBSet = LinkedList!(ISmallButton, false, "a is b")
Undocumented in source.
CWSet
alias CWSet = LinkedList!(Window, false, "a is b")
Undocumented in source.
focusables
FocusableSet focusables;

All focusable objects belonging to the window

elements
WESet elements;

Stores all window elements here

title
Text title;

Title of the window

lastMouseEventTarget
WindowElement lastMouseEventTarget;

Used for mouse move and wheel events

focusedElement
sizediff_t focusedElement;

The index of the currently focused element, or -1 if none

handler
WindowHandler handler;

The handler of the window

output
BitmapDrawer output;

Graphics output of the window

moveX
int moveX;
Undocumented in source.
moveY
int moveY;

Relative x and y coordinates for drag events

flags
uint flags;

Stores various flags

IS_ACTIVE
enum IS_ACTIVE;
Undocumented in source.
NEEDS_FULL_UPDATE
enum NEEDS_FULL_UPDATE;
Undocumented in source.
HEADER_UPDATE
enum HEADER_UPDATE;
Undocumented in source.
IS_MOVED
enum IS_MOVED;
Undocumented in source.
IS_RESIZED
enum IS_RESIZED;
Undocumented in source.
IS_RESIZED_L
enum IS_RESIZED_L;
Undocumented in source.
IS_RESIZED_T
enum IS_RESIZED_T;
Undocumented in source.
IS_RESIZED_B
enum IS_RESIZED_B;
Undocumented in source.
IS_RESIZED_R
enum IS_RESIZED_R;
Undocumented in source.
IS_RESIZABLE_BY_MOUSE
enum IS_RESIZABLE_BY_MOUSE;
Undocumented in source.
lastMousePos
Point lastMousePos;

Stores the last mouse position.

smallButtons
SBSet smallButtons;

Contains the icons of the extra buttons. Might be replaced with a WindowElement in the future

position
Box position;

Position of the window

customStyle
StyleSheet customStyle;

Custom stylesheet for this window

children
CWSet children;

Stores child windows

parent
Window parent;

Stores reference to the parent

onClose
void delegate() onClose;

Called when the window is closed

onDrawUpdate
void delegate() onDrawUpdate;

Called if not null after every draw update

getPosition
Box getPosition()

Returns the window's position.

setPosition
Box setPosition(Box newPos)

Sets the new position for the window.

getStyleSheet
StyleSheet getStyleSheet()

If the current window doesn't contain a custom StyleSheet, it gets from it's parent.

addElement
void addElement(WindowElement we)

Adds an element to the window.

removeElement
void removeElement(WindowElement we)

Removes the WindowElement if 'we' is found within its ranges, does nothing otherwise.

addHeaderButton
void addHeaderButton(ISmallButton sb)

Adds a smallbutton to the header.

removeHeaderButton
void removeHeaderButton(ISmallButton sb)

Removes a smallbutton from the header.

draw
void draw(bool drawHeaderOnly)

Draws the window. Intended to be used by the WindowHandler.

drawHeader
void drawHeader()

Draws the header.

active
bool active [@property getter]

Returns true if the window is focused

active
bool active [@property setter]

Sets the IS_ACTIVE flag to the given value

isMoved
bool isMoved [@property getter]

Returns whether the window is moved or not

isMoved
bool isMoved [@property setter]

Sets whether the window is moved or not

setTitle
void setTitle(Text s)
void setTitle(dstring s)

Sets the title of the window

getTitle
Text getTitle()

Returns the title of the window

close
void close(Event ev)
void close()

Closes the window by calling the WindowHandler's closeWindow function.

addHandler
void addHandler(WindowHandler wh)

Adds a WindowHandler to the window.

getAbsolutePosition
Coordinate getAbsolutePosition(WindowElement sender)
Undocumented in source. Be warned that the author may not have intended to support it.
move
void move(int x, int y)

Moves the window to the exact location.

relMove
void relMove(int x, int y)

Moves the window by the given values.

resize
void resize(int width, int height)

Sets the size of the window, also issues a redraw.

getOutput
ABitmap getOutput [@property getter]

Returns the outputted bitmap. Can be overridden for 32 bit outputs.

requestFocus
void requestFocus(WindowElement sender)

Gives focus to the windowelement requesting it.

requestCursor
void requestCursor(CursorType type)

Sets the cursor to the given type on request.

addChildWindow
void addChildWindow(Window w)

Adds a child window to the current window.

removeChildWindow
void removeChildWindow(Window w)

Removes a child window from the current window.

getChildWindows
CWSet getChildWindows()

Returns the child windows.

drawLine
void drawLine(Point from, Point to, ubyte color)

Draws a line.

drawLinePattern
void drawLinePattern(Point from, Point to, ubyte[] pattern)

Draws a line pattern.

drawBox
void drawBox(Coordinate target, ubyte color)

Draws an empty rectangle.

drawBoxPattern
void drawBoxPattern(Coordinate target, ubyte[] pattern)

Draws an empty rectangle with line patterns.

drawFilledBox
void drawFilledBox(Coordinate target, ubyte color)

Draws a filled rectangle with a specified color,

bitBLT
void bitBLT(Point target, ABitmap source)

Pastes a bitmap to the given point using blitter, which threats color #0 as transparency.

bitBLT
void bitBLT(Point target, ABitmap source, Coordinate slice)

Pastes a slice of a bitmap to the given point using blitter, which threats color #0 as transparency.

bitBLTPattern
void bitBLTPattern(Coordinate target, ABitmap pattern)

Pastes a repeated bitmap pattern over the specified area.

xorBitBLT
void xorBitBLT(Coordinate target, ABitmap pattern)

XOR blits a repeated bitmap pattern over the specified area.

xorBitBLT
void xorBitBLT(Coordinate target, ubyte color)

XOR blits a color index over a specified area.

fill
void fill(Point target, ubyte color, ubyte background)

Fills an area with the specified color.

drawTextSL
void drawTextSL(Coordinate target, Text text, Point offset)

Draws a single line text within the given prelimiter.

drawTextML
void drawTextML(Coordinate target, Text text, Point offset)

Draws a multi line text within the given prelimiter.

clearArea
void clearArea(Coordinate target)

Clears the area within the target

focusGiven
void focusGiven()

Called when an object receives focus.

focusTaken
void focusTaken()

Called when an object loses focus.

cycleFocus
int cycleFocus(int direction)

Cycles the focus on a single element. Returns -1 if end is reached, or the number of remaining elements that are cycleable in the direction.

passKey
void passKey(uint keyCode, ubyte mod)

Passes key events to the focused element when not in text editing mode.

passMCE
void passMCE(MouseEventCommons mec, MouseClickEvent mce)

Passes mouse click event

passMME
void passMME(MouseEventCommons mec, MouseMotionEvent mme)

Passes mouse move event

passMWE
void passMWE(MouseEventCommons mec, MouseWheelEvent mwe)

Passes mouse scroll event

addPopUpElement
void addPopUpElement(PopUpElement p)

Puts a PopUpElement on the GUI.

addPopUpElement
void addPopUpElement(PopUpElement p, int x, int y)

Puts a PopUpElement on the GUI at the given position.

endPopUpSession
void endPopUpSession(PopUpElement p)

Ends the popup session and closes all popups.

closePopUp
void closePopUp(PopUpElement p)

Closes a single popup element.

closeButton
SmallButton closeButton(StyleSheet ss)

Generates a generic close button

From PaletteContainer

palette
Color[] palette [@property getter]

Returns the palette of the object.

getPaletteIndex
Color getPaletteIndex(ushort index)

Returns the given palette index.

setPaletteIndex
Color setPaletteIndex(ushort index, Color value)

Sets the given palette index to the given value.

addPaletteChunk
Color[] addPaletteChunk(Color[] paletteChunk)

Adds a palette chunk to the end of the main palette.

loadPalette
Color[] loadPalette(Color[] palette)

Loads a palette into the object. Returns the new palette of the object.

loadPaletteChunk
Color[] loadPaletteChunk(Color[] paletteChunk, ushort offset)

Loads a palette chunk into the object. The offset determines where the palette should be loaded. If it points to an existing place, the indices after that will be overwritten until the whole palette will be copied. If it points to the end or after it, then the palette will be made longer, and will pad with values #00000000 if needed. Returns the new palette of the object.

clearPaletteChunk
Color[] clearPaletteChunk(ushort lenght, ushort offset)

Clears an area of the palette with zeroes. Returns the original area.

Meta