Changeset 1766326 in mainline for uspace/app/taskbar
- Timestamp:
- 2022-10-18T09:06:07Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a05d924
- Parents:
- 0761448
- git-author:
- Jiri Svoboda <jiri@…> (2022-10-17 17:05:56)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-10-18 09:06:07)
- Location:
- uspace/app/taskbar
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/main.c
r0761448 r1766326 46 46 { 47 47 const char *display_spec = UI_ANY_DEFAULT; 48 const char *wndmgt_svc = WNDMGT_DEFAULT; 48 49 taskbar_t *taskbar; 49 50 errno_t rc; … … 61 62 62 63 display_spec = argv[i++]; 64 } else if (str_cmp(argv[i], "-w") == 0) { 65 ++i; 66 if (i >= argc) { 67 printf("Argument missing.\n"); 68 print_syntax(); 69 return 1; 70 } 71 72 wndmgt_svc = argv[i++]; 63 73 } else { 64 74 printf("Invalid option '%s'.\n", argv[i]); … … 73 83 } 74 84 75 rc = taskbar_create(display_spec, &taskbar);85 rc = taskbar_create(display_spec, wndmgt_svc, &taskbar); 76 86 if (rc != EOK) 77 87 return 1; -
uspace/app/taskbar/meson.build
r0761448 r1766326 27 27 # 28 28 29 deps = [ 'ui' ]29 deps = [ 'ui', 'wndmgt' ] 30 30 src = files( 31 31 'clock.c', -
uspace/app/taskbar/taskbar.c
r0761448 r1766326 42 42 #include <ui/ui.h> 43 43 #include <ui/window.h> 44 #include <wndmgt.h> 44 45 #include "clock.h" 45 46 #include "taskbar.h" … … 67 68 * 68 69 * @param display_spec Display specification 70 * @param wndmgt_svc Window management service (or WNDMGT_DEFAULT) 69 71 * @param rtaskbar Place to store pointer to new task bar 70 72 * @return @c EOK on success or an error coe 71 73 */ 72 errno_t taskbar_create(const char *display_spec, taskbar_t **rtaskbar) 74 errno_t taskbar_create(const char *display_spec, const char *wndmgt_svc, 75 taskbar_t **rtaskbar) 73 76 { 74 77 ui_wnd_params_t params; … … 83 86 rc = ENOMEM; 84 87 goto error; 88 } 89 90 if (wndmgt_svc != NULL) { 91 rc = wndmgt_open(wndmgt_svc, NULL, NULL, &taskbar->wndmgt); 92 if (rc != EOK) 93 goto error; 85 94 } 86 95 … … 215 224 if (taskbar->ui != NULL) 216 225 ui_destroy(taskbar->ui); 226 if (taskbar->wndmgt != NULL) 227 wndmgt_close(taskbar->wndmgt); 217 228 return rc; 218 229 … … 226 237 ui_window_destroy(taskbar->window); 227 238 ui_destroy(taskbar->ui); 239 if (taskbar->wndmgt != NULL) 240 wndmgt_close(taskbar->wndmgt); 228 241 } 229 242 -
uspace/app/taskbar/taskbar.h
r0761448 r1766326 38 38 39 39 #include <errno.h> 40 #include <wndmgt.h> 40 41 #include "types/taskbar.h" 41 42 42 extern errno_t taskbar_create(const char * display_spec, taskbar_t **);43 extern errno_t taskbar_create(const char *, const char *, taskbar_t **); 43 44 extern void taskbar_destroy(taskbar_t *); 44 45 -
uspace/app/taskbar/test/taskbar.c
r0761448 r1766326 41 41 taskbar_t *taskbar; 42 42 43 rc = taskbar_create(UI_DISPLAY_NULL, &taskbar);43 rc = taskbar_create(UI_DISPLAY_NULL, NULL, &taskbar); 44 44 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 45 45 -
uspace/app/taskbar/types/taskbar.h
r0761448 r1766326 57 57 /** Clock */ 58 58 taskbar_clock_t *clock; 59 /** Window management service */ 60 wndmgt_t *wndmgt; 59 61 } taskbar_t; 60 62
Note:
See TracChangeset
for help on using the changeset viewer.