Changes in uspace/lib/display/src/display.c [06176e1:35cffea] in mainline
- File:
-
- 1 edited
-
uspace/lib/display/src/display.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/display/src/display.c
r06176e1 r35cffea 38 38 #include <mem.h> 39 39 #include <stdlib.h> 40 #include <str.h>41 40 #include "../private/display.h" 42 41 #include "../private/params.h" … … 148 147 { 149 148 memset(params, 0, sizeof(*params)); 150 params->caption = "";151 149 } 152 150 … … 164 162 { 165 163 display_window_t *window; 166 display_wnd_params_enc_t eparams; 167 async_exch_t *exch; 168 aid_t req; 169 ipc_call_t answer; 170 errno_t rc; 171 172 /* Encode the parameters for transport */ 173 eparams.rect = params->rect; 174 eparams.caption_size = str_size(params->caption); 175 eparams.min_size = params->min_size; 176 eparams.pos = params->pos; 177 eparams.flags = params->flags; 164 async_exch_t *exch; 165 aid_t req; 166 ipc_call_t answer; 167 errno_t rc; 178 168 179 169 window = calloc(1, sizeof(display_window_t)); … … 183 173 exch = async_exchange_begin(display->sess); 184 174 req = async_send_0(exch, DISPLAY_WINDOW_CREATE, &answer); 185 186 /* Write fixed fields */ 187 rc = async_data_write_start(exch, &eparams, 188 sizeof (display_wnd_params_enc_t)); 189 if (rc != EOK) { 190 async_exchange_end(exch); 191 async_forget(req); 192 free(window); 193 return rc; 194 } 195 196 /* Write caption */ 197 rc = async_data_write_start(exch, params->caption, 198 eparams.caption_size); 175 rc = async_data_write_start(exch, params, sizeof (display_wnd_params_t)); 199 176 async_exchange_end(exch); 200 177 if (rc != EOK) { … … 510 487 } 511 488 512 /** Minimize window.513 *514 * @param window Window515 * @return EOK on success or an error code516 */517 errno_t display_window_minimize(display_window_t *window)518 {519 async_exch_t *exch;520 errno_t rc;521 522 exch = async_exchange_begin(window->display->sess);523 rc = async_req_1_0(exch, DISPLAY_WINDOW_MINIMIZE, window->id);524 async_exchange_end(exch);525 526 return rc;527 }528 529 489 /** Maximize window. 530 490 * … … 580 540 cursor); 581 541 async_exchange_end(exch); 582 return rc;583 }584 585 /** Set display window caption.586 *587 * @param window Window588 * @param caption New caption589 * @return EOK on success or an error code590 */591 errno_t display_window_set_caption(display_window_t *window,592 const char *caption)593 {594 async_exch_t *exch;595 aid_t req;596 ipc_call_t answer;597 size_t cap_size;598 errno_t rc;599 600 cap_size = str_size(caption);601 602 exch = async_exchange_begin(window->display->sess);603 req = async_send_1(exch, DISPLAY_WINDOW_SET_CAPTION, window->id,604 &answer);605 606 /* Write caption */607 rc = async_data_write_start(exch, caption, cap_size);608 async_exchange_end(exch);609 if (rc != EOK) {610 async_forget(req);611 return rc;612 }613 614 async_wait_for(req, &rc);615 542 return rc; 616 543 }
Note:
See TracChangeset
for help on using the changeset viewer.
