Check-in [49b23a5fbf]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Base partial work graphics and framebuffer refactor.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 49b23a5fbf661fc409c4dd9ffa75c2398781e49a
User & Date: stephanie.gawroriski 2020-01-16 00:27:12
Context
2020-01-16
00:34
Implement VirtualFramebuffer capabilities. check-in: d191e29541 user: stephanie.gawroriski tags: trunk
00:27
Base partial work graphics and framebuffer refactor. check-in: 49b23a5fbf user: stephanie.gawroriski tags: trunk
2020-01-13
08:02
Backup developer notes. check-in: c4b2c5b2d3 user: squirreljme tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ratufacoat/sjmecon.h.

748
749
750
751
752
753
754









755
756
757
758
759
760
761
*****************************************************************************/

/** Has touch. */
#define SJME_FB_CAPABILITY_TOUCH SJME_JINT_C(0x01)

/** Has keyboard. */
#define SJME_FB_CAPABILITY_KEYBOARD SJME_JINT_C(0x02)










/*****************************************************************************
*************************** SUPERVISOR PROPERTIES ****************************
*****************************************************************************/

/** The static field register of the task syscall handler. */
#define SJME_SUPERPROP_TASK_SYSCALL_STATIC_FIELD_POINTER SJME_JINT_C(1)







>
>
>
>
>
>
>
>
>







748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
*****************************************************************************/

/** Has touch. */
#define SJME_FB_CAPABILITY_TOUCH SJME_JINT_C(0x01)

/** Has keyboard. */
#define SJME_FB_CAPABILITY_KEYBOARD SJME_JINT_C(0x02)

/** The JVM pushes to the IPC handler when events happen. */
#define SJME_FB_CAPABILITY_IPC_EVENTS SJME_JINT_C(0x04)

/** Screen flipping can be detected. */
#define SJME_FB_CAPABILITY_SCREEN_FLIP SJME_JINT_C(0x08)

/** Screen has colors other than a single shade. */
#define SJME_FB_CAPABILITY_COLOR SJME_JINT_C(0x10)

/*****************************************************************************
*************************** SUPERVISOR PROPERTIES ****************************
*****************************************************************************/

/** The static field register of the task syscall handler. */
#define SJME_SUPERPROP_TASK_SYSCALL_STATIC_FIELD_POINTER SJME_JINT_C(1)

Changes to runt/apis/cldc-compact/cc/squirreljme/jvm/Framebuffer.java.

163
164
165
166
167
168
169














170
171
172

173
174
175
176
177
178
179
...
198
199
200
201
202
203
204












205
206
207
208
209
210
211
	 * @return A value that is according to the invoked function, if it is
	 * supported or possible.
	 * @since 2020/01/10
	 */
	public static final byte CONTROL_ACCEL_FUNC_INVOKE =
		18;
	














	/** The number of framebuffer controls. */
	public static final byte NUM_CONTROLS =
		19;

	
	/** Screen is RGB 32-bit. */
	public static final byte FORMAT_INTEGER_RGB888 =
		0;
	
	/** Screen is 8-bit indexed. */
	public static final byte FORMAT_BYTE_INDEXED =
................................................................................
	/** Has touch-screen. */
	public static final byte CAPABILITY_TOUCH =
		0x01;
	
	/** Has keyboard. */
	public static final byte CAPABILITY_KEYBOARD =
		0x02;












	
	/** Set color. */
	public static final byte ACCEL_FUNC_SET_COLOR =
		0;
	
	/** Draw line. */
	public static final byte ACCEL_FUNC_DRAW_LINE =







>
>
>
>
>
>
>
>
>
>
>
>
>
>


<
>







 







>
>
>
>
>
>
>
>
>
>
>
>







163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193
...
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
	 * @return A value that is according to the invoked function, if it is
	 * supported or possible.
	 * @since 2020/01/10
	 */
	public static final byte CONTROL_ACCEL_FUNC_INVOKE =
		18;
	
	/**
	 * Requests that the framebuffer be repainted.
	 *
	 * @param 1 The X coordinate.
	 * @param 2 The Y coordinate.
	 * @param 3 The width.
	 * @param 4 The height.
	 * @return Returns {@code 0} if the repaint was not queued and it must be
	 * handled by the code running the application, 
	 * @since 2020/01/15
	 */
	public static final byte CONTROL_REPAINT_REQUEST =
		19;
	
	/** The number of framebuffer controls. */
	public static final byte NUM_CONTROLS =

		20;
	
	/** Screen is RGB 32-bit. */
	public static final byte FORMAT_INTEGER_RGB888 =
		0;
	
	/** Screen is 8-bit indexed. */
	public static final byte FORMAT_BYTE_INDEXED =
................................................................................
	/** Has touch-screen. */
	public static final byte CAPABILITY_TOUCH =
		0x01;
	
	/** Has keyboard. */
	public static final byte CAPABILITY_KEYBOARD =
		0x02;
	
	/** The JVM pushes to the IPC handler when events happen. */
	public static final byte CAPABILITY_IPC_EVENTS =
		0x04;
	
	/** Has screen flipping? */
	public static final byte CAPABILITY_SCREEN_FLIP =
		0x08;
	
	/** Screen has color that is not just a single shade. */
	public static final byte CAPABILITY_COLOR =
		0x10;
	
	/** Set color. */
	public static final byte ACCEL_FUNC_SET_COLOR =
		0;
	
	/** Draw line. */
	public static final byte ACCEL_FUNC_DRAW_LINE =

Added runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/fbui/UIDrawerState.java.



















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.fbui;

/**
 * This contains the state of a drawer.
 *
 * @since 2020/01/15
 */
public abstract class UIDrawerState
{
	/**
	 * Returns the content height of this state.
	 *
	 * @return The content height.
	 * @since 2020/01/15
	 */
	public final int contentHeight()
	{
		throw new todo.TODO();
	}
	
	/**
	 * Returns the content width of this state.
	 *
	 * @return The content width.
	 * @since 2020/01/15
	 */
	public final int contentWidth()
	{
		throw new todo.TODO();
	}
}

Added runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/fbui/UIState.java.

























































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.fbui;

import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Framebuffer;
import cc.squirreljme.jvm.IPCCallback;
import cc.squirreljme.jvm.IPCManager;
import cc.squirreljme.jvm.SystemCallIndex;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;

/**
 * This class contains the state of the user interface. It may call the native
 * frame buffer system calls to perform updates or otherwise.
 *
 * @since 2020/01/12
 */
public final class UIState
	implements IPCCallback
{
	/** User interface state. */
	private static UIState _UI_STATE;
	
	/** Get capabilities of the display. */
	protected final int capabilities;
	
	/** The format of the framebuffer. */
	protected final byte format;
	
	/** Is native IPC used for the framebuffer? */
	protected final boolean useipc;
	
	/** Has screen flipping capability. */
	protected final boolean canflip;
	
	/** Is this a color screen? */
	protected final boolean iscolor;
	
	/** The currently bound display. */
	protected Display display;
	
	/** The current drawable state. */
	protected UIDrawerState drawerstate;
	
	/**
	 * Only internally initialized.
	 *
	 * @since 2020/01/12
	 */
	private UIState()
	{
		// Get display format
		this.format = (byte)Assembly.sysCallV(SystemCallIndex.FRAMEBUFFER,
			Framebuffer.CONTROL_FORMAT);
		
		// Get display capabilities
		int capabilities = Assembly.sysCallV(SystemCallIndex.FRAMEBUFFER,
			Framebuffer.CONTROL_GET_CAPABILITIES);
		this.capabilities = capabilities;
		
		// Quick capability setting
		this.useipc =
			((capabilities & Framebuffer.CAPABILITY_IPC_EVENTS) != 0);
		this.canflip = 
			((capabilities & Framebuffer.CAPABILITY_SCREEN_FLIP) != 0);
		this.iscolor =
			((capabilities & Framebuffer.CAPABILITY_COLOR) != 0);
		
		// Register callback for the UI so we get events and such
		// Note that even if we do event handling in this program because the
		// JVM does not have one, we still register for other portions using
		// them
		IPCManager.register(Framebuffer.IPC_ID, this);
	}
	
	/**
	 * Binds this display to the current state.
	 *
	 * @param __d The display to bind.
	 * @throws NullPointerException On null arguments.
	 * @since 2020/01/12
	 */
	public final void bindDisplay(Display __d)
		throws NullPointerException
	{
		if (__d == null)
			throw new NullPointerException("NARG");
		
		this.display = __d;
	}
	
	/**
	 * Returns the capabilities of the framebuffer.
	 *
	 * @return The framebuffer capabilities.
	 * @since 2020/01/15
	 */
	public final int capabilities()
	{
		return this.capabilities;
	}
	
	/**
	 * Is the display currently flipped?
	 *
	 * @return If the display is flipped.
	 * @since 2020/01/15
	 */
	public final boolean displayFlipped()
	{
		// If the display cannot be flipped, this always returns false
		if (!this.canflip)
			return false;
		
		throw new todo.TODO();
	}
	
	/**
	 * Returns the current display height.
	 *
	 * @return The display height.
	 * @since 2020/01/15
	 */
	public final int displayHeight()
	{
		throw new todo.TODO();
	}
	
	/**
	 * Is this a color display?
	 *
	 * @return If this is a color display.
	 * @since 2020/01/15
	 */
	public final boolean displayIsColor()
	{
		return this.iscolor;
	}
	
	/**
	 * Returns the number of unique colors.
	 *
	 * @return The number of unique colors.
	 * @since 2020/01/15
	 */
	public final int displayUniqueColors()
	{
		int format = this.format;
		switch (format)
		{
			case Framebuffer.FORMAT_INTEGER_RGB888:	return 16777216;
			case Framebuffer.FORMAT_BYTE_INDEXED:	return 256;
			case Framebuffer.FORMAT_SHORT_RGB565:	return 66560;
			case Framebuffer.FORMAT_PACKED_ONE:		return 2;
			case Framebuffer.FORMAT_PACKED_TWO:		return 4;
			case Framebuffer.FORMAT_PACKED_FOUR:	return 16;
			
			default:
				throw new todo.OOPS();
		}
	}
	
	/**
	 * Returns the current display width.
	 *
	 * @return The display width.
	 * @since 2020/01/15
	 */
	public final int displayWidth()
	{
		throw new todo.TODO();
	}
	
	/**
	 * Returns the current drawer state.
	 *
	 * @return The current drawer state.
	 * @since 2020/01/15
	 */
	public final UIDrawerState drawerState()
	{
		return this.drawerstate;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/12/28
	 */
	@Override
	public long ipcCall(int __tid, int __ipcid, int __a, int __b,
		int __c, int __d, int __e, int __f, int __g, int __h)
	{
		throw new todo.TODO();
	}
	
	/**
	 * Requests that the display be repainted.
	 *
	 * @since 2020/01/15
	 */
	public final void repaint()
	{
		this.repaint(0, 0, this.displayWidth(), this.displayHeight());
	}
	
	/**
	 * Requests that the display be repainted.
	 *
	 * @param __x The X coordinate.
	 * @param __y The Y coordinate.
	 * @param __w The width.
	 * @param __h The height.
	 * @since 2020/01/15
	 */
	public final void repaint(int __x, int __y, int __w, int __h)
	{
		if (this.useipc)
			Assembly.sysCall(SystemCallIndex.FRAMEBUFFER,
				Framebuffer.CONTROL_REPAINT_REQUEST,
				__x, __y, __w, __h);
		
		// IPC not supported, so we manage our own event queue and such
		else
			throw new todo.TODO();
	}
	
	/**
	 * Sets the displayable to be drawn.
	 *
	 * @param __d The displayable to draw.
	 * @since 2020/01/15
	 */
	public final void setDisplayable(Displayable __d)
	{
		throw new todo.TODO();
	}
	
	/**
	 * Sets the system title.
	 *
	 * @param __s The title to set.
	 * @since 2020/01/15
	 */
	public final void setTitle(String __s)
	{
		throw new todo.TODO();
	}
	
	/**
	 * Returns the instance of the user interface state.
	 *
	 * @return The instance of the user interface state.
	 * @since 2020/01/12
	 */
	public static final UIState getInstance()
	{
		UIState rv = UIState._UI_STATE;
		if (rv != null)
			return rv;
		
		// We may need to create an instance
		synchronized (UIState.class)
		{
			// Try again
			rv = UIState._UI_STATE;
			if (rv != null)
				return rv;
			
			// Initialize new state
			UIState._UI_STATE = (rv = new UIState());
			
			return rv;
		}
	}
}

Added runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/fbui/package-info.java.



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

/**
 * This contains the Framebuffer UI engine.
 *
 * @since 2020/01/12
 */

package cc.squirreljme.runtime.lcdui.fbui;

Changes to runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/phoneui/NativeUIBackend.java.

12
13
14
15
16
17
18

19
20
21
22

23
24
25
26
27
28
29
..
87
88
89
90
91
92
93



94
95
96
97
98
99
100
101
102
103
104
105












106
107
108
109
110
111
112
113
114



115
116
117
118
119
120
121
...
129
130
131
132
133
134
135



136
137
138
139
140
141
142
...
150
151
152
153
154
155
156



157
158
159
160
161
162
163
...
204
205
206
207
208
209
210



211
212
213
214
215
216
217
218
219
220
221



222
223
224
225
226
227
228
...
236
237
238
239
240
241
242



243
244
245
246
247
248
249
250
251
252
253



254
255
256
257
258
259
260
...
297
298
299
300
301
302
303



304
305
306
307
308
309
310
...
318
319
320
321
322
323
324



325
326
327
328
329
330
331
332
333
334
335



336
337
338
339
340
341
342
343
344
345



346
347
348
349
350
351
352
...
353
354
355
356
357
358
359



360
361
362
363
364
365
366
import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Framebuffer;
import cc.squirreljme.jvm.SystemCallIndex;
import cc.squirreljme.jvm.SystemCallError;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayAccess;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayEventCallback;
import cc.squirreljme.runtime.lcdui.event.NonStandardKey;

import cc.squirreljme.runtime.lcdui.gfx.AcceleratedGraphics;
import cc.squirreljme.runtime.lcdui.gfx.EnforcedDrawingAreaGraphics;
import cc.squirreljme.runtime.lcdui.gfx.PixelFormat;
import javax.microedition.lcdui.Canvas;

import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

/**
 * This is a backend which utilizes the SquirrelJME UI interface for all of
 * the related drawing applications.
................................................................................
	{
		if (__ad == null)
			throw new NullPointerException("NARG");
		
		// Set the active display
		this._activedisplay = __ad;
		



		// Register self for event callbacks
		NativeDisplayAccess.registerEventCallback(this);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/17
	 */
	@Override
	public final int capabilities()
	{
		return NativeDisplayAccess.capabilities(this.nid);












	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void command(int __d, int __c)
	{



		// Not our display?
		if (__d != this.nid)
			return;
		
		// No display active?
		ActiveDisplay activedisplay = this._activedisplay;
		if (activedisplay == null)
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void exitRequest(int __d)
	{



		// Not our display?
		if (__d != this.nid)
			return;
		
		// Forward
		this._activedisplay.exitRequest();
	}
................................................................................
	 */
	public final Graphics graphics(boolean[] __a, int[] __dims)
		throws NullPointerException
	{
		if (__dims == null)
			throw new NullPointerException("NARG");
		



		// Read width and height
		int[] params = NativeDisplayAccess.framebufferParameters(nid);
		int width = params[NativeDisplayAccess.PARAMETER_BUFFERWIDTH];
		int height = params[NativeDisplayAccess.PARAMETER_BUFFERHEIGHT];
		
		// Set
		__dims[0] = width;
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final boolean isUpsidedown()
	{



		return NativeDisplayAccess.isUpsideDown(this.nid);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void keyEvent(int __d, int __ty, int __kc, int __ch,
		int __time)
	{



		// Not our display?
		if (__d != this.nid)
			return;
		
		// No display active?
		ActiveDisplay activedisplay = this._activedisplay;
		if (activedisplay == null)
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void lostCallback()
	{



		todo.TODO.note("Implement");
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void paintDisplay(int __d, int __x, int __y,
		int __w, int __h)
	{



		// Not our display?
		if (__d != this.nid)
			return;
		
		// Paint whatever is in the active display
		ActiveDisplay ad = this._activedisplay;
		if (ad != null)
................................................................................
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void pointerEvent(int __d, int __ty, int __x, int __y,
		int __time)
	{



		// Not our display?
		if (__d != this.nid)
			return;
		
		// No display active?
		ActiveDisplay activedisplay = this._activedisplay;
		if (activedisplay == null)
................................................................................
	/**
	 * Repaints the entire display.
	 *
	 * @since 2019/05/18
	 */
	public final void repaint()
	{



		NativeDisplayAccess.displayRepaint(this.nid,
			0, 0, this._width, this._height);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void repaint(int __x, int __y, int __w, int __h)
	{



		NativeDisplayAccess.displayRepaint(this.nid, __x, __y, __w, __h);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void shown(int __d, int __shown)
	{



		// Not our display?
		if (__d != this.nid)
			return;
		
		todo.TODO.note("Implement");
	}
	
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void sizeChanged(int __d, int __w, int __h)
	{



		// Not our display?
		if (__d != this.nid)
			return;
		
		ActiveDisplay ad = this._activedisplay;
		if (ad != null)
		{







>




>







 







>
>
>











|
>
>
>
>
>
>
>
>
>
>
>
>









>
>
>







 







>
>
>







 







>
>
>







 







>
>
>











>
>
>







 







>
>
>











>
>
>







 







>
>
>







 







>
>
>











>
>
>










>
>
>







 







>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
...
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
...
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
...
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
...
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
...
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
...
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Framebuffer;
import cc.squirreljme.jvm.SystemCallIndex;
import cc.squirreljme.jvm.SystemCallError;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayAccess;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayEventCallback;
import cc.squirreljme.runtime.lcdui.event.NonStandardKey;
import cc.squirreljme.runtime.lcdui.ExtendedCapabilities;
import cc.squirreljme.runtime.lcdui.gfx.AcceleratedGraphics;
import cc.squirreljme.runtime.lcdui.gfx.EnforcedDrawingAreaGraphics;
import cc.squirreljme.runtime.lcdui.gfx.PixelFormat;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

/**
 * This is a backend which utilizes the SquirrelJME UI interface for all of
 * the related drawing applications.
................................................................................
	{
		if (__ad == null)
			throw new NullPointerException("NARG");
		
		// Set the active display
		this._activedisplay = __ad;
		
		if (true)
			throw new todo.TODO();
		
		// Register self for event callbacks
		NativeDisplayAccess.registerEventCallback(this);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/17
	 */
	@Override
	public final int capabilities()
	{
		// Get native capabilities
		int fbcaps = Assembly.sysCallV(SystemCallIndex.FRAMEBUFFER,
			Framebuffer.CONTROL_GET_CAPABILITIES);
		
		// Translate to LCDUI capabilities
		int rv = 0;
		if ((fbcaps & Framebuffer.CAPABILITY_TOUCH) != 0)
			rv |= ExtendedCapabilities.SUPPORTS_POINTER_EVENTS |
				Display.SUPPORTS_INPUT_EVENTS;
		if ((fbcaps & Framebuffer.CAPABILITY_KEYBOARD) != 0)
			rv |= Display.SUPPORTS_INPUT_EVENTS;
		
		return rv;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void command(int __d, int __c)
	{
		if (true)
			throw new todo.TODO();
		
		// Not our display?
		if (__d != this.nid)
			return;
		
		// No display active?
		ActiveDisplay activedisplay = this._activedisplay;
		if (activedisplay == null)
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void exitRequest(int __d)
	{
		if (true)
			throw new todo.TODO();
		
		// Not our display?
		if (__d != this.nid)
			return;
		
		// Forward
		this._activedisplay.exitRequest();
	}
................................................................................
	 */
	public final Graphics graphics(boolean[] __a, int[] __dims)
		throws NullPointerException
	{
		if (__dims == null)
			throw new NullPointerException("NARG");
		
		if (true)
			throw new todo.TODO();
		
		// Read width and height
		int[] params = NativeDisplayAccess.framebufferParameters(nid);
		int width = params[NativeDisplayAccess.PARAMETER_BUFFERWIDTH];
		int height = params[NativeDisplayAccess.PARAMETER_BUFFERHEIGHT];
		
		// Set
		__dims[0] = width;
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final boolean isUpsidedown()
	{
		if (true)
			throw new todo.TODO();
		
		return NativeDisplayAccess.isUpsideDown(this.nid);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void keyEvent(int __d, int __ty, int __kc, int __ch,
		int __time)
	{
		if (true)
			throw new todo.TODO();
		
		// Not our display?
		if (__d != this.nid)
			return;
		
		// No display active?
		ActiveDisplay activedisplay = this._activedisplay;
		if (activedisplay == null)
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void lostCallback()
	{
		if (true)
			throw new todo.TODO();
		
		todo.TODO.note("Implement");
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void paintDisplay(int __d, int __x, int __y,
		int __w, int __h)
	{
		if (true)
			throw new todo.TODO();
		
		// Not our display?
		if (__d != this.nid)
			return;
		
		// Paint whatever is in the active display
		ActiveDisplay ad = this._activedisplay;
		if (ad != null)
................................................................................
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void pointerEvent(int __d, int __ty, int __x, int __y,
		int __time)
	{
		if (true)
			throw new todo.TODO();
		
		// Not our display?
		if (__d != this.nid)
			return;
		
		// No display active?
		ActiveDisplay activedisplay = this._activedisplay;
		if (activedisplay == null)
................................................................................
	/**
	 * Repaints the entire display.
	 *
	 * @since 2019/05/18
	 */
	public final void repaint()
	{
		if (true)
			throw new todo.TODO();
			
		NativeDisplayAccess.displayRepaint(this.nid,
			0, 0, this._width, this._height);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void repaint(int __x, int __y, int __w, int __h)
	{
		if (true)
			throw new todo.TODO();
			
		NativeDisplayAccess.displayRepaint(this.nid, __x, __y, __w, __h);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void shown(int __d, int __shown)
	{
		if (true)
			throw new todo.TODO();
			
		// Not our display?
		if (__d != this.nid)
			return;
		
		todo.TODO.note("Implement");
	}
	
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final void sizeChanged(int __d, int __w, int __h)
	{
		if (true)
			throw new todo.TODO();
			
		// Not our display?
		if (__d != this.nid)
			return;
		
		ActiveDisplay ad = this._activedisplay;
		if (ad != null)
		{

Changes to runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/phoneui/PhoneUI.java.

15
16
17
18
19
20
21

22
23
24
25
26
27
28

/**
 * This class contains the definition and holders for the phone based user
 * interface.
 *
 * @since 2019/05/16
 */

public final class PhoneUI
{
	/** The width of the phone screen. */
	public static final int DEFAULT_SCREEN_WIDTH =
		240;
	
	/** The height of the phone screen. */







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

/**
 * This class contains the definition and holders for the phone based user
 * interface.
 *
 * @since 2019/05/16
 */
@Deprecated
public final class PhoneUI
{
	/** The width of the phone screen. */
	public static final int DEFAULT_SCREEN_WIDTH =
		240;
	
	/** The height of the phone screen. */

Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Canvas.java.

11
12
13
14
15
16
17

18
19
20
21
22
23
24
...
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
...
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
...
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
package javax.microedition.lcdui;

import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.event.EventTranslate;
import cc.squirreljme.runtime.lcdui.event.KeyNames;
import cc.squirreljme.runtime.lcdui.event.NonStandardKey;

import cc.squirreljme.runtime.lcdui.gfx.EnforcedDrawingAreaGraphics;
import cc.squirreljme.runtime.lcdui.SerializedEvent;

/**
 * The canvas acts as the base class for primary display interfaces that
 * require more customized draw handling.
 *
................................................................................
	{
		// Do nothing
		if (__w <= 0 || __h <= 0)
			return;
		
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint(__x, __y, __w, __h);
	}
	
	/**
	 * This forces any pending repaint requests to be serviced immedietely,
	 * blocking until paint has been called. If the canvas is not visible on
	 * the display or if there are no pending repaints then this call does
	 * nothing.
................................................................................
		
		// Set new mode
		this._isfullscreen = __f;
		
		// Repaint the display if we have one so that it actually is used
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
	}
	
	/**
	 * Sets the key listener which is used to handle key events.
	 *
	 * If this is set then {@link #keyPressed(int)}, {@link #keyReleased(int)},
	 * and {@link #keyRepeated} will still be called.
................................................................................
	 * @since 2017/02/10
	 */
	@Override
	@SerializedEvent
	protected void sizeChanged(int __w, int __h)
	{
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/02
	 */
	@Deprecated
	@SerializedEvent
	void __doKeyAction(int __type, int __kc, char __ch, int __time)
	{
		// Since we really only care about actions, if we happen to detect
		// that the character is one of these symbols map them to the
		// appropriate key.
		// Keycodes for the same characters might not be mapped to the actual
		// event in the event of natural keyboards.
		if (__ch == '#')
			__kc = KEY_POUND;
		else if (__ch == '*')
			__kc = KEY_STAR;
		
		// Canvases only care about keycodes and not characters, so only
		// do something if the key code is actually valid!
		if (__kc == NonStandardKey.UNKNOWN)
			return;
		
		// Depends on the action
		throw new todo.TODO();
		/*
		switch (__type)
		{
			case NativeDisplayEventCallback.KEY_PRESSED:
				this.keyPressed(__kc);
				break;
			
			case NativeDisplayEventCallback.KEY_REPEATED:
				this.keyRepeated(__kc);
				break;
			
			case NativeDisplayEventCallback.KEY_RELEASED:
				this.keyReleased(__kc);
				break;
			
			default:
				break;
		}*/
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/02
	 */
	@Deprecated
	@SerializedEvent
	void __doPointerAction(int __type, int __x, int __y, int __time)
	{
		throw new todo.TODO();
		/*
		switch (__type)
		{
			case NativeDisplayEventCallback.POINTER_DRAGGED:
				this.pointerDragged(__x, __y);
				break;
			
			case NativeDisplayEventCallback.POINTER_PRESSED:
				this.pointerPressed(__x, __y);
				break;
			
			case NativeDisplayEventCallback.POINTER_RELEASED:
				this.pointerReleased(__x, __y);
				break;
			
			default:
				break;
		}
		*/
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/01
	 */
	@Deprecated
	@SerializedEvent
	void __doShown(boolean __shown)
	{
		throw new todo.TODO();
		/*
		// Needed for isShown()
		super.__doShown(__shown);	
		
		if (__shown)
			this.showNotify();
		else
			this.hideNotify();
		*/
	}
}








>







 







|







 







|







 







|
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
...
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
...
585
586
587
588
589
590
591
592







593
























































































package javax.microedition.lcdui;

import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.event.EventTranslate;
import cc.squirreljme.runtime.lcdui.event.KeyNames;
import cc.squirreljme.runtime.lcdui.event.NonStandardKey;
import cc.squirreljme.runtime.lcdui.fbui.UIState;
import cc.squirreljme.runtime.lcdui.gfx.EnforcedDrawingAreaGraphics;
import cc.squirreljme.runtime.lcdui.SerializedEvent;

/**
 * The canvas acts as the base class for primary display interfaces that
 * require more customized draw handling.
 *
................................................................................
	{
		// Do nothing
		if (__w <= 0 || __h <= 0)
			return;
		
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint(__x, __y, __w, __h);
	}
	
	/**
	 * This forces any pending repaint requests to be serviced immedietely,
	 * blocking until paint has been called. If the canvas is not visible on
	 * the display or if there are no pending repaints then this call does
	 * nothing.
................................................................................
		
		// Set new mode
		this._isfullscreen = __f;
		
		// Repaint the display if we have one so that it actually is used
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
	}
	
	/**
	 * Sets the key listener which is used to handle key events.
	 *
	 * If this is set then {@link #keyPressed(int)}, {@link #keyReleased(int)},
	 * and {@link #keyRepeated} will still be called.
................................................................................
	 * @since 2017/02/10
	 */
	@Override
	@SerializedEvent
	protected void sizeChanged(int __w, int __h)
	{
	}
}
































































































Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Display.java.

18
19
20
21
22
23
24

25
26
27
28
29
30
31
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
...
359
360
361
362
363
364
365





366
367
368
369

370
371
372
373
374
375
376
377
378
379
380
...
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
...
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
...
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
...
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
...
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
...
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
...
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222


1223
1224
1225
1226
1227
1228
1229
1230
1231

1232
1233
1234
1235
1236
1237
1238
....
1273
1274
1275
1276
1277
1278
1279





1280
1281
1282
1283
1284
1285
1286
....
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308

1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324



1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337


1338
1339

1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
....
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
import cc.squirreljme.jvm.SystemCallIndex;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.common.CommonMetrics;
import cc.squirreljme.runtime.lcdui.DisplayOrientation;
import cc.squirreljme.runtime.lcdui.DisplayState;
import cc.squirreljme.runtime.lcdui.event.NonStandardKey;
import cc.squirreljme.runtime.lcdui.ExtendedCapabilities;

import cc.squirreljme.runtime.lcdui.phoneui.NativeUIBackend;
import cc.squirreljme.runtime.lcdui.phoneui.PhoneDisplayBackend;
import cc.squirreljme.runtime.lcdui.phoneui.PhoneUI;
import cc.squirreljme.runtime.lcdui.phoneui.StandardMetrics;
import cc.squirreljme.runtime.lcdui.SerializedEvent;
import java.io.DataInputStream;
import java.io.DataOutputStream;
................................................................................
	public static final int TAB =
		4;
	
	/** The number of down keys to store, for a single hand. */
	private static final int _NUM_DOWNKEYS =
		5;
	
	/** The displays which currently exist based on their index. */
	private static final Map<Integer, Display> _DISPLAYS =
		new HashMap<>();
	
	/** Listeners for the display. */
	private static final List<DisplayListener> _LISTENERS =
		new ArrayList<>();
	
	/** Quick reference to the 0th display without needing a lock. */
	private static volatile Display _DISPLAY_ZERO;
	
	/** The backend for the phone interface. */
	final PhoneDisplayBackend _backend;
	
	/** The phone user interface for this display. */
	final PhoneUI _phoneui;
	
	/** Set of keys which are down already, used to detect repeats on press. */
	@Deprecated
	private final int[] _downkeys =
		new int[_NUM_DOWNKEYS];
	
	/** The displayable to show. */
	private volatile Displayable _current;
	
	/** The displayable to show on exit. */
	private volatile Displayable _exit;
	
	/**
	 * Initializes the display instance.
	 *
	 * @param __b The backend for the display.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/03/16
	 */
	Display(PhoneDisplayBackend __b)
		throws NullPointerException
	{
		if (__b == null)
			throw new NullPointerException("NARG");
		
		this._backend = __b;
		this._phoneui = new PhoneUI(__b);
	}
	
	public void callSerially(Runnable __a)
	{
		// Note that the Runnable.run() will be called as if it were serialized
		// like everything else with @SerializedEvent
		throw new todo.TODO();
................................................................................
	 *
	 * @return A bit field where set bits indicate supported capabilities, if
	 * {@code 0} is returned then only a {@link Canvas} is supported.
	 * @since 2016/10/08
	 */
	public int getCapabilities()
	{





		// Use the capabilities of the native display, but since SquirrelJME
		// manages pretty much everything in a framebuffer every display will
		// always have certain capabilities
		return (this._backend.capabilities() |

			SUPPORTS_COMMANDS | SUPPORTS_FORMS | SUPPORTS_TICKER |
			SUPPORTS_ALERTS | SUPPORTS_LISTS | SUPPORTS_TEXTBOXES |
			SUPPORTS_FILESELECTORS | SUPPORTS_TABBEDPANES |
			SUPPORTS_MENUS);
	}
	
	/**
	 * Returns the color used for the specified interface item.
	 *
	 * The value values are:
	 * {@link #COLOR_BACKGROUND},
................................................................................
	 * Returns the maximum height of the display.
	 *
	 * @return The maximum display height.
	 * @since 2016/10/14
	 */
	public int getHeight()
	{
		return this._phoneui.height;
	}
	
	public IdleItem getIdleItem()
	{
		throw new todo.TODO();
	}
	
................................................................................
	public int getOrientation()
	{
		// Landscape just means a longer width
		boolean landscape = this.getWidth() > this.getHeight();
		
		// If it is detected that the display is upsidedown, just say that
		// it was rotated 180 degrees
		if (this._backend.isUpsidedown())
			if (landscape)
				return ORIENTATION_LANDSCAPE_180;
			else
				return ORIENTATION_PORTRAIT_180;
		else
			if (landscape)
				return ORIENTATION_LANDSCAPE;
................................................................................
	 * Returns the maximum width of the display.
	 *
	 * @retrn The maximum display width.
	 * @since 2016/10/14
	 */
	public int getWidth()
	{
		return this._phoneui.width;
	}
	
	/**
	 * Are mouse/stylus press and release events supported?
	 *
	 * @return {@code true} if they are supported.
	 * @since 2016/10/14
................................................................................
	 * Is color supported by this display?
	 *
	 * @return {@code true} if color is supported.
	 * @since 2016/10/14
	 */
	public boolean isColor()
	{
		return this._backend.pixelFormat().numColors() > 2;
	}
	
	/**
	 * Returns the number of alpha-transparency levels.
	 *
	 * Alpha levels range from fully transparent to fully opaue.
	 *
................................................................................
	 * There will always be at least two levels.
	 *
	 * @return The alpha transparency levels.
	 * @since 2016/10/14
	 */
	public int numAlphaLevels()
	{
		int rv = this._backend.pixelFormat().numAlphaLevels();
		if (rv <= 2)
			return 2;
		return rv;
	}
	
	/**
	 * Returns the number of colors available to the display.
	 *
	 * Monochrome (black and white) displays only have two colors.
	 *
................................................................................
	 * There will always be at least two colors.
	 *
	 * @return The number of available colors.
	 * @since 2016/10/14
	 */
	public int numColors()
	{
		return this._backend.pixelFormat().numColors();
	}
	
	public void removeCurrent()
	{
		throw new todo.TODO();
	}
	
................................................................................
				// the specified element. (The element specifier)}
			default:
				throw new IllegalArgumentException(String.format("EB1o %d",
					__e));
		}
	}
	
	/**
	 * Performs a command event on the target displayable.
	 *
	 * @param __i The command index.
	 * @since 2018/12/02
	 */
	@SerializedEvent
	final void __doCommandAction(int __i)
	{
		throw new todo.TODO();
		/*
		// No current, do nothing
		Displayable current = this._current;
		if (current == null)
			return;
		
		// If there is no command listener then nothing can ever happen
		CommandListener cmdlistener = current._cmdlistener;
		if (cmdlistener == null)
			return;
		
		// Check if the command index is in bounds
		Object[] rawcommands = current._commands.values();
		if (__i < 0 || __i >=  rawcommands.length)
			return;
		
		// Otherwise execute the command
		cmdlistener.commandAction((Command)rawcommands[__i], current);
		*/
	}
	
	/**
	 * {@inheritDoc}
	 * @param __shown Is the display being shown?
	 * @since 2018/03/24
	 */
	@SerializedEvent
	final void __doDisplayShown(boolean __shown)
	{
		throw new todo.TODO();
		/*
		// If this is being shown, load the framebuffer
		if (__shown)
			this._state.framebuffer();
		
		// Internally set the display as shown or not
		this._isshown = __shown;
		
		// Report that visibility has changed
		int state = (__shown ? Display.STATE_VISIBLE :
			Display.STATE_BACKGROUND);
		for (DisplayListener dl : Display.__listeners())
			dl.displayStateChanged(this, state);
		
		// Show the widget
		Displayable current = this._current;
		if (current != null)
			current.__doShown(__shown);
		*/
	}
	
	/**
	 * This is called when the display has changed size.
	 *
	 * @param __w The display width.
	 * @param __h The display height.
	 * @since 2018/03/23
	 */
	@SerializedEvent
	final void __doDisplaySizeChanged(int __w, int __h)
	{
		throw new todo.TODO();
		/*
		// Update the framebuffer because everything relies on it
		UIDisplayState state = this._state;
		state.framebuffer();
		
		// Report that the size changed for events
		for (DisplayListener dl : Display.__listeners())
			dl.sizeChanged(this, __w, __h);
		
		// Tell the current displayable that the size has changed
		Displayable d = this.getCurrent();
		if (d != null)
			d.sizeChanged(__w, __h);
		
		// Update the UI stack
		this.__updateUIStack(this._uipersist, null);
		*/
	}
	
	/**
	 * Requests that exit is performed. If there is a command which tagged
	 * under the exit type, then that will be launched. Otherwise if there is
	 * no command then it will just do a system exit.
	 *
	 * @since 2018/11/18
	 */
	@SerializedEvent
	final void __doExitRequest()
	{
		throw new todo.TODO();
		/*
		// If an exit command is found, run it
		Displayable d = this.getCurrent();
		if (d != null)
		{
			// Only if there is an action to be ran, otherwise ignore
			CommandListener cl = d._cmdlistener;
			if (cl != null)
				for (Command c : d._commands)
					if (c._type == Command.EXIT)
					{
						cl.commandAction(c, d);
						return;
					}
		}
		
		// Otherwise just exit the VM
		System.exit(0);
		*/
	}
	
	/**
	 * Performs a key action.
	 *
	 * @param __kt The event type.
	 * @param __kc Key code.
	 * @param __ch Character code.
	 * @param __time Time code.
	 * @throws IllegalArgumentException If the key type is not valid.
	 * @since 2018/12/02
	 */
	@SerializedEvent
	final void __doKeyAction(int __kt, int __kc, char __ch, int __time)
		throws IllegalArgumentException
	{
		throw new todo.TODO();
		/*
		// If a function key is pressed, just treat it as a command which
		// has been executed
		if (__kc >= NonStandardKey.F1 && __kc <= NonStandardKey.F24)
		{
			if (__kt == NativeDisplayEventCallback.KEY_PRESSED)
				this.__doCommandAction(__kc - NonStandardKey.F1);
			return;
		}
		
		// This is used to detect repeats from press events
		int[] downkeys = this._downkeys;
		
		// Forward to the displayable
		Displayable current = this._current;
		if (current != null)
		{
			// If the key code is not invalid, then detect if duplicate
			// press events should be turned into repeats
			if (__kc != 0)
			{
				// Turn duplicate key press events into repeat events
				if (__kt == NativeDisplayEventCallback.KEY_PRESSED)
				{
					// Check for key repeat
					boolean isrepeat = false;
					int lastslot = -1;
					for (int i = 0; i < _NUM_DOWNKEYS; i++)
						if (downkeys[i] == 0)
							lastslot = i;
						else if (downkeys[i] == __kc)
						{
							isrepeat = true;
							break;
						}
					
					// Change to repeat event
					if (isrepeat)
						__kt = NativeDisplayEventCallback.KEY_REPEATED;
					
					// Store key which is down for later
					else if (lastslot >= 0)
						downkeys[lastslot] = __kc;
				}
				
				// Remove released keys
				else if (__kt == NativeDisplayEventCallback.KEY_RELEASED)
				{
					// Remove from the down key set
					for (int i = 0; i < _NUM_DOWNKEYS; i++)
						if (__kc == downkeys[i])
						{
							downkeys[i] = 0;
							break;
						}
				}
			}
			
			// Forward
			current.__doKeyAction(__kt, __kc, __ch, __time);
		}
		*/
	}
	
	/**
	 * Performs a mouse pointer action.
	 *
	 * @param __t The event type.
	 * @param __x X coordinate.
	 * @param __y Y coordinate.
	 * @param __time Timecode.
	 * @throws IllegalArgumentException If the event is not valid.
	 * @since 2018/12/02
	 */
	@SerializedEvent
	final void __doPointerAction(int __t, int __x, int __y, int __time)
		throws IllegalArgumentException
	{
		throw new todo.TODO();
		/*
		// Forward to the displayable
		Displayable current = this._current;
		if (current != null)
			current.__doPointerAction(__t, __x, __y, __time);
		*/
	}
	
	/**
	 * Performs a repaint of the frame.
	 *
	 * @param __x X clip.
	 * @param __y Y clip.
	 * @param __w Width clip.
	 * @param __h Height clip.
	 * @since 2018/11/18
	 */
	@SerializedEvent
	final void __doRepaint(int __x, int __y, int __w, int __h)
	{
		throw new todo.TODO();
		/*
		// Reclaulcate the draw stack?
		UIPersist uipersist = this._uipersist;
		if (uipersist.recalc)
		{
			// Do not recalculate again
			uipersist.recalc = false;
			
			// Update the UI stack
			this.__updateUIStack(uipersist, null);
		}
		
		// A repaint is happening now so always clear it
		uipersist.repaint = false;
		
		// Get graphics for this state
		Graphics g = this._state.graphics();
		
		// Set the initial clipping region
		g.clipRect(__x, __y, __w, __h);
		
		// Call internal paint, which draws our stack
		try
		{
			// Clear the old focal item, it gets set on a redraw
			uipersist.focalstack = null;
			
			// Render the draw stack
			UIStack stack = this._uistack;
			if (stack != null)
				stack.render(uipersist, null, g);
			
			// Draw the focal item if there is one
			UIStack focalstack = uipersist.focalstack;
			if (focalstack != null)
			{
				int sx = focalstack.xoffset,
					sy = focalstack.yoffset,
					sw = focalstack.drawwidth - 2,
					sh = focalstack.drawheight - 1;
				
				// Draw back line first
				g.setAlphaColor(CommonColors.FOCUSED_COLOR_TWO);
				g.setStrokeStyle(Graphics.SOLID);
				g.drawRect(sx, sy, sw, sh);
				
				// Then opposite color line1
				g.setAlphaColor(CommonColors.FOCUSED_COLOR);
				g.setStrokeStyle(Graphics.DOTTED);
				g.drawRect(sx, sy, sw, sh);
			}
		}
		
		// Catch all of these, but keep drawing!
		catch (Throwable t)
		{
			t.printStackTrace();
		}
		*/
	}
	
	/**
	 * Do current show logic.
	 *
	 * @param __show The displayable to show.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
	 */
	final void __doShowCurrent(Displayable __show)
		throws NullPointerException
	{


		// Always set as shown, easier to work with
		__show._isshown = true;
		
		// Set title of our display to the title of the Displayable
		PhoneUI phoneui = this._phoneui;
		phoneui.setTitle(__show._dtitle);
		
		// Set current drawn displayable
		phoneui.setCurrent(__show);

		
		// Callback when it is made visible
		__show.showNotify();
	}
	
	/**
	 * Adds the specified listener for changes to displays.
................................................................................
	 */
	public static Display getDisplay(MIDlet __m)
		throws NullPointerException
	{
		// Check
		if (__m == null)
			throw new NullPointerException("NARG");





		
		// Use the first display that is available.
		// In the runtime, each program only ever gets a single MIDlet and
		// creating new MIDlets is illegal. Thus since getDisplays() has zero
		// be the return value for this method, that is used here.
		Display[] disp = getDisplays(0);
		if (disp.length > 0)
................................................................................
	 * include all of the {@code SUPPORT_} prefixed constans. If {@code 0} is
	 * specified then capabilities are not checked.
	 * @return An array containing the displays with these capabilities.
	 * @since 2016/10/08
	 */
	public static Display[] getDisplays(int __caps)
	{
		// Initially filled with all displays, this will be filtered
		// accordingly
		List<Display> rv = new ArrayList<>();

		
		// Map all display IDs to actual displays
		Map<Integer, Display> displays = Display._DISPLAYS;
		synchronized (displays)
		{
			// Try to obtain the address of the framebuffer
			int fbaddr = Assembly.sysCallV(SystemCallIndex.FRAMEBUFFER,
				Framebuffer.CONTROL_ADDRESS);
			int fbaobj = Assembly.sysCallV(SystemCallIndex.FRAMEBUFFER,
				Framebuffer.CONTROL_BACKING_ARRAY_OBJECT);
			
			// There is only a single display if a framebuffer is supported
			// It could be mapped to an object or otherwise raw memory
			int numdisplays = (fbaddr != 0 || fbaobj != 0 ? 1 : 0);
			for (int i = 0; i < numdisplays; i++)
				rv.add(Display.__mapDisplay(i));



		}
		
		// We only need to filter out displays if we specified capabilities
		// we need
		if (__caps != 0)
		{
			// Filter out all the displays so that only the displays which mat
			for (Iterator<Display> it = rv.iterator(); it.hasNext();)
			{
				Display d = it.next();
				
				// Remove any displays which specifically are lacking the ones
				// we want


				if ((d.getCapabilities() & __caps) != __caps)
					it.remove();

			}
			
			// {@squirreljme.error EB1q No displays are available.}
			if (rv.size() <= 0)
				throw new IllegalStateException("EB1q");
		}
		
		return rv.<Display>toArray(new Display[rv.size()]);
	}
	
	/**
	 * Removes the specified display listener so that it is no longer called
	 * when events occur.
	 *
	 * @param __dl The listener to remove.
................................................................................
		List<DisplayListener> listeners = Display._LISTENERS;
		synchronized (listeners)
		{
			return listeners.<DisplayListener>toArray(new DisplayListener[
				listeners.size()]);
		}
	}
	
	/**
	 * Maps the specified display index to a display and creates an object
	 * which represents and provides access to the display.
	 *
	 * @param __did The display index.
	 * @return The display for the given index.
	 * @since 2018/03/16
	 */
	static Display __mapDisplay(int __did)
	{
		// If we are requesting the 0th display, since it is requested so often
		// allow getting it without needing to lock and load from the map
		// This in general should improve performance nicely
		if (__did == 0)
		{
			Display rv = _DISPLAY_ZERO;
			if (rv != null)
				return rv;
		}
		
		// Lock since multiple threads could be messing with the displays
		Map<Integer, Display> displays = Display._DISPLAYS;
		synchronized (displays)
		{
			Integer k = Integer.valueOf(__did);
			Display rv = displays.get(k);
			
			// Create mapping for this display?
			if (rv == null)
			{
				// Store it
				displays.put(k, (rv = new Display(
					new NativeUIBackend(__did))));
				
				// Cache display zero?
				if (__did == 0)
				{
					_DISPLAY_ZERO = rv;
				
					// Register callback handler for IPC events
					IPCManager.register(Framebuffer.IPC_ID,
						__GfxIPCDispatch__.__instance());
				}
			}
			
			return rv;
		}
	}
}








>







 







<
<
<
<




|
|
<
<
<
<
<
<
<
<
<
<
<










<
<


|
<

<
<
<
<
<







 







>
>
>
>
>



|
>



|







 







|







 







|







 







|







 







|







 







|
|
|
<







 







|







 








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








|
>
>




<
|

|
<
>







 







>
>
>
>
>







 







|
|
|
>
|
<
|
|
|
|
<
<
<
<
|
<
<
<
<
<
>
>
>
|
|
<
<
<
|
<
<
<
<
<
<
<
>
>
|
<
>
|
<
|
<
|
<
<
<







 







|
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
201
202
203
204
205
206
207




208
209
210
211
212
213











214
215
216
217
218
219
220
221
222
223


224
225
226

227





228
229
230
231
232
233
234
...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
...
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
...
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
...
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
...
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
...
600
601
602
603
604
605
606
607
608
609

610
611
612
613
614
615
616
...
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
...
890
891
892
893
894
895
896
897











































































































































































































































































































898
899
900
901
902
903
904
905
906
907
908
909
910
911
912

913
914
915

916
917
918
919
920
921
922
923
...
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
...
989
990
991
992
993
994
995
996
997
998
999
1000

1001
1002
1003
1004




1005





1006
1007
1008
1009
1010



1011







1012
1013
1014

1015
1016

1017

1018



1019
1020
1021
1022
1023
1024
1025
....
1062
1063
1064
1065
1066
1067
1068
1069



1070














































import cc.squirreljme.jvm.SystemCallIndex;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.common.CommonMetrics;
import cc.squirreljme.runtime.lcdui.DisplayOrientation;
import cc.squirreljme.runtime.lcdui.DisplayState;
import cc.squirreljme.runtime.lcdui.event.NonStandardKey;
import cc.squirreljme.runtime.lcdui.ExtendedCapabilities;
import cc.squirreljme.runtime.lcdui.fbui.UIState;
import cc.squirreljme.runtime.lcdui.phoneui.NativeUIBackend;
import cc.squirreljme.runtime.lcdui.phoneui.PhoneDisplayBackend;
import cc.squirreljme.runtime.lcdui.phoneui.PhoneUI;
import cc.squirreljme.runtime.lcdui.phoneui.StandardMetrics;
import cc.squirreljme.runtime.lcdui.SerializedEvent;
import java.io.DataInputStream;
import java.io.DataOutputStream;
................................................................................
	public static final int TAB =
		4;
	
	/** The number of down keys to store, for a single hand. */
	private static final int _NUM_DOWNKEYS =
		5;
	




	/** Listeners for the display. */
	private static final List<DisplayListener> _LISTENERS =
		new ArrayList<>();
	
	/** The current display which was created. */
	private static Display _DISPLAY;











	
	/** The displayable to show. */
	private volatile Displayable _current;
	
	/** The displayable to show on exit. */
	private volatile Displayable _exit;
	
	/**
	 * Initializes the display instance.
	 *


	 * @since 2018/03/16
	 */
	Display()

	{





	}
	
	public void callSerially(Runnable __a)
	{
		// Note that the Runnable.run() will be called as if it were serialized
		// like everything else with @SerializedEvent
		throw new todo.TODO();
................................................................................
	 *
	 * @return A bit field where set bits indicate supported capabilities, if
	 * {@code 0} is returned then only a {@link Canvas} is supported.
	 * @since 2016/10/08
	 */
	public int getCapabilities()
	{
		int caps = UIState.getInstance().capabilities();
		boolean hastouch = ((caps & Framebuffer.CAPABILITY_TOUCH) != 0);
		boolean hasinput = hastouch |
			((caps & Framebuffer.CAPABILITY_KEYBOARD) != 0);
		
		// Use the capabilities of the native display, but since SquirrelJME
		// manages pretty much everything in a framebuffer every display will
		// always have certain capabilities
		return (hasinput ? SUPPORTS_INPUT_EVENTS : 0) |
			(hastouch ? ExtendedCapabilities.SUPPORTS_POINTER_EVENTS : 0) |
			SUPPORTS_COMMANDS | SUPPORTS_FORMS | SUPPORTS_TICKER |
			SUPPORTS_ALERTS | SUPPORTS_LISTS | SUPPORTS_TEXTBOXES |
			SUPPORTS_FILESELECTORS | SUPPORTS_TABBEDPANES |
			SUPPORTS_MENUS;
	}
	
	/**
	 * Returns the color used for the specified interface item.
	 *
	 * The value values are:
	 * {@link #COLOR_BACKGROUND},
................................................................................
	 * Returns the maximum height of the display.
	 *
	 * @return The maximum display height.
	 * @since 2016/10/14
	 */
	public int getHeight()
	{
		return UIState.getInstance().displayHeight();
	}
	
	public IdleItem getIdleItem()
	{
		throw new todo.TODO();
	}
	
................................................................................
	public int getOrientation()
	{
		// Landscape just means a longer width
		boolean landscape = this.getWidth() > this.getHeight();
		
		// If it is detected that the display is upsidedown, just say that
		// it was rotated 180 degrees
		if (UIState.getInstance().displayFlipped())
			if (landscape)
				return ORIENTATION_LANDSCAPE_180;
			else
				return ORIENTATION_PORTRAIT_180;
		else
			if (landscape)
				return ORIENTATION_LANDSCAPE;
................................................................................
	 * Returns the maximum width of the display.
	 *
	 * @retrn The maximum display width.
	 * @since 2016/10/14
	 */
	public int getWidth()
	{
		return UIState.getInstance().displayWidth();
	}
	
	/**
	 * Are mouse/stylus press and release events supported?
	 *
	 * @return {@code true} if they are supported.
	 * @since 2016/10/14
................................................................................
	 * Is color supported by this display?
	 *
	 * @return {@code true} if color is supported.
	 * @since 2016/10/14
	 */
	public boolean isColor()
	{
		return UIState.getInstance().displayIsColor();
	}
	
	/**
	 * Returns the number of alpha-transparency levels.
	 *
	 * Alpha levels range from fully transparent to fully opaue.
	 *
................................................................................
	 * There will always be at least two levels.
	 *
	 * @return The alpha transparency levels.
	 * @since 2016/10/14
	 */
	public int numAlphaLevels()
	{
		// Always return 2 because SquirrelJME operates on a flat framebuffer
		// where there is no such thing as transparency
		return 2;

	}
	
	/**
	 * Returns the number of colors available to the display.
	 *
	 * Monochrome (black and white) displays only have two colors.
	 *
................................................................................
	 * There will always be at least two colors.
	 *
	 * @return The number of available colors.
	 * @since 2016/10/14
	 */
	public int numColors()
	{
		return UIState.getInstance().displayUniqueColors();
	}
	
	public void removeCurrent()
	{
		throw new todo.TODO();
	}
	
................................................................................
				// the specified element. (The element specifier)}
			default:
				throw new IllegalArgumentException(String.format("EB1o %d",
					__e));
		}
	}
	
	/**











































































































































































































































































































	 * Do current show logic.
	 *
	 * @param __show The displayable to show.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
	 */
	final void __doShowCurrent(Displayable __show)
		throws NullPointerException
	{	
		UIState uis = UIState.getInstance();
		
		// Always set as shown, easier to work with
		__show._isshown = true;
		
		// Set title of our display to the title of the Displayable

		uis.setTitle(__show._dtitle);
		
		// Set drawn displayable

		uis.setDisplayable(__show);
		
		// Callback when it is made visible
		__show.showNotify();
	}
	
	/**
	 * Adds the specified listener for changes to displays.
................................................................................
	 */
	public static Display getDisplay(MIDlet __m)
		throws NullPointerException
	{
		// Check
		if (__m == null)
			throw new NullPointerException("NARG");
		
		// First display already made?
		Display d = Display._DISPLAY;
		if (d != null)
			return d;
		
		// Use the first display that is available.
		// In the runtime, each program only ever gets a single MIDlet and
		// creating new MIDlets is illegal. Thus since getDisplays() has zero
		// be the return value for this method, that is used here.
		Display[] disp = getDisplays(0);
		if (disp.length > 0)
................................................................................
	 * include all of the {@code SUPPORT_} prefixed constans. If {@code 0} is
	 * specified then capabilities are not checked.
	 * @return An array containing the displays with these capabilities.
	 * @since 2016/10/08
	 */
	public static Display[] getDisplays(int __caps)
	{
		// Create initial display?
		Display d = Display._DISPLAY;
		if (d == null)
			synchronized (Display.class)
			{

				d = Display._DISPLAY;
				if (d == null)
				{
					Display._DISPLAY = (d = new Display());




					





					// Just signify that the display was added here
					for (DisplayListener dl : Display.__listeners())
						dl.displayAdded(d);
				}
			}



		







		// Either the capabilities match or we do not care what the display
		// supports
		if (__caps == 0 || ((d.getCapabilities() & __caps) == __caps))

			return new Display[]{d};
		

		// {@squirreljme.error EB1q No displays are available.}

		throw new IllegalStateException("EB1q");



	}
	
	/**
	 * Removes the specified display listener so that it is no longer called
	 * when events occur.
	 *
	 * @param __dl The listener to remove.
................................................................................
		List<DisplayListener> listeners = Display._LISTENERS;
		synchronized (listeners)
		{
			return listeners.<DisplayListener>toArray(new DisplayListener[
				listeners.size()]);
		}
	}
}


















































Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Displayable.java.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
...
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
...
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
...
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
...
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;


import cc.squirreljme.runtime.lcdui.phoneui.ExposedDisplayable;
import cc.squirreljme.runtime.lcdui.SerializedEvent;
import cc.squirreljme.runtime.midlet.ActiveMidlet;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
................................................................................
		
		// Add the command
		this._actions.addUniqueObjRef(__c);
		
		// Repaint display?
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
	}
	
	public Command getCommand(int __p)
	{
		throw new todo.TODO();
	}
	
................................................................................
		
		// Remove the command
		this._actions.remove(__c);
		
		// Repaint display?
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
	}
	
	public void removeCommandOrMenu(int __p)
	{
		throw new todo.TODO();
	}
	
................................................................................
			
			// Set
			this._ticker = __t;
			
			// Update display
			Display d = this._display;
			if (d != null)
				d._phoneui.repaint();
		}
	}
	
	/**
	 * Sets the title of this displayable.
	 *
	 * @param __t The title to use, {@code null} clears it.
................................................................................
		
		// Store this
		this._dtitle = __t;
		
		// Set the title of the display
		Display d = this._display;
		if (d != null)
			d._phoneui.setTitle(__t);
	}
	
	/**
	 * This is called when the canvas has been shown.
	 *
	 * @since 2018/05/18
	 */
................................................................................
			throw new NullPointerException("NARG");
		
		// Use dimension from default display
		Display display = __d._display;
		if (display == null)
			return Display.getDisplays(0)[0].getHeight();
		
		// Use content area size
		if (__full)
			return display._phoneui.height;
		return display._phoneui.contentHeight();
	}
	
	/**
	 * Returns the displayable width.
	 *
	 * @param __d The displayable.
	 * @param __full Return the full screen?
................................................................................
			throw new NullPointerException("NARG");
			
		// Use dimension from default display
		Display display = __d._display;
		if (display == null)
			return Display.getDisplays(0)[0].getWidth();
		
		// Use content area size
		if (__full)
			return display._phoneui.width;
		return display._phoneui.contentWidth();
	}
}









>







 







|







 







|







 







|







 







|







 







|
|
<
<







 







|
|
<
<




6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
...
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
...
407
408
409
410
411
412
413
414
415


416
417
418
419
420
421
422
...
430
431
432
433
434
435
436
437
438


439
440
441
442
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;

import cc.squirreljme.runtime.lcdui.fbui.UIState;
import cc.squirreljme.runtime.lcdui.phoneui.ExposedDisplayable;
import cc.squirreljme.runtime.lcdui.SerializedEvent;
import cc.squirreljme.runtime.midlet.ActiveMidlet;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
................................................................................
		
		// Add the command
		this._actions.addUniqueObjRef(__c);
		
		// Repaint display?
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
	}
	
	public Command getCommand(int __p)
	{
		throw new todo.TODO();
	}
	
................................................................................
		
		// Remove the command
		this._actions.remove(__c);
		
		// Repaint display?
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
	}
	
	public void removeCommandOrMenu(int __p)
	{
		throw new todo.TODO();
	}
	
................................................................................
			
			// Set
			this._ticker = __t;
			
			// Update display
			Display d = this._display;
			if (d != null)
				UIState.getInstance().repaint();
		}
	}
	
	/**
	 * Sets the title of this displayable.
	 *
	 * @param __t The title to use, {@code null} clears it.
................................................................................
		
		// Store this
		this._dtitle = __t;
		
		// Set the title of the display
		Display d = this._display;
		if (d != null)
			UIState.getInstance().setTitle(__t);
	}
	
	/**
	 * This is called when the canvas has been shown.
	 *
	 * @since 2018/05/18
	 */
................................................................................
			throw new NullPointerException("NARG");
		
		// Use dimension from default display
		Display display = __d._display;
		if (display == null)
			return Display.getDisplays(0)[0].getHeight();
		
		// Use drawer width
		return UIState.getInstance().drawerState().contentHeight();


	}
	
	/**
	 * Returns the displayable width.
	 *
	 * @param __d The displayable.
	 * @param __full Return the full screen?
................................................................................
			throw new NullPointerException("NARG");
			
		// Use dimension from default display
		Display display = __d._display;
		if (display == null)
			return Display.getDisplays(0)[0].getWidth();
		
		// Use drawer width
		return UIState.getInstance().drawerState().contentWidth();


	}
}


Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Form.java.

6
7
8
9
10
11
12


13
14
15
16
17
18
19
..
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;



public class Form
	extends Screen
{
	/** Items on the form. */
	final __VolatileList__<Item> _items =
		new __VolatileList__<>();
	
................................................................................
	 */
	public Form(String __t, Item[] __i)
		throws IllegalStateException, NullPointerException
	{
		// Forms just use the titles the same as Displayables
		try
		{
			setTitle(__t);
		}
		
		// Ignore this if it occurs so that constructing the form does not
		// end in failure
		catch (DisplayCapabilityException e)
		{
		}
................................................................................
		// Append item
		__VolatileList__<Item> items = this._items;
		int rv = items.append(__i);
		
		// Update display
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
		
		return rv;
	}
	
	public void delete(int __a)
	{
		throw new todo.TODO();







>
>







 







|







 







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;

import cc.squirreljme.runtime.lcdui.fbui.UIState;

public class Form
	extends Screen
{
	/** Items on the form. */
	final __VolatileList__<Item> _items =
		new __VolatileList__<>();
	
................................................................................
	 */
	public Form(String __t, Item[] __i)
		throws IllegalStateException, NullPointerException
	{
		// Forms just use the titles the same as Displayables
		try
		{
			this.setTitle(__t);
		}
		
		// Ignore this if it occurs so that constructing the form does not
		// end in failure
		catch (DisplayCapabilityException e)
		{
		}
................................................................................
		// Append item
		__VolatileList__<Item> items = this._items;
		int rv = items.append(__i);
		
		// Update display
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
		
		return rv;
	}
	
	public void delete(int __a)
	{
		throw new todo.TODO();

Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Item.java.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
...
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;


import cc.squirreljme.runtime.lcdui.SerializedEvent;

public abstract class Item
{
	public static final int BUTTON =
		2;
	
................................................................................
		
		// Repaint the display
		Displayable displayable = this._displayable;
		if (displayable != null)
		{
			Display display = displayable._display;
			if (display != null)
				display._phoneui.repaint();
		}
	}
	
	/**
	 * Sets the layout.
	 *
	 * @param __lay The layout.







>







 







|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;

import cc.squirreljme.runtime.lcdui.fbui.UIState;
import cc.squirreljme.runtime.lcdui.SerializedEvent;

public abstract class Item
{
	public static final int BUTTON =
		2;
	
................................................................................
		
		// Repaint the display
		Displayable displayable = this._displayable;
		if (displayable != null)
		{
			Display display = displayable._display;
			if (display != null)
				UIState.getInstance().repaint();
		}
	}
	
	/**
	 * Sets the layout.
	 *
	 * @param __lay The layout.

Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/List.java.

10
11
12
13
14
15
16

17
18
19
20
21
22
23
...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
...
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
...
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
...
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386

package javax.microedition.lcdui;

import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayEventCallback;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.common.CommonMetrics;

import cc.squirreljme.runtime.lcdui.SerializedEvent;

public class List
	extends Screen
	implements Choice
{
	/** The default select command used for lists. */
................................................................................
		if (items.size() == 1 && (ltype == Choice.EXCLUSIVE ||
			ltype == Choice.IMPLICIT))
			e._selected = true;
		
		// Update display
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
		
		return rv;
	}
	
	public void delete(int __a)
	{
		throw new todo.TODO();
................................................................................
		throws IndexOutOfBoundsException
	{
		this._items.get(__i)._disabled = !__e;
		
		// Update display
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
	}
	
	public void setFitPolicy(int __a)
	{
		throw new todo.TODO();
	}
	
................................................................................
		throws IndexOutOfBoundsException
	{
		this._items.get(__i)._font = __f;
		
		// Update display
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
	}
	
	public void setSelectCommand(Command __a)
	{
		throw new todo.TODO();
	}
	
................................................................................
			for (int i = 0; i < n; i++)
				this._items.get(i)._selected = (__i == i);
		}
		
		// Update display
		Display d = this._display;
		if (d != null)
			d._phoneui.repaint();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/10
	 */
	@Override
	public int size()
	{
		return this._items.size();
	}
}








>







 







|







 







|







 







|







 







|













10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
...
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
...
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
...
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387

package javax.microedition.lcdui;

import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayEventCallback;
import cc.squirreljme.runtime.lcdui.common.CommonColors;
import cc.squirreljme.runtime.lcdui.common.CommonMetrics;
import cc.squirreljme.runtime.lcdui.fbui.UIState;
import cc.squirreljme.runtime.lcdui.SerializedEvent;

public class List
	extends Screen
	implements Choice
{
	/** The default select command used for lists. */
................................................................................
		if (items.size() == 1 && (ltype == Choice.EXCLUSIVE ||
			ltype == Choice.IMPLICIT))
			e._selected = true;
		
		// Update display
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
		
		return rv;
	}
	
	public void delete(int __a)
	{
		throw new todo.TODO();
................................................................................
		throws IndexOutOfBoundsException
	{
		this._items.get(__i)._disabled = !__e;
		
		// Update display
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
	}
	
	public void setFitPolicy(int __a)
	{
		throw new todo.TODO();
	}
	
................................................................................
		throws IndexOutOfBoundsException
	{
		this._items.get(__i)._font = __f;
		
		// Update display
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
	}
	
	public void setSelectCommand(Command __a)
	{
		throw new todo.TODO();
	}
	
................................................................................
			for (int i = 0; i < n; i++)
				this._items.get(i)._selected = (__i == i);
		}
		
		// Update display
		Display d = this._display;
		if (d != null)
			UIState.getInstance().repaint();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/10
	 */
	@Override
	public int size()
	{
		return this._items.size();
	}
}

Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Ticker.java.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
..
70
71
72
73
74
75
76
77

78
79
80
81
82
83



84
85
86
87
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;


import cc.squirreljme.runtime.lcdui.SerializedEvent;

/**
 * A ticker contains an infinitely scrolling message.
 *
 * Any {@link Displayable} may have tickers associated with them in which
 * they will be shown at the top of the screen accordingly. As such these can
................................................................................
	{
		if (__s == null)
			throw new NullPointerException("NARG");
		
		// Set new
		this._text = __s;
		
		// Repaint for any displays which are using this ticker

		for (Displayable di : this._displayables)
		{
			Display d = di._display;
			if (d != null)
				d._phoneui.repaint();
		}



	}
}









>







 







|
>




|

>
>
>




6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;

import cc.squirreljme.runtime.lcdui.fbui.UIState;
import cc.squirreljme.runtime.lcdui.SerializedEvent;

/**
 * A ticker contains an infinitely scrolling message.
 *
 * Any {@link Displayable} may have tickers associated with them in which
 * they will be shown at the top of the screen accordingly. As such these can
................................................................................
	{
		if (__s == null)
			throw new NullPointerException("NARG");
		
		// Set new
		this._text = __s;
		
		// Find a displayable which is showing this
		boolean isshown = false;
		for (Displayable di : this._displayables)
		{
			Display d = di._display;
			if (d != null)
				isshown = true;
		}
		
		// If this is being shown, then force the view to repaint
		UIState.getInstance().repaint();
	}
}


Deleted runt/apis/midp-lcdui/javax/microedition/lcdui/__EventCallback__.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package javax.microedition.lcdui;

import cc.squirreljme.runtime.cldc.asm.NativeDisplayAccess;
import cc.squirreljme.runtime.cldc.asm.NativeDisplayEventCallback;

/**
 * This is the event callback which is called whenever the display system
 * needs an event to happen.
 *
 * @since 2018/12/03
 */
@Deprecated
final class __EventCallback__
	implements NativeDisplayEventCallback
{
	/** The callback for events. */
	static final __EventCallback__ _CALLBACK =
		new __EventCallback__();
	
	/** Is this registered? */
	volatile boolean _registered;
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/03
	 */
	@Override
	@Deprecated
	public final void command(int __d, int __c)
	{
		try
		{
			Display.__mapDisplay(__d).__doCommandAction(__c);
		}
		catch (Exception t)
		{
			t.printStackTrace();
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/03
	 */
	@Override
	@Deprecated
	public final void exitRequest(int __d)
	{
		try
		{
			Display.__mapDisplay(__d).__doExitRequest();
		}
		catch (Exception t)
		{
			t.printStackTrace();
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/03
	 */
	@Override
	@Deprecated
	public final void keyEvent(int __d, int __ty, int __kc, int __ch,
		int __time)
	{
		try
		{
			Display.__mapDisplay(__d).__doKeyAction(__ty, __kc,
				(__ch < 0 ? 0 : (char)__ch), __time);
		}
		catch (Exception t)
		{
			t.printStackTrace();
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/10
	 */
	@Override
	@Deprecated
	public final void lostCallback()
	{
		todo.DEBUG.note("Lost callback.");
		synchronized (this)
		{
			this._registered = false;
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/03
	 */
	@Override
	@Deprecated
	public final void paintDisplay(int __d, int __x, int __y,
		int __w, int __h)
	{
		try
		{
			Display.__mapDisplay(__d).__doRepaint(__x, __y, __w, __h);
		}
		catch (Exception t)
		{
			t.printStackTrace();
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/03
	 */
	@Override
	@Deprecated
	public final void pointerEvent(int __d, int __ty, int __x, int __y,
		int __time)
	{
		try
		{
			Display.__mapDisplay(__d).
				__doPointerAction(__ty, __x, __y, __time);
		}
		catch (Exception t)
		{
			t.printStackTrace();
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/03
	 */
	@Override
	@Deprecated
	public final void shown(int __d, int __shown)
	{
		try
		{
			Display.__mapDisplay(__d).__doDisplayShown(__shown != 0);
		}
		catch (Exception t)
		{
			t.printStackTrace();
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/03
	 */
	@Override
	@Deprecated
	public final void sizeChanged(int __d, int __w, int __h)
	{
		try
		{
			Display.__mapDisplay(__d).__doDisplaySizeChanged(__w, __h);
		}
		catch (Exception t)
		{
			t.printStackTrace();
		}
	}
	
	/**
	 * Registers the display.
	 *
	 * @since 2018/12/10
	 */
	@Deprecated
	final void __register()
	{
		// Do not allow the variable to go crazy
		synchronized (this)
		{
			// Only register once!
			if (!this._registered)
			{
				NativeDisplayAccess.registerEventCallback(_CALLBACK);
				this._registered = true;
			}
		}
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































































































































































































































Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/__GfxIPCDispatch__.java.

13
14
15
16
17
18
19

20
21
22
23
24
25
26

/**
 * This is the graphics IPC handler which dispatches any events to the
 * appropriate widgets and such.
 *
 * @since 2019/12/28
 */

class __GfxIPCDispatch__
	implements IPCCallback
{
	/** The instance of this. */
	private static __GfxIPCDispatch__ _INSTANCE;
	
	/**







>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

/**
 * This is the graphics IPC handler which dispatches any events to the
 * appropriate widgets and such.
 *
 * @since 2019/12/28
 */
@Deprecated
class __GfxIPCDispatch__
	implements IPCCallback
{
	/** The instance of this. */
	private static __GfxIPCDispatch__ _INSTANCE;
	
	/**

Changes to runt/klib/supervisor/cc/squirreljme/jvm/Framebuffer.java.

163
164
165
166
167
168
169














170
171
172

173
174
175
176
177
178
179
...
198
199
200
201
202
203
204












205
206
207
208
209
210
211
	 * @return A value that is according to the invoked function, if it is
	 * supported or possible.
	 * @since 2020/01/10
	 */
	public static final byte CONTROL_ACCEL_FUNC_INVOKE =
		18;
	














	/** The number of framebuffer controls. */
	public static final byte NUM_CONTROLS =
		19;

	
	/** Screen is RGB 32-bit. */
	public static final byte FORMAT_INTEGER_RGB888 =
		0;
	
	/** Screen is 8-bit indexed. */
	public static final byte FORMAT_BYTE_INDEXED =
................................................................................
	/** Has touch-screen. */
	public static final byte CAPABILITY_TOUCH =
		0x01;
	
	/** Has keyboard. */
	public static final byte CAPABILITY_KEYBOARD =
		0x02;












	
	/** Set color. */
	public static final byte ACCEL_FUNC_SET_COLOR =
		0;
	
	/** Draw line. */
	public static final byte ACCEL_FUNC_DRAW_LINE =







>
>
>
>
>
>
>
>
>
>
>
>
>
>


<
>







 







>
>
>
>
>
>
>
>
>
>
>
>







163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193
...
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
	 * @return A value that is according to the invoked function, if it is
	 * supported or possible.
	 * @since 2020/01/10
	 */
	public static final byte CONTROL_ACCEL_FUNC_INVOKE =
		18;
	
	/**
	 * Requests that the framebuffer be repainted.
	 *
	 * @param 1 The X coordinate.
	 * @param 2 The Y coordinate.
	 * @param 3 The width.
	 * @param 4 The height.
	 * @return Returns {@code 0} if the repaint was not queued and it must be
	 * handled by the code running the application, 
	 * @since 2020/01/15
	 */
	public static final byte CONTROL_REPAINT_REQUEST =
		19;
	
	/** The number of framebuffer controls. */
	public static final byte NUM_CONTROLS =

		20;
	
	/** Screen is RGB 32-bit. */
	public static final byte FORMAT_INTEGER_RGB888 =
		0;
	
	/** Screen is 8-bit indexed. */
	public static final byte FORMAT_BYTE_INDEXED =
................................................................................
	/** Has touch-screen. */
	public static final byte CAPABILITY_TOUCH =
		0x01;
	
	/** Has keyboard. */
	public static final byte CAPABILITY_KEYBOARD =
		0x02;
	
	/** The JVM pushes to the IPC handler when events happen. */
	public static final byte CAPABILITY_IPC_EVENTS =
		0x04;
	
	/** Has screen flipping? */
	public static final byte CAPABILITY_SCREEN_FLIP =
		0x08;
	
	/** Screen has color that is not just a single shade. */
	public static final byte CAPABILITY_COLOR =
		0x10;
	
	/** Set color. */
	public static final byte ACCEL_FUNC_SET_COLOR =
		0;
	
	/** Draw line. */
	public static final byte ACCEL_FUNC_DRAW_LINE =