2
* Copyright (C) 2010 The Android Open Source Project
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
24
* Pixel formats that a window can use.
27
WINDOW_FORMAT_RGBA_8888 = 1;
28
WINDOW_FORMAT_RGBX_8888 = 2;
29
WINDOW_FORMAT_RGB_565 = 4;
32
PANativeWindow = ^ANativeWindow;
33
ANativeWindow = record end;
35
PANativeWindow_Buffer = ^ANativeWindow_Buffer;
36
ANativeWindow_Buffer = packed record
37
// The number of pixels that are show horizontally.
39
// The number of pixels that are shown vertically.
41
// The number of *pixels* that a line in the buffer takes in
42
// memory. This may be >= width.
44
// The format of the buffer. One of WINDOW_FORMAT_*
49
reserved : array [0..5] of cuint32;
53
* Acquire a reference on the given ANativeWindow object. This prevents the object
54
* from being deleted until the reference is removed.
56
procedure ANativeWindow_acquire(window: PANativeWindow); cdecl; external;
59
* Remove a reference that was previously acquired with ANativeWindow_acquire().
61
procedure ANativeWindow_release(window: PANativeWindow); cdecl; external;
64
* Return the current width in pixels of the window surface. Returns a
65
* negative value on error.
67
function ANativeWindow_getWidth(window: PANativeWindow): cint32; cdecl; external;
70
* Return the current height in pixels of the window surface. Returns a
71
* negative value on error.
73
function ANativeWindow_getHeight(window: PANativeWindow): cint32; cdecl; external;
76
* Return the current pixel format of the window surface. Returns a
77
* negative value on error.
79
function ANativeWindow_getFormat(window: PANativeWindow): cint32; cdecl; external;
82
* Change the format and size of the window buffers.
84
* The width and height control the number of pixels in the buffers, not the
85
* dimensions of the window on screen. If these are different than the
86
* window's physical size, then it buffer will be scaled to match that size
87
* when compositing it to the screen.
89
* For all of these parameters, if 0 is supplied then the window's base
90
* value will come back in force.
92
function ANativeWindow_setBuffersGeometry(window: PANativeWindow; width, height, format: cint32): cint32; cdecl; external;
95
* Lock the window's next drawing surface for writing.
97
function ANativeWindow_lock(window: PANativeWindow; outBuffer: PANativeWindow_Buffer; inOutDirtyBounds: PARect): cint32; cdecl; external;
100
* Unlock the window's drawing surface after previously locking it,
101
* posting the new buffer to the display.
103
function ANativeWindow_unlockAndPost(window: PANativeWindow): cint32; cdecl; external;