src/events/SDL_windowevents.c
author Sam Lantinga <slouken@libsdl.org>
Sun, 28 May 2006 13:04:16 +0000
branchSDL-1.3
changeset 1662 782fd950bd46
child 1668 4da1ee79c9af
permissions -rw-r--r--
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.

WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.

The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce

The headers are being converted to automatically generate doxygen documentation.
slouken@1662
     1
/*
slouken@1662
     2
    SDL - Simple DirectMedia Layer
slouken@1662
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@1662
     4
slouken@1662
     5
    This library is free software; you can redistribute it and/or
slouken@1662
     6
    modify it under the terms of the GNU Lesser General Public
slouken@1662
     7
    License as published by the Free Software Foundation; either
slouken@1662
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@1662
     9
slouken@1662
    10
    This library is distributed in the hope that it will be useful,
slouken@1662
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@1662
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1662
    13
    Lesser General Public License for more details.
slouken@1662
    14
slouken@1662
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1662
    16
    License along with this library; if not, write to the Free Software
slouken@1662
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@1662
    18
slouken@1662
    19
    Sam Lantinga
slouken@1662
    20
    slouken@libsdl.org
slouken@1662
    21
*/
slouken@1662
    22
#include "SDL_config.h"
slouken@1662
    23
slouken@1662
    24
/* Window event handling code for SDL */
slouken@1662
    25
slouken@1662
    26
#include "SDL_events.h"
slouken@1662
    27
#include "SDL_events_c.h"
slouken@1662
    28
slouken@1662
    29
int
slouken@1662
    30
SDL_PrivateWindowEvent (SDL_WindowID windowID, Uint8 windowevent, int data1,
slouken@1662
    31
                        int data2)
slouken@1662
    32
{
slouken@1662
    33
    int posted;
slouken@1662
    34
slouken@1662
    35
    /* Post the event, if desired */
slouken@1662
    36
    posted = 0;
slouken@1662
    37
    if (SDL_ProcessEvents[SDL_WINDOWEVENT] == SDL_ENABLE) {
slouken@1662
    38
        SDL_Event event;
slouken@1662
    39
        event.type = SDL_WINDOWEVENT;
slouken@1662
    40
        event.window.event = windowevent;
slouken@1662
    41
        event.window.data1 = data1;
slouken@1662
    42
        event.window.data2 = data2;
slouken@1662
    43
        event.window.windowID = windowID;
slouken@1662
    44
        if ((SDL_EventOK == NULL) || (*SDL_EventOK) (&event)) {
slouken@1662
    45
            posted = 1;
slouken@1662
    46
            SDL_PushEvent (&event);
slouken@1662
    47
        }
slouken@1662
    48
    }
slouken@1662
    49
    return (posted);
slouken@1662
    50
}
slouken@1662
    51
slouken@1662
    52
/* vi: set ts=4 sw=4 expandtab: */