Changeset ba02baa in mainline
- Timestamp:
- 2014-01-16T17:23:30Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 62fbb7e
- Parents:
- dace86a
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/window.c
rdace86a rba02baa 592 592 const char *caption, sysarg_t x_offset, sysarg_t y_offset) 593 593 { 594 int rc;595 596 594 window_t *win = (window_t *) malloc(sizeof(window_t)); 597 if (!win) {595 if (!win) 598 596 return NULL; 599 } 600 597 601 598 win->is_main = is_main; 602 599 win->is_decorated = is_decorated; … … 604 601 prodcons_initialize(&win->events); 605 602 fibril_mutex_initialize(&win->guard); 603 606 604 widget_init(&win->root, NULL); 607 605 win->root.window = win; … … 615 613 win->focus = NULL; 616 614 win->surface = NULL; 617 615 618 616 service_id_t reg_dsid; 619 async_sess_t *reg_sess; 620 621 rc = loc_service_get_id(winreg, ®_dsid, 0); 617 int rc = loc_service_get_id(winreg, ®_dsid, 0); 622 618 if (rc != EOK) { 623 619 free(win); 624 620 return NULL; 625 621 } 626 627 reg_sess = loc_service_connect(EXCHANGE_SERIALIZE, reg_dsid, 0); 622 623 async_sess_t *reg_sess = loc_service_connect(EXCHANGE_SERIALIZE, 624 reg_dsid, 0); 628 625 if (reg_sess == NULL) { 629 626 free(win); 630 627 return NULL; 631 628 } 632 629 633 630 service_id_t in_dsid; 634 631 service_id_t out_dsid; 635 636 632 rc = win_register(reg_sess, &in_dsid, &out_dsid, x_offset, y_offset); 637 633 async_hangup(reg_sess); … … 640 636 return NULL; 641 637 } 642 638 643 639 win->osess = loc_service_connect(EXCHANGE_SERIALIZE, out_dsid, 0); 644 640 if (win->osess == NULL) { … … 646 642 return NULL; 647 643 } 648 644 649 645 win->isess = loc_service_connect(EXCHANGE_SERIALIZE, in_dsid, 0); 650 646 if (win->isess == NULL) { … … 653 649 return NULL; 654 650 } 655 656 if (caption == NULL) {651 652 if (caption == NULL) 657 653 win->caption = NULL; 658 } else {654 else 659 655 win->caption = str_dup(caption); 660 } 661 656 662 657 return win; 663 658 } -
uspace/srv/hid/compositor/compositor.c
rdace86a rba02baa 161 161 static void input_disconnect(void); 162 162 163 164 163 static pointer_t *input_pointer(input_t *input) 165 164 { … … 170 169 { 171 170 pointer_t *p = (pointer_t *) malloc(sizeof(pointer_t)); 172 if (!p) {171 if (!p) 173 172 return NULL; 174 } 175 173 176 174 link_initialize(&p->link); 177 175 p->pos.x = coord_origin; … … 185 183 p->state = 0; 186 184 cursor_init(&p->cursor, CURSOR_DECODER_EMBEDDED, NULL); 187 185 188 186 /* Ghost window for transformation animation. */ 189 187 transform_identity(&p->ghost.transform); … … 198 196 p->accum_ghost.x = 0; 199 197 p->accum_ghost.y = 0; 200 198 201 199 return p; 202 200 } … … 213 211 { 214 212 window_t *win = (window_t *) malloc(sizeof(window_t)); 215 if (!win) {213 if (!win) 216 214 return NULL; 217 } 218 215 219 216 link_initialize(&win->link); 220 217 atomic_set(&win->ref_cnt, 0); 221 218 prodcons_initialize(&win->queue); 222 219 transform_identity(&win->transform); 223 transform_translate(&win->transform, 220 transform_translate(&win->transform, 224 221 coord_origin + x_offset, coord_origin + y_offset); 225 222 win->dx = coord_origin + x_offset; … … 230 227 win->opacity = 255; 231 228 win->surface = NULL; 232 229 233 230 return win; 234 231 } … … 707 704 { 708 705 fibril_mutex_lock(&window_list_mtx); 709 706 710 707 list_foreach(window_list, link, window_t, window) { 711 708 if (window == target) { … … 715 712 } 716 713 } 717 714 718 715 fibril_mutex_unlock(&window_list_mtx); 719 716 free(event); … … 723 720 { 724 721 fibril_mutex_lock(&window_list_mtx); 722 725 723 window_t *win = (window_t *) list_first(&window_list); 726 if (win) {724 if (win) 727 725 prodcons_produce(&win->queue, &event->link); 728 } else {726 else 729 727 free(event); 730 }728 731 729 fibril_mutex_unlock(&window_list_mtx); 732 730 } … … 1182 1180 transform_identity(&translate); 1183 1181 transform_translate(&translate, win->dx, win->dy); 1184 1182 1185 1183 transform_t scale; 1186 1184 transform_identity(&scale); 1187 if ( win->fx != 1 || win->fy != 1) {1185 if ((win->fx != 1) || (win->fy != 1)) 1188 1186 transform_scale(&scale, win->fx, win->fy); 1189 } 1190 1187 1191 1188 transform_t rotate; 1192 1189 transform_identity(&rotate); 1193 if (win->angle != 0) {1190 if (win->angle != 0) 1194 1191 transform_rotate(&rotate, win->angle); 1195 } 1196 1192 1197 1193 transform_t transform; 1198 1194 transform_t temp; … … 1205 1201 transform_multiply(&transform, &temp, &scale); 1206 1202 1207 1208 1203 win->transform = transform; 1209 1204 } … … 1268 1263 if (fx > 0) { 1269 1264 #if ANIMATE_WINDOW_TRANSFORMS == 0 1270 if (scale) win->fx *= fx; 1265 if (scale) 1266 win->fx *= fx; 1271 1267 #endif 1272 1268 #if ANIMATE_WINDOW_TRANSFORMS == 1
Note:
See TracChangeset
for help on using the changeset viewer.