Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Work in progress. :)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 7, 2006
1 parent 611acc9 commit a7e7b31
Show file tree
Hide file tree
Showing 19 changed files with 2,369 additions and 1,611 deletions.
31 changes: 23 additions & 8 deletions Makefile.in
Expand Up @@ -125,14 +125,6 @@ uninstall-man:
rm -f $(mandir)/man3/$$file; \
done

indent:
cd $(srcdir) && \
find . \( \
-name '*.h' -o \
-name '*.c' -o \
-name '*.cc' \) \
-exec indent {} \;

clean:
rm -rf $(objects)
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
Expand Down Expand Up @@ -173,6 +165,29 @@ dist $(distfile):
rpm: $(distfile)
rpmbuild -ta $?

# Run indent on the source to standardize coding style
indent:
@echo "Running indent... modified files:"
@cd $(srcdir) && \
find . \( \
-name '*.h' -o \
-name '*.c' -o \
-name '*.cc' \) \
-print | \
while read file; do \
indent "$$file" -o "$$file.indent"; \
if cmp "$$file" "$$file.indent" >/dev/null; then \
rm -f "$$file.indent"; \
else \
echo "$$file"; \
mv -f "$$file.indent" "$$file"; \
fi; \
done

# Run indent and then commit modified files
commit: indent
svn commit

# Create a SVN snapshot that people can run update on
snapshot:
svn co svn://libsdl.org/trunk/SDL
Expand Down
64 changes: 48 additions & 16 deletions include/SDL_compat.h
Expand Up @@ -36,22 +36,18 @@ extern "C" {
/* *INDENT-ON* */
#endif

#define SDL_SWSURFACE 0x00000000
#define SDL_HWSURFACE 0x00000001
#define SDL_ASYNCBLIT 0x00000004
#define SDL_ANYFORMAT 0x10000000
#define SDL_HWPALETTE 0x20000000
#define SDL_DOUBLEBUF 0x40000000
#define SDL_FULLSCREEN 0x80000000
#define SDL_OPENGL 0x00000002
#define SDL_INTERNALOPENGL 0x00000008
#define SDL_RESIZABLE 0x00000010
#define SDL_NOFRAME 0x00000020
#define SDL_HWACCEL 0x00000100
#define SDL_SRCCOLORKEY 0x00001000
#define SDL_RLEACCELOK 0x00002000
#define SDL_RLEACCEL 0x00004000
#define SDL_SRCALPHA 0x00010000
#define SDL_SWSURFACE 0x00000000
#define SDL_ANYFORMAT 0x00100000
#define SDL_HWPALETTE 0x00200000
#define SDL_DOUBLEBUF 0x00400000
#define SDL_FULLSCREEN 0x00800000
#define SDL_RESIZABLE 0x01000000
#define SDL_NOFRAME 0x02000000
#define SDL_OPENGL 0x04000000
#define SDL_ASYNCBLIT 0x00000000
#define SDL_HWACCEL 0x00000000
#define SDL_SCREEN_SURFACE 0x10000000 /* Surface is a window screen surface */
#define SDL_SHADOW_SURFACE 0x20000000 /* Surface is a window shadow surface */

#define SDL_APPMOUSEFOCUS 0x01
#define SDL_APPINPUTFOCUS 0x02
Expand All @@ -64,23 +60,53 @@ extern "C" {
#define SDL_VIDEORESIZE SDL_EVENT_RESERVED2
#define SDL_VIDEOEXPOSE SDL_EVENT_RESERVED3

typedef struct SDL_VideoInfo
{
Uint32 hw_available:1;
Uint32 wm_available:1;
Uint32 UnusedBits1:6;
Uint32 UnusedBits2:1;
Uint32 blit_hw:1;
Uint32 blit_hw_CC:1;
Uint32 blit_hw_A:1;
Uint32 blit_sw:1;
Uint32 blit_sw_CC:1;
Uint32 blit_sw_A:1;
Uint32 blit_fill:1;
Uint32 UnusedBits3:16;
Uint32 video_mem;

SDL_PixelFormat *vfmt;
} SDL_VideoInfo;

typedef enum
{
SDL_GRAB_QUERY = -1,
SDL_GRAB_OFF = 0,
SDL_GRAB_ON = 1
} SDL_GrabMode;

#define SDL_AllocSurface SDL_CreateRGBSurface

extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
extern DECLSPEC char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
extern DECLSPEC char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp,
Uint32 flags);
extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(SDL_PixelFormat * format,
Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width, int height,
int bpp, Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface(void);
extern DECLSPEC void SDLCALL SDL_UpdateRects(SDL_Surface * screen,
int numrects, SDL_Rect * rects);
extern DECLSPEC void SDLCALL SDL_UpdateRect(SDL_Surface * screen, Sint32 x,
Sint32 y, Uint32 w, Uint32 h);
extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface * screen);
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormat(SDL_Surface * surface);
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *
surface);
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title,
const char *icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
Expand All @@ -92,6 +118,9 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface, int flags,
SDL_Color * colors,
int firstcolor, int ncolors);
extern DECLSPEC int SDLCALL SDL_SetScreenColors(SDL_Surface * screen,
SDL_Color * colors,
int firstcolor, int ncolors);
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo * info);

/* Ends C function definitions when using C++ */
Expand All @@ -103,3 +132,6 @@ extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo * info);
#include "close_code.h"

#endif /* _SDL_compat_h */

/* vi: set ts=4 sw=4 expandtab: */
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
64 changes: 49 additions & 15 deletions include/SDL_mouse.h
Expand Up @@ -41,38 +41,72 @@ extern "C" {
/* *INDENT-ON* */
#endif

typedef struct WMcursor WMcursor; /* Implementation dependent */
typedef struct SDL_Cursor
{
SDL_Rect area; /* The area of the mouse cursor */
Sint16 hot_x, hot_y; /* The "tip" of the cursor */
Uint8 *data; /* B/W cursor data */
Uint8 *mask; /* B/W cursor mask */
Uint8 *save[2]; /* Place to save cursor area */
WMcursor *wm_cursor; /* Window-manager cursor */
} SDL_Cursor;
typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */

/* Function prototypes */

/* \fn int SDL_GetNumMice(void)
*
* \brief Get the number of mouse input devices available.
*
* \sa SDL_SelectMouse()
*/
extern DECLSPEC int SDLCALL SDL_GetNumMice(void);

/* \fn int SDL_SelectMouse(int index)
*
* \brief Set the index of the currently selected mouse.
*
* \return The index of the currently selected mouse.
*
* \note You can query the currently selected mouse by passing an index of -1.
*
* \sa SDL_GetNumMice()
*/
extern DECLSPEC int SDLCALL SDL_SelectMouse(int index);

/* \fn SDL_WindowID SDL_GetMouseFocusWindow(void)
*
* \brief Get the window which currently has focus for the currently selected mouse.
*/
extern DECLSPEC SDL_WindowID SDLCALL SDL_GetMouseFocusWindow(void);

/*
* Retrieve the current state of the mouse.
* \fn Uint8 SDL_GetMouseState(int *x, int *y)
*
* \brief Retrieve the current state of the mouse.
*
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* current mouse cursor position. You can pass NULL for either x or y.
* mouse cursor position relative to the focus window for the currently
* selected mouse. You can pass NULL for either x or y.
*/
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);

/*
* Retrieve the current state of the mouse.
* \fn Uint8 SDL_GetRelativeMouseState(int *x, int *y)
*
* \brief Retrieve the current state of the mouse.
*
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse deltas since the last call to SDL_GetRelativeMouseState().
*/
extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);

/*
* Set the position of the mouse cursor (generates a mouse motion event)
* \fn void SDL_WarpMouseInWindow(SDL_WindowID windowID, int x, int y)
*
* \brief Moves the currently selected mouse to the given position within the window.
*
* \param windowID The window to move the mouse into, or 0 for the current mouse focus
* \param x The x coordinate within the window
* \param y The y coordinate within the window
*
* \note This function generates a mouse motion event
*/
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID,
int x, int y);

/*
* Create a cursor using the specified data and mask (in MSB format).
Expand Down

0 comments on commit a7e7b31

Please sign in to comment.