Changeset dace86a in mainline


Ignore:
Timestamp:
2014-01-16T17:02:31Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba02baa
Parents:
8bb0f5d6
Message:

cstyle (no change in functionality)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/compositor/compositor.c

    r8bb0f5d6 rdace86a  
    293293    sysarg_t *x_out, sysarg_t *y_out, sysarg_t *w_out, sysarg_t *h_out)
    294294{
    295         if (w_in > 0 && h_in > 0) {
     295        if ((w_in > 0) && (h_in > 0)) {
    296296                sysarg_t x[4];
    297297                sysarg_t y[4];
     298               
    298299                comp_coord_from_client(x_in, y_in, win_trans, &x[0], &y[0]);
    299300                comp_coord_from_client(x_in + w_in - 1, y_in, win_trans, &x[1], &y[1]);
    300301                comp_coord_from_client(x_in + w_in - 1, y_in + h_in - 1, win_trans, &x[2], &y[2]);
    301302                comp_coord_from_client(x_in, y_in + h_in - 1, win_trans, &x[3], &y[3]);
     303               
    302304                (*x_out) = x[0];
    303305                (*y_out) = y[0];
    304306                (*w_out) = x[0];
    305307                (*h_out) = y[0];
    306                 for (int i = 1; i < 4; ++i) {
     308               
     309                for (unsigned int i = 1; i < 4; ++i) {
    307310                        (*x_out) = (x[i] < (*x_out)) ? x[i] : (*x_out);
    308311                        (*y_out) = (y[i] < (*y_out)) ? y[i] : (*y_out);
     
    310313                        (*h_out) = (y[i] > (*h_out)) ? y[i] : (*h_out);
    311314                }
     315               
    312316                (*w_out) = (*w_out) - (*x_out) + 1;
    313317                (*h_out) = (*h_out) - (*y_out) + 1;
     
    643647static void comp_window_resize(window_t *win, ipc_callid_t iid, ipc_call_t *icall)
    644648{
    645         int rc;
    646 
    647649        ipc_callid_t callid;
    648650        size_t size;
    649651        unsigned int flags;
    650 
     652       
    651653        /* Start sharing resized window with client. */
    652654        if (!async_share_out_receive(&callid, &size, &flags)) {
     
    654656                return;
    655657        }
     658       
    656659        void *new_cell_storage;
    657         rc = async_share_out_finalize(callid, &new_cell_storage);
     660        int rc = async_share_out_finalize(callid, &new_cell_storage);
    658661        if ((rc != EOK) || (new_cell_storage == AS_MAP_FAILED)) {
    659662                async_answer_0(iid, ENOMEM);
    660663                return;
    661664        }
    662 
     665       
    663666        /* Create new surface for the resized window. */
    664         surface_t *new_surface = surface_create(
    665             IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall),
    666             new_cell_storage, SURFACE_FLAG_SHARED);
     667        surface_t *new_surface = surface_create(IPC_GET_ARG1(*icall),
     668            IPC_GET_ARG2(*icall), new_cell_storage, SURFACE_FLAG_SHARED);
    667669        if (!new_surface) {
    668670                as_area_destroy(new_cell_storage);
     
    670672                return;
    671673        }
    672 
     674       
    673675        /* Switch new surface with old surface and calculate damage. */
    674676        fibril_mutex_lock(&window_list_mtx);
    675 
     677       
    676678        sysarg_t old_width = 0;
    677679        sysarg_t old_height = 0;
     680       
    678681        if (win->surface) {
    679682                surface_get_resolution(win->surface, &old_width, &old_height);
    680683                surface_destroy(win->surface);
    681684        }
    682 
     685       
    683686        win->surface = new_surface;
    684 
     687       
    685688        sysarg_t new_width = 0;
    686689        sysarg_t new_height = 0;
    687690        surface_get_resolution(win->surface, &new_width, &new_height);
    688 
    689         sysarg_t x, y;
     691       
     692        sysarg_t x;
     693        sysarg_t y;
    690694        sysarg_t width = old_width > new_width ? old_width : new_width;
    691695        sysarg_t height = old_height > new_height ? old_height : new_height;
    692         comp_coord_bounding_rect(0, 0, width, height, win->transform, &x, &y, &width, &height);
    693 
     696        comp_coord_bounding_rect(0, 0, width, height, win->transform, &x, &y,
     697            &width, &height);
     698       
    694699        fibril_mutex_unlock(&window_list_mtx);
    695 
     700       
    696701        comp_damage(x, y, width, height);
    697 
     702       
    698703        async_answer_0(iid, EOK);
    699704}
     
    12251230                double cx = 0;
    12261231                double cy = 0;
    1227                 if (pointer->grab_flags & GF_MOVE_X) {
     1232               
     1233                if (pointer->grab_flags & GF_MOVE_X)
    12281234                        cx = 1;
    1229                 }
    1230                 if (pointer->grab_flags & GF_MOVE_Y) {
     1235               
     1236                if (pointer->grab_flags & GF_MOVE_Y)
    12311237                        cy = 1;
    1232                 }
    1233 
    1234                 if ((scale || resize) && (win->angle != 0)) {
     1238               
     1239                if (((scale) || (resize)) && (win->angle != 0)) {
    12351240                        transform_t rotate;
    12361241                        transform_identity(&rotate);
     1242                       
    12371243                        transform_rotate(&rotate, win->angle);
    12381244                        transform_apply_linear(&rotate, &cx, &cy);
    12391245                }
    12401246               
    1241                 cx = (cx < 0) ? (-1 * cx) : cx; 
     1247                cx = (cx < 0) ? (-1 * cx) : cx;
    12421248                cy = (cy < 0) ? (-1 * cy) : cy;
    1243 
     1249               
    12441250                win->dx += (cx * dx);
    12451251                win->dy += (cy * dy);
Note: See TracChangeset for help on using the changeset viewer.