Subversion Repositories HelenOS

Rev

Rev 2927 | Rev 4337 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2927 Rev 3674
Line 248... Line 248...
248
 * @param dx Delta X of mouse move
248
 * @param dx Delta X of mouse move
249
 * @param dy Delta Y of mouse move
249
 * @param dy Delta Y of mouse move
250
 */
250
 */
251
void gcons_mouse_move(int dx, int dy)
251
void gcons_mouse_move(int dx, int dy)
252
{
252
{
253
    mouse_x = limit(mouse_x+dx, 0, xres);
253
    mouse_x = limit(mouse_x + dx, 0, xres);
254
    mouse_y = limit(mouse_y+dy, 0, yres);
254
    mouse_y = limit(mouse_y + dy, 0, yres);
255
 
255
 
256
    async_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y);
256
    async_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y);
257
}
257
}
258
 
258
 
259
static int gcons_find_conbut(int x, int y)
259
static int gcons_find_conbut(int x, int y)
260
{
260
{
261
    int status_start = STATUS_START + (xres - 800) / 2;;
261
    int status_start = STATUS_START + (xres - 800) / 2;
262
 
262
 
263
    if (y < STATUS_TOP || y >= STATUS_TOP + STATUS_HEIGHT)
263
    if (y < STATUS_TOP || y >= STATUS_TOP + STATUS_HEIGHT)
264
        return -1;
264
        return -1;
265
   
265
   
266
    if (x < status_start)
266
    if (x < status_start)
267
        return -1;
267
        return -1;
268
   
268
   
269
    if (x >= status_start + (STATUS_WIDTH + STATUS_SPACE) * CONSOLE_COUNT)
269
    if (x >= status_start + (STATUS_WIDTH + STATUS_SPACE) * CONSOLE_COUNT)
270
        return -1;
270
        return -1;
271
    if (((x - status_start) % (STATUS_WIDTH+STATUS_SPACE)) < STATUS_SPACE)
271
    if (((x - status_start) % (STATUS_WIDTH + STATUS_SPACE)) < STATUS_SPACE)
272
        return -1;
272
        return -1;
273
   
273
   
274
    return (x - status_start) / (STATUS_WIDTH+STATUS_SPACE);
274
    return (x - status_start) / (STATUS_WIDTH + STATUS_SPACE);
275
}
275
}
276
 
276
 
277
/** Handle mouse click
277
/** Handle mouse click
278
 *
278
 *
279
 * @param state New state (1-pressed, 0-depressed)
279
 * @param state New state (1-pressed, 0-depressed)