Changeset ba02baa in mainline


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

cstyle (no change in functionality)

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gui/window.c

    rdace86a rba02baa  
    592592    const char *caption, sysarg_t x_offset, sysarg_t y_offset)
    593593{
    594         int rc;
    595 
    596594        window_t *win = (window_t *) malloc(sizeof(window_t));
    597         if (!win) {
     595        if (!win)
    598596                return NULL;
    599         }
    600 
     597       
    601598        win->is_main = is_main;
    602599        win->is_decorated = is_decorated;
     
    604601        prodcons_initialize(&win->events);
    605602        fibril_mutex_initialize(&win->guard);
     603       
    606604        widget_init(&win->root, NULL);
    607605        win->root.window = win;
     
    615613        win->focus = NULL;
    616614        win->surface = NULL;
    617 
     615       
    618616        service_id_t reg_dsid;
    619         async_sess_t *reg_sess;
    620 
    621         rc = loc_service_get_id(winreg, &reg_dsid, 0);
     617        int rc = loc_service_get_id(winreg, &reg_dsid, 0);
    622618        if (rc != EOK) {
    623619                free(win);
    624620                return NULL;
    625621        }
    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);
    628625        if (reg_sess == NULL) {
    629626                free(win);
    630627                return NULL;
    631628        }
    632 
     629       
    633630        service_id_t in_dsid;
    634631        service_id_t out_dsid;
    635        
    636632        rc = win_register(reg_sess, &in_dsid, &out_dsid, x_offset, y_offset);
    637633        async_hangup(reg_sess);
     
    640636                return NULL;
    641637        }
    642 
     638       
    643639        win->osess = loc_service_connect(EXCHANGE_SERIALIZE, out_dsid, 0);
    644640        if (win->osess == NULL) {
     
    646642                return NULL;
    647643        }
    648 
     644       
    649645        win->isess = loc_service_connect(EXCHANGE_SERIALIZE, in_dsid, 0);
    650646        if (win->isess == NULL) {
     
    653649                return NULL;
    654650        }
    655 
    656         if (caption == NULL) {
     651       
     652        if (caption == NULL)
    657653                win->caption = NULL;
    658         } else {
     654        else
    659655                win->caption = str_dup(caption);
    660         }
    661 
     656       
    662657        return win;
    663658}
  • uspace/srv/hid/compositor/compositor.c

    rdace86a rba02baa  
    161161static void input_disconnect(void);
    162162
    163 
    164163static pointer_t *input_pointer(input_t *input)
    165164{
     
    170169{
    171170        pointer_t *p = (pointer_t *) malloc(sizeof(pointer_t));
    172         if (!p) {
     171        if (!p)
    173172                return NULL;
    174         }
    175 
     173       
    176174        link_initialize(&p->link);
    177175        p->pos.x = coord_origin;
     
    185183        p->state = 0;
    186184        cursor_init(&p->cursor, CURSOR_DECODER_EMBEDDED, NULL);
    187 
     185       
    188186        /* Ghost window for transformation animation. */
    189187        transform_identity(&p->ghost.transform);
     
    198196        p->accum_ghost.x = 0;
    199197        p->accum_ghost.y = 0;
    200 
     198       
    201199        return p;
    202200}
     
    213211{
    214212        window_t *win = (window_t *) malloc(sizeof(window_t));
    215         if (!win) {
     213        if (!win)
    216214                return NULL;
    217         }
    218 
     215       
    219216        link_initialize(&win->link);
    220217        atomic_set(&win->ref_cnt, 0);
    221218        prodcons_initialize(&win->queue);
    222219        transform_identity(&win->transform);
    223         transform_translate(&win->transform, 
     220        transform_translate(&win->transform,
    224221            coord_origin + x_offset, coord_origin + y_offset);
    225222        win->dx = coord_origin + x_offset;
     
    230227        win->opacity = 255;
    231228        win->surface = NULL;
    232 
     229       
    233230        return win;
    234231}
     
    707704{
    708705        fibril_mutex_lock(&window_list_mtx);
    709 
     706       
    710707        list_foreach(window_list, link, window_t, window) {
    711708                if (window == target) {
     
    715712                }
    716713        }
    717 
     714       
    718715        fibril_mutex_unlock(&window_list_mtx);
    719716        free(event);
     
    723720{
    724721        fibril_mutex_lock(&window_list_mtx);
     722       
    725723        window_t *win = (window_t *) list_first(&window_list);
    726         if (win) {
     724        if (win)
    727725                prodcons_produce(&win->queue, &event->link);
    728         } else {
     726        else
    729727                free(event);
    730         }
     728       
    731729        fibril_mutex_unlock(&window_list_mtx);
    732730}
     
    11821180        transform_identity(&translate);
    11831181        transform_translate(&translate, win->dx, win->dy);
    1184 
     1182       
    11851183        transform_t scale;
    11861184        transform_identity(&scale);
    1187         if (win->fx != 1 || win->fy != 1) {
     1185        if ((win->fx != 1) || (win->fy != 1))
    11881186                transform_scale(&scale, win->fx, win->fy);
    1189         }
    1190 
     1187       
    11911188        transform_t rotate;
    11921189        transform_identity(&rotate);
    1193         if (win->angle != 0) {
     1190        if (win->angle != 0)
    11941191                transform_rotate(&rotate, win->angle);
    1195         }
    1196 
     1192       
    11971193        transform_t transform;
    11981194        transform_t temp;
     
    12051201        transform_multiply(&transform, &temp, &scale);
    12061202       
    1207 
    12081203        win->transform = transform;
    12091204}
     
    12681263                        if (fx > 0) {
    12691264#if ANIMATE_WINDOW_TRANSFORMS == 0
    1270                                 if (scale) win->fx *= fx;
     1265                                if (scale)
     1266                                        win->fx *= fx;
    12711267#endif
    12721268#if ANIMATE_WINDOW_TRANSFORMS == 1
Note: See TracChangeset for help on using the changeset viewer.