diff options
author | Yuta Doi <yuta-d@witz-inc.co.jp> | 2017-12-11 11:38:01 +0900 |
---|---|---|
committer | Yuta Doi <yuta-d@witz-inc.co.jp> | 2017-12-11 11:38:01 +0900 |
commit | 6aaba1066fe89f324d4bae67497f4035fe997d5f (patch) | |
tree | 89ecc85436fcc1e5567d6dfa8f10dadee0121c61 /doc | |
parent | 7fb167a27e9e12ef38c5942cf73679bff12a5b25 (diff) |
Add APIs which can get information of display and area
getDisplayInfo() can get the display information as follows:
- width[pixel]
- height[pixel]
- width[mm]
- height[mm]
NOTE:
It uses wl_output::geometry() for getting physical width[mm] and height[mm] of the display,
but the value is different with measured value.
value from wl_output::geometry(): width:320 height:520
measured value : width:193 height:343
getAreaInfo() can get the information of area drawn by the application as follows:
- x-coordinate
- y-coordinate
- width
- height
The details are described in doc/ApplicationGuide.md.
Change-Id: I41eec6251527862ef25d1b84cd37d736d3f9c8aa
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ApplicationGuide.md | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/doc/ApplicationGuide.md b/doc/ApplicationGuide.md index 7888292..d66f20b 100644 --- a/doc/ApplicationGuide.md +++ b/doc/ApplicationGuide.md @@ -517,6 +517,10 @@ This is the public interface of the class `LibWindowmanager`. int activateSurface(json_object *object); int deactivateSurface(json_object *object); int endDraw(json_object *object); + int getDisplayInfo(json_object *object); + int getAreaInfo(json_object *in_obj, json_object *out_obj); + + int getAreaInfo(const char *label, json_object *out_obj); void set_event_handler(enum EventType et, handler_fun f); @@ -580,6 +584,56 @@ It is not crucial to make this call at every time a drawing is finished drawing in case of layout switch. The exact semantics are explained in the next [Events](#_events) Section. +### getDisplayInfo(json_object *object) + +**args: `{ }`** +This function gets the display information as follows: + - width[pixel] + - height[pixel] + - width[mm] + - height[mm] + +It outputs the display information for json_object in the argument as follows: + `{"width_pixel": int value of width[pixel], "height_pixel": int value of height[pixel], + "width_mm": int value of width[mm], "height_mm": int value of height[mm]}` + +It should be called after calling init(). +It should not be called in the event handler because it occurs hang-up. + +#### NOTE +It uses wl_output::geometry() for getting physical width[mm] and height[mm] of the display, +but the value is different with measured value. + + - value from wl_output::geometry(): width:320 height:520 + - measured value : width:193 height:343 + +### getAreaInfo(json_object *in_obj, json_object *out_obj) + +**args1: `{ 'kKeyDrawingName': 'application name' }`** +**args2: `{ }`** +This function gets the information of area drawn by the application as follows: + - x-coordinate + - y-coordinate + - width + - height + +It outputs the area information for json_object in the 2nd argument as follows: + `{"x": int value of x-coordinate, "y": int value of y-coordinate, + "width": int value of width, "height": int value of height}` + +It should be called after calling activateSurface(). +It should not be called in the event handler because it occurs hang-up. + +#### NOTE +The same information can given by SyncDraw event. + +### getAreaInfo(const char *label, json_object *out_obj) + +**args1: String of application name** +**args2: `{ }`** +This function is same with `getAreaInfo(json_object *in_obj, json_object *out_obj)`, +but only has difference of 1st argument. + ### set\_event\_handler(enum EventType et, handler_fun f) This method needs to be used to register event handlers for the WM @@ -705,11 +759,14 @@ contents - again, this is handled implicitly by the wayland protocol. that is *signal* the compositor that its surface contains new content. - `SyncDraw(json_object *object)` - args: { 'kKeyDrawingName': 'application name', 'kKeyDrawingArea': 'layout' } + args: { 'kKeyDrawingName': 'application name', 'kKeyDrawingArea': 'layout', + 'kKeyDrawingRect': { "x": int value of x-coordinate, "y": int value of y-coordinate, + "width": int value of width, "height": int value of height } } Signal applications, that the surface with name `kKeyDrawingArea` needs to redraw its content in the layout with name `kKeyDrawingArea` - this usually is sent when the surface geometry changed. + And the area position and size are included with name `kKeyDrawingRect`. - `FlushDraw(json_object *object)` args: { 'kKeyDrawingName': 'application name' } |