Changeset c8cf261 in mainline
- Timestamp:
- 2019-10-03T09:10:01Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6af4b4f
- Parents:
- aac5069
- git-author:
- Jiri Svoboda <jiri@…> (2019-10-02 17:09:46)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-10-03 09:10:01)
- Files:
-
- 16 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/ipc/interfaces.h
raac5069 rc8cf261 187 187 FOURCC_COMPACT('i', 'p', 'c', 't') | IFACE_EXCHANGE_SERIALIZE, 188 188 INTERFACE_PCI = 189 FOURCC_COMPACT('p', 'c', 'i', ' ') | IFACE_EXCHANGE_SERIALIZE 189 FOURCC_COMPACT('p', 'c', 'i', ' ') | IFACE_EXCHANGE_SERIALIZE, 190 INTERFACE_DISPLAY = 191 FOURCC_COMPACT('d', 's', 'p', 'l') | IFACE_EXCHANGE_SERIALIZE, 192 INTERFACE_GC = 193 FOURCC_COMPACT('g', 'f', 'x', 'c') | IFACE_EXCHANGE_SERIALIZE, 190 194 } iface_t; 191 195 -
uspace/app/gfxdemo/gfxdemo.c
raac5069 rc8cf261 36 36 #include <congfx/console.h> 37 37 #include <draw/surface.h> 38 #include <display.h> 38 39 #include <fibril.h> 39 40 #include <guigfx/canvas.h> … … 117 118 static errno_t demo_canvas(void) 118 119 { 119 console_ctrl_t *con = NULL;120 120 canvas_gc_t *cgc = NULL; 121 121 gfx_context_t *gc; … … 128 128 129 129 printf("Init canvas..\n"); 130 con = console_init(stdin, stdout);131 if (con == NULL)132 return EIO;133 130 134 131 window = window_open("comp:0/winreg", NULL, … … 145 142 if (pixbuf == NULL) { 146 143 printf("Error allocating memory for pixel buffer.\n"); 147 return -1;144 return ENOMEM; 148 145 } 149 146 … … 151 148 if (surface == NULL) { 152 149 printf("Error creating surface.\n"); 153 return -1;150 return EIO; 154 151 } 155 152 … … 158 155 if (canvas == NULL) { 159 156 printf("Error creating canvas.\n"); 160 return -1;157 return EIO; 161 158 } 162 159 … … 182 179 } 183 180 181 /** Run demo on display server. */ 182 static errno_t demo_display(void) 183 { 184 display_t *display = NULL; 185 gfx_context_t *gc; 186 display_window_t *window = NULL; 187 errno_t rc; 188 189 printf("Init display..\n"); 190 191 rc = display_open(NULL, &display); 192 if (rc != EOK) { 193 printf("Error opening display.\n"); 194 return rc; 195 } 196 197 rc = display_window_create(display, &window); 198 if (rc != EOK) { 199 printf("Error creating window.\n"); 200 return rc; 201 } 202 203 rc = display_window_get_gc(window, &gc); 204 if (rc != EOK) { 205 printf("Error getting graphics context.\n"); 206 } 207 208 rc = demo_rects(gc, 400, 300); 209 if (rc != EOK) 210 return rc; 211 212 rc = gfx_context_delete(gc); 213 if (rc != EOK) 214 return rc; 215 216 return EOK; 217 } 218 184 219 static void print_syntax(void) 185 220 { 186 printf("syntax: gfxdemo {canvas|console }\n");221 printf("syntax: gfxdemo {canvas|console|display}\n"); 187 222 } 188 223 … … 202 237 } else if (str_cmp(argv[1], "canvas") == 0) { 203 238 rc = demo_canvas(); 239 if (rc != EOK) 240 return 1; 241 } else if (str_cmp(argv[1], "display") == 0) { 242 rc = demo_display(); 204 243 if (rc != EOK) 205 244 return 1; -
uspace/app/gfxdemo/meson.build
raac5069 rc8cf261 27 27 # 28 28 29 deps = [ 'gfx', 'guigfx', 'congfx', 'ipcgfx' ]29 deps = [ 'gfx', 'guigfx', 'congfx', 'ipcgfx', 'display' ] 30 30 src = files( 31 31 'gfxdemo.c', -
uspace/lib/c/include/ipc/services.h
raac5069 rc8cf261 54 54 #define SERVICE_NAME_CLIPBOARD "clipboard" 55 55 #define SERVICE_NAME_CORECFG "corecfg" 56 #define SERVICE_NAME_DISPLAY "hid/display" 56 57 #define SERVICE_NAME_DHCP "net/dhcp" 57 58 #define SERVICE_NAME_DNSR "net/dnsr" -
uspace/lib/ipcgfx/include/ipcgfx/server.h
raac5069 rc8cf261 41 41 #include <gfx/context.h> 42 42 43 extern errno_t gc_conn(ipc_call_t *icall, gfx_context_t *gc) 43 extern errno_t gc_conn(ipc_call_t *icall, gfx_context_t *gc); 44 44 45 45 #endif -
uspace/lib/ipcgfx/src/client.c
raac5069 rc8cf261 51 51 }; 52 52 53 #include <stdio.h> 54 53 55 /** Set color on IPC GC. 54 56 * … … 67 69 errno_t rc; 68 70 71 printf("ipc_gc_set_color\n"); 69 72 gfx_color_get_rgb_i16(color, &r, &g, &b); 70 73 … … 89 92 errno_t rc; 90 93 94 printf("ipc_gc_fill_rect\n"); 91 95 exch = async_exchange_begin(ipcgc->sess); 92 96 rc = async_req_4_0(exch, GC_FILL_RECT, rect->p0.x, rect->p0.y, -
uspace/lib/ipcgfx/src/server.c
raac5069 rc8cf261 44 44 #include <stdint.h> 45 45 46 #include <stdio.h> 47 46 48 #include <bd_srv.h> 47 49 … … 64 66 rc = gfx_set_color(gc, color); 65 67 async_answer_0(call, rc); 68 printf("done with rgb_color_srv\n"); 66 69 } 67 70 … … 85 88 async_accept_0(icall); 86 89 90 printf("gc_conn: accepted connection\n"); 91 87 92 while (true) { 88 93 ipc_call_t call; … … 98 103 switch (method) { 99 104 case GC_SET_RGB_COLOR: 105 printf("gc_conn: set_rgb_color\n"); 100 106 gc_set_rgb_color_srv(gc, &call); 107 printf("gc_conn: done set_rgb_color\n"); 101 108 break; 102 109 case GC_FILL_RECT: 110 printf("gc_conn: fill_rect_srv\n"); 103 111 gc_fill_rect_srv(gc, &call); 112 printf("gc_conn: done fill_rect_srv\n"); 104 113 break; 105 114 default: 115 printf("gc_conn: answer einval\n"); 106 116 async_answer_0(&call, EINVAL); 117 printf("gc_conn: done answer einval\n"); 107 118 } 108 119 } -
uspace/lib/meson.build
raac5069 rc8cf261 86 86 'guigfx', 87 87 'ieee80211', 88 'ipcgfx' 88 'ipcgfx', 89 90 'display' 89 91 ] 90 92 -
uspace/srv/meson.build
raac5069 rc8cf261 45 45 'hid/compositor', 46 46 'hid/console', 47 'hid/display', 47 48 'hid/input', 48 49 'hid/isdv4_tablet',
Note:
See TracChangeset
for help on using the changeset viewer.