Ignore:
Timestamp:
Mar 8, 2006, 12:27:23 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Cosmetic changes here and there.
Location:
libcaca/trunk/caca
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.c

    r550 r551  
    8080    kk->lastticks = 0;
    8181
    82     kk->mouse_x = kk->qq->width / 2;
    83     kk->mouse_y = kk->qq->height / 2;
     82    kk->mouse.x = kk->qq->width / 2;
     83    kk->mouse.y = kk->qq->height / 2;
    8484
    8585    kk->resize = 0;
  • libcaca/trunk/caca/caca_internals.h

    r550 r551  
    8787struct caca_context
    8888{
     89    /* A link to our cucul canvas */
    8990    cucul_t *qq;
    9091
     92    /* Device-specific functions */
    9193    struct drv
    9294    {
     
    104106    } drv;
    105107
    106     //unsigned int width, height;
    107     unsigned int mouse_x, mouse_y;
     108    /* Mouse position */
     109    struct mouse
     110    {
     111        unsigned int x, y;
     112    } mouse;
    108113
     114    /* Window resize handling */
    109115    int resize;
    110116    int resize_event;
    111117
     118    /* Framerate handling */
    112119    unsigned int delay, rendertime;
    113120    struct caca_timer timer;
  • libcaca/trunk/caca/driver_gl.c

    r550 r551  
    332332            kk->drv.p->mouse_clicked = 0;
    333333        }
    334         kk->mouse_x = kk->drv.p->mouse_x;
    335         kk->mouse_y = kk->drv.p->mouse_y;
    336         event |= CACA_EVENT_MOUSE_MOTION | (kk->mouse_x << 12) | kk->mouse_y;
     334        kk->mouse.x = kk->drv.p->mouse_x;
     335        kk->mouse.y = kk->drv.p->mouse_y;
     336        event |= CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y;
    337337        kk->drv.p->mouse_changed = 0;
    338338    }
  • libcaca/trunk/caca/driver_ncurses.c

    r550 r551  
    361361        }
    362362
    363         if(kk->mouse_x == (unsigned int)mevent.x &&
    364            kk->mouse_y == (unsigned int)mevent.y)
     363        if(kk->mouse.x == (unsigned int)mevent.x &&
     364           kk->mouse.y == (unsigned int)mevent.y)
    365365            return _pop_event(kk);
    366366
    367         kk->mouse_x = mevent.x;
    368         kk->mouse_y = mevent.y;
    369 
    370         return CACA_EVENT_MOUSE_MOTION | (kk->mouse_x << 12) | kk->mouse_y;
     367        kk->mouse.x = mevent.x;
     368        kk->mouse.y = mevent.y;
     369
     370        return CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y;
    371371    }
    372372
  • libcaca/trunk/caca/driver_slang.c

    r550 r551  
    288288        _push_event(kk, CACA_EVENT_MOUSE_RELEASE | button);
    289289
    290         if(kk->mouse_x == x && kk->mouse_y == y)
     290        if(kk->mouse.x == x && kk->mouse.y == y)
    291291            return _pop_event(kk);
    292292
    293         kk->mouse_x = x;
    294         kk->mouse_y = y;
    295 
    296         return CACA_EVENT_MOUSE_MOTION | (kk->mouse_x << 12) | kk->mouse_y;
     293        kk->mouse.x = x;
     294        kk->mouse.y = y;
     295
     296        return CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y;
    297297    }
    298298
  • libcaca/trunk/caca/driver_win32.c

    r550 r551  
    262262                COORD pos = rec.Event.MouseEvent.dwMousePosition;
    263263
    264                 if(kk->mouse_x == (unsigned int)pos.X &&
    265                    kk->mouse_y == (unsigned int)pos.Y)
     264                if(kk->mouse.x == (unsigned int)pos.X &&
     265                   kk->mouse.y == (unsigned int)pos.Y)
    266266                    continue;
    267267
    268                 kk->mouse_x = pos.X;
    269                 kk->mouse_y = pos.Y;
    270 
    271                 return CACA_EVENT_MOUSE_MOTION | (kk->mouse_x << 12) | kk->mouse_y;
     268                kk->mouse.x = pos.X;
     269                kk->mouse.y = pos.Y;
     270
     271                return CACA_EVENT_MOUSE_MOTION
     272                        | (kk->mouse.x << 12) | kk->mouse.y;
    272273            }
    273274#if 0
  • libcaca/trunk/caca/driver_x11.c

    r550 r551  
    388388                newy = kk->qq->height - 1;
    389389
    390             if(kk->mouse_x == newx && kk->mouse_y == newy)
     390            if(kk->mouse.x == newx && kk->mouse.y == newy)
    391391                continue;
    392392
    393             kk->mouse_x = newx;
    394             kk->mouse_y = newy;
    395 
    396             return CACA_EVENT_MOUSE_MOTION | (kk->mouse_x << 12) | kk->mouse_y;
     393            kk->mouse.x = newx;
     394            kk->mouse.y = newy;
     395
     396            return CACA_EVENT_MOUSE_MOTION | (kk->mouse.x << 12) | kk->mouse.y;
    397397        }
    398398
  • libcaca/trunk/caca/event.c

    r550 r551  
    104104unsigned int caca_get_mouse_x(caca_t *kk)
    105105{
    106     if(kk->mouse_x >= kk->qq->width)
    107         kk->mouse_x = kk->qq->width - 1;
    108 
    109     return kk->mouse_x;
     106    if(kk->mouse.x >= kk->qq->width)
     107        kk->mouse.x = kk->qq->width - 1;
     108
     109    return kk->mouse.x;
    110110}
    111111
     
    121121unsigned int caca_get_mouse_y(caca_t *kk)
    122122{
    123     if(kk->mouse_y >= kk->qq->height)
    124         kk->mouse_y = kk->qq->height - 1;
    125 
    126     return kk->mouse_y;
     123    if(kk->mouse.y >= kk->qq->height)
     124        kk->mouse.y = kk->qq->height - 1;
     125
     126    return kk->mouse.y;
    127127}
    128128
Note: See TracChangeset for help on using the changeset viewer.