1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.jvm
;
13 * This is used to get/set the property of the framebuffer.
17 public interface Framebuffer
20 * Returns the address of the framebuffer.
22 * @squirreljme.syscallreturn The framebuffer address.
24 byte CONTROL_ADDRESS
=
28 * Returns the width of the framebuffer.
30 * @squirreljme.syscallreturn The framebuffer width.
36 * Returns the height of the framebuffer.
38 * @squirreljme.syscallreturn The framebuffer height.
44 * Returns the scanline length.
46 * @squirreljme.syscallreturn The framebuffer scanline length.
48 byte CONTROL_SCANLEN
=
52 * Flush the display because it has been drawn.
58 * Returns the pixel format of the screen.
60 * @squirreljme.syscallreturn The pixel format of the screen.
66 * Returns the scanline length in bytes.
68 * @squirreljme.syscallreturn The scanline length in bytes.
70 byte CONTROL_SCANLEN_BYTES
=
74 * Returns the number of bytes per pixel.
76 * @squirreljme.syscallreturn The bytes per pixel.
78 byte CONTROL_BYTES_PER_PIXEL
=
82 * Returns the number of available pixels.
84 * @squirreljme.syscallreturn The number of pixels.
86 byte CONTROL_NUM_PIXELS
=
92 * @squirreljme.syscallreturn The bits per pixel.
94 byte CONTROL_BITS_PER_PIXEL
=
98 * Get backlight level.
100 * @squirreljme.syscallreturn The current backlight level.
102 byte CONTROL_BACKLIGHT_LEVEL_GET
=
106 * Set backlight level.
108 * @squirreljme.syscallparam 1 The level to set.
110 byte CONTROL_BACKLIGHT_LEVEL_SET
=
114 * Maximum backlight level.
116 * @squirreljme.syscallreturn The maximum backlight level.
118 byte CONTROL_BACKLIGHT_LEVEL_MAX
=
122 * Uploads an integer array of pixel data to the framebuffer.
124 * @squirreljme.syscallparam 1 The address of the array to upload.
127 byte CONTROL_UPLOAD_ARRAY_INT
=
131 * The array which backs the framebuffer, if there is one.
133 * @squirreljme.syscallreturn The backing array object, if there is one.
136 byte CONTROL_BACKING_ARRAY_OBJECT
=
140 * Returns the capabilities of the display.
142 * @squirreljme.syscallreturn The display capabilities.
145 byte CONTROL_GET_CAPABILITIES
=
149 * Query acceleration function.
151 * @squirreljme.syscallparam 1 The graphics function.
152 * @squirreljme.syscallreturn A non-zero value if this is supported.
155 byte CONTROL_ACCEL_FUNC_QUERY
=
159 * Perform acceleration function.
161 * @squirreljme.syscallparam 1 The graphics function.
162 * @squirreljme.syscallparam ... Parameters to the function.
163 * @squirreljme.syscallreturn A value that is according to the invoked
164 * function, if it is supported or possible.
167 byte CONTROL_ACCEL_FUNC_INVOKE
=
171 * Requests that the framebuffer be repainted.
173 * @squirreljme.syscallparam 1 The X coordinate.
174 * @squirreljme.syscallparam 2 The Y coordinate.
175 * @squirreljme.syscallparam 3 The width.
176 * @squirreljme.syscallparam 4 The height.
177 * @squirreljme.syscallreturn Returns {@code 0} if the repaint was not
178 * queued and it must be handled by the code running the application,
181 byte CONTROL_REPAINT_REQUEST
=
185 * Sets the title of the framebuffer if applicable.
187 * @squirreljme.syscallparam 1 Char buffer pointer (high).
188 * @squirreljme.syscallparam 2 Char buffer pointer (low).
191 byte CONTROL_SET_TITLE
=
194 /** The number of framebuffer controls. */
198 /** Screen is RGB 32-bit. */
199 byte FORMAT_INTEGER_RGB888
=
202 /** Screen is 8-bit indexed. */
203 byte FORMAT_BYTE_INDEXED
=
206 /** Screen is 16-bit RGB565. */
207 byte FORMAT_SHORT_RGB565
=
210 /** Screen is packed 1 bit values. */
211 byte FORMAT_PACKED_ONE
=
214 /** Screen is packed 2 bit values. */
215 byte FORMAT_PACKED_TWO
=
218 /** Screen is packed 4 bit values. */
219 byte FORMAT_PACKED_FOUR
=
222 /** Has touch-screen. */
223 byte CAPABILITY_TOUCH
=
227 byte CAPABILITY_KEYBOARD
=
230 /** The JVM pushes to the IPC handler when events happen. */
231 byte CAPABILITY_IPC_EVENTS
=
234 /** Has screen flipping? */
235 byte CAPABILITY_SCREEN_FLIP
=
238 /** Screen has color that is not just a single shade. */
239 byte CAPABILITY_COLOR
=
243 byte ACCEL_FUNC_SET_COLOR
=
247 byte ACCEL_FUNC_DRAW_LINE
=
250 /** Get the X clip. */
251 byte ACCEL_FUNC_GET_CLIP_X
=
254 /** Get the Y clip. */
255 byte ACCEL_FUNC_GET_CLIP_Y
=
258 /** Get the width clip. */
259 byte ACCEL_FUNC_GET_CLIP_WIDTH
=
262 /** Get the height clip. */
263 byte ACCEL_FUNC_GET_CLIP_HEIGHT
=
267 byte ACCEL_FUNC_SET_CLIP
=
270 /** Draw rectangle. */
271 byte ACCEL_FUNC_DRAW_RECT
=
274 /** Get the alpha color. */
275 byte ACCEL_FUNC_GET_ALPHA_COLOR
=
278 /** Set the alpha color. */
279 byte ACCEL_FUNC_SET_ALPHA_COLOR
=
282 /** Fill rectangle. */
283 byte ACCEL_FUNC_FILL_RECT
=
286 /** Sets the fonts for the graphics. */
287 byte ACCEL_FUNC_SET_FONT
=
290 /** Gets the font to use for drawing. */
291 byte ACCEL_FUNC_GET_FONT
=
294 /** Draw sub-characters. */
295 byte ACCEL_FUNC_DRAW_SUB_CHARS
=
299 byte ACCEL_FUNC_DRAW_TEXT
=
302 /** Get stroke style. */
303 byte ACCEL_FUNC_GET_STROKE_STYLE
=
306 /** Set stroke style. */
307 byte ACCEL_FUNC_SET_STROKE_STYLE
=
311 byte ACCEL_FUNC_COPY_AREA
=
315 byte ACCEL_FUNC_DRAW_ARC
=
319 byte ACCEL_FUNC_DRAW_ARGB16
=
322 /** Draw character. */
323 byte ACCEL_FUNC_DRAW_CHAR
=
326 /** Draw characters. */
327 byte ACCEL_FUNC_DRAW_CHARS
=
331 byte ACCEL_FUNC_DRAW_RGB
=
335 byte ACCEL_FUNC_DRAW_RGB16
=
338 /** Draw round rectangle. */
339 byte ACCEL_FUNC_DRAW_ROUND_RECT
=
343 byte ACCEL_FUNC_FILL_ARC
=
346 /** Fill round rectangle. */
347 byte ACCEL_FUNC_FILL_ROUND_RECT
=
350 /** Fill triangle. */
351 byte ACCEL_FUNC_FILL_TRIANGLE
=
354 /** Get blending mode. */
355 byte ACCEL_FUNC_GET_BLENDING_MODE
=
358 /** Get display color. */
359 byte ACCEL_FUNC_GET_DISPLAY_COLOR
=
362 /** Set blending mode. */
363 byte ACCEL_FUNC_SET_BLENDING_MODE
=
367 byte ACCEL_FUNC_DRAW_REGION
=
370 /** Number of acceleration functions. */
371 byte NUM_ACCEL_FUNC
=
374 /** The IPC ID for the graphics callbacks. */