Changeset 9be2358 in mainline
- Timestamp:
- 2019-09-23T13:05:52Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 00e8290
- Parents:
- 3e828ea
- git-author:
- Jiri Svoboda <jiri@…> (2019-09-22 13:04:48)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-09-23 13:05:52)
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/gfxdemo/gfxdemo.c
r3e828ea r9be2358 44 44 console_ctrl_t *con = NULL; 45 45 gfx_color_t *color = NULL; 46 gfx_context_t *gc = NULL; 46 console_gc_t *cgc = NULL; 47 gfx_context_t *gc; 47 48 gfx_rect_t rect; 48 49 int i; … … 55 56 56 57 printf("Create console GC\n"); 57 rc = console_gc_create(con, stdout, & gc);58 rc = console_gc_create(con, stdout, &cgc); 58 59 if (rc != EOK) 59 60 return 1; 61 62 gc = console_gc_get_ctx(cgc); 60 63 61 64 while (true) { … … 85 88 } 86 89 87 // TODO How will we free GC subclass? 88 89 // rc = gfx_context_delete(gc); 90 // if (rc != EOK) 91 // return 1; 90 rc = console_gc_delete(cgc); 91 if (rc != EOK) 92 return 1; 92 93 93 94 return 0; -
uspace/lib/gfx/include/gfx/backend/console.h
r3e828ea r9be2358 45 45 extern gfx_context_ops_t console_gc_ops; 46 46 47 extern errno_t console_gc_create(console_ctrl_t *, FILE *, gfx_context_t **); 47 extern errno_t console_gc_create(console_ctrl_t *, FILE *, console_gc_t **); 48 extern errno_t console_gc_delete(console_gc_t *); 49 extern gfx_context_t *console_gc_get_ctx(console_gc_t *); 48 50 49 51 #endif -
uspace/lib/gfx/private/backend/console.h
r3e828ea r9be2358 40 40 #include <io/console.h> 41 41 #include <stdio.h> 42 #include "../context.h" 42 43 43 44 /** Actual structure of graphics context. … … 46 47 */ 47 48 struct console_gc { 49 /** Base graphic context */ 50 gfx_context_t *gc; 48 51 /** Console control structure */ 49 52 console_ctrl_t *con; -
uspace/lib/gfx/src/backend/console.c
r3e828ea r9be2358 115 115 */ 116 116 errno_t console_gc_create(console_ctrl_t *con, FILE *fout, 117 gfx_context_t **rgc)117 console_gc_t **rgc) 118 118 { 119 119 console_gc_t *cgc = NULL; … … 131 131 goto error; 132 132 133 cgc->gc = gc; 133 134 cgc->con = con; 134 135 cgc->fout = fout; 135 *rgc = gc;136 *rgc = cgc; 136 137 return EOK; 137 138 error: … … 142 143 } 143 144 145 /** Delete console GC. 146 * 147 * @param cgc Console GC 148 */ 149 errno_t console_gc_delete(console_gc_t *cgc) 150 { 151 errno_t rc; 152 153 rc = gfx_context_delete(cgc->gc); 154 if (rc != EOK) 155 return rc; 156 157 free(cgc); 158 return EOK; 159 } 160 161 /** Get generic graphic context from console GC. 162 * 163 * @param cgc Console GC 164 * @return Graphic context 165 */ 166 gfx_context_t *console_gc_get_ctx(console_gc_t *cgc) 167 { 168 return cgc->gc; 169 } 170 144 171 /** @} 145 172 */
Note:
See TracChangeset
for help on using the changeset viewer.