src/video/nanox/SDL_nxmouse.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 06 Jan 2006 13:20:10 +0000
changeset 1234 73676c1f56ee
parent 769 b8d311d90021
child 1338 604d73db6802
permissions -rw-r--r--
For sanity's sake, removed the '&' when passing copy_row array to asm.
slouken@30
     1
/*
slouken@30
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@30
     4
    Copyright (C) 2001  Hsieh-Fu Tsai
slouken@30
     5
slouken@30
     6
    This library is free software; you can redistribute it and/or
slouken@30
     7
    modify it under the terms of the GNU Library General Public
slouken@30
     8
    License as published by the Free Software Foundation; either
slouken@30
     9
    version 2 of the License, or (at your option) any later version.
slouken@30
    10
slouken@30
    11
    This library is distributed in the hope that it will be useful,
slouken@30
    12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@30
    13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@30
    14
    Library General Public License for more details.
slouken@30
    15
slouken@30
    16
    You should have received a copy of the GNU Library General Public
slouken@30
    17
    License along with this library; if not, write to the Free
slouken@30
    18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@30
    19
slouken@30
    20
    Sam Lantinga
slouken@252
    21
    slouken@libsdl.org
slouken@30
    22
    
slouken@30
    23
    Hsieh-Fu Tsai
slouken@30
    24
    clare@setabox.com
slouken@30
    25
*/
slouken@30
    26
slouken@30
    27
#include <stdlib.h>
slouken@30
    28
slouken@30
    29
#include "SDL_error.h"
slouken@30
    30
#include "SDL_events_c.h"
slouken@30
    31
slouken@30
    32
#include "SDL_nxmouse_c.h"
slouken@30
    33
slouken@30
    34
// The implementation dependent data for the window manager cursor
slouken@30
    35
struct WMcursor {
slouken@30
    36
    int unused ;
slouken@30
    37
} ;
slouken@30
    38
slouken@30
    39
WMcursor * NX_CreateWMCursor (_THIS,
slouken@30
    40
        Uint8 * data, Uint8 * mask, int w, int h, int hot_x, int hot_y)
slouken@30
    41
{
slouken@30
    42
    WMcursor * cursor ;
slouken@30
    43
slouken@30
    44
    Dprintf ("enter NX_CreateWMCursor\n") ;
slouken@30
    45
slouken@30
    46
    cursor = (WMcursor *) malloc (sizeof (WMcursor)) ;
slouken@30
    47
    if (cursor == NULL) {
slouken@30
    48
        SDL_OutOfMemory () ;
slouken@30
    49
        return NULL ;
slouken@30
    50
    }
slouken@30
    51
slouken@30
    52
    Dprintf ("leave NX_CreateWMCursor\n") ;
slouken@30
    53
    return cursor ;
slouken@30
    54
}
slouken@30
    55
slouken@30
    56
void NX_FreeWMCursor (_THIS, WMcursor * cursor)
slouken@30
    57
{
slouken@30
    58
    Dprintf ("NX_FreeWMCursor\n") ;
slouken@30
    59
    free (cursor) ;
slouken@30
    60
    return ;
slouken@30
    61
}
slouken@30
    62
slouken@30
    63
void NX_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
slouken@30
    64
{
slouken@30
    65
    GR_WINDOW_INFO info ;
slouken@30
    66
slouken@30
    67
    Dprintf ("enter NX_WarpWMCursor\n") ;
slouken@30
    68
    SDL_Lock_EventThread () ;
slouken@30
    69
    
slouken@30
    70
    GrGetWindowInfo (SDL_Window, & info) ;
slouken@30
    71
    GrMoveCursor (info.x + x, info.y + y) ;
slouken@30
    72
slouken@30
    73
    SDL_Unlock_EventThread () ;
slouken@30
    74
    Dprintf ("leave NX_WarpWMCursor\n") ;
slouken@30
    75
}
slouken@30
    76
slouken@30
    77
int NX_ShowWMCursor (_THIS, WMcursor * cursor)
slouken@30
    78
{
slouken@30
    79
    Dprintf ("NX_ShowWMCursor\n") ;
slouken@30
    80
    return 1 ;
slouken@30
    81
}