Changeset 7d78e466 in mainline
- Timestamp:
- 2023-10-07T15:50:59Z (15 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9bec33a
- Parents:
- 4d58bac
- Location:
- uspace
- Files:
-
- 9 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/meson.build
r4d58bac r7d78e466 27 27 # 28 28 29 deps = [ ' ui', 'wndmgt' ]29 deps = [ 'startmenu', 'ui', 'wndmgt' ] 30 30 src = files( 31 31 'clock.c', … … 47 47 'test/wndlist.c', 48 48 ) 49 50 if install_nonessential_data 51 installed_data += { 'name': 'startmenu.sif', 'dir': '/cfg' } 52 endif -
uspace/app/taskbar/taskbar.c
r4d58bac r7d78e466 173 173 } 174 174 175 rc = tbsmenu_load(taskbar->tbsmenu, "/cfg/startmenu.sif"); 176 if (rc != EOK) { 177 printf("Error loading start menu from '%s'.\n", 178 "/cfg/startmenu.sif"); 179 goto error; 180 } 181 175 182 if (ui_is_textmode(taskbar->ui)) { 176 183 rect.p0.x = params.rect.p0.x + 1; -
uspace/app/taskbar/tbsmenu.c
r4d58bac r7d78e466 34 34 35 35 #include <gfx/coord.h> 36 #include <startmenu/startmenu.h> 36 37 #include <stdbool.h> 37 38 #include <stddef.h> … … 71 72 ui_resource_t *res = ui_window_get_res(window); 72 73 tbsmenu_t *tbsmenu = NULL; 73 ui_menu_entry_t *tentry;74 74 errno_t rc; 75 75 … … 96 96 97 97 ui_menu_set_cb(tbsmenu->smenu, &tbsmenu_smenu_cb, (void *)tbsmenu); 98 99 rc = ui_menu_entry_create(tbsmenu->smenu, "~N~avigator", "", &tentry);100 if (rc != EOK)101 goto error;102 103 rc = ui_menu_entry_create(tbsmenu->smenu, "Text ~E~ditor", "", &tentry);104 if (rc != EOK)105 goto error;106 107 rc = ui_menu_entry_create(tbsmenu->smenu, "~T~erminal", "", &tentry);108 if (rc != EOK)109 goto error;110 111 rc = ui_menu_entry_create(tbsmenu->smenu, "~C~alculator", "", &tentry);112 if (rc != EOK)113 goto error;114 115 rc = ui_menu_entry_create(tbsmenu->smenu, "~U~I Demo", "", &tentry);116 if (rc != EOK)117 goto error;118 119 rc = ui_menu_entry_create(tbsmenu->smenu, "~G~FX Demo", "", &tentry);120 if (rc != EOK)121 goto error;122 98 123 99 tbsmenu->window = window; … … 135 111 } 136 112 137 /** Set window list rectangle. 138 * 139 * @param tbsmenu Window list 113 /** Load start menu from repository. 114 * 115 * @param tbsmenu Start menu 116 * @param Repository path 117 * @return EOK on success or an error code 118 */ 119 errno_t tbsmenu_load(tbsmenu_t *tbsmenu, const char *repopath) 120 { 121 ui_menu_entry_t *tentry; 122 startmenu_t *smenu = NULL; 123 startmenu_entry_t *sme; 124 const char *caption; 125 const char *cmd; 126 errno_t rc; 127 128 rc = startmenu_open(repopath, &smenu); 129 if (rc != EOK) 130 goto error; 131 132 sme = startmenu_first(smenu); 133 while (sme != NULL) { 134 caption = startmenu_entry_get_caption(sme); 135 cmd = startmenu_entry_get_cmd(sme); 136 137 rc = ui_menu_entry_create(tbsmenu->smenu, caption, "", &tentry); 138 if (rc != EOK) 139 goto error; 140 141 (void)cmd; 142 143 sme = startmenu_next(sme); 144 } 145 146 startmenu_close(smenu); 147 return EOK; 148 error: 149 if (smenu != NULL) 150 startmenu_close(smenu); 151 return rc; 152 } 153 154 /** Set start menu rectangle. 155 * 156 * @param tbsmenu Start menu 140 157 * @param rect Rectangle 141 158 */ … … 170 187 } 171 188 172 /** Remove entry from window list.173 * 174 * @param tbsmenu Window list175 * @param entry Window listentry176 * @param paint @c true to repaint window list189 /** Remove entry from strat menu. 190 * 191 * @param tbsmenu Start menu 192 * @param entry Start menu entry 193 * @param paint @c true to repaint start menu 177 194 * @return @c EOK on success or an error code 178 195 */ -
uspace/app/taskbar/tbsmenu.h
r4d58bac r7d78e466 47 47 48 48 extern errno_t tbsmenu_create(ui_window_t *, ui_fixed_t *, tbsmenu_t **); 49 extern errno_t tbsmenu_load(tbsmenu_t *, const char *); 49 50 extern void tbsmenu_set_rect(tbsmenu_t *, gfx_rect_t *); 50 51 extern void tbsmenu_destroy(tbsmenu_t *); -
uspace/lib/meson.build
r4d58bac r7d78e466 80 80 'scsi', 81 81 'sif', 82 'startmenu', 82 83 'trackmod', 83 84 'untar',
Note:
See TracChangeset
for help on using the changeset viewer.