Allow for additional memory pool links to where the next pool will be tried if alloca...
[SquirrelJME.git] / modules / cldc-compact / src / main / java / cc / squirreljme / jvm / Framebuffer.java
blob8b6c572b078be4737307c02f6425721992cdcf3a
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.jvm;
12 /**
13 * This is used to get/set the property of the framebuffer.
15 * @since 2019/06/20
17 public interface Framebuffer
19 /**
20 * Returns the address of the framebuffer.
22 * @squirreljme.syscallreturn The framebuffer address.
24 byte CONTROL_ADDRESS =
27 /**
28 * Returns the width of the framebuffer.
30 * @squirreljme.syscallreturn The framebuffer width.
32 byte CONTROL_WIDTH =
35 /**
36 * Returns the height of the framebuffer.
38 * @squirreljme.syscallreturn The framebuffer height.
40 byte CONTROL_HEIGHT =
43 /**
44 * Returns the scanline length.
46 * @squirreljme.syscallreturn The framebuffer scanline length.
48 byte CONTROL_SCANLEN =
51 /**
52 * Flush the display because it has been drawn.
54 byte CONTROL_FLUSH =
57 /**
58 * Returns the pixel format of the screen.
60 * @squirreljme.syscallreturn The pixel format of the screen.
62 byte CONTROL_FORMAT =
65 /**
66 * Returns the scanline length in bytes.
68 * @squirreljme.syscallreturn The scanline length in bytes.
70 byte CONTROL_SCANLEN_BYTES =
73 /**
74 * Returns the number of bytes per pixel.
76 * @squirreljme.syscallreturn The bytes per pixel.
78 byte CONTROL_BYTES_PER_PIXEL =
81 /**
82 * Returns the number of available pixels.
84 * @squirreljme.syscallreturn The number of pixels.
86 byte CONTROL_NUM_PIXELS =
89 /**
90 * Bits per pixel.
92 * @squirreljme.syscallreturn The bits per pixel.
94 byte CONTROL_BITS_PER_PIXEL =
95 10;
97 /**
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.
125 * @since 2019/12/21
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.
134 * @since 2019/12/28
136 byte CONTROL_BACKING_ARRAY_OBJECT =
140 * Returns the capabilities of the display.
142 * @squirreljme.syscallreturn The display capabilities.
143 * @since 2020/01/10
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.
153 * @since 2020/01/10
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.
165 * @since 2020/01/10
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,
179 * @since 2020/01/15
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).
189 * @since 2020/01/15
191 byte CONTROL_SET_TITLE =
194 /** The number of framebuffer controls. */
195 byte NUM_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 =
224 0x01;
226 /** Has keyboard. */
227 byte CAPABILITY_KEYBOARD =
228 0x02;
230 /** The JVM pushes to the IPC handler when events happen. */
231 byte CAPABILITY_IPC_EVENTS =
232 0x04;
234 /** Has screen flipping? */
235 byte CAPABILITY_SCREEN_FLIP =
236 0x08;
238 /** Screen has color that is not just a single shade. */
239 byte CAPABILITY_COLOR =
240 0x10;
242 /** Set color. */
243 byte ACCEL_FUNC_SET_COLOR =
246 /** Draw line. */
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 =
266 /** Set the clip. */
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 =
298 /** Draw text. */
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 =
310 /** Copy area. */
311 byte ACCEL_FUNC_COPY_AREA =
314 /** Draw arc. */
315 byte ACCEL_FUNC_DRAW_ARC =
318 /** Draw ARGB16. */
319 byte ACCEL_FUNC_DRAW_ARGB16 =
322 /** Draw character. */
323 byte ACCEL_FUNC_DRAW_CHAR =
326 /** Draw characters. */
327 byte ACCEL_FUNC_DRAW_CHARS =
330 /** Draw RGB. */
331 byte ACCEL_FUNC_DRAW_RGB =
334 /** Draw RGB16. */
335 byte ACCEL_FUNC_DRAW_RGB16 =
338 /** Draw round rectangle. */
339 byte ACCEL_FUNC_DRAW_ROUND_RECT =
342 /** Fill arc. */
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 =
366 /** Draw region. */
367 byte ACCEL_FUNC_DRAW_REGION =
370 /** Number of acceleration functions. */
371 byte NUM_ACCEL_FUNC =
374 /** The IPC ID for the graphics callbacks. */
375 int IPC_ID =
376 0x47665821;