include/SDL_video.h
changeset 8937 e5caf226926d
parent 8935 9d2f0236322b
child 8946 c9592936dffc
equal deleted inserted replaced
8936:59cbb9959346 8937:e5caf226926d
   789 extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
   789 extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
   790                                                    Uint16 * red,
   790                                                    Uint16 * red,
   791                                                    Uint16 * green,
   791                                                    Uint16 * green,
   792                                                    Uint16 * blue);
   792                                                    Uint16 * blue);
   793 
   793 
       
   794 /**
       
   795  *  \brief Possible return values from the SDL_HitTest callback.
       
   796  *
       
   797  *  \sa SDL_HitTest
       
   798  */
   794 typedef enum
   799 typedef enum
   795 {
   800 {
   796     SDL_HITTEST_NORMAL,  /**< Region is normal. No special properties. */
   801     SDL_HITTEST_NORMAL,  /**< Region is normal. No special properties. */
   797     SDL_HITTEST_DRAGGABLE,  /**< Region can drag entire window. */
   802     SDL_HITTEST_DRAGGABLE,  /**< Region can drag entire window. */
   798     /* !!! FIXME: resize enums here. */
   803     /* !!! FIXME: resize enums here. */
   799 } SDL_HitTestResult;
   804 } SDL_HitTestResult;
   800 
   805 
       
   806 /**
       
   807  *  \brief Callback used for hit-testing.
       
   808  *
       
   809  *  \sa SDL_SetWindowHitTest
       
   810  */
   801 typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
   811 typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
   802                                                  const SDL_Point *area,
   812                                                  const SDL_Point *area,
   803                                                  void *data);
   813                                                  void *data);
   804 
   814 
   805 /**
   815 /**
   824  *  disabled by default.
   834  *  disabled by default.
   825  *
   835  *
   826  *  Platforms that don't support this functionality will return -1
   836  *  Platforms that don't support this functionality will return -1
   827  *  unconditionally, even if you're attempting to disable hit-testing.
   837  *  unconditionally, even if you're attempting to disable hit-testing.
   828  *
   838  *
   829  *  Your callback may fire at any time.
   839  *  Your callback may fire at any time, and its firing does not indicate any
       
   840  *  specific behavior (for example, on Windows, this certainly might fire
       
   841  *  when the OS is deciding whether to drag your window, but it fires for lots
       
   842  *  of other reasons, too, some unrelated to anything you probably care about
       
   843  *  _and when the mouse isn't actually at the location it is testing_).
       
   844  *  Since this can fire at any time, you should try to keep your callback
       
   845  *  efficient, devoid of allocations, etc.
   830  *
   846  *
   831  *  \param window The window to set hit-testing on.
   847  *  \param window The window to set hit-testing on.
   832  *  \param callback The callback to call when doing a hit-test.
   848  *  \param callback The callback to call when doing a hit-test.
   833  *  \param callback_data An app-defined void pointer passed to the callback.
   849  *  \param callback_data An app-defined void pointer passed to the callback.
   834  *  \return 0 on success, -1 on error (including unsupported).
   850  *  \return 0 on success, -1 on error (including unsupported).