Check-in [d24b05500f]

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

Overview
Comment:Width and height of the stuff to draw.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d24b05500f21460fb784db2200b6156d5d68670b
User & Date: stephanie.gawroriski 2019-05-16 17:29:00
Context
2019-05-16
17:39
Implement basic content area size. check-in: 8cca18df48 user: stephanie.gawroriski tags: trunk
17:29
Width and height of the stuff to draw. check-in: d24b05500f user: stephanie.gawroriski tags: trunk
17:04
Set of current displayable item. check-in: 6a5ff73033 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

7
8
9
10
11
12
13

14
15
16
17
18
19
20
..
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
..
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
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.phoneui;

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


/**
 * This class contains the definition and holders for the phone based user
 * interface.
 *
 * @since 2019/05/16
 */
................................................................................
		240;
	
	/** The height of the phone screen. */
	public static final int DEFAULT_SCREEN_HEIGHT =
		320;
	
	/** The width of the phone screen. */
	public final int screenwidth;
	
	/** The height of the phone screen. */
	public final int screenheight;
	
	/** The backend this UI uses. */
	protected final PhoneDisplayBackend backend;



	
	/** The current displayable to show. */
	private Displayable _current;
	
	/** The title to use. */
	private String _title;



	
	/**
	 * Initializes the base UI using the default screen size.
	 *
	 * @param __b The display backend to use.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
................................................................................
	public PhoneUI(PhoneDisplayBackend __b, int __sw, int __sh)
		throws NullPointerException
	{
		if (__b == null)
			throw new NullPointerException("NARG");
		
		this.backend = __b;
		this.screenwidth = (__sw <= 0 ? DEFAULT_SCREEN_WIDTH : __sw);
		this.screenheight = (__sh <= 0 ? DEFAULT_SCREEN_HEIGHT : __sh);
	}



	

	/**
	 * Repaints the display.























	 *
	 * @since 2019/05/16
	 */
	public final void repaint()
	{
		throw new todo.TODO();
	}
	
	/**
	 * Sets the current displayable to be drawn.
	 *
	 * @param __d The displayable to draw.
	 * @since 2019/05/16







>







 







|


|



>
>
>






>
>
>







 







|
|
|
>
>
>
|
>

<
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
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
..
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
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.phoneui;

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

/**
 * This class contains the definition and holders for the phone based user
 * interface.
 *
 * @since 2019/05/16
 */
................................................................................
		240;
	
	/** The height of the phone screen. */
	public static final int DEFAULT_SCREEN_HEIGHT =
		320;
	
	/** The width of the phone screen. */
	public final int width;
	
	/** The height of the phone screen. */
	public final int height;
	
	/** The backend this UI uses. */
	protected final PhoneDisplayBackend backend;
	
	/** The buffer which represents the display itself. */
	protected final Image buffer;
	
	/** The current displayable to show. */
	private Displayable _current;
	
	/** The title to use. */
	private String _title;
	
	/** Should the display be repainted? */
	private volatile boolean _repaint;
	
	/**
	 * Initializes the base UI using the default screen size.
	 *
	 * @param __b The display backend to use.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
................................................................................
	public PhoneUI(PhoneDisplayBackend __b, int __sw, int __sh)
		throws NullPointerException
	{
		if (__b == null)
			throw new NullPointerException("NARG");
		
		this.backend = __b;
		this.width = (__sw = (__sw <= 0 ? DEFAULT_SCREEN_WIDTH : __sw));
		this.height = (__sh = (__sh <= 0 ? DEFAULT_SCREEN_HEIGHT : __sh));
		
		// The screen is drawn into this buffer, which is then draw on the
		// actual display (using possible scaling, or otherwise)
		this.buffer = Image.createImage(__sw, __sh);
	}
	
	/**

	 * Returns the height of the content area.
	 *
	 * @return The content area height.
	 * @since 2019/05/16
	 */
	public final int contentHeight()
	{
		throw new todo.TODO();
	}
	
	/**
	 * Returns the width of the content area.
	 *
	 * @return The content area width.
	 * @since 2019/05/16
	 */
	public final int contentWidth()
	{
		throw new todo.TODO();
	}
	
	/**
	 * Signals that the display should be repainted on the next draw loop.
	 *
	 * @since 2019/05/16
	 */
	public final void repaint()
	{
		this._repaint = true;
	}
	
	/**
	 * Sets the current displayable to be drawn.
	 *
	 * @param __d The displayable to draw.
	 * @since 2019/05/16

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

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
...
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
	/**
	 * {@inheritDoc}
	 * @since 2017/02/08
	 */
	@Override
	public int getHeight()
	{
		throw new todo.TODO();
		/*
		return this.__defaultHeight();
		*/
	}
	
	/**
	 * Returns the key code for the given game action.
	 *
	 * @param __gc The game action to convert.
	 * @return The key code
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2017/02/08
	 */
	@Override
	public int getWidth()
	{
		throw new todo.TODO();
		/*
		return this.__defaultWidth();
		*/
	}
	
	/**
	 * This checks whether the display has the capability to handle pointer
	 * events.
	 *
	 * @return {@code true} if pointer events are available.







|
<
<
<







 







|
<
<
<







206
207
208
209
210
211
212
213



214
215
216
217
218
219
220
...
253
254
255
256
257
258
259
260



261
262
263
264
265
266
267
	/**
	 * {@inheritDoc}
	 * @since 2017/02/08
	 */
	@Override
	public int getHeight()
	{
		return Displayable.__getHeight(this, this._isfullscreen);



	}
	
	/**
	 * Returns the key code for the given game action.
	 *
	 * @param __gc The game action to convert.
	 * @return The key code
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2017/02/08
	 */
	@Override
	public int getWidth()
	{
		return Displayable.__getWidth(this, this._isfullscreen);



	}
	
	/**
	 * This checks whether the display has the capability to handle pointer
	 * events.
	 *
	 * @return {@code true} if pointer events are available.

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

487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
...
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
	 * Returns the maximum height of the display.
	 *
	 * @return The maximum display height.
	 * @since 2016/10/14
	 */
	public int getHeight()
	{
		return this._phoneui.screenheight;
	}
	
	public IdleItem getIdleItem()
	{
		throw new todo.TODO();
	}
	
................................................................................
	 * Returns the maximum width of the display.
	 *
	 * @retrn The maximum display width.
	 * @since 2016/10/14
	 */
	public int getWidth()
	{
		return this._phoneui.screenwidth;
	}
	
	/**
	 * Are mouse/stylus press and release events supported?
	 *
	 * @return {@code true} if they are supported.
	 * @since 2016/10/14







|







 







|







487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
...
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
	 * 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();
	}
	
................................................................................
	 * 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

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

329
330
331
332
333
334
335
336


337








338









































			if (midclass != null)
				return midclass;
		}
		
		// Fallback to just using SquirrelJME
		return "SquirrelJME";
	}
}




























































|
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
			if (midclass != null)
				return midclass;
		}
		
		// Fallback to just using SquirrelJME
		return "SquirrelJME";
	}
	
	/**
	 * Returns the displayable height.
	 *
	 * @param __d The displayable.
	 * @param __full Return the full screen?
	 * @return The height.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
	 */
	static final int __getHeight(Displayable __d, boolean __full)
		throws NullPointerException
	{
		if (__d == null)
			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?
	 * @return The width.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
	 */
	static final int __getWidth(Displayable __d, boolean __full)
	{
		if (__d == null)
			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();
	}
}