Developer World
Spresense SDK Library v3.2.0-ebc0364
vnc.h
1/****************************************************************************
2 * include/nuttx/video/vnc.h
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership. The
7 * ASF licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
9 * License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations
17 * under the License.
18 *
19 ****************************************************************************/
20
21#ifndef __INCLUDE_NUTTX_VIDEO_VNC_H
22#define __INCLUDE_NUTTX_VIDEO_VNC_H
23
24/****************************************************************************
25 * Included Files
26 ****************************************************************************/
27
28#include <nuttx/config.h>
29
30#include <stdint.h>
31
32/****************************************************************************
33 * Public Function Prototypes
34 ****************************************************************************/
35
36/* These are the types of the function pointers used to support callouts when
37 * mouse or keyboard inputs are received by the local VNC server from the
38 * remove VNC client. Notice that these callouts have arguments that match
39 * the inputs to nx_kbdin() and nx_mousein().
40 */
41
42typedef CODE int (*vnc_mouseout_t)(FAR void *arg, int16_t x,
43 int16_t y, uint8_t buttons);
44typedef CODE int (*vnc_kbdout_t)(FAR void *arg, uint8_t nch,
45 FAR const uint8_t *ch);
46
47/****************************************************************************
48 * Public Function Prototypes
49 ****************************************************************************/
50
51#ifdef __cplusplus
52#define EXTERN extern "C"
53extern "C"
54{
55#else
56#define EXTERN extern
57#endif
58
59/****************************************************************************
60 * Name: vnc_fbinitialize
61 *
62 * Description:
63 * Initialize the VNC frame buffer driver. The VNC frame buffer driver
64 * supports two initialization interfaces: The standard up_fbinitialize()
65 * that will be called from the graphics layer and this special
66 * initialization function that can be used only by VNC aware OS logic.
67 *
68 * The two initialization functions may be called separated or together in
69 * either order. The difference is that standard up_fbinitialize(), if
70 * used by itself, will not have any remote mouse or keyboard inputs that
71 * are reported to the VNC framebuffer driver from the remote VNC client.
72 *
73 * In the standard graphics architecture, the keyboard/mouse inputs are
74 * received by some application/board specific logic at the highest level
75 * in the architecture via input drivers. The received keyboard/mouse
76 * input data must then be "injected" into NX where it can they can be
77 * assigned to the window that has focus. They will eventually be
78 * received by the Window instances via NX callback methods.
79 *
80 * NX is a middleware layer in the architecture, below the
81 * application/board specific logic but above the driver level logic. The
82 * frame buffer driver, on the other hand lies at the very lowest level in
83 * the graphics architecture. It cannot call upward into the application
84 * nor can it call upward into NX. So, some other logic.
85 *
86 * vnc_fbinitialize() provides an optional, alternative initialization
87 * function. It is optional because it need not be called. If it is not
88 * called, however, keyboard/mouse inputs from the remote VNC client will
89 * be lost. By calling vnc_fbinitialize(), you can provide callout
90 * functions that can be received by logic higher in the architecture.
91 * These higher level callouts can then call nx_kbdin() or nx_mousein() on
92 * behalf of the VNC server.
93 *
94 * See also nx_vnc_fbinitialize() in include/nuttx/nx/nx.h.
95 *
96 * Input Parameters:
97 * display - In the case of hardware with multiple displays, this
98 * specifies the display. Normally this is zero.
99 * kbdout - If non-NULL, then the pointed-to function will be called to
100 * handle all keyboard input as it is received. This may be either raw,
101 * ASCII keypress input or encoded keyboard input as determined by
102 * CONFIG_VNCSERVER_KBDENCODE. See include/nuttx/input/kbd_codec.h.
103 * mouseout - If non-NULL, then the pointed-to function will be called to
104 * handle all mouse input as it is received.
105 * arg - An opaque user provided argument that will be provided when the
106 * callouts are performed.
107 *
108 * Returned Value:
109 * Zero (OK) is returned on success. Otherwise, a negated errno value is
110 * returned to indicate the nature of the failure.
111 *
112 ****************************************************************************/
113
114int vnc_fbinitialize(int display, vnc_kbdout_t kbdout,
115 vnc_mouseout_t mouseout, FAR void *arg);
116
117#undef EXTERN
118#ifdef __cplusplus
119}
120#endif
121
122#endif /* __INCLUDE_NUTTX_VIDEO_VNC_H */