include/SDL_video.h
changeset 8931 44d8a2f4b431
parent 8927 be64f5daf64b
child 8935 9d2f0236322b
     1.1 --- a/include/SDL_video.h	Tue May 27 00:26:47 2014 -0400
     1.2 +++ b/include/SDL_video.h	Tue May 27 01:27:42 2014 -0400
     1.3 @@ -792,6 +792,44 @@
     1.4                                                     Uint16 * blue);
     1.5  
     1.6  /**
     1.7 + *  \brief Define regions of a window that can be used to drag it.
     1.8 + *
     1.9 + *  Normally windows are dragged by decorations provided by the system
    1.10 + *  window manager (usually, a title bar), but for some apps, it makes sense
    1.11 + *  to drag them from somewhere else inside the window itself; for example,
    1.12 + *  one might have a borderless window that wants to be draggable from any
    1.13 + *  part, or simulate its own title bar, etc.
    1.14 + *
    1.15 + *  This method designates pieces of a given window as "drag areas," which
    1.16 + *  will move the window when the user drags with his mouse, as if she had
    1.17 + *  used the titlebar.
    1.18 + *
    1.19 + *  You may specify multiple drag areas, disconnected or overlapping. This
    1.20 + *  function accepts an array of rectangles. Each call to this function will
    1.21 + *  replace any previously-defined drag areas. To disable drag areas on a
    1.22 + *  window, call this function with a NULL array of zero elements.
    1.23 + *
    1.24 + *  Drag areas do not automatically resize. If your window changes dimensions
    1.25 + *  you should plan to re-call this function with new drag areas if
    1.26 + *  appropriate.
    1.27 + *
    1.28 + *  Mouse input may not be delivered to your application if it is within
    1.29 + *  a drag area; the OS will often apply that input to moving the window and
    1.30 + *  not deliver it to the application.
    1.31 + *
    1.32 + *  Platforms that don't support this functionality will return -1
    1.33 + *  unconditionally, even if you're attempting to disable drag areas.
    1.34 + *
    1.35 + *  \param window The window to set drag areas on.
    1.36 + *  \param areas An array of SDL_Rects containing num_areas elements.
    1.37 + *  \param num_areas The number of elements in the areas parameter.
    1.38 + *  \return 0 on success, -1 on error (including unsupported).
    1.39 + */
    1.40 +extern DECLSPEC int SDLCALL SDL_SetWindowDragAreas(SDL_Window * window,
    1.41 +                                                   const SDL_Rect *areas,
    1.42 +                                                   int num_areas);
    1.43 +
    1.44 +/**
    1.45   *  \brief Destroy a window.
    1.46   */
    1.47  extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);