Check-in [d01095aa38]

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

Overview
Comment:Initialize the framebuffer again now.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d01095aa38861b78453257ccd3113592be0c63f7
User & Date: stephanie.gawroriski 2019-05-16 17:46:58
Context
2019-05-16
18:05
Registration of callback for native ui. check-in: 5ead2a7a1b user: stephanie.gawroriski tags: trunk
17:46
Initialize the framebuffer again now. check-in: d01095aa38 user: stephanie.gawroriski tags: trunk
17:39
Implement basic content area size. check-in: 8cca18df48 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

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
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.phoneui;


import cc.squirreljme.runtime.lcdui.gfx.PixelFormat;

/**
 * This is a backend which utilizes the SquirrelJME UI interface for all of
 * the related drawing applications.
 *
 * @since 2019/05/16
................................................................................
 */
public final class NativeUIBackend
	implements PhoneDisplayBackend
{
	/** The native display ID. */
	protected final int nid;
	






























	/**
	 * Initializes the native UI backend using the given display ID.
	 *
	 * @param __nid The native display ID this uses.
	 * @since 2019/05/16
	 */
	public NativeUIBackend(int __nid)
	{
		this.nid = __nid;


















	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final boolean isUpsidedown()
	{
		throw new todo.TODO();
		/*
		NativeDisplayAccess.isUpsideDown(this._nid)
		*/
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final PixelFormat pixelFormat()
	{
		throw new todo.TODO();
		/*
		this._state.framebuffer().pixelformat
		*/
	}
	
	/*
	NativeDisplayAccess.displayRepaint(state.nativeid, 0, 0, w, h);
	*/
}








>







 







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









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









<
<
|
<









|
<
<
<







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
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.phoneui;

import cc.squirreljme.runtime.cldc.asm.NativeDisplayAccess;
import cc.squirreljme.runtime.lcdui.gfx.PixelFormat;

/**
 * This is a backend which utilizes the SquirrelJME UI interface for all of
 * the related drawing applications.
 *
 * @since 2019/05/16
................................................................................
 */
public final class NativeUIBackend
	implements PhoneDisplayBackend
{
	/** The native display ID. */
	protected final int nid;
	
	/** The pixel format of the buffer. */
	protected final PixelFormat pixelformat;
		
	/** The buffer data. */
	protected final Object buffer;
	
	/** The palette. */
	protected final int[] palette;
	
	/** The buffer width. */
	public final int width;
	
	/** The buffer height. */
	public final int height;
	
	/** Is the alpha channel used? */
	protected final boolean alpha;
	
	/** The pitch. */
	protected final int pitch;
	
	/** The offset into the buffer. */
	protected final int offset;
	
	/** The virtual X origin. */
	protected final int virtxorig;
	
	/** The virtual Y origin. */
	protected final int virtyorig;
	
	/**
	 * Initializes the native UI backend using the given display ID.
	 *
	 * @param __nid The native display ID this uses.
	 * @since 2019/05/16
	 */
	public NativeUIBackend(int __nid)
	{
		this.nid = __nid;
		
		// Get data buffers and properties
		Object buf = NativeDisplayAccess.framebufferObject(__nid);
		int[] pal = NativeDisplayAccess.framebufferPalette(__nid);
		int[] params = NativeDisplayAccess.framebufferParameters(__nid);
		
		// Set parameters
		this.pixelformat = PixelFormat.of(
			params[NativeDisplayAccess.PARAMETER_PIXELFORMAT]);
		this.buffer = buf;
		this.palette = pal;
		this.width = params[NativeDisplayAccess.PARAMETER_BUFFERWIDTH];
		this.height = params[NativeDisplayAccess.PARAMETER_BUFFERHEIGHT];
		this.alpha = params[NativeDisplayAccess.PARAMETER_ALPHA] != 0;
		this.pitch = params[NativeDisplayAccess.PARAMETER_PITCH];
		this.offset = params[NativeDisplayAccess.PARAMETER_OFFSET];
		this.virtxorig = params[NativeDisplayAccess.PARAMETER_VIRTXOFF];
		this.virtyorig = params[NativeDisplayAccess.PARAMETER_VIRTYOFF];
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final boolean isUpsidedown()
	{


		return NativeDisplayAccess.isUpsideDown(this.nid);

	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/05/16
	 */
	@Override
	public final PixelFormat pixelFormat()
	{
		return this.pixelFormat();



	}
	
	/*
	NativeDisplayAccess.displayRepaint(state.nativeid, 0, 0, w, h);
	*/
}

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

123
124
125
126
127
128
129
130
131
132
133
134
135
136













137
138
139
140
141
142
143
	 */
	public final int contentWidth()
	{
		return this._contentwidth;
	}
	
	/**
	 * 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







|





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







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
	 */
	public final int contentWidth()
	{
		return this._contentwidth;
	}
	
	/**
	 * Signals that the display should be repainted.
	 *
	 * @since 2019/05/16
	 */
	public final void repaint()
	{
		this.repaint(0, 0, this.width, this.height);
	}
	
	/**
	 * Signals that the display should be repainted.
	 *
	 * @param __x The X coordinate.
	 * @param __y The Y coordinate.
	 * @param __w The width.
	 * @param __h The height.
	 * @since 2019/05/16
	 */
	public final void repaint(int __x, int __y, int __w, int __h)
	{
	}
	
	/**
	 * 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.

450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
	 */
	public final void repaint(int __x, int __y, int __w, int __h)
	{
		// Do nothing
		if (__w <= 0 || __h <= 0)
			return;
		
		throw new todo.TODO();
		/*
		// Tell the display to repaint itself
		Display display = this.getCurrentDisplay();
		if (display != null)
		{
			// Used for service repaints
			this._paintwanted = true;
			
			// Call paint
			NativeDisplayAccess.displayRepaint(
				display._state.nativeid, __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.







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







450
451
452
453
454
455
456
457



458






459


460
461
462
463
464
465
466
	 */
	public final void repaint(int __x, int __y, int __w, int __h)
	{
		// 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.