Add Repo: Floatkyun_Ultra-Vision
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_rect.h +174 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_render.h +1158 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_revision.h +2 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_rwops.h +291 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_scancode.h +413 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_sensor.h +251 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_shape.h +144 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_stdinc.h +617 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_surface.h +554 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_system.h +316 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_syswm.h +331 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test.h +69 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_assert.h +105 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_common.h +218 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_compare.h +69 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_crc32.h +124 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_font.h +81 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_fuzzer.h +384 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_harness.h +134 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_images.h +78 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_log.h +67 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_md5.h +129 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_memory.h +63 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_random.h +115 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_thread.h +361 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_timer.h +115 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_touch.h +102 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_types.h +29 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_version.h +162 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_video.h +1275 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_vulkan.h +278 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/begin_code.h +170 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/close_code.h +40 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/decoder.h +28 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/connect_utils.c +231 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/connect_utils.h +41 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/freemaster_client.c +212 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/freemaster_client.h +75 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/gg_external_data.c +141 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/gg_external_data.h +76 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_conf.h +727 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/README.md +7 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/GC9A01.c +579 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/GC9A01.h +88 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/ILI9341.c +432 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/ILI9341.h +67 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/R61581.c +425 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/R61581.h +57 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/SHARP_MIP.c +182 -0
- Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/SHARP_MIP.h +63 -0
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_rect.h
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_rect.h
|
| 24 |
+
*
|
| 25 |
+
* Header file for SDL_rect definition and management functions.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_rect_h_
|
| 29 |
+
#define SDL_rect_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_error.h"
|
| 33 |
+
#include "SDL_pixels.h"
|
| 34 |
+
#include "SDL_rwops.h"
|
| 35 |
+
|
| 36 |
+
#include "begin_code.h"
|
| 37 |
+
/* Set up for C function definitions, even when using C++ */
|
| 38 |
+
#ifdef __cplusplus
|
| 39 |
+
extern "C" {
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* \brief The structure that defines a point (integer)
|
| 44 |
+
*
|
| 45 |
+
* \sa SDL_EnclosePoints
|
| 46 |
+
* \sa SDL_PointInRect
|
| 47 |
+
*/
|
| 48 |
+
typedef struct SDL_Point
|
| 49 |
+
{
|
| 50 |
+
int x;
|
| 51 |
+
int y;
|
| 52 |
+
} SDL_Point;
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* \brief The structure that defines a point (floating point)
|
| 56 |
+
*
|
| 57 |
+
* \sa SDL_EnclosePoints
|
| 58 |
+
* \sa SDL_PointInRect
|
| 59 |
+
*/
|
| 60 |
+
typedef struct SDL_FPoint
|
| 61 |
+
{
|
| 62 |
+
float x;
|
| 63 |
+
float y;
|
| 64 |
+
} SDL_FPoint;
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
/**
|
| 68 |
+
* \brief A rectangle, with the origin at the upper left (integer).
|
| 69 |
+
*
|
| 70 |
+
* \sa SDL_RectEmpty
|
| 71 |
+
* \sa SDL_RectEquals
|
| 72 |
+
* \sa SDL_HasIntersection
|
| 73 |
+
* \sa SDL_IntersectRect
|
| 74 |
+
* \sa SDL_UnionRect
|
| 75 |
+
* \sa SDL_EnclosePoints
|
| 76 |
+
*/
|
| 77 |
+
typedef struct SDL_Rect
|
| 78 |
+
{
|
| 79 |
+
int x, y;
|
| 80 |
+
int w, h;
|
| 81 |
+
} SDL_Rect;
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* \brief A rectangle, with the origin at the upper left (floating point).
|
| 86 |
+
*/
|
| 87 |
+
typedef struct SDL_FRect
|
| 88 |
+
{
|
| 89 |
+
float x;
|
| 90 |
+
float y;
|
| 91 |
+
float w;
|
| 92 |
+
float h;
|
| 93 |
+
} SDL_FRect;
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
/**
|
| 97 |
+
* \brief Returns true if point resides inside a rectangle.
|
| 98 |
+
*/
|
| 99 |
+
SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
|
| 100 |
+
{
|
| 101 |
+
return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
|
| 102 |
+
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
/**
|
| 106 |
+
* \brief Returns true if the rectangle has no area.
|
| 107 |
+
*/
|
| 108 |
+
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
|
| 109 |
+
{
|
| 110 |
+
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
* \brief Returns true if the two rectangles are equal.
|
| 115 |
+
*/
|
| 116 |
+
SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
|
| 117 |
+
{
|
| 118 |
+
return (a && b && (a->x == b->x) && (a->y == b->y) &&
|
| 119 |
+
(a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
/**
|
| 123 |
+
* \brief Determine whether two rectangles intersect.
|
| 124 |
+
*
|
| 125 |
+
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
| 126 |
+
*/
|
| 127 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
|
| 128 |
+
const SDL_Rect * B);
|
| 129 |
+
|
| 130 |
+
/**
|
| 131 |
+
* \brief Calculate the intersection of two rectangles.
|
| 132 |
+
*
|
| 133 |
+
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
| 134 |
+
*/
|
| 135 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
|
| 136 |
+
const SDL_Rect * B,
|
| 137 |
+
SDL_Rect * result);
|
| 138 |
+
|
| 139 |
+
/**
|
| 140 |
+
* \brief Calculate the union of two rectangles.
|
| 141 |
+
*/
|
| 142 |
+
extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
|
| 143 |
+
const SDL_Rect * B,
|
| 144 |
+
SDL_Rect * result);
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* \brief Calculate a minimal rectangle enclosing a set of points
|
| 148 |
+
*
|
| 149 |
+
* \return SDL_TRUE if any points were within the clipping rect
|
| 150 |
+
*/
|
| 151 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
|
| 152 |
+
int count,
|
| 153 |
+
const SDL_Rect * clip,
|
| 154 |
+
SDL_Rect * result);
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* \brief Calculate the intersection of a rectangle and line segment.
|
| 158 |
+
*
|
| 159 |
+
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
| 160 |
+
*/
|
| 161 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
|
| 162 |
+
rect, int *X1,
|
| 163 |
+
int *Y1, int *X2,
|
| 164 |
+
int *Y2);
|
| 165 |
+
|
| 166 |
+
/* Ends C function definitions when using C++ */
|
| 167 |
+
#ifdef __cplusplus
|
| 168 |
+
}
|
| 169 |
+
#endif
|
| 170 |
+
#include "close_code.h"
|
| 171 |
+
|
| 172 |
+
#endif /* SDL_rect_h_ */
|
| 173 |
+
|
| 174 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_render.h
ADDED
|
@@ -0,0 +1,1158 @@
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_render.h
|
| 24 |
+
*
|
| 25 |
+
* Header file for SDL 2D rendering functions.
|
| 26 |
+
*
|
| 27 |
+
* This API supports the following features:
|
| 28 |
+
* * single pixel points
|
| 29 |
+
* * single pixel lines
|
| 30 |
+
* * filled rectangles
|
| 31 |
+
* * texture images
|
| 32 |
+
*
|
| 33 |
+
* The primitives may be drawn in opaque, blended, or additive modes.
|
| 34 |
+
*
|
| 35 |
+
* The texture images may be drawn in opaque, blended, or additive modes.
|
| 36 |
+
* They can have an additional color tint or alpha modulation applied to
|
| 37 |
+
* them, and may also be stretched with linear interpolation.
|
| 38 |
+
*
|
| 39 |
+
* This API is designed to accelerate simple 2D operations. You may
|
| 40 |
+
* want more functionality such as polygons and particle effects and
|
| 41 |
+
* in that case you should use SDL's OpenGL/Direct3D support or one
|
| 42 |
+
* of the many good 3D engines.
|
| 43 |
+
*
|
| 44 |
+
* These functions must be called from the main thread.
|
| 45 |
+
* See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#ifndef SDL_render_h_
|
| 49 |
+
#define SDL_render_h_
|
| 50 |
+
|
| 51 |
+
#include "SDL_stdinc.h"
|
| 52 |
+
#include "SDL_rect.h"
|
| 53 |
+
#include "SDL_video.h"
|
| 54 |
+
|
| 55 |
+
#include "begin_code.h"
|
| 56 |
+
/* Set up for C function definitions, even when using C++ */
|
| 57 |
+
#ifdef __cplusplus
|
| 58 |
+
extern "C" {
|
| 59 |
+
#endif
|
| 60 |
+
|
| 61 |
+
/**
|
| 62 |
+
* \brief Flags used when creating a rendering context
|
| 63 |
+
*/
|
| 64 |
+
typedef enum
|
| 65 |
+
{
|
| 66 |
+
SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */
|
| 67 |
+
SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware
|
| 68 |
+
acceleration */
|
| 69 |
+
SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized
|
| 70 |
+
with the refresh rate */
|
| 71 |
+
SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports
|
| 72 |
+
rendering to texture */
|
| 73 |
+
} SDL_RendererFlags;
|
| 74 |
+
|
| 75 |
+
/**
|
| 76 |
+
* \brief Information on the capabilities of a render driver or context.
|
| 77 |
+
*/
|
| 78 |
+
typedef struct SDL_RendererInfo
|
| 79 |
+
{
|
| 80 |
+
const char *name; /**< The name of the renderer */
|
| 81 |
+
Uint32 flags; /**< Supported ::SDL_RendererFlags */
|
| 82 |
+
Uint32 num_texture_formats; /**< The number of available texture formats */
|
| 83 |
+
Uint32 texture_formats[16]; /**< The available texture formats */
|
| 84 |
+
int max_texture_width; /**< The maximum texture width */
|
| 85 |
+
int max_texture_height; /**< The maximum texture height */
|
| 86 |
+
} SDL_RendererInfo;
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* \brief The scaling mode for a texture.
|
| 90 |
+
*/
|
| 91 |
+
typedef enum
|
| 92 |
+
{
|
| 93 |
+
SDL_ScaleModeNearest, /**< nearest pixel sampling */
|
| 94 |
+
SDL_ScaleModeLinear, /**< linear filtering */
|
| 95 |
+
SDL_ScaleModeBest /**< anisotropic filtering */
|
| 96 |
+
} SDL_ScaleMode;
|
| 97 |
+
|
| 98 |
+
/**
|
| 99 |
+
* \brief The access pattern allowed for a texture.
|
| 100 |
+
*/
|
| 101 |
+
typedef enum
|
| 102 |
+
{
|
| 103 |
+
SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
|
| 104 |
+
SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
|
| 105 |
+
SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
|
| 106 |
+
} SDL_TextureAccess;
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* \brief The texture channel modulation used in SDL_RenderCopy().
|
| 110 |
+
*/
|
| 111 |
+
typedef enum
|
| 112 |
+
{
|
| 113 |
+
SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */
|
| 114 |
+
SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */
|
| 115 |
+
SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
|
| 116 |
+
} SDL_TextureModulate;
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* \brief Flip constants for SDL_RenderCopyEx
|
| 120 |
+
*/
|
| 121 |
+
typedef enum
|
| 122 |
+
{
|
| 123 |
+
SDL_FLIP_NONE = 0x00000000, /**< Do not flip */
|
| 124 |
+
SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */
|
| 125 |
+
SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */
|
| 126 |
+
} SDL_RendererFlip;
|
| 127 |
+
|
| 128 |
+
/**
|
| 129 |
+
* \brief A structure representing rendering state
|
| 130 |
+
*/
|
| 131 |
+
struct SDL_Renderer;
|
| 132 |
+
typedef struct SDL_Renderer SDL_Renderer;
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* \brief An efficient driver-specific representation of pixel data
|
| 136 |
+
*/
|
| 137 |
+
struct SDL_Texture;
|
| 138 |
+
typedef struct SDL_Texture SDL_Texture;
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
/* Function prototypes */
|
| 142 |
+
|
| 143 |
+
/**
|
| 144 |
+
* \brief Get the number of 2D rendering drivers available for the current
|
| 145 |
+
* display.
|
| 146 |
+
*
|
| 147 |
+
* A render driver is a set of code that handles rendering and texture
|
| 148 |
+
* management on a particular display. Normally there is only one, but
|
| 149 |
+
* some drivers may have several available with different capabilities.
|
| 150 |
+
*
|
| 151 |
+
* \sa SDL_GetRenderDriverInfo()
|
| 152 |
+
* \sa SDL_CreateRenderer()
|
| 153 |
+
*/
|
| 154 |
+
extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* \brief Get information about a specific 2D rendering driver for the current
|
| 158 |
+
* display.
|
| 159 |
+
*
|
| 160 |
+
* \param index The index of the driver to query information about.
|
| 161 |
+
* \param info A pointer to an SDL_RendererInfo struct to be filled with
|
| 162 |
+
* information on the rendering driver.
|
| 163 |
+
*
|
| 164 |
+
* \return 0 on success, -1 if the index was out of range.
|
| 165 |
+
*
|
| 166 |
+
* \sa SDL_CreateRenderer()
|
| 167 |
+
*/
|
| 168 |
+
extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
|
| 169 |
+
SDL_RendererInfo * info);
|
| 170 |
+
|
| 171 |
+
/**
|
| 172 |
+
* \brief Create a window and default renderer
|
| 173 |
+
*
|
| 174 |
+
* \param width The width of the window
|
| 175 |
+
* \param height The height of the window
|
| 176 |
+
* \param window_flags The flags used to create the window
|
| 177 |
+
* \param window A pointer filled with the window, or NULL on error
|
| 178 |
+
* \param renderer A pointer filled with the renderer, or NULL on error
|
| 179 |
+
*
|
| 180 |
+
* \return 0 on success, or -1 on error
|
| 181 |
+
*/
|
| 182 |
+
extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(
|
| 183 |
+
int width, int height, Uint32 window_flags,
|
| 184 |
+
SDL_Window **window, SDL_Renderer **renderer);
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
/**
|
| 188 |
+
* \brief Create a 2D rendering context for a window.
|
| 189 |
+
*
|
| 190 |
+
* \param window The window where rendering is displayed.
|
| 191 |
+
* \param index The index of the rendering driver to initialize, or -1 to
|
| 192 |
+
* initialize the first one supporting the requested flags.
|
| 193 |
+
* \param flags ::SDL_RendererFlags.
|
| 194 |
+
*
|
| 195 |
+
* \return A valid rendering context or NULL if there was an error.
|
| 196 |
+
*
|
| 197 |
+
* \sa SDL_CreateSoftwareRenderer()
|
| 198 |
+
* \sa SDL_GetRendererInfo()
|
| 199 |
+
* \sa SDL_DestroyRenderer()
|
| 200 |
+
*/
|
| 201 |
+
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
|
| 202 |
+
int index, Uint32 flags);
|
| 203 |
+
|
| 204 |
+
/**
|
| 205 |
+
* \brief Create a 2D software rendering context for a surface.
|
| 206 |
+
*
|
| 207 |
+
* \param surface The surface where rendering is done.
|
| 208 |
+
*
|
| 209 |
+
* \return A valid rendering context or NULL if there was an error.
|
| 210 |
+
*
|
| 211 |
+
* \sa SDL_CreateRenderer()
|
| 212 |
+
* \sa SDL_DestroyRenderer()
|
| 213 |
+
*/
|
| 214 |
+
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
|
| 215 |
+
|
| 216 |
+
/**
|
| 217 |
+
* \brief Get the renderer associated with a window.
|
| 218 |
+
*/
|
| 219 |
+
extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
|
| 220 |
+
|
| 221 |
+
/**
|
| 222 |
+
* \brief Get information about a rendering context.
|
| 223 |
+
*/
|
| 224 |
+
extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
|
| 225 |
+
SDL_RendererInfo * info);
|
| 226 |
+
|
| 227 |
+
/**
|
| 228 |
+
* \brief Get the output size in pixels of a rendering context.
|
| 229 |
+
*/
|
| 230 |
+
extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer,
|
| 231 |
+
int *w, int *h);
|
| 232 |
+
|
| 233 |
+
/**
|
| 234 |
+
* \brief Create a texture for a rendering context.
|
| 235 |
+
*
|
| 236 |
+
* \param renderer The renderer.
|
| 237 |
+
* \param format The format of the texture.
|
| 238 |
+
* \param access One of the enumerated values in ::SDL_TextureAccess.
|
| 239 |
+
* \param w The width of the texture in pixels.
|
| 240 |
+
* \param h The height of the texture in pixels.
|
| 241 |
+
*
|
| 242 |
+
* \return The created texture is returned, or NULL if no rendering context was
|
| 243 |
+
* active, the format was unsupported, or the width or height were out
|
| 244 |
+
* of range.
|
| 245 |
+
*
|
| 246 |
+
* \note The contents of the texture are not defined at creation.
|
| 247 |
+
*
|
| 248 |
+
* \sa SDL_QueryTexture()
|
| 249 |
+
* \sa SDL_UpdateTexture()
|
| 250 |
+
* \sa SDL_DestroyTexture()
|
| 251 |
+
*/
|
| 252 |
+
extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,
|
| 253 |
+
Uint32 format,
|
| 254 |
+
int access, int w,
|
| 255 |
+
int h);
|
| 256 |
+
|
| 257 |
+
/**
|
| 258 |
+
* \brief Create a texture from an existing surface.
|
| 259 |
+
*
|
| 260 |
+
* \param renderer The renderer.
|
| 261 |
+
* \param surface The surface containing pixel data used to fill the texture.
|
| 262 |
+
*
|
| 263 |
+
* \return The created texture is returned, or NULL on error.
|
| 264 |
+
*
|
| 265 |
+
* \note The surface is not modified or freed by this function.
|
| 266 |
+
*
|
| 267 |
+
* \sa SDL_QueryTexture()
|
| 268 |
+
* \sa SDL_DestroyTexture()
|
| 269 |
+
*/
|
| 270 |
+
extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
|
| 271 |
+
|
| 272 |
+
/**
|
| 273 |
+
* \brief Query the attributes of a texture
|
| 274 |
+
*
|
| 275 |
+
* \param texture A texture to be queried.
|
| 276 |
+
* \param format A pointer filled in with the raw format of the texture. The
|
| 277 |
+
* actual format may differ, but pixel transfers will use this
|
| 278 |
+
* format.
|
| 279 |
+
* \param access A pointer filled in with the actual access to the texture.
|
| 280 |
+
* \param w A pointer filled in with the width of the texture in pixels.
|
| 281 |
+
* \param h A pointer filled in with the height of the texture in pixels.
|
| 282 |
+
*
|
| 283 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 284 |
+
*/
|
| 285 |
+
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
|
| 286 |
+
Uint32 * format, int *access,
|
| 287 |
+
int *w, int *h);
|
| 288 |
+
|
| 289 |
+
/**
|
| 290 |
+
* \brief Set an additional color value used in render copy operations.
|
| 291 |
+
*
|
| 292 |
+
* \param texture The texture to update.
|
| 293 |
+
* \param r The red color value multiplied into copy operations.
|
| 294 |
+
* \param g The green color value multiplied into copy operations.
|
| 295 |
+
* \param b The blue color value multiplied into copy operations.
|
| 296 |
+
*
|
| 297 |
+
* \return 0 on success, or -1 if the texture is not valid or color modulation
|
| 298 |
+
* is not supported.
|
| 299 |
+
*
|
| 300 |
+
* \sa SDL_GetTextureColorMod()
|
| 301 |
+
*/
|
| 302 |
+
extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
|
| 303 |
+
Uint8 r, Uint8 g, Uint8 b);
|
| 304 |
+
|
| 305 |
+
|
| 306 |
+
/**
|
| 307 |
+
* \brief Get the additional color value used in render copy operations.
|
| 308 |
+
*
|
| 309 |
+
* \param texture The texture to query.
|
| 310 |
+
* \param r A pointer filled in with the current red color value.
|
| 311 |
+
* \param g A pointer filled in with the current green color value.
|
| 312 |
+
* \param b A pointer filled in with the current blue color value.
|
| 313 |
+
*
|
| 314 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 315 |
+
*
|
| 316 |
+
* \sa SDL_SetTextureColorMod()
|
| 317 |
+
*/
|
| 318 |
+
extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
|
| 319 |
+
Uint8 * r, Uint8 * g,
|
| 320 |
+
Uint8 * b);
|
| 321 |
+
|
| 322 |
+
/**
|
| 323 |
+
* \brief Set an additional alpha value used in render copy operations.
|
| 324 |
+
*
|
| 325 |
+
* \param texture The texture to update.
|
| 326 |
+
* \param alpha The alpha value multiplied into copy operations.
|
| 327 |
+
*
|
| 328 |
+
* \return 0 on success, or -1 if the texture is not valid or alpha modulation
|
| 329 |
+
* is not supported.
|
| 330 |
+
*
|
| 331 |
+
* \sa SDL_GetTextureAlphaMod()
|
| 332 |
+
*/
|
| 333 |
+
extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
|
| 334 |
+
Uint8 alpha);
|
| 335 |
+
|
| 336 |
+
/**
|
| 337 |
+
* \brief Get the additional alpha value used in render copy operations.
|
| 338 |
+
*
|
| 339 |
+
* \param texture The texture to query.
|
| 340 |
+
* \param alpha A pointer filled in with the current alpha value.
|
| 341 |
+
*
|
| 342 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 343 |
+
*
|
| 344 |
+
* \sa SDL_SetTextureAlphaMod()
|
| 345 |
+
*/
|
| 346 |
+
extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
|
| 347 |
+
Uint8 * alpha);
|
| 348 |
+
|
| 349 |
+
/**
|
| 350 |
+
* \brief Set the blend mode used for texture copy operations.
|
| 351 |
+
*
|
| 352 |
+
* \param texture The texture to update.
|
| 353 |
+
* \param blendMode ::SDL_BlendMode to use for texture blending.
|
| 354 |
+
*
|
| 355 |
+
* \return 0 on success, or -1 if the texture is not valid or the blend mode is
|
| 356 |
+
* not supported.
|
| 357 |
+
*
|
| 358 |
+
* \note If the blend mode is not supported, the closest supported mode is
|
| 359 |
+
* chosen.
|
| 360 |
+
*
|
| 361 |
+
* \sa SDL_GetTextureBlendMode()
|
| 362 |
+
*/
|
| 363 |
+
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
|
| 364 |
+
SDL_BlendMode blendMode);
|
| 365 |
+
|
| 366 |
+
/**
|
| 367 |
+
* \brief Get the blend mode used for texture copy operations.
|
| 368 |
+
*
|
| 369 |
+
* \param texture The texture to query.
|
| 370 |
+
* \param blendMode A pointer filled in with the current blend mode.
|
| 371 |
+
*
|
| 372 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 373 |
+
*
|
| 374 |
+
* \sa SDL_SetTextureBlendMode()
|
| 375 |
+
*/
|
| 376 |
+
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
|
| 377 |
+
SDL_BlendMode *blendMode);
|
| 378 |
+
|
| 379 |
+
/**
|
| 380 |
+
* \brief Set the scale mode used for texture scale operations.
|
| 381 |
+
*
|
| 382 |
+
* \param texture The texture to update.
|
| 383 |
+
* \param scaleMode ::SDL_ScaleMode to use for texture scaling.
|
| 384 |
+
*
|
| 385 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 386 |
+
*
|
| 387 |
+
* \note If the scale mode is not supported, the closest supported mode is
|
| 388 |
+
* chosen.
|
| 389 |
+
*
|
| 390 |
+
* \sa SDL_GetTextureScaleMode()
|
| 391 |
+
*/
|
| 392 |
+
extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
|
| 393 |
+
SDL_ScaleMode scaleMode);
|
| 394 |
+
|
| 395 |
+
/**
|
| 396 |
+
* \brief Get the scale mode used for texture scale operations.
|
| 397 |
+
*
|
| 398 |
+
* \param texture The texture to query.
|
| 399 |
+
* \param scaleMode A pointer filled in with the current scale mode.
|
| 400 |
+
*
|
| 401 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 402 |
+
*
|
| 403 |
+
* \sa SDL_SetTextureScaleMode()
|
| 404 |
+
*/
|
| 405 |
+
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
|
| 406 |
+
SDL_ScaleMode *scaleMode);
|
| 407 |
+
|
| 408 |
+
/**
|
| 409 |
+
* \brief Update the given texture rectangle with new pixel data.
|
| 410 |
+
*
|
| 411 |
+
* \param texture The texture to update
|
| 412 |
+
* \param rect A pointer to the rectangle of pixels to update, or NULL to
|
| 413 |
+
* update the entire texture.
|
| 414 |
+
* \param pixels The raw pixel data in the format of the texture.
|
| 415 |
+
* \param pitch The number of bytes in a row of pixel data, including padding between lines.
|
| 416 |
+
*
|
| 417 |
+
* The pixel data must be in the format of the texture. The pixel format can be
|
| 418 |
+
* queried with SDL_QueryTexture.
|
| 419 |
+
*
|
| 420 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 421 |
+
*
|
| 422 |
+
* \note This is a fairly slow function.
|
| 423 |
+
*/
|
| 424 |
+
extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
|
| 425 |
+
const SDL_Rect * rect,
|
| 426 |
+
const void *pixels, int pitch);
|
| 427 |
+
|
| 428 |
+
/**
|
| 429 |
+
* \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
|
| 430 |
+
*
|
| 431 |
+
* \param texture The texture to update
|
| 432 |
+
* \param rect A pointer to the rectangle of pixels to update, or NULL to
|
| 433 |
+
* update the entire texture.
|
| 434 |
+
* \param Yplane The raw pixel data for the Y plane.
|
| 435 |
+
* \param Ypitch The number of bytes between rows of pixel data for the Y plane.
|
| 436 |
+
* \param Uplane The raw pixel data for the U plane.
|
| 437 |
+
* \param Upitch The number of bytes between rows of pixel data for the U plane.
|
| 438 |
+
* \param Vplane The raw pixel data for the V plane.
|
| 439 |
+
* \param Vpitch The number of bytes between rows of pixel data for the V plane.
|
| 440 |
+
*
|
| 441 |
+
* \return 0 on success, or -1 if the texture is not valid.
|
| 442 |
+
*
|
| 443 |
+
* \note You can use SDL_UpdateTexture() as long as your pixel data is
|
| 444 |
+
* a contiguous block of Y and U/V planes in the proper order, but
|
| 445 |
+
* this function is available if your pixel data is not contiguous.
|
| 446 |
+
*/
|
| 447 |
+
extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture,
|
| 448 |
+
const SDL_Rect * rect,
|
| 449 |
+
const Uint8 *Yplane, int Ypitch,
|
| 450 |
+
const Uint8 *Uplane, int Upitch,
|
| 451 |
+
const Uint8 *Vplane, int Vpitch);
|
| 452 |
+
|
| 453 |
+
/**
|
| 454 |
+
* \brief Lock a portion of the texture for write-only pixel access.
|
| 455 |
+
*
|
| 456 |
+
* \param texture The texture to lock for access, which was created with
|
| 457 |
+
* ::SDL_TEXTUREACCESS_STREAMING.
|
| 458 |
+
* \param rect A pointer to the rectangle to lock for access. If the rect
|
| 459 |
+
* is NULL, the entire texture will be locked.
|
| 460 |
+
* \param pixels This is filled in with a pointer to the locked pixels,
|
| 461 |
+
* appropriately offset by the locked area.
|
| 462 |
+
* \param pitch This is filled in with the pitch of the locked pixels.
|
| 463 |
+
*
|
| 464 |
+
* \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
|
| 465 |
+
*
|
| 466 |
+
* \sa SDL_UnlockTexture()
|
| 467 |
+
*/
|
| 468 |
+
extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
|
| 469 |
+
const SDL_Rect * rect,
|
| 470 |
+
void **pixels, int *pitch);
|
| 471 |
+
|
| 472 |
+
/**
|
| 473 |
+
* \brief Lock a portion of the texture for write-only pixel access.
|
| 474 |
+
* Expose it as a SDL surface.
|
| 475 |
+
*
|
| 476 |
+
* \param texture The texture to lock for access, which was created with
|
| 477 |
+
* ::SDL_TEXTUREACCESS_STREAMING.
|
| 478 |
+
* \param rect A pointer to the rectangle to lock for access. If the rect
|
| 479 |
+
* is NULL, the entire texture will be locked.
|
| 480 |
+
* \param surface This is filled in with a SDL surface representing the locked area
|
| 481 |
+
* Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture.
|
| 482 |
+
*
|
| 483 |
+
* \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
|
| 484 |
+
*
|
| 485 |
+
* \sa SDL_UnlockTexture()
|
| 486 |
+
*/
|
| 487 |
+
extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture,
|
| 488 |
+
const SDL_Rect *rect,
|
| 489 |
+
SDL_Surface **surface);
|
| 490 |
+
|
| 491 |
+
/**
|
| 492 |
+
* \brief Unlock a texture, uploading the changes to video memory, if needed.
|
| 493 |
+
* If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed.
|
| 494 |
+
*
|
| 495 |
+
* \sa SDL_LockTexture()
|
| 496 |
+
* \sa SDL_LockTextureToSurface()
|
| 497 |
+
*/
|
| 498 |
+
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
|
| 499 |
+
|
| 500 |
+
/**
|
| 501 |
+
* \brief Determines whether a window supports the use of render targets
|
| 502 |
+
*
|
| 503 |
+
* \param renderer The renderer that will be checked
|
| 504 |
+
*
|
| 505 |
+
* \return SDL_TRUE if supported, SDL_FALSE if not.
|
| 506 |
+
*/
|
| 507 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
|
| 508 |
+
|
| 509 |
+
/**
|
| 510 |
+
* \brief Set a texture as the current rendering target.
|
| 511 |
+
*
|
| 512 |
+
* \param renderer The renderer.
|
| 513 |
+
* \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
|
| 514 |
+
*
|
| 515 |
+
* \return 0 on success, or -1 on error
|
| 516 |
+
*
|
| 517 |
+
* \sa SDL_GetRenderTarget()
|
| 518 |
+
*/
|
| 519 |
+
extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
|
| 520 |
+
SDL_Texture *texture);
|
| 521 |
+
|
| 522 |
+
/**
|
| 523 |
+
* \brief Get the current render target or NULL for the default render target.
|
| 524 |
+
*
|
| 525 |
+
* \return The current render target
|
| 526 |
+
*
|
| 527 |
+
* \sa SDL_SetRenderTarget()
|
| 528 |
+
*/
|
| 529 |
+
extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
|
| 530 |
+
|
| 531 |
+
/**
|
| 532 |
+
* \brief Set device independent resolution for rendering
|
| 533 |
+
*
|
| 534 |
+
* \param renderer The renderer for which resolution should be set.
|
| 535 |
+
* \param w The width of the logical resolution
|
| 536 |
+
* \param h The height of the logical resolution
|
| 537 |
+
*
|
| 538 |
+
* This function uses the viewport and scaling functionality to allow a fixed logical
|
| 539 |
+
* resolution for rendering, regardless of the actual output resolution. If the actual
|
| 540 |
+
* output resolution doesn't have the same aspect ratio the output rendering will be
|
| 541 |
+
* centered within the output display.
|
| 542 |
+
*
|
| 543 |
+
* If the output display is a window, mouse events in the window will be filtered
|
| 544 |
+
* and scaled so they seem to arrive within the logical resolution.
|
| 545 |
+
*
|
| 546 |
+
* \note If this function results in scaling or subpixel drawing by the
|
| 547 |
+
* rendering backend, it will be handled using the appropriate
|
| 548 |
+
* quality hints.
|
| 549 |
+
*
|
| 550 |
+
* \sa SDL_RenderGetLogicalSize()
|
| 551 |
+
* \sa SDL_RenderSetScale()
|
| 552 |
+
* \sa SDL_RenderSetViewport()
|
| 553 |
+
*/
|
| 554 |
+
extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
|
| 555 |
+
|
| 556 |
+
/**
|
| 557 |
+
* \brief Get device independent resolution for rendering
|
| 558 |
+
*
|
| 559 |
+
* \param renderer The renderer from which resolution should be queried.
|
| 560 |
+
* \param w A pointer filled with the width of the logical resolution
|
| 561 |
+
* \param h A pointer filled with the height of the logical resolution
|
| 562 |
+
*
|
| 563 |
+
* \sa SDL_RenderSetLogicalSize()
|
| 564 |
+
*/
|
| 565 |
+
extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h);
|
| 566 |
+
|
| 567 |
+
/**
|
| 568 |
+
* \brief Set whether to force integer scales for resolution-independent rendering
|
| 569 |
+
*
|
| 570 |
+
* \param renderer The renderer for which integer scaling should be set.
|
| 571 |
+
* \param enable Enable or disable integer scaling
|
| 572 |
+
*
|
| 573 |
+
* This function restricts the logical viewport to integer values - that is, when
|
| 574 |
+
* a resolution is between two multiples of a logical size, the viewport size is
|
| 575 |
+
* rounded down to the lower multiple.
|
| 576 |
+
*
|
| 577 |
+
* \sa SDL_RenderSetLogicalSize()
|
| 578 |
+
*/
|
| 579 |
+
extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer,
|
| 580 |
+
SDL_bool enable);
|
| 581 |
+
|
| 582 |
+
/**
|
| 583 |
+
* \brief Get whether integer scales are forced for resolution-independent rendering
|
| 584 |
+
*
|
| 585 |
+
* \param renderer The renderer from which integer scaling should be queried.
|
| 586 |
+
*
|
| 587 |
+
* \sa SDL_RenderSetIntegerScale()
|
| 588 |
+
*/
|
| 589 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer);
|
| 590 |
+
|
| 591 |
+
/**
|
| 592 |
+
* \brief Set the drawing area for rendering on the current target.
|
| 593 |
+
*
|
| 594 |
+
* \param renderer The renderer for which the drawing area should be set.
|
| 595 |
+
* \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
|
| 596 |
+
*
|
| 597 |
+
* The x,y of the viewport rect represents the origin for rendering.
|
| 598 |
+
*
|
| 599 |
+
* \return 0 on success, or -1 on error
|
| 600 |
+
*
|
| 601 |
+
* \note If the window associated with the renderer is resized, the viewport is automatically reset.
|
| 602 |
+
*
|
| 603 |
+
* \sa SDL_RenderGetViewport()
|
| 604 |
+
* \sa SDL_RenderSetLogicalSize()
|
| 605 |
+
*/
|
| 606 |
+
extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
|
| 607 |
+
const SDL_Rect * rect);
|
| 608 |
+
|
| 609 |
+
/**
|
| 610 |
+
* \brief Get the drawing area for the current target.
|
| 611 |
+
*
|
| 612 |
+
* \sa SDL_RenderSetViewport()
|
| 613 |
+
*/
|
| 614 |
+
extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
|
| 615 |
+
SDL_Rect * rect);
|
| 616 |
+
|
| 617 |
+
/**
|
| 618 |
+
* \brief Set the clip rectangle for the current target.
|
| 619 |
+
*
|
| 620 |
+
* \param renderer The renderer for which clip rectangle should be set.
|
| 621 |
+
* \param rect A pointer to the rectangle to set as the clip rectangle,
|
| 622 |
+
* relative to the viewport, or NULL to disable clipping.
|
| 623 |
+
*
|
| 624 |
+
* \return 0 on success, or -1 on error
|
| 625 |
+
*
|
| 626 |
+
* \sa SDL_RenderGetClipRect()
|
| 627 |
+
*/
|
| 628 |
+
extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
|
| 629 |
+
const SDL_Rect * rect);
|
| 630 |
+
|
| 631 |
+
/**
|
| 632 |
+
* \brief Get the clip rectangle for the current target.
|
| 633 |
+
*
|
| 634 |
+
* \param renderer The renderer from which clip rectangle should be queried.
|
| 635 |
+
* \param rect A pointer filled in with the current clip rectangle, or
|
| 636 |
+
* an empty rectangle if clipping is disabled.
|
| 637 |
+
*
|
| 638 |
+
* \sa SDL_RenderSetClipRect()
|
| 639 |
+
*/
|
| 640 |
+
extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer,
|
| 641 |
+
SDL_Rect * rect);
|
| 642 |
+
|
| 643 |
+
/**
|
| 644 |
+
* \brief Get whether clipping is enabled on the given renderer.
|
| 645 |
+
*
|
| 646 |
+
* \param renderer The renderer from which clip state should be queried.
|
| 647 |
+
*
|
| 648 |
+
* \sa SDL_RenderGetClipRect()
|
| 649 |
+
*/
|
| 650 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer);
|
| 651 |
+
|
| 652 |
+
|
| 653 |
+
/**
|
| 654 |
+
* \brief Set the drawing scale for rendering on the current target.
|
| 655 |
+
*
|
| 656 |
+
* \param renderer The renderer for which the drawing scale should be set.
|
| 657 |
+
* \param scaleX The horizontal scaling factor
|
| 658 |
+
* \param scaleY The vertical scaling factor
|
| 659 |
+
*
|
| 660 |
+
* The drawing coordinates are scaled by the x/y scaling factors
|
| 661 |
+
* before they are used by the renderer. This allows resolution
|
| 662 |
+
* independent drawing with a single coordinate system.
|
| 663 |
+
*
|
| 664 |
+
* \note If this results in scaling or subpixel drawing by the
|
| 665 |
+
* rendering backend, it will be handled using the appropriate
|
| 666 |
+
* quality hints. For best results use integer scaling factors.
|
| 667 |
+
*
|
| 668 |
+
* \sa SDL_RenderGetScale()
|
| 669 |
+
* \sa SDL_RenderSetLogicalSize()
|
| 670 |
+
*/
|
| 671 |
+
extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer,
|
| 672 |
+
float scaleX, float scaleY);
|
| 673 |
+
|
| 674 |
+
/**
|
| 675 |
+
* \brief Get the drawing scale for the current target.
|
| 676 |
+
*
|
| 677 |
+
* \param renderer The renderer from which drawing scale should be queried.
|
| 678 |
+
* \param scaleX A pointer filled in with the horizontal scaling factor
|
| 679 |
+
* \param scaleY A pointer filled in with the vertical scaling factor
|
| 680 |
+
*
|
| 681 |
+
* \sa SDL_RenderSetScale()
|
| 682 |
+
*/
|
| 683 |
+
extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer,
|
| 684 |
+
float *scaleX, float *scaleY);
|
| 685 |
+
|
| 686 |
+
/**
|
| 687 |
+
* \brief Set the color used for drawing operations (Rect, Line and Clear).
|
| 688 |
+
*
|
| 689 |
+
* \param renderer The renderer for which drawing color should be set.
|
| 690 |
+
* \param r The red value used to draw on the rendering target.
|
| 691 |
+
* \param g The green value used to draw on the rendering target.
|
| 692 |
+
* \param b The blue value used to draw on the rendering target.
|
| 693 |
+
* \param a The alpha value used to draw on the rendering target, usually
|
| 694 |
+
* ::SDL_ALPHA_OPAQUE (255).
|
| 695 |
+
*
|
| 696 |
+
* \return 0 on success, or -1 on error
|
| 697 |
+
*/
|
| 698 |
+
extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer,
|
| 699 |
+
Uint8 r, Uint8 g, Uint8 b,
|
| 700 |
+
Uint8 a);
|
| 701 |
+
|
| 702 |
+
/**
|
| 703 |
+
* \brief Get the color used for drawing operations (Rect, Line and Clear).
|
| 704 |
+
*
|
| 705 |
+
* \param renderer The renderer from which drawing color should be queried.
|
| 706 |
+
* \param r A pointer to the red value used to draw on the rendering target.
|
| 707 |
+
* \param g A pointer to the green value used to draw on the rendering target.
|
| 708 |
+
* \param b A pointer to the blue value used to draw on the rendering target.
|
| 709 |
+
* \param a A pointer to the alpha value used to draw on the rendering target,
|
| 710 |
+
* usually ::SDL_ALPHA_OPAQUE (255).
|
| 711 |
+
*
|
| 712 |
+
* \return 0 on success, or -1 on error
|
| 713 |
+
*/
|
| 714 |
+
extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer,
|
| 715 |
+
Uint8 * r, Uint8 * g, Uint8 * b,
|
| 716 |
+
Uint8 * a);
|
| 717 |
+
|
| 718 |
+
/**
|
| 719 |
+
* \brief Set the blend mode used for drawing operations (Fill and Line).
|
| 720 |
+
*
|
| 721 |
+
* \param renderer The renderer for which blend mode should be set.
|
| 722 |
+
* \param blendMode ::SDL_BlendMode to use for blending.
|
| 723 |
+
*
|
| 724 |
+
* \return 0 on success, or -1 on error
|
| 725 |
+
*
|
| 726 |
+
* \note If the blend mode is not supported, the closest supported mode is
|
| 727 |
+
* chosen.
|
| 728 |
+
*
|
| 729 |
+
* \sa SDL_GetRenderDrawBlendMode()
|
| 730 |
+
*/
|
| 731 |
+
extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
|
| 732 |
+
SDL_BlendMode blendMode);
|
| 733 |
+
|
| 734 |
+
/**
|
| 735 |
+
* \brief Get the blend mode used for drawing operations.
|
| 736 |
+
*
|
| 737 |
+
* \param renderer The renderer from which blend mode should be queried.
|
| 738 |
+
* \param blendMode A pointer filled in with the current blend mode.
|
| 739 |
+
*
|
| 740 |
+
* \return 0 on success, or -1 on error
|
| 741 |
+
*
|
| 742 |
+
* \sa SDL_SetRenderDrawBlendMode()
|
| 743 |
+
*/
|
| 744 |
+
extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
|
| 745 |
+
SDL_BlendMode *blendMode);
|
| 746 |
+
|
| 747 |
+
/**
|
| 748 |
+
* \brief Clear the current rendering target with the drawing color
|
| 749 |
+
*
|
| 750 |
+
* This function clears the entire rendering target, ignoring the viewport and
|
| 751 |
+
* the clip rectangle.
|
| 752 |
+
*
|
| 753 |
+
* \return 0 on success, or -1 on error
|
| 754 |
+
*/
|
| 755 |
+
extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
|
| 756 |
+
|
| 757 |
+
/**
|
| 758 |
+
* \brief Draw a point on the current rendering target.
|
| 759 |
+
*
|
| 760 |
+
* \param renderer The renderer which should draw a point.
|
| 761 |
+
* \param x The x coordinate of the point.
|
| 762 |
+
* \param y The y coordinate of the point.
|
| 763 |
+
*
|
| 764 |
+
* \return 0 on success, or -1 on error
|
| 765 |
+
*/
|
| 766 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
|
| 767 |
+
int x, int y);
|
| 768 |
+
|
| 769 |
+
/**
|
| 770 |
+
* \brief Draw multiple points on the current rendering target.
|
| 771 |
+
*
|
| 772 |
+
* \param renderer The renderer which should draw multiple points.
|
| 773 |
+
* \param points The points to draw
|
| 774 |
+
* \param count The number of points to draw
|
| 775 |
+
*
|
| 776 |
+
* \return 0 on success, or -1 on error
|
| 777 |
+
*/
|
| 778 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
|
| 779 |
+
const SDL_Point * points,
|
| 780 |
+
int count);
|
| 781 |
+
|
| 782 |
+
/**
|
| 783 |
+
* \brief Draw a line on the current rendering target.
|
| 784 |
+
*
|
| 785 |
+
* \param renderer The renderer which should draw a line.
|
| 786 |
+
* \param x1 The x coordinate of the start point.
|
| 787 |
+
* \param y1 The y coordinate of the start point.
|
| 788 |
+
* \param x2 The x coordinate of the end point.
|
| 789 |
+
* \param y2 The y coordinate of the end point.
|
| 790 |
+
*
|
| 791 |
+
* \return 0 on success, or -1 on error
|
| 792 |
+
*/
|
| 793 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
|
| 794 |
+
int x1, int y1, int x2, int y2);
|
| 795 |
+
|
| 796 |
+
/**
|
| 797 |
+
* \brief Draw a series of connected lines on the current rendering target.
|
| 798 |
+
*
|
| 799 |
+
* \param renderer The renderer which should draw multiple lines.
|
| 800 |
+
* \param points The points along the lines
|
| 801 |
+
* \param count The number of points, drawing count-1 lines
|
| 802 |
+
*
|
| 803 |
+
* \return 0 on success, or -1 on error
|
| 804 |
+
*/
|
| 805 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
|
| 806 |
+
const SDL_Point * points,
|
| 807 |
+
int count);
|
| 808 |
+
|
| 809 |
+
/**
|
| 810 |
+
* \brief Draw a rectangle on the current rendering target.
|
| 811 |
+
*
|
| 812 |
+
* \param renderer The renderer which should draw a rectangle.
|
| 813 |
+
* \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
|
| 814 |
+
*
|
| 815 |
+
* \return 0 on success, or -1 on error
|
| 816 |
+
*/
|
| 817 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
|
| 818 |
+
const SDL_Rect * rect);
|
| 819 |
+
|
| 820 |
+
/**
|
| 821 |
+
* \brief Draw some number of rectangles on the current rendering target.
|
| 822 |
+
*
|
| 823 |
+
* \param renderer The renderer which should draw multiple rectangles.
|
| 824 |
+
* \param rects A pointer to an array of destination rectangles.
|
| 825 |
+
* \param count The number of rectangles.
|
| 826 |
+
*
|
| 827 |
+
* \return 0 on success, or -1 on error
|
| 828 |
+
*/
|
| 829 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
|
| 830 |
+
const SDL_Rect * rects,
|
| 831 |
+
int count);
|
| 832 |
+
|
| 833 |
+
/**
|
| 834 |
+
* \brief Fill a rectangle on the current rendering target with the drawing color.
|
| 835 |
+
*
|
| 836 |
+
* \param renderer The renderer which should fill a rectangle.
|
| 837 |
+
* \param rect A pointer to the destination rectangle, or NULL for the entire
|
| 838 |
+
* rendering target.
|
| 839 |
+
*
|
| 840 |
+
* \return 0 on success, or -1 on error
|
| 841 |
+
*/
|
| 842 |
+
extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
|
| 843 |
+
const SDL_Rect * rect);
|
| 844 |
+
|
| 845 |
+
/**
|
| 846 |
+
* \brief Fill some number of rectangles on the current rendering target with the drawing color.
|
| 847 |
+
*
|
| 848 |
+
* \param renderer The renderer which should fill multiple rectangles.
|
| 849 |
+
* \param rects A pointer to an array of destination rectangles.
|
| 850 |
+
* \param count The number of rectangles.
|
| 851 |
+
*
|
| 852 |
+
* \return 0 on success, or -1 on error
|
| 853 |
+
*/
|
| 854 |
+
extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
|
| 855 |
+
const SDL_Rect * rects,
|
| 856 |
+
int count);
|
| 857 |
+
|
| 858 |
+
/**
|
| 859 |
+
* \brief Copy a portion of the texture to the current rendering target.
|
| 860 |
+
*
|
| 861 |
+
* \param renderer The renderer which should copy parts of a texture.
|
| 862 |
+
* \param texture The source texture.
|
| 863 |
+
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
| 864 |
+
* texture.
|
| 865 |
+
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
| 866 |
+
* entire rendering target.
|
| 867 |
+
*
|
| 868 |
+
* \return 0 on success, or -1 on error
|
| 869 |
+
*/
|
| 870 |
+
extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
|
| 871 |
+
SDL_Texture * texture,
|
| 872 |
+
const SDL_Rect * srcrect,
|
| 873 |
+
const SDL_Rect * dstrect);
|
| 874 |
+
|
| 875 |
+
/**
|
| 876 |
+
* \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
|
| 877 |
+
*
|
| 878 |
+
* \param renderer The renderer which should copy parts of a texture.
|
| 879 |
+
* \param texture The source texture.
|
| 880 |
+
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
| 881 |
+
* texture.
|
| 882 |
+
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
| 883 |
+
* entire rendering target.
|
| 884 |
+
* \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
|
| 885 |
+
* \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
|
| 886 |
+
* \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
|
| 887 |
+
*
|
| 888 |
+
* \return 0 on success, or -1 on error
|
| 889 |
+
*/
|
| 890 |
+
extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer,
|
| 891 |
+
SDL_Texture * texture,
|
| 892 |
+
const SDL_Rect * srcrect,
|
| 893 |
+
const SDL_Rect * dstrect,
|
| 894 |
+
const double angle,
|
| 895 |
+
const SDL_Point *center,
|
| 896 |
+
const SDL_RendererFlip flip);
|
| 897 |
+
|
| 898 |
+
|
| 899 |
+
/**
|
| 900 |
+
* \brief Draw a point on the current rendering target.
|
| 901 |
+
*
|
| 902 |
+
* \param renderer The renderer which should draw a point.
|
| 903 |
+
* \param x The x coordinate of the point.
|
| 904 |
+
* \param y The y coordinate of the point.
|
| 905 |
+
*
|
| 906 |
+
* \return 0 on success, or -1 on error
|
| 907 |
+
*/
|
| 908 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer,
|
| 909 |
+
float x, float y);
|
| 910 |
+
|
| 911 |
+
/**
|
| 912 |
+
* \brief Draw multiple points on the current rendering target.
|
| 913 |
+
*
|
| 914 |
+
* \param renderer The renderer which should draw multiple points.
|
| 915 |
+
* \param points The points to draw
|
| 916 |
+
* \param count The number of points to draw
|
| 917 |
+
*
|
| 918 |
+
* \return 0 on success, or -1 on error
|
| 919 |
+
*/
|
| 920 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer,
|
| 921 |
+
const SDL_FPoint * points,
|
| 922 |
+
int count);
|
| 923 |
+
|
| 924 |
+
/**
|
| 925 |
+
* \brief Draw a line on the current rendering target.
|
| 926 |
+
*
|
| 927 |
+
* \param renderer The renderer which should draw a line.
|
| 928 |
+
* \param x1 The x coordinate of the start point.
|
| 929 |
+
* \param y1 The y coordinate of the start point.
|
| 930 |
+
* \param x2 The x coordinate of the end point.
|
| 931 |
+
* \param y2 The y coordinate of the end point.
|
| 932 |
+
*
|
| 933 |
+
* \return 0 on success, or -1 on error
|
| 934 |
+
*/
|
| 935 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer,
|
| 936 |
+
float x1, float y1, float x2, float y2);
|
| 937 |
+
|
| 938 |
+
/**
|
| 939 |
+
* \brief Draw a series of connected lines on the current rendering target.
|
| 940 |
+
*
|
| 941 |
+
* \param renderer The renderer which should draw multiple lines.
|
| 942 |
+
* \param points The points along the lines
|
| 943 |
+
* \param count The number of points, drawing count-1 lines
|
| 944 |
+
*
|
| 945 |
+
* \return 0 on success, or -1 on error
|
| 946 |
+
*/
|
| 947 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer,
|
| 948 |
+
const SDL_FPoint * points,
|
| 949 |
+
int count);
|
| 950 |
+
|
| 951 |
+
/**
|
| 952 |
+
* \brief Draw a rectangle on the current rendering target.
|
| 953 |
+
*
|
| 954 |
+
* \param renderer The renderer which should draw a rectangle.
|
| 955 |
+
* \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
|
| 956 |
+
*
|
| 957 |
+
* \return 0 on success, or -1 on error
|
| 958 |
+
*/
|
| 959 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer,
|
| 960 |
+
const SDL_FRect * rect);
|
| 961 |
+
|
| 962 |
+
/**
|
| 963 |
+
* \brief Draw some number of rectangles on the current rendering target.
|
| 964 |
+
*
|
| 965 |
+
* \param renderer The renderer which should draw multiple rectangles.
|
| 966 |
+
* \param rects A pointer to an array of destination rectangles.
|
| 967 |
+
* \param count The number of rectangles.
|
| 968 |
+
*
|
| 969 |
+
* \return 0 on success, or -1 on error
|
| 970 |
+
*/
|
| 971 |
+
extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer,
|
| 972 |
+
const SDL_FRect * rects,
|
| 973 |
+
int count);
|
| 974 |
+
|
| 975 |
+
/**
|
| 976 |
+
* \brief Fill a rectangle on the current rendering target with the drawing color.
|
| 977 |
+
*
|
| 978 |
+
* \param renderer The renderer which should fill a rectangle.
|
| 979 |
+
* \param rect A pointer to the destination rectangle, or NULL for the entire
|
| 980 |
+
* rendering target.
|
| 981 |
+
*
|
| 982 |
+
* \return 0 on success, or -1 on error
|
| 983 |
+
*/
|
| 984 |
+
extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer,
|
| 985 |
+
const SDL_FRect * rect);
|
| 986 |
+
|
| 987 |
+
/**
|
| 988 |
+
* \brief Fill some number of rectangles on the current rendering target with the drawing color.
|
| 989 |
+
*
|
| 990 |
+
* \param renderer The renderer which should fill multiple rectangles.
|
| 991 |
+
* \param rects A pointer to an array of destination rectangles.
|
| 992 |
+
* \param count The number of rectangles.
|
| 993 |
+
*
|
| 994 |
+
* \return 0 on success, or -1 on error
|
| 995 |
+
*/
|
| 996 |
+
extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer,
|
| 997 |
+
const SDL_FRect * rects,
|
| 998 |
+
int count);
|
| 999 |
+
|
| 1000 |
+
/**
|
| 1001 |
+
* \brief Copy a portion of the texture to the current rendering target.
|
| 1002 |
+
*
|
| 1003 |
+
* \param renderer The renderer which should copy parts of a texture.
|
| 1004 |
+
* \param texture The source texture.
|
| 1005 |
+
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
| 1006 |
+
* texture.
|
| 1007 |
+
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
| 1008 |
+
* entire rendering target.
|
| 1009 |
+
*
|
| 1010 |
+
* \return 0 on success, or -1 on error
|
| 1011 |
+
*/
|
| 1012 |
+
extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer,
|
| 1013 |
+
SDL_Texture * texture,
|
| 1014 |
+
const SDL_Rect * srcrect,
|
| 1015 |
+
const SDL_FRect * dstrect);
|
| 1016 |
+
|
| 1017 |
+
/**
|
| 1018 |
+
* \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
|
| 1019 |
+
*
|
| 1020 |
+
* \param renderer The renderer which should copy parts of a texture.
|
| 1021 |
+
* \param texture The source texture.
|
| 1022 |
+
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
| 1023 |
+
* texture.
|
| 1024 |
+
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
| 1025 |
+
* entire rendering target.
|
| 1026 |
+
* \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
|
| 1027 |
+
* \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
|
| 1028 |
+
* \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
|
| 1029 |
+
*
|
| 1030 |
+
* \return 0 on success, or -1 on error
|
| 1031 |
+
*/
|
| 1032 |
+
extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer,
|
| 1033 |
+
SDL_Texture * texture,
|
| 1034 |
+
const SDL_Rect * srcrect,
|
| 1035 |
+
const SDL_FRect * dstrect,
|
| 1036 |
+
const double angle,
|
| 1037 |
+
const SDL_FPoint *center,
|
| 1038 |
+
const SDL_RendererFlip flip);
|
| 1039 |
+
|
| 1040 |
+
/**
|
| 1041 |
+
* \brief Read pixels from the current rendering target.
|
| 1042 |
+
*
|
| 1043 |
+
* \param renderer The renderer from which pixels should be read.
|
| 1044 |
+
* \param rect A pointer to the rectangle to read, or NULL for the entire
|
| 1045 |
+
* render target.
|
| 1046 |
+
* \param format The desired format of the pixel data, or 0 to use the format
|
| 1047 |
+
* of the rendering target
|
| 1048 |
+
* \param pixels A pointer to be filled in with the pixel data
|
| 1049 |
+
* \param pitch The pitch of the pixels parameter.
|
| 1050 |
+
*
|
| 1051 |
+
* \return 0 on success, or -1 if pixel reading is not supported.
|
| 1052 |
+
*
|
| 1053 |
+
* \warning This is a very slow operation, and should not be used frequently.
|
| 1054 |
+
*/
|
| 1055 |
+
extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
|
| 1056 |
+
const SDL_Rect * rect,
|
| 1057 |
+
Uint32 format,
|
| 1058 |
+
void *pixels, int pitch);
|
| 1059 |
+
|
| 1060 |
+
/**
|
| 1061 |
+
* \brief Update the screen with rendering performed.
|
| 1062 |
+
*/
|
| 1063 |
+
extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
|
| 1064 |
+
|
| 1065 |
+
/**
|
| 1066 |
+
* \brief Destroy the specified texture.
|
| 1067 |
+
*
|
| 1068 |
+
* \sa SDL_CreateTexture()
|
| 1069 |
+
* \sa SDL_CreateTextureFromSurface()
|
| 1070 |
+
*/
|
| 1071 |
+
extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
|
| 1072 |
+
|
| 1073 |
+
/**
|
| 1074 |
+
* \brief Destroy the rendering context for a window and free associated
|
| 1075 |
+
* textures.
|
| 1076 |
+
*
|
| 1077 |
+
* \sa SDL_CreateRenderer()
|
| 1078 |
+
*/
|
| 1079 |
+
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
|
| 1080 |
+
|
| 1081 |
+
/**
|
| 1082 |
+
* \brief Force the rendering context to flush any pending commands to the
|
| 1083 |
+
* underlying rendering API.
|
| 1084 |
+
*
|
| 1085 |
+
* You do not need to (and in fact, shouldn't) call this function unless
|
| 1086 |
+
* you are planning to call into OpenGL/Direct3D/Metal/whatever directly
|
| 1087 |
+
* in addition to using an SDL_Renderer.
|
| 1088 |
+
*
|
| 1089 |
+
* This is for a very-specific case: if you are using SDL's render API,
|
| 1090 |
+
* you asked for a specific renderer backend (OpenGL, Direct3D, etc),
|
| 1091 |
+
* you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make
|
| 1092 |
+
* OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of
|
| 1093 |
+
* this applies, you should call SDL_RenderFlush() between calls to SDL's
|
| 1094 |
+
* render API and the low-level API you're using in cooperation.
|
| 1095 |
+
*
|
| 1096 |
+
* In all other cases, you can ignore this function. This is only here to
|
| 1097 |
+
* get maximum performance out of a specific situation. In all other cases,
|
| 1098 |
+
* SDL will do the right thing, perhaps at a performance loss.
|
| 1099 |
+
*
|
| 1100 |
+
* This function is first available in SDL 2.0.10, and is not needed in
|
| 1101 |
+
* 2.0.9 and earlier, as earlier versions did not queue rendering commands
|
| 1102 |
+
* at all, instead flushing them to the OS immediately.
|
| 1103 |
+
*/
|
| 1104 |
+
extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer);
|
| 1105 |
+
|
| 1106 |
+
|
| 1107 |
+
/**
|
| 1108 |
+
* \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
|
| 1109 |
+
* OpenGL instructions.
|
| 1110 |
+
*
|
| 1111 |
+
* \param texture The SDL texture to bind
|
| 1112 |
+
* \param texw A pointer to a float that will be filled with the texture width
|
| 1113 |
+
* \param texh A pointer to a float that will be filled with the texture height
|
| 1114 |
+
*
|
| 1115 |
+
* \return 0 on success, or -1 if the operation is not supported
|
| 1116 |
+
*/
|
| 1117 |
+
extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
|
| 1118 |
+
|
| 1119 |
+
/**
|
| 1120 |
+
* \brief Unbind a texture from the current OpenGL/ES/ES2 context.
|
| 1121 |
+
*
|
| 1122 |
+
* \param texture The SDL texture to unbind
|
| 1123 |
+
*
|
| 1124 |
+
* \return 0 on success, or -1 if the operation is not supported
|
| 1125 |
+
*/
|
| 1126 |
+
extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture);
|
| 1127 |
+
|
| 1128 |
+
/**
|
| 1129 |
+
* \brief Get the CAMetalLayer associated with the given Metal renderer
|
| 1130 |
+
*
|
| 1131 |
+
* \param renderer The renderer to query
|
| 1132 |
+
*
|
| 1133 |
+
* \return CAMetalLayer* on success, or NULL if the renderer isn't a Metal renderer
|
| 1134 |
+
*
|
| 1135 |
+
* \sa SDL_RenderGetMetalCommandEncoder()
|
| 1136 |
+
*/
|
| 1137 |
+
extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer);
|
| 1138 |
+
|
| 1139 |
+
/**
|
| 1140 |
+
* \brief Get the Metal command encoder for the current frame
|
| 1141 |
+
*
|
| 1142 |
+
* \param renderer The renderer to query
|
| 1143 |
+
*
|
| 1144 |
+
* \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer
|
| 1145 |
+
*
|
| 1146 |
+
* \sa SDL_RenderGetMetalLayer()
|
| 1147 |
+
*/
|
| 1148 |
+
extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer);
|
| 1149 |
+
|
| 1150 |
+
/* Ends C function definitions when using C++ */
|
| 1151 |
+
#ifdef __cplusplus
|
| 1152 |
+
}
|
| 1153 |
+
#endif
|
| 1154 |
+
#include "close_code.h"
|
| 1155 |
+
|
| 1156 |
+
#endif /* SDL_render_h_ */
|
| 1157 |
+
|
| 1158 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/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ken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_rwops.h
|
| 24 |
+
*
|
| 25 |
+
* This file provides a general interface for SDL to read and write
|
| 26 |
+
* data streams. It can easily be extended to files, memory, etc.
|
| 27 |
+
*/
|
| 28 |
+
|
| 29 |
+
#ifndef SDL_rwops_h_
|
| 30 |
+
#define SDL_rwops_h_
|
| 31 |
+
|
| 32 |
+
#include "SDL_stdinc.h"
|
| 33 |
+
#include "SDL_error.h"
|
| 34 |
+
|
| 35 |
+
#include "begin_code.h"
|
| 36 |
+
/* Set up for C function definitions, even when using C++ */
|
| 37 |
+
#ifdef __cplusplus
|
| 38 |
+
extern "C" {
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
/* RWops Types */
|
| 42 |
+
#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */
|
| 43 |
+
#define SDL_RWOPS_WINFILE 1U /**< Win32 file */
|
| 44 |
+
#define SDL_RWOPS_STDFILE 2U /**< Stdio file */
|
| 45 |
+
#define SDL_RWOPS_JNIFILE 3U /**< Android asset */
|
| 46 |
+
#define SDL_RWOPS_MEMORY 4U /**< Memory stream */
|
| 47 |
+
#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* This is the read/write operation structure -- very basic.
|
| 51 |
+
*/
|
| 52 |
+
typedef struct SDL_RWops
|
| 53 |
+
{
|
| 54 |
+
/**
|
| 55 |
+
* Return the size of the file in this rwops, or -1 if unknown
|
| 56 |
+
*/
|
| 57 |
+
Sint64 (SDLCALL * size) (struct SDL_RWops * context);
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* Seek to \c offset relative to \c whence, one of stdio's whence values:
|
| 61 |
+
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
|
| 62 |
+
*
|
| 63 |
+
* \return the final offset in the data stream, or -1 on error.
|
| 64 |
+
*/
|
| 65 |
+
Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
|
| 66 |
+
int whence);
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* Read up to \c maxnum objects each of size \c size from the data
|
| 70 |
+
* stream to the area pointed at by \c ptr.
|
| 71 |
+
*
|
| 72 |
+
* \return the number of objects read, or 0 at error or end of file.
|
| 73 |
+
*/
|
| 74 |
+
size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
|
| 75 |
+
size_t size, size_t maxnum);
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* Write exactly \c num objects each of size \c size from the area
|
| 79 |
+
* pointed at by \c ptr to data stream.
|
| 80 |
+
*
|
| 81 |
+
* \return the number of objects written, or 0 at error or end of file.
|
| 82 |
+
*/
|
| 83 |
+
size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
|
| 84 |
+
size_t size, size_t num);
|
| 85 |
+
|
| 86 |
+
/**
|
| 87 |
+
* Close and free an allocated SDL_RWops structure.
|
| 88 |
+
*
|
| 89 |
+
* \return 0 if successful or -1 on write error when flushing data.
|
| 90 |
+
*/
|
| 91 |
+
int (SDLCALL * close) (struct SDL_RWops * context);
|
| 92 |
+
|
| 93 |
+
Uint32 type;
|
| 94 |
+
union
|
| 95 |
+
{
|
| 96 |
+
#if defined(__ANDROID__)
|
| 97 |
+
struct
|
| 98 |
+
{
|
| 99 |
+
void *fileNameRef;
|
| 100 |
+
void *inputStreamRef;
|
| 101 |
+
void *readableByteChannelRef;
|
| 102 |
+
void *readMethod;
|
| 103 |
+
void *assetFileDescriptorRef;
|
| 104 |
+
long position;
|
| 105 |
+
long size;
|
| 106 |
+
long offset;
|
| 107 |
+
int fd;
|
| 108 |
+
} androidio;
|
| 109 |
+
#elif defined(__WIN32__)
|
| 110 |
+
struct
|
| 111 |
+
{
|
| 112 |
+
SDL_bool append;
|
| 113 |
+
void *h;
|
| 114 |
+
struct
|
| 115 |
+
{
|
| 116 |
+
void *data;
|
| 117 |
+
size_t size;
|
| 118 |
+
size_t left;
|
| 119 |
+
} buffer;
|
| 120 |
+
} windowsio;
|
| 121 |
+
#endif
|
| 122 |
+
|
| 123 |
+
#ifdef HAVE_STDIO_H
|
| 124 |
+
struct
|
| 125 |
+
{
|
| 126 |
+
SDL_bool autoclose;
|
| 127 |
+
FILE *fp;
|
| 128 |
+
} stdio;
|
| 129 |
+
#endif
|
| 130 |
+
struct
|
| 131 |
+
{
|
| 132 |
+
Uint8 *base;
|
| 133 |
+
Uint8 *here;
|
| 134 |
+
Uint8 *stop;
|
| 135 |
+
} mem;
|
| 136 |
+
struct
|
| 137 |
+
{
|
| 138 |
+
void *data1;
|
| 139 |
+
void *data2;
|
| 140 |
+
} unknown;
|
| 141 |
+
} hidden;
|
| 142 |
+
|
| 143 |
+
} SDL_RWops;
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* \name RWFrom functions
|
| 148 |
+
*
|
| 149 |
+
* Functions to create SDL_RWops structures from various data streams.
|
| 150 |
+
*/
|
| 151 |
+
/* @{ */
|
| 152 |
+
|
| 153 |
+
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
|
| 154 |
+
const char *mode);
|
| 155 |
+
|
| 156 |
+
#ifdef HAVE_STDIO_H
|
| 157 |
+
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
|
| 158 |
+
SDL_bool autoclose);
|
| 159 |
+
#else
|
| 160 |
+
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
|
| 161 |
+
SDL_bool autoclose);
|
| 162 |
+
#endif
|
| 163 |
+
|
| 164 |
+
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
|
| 165 |
+
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
|
| 166 |
+
int size);
|
| 167 |
+
|
| 168 |
+
/* @} *//* RWFrom functions */
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
|
| 172 |
+
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
| 173 |
+
|
| 174 |
+
#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
|
| 175 |
+
#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
|
| 176 |
+
#define RW_SEEK_END 2 /**< Seek relative to the end of data */
|
| 177 |
+
|
| 178 |
+
/**
|
| 179 |
+
* Return the size of the file in this rwops, or -1 if unknown
|
| 180 |
+
*/
|
| 181 |
+
extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
|
| 182 |
+
|
| 183 |
+
/**
|
| 184 |
+
* Seek to \c offset relative to \c whence, one of stdio's whence values:
|
| 185 |
+
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
|
| 186 |
+
*
|
| 187 |
+
* \return the final offset in the data stream, or -1 on error.
|
| 188 |
+
*/
|
| 189 |
+
extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
|
| 190 |
+
Sint64 offset, int whence);
|
| 191 |
+
|
| 192 |
+
/**
|
| 193 |
+
* Return the current offset in the data stream, or -1 on error.
|
| 194 |
+
*/
|
| 195 |
+
extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
|
| 196 |
+
|
| 197 |
+
/**
|
| 198 |
+
* Read up to \c maxnum objects each of size \c size from the data
|
| 199 |
+
* stream to the area pointed at by \c ptr.
|
| 200 |
+
*
|
| 201 |
+
* \return the number of objects read, or 0 at error or end of file.
|
| 202 |
+
*/
|
| 203 |
+
extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
|
| 204 |
+
void *ptr, size_t size, size_t maxnum);
|
| 205 |
+
|
| 206 |
+
/**
|
| 207 |
+
* Write exactly \c num objects each of size \c size from the area
|
| 208 |
+
* pointed at by \c ptr to data stream.
|
| 209 |
+
*
|
| 210 |
+
* \return the number of objects written, or 0 at error or end of file.
|
| 211 |
+
*/
|
| 212 |
+
extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
|
| 213 |
+
const void *ptr, size_t size, size_t num);
|
| 214 |
+
|
| 215 |
+
/**
|
| 216 |
+
* Close and free an allocated SDL_RWops structure.
|
| 217 |
+
*
|
| 218 |
+
* \return 0 if successful or -1 on write error when flushing data.
|
| 219 |
+
*/
|
| 220 |
+
extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
|
| 221 |
+
|
| 222 |
+
/**
|
| 223 |
+
* Load all the data from an SDL data stream.
|
| 224 |
+
*
|
| 225 |
+
* The data is allocated with a zero byte at the end (null terminated)
|
| 226 |
+
*
|
| 227 |
+
* If \c datasize is not NULL, it is filled with the size of the data read.
|
| 228 |
+
*
|
| 229 |
+
* If \c freesrc is non-zero, the stream will be closed after being read.
|
| 230 |
+
*
|
| 231 |
+
* The data should be freed with SDL_free().
|
| 232 |
+
*
|
| 233 |
+
* \return the data, or NULL if there was an error.
|
| 234 |
+
*/
|
| 235 |
+
extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize,
|
| 236 |
+
int freesrc);
|
| 237 |
+
|
| 238 |
+
/**
|
| 239 |
+
* Load an entire file.
|
| 240 |
+
*
|
| 241 |
+
* The data is allocated with a zero byte at the end (null terminated)
|
| 242 |
+
*
|
| 243 |
+
* If \c datasize is not NULL, it is filled with the size of the data read.
|
| 244 |
+
*
|
| 245 |
+
* If \c freesrc is non-zero, the stream will be closed after being read.
|
| 246 |
+
*
|
| 247 |
+
* The data should be freed with SDL_free().
|
| 248 |
+
*
|
| 249 |
+
* \return the data, or NULL if there was an error.
|
| 250 |
+
*/
|
| 251 |
+
extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
| 252 |
+
|
| 253 |
+
/**
|
| 254 |
+
* \name Read endian functions
|
| 255 |
+
*
|
| 256 |
+
* Read an item of the specified endianness and return in native format.
|
| 257 |
+
*/
|
| 258 |
+
/* @{ */
|
| 259 |
+
extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
|
| 260 |
+
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
| 261 |
+
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
| 262 |
+
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
| 263 |
+
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
| 264 |
+
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
| 265 |
+
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
| 266 |
+
/* @} *//* Read endian functions */
|
| 267 |
+
|
| 268 |
+
/**
|
| 269 |
+
* \name Write endian functions
|
| 270 |
+
*
|
| 271 |
+
* Write an item of native format to the specified endianness.
|
| 272 |
+
*/
|
| 273 |
+
/* @{ */
|
| 274 |
+
extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
|
| 275 |
+
extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
|
| 276 |
+
extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
| 277 |
+
extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
| 278 |
+
extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
| 279 |
+
extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
| 280 |
+
extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
|
| 281 |
+
/* @} *//* Write endian functions */
|
| 282 |
+
|
| 283 |
+
/* Ends C function definitions when using C++ */
|
| 284 |
+
#ifdef __cplusplus
|
| 285 |
+
}
|
| 286 |
+
#endif
|
| 287 |
+
#include "close_code.h"
|
| 288 |
+
|
| 289 |
+
#endif /* SDL_rwops_h_ */
|
| 290 |
+
|
| 291 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_scancode.h
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_scancode.h
|
| 24 |
+
*
|
| 25 |
+
* Defines keyboard scancodes.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_scancode_h_
|
| 29 |
+
#define SDL_scancode_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* \brief The SDL keyboard scancode representation.
|
| 35 |
+
*
|
| 36 |
+
* Values of this type are used to represent keyboard keys, among other places
|
| 37 |
+
* in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
|
| 38 |
+
* SDL_Event structure.
|
| 39 |
+
*
|
| 40 |
+
* The values in this enumeration are based on the USB usage page standard:
|
| 41 |
+
* https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
|
| 42 |
+
*/
|
| 43 |
+
typedef enum
|
| 44 |
+
{
|
| 45 |
+
SDL_SCANCODE_UNKNOWN = 0,
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* \name Usage page 0x07
|
| 49 |
+
*
|
| 50 |
+
* These values are from usage page 0x07 (USB keyboard page).
|
| 51 |
+
*/
|
| 52 |
+
/* @{ */
|
| 53 |
+
|
| 54 |
+
SDL_SCANCODE_A = 4,
|
| 55 |
+
SDL_SCANCODE_B = 5,
|
| 56 |
+
SDL_SCANCODE_C = 6,
|
| 57 |
+
SDL_SCANCODE_D = 7,
|
| 58 |
+
SDL_SCANCODE_E = 8,
|
| 59 |
+
SDL_SCANCODE_F = 9,
|
| 60 |
+
SDL_SCANCODE_G = 10,
|
| 61 |
+
SDL_SCANCODE_H = 11,
|
| 62 |
+
SDL_SCANCODE_I = 12,
|
| 63 |
+
SDL_SCANCODE_J = 13,
|
| 64 |
+
SDL_SCANCODE_K = 14,
|
| 65 |
+
SDL_SCANCODE_L = 15,
|
| 66 |
+
SDL_SCANCODE_M = 16,
|
| 67 |
+
SDL_SCANCODE_N = 17,
|
| 68 |
+
SDL_SCANCODE_O = 18,
|
| 69 |
+
SDL_SCANCODE_P = 19,
|
| 70 |
+
SDL_SCANCODE_Q = 20,
|
| 71 |
+
SDL_SCANCODE_R = 21,
|
| 72 |
+
SDL_SCANCODE_S = 22,
|
| 73 |
+
SDL_SCANCODE_T = 23,
|
| 74 |
+
SDL_SCANCODE_U = 24,
|
| 75 |
+
SDL_SCANCODE_V = 25,
|
| 76 |
+
SDL_SCANCODE_W = 26,
|
| 77 |
+
SDL_SCANCODE_X = 27,
|
| 78 |
+
SDL_SCANCODE_Y = 28,
|
| 79 |
+
SDL_SCANCODE_Z = 29,
|
| 80 |
+
|
| 81 |
+
SDL_SCANCODE_1 = 30,
|
| 82 |
+
SDL_SCANCODE_2 = 31,
|
| 83 |
+
SDL_SCANCODE_3 = 32,
|
| 84 |
+
SDL_SCANCODE_4 = 33,
|
| 85 |
+
SDL_SCANCODE_5 = 34,
|
| 86 |
+
SDL_SCANCODE_6 = 35,
|
| 87 |
+
SDL_SCANCODE_7 = 36,
|
| 88 |
+
SDL_SCANCODE_8 = 37,
|
| 89 |
+
SDL_SCANCODE_9 = 38,
|
| 90 |
+
SDL_SCANCODE_0 = 39,
|
| 91 |
+
|
| 92 |
+
SDL_SCANCODE_RETURN = 40,
|
| 93 |
+
SDL_SCANCODE_ESCAPE = 41,
|
| 94 |
+
SDL_SCANCODE_BACKSPACE = 42,
|
| 95 |
+
SDL_SCANCODE_TAB = 43,
|
| 96 |
+
SDL_SCANCODE_SPACE = 44,
|
| 97 |
+
|
| 98 |
+
SDL_SCANCODE_MINUS = 45,
|
| 99 |
+
SDL_SCANCODE_EQUALS = 46,
|
| 100 |
+
SDL_SCANCODE_LEFTBRACKET = 47,
|
| 101 |
+
SDL_SCANCODE_RIGHTBRACKET = 48,
|
| 102 |
+
SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return
|
| 103 |
+
* key on ISO keyboards and at the right end
|
| 104 |
+
* of the QWERTY row on ANSI keyboards.
|
| 105 |
+
* Produces REVERSE SOLIDUS (backslash) and
|
| 106 |
+
* VERTICAL LINE in a US layout, REVERSE
|
| 107 |
+
* SOLIDUS and VERTICAL LINE in a UK Mac
|
| 108 |
+
* layout, NUMBER SIGN and TILDE in a UK
|
| 109 |
+
* Windows layout, DOLLAR SIGN and POUND SIGN
|
| 110 |
+
* in a Swiss German layout, NUMBER SIGN and
|
| 111 |
+
* APOSTROPHE in a German layout, GRAVE
|
| 112 |
+
* ACCENT and POUND SIGN in a French Mac
|
| 113 |
+
* layout, and ASTERISK and MICRO SIGN in a
|
| 114 |
+
* French Windows layout.
|
| 115 |
+
*/
|
| 116 |
+
SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
|
| 117 |
+
* instead of 49 for the same key, but all
|
| 118 |
+
* OSes I've seen treat the two codes
|
| 119 |
+
* identically. So, as an implementor, unless
|
| 120 |
+
* your keyboard generates both of those
|
| 121 |
+
* codes and your OS treats them differently,
|
| 122 |
+
* you should generate SDL_SCANCODE_BACKSLASH
|
| 123 |
+
* instead of this code. As a user, you
|
| 124 |
+
* should not rely on this code because SDL
|
| 125 |
+
* will never generate it with most (all?)
|
| 126 |
+
* keyboards.
|
| 127 |
+
*/
|
| 128 |
+
SDL_SCANCODE_SEMICOLON = 51,
|
| 129 |
+
SDL_SCANCODE_APOSTROPHE = 52,
|
| 130 |
+
SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI
|
| 131 |
+
* and ISO keyboards). Produces GRAVE ACCENT and
|
| 132 |
+
* TILDE in a US Windows layout and in US and UK
|
| 133 |
+
* Mac layouts on ANSI keyboards, GRAVE ACCENT
|
| 134 |
+
* and NOT SIGN in a UK Windows layout, SECTION
|
| 135 |
+
* SIGN and PLUS-MINUS SIGN in US and UK Mac
|
| 136 |
+
* layouts on ISO keyboards, SECTION SIGN and
|
| 137 |
+
* DEGREE SIGN in a Swiss German layout (Mac:
|
| 138 |
+
* only on ISO keyboards), CIRCUMFLEX ACCENT and
|
| 139 |
+
* DEGREE SIGN in a German layout (Mac: only on
|
| 140 |
+
* ISO keyboards), SUPERSCRIPT TWO and TILDE in a
|
| 141 |
+
* French Windows layout, COMMERCIAL AT and
|
| 142 |
+
* NUMBER SIGN in a French Mac layout on ISO
|
| 143 |
+
* keyboards, and LESS-THAN SIGN and GREATER-THAN
|
| 144 |
+
* SIGN in a Swiss German, German, or French Mac
|
| 145 |
+
* layout on ANSI keyboards.
|
| 146 |
+
*/
|
| 147 |
+
SDL_SCANCODE_COMMA = 54,
|
| 148 |
+
SDL_SCANCODE_PERIOD = 55,
|
| 149 |
+
SDL_SCANCODE_SLASH = 56,
|
| 150 |
+
|
| 151 |
+
SDL_SCANCODE_CAPSLOCK = 57,
|
| 152 |
+
|
| 153 |
+
SDL_SCANCODE_F1 = 58,
|
| 154 |
+
SDL_SCANCODE_F2 = 59,
|
| 155 |
+
SDL_SCANCODE_F3 = 60,
|
| 156 |
+
SDL_SCANCODE_F4 = 61,
|
| 157 |
+
SDL_SCANCODE_F5 = 62,
|
| 158 |
+
SDL_SCANCODE_F6 = 63,
|
| 159 |
+
SDL_SCANCODE_F7 = 64,
|
| 160 |
+
SDL_SCANCODE_F8 = 65,
|
| 161 |
+
SDL_SCANCODE_F9 = 66,
|
| 162 |
+
SDL_SCANCODE_F10 = 67,
|
| 163 |
+
SDL_SCANCODE_F11 = 68,
|
| 164 |
+
SDL_SCANCODE_F12 = 69,
|
| 165 |
+
|
| 166 |
+
SDL_SCANCODE_PRINTSCREEN = 70,
|
| 167 |
+
SDL_SCANCODE_SCROLLLOCK = 71,
|
| 168 |
+
SDL_SCANCODE_PAUSE = 72,
|
| 169 |
+
SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
|
| 170 |
+
does send code 73, not 117) */
|
| 171 |
+
SDL_SCANCODE_HOME = 74,
|
| 172 |
+
SDL_SCANCODE_PAGEUP = 75,
|
| 173 |
+
SDL_SCANCODE_DELETE = 76,
|
| 174 |
+
SDL_SCANCODE_END = 77,
|
| 175 |
+
SDL_SCANCODE_PAGEDOWN = 78,
|
| 176 |
+
SDL_SCANCODE_RIGHT = 79,
|
| 177 |
+
SDL_SCANCODE_LEFT = 80,
|
| 178 |
+
SDL_SCANCODE_DOWN = 81,
|
| 179 |
+
SDL_SCANCODE_UP = 82,
|
| 180 |
+
|
| 181 |
+
SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
|
| 182 |
+
*/
|
| 183 |
+
SDL_SCANCODE_KP_DIVIDE = 84,
|
| 184 |
+
SDL_SCANCODE_KP_MULTIPLY = 85,
|
| 185 |
+
SDL_SCANCODE_KP_MINUS = 86,
|
| 186 |
+
SDL_SCANCODE_KP_PLUS = 87,
|
| 187 |
+
SDL_SCANCODE_KP_ENTER = 88,
|
| 188 |
+
SDL_SCANCODE_KP_1 = 89,
|
| 189 |
+
SDL_SCANCODE_KP_2 = 90,
|
| 190 |
+
SDL_SCANCODE_KP_3 = 91,
|
| 191 |
+
SDL_SCANCODE_KP_4 = 92,
|
| 192 |
+
SDL_SCANCODE_KP_5 = 93,
|
| 193 |
+
SDL_SCANCODE_KP_6 = 94,
|
| 194 |
+
SDL_SCANCODE_KP_7 = 95,
|
| 195 |
+
SDL_SCANCODE_KP_8 = 96,
|
| 196 |
+
SDL_SCANCODE_KP_9 = 97,
|
| 197 |
+
SDL_SCANCODE_KP_0 = 98,
|
| 198 |
+
SDL_SCANCODE_KP_PERIOD = 99,
|
| 199 |
+
|
| 200 |
+
SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
|
| 201 |
+
* keyboards have over ANSI ones,
|
| 202 |
+
* located between left shift and Y.
|
| 203 |
+
* Produces GRAVE ACCENT and TILDE in a
|
| 204 |
+
* US or UK Mac layout, REVERSE SOLIDUS
|
| 205 |
+
* (backslash) and VERTICAL LINE in a
|
| 206 |
+
* US or UK Windows layout, and
|
| 207 |
+
* LESS-THAN SIGN and GREATER-THAN SIGN
|
| 208 |
+
* in a Swiss German, German, or French
|
| 209 |
+
* layout. */
|
| 210 |
+
SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
|
| 211 |
+
SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag,
|
| 212 |
+
* not a physical key - but some Mac keyboards
|
| 213 |
+
* do have a power key. */
|
| 214 |
+
SDL_SCANCODE_KP_EQUALS = 103,
|
| 215 |
+
SDL_SCANCODE_F13 = 104,
|
| 216 |
+
SDL_SCANCODE_F14 = 105,
|
| 217 |
+
SDL_SCANCODE_F15 = 106,
|
| 218 |
+
SDL_SCANCODE_F16 = 107,
|
| 219 |
+
SDL_SCANCODE_F17 = 108,
|
| 220 |
+
SDL_SCANCODE_F18 = 109,
|
| 221 |
+
SDL_SCANCODE_F19 = 110,
|
| 222 |
+
SDL_SCANCODE_F20 = 111,
|
| 223 |
+
SDL_SCANCODE_F21 = 112,
|
| 224 |
+
SDL_SCANCODE_F22 = 113,
|
| 225 |
+
SDL_SCANCODE_F23 = 114,
|
| 226 |
+
SDL_SCANCODE_F24 = 115,
|
| 227 |
+
SDL_SCANCODE_EXECUTE = 116,
|
| 228 |
+
SDL_SCANCODE_HELP = 117,
|
| 229 |
+
SDL_SCANCODE_MENU = 118,
|
| 230 |
+
SDL_SCANCODE_SELECT = 119,
|
| 231 |
+
SDL_SCANCODE_STOP = 120,
|
| 232 |
+
SDL_SCANCODE_AGAIN = 121, /**< redo */
|
| 233 |
+
SDL_SCANCODE_UNDO = 122,
|
| 234 |
+
SDL_SCANCODE_CUT = 123,
|
| 235 |
+
SDL_SCANCODE_COPY = 124,
|
| 236 |
+
SDL_SCANCODE_PASTE = 125,
|
| 237 |
+
SDL_SCANCODE_FIND = 126,
|
| 238 |
+
SDL_SCANCODE_MUTE = 127,
|
| 239 |
+
SDL_SCANCODE_VOLUMEUP = 128,
|
| 240 |
+
SDL_SCANCODE_VOLUMEDOWN = 129,
|
| 241 |
+
/* not sure whether there's a reason to enable these */
|
| 242 |
+
/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
|
| 243 |
+
/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
|
| 244 |
+
/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
|
| 245 |
+
SDL_SCANCODE_KP_COMMA = 133,
|
| 246 |
+
SDL_SCANCODE_KP_EQUALSAS400 = 134,
|
| 247 |
+
|
| 248 |
+
SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
|
| 249 |
+
footnotes in USB doc */
|
| 250 |
+
SDL_SCANCODE_INTERNATIONAL2 = 136,
|
| 251 |
+
SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
|
| 252 |
+
SDL_SCANCODE_INTERNATIONAL4 = 138,
|
| 253 |
+
SDL_SCANCODE_INTERNATIONAL5 = 139,
|
| 254 |
+
SDL_SCANCODE_INTERNATIONAL6 = 140,
|
| 255 |
+
SDL_SCANCODE_INTERNATIONAL7 = 141,
|
| 256 |
+
SDL_SCANCODE_INTERNATIONAL8 = 142,
|
| 257 |
+
SDL_SCANCODE_INTERNATIONAL9 = 143,
|
| 258 |
+
SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
|
| 259 |
+
SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
|
| 260 |
+
SDL_SCANCODE_LANG3 = 146, /**< Katakana */
|
| 261 |
+
SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
|
| 262 |
+
SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
|
| 263 |
+
SDL_SCANCODE_LANG6 = 149, /**< reserved */
|
| 264 |
+
SDL_SCANCODE_LANG7 = 150, /**< reserved */
|
| 265 |
+
SDL_SCANCODE_LANG8 = 151, /**< reserved */
|
| 266 |
+
SDL_SCANCODE_LANG9 = 152, /**< reserved */
|
| 267 |
+
|
| 268 |
+
SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
|
| 269 |
+
SDL_SCANCODE_SYSREQ = 154,
|
| 270 |
+
SDL_SCANCODE_CANCEL = 155,
|
| 271 |
+
SDL_SCANCODE_CLEAR = 156,
|
| 272 |
+
SDL_SCANCODE_PRIOR = 157,
|
| 273 |
+
SDL_SCANCODE_RETURN2 = 158,
|
| 274 |
+
SDL_SCANCODE_SEPARATOR = 159,
|
| 275 |
+
SDL_SCANCODE_OUT = 160,
|
| 276 |
+
SDL_SCANCODE_OPER = 161,
|
| 277 |
+
SDL_SCANCODE_CLEARAGAIN = 162,
|
| 278 |
+
SDL_SCANCODE_CRSEL = 163,
|
| 279 |
+
SDL_SCANCODE_EXSEL = 164,
|
| 280 |
+
|
| 281 |
+
SDL_SCANCODE_KP_00 = 176,
|
| 282 |
+
SDL_SCANCODE_KP_000 = 177,
|
| 283 |
+
SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
|
| 284 |
+
SDL_SCANCODE_DECIMALSEPARATOR = 179,
|
| 285 |
+
SDL_SCANCODE_CURRENCYUNIT = 180,
|
| 286 |
+
SDL_SCANCODE_CURRENCYSUBUNIT = 181,
|
| 287 |
+
SDL_SCANCODE_KP_LEFTPAREN = 182,
|
| 288 |
+
SDL_SCANCODE_KP_RIGHTPAREN = 183,
|
| 289 |
+
SDL_SCANCODE_KP_LEFTBRACE = 184,
|
| 290 |
+
SDL_SCANCODE_KP_RIGHTBRACE = 185,
|
| 291 |
+
SDL_SCANCODE_KP_TAB = 186,
|
| 292 |
+
SDL_SCANCODE_KP_BACKSPACE = 187,
|
| 293 |
+
SDL_SCANCODE_KP_A = 188,
|
| 294 |
+
SDL_SCANCODE_KP_B = 189,
|
| 295 |
+
SDL_SCANCODE_KP_C = 190,
|
| 296 |
+
SDL_SCANCODE_KP_D = 191,
|
| 297 |
+
SDL_SCANCODE_KP_E = 192,
|
| 298 |
+
SDL_SCANCODE_KP_F = 193,
|
| 299 |
+
SDL_SCANCODE_KP_XOR = 194,
|
| 300 |
+
SDL_SCANCODE_KP_POWER = 195,
|
| 301 |
+
SDL_SCANCODE_KP_PERCENT = 196,
|
| 302 |
+
SDL_SCANCODE_KP_LESS = 197,
|
| 303 |
+
SDL_SCANCODE_KP_GREATER = 198,
|
| 304 |
+
SDL_SCANCODE_KP_AMPERSAND = 199,
|
| 305 |
+
SDL_SCANCODE_KP_DBLAMPERSAND = 200,
|
| 306 |
+
SDL_SCANCODE_KP_VERTICALBAR = 201,
|
| 307 |
+
SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
|
| 308 |
+
SDL_SCANCODE_KP_COLON = 203,
|
| 309 |
+
SDL_SCANCODE_KP_HASH = 204,
|
| 310 |
+
SDL_SCANCODE_KP_SPACE = 205,
|
| 311 |
+
SDL_SCANCODE_KP_AT = 206,
|
| 312 |
+
SDL_SCANCODE_KP_EXCLAM = 207,
|
| 313 |
+
SDL_SCANCODE_KP_MEMSTORE = 208,
|
| 314 |
+
SDL_SCANCODE_KP_MEMRECALL = 209,
|
| 315 |
+
SDL_SCANCODE_KP_MEMCLEAR = 210,
|
| 316 |
+
SDL_SCANCODE_KP_MEMADD = 211,
|
| 317 |
+
SDL_SCANCODE_KP_MEMSUBTRACT = 212,
|
| 318 |
+
SDL_SCANCODE_KP_MEMMULTIPLY = 213,
|
| 319 |
+
SDL_SCANCODE_KP_MEMDIVIDE = 214,
|
| 320 |
+
SDL_SCANCODE_KP_PLUSMINUS = 215,
|
| 321 |
+
SDL_SCANCODE_KP_CLEAR = 216,
|
| 322 |
+
SDL_SCANCODE_KP_CLEARENTRY = 217,
|
| 323 |
+
SDL_SCANCODE_KP_BINARY = 218,
|
| 324 |
+
SDL_SCANCODE_KP_OCTAL = 219,
|
| 325 |
+
SDL_SCANCODE_KP_DECIMAL = 220,
|
| 326 |
+
SDL_SCANCODE_KP_HEXADECIMAL = 221,
|
| 327 |
+
|
| 328 |
+
SDL_SCANCODE_LCTRL = 224,
|
| 329 |
+
SDL_SCANCODE_LSHIFT = 225,
|
| 330 |
+
SDL_SCANCODE_LALT = 226, /**< alt, option */
|
| 331 |
+
SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
|
| 332 |
+
SDL_SCANCODE_RCTRL = 228,
|
| 333 |
+
SDL_SCANCODE_RSHIFT = 229,
|
| 334 |
+
SDL_SCANCODE_RALT = 230, /**< alt gr, option */
|
| 335 |
+
SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
|
| 336 |
+
|
| 337 |
+
SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered
|
| 338 |
+
* by any of the above, but since there's a
|
| 339 |
+
* special KMOD_MODE for it I'm adding it here
|
| 340 |
+
*/
|
| 341 |
+
|
| 342 |
+
/* @} *//* Usage page 0x07 */
|
| 343 |
+
|
| 344 |
+
/**
|
| 345 |
+
* \name Usage page 0x0C
|
| 346 |
+
*
|
| 347 |
+
* These values are mapped from usage page 0x0C (USB consumer page).
|
| 348 |
+
*/
|
| 349 |
+
/* @{ */
|
| 350 |
+
|
| 351 |
+
SDL_SCANCODE_AUDIONEXT = 258,
|
| 352 |
+
SDL_SCANCODE_AUDIOPREV = 259,
|
| 353 |
+
SDL_SCANCODE_AUDIOSTOP = 260,
|
| 354 |
+
SDL_SCANCODE_AUDIOPLAY = 261,
|
| 355 |
+
SDL_SCANCODE_AUDIOMUTE = 262,
|
| 356 |
+
SDL_SCANCODE_MEDIASELECT = 263,
|
| 357 |
+
SDL_SCANCODE_WWW = 264,
|
| 358 |
+
SDL_SCANCODE_MAIL = 265,
|
| 359 |
+
SDL_SCANCODE_CALCULATOR = 266,
|
| 360 |
+
SDL_SCANCODE_COMPUTER = 267,
|
| 361 |
+
SDL_SCANCODE_AC_SEARCH = 268,
|
| 362 |
+
SDL_SCANCODE_AC_HOME = 269,
|
| 363 |
+
SDL_SCANCODE_AC_BACK = 270,
|
| 364 |
+
SDL_SCANCODE_AC_FORWARD = 271,
|
| 365 |
+
SDL_SCANCODE_AC_STOP = 272,
|
| 366 |
+
SDL_SCANCODE_AC_REFRESH = 273,
|
| 367 |
+
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
| 368 |
+
|
| 369 |
+
/* @} *//* Usage page 0x0C */
|
| 370 |
+
|
| 371 |
+
/**
|
| 372 |
+
* \name Walther keys
|
| 373 |
+
*
|
| 374 |
+
* These are values that Christian Walther added (for mac keyboard?).
|
| 375 |
+
*/
|
| 376 |
+
/* @{ */
|
| 377 |
+
|
| 378 |
+
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
|
| 379 |
+
SDL_SCANCODE_BRIGHTNESSUP = 276,
|
| 380 |
+
SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display
|
| 381 |
+
switch, video mode switch */
|
| 382 |
+
SDL_SCANCODE_KBDILLUMTOGGLE = 278,
|
| 383 |
+
SDL_SCANCODE_KBDILLUMDOWN = 279,
|
| 384 |
+
SDL_SCANCODE_KBDILLUMUP = 280,
|
| 385 |
+
SDL_SCANCODE_EJECT = 281,
|
| 386 |
+
SDL_SCANCODE_SLEEP = 282,
|
| 387 |
+
|
| 388 |
+
SDL_SCANCODE_APP1 = 283,
|
| 389 |
+
SDL_SCANCODE_APP2 = 284,
|
| 390 |
+
|
| 391 |
+
/* @} *//* Walther keys */
|
| 392 |
+
|
| 393 |
+
/**
|
| 394 |
+
* \name Usage page 0x0C (additional media keys)
|
| 395 |
+
*
|
| 396 |
+
* These values are mapped from usage page 0x0C (USB consumer page).
|
| 397 |
+
*/
|
| 398 |
+
/* @{ */
|
| 399 |
+
|
| 400 |
+
SDL_SCANCODE_AUDIOREWIND = 285,
|
| 401 |
+
SDL_SCANCODE_AUDIOFASTFORWARD = 286,
|
| 402 |
+
|
| 403 |
+
/* @} *//* Usage page 0x0C (additional media keys) */
|
| 404 |
+
|
| 405 |
+
/* Add any other keys here. */
|
| 406 |
+
|
| 407 |
+
SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
|
| 408 |
+
for array bounds */
|
| 409 |
+
} SDL_Scancode;
|
| 410 |
+
|
| 411 |
+
#endif /* SDL_scancode_h_ */
|
| 412 |
+
|
| 413 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_sensor.h
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_sensor.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL sensor event handling
|
| 26 |
+
*
|
| 27 |
+
*/
|
| 28 |
+
|
| 29 |
+
#ifndef SDL_sensor_h_
|
| 30 |
+
#define SDL_sensor_h_
|
| 31 |
+
|
| 32 |
+
#include "SDL_stdinc.h"
|
| 33 |
+
#include "SDL_error.h"
|
| 34 |
+
|
| 35 |
+
#include "begin_code.h"
|
| 36 |
+
/* Set up for C function definitions, even when using C++ */
|
| 37 |
+
#ifdef __cplusplus
|
| 38 |
+
/* *INDENT-OFF* */
|
| 39 |
+
extern "C" {
|
| 40 |
+
/* *INDENT-ON* */
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* \brief SDL_sensor.h
|
| 45 |
+
*
|
| 46 |
+
* In order to use these functions, SDL_Init() must have been called
|
| 47 |
+
* with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system
|
| 48 |
+
* for sensors, and load appropriate drivers.
|
| 49 |
+
*/
|
| 50 |
+
|
| 51 |
+
struct _SDL_Sensor;
|
| 52 |
+
typedef struct _SDL_Sensor SDL_Sensor;
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* This is a unique ID for a sensor for the time it is connected to the system,
|
| 56 |
+
* and is never reused for the lifetime of the application.
|
| 57 |
+
*
|
| 58 |
+
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
|
| 59 |
+
*/
|
| 60 |
+
typedef Sint32 SDL_SensorID;
|
| 61 |
+
|
| 62 |
+
/* The different sensors defined by SDL
|
| 63 |
+
*
|
| 64 |
+
* Additional sensors may be available, using platform dependent semantics.
|
| 65 |
+
*
|
| 66 |
+
* Hare are the additional Android sensors:
|
| 67 |
+
* https://developer.android.com/reference/android/hardware/SensorEvent.html#values
|
| 68 |
+
*/
|
| 69 |
+
typedef enum
|
| 70 |
+
{
|
| 71 |
+
SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */
|
| 72 |
+
SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */
|
| 73 |
+
SDL_SENSOR_ACCEL, /**< Accelerometer */
|
| 74 |
+
SDL_SENSOR_GYRO /**< Gyroscope */
|
| 75 |
+
} SDL_SensorType;
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* Accelerometer sensor
|
| 79 |
+
*
|
| 80 |
+
* The accelerometer returns the current acceleration in SI meters per
|
| 81 |
+
* second squared. This includes gravity, so a device at rest will have
|
| 82 |
+
* an acceleration of SDL_STANDARD_GRAVITY straight down.
|
| 83 |
+
*
|
| 84 |
+
* values[0]: Acceleration on the x axis
|
| 85 |
+
* values[1]: Acceleration on the y axis
|
| 86 |
+
* values[2]: Acceleration on the z axis
|
| 87 |
+
*
|
| 88 |
+
* For phones held in portrait mode, the axes are defined as follows:
|
| 89 |
+
* -X ... +X : left ... right
|
| 90 |
+
* -Y ... +Y : bottom ... top
|
| 91 |
+
* -Z ... +Z : farther ... closer
|
| 92 |
+
*
|
| 93 |
+
* The axis data is not changed when the phone is rotated.
|
| 94 |
+
*
|
| 95 |
+
* \sa SDL_GetDisplayOrientation()
|
| 96 |
+
*/
|
| 97 |
+
#define SDL_STANDARD_GRAVITY 9.80665f
|
| 98 |
+
|
| 99 |
+
/**
|
| 100 |
+
* Gyroscope sensor
|
| 101 |
+
*
|
| 102 |
+
* The gyroscope returns the current rate of rotation in radians per second.
|
| 103 |
+
* The rotation is positive in the counter-clockwise direction. That is,
|
| 104 |
+
* an observer looking from a positive location on one of the axes would
|
| 105 |
+
* see positive rotation on that axis when it appeared to be rotating
|
| 106 |
+
* counter-clockwise.
|
| 107 |
+
*
|
| 108 |
+
* values[0]: Angular speed around the x axis
|
| 109 |
+
* values[1]: Angular speed around the y axis
|
| 110 |
+
* values[2]: Angular speed around the z axis
|
| 111 |
+
*
|
| 112 |
+
* For phones held in portrait mode, the axes are defined as follows:
|
| 113 |
+
* -X ... +X : left ... right
|
| 114 |
+
* -Y ... +Y : bottom ... top
|
| 115 |
+
* -Z ... +Z : farther ... closer
|
| 116 |
+
*
|
| 117 |
+
* The axis data is not changed when the phone is rotated.
|
| 118 |
+
*
|
| 119 |
+
* \sa SDL_GetDisplayOrientation()
|
| 120 |
+
*/
|
| 121 |
+
|
| 122 |
+
/* Function prototypes */
|
| 123 |
+
|
| 124 |
+
/**
|
| 125 |
+
* \brief Count the number of sensors attached to the system right now
|
| 126 |
+
*/
|
| 127 |
+
extern DECLSPEC int SDLCALL SDL_NumSensors(void);
|
| 128 |
+
|
| 129 |
+
/**
|
| 130 |
+
* \brief Get the implementation dependent name of a sensor.
|
| 131 |
+
*
|
| 132 |
+
* This can be called before any sensors are opened.
|
| 133 |
+
*
|
| 134 |
+
* \return The sensor name, or NULL if device_index is out of range.
|
| 135 |
+
*/
|
| 136 |
+
extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* \brief Get the type of a sensor.
|
| 140 |
+
*
|
| 141 |
+
* This can be called before any sensors are opened.
|
| 142 |
+
*
|
| 143 |
+
* \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
|
| 144 |
+
*/
|
| 145 |
+
extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index);
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* \brief Get the platform dependent type of a sensor.
|
| 149 |
+
*
|
| 150 |
+
* This can be called before any sensors are opened.
|
| 151 |
+
*
|
| 152 |
+
* \return The sensor platform dependent type, or -1 if device_index is out of range.
|
| 153 |
+
*/
|
| 154 |
+
extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index);
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* \brief Get the instance ID of a sensor.
|
| 158 |
+
*
|
| 159 |
+
* This can be called before any sensors are opened.
|
| 160 |
+
*
|
| 161 |
+
* \return The sensor instance ID, or -1 if device_index is out of range.
|
| 162 |
+
*/
|
| 163 |
+
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index);
|
| 164 |
+
|
| 165 |
+
/**
|
| 166 |
+
* \brief Open a sensor for use.
|
| 167 |
+
*
|
| 168 |
+
* The index passed as an argument refers to the N'th sensor on the system.
|
| 169 |
+
*
|
| 170 |
+
* \return A sensor identifier, or NULL if an error occurred.
|
| 171 |
+
*/
|
| 172 |
+
extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
|
| 173 |
+
|
| 174 |
+
/**
|
| 175 |
+
* Return the SDL_Sensor associated with an instance id.
|
| 176 |
+
*/
|
| 177 |
+
extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id);
|
| 178 |
+
|
| 179 |
+
/**
|
| 180 |
+
* \brief Get the implementation dependent name of a sensor.
|
| 181 |
+
*
|
| 182 |
+
* \return The sensor name, or NULL if the sensor is NULL.
|
| 183 |
+
*/
|
| 184 |
+
extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
|
| 185 |
+
|
| 186 |
+
/**
|
| 187 |
+
* \brief Get the type of a sensor.
|
| 188 |
+
*
|
| 189 |
+
* This can be called before any sensors are opened.
|
| 190 |
+
*
|
| 191 |
+
* \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
|
| 192 |
+
*/
|
| 193 |
+
extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
|
| 194 |
+
|
| 195 |
+
/**
|
| 196 |
+
* \brief Get the platform dependent type of a sensor.
|
| 197 |
+
*
|
| 198 |
+
* This can be called before any sensors are opened.
|
| 199 |
+
*
|
| 200 |
+
* \return The sensor platform dependent type, or -1 if the sensor is NULL.
|
| 201 |
+
*/
|
| 202 |
+
extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
|
| 203 |
+
|
| 204 |
+
/**
|
| 205 |
+
* \brief Get the instance ID of a sensor.
|
| 206 |
+
*
|
| 207 |
+
* This can be called before any sensors are opened.
|
| 208 |
+
*
|
| 209 |
+
* \return The sensor instance ID, or -1 if the sensor is NULL.
|
| 210 |
+
*/
|
| 211 |
+
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor);
|
| 212 |
+
|
| 213 |
+
/**
|
| 214 |
+
* Get the current state of an opened sensor.
|
| 215 |
+
*
|
| 216 |
+
* The number of values and interpretation of the data is sensor dependent.
|
| 217 |
+
*
|
| 218 |
+
* \param sensor The sensor to query
|
| 219 |
+
* \param data A pointer filled with the current sensor state
|
| 220 |
+
* \param num_values The number of values to write to data
|
| 221 |
+
*
|
| 222 |
+
* \return 0 or -1 if an error occurred.
|
| 223 |
+
*/
|
| 224 |
+
extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
|
| 225 |
+
|
| 226 |
+
/**
|
| 227 |
+
* Close a sensor previously opened with SDL_SensorOpen()
|
| 228 |
+
*/
|
| 229 |
+
extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
|
| 230 |
+
|
| 231 |
+
/**
|
| 232 |
+
* Update the current state of the open sensors.
|
| 233 |
+
*
|
| 234 |
+
* This is called automatically by the event loop if sensor events are enabled.
|
| 235 |
+
*
|
| 236 |
+
* This needs to be called from the thread that initialized the sensor subsystem.
|
| 237 |
+
*/
|
| 238 |
+
extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
/* Ends C function definitions when using C++ */
|
| 242 |
+
#ifdef __cplusplus
|
| 243 |
+
/* *INDENT-OFF* */
|
| 244 |
+
}
|
| 245 |
+
/* *INDENT-ON* */
|
| 246 |
+
#endif
|
| 247 |
+
#include "close_code.h"
|
| 248 |
+
|
| 249 |
+
#endif /* SDL_sensor_h_ */
|
| 250 |
+
|
| 251 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_shape.h
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#ifndef SDL_shape_h_
|
| 23 |
+
#define SDL_shape_h_
|
| 24 |
+
|
| 25 |
+
#include "SDL_stdinc.h"
|
| 26 |
+
#include "SDL_pixels.h"
|
| 27 |
+
#include "SDL_rect.h"
|
| 28 |
+
#include "SDL_surface.h"
|
| 29 |
+
#include "SDL_video.h"
|
| 30 |
+
|
| 31 |
+
#include "begin_code.h"
|
| 32 |
+
/* Set up for C function definitions, even when using C++ */
|
| 33 |
+
#ifdef __cplusplus
|
| 34 |
+
extern "C" {
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
/** \file SDL_shape.h
|
| 38 |
+
*
|
| 39 |
+
* Header file for the shaped window API.
|
| 40 |
+
*/
|
| 41 |
+
|
| 42 |
+
#define SDL_NONSHAPEABLE_WINDOW -1
|
| 43 |
+
#define SDL_INVALID_SHAPE_ARGUMENT -2
|
| 44 |
+
#define SDL_WINDOW_LACKS_SHAPE -3
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* \brief Create a window that can be shaped with the specified position, dimensions, and flags.
|
| 48 |
+
*
|
| 49 |
+
* \param title The title of the window, in UTF-8 encoding.
|
| 50 |
+
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
| 51 |
+
* ::SDL_WINDOWPOS_UNDEFINED.
|
| 52 |
+
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
| 53 |
+
* ::SDL_WINDOWPOS_UNDEFINED.
|
| 54 |
+
* \param w The width of the window.
|
| 55 |
+
* \param h The height of the window.
|
| 56 |
+
* \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
|
| 57 |
+
* ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED,
|
| 58 |
+
* ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE,
|
| 59 |
+
* ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
|
| 60 |
+
* ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
|
| 61 |
+
*
|
| 62 |
+
* \return The window created, or NULL if window creation failed.
|
| 63 |
+
*
|
| 64 |
+
* \sa SDL_DestroyWindow()
|
| 65 |
+
*/
|
| 66 |
+
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* \brief Return whether the given window is a shaped window.
|
| 70 |
+
*
|
| 71 |
+
* \param window The window to query for being shaped.
|
| 72 |
+
*
|
| 73 |
+
* \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
|
| 74 |
+
*
|
| 75 |
+
* \sa SDL_CreateShapedWindow
|
| 76 |
+
*/
|
| 77 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
|
| 78 |
+
|
| 79 |
+
/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
|
| 80 |
+
typedef enum {
|
| 81 |
+
/** \brief The default mode, a binarized alpha cutoff of 1. */
|
| 82 |
+
ShapeModeDefault,
|
| 83 |
+
/** \brief A binarized alpha cutoff with a given integer value. */
|
| 84 |
+
ShapeModeBinarizeAlpha,
|
| 85 |
+
/** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */
|
| 86 |
+
ShapeModeReverseBinarizeAlpha,
|
| 87 |
+
/** \brief A color key is applied. */
|
| 88 |
+
ShapeModeColorKey
|
| 89 |
+
} WindowShapeMode;
|
| 90 |
+
|
| 91 |
+
#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
|
| 92 |
+
|
| 93 |
+
/** \brief A union containing parameters for shaped windows. */
|
| 94 |
+
typedef union {
|
| 95 |
+
/** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */
|
| 96 |
+
Uint8 binarizationCutoff;
|
| 97 |
+
SDL_Color colorKey;
|
| 98 |
+
} SDL_WindowShapeParams;
|
| 99 |
+
|
| 100 |
+
/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
|
| 101 |
+
typedef struct SDL_WindowShapeMode {
|
| 102 |
+
/** \brief The mode of these window-shape parameters. */
|
| 103 |
+
WindowShapeMode mode;
|
| 104 |
+
/** \brief Window-shape parameters. */
|
| 105 |
+
SDL_WindowShapeParams parameters;
|
| 106 |
+
} SDL_WindowShapeMode;
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* \brief Set the shape and parameters of a shaped window.
|
| 110 |
+
*
|
| 111 |
+
* \param window The shaped window whose parameters should be set.
|
| 112 |
+
* \param shape A surface encoding the desired shape for the window.
|
| 113 |
+
* \param shape_mode The parameters to set for the shaped window.
|
| 114 |
+
*
|
| 115 |
+
* \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
|
| 116 |
+
* if the SDL_Window given does not reference a valid shaped window.
|
| 117 |
+
*
|
| 118 |
+
* \sa SDL_WindowShapeMode
|
| 119 |
+
* \sa SDL_GetShapedWindowMode.
|
| 120 |
+
*/
|
| 121 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
* \brief Get the shape parameters of a shaped window.
|
| 125 |
+
*
|
| 126 |
+
* \param window The shaped window whose parameters should be retrieved.
|
| 127 |
+
* \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
|
| 128 |
+
*
|
| 129 |
+
* \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
|
| 130 |
+
* data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
|
| 131 |
+
* the SDL_Window given is a shapeable window currently lacking a shape.
|
| 132 |
+
*
|
| 133 |
+
* \sa SDL_WindowShapeMode
|
| 134 |
+
* \sa SDL_SetWindowShape
|
| 135 |
+
*/
|
| 136 |
+
extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);
|
| 137 |
+
|
| 138 |
+
/* Ends C function definitions when using C++ */
|
| 139 |
+
#ifdef __cplusplus
|
| 140 |
+
}
|
| 141 |
+
#endif
|
| 142 |
+
#include "close_code.h"
|
| 143 |
+
|
| 144 |
+
#endif /* SDL_shape_h_ */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_stdinc.h
ADDED
|
@@ -0,0 +1,617 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_stdinc.h
|
| 24 |
+
*
|
| 25 |
+
* This is a general header that includes C language support.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_stdinc_h_
|
| 29 |
+
#define SDL_stdinc_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_config.h"
|
| 32 |
+
|
| 33 |
+
#ifdef HAVE_SYS_TYPES_H
|
| 34 |
+
#include <sys/types.h>
|
| 35 |
+
#endif
|
| 36 |
+
#ifdef HAVE_STDIO_H
|
| 37 |
+
#include <stdio.h>
|
| 38 |
+
#endif
|
| 39 |
+
#if defined(STDC_HEADERS)
|
| 40 |
+
# include <stdlib.h>
|
| 41 |
+
# include <stddef.h>
|
| 42 |
+
# include <stdarg.h>
|
| 43 |
+
#else
|
| 44 |
+
# if defined(HAVE_STDLIB_H)
|
| 45 |
+
# include <stdlib.h>
|
| 46 |
+
# elif defined(HAVE_MALLOC_H)
|
| 47 |
+
# include <malloc.h>
|
| 48 |
+
# endif
|
| 49 |
+
# if defined(HAVE_STDDEF_H)
|
| 50 |
+
# include <stddef.h>
|
| 51 |
+
# endif
|
| 52 |
+
# if defined(HAVE_STDARG_H)
|
| 53 |
+
# include <stdarg.h>
|
| 54 |
+
# endif
|
| 55 |
+
#endif
|
| 56 |
+
#ifdef HAVE_STRING_H
|
| 57 |
+
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
|
| 58 |
+
# include <memory.h>
|
| 59 |
+
# endif
|
| 60 |
+
# include <string.h>
|
| 61 |
+
#endif
|
| 62 |
+
#ifdef HAVE_STRINGS_H
|
| 63 |
+
# include <strings.h>
|
| 64 |
+
#endif
|
| 65 |
+
#ifdef HAVE_WCHAR_H
|
| 66 |
+
# include <wchar.h>
|
| 67 |
+
#endif
|
| 68 |
+
#if defined(HAVE_INTTYPES_H)
|
| 69 |
+
# include <inttypes.h>
|
| 70 |
+
#elif defined(HAVE_STDINT_H)
|
| 71 |
+
# include <stdint.h>
|
| 72 |
+
#endif
|
| 73 |
+
#ifdef HAVE_CTYPE_H
|
| 74 |
+
# include <ctype.h>
|
| 75 |
+
#endif
|
| 76 |
+
#ifdef HAVE_MATH_H
|
| 77 |
+
# if defined(__WINRT__)
|
| 78 |
+
/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
|
| 79 |
+
WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
|
| 80 |
+
for more information.
|
| 81 |
+
*/
|
| 82 |
+
# define _USE_MATH_DEFINES
|
| 83 |
+
# endif
|
| 84 |
+
# include <math.h>
|
| 85 |
+
#endif
|
| 86 |
+
#ifdef HAVE_FLOAT_H
|
| 87 |
+
# include <float.h>
|
| 88 |
+
#endif
|
| 89 |
+
#if defined(HAVE_ALLOCA) && !defined(alloca)
|
| 90 |
+
# if defined(HAVE_ALLOCA_H)
|
| 91 |
+
# include <alloca.h>
|
| 92 |
+
# elif defined(__GNUC__)
|
| 93 |
+
# define alloca __builtin_alloca
|
| 94 |
+
# elif defined(_MSC_VER)
|
| 95 |
+
# include <malloc.h>
|
| 96 |
+
# define alloca _alloca
|
| 97 |
+
# elif defined(__WATCOMC__)
|
| 98 |
+
# include <malloc.h>
|
| 99 |
+
# elif defined(__BORLANDC__)
|
| 100 |
+
# include <malloc.h>
|
| 101 |
+
# elif defined(__DMC__)
|
| 102 |
+
# include <stdlib.h>
|
| 103 |
+
# elif defined(__AIX__)
|
| 104 |
+
#pragma alloca
|
| 105 |
+
# elif defined(__MRC__)
|
| 106 |
+
void *alloca(unsigned);
|
| 107 |
+
# else
|
| 108 |
+
char *alloca();
|
| 109 |
+
# endif
|
| 110 |
+
#endif
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* The number of elements in an array.
|
| 114 |
+
*/
|
| 115 |
+
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
|
| 116 |
+
#define SDL_TABLESIZE(table) SDL_arraysize(table)
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* Macro useful for building other macros with strings in them
|
| 120 |
+
*
|
| 121 |
+
* e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
|
| 122 |
+
*/
|
| 123 |
+
#define SDL_STRINGIFY_ARG(arg) #arg
|
| 124 |
+
|
| 125 |
+
/**
|
| 126 |
+
* \name Cast operators
|
| 127 |
+
*
|
| 128 |
+
* Use proper C++ casts when compiled as C++ to be compatible with the option
|
| 129 |
+
* -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
|
| 130 |
+
*/
|
| 131 |
+
/* @{ */
|
| 132 |
+
#ifdef __cplusplus
|
| 133 |
+
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
|
| 134 |
+
#define SDL_static_cast(type, expression) static_cast<type>(expression)
|
| 135 |
+
#define SDL_const_cast(type, expression) const_cast<type>(expression)
|
| 136 |
+
#else
|
| 137 |
+
#define SDL_reinterpret_cast(type, expression) ((type)(expression))
|
| 138 |
+
#define SDL_static_cast(type, expression) ((type)(expression))
|
| 139 |
+
#define SDL_const_cast(type, expression) ((type)(expression))
|
| 140 |
+
#endif
|
| 141 |
+
/* @} *//* Cast operators */
|
| 142 |
+
|
| 143 |
+
/* Define a four character code as a Uint32 */
|
| 144 |
+
#define SDL_FOURCC(A, B, C, D) \
|
| 145 |
+
((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
|
| 146 |
+
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
|
| 147 |
+
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
|
| 148 |
+
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
|
| 149 |
+
|
| 150 |
+
/**
|
| 151 |
+
* \name Basic data types
|
| 152 |
+
*/
|
| 153 |
+
/* @{ */
|
| 154 |
+
|
| 155 |
+
#ifdef __CC_ARM
|
| 156 |
+
/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */
|
| 157 |
+
#define SDL_FALSE 0
|
| 158 |
+
#define SDL_TRUE 1
|
| 159 |
+
typedef int SDL_bool;
|
| 160 |
+
#else
|
| 161 |
+
typedef enum
|
| 162 |
+
{
|
| 163 |
+
SDL_FALSE = 0,
|
| 164 |
+
SDL_TRUE = 1
|
| 165 |
+
} SDL_bool;
|
| 166 |
+
#endif
|
| 167 |
+
|
| 168 |
+
/**
|
| 169 |
+
* \brief A signed 8-bit integer type.
|
| 170 |
+
*/
|
| 171 |
+
#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */
|
| 172 |
+
#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */
|
| 173 |
+
typedef int8_t Sint8;
|
| 174 |
+
/**
|
| 175 |
+
* \brief An unsigned 8-bit integer type.
|
| 176 |
+
*/
|
| 177 |
+
#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */
|
| 178 |
+
#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */
|
| 179 |
+
typedef uint8_t Uint8;
|
| 180 |
+
/**
|
| 181 |
+
* \brief A signed 16-bit integer type.
|
| 182 |
+
*/
|
| 183 |
+
#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */
|
| 184 |
+
#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */
|
| 185 |
+
typedef int16_t Sint16;
|
| 186 |
+
/**
|
| 187 |
+
* \brief An unsigned 16-bit integer type.
|
| 188 |
+
*/
|
| 189 |
+
#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */
|
| 190 |
+
#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */
|
| 191 |
+
typedef uint16_t Uint16;
|
| 192 |
+
/**
|
| 193 |
+
* \brief A signed 32-bit integer type.
|
| 194 |
+
*/
|
| 195 |
+
#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */
|
| 196 |
+
#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
|
| 197 |
+
typedef int32_t Sint32;
|
| 198 |
+
/**
|
| 199 |
+
* \brief An unsigned 32-bit integer type.
|
| 200 |
+
*/
|
| 201 |
+
#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */
|
| 202 |
+
#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */
|
| 203 |
+
typedef uint32_t Uint32;
|
| 204 |
+
|
| 205 |
+
/**
|
| 206 |
+
* \brief A signed 64-bit integer type.
|
| 207 |
+
*/
|
| 208 |
+
#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */
|
| 209 |
+
#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */
|
| 210 |
+
typedef int64_t Sint64;
|
| 211 |
+
/**
|
| 212 |
+
* \brief An unsigned 64-bit integer type.
|
| 213 |
+
*/
|
| 214 |
+
#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */
|
| 215 |
+
#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */
|
| 216 |
+
typedef uint64_t Uint64;
|
| 217 |
+
|
| 218 |
+
/* @} *//* Basic data types */
|
| 219 |
+
|
| 220 |
+
/* Make sure we have macros for printing 64 bit values.
|
| 221 |
+
* <stdint.h> should define these but this is not true all platforms.
|
| 222 |
+
* (for example win32) */
|
| 223 |
+
#ifndef SDL_PRIs64
|
| 224 |
+
#ifdef PRIs64
|
| 225 |
+
#define SDL_PRIs64 PRIs64
|
| 226 |
+
#elif defined(__WIN32__)
|
| 227 |
+
#define SDL_PRIs64 "I64d"
|
| 228 |
+
#elif defined(__LINUX__) && defined(__LP64__)
|
| 229 |
+
#define SDL_PRIs64 "ld"
|
| 230 |
+
#else
|
| 231 |
+
#define SDL_PRIs64 "lld"
|
| 232 |
+
#endif
|
| 233 |
+
#endif
|
| 234 |
+
#ifndef SDL_PRIu64
|
| 235 |
+
#ifdef PRIu64
|
| 236 |
+
#define SDL_PRIu64 PRIu64
|
| 237 |
+
#elif defined(__WIN32__)
|
| 238 |
+
#define SDL_PRIu64 "I64u"
|
| 239 |
+
#elif defined(__LINUX__) && defined(__LP64__)
|
| 240 |
+
#define SDL_PRIu64 "lu"
|
| 241 |
+
#else
|
| 242 |
+
#define SDL_PRIu64 "llu"
|
| 243 |
+
#endif
|
| 244 |
+
#endif
|
| 245 |
+
#ifndef SDL_PRIx64
|
| 246 |
+
#ifdef PRIx64
|
| 247 |
+
#define SDL_PRIx64 PRIx64
|
| 248 |
+
#elif defined(__WIN32__)
|
| 249 |
+
#define SDL_PRIx64 "I64x"
|
| 250 |
+
#elif defined(__LINUX__) && defined(__LP64__)
|
| 251 |
+
#define SDL_PRIx64 "lx"
|
| 252 |
+
#else
|
| 253 |
+
#define SDL_PRIx64 "llx"
|
| 254 |
+
#endif
|
| 255 |
+
#endif
|
| 256 |
+
#ifndef SDL_PRIX64
|
| 257 |
+
#ifdef PRIX64
|
| 258 |
+
#define SDL_PRIX64 PRIX64
|
| 259 |
+
#elif defined(__WIN32__)
|
| 260 |
+
#define SDL_PRIX64 "I64X"
|
| 261 |
+
#elif defined(__LINUX__) && defined(__LP64__)
|
| 262 |
+
#define SDL_PRIX64 "lX"
|
| 263 |
+
#else
|
| 264 |
+
#define SDL_PRIX64 "llX"
|
| 265 |
+
#endif
|
| 266 |
+
#endif
|
| 267 |
+
|
| 268 |
+
/* Annotations to help code analysis tools */
|
| 269 |
+
#ifdef SDL_DISABLE_ANALYZE_MACROS
|
| 270 |
+
#define SDL_IN_BYTECAP(x)
|
| 271 |
+
#define SDL_INOUT_Z_CAP(x)
|
| 272 |
+
#define SDL_OUT_Z_CAP(x)
|
| 273 |
+
#define SDL_OUT_CAP(x)
|
| 274 |
+
#define SDL_OUT_BYTECAP(x)
|
| 275 |
+
#define SDL_OUT_Z_BYTECAP(x)
|
| 276 |
+
#define SDL_PRINTF_FORMAT_STRING
|
| 277 |
+
#define SDL_SCANF_FORMAT_STRING
|
| 278 |
+
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
|
| 279 |
+
#define SDL_SCANF_VARARG_FUNC( fmtargnumber )
|
| 280 |
+
#else
|
| 281 |
+
#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
|
| 282 |
+
#include <sal.h>
|
| 283 |
+
|
| 284 |
+
#define SDL_IN_BYTECAP(x) _In_bytecount_(x)
|
| 285 |
+
#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x)
|
| 286 |
+
#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x)
|
| 287 |
+
#define SDL_OUT_CAP(x) _Out_cap_(x)
|
| 288 |
+
#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x)
|
| 289 |
+
#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x)
|
| 290 |
+
|
| 291 |
+
#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_
|
| 292 |
+
#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_
|
| 293 |
+
#else
|
| 294 |
+
#define SDL_IN_BYTECAP(x)
|
| 295 |
+
#define SDL_INOUT_Z_CAP(x)
|
| 296 |
+
#define SDL_OUT_Z_CAP(x)
|
| 297 |
+
#define SDL_OUT_CAP(x)
|
| 298 |
+
#define SDL_OUT_BYTECAP(x)
|
| 299 |
+
#define SDL_OUT_Z_BYTECAP(x)
|
| 300 |
+
#define SDL_PRINTF_FORMAT_STRING
|
| 301 |
+
#define SDL_SCANF_FORMAT_STRING
|
| 302 |
+
#endif
|
| 303 |
+
#if defined(__GNUC__)
|
| 304 |
+
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
|
| 305 |
+
#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
|
| 306 |
+
#else
|
| 307 |
+
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
|
| 308 |
+
#define SDL_SCANF_VARARG_FUNC( fmtargnumber )
|
| 309 |
+
#endif
|
| 310 |
+
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
| 311 |
+
|
| 312 |
+
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
| 313 |
+
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
|
| 314 |
+
/** \cond */
|
| 315 |
+
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
| 316 |
+
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
|
| 317 |
+
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
|
| 318 |
+
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
|
| 319 |
+
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
|
| 320 |
+
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
|
| 321 |
+
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
|
| 322 |
+
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
|
| 323 |
+
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
| 324 |
+
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
| 325 |
+
/** \endcond */
|
| 326 |
+
|
| 327 |
+
/* Check to make sure enums are the size of ints, for structure packing.
|
| 328 |
+
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
|
| 329 |
+
enums having the size of an int must be enabled.
|
| 330 |
+
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
|
| 331 |
+
*/
|
| 332 |
+
|
| 333 |
+
/** \cond */
|
| 334 |
+
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
| 335 |
+
#if !defined(__ANDROID__)
|
| 336 |
+
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
|
| 337 |
+
typedef enum
|
| 338 |
+
{
|
| 339 |
+
DUMMY_ENUM_VALUE
|
| 340 |
+
} SDL_DUMMY_ENUM;
|
| 341 |
+
|
| 342 |
+
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
|
| 343 |
+
#endif
|
| 344 |
+
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
| 345 |
+
/** \endcond */
|
| 346 |
+
|
| 347 |
+
#include "begin_code.h"
|
| 348 |
+
/* Set up for C function definitions, even when using C++ */
|
| 349 |
+
#ifdef __cplusplus
|
| 350 |
+
extern "C" {
|
| 351 |
+
#endif
|
| 352 |
+
|
| 353 |
+
#ifdef HAVE_ALLOCA
|
| 354 |
+
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
|
| 355 |
+
#define SDL_stack_free(data)
|
| 356 |
+
#else
|
| 357 |
+
#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
|
| 358 |
+
#define SDL_stack_free(data) SDL_free(data)
|
| 359 |
+
#endif
|
| 360 |
+
|
| 361 |
+
extern DECLSPEC void *SDLCALL SDL_malloc(size_t size);
|
| 362 |
+
extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
| 363 |
+
extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size);
|
| 364 |
+
extern DECLSPEC void SDLCALL SDL_free(void *mem);
|
| 365 |
+
|
| 366 |
+
typedef void *(SDLCALL *SDL_malloc_func)(size_t size);
|
| 367 |
+
typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size);
|
| 368 |
+
typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
|
| 369 |
+
typedef void (SDLCALL *SDL_free_func)(void *mem);
|
| 370 |
+
|
| 371 |
+
/**
|
| 372 |
+
* \brief Get the current set of SDL memory functions
|
| 373 |
+
*/
|
| 374 |
+
extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
|
| 375 |
+
SDL_calloc_func *calloc_func,
|
| 376 |
+
SDL_realloc_func *realloc_func,
|
| 377 |
+
SDL_free_func *free_func);
|
| 378 |
+
|
| 379 |
+
/**
|
| 380 |
+
* \brief Replace SDL's memory allocation functions with a custom set
|
| 381 |
+
*
|
| 382 |
+
* \note If you are replacing SDL's memory functions, you should call
|
| 383 |
+
* SDL_GetNumAllocations() and be very careful if it returns non-zero.
|
| 384 |
+
* That means that your free function will be called with memory
|
| 385 |
+
* allocated by the previous memory allocation functions.
|
| 386 |
+
*/
|
| 387 |
+
extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
| 388 |
+
SDL_calloc_func calloc_func,
|
| 389 |
+
SDL_realloc_func realloc_func,
|
| 390 |
+
SDL_free_func free_func);
|
| 391 |
+
|
| 392 |
+
/**
|
| 393 |
+
* \brief Get the number of outstanding (unfreed) allocations
|
| 394 |
+
*/
|
| 395 |
+
extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
| 396 |
+
|
| 397 |
+
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
| 398 |
+
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
| 399 |
+
|
| 400 |
+
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
|
| 401 |
+
|
| 402 |
+
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
| 403 |
+
|
| 404 |
+
/* !!! FIXME: these have side effects. You probably shouldn't use them. */
|
| 405 |
+
/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
|
| 406 |
+
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
|
| 407 |
+
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
|
| 408 |
+
|
| 409 |
+
extern DECLSPEC int SDLCALL SDL_isdigit(int x);
|
| 410 |
+
extern DECLSPEC int SDLCALL SDL_isspace(int x);
|
| 411 |
+
extern DECLSPEC int SDLCALL SDL_isupper(int x);
|
| 412 |
+
extern DECLSPEC int SDLCALL SDL_islower(int x);
|
| 413 |
+
extern DECLSPEC int SDLCALL SDL_toupper(int x);
|
| 414 |
+
extern DECLSPEC int SDLCALL SDL_tolower(int x);
|
| 415 |
+
|
| 416 |
+
extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
| 417 |
+
|
| 418 |
+
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
|
| 419 |
+
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
| 420 |
+
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
| 421 |
+
|
| 422 |
+
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
|
| 423 |
+
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
| 424 |
+
{
|
| 425 |
+
#ifdef __APPLE__
|
| 426 |
+
memset_pattern4(dst, &val, dwords * 4);
|
| 427 |
+
#elif defined(__GNUC__) && defined(i386)
|
| 428 |
+
int u0, u1, u2;
|
| 429 |
+
__asm__ __volatile__ (
|
| 430 |
+
"cld \n\t"
|
| 431 |
+
"rep ; stosl \n\t"
|
| 432 |
+
: "=&D" (u0), "=&a" (u1), "=&c" (u2)
|
| 433 |
+
: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
|
| 434 |
+
: "memory"
|
| 435 |
+
);
|
| 436 |
+
#else
|
| 437 |
+
size_t _n = (dwords + 3) / 4;
|
| 438 |
+
Uint32 *_p = SDL_static_cast(Uint32 *, dst);
|
| 439 |
+
Uint32 _val = (val);
|
| 440 |
+
if (dwords == 0)
|
| 441 |
+
return;
|
| 442 |
+
switch (dwords % 4)
|
| 443 |
+
{
|
| 444 |
+
case 0: do { *_p++ = _val; /* fallthrough */
|
| 445 |
+
case 3: *_p++ = _val; /* fallthrough */
|
| 446 |
+
case 2: *_p++ = _val; /* fallthrough */
|
| 447 |
+
case 1: *_p++ = _val; /* fallthrough */
|
| 448 |
+
} while ( --_n );
|
| 449 |
+
}
|
| 450 |
+
#endif
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
| 454 |
+
|
| 455 |
+
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
| 456 |
+
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
|
| 457 |
+
|
| 458 |
+
extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
|
| 459 |
+
extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
| 460 |
+
extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
| 461 |
+
extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
|
| 462 |
+
extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
|
| 463 |
+
|
| 464 |
+
extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
|
| 465 |
+
extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
|
| 466 |
+
|
| 467 |
+
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
|
| 468 |
+
extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
| 469 |
+
extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes);
|
| 470 |
+
extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
| 471 |
+
extern DECLSPEC char *SDLCALL SDL_strdup(const char *str);
|
| 472 |
+
extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
|
| 473 |
+
extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
|
| 474 |
+
extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
|
| 475 |
+
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
|
| 476 |
+
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
|
| 477 |
+
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
| 478 |
+
extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
|
| 479 |
+
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
|
| 480 |
+
|
| 481 |
+
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
|
| 482 |
+
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
|
| 483 |
+
extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
|
| 484 |
+
extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
|
| 485 |
+
extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
|
| 486 |
+
extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
|
| 487 |
+
|
| 488 |
+
extern DECLSPEC int SDLCALL SDL_atoi(const char *str);
|
| 489 |
+
extern DECLSPEC double SDLCALL SDL_atof(const char *str);
|
| 490 |
+
extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
|
| 491 |
+
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
|
| 492 |
+
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
|
| 493 |
+
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
|
| 494 |
+
extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
|
| 495 |
+
|
| 496 |
+
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
| 497 |
+
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
|
| 498 |
+
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
| 499 |
+
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
|
| 500 |
+
|
| 501 |
+
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
|
| 502 |
+
extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap);
|
| 503 |
+
extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
|
| 504 |
+
extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap);
|
| 505 |
+
|
| 506 |
+
#ifndef HAVE_M_PI
|
| 507 |
+
#ifndef M_PI
|
| 508 |
+
#define M_PI 3.14159265358979323846264338327950288 /**< pi */
|
| 509 |
+
#endif
|
| 510 |
+
#endif
|
| 511 |
+
|
| 512 |
+
extern DECLSPEC double SDLCALL SDL_acos(double x);
|
| 513 |
+
extern DECLSPEC float SDLCALL SDL_acosf(float x);
|
| 514 |
+
extern DECLSPEC double SDLCALL SDL_asin(double x);
|
| 515 |
+
extern DECLSPEC float SDLCALL SDL_asinf(float x);
|
| 516 |
+
extern DECLSPEC double SDLCALL SDL_atan(double x);
|
| 517 |
+
extern DECLSPEC float SDLCALL SDL_atanf(float x);
|
| 518 |
+
extern DECLSPEC double SDLCALL SDL_atan2(double x, double y);
|
| 519 |
+
extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y);
|
| 520 |
+
extern DECLSPEC double SDLCALL SDL_ceil(double x);
|
| 521 |
+
extern DECLSPEC float SDLCALL SDL_ceilf(float x);
|
| 522 |
+
extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
|
| 523 |
+
extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
|
| 524 |
+
extern DECLSPEC double SDLCALL SDL_cos(double x);
|
| 525 |
+
extern DECLSPEC float SDLCALL SDL_cosf(float x);
|
| 526 |
+
extern DECLSPEC double SDLCALL SDL_exp(double x);
|
| 527 |
+
extern DECLSPEC float SDLCALL SDL_expf(float x);
|
| 528 |
+
extern DECLSPEC double SDLCALL SDL_fabs(double x);
|
| 529 |
+
extern DECLSPEC float SDLCALL SDL_fabsf(float x);
|
| 530 |
+
extern DECLSPEC double SDLCALL SDL_floor(double x);
|
| 531 |
+
extern DECLSPEC float SDLCALL SDL_floorf(float x);
|
| 532 |
+
extern DECLSPEC double SDLCALL SDL_fmod(double x, double y);
|
| 533 |
+
extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
|
| 534 |
+
extern DECLSPEC double SDLCALL SDL_log(double x);
|
| 535 |
+
extern DECLSPEC float SDLCALL SDL_logf(float x);
|
| 536 |
+
extern DECLSPEC double SDLCALL SDL_log10(double x);
|
| 537 |
+
extern DECLSPEC float SDLCALL SDL_log10f(float x);
|
| 538 |
+
extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
|
| 539 |
+
extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
|
| 540 |
+
extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
|
| 541 |
+
extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
|
| 542 |
+
extern DECLSPEC double SDLCALL SDL_sin(double x);
|
| 543 |
+
extern DECLSPEC float SDLCALL SDL_sinf(float x);
|
| 544 |
+
extern DECLSPEC double SDLCALL SDL_sqrt(double x);
|
| 545 |
+
extern DECLSPEC float SDLCALL SDL_sqrtf(float x);
|
| 546 |
+
extern DECLSPEC double SDLCALL SDL_tan(double x);
|
| 547 |
+
extern DECLSPEC float SDLCALL SDL_tanf(float x);
|
| 548 |
+
|
| 549 |
+
/* The SDL implementation of iconv() returns these error codes */
|
| 550 |
+
#define SDL_ICONV_ERROR (size_t)-1
|
| 551 |
+
#define SDL_ICONV_E2BIG (size_t)-2
|
| 552 |
+
#define SDL_ICONV_EILSEQ (size_t)-3
|
| 553 |
+
#define SDL_ICONV_EINVAL (size_t)-4
|
| 554 |
+
|
| 555 |
+
/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */
|
| 556 |
+
typedef struct _SDL_iconv_t *SDL_iconv_t;
|
| 557 |
+
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
|
| 558 |
+
const char *fromcode);
|
| 559 |
+
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
| 560 |
+
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
| 561 |
+
size_t * inbytesleft, char **outbuf,
|
| 562 |
+
size_t * outbytesleft);
|
| 563 |
+
/**
|
| 564 |
+
* This function converts a string between encodings in one pass, returning a
|
| 565 |
+
* string that must be freed with SDL_free() or NULL on error.
|
| 566 |
+
*/
|
| 567 |
+
extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
| 568 |
+
const char *fromcode,
|
| 569 |
+
const char *inbuf,
|
| 570 |
+
size_t inbytesleft);
|
| 571 |
+
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
|
| 572 |
+
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
|
| 573 |
+
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
|
| 574 |
+
|
| 575 |
+
/* force builds using Clang's static analysis tools to use literal C runtime
|
| 576 |
+
here, since there are possibly tests that are ineffective otherwise. */
|
| 577 |
+
#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS)
|
| 578 |
+
#define SDL_malloc malloc
|
| 579 |
+
#define SDL_calloc calloc
|
| 580 |
+
#define SDL_realloc realloc
|
| 581 |
+
#define SDL_free free
|
| 582 |
+
#define SDL_memset memset
|
| 583 |
+
#define SDL_memcpy memcpy
|
| 584 |
+
#define SDL_memmove memmove
|
| 585 |
+
#define SDL_memcmp memcmp
|
| 586 |
+
#define SDL_strlen strlen
|
| 587 |
+
#define SDL_strlcpy strlcpy
|
| 588 |
+
#define SDL_strlcat strlcat
|
| 589 |
+
#define SDL_strdup strdup
|
| 590 |
+
#define SDL_strchr strchr
|
| 591 |
+
#define SDL_strrchr strrchr
|
| 592 |
+
#define SDL_strstr strstr
|
| 593 |
+
#define SDL_strtokr strtok_r
|
| 594 |
+
#define SDL_strcmp strcmp
|
| 595 |
+
#define SDL_strncmp strncmp
|
| 596 |
+
#define SDL_strcasecmp strcasecmp
|
| 597 |
+
#define SDL_strncasecmp strncasecmp
|
| 598 |
+
#define SDL_sscanf sscanf
|
| 599 |
+
#define SDL_vsscanf vsscanf
|
| 600 |
+
#define SDL_snprintf snprintf
|
| 601 |
+
#define SDL_vsnprintf vsnprintf
|
| 602 |
+
#endif
|
| 603 |
+
|
| 604 |
+
SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords)
|
| 605 |
+
{
|
| 606 |
+
return SDL_memcpy(dst, src, dwords * 4);
|
| 607 |
+
}
|
| 608 |
+
|
| 609 |
+
/* Ends C function definitions when using C++ */
|
| 610 |
+
#ifdef __cplusplus
|
| 611 |
+
}
|
| 612 |
+
#endif
|
| 613 |
+
#include "close_code.h"
|
| 614 |
+
|
| 615 |
+
#endif /* SDL_stdinc_h_ */
|
| 616 |
+
|
| 617 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_surface.h
ADDED
|
@@ -0,0 +1,554 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_surface.h
|
| 24 |
+
*
|
| 25 |
+
* Header file for ::SDL_Surface definition and management functions.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_surface_h_
|
| 29 |
+
#define SDL_surface_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_pixels.h"
|
| 33 |
+
#include "SDL_rect.h"
|
| 34 |
+
#include "SDL_blendmode.h"
|
| 35 |
+
#include "SDL_rwops.h"
|
| 36 |
+
|
| 37 |
+
#include "begin_code.h"
|
| 38 |
+
/* Set up for C function definitions, even when using C++ */
|
| 39 |
+
#ifdef __cplusplus
|
| 40 |
+
extern "C" {
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* \name Surface flags
|
| 45 |
+
*
|
| 46 |
+
* These are the currently supported flags for the ::SDL_Surface.
|
| 47 |
+
*
|
| 48 |
+
* \internal
|
| 49 |
+
* Used internally (read-only).
|
| 50 |
+
*/
|
| 51 |
+
/* @{ */
|
| 52 |
+
#define SDL_SWSURFACE 0 /**< Just here for compatibility */
|
| 53 |
+
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
|
| 54 |
+
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
|
| 55 |
+
#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
|
| 56 |
+
#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */
|
| 57 |
+
/* @} *//* Surface flags */
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* Evaluates to true if the surface needs to be locked before access.
|
| 61 |
+
*/
|
| 62 |
+
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* \brief A collection of pixels used in software blitting.
|
| 66 |
+
*
|
| 67 |
+
* \note This structure should be treated as read-only, except for \c pixels,
|
| 68 |
+
* which, if not NULL, contains the raw pixel data for the surface.
|
| 69 |
+
*/
|
| 70 |
+
typedef struct SDL_Surface
|
| 71 |
+
{
|
| 72 |
+
Uint32 flags; /**< Read-only */
|
| 73 |
+
SDL_PixelFormat *format; /**< Read-only */
|
| 74 |
+
int w, h; /**< Read-only */
|
| 75 |
+
int pitch; /**< Read-only */
|
| 76 |
+
void *pixels; /**< Read-write */
|
| 77 |
+
|
| 78 |
+
/** Application data associated with the surface */
|
| 79 |
+
void *userdata; /**< Read-write */
|
| 80 |
+
|
| 81 |
+
/** information needed for surfaces requiring locks */
|
| 82 |
+
int locked; /**< Read-only */
|
| 83 |
+
void *lock_data; /**< Read-only */
|
| 84 |
+
|
| 85 |
+
/** clipping information */
|
| 86 |
+
SDL_Rect clip_rect; /**< Read-only */
|
| 87 |
+
|
| 88 |
+
/** info for fast blit mapping to other surfaces */
|
| 89 |
+
struct SDL_BlitMap *map; /**< Private */
|
| 90 |
+
|
| 91 |
+
/** Reference count -- used when freeing surface */
|
| 92 |
+
int refcount; /**< Read-mostly */
|
| 93 |
+
} SDL_Surface;
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* \brief The type of function used for surface blitting functions.
|
| 97 |
+
*/
|
| 98 |
+
typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
|
| 99 |
+
struct SDL_Surface * dst, SDL_Rect * dstrect);
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* \brief The formula used for converting between YUV and RGB
|
| 103 |
+
*/
|
| 104 |
+
typedef enum
|
| 105 |
+
{
|
| 106 |
+
SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
|
| 107 |
+
SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
|
| 108 |
+
SDL_YUV_CONVERSION_BT709, /**< BT.709 */
|
| 109 |
+
SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
|
| 110 |
+
} SDL_YUV_CONVERSION_MODE;
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* Allocate and free an RGB surface.
|
| 114 |
+
*
|
| 115 |
+
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
|
| 116 |
+
* If the depth is greater than 8 bits, the pixel format is set using the
|
| 117 |
+
* flags '[RGB]mask'.
|
| 118 |
+
*
|
| 119 |
+
* If the function runs out of memory, it will return NULL.
|
| 120 |
+
*
|
| 121 |
+
* \param flags The \c flags are obsolete and should be set to 0.
|
| 122 |
+
* \param width The width in pixels of the surface to create.
|
| 123 |
+
* \param height The height in pixels of the surface to create.
|
| 124 |
+
* \param depth The depth in bits of the surface to create.
|
| 125 |
+
* \param Rmask The red mask of the surface to create.
|
| 126 |
+
* \param Gmask The green mask of the surface to create.
|
| 127 |
+
* \param Bmask The blue mask of the surface to create.
|
| 128 |
+
* \param Amask The alpha mask of the surface to create.
|
| 129 |
+
*/
|
| 130 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
|
| 131 |
+
(Uint32 flags, int width, int height, int depth,
|
| 132 |
+
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
| 133 |
+
|
| 134 |
+
/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
|
| 135 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
|
| 136 |
+
(Uint32 flags, int width, int height, int depth, Uint32 format);
|
| 137 |
+
|
| 138 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
| 139 |
+
int width,
|
| 140 |
+
int height,
|
| 141 |
+
int depth,
|
| 142 |
+
int pitch,
|
| 143 |
+
Uint32 Rmask,
|
| 144 |
+
Uint32 Gmask,
|
| 145 |
+
Uint32 Bmask,
|
| 146 |
+
Uint32 Amask);
|
| 147 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
|
| 148 |
+
(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
|
| 149 |
+
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
|
| 150 |
+
|
| 151 |
+
/**
|
| 152 |
+
* \brief Set the palette used by a surface.
|
| 153 |
+
*
|
| 154 |
+
* \return 0, or -1 if the surface format doesn't use a palette.
|
| 155 |
+
*
|
| 156 |
+
* \note A single palette can be shared with many surfaces.
|
| 157 |
+
*/
|
| 158 |
+
extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
|
| 159 |
+
SDL_Palette * palette);
|
| 160 |
+
|
| 161 |
+
/**
|
| 162 |
+
* \brief Sets up a surface for directly accessing the pixels.
|
| 163 |
+
*
|
| 164 |
+
* Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
|
| 165 |
+
* to and read from \c surface->pixels, using the pixel format stored in
|
| 166 |
+
* \c surface->format. Once you are done accessing the surface, you should
|
| 167 |
+
* use SDL_UnlockSurface() to release it.
|
| 168 |
+
*
|
| 169 |
+
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
|
| 170 |
+
* to 0, then you can read and write to the surface at any time, and the
|
| 171 |
+
* pixel format of the surface will not change.
|
| 172 |
+
*
|
| 173 |
+
* No operating system or library calls should be made between lock/unlock
|
| 174 |
+
* pairs, as critical system locks may be held during this time.
|
| 175 |
+
*
|
| 176 |
+
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
|
| 177 |
+
*
|
| 178 |
+
* \sa SDL_UnlockSurface()
|
| 179 |
+
*/
|
| 180 |
+
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
|
| 181 |
+
/** \sa SDL_LockSurface() */
|
| 182 |
+
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
|
| 183 |
+
|
| 184 |
+
/**
|
| 185 |
+
* Load a surface from a seekable SDL data stream (memory or file).
|
| 186 |
+
*
|
| 187 |
+
* If \c freesrc is non-zero, the stream will be closed after being read.
|
| 188 |
+
*
|
| 189 |
+
* The new surface should be freed with SDL_FreeSurface().
|
| 190 |
+
*
|
| 191 |
+
* \return the new surface, or NULL if there was an error.
|
| 192 |
+
*/
|
| 193 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
|
| 194 |
+
int freesrc);
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* Load a surface from a file.
|
| 198 |
+
*
|
| 199 |
+
* Convenience macro.
|
| 200 |
+
*/
|
| 201 |
+
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
|
| 202 |
+
|
| 203 |
+
/**
|
| 204 |
+
* Save a surface to a seekable SDL data stream (memory or file).
|
| 205 |
+
*
|
| 206 |
+
* Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
|
| 207 |
+
* BMP directly. Other RGB formats with 8-bit or higher get converted to a
|
| 208 |
+
* 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
|
| 209 |
+
* surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
|
| 210 |
+
* not supported.
|
| 211 |
+
*
|
| 212 |
+
* If \c freedst is non-zero, the stream will be closed after being written.
|
| 213 |
+
*
|
| 214 |
+
* \return 0 if successful or -1 if there was an error.
|
| 215 |
+
*/
|
| 216 |
+
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
| 217 |
+
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
|
| 218 |
+
|
| 219 |
+
/**
|
| 220 |
+
* Save a surface to a file.
|
| 221 |
+
*
|
| 222 |
+
* Convenience macro.
|
| 223 |
+
*/
|
| 224 |
+
#define SDL_SaveBMP(surface, file) \
|
| 225 |
+
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
| 226 |
+
|
| 227 |
+
/**
|
| 228 |
+
* \brief Sets the RLE acceleration hint for a surface.
|
| 229 |
+
*
|
| 230 |
+
* \return 0 on success, or -1 if the surface is not valid
|
| 231 |
+
*
|
| 232 |
+
* \note If RLE is enabled, colorkey and alpha blending blits are much faster,
|
| 233 |
+
* but the surface must be locked before directly accessing the pixels.
|
| 234 |
+
*/
|
| 235 |
+
extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
|
| 236 |
+
int flag);
|
| 237 |
+
|
| 238 |
+
/**
|
| 239 |
+
* \brief Sets the color key (transparent pixel) in a blittable surface.
|
| 240 |
+
*
|
| 241 |
+
* \param surface The surface to update
|
| 242 |
+
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
|
| 243 |
+
* \param key The transparent pixel in the native surface format
|
| 244 |
+
*
|
| 245 |
+
* \return 0 on success, or -1 if the surface is not valid
|
| 246 |
+
*
|
| 247 |
+
* You can pass SDL_RLEACCEL to enable RLE accelerated blits.
|
| 248 |
+
*/
|
| 249 |
+
extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
|
| 250 |
+
int flag, Uint32 key);
|
| 251 |
+
|
| 252 |
+
/**
|
| 253 |
+
* \brief Returns whether the surface has a color key
|
| 254 |
+
*
|
| 255 |
+
* \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
|
| 256 |
+
*/
|
| 257 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
|
| 258 |
+
|
| 259 |
+
/**
|
| 260 |
+
* \brief Gets the color key (transparent pixel) in a blittable surface.
|
| 261 |
+
*
|
| 262 |
+
* \param surface The surface to update
|
| 263 |
+
* \param key A pointer filled in with the transparent pixel in the native
|
| 264 |
+
* surface format
|
| 265 |
+
*
|
| 266 |
+
* \return 0 on success, or -1 if the surface is not valid or colorkey is not
|
| 267 |
+
* enabled.
|
| 268 |
+
*/
|
| 269 |
+
extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
|
| 270 |
+
Uint32 * key);
|
| 271 |
+
|
| 272 |
+
/**
|
| 273 |
+
* \brief Set an additional color value used in blit operations.
|
| 274 |
+
*
|
| 275 |
+
* \param surface The surface to update.
|
| 276 |
+
* \param r The red color value multiplied into blit operations.
|
| 277 |
+
* \param g The green color value multiplied into blit operations.
|
| 278 |
+
* \param b The blue color value multiplied into blit operations.
|
| 279 |
+
*
|
| 280 |
+
* \return 0 on success, or -1 if the surface is not valid.
|
| 281 |
+
*
|
| 282 |
+
* \sa SDL_GetSurfaceColorMod()
|
| 283 |
+
*/
|
| 284 |
+
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
|
| 285 |
+
Uint8 r, Uint8 g, Uint8 b);
|
| 286 |
+
|
| 287 |
+
|
| 288 |
+
/**
|
| 289 |
+
* \brief Get the additional color value used in blit operations.
|
| 290 |
+
*
|
| 291 |
+
* \param surface The surface to query.
|
| 292 |
+
* \param r A pointer filled in with the current red color value.
|
| 293 |
+
* \param g A pointer filled in with the current green color value.
|
| 294 |
+
* \param b A pointer filled in with the current blue color value.
|
| 295 |
+
*
|
| 296 |
+
* \return 0 on success, or -1 if the surface is not valid.
|
| 297 |
+
*
|
| 298 |
+
* \sa SDL_SetSurfaceColorMod()
|
| 299 |
+
*/
|
| 300 |
+
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
|
| 301 |
+
Uint8 * r, Uint8 * g,
|
| 302 |
+
Uint8 * b);
|
| 303 |
+
|
| 304 |
+
/**
|
| 305 |
+
* \brief Set an additional alpha value used in blit operations.
|
| 306 |
+
*
|
| 307 |
+
* \param surface The surface to update.
|
| 308 |
+
* \param alpha The alpha value multiplied into blit operations.
|
| 309 |
+
*
|
| 310 |
+
* \return 0 on success, or -1 if the surface is not valid.
|
| 311 |
+
*
|
| 312 |
+
* \sa SDL_GetSurfaceAlphaMod()
|
| 313 |
+
*/
|
| 314 |
+
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
|
| 315 |
+
Uint8 alpha);
|
| 316 |
+
|
| 317 |
+
/**
|
| 318 |
+
* \brief Get the additional alpha value used in blit operations.
|
| 319 |
+
*
|
| 320 |
+
* \param surface The surface to query.
|
| 321 |
+
* \param alpha A pointer filled in with the current alpha value.
|
| 322 |
+
*
|
| 323 |
+
* \return 0 on success, or -1 if the surface is not valid.
|
| 324 |
+
*
|
| 325 |
+
* \sa SDL_SetSurfaceAlphaMod()
|
| 326 |
+
*/
|
| 327 |
+
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
|
| 328 |
+
Uint8 * alpha);
|
| 329 |
+
|
| 330 |
+
/**
|
| 331 |
+
* \brief Set the blend mode used for blit operations.
|
| 332 |
+
*
|
| 333 |
+
* \param surface The surface to update.
|
| 334 |
+
* \param blendMode ::SDL_BlendMode to use for blit blending.
|
| 335 |
+
*
|
| 336 |
+
* \return 0 on success, or -1 if the parameters are not valid.
|
| 337 |
+
*
|
| 338 |
+
* \sa SDL_GetSurfaceBlendMode()
|
| 339 |
+
*/
|
| 340 |
+
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
|
| 341 |
+
SDL_BlendMode blendMode);
|
| 342 |
+
|
| 343 |
+
/**
|
| 344 |
+
* \brief Get the blend mode used for blit operations.
|
| 345 |
+
*
|
| 346 |
+
* \param surface The surface to query.
|
| 347 |
+
* \param blendMode A pointer filled in with the current blend mode.
|
| 348 |
+
*
|
| 349 |
+
* \return 0 on success, or -1 if the surface is not valid.
|
| 350 |
+
*
|
| 351 |
+
* \sa SDL_SetSurfaceBlendMode()
|
| 352 |
+
*/
|
| 353 |
+
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
| 354 |
+
SDL_BlendMode *blendMode);
|
| 355 |
+
|
| 356 |
+
/**
|
| 357 |
+
* Sets the clipping rectangle for the destination surface in a blit.
|
| 358 |
+
*
|
| 359 |
+
* If the clip rectangle is NULL, clipping will be disabled.
|
| 360 |
+
*
|
| 361 |
+
* If the clip rectangle doesn't intersect the surface, the function will
|
| 362 |
+
* return SDL_FALSE and blits will be completely clipped. Otherwise the
|
| 363 |
+
* function returns SDL_TRUE and blits to the surface will be clipped to
|
| 364 |
+
* the intersection of the surface area and the clipping rectangle.
|
| 365 |
+
*
|
| 366 |
+
* Note that blits are automatically clipped to the edges of the source
|
| 367 |
+
* and destination surfaces.
|
| 368 |
+
*/
|
| 369 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
|
| 370 |
+
const SDL_Rect * rect);
|
| 371 |
+
|
| 372 |
+
/**
|
| 373 |
+
* Gets the clipping rectangle for the destination surface in a blit.
|
| 374 |
+
*
|
| 375 |
+
* \c rect must be a pointer to a valid rectangle which will be filled
|
| 376 |
+
* with the correct values.
|
| 377 |
+
*/
|
| 378 |
+
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
|
| 379 |
+
SDL_Rect * rect);
|
| 380 |
+
|
| 381 |
+
/*
|
| 382 |
+
* Creates a new surface identical to the existing surface
|
| 383 |
+
*/
|
| 384 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
|
| 385 |
+
|
| 386 |
+
/**
|
| 387 |
+
* Creates a new surface of the specified format, and then copies and maps
|
| 388 |
+
* the given surface to it so the blit of the converted surface will be as
|
| 389 |
+
* fast as possible. If this function fails, it returns NULL.
|
| 390 |
+
*
|
| 391 |
+
* The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
|
| 392 |
+
* semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
|
| 393 |
+
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
|
| 394 |
+
* surface.
|
| 395 |
+
*/
|
| 396 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
|
| 397 |
+
(SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
|
| 398 |
+
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
|
| 399 |
+
(SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
|
| 400 |
+
|
| 401 |
+
/**
|
| 402 |
+
* \brief Copy a block of pixels of one format to another format
|
| 403 |
+
*
|
| 404 |
+
* \return 0 on success, or -1 if there was an error
|
| 405 |
+
*/
|
| 406 |
+
extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
| 407 |
+
Uint32 src_format,
|
| 408 |
+
const void * src, int src_pitch,
|
| 409 |
+
Uint32 dst_format,
|
| 410 |
+
void * dst, int dst_pitch);
|
| 411 |
+
|
| 412 |
+
/**
|
| 413 |
+
* Performs a fast fill of the given rectangle with \c color.
|
| 414 |
+
*
|
| 415 |
+
* If \c rect is NULL, the whole surface will be filled with \c color.
|
| 416 |
+
*
|
| 417 |
+
* The color should be a pixel of the format used by the surface, and
|
| 418 |
+
* can be generated by the SDL_MapRGB() function.
|
| 419 |
+
*
|
| 420 |
+
* \return 0 on success, or -1 on error.
|
| 421 |
+
*/
|
| 422 |
+
extern DECLSPEC int SDLCALL SDL_FillRect
|
| 423 |
+
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
|
| 424 |
+
extern DECLSPEC int SDLCALL SDL_FillRects
|
| 425 |
+
(SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
|
| 426 |
+
|
| 427 |
+
/**
|
| 428 |
+
* Performs a fast blit from the source surface to the destination surface.
|
| 429 |
+
*
|
| 430 |
+
* This assumes that the source and destination rectangles are
|
| 431 |
+
* the same size. If either \c srcrect or \c dstrect are NULL, the entire
|
| 432 |
+
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
|
| 433 |
+
* in \c srcrect and \c dstrect after all clipping is performed.
|
| 434 |
+
*
|
| 435 |
+
* \return If the blit is successful, it returns 0, otherwise it returns -1.
|
| 436 |
+
*
|
| 437 |
+
* The blit function should not be called on a locked surface.
|
| 438 |
+
*
|
| 439 |
+
* The blit semantics for surfaces with and without blending and colorkey
|
| 440 |
+
* are defined as follows:
|
| 441 |
+
* \verbatim
|
| 442 |
+
RGBA->RGB:
|
| 443 |
+
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
| 444 |
+
alpha-blend (using the source alpha-channel and per-surface alpha)
|
| 445 |
+
SDL_SRCCOLORKEY ignored.
|
| 446 |
+
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
| 447 |
+
copy RGB.
|
| 448 |
+
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
| 449 |
+
RGB values of the source color key, ignoring alpha in the
|
| 450 |
+
comparison.
|
| 451 |
+
|
| 452 |
+
RGB->RGBA:
|
| 453 |
+
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
| 454 |
+
alpha-blend (using the source per-surface alpha)
|
| 455 |
+
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
| 456 |
+
copy RGB, set destination alpha to source per-surface alpha value.
|
| 457 |
+
both:
|
| 458 |
+
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
| 459 |
+
source color key.
|
| 460 |
+
|
| 461 |
+
RGBA->RGBA:
|
| 462 |
+
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
| 463 |
+
alpha-blend (using the source alpha-channel and per-surface alpha)
|
| 464 |
+
SDL_SRCCOLORKEY ignored.
|
| 465 |
+
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
| 466 |
+
copy all of RGBA to the destination.
|
| 467 |
+
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
| 468 |
+
RGB values of the source color key, ignoring alpha in the
|
| 469 |
+
comparison.
|
| 470 |
+
|
| 471 |
+
RGB->RGB:
|
| 472 |
+
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
| 473 |
+
alpha-blend (using the source per-surface alpha)
|
| 474 |
+
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
| 475 |
+
copy RGB.
|
| 476 |
+
both:
|
| 477 |
+
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
| 478 |
+
source color key.
|
| 479 |
+
\endverbatim
|
| 480 |
+
*
|
| 481 |
+
* You should call SDL_BlitSurface() unless you know exactly how SDL
|
| 482 |
+
* blitting works internally and how to use the other blit functions.
|
| 483 |
+
*/
|
| 484 |
+
#define SDL_BlitSurface SDL_UpperBlit
|
| 485 |
+
|
| 486 |
+
/**
|
| 487 |
+
* This is the public blit function, SDL_BlitSurface(), and it performs
|
| 488 |
+
* rectangle validation and clipping before passing it to SDL_LowerBlit()
|
| 489 |
+
*/
|
| 490 |
+
extern DECLSPEC int SDLCALL SDL_UpperBlit
|
| 491 |
+
(SDL_Surface * src, const SDL_Rect * srcrect,
|
| 492 |
+
SDL_Surface * dst, SDL_Rect * dstrect);
|
| 493 |
+
|
| 494 |
+
/**
|
| 495 |
+
* This is a semi-private blit function and it performs low-level surface
|
| 496 |
+
* blitting only.
|
| 497 |
+
*/
|
| 498 |
+
extern DECLSPEC int SDLCALL SDL_LowerBlit
|
| 499 |
+
(SDL_Surface * src, SDL_Rect * srcrect,
|
| 500 |
+
SDL_Surface * dst, SDL_Rect * dstrect);
|
| 501 |
+
|
| 502 |
+
/**
|
| 503 |
+
* \brief Perform a fast, low quality, stretch blit between two surfaces of the
|
| 504 |
+
* same pixel format.
|
| 505 |
+
*
|
| 506 |
+
* \note This function uses a static buffer, and is not thread-safe.
|
| 507 |
+
*/
|
| 508 |
+
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
|
| 509 |
+
const SDL_Rect * srcrect,
|
| 510 |
+
SDL_Surface * dst,
|
| 511 |
+
const SDL_Rect * dstrect);
|
| 512 |
+
|
| 513 |
+
#define SDL_BlitScaled SDL_UpperBlitScaled
|
| 514 |
+
|
| 515 |
+
/**
|
| 516 |
+
* This is the public scaled blit function, SDL_BlitScaled(), and it performs
|
| 517 |
+
* rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
|
| 518 |
+
*/
|
| 519 |
+
extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
|
| 520 |
+
(SDL_Surface * src, const SDL_Rect * srcrect,
|
| 521 |
+
SDL_Surface * dst, SDL_Rect * dstrect);
|
| 522 |
+
|
| 523 |
+
/**
|
| 524 |
+
* This is a semi-private blit function and it performs low-level surface
|
| 525 |
+
* scaled blitting only.
|
| 526 |
+
*/
|
| 527 |
+
extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
|
| 528 |
+
(SDL_Surface * src, SDL_Rect * srcrect,
|
| 529 |
+
SDL_Surface * dst, SDL_Rect * dstrect);
|
| 530 |
+
|
| 531 |
+
/**
|
| 532 |
+
* \brief Set the YUV conversion mode
|
| 533 |
+
*/
|
| 534 |
+
extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
|
| 535 |
+
|
| 536 |
+
/**
|
| 537 |
+
* \brief Get the YUV conversion mode
|
| 538 |
+
*/
|
| 539 |
+
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
|
| 540 |
+
|
| 541 |
+
/**
|
| 542 |
+
* \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
|
| 543 |
+
*/
|
| 544 |
+
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
|
| 545 |
+
|
| 546 |
+
/* Ends C function definitions when using C++ */
|
| 547 |
+
#ifdef __cplusplus
|
| 548 |
+
}
|
| 549 |
+
#endif
|
| 550 |
+
#include "close_code.h"
|
| 551 |
+
|
| 552 |
+
#endif /* SDL_surface_h_ */
|
| 553 |
+
|
| 554 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_system.h
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_system.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for platform specific SDL API functions
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_system_h_
|
| 29 |
+
#define SDL_system_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_keyboard.h"
|
| 33 |
+
#include "SDL_render.h"
|
| 34 |
+
#include "SDL_video.h"
|
| 35 |
+
|
| 36 |
+
#include "begin_code.h"
|
| 37 |
+
/* Set up for C function definitions, even when using C++ */
|
| 38 |
+
#ifdef __cplusplus
|
| 39 |
+
extern "C" {
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
/* Platform specific functions for Windows */
|
| 44 |
+
#ifdef __WIN32__
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
\brief Set a function that is called for every windows message, before TranslateMessage()
|
| 48 |
+
*/
|
| 49 |
+
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
|
| 50 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
| 51 |
+
|
| 52 |
+
/**
|
| 53 |
+
\brief Returns the D3D9 adapter index that matches the specified display index.
|
| 54 |
+
|
| 55 |
+
This adapter index can be passed to IDirect3D9::CreateDevice and controls
|
| 56 |
+
on which monitor a full screen application will appear.
|
| 57 |
+
*/
|
| 58 |
+
extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
|
| 59 |
+
|
| 60 |
+
typedef struct IDirect3DDevice9 IDirect3DDevice9;
|
| 61 |
+
/**
|
| 62 |
+
\brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
|
| 63 |
+
|
| 64 |
+
Once you are done using the device, you should release it to avoid a resource leak.
|
| 65 |
+
*/
|
| 66 |
+
extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
\brief Returns the DXGI Adapter and Output indices for the specified display index.
|
| 70 |
+
|
| 71 |
+
These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
|
| 72 |
+
required to create a DX10 or DX11 device and swap chain.
|
| 73 |
+
*/
|
| 74 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
|
| 75 |
+
|
| 76 |
+
#endif /* __WIN32__ */
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
/* Platform specific functions for Linux */
|
| 80 |
+
#ifdef __LINUX__
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
\brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
|
| 84 |
+
|
| 85 |
+
\return 0 on success, or -1 on error.
|
| 86 |
+
*/
|
| 87 |
+
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
|
| 88 |
+
|
| 89 |
+
#endif /* __LINUX__ */
|
| 90 |
+
|
| 91 |
+
/* Platform specific functions for iOS */
|
| 92 |
+
#ifdef __IPHONEOS__
|
| 93 |
+
|
| 94 |
+
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
| 95 |
+
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
| 96 |
+
|
| 97 |
+
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
| 98 |
+
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
| 99 |
+
|
| 100 |
+
#endif /* __IPHONEOS__ */
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
/* Platform specific functions for Android */
|
| 104 |
+
#ifdef __ANDROID__
|
| 105 |
+
|
| 106 |
+
/**
|
| 107 |
+
\brief Get the JNI environment for the current thread
|
| 108 |
+
|
| 109 |
+
This returns JNIEnv*, but the prototype is void* so we don't need jni.h
|
| 110 |
+
*/
|
| 111 |
+
extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
\brief Get the SDL Activity object for the application
|
| 115 |
+
|
| 116 |
+
This returns jobject, but the prototype is void* so we don't need jni.h
|
| 117 |
+
The jobject returned by SDL_AndroidGetActivity is a local reference.
|
| 118 |
+
It is the caller's responsibility to properly release it
|
| 119 |
+
(using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
|
| 120 |
+
*/
|
| 121 |
+
extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
\brief Return API level of the current device
|
| 125 |
+
|
| 126 |
+
API level 29: Android 10
|
| 127 |
+
API level 28: Android 9
|
| 128 |
+
API level 27: Android 8.1
|
| 129 |
+
API level 26: Android 8.0
|
| 130 |
+
API level 25: Android 7.1
|
| 131 |
+
API level 24: Android 7.0
|
| 132 |
+
API level 23: Android 6.0
|
| 133 |
+
API level 22: Android 5.1
|
| 134 |
+
API level 21: Android 5.0
|
| 135 |
+
API level 20: Android 4.4W
|
| 136 |
+
API level 19: Android 4.4
|
| 137 |
+
API level 18: Android 4.3
|
| 138 |
+
API level 17: Android 4.2
|
| 139 |
+
API level 16: Android 4.1
|
| 140 |
+
API level 15: Android 4.0.3
|
| 141 |
+
API level 14: Android 4.0
|
| 142 |
+
API level 13: Android 3.2
|
| 143 |
+
API level 12: Android 3.1
|
| 144 |
+
API level 11: Android 3.0
|
| 145 |
+
API level 10: Android 2.3.3
|
| 146 |
+
*/
|
| 147 |
+
extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
| 148 |
+
|
| 149 |
+
/**
|
| 150 |
+
\brief Return true if the application is running on Android TV
|
| 151 |
+
*/
|
| 152 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
| 153 |
+
|
| 154 |
+
/**
|
| 155 |
+
\brief Return true if the application is running on a Chromebook
|
| 156 |
+
*/
|
| 157 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
| 158 |
+
|
| 159 |
+
/**
|
| 160 |
+
\brief Return true is the application is running on a Samsung DeX docking station
|
| 161 |
+
*/
|
| 162 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
\brief Trigger the Android system back button behavior.
|
| 166 |
+
*/
|
| 167 |
+
extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
| 168 |
+
|
| 169 |
+
/**
|
| 170 |
+
See the official Android developer guide for more information:
|
| 171 |
+
http://developer.android.com/guide/topics/data/data-storage.html
|
| 172 |
+
*/
|
| 173 |
+
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
|
| 174 |
+
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
|
| 175 |
+
|
| 176 |
+
/**
|
| 177 |
+
\brief Get the path used for internal storage for this application.
|
| 178 |
+
|
| 179 |
+
This path is unique to your application and cannot be written to
|
| 180 |
+
by other applications.
|
| 181 |
+
*/
|
| 182 |
+
extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
|
| 183 |
+
|
| 184 |
+
/**
|
| 185 |
+
\brief Get the current state of external storage, a bitmask of these values:
|
| 186 |
+
SDL_ANDROID_EXTERNAL_STORAGE_READ
|
| 187 |
+
SDL_ANDROID_EXTERNAL_STORAGE_WRITE
|
| 188 |
+
|
| 189 |
+
If external storage is currently unavailable, this will return 0.
|
| 190 |
+
*/
|
| 191 |
+
extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
|
| 192 |
+
|
| 193 |
+
/**
|
| 194 |
+
\brief Get the path used for external storage for this application.
|
| 195 |
+
|
| 196 |
+
This path is unique to your application, but is public and can be
|
| 197 |
+
written to by other applications.
|
| 198 |
+
*/
|
| 199 |
+
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
|
| 200 |
+
|
| 201 |
+
#endif /* __ANDROID__ */
|
| 202 |
+
|
| 203 |
+
/* Platform specific functions for WinRT */
|
| 204 |
+
#ifdef __WINRT__
|
| 205 |
+
|
| 206 |
+
/**
|
| 207 |
+
* \brief WinRT / Windows Phone path types
|
| 208 |
+
*/
|
| 209 |
+
typedef enum
|
| 210 |
+
{
|
| 211 |
+
/** \brief The installed app's root directory.
|
| 212 |
+
Files here are likely to be read-only. */
|
| 213 |
+
SDL_WINRT_PATH_INSTALLED_LOCATION,
|
| 214 |
+
|
| 215 |
+
/** \brief The app's local data store. Files may be written here */
|
| 216 |
+
SDL_WINRT_PATH_LOCAL_FOLDER,
|
| 217 |
+
|
| 218 |
+
/** \brief The app's roaming data store. Unsupported on Windows Phone.
|
| 219 |
+
Files written here may be copied to other machines via a network
|
| 220 |
+
connection.
|
| 221 |
+
*/
|
| 222 |
+
SDL_WINRT_PATH_ROAMING_FOLDER,
|
| 223 |
+
|
| 224 |
+
/** \brief The app's temporary data store. Unsupported on Windows Phone.
|
| 225 |
+
Files written here may be deleted at any time. */
|
| 226 |
+
SDL_WINRT_PATH_TEMP_FOLDER
|
| 227 |
+
} SDL_WinRT_Path;
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
/**
|
| 231 |
+
* \brief WinRT Device Family
|
| 232 |
+
*/
|
| 233 |
+
typedef enum
|
| 234 |
+
{
|
| 235 |
+
/** \brief Unknown family */
|
| 236 |
+
SDL_WINRT_DEVICEFAMILY_UNKNOWN,
|
| 237 |
+
|
| 238 |
+
/** \brief Desktop family*/
|
| 239 |
+
SDL_WINRT_DEVICEFAMILY_DESKTOP,
|
| 240 |
+
|
| 241 |
+
/** \brief Mobile family (for example smartphone) */
|
| 242 |
+
SDL_WINRT_DEVICEFAMILY_MOBILE,
|
| 243 |
+
|
| 244 |
+
/** \brief XBox family */
|
| 245 |
+
SDL_WINRT_DEVICEFAMILY_XBOX,
|
| 246 |
+
} SDL_WinRT_DeviceFamily;
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
/**
|
| 250 |
+
* \brief Retrieves a WinRT defined path on the local file system
|
| 251 |
+
*
|
| 252 |
+
* \note Documentation on most app-specific path types on WinRT
|
| 253 |
+
* can be found on MSDN, at the URL:
|
| 254 |
+
* http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
| 255 |
+
*
|
| 256 |
+
* \param pathType The type of path to retrieve.
|
| 257 |
+
* \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
|
| 258 |
+
* if the path is not available for any reason. Not all paths are
|
| 259 |
+
* available on all versions of Windows. This is especially true on
|
| 260 |
+
* Windows Phone. Check the documentation for the given
|
| 261 |
+
* SDL_WinRT_Path for more information on which path types are
|
| 262 |
+
* supported where.
|
| 263 |
+
*/
|
| 264 |
+
extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
|
| 265 |
+
|
| 266 |
+
/**
|
| 267 |
+
* \brief Retrieves a WinRT defined path on the local file system
|
| 268 |
+
*
|
| 269 |
+
* \note Documentation on most app-specific path types on WinRT
|
| 270 |
+
* can be found on MSDN, at the URL:
|
| 271 |
+
* http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
| 272 |
+
*
|
| 273 |
+
* \param pathType The type of path to retrieve.
|
| 274 |
+
* \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
|
| 275 |
+
* if the path is not available for any reason. Not all paths are
|
| 276 |
+
* available on all versions of Windows. This is especially true on
|
| 277 |
+
* Windows Phone. Check the documentation for the given
|
| 278 |
+
* SDL_WinRT_Path for more information on which path types are
|
| 279 |
+
* supported where.
|
| 280 |
+
*/
|
| 281 |
+
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
|
| 282 |
+
|
| 283 |
+
/**
|
| 284 |
+
* \brief Detects the device family of WinRT plattform on runtime
|
| 285 |
+
*
|
| 286 |
+
* \return Device family
|
| 287 |
+
*/
|
| 288 |
+
extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
| 289 |
+
|
| 290 |
+
#endif /* __WINRT__ */
|
| 291 |
+
|
| 292 |
+
/**
|
| 293 |
+
\brief Return true if the current device is a tablet.
|
| 294 |
+
*/
|
| 295 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
| 296 |
+
|
| 297 |
+
/* Functions used by iOS application delegates to notify SDL about state changes */
|
| 298 |
+
extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
|
| 299 |
+
extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
|
| 300 |
+
extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
|
| 301 |
+
extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
|
| 302 |
+
extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
| 303 |
+
extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
| 304 |
+
#ifdef __IPHONEOS__
|
| 305 |
+
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
| 306 |
+
#endif
|
| 307 |
+
|
| 308 |
+
/* Ends C function definitions when using C++ */
|
| 309 |
+
#ifdef __cplusplus
|
| 310 |
+
}
|
| 311 |
+
#endif
|
| 312 |
+
#include "close_code.h"
|
| 313 |
+
|
| 314 |
+
#endif /* SDL_system_h_ */
|
| 315 |
+
|
| 316 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_syswm.h
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_syswm.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL custom system window manager hooks.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_syswm_h_
|
| 29 |
+
#define SDL_syswm_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_error.h"
|
| 33 |
+
#include "SDL_video.h"
|
| 34 |
+
#include "SDL_version.h"
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* \brief SDL_syswm.h
|
| 38 |
+
*
|
| 39 |
+
* Your application has access to a special type of event ::SDL_SYSWMEVENT,
|
| 40 |
+
* which contains window-manager specific information and arrives whenever
|
| 41 |
+
* an unhandled window event occurs. This event is ignored by default, but
|
| 42 |
+
* you can enable it with SDL_EventState().
|
| 43 |
+
*/
|
| 44 |
+
struct SDL_SysWMinfo;
|
| 45 |
+
|
| 46 |
+
#if !defined(SDL_PROTOTYPES_ONLY)
|
| 47 |
+
|
| 48 |
+
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
| 49 |
+
#ifndef WIN32_LEAN_AND_MEAN
|
| 50 |
+
#define WIN32_LEAN_AND_MEAN
|
| 51 |
+
#endif
|
| 52 |
+
#ifndef NOMINMAX /* don't define min() and max(). */
|
| 53 |
+
#define NOMINMAX
|
| 54 |
+
#endif
|
| 55 |
+
#include <windows.h>
|
| 56 |
+
#endif
|
| 57 |
+
|
| 58 |
+
#if defined(SDL_VIDEO_DRIVER_WINRT)
|
| 59 |
+
#include <Inspectable.h>
|
| 60 |
+
#endif
|
| 61 |
+
|
| 62 |
+
/* This is the structure for custom window manager events */
|
| 63 |
+
#if defined(SDL_VIDEO_DRIVER_X11)
|
| 64 |
+
#if defined(__APPLE__) && defined(__MACH__)
|
| 65 |
+
/* conflicts with Quickdraw.h */
|
| 66 |
+
#define Cursor X11Cursor
|
| 67 |
+
#endif
|
| 68 |
+
|
| 69 |
+
#include <X11/Xlib.h>
|
| 70 |
+
#include <X11/Xatom.h>
|
| 71 |
+
|
| 72 |
+
#if defined(__APPLE__) && defined(__MACH__)
|
| 73 |
+
/* matches the re-define above */
|
| 74 |
+
#undef Cursor
|
| 75 |
+
#endif
|
| 76 |
+
|
| 77 |
+
#endif /* defined(SDL_VIDEO_DRIVER_X11) */
|
| 78 |
+
|
| 79 |
+
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
| 80 |
+
#include <directfb.h>
|
| 81 |
+
#endif
|
| 82 |
+
|
| 83 |
+
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
| 84 |
+
#ifdef __OBJC__
|
| 85 |
+
@class NSWindow;
|
| 86 |
+
#else
|
| 87 |
+
typedef struct _NSWindow NSWindow;
|
| 88 |
+
#endif
|
| 89 |
+
#endif
|
| 90 |
+
|
| 91 |
+
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
| 92 |
+
#ifdef __OBJC__
|
| 93 |
+
#include <UIKit/UIKit.h>
|
| 94 |
+
#else
|
| 95 |
+
typedef struct _UIWindow UIWindow;
|
| 96 |
+
typedef struct _UIViewController UIViewController;
|
| 97 |
+
#endif
|
| 98 |
+
typedef Uint32 GLuint;
|
| 99 |
+
#endif
|
| 100 |
+
|
| 101 |
+
#if defined(SDL_VIDEO_DRIVER_ANDROID)
|
| 102 |
+
typedef struct ANativeWindow ANativeWindow;
|
| 103 |
+
typedef void *EGLSurface;
|
| 104 |
+
#endif
|
| 105 |
+
|
| 106 |
+
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
| 107 |
+
#include "SDL_egl.h"
|
| 108 |
+
#endif
|
| 109 |
+
#endif /* SDL_PROTOTYPES_ONLY */
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
#include "begin_code.h"
|
| 113 |
+
/* Set up for C function definitions, even when using C++ */
|
| 114 |
+
#ifdef __cplusplus
|
| 115 |
+
extern "C" {
|
| 116 |
+
#endif
|
| 117 |
+
|
| 118 |
+
#if !defined(SDL_PROTOTYPES_ONLY)
|
| 119 |
+
/**
|
| 120 |
+
* These are the various supported windowing subsystems
|
| 121 |
+
*/
|
| 122 |
+
typedef enum
|
| 123 |
+
{
|
| 124 |
+
SDL_SYSWM_UNKNOWN,
|
| 125 |
+
SDL_SYSWM_WINDOWS,
|
| 126 |
+
SDL_SYSWM_X11,
|
| 127 |
+
SDL_SYSWM_DIRECTFB,
|
| 128 |
+
SDL_SYSWM_COCOA,
|
| 129 |
+
SDL_SYSWM_UIKIT,
|
| 130 |
+
SDL_SYSWM_WAYLAND,
|
| 131 |
+
SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
| 132 |
+
SDL_SYSWM_WINRT,
|
| 133 |
+
SDL_SYSWM_ANDROID,
|
| 134 |
+
SDL_SYSWM_VIVANTE,
|
| 135 |
+
SDL_SYSWM_OS2,
|
| 136 |
+
SDL_SYSWM_HAIKU
|
| 137 |
+
} SDL_SYSWM_TYPE;
|
| 138 |
+
|
| 139 |
+
/**
|
| 140 |
+
* The custom event structure.
|
| 141 |
+
*/
|
| 142 |
+
struct SDL_SysWMmsg
|
| 143 |
+
{
|
| 144 |
+
SDL_version version;
|
| 145 |
+
SDL_SYSWM_TYPE subsystem;
|
| 146 |
+
union
|
| 147 |
+
{
|
| 148 |
+
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
| 149 |
+
struct {
|
| 150 |
+
HWND hwnd; /**< The window for the message */
|
| 151 |
+
UINT msg; /**< The type of message */
|
| 152 |
+
WPARAM wParam; /**< WORD message parameter */
|
| 153 |
+
LPARAM lParam; /**< LONG message parameter */
|
| 154 |
+
} win;
|
| 155 |
+
#endif
|
| 156 |
+
#if defined(SDL_VIDEO_DRIVER_X11)
|
| 157 |
+
struct {
|
| 158 |
+
XEvent event;
|
| 159 |
+
} x11;
|
| 160 |
+
#endif
|
| 161 |
+
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
| 162 |
+
struct {
|
| 163 |
+
DFBEvent event;
|
| 164 |
+
} dfb;
|
| 165 |
+
#endif
|
| 166 |
+
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
| 167 |
+
struct
|
| 168 |
+
{
|
| 169 |
+
/* Latest version of Xcode clang complains about empty structs in C v. C++:
|
| 170 |
+
error: empty struct has size 0 in C, size 1 in C++
|
| 171 |
+
*/
|
| 172 |
+
int dummy;
|
| 173 |
+
/* No Cocoa window events yet */
|
| 174 |
+
} cocoa;
|
| 175 |
+
#endif
|
| 176 |
+
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
| 177 |
+
struct
|
| 178 |
+
{
|
| 179 |
+
int dummy;
|
| 180 |
+
/* No UIKit window events yet */
|
| 181 |
+
} uikit;
|
| 182 |
+
#endif
|
| 183 |
+
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
| 184 |
+
struct
|
| 185 |
+
{
|
| 186 |
+
int dummy;
|
| 187 |
+
/* No Vivante window events yet */
|
| 188 |
+
} vivante;
|
| 189 |
+
#endif
|
| 190 |
+
/* Can't have an empty union */
|
| 191 |
+
int dummy;
|
| 192 |
+
} msg;
|
| 193 |
+
};
|
| 194 |
+
|
| 195 |
+
/**
|
| 196 |
+
* The custom window manager information structure.
|
| 197 |
+
*
|
| 198 |
+
* When this structure is returned, it holds information about which
|
| 199 |
+
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
|
| 200 |
+
*/
|
| 201 |
+
struct SDL_SysWMinfo
|
| 202 |
+
{
|
| 203 |
+
SDL_version version;
|
| 204 |
+
SDL_SYSWM_TYPE subsystem;
|
| 205 |
+
union
|
| 206 |
+
{
|
| 207 |
+
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
| 208 |
+
struct
|
| 209 |
+
{
|
| 210 |
+
HWND window; /**< The window handle */
|
| 211 |
+
HDC hdc; /**< The window device context */
|
| 212 |
+
HINSTANCE hinstance; /**< The instance handle */
|
| 213 |
+
} win;
|
| 214 |
+
#endif
|
| 215 |
+
#if defined(SDL_VIDEO_DRIVER_WINRT)
|
| 216 |
+
struct
|
| 217 |
+
{
|
| 218 |
+
IInspectable * window; /**< The WinRT CoreWindow */
|
| 219 |
+
} winrt;
|
| 220 |
+
#endif
|
| 221 |
+
#if defined(SDL_VIDEO_DRIVER_X11)
|
| 222 |
+
struct
|
| 223 |
+
{
|
| 224 |
+
Display *display; /**< The X11 display */
|
| 225 |
+
Window window; /**< The X11 window */
|
| 226 |
+
} x11;
|
| 227 |
+
#endif
|
| 228 |
+
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
| 229 |
+
struct
|
| 230 |
+
{
|
| 231 |
+
IDirectFB *dfb; /**< The directfb main interface */
|
| 232 |
+
IDirectFBWindow *window; /**< The directfb window handle */
|
| 233 |
+
IDirectFBSurface *surface; /**< The directfb client surface */
|
| 234 |
+
} dfb;
|
| 235 |
+
#endif
|
| 236 |
+
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
| 237 |
+
struct
|
| 238 |
+
{
|
| 239 |
+
#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
|
| 240 |
+
NSWindow __unsafe_unretained *window; /**< The Cocoa window */
|
| 241 |
+
#else
|
| 242 |
+
NSWindow *window; /**< The Cocoa window */
|
| 243 |
+
#endif
|
| 244 |
+
} cocoa;
|
| 245 |
+
#endif
|
| 246 |
+
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
| 247 |
+
struct
|
| 248 |
+
{
|
| 249 |
+
#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
|
| 250 |
+
UIWindow __unsafe_unretained *window; /**< The UIKit window */
|
| 251 |
+
#else
|
| 252 |
+
UIWindow *window; /**< The UIKit window */
|
| 253 |
+
#endif
|
| 254 |
+
GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
|
| 255 |
+
GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
|
| 256 |
+
GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
|
| 257 |
+
} uikit;
|
| 258 |
+
#endif
|
| 259 |
+
#if defined(SDL_VIDEO_DRIVER_WAYLAND)
|
| 260 |
+
struct
|
| 261 |
+
{
|
| 262 |
+
struct wl_display *display; /**< Wayland display */
|
| 263 |
+
struct wl_surface *surface; /**< Wayland surface */
|
| 264 |
+
struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
|
| 265 |
+
} wl;
|
| 266 |
+
#endif
|
| 267 |
+
#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
| 268 |
+
struct
|
| 269 |
+
{
|
| 270 |
+
void *connection; /**< Mir display server connection */
|
| 271 |
+
void *surface; /**< Mir surface */
|
| 272 |
+
} mir;
|
| 273 |
+
#endif
|
| 274 |
+
|
| 275 |
+
#if defined(SDL_VIDEO_DRIVER_ANDROID)
|
| 276 |
+
struct
|
| 277 |
+
{
|
| 278 |
+
ANativeWindow *window;
|
| 279 |
+
EGLSurface surface;
|
| 280 |
+
} android;
|
| 281 |
+
#endif
|
| 282 |
+
|
| 283 |
+
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
| 284 |
+
struct
|
| 285 |
+
{
|
| 286 |
+
EGLNativeDisplayType display;
|
| 287 |
+
EGLNativeWindowType window;
|
| 288 |
+
} vivante;
|
| 289 |
+
#endif
|
| 290 |
+
|
| 291 |
+
/* Make sure this union is always 64 bytes (8 64-bit pointers). */
|
| 292 |
+
/* Be careful not to overflow this if you add a new target! */
|
| 293 |
+
Uint8 dummy[64];
|
| 294 |
+
} info;
|
| 295 |
+
};
|
| 296 |
+
|
| 297 |
+
#endif /* SDL_PROTOTYPES_ONLY */
|
| 298 |
+
|
| 299 |
+
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
| 300 |
+
|
| 301 |
+
/* Function prototypes */
|
| 302 |
+
/**
|
| 303 |
+
* \brief This function allows access to driver-dependent window information.
|
| 304 |
+
*
|
| 305 |
+
* \param window The window about which information is being requested
|
| 306 |
+
* \param info This structure must be initialized with the SDL version, and is
|
| 307 |
+
* then filled in with information about the given window.
|
| 308 |
+
*
|
| 309 |
+
* \return SDL_TRUE if the function is implemented and the version member of
|
| 310 |
+
* the \c info struct is valid, SDL_FALSE otherwise.
|
| 311 |
+
*
|
| 312 |
+
* You typically use this function like this:
|
| 313 |
+
* \code
|
| 314 |
+
* SDL_SysWMinfo info;
|
| 315 |
+
* SDL_VERSION(&info.version);
|
| 316 |
+
* if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
|
| 317 |
+
* \endcode
|
| 318 |
+
*/
|
| 319 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
|
| 320 |
+
SDL_SysWMinfo * info);
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
/* Ends C function definitions when using C++ */
|
| 324 |
+
#ifdef __cplusplus
|
| 325 |
+
}
|
| 326 |
+
#endif
|
| 327 |
+
#include "close_code.h"
|
| 328 |
+
|
| 329 |
+
#endif /* SDL_syswm_h_ */
|
| 330 |
+
|
| 331 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test.h
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
#ifndef SDL_test_h_
|
| 31 |
+
#define SDL_test_h_
|
| 32 |
+
|
| 33 |
+
#include "SDL.h"
|
| 34 |
+
#include "SDL_test_assert.h"
|
| 35 |
+
#include "SDL_test_common.h"
|
| 36 |
+
#include "SDL_test_compare.h"
|
| 37 |
+
#include "SDL_test_crc32.h"
|
| 38 |
+
#include "SDL_test_font.h"
|
| 39 |
+
#include "SDL_test_fuzzer.h"
|
| 40 |
+
#include "SDL_test_harness.h"
|
| 41 |
+
#include "SDL_test_images.h"
|
| 42 |
+
#include "SDL_test_log.h"
|
| 43 |
+
#include "SDL_test_md5.h"
|
| 44 |
+
#include "SDL_test_memory.h"
|
| 45 |
+
#include "SDL_test_random.h"
|
| 46 |
+
|
| 47 |
+
#include "begin_code.h"
|
| 48 |
+
/* Set up for C function definitions, even when using C++ */
|
| 49 |
+
#ifdef __cplusplus
|
| 50 |
+
extern "C" {
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
/* Global definitions */
|
| 54 |
+
|
| 55 |
+
/*
|
| 56 |
+
* Note: Maximum size of SDLTest log message is less than SDL's limit
|
| 57 |
+
* to ensure we can fit additional information such as the timestamp.
|
| 58 |
+
*/
|
| 59 |
+
#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584
|
| 60 |
+
|
| 61 |
+
/* Ends C function definitions when using C++ */
|
| 62 |
+
#ifdef __cplusplus
|
| 63 |
+
}
|
| 64 |
+
#endif
|
| 65 |
+
#include "close_code.h"
|
| 66 |
+
|
| 67 |
+
#endif /* SDL_test_h_ */
|
| 68 |
+
|
| 69 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_assert.h
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_assert.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
*
|
| 32 |
+
* Assert API for test code and test cases
|
| 33 |
+
*
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_test_assert_h_
|
| 37 |
+
#define SDL_test_assert_h_
|
| 38 |
+
|
| 39 |
+
#include "begin_code.h"
|
| 40 |
+
/* Set up for C function definitions, even when using C++ */
|
| 41 |
+
#ifdef __cplusplus
|
| 42 |
+
extern "C" {
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* \brief Fails the assert.
|
| 47 |
+
*/
|
| 48 |
+
#define ASSERT_FAIL 0
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* \brief Passes the assert.
|
| 52 |
+
*/
|
| 53 |
+
#define ASSERT_PASS 1
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* \brief Assert that logs and break execution flow on failures.
|
| 57 |
+
*
|
| 58 |
+
* \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
|
| 59 |
+
* \param assertDescription Message to log with the assert describing it.
|
| 60 |
+
*/
|
| 61 |
+
void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
|
| 65 |
+
*
|
| 66 |
+
* \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
|
| 67 |
+
* \param assertDescription Message to log with the assert describing it.
|
| 68 |
+
*
|
| 69 |
+
* \returns Returns the assertCondition so it can be used to externally to break execution flow if desired.
|
| 70 |
+
*/
|
| 71 |
+
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
|
| 75 |
+
*
|
| 76 |
+
* \param assertDescription Message to log with the assert describing it.
|
| 77 |
+
*/
|
| 78 |
+
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
|
| 79 |
+
|
| 80 |
+
/**
|
| 81 |
+
* \brief Resets the assert summary counters to zero.
|
| 82 |
+
*/
|
| 83 |
+
void SDLTest_ResetAssertSummary(void);
|
| 84 |
+
|
| 85 |
+
/**
|
| 86 |
+
* \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
|
| 87 |
+
*/
|
| 88 |
+
void SDLTest_LogAssertSummary(void);
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
/**
|
| 92 |
+
* \brief Converts the current assert summary state to a test result.
|
| 93 |
+
*
|
| 94 |
+
* \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
|
| 95 |
+
*/
|
| 96 |
+
int SDLTest_AssertSummaryToTestResult(void);
|
| 97 |
+
|
| 98 |
+
#ifdef __cplusplus
|
| 99 |
+
}
|
| 100 |
+
#endif
|
| 101 |
+
#include "close_code.h"
|
| 102 |
+
|
| 103 |
+
#endif /* SDL_test_assert_h_ */
|
| 104 |
+
|
| 105 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_common.h
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_common.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/* Ported from original test\common.h file. */
|
| 31 |
+
|
| 32 |
+
#ifndef SDL_test_common_h_
|
| 33 |
+
#define SDL_test_common_h_
|
| 34 |
+
|
| 35 |
+
#include "SDL.h"
|
| 36 |
+
|
| 37 |
+
#if defined(__PSP__)
|
| 38 |
+
#define DEFAULT_WINDOW_WIDTH 480
|
| 39 |
+
#define DEFAULT_WINDOW_HEIGHT 272
|
| 40 |
+
#else
|
| 41 |
+
#define DEFAULT_WINDOW_WIDTH 640
|
| 42 |
+
#define DEFAULT_WINDOW_HEIGHT 480
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#define VERBOSE_VIDEO 0x00000001
|
| 46 |
+
#define VERBOSE_MODES 0x00000002
|
| 47 |
+
#define VERBOSE_RENDER 0x00000004
|
| 48 |
+
#define VERBOSE_EVENT 0x00000008
|
| 49 |
+
#define VERBOSE_AUDIO 0x00000010
|
| 50 |
+
|
| 51 |
+
typedef struct
|
| 52 |
+
{
|
| 53 |
+
/* SDL init flags */
|
| 54 |
+
char **argv;
|
| 55 |
+
Uint32 flags;
|
| 56 |
+
Uint32 verbose;
|
| 57 |
+
|
| 58 |
+
/* Video info */
|
| 59 |
+
const char *videodriver;
|
| 60 |
+
int display;
|
| 61 |
+
const char *window_title;
|
| 62 |
+
const char *window_icon;
|
| 63 |
+
Uint32 window_flags;
|
| 64 |
+
int window_x;
|
| 65 |
+
int window_y;
|
| 66 |
+
int window_w;
|
| 67 |
+
int window_h;
|
| 68 |
+
int window_minW;
|
| 69 |
+
int window_minH;
|
| 70 |
+
int window_maxW;
|
| 71 |
+
int window_maxH;
|
| 72 |
+
int logical_w;
|
| 73 |
+
int logical_h;
|
| 74 |
+
float scale;
|
| 75 |
+
int depth;
|
| 76 |
+
int refresh_rate;
|
| 77 |
+
int num_windows;
|
| 78 |
+
SDL_Window **windows;
|
| 79 |
+
|
| 80 |
+
/* Renderer info */
|
| 81 |
+
const char *renderdriver;
|
| 82 |
+
Uint32 render_flags;
|
| 83 |
+
SDL_bool skip_renderer;
|
| 84 |
+
SDL_Renderer **renderers;
|
| 85 |
+
SDL_Texture **targets;
|
| 86 |
+
|
| 87 |
+
/* Audio info */
|
| 88 |
+
const char *audiodriver;
|
| 89 |
+
SDL_AudioSpec audiospec;
|
| 90 |
+
|
| 91 |
+
/* GL settings */
|
| 92 |
+
int gl_red_size;
|
| 93 |
+
int gl_green_size;
|
| 94 |
+
int gl_blue_size;
|
| 95 |
+
int gl_alpha_size;
|
| 96 |
+
int gl_buffer_size;
|
| 97 |
+
int gl_depth_size;
|
| 98 |
+
int gl_stencil_size;
|
| 99 |
+
int gl_double_buffer;
|
| 100 |
+
int gl_accum_red_size;
|
| 101 |
+
int gl_accum_green_size;
|
| 102 |
+
int gl_accum_blue_size;
|
| 103 |
+
int gl_accum_alpha_size;
|
| 104 |
+
int gl_stereo;
|
| 105 |
+
int gl_multisamplebuffers;
|
| 106 |
+
int gl_multisamplesamples;
|
| 107 |
+
int gl_retained_backing;
|
| 108 |
+
int gl_accelerated;
|
| 109 |
+
int gl_major_version;
|
| 110 |
+
int gl_minor_version;
|
| 111 |
+
int gl_debug;
|
| 112 |
+
int gl_profile_mask;
|
| 113 |
+
} SDLTest_CommonState;
|
| 114 |
+
|
| 115 |
+
#include "begin_code.h"
|
| 116 |
+
/* Set up for C function definitions, even when using C++ */
|
| 117 |
+
#ifdef __cplusplus
|
| 118 |
+
extern "C" {
|
| 119 |
+
#endif
|
| 120 |
+
|
| 121 |
+
/* Function prototypes */
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
* \brief Parse command line parameters and create common state.
|
| 125 |
+
*
|
| 126 |
+
* \param argv Array of command line parameters
|
| 127 |
+
* \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO)
|
| 128 |
+
*
|
| 129 |
+
* \returns Returns a newly allocated common state object.
|
| 130 |
+
*/
|
| 131 |
+
SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
|
| 132 |
+
|
| 133 |
+
/**
|
| 134 |
+
* \brief Process one common argument.
|
| 135 |
+
*
|
| 136 |
+
* \param state The common state describing the test window to create.
|
| 137 |
+
* \param index The index of the argument to process in argv[].
|
| 138 |
+
*
|
| 139 |
+
* \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error.
|
| 140 |
+
*/
|
| 141 |
+
int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
/**
|
| 145 |
+
* \brief Logs command line usage info.
|
| 146 |
+
*
|
| 147 |
+
* This logs the appropriate command line options for the subsystems in use
|
| 148 |
+
* plus other common options, and then any application-specific options.
|
| 149 |
+
* This uses the SDL_Log() function and splits up output to be friendly to
|
| 150 |
+
* 80-character-wide terminals.
|
| 151 |
+
*
|
| 152 |
+
* \param state The common state describing the test window for the app.
|
| 153 |
+
* \param argv0 argv[0], as passed to main/SDL_main.
|
| 154 |
+
* \param options an array of strings for application specific options. The last element of the array should be NULL.
|
| 155 |
+
*/
|
| 156 |
+
void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
|
| 157 |
+
|
| 158 |
+
/**
|
| 159 |
+
* \brief Returns common usage information
|
| 160 |
+
*
|
| 161 |
+
* You should (probably) be using SDLTest_CommonLogUsage() instead, but this
|
| 162 |
+
* function remains for binary compatibility. Strings returned from this
|
| 163 |
+
* function are valid until SDLTest_CommonQuit() is called, in which case
|
| 164 |
+
* those strings' memory is freed and can no longer be used.
|
| 165 |
+
*
|
| 166 |
+
* \param state The common state describing the test window to create.
|
| 167 |
+
* \returns String with usage information
|
| 168 |
+
*/
|
| 169 |
+
const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
|
| 170 |
+
|
| 171 |
+
/**
|
| 172 |
+
* \brief Open test window.
|
| 173 |
+
*
|
| 174 |
+
* \param state The common state describing the test window to create.
|
| 175 |
+
*
|
| 176 |
+
* \returns True if initialization succeeded, false otherwise
|
| 177 |
+
*/
|
| 178 |
+
SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
|
| 179 |
+
|
| 180 |
+
/**
|
| 181 |
+
* \brief Easy argument handling when test app doesn't need any custom args.
|
| 182 |
+
*
|
| 183 |
+
* \param state The common state describing the test window to create.
|
| 184 |
+
* \param argc argc, as supplied to SDL_main
|
| 185 |
+
* \param argv argv, as supplied to SDL_main
|
| 186 |
+
*
|
| 187 |
+
* \returns False if app should quit, true otherwise.
|
| 188 |
+
*/
|
| 189 |
+
SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
|
| 190 |
+
|
| 191 |
+
/**
|
| 192 |
+
* \brief Common event handler for test windows.
|
| 193 |
+
*
|
| 194 |
+
* \param state The common state used to create test window.
|
| 195 |
+
* \param event The event to handle.
|
| 196 |
+
* \param done Flag indicating we are done.
|
| 197 |
+
*
|
| 198 |
+
*/
|
| 199 |
+
void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
|
| 200 |
+
|
| 201 |
+
/**
|
| 202 |
+
* \brief Close test window.
|
| 203 |
+
*
|
| 204 |
+
* \param state The common state used to create test window.
|
| 205 |
+
*
|
| 206 |
+
*/
|
| 207 |
+
void SDLTest_CommonQuit(SDLTest_CommonState * state);
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
/* Ends C function definitions when using C++ */
|
| 211 |
+
#ifdef __cplusplus
|
| 212 |
+
}
|
| 213 |
+
#endif
|
| 214 |
+
#include "close_code.h"
|
| 215 |
+
|
| 216 |
+
#endif /* SDL_test_common_h_ */
|
| 217 |
+
|
| 218 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_compare.h
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_compare.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
|
| 32 |
+
Defines comparison functions (i.e. for surfaces).
|
| 33 |
+
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_test_compare_h_
|
| 37 |
+
#define SDL_test_compare_h_
|
| 38 |
+
|
| 39 |
+
#include "SDL.h"
|
| 40 |
+
|
| 41 |
+
#include "SDL_test_images.h"
|
| 42 |
+
|
| 43 |
+
#include "begin_code.h"
|
| 44 |
+
/* Set up for C function definitions, even when using C++ */
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* \brief Compares a surface and with reference image data for equality
|
| 51 |
+
*
|
| 52 |
+
* \param surface Surface used in comparison
|
| 53 |
+
* \param referenceSurface Test Surface used in comparison
|
| 54 |
+
* \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy.
|
| 55 |
+
*
|
| 56 |
+
* \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.
|
| 57 |
+
*/
|
| 58 |
+
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
/* Ends C function definitions when using C++ */
|
| 62 |
+
#ifdef __cplusplus
|
| 63 |
+
}
|
| 64 |
+
#endif
|
| 65 |
+
#include "close_code.h"
|
| 66 |
+
|
| 67 |
+
#endif /* SDL_test_compare_h_ */
|
| 68 |
+
|
| 69 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_crc32.h
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_crc32.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
|
| 32 |
+
Implements CRC32 calculations (default output is Perl String::CRC32 compatible).
|
| 33 |
+
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_test_crc32_h_
|
| 37 |
+
#define SDL_test_crc32_h_
|
| 38 |
+
|
| 39 |
+
#include "begin_code.h"
|
| 40 |
+
/* Set up for C function definitions, even when using C++ */
|
| 41 |
+
#ifdef __cplusplus
|
| 42 |
+
extern "C" {
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
/* ------------ Definitions --------- */
|
| 47 |
+
|
| 48 |
+
/* Definition shared by all CRC routines */
|
| 49 |
+
|
| 50 |
+
#ifndef CrcUint32
|
| 51 |
+
#define CrcUint32 unsigned int
|
| 52 |
+
#endif
|
| 53 |
+
#ifndef CrcUint8
|
| 54 |
+
#define CrcUint8 unsigned char
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#ifdef ORIGINAL_METHOD
|
| 58 |
+
#define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */
|
| 59 |
+
#else
|
| 60 |
+
#define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* Data structure for CRC32 (checksum) computation
|
| 65 |
+
*/
|
| 66 |
+
typedef struct {
|
| 67 |
+
CrcUint32 crc32_table[256]; /* CRC table */
|
| 68 |
+
} SDLTest_Crc32Context;
|
| 69 |
+
|
| 70 |
+
/* ---------- Function Prototypes ------------- */
|
| 71 |
+
|
| 72 |
+
/**
|
| 73 |
+
* \brief Initialize the CRC context
|
| 74 |
+
*
|
| 75 |
+
* Note: The function initializes the crc table required for all crc calculations.
|
| 76 |
+
*
|
| 77 |
+
* \param crcContext pointer to context variable
|
| 78 |
+
*
|
| 79 |
+
* \returns 0 for OK, -1 on error
|
| 80 |
+
*
|
| 81 |
+
*/
|
| 82 |
+
int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
/**
|
| 86 |
+
* \brief calculate a crc32 from a data block
|
| 87 |
+
*
|
| 88 |
+
* \param crcContext pointer to context variable
|
| 89 |
+
* \param inBuf input buffer to checksum
|
| 90 |
+
* \param inLen length of input buffer
|
| 91 |
+
* \param crc32 pointer to Uint32 to store the final CRC into
|
| 92 |
+
*
|
| 93 |
+
* \returns 0 for OK, -1 on error
|
| 94 |
+
*
|
| 95 |
+
*/
|
| 96 |
+
int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
|
| 97 |
+
|
| 98 |
+
/* Same routine broken down into three steps */
|
| 99 |
+
int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
|
| 100 |
+
int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
|
| 101 |
+
int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
/**
|
| 105 |
+
* \brief clean up CRC context
|
| 106 |
+
*
|
| 107 |
+
* \param crcContext pointer to context variable
|
| 108 |
+
*
|
| 109 |
+
* \returns 0 for OK, -1 on error
|
| 110 |
+
*
|
| 111 |
+
*/
|
| 112 |
+
|
| 113 |
+
int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
/* Ends C function definitions when using C++ */
|
| 117 |
+
#ifdef __cplusplus
|
| 118 |
+
}
|
| 119 |
+
#endif
|
| 120 |
+
#include "close_code.h"
|
| 121 |
+
|
| 122 |
+
#endif /* SDL_test_crc32_h_ */
|
| 123 |
+
|
| 124 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_font.h
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_font.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
#ifndef SDL_test_font_h_
|
| 31 |
+
#define SDL_test_font_h_
|
| 32 |
+
|
| 33 |
+
#include "begin_code.h"
|
| 34 |
+
/* Set up for C function definitions, even when using C++ */
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/* Function prototypes */
|
| 40 |
+
|
| 41 |
+
#define FONT_CHARACTER_SIZE 8
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* \brief Draw a string in the currently set font.
|
| 45 |
+
*
|
| 46 |
+
* \param renderer The renderer to draw on.
|
| 47 |
+
* \param x The X coordinate of the upper left corner of the character.
|
| 48 |
+
* \param y The Y coordinate of the upper left corner of the character.
|
| 49 |
+
* \param c The character to draw.
|
| 50 |
+
*
|
| 51 |
+
* \returns Returns 0 on success, -1 on failure.
|
| 52 |
+
*/
|
| 53 |
+
int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* \brief Draw a string in the currently set font.
|
| 57 |
+
*
|
| 58 |
+
* \param renderer The renderer to draw on.
|
| 59 |
+
* \param x The X coordinate of the upper left corner of the string.
|
| 60 |
+
* \param y The Y coordinate of the upper left corner of the string.
|
| 61 |
+
* \param s The string to draw.
|
| 62 |
+
*
|
| 63 |
+
* \returns Returns 0 on success, -1 on failure.
|
| 64 |
+
*/
|
| 65 |
+
int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* \brief Cleanup textures used by font drawing functions.
|
| 70 |
+
*/
|
| 71 |
+
void SDLTest_CleanupTextDrawing(void);
|
| 72 |
+
|
| 73 |
+
/* Ends C function definitions when using C++ */
|
| 74 |
+
#ifdef __cplusplus
|
| 75 |
+
}
|
| 76 |
+
#endif
|
| 77 |
+
#include "close_code.h"
|
| 78 |
+
|
| 79 |
+
#endif /* SDL_test_font_h_ */
|
| 80 |
+
|
| 81 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_fuzzer.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
|
| 32 |
+
Data generators for fuzzing test data in a reproducible way.
|
| 33 |
+
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_test_fuzzer_h_
|
| 37 |
+
#define SDL_test_fuzzer_h_
|
| 38 |
+
|
| 39 |
+
#include "begin_code.h"
|
| 40 |
+
/* Set up for C function definitions, even when using C++ */
|
| 41 |
+
#ifdef __cplusplus
|
| 42 |
+
extern "C" {
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
/*
|
| 47 |
+
Based on GSOC code by Markus Kauppila <markus.kauppila@gmail.com>
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* \file
|
| 53 |
+
* Note: The fuzzer implementation uses a static instance of random context
|
| 54 |
+
* internally which makes it thread-UNsafe.
|
| 55 |
+
*/
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
* Initializes the fuzzer for a test
|
| 59 |
+
*
|
| 60 |
+
* \param execKey Execution "Key" that initializes the random number generator uniquely for the test.
|
| 61 |
+
*
|
| 62 |
+
*/
|
| 63 |
+
void SDLTest_FuzzerInit(Uint64 execKey);
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* Returns a random Uint8
|
| 68 |
+
*
|
| 69 |
+
* \returns Generated integer
|
| 70 |
+
*/
|
| 71 |
+
Uint8 SDLTest_RandomUint8(void);
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* Returns a random Sint8
|
| 75 |
+
*
|
| 76 |
+
* \returns Generated signed integer
|
| 77 |
+
*/
|
| 78 |
+
Sint8 SDLTest_RandomSint8(void);
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
/**
|
| 82 |
+
* Returns a random Uint16
|
| 83 |
+
*
|
| 84 |
+
* \returns Generated integer
|
| 85 |
+
*/
|
| 86 |
+
Uint16 SDLTest_RandomUint16(void);
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* Returns a random Sint16
|
| 90 |
+
*
|
| 91 |
+
* \returns Generated signed integer
|
| 92 |
+
*/
|
| 93 |
+
Sint16 SDLTest_RandomSint16(void);
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
/**
|
| 97 |
+
* Returns a random integer
|
| 98 |
+
*
|
| 99 |
+
* \returns Generated integer
|
| 100 |
+
*/
|
| 101 |
+
Sint32 SDLTest_RandomSint32(void);
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
/**
|
| 105 |
+
* Returns a random positive integer
|
| 106 |
+
*
|
| 107 |
+
* \returns Generated integer
|
| 108 |
+
*/
|
| 109 |
+
Uint32 SDLTest_RandomUint32(void);
|
| 110 |
+
|
| 111 |
+
/**
|
| 112 |
+
* Returns random Uint64.
|
| 113 |
+
*
|
| 114 |
+
* \returns Generated integer
|
| 115 |
+
*/
|
| 116 |
+
Uint64 SDLTest_RandomUint64(void);
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
/**
|
| 120 |
+
* Returns random Sint64.
|
| 121 |
+
*
|
| 122 |
+
* \returns Generated signed integer
|
| 123 |
+
*/
|
| 124 |
+
Sint64 SDLTest_RandomSint64(void);
|
| 125 |
+
|
| 126 |
+
/**
|
| 127 |
+
* \returns random float in range [0.0 - 1.0[
|
| 128 |
+
*/
|
| 129 |
+
float SDLTest_RandomUnitFloat(void);
|
| 130 |
+
|
| 131 |
+
/**
|
| 132 |
+
* \returns random double in range [0.0 - 1.0[
|
| 133 |
+
*/
|
| 134 |
+
double SDLTest_RandomUnitDouble(void);
|
| 135 |
+
|
| 136 |
+
/**
|
| 137 |
+
* \returns random float.
|
| 138 |
+
*
|
| 139 |
+
*/
|
| 140 |
+
float SDLTest_RandomFloat(void);
|
| 141 |
+
|
| 142 |
+
/**
|
| 143 |
+
* \returns random double.
|
| 144 |
+
*
|
| 145 |
+
*/
|
| 146 |
+
double SDLTest_RandomDouble(void);
|
| 147 |
+
|
| 148 |
+
/**
|
| 149 |
+
* Returns a random boundary value for Uint8 within the given boundaries.
|
| 150 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 151 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 152 |
+
* boundaries are also possible.
|
| 153 |
+
* If boundary1 > boundary2, the values are swapped
|
| 154 |
+
*
|
| 155 |
+
* Usage examples:
|
| 156 |
+
* RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
|
| 157 |
+
* RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
|
| 158 |
+
* RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100
|
| 159 |
+
* RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set)
|
| 160 |
+
*
|
| 161 |
+
* \param boundary1 Lower boundary limit
|
| 162 |
+
* \param boundary2 Upper boundary limit
|
| 163 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 164 |
+
*
|
| 165 |
+
* \returns Random boundary value for the given range and domain or 0 with error set
|
| 166 |
+
*/
|
| 167 |
+
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
|
| 168 |
+
|
| 169 |
+
/**
|
| 170 |
+
* Returns a random boundary value for Uint16 within the given boundaries.
|
| 171 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 172 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 173 |
+
* boundaries are also possible.
|
| 174 |
+
* If boundary1 > boundary2, the values are swapped
|
| 175 |
+
*
|
| 176 |
+
* Usage examples:
|
| 177 |
+
* RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
|
| 178 |
+
* RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
|
| 179 |
+
* RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100
|
| 180 |
+
* RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set)
|
| 181 |
+
*
|
| 182 |
+
* \param boundary1 Lower boundary limit
|
| 183 |
+
* \param boundary2 Upper boundary limit
|
| 184 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 185 |
+
*
|
| 186 |
+
* \returns Random boundary value for the given range and domain or 0 with error set
|
| 187 |
+
*/
|
| 188 |
+
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
|
| 189 |
+
|
| 190 |
+
/**
|
| 191 |
+
* Returns a random boundary value for Uint32 within the given boundaries.
|
| 192 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 193 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 194 |
+
* boundaries are also possible.
|
| 195 |
+
* If boundary1 > boundary2, the values are swapped
|
| 196 |
+
*
|
| 197 |
+
* Usage examples:
|
| 198 |
+
* RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
|
| 199 |
+
* RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
|
| 200 |
+
* RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100
|
| 201 |
+
* RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set)
|
| 202 |
+
*
|
| 203 |
+
* \param boundary1 Lower boundary limit
|
| 204 |
+
* \param boundary2 Upper boundary limit
|
| 205 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 206 |
+
*
|
| 207 |
+
* \returns Random boundary value for the given range and domain or 0 with error set
|
| 208 |
+
*/
|
| 209 |
+
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
|
| 210 |
+
|
| 211 |
+
/**
|
| 212 |
+
* Returns a random boundary value for Uint64 within the given boundaries.
|
| 213 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 214 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 215 |
+
* boundaries are also possible.
|
| 216 |
+
* If boundary1 > boundary2, the values are swapped
|
| 217 |
+
*
|
| 218 |
+
* Usage examples:
|
| 219 |
+
* RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
|
| 220 |
+
* RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
|
| 221 |
+
* RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100
|
| 222 |
+
* RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set)
|
| 223 |
+
*
|
| 224 |
+
* \param boundary1 Lower boundary limit
|
| 225 |
+
* \param boundary2 Upper boundary limit
|
| 226 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 227 |
+
*
|
| 228 |
+
* \returns Random boundary value for the given range and domain or 0 with error set
|
| 229 |
+
*/
|
| 230 |
+
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
|
| 231 |
+
|
| 232 |
+
/**
|
| 233 |
+
* Returns a random boundary value for Sint8 within the given boundaries.
|
| 234 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 235 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 236 |
+
* boundaries are also possible.
|
| 237 |
+
* If boundary1 > boundary2, the values are swapped
|
| 238 |
+
*
|
| 239 |
+
* Usage examples:
|
| 240 |
+
* RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
|
| 241 |
+
* RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
|
| 242 |
+
* RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100
|
| 243 |
+
* RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set
|
| 244 |
+
*
|
| 245 |
+
* \param boundary1 Lower boundary limit
|
| 246 |
+
* \param boundary2 Upper boundary limit
|
| 247 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 248 |
+
*
|
| 249 |
+
* \returns Random boundary value for the given range and domain or SINT8_MIN with error set
|
| 250 |
+
*/
|
| 251 |
+
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
/**
|
| 255 |
+
* Returns a random boundary value for Sint16 within the given boundaries.
|
| 256 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 257 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 258 |
+
* boundaries are also possible.
|
| 259 |
+
* If boundary1 > boundary2, the values are swapped
|
| 260 |
+
*
|
| 261 |
+
* Usage examples:
|
| 262 |
+
* RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
|
| 263 |
+
* RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
|
| 264 |
+
* RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100
|
| 265 |
+
* RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set
|
| 266 |
+
*
|
| 267 |
+
* \param boundary1 Lower boundary limit
|
| 268 |
+
* \param boundary2 Upper boundary limit
|
| 269 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 270 |
+
*
|
| 271 |
+
* \returns Random boundary value for the given range and domain or SINT16_MIN with error set
|
| 272 |
+
*/
|
| 273 |
+
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
|
| 274 |
+
|
| 275 |
+
/**
|
| 276 |
+
* Returns a random boundary value for Sint32 within the given boundaries.
|
| 277 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 278 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 279 |
+
* boundaries are also possible.
|
| 280 |
+
* If boundary1 > boundary2, the values are swapped
|
| 281 |
+
*
|
| 282 |
+
* Usage examples:
|
| 283 |
+
* RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
|
| 284 |
+
* RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
|
| 285 |
+
* RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100
|
| 286 |
+
* RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value)
|
| 287 |
+
*
|
| 288 |
+
* \param boundary1 Lower boundary limit
|
| 289 |
+
* \param boundary2 Upper boundary limit
|
| 290 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 291 |
+
*
|
| 292 |
+
* \returns Random boundary value for the given range and domain or SINT32_MIN with error set
|
| 293 |
+
*/
|
| 294 |
+
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
|
| 295 |
+
|
| 296 |
+
/**
|
| 297 |
+
* Returns a random boundary value for Sint64 within the given boundaries.
|
| 298 |
+
* Boundaries are inclusive, see the usage examples below. If validDomain
|
| 299 |
+
* is true, the function will only return valid boundaries, otherwise non-valid
|
| 300 |
+
* boundaries are also possible.
|
| 301 |
+
* If boundary1 > boundary2, the values are swapped
|
| 302 |
+
*
|
| 303 |
+
* Usage examples:
|
| 304 |
+
* RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
|
| 305 |
+
* RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
|
| 306 |
+
* RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100
|
| 307 |
+
* RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set
|
| 308 |
+
*
|
| 309 |
+
* \param boundary1 Lower boundary limit
|
| 310 |
+
* \param boundary2 Upper boundary limit
|
| 311 |
+
* \param validDomain Should the generated boundary be valid (=within the bounds) or not?
|
| 312 |
+
*
|
| 313 |
+
* \returns Random boundary value for the given range and domain or SINT64_MIN with error set
|
| 314 |
+
*/
|
| 315 |
+
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
|
| 316 |
+
|
| 317 |
+
|
| 318 |
+
/**
|
| 319 |
+
* Returns integer in range [min, max] (inclusive).
|
| 320 |
+
* Min and max values can be negative values.
|
| 321 |
+
* If Max in smaller than min, then the values are swapped.
|
| 322 |
+
* Min and max are the same value, that value will be returned.
|
| 323 |
+
*
|
| 324 |
+
* \param min Minimum inclusive value of returned random number
|
| 325 |
+
* \param max Maximum inclusive value of returned random number
|
| 326 |
+
*
|
| 327 |
+
* \returns Generated random integer in range
|
| 328 |
+
*/
|
| 329 |
+
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
|
| 330 |
+
|
| 331 |
+
|
| 332 |
+
/**
|
| 333 |
+
* Generates random null-terminated string. The minimum length for
|
| 334 |
+
* the string is 1 character, maximum length for the string is 255
|
| 335 |
+
* characters and it can contain ASCII characters from 32 to 126.
|
| 336 |
+
*
|
| 337 |
+
* Note: Returned string needs to be deallocated.
|
| 338 |
+
*
|
| 339 |
+
* \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
|
| 340 |
+
*/
|
| 341 |
+
char * SDLTest_RandomAsciiString(void);
|
| 342 |
+
|
| 343 |
+
|
| 344 |
+
/**
|
| 345 |
+
* Generates random null-terminated string. The maximum length for
|
| 346 |
+
* the string is defined by the maxLength parameter.
|
| 347 |
+
* String can contain ASCII characters from 32 to 126.
|
| 348 |
+
*
|
| 349 |
+
* Note: Returned string needs to be deallocated.
|
| 350 |
+
*
|
| 351 |
+
* \param maxLength The maximum length of the generated string.
|
| 352 |
+
*
|
| 353 |
+
* \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
|
| 354 |
+
*/
|
| 355 |
+
char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
/**
|
| 359 |
+
* Generates random null-terminated string. The length for
|
| 360 |
+
* the string is defined by the size parameter.
|
| 361 |
+
* String can contain ASCII characters from 32 to 126.
|
| 362 |
+
*
|
| 363 |
+
* Note: Returned string needs to be deallocated.
|
| 364 |
+
*
|
| 365 |
+
* \param size The length of the generated string
|
| 366 |
+
*
|
| 367 |
+
* \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated.
|
| 368 |
+
*/
|
| 369 |
+
char * SDLTest_RandomAsciiStringOfSize(int size);
|
| 370 |
+
|
| 371 |
+
/**
|
| 372 |
+
* Returns the invocation count for the fuzzer since last ...FuzzerInit.
|
| 373 |
+
*/
|
| 374 |
+
int SDLTest_GetFuzzerInvocationCount(void);
|
| 375 |
+
|
| 376 |
+
/* Ends C function definitions when using C++ */
|
| 377 |
+
#ifdef __cplusplus
|
| 378 |
+
}
|
| 379 |
+
#endif
|
| 380 |
+
#include "close_code.h"
|
| 381 |
+
|
| 382 |
+
#endif /* SDL_test_fuzzer_h_ */
|
| 383 |
+
|
| 384 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_harness.h
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_harness.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
Defines types for test case definitions and the test execution harness API.
|
| 32 |
+
|
| 33 |
+
Based on original GSOC code by Markus Kauppila <markus.kauppila@gmail.com>
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_test_h_arness_h
|
| 37 |
+
#define SDL_test_h_arness_h
|
| 38 |
+
|
| 39 |
+
#include "begin_code.h"
|
| 40 |
+
/* Set up for C function definitions, even when using C++ */
|
| 41 |
+
#ifdef __cplusplus
|
| 42 |
+
extern "C" {
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
/* ! Definitions for test case structures */
|
| 47 |
+
#define TEST_ENABLED 1
|
| 48 |
+
#define TEST_DISABLED 0
|
| 49 |
+
|
| 50 |
+
/* ! Definition of all the possible test return values of the test case method */
|
| 51 |
+
#define TEST_ABORTED -1
|
| 52 |
+
#define TEST_STARTED 0
|
| 53 |
+
#define TEST_COMPLETED 1
|
| 54 |
+
#define TEST_SKIPPED 2
|
| 55 |
+
|
| 56 |
+
/* ! Definition of all the possible test results for the harness */
|
| 57 |
+
#define TEST_RESULT_PASSED 0
|
| 58 |
+
#define TEST_RESULT_FAILED 1
|
| 59 |
+
#define TEST_RESULT_NO_ASSERT 2
|
| 60 |
+
#define TEST_RESULT_SKIPPED 3
|
| 61 |
+
#define TEST_RESULT_SETUP_FAILURE 4
|
| 62 |
+
|
| 63 |
+
/* !< Function pointer to a test case setup function (run before every test) */
|
| 64 |
+
typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
|
| 65 |
+
|
| 66 |
+
/* !< Function pointer to a test case function */
|
| 67 |
+
typedef int (*SDLTest_TestCaseFp)(void *arg);
|
| 68 |
+
|
| 69 |
+
/* !< Function pointer to a test case teardown function (run after every test) */
|
| 70 |
+
typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
|
| 71 |
+
|
| 72 |
+
/**
|
| 73 |
+
* Holds information about a single test case.
|
| 74 |
+
*/
|
| 75 |
+
typedef struct SDLTest_TestCaseReference {
|
| 76 |
+
/* !< Func2Stress */
|
| 77 |
+
SDLTest_TestCaseFp testCase;
|
| 78 |
+
/* !< Short name (or function name) "Func2Stress" */
|
| 79 |
+
char *name;
|
| 80 |
+
/* !< Long name or full description "This test pushes func2() to the limit." */
|
| 81 |
+
char *description;
|
| 82 |
+
/* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
|
| 83 |
+
int enabled;
|
| 84 |
+
} SDLTest_TestCaseReference;
|
| 85 |
+
|
| 86 |
+
/**
|
| 87 |
+
* Holds information about a test suite (multiple test cases).
|
| 88 |
+
*/
|
| 89 |
+
typedef struct SDLTest_TestSuiteReference {
|
| 90 |
+
/* !< "PlatformSuite" */
|
| 91 |
+
char *name;
|
| 92 |
+
/* !< The function that is run before each test. NULL skips. */
|
| 93 |
+
SDLTest_TestCaseSetUpFp testSetUp;
|
| 94 |
+
/* !< The test cases that are run as part of the suite. Last item should be NULL. */
|
| 95 |
+
const SDLTest_TestCaseReference **testCases;
|
| 96 |
+
/* !< The function that is run after each test. NULL skips. */
|
| 97 |
+
SDLTest_TestCaseTearDownFp testTearDown;
|
| 98 |
+
} SDLTest_TestSuiteReference;
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
|
| 103 |
+
*
|
| 104 |
+
* Note: The returned string needs to be deallocated by the caller.
|
| 105 |
+
*
|
| 106 |
+
* \param length The length of the seed string to generate
|
| 107 |
+
*
|
| 108 |
+
* \returns The generated seed string
|
| 109 |
+
*/
|
| 110 |
+
char *SDLTest_GenerateRunSeed(const int length);
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* \brief Execute a test suite using the given run seed and execution key.
|
| 114 |
+
*
|
| 115 |
+
* \param testSuites Suites containing the test case.
|
| 116 |
+
* \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
|
| 117 |
+
* \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
|
| 118 |
+
* \param filter Filter specification. NULL disables. Case sensitive.
|
| 119 |
+
* \param testIterations Number of iterations to run each test case.
|
| 120 |
+
*
|
| 121 |
+
* \returns Test run result; 0 when all tests passed, 1 if any tests failed.
|
| 122 |
+
*/
|
| 123 |
+
int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
/* Ends C function definitions when using C++ */
|
| 127 |
+
#ifdef __cplusplus
|
| 128 |
+
}
|
| 129 |
+
#endif
|
| 130 |
+
#include "close_code.h"
|
| 131 |
+
|
| 132 |
+
#endif /* SDL_test_h_arness_h */
|
| 133 |
+
|
| 134 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_images.h
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_images.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
|
| 32 |
+
Defines some images for tests.
|
| 33 |
+
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_test_images_h_
|
| 37 |
+
#define SDL_test_images_h_
|
| 38 |
+
|
| 39 |
+
#include "SDL.h"
|
| 40 |
+
|
| 41 |
+
#include "begin_code.h"
|
| 42 |
+
/* Set up for C function definitions, even when using C++ */
|
| 43 |
+
#ifdef __cplusplus
|
| 44 |
+
extern "C" {
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
*Type for test images.
|
| 49 |
+
*/
|
| 50 |
+
typedef struct SDLTest_SurfaceImage_s {
|
| 51 |
+
int width;
|
| 52 |
+
int height;
|
| 53 |
+
unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
|
| 54 |
+
const char *pixel_data;
|
| 55 |
+
} SDLTest_SurfaceImage_t;
|
| 56 |
+
|
| 57 |
+
/* Test images */
|
| 58 |
+
SDL_Surface *SDLTest_ImageBlit(void);
|
| 59 |
+
SDL_Surface *SDLTest_ImageBlitColor(void);
|
| 60 |
+
SDL_Surface *SDLTest_ImageBlitAlpha(void);
|
| 61 |
+
SDL_Surface *SDLTest_ImageBlitBlendAdd(void);
|
| 62 |
+
SDL_Surface *SDLTest_ImageBlitBlend(void);
|
| 63 |
+
SDL_Surface *SDLTest_ImageBlitBlendMod(void);
|
| 64 |
+
SDL_Surface *SDLTest_ImageBlitBlendNone(void);
|
| 65 |
+
SDL_Surface *SDLTest_ImageBlitBlendAll(void);
|
| 66 |
+
SDL_Surface *SDLTest_ImageFace(void);
|
| 67 |
+
SDL_Surface *SDLTest_ImagePrimitives(void);
|
| 68 |
+
SDL_Surface *SDLTest_ImagePrimitivesBlend(void);
|
| 69 |
+
|
| 70 |
+
/* Ends C function definitions when using C++ */
|
| 71 |
+
#ifdef __cplusplus
|
| 72 |
+
}
|
| 73 |
+
#endif
|
| 74 |
+
#include "close_code.h"
|
| 75 |
+
|
| 76 |
+
#endif /* SDL_test_images_h_ */
|
| 77 |
+
|
| 78 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_log.h
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_log.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
*
|
| 32 |
+
* Wrapper to log in the TEST category
|
| 33 |
+
*
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_test_log_h_
|
| 37 |
+
#define SDL_test_log_h_
|
| 38 |
+
|
| 39 |
+
#include "begin_code.h"
|
| 40 |
+
/* Set up for C function definitions, even when using C++ */
|
| 41 |
+
#ifdef __cplusplus
|
| 42 |
+
extern "C" {
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* \brief Prints given message with a timestamp in the TEST category and INFO priority.
|
| 47 |
+
*
|
| 48 |
+
* \param fmt Message to be logged
|
| 49 |
+
*/
|
| 50 |
+
void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
| 51 |
+
|
| 52 |
+
/**
|
| 53 |
+
* \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
|
| 54 |
+
*
|
| 55 |
+
* \param fmt Message to be logged
|
| 56 |
+
*/
|
| 57 |
+
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
| 58 |
+
|
| 59 |
+
/* Ends C function definitions when using C++ */
|
| 60 |
+
#ifdef __cplusplus
|
| 61 |
+
}
|
| 62 |
+
#endif
|
| 63 |
+
#include "close_code.h"
|
| 64 |
+
|
| 65 |
+
#endif /* SDL_test_log_h_ */
|
| 66 |
+
|
| 67 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_md5.h
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_md5.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
***********************************************************************
|
| 32 |
+
** Header file for implementation of MD5 **
|
| 33 |
+
** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
|
| 34 |
+
** Created: 2/17/90 RLR **
|
| 35 |
+
** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
|
| 36 |
+
** Revised (for MD5): RLR 4/27/91 **
|
| 37 |
+
** -- G modified to have y&~z instead of y&z **
|
| 38 |
+
** -- FF, GG, HH modified to add in last register done **
|
| 39 |
+
** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
|
| 40 |
+
** -- distinct additive constant for each step **
|
| 41 |
+
** -- round 4 added, working mod 7 **
|
| 42 |
+
***********************************************************************
|
| 43 |
+
*/
|
| 44 |
+
|
| 45 |
+
/*
|
| 46 |
+
***********************************************************************
|
| 47 |
+
** Message-digest routines: **
|
| 48 |
+
** To form the message digest for a message M **
|
| 49 |
+
** (1) Initialize a context buffer mdContext using MD5Init **
|
| 50 |
+
** (2) Call MD5Update on mdContext and M **
|
| 51 |
+
** (3) Call MD5Final on mdContext **
|
| 52 |
+
** The message digest is now in mdContext->digest[0...15] **
|
| 53 |
+
***********************************************************************
|
| 54 |
+
*/
|
| 55 |
+
|
| 56 |
+
#ifndef SDL_test_md5_h_
|
| 57 |
+
#define SDL_test_md5_h_
|
| 58 |
+
|
| 59 |
+
#include "begin_code.h"
|
| 60 |
+
/* Set up for C function definitions, even when using C++ */
|
| 61 |
+
#ifdef __cplusplus
|
| 62 |
+
extern "C" {
|
| 63 |
+
#endif
|
| 64 |
+
|
| 65 |
+
/* ------------ Definitions --------- */
|
| 66 |
+
|
| 67 |
+
/* typedef a 32-bit type */
|
| 68 |
+
typedef unsigned long int MD5UINT4;
|
| 69 |
+
|
| 70 |
+
/* Data structure for MD5 (Message-Digest) computation */
|
| 71 |
+
typedef struct {
|
| 72 |
+
MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
|
| 73 |
+
MD5UINT4 buf[4]; /* scratch buffer */
|
| 74 |
+
unsigned char in[64]; /* input buffer */
|
| 75 |
+
unsigned char digest[16]; /* actual digest after Md5Final call */
|
| 76 |
+
} SDLTest_Md5Context;
|
| 77 |
+
|
| 78 |
+
/* ---------- Function Prototypes ------------- */
|
| 79 |
+
|
| 80 |
+
/**
|
| 81 |
+
* \brief initialize the context
|
| 82 |
+
*
|
| 83 |
+
* \param mdContext pointer to context variable
|
| 84 |
+
*
|
| 85 |
+
* Note: The function initializes the message-digest context
|
| 86 |
+
* mdContext. Call before each new use of the context -
|
| 87 |
+
* all fields are set to zero.
|
| 88 |
+
*/
|
| 89 |
+
void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* \brief update digest from variable length data
|
| 94 |
+
*
|
| 95 |
+
* \param mdContext pointer to context variable
|
| 96 |
+
* \param inBuf pointer to data array/string
|
| 97 |
+
* \param inLen length of data array/string
|
| 98 |
+
*
|
| 99 |
+
* Note: The function updates the message-digest context to account
|
| 100 |
+
* for the presence of each of the characters inBuf[0..inLen-1]
|
| 101 |
+
* in the message whose digest is being computed.
|
| 102 |
+
*/
|
| 103 |
+
|
| 104 |
+
void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf,
|
| 105 |
+
unsigned int inLen);
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* \brief complete digest computation
|
| 110 |
+
*
|
| 111 |
+
* \param mdContext pointer to context variable
|
| 112 |
+
*
|
| 113 |
+
* Note: The function terminates the message-digest computation and
|
| 114 |
+
* ends with the desired message digest in mdContext.digest[0..15].
|
| 115 |
+
* Always call before using the digest[] variable.
|
| 116 |
+
*/
|
| 117 |
+
|
| 118 |
+
void SDLTest_Md5Final(SDLTest_Md5Context * mdContext);
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
/* Ends C function definitions when using C++ */
|
| 122 |
+
#ifdef __cplusplus
|
| 123 |
+
}
|
| 124 |
+
#endif
|
| 125 |
+
#include "close_code.h"
|
| 126 |
+
|
| 127 |
+
#endif /* SDL_test_md5_h_ */
|
| 128 |
+
|
| 129 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_memory.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_memory.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
#ifndef SDL_test_memory_h_
|
| 31 |
+
#define SDL_test_memory_h_
|
| 32 |
+
|
| 33 |
+
#include "begin_code.h"
|
| 34 |
+
/* Set up for C function definitions, even when using C++ */
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* \brief Start tracking SDL memory allocations
|
| 42 |
+
*
|
| 43 |
+
* \note This should be called before any other SDL functions for complete tracking coverage
|
| 44 |
+
*/
|
| 45 |
+
int SDLTest_TrackAllocations(void);
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* \brief Print a log of any outstanding allocations
|
| 49 |
+
*
|
| 50 |
+
* \note This can be called after SDL_Quit()
|
| 51 |
+
*/
|
| 52 |
+
void SDLTest_LogAllocations(void);
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
/* Ends C function definitions when using C++ */
|
| 56 |
+
#ifdef __cplusplus
|
| 57 |
+
}
|
| 58 |
+
#endif
|
| 59 |
+
#include "close_code.h"
|
| 60 |
+
|
| 61 |
+
#endif /* SDL_test_memory_h_ */
|
| 62 |
+
|
| 63 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_test_random.h
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_test_random.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL test framework.
|
| 26 |
+
*
|
| 27 |
+
* This code is a part of the SDL2_test library, not the main SDL library.
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/*
|
| 31 |
+
|
| 32 |
+
A "32-bit Multiply with carry random number generator. Very fast.
|
| 33 |
+
Includes a list of recommended multipliers.
|
| 34 |
+
|
| 35 |
+
multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32.
|
| 36 |
+
period: (a*2^31)-1
|
| 37 |
+
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#ifndef SDL_test_random_h_
|
| 41 |
+
#define SDL_test_random_h_
|
| 42 |
+
|
| 43 |
+
#include "begin_code.h"
|
| 44 |
+
/* Set up for C function definitions, even when using C++ */
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
/* --- Definitions */
|
| 50 |
+
|
| 51 |
+
/*
|
| 52 |
+
* Macros that return a random number in a specific format.
|
| 53 |
+
*/
|
| 54 |
+
#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c))
|
| 55 |
+
|
| 56 |
+
/*
|
| 57 |
+
* Context structure for the random number generator state.
|
| 58 |
+
*/
|
| 59 |
+
typedef struct {
|
| 60 |
+
unsigned int a;
|
| 61 |
+
unsigned int x;
|
| 62 |
+
unsigned int c;
|
| 63 |
+
unsigned int ah;
|
| 64 |
+
unsigned int al;
|
| 65 |
+
} SDLTest_RandomContext;
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
/* --- Function prototypes */
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* \brief Initialize random number generator with two integers.
|
| 72 |
+
*
|
| 73 |
+
* Note: The random sequence of numbers returned by ...Random() is the
|
| 74 |
+
* same for the same two integers and has a period of 2^31.
|
| 75 |
+
*
|
| 76 |
+
* \param rndContext pointer to context structure
|
| 77 |
+
* \param xi integer that defines the random sequence
|
| 78 |
+
* \param ci integer that defines the random sequence
|
| 79 |
+
*
|
| 80 |
+
*/
|
| 81 |
+
void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
|
| 82 |
+
unsigned int ci);
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* \brief Initialize random number generator based on current system time.
|
| 86 |
+
*
|
| 87 |
+
* \param rndContext pointer to context structure
|
| 88 |
+
*
|
| 89 |
+
*/
|
| 90 |
+
void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
/**
|
| 94 |
+
* \brief Initialize random number generator based on current system time.
|
| 95 |
+
*
|
| 96 |
+
* Note: ...RandomInit() or ...RandomInitTime() must have been called
|
| 97 |
+
* before using this function.
|
| 98 |
+
*
|
| 99 |
+
* \param rndContext pointer to context structure
|
| 100 |
+
*
|
| 101 |
+
* \returns A random number (32bit unsigned integer)
|
| 102 |
+
*
|
| 103 |
+
*/
|
| 104 |
+
unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
/* Ends C function definitions when using C++ */
|
| 108 |
+
#ifdef __cplusplus
|
| 109 |
+
}
|
| 110 |
+
#endif
|
| 111 |
+
#include "close_code.h"
|
| 112 |
+
|
| 113 |
+
#endif /* SDL_test_random_h_ */
|
| 114 |
+
|
| 115 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_thread.h
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#ifndef SDL_thread_h_
|
| 23 |
+
#define SDL_thread_h_
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* \file SDL_thread.h
|
| 27 |
+
*
|
| 28 |
+
* Header for the SDL thread management routines.
|
| 29 |
+
*/
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_error.h"
|
| 33 |
+
|
| 34 |
+
/* Thread synchronization primitives */
|
| 35 |
+
#include "SDL_atomic.h"
|
| 36 |
+
#include "SDL_mutex.h"
|
| 37 |
+
|
| 38 |
+
#include "begin_code.h"
|
| 39 |
+
/* Set up for C function definitions, even when using C++ */
|
| 40 |
+
#ifdef __cplusplus
|
| 41 |
+
extern "C" {
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
/* The SDL thread structure, defined in SDL_thread.c */
|
| 45 |
+
struct SDL_Thread;
|
| 46 |
+
typedef struct SDL_Thread SDL_Thread;
|
| 47 |
+
|
| 48 |
+
/* The SDL thread ID */
|
| 49 |
+
typedef unsigned long SDL_threadID;
|
| 50 |
+
|
| 51 |
+
/* Thread local storage ID, 0 is the invalid ID */
|
| 52 |
+
typedef unsigned int SDL_TLSID;
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* The SDL thread priority.
|
| 56 |
+
*
|
| 57 |
+
* \note On many systems you require special privileges to set high or time critical priority.
|
| 58 |
+
*/
|
| 59 |
+
typedef enum {
|
| 60 |
+
SDL_THREAD_PRIORITY_LOW,
|
| 61 |
+
SDL_THREAD_PRIORITY_NORMAL,
|
| 62 |
+
SDL_THREAD_PRIORITY_HIGH,
|
| 63 |
+
SDL_THREAD_PRIORITY_TIME_CRITICAL
|
| 64 |
+
} SDL_ThreadPriority;
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* The function passed to SDL_CreateThread().
|
| 68 |
+
* It is passed a void* user context parameter and returns an int.
|
| 69 |
+
*/
|
| 70 |
+
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
|
| 71 |
+
|
| 72 |
+
#if defined(__WIN32__)
|
| 73 |
+
/**
|
| 74 |
+
* \file SDL_thread.h
|
| 75 |
+
*
|
| 76 |
+
* We compile SDL into a DLL. This means, that it's the DLL which
|
| 77 |
+
* creates a new thread for the calling process with the SDL_CreateThread()
|
| 78 |
+
* API. There is a problem with this, that only the RTL of the SDL2.DLL will
|
| 79 |
+
* be initialized for those threads, and not the RTL of the calling
|
| 80 |
+
* application!
|
| 81 |
+
*
|
| 82 |
+
* To solve this, we make a little hack here.
|
| 83 |
+
*
|
| 84 |
+
* We'll always use the caller's _beginthread() and _endthread() APIs to
|
| 85 |
+
* start a new thread. This way, if it's the SDL2.DLL which uses this API,
|
| 86 |
+
* then the RTL of SDL2.DLL will be used to create the new thread, and if it's
|
| 87 |
+
* the application, then the RTL of the application will be used.
|
| 88 |
+
*
|
| 89 |
+
* So, in short:
|
| 90 |
+
* Always use the _beginthread() and _endthread() of the calling runtime
|
| 91 |
+
* library!
|
| 92 |
+
*/
|
| 93 |
+
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
| 94 |
+
#include <process.h> /* _beginthreadex() and _endthreadex() */
|
| 95 |
+
|
| 96 |
+
typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
|
| 97 |
+
(void *, unsigned, unsigned (__stdcall *func)(void *),
|
| 98 |
+
void * /*arg*/, unsigned, unsigned * /* threadID */);
|
| 99 |
+
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
| 100 |
+
|
| 101 |
+
#ifndef SDL_beginthread
|
| 102 |
+
#define SDL_beginthread _beginthreadex
|
| 103 |
+
#endif
|
| 104 |
+
#ifndef SDL_endthread
|
| 105 |
+
#define SDL_endthread _endthreadex
|
| 106 |
+
#endif
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* Create a thread.
|
| 110 |
+
*/
|
| 111 |
+
extern DECLSPEC SDL_Thread *SDLCALL
|
| 112 |
+
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
| 113 |
+
pfnSDL_CurrentBeginThread pfnBeginThread,
|
| 114 |
+
pfnSDL_CurrentEndThread pfnEndThread);
|
| 115 |
+
|
| 116 |
+
extern DECLSPEC SDL_Thread *SDLCALL
|
| 117 |
+
SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
|
| 118 |
+
const char *name, const size_t stacksize, void *data,
|
| 119 |
+
pfnSDL_CurrentBeginThread pfnBeginThread,
|
| 120 |
+
pfnSDL_CurrentEndThread pfnEndThread);
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
* Create a thread.
|
| 125 |
+
*/
|
| 126 |
+
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
| 127 |
+
#undef SDL_CreateThread
|
| 128 |
+
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 129 |
+
#undef SDL_CreateThreadWithStackSize
|
| 130 |
+
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 131 |
+
#else
|
| 132 |
+
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 133 |
+
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 134 |
+
#endif
|
| 135 |
+
|
| 136 |
+
#elif defined(__OS2__)
|
| 137 |
+
/*
|
| 138 |
+
* just like the windows case above: We compile SDL2
|
| 139 |
+
* into a dll with Watcom's runtime statically linked.
|
| 140 |
+
*/
|
| 141 |
+
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
| 142 |
+
|
| 143 |
+
#ifndef __EMX__
|
| 144 |
+
#include <process.h>
|
| 145 |
+
#else
|
| 146 |
+
#include <stdlib.h>
|
| 147 |
+
#endif
|
| 148 |
+
|
| 149 |
+
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
|
| 150 |
+
typedef void (*pfnSDL_CurrentEndThread)(void);
|
| 151 |
+
|
| 152 |
+
#ifndef SDL_beginthread
|
| 153 |
+
#define SDL_beginthread _beginthread
|
| 154 |
+
#endif
|
| 155 |
+
#ifndef SDL_endthread
|
| 156 |
+
#define SDL_endthread _endthread
|
| 157 |
+
#endif
|
| 158 |
+
|
| 159 |
+
extern DECLSPEC SDL_Thread *SDLCALL
|
| 160 |
+
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
| 161 |
+
pfnSDL_CurrentBeginThread pfnBeginThread,
|
| 162 |
+
pfnSDL_CurrentEndThread pfnEndThread);
|
| 163 |
+
extern DECLSPEC SDL_Thread *SDLCALL
|
| 164 |
+
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data,
|
| 165 |
+
pfnSDL_CurrentBeginThread pfnBeginThread,
|
| 166 |
+
pfnSDL_CurrentEndThread pfnEndThread);
|
| 167 |
+
|
| 168 |
+
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
| 169 |
+
#undef SDL_CreateThread
|
| 170 |
+
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 171 |
+
#undef SDL_CreateThreadWithStackSize
|
| 172 |
+
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 173 |
+
#else
|
| 174 |
+
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 175 |
+
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
| 176 |
+
#endif
|
| 177 |
+
|
| 178 |
+
#else
|
| 179 |
+
|
| 180 |
+
/**
|
| 181 |
+
* Create a thread with a default stack size.
|
| 182 |
+
*
|
| 183 |
+
* This is equivalent to calling:
|
| 184 |
+
* SDL_CreateThreadWithStackSize(fn, name, 0, data);
|
| 185 |
+
*/
|
| 186 |
+
extern DECLSPEC SDL_Thread *SDLCALL
|
| 187 |
+
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
| 188 |
+
|
| 189 |
+
/**
|
| 190 |
+
* Create a thread.
|
| 191 |
+
*
|
| 192 |
+
* Thread naming is a little complicated: Most systems have very small
|
| 193 |
+
* limits for the string length (Haiku has 32 bytes, Linux currently has 16,
|
| 194 |
+
* Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
|
| 195 |
+
* have to see what happens with your system's debugger. The name should be
|
| 196 |
+
* UTF-8 (but using the naming limits of C identifiers is a better bet).
|
| 197 |
+
* There are no requirements for thread naming conventions, so long as the
|
| 198 |
+
* string is null-terminated UTF-8, but these guidelines are helpful in
|
| 199 |
+
* choosing a name:
|
| 200 |
+
*
|
| 201 |
+
* http://stackoverflow.com/questions/149932/naming-conventions-for-threads
|
| 202 |
+
*
|
| 203 |
+
* If a system imposes requirements, SDL will try to munge the string for
|
| 204 |
+
* it (truncate, etc), but the original string contents will be available
|
| 205 |
+
* from SDL_GetThreadName().
|
| 206 |
+
*
|
| 207 |
+
* The size (in bytes) of the new stack can be specified. Zero means "use
|
| 208 |
+
* the system default" which might be wildly different between platforms
|
| 209 |
+
* (x86 Linux generally defaults to eight megabytes, an embedded device
|
| 210 |
+
* might be a few kilobytes instead).
|
| 211 |
+
*
|
| 212 |
+
* In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
|
| 213 |
+
* function.
|
| 214 |
+
*/
|
| 215 |
+
extern DECLSPEC SDL_Thread *SDLCALL
|
| 216 |
+
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
|
| 217 |
+
|
| 218 |
+
#endif
|
| 219 |
+
|
| 220 |
+
/**
|
| 221 |
+
* Get the thread name, as it was specified in SDL_CreateThread().
|
| 222 |
+
* This function returns a pointer to a UTF-8 string that names the
|
| 223 |
+
* specified thread, or NULL if it doesn't have a name. This is internal
|
| 224 |
+
* memory, not to be free()'d by the caller, and remains valid until the
|
| 225 |
+
* specified thread is cleaned up by SDL_WaitThread().
|
| 226 |
+
*/
|
| 227 |
+
extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
| 228 |
+
|
| 229 |
+
/**
|
| 230 |
+
* Get the thread identifier for the current thread.
|
| 231 |
+
*/
|
| 232 |
+
extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
|
| 233 |
+
|
| 234 |
+
/**
|
| 235 |
+
* Get the thread identifier for the specified thread.
|
| 236 |
+
*
|
| 237 |
+
* Equivalent to SDL_ThreadID() if the specified thread is NULL.
|
| 238 |
+
*/
|
| 239 |
+
extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
| 240 |
+
|
| 241 |
+
/**
|
| 242 |
+
* Set the priority for the current thread
|
| 243 |
+
*/
|
| 244 |
+
extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
| 245 |
+
|
| 246 |
+
/**
|
| 247 |
+
* Wait for a thread to finish. Threads that haven't been detached will
|
| 248 |
+
* remain (as a "zombie") until this function cleans them up. Not doing so
|
| 249 |
+
* is a resource leak.
|
| 250 |
+
*
|
| 251 |
+
* Once a thread has been cleaned up through this function, the SDL_Thread
|
| 252 |
+
* that references it becomes invalid and should not be referenced again.
|
| 253 |
+
* As such, only one thread may call SDL_WaitThread() on another.
|
| 254 |
+
*
|
| 255 |
+
* The return code for the thread function is placed in the area
|
| 256 |
+
* pointed to by \c status, if \c status is not NULL.
|
| 257 |
+
*
|
| 258 |
+
* You may not wait on a thread that has been used in a call to
|
| 259 |
+
* SDL_DetachThread(). Use either that function or this one, but not
|
| 260 |
+
* both, or behavior is undefined.
|
| 261 |
+
*
|
| 262 |
+
* It is safe to pass NULL to this function; it is a no-op.
|
| 263 |
+
*/
|
| 264 |
+
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
| 265 |
+
|
| 266 |
+
/**
|
| 267 |
+
* A thread may be "detached" to signify that it should not remain until
|
| 268 |
+
* another thread has called SDL_WaitThread() on it. Detaching a thread
|
| 269 |
+
* is useful for long-running threads that nothing needs to synchronize
|
| 270 |
+
* with or further manage. When a detached thread is done, it simply
|
| 271 |
+
* goes away.
|
| 272 |
+
*
|
| 273 |
+
* There is no way to recover the return code of a detached thread. If you
|
| 274 |
+
* need this, don't detach the thread and instead use SDL_WaitThread().
|
| 275 |
+
*
|
| 276 |
+
* Once a thread is detached, you should usually assume the SDL_Thread isn't
|
| 277 |
+
* safe to reference again, as it will become invalid immediately upon
|
| 278 |
+
* the detached thread's exit, instead of remaining until someone has called
|
| 279 |
+
* SDL_WaitThread() to finally clean it up. As such, don't detach the same
|
| 280 |
+
* thread more than once.
|
| 281 |
+
*
|
| 282 |
+
* If a thread has already exited when passed to SDL_DetachThread(), it will
|
| 283 |
+
* stop waiting for a call to SDL_WaitThread() and clean up immediately.
|
| 284 |
+
* It is not safe to detach a thread that might be used with SDL_WaitThread().
|
| 285 |
+
*
|
| 286 |
+
* You may not call SDL_WaitThread() on a thread that has been detached.
|
| 287 |
+
* Use either that function or this one, but not both, or behavior is
|
| 288 |
+
* undefined.
|
| 289 |
+
*
|
| 290 |
+
* It is safe to pass NULL to this function; it is a no-op.
|
| 291 |
+
*/
|
| 292 |
+
extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
| 293 |
+
|
| 294 |
+
/**
|
| 295 |
+
* \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
|
| 296 |
+
*
|
| 297 |
+
* \return The newly created thread local storage identifier, or 0 on error
|
| 298 |
+
*
|
| 299 |
+
* \code
|
| 300 |
+
* static SDL_SpinLock tls_lock;
|
| 301 |
+
* static SDL_TLSID thread_local_storage;
|
| 302 |
+
*
|
| 303 |
+
* void SetMyThreadData(void *value)
|
| 304 |
+
* {
|
| 305 |
+
* if (!thread_local_storage) {
|
| 306 |
+
* SDL_AtomicLock(&tls_lock);
|
| 307 |
+
* if (!thread_local_storage) {
|
| 308 |
+
* thread_local_storage = SDL_TLSCreate();
|
| 309 |
+
* }
|
| 310 |
+
* SDL_AtomicUnlock(&tls_lock);
|
| 311 |
+
* }
|
| 312 |
+
* SDL_TLSSet(thread_local_storage, value, 0);
|
| 313 |
+
* }
|
| 314 |
+
*
|
| 315 |
+
* void *GetMyThreadData(void)
|
| 316 |
+
* {
|
| 317 |
+
* return SDL_TLSGet(thread_local_storage);
|
| 318 |
+
* }
|
| 319 |
+
* \endcode
|
| 320 |
+
*
|
| 321 |
+
* \sa SDL_TLSGet()
|
| 322 |
+
* \sa SDL_TLSSet()
|
| 323 |
+
*/
|
| 324 |
+
extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
|
| 325 |
+
|
| 326 |
+
/**
|
| 327 |
+
* \brief Get the value associated with a thread local storage ID for the current thread.
|
| 328 |
+
*
|
| 329 |
+
* \param id The thread local storage ID
|
| 330 |
+
*
|
| 331 |
+
* \return The value associated with the ID for the current thread, or NULL if no value has been set.
|
| 332 |
+
*
|
| 333 |
+
* \sa SDL_TLSCreate()
|
| 334 |
+
* \sa SDL_TLSSet()
|
| 335 |
+
*/
|
| 336 |
+
extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
|
| 337 |
+
|
| 338 |
+
/**
|
| 339 |
+
* \brief Set the value associated with a thread local storage ID for the current thread.
|
| 340 |
+
*
|
| 341 |
+
* \param id The thread local storage ID
|
| 342 |
+
* \param value The value to associate with the ID for the current thread
|
| 343 |
+
* \param destructor A function called when the thread exits, to free the value.
|
| 344 |
+
*
|
| 345 |
+
* \return 0 on success, -1 on error
|
| 346 |
+
*
|
| 347 |
+
* \sa SDL_TLSCreate()
|
| 348 |
+
* \sa SDL_TLSGet()
|
| 349 |
+
*/
|
| 350 |
+
extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
|
| 351 |
+
|
| 352 |
+
|
| 353 |
+
/* Ends C function definitions when using C++ */
|
| 354 |
+
#ifdef __cplusplus
|
| 355 |
+
}
|
| 356 |
+
#endif
|
| 357 |
+
#include "close_code.h"
|
| 358 |
+
|
| 359 |
+
#endif /* SDL_thread_h_ */
|
| 360 |
+
|
| 361 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_timer.h
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#ifndef SDL_timer_h_
|
| 23 |
+
#define SDL_timer_h_
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* \file SDL_timer.h
|
| 27 |
+
*
|
| 28 |
+
* Header for the SDL time management routines.
|
| 29 |
+
*/
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_error.h"
|
| 33 |
+
|
| 34 |
+
#include "begin_code.h"
|
| 35 |
+
/* Set up for C function definitions, even when using C++ */
|
| 36 |
+
#ifdef __cplusplus
|
| 37 |
+
extern "C" {
|
| 38 |
+
#endif
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* \brief Get the number of milliseconds since the SDL library initialization.
|
| 42 |
+
*
|
| 43 |
+
* \note This value wraps if the program runs for more than ~49 days.
|
| 44 |
+
*/
|
| 45 |
+
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* \brief Compare SDL ticks values, and return true if A has passed B
|
| 49 |
+
*
|
| 50 |
+
* e.g. if you want to wait 100 ms, you could do this:
|
| 51 |
+
* Uint32 timeout = SDL_GetTicks() + 100;
|
| 52 |
+
* while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
|
| 53 |
+
* ... do work until timeout has elapsed
|
| 54 |
+
* }
|
| 55 |
+
*/
|
| 56 |
+
#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* \brief Get the current value of the high resolution counter
|
| 60 |
+
*/
|
| 61 |
+
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* \brief Get the count per second of the high resolution counter
|
| 65 |
+
*/
|
| 66 |
+
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* \brief Wait a specified number of milliseconds before returning.
|
| 70 |
+
*/
|
| 71 |
+
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* Function prototype for the timer callback function.
|
| 75 |
+
*
|
| 76 |
+
* The callback function is passed the current timer interval and returns
|
| 77 |
+
* the next timer interval. If the returned value is the same as the one
|
| 78 |
+
* passed in, the periodic alarm continues, otherwise a new alarm is
|
| 79 |
+
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
|
| 80 |
+
*/
|
| 81 |
+
typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Definition of the timer ID type.
|
| 85 |
+
*/
|
| 86 |
+
typedef int SDL_TimerID;
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* \brief Add a new timer to the pool of timers already running.
|
| 90 |
+
*
|
| 91 |
+
* \return A timer ID, or 0 when an error occurs.
|
| 92 |
+
*/
|
| 93 |
+
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
| 94 |
+
SDL_TimerCallback callback,
|
| 95 |
+
void *param);
|
| 96 |
+
|
| 97 |
+
/**
|
| 98 |
+
* \brief Remove a timer knowing its ID.
|
| 99 |
+
*
|
| 100 |
+
* \return A boolean value indicating success or failure.
|
| 101 |
+
*
|
| 102 |
+
* \warning It is not safe to remove a timer multiple times.
|
| 103 |
+
*/
|
| 104 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
/* Ends C function definitions when using C++ */
|
| 108 |
+
#ifdef __cplusplus
|
| 109 |
+
}
|
| 110 |
+
#endif
|
| 111 |
+
#include "close_code.h"
|
| 112 |
+
|
| 113 |
+
#endif /* SDL_timer_h_ */
|
| 114 |
+
|
| 115 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_touch.h
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_touch.h
|
| 24 |
+
*
|
| 25 |
+
* Include file for SDL touch event handling.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_touch_h_
|
| 29 |
+
#define SDL_touch_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_error.h"
|
| 33 |
+
#include "SDL_video.h"
|
| 34 |
+
|
| 35 |
+
#include "begin_code.h"
|
| 36 |
+
/* Set up for C function definitions, even when using C++ */
|
| 37 |
+
#ifdef __cplusplus
|
| 38 |
+
extern "C" {
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
typedef Sint64 SDL_TouchID;
|
| 42 |
+
typedef Sint64 SDL_FingerID;
|
| 43 |
+
|
| 44 |
+
typedef enum
|
| 45 |
+
{
|
| 46 |
+
SDL_TOUCH_DEVICE_INVALID = -1,
|
| 47 |
+
SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */
|
| 48 |
+
SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
|
| 49 |
+
SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */
|
| 50 |
+
} SDL_TouchDeviceType;
|
| 51 |
+
|
| 52 |
+
typedef struct SDL_Finger
|
| 53 |
+
{
|
| 54 |
+
SDL_FingerID id;
|
| 55 |
+
float x;
|
| 56 |
+
float y;
|
| 57 |
+
float pressure;
|
| 58 |
+
} SDL_Finger;
|
| 59 |
+
|
| 60 |
+
/* Used as the device ID for mouse events simulated with touch input */
|
| 61 |
+
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
|
| 62 |
+
|
| 63 |
+
/* Used as the SDL_TouchID for touch events simulated with mouse input */
|
| 64 |
+
#define SDL_MOUSE_TOUCHID ((Sint64)-1)
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
/* Function prototypes */
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* \brief Get the number of registered touch devices.
|
| 71 |
+
*/
|
| 72 |
+
extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* \brief Get the touch ID with the given index, or 0 if the index is invalid.
|
| 76 |
+
*/
|
| 77 |
+
extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
|
| 78 |
+
|
| 79 |
+
/**
|
| 80 |
+
* \brief Get the type of the given touch device.
|
| 81 |
+
*/
|
| 82 |
+
extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* \brief Get the number of active fingers for a given touch device.
|
| 86 |
+
*/
|
| 87 |
+
extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
|
| 88 |
+
|
| 89 |
+
/**
|
| 90 |
+
* \brief Get the finger object of the given touch, with the given index.
|
| 91 |
+
*/
|
| 92 |
+
extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
|
| 93 |
+
|
| 94 |
+
/* Ends C function definitions when using C++ */
|
| 95 |
+
#ifdef __cplusplus
|
| 96 |
+
}
|
| 97 |
+
#endif
|
| 98 |
+
#include "close_code.h"
|
| 99 |
+
|
| 100 |
+
#endif /* SDL_touch_h_ */
|
| 101 |
+
|
| 102 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_types.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_version.h
|
| 24 |
+
*
|
| 25 |
+
* This header defines the current SDL version.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_version_h_
|
| 29 |
+
#define SDL_version_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
|
| 33 |
+
#include "begin_code.h"
|
| 34 |
+
/* Set up for C function definitions, even when using C++ */
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* \brief Information the version of SDL in use.
|
| 41 |
+
*
|
| 42 |
+
* Represents the library's version as three levels: major revision
|
| 43 |
+
* (increments with massive changes, additions, and enhancements),
|
| 44 |
+
* minor revision (increments with backwards-compatible changes to the
|
| 45 |
+
* major revision), and patchlevel (increments with fixes to the minor
|
| 46 |
+
* revision).
|
| 47 |
+
*
|
| 48 |
+
* \sa SDL_VERSION
|
| 49 |
+
* \sa SDL_GetVersion
|
| 50 |
+
*/
|
| 51 |
+
typedef struct SDL_version
|
| 52 |
+
{
|
| 53 |
+
Uint8 major; /**< major version */
|
| 54 |
+
Uint8 minor; /**< minor version */
|
| 55 |
+
Uint8 patch; /**< update version */
|
| 56 |
+
} SDL_version;
|
| 57 |
+
|
| 58 |
+
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
| 59 |
+
*/
|
| 60 |
+
#define SDL_MAJOR_VERSION 2
|
| 61 |
+
#define SDL_MINOR_VERSION 0
|
| 62 |
+
#define SDL_PATCHLEVEL 12
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* \brief Macro to determine SDL version program was compiled against.
|
| 66 |
+
*
|
| 67 |
+
* This macro fills in a SDL_version structure with the version of the
|
| 68 |
+
* library you compiled against. This is determined by what header the
|
| 69 |
+
* compiler uses. Note that if you dynamically linked the library, you might
|
| 70 |
+
* have a slightly newer or older version at runtime. That version can be
|
| 71 |
+
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
|
| 72 |
+
* is not a macro.
|
| 73 |
+
*
|
| 74 |
+
* \param x A pointer to a SDL_version struct to initialize.
|
| 75 |
+
*
|
| 76 |
+
* \sa SDL_version
|
| 77 |
+
* \sa SDL_GetVersion
|
| 78 |
+
*/
|
| 79 |
+
#define SDL_VERSION(x) \
|
| 80 |
+
{ \
|
| 81 |
+
(x)->major = SDL_MAJOR_VERSION; \
|
| 82 |
+
(x)->minor = SDL_MINOR_VERSION; \
|
| 83 |
+
(x)->patch = SDL_PATCHLEVEL; \
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
/**
|
| 87 |
+
* This macro turns the version numbers into a numeric value:
|
| 88 |
+
* \verbatim
|
| 89 |
+
(1,2,3) -> (1203)
|
| 90 |
+
\endverbatim
|
| 91 |
+
*
|
| 92 |
+
* This assumes that there will never be more than 100 patchlevels.
|
| 93 |
+
*/
|
| 94 |
+
#define SDL_VERSIONNUM(X, Y, Z) \
|
| 95 |
+
((X)*1000 + (Y)*100 + (Z))
|
| 96 |
+
|
| 97 |
+
/**
|
| 98 |
+
* This is the version number macro for the current SDL version.
|
| 99 |
+
*/
|
| 100 |
+
#define SDL_COMPILEDVERSION \
|
| 101 |
+
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
|
| 102 |
+
|
| 103 |
+
/**
|
| 104 |
+
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
|
| 105 |
+
*/
|
| 106 |
+
#define SDL_VERSION_ATLEAST(X, Y, Z) \
|
| 107 |
+
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
|
| 108 |
+
|
| 109 |
+
/**
|
| 110 |
+
* \brief Get the version of SDL that is linked against your program.
|
| 111 |
+
*
|
| 112 |
+
* If you are linking to SDL dynamically, then it is possible that the
|
| 113 |
+
* current version will be different than the version you compiled against.
|
| 114 |
+
* This function returns the current version, while SDL_VERSION() is a
|
| 115 |
+
* macro that tells you what version you compiled with.
|
| 116 |
+
*
|
| 117 |
+
* \code
|
| 118 |
+
* SDL_version compiled;
|
| 119 |
+
* SDL_version linked;
|
| 120 |
+
*
|
| 121 |
+
* SDL_VERSION(&compiled);
|
| 122 |
+
* SDL_GetVersion(&linked);
|
| 123 |
+
* printf("We compiled against SDL version %d.%d.%d ...\n",
|
| 124 |
+
* compiled.major, compiled.minor, compiled.patch);
|
| 125 |
+
* printf("But we linked against SDL version %d.%d.%d.\n",
|
| 126 |
+
* linked.major, linked.minor, linked.patch);
|
| 127 |
+
* \endcode
|
| 128 |
+
*
|
| 129 |
+
* This function may be called safely at any time, even before SDL_Init().
|
| 130 |
+
*
|
| 131 |
+
* \sa SDL_VERSION
|
| 132 |
+
*/
|
| 133 |
+
extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
|
| 134 |
+
|
| 135 |
+
/**
|
| 136 |
+
* \brief Get the code revision of SDL that is linked against your program.
|
| 137 |
+
*
|
| 138 |
+
* Returns an arbitrary string (a hash value) uniquely identifying the
|
| 139 |
+
* exact revision of the SDL library in use, and is only useful in comparing
|
| 140 |
+
* against other revisions. It is NOT an incrementing number.
|
| 141 |
+
*/
|
| 142 |
+
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
|
| 143 |
+
|
| 144 |
+
/**
|
| 145 |
+
* \brief Get the revision number of SDL that is linked against your program.
|
| 146 |
+
*
|
| 147 |
+
* Returns a number uniquely identifying the exact revision of the SDL
|
| 148 |
+
* library in use. It is an incrementing number based on commits to
|
| 149 |
+
* hg.libsdl.org.
|
| 150 |
+
*/
|
| 151 |
+
extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
/* Ends C function definitions when using C++ */
|
| 155 |
+
#ifdef __cplusplus
|
| 156 |
+
}
|
| 157 |
+
#endif
|
| 158 |
+
#include "close_code.h"
|
| 159 |
+
|
| 160 |
+
#endif /* SDL_version_h_ */
|
| 161 |
+
|
| 162 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_video.h
ADDED
|
@@ -0,0 +1,1275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_video.h
|
| 24 |
+
*
|
| 25 |
+
* Header file for SDL video functions.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_video_h_
|
| 29 |
+
#define SDL_video_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_stdinc.h"
|
| 32 |
+
#include "SDL_pixels.h"
|
| 33 |
+
#include "SDL_rect.h"
|
| 34 |
+
#include "SDL_surface.h"
|
| 35 |
+
|
| 36 |
+
#include "begin_code.h"
|
| 37 |
+
/* Set up for C function definitions, even when using C++ */
|
| 38 |
+
#ifdef __cplusplus
|
| 39 |
+
extern "C" {
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* \brief The structure that defines a display mode
|
| 44 |
+
*
|
| 45 |
+
* \sa SDL_GetNumDisplayModes()
|
| 46 |
+
* \sa SDL_GetDisplayMode()
|
| 47 |
+
* \sa SDL_GetDesktopDisplayMode()
|
| 48 |
+
* \sa SDL_GetCurrentDisplayMode()
|
| 49 |
+
* \sa SDL_GetClosestDisplayMode()
|
| 50 |
+
* \sa SDL_SetWindowDisplayMode()
|
| 51 |
+
* \sa SDL_GetWindowDisplayMode()
|
| 52 |
+
*/
|
| 53 |
+
typedef struct
|
| 54 |
+
{
|
| 55 |
+
Uint32 format; /**< pixel format */
|
| 56 |
+
int w; /**< width, in screen coordinates */
|
| 57 |
+
int h; /**< height, in screen coordinates */
|
| 58 |
+
int refresh_rate; /**< refresh rate (or zero for unspecified) */
|
| 59 |
+
void *driverdata; /**< driver-specific data, initialize to 0 */
|
| 60 |
+
} SDL_DisplayMode;
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* \brief The type used to identify a window
|
| 64 |
+
*
|
| 65 |
+
* \sa SDL_CreateWindow()
|
| 66 |
+
* \sa SDL_CreateWindowFrom()
|
| 67 |
+
* \sa SDL_DestroyWindow()
|
| 68 |
+
* \sa SDL_GetWindowData()
|
| 69 |
+
* \sa SDL_GetWindowFlags()
|
| 70 |
+
* \sa SDL_GetWindowGrab()
|
| 71 |
+
* \sa SDL_GetWindowPosition()
|
| 72 |
+
* \sa SDL_GetWindowSize()
|
| 73 |
+
* \sa SDL_GetWindowTitle()
|
| 74 |
+
* \sa SDL_HideWindow()
|
| 75 |
+
* \sa SDL_MaximizeWindow()
|
| 76 |
+
* \sa SDL_MinimizeWindow()
|
| 77 |
+
* \sa SDL_RaiseWindow()
|
| 78 |
+
* \sa SDL_RestoreWindow()
|
| 79 |
+
* \sa SDL_SetWindowData()
|
| 80 |
+
* \sa SDL_SetWindowFullscreen()
|
| 81 |
+
* \sa SDL_SetWindowGrab()
|
| 82 |
+
* \sa SDL_SetWindowIcon()
|
| 83 |
+
* \sa SDL_SetWindowPosition()
|
| 84 |
+
* \sa SDL_SetWindowSize()
|
| 85 |
+
* \sa SDL_SetWindowBordered()
|
| 86 |
+
* \sa SDL_SetWindowResizable()
|
| 87 |
+
* \sa SDL_SetWindowTitle()
|
| 88 |
+
* \sa SDL_ShowWindow()
|
| 89 |
+
*/
|
| 90 |
+
typedef struct SDL_Window SDL_Window;
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* \brief The flags on a window
|
| 94 |
+
*
|
| 95 |
+
* \sa SDL_GetWindowFlags()
|
| 96 |
+
*/
|
| 97 |
+
typedef enum
|
| 98 |
+
{
|
| 99 |
+
SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */
|
| 100 |
+
SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */
|
| 101 |
+
SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */
|
| 102 |
+
SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */
|
| 103 |
+
SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */
|
| 104 |
+
SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */
|
| 105 |
+
SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */
|
| 106 |
+
SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */
|
| 107 |
+
SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */
|
| 108 |
+
SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */
|
| 109 |
+
SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */
|
| 110 |
+
SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ),
|
| 111 |
+
SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */
|
| 112 |
+
SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported.
|
| 113 |
+
On macOS NSHighResolutionCapable must be set true in the
|
| 114 |
+
application's Info.plist for this to have any effect. */
|
| 115 |
+
SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, /**< window has mouse captured (unrelated to INPUT_GRABBED) */
|
| 116 |
+
SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, /**< window should always be above others */
|
| 117 |
+
SDL_WINDOW_SKIP_TASKBAR = 0x00010000, /**< window should not be added to the taskbar */
|
| 118 |
+
SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */
|
| 119 |
+
SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */
|
| 120 |
+
SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */
|
| 121 |
+
SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */
|
| 122 |
+
} SDL_WindowFlags;
|
| 123 |
+
|
| 124 |
+
/**
|
| 125 |
+
* \brief Used to indicate that you don't care what the window position is.
|
| 126 |
+
*/
|
| 127 |
+
#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u
|
| 128 |
+
#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
|
| 129 |
+
#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
|
| 130 |
+
#define SDL_WINDOWPOS_ISUNDEFINED(X) \
|
| 131 |
+
(((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
|
| 132 |
+
|
| 133 |
+
/**
|
| 134 |
+
* \brief Used to indicate that the window position should be centered.
|
| 135 |
+
*/
|
| 136 |
+
#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u
|
| 137 |
+
#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
|
| 138 |
+
#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
|
| 139 |
+
#define SDL_WINDOWPOS_ISCENTERED(X) \
|
| 140 |
+
(((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
|
| 141 |
+
|
| 142 |
+
/**
|
| 143 |
+
* \brief Event subtype for window events
|
| 144 |
+
*/
|
| 145 |
+
typedef enum
|
| 146 |
+
{
|
| 147 |
+
SDL_WINDOWEVENT_NONE, /**< Never used */
|
| 148 |
+
SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */
|
| 149 |
+
SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */
|
| 150 |
+
SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be
|
| 151 |
+
redrawn */
|
| 152 |
+
SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2
|
| 153 |
+
*/
|
| 154 |
+
SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */
|
| 155 |
+
SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as
|
| 156 |
+
a result of an API call or through the
|
| 157 |
+
system or user changing the window size. */
|
| 158 |
+
SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */
|
| 159 |
+
SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */
|
| 160 |
+
SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size
|
| 161 |
+
and position */
|
| 162 |
+
SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */
|
| 163 |
+
SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */
|
| 164 |
+
SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */
|
| 165 |
+
SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */
|
| 166 |
+
SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */
|
| 167 |
+
SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */
|
| 168 |
+
SDL_WINDOWEVENT_HIT_TEST /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */
|
| 169 |
+
} SDL_WindowEventID;
|
| 170 |
+
|
| 171 |
+
/**
|
| 172 |
+
* \brief Event subtype for display events
|
| 173 |
+
*/
|
| 174 |
+
typedef enum
|
| 175 |
+
{
|
| 176 |
+
SDL_DISPLAYEVENT_NONE, /**< Never used */
|
| 177 |
+
SDL_DISPLAYEVENT_ORIENTATION /**< Display orientation has changed to data1 */
|
| 178 |
+
} SDL_DisplayEventID;
|
| 179 |
+
|
| 180 |
+
typedef enum
|
| 181 |
+
{
|
| 182 |
+
SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */
|
| 183 |
+
SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */
|
| 184 |
+
SDL_ORIENTATION_LANDSCAPE_FLIPPED, /**< The display is in landscape mode, with the left side up, relative to portrait mode */
|
| 185 |
+
SDL_ORIENTATION_PORTRAIT, /**< The display is in portrait mode */
|
| 186 |
+
SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */
|
| 187 |
+
} SDL_DisplayOrientation;
|
| 188 |
+
|
| 189 |
+
/**
|
| 190 |
+
* \brief An opaque handle to an OpenGL context.
|
| 191 |
+
*/
|
| 192 |
+
typedef void *SDL_GLContext;
|
| 193 |
+
|
| 194 |
+
/**
|
| 195 |
+
* \brief OpenGL configuration attributes
|
| 196 |
+
*/
|
| 197 |
+
typedef enum
|
| 198 |
+
{
|
| 199 |
+
SDL_GL_RED_SIZE,
|
| 200 |
+
SDL_GL_GREEN_SIZE,
|
| 201 |
+
SDL_GL_BLUE_SIZE,
|
| 202 |
+
SDL_GL_ALPHA_SIZE,
|
| 203 |
+
SDL_GL_BUFFER_SIZE,
|
| 204 |
+
SDL_GL_DOUBLEBUFFER,
|
| 205 |
+
SDL_GL_DEPTH_SIZE,
|
| 206 |
+
SDL_GL_STENCIL_SIZE,
|
| 207 |
+
SDL_GL_ACCUM_RED_SIZE,
|
| 208 |
+
SDL_GL_ACCUM_GREEN_SIZE,
|
| 209 |
+
SDL_GL_ACCUM_BLUE_SIZE,
|
| 210 |
+
SDL_GL_ACCUM_ALPHA_SIZE,
|
| 211 |
+
SDL_GL_STEREO,
|
| 212 |
+
SDL_GL_MULTISAMPLEBUFFERS,
|
| 213 |
+
SDL_GL_MULTISAMPLESAMPLES,
|
| 214 |
+
SDL_GL_ACCELERATED_VISUAL,
|
| 215 |
+
SDL_GL_RETAINED_BACKING,
|
| 216 |
+
SDL_GL_CONTEXT_MAJOR_VERSION,
|
| 217 |
+
SDL_GL_CONTEXT_MINOR_VERSION,
|
| 218 |
+
SDL_GL_CONTEXT_EGL,
|
| 219 |
+
SDL_GL_CONTEXT_FLAGS,
|
| 220 |
+
SDL_GL_CONTEXT_PROFILE_MASK,
|
| 221 |
+
SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
|
| 222 |
+
SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
|
| 223 |
+
SDL_GL_CONTEXT_RELEASE_BEHAVIOR,
|
| 224 |
+
SDL_GL_CONTEXT_RESET_NOTIFICATION,
|
| 225 |
+
SDL_GL_CONTEXT_NO_ERROR
|
| 226 |
+
} SDL_GLattr;
|
| 227 |
+
|
| 228 |
+
typedef enum
|
| 229 |
+
{
|
| 230 |
+
SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
|
| 231 |
+
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
|
| 232 |
+
SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */
|
| 233 |
+
} SDL_GLprofile;
|
| 234 |
+
|
| 235 |
+
typedef enum
|
| 236 |
+
{
|
| 237 |
+
SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
|
| 238 |
+
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
|
| 239 |
+
SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004,
|
| 240 |
+
SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
|
| 241 |
+
} SDL_GLcontextFlag;
|
| 242 |
+
|
| 243 |
+
typedef enum
|
| 244 |
+
{
|
| 245 |
+
SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000,
|
| 246 |
+
SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001
|
| 247 |
+
} SDL_GLcontextReleaseFlag;
|
| 248 |
+
|
| 249 |
+
typedef enum
|
| 250 |
+
{
|
| 251 |
+
SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000,
|
| 252 |
+
SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001
|
| 253 |
+
} SDL_GLContextResetNotification;
|
| 254 |
+
|
| 255 |
+
/* Function prototypes */
|
| 256 |
+
|
| 257 |
+
/**
|
| 258 |
+
* \brief Get the number of video drivers compiled into SDL
|
| 259 |
+
*
|
| 260 |
+
* \sa SDL_GetVideoDriver()
|
| 261 |
+
*/
|
| 262 |
+
extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
|
| 263 |
+
|
| 264 |
+
/**
|
| 265 |
+
* \brief Get the name of a built in video driver.
|
| 266 |
+
*
|
| 267 |
+
* \note The video drivers are presented in the order in which they are
|
| 268 |
+
* normally checked during initialization.
|
| 269 |
+
*
|
| 270 |
+
* \sa SDL_GetNumVideoDrivers()
|
| 271 |
+
*/
|
| 272 |
+
extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
|
| 273 |
+
|
| 274 |
+
/**
|
| 275 |
+
* \brief Initialize the video subsystem, optionally specifying a video driver.
|
| 276 |
+
*
|
| 277 |
+
* \param driver_name Initialize a specific driver by name, or NULL for the
|
| 278 |
+
* default video driver.
|
| 279 |
+
*
|
| 280 |
+
* \return 0 on success, -1 on error
|
| 281 |
+
*
|
| 282 |
+
* This function initializes the video subsystem; setting up a connection
|
| 283 |
+
* to the window manager, etc, and determines the available display modes
|
| 284 |
+
* and pixel formats, but does not initialize a window or graphics mode.
|
| 285 |
+
*
|
| 286 |
+
* \sa SDL_VideoQuit()
|
| 287 |
+
*/
|
| 288 |
+
extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name);
|
| 289 |
+
|
| 290 |
+
/**
|
| 291 |
+
* \brief Shuts down the video subsystem.
|
| 292 |
+
*
|
| 293 |
+
* This function closes all windows, and restores the original video mode.
|
| 294 |
+
*
|
| 295 |
+
* \sa SDL_VideoInit()
|
| 296 |
+
*/
|
| 297 |
+
extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
|
| 298 |
+
|
| 299 |
+
/**
|
| 300 |
+
* \brief Returns the name of the currently initialized video driver.
|
| 301 |
+
*
|
| 302 |
+
* \return The name of the current video driver or NULL if no driver
|
| 303 |
+
* has been initialized
|
| 304 |
+
*
|
| 305 |
+
* \sa SDL_GetNumVideoDrivers()
|
| 306 |
+
* \sa SDL_GetVideoDriver()
|
| 307 |
+
*/
|
| 308 |
+
extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
|
| 309 |
+
|
| 310 |
+
/**
|
| 311 |
+
* \brief Returns the number of available video displays.
|
| 312 |
+
*
|
| 313 |
+
* \sa SDL_GetDisplayBounds()
|
| 314 |
+
*/
|
| 315 |
+
extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
|
| 316 |
+
|
| 317 |
+
/**
|
| 318 |
+
* \brief Get the name of a display in UTF-8 encoding
|
| 319 |
+
*
|
| 320 |
+
* \return The name of a display, or NULL for an invalid display index.
|
| 321 |
+
*
|
| 322 |
+
* \sa SDL_GetNumVideoDisplays()
|
| 323 |
+
*/
|
| 324 |
+
extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex);
|
| 325 |
+
|
| 326 |
+
/**
|
| 327 |
+
* \brief Get the desktop area represented by a display, with the primary
|
| 328 |
+
* display located at 0,0
|
| 329 |
+
*
|
| 330 |
+
* \return 0 on success, or -1 if the index is out of range.
|
| 331 |
+
*
|
| 332 |
+
* \sa SDL_GetNumVideoDisplays()
|
| 333 |
+
*/
|
| 334 |
+
extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
|
| 335 |
+
|
| 336 |
+
/**
|
| 337 |
+
* \brief Get the usable desktop area represented by a display, with the
|
| 338 |
+
* primary display located at 0,0
|
| 339 |
+
*
|
| 340 |
+
* This is the same area as SDL_GetDisplayBounds() reports, but with portions
|
| 341 |
+
* reserved by the system removed. For example, on Mac OS X, this subtracts
|
| 342 |
+
* the area occupied by the menu bar and dock.
|
| 343 |
+
*
|
| 344 |
+
* Setting a window to be fullscreen generally bypasses these unusable areas,
|
| 345 |
+
* so these are good guidelines for the maximum space available to a
|
| 346 |
+
* non-fullscreen window.
|
| 347 |
+
*
|
| 348 |
+
* \return 0 on success, or -1 if the index is out of range.
|
| 349 |
+
*
|
| 350 |
+
* \sa SDL_GetDisplayBounds()
|
| 351 |
+
* \sa SDL_GetNumVideoDisplays()
|
| 352 |
+
*/
|
| 353 |
+
extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect);
|
| 354 |
+
|
| 355 |
+
/**
|
| 356 |
+
* \brief Get the dots/pixels-per-inch for a display
|
| 357 |
+
*
|
| 358 |
+
* \note Diagonal, horizontal and vertical DPI can all be optionally
|
| 359 |
+
* returned if the parameter is non-NULL.
|
| 360 |
+
*
|
| 361 |
+
* \return 0 on success, or -1 if no DPI information is available or the index is out of range.
|
| 362 |
+
*
|
| 363 |
+
* \sa SDL_GetNumVideoDisplays()
|
| 364 |
+
*/
|
| 365 |
+
extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi);
|
| 366 |
+
|
| 367 |
+
/**
|
| 368 |
+
* \brief Get the orientation of a display
|
| 369 |
+
*
|
| 370 |
+
* \return The orientation of the display, or SDL_ORIENTATION_UNKNOWN if it isn't available.
|
| 371 |
+
*
|
| 372 |
+
* \sa SDL_GetNumVideoDisplays()
|
| 373 |
+
*/
|
| 374 |
+
extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex);
|
| 375 |
+
|
| 376 |
+
/**
|
| 377 |
+
* \brief Returns the number of available display modes.
|
| 378 |
+
*
|
| 379 |
+
* \sa SDL_GetDisplayMode()
|
| 380 |
+
*/
|
| 381 |
+
extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex);
|
| 382 |
+
|
| 383 |
+
/**
|
| 384 |
+
* \brief Fill in information about a specific display mode.
|
| 385 |
+
*
|
| 386 |
+
* \note The display modes are sorted in this priority:
|
| 387 |
+
* \li bits per pixel -> more colors to fewer colors
|
| 388 |
+
* \li width -> largest to smallest
|
| 389 |
+
* \li height -> largest to smallest
|
| 390 |
+
* \li refresh rate -> highest to lowest
|
| 391 |
+
*
|
| 392 |
+
* \sa SDL_GetNumDisplayModes()
|
| 393 |
+
*/
|
| 394 |
+
extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex,
|
| 395 |
+
SDL_DisplayMode * mode);
|
| 396 |
+
|
| 397 |
+
/**
|
| 398 |
+
* \brief Fill in information about the desktop display mode.
|
| 399 |
+
*/
|
| 400 |
+
extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
|
| 401 |
+
|
| 402 |
+
/**
|
| 403 |
+
* \brief Fill in information about the current display mode.
|
| 404 |
+
*/
|
| 405 |
+
extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
|
| 406 |
+
|
| 407 |
+
|
| 408 |
+
/**
|
| 409 |
+
* \brief Get the closest match to the requested display mode.
|
| 410 |
+
*
|
| 411 |
+
* \param displayIndex The index of display from which mode should be queried.
|
| 412 |
+
* \param mode The desired display mode
|
| 413 |
+
* \param closest A pointer to a display mode to be filled in with the closest
|
| 414 |
+
* match of the available display modes.
|
| 415 |
+
*
|
| 416 |
+
* \return The passed in value \c closest, or NULL if no matching video mode
|
| 417 |
+
* was available.
|
| 418 |
+
*
|
| 419 |
+
* The available display modes are scanned, and \c closest is filled in with the
|
| 420 |
+
* closest mode matching the requested mode and returned. The mode format and
|
| 421 |
+
* refresh_rate default to the desktop mode if they are 0. The modes are
|
| 422 |
+
* scanned with size being first priority, format being second priority, and
|
| 423 |
+
* finally checking the refresh_rate. If all the available modes are too
|
| 424 |
+
* small, then NULL is returned.
|
| 425 |
+
*
|
| 426 |
+
* \sa SDL_GetNumDisplayModes()
|
| 427 |
+
* \sa SDL_GetDisplayMode()
|
| 428 |
+
*/
|
| 429 |
+
extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
|
| 430 |
+
|
| 431 |
+
/**
|
| 432 |
+
* \brief Get the display index associated with a window.
|
| 433 |
+
*
|
| 434 |
+
* \return the display index of the display containing the center of the
|
| 435 |
+
* window, or -1 on error.
|
| 436 |
+
*/
|
| 437 |
+
extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window);
|
| 438 |
+
|
| 439 |
+
/**
|
| 440 |
+
* \brief Set the display mode used when a fullscreen window is visible.
|
| 441 |
+
*
|
| 442 |
+
* By default the window's dimensions and the desktop format and refresh rate
|
| 443 |
+
* are used.
|
| 444 |
+
*
|
| 445 |
+
* \param window The window for which the display mode should be set.
|
| 446 |
+
* \param mode The mode to use, or NULL for the default mode.
|
| 447 |
+
*
|
| 448 |
+
* \return 0 on success, or -1 if setting the display mode failed.
|
| 449 |
+
*
|
| 450 |
+
* \sa SDL_GetWindowDisplayMode()
|
| 451 |
+
* \sa SDL_SetWindowFullscreen()
|
| 452 |
+
*/
|
| 453 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
|
| 454 |
+
const SDL_DisplayMode
|
| 455 |
+
* mode);
|
| 456 |
+
|
| 457 |
+
/**
|
| 458 |
+
* \brief Fill in information about the display mode used when a fullscreen
|
| 459 |
+
* window is visible.
|
| 460 |
+
*
|
| 461 |
+
* \sa SDL_SetWindowDisplayMode()
|
| 462 |
+
* \sa SDL_SetWindowFullscreen()
|
| 463 |
+
*/
|
| 464 |
+
extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
|
| 465 |
+
SDL_DisplayMode * mode);
|
| 466 |
+
|
| 467 |
+
/**
|
| 468 |
+
* \brief Get the pixel format associated with the window.
|
| 469 |
+
*/
|
| 470 |
+
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
|
| 471 |
+
|
| 472 |
+
/**
|
| 473 |
+
* \brief Create a window with the specified position, dimensions, and flags.
|
| 474 |
+
*
|
| 475 |
+
* \param title The title of the window, in UTF-8 encoding.
|
| 476 |
+
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
| 477 |
+
* ::SDL_WINDOWPOS_UNDEFINED.
|
| 478 |
+
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
| 479 |
+
* ::SDL_WINDOWPOS_UNDEFINED.
|
| 480 |
+
* \param w The width of the window, in screen coordinates.
|
| 481 |
+
* \param h The height of the window, in screen coordinates.
|
| 482 |
+
* \param flags The flags for the window, a mask of any of the following:
|
| 483 |
+
* ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL,
|
| 484 |
+
* ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS,
|
| 485 |
+
* ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
|
| 486 |
+
* ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED,
|
| 487 |
+
* ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN.
|
| 488 |
+
*
|
| 489 |
+
* \return The created window, or NULL if window creation failed.
|
| 490 |
+
*
|
| 491 |
+
* If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size
|
| 492 |
+
* in pixels may differ from its size in screen coordinates on platforms with
|
| 493 |
+
* high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query
|
| 494 |
+
* the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(),
|
| 495 |
+
* SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the
|
| 496 |
+
* drawable size in pixels.
|
| 497 |
+
*
|
| 498 |
+
* If the window is created with any of the SDL_WINDOW_OPENGL or
|
| 499 |
+
* SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function
|
| 500 |
+
* (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the
|
| 501 |
+
* corresponding UnloadLibrary function is called by SDL_DestroyWindow().
|
| 502 |
+
*
|
| 503 |
+
* If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver,
|
| 504 |
+
* SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail.
|
| 505 |
+
*
|
| 506 |
+
* \note On non-Apple devices, SDL requires you to either not link to the
|
| 507 |
+
* Vulkan loader or link to a dynamic library version. This limitation
|
| 508 |
+
* may be removed in a future version of SDL.
|
| 509 |
+
*
|
| 510 |
+
* \sa SDL_DestroyWindow()
|
| 511 |
+
* \sa SDL_GL_LoadLibrary()
|
| 512 |
+
* \sa SDL_Vulkan_LoadLibrary()
|
| 513 |
+
*/
|
| 514 |
+
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title,
|
| 515 |
+
int x, int y, int w,
|
| 516 |
+
int h, Uint32 flags);
|
| 517 |
+
|
| 518 |
+
/**
|
| 519 |
+
* \brief Create an SDL window from an existing native window.
|
| 520 |
+
*
|
| 521 |
+
* \param data A pointer to driver-dependent window creation data
|
| 522 |
+
*
|
| 523 |
+
* \return The created window, or NULL if window creation failed.
|
| 524 |
+
*
|
| 525 |
+
* \sa SDL_DestroyWindow()
|
| 526 |
+
*/
|
| 527 |
+
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data);
|
| 528 |
+
|
| 529 |
+
/**
|
| 530 |
+
* \brief Get the numeric ID of a window, for logging purposes.
|
| 531 |
+
*/
|
| 532 |
+
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window);
|
| 533 |
+
|
| 534 |
+
/**
|
| 535 |
+
* \brief Get a window from a stored ID, or NULL if it doesn't exist.
|
| 536 |
+
*/
|
| 537 |
+
extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id);
|
| 538 |
+
|
| 539 |
+
/**
|
| 540 |
+
* \brief Get the window flags.
|
| 541 |
+
*/
|
| 542 |
+
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window);
|
| 543 |
+
|
| 544 |
+
/**
|
| 545 |
+
* \brief Set the title of a window, in UTF-8 format.
|
| 546 |
+
*
|
| 547 |
+
* \sa SDL_GetWindowTitle()
|
| 548 |
+
*/
|
| 549 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window,
|
| 550 |
+
const char *title);
|
| 551 |
+
|
| 552 |
+
/**
|
| 553 |
+
* \brief Get the title of a window, in UTF-8 format.
|
| 554 |
+
*
|
| 555 |
+
* \sa SDL_SetWindowTitle()
|
| 556 |
+
*/
|
| 557 |
+
extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window);
|
| 558 |
+
|
| 559 |
+
/**
|
| 560 |
+
* \brief Set the icon for a window.
|
| 561 |
+
*
|
| 562 |
+
* \param window The window for which the icon should be set.
|
| 563 |
+
* \param icon The icon for the window.
|
| 564 |
+
*/
|
| 565 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window,
|
| 566 |
+
SDL_Surface * icon);
|
| 567 |
+
|
| 568 |
+
/**
|
| 569 |
+
* \brief Associate an arbitrary named pointer with a window.
|
| 570 |
+
*
|
| 571 |
+
* \param window The window to associate with the pointer.
|
| 572 |
+
* \param name The name of the pointer.
|
| 573 |
+
* \param userdata The associated pointer.
|
| 574 |
+
*
|
| 575 |
+
* \return The previous value associated with 'name'
|
| 576 |
+
*
|
| 577 |
+
* \note The name is case-sensitive.
|
| 578 |
+
*
|
| 579 |
+
* \sa SDL_GetWindowData()
|
| 580 |
+
*/
|
| 581 |
+
extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
|
| 582 |
+
const char *name,
|
| 583 |
+
void *userdata);
|
| 584 |
+
|
| 585 |
+
/**
|
| 586 |
+
* \brief Retrieve the data pointer associated with a window.
|
| 587 |
+
*
|
| 588 |
+
* \param window The window to query.
|
| 589 |
+
* \param name The name of the pointer.
|
| 590 |
+
*
|
| 591 |
+
* \return The value associated with 'name'
|
| 592 |
+
*
|
| 593 |
+
* \sa SDL_SetWindowData()
|
| 594 |
+
*/
|
| 595 |
+
extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window,
|
| 596 |
+
const char *name);
|
| 597 |
+
|
| 598 |
+
/**
|
| 599 |
+
* \brief Set the position of a window.
|
| 600 |
+
*
|
| 601 |
+
* \param window The window to reposition.
|
| 602 |
+
* \param x The x coordinate of the window in screen coordinates, or
|
| 603 |
+
* ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
|
| 604 |
+
* \param y The y coordinate of the window in screen coordinates, or
|
| 605 |
+
* ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
|
| 606 |
+
*
|
| 607 |
+
* \note The window coordinate origin is the upper left of the display.
|
| 608 |
+
*
|
| 609 |
+
* \sa SDL_GetWindowPosition()
|
| 610 |
+
*/
|
| 611 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window,
|
| 612 |
+
int x, int y);
|
| 613 |
+
|
| 614 |
+
/**
|
| 615 |
+
* \brief Get the position of a window.
|
| 616 |
+
*
|
| 617 |
+
* \param window The window to query.
|
| 618 |
+
* \param x Pointer to variable for storing the x position, in screen
|
| 619 |
+
* coordinates. May be NULL.
|
| 620 |
+
* \param y Pointer to variable for storing the y position, in screen
|
| 621 |
+
* coordinates. May be NULL.
|
| 622 |
+
*
|
| 623 |
+
* \sa SDL_SetWindowPosition()
|
| 624 |
+
*/
|
| 625 |
+
extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window,
|
| 626 |
+
int *x, int *y);
|
| 627 |
+
|
| 628 |
+
/**
|
| 629 |
+
* \brief Set the size of a window's client area.
|
| 630 |
+
*
|
| 631 |
+
* \param window The window to resize.
|
| 632 |
+
* \param w The width of the window, in screen coordinates. Must be >0.
|
| 633 |
+
* \param h The height of the window, in screen coordinates. Must be >0.
|
| 634 |
+
*
|
| 635 |
+
* \note Fullscreen windows automatically match the size of the display mode,
|
| 636 |
+
* and you should use SDL_SetWindowDisplayMode() to change their size.
|
| 637 |
+
*
|
| 638 |
+
* The window size in screen coordinates may differ from the size in pixels, if
|
| 639 |
+
* the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
|
| 640 |
+
* high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
|
| 641 |
+
* SDL_GetRendererOutputSize() to get the real client area size in pixels.
|
| 642 |
+
*
|
| 643 |
+
* \sa SDL_GetWindowSize()
|
| 644 |
+
* \sa SDL_SetWindowDisplayMode()
|
| 645 |
+
*/
|
| 646 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w,
|
| 647 |
+
int h);
|
| 648 |
+
|
| 649 |
+
/**
|
| 650 |
+
* \brief Get the size of a window's client area.
|
| 651 |
+
*
|
| 652 |
+
* \param window The window to query.
|
| 653 |
+
* \param w Pointer to variable for storing the width, in screen
|
| 654 |
+
* coordinates. May be NULL.
|
| 655 |
+
* \param h Pointer to variable for storing the height, in screen
|
| 656 |
+
* coordinates. May be NULL.
|
| 657 |
+
*
|
| 658 |
+
* The window size in screen coordinates may differ from the size in pixels, if
|
| 659 |
+
* the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
|
| 660 |
+
* high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
|
| 661 |
+
* SDL_GetRendererOutputSize() to get the real client area size in pixels.
|
| 662 |
+
*
|
| 663 |
+
* \sa SDL_SetWindowSize()
|
| 664 |
+
*/
|
| 665 |
+
extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w,
|
| 666 |
+
int *h);
|
| 667 |
+
|
| 668 |
+
/**
|
| 669 |
+
* \brief Get the size of a window's borders (decorations) around the client area.
|
| 670 |
+
*
|
| 671 |
+
* \param window The window to query.
|
| 672 |
+
* \param top Pointer to variable for storing the size of the top border. NULL is permitted.
|
| 673 |
+
* \param left Pointer to variable for storing the size of the left border. NULL is permitted.
|
| 674 |
+
* \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted.
|
| 675 |
+
* \param right Pointer to variable for storing the size of the right border. NULL is permitted.
|
| 676 |
+
*
|
| 677 |
+
* \return 0 on success, or -1 if getting this information is not supported.
|
| 678 |
+
*
|
| 679 |
+
* \note if this function fails (returns -1), the size values will be
|
| 680 |
+
* initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as
|
| 681 |
+
* if the window in question was borderless.
|
| 682 |
+
*/
|
| 683 |
+
extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window,
|
| 684 |
+
int *top, int *left,
|
| 685 |
+
int *bottom, int *right);
|
| 686 |
+
|
| 687 |
+
/**
|
| 688 |
+
* \brief Set the minimum size of a window's client area.
|
| 689 |
+
*
|
| 690 |
+
* \param window The window to set a new minimum size.
|
| 691 |
+
* \param min_w The minimum width of the window, must be >0
|
| 692 |
+
* \param min_h The minimum height of the window, must be >0
|
| 693 |
+
*
|
| 694 |
+
* \note You can't change the minimum size of a fullscreen window, it
|
| 695 |
+
* automatically matches the size of the display mode.
|
| 696 |
+
*
|
| 697 |
+
* \sa SDL_GetWindowMinimumSize()
|
| 698 |
+
* \sa SDL_SetWindowMaximumSize()
|
| 699 |
+
*/
|
| 700 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window,
|
| 701 |
+
int min_w, int min_h);
|
| 702 |
+
|
| 703 |
+
/**
|
| 704 |
+
* \brief Get the minimum size of a window's client area.
|
| 705 |
+
*
|
| 706 |
+
* \param window The window to query.
|
| 707 |
+
* \param w Pointer to variable for storing the minimum width, may be NULL
|
| 708 |
+
* \param h Pointer to variable for storing the minimum height, may be NULL
|
| 709 |
+
*
|
| 710 |
+
* \sa SDL_GetWindowMaximumSize()
|
| 711 |
+
* \sa SDL_SetWindowMinimumSize()
|
| 712 |
+
*/
|
| 713 |
+
extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window,
|
| 714 |
+
int *w, int *h);
|
| 715 |
+
|
| 716 |
+
/**
|
| 717 |
+
* \brief Set the maximum size of a window's client area.
|
| 718 |
+
*
|
| 719 |
+
* \param window The window to set a new maximum size.
|
| 720 |
+
* \param max_w The maximum width of the window, must be >0
|
| 721 |
+
* \param max_h The maximum height of the window, must be >0
|
| 722 |
+
*
|
| 723 |
+
* \note You can't change the maximum size of a fullscreen window, it
|
| 724 |
+
* automatically matches the size of the display mode.
|
| 725 |
+
*
|
| 726 |
+
* \sa SDL_GetWindowMaximumSize()
|
| 727 |
+
* \sa SDL_SetWindowMinimumSize()
|
| 728 |
+
*/
|
| 729 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window,
|
| 730 |
+
int max_w, int max_h);
|
| 731 |
+
|
| 732 |
+
/**
|
| 733 |
+
* \brief Get the maximum size of a window's client area.
|
| 734 |
+
*
|
| 735 |
+
* \param window The window to query.
|
| 736 |
+
* \param w Pointer to variable for storing the maximum width, may be NULL
|
| 737 |
+
* \param h Pointer to variable for storing the maximum height, may be NULL
|
| 738 |
+
*
|
| 739 |
+
* \sa SDL_GetWindowMinimumSize()
|
| 740 |
+
* \sa SDL_SetWindowMaximumSize()
|
| 741 |
+
*/
|
| 742 |
+
extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window,
|
| 743 |
+
int *w, int *h);
|
| 744 |
+
|
| 745 |
+
/**
|
| 746 |
+
* \brief Set the border state of a window.
|
| 747 |
+
*
|
| 748 |
+
* This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
|
| 749 |
+
* add or remove the border from the actual window. This is a no-op if the
|
| 750 |
+
* window's border already matches the requested state.
|
| 751 |
+
*
|
| 752 |
+
* \param window The window of which to change the border state.
|
| 753 |
+
* \param bordered SDL_FALSE to remove border, SDL_TRUE to add border.
|
| 754 |
+
*
|
| 755 |
+
* \note You can't change the border state of a fullscreen window.
|
| 756 |
+
*
|
| 757 |
+
* \sa SDL_GetWindowFlags()
|
| 758 |
+
*/
|
| 759 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window,
|
| 760 |
+
SDL_bool bordered);
|
| 761 |
+
|
| 762 |
+
/**
|
| 763 |
+
* \brief Set the user-resizable state of a window.
|
| 764 |
+
*
|
| 765 |
+
* This will add or remove the window's SDL_WINDOW_RESIZABLE flag and
|
| 766 |
+
* allow/disallow user resizing of the window. This is a no-op if the
|
| 767 |
+
* window's resizable state already matches the requested state.
|
| 768 |
+
*
|
| 769 |
+
* \param window The window of which to change the resizable state.
|
| 770 |
+
* \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow.
|
| 771 |
+
*
|
| 772 |
+
* \note You can't change the resizable state of a fullscreen window.
|
| 773 |
+
*
|
| 774 |
+
* \sa SDL_GetWindowFlags()
|
| 775 |
+
*/
|
| 776 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window,
|
| 777 |
+
SDL_bool resizable);
|
| 778 |
+
|
| 779 |
+
/**
|
| 780 |
+
* \brief Show a window.
|
| 781 |
+
*
|
| 782 |
+
* \sa SDL_HideWindow()
|
| 783 |
+
*/
|
| 784 |
+
extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window);
|
| 785 |
+
|
| 786 |
+
/**
|
| 787 |
+
* \brief Hide a window.
|
| 788 |
+
*
|
| 789 |
+
* \sa SDL_ShowWindow()
|
| 790 |
+
*/
|
| 791 |
+
extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window);
|
| 792 |
+
|
| 793 |
+
/**
|
| 794 |
+
* \brief Raise a window above other windows and set the input focus.
|
| 795 |
+
*/
|
| 796 |
+
extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window);
|
| 797 |
+
|
| 798 |
+
/**
|
| 799 |
+
* \brief Make a window as large as possible.
|
| 800 |
+
*
|
| 801 |
+
* \sa SDL_RestoreWindow()
|
| 802 |
+
*/
|
| 803 |
+
extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window);
|
| 804 |
+
|
| 805 |
+
/**
|
| 806 |
+
* \brief Minimize a window to an iconic representation.
|
| 807 |
+
*
|
| 808 |
+
* \sa SDL_RestoreWindow()
|
| 809 |
+
*/
|
| 810 |
+
extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window);
|
| 811 |
+
|
| 812 |
+
/**
|
| 813 |
+
* \brief Restore the size and position of a minimized or maximized window.
|
| 814 |
+
*
|
| 815 |
+
* \sa SDL_MaximizeWindow()
|
| 816 |
+
* \sa SDL_MinimizeWindow()
|
| 817 |
+
*/
|
| 818 |
+
extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window);
|
| 819 |
+
|
| 820 |
+
/**
|
| 821 |
+
* \brief Set a window's fullscreen state.
|
| 822 |
+
*
|
| 823 |
+
* \return 0 on success, or -1 if setting the display mode failed.
|
| 824 |
+
*
|
| 825 |
+
* \sa SDL_SetWindowDisplayMode()
|
| 826 |
+
* \sa SDL_GetWindowDisplayMode()
|
| 827 |
+
*/
|
| 828 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
|
| 829 |
+
Uint32 flags);
|
| 830 |
+
|
| 831 |
+
/**
|
| 832 |
+
* \brief Get the SDL surface associated with the window.
|
| 833 |
+
*
|
| 834 |
+
* \return The window's framebuffer surface, or NULL on error.
|
| 835 |
+
*
|
| 836 |
+
* A new surface will be created with the optimal format for the window,
|
| 837 |
+
* if necessary. This surface will be freed when the window is destroyed.
|
| 838 |
+
*
|
| 839 |
+
* \note You may not combine this with 3D or the rendering API on this window.
|
| 840 |
+
*
|
| 841 |
+
* \sa SDL_UpdateWindowSurface()
|
| 842 |
+
* \sa SDL_UpdateWindowSurfaceRects()
|
| 843 |
+
*/
|
| 844 |
+
extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window);
|
| 845 |
+
|
| 846 |
+
/**
|
| 847 |
+
* \brief Copy the window surface to the screen.
|
| 848 |
+
*
|
| 849 |
+
* \return 0 on success, or -1 on error.
|
| 850 |
+
*
|
| 851 |
+
* \sa SDL_GetWindowSurface()
|
| 852 |
+
* \sa SDL_UpdateWindowSurfaceRects()
|
| 853 |
+
*/
|
| 854 |
+
extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
|
| 855 |
+
|
| 856 |
+
/**
|
| 857 |
+
* \brief Copy a number of rectangles on the window surface to the screen.
|
| 858 |
+
*
|
| 859 |
+
* \return 0 on success, or -1 on error.
|
| 860 |
+
*
|
| 861 |
+
* \sa SDL_GetWindowSurface()
|
| 862 |
+
* \sa SDL_UpdateWindowSurface()
|
| 863 |
+
*/
|
| 864 |
+
extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
|
| 865 |
+
const SDL_Rect * rects,
|
| 866 |
+
int numrects);
|
| 867 |
+
|
| 868 |
+
/**
|
| 869 |
+
* \brief Set a window's input grab mode.
|
| 870 |
+
*
|
| 871 |
+
* \param window The window for which the input grab mode should be set.
|
| 872 |
+
* \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
|
| 873 |
+
*
|
| 874 |
+
* If the caller enables a grab while another window is currently grabbed,
|
| 875 |
+
* the other window loses its grab in favor of the caller's window.
|
| 876 |
+
*
|
| 877 |
+
* \sa SDL_GetWindowGrab()
|
| 878 |
+
*/
|
| 879 |
+
extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window,
|
| 880 |
+
SDL_bool grabbed);
|
| 881 |
+
|
| 882 |
+
/**
|
| 883 |
+
* \brief Get a window's input grab mode.
|
| 884 |
+
*
|
| 885 |
+
* \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
|
| 886 |
+
*
|
| 887 |
+
* \sa SDL_SetWindowGrab()
|
| 888 |
+
*/
|
| 889 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window);
|
| 890 |
+
|
| 891 |
+
/**
|
| 892 |
+
* \brief Get the window that currently has an input grab enabled.
|
| 893 |
+
*
|
| 894 |
+
* \return This returns the window if input is grabbed, and NULL otherwise.
|
| 895 |
+
*
|
| 896 |
+
* \sa SDL_SetWindowGrab()
|
| 897 |
+
*/
|
| 898 |
+
extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void);
|
| 899 |
+
|
| 900 |
+
/**
|
| 901 |
+
* \brief Set the brightness (gamma correction) for a window.
|
| 902 |
+
*
|
| 903 |
+
* \return 0 on success, or -1 if setting the brightness isn't supported.
|
| 904 |
+
*
|
| 905 |
+
* \sa SDL_GetWindowBrightness()
|
| 906 |
+
* \sa SDL_SetWindowGammaRamp()
|
| 907 |
+
*/
|
| 908 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness);
|
| 909 |
+
|
| 910 |
+
/**
|
| 911 |
+
* \brief Get the brightness (gamma correction) for a window.
|
| 912 |
+
*
|
| 913 |
+
* \return The last brightness value passed to SDL_SetWindowBrightness()
|
| 914 |
+
*
|
| 915 |
+
* \sa SDL_SetWindowBrightness()
|
| 916 |
+
*/
|
| 917 |
+
extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window);
|
| 918 |
+
|
| 919 |
+
/**
|
| 920 |
+
* \brief Set the opacity for a window
|
| 921 |
+
*
|
| 922 |
+
* \param window The window which will be made transparent or opaque
|
| 923 |
+
* \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be
|
| 924 |
+
* clamped internally between 0.0f and 1.0f.
|
| 925 |
+
*
|
| 926 |
+
* \return 0 on success, or -1 if setting the opacity isn't supported.
|
| 927 |
+
*
|
| 928 |
+
* \sa SDL_GetWindowOpacity()
|
| 929 |
+
*/
|
| 930 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity);
|
| 931 |
+
|
| 932 |
+
/**
|
| 933 |
+
* \brief Get the opacity of a window.
|
| 934 |
+
*
|
| 935 |
+
* If transparency isn't supported on this platform, opacity will be reported
|
| 936 |
+
* as 1.0f without error.
|
| 937 |
+
*
|
| 938 |
+
* \param window The window in question.
|
| 939 |
+
* \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque)
|
| 940 |
+
*
|
| 941 |
+
* \return 0 on success, or -1 on error (invalid window, etc).
|
| 942 |
+
*
|
| 943 |
+
* \sa SDL_SetWindowOpacity()
|
| 944 |
+
*/
|
| 945 |
+
extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity);
|
| 946 |
+
|
| 947 |
+
/**
|
| 948 |
+
* \brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name)
|
| 949 |
+
*
|
| 950 |
+
* \param modal_window The window that should be modal
|
| 951 |
+
* \param parent_window The parent window
|
| 952 |
+
*
|
| 953 |
+
* \return 0 on success, or -1 otherwise.
|
| 954 |
+
*/
|
| 955 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window);
|
| 956 |
+
|
| 957 |
+
/**
|
| 958 |
+
* \brief Explicitly sets input focus to the window.
|
| 959 |
+
*
|
| 960 |
+
* You almost certainly want SDL_RaiseWindow() instead of this function. Use
|
| 961 |
+
* this with caution, as you might give focus to a window that's completely
|
| 962 |
+
* obscured by other windows.
|
| 963 |
+
*
|
| 964 |
+
* \param window The window that should get the input focus
|
| 965 |
+
*
|
| 966 |
+
* \return 0 on success, or -1 otherwise.
|
| 967 |
+
* \sa SDL_RaiseWindow()
|
| 968 |
+
*/
|
| 969 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window);
|
| 970 |
+
|
| 971 |
+
/**
|
| 972 |
+
* \brief Set the gamma ramp for a window.
|
| 973 |
+
*
|
| 974 |
+
* \param window The window for which the gamma ramp should be set.
|
| 975 |
+
* \param red The translation table for the red channel, or NULL.
|
| 976 |
+
* \param green The translation table for the green channel, or NULL.
|
| 977 |
+
* \param blue The translation table for the blue channel, or NULL.
|
| 978 |
+
*
|
| 979 |
+
* \return 0 on success, or -1 if gamma ramps are unsupported.
|
| 980 |
+
*
|
| 981 |
+
* Set the gamma translation table for the red, green, and blue channels
|
| 982 |
+
* of the video hardware. Each table is an array of 256 16-bit quantities,
|
| 983 |
+
* representing a mapping between the input and output for that channel.
|
| 984 |
+
* The input is the index into the array, and the output is the 16-bit
|
| 985 |
+
* gamma value at that index, scaled to the output color precision.
|
| 986 |
+
*
|
| 987 |
+
* \sa SDL_GetWindowGammaRamp()
|
| 988 |
+
*/
|
| 989 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window,
|
| 990 |
+
const Uint16 * red,
|
| 991 |
+
const Uint16 * green,
|
| 992 |
+
const Uint16 * blue);
|
| 993 |
+
|
| 994 |
+
/**
|
| 995 |
+
* \brief Get the gamma ramp for a window.
|
| 996 |
+
*
|
| 997 |
+
* \param window The window from which the gamma ramp should be queried.
|
| 998 |
+
* \param red A pointer to a 256 element array of 16-bit quantities to hold
|
| 999 |
+
* the translation table for the red channel, or NULL.
|
| 1000 |
+
* \param green A pointer to a 256 element array of 16-bit quantities to hold
|
| 1001 |
+
* the translation table for the green channel, or NULL.
|
| 1002 |
+
* \param blue A pointer to a 256 element array of 16-bit quantities to hold
|
| 1003 |
+
* the translation table for the blue channel, or NULL.
|
| 1004 |
+
*
|
| 1005 |
+
* \return 0 on success, or -1 if gamma ramps are unsupported.
|
| 1006 |
+
*
|
| 1007 |
+
* \sa SDL_SetWindowGammaRamp()
|
| 1008 |
+
*/
|
| 1009 |
+
extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
|
| 1010 |
+
Uint16 * red,
|
| 1011 |
+
Uint16 * green,
|
| 1012 |
+
Uint16 * blue);
|
| 1013 |
+
|
| 1014 |
+
/**
|
| 1015 |
+
* \brief Possible return values from the SDL_HitTest callback.
|
| 1016 |
+
*
|
| 1017 |
+
* \sa SDL_HitTest
|
| 1018 |
+
*/
|
| 1019 |
+
typedef enum
|
| 1020 |
+
{
|
| 1021 |
+
SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */
|
| 1022 |
+
SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */
|
| 1023 |
+
SDL_HITTEST_RESIZE_TOPLEFT,
|
| 1024 |
+
SDL_HITTEST_RESIZE_TOP,
|
| 1025 |
+
SDL_HITTEST_RESIZE_TOPRIGHT,
|
| 1026 |
+
SDL_HITTEST_RESIZE_RIGHT,
|
| 1027 |
+
SDL_HITTEST_RESIZE_BOTTOMRIGHT,
|
| 1028 |
+
SDL_HITTEST_RESIZE_BOTTOM,
|
| 1029 |
+
SDL_HITTEST_RESIZE_BOTTOMLEFT,
|
| 1030 |
+
SDL_HITTEST_RESIZE_LEFT
|
| 1031 |
+
} SDL_HitTestResult;
|
| 1032 |
+
|
| 1033 |
+
/**
|
| 1034 |
+
* \brief Callback used for hit-testing.
|
| 1035 |
+
*
|
| 1036 |
+
* \sa SDL_SetWindowHitTest
|
| 1037 |
+
*/
|
| 1038 |
+
typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
|
| 1039 |
+
const SDL_Point *area,
|
| 1040 |
+
void *data);
|
| 1041 |
+
|
| 1042 |
+
/**
|
| 1043 |
+
* \brief Provide a callback that decides if a window region has special properties.
|
| 1044 |
+
*
|
| 1045 |
+
* Normally windows are dragged and resized by decorations provided by the
|
| 1046 |
+
* system window manager (a title bar, borders, etc), but for some apps, it
|
| 1047 |
+
* makes sense to drag them from somewhere else inside the window itself; for
|
| 1048 |
+
* example, one might have a borderless window that wants to be draggable
|
| 1049 |
+
* from any part, or simulate its own title bar, etc.
|
| 1050 |
+
*
|
| 1051 |
+
* This function lets the app provide a callback that designates pieces of
|
| 1052 |
+
* a given window as special. This callback is run during event processing
|
| 1053 |
+
* if we need to tell the OS to treat a region of the window specially; the
|
| 1054 |
+
* use of this callback is known as "hit testing."
|
| 1055 |
+
*
|
| 1056 |
+
* Mouse input may not be delivered to your application if it is within
|
| 1057 |
+
* a special area; the OS will often apply that input to moving the window or
|
| 1058 |
+
* resizing the window and not deliver it to the application.
|
| 1059 |
+
*
|
| 1060 |
+
* Specifying NULL for a callback disables hit-testing. Hit-testing is
|
| 1061 |
+
* disabled by default.
|
| 1062 |
+
*
|
| 1063 |
+
* Platforms that don't support this functionality will return -1
|
| 1064 |
+
* unconditionally, even if you're attempting to disable hit-testing.
|
| 1065 |
+
*
|
| 1066 |
+
* Your callback may fire at any time, and its firing does not indicate any
|
| 1067 |
+
* specific behavior (for example, on Windows, this certainly might fire
|
| 1068 |
+
* when the OS is deciding whether to drag your window, but it fires for lots
|
| 1069 |
+
* of other reasons, too, some unrelated to anything you probably care about
|
| 1070 |
+
* _and when the mouse isn't actually at the location it is testing_).
|
| 1071 |
+
* Since this can fire at any time, you should try to keep your callback
|
| 1072 |
+
* efficient, devoid of allocations, etc.
|
| 1073 |
+
*
|
| 1074 |
+
* \param window The window to set hit-testing on.
|
| 1075 |
+
* \param callback The callback to call when doing a hit-test.
|
| 1076 |
+
* \param callback_data An app-defined void pointer passed to the callback.
|
| 1077 |
+
* \return 0 on success, -1 on error (including unsupported).
|
| 1078 |
+
*/
|
| 1079 |
+
extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window,
|
| 1080 |
+
SDL_HitTest callback,
|
| 1081 |
+
void *callback_data);
|
| 1082 |
+
|
| 1083 |
+
/**
|
| 1084 |
+
* \brief Destroy a window.
|
| 1085 |
+
*/
|
| 1086 |
+
extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
|
| 1087 |
+
|
| 1088 |
+
|
| 1089 |
+
/**
|
| 1090 |
+
* \brief Returns whether the screensaver is currently enabled (default off).
|
| 1091 |
+
*
|
| 1092 |
+
* \sa SDL_EnableScreenSaver()
|
| 1093 |
+
* \sa SDL_DisableScreenSaver()
|
| 1094 |
+
*/
|
| 1095 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void);
|
| 1096 |
+
|
| 1097 |
+
/**
|
| 1098 |
+
* \brief Allow the screen to be blanked by a screensaver
|
| 1099 |
+
*
|
| 1100 |
+
* \sa SDL_IsScreenSaverEnabled()
|
| 1101 |
+
* \sa SDL_DisableScreenSaver()
|
| 1102 |
+
*/
|
| 1103 |
+
extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
|
| 1104 |
+
|
| 1105 |
+
/**
|
| 1106 |
+
* \brief Prevent the screen from being blanked by a screensaver
|
| 1107 |
+
*
|
| 1108 |
+
* \sa SDL_IsScreenSaverEnabled()
|
| 1109 |
+
* \sa SDL_EnableScreenSaver()
|
| 1110 |
+
*/
|
| 1111 |
+
extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
|
| 1112 |
+
|
| 1113 |
+
|
| 1114 |
+
/**
|
| 1115 |
+
* \name OpenGL support functions
|
| 1116 |
+
*/
|
| 1117 |
+
/* @{ */
|
| 1118 |
+
|
| 1119 |
+
/**
|
| 1120 |
+
* \brief Dynamically load an OpenGL library.
|
| 1121 |
+
*
|
| 1122 |
+
* \param path The platform dependent OpenGL library name, or NULL to open the
|
| 1123 |
+
* default OpenGL library.
|
| 1124 |
+
*
|
| 1125 |
+
* \return 0 on success, or -1 if the library couldn't be loaded.
|
| 1126 |
+
*
|
| 1127 |
+
* This should be done after initializing the video driver, but before
|
| 1128 |
+
* creating any OpenGL windows. If no OpenGL library is loaded, the default
|
| 1129 |
+
* library will be loaded upon creation of the first OpenGL window.
|
| 1130 |
+
*
|
| 1131 |
+
* \note If you do this, you need to retrieve all of the GL functions used in
|
| 1132 |
+
* your program from the dynamic library using SDL_GL_GetProcAddress().
|
| 1133 |
+
*
|
| 1134 |
+
* \sa SDL_GL_GetProcAddress()
|
| 1135 |
+
* \sa SDL_GL_UnloadLibrary()
|
| 1136 |
+
*/
|
| 1137 |
+
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
|
| 1138 |
+
|
| 1139 |
+
/**
|
| 1140 |
+
* \brief Get the address of an OpenGL function.
|
| 1141 |
+
*/
|
| 1142 |
+
extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
|
| 1143 |
+
|
| 1144 |
+
/**
|
| 1145 |
+
* \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
|
| 1146 |
+
*
|
| 1147 |
+
* \sa SDL_GL_LoadLibrary()
|
| 1148 |
+
*/
|
| 1149 |
+
extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
|
| 1150 |
+
|
| 1151 |
+
/**
|
| 1152 |
+
* \brief Return true if an OpenGL extension is supported for the current
|
| 1153 |
+
* context.
|
| 1154 |
+
*/
|
| 1155 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
|
| 1156 |
+
*extension);
|
| 1157 |
+
|
| 1158 |
+
/**
|
| 1159 |
+
* \brief Reset all previously set OpenGL context attributes to their default values
|
| 1160 |
+
*/
|
| 1161 |
+
extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
|
| 1162 |
+
|
| 1163 |
+
/**
|
| 1164 |
+
* \brief Set an OpenGL window attribute before window creation.
|
| 1165 |
+
*
|
| 1166 |
+
* \return 0 on success, or -1 if the attribute could not be set.
|
| 1167 |
+
*/
|
| 1168 |
+
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
|
| 1169 |
+
|
| 1170 |
+
/**
|
| 1171 |
+
* \brief Get the actual value for an attribute from the current context.
|
| 1172 |
+
*
|
| 1173 |
+
* \return 0 on success, or -1 if the attribute could not be retrieved.
|
| 1174 |
+
* The integer at \c value will be modified in either case.
|
| 1175 |
+
*/
|
| 1176 |
+
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
|
| 1177 |
+
|
| 1178 |
+
/**
|
| 1179 |
+
* \brief Create an OpenGL context for use with an OpenGL window, and make it
|
| 1180 |
+
* current.
|
| 1181 |
+
*
|
| 1182 |
+
* \sa SDL_GL_DeleteContext()
|
| 1183 |
+
*/
|
| 1184 |
+
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *
|
| 1185 |
+
window);
|
| 1186 |
+
|
| 1187 |
+
/**
|
| 1188 |
+
* \brief Set up an OpenGL context for rendering into an OpenGL window.
|
| 1189 |
+
*
|
| 1190 |
+
* \note The context must have been created with a compatible window.
|
| 1191 |
+
*/
|
| 1192 |
+
extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window,
|
| 1193 |
+
SDL_GLContext context);
|
| 1194 |
+
|
| 1195 |
+
/**
|
| 1196 |
+
* \brief Get the currently active OpenGL window.
|
| 1197 |
+
*/
|
| 1198 |
+
extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void);
|
| 1199 |
+
|
| 1200 |
+
/**
|
| 1201 |
+
* \brief Get the currently active OpenGL context.
|
| 1202 |
+
*/
|
| 1203 |
+
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
|
| 1204 |
+
|
| 1205 |
+
/**
|
| 1206 |
+
* \brief Get the size of a window's underlying drawable in pixels (for use
|
| 1207 |
+
* with glViewport).
|
| 1208 |
+
*
|
| 1209 |
+
* \param window Window from which the drawable size should be queried
|
| 1210 |
+
* \param w Pointer to variable for storing the width in pixels, may be NULL
|
| 1211 |
+
* \param h Pointer to variable for storing the height in pixels, may be NULL
|
| 1212 |
+
*
|
| 1213 |
+
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
|
| 1214 |
+
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
|
| 1215 |
+
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
|
| 1216 |
+
* by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
|
| 1217 |
+
*
|
| 1218 |
+
* \sa SDL_GetWindowSize()
|
| 1219 |
+
* \sa SDL_CreateWindow()
|
| 1220 |
+
*/
|
| 1221 |
+
extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
|
| 1222 |
+
int *h);
|
| 1223 |
+
|
| 1224 |
+
/**
|
| 1225 |
+
* \brief Set the swap interval for the current OpenGL context.
|
| 1226 |
+
*
|
| 1227 |
+
* \param interval 0 for immediate updates, 1 for updates synchronized with the
|
| 1228 |
+
* vertical retrace. If the system supports it, you may
|
| 1229 |
+
* specify -1 to allow late swaps to happen immediately
|
| 1230 |
+
* instead of waiting for the next retrace.
|
| 1231 |
+
*
|
| 1232 |
+
* \return 0 on success, or -1 if setting the swap interval is not supported.
|
| 1233 |
+
*
|
| 1234 |
+
* \sa SDL_GL_GetSwapInterval()
|
| 1235 |
+
*/
|
| 1236 |
+
extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
|
| 1237 |
+
|
| 1238 |
+
/**
|
| 1239 |
+
* \brief Get the swap interval for the current OpenGL context.
|
| 1240 |
+
*
|
| 1241 |
+
* \return 0 if there is no vertical retrace synchronization, 1 if the buffer
|
| 1242 |
+
* swap is synchronized with the vertical retrace, and -1 if late
|
| 1243 |
+
* swaps happen immediately instead of waiting for the next retrace.
|
| 1244 |
+
* If the system can't determine the swap interval, or there isn't a
|
| 1245 |
+
* valid current context, this will return 0 as a safe default.
|
| 1246 |
+
*
|
| 1247 |
+
* \sa SDL_GL_SetSwapInterval()
|
| 1248 |
+
*/
|
| 1249 |
+
extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
|
| 1250 |
+
|
| 1251 |
+
/**
|
| 1252 |
+
* \brief Swap the OpenGL buffers for a window, if double-buffering is
|
| 1253 |
+
* supported.
|
| 1254 |
+
*/
|
| 1255 |
+
extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window);
|
| 1256 |
+
|
| 1257 |
+
/**
|
| 1258 |
+
* \brief Delete an OpenGL context.
|
| 1259 |
+
*
|
| 1260 |
+
* \sa SDL_GL_CreateContext()
|
| 1261 |
+
*/
|
| 1262 |
+
extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
|
| 1263 |
+
|
| 1264 |
+
/* @} *//* OpenGL support functions */
|
| 1265 |
+
|
| 1266 |
+
|
| 1267 |
+
/* Ends C function definitions when using C++ */
|
| 1268 |
+
#ifdef __cplusplus
|
| 1269 |
+
}
|
| 1270 |
+
#endif
|
| 1271 |
+
#include "close_code.h"
|
| 1272 |
+
|
| 1273 |
+
#endif /* SDL_video_h_ */
|
| 1274 |
+
|
| 1275 |
+
/* vi: set ts=4 sw=4 expandtab: */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/SDL_vulkan.h
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 2017, Mark Callow
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file SDL_vulkan.h
|
| 24 |
+
*
|
| 25 |
+
* Header file for functions to creating Vulkan surfaces on SDL windows.
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
#ifndef SDL_vulkan_h_
|
| 29 |
+
#define SDL_vulkan_h_
|
| 30 |
+
|
| 31 |
+
#include "SDL_video.h"
|
| 32 |
+
|
| 33 |
+
#include "begin_code.h"
|
| 34 |
+
/* Set up for C function definitions, even when using C++ */
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/* Avoid including vulkan.h, don't define VkInstance if it's already included */
|
| 40 |
+
#ifdef VULKAN_H_
|
| 41 |
+
#define NO_SDL_VULKAN_TYPEDEFS
|
| 42 |
+
#endif
|
| 43 |
+
#ifndef NO_SDL_VULKAN_TYPEDEFS
|
| 44 |
+
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
|
| 45 |
+
|
| 46 |
+
#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
| 47 |
+
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
|
| 48 |
+
#else
|
| 49 |
+
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
|
| 50 |
+
#endif
|
| 51 |
+
|
| 52 |
+
VK_DEFINE_HANDLE(VkInstance)
|
| 53 |
+
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
|
| 54 |
+
|
| 55 |
+
#endif /* !NO_SDL_VULKAN_TYPEDEFS */
|
| 56 |
+
|
| 57 |
+
typedef VkInstance SDL_vulkanInstance;
|
| 58 |
+
typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
|
| 59 |
+
|
| 60 |
+
/**
|
| 61 |
+
* \name Vulkan support functions
|
| 62 |
+
*
|
| 63 |
+
* \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API
|
| 64 |
+
* is compatable with Tizen's implementation of Vulkan in SDL.
|
| 65 |
+
*/
|
| 66 |
+
/* @{ */
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* \brief Dynamically load a Vulkan loader library.
|
| 70 |
+
*
|
| 71 |
+
* \param [in] path The platform dependent Vulkan loader library name, or
|
| 72 |
+
* \c NULL.
|
| 73 |
+
*
|
| 74 |
+
* \return \c 0 on success, or \c -1 if the library couldn't be loaded.
|
| 75 |
+
*
|
| 76 |
+
* If \a path is NULL SDL will use the value of the environment variable
|
| 77 |
+
* \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan
|
| 78 |
+
* loader library.
|
| 79 |
+
*
|
| 80 |
+
* This should be called after initializing the video driver, but before
|
| 81 |
+
* creating any Vulkan windows. If no Vulkan loader library is loaded, the
|
| 82 |
+
* default library will be loaded upon creation of the first Vulkan window.
|
| 83 |
+
*
|
| 84 |
+
* \note It is fairly common for Vulkan applications to link with \a libvulkan
|
| 85 |
+
* instead of explicitly loading it at run time. This will work with
|
| 86 |
+
* SDL provided the application links to a dynamic library and both it
|
| 87 |
+
* and SDL use the same search path.
|
| 88 |
+
*
|
| 89 |
+
* \note If you specify a non-NULL \c path, an application should retrieve all
|
| 90 |
+
* of the Vulkan functions it uses from the dynamic library using
|
| 91 |
+
* \c SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee
|
| 92 |
+
* \c path points to the same vulkan loader library the application
|
| 93 |
+
* linked to.
|
| 94 |
+
*
|
| 95 |
+
* \note On Apple devices, if \a path is NULL, SDL will attempt to find
|
| 96 |
+
* the vkGetInstanceProcAddr address within all the mach-o images of
|
| 97 |
+
* the current process. This is because it is fairly common for Vulkan
|
| 98 |
+
* applications to link with libvulkan (and historically MoltenVK was
|
| 99 |
+
* provided as a static library). If it is not found then, on macOS, SDL
|
| 100 |
+
* will attempt to load \c vulkan.framework/vulkan, \c libvulkan.1.dylib,
|
| 101 |
+
* followed by \c libvulkan.dylib, in that order.
|
| 102 |
+
* On iOS SDL will attempt to load \c libvulkan.dylib only. Applications
|
| 103 |
+
* using a dynamic framework or .dylib must ensure it is included in its
|
| 104 |
+
* application bundle.
|
| 105 |
+
*
|
| 106 |
+
* \note On non-Apple devices, application linking with a static libvulkan is
|
| 107 |
+
* not supported. Either do not link to the Vulkan loader or link to a
|
| 108 |
+
* dynamic library version.
|
| 109 |
+
*
|
| 110 |
+
* \note This function will fail if there are no working Vulkan drivers
|
| 111 |
+
* installed.
|
| 112 |
+
*
|
| 113 |
+
* \sa SDL_Vulkan_GetVkGetInstanceProcAddr()
|
| 114 |
+
* \sa SDL_Vulkan_UnloadLibrary()
|
| 115 |
+
*/
|
| 116 |
+
extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* \brief Get the address of the \c vkGetInstanceProcAddr function.
|
| 120 |
+
*
|
| 121 |
+
* \note This should be called after either calling SDL_Vulkan_LoadLibrary
|
| 122 |
+
* or creating an SDL_Window with the SDL_WINDOW_VULKAN flag.
|
| 123 |
+
*/
|
| 124 |
+
extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
|
| 125 |
+
|
| 126 |
+
/**
|
| 127 |
+
* \brief Unload the Vulkan loader library previously loaded by
|
| 128 |
+
* \c SDL_Vulkan_LoadLibrary().
|
| 129 |
+
*
|
| 130 |
+
* \sa SDL_Vulkan_LoadLibrary()
|
| 131 |
+
*/
|
| 132 |
+
extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* \brief Get the names of the Vulkan instance extensions needed to create
|
| 136 |
+
* a surface with \c SDL_Vulkan_CreateSurface().
|
| 137 |
+
*
|
| 138 |
+
* \param [in] \c NULL or window Window for which the required Vulkan instance
|
| 139 |
+
* extensions should be retrieved
|
| 140 |
+
* \param [in,out] pCount pointer to an \c unsigned related to the number of
|
| 141 |
+
* required Vulkan instance extensions
|
| 142 |
+
* \param [out] pNames \c NULL or a pointer to an array to be filled with the
|
| 143 |
+
* required Vulkan instance extensions
|
| 144 |
+
*
|
| 145 |
+
* \return \c SDL_TRUE on success, \c SDL_FALSE on error.
|
| 146 |
+
*
|
| 147 |
+
* If \a pNames is \c NULL, then the number of required Vulkan instance
|
| 148 |
+
* extensions is returned in pCount. Otherwise, \a pCount must point to a
|
| 149 |
+
* variable set to the number of elements in the \a pNames array, and on
|
| 150 |
+
* return the variable is overwritten with the number of names actually
|
| 151 |
+
* written to \a pNames. If \a pCount is less than the number of required
|
| 152 |
+
* extensions, at most \a pCount structures will be written. If \a pCount
|
| 153 |
+
* is smaller than the number of required extensions, \c SDL_FALSE will be
|
| 154 |
+
* returned instead of \c SDL_TRUE, to indicate that not all the required
|
| 155 |
+
* extensions were returned.
|
| 156 |
+
*
|
| 157 |
+
* \note If \c window is not NULL, it will be checked against its creation
|
| 158 |
+
* flags to ensure that the Vulkan flag is present. This parameter
|
| 159 |
+
* will be removed in a future major release.
|
| 160 |
+
*
|
| 161 |
+
* \note The returned list of extensions will contain \c VK_KHR_surface
|
| 162 |
+
* and zero or more platform specific extensions
|
| 163 |
+
*
|
| 164 |
+
* \note The extension names queried here must be enabled when calling
|
| 165 |
+
* VkCreateInstance, otherwise surface creation will fail.
|
| 166 |
+
*
|
| 167 |
+
* \note \c window should have been created with the \c SDL_WINDOW_VULKAN flag
|
| 168 |
+
* or be \c NULL
|
| 169 |
+
*
|
| 170 |
+
* \code
|
| 171 |
+
* unsigned int count;
|
| 172 |
+
* // get count of required extensions
|
| 173 |
+
* if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, NULL))
|
| 174 |
+
* handle_error();
|
| 175 |
+
*
|
| 176 |
+
* static const char *const additionalExtensions[] =
|
| 177 |
+
* {
|
| 178 |
+
* VK_EXT_DEBUG_REPORT_EXTENSION_NAME, // example additional extension
|
| 179 |
+
* };
|
| 180 |
+
* size_t additionalExtensionsCount = sizeof(additionalExtensions) / sizeof(additionalExtensions[0]);
|
| 181 |
+
* size_t extensionCount = count + additionalExtensionsCount;
|
| 182 |
+
* const char **names = malloc(sizeof(const char *) * extensionCount);
|
| 183 |
+
* if(!names)
|
| 184 |
+
* handle_error();
|
| 185 |
+
*
|
| 186 |
+
* // get names of required extensions
|
| 187 |
+
* if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, names))
|
| 188 |
+
* handle_error();
|
| 189 |
+
*
|
| 190 |
+
* // copy additional extensions after required extensions
|
| 191 |
+
* for(size_t i = 0; i < additionalExtensionsCount; i++)
|
| 192 |
+
* names[i + count] = additionalExtensions[i];
|
| 193 |
+
*
|
| 194 |
+
* VkInstanceCreateInfo instanceCreateInfo = {};
|
| 195 |
+
* instanceCreateInfo.enabledExtensionCount = extensionCount;
|
| 196 |
+
* instanceCreateInfo.ppEnabledExtensionNames = names;
|
| 197 |
+
* // fill in rest of instanceCreateInfo
|
| 198 |
+
*
|
| 199 |
+
* VkInstance instance;
|
| 200 |
+
* // create the Vulkan instance
|
| 201 |
+
* VkResult result = vkCreateInstance(&instanceCreateInfo, NULL, &instance);
|
| 202 |
+
* free(names);
|
| 203 |
+
* \endcode
|
| 204 |
+
*
|
| 205 |
+
* \sa SDL_Vulkan_CreateSurface()
|
| 206 |
+
*/
|
| 207 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(
|
| 208 |
+
SDL_Window *window,
|
| 209 |
+
unsigned int *pCount,
|
| 210 |
+
const char **pNames);
|
| 211 |
+
|
| 212 |
+
/**
|
| 213 |
+
* \brief Create a Vulkan rendering surface for a window.
|
| 214 |
+
*
|
| 215 |
+
* \param [in] window SDL_Window to which to attach the rendering surface.
|
| 216 |
+
* \param [in] instance handle to the Vulkan instance to use.
|
| 217 |
+
* \param [out] surface pointer to a VkSurfaceKHR handle to receive the
|
| 218 |
+
* handle of the newly created surface.
|
| 219 |
+
*
|
| 220 |
+
* \return \c SDL_TRUE on success, \c SDL_FALSE on error.
|
| 221 |
+
*
|
| 222 |
+
* \code
|
| 223 |
+
* VkInstance instance;
|
| 224 |
+
* SDL_Window *window;
|
| 225 |
+
*
|
| 226 |
+
* // create instance and window
|
| 227 |
+
*
|
| 228 |
+
* // create the Vulkan surface
|
| 229 |
+
* VkSurfaceKHR surface;
|
| 230 |
+
* if(!SDL_Vulkan_CreateSurface(window, instance, &surface))
|
| 231 |
+
* handle_error();
|
| 232 |
+
* \endcode
|
| 233 |
+
*
|
| 234 |
+
* \note \a window should have been created with the \c SDL_WINDOW_VULKAN flag.
|
| 235 |
+
*
|
| 236 |
+
* \note \a instance should have been created with the extensions returned
|
| 237 |
+
* by \c SDL_Vulkan_CreateSurface() enabled.
|
| 238 |
+
*
|
| 239 |
+
* \sa SDL_Vulkan_GetInstanceExtensions()
|
| 240 |
+
*/
|
| 241 |
+
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(
|
| 242 |
+
SDL_Window *window,
|
| 243 |
+
VkInstance instance,
|
| 244 |
+
VkSurfaceKHR* surface);
|
| 245 |
+
|
| 246 |
+
/**
|
| 247 |
+
* \brief Get the size of a window's underlying drawable in pixels (for use
|
| 248 |
+
* with setting viewport, scissor & etc).
|
| 249 |
+
*
|
| 250 |
+
* \param window SDL_Window from which the drawable size should be queried
|
| 251 |
+
* \param w Pointer to variable for storing the width in pixels,
|
| 252 |
+
* may be NULL
|
| 253 |
+
* \param h Pointer to variable for storing the height in pixels,
|
| 254 |
+
* may be NULL
|
| 255 |
+
*
|
| 256 |
+
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
|
| 257 |
+
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
|
| 258 |
+
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
|
| 259 |
+
* by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
|
| 260 |
+
*
|
| 261 |
+
* \note On macOS high-DPI support must be enabled for an application by
|
| 262 |
+
* setting NSHighResolutionCapable to true in its Info.plist.
|
| 263 |
+
*
|
| 264 |
+
* \sa SDL_GetWindowSize()
|
| 265 |
+
* \sa SDL_CreateWindow()
|
| 266 |
+
*/
|
| 267 |
+
extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
|
| 268 |
+
int *w, int *h);
|
| 269 |
+
|
| 270 |
+
/* @} *//* Vulkan support functions */
|
| 271 |
+
|
| 272 |
+
/* Ends C function definitions when using C++ */
|
| 273 |
+
#ifdef __cplusplus
|
| 274 |
+
}
|
| 275 |
+
#endif
|
| 276 |
+
#include "close_code.h"
|
| 277 |
+
|
| 278 |
+
#endif /* SDL_vulkan_h_ */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/begin_code.h
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file begin_code.h
|
| 24 |
+
*
|
| 25 |
+
* This file sets things up for C dynamic library function definitions,
|
| 26 |
+
* static inlined functions, and structures aligned at 4-byte alignment.
|
| 27 |
+
* If you don't like ugly C preprocessor code, don't look at this file. :)
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
/* This shouldn't be nested -- included it around code only. */
|
| 31 |
+
#ifdef _begin_code_h
|
| 32 |
+
#error Nested inclusion of begin_code.h
|
| 33 |
+
#endif
|
| 34 |
+
#define _begin_code_h
|
| 35 |
+
|
| 36 |
+
#ifndef SDL_DEPRECATED
|
| 37 |
+
# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
|
| 38 |
+
# define SDL_DEPRECATED __attribute__((deprecated))
|
| 39 |
+
# else
|
| 40 |
+
# define SDL_DEPRECATED
|
| 41 |
+
# endif
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
#ifndef SDL_UNUSED
|
| 45 |
+
# ifdef __GNUC__
|
| 46 |
+
# define SDL_UNUSED __attribute__((unused))
|
| 47 |
+
# else
|
| 48 |
+
# define SDL_UNUSED
|
| 49 |
+
# endif
|
| 50 |
+
#endif
|
| 51 |
+
|
| 52 |
+
/* Some compilers use a special export keyword */
|
| 53 |
+
#ifndef DECLSPEC
|
| 54 |
+
# if defined(__WIN32__) || defined(__WINRT__)
|
| 55 |
+
# ifdef __BORLANDC__
|
| 56 |
+
# ifdef BUILD_SDL
|
| 57 |
+
# define DECLSPEC
|
| 58 |
+
# else
|
| 59 |
+
# define DECLSPEC __declspec(dllimport)
|
| 60 |
+
# endif
|
| 61 |
+
# else
|
| 62 |
+
# define DECLSPEC __declspec(dllexport)
|
| 63 |
+
# endif
|
| 64 |
+
# elif defined(__OS2__)
|
| 65 |
+
# ifdef BUILD_SDL
|
| 66 |
+
# define DECLSPEC __declspec(dllexport)
|
| 67 |
+
# else
|
| 68 |
+
# define DECLSPEC
|
| 69 |
+
# endif
|
| 70 |
+
# else
|
| 71 |
+
# if defined(__GNUC__) && __GNUC__ >= 4
|
| 72 |
+
# define DECLSPEC __attribute__ ((visibility("default")))
|
| 73 |
+
# else
|
| 74 |
+
# define DECLSPEC
|
| 75 |
+
# endif
|
| 76 |
+
# endif
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
/* By default SDL uses the C calling convention */
|
| 80 |
+
#ifndef SDLCALL
|
| 81 |
+
#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
|
| 82 |
+
#define SDLCALL __cdecl
|
| 83 |
+
#elif defined(__OS2__) || defined(__EMX__)
|
| 84 |
+
#define SDLCALL _System
|
| 85 |
+
# if defined (__GNUC__) && !defined(_System)
|
| 86 |
+
# define _System /* for old EMX/GCC compat. */
|
| 87 |
+
# endif
|
| 88 |
+
#else
|
| 89 |
+
#define SDLCALL
|
| 90 |
+
#endif
|
| 91 |
+
#endif /* SDLCALL */
|
| 92 |
+
|
| 93 |
+
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
|
| 94 |
+
#ifdef __SYMBIAN32__
|
| 95 |
+
#undef DECLSPEC
|
| 96 |
+
#define DECLSPEC
|
| 97 |
+
#endif /* __SYMBIAN32__ */
|
| 98 |
+
|
| 99 |
+
/* Force structure packing at 4 byte alignment.
|
| 100 |
+
This is necessary if the header is included in code which has structure
|
| 101 |
+
packing set to an alternate value, say for loading structures from disk.
|
| 102 |
+
The packing is reset to the previous value in close_code.h
|
| 103 |
+
*/
|
| 104 |
+
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
|
| 105 |
+
#ifdef _MSC_VER
|
| 106 |
+
#pragma warning(disable: 4103)
|
| 107 |
+
#endif
|
| 108 |
+
#ifdef __clang__
|
| 109 |
+
#pragma clang diagnostic ignored "-Wpragma-pack"
|
| 110 |
+
#endif
|
| 111 |
+
#ifdef __BORLANDC__
|
| 112 |
+
#pragma nopackwarning
|
| 113 |
+
#endif
|
| 114 |
+
#ifdef _M_X64
|
| 115 |
+
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
|
| 116 |
+
#pragma pack(push,8)
|
| 117 |
+
#else
|
| 118 |
+
#pragma pack(push,4)
|
| 119 |
+
#endif
|
| 120 |
+
#endif /* Compiler needs structure packing set */
|
| 121 |
+
|
| 122 |
+
#ifndef SDL_INLINE
|
| 123 |
+
#if defined(__GNUC__)
|
| 124 |
+
#define SDL_INLINE __inline__
|
| 125 |
+
#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
|
| 126 |
+
defined(__DMC__) || defined(__SC__) || \
|
| 127 |
+
defined(__WATCOMC__) || defined(__LCC__) || \
|
| 128 |
+
defined(__DECC) || defined(__CC_ARM)
|
| 129 |
+
#define SDL_INLINE __inline
|
| 130 |
+
#ifndef __inline__
|
| 131 |
+
#define __inline__ __inline
|
| 132 |
+
#endif
|
| 133 |
+
#else
|
| 134 |
+
#define SDL_INLINE inline
|
| 135 |
+
#ifndef __inline__
|
| 136 |
+
#define __inline__ inline
|
| 137 |
+
#endif
|
| 138 |
+
#endif
|
| 139 |
+
#endif /* SDL_INLINE not defined */
|
| 140 |
+
|
| 141 |
+
#ifndef SDL_FORCE_INLINE
|
| 142 |
+
#if defined(_MSC_VER)
|
| 143 |
+
#define SDL_FORCE_INLINE __forceinline
|
| 144 |
+
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
|
| 145 |
+
#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
|
| 146 |
+
#else
|
| 147 |
+
#define SDL_FORCE_INLINE static SDL_INLINE
|
| 148 |
+
#endif
|
| 149 |
+
#endif /* SDL_FORCE_INLINE not defined */
|
| 150 |
+
|
| 151 |
+
#ifndef SDL_NORETURN
|
| 152 |
+
#if defined(__GNUC__)
|
| 153 |
+
#define SDL_NORETURN __attribute__((noreturn))
|
| 154 |
+
#elif defined(_MSC_VER)
|
| 155 |
+
#define SDL_NORETURN __declspec(noreturn)
|
| 156 |
+
#else
|
| 157 |
+
#define SDL_NORETURN
|
| 158 |
+
#endif
|
| 159 |
+
#endif /* SDL_NORETURN not defined */
|
| 160 |
+
|
| 161 |
+
/* Apparently this is needed by several Windows compilers */
|
| 162 |
+
#if !defined(__MACH__)
|
| 163 |
+
#ifndef NULL
|
| 164 |
+
#ifdef __cplusplus
|
| 165 |
+
#define NULL 0
|
| 166 |
+
#else
|
| 167 |
+
#define NULL ((void *)0)
|
| 168 |
+
#endif
|
| 169 |
+
#endif /* NULL */
|
| 170 |
+
#endif /* ! Mac OS X - breaks precompiled headers */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/SDL2/include/SDL2/close_code.h
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Simple DirectMedia Layer
|
| 3 |
+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
| 4 |
+
|
| 5 |
+
This software is provided 'as-is', without any express or implied
|
| 6 |
+
warranty. In no event will the authors be held liable for any damages
|
| 7 |
+
arising from the use of this software.
|
| 8 |
+
|
| 9 |
+
Permission is granted to anyone to use this software for any purpose,
|
| 10 |
+
including commercial applications, and to alter it and redistribute it
|
| 11 |
+
freely, subject to the following restrictions:
|
| 12 |
+
|
| 13 |
+
1. The origin of this software must not be misrepresented; you must not
|
| 14 |
+
claim that you wrote the original software. If you use this software
|
| 15 |
+
in a product, an acknowledgment in the product documentation would be
|
| 16 |
+
appreciated but is not required.
|
| 17 |
+
2. Altered source versions must be plainly marked as such, and must not be
|
| 18 |
+
misrepresented as being the original software.
|
| 19 |
+
3. This notice may not be removed or altered from any source distribution.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* \file close_code.h
|
| 24 |
+
*
|
| 25 |
+
* This file reverses the effects of begin_code.h and should be included
|
| 26 |
+
* after you finish any function and structure declarations in your headers
|
| 27 |
+
*/
|
| 28 |
+
|
| 29 |
+
#ifndef _begin_code_h
|
| 30 |
+
#error close_code.h included without matching begin_code.h
|
| 31 |
+
#endif
|
| 32 |
+
#undef _begin_code_h
|
| 33 |
+
|
| 34 |
+
/* Reset structure packing at previous byte alignment */
|
| 35 |
+
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
|
| 36 |
+
#ifdef __BORLANDC__
|
| 37 |
+
#pragma nopackwarning
|
| 38 |
+
#endif
|
| 39 |
+
#pragma pack(pop)
|
| 40 |
+
#endif /* Compiler needs structure packing set */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/decoder.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2023 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#pragma once
|
| 11 |
+
|
| 12 |
+
#ifdef __cplusplus
|
| 13 |
+
extern "C" {
|
| 14 |
+
#endif
|
| 15 |
+
#include "wels/codec_api.h"
|
| 16 |
+
#include "wels/codec_def.h"
|
| 17 |
+
#include <stdint.h>
|
| 18 |
+
#include <stddef.h>
|
| 19 |
+
|
| 20 |
+
void Yuv420p2Rgb565(uint16_t *dst, uint8_t *yp, uint8_t *up, uint8_t*vp, size_t width, size_t height);
|
| 21 |
+
int OpenH264_Init(void);
|
| 22 |
+
int OpenH264_Decode(const unsigned char* pSrc, const int iSrcLen, unsigned char** ppDst, SBufferInfo* pDstInfo);
|
| 23 |
+
void OpenH264_GetOption(void* pOption);
|
| 24 |
+
void OpenH264_FlashFrame(unsigned char** ppDst, SBufferInfo* pDstInfo);
|
| 25 |
+
void OpenH264_Uninit(void);
|
| 26 |
+
#ifdef __cplusplus
|
| 27 |
+
}
|
| 28 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/connect_utils.c
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#include <stdio.h>
|
| 11 |
+
#include <time.h>
|
| 12 |
+
#include <pthread.h>
|
| 13 |
+
#include "connect_utils.h"
|
| 14 |
+
#include "freemaster_client.h"
|
| 15 |
+
|
| 16 |
+
#define BUFFER_SIZE 128*1024
|
| 17 |
+
#define RECV_RETRY_COUNT 40
|
| 18 |
+
#define RECV_RETRY_INTERVAL 25 /*ns*/
|
| 19 |
+
|
| 20 |
+
#if LV_USE_FREEMASTER
|
| 21 |
+
extern pthread_mutex_t jsonrpc_mutex;
|
| 22 |
+
|
| 23 |
+
/*define the result struct.*/
|
| 24 |
+
struct write_result {
|
| 25 |
+
char *data;
|
| 26 |
+
int pos;
|
| 27 |
+
};
|
| 28 |
+
|
| 29 |
+
/* show websocket error message*/
|
| 30 |
+
void websocket_error(CURLcode res, char *message)
|
| 31 |
+
{
|
| 32 |
+
size_t len = 0;
|
| 33 |
+
if (message != NULL) len = strlen(message);
|
| 34 |
+
fprintf(stderr, "FreeMASTER: (%d) ", res);
|
| 35 |
+
if(len) {
|
| 36 |
+
fprintf(stderr, "%s%s", message,
|
| 37 |
+
((message[len - 1] != '\n') ? "\n" : ""));
|
| 38 |
+
} else {
|
| 39 |
+
fprintf(stderr, "%s\n", curl_easy_strerror(res));
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/* init and connect the websocket instance*/
|
| 44 |
+
CURL * websocket_connect(const char *ws_url)
|
| 45 |
+
{
|
| 46 |
+
CURL *ws_curl;
|
| 47 |
+
CURLcode res;
|
| 48 |
+
#ifdef DEBUG
|
| 49 |
+
fprintf(stdout, "\nInit curl connection to %s\n", ws_url);
|
| 50 |
+
#endif
|
| 51 |
+
ws_curl = curl_easy_init();
|
| 52 |
+
if (ws_curl == NULL)
|
| 53 |
+
{
|
| 54 |
+
fprintf(stderr, "ERROR: Failed to start a curl session.\n");
|
| 55 |
+
message_display("ERROR: Failed to start a curl session.\n");
|
| 56 |
+
return NULL;
|
| 57 |
+
}
|
| 58 |
+
/*set the ws link address`*/
|
| 59 |
+
curl_easy_setopt(ws_curl, CURLOPT_URL, ws_url);
|
| 60 |
+
/*set the websocket option: stop when connected to target server*/
|
| 61 |
+
curl_easy_setopt(ws_curl, CURLOPT_CONNECT_ONLY, 2L);
|
| 62 |
+
/* Perform the request, res will get the return code */
|
| 63 |
+
res = curl_easy_perform(ws_curl);
|
| 64 |
+
if (res != CURLE_OK)
|
| 65 |
+
{
|
| 66 |
+
websocket_error(res, NULL);
|
| 67 |
+
curl_easy_cleanup(ws_curl);
|
| 68 |
+
return NULL;
|
| 69 |
+
}
|
| 70 |
+
return ws_curl;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
/* close the connection */
|
| 75 |
+
void websocket_close(CURL *ws_curl)
|
| 76 |
+
{
|
| 77 |
+
size_t sent;
|
| 78 |
+
(void)curl_ws_send(ws_curl, "", 0, &sent, 0, CURLWS_CLOSE);
|
| 79 |
+
/* always cleanup */
|
| 80 |
+
curl_easy_cleanup(ws_curl);
|
| 81 |
+
return;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/*send and got the receive*/
|
| 85 |
+
char *websocket_request(CURL *ws_curl, char *params)
|
| 86 |
+
{
|
| 87 |
+
static uint32_t id = 1;
|
| 88 |
+
const struct curl_ws_frame *meta;
|
| 89 |
+
size_t send, rlen;
|
| 90 |
+
char recv_buffer[BUFFER_SIZE];
|
| 91 |
+
CURLcode res;
|
| 92 |
+
if (ws_curl == NULL)
|
| 93 |
+
{
|
| 94 |
+
websocket_error(CURLE_COULDNT_CONNECT, NULL);
|
| 95 |
+
connect_init();
|
| 96 |
+
return NULL;
|
| 97 |
+
}
|
| 98 |
+
pthread_mutex_lock(&jsonrpc_mutex);
|
| 99 |
+
char request_head[50];
|
| 100 |
+
snprintf(request_head, 50, "\"jsonrpc\":\"2.0\",\"id\":\"%d\"", id);
|
| 101 |
+
char request_data[500];
|
| 102 |
+
snprintf(request_data, 500, "{%s, %s}", request_head, params);
|
| 103 |
+
id++;
|
| 104 |
+
if (id == UINT_MAX) {
|
| 105 |
+
id = 1;
|
| 106 |
+
}
|
| 107 |
+
pthread_mutex_unlock(&jsonrpc_mutex);
|
| 108 |
+
#ifdef DEBUG
|
| 109 |
+
fprintf(stdout, "Sending request: %s\n", request_data);
|
| 110 |
+
#endif
|
| 111 |
+
res = curl_ws_send(ws_curl, request_data, strlen(request_data), &send, 0, CURLWS_TEXT);
|
| 112 |
+
if (res != CURLE_OK)
|
| 113 |
+
{
|
| 114 |
+
websocket_error(res, NULL);
|
| 115 |
+
curl_easy_cleanup(ws_curl);
|
| 116 |
+
connect_init();
|
| 117 |
+
return NULL;
|
| 118 |
+
}
|
| 119 |
+
/* retry until ws server is ready*/
|
| 120 |
+
bool timeout = false;
|
| 121 |
+
int count = 1;
|
| 122 |
+
while (count < RECV_RETRY_COUNT) {
|
| 123 |
+
#ifdef DEBUG
|
| 124 |
+
fprintf(stdout, "Receiving response, try %d times.\n", count);
|
| 125 |
+
#endif
|
| 126 |
+
res = curl_ws_recv(ws_curl, recv_buffer, sizeof(recv_buffer), &rlen, &meta);
|
| 127 |
+
if (res == CURLE_OK) {
|
| 128 |
+
/*receive successfully*/
|
| 129 |
+
if (strstr(recv_buffer, request_head) != NULL) {
|
| 130 |
+
/*jsonrpc response has correct head*/
|
| 131 |
+
break;
|
| 132 |
+
}
|
| 133 |
+
} else if (res != CURLE_AGAIN) {
|
| 134 |
+
/*an error occurred, but no signal to retry again*/
|
| 135 |
+
break;
|
| 136 |
+
}
|
| 137 |
+
gg_nanosleep(RECV_RETRY_INTERVAL);
|
| 138 |
+
count++;
|
| 139 |
+
if (count == RECV_RETRY_COUNT) timeout = true;
|
| 140 |
+
};
|
| 141 |
+
/*an error occurred, no data*/
|
| 142 |
+
if (res != CURLE_OK)
|
| 143 |
+
{
|
| 144 |
+
websocket_error(res, NULL);
|
| 145 |
+
if (res != CURLE_AGAIN)
|
| 146 |
+
{
|
| 147 |
+
curl_easy_cleanup(ws_curl);
|
| 148 |
+
connect_init();
|
| 149 |
+
}
|
| 150 |
+
return NULL;
|
| 151 |
+
}
|
| 152 |
+
/*timeout, no data*/
|
| 153 |
+
if (timeout) return NULL;
|
| 154 |
+
|
| 155 |
+
char *data = malloc(BUFFER_SIZE);
|
| 156 |
+
if (data == NULL)
|
| 157 |
+
{
|
| 158 |
+
fprintf(stderr, "\nERROR: Failed to alloc memory.\n");
|
| 159 |
+
return NULL;
|
| 160 |
+
}
|
| 161 |
+
//memset(data, 0, BUFFER_SIZE);
|
| 162 |
+
strncpy(data, recv_buffer, rlen);
|
| 163 |
+
data[rlen] = '\0';
|
| 164 |
+
return data;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
/* Define the function how to write http response.*/
|
| 168 |
+
static size_t write_response(void *ptr, size_t size, size_t nmemb, void *stream) {
|
| 169 |
+
struct write_result *result = (struct write_result *)stream;
|
| 170 |
+
if (result->pos + size * nmemb >= BUFFER_SIZE - 1) {
|
| 171 |
+
fprintf(stderr, "error: too small buffer\n");
|
| 172 |
+
return 0;
|
| 173 |
+
}
|
| 174 |
+
memcpy(result->data + result->pos, ptr, size * nmemb);
|
| 175 |
+
result->pos += size * nmemb;
|
| 176 |
+
return size * nmemb;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
char *http_request(const char *url, const char *params)
|
| 180 |
+
{
|
| 181 |
+
long code;
|
| 182 |
+
char *data = NULL;
|
| 183 |
+
struct curl_slist *headers = NULL;
|
| 184 |
+
CURL *http_curl = NULL;
|
| 185 |
+
CURLcode res_code;
|
| 186 |
+
/*init the curl request instance.*/
|
| 187 |
+
curl_global_init(CURL_GLOBAL_ALL);
|
| 188 |
+
http_curl = curl_easy_init();
|
| 189 |
+
if(http_curl){
|
| 190 |
+
data = malloc(BUFFER_SIZE);
|
| 191 |
+
struct write_result write_result = {.data = data, .pos = 0};
|
| 192 |
+
/* define the http request headers */
|
| 193 |
+
headers = curl_slist_append(headers, "content-type: application/json;");
|
| 194 |
+
/*define the type of the http request.*/
|
| 195 |
+
curl_easy_setopt(http_curl, CURLOPT_POST, 1);
|
| 196 |
+
/*define the URL to visit.*/
|
| 197 |
+
curl_easy_setopt(http_curl, CURLOPT_URL, url);
|
| 198 |
+
/*define the request header.*/
|
| 199 |
+
curl_easy_setopt(http_curl, CURLOPT_HTTPHEADER, headers);
|
| 200 |
+
/*set the http post data.*/
|
| 201 |
+
curl_easy_setopt(http_curl, CURLOPT_POSTFIELDS, params);
|
| 202 |
+
curl_easy_setopt(http_curl, CURLOPT_POSTFIELDSIZE, (long)strlen(params));
|
| 203 |
+
/*use the defined function to save the return data.*/
|
| 204 |
+
curl_easy_setopt(http_curl, CURLOPT_WRITEFUNCTION, write_response);
|
| 205 |
+
/*define the write result data.*/
|
| 206 |
+
curl_easy_setopt(http_curl, CURLOPT_WRITEDATA, &write_result);
|
| 207 |
+
|
| 208 |
+
/* Perform the request, res will get the return code */
|
| 209 |
+
res_code = curl_easy_perform(http_curl);
|
| 210 |
+
if(res_code) {
|
| 211 |
+
fprintf(stderr, "error: unable to request data from %s:\n", url);
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
/* check the http response status code. */
|
| 215 |
+
curl_easy_getinfo(http_curl, CURLINFO_RESPONSE_CODE, &code);
|
| 216 |
+
if(res_code != 200){
|
| 217 |
+
fprintf(stderr, "error: server responded with code %ld\n", code);
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
/* close the http request and free the http_curl.*/
|
| 221 |
+
curl_easy_cleanup(http_curl);
|
| 222 |
+
curl_slist_free_all(headers);
|
| 223 |
+
curl_global_cleanup();
|
| 224 |
+
|
| 225 |
+
/* zero-terminate the result */
|
| 226 |
+
data[write_result.pos] = '\0';
|
| 227 |
+
return data;
|
| 228 |
+
}
|
| 229 |
+
return 0;
|
| 230 |
+
}
|
| 231 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/connect_utils.h
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef CONNECT_UTILS_H
|
| 11 |
+
#define CONNECT_UTILS_H
|
| 12 |
+
|
| 13 |
+
#include <curl/curl.h>
|
| 14 |
+
|
| 15 |
+
/*
|
| 16 |
+
* @param {char*} ws_url: websocket link eg: ws://127.0.0.1:41000.
|
| 17 |
+
* @returns {CURL* } the pointer of the curl connection.
|
| 18 |
+
*/
|
| 19 |
+
CURL * websocket_connect(const char *ws_url);
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* @param {CURL *} ws_curl: the pointer of the curl connection.
|
| 23 |
+
* @param {char *} parm: the request data with json string.
|
| 24 |
+
* @returns {char *} the websocket response data with json string.
|
| 25 |
+
*/
|
| 26 |
+
char *websocket_request(CURL *ws_curl, char *parm);
|
| 27 |
+
|
| 28 |
+
/*
|
| 29 |
+
* for close the websocket connection.
|
| 30 |
+
* @param {CURL *} ws_curl: the pointer of the curl connection.
|
| 31 |
+
*/
|
| 32 |
+
void websocket_close(CURL *ws_curl);
|
| 33 |
+
|
| 34 |
+
/*
|
| 35 |
+
* for http request function.
|
| 36 |
+
* @param {const char *} url: http link eg: http://127.0.0.1:41000.
|
| 37 |
+
* @param {const char *} parm: http post request parameters.
|
| 38 |
+
*/
|
| 39 |
+
char *http_request(const char *url, const char *parm);
|
| 40 |
+
|
| 41 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/freemaster_client.c
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#include <time.h>
|
| 11 |
+
#include <errno.h>
|
| 12 |
+
#include "freemaster_client.h"
|
| 13 |
+
|
| 14 |
+
#if LV_USE_FREEMASTER
|
| 15 |
+
#include "external_data_init.h"
|
| 16 |
+
CURL *ws_connect;
|
| 17 |
+
lv_obj_t * gg_msgbox = NULL;
|
| 18 |
+
extern pthread_mutex_t lvgl_mutex;
|
| 19 |
+
|
| 20 |
+
void connect_init()
|
| 21 |
+
{
|
| 22 |
+
ws_connect = websocket_connect(FREEMASTER_SERVER);
|
| 23 |
+
return;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
bool equal_to_double_max(double a)
|
| 27 |
+
{
|
| 28 |
+
return abs(DBL_MAX - fabs(a)) < 0.000001;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
void freeMasterParse(void *param)
|
| 32 |
+
{
|
| 33 |
+
char result[20];
|
| 34 |
+
if (strcmp(((readVariableParm *)param)->apiName, "ReadVariable") == 0)
|
| 35 |
+
{
|
| 36 |
+
readVariableParm *user_parm = param;
|
| 37 |
+
double dataArray[user_parm->arrayLen];
|
| 38 |
+
read_variable(user_parm->varArray, user_parm->arrayLen, dataArray);
|
| 39 |
+
/* use timedlock to avoid dead loop when there is screen transition event*/
|
| 40 |
+
struct timespec timeout = { 0, LV_DISP_DEF_REFR_PERIOD * 1000 * 1000 };
|
| 41 |
+
int err = pthread_mutex_timedlock(&lvgl_mutex, &timeout);
|
| 42 |
+
if (0 != err) return;
|
| 43 |
+
/* display the extern data according to widget type. */
|
| 44 |
+
switch (user_parm->widget_type)
|
| 45 |
+
{
|
| 46 |
+
case GG_LABEL:
|
| 47 |
+
{
|
| 48 |
+
if (equal_to_double_max(dataArray[0])) break;
|
| 49 |
+
if (strcmp(user_parm->varArray[0].varType, "Fixed point number") == 0) {
|
| 50 |
+
//itoa(dataArray[0], result, 10);
|
| 51 |
+
sprintf(result, "%d", (int)dataArray[0]);
|
| 52 |
+
} else if (strcmp(user_parm->varArray[0].varType, "IEEE floating point") == 0) {
|
| 53 |
+
sprintf(result, "%.2lf", (double)dataArray[0]);
|
| 54 |
+
} else {
|
| 55 |
+
break;
|
| 56 |
+
}
|
| 57 |
+
lv_label_set_text(user_parm->parentObj, result);
|
| 58 |
+
break;
|
| 59 |
+
}
|
| 60 |
+
case GG_CHART:
|
| 61 |
+
{
|
| 62 |
+
lv_chart_series_t *childObj = NULL;
|
| 63 |
+
for (int i = 0; i < user_parm->arrayLen; i++) {
|
| 64 |
+
if (equal_to_double_max(dataArray[i])) continue;
|
| 65 |
+
childObj = (user_parm->childObjArray)[i];
|
| 66 |
+
lv_chart_set_next_value(user_parm->parentObj, childObj, (int)dataArray[i]);
|
| 67 |
+
}
|
| 68 |
+
lv_chart_refresh(user_parm->parentObj);
|
| 69 |
+
break;
|
| 70 |
+
}
|
| 71 |
+
case GG_BAR:
|
| 72 |
+
{
|
| 73 |
+
if (equal_to_double_max(dataArray[0])) break;
|
| 74 |
+
lv_bar_set_value(user_parm->parentObj, (int)dataArray[0], LV_ANIM_OFF);
|
| 75 |
+
break;
|
| 76 |
+
}
|
| 77 |
+
case GG_METER:
|
| 78 |
+
{
|
| 79 |
+
lv_meter_indicator_t *childObj = NULL;
|
| 80 |
+
for (int i = 0; i < user_parm->arrayLen; i++) {
|
| 81 |
+
if (equal_to_double_max(dataArray[i])) continue;
|
| 82 |
+
childObj = (user_parm->childObjArray)[i];
|
| 83 |
+
lv_meter_set_indicator_value(user_parm->parentObj, childObj, (int)dataArray[i]);
|
| 84 |
+
}
|
| 85 |
+
break;
|
| 86 |
+
}
|
| 87 |
+
case GG_ARC:
|
| 88 |
+
{
|
| 89 |
+
if (equal_to_double_max(dataArray[0])) break;
|
| 90 |
+
lv_arc_set_value(user_parm->parentObj, (int)dataArray[0]);
|
| 91 |
+
break;
|
| 92 |
+
}
|
| 93 |
+
case GG_SLIDER:
|
| 94 |
+
{
|
| 95 |
+
if (equal_to_double_max(dataArray[0])) break;
|
| 96 |
+
lv_slider_set_value(user_parm->parentObj, (int)dataArray[0], LV_ANIM_OFF);
|
| 97 |
+
break;
|
| 98 |
+
}
|
| 99 |
+
case GG_SWITCH:
|
| 100 |
+
{
|
| 101 |
+
if (equal_to_double_max(dataArray[0])) break;
|
| 102 |
+
if((int)dataArray[0] == 0 && lv_obj_has_state(user_parm->parentObj, LV_STATE_CHECKED)) {
|
| 103 |
+
lv_obj_clear_state(user_parm->parentObj, LV_STATE_CHECKED);
|
| 104 |
+
}
|
| 105 |
+
if((int)dataArray[0] == 1 && !lv_obj_has_state(user_parm->parentObj, LV_STATE_CHECKED)) {
|
| 106 |
+
lv_obj_add_state(user_parm->parentObj, LV_STATE_CHECKED);
|
| 107 |
+
}
|
| 108 |
+
break;
|
| 109 |
+
}
|
| 110 |
+
default:
|
| 111 |
+
break;
|
| 112 |
+
}
|
| 113 |
+
pthread_mutex_unlock(&lvgl_mutex);
|
| 114 |
+
}
|
| 115 |
+
return;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
void message_display(char *message)
|
| 119 |
+
{
|
| 120 |
+
if(gg_msgbox == NULL || !lv_obj_is_valid(gg_msgbox)) {
|
| 121 |
+
static const char * btns[] = {""};
|
| 122 |
+
gg_msgbox = lv_msgbox_create(lv_layer_top(), "Error", message, btns, true);
|
| 123 |
+
lv_obj_center(gg_msgbox);
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
json_t * callAPI(char *params, char* method_name)
|
| 128 |
+
{
|
| 129 |
+
char request_data[500];
|
| 130 |
+
json_error_t error;
|
| 131 |
+
json_t *json_obj;
|
| 132 |
+
|
| 133 |
+
/* try to connect*/
|
| 134 |
+
if (ws_connect == NULL) {
|
| 135 |
+
connect_init();
|
| 136 |
+
}
|
| 137 |
+
if (ws_connect == NULL) {
|
| 138 |
+
message_display("websocket connect failed.");
|
| 139 |
+
return NULL;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
/* format the request data */
|
| 143 |
+
snprintf(request_data, 500, "\"method\": \"%s\", \"params\": [%s]", method_name, params);
|
| 144 |
+
/* get the json data from FreeMaster server JSONRPC with websocket.*/
|
| 145 |
+
char * origin_response = websocket_request(ws_connect, request_data);
|
| 146 |
+
if (origin_response == NULL)
|
| 147 |
+
{
|
| 148 |
+
fprintf(stderr, "No data returned from jsonrpc server.\n");
|
| 149 |
+
message_display("No data returned from jsonrpc server.\n");
|
| 150 |
+
return NULL;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
#ifdef DEBUG
|
| 154 |
+
fprintf(stdout, "Decoding json: %s\n", origin_response);
|
| 155 |
+
#endif
|
| 156 |
+
|
| 157 |
+
json_obj = json_loads(origin_response, 0, &error);
|
| 158 |
+
free(origin_response);
|
| 159 |
+
if (json_obj == NULL)
|
| 160 |
+
{
|
| 161 |
+
fprintf(stderr, "Failed to decode json: %s\n", error.text);
|
| 162 |
+
return NULL;
|
| 163 |
+
}
|
| 164 |
+
return json_obj;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
void read_variable(fm_var * varArray, int arrayLen, double* dataArray) {
|
| 168 |
+
json_t *result_json;
|
| 169 |
+
char rpcParams[50];
|
| 170 |
+
for (int i = 0; i < arrayLen; i++)
|
| 171 |
+
{
|
| 172 |
+
char *variable_name = varArray[i].varName;
|
| 173 |
+
snprintf(rpcParams, 50, "\"%s\"", variable_name);
|
| 174 |
+
result_json = callAPI(rpcParams, "ReadVariable");
|
| 175 |
+
if (result_json == NULL) {
|
| 176 |
+
dataArray[i] = DBL_MAX;
|
| 177 |
+
continue;
|
| 178 |
+
}
|
| 179 |
+
int success = 0, retval = 0, errorCode = 0;
|
| 180 |
+
double data = DBL_MAX;
|
| 181 |
+
char *id, *dataFormatted, *errorMessage;
|
| 182 |
+
json_error_t error;
|
| 183 |
+
int res = json_unpack_ex(result_json, &error, 0, "{s:s, s:{s:b, s?F, s:{s:b, s?:s}, s?{s:i, s:s}}}",
|
| 184 |
+
"id", &id, "result", "success", &success, "data", &data,
|
| 185 |
+
"xtra", "retval", &retval, "formatted", &dataFormatted,
|
| 186 |
+
"error", "code", &errorCode, "msg", &errorMessage);
|
| 187 |
+
if (res == -1) {
|
| 188 |
+
fprintf(stderr, "Failed to parse json: %s\n", error.text);
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
if (!success) {
|
| 192 |
+
fprintf(stderr, "%s\n", errorMessage);
|
| 193 |
+
message_display(errorMessage);
|
| 194 |
+
continue;
|
| 195 |
+
}
|
| 196 |
+
if (strcmp(varArray[i].varType, "Fixed point number") == 0) {
|
| 197 |
+
dataArray[i] = (double)atoi(dataFormatted);
|
| 198 |
+
} else if (strcmp(varArray[i].varType, "IEEE floating point") == 0) {
|
| 199 |
+
dataArray[i] = (double)data;
|
| 200 |
+
}
|
| 201 |
+
json_decref(result_json);
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
void write_variable(char *varName, int value) {
|
| 206 |
+
json_t *result_json;
|
| 207 |
+
char rpcParams[50];
|
| 208 |
+
snprintf(rpcParams, 50, "\"%s\", %d", varName, value);
|
| 209 |
+
callAPI(rpcParams, "WriteVariable");
|
| 210 |
+
return;
|
| 211 |
+
}
|
| 212 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/freemaster/freemaster_client.h
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef FREEMASTER_CLIENT_H
|
| 11 |
+
#define FREEMASTER_CLIENT_H
|
| 12 |
+
|
| 13 |
+
#include <stdlib.h>
|
| 14 |
+
#include <float.h>
|
| 15 |
+
#include <math.h>
|
| 16 |
+
#include <jansson.h>
|
| 17 |
+
#include "connect_utils.h"
|
| 18 |
+
#include "lvgl.h"
|
| 19 |
+
#include "gg_external_data.h"
|
| 20 |
+
#include <pthread.h>
|
| 21 |
+
|
| 22 |
+
typedef struct {
|
| 23 |
+
char * varName;
|
| 24 |
+
char * varType;
|
| 25 |
+
} fm_var;
|
| 26 |
+
|
| 27 |
+
typedef struct {
|
| 28 |
+
lv_obj_t *screen;
|
| 29 |
+
lv_obj_t *parentObj;
|
| 30 |
+
fm_var * varArray;
|
| 31 |
+
void ** childObjArray;
|
| 32 |
+
int arrayLen;
|
| 33 |
+
int widget_type;
|
| 34 |
+
char *apiName;
|
| 35 |
+
} readVariableParm;
|
| 36 |
+
|
| 37 |
+
/*
|
| 38 |
+
* FreeMaster JSONRPC response data example :
|
| 39 |
+
* {"jsonrpc": "2.0", "id": "1", "result": {"success": true, "xtra": {"retval": true}, "data": 14}}
|
| 40 |
+
*/
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
/*
|
| 44 |
+
* for connect the websocket server.
|
| 45 |
+
*/
|
| 46 |
+
void connect_init();
|
| 47 |
+
|
| 48 |
+
/*
|
| 49 |
+
* @param {char} params eg: [ "counter", 1].
|
| 50 |
+
* @param {char} method_name FreeMaster JSONRPC api name.
|
| 51 |
+
* @returns {api_result* } the pointer of the type ap_result.
|
| 52 |
+
*/
|
| 53 |
+
json_t * callAPI(char *params, char* method_name);
|
| 54 |
+
|
| 55 |
+
void freeMasterParse(void *params);
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* Show the freeMaster except info based on the LVGL msgbox widget.
|
| 59 |
+
* @param {char*} params For show the message box info.
|
| 60 |
+
*/
|
| 61 |
+
void message_display(char *message);
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* @param {char **} variable_name the binding variable name array.
|
| 65 |
+
* @returns {int *} Array of data, In case of success, the result array will contain data property of type number representing the read value.
|
| 66 |
+
*/
|
| 67 |
+
void read_variable(fm_var * varArray, int arrayLen, double* dataArray);
|
| 68 |
+
|
| 69 |
+
/*
|
| 70 |
+
* @param {char} variable_name the binding variable name.
|
| 71 |
+
* @param {int} value Value to be written.
|
| 72 |
+
*/
|
| 73 |
+
void write_variable(char *varName, int value);
|
| 74 |
+
|
| 75 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/gg_external_data.c
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
/*********************
|
| 10 |
+
* INCLUDES
|
| 11 |
+
*********************/
|
| 12 |
+
|
| 13 |
+
#include <time.h>
|
| 14 |
+
#include <stdio.h>
|
| 15 |
+
#include <stdlib.h>
|
| 16 |
+
#include "lv_ll.h"
|
| 17 |
+
#include "gg_external_data.h"
|
| 18 |
+
#include "freemaster_client.h"
|
| 19 |
+
#include <pthread.h>
|
| 20 |
+
|
| 21 |
+
#if LV_USE_FREEMASTER
|
| 22 |
+
/* Define a global variables */
|
| 23 |
+
lv_ll_t GG_EDATA_TASK_LN;
|
| 24 |
+
|
| 25 |
+
extern pthread_mutex_t gg_edata_ll_mutex;
|
| 26 |
+
extern pthread_cond_t gg_edata_ll_cond;
|
| 27 |
+
bool gg_edata_ll_changed = false;
|
| 28 |
+
|
| 29 |
+
uint64_t gg_get_us_time() {
|
| 30 |
+
struct timespec ts;
|
| 31 |
+
|
| 32 |
+
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
|
| 33 |
+
fprintf(stderr, "\nFailed to get time.");
|
| 34 |
+
exit(EXIT_FAILURE);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
return (uint64_t) (ts.tv_sec * 1000000 + ts.tv_nsec / 1000);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
uint64_t gg_get_ms_time() {
|
| 41 |
+
struct timespec ts;
|
| 42 |
+
|
| 43 |
+
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
|
| 44 |
+
fprintf(stderr, "\nFailed to get time.");
|
| 45 |
+
exit(EXIT_FAILURE);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
return (uint64_t) (ts.tv_sec * 1000 + ts.tv_nsec / 1000000);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
void gg_nanosleep(int ns) {
|
| 52 |
+
struct timespec remaining, request = { 0, ns };
|
| 53 |
+
nanosleep(&request, &remaining);
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
void gg_edata_task_init(void) {
|
| 57 |
+
_lv_ll_init(&GG_EDATA_TASK_LN, sizeof(gg_edata_task_t));
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
void gg_edata_task_clear(lv_obj_t * act_scr) {
|
| 61 |
+
#ifdef DEBUG
|
| 62 |
+
fprintf(stdout, "External data: clear task list...\n");
|
| 63 |
+
#endif
|
| 64 |
+
pthread_mutex_lock(&gg_edata_ll_mutex);
|
| 65 |
+
//_lv_ll_clear(&GG_EDATA_TASK_LN);
|
| 66 |
+
gg_edata_task_t * head;
|
| 67 |
+
head = _lv_ll_get_head(&GG_EDATA_TASK_LN);
|
| 68 |
+
while (head) {
|
| 69 |
+
bool task_deleted = false;
|
| 70 |
+
readVariableParm *param = head->param;
|
| 71 |
+
if (param->screen == act_scr) {
|
| 72 |
+
task_deleted = true;
|
| 73 |
+
gg_edata_ll_changed = true;
|
| 74 |
+
_lv_ll_remove(&GG_EDATA_TASK_LN, head);
|
| 75 |
+
}
|
| 76 |
+
if(task_deleted)
|
| 77 |
+
head = _lv_ll_get_head(&GG_EDATA_TASK_LN);
|
| 78 |
+
else
|
| 79 |
+
head = _lv_ll_get_next(&GG_EDATA_TASK_LN, head);
|
| 80 |
+
}
|
| 81 |
+
pthread_mutex_unlock(&gg_edata_ll_mutex);
|
| 82 |
+
#ifdef DEBUG
|
| 83 |
+
fprintf(stdout, "External data: clear task list [Done]\n");
|
| 84 |
+
#endif
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
gg_edata_task_t * gg_edata_task_create(uint32_t period, gg_edata_task_cb_t cb, void * param)
|
| 88 |
+
{
|
| 89 |
+
pthread_mutex_lock(&gg_edata_ll_mutex);
|
| 90 |
+
gg_edata_task_t * new_task = NULL;
|
| 91 |
+
new_task = _lv_ll_ins_head(&GG_EDATA_TASK_LN);
|
| 92 |
+
if(new_task != NULL) {
|
| 93 |
+
new_task->last_time = 0;
|
| 94 |
+
new_task->period = period;
|
| 95 |
+
new_task->cb = cb;
|
| 96 |
+
new_task->param = param;
|
| 97 |
+
gg_edata_ll_changed = true;
|
| 98 |
+
pthread_cond_signal(&gg_edata_ll_cond);
|
| 99 |
+
#ifdef DEBUG
|
| 100 |
+
fprintf(stdout, "External data: create new task.\n");
|
| 101 |
+
#endif
|
| 102 |
+
}
|
| 103 |
+
pthread_mutex_unlock(&gg_edata_ll_mutex);
|
| 104 |
+
return new_task;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
void *gg_edata_task_exec()
|
| 108 |
+
{
|
| 109 |
+
gg_edata_task_t * head;
|
| 110 |
+
head = _lv_ll_get_head(&GG_EDATA_TASK_LN);
|
| 111 |
+
while(true){
|
| 112 |
+
pthread_mutex_lock(&gg_edata_ll_mutex);
|
| 113 |
+
/* always check the link. After screen transition, old screen is
|
| 114 |
+
* deleted and new screen may have NO external data task
|
| 115 |
+
*/
|
| 116 |
+
while (_lv_ll_is_empty(&GG_EDATA_TASK_LN)) {
|
| 117 |
+
#ifdef DEBUG
|
| 118 |
+
fprintf(stdout, "External data: wait for task...\n");
|
| 119 |
+
#endif
|
| 120 |
+
/*no task, wait for signal and release the lock*/
|
| 121 |
+
pthread_cond_wait(&gg_edata_ll_cond, &gg_edata_ll_mutex);
|
| 122 |
+
}
|
| 123 |
+
if (gg_edata_ll_changed || head == NULL) {
|
| 124 |
+
head = _lv_ll_get_head(&GG_EDATA_TASK_LN);
|
| 125 |
+
} else {
|
| 126 |
+
head = _lv_ll_get_next(&GG_EDATA_TASK_LN, head);
|
| 127 |
+
}
|
| 128 |
+
if(head != NULL) {
|
| 129 |
+
gg_edata_ll_changed = false;
|
| 130 |
+
uint64_t currentTime = gg_get_ms_time();
|
| 131 |
+
uint64_t realExecTime = (head->period) + (head->last_time);
|
| 132 |
+
if(head->last_time == 0 || currentTime > realExecTime) {
|
| 133 |
+
head->cb(head->param);
|
| 134 |
+
head->last_time = currentTime;
|
| 135 |
+
}
|
| 136 |
+
}
|
| 137 |
+
pthread_mutex_unlock(&gg_edata_ll_mutex);
|
| 138 |
+
gg_nanosleep(100);
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/gg_external_data/gg_external_data.h
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef GG_EXTERNAL_DATA_H
|
| 11 |
+
#define GG_EXTERNAL_DATA_H
|
| 12 |
+
|
| 13 |
+
#include <stdint.h>
|
| 14 |
+
#include "lvgl.h"
|
| 15 |
+
|
| 16 |
+
typedef void (*gg_edata_task_cb_t)(void * param);
|
| 17 |
+
|
| 18 |
+
typedef struct _gg_edata_task_t
|
| 19 |
+
{
|
| 20 |
+
uint64_t last_time;
|
| 21 |
+
uint32_t period;
|
| 22 |
+
gg_edata_task_cb_t cb;
|
| 23 |
+
void * param;
|
| 24 |
+
} gg_edata_task_t;
|
| 25 |
+
|
| 26 |
+
enum gg_widget_type {
|
| 27 |
+
GG_LABEL = 1,
|
| 28 |
+
GG_CHART,
|
| 29 |
+
GG_BAR,
|
| 30 |
+
GG_METER,
|
| 31 |
+
GG_ARC,
|
| 32 |
+
GG_SLIDER,
|
| 33 |
+
GG_SWITCH
|
| 34 |
+
};
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* get time in us
|
| 38 |
+
*/
|
| 39 |
+
uint64_t gg_get_us_time();
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* get time in ms
|
| 43 |
+
*/
|
| 44 |
+
uint64_t gg_get_ms_time();
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* sleep in ns
|
| 48 |
+
* @param ns number to sleep.
|
| 49 |
+
*/
|
| 50 |
+
void gg_nanosleep(int ns);
|
| 51 |
+
|
| 52 |
+
/**
|
| 53 |
+
* init edata task link
|
| 54 |
+
*/
|
| 55 |
+
void gg_edata_task_init(void);
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
* clear edata task linked list, The list remain valid but become empty.
|
| 59 |
+
*/
|
| 60 |
+
void gg_edata_task_clear(lv_obj_t * act_scr);
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Create a new edata task
|
| 64 |
+
* @param period call period in ms unit
|
| 65 |
+
* @param cb a callback which will be called periodically.
|
| 66 |
+
* @param param parameter for callback
|
| 67 |
+
* @return pointer to the new task
|
| 68 |
+
*/
|
| 69 |
+
gg_edata_task_t * gg_edata_task_create(uint32_t period, gg_edata_task_cb_t cb, void * param);
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* routine which will be executed in a new thread
|
| 73 |
+
*/
|
| 74 |
+
void *gg_edata_task_exec();
|
| 75 |
+
|
| 76 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_conf.h
ADDED
|
@@ -0,0 +1,727 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2024 NXP
|
| 3 |
+
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
| 4 |
+
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
| 5 |
+
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
| 6 |
+
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
| 7 |
+
* terms, then you may not retain, install, activate or otherwise use the software.
|
| 8 |
+
*/
|
| 9 |
+
#ifndef LV_CONF_H
|
| 10 |
+
#define LV_CONF_H
|
| 11 |
+
|
| 12 |
+
#include <stdint.h>
|
| 13 |
+
|
| 14 |
+
/*====================
|
| 15 |
+
COLOR SETTINGS
|
| 16 |
+
*====================*/
|
| 17 |
+
|
| 18 |
+
/*Maximal horizontal resolution*/
|
| 19 |
+
#define LV_HOR_RES_MAX (800)
|
| 20 |
+
|
| 21 |
+
/*Maximal vertical resolution*/
|
| 22 |
+
#define LV_VER_RES_MAX (480)
|
| 23 |
+
|
| 24 |
+
/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
|
| 25 |
+
#define LV_COLOR_DEPTH 16
|
| 26 |
+
|
| 27 |
+
/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
|
| 28 |
+
#define LV_COLOR_16_SWAP 0
|
| 29 |
+
|
| 30 |
+
/*Enable features to draw on transparent background.
|
| 31 |
+
*It's required if opa, and transform_* style properties are used.
|
| 32 |
+
*Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/
|
| 33 |
+
#define LV_COLOR_SCREEN_TRANSP 0
|
| 34 |
+
|
| 35 |
+
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
|
| 36 |
+
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
|
| 37 |
+
#define LV_COLOR_MIX_ROUND_OFS 0
|
| 38 |
+
|
| 39 |
+
/*Images pixels with this color will not be drawn if they are chroma keyed)*/
|
| 40 |
+
#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00)
|
| 41 |
+
|
| 42 |
+
/*=========================
|
| 43 |
+
MEMORY SETTINGS
|
| 44 |
+
*=========================*/
|
| 45 |
+
|
| 46 |
+
/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
|
| 47 |
+
#define LV_MEM_CUSTOM 0
|
| 48 |
+
#if LV_MEM_CUSTOM == 0
|
| 49 |
+
/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
|
| 50 |
+
#define LV_MEM_SIZE (320U * 1024U)
|
| 51 |
+
#else /* LV_MEM_CUSTOM */
|
| 52 |
+
/*Header for the dynamic memory function*/
|
| 53 |
+
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h>
|
| 54 |
+
/*Name for the memory malloc function*/
|
| 55 |
+
#define LV_MEM_CUSTOM_ALLOC malloc
|
| 56 |
+
/*Name for the memory free function*/
|
| 57 |
+
#define LV_MEM_CUSTOM_FREE free
|
| 58 |
+
/*Name for the memory realloc function*/
|
| 59 |
+
#define LV_MEM_CUSTOM_REALLOC realloc
|
| 60 |
+
#endif /* LV_MEM_CUSTOM */
|
| 61 |
+
|
| 62 |
+
/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms.
|
| 63 |
+
*You will see an error log message if there wasn't enough buffers. */
|
| 64 |
+
#define LV_MEM_BUF_MAX_NUM 16
|
| 65 |
+
|
| 66 |
+
/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/
|
| 67 |
+
#define LV_MEMCPY_MEMSET_STD 0
|
| 68 |
+
|
| 69 |
+
/*====================
|
| 70 |
+
HAL SETTINGS
|
| 71 |
+
*====================*/
|
| 72 |
+
|
| 73 |
+
/*Default display refresh period in milliseconds. LVG will redraw changed areas with this period time*/
|
| 74 |
+
#define LV_DISP_DEF_REFR_PERIOD 30
|
| 75 |
+
|
| 76 |
+
/*Input device read period in milliseconds*/
|
| 77 |
+
#define LV_INDEV_DEF_READ_PERIOD 30
|
| 78 |
+
|
| 79 |
+
/*Use a custom tick source that tells the elapsed time in milliseconds.
|
| 80 |
+
*It removes the need to manually update the tick with `lv_tick_inc()`)*/
|
| 81 |
+
#define LV_TICK_CUSTOM 0
|
| 82 |
+
#if LV_TICK_CUSTOM
|
| 83 |
+
/*Header for the system time function*/
|
| 84 |
+
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h"
|
| 85 |
+
/*Expression evaluating to current system time in ms*/
|
| 86 |
+
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis())
|
| 87 |
+
#endif /* LV_TICK_CUSTOM */
|
| 88 |
+
|
| 89 |
+
/*Default Dot Per Inch(px/inch). Used to initialize default sizes such as widgets sized, style paddings.
|
| 90 |
+
*(Not so important, you can adjust it to modify default sizes and spaces)*/
|
| 91 |
+
#define LV_DPI_DEF 130
|
| 92 |
+
|
| 93 |
+
/*=======================
|
| 94 |
+
* FEATURE CONFIGURATION
|
| 95 |
+
*=======================*/
|
| 96 |
+
|
| 97 |
+
/*-------------
|
| 98 |
+
* Drawing
|
| 99 |
+
*-----------*/
|
| 100 |
+
|
| 101 |
+
/*Enable complex draw engine.
|
| 102 |
+
*Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/
|
| 103 |
+
#define LV_DRAW_COMPLEX 1
|
| 104 |
+
#if LV_DRAW_COMPLEX
|
| 105 |
+
/*Allow buffering some shadow calculation.
|
| 106 |
+
*LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
|
| 107 |
+
*Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
|
| 108 |
+
#define LV_SHADOW_CACHE_SIZE 0
|
| 109 |
+
|
| 110 |
+
/* Set number of maximally cached circle data.
|
| 111 |
+
* The circumference of 1/4 circle are saved for anti-aliasing
|
| 112 |
+
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
|
| 113 |
+
* 0: to disable caching */
|
| 114 |
+
#define LV_CIRCLE_CACHE_SIZE 4
|
| 115 |
+
#endif /* LV_DRAW_COMPLEX */
|
| 116 |
+
|
| 117 |
+
/**
|
| 118 |
+
* "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer
|
| 119 |
+
* and blend it as an image with the given opacity.
|
| 120 |
+
* Note that `bg_opa`, `text_opa` etc don't require buffering into layer)
|
| 121 |
+
* The widget can be buffered in smaller chunks to avoid using large buffers.
|
| 122 |
+
*
|
| 123 |
+
* - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it
|
| 124 |
+
* - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated.
|
| 125 |
+
*
|
| 126 |
+
* Both buffer sizes are in bytes.
|
| 127 |
+
* "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers
|
| 128 |
+
* and can't be drawn in chunks. So these settings affects only widgets with opacity.
|
| 129 |
+
*/
|
| 130 |
+
#define LV_LAYER_SIMPLE_BUF_SIZE (24U * 1024U)
|
| 131 |
+
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3U * 1024U)
|
| 132 |
+
|
| 133 |
+
/*Default image cache size. Image caching keeps the images opened.
|
| 134 |
+
*If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
|
| 135 |
+
*With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
|
| 136 |
+
*However the opened images might consume additional RAM.
|
| 137 |
+
*0: to disable caching*/
|
| 138 |
+
#define LV_IMG_CACHE_DEF_SIZE 0
|
| 139 |
+
|
| 140 |
+
/*Number of stops allowed per gradient. Increase this to allow more stops.
|
| 141 |
+
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
|
| 142 |
+
#define LV_GRADIENT_MAX_STOPS 2
|
| 143 |
+
|
| 144 |
+
/*Default gradient buffer size.
|
| 145 |
+
*When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again.
|
| 146 |
+
*LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes.
|
| 147 |
+
*If the cache is too small the map will be allocated only while it's required for the drawing.
|
| 148 |
+
*0 mean no caching.*/
|
| 149 |
+
#define LV_GRAD_CACHE_DEF_SIZE 0
|
| 150 |
+
|
| 151 |
+
/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display)
|
| 152 |
+
*LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface
|
| 153 |
+
*The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */
|
| 154 |
+
#define LV_DITHER_GRADIENT 0
|
| 155 |
+
#if LV_DITHER_GRADIENT
|
| 156 |
+
/*Add support for error diffusion dithering.
|
| 157 |
+
*Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing.
|
| 158 |
+
*The increase in memory consumption is (24 bits * object's width)*/
|
| 159 |
+
#define LV_DITHER_ERROR_DIFFUSION 0
|
| 160 |
+
#endif /* LV_DITHER_GRADIENT */
|
| 161 |
+
|
| 162 |
+
/*Maximum buffer size to allocate for rotation.
|
| 163 |
+
*Only used if software rotation is enabled in the display driver.*/
|
| 164 |
+
#define LV_DISP_ROT_MAX_BUF (10U * 1024U)
|
| 165 |
+
|
| 166 |
+
/*-------------
|
| 167 |
+
* GPU
|
| 168 |
+
*-----------*/
|
| 169 |
+
#if LV_USE_GPU_NXP_PXP
|
| 170 |
+
#endif /* LV_USE_GPU_NXP_PXP */
|
| 171 |
+
|
| 172 |
+
/*Use SDL renderer API*/
|
| 173 |
+
#define LV_USE_GPU_SDL 0
|
| 174 |
+
#if LV_USE_GPU_SDL
|
| 175 |
+
#define LV_GPU_SDL_INCLUDE_PATH <SDL2/SDL.h>
|
| 176 |
+
/*Texture cache size, 8MB by default*/
|
| 177 |
+
#define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8)
|
| 178 |
+
/*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/
|
| 179 |
+
#define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6))
|
| 180 |
+
#endif /* LV_USE_GPU_SDL */
|
| 181 |
+
|
| 182 |
+
/*-------------
|
| 183 |
+
* Logging
|
| 184 |
+
*-----------*/
|
| 185 |
+
|
| 186 |
+
/*Enable the log module*/
|
| 187 |
+
#define LV_USE_LOG 0
|
| 188 |
+
#if LV_USE_LOG
|
| 189 |
+
/*How important log should be added:
|
| 190 |
+
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
|
| 191 |
+
*LV_LOG_LEVEL_INFO Log important events
|
| 192 |
+
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
|
| 193 |
+
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
|
| 194 |
+
*LV_LOG_LEVEL_USER Only logs added by the user
|
| 195 |
+
*LV_LOG_LEVEL_NONE Do not log anything*/
|
| 196 |
+
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
|
| 197 |
+
|
| 198 |
+
/*1: Print the log with 'printf';
|
| 199 |
+
*0: User need to register a callback with `lv_log_register_print_cb()`*/
|
| 200 |
+
#define LV_LOG_PRINTF 0
|
| 201 |
+
#define LV_LOG_TRACE_MEM 1
|
| 202 |
+
#define LV_LOG_TRACE_TIMER 1
|
| 203 |
+
#define LV_LOG_TRACE_INDEV 1
|
| 204 |
+
#define LV_LOG_TRACE_DISP_REFR 1
|
| 205 |
+
#define LV_LOG_TRACE_EVENT 1
|
| 206 |
+
#define LV_LOG_TRACE_OBJ_CREATE 1
|
| 207 |
+
#define LV_LOG_TRACE_LAYOUT 1
|
| 208 |
+
#define LV_LOG_TRACE_ANIM 1
|
| 209 |
+
#endif /* LV_USE_LOG */
|
| 210 |
+
|
| 211 |
+
/*-------------
|
| 212 |
+
* Asserts
|
| 213 |
+
*-----------*/
|
| 214 |
+
|
| 215 |
+
/*Enable asserts if an operation is failed or an invalid data is found.
|
| 216 |
+
*If LV_USE_LOG is enabled an error message will be printed on failure*/
|
| 217 |
+
|
| 218 |
+
/*Check if the parameter is NULL. (Very fast, recommended)*/
|
| 219 |
+
#define LV_USE_ASSERT_NULL 1
|
| 220 |
+
/*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
|
| 221 |
+
#define LV_USE_ASSERT_MALLOC 1
|
| 222 |
+
/*Check if the styles are properly initialized. (Very fast, recommended)*/
|
| 223 |
+
#define LV_USE_ASSERT_STYLE 0
|
| 224 |
+
/*Check the integrity of `lv_mem` after critical operations. (Slow)*/
|
| 225 |
+
#define LV_USE_ASSERT_MEM_INTEGRITY 0
|
| 226 |
+
/*Check the object's type and existence (e.g. not deleted). (Slow)*/
|
| 227 |
+
#define LV_USE_ASSERT_OBJ 0
|
| 228 |
+
|
| 229 |
+
/*Add a custom handler when assert happens e.g. to restart the MCU*/
|
| 230 |
+
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
|
| 231 |
+
/*Halt by default*/
|
| 232 |
+
#define LV_ASSERT_HANDLER while(1);
|
| 233 |
+
|
| 234 |
+
/*-------------
|
| 235 |
+
* Others
|
| 236 |
+
*-----------*/
|
| 237 |
+
|
| 238 |
+
/*1: Show CPU usage and FPS count*/
|
| 239 |
+
#define LV_USE_PERF_MONITOR 0
|
| 240 |
+
#if LV_USE_PERF_MONITOR
|
| 241 |
+
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
|
| 242 |
+
#endif /* LV_USE_PERF_MONITOR */
|
| 243 |
+
|
| 244 |
+
/*1: Show the used memory and the memory fragmentation
|
| 245 |
+
* Requires LV_MEM_CUSTOM = 0*/
|
| 246 |
+
#define LV_USE_MEM_MONITOR 0
|
| 247 |
+
#if LV_USE_MEM_MONITOR
|
| 248 |
+
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
|
| 249 |
+
#endif /* LV_USE_MEM_MONITOR */
|
| 250 |
+
|
| 251 |
+
/*1: Draw random colored rectangles over the redrawn areas*/
|
| 252 |
+
#define LV_USE_REFR_DEBUG 0
|
| 253 |
+
|
| 254 |
+
/*Change the built in (v)snprintf functions*/
|
| 255 |
+
#define LV_SPRINTF_CUSTOM 0
|
| 256 |
+
#if LV_SPRINTF_CUSTOM
|
| 257 |
+
#define LV_SPRINTF_INCLUDE <stdio.h>
|
| 258 |
+
#define lv_snprintf snprintf
|
| 259 |
+
#define lv_vsnprintf vsnprintf
|
| 260 |
+
#else /* LV_SPRINTF_CUSTOM */
|
| 261 |
+
#define LV_SPRINTF_USE_FLOAT 0
|
| 262 |
+
#endif /* LV_SPRINTF_CUSTOM */
|
| 263 |
+
|
| 264 |
+
#define LV_USE_USER_DATA 1
|
| 265 |
+
|
| 266 |
+
/*Garbage Collector settings
|
| 267 |
+
*Used if lvgl is bound to higher level language and the memory is managed by that language*/
|
| 268 |
+
#define LV_ENABLE_GC 0
|
| 269 |
+
#if LV_ENABLE_GC
|
| 270 |
+
/*Include Garbage Collector related things*/
|
| 271 |
+
#define LV_GC_INCLUDE "gc.h"
|
| 272 |
+
#endif /* LV_ENABLE_GC */
|
| 273 |
+
|
| 274 |
+
/*=====================
|
| 275 |
+
* COMPILER SETTINGS
|
| 276 |
+
*====================*/
|
| 277 |
+
|
| 278 |
+
/*For big endian systems set to 1*/
|
| 279 |
+
#define LV_BIG_ENDIAN_SYSTEM 0
|
| 280 |
+
|
| 281 |
+
/*Define a custom attribute to `lv_tick_inc` function*/
|
| 282 |
+
#define LV_ATTRIBUTE_TICK_INC
|
| 283 |
+
|
| 284 |
+
/*Define a custom attribute to `lv_timer_handler` function*/
|
| 285 |
+
#define LV_ATTRIBUTE_TIMER_HANDLER
|
| 286 |
+
|
| 287 |
+
/*Define a custom attribute to `lv_disp_flush_ready` function*/
|
| 288 |
+
#define LV_ATTRIBUTE_FLUSH_READY
|
| 289 |
+
|
| 290 |
+
#ifndef LV_ATTRIBUTE_LARGE_CONST
|
| 291 |
+
/*Attribute to mark large constant arrays for example font's bitmaps*/
|
| 292 |
+
#define LV_ATTRIBUTE_LARGE_CONST
|
| 293 |
+
#endif /* LV_ATTRIBUTE_LARGE_CONST */
|
| 294 |
+
|
| 295 |
+
/*Compiler prefix for a big array declaration in RAM*/
|
| 296 |
+
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
|
| 297 |
+
|
| 298 |
+
/*Place performance critical functions into a faster memory (e.g RAM)*/
|
| 299 |
+
#define LV_ATTRIBUTE_FAST_MEM
|
| 300 |
+
|
| 301 |
+
/*Prefix variables that are used in GPU accelerated operations,
|
| 302 |
+
often these need to be placed in RAM sections that are DMA accessible*/
|
| 303 |
+
#define LV_ATTRIBUTE_DMA
|
| 304 |
+
|
| 305 |
+
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
|
| 306 |
+
*should also appear on LVGL binding API such as Micropython.*/
|
| 307 |
+
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning
|
| 308 |
+
|
| 309 |
+
/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/
|
| 310 |
+
#define LV_USE_LARGE_COORD 0
|
| 311 |
+
|
| 312 |
+
/*==================
|
| 313 |
+
* FONT USAGE
|
| 314 |
+
*===================*/
|
| 315 |
+
|
| 316 |
+
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
|
| 317 |
+
*https://fonts.google.com/specimen/Montserrat*/
|
| 318 |
+
#define LV_FONT_MONTSERRAT_8 0
|
| 319 |
+
#define LV_FONT_MONTSERRAT_10 0
|
| 320 |
+
#define LV_FONT_MONTSERRAT_12 1
|
| 321 |
+
#define LV_FONT_MONTSERRAT_14 1
|
| 322 |
+
#define LV_FONT_MONTSERRAT_16 0
|
| 323 |
+
#define LV_FONT_MONTSERRAT_18 0
|
| 324 |
+
#define LV_FONT_MONTSERRAT_20 0
|
| 325 |
+
#define LV_FONT_MONTSERRAT_22 0
|
| 326 |
+
#define LV_FONT_MONTSERRAT_24 0
|
| 327 |
+
#define LV_FONT_MONTSERRAT_26 0
|
| 328 |
+
#define LV_FONT_MONTSERRAT_28 0
|
| 329 |
+
#define LV_FONT_MONTSERRAT_30 0
|
| 330 |
+
#define LV_FONT_MONTSERRAT_32 0
|
| 331 |
+
#define LV_FONT_MONTSERRAT_34 0
|
| 332 |
+
#define LV_FONT_MONTSERRAT_36 0
|
| 333 |
+
#define LV_FONT_MONTSERRAT_38 0
|
| 334 |
+
#define LV_FONT_MONTSERRAT_40 0
|
| 335 |
+
#define LV_FONT_MONTSERRAT_42 0
|
| 336 |
+
#define LV_FONT_MONTSERRAT_44 0
|
| 337 |
+
#define LV_FONT_MONTSERRAT_46 0
|
| 338 |
+
#define LV_FONT_MONTSERRAT_48 0
|
| 339 |
+
|
| 340 |
+
/*Demonstrate special features*/
|
| 341 |
+
#define LV_FONT_MONTSERRAT_12_SUBPX 0
|
| 342 |
+
/*bpp = 3*/
|
| 343 |
+
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0
|
| 344 |
+
/*Hebrew, Arabic, Persian letters and all their forms*/
|
| 345 |
+
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0
|
| 346 |
+
/*1000 most common CJK radicals*/
|
| 347 |
+
#define LV_FONT_SIMSUN_16_CJK 0
|
| 348 |
+
|
| 349 |
+
/*Pixel perfect monospace fonts*/
|
| 350 |
+
#define LV_FONT_UNSCII_8 0
|
| 351 |
+
#define LV_FONT_UNSCII_16 0
|
| 352 |
+
|
| 353 |
+
/*Optionally declare custom fonts here.
|
| 354 |
+
*You can use these fonts as default font too and they will be available globally.
|
| 355 |
+
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
|
| 356 |
+
#define LV_FONT_CUSTOM_DECLARE
|
| 357 |
+
|
| 358 |
+
/*Always set a default font*/
|
| 359 |
+
#define LV_FONT_DEFAULT &lv_font_montserrat_14
|
| 360 |
+
|
| 361 |
+
/*Enable handling large font and/or fonts with a lot of characters.
|
| 362 |
+
*The limit depends on the font size, font face and bpp.
|
| 363 |
+
*Compiler error will be triggered if a font needs it.*/
|
| 364 |
+
#define LV_FONT_FMT_TXT_LARGE 0
|
| 365 |
+
|
| 366 |
+
/*Enables/disables support for compressed fonts.*/
|
| 367 |
+
#define LV_USE_FONT_COMPRESSED 0
|
| 368 |
+
|
| 369 |
+
/*Enable subpixel rendering*/
|
| 370 |
+
#define LV_USE_FONT_SUBPX 0
|
| 371 |
+
#if LV_USE_FONT_SUBPX
|
| 372 |
+
/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/
|
| 373 |
+
#define LV_FONT_SUBPX_BGR 0
|
| 374 |
+
#endif /* LV_USE_FONT_SUBPX */
|
| 375 |
+
|
| 376 |
+
/*Enable drawing placeholders when glyph dsc is not found*/
|
| 377 |
+
#define LV_USE_FONT_PLACEHOLDER 1
|
| 378 |
+
|
| 379 |
+
/*=================
|
| 380 |
+
* TEXT SETTINGS
|
| 381 |
+
*=================*/
|
| 382 |
+
|
| 383 |
+
/**
|
| 384 |
+
* Select a character encoding for strings.
|
| 385 |
+
* Your IDE or editor should have the same character encoding
|
| 386 |
+
* - LV_TXT_ENC_UTF8
|
| 387 |
+
* - LV_TXT_ENC_ASCII
|
| 388 |
+
*/
|
| 389 |
+
#define LV_TXT_ENC LV_TXT_ENC_UTF8
|
| 390 |
+
|
| 391 |
+
/*Can break (wrap) texts on these chars*/
|
| 392 |
+
#define LV_TXT_BREAK_CHARS " ,.;:-_"
|
| 393 |
+
|
| 394 |
+
/*If a word is at least this long, will break wherever "prettiest"
|
| 395 |
+
*To disable, set to a value <= 0*/
|
| 396 |
+
#define LV_TXT_LINE_BREAK_LONG_LEN 0
|
| 397 |
+
|
| 398 |
+
/*Minimum number of characters in a long word to put on a line before a break.
|
| 399 |
+
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
|
| 400 |
+
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
|
| 401 |
+
|
| 402 |
+
/*Minimum number of characters in a long word to put on a line after a break.
|
| 403 |
+
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
|
| 404 |
+
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
|
| 405 |
+
|
| 406 |
+
/*The control character to use for signalling text recoloring.*/
|
| 407 |
+
#define LV_TXT_COLOR_CMD "#"
|
| 408 |
+
|
| 409 |
+
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
|
| 410 |
+
*The direction will be processed according to the Unicode Bidirectional Algorithm:
|
| 411 |
+
*https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
|
| 412 |
+
#define LV_USE_BIDI 0
|
| 413 |
+
#if LV_USE_BIDI
|
| 414 |
+
/*Set the default direction. Supported values:
|
| 415 |
+
*`LV_BASE_DIR_LTR` Left-to-Right
|
| 416 |
+
*`LV_BASE_DIR_RTL` Right-to-Left
|
| 417 |
+
*`LV_BASE_DIR_AUTO` detect texts base direction*/
|
| 418 |
+
#define LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO
|
| 419 |
+
#endif /* LV_USE_BIDI */
|
| 420 |
+
|
| 421 |
+
/*Enable Arabic/Persian processing
|
| 422 |
+
*In these languages characters should be replaced with an other form based on their position in the text*/
|
| 423 |
+
#define LV_USE_ARABIC_PERSIAN_CHARS 0
|
| 424 |
+
|
| 425 |
+
/*==================
|
| 426 |
+
* WIDGET USAGE
|
| 427 |
+
*================*/
|
| 428 |
+
|
| 429 |
+
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
|
| 430 |
+
#define LV_USE_ARC 1
|
| 431 |
+
|
| 432 |
+
#define LV_USE_BAR 1
|
| 433 |
+
|
| 434 |
+
#define LV_USE_BTN 1
|
| 435 |
+
|
| 436 |
+
#define LV_USE_BTNMATRIX 1
|
| 437 |
+
|
| 438 |
+
#define LV_USE_CANVAS 1
|
| 439 |
+
|
| 440 |
+
#define LV_USE_CHECKBOX 1
|
| 441 |
+
|
| 442 |
+
#define LV_USE_DROPDOWN 1
|
| 443 |
+
|
| 444 |
+
#define LV_USE_IMG 1
|
| 445 |
+
|
| 446 |
+
#define LV_USE_LABEL 1
|
| 447 |
+
#if LV_USE_LABEL
|
| 448 |
+
/*Enable selecting text of the label*/
|
| 449 |
+
#define LV_LABEL_TEXT_SELECTION 1
|
| 450 |
+
/*Store some extra info in labels to speed up drawing of very long texts*/
|
| 451 |
+
#define LV_LABEL_LONG_TXT_HINT 1
|
| 452 |
+
#endif /* LV_USE_LABEL */
|
| 453 |
+
|
| 454 |
+
#define LV_USE_LINE 1
|
| 455 |
+
|
| 456 |
+
#define LV_USE_ROLLER 1
|
| 457 |
+
#if LV_USE_ROLLER
|
| 458 |
+
/*Number of extra "pages" when the roller is infinite*/
|
| 459 |
+
#define LV_ROLLER_INF_PAGES 7
|
| 460 |
+
#endif /* LV_USE_ROLLER */
|
| 461 |
+
|
| 462 |
+
#define LV_USE_SLIDER 1
|
| 463 |
+
|
| 464 |
+
#define LV_USE_SWITCH 1
|
| 465 |
+
|
| 466 |
+
#define LV_USE_TEXTAREA 1
|
| 467 |
+
#if LV_USE_TEXTAREA
|
| 468 |
+
#define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500
|
| 469 |
+
#endif /* LV_USE_TEXTAREA */
|
| 470 |
+
|
| 471 |
+
#define LV_USE_TABLE 1
|
| 472 |
+
|
| 473 |
+
/*==================
|
| 474 |
+
* EXTRA COMPONENTS
|
| 475 |
+
*==================*/
|
| 476 |
+
|
| 477 |
+
/*-----------
|
| 478 |
+
* Widgets
|
| 479 |
+
*----------*/
|
| 480 |
+
|
| 481 |
+
#define LV_USE_ANALOGCLOCK 0
|
| 482 |
+
|
| 483 |
+
#define LV_USE_ANIMIMG 1
|
| 484 |
+
|
| 485 |
+
#define LV_USE_CALENDAR 1
|
| 486 |
+
#if LV_USE_CALENDAR
|
| 487 |
+
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
|
| 488 |
+
#if LV_CALENDAR_WEEK_STARTS_MONDAY == 0
|
| 489 |
+
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
|
| 490 |
+
#endif /* LV_CALENDAR_WEEK_STARTS_MONDAY */
|
| 491 |
+
#define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
|
| 492 |
+
#define LV_USE_CALENDAR_HEADER_ARROW 1
|
| 493 |
+
#define LV_USE_CALENDAR_HEADER_DROPDOWN 1
|
| 494 |
+
#endif /* LV_USE_CALENDAR */
|
| 495 |
+
|
| 496 |
+
#define LV_USE_CAROUSEL 1
|
| 497 |
+
|
| 498 |
+
#define LV_USE_CHART 1
|
| 499 |
+
|
| 500 |
+
#define LV_USE_COLORWHEEL 1
|
| 501 |
+
|
| 502 |
+
#define LV_USE_DCLOCK 1
|
| 503 |
+
|
| 504 |
+
#define LV_USE_IMGBTN 1
|
| 505 |
+
|
| 506 |
+
#define LV_USE_KEYBOARD 0
|
| 507 |
+
|
| 508 |
+
#define LV_USE_LED 1
|
| 509 |
+
|
| 510 |
+
#define LV_USE_LIST 1
|
| 511 |
+
|
| 512 |
+
#define LV_USE_MENU 1
|
| 513 |
+
|
| 514 |
+
#define LV_USE_METER 1
|
| 515 |
+
|
| 516 |
+
#define LV_USE_MSGBOX 1
|
| 517 |
+
|
| 518 |
+
#define LV_USE_RADIOBTN 1
|
| 519 |
+
|
| 520 |
+
#define LV_USE_SPAN 1
|
| 521 |
+
#if LV_USE_SPAN
|
| 522 |
+
/*A line text can contain maximum num of span descriptor */
|
| 523 |
+
#define LV_SPAN_SNIPPET_STACK_SIZE 64
|
| 524 |
+
#endif /* LV_USE_SPAN */
|
| 525 |
+
|
| 526 |
+
#define LV_USE_SPINBOX 1
|
| 527 |
+
|
| 528 |
+
#define LV_USE_SPINNER 1
|
| 529 |
+
|
| 530 |
+
#define LV_USE_TABVIEW 1
|
| 531 |
+
|
| 532 |
+
#define LV_USE_TILEVIEW 1
|
| 533 |
+
|
| 534 |
+
#define LV_USE_VIDEO 0
|
| 535 |
+
|
| 536 |
+
#define LV_USE_WIN 1
|
| 537 |
+
|
| 538 |
+
#define LV_USE_ZH_KEYBOARD 0
|
| 539 |
+
#if LV_USE_ZH_KEYBOARD
|
| 540 |
+
#define LV_ZH_KEYBOARD_MINI 0
|
| 541 |
+
#endif /* LV_USE_ZH_KEYBOARD */
|
| 542 |
+
|
| 543 |
+
/*-----------
|
| 544 |
+
* Themes
|
| 545 |
+
*----------*/
|
| 546 |
+
|
| 547 |
+
/*A simple, impressive and very complete theme*/
|
| 548 |
+
#define LV_USE_THEME_DEFAULT 1
|
| 549 |
+
#if LV_USE_THEME_DEFAULT
|
| 550 |
+
/*0: Light mode; 1: Dark mode*/
|
| 551 |
+
#define LV_THEME_DEFAULT_DARK 0
|
| 552 |
+
/*1: Enable grow on press*/
|
| 553 |
+
#define LV_THEME_DEFAULT_GROW 1
|
| 554 |
+
/*Default transition time in [ms]*/
|
| 555 |
+
#define LV_THEME_DEFAULT_TRANSITION_TIME 80
|
| 556 |
+
#endif /* LV_USE_THEME_DEFAULT */
|
| 557 |
+
|
| 558 |
+
/*A very simple theme that is a good starting point for a custom theme*/
|
| 559 |
+
#define LV_USE_THEME_BASIC 1
|
| 560 |
+
|
| 561 |
+
/*A theme designed for monochrome displays*/
|
| 562 |
+
#define LV_USE_THEME_MONO 1
|
| 563 |
+
|
| 564 |
+
/*-----------
|
| 565 |
+
* Layouts
|
| 566 |
+
*----------*/
|
| 567 |
+
|
| 568 |
+
/*A layout similar to Flexbox in CSS.*/
|
| 569 |
+
#define LV_USE_FLEX 1
|
| 570 |
+
|
| 571 |
+
/*A layout similar to Grid in CSS.*/
|
| 572 |
+
#define LV_USE_GRID 1
|
| 573 |
+
|
| 574 |
+
/*---------------------
|
| 575 |
+
* 3rd party libraries
|
| 576 |
+
*--------------------*/
|
| 577 |
+
|
| 578 |
+
/*File system interfaces for common APIs */
|
| 579 |
+
|
| 580 |
+
/*API for fopen, fread, etc*/
|
| 581 |
+
#define LV_USE_FS_STDIO 0
|
| 582 |
+
#if LV_USE_FS_STDIO
|
| 583 |
+
/*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
| 584 |
+
#define LV_FS_STDIO_LETTER 'C'
|
| 585 |
+
/*Set the working directory. File/directory paths will be appended to it.*/
|
| 586 |
+
#define LV_FS_STDIO_PATH ""
|
| 587 |
+
/*>0 to cache this number of bytes in lv_fs_read()*/
|
| 588 |
+
#define LV_FS_STDIO_CACHE_SIZE 0
|
| 589 |
+
#endif /* LV_USE_FS_STDIO */
|
| 590 |
+
|
| 591 |
+
/*API for open, read, etc*/
|
| 592 |
+
#define LV_USE_FS_POSIX 0
|
| 593 |
+
#if LV_USE_FS_POSIX
|
| 594 |
+
/*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
| 595 |
+
#define LV_FS_POSIX_LETTER '\0'
|
| 596 |
+
/*Set the working directory. File/directory paths will be appended to it.*/
|
| 597 |
+
#define LV_FS_POSIX_PATH ""
|
| 598 |
+
/*>0 to cache this number of bytes in lv_fs_read()*/
|
| 599 |
+
#define LV_FS_POSIX_CACHE_SIZE 0
|
| 600 |
+
#endif /* LV_USE_FS_POSIX */
|
| 601 |
+
|
| 602 |
+
/*API for CreateFile, ReadFile, etc*/
|
| 603 |
+
#define LV_USE_FS_WIN32 0
|
| 604 |
+
#if LV_USE_FS_WIN32
|
| 605 |
+
/*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
| 606 |
+
#define LV_FS_WIN32_LETTER '\0'
|
| 607 |
+
/*Set the working directory. File/directory paths will be appended to it.*/
|
| 608 |
+
#define LV_FS_WIN32_PATH ""
|
| 609 |
+
/*>0 to cache this number of bytes in lv_fs_read()*/
|
| 610 |
+
#define LV_FS_WIN32_CACHE_SIZE 0
|
| 611 |
+
#endif /* LV_USE_FS_WIN32 */
|
| 612 |
+
|
| 613 |
+
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
|
| 614 |
+
#define LV_USE_FS_FATFS 0
|
| 615 |
+
#if LV_USE_FS_FATFS
|
| 616 |
+
/*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
| 617 |
+
#define LV_FS_FATFS_LETTER '\0'
|
| 618 |
+
/*>0 to cache this number of bytes in lv_fs_read()*/
|
| 619 |
+
#define LV_FS_FATFS_CACHE_SIZE 0
|
| 620 |
+
#endif /* LV_USE_FS_FATFS */
|
| 621 |
+
|
| 622 |
+
/*API for RAWFS (needs to be added separately).*/
|
| 623 |
+
#define LV_USE_FS_RAWFS 0
|
| 624 |
+
#if LV_USE_FS_RAWFS
|
| 625 |
+
/*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
| 626 |
+
#define LV_FS_RAWFS_LETTER '\0'
|
| 627 |
+
/*use the XIP flash*/
|
| 628 |
+
#define LV_FS_RAWFS_XIP 0
|
| 629 |
+
#if LV_FS_RAWFS_XIP
|
| 630 |
+
/*the XIP flash address where the image binary is placed*/
|
| 631 |
+
#define LV_FS_RAWFS_XIP_BASE_ADDR
|
| 632 |
+
#endif /* LV_FS_RAWFS_XIP */
|
| 633 |
+
#endif /* LV_USE_FS_RAWFS */
|
| 634 |
+
|
| 635 |
+
/*PNG decoder library*/
|
| 636 |
+
#define LV_USE_PNG 0
|
| 637 |
+
|
| 638 |
+
/*BMP decoder library*/
|
| 639 |
+
#define LV_USE_BMP 0
|
| 640 |
+
|
| 641 |
+
/* JPG + split JPG decoder library.
|
| 642 |
+
* Split JPG is a custom format optimized for embedded systems. */
|
| 643 |
+
#define LV_USE_SJPG 0
|
| 644 |
+
|
| 645 |
+
/*GIF decoder library*/
|
| 646 |
+
#define LV_USE_GIF 0
|
| 647 |
+
|
| 648 |
+
/*QR code library*/
|
| 649 |
+
#define LV_USE_QRCODE 1
|
| 650 |
+
|
| 651 |
+
/*FreeType library*/
|
| 652 |
+
#define LV_USE_FREETYPE 0
|
| 653 |
+
#if LV_USE_FREETYPE
|
| 654 |
+
/*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/
|
| 655 |
+
#define LV_FREETYPE_CACHE_SIZE (16U * 1024U)
|
| 656 |
+
#if LV_FREETYPE_CACHE_SIZE >= 0
|
| 657 |
+
/* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */
|
| 658 |
+
/* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */
|
| 659 |
+
/* if font size >= 256, must be configured as image cache */
|
| 660 |
+
#define LV_FREETYPE_SBIT_CACHE 0
|
| 661 |
+
/* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */
|
| 662 |
+
/* (0:use system defaults) */
|
| 663 |
+
#define LV_FREETYPE_CACHE_FT_FACES 0
|
| 664 |
+
#define LV_FREETYPE_CACHE_FT_SIZES 0
|
| 665 |
+
#endif /* LV_FREETYPE_CACHE_SIZE */
|
| 666 |
+
#endif /* LV_USE_FREETYPE */
|
| 667 |
+
|
| 668 |
+
/*Rlottie library*/
|
| 669 |
+
#define LV_USE_RLOTTIE 0
|
| 670 |
+
|
| 671 |
+
/*FFmpeg library for image decoding and playing videos
|
| 672 |
+
*Supports all major image formats so do not enable other image decoder with it*/
|
| 673 |
+
#define LV_USE_FFMPEG 0
|
| 674 |
+
#if LV_USE_FFMPEG
|
| 675 |
+
/*Dump input information to stderr*/
|
| 676 |
+
#define LV_FFMPEG_DUMP_FORMAT 0
|
| 677 |
+
#endif /* LV_USE_FFMPEG */
|
| 678 |
+
|
| 679 |
+
/*-----------
|
| 680 |
+
* Others
|
| 681 |
+
*----------*/
|
| 682 |
+
|
| 683 |
+
/*1: Enable API to take snapshot for object*/
|
| 684 |
+
#define LV_USE_SNAPSHOT 0
|
| 685 |
+
|
| 686 |
+
/*1: Enable Monkey test*/
|
| 687 |
+
#define LV_USE_MONKEY 0
|
| 688 |
+
|
| 689 |
+
/*1: Enable grid navigation*/
|
| 690 |
+
#define LV_USE_GRIDNAV 0
|
| 691 |
+
|
| 692 |
+
/*1: Enable lv_obj fragment*/
|
| 693 |
+
#define LV_USE_FRAGMENT 0
|
| 694 |
+
|
| 695 |
+
/*1: Support using images as font in label or span widgets */
|
| 696 |
+
#define LV_USE_IMGFONT 0
|
| 697 |
+
|
| 698 |
+
/*1: Enable a published subscriber based messaging system */
|
| 699 |
+
#define LV_USE_MSG 0
|
| 700 |
+
|
| 701 |
+
/*1: Enable Pinyin input method. Requires: lv_keyboard*/
|
| 702 |
+
#define LV_USE_IME_PINYIN 0
|
| 703 |
+
#if LV_USE_IME_PINYIN
|
| 704 |
+
/*1: Use default thesaurus*/
|
| 705 |
+
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
|
| 706 |
+
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
|
| 707 |
+
/*Set the maximum number of candidate panels that can be displayed*/
|
| 708 |
+
/*This needs to be adjusted according to the size of the screen*/
|
| 709 |
+
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
|
| 710 |
+
|
| 711 |
+
/*Use 9 key input(k9)*/
|
| 712 |
+
#define LV_IME_PINYIN_USE_K9_MODE 1
|
| 713 |
+
#if LV_IME_PINYIN_USE_K9_MODE
|
| 714 |
+
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
|
| 715 |
+
#endif /* LV_IME_PINYIN_USE_K9_MODE */
|
| 716 |
+
#endif /* LV_USE_IME_PINYIN */
|
| 717 |
+
/*Enable the text progress bar*/
|
| 718 |
+
#define LV_USE_TEXTPROGRESS 1
|
| 719 |
+
/*Enable the barcode*/
|
| 720 |
+
#define LV_USE_BARCODE 0
|
| 721 |
+
|
| 722 |
+
#define LV_USE_GUIDER_SIMULATOR 1
|
| 723 |
+
/* Enable the FreeMaster integration */
|
| 724 |
+
#define LV_USE_FREEMASTER 0
|
| 725 |
+
#include "lv_conf_ext.h"
|
| 726 |
+
|
| 727 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Display and Touch pad drivers
|
| 2 |
+
|
| 3 |
+
Display controller and touchpad driver to can be directly used with [LittlevGL](https://littlevgl.com).
|
| 4 |
+
|
| 5 |
+
To learn more about using drivers in LittlevGL visit the [Porting guide](https://docs.lvgl.io/latest/en/html/porting/index.html).
|
| 6 |
+
|
| 7 |
+
If you used a new display or touch pad driver with LittlevGL please share it with other people!
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/GC9A01.c
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
| 6 |
+
|
| 7 |
+
/*********************
|
| 8 |
+
* INCLUDES
|
| 9 |
+
*********************/
|
| 10 |
+
#include "GC9A01.h"
|
| 11 |
+
#if USE_GC9A01
|
| 12 |
+
|
| 13 |
+
#include <stdbool.h>
|
| 14 |
+
#include <stddef.h>
|
| 15 |
+
#include <string.h>
|
| 16 |
+
|
| 17 |
+
#include LV_DRV_DISP_INCLUDE
|
| 18 |
+
#include LV_DRV_DELAY_INCLUDE
|
| 19 |
+
|
| 20 |
+
/*********************
|
| 21 |
+
* DEFINES
|
| 22 |
+
*********************/
|
| 23 |
+
#define GC9A01_BAUD 2000000 /*< 2,5 MHz (400 ns)*/
|
| 24 |
+
|
| 25 |
+
#define GC9A01_CMD_MODE 0
|
| 26 |
+
#define GC9A01_DATA_MODE 1
|
| 27 |
+
|
| 28 |
+
#define GC9A01_HOR_RES 240
|
| 29 |
+
#define GC9A01_VER_RES 240
|
| 30 |
+
|
| 31 |
+
/* GC9A01 Commands that we know of. Limited documentation */
|
| 32 |
+
#define GC9A01_INVOFF 0x20
|
| 33 |
+
#define GC9A01_INVON 0x21
|
| 34 |
+
#define GC9A01_DISPON 0x29
|
| 35 |
+
#define GC9A01_CASET 0x2A
|
| 36 |
+
#define GC9A01_RASET 0x2B
|
| 37 |
+
#define GC9A01_RAMWR 0x2C
|
| 38 |
+
#define GC9A01_COLMOD 0x3A
|
| 39 |
+
#define GC9A01_MADCTL 0x36
|
| 40 |
+
#define GC9A01_MADCTL_MY 0x80
|
| 41 |
+
#define GC9A01_MADCTL_MX 0x40
|
| 42 |
+
#define GC9A01_MADCTL_MV 0x20
|
| 43 |
+
#define GC9A01_MADCTL_RGB 0x00
|
| 44 |
+
#define GC9A01_DISFNCTRL 0xB6
|
| 45 |
+
|
| 46 |
+
/**********************
|
| 47 |
+
* TYPEDEFS
|
| 48 |
+
**********************/
|
| 49 |
+
|
| 50 |
+
/**********************
|
| 51 |
+
* STATIC PROTOTYPES
|
| 52 |
+
**********************/
|
| 53 |
+
static void GC9A01_command(uint8_t cmd);
|
| 54 |
+
static void GC9A01_data(uint8_t data);
|
| 55 |
+
static void GC9A01_set_addr_win(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
|
| 56 |
+
|
| 57 |
+
/**********************
|
| 58 |
+
* STATIC VARIABLES
|
| 59 |
+
**********************/
|
| 60 |
+
// Documentation on op codes for GC9A01 are very hard to find.
|
| 61 |
+
// Will document should they be found.
|
| 62 |
+
static struct GC9A01_function GC9A01_cfg_script[] = {
|
| 63 |
+
{ GC9A01_START, GC9A01_START},
|
| 64 |
+
{ GC9A01_CMD, 0xEF},
|
| 65 |
+
|
| 66 |
+
{ GC9A01_CMD, 0xEB},
|
| 67 |
+
{ GC9A01_DATA, 0x14},
|
| 68 |
+
|
| 69 |
+
{ GC9A01_CMD, 0xFE}, // Inter Register Enable1
|
| 70 |
+
{ GC9A01_CMD, 0xEF}, // Inter Register Enable2
|
| 71 |
+
|
| 72 |
+
{ GC9A01_CMD, 0xEB},
|
| 73 |
+
{ GC9A01_DATA, 0x14},
|
| 74 |
+
|
| 75 |
+
{ GC9A01_CMD, 0x84},
|
| 76 |
+
{ GC9A01_DATA, 0x40},
|
| 77 |
+
|
| 78 |
+
{ GC9A01_CMD, 0x85},
|
| 79 |
+
{ GC9A01_DATA, 0xFF},
|
| 80 |
+
|
| 81 |
+
{ GC9A01_CMD, 0x86},
|
| 82 |
+
{ GC9A01_DATA, 0xFF},
|
| 83 |
+
|
| 84 |
+
{ GC9A01_CMD, 0x87},
|
| 85 |
+
{ GC9A01_DATA, 0xFF},
|
| 86 |
+
|
| 87 |
+
{ GC9A01_CMD, 0x88},
|
| 88 |
+
{ GC9A01_DATA, 0x0A},
|
| 89 |
+
|
| 90 |
+
{ GC9A01_CMD, 0x89},
|
| 91 |
+
{ GC9A01_DATA, 0x21},
|
| 92 |
+
|
| 93 |
+
{ GC9A01_CMD, 0x8A},
|
| 94 |
+
{ GC9A01_DATA, 0x00},
|
| 95 |
+
|
| 96 |
+
{ GC9A01_CMD, 0x8B},
|
| 97 |
+
{ GC9A01_DATA, 0x80},
|
| 98 |
+
|
| 99 |
+
{ GC9A01_CMD, 0x8C},
|
| 100 |
+
{ GC9A01_DATA, 0x01},
|
| 101 |
+
|
| 102 |
+
{ GC9A01_CMD, 0x8D},
|
| 103 |
+
{ GC9A01_DATA, 0x01},
|
| 104 |
+
|
| 105 |
+
{ GC9A01_CMD, 0x8E},
|
| 106 |
+
{ GC9A01_DATA, 0xFF},
|
| 107 |
+
|
| 108 |
+
{ GC9A01_CMD, 0x8F},
|
| 109 |
+
{ GC9A01_DATA, 0xFF},
|
| 110 |
+
|
| 111 |
+
{ GC9A01_CMD, GC9A01_DISFNCTRL}, // Display Function Control
|
| 112 |
+
{ GC9A01_DATA, 0x00},
|
| 113 |
+
{ GC9A01_DATA, 0x00},
|
| 114 |
+
|
| 115 |
+
{ GC9A01_CMD, GC9A01_MADCTL}, // Memory Access Control
|
| 116 |
+
{ GC9A01_DATA, 0x48}, // Set the display direction 0,1,2,3 four directions
|
| 117 |
+
|
| 118 |
+
{ GC9A01_CMD, GC9A01_COLMOD}, // COLMOD: Pixel Format Set
|
| 119 |
+
{ GC9A01_DATA, 0x05}, // 16 Bits per pixel
|
| 120 |
+
|
| 121 |
+
{ GC9A01_CMD, 0x90},
|
| 122 |
+
{ GC9A01_DATA, 0x08},
|
| 123 |
+
{ GC9A01_DATA, 0x08},
|
| 124 |
+
{ GC9A01_DATA, 0x08},
|
| 125 |
+
{ GC9A01_DATA, 0x08},
|
| 126 |
+
|
| 127 |
+
{ GC9A01_CMD, 0xBD},
|
| 128 |
+
{ GC9A01_DATA, 0x06},
|
| 129 |
+
|
| 130 |
+
{ GC9A01_CMD, 0xBC},
|
| 131 |
+
{ GC9A01_DATA, 0x00},
|
| 132 |
+
|
| 133 |
+
{ GC9A01_CMD, 0xFF},
|
| 134 |
+
{ GC9A01_DATA, 0x60},
|
| 135 |
+
{ GC9A01_DATA, 0x01},
|
| 136 |
+
{ GC9A01_DATA, 0x04},
|
| 137 |
+
|
| 138 |
+
{ GC9A01_CMD, 0xC3}, // Power Control 2
|
| 139 |
+
{ GC9A01_DATA, 0x13},
|
| 140 |
+
{ GC9A01_CMD, 0xC4}, // Power Control 3
|
| 141 |
+
{ GC9A01_DATA, 0x13},
|
| 142 |
+
|
| 143 |
+
{ GC9A01_CMD, 0xC9}, // Power Control 4
|
| 144 |
+
{ GC9A01_DATA, 0x22},
|
| 145 |
+
|
| 146 |
+
{ GC9A01_CMD, 0xBE},
|
| 147 |
+
{ GC9A01_DATA, 0x11},
|
| 148 |
+
|
| 149 |
+
{ GC9A01_CMD, 0xE1},
|
| 150 |
+
{ GC9A01_DATA, 0x10},
|
| 151 |
+
{ GC9A01_DATA, 0x0E},
|
| 152 |
+
|
| 153 |
+
{ GC9A01_CMD, 0xDF},
|
| 154 |
+
{ GC9A01_DATA, 0x21},
|
| 155 |
+
{ GC9A01_DATA, 0x0C},
|
| 156 |
+
{ GC9A01_DATA, 0x02},
|
| 157 |
+
|
| 158 |
+
{ GC9A01_CMD, 0xF0}, // SET_GAMMA1
|
| 159 |
+
{ GC9A01_DATA, 0x45},
|
| 160 |
+
{ GC9A01_DATA, 0x09},
|
| 161 |
+
{ GC9A01_DATA, 0x08},
|
| 162 |
+
{ GC9A01_DATA, 0x08},
|
| 163 |
+
{ GC9A01_DATA, 0x26},
|
| 164 |
+
{ GC9A01_DATA, 0x2A},
|
| 165 |
+
|
| 166 |
+
{ GC9A01_CMD, 0xF1}, // SET_GAMMA2
|
| 167 |
+
{ GC9A01_DATA, 0x43},
|
| 168 |
+
{ GC9A01_DATA, 0x70},
|
| 169 |
+
{ GC9A01_DATA, 0x72},
|
| 170 |
+
{ GC9A01_DATA, 0x36},
|
| 171 |
+
{ GC9A01_DATA, 0x37},
|
| 172 |
+
{ GC9A01_DATA, 0x6F},
|
| 173 |
+
|
| 174 |
+
{ GC9A01_CMD, 0xF2}, // SET_GAMMA3
|
| 175 |
+
{ GC9A01_DATA, 0x45},
|
| 176 |
+
{ GC9A01_DATA, 0x09},
|
| 177 |
+
{ GC9A01_DATA, 0x08},
|
| 178 |
+
{ GC9A01_DATA, 0x08},
|
| 179 |
+
{ GC9A01_DATA, 0x26},
|
| 180 |
+
{ GC9A01_DATA, 0x2A},
|
| 181 |
+
|
| 182 |
+
{ GC9A01_CMD, 0xF3}, // SET_GAMMA4
|
| 183 |
+
{ GC9A01_DATA, 0x43},
|
| 184 |
+
{ GC9A01_DATA, 0x70},
|
| 185 |
+
{ GC9A01_DATA, 0x72},
|
| 186 |
+
{ GC9A01_DATA, 0x36},
|
| 187 |
+
{ GC9A01_DATA, 0x37},
|
| 188 |
+
{ GC9A01_DATA, 0x6F},
|
| 189 |
+
|
| 190 |
+
{ GC9A01_CMD, 0xED},
|
| 191 |
+
{ GC9A01_DATA, 0x1B},
|
| 192 |
+
{ GC9A01_DATA, 0x0B},
|
| 193 |
+
|
| 194 |
+
{ GC9A01_CMD, 0xAE},
|
| 195 |
+
{ GC9A01_DATA, 0x77},
|
| 196 |
+
|
| 197 |
+
{ GC9A01_CMD, 0xCD},
|
| 198 |
+
{ GC9A01_DATA, 0x63},
|
| 199 |
+
|
| 200 |
+
{ GC9A01_CMD, 0x70},
|
| 201 |
+
{ GC9A01_DATA, 0x07},
|
| 202 |
+
{ GC9A01_DATA, 0x07},
|
| 203 |
+
{ GC9A01_DATA, 0x04},
|
| 204 |
+
{ GC9A01_DATA, 0x0E},
|
| 205 |
+
{ GC9A01_DATA, 0x0F},
|
| 206 |
+
{ GC9A01_DATA, 0x09},
|
| 207 |
+
{ GC9A01_DATA, 0x07},
|
| 208 |
+
{ GC9A01_DATA, 0x08},
|
| 209 |
+
{ GC9A01_DATA, 0x03},
|
| 210 |
+
|
| 211 |
+
{ GC9A01_CMD, 0xE8},
|
| 212 |
+
{ GC9A01_DATA, 0x34},
|
| 213 |
+
|
| 214 |
+
{ GC9A01_CMD, 0x62},
|
| 215 |
+
{ GC9A01_DATA, 0x18},
|
| 216 |
+
{ GC9A01_DATA, 0x0D},
|
| 217 |
+
{ GC9A01_DATA, 0x71},
|
| 218 |
+
{ GC9A01_DATA, 0xED},
|
| 219 |
+
{ GC9A01_DATA, 0x70},
|
| 220 |
+
{ GC9A01_DATA, 0x70},
|
| 221 |
+
{ GC9A01_DATA, 0x18},
|
| 222 |
+
{ GC9A01_DATA, 0x0F},
|
| 223 |
+
{ GC9A01_DATA, 0x71},
|
| 224 |
+
{ GC9A01_DATA, 0xEF},
|
| 225 |
+
{ GC9A01_DATA, 0x70},
|
| 226 |
+
{ GC9A01_DATA, 0x70},
|
| 227 |
+
|
| 228 |
+
{ GC9A01_CMD, 0x63},
|
| 229 |
+
{ GC9A01_DATA, 0x18},
|
| 230 |
+
{ GC9A01_DATA, 0x11},
|
| 231 |
+
{ GC9A01_DATA, 0x71},
|
| 232 |
+
{ GC9A01_DATA, 0xF1},
|
| 233 |
+
{ GC9A01_DATA, 0x70},
|
| 234 |
+
{ GC9A01_DATA, 0x70},
|
| 235 |
+
{ GC9A01_DATA, 0x18},
|
| 236 |
+
{ GC9A01_DATA, 0x13},
|
| 237 |
+
{ GC9A01_DATA, 0x71},
|
| 238 |
+
{ GC9A01_DATA, 0xF3},
|
| 239 |
+
{ GC9A01_DATA, 0x70},
|
| 240 |
+
{ GC9A01_DATA, 0x70},
|
| 241 |
+
|
| 242 |
+
{ GC9A01_CMD, 0x64},
|
| 243 |
+
{ GC9A01_DATA, 0x28},
|
| 244 |
+
{ GC9A01_DATA, 0x29},
|
| 245 |
+
{ GC9A01_DATA, 0xF1},
|
| 246 |
+
{ GC9A01_DATA, 0x01},
|
| 247 |
+
{ GC9A01_DATA, 0xF1},
|
| 248 |
+
{ GC9A01_DATA, 0x00},
|
| 249 |
+
{ GC9A01_DATA, 0x07},
|
| 250 |
+
|
| 251 |
+
{ GC9A01_CMD, 0x66},
|
| 252 |
+
{ GC9A01_DATA, 0x3C},
|
| 253 |
+
{ GC9A01_DATA, 0x00},
|
| 254 |
+
{ GC9A01_DATA, 0xCD},
|
| 255 |
+
{ GC9A01_DATA, 0x67},
|
| 256 |
+
{ GC9A01_DATA, 0x45},
|
| 257 |
+
{ GC9A01_DATA, 0x45},
|
| 258 |
+
{ GC9A01_DATA, 0x10},
|
| 259 |
+
{ GC9A01_DATA, 0x00},
|
| 260 |
+
{ GC9A01_DATA, 0x00},
|
| 261 |
+
{ GC9A01_DATA, 0x00},
|
| 262 |
+
|
| 263 |
+
{ GC9A01_CMD, 0x67},
|
| 264 |
+
{ GC9A01_DATA, 0x00},
|
| 265 |
+
{ GC9A01_DATA, 0x3C},
|
| 266 |
+
{ GC9A01_DATA, 0x00},
|
| 267 |
+
{ GC9A01_DATA, 0x00},
|
| 268 |
+
{ GC9A01_DATA, 0x00},
|
| 269 |
+
{ GC9A01_DATA, 0x01},
|
| 270 |
+
{ GC9A01_DATA, 0x54},
|
| 271 |
+
{ GC9A01_DATA, 0x10},
|
| 272 |
+
{ GC9A01_DATA, 0x32},
|
| 273 |
+
{ GC9A01_DATA, 0x98},
|
| 274 |
+
|
| 275 |
+
{ GC9A01_CMD, 0x74},
|
| 276 |
+
{ GC9A01_DATA, 0x10},
|
| 277 |
+
{ GC9A01_DATA, 0x85},
|
| 278 |
+
{ GC9A01_DATA, 0x80},
|
| 279 |
+
{ GC9A01_DATA, 0x00},
|
| 280 |
+
{ GC9A01_DATA, 0x00},
|
| 281 |
+
{ GC9A01_DATA, 0x4E},
|
| 282 |
+
{ GC9A01_DATA, 0x00},
|
| 283 |
+
|
| 284 |
+
{ GC9A01_CMD, 0x98},
|
| 285 |
+
{ GC9A01_DATA, 0x3E},
|
| 286 |
+
{ GC9A01_DATA, 0x07},
|
| 287 |
+
|
| 288 |
+
{ GC9A01_CMD, 0x35}, // Tearing Effect Line ON
|
| 289 |
+
{ GC9A01_CMD, 0x21}, // Display Inversion ON
|
| 290 |
+
|
| 291 |
+
{ GC9A01_CMD, 0x11}, // Sleep Out Mode
|
| 292 |
+
{ GC9A01_DELAY, 120},
|
| 293 |
+
{ GC9A01_CMD, GC9A01_DISPON}, // Display ON
|
| 294 |
+
{ GC9A01_DELAY, 255},
|
| 295 |
+
{ GC9A01_END, GC9A01_END},
|
| 296 |
+
};
|
| 297 |
+
|
| 298 |
+
/**********************
|
| 299 |
+
* MACROS
|
| 300 |
+
**********************/
|
| 301 |
+
|
| 302 |
+
/**********************
|
| 303 |
+
* GLOBAL FUNCTIONS
|
| 304 |
+
**********************/
|
| 305 |
+
|
| 306 |
+
/**
|
| 307 |
+
* Write a command to the GC9A01
|
| 308 |
+
* @param cmd the command
|
| 309 |
+
*/
|
| 310 |
+
static void GC9A01_command(uint8_t cmd)
|
| 311 |
+
{
|
| 312 |
+
LV_DRV_DISP_CMD_DATA(GC9A01_CMD_MODE);
|
| 313 |
+
LV_DRV_DISP_SPI_WR_BYTE(cmd);
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
/**
|
| 317 |
+
* Write data to the GC9A01
|
| 318 |
+
* @param data the data
|
| 319 |
+
*/
|
| 320 |
+
static void GC9A01_data(uint8_t data)
|
| 321 |
+
{
|
| 322 |
+
LV_DRV_DISP_CMD_DATA(GC9A01_DATA_MODE);
|
| 323 |
+
LV_DRV_DISP_SPI_WR_BYTE(data);
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
static int GC9A01_data_array(uint8_t *buf, uint32_t len)
|
| 327 |
+
{
|
| 328 |
+
uint8_t *pt = buf;
|
| 329 |
+
|
| 330 |
+
for (uint32_t lp = 0; lp < len; lp++, pt++)
|
| 331 |
+
{
|
| 332 |
+
LV_DRV_DISP_SPI_WR_BYTE(*pt);
|
| 333 |
+
}
|
| 334 |
+
return 0;
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
static int GC9A01_databuf(uint32_t len, uint8_t *buf)
|
| 338 |
+
{
|
| 339 |
+
uint32_t byte_left = len;
|
| 340 |
+
uint8_t *pt = buf;
|
| 341 |
+
|
| 342 |
+
while (byte_left)
|
| 343 |
+
{
|
| 344 |
+
if (byte_left > 64)
|
| 345 |
+
{
|
| 346 |
+
LV_DRV_DISP_SPI_WR_ARRAY((char*)pt, 64);
|
| 347 |
+
byte_left = byte_left - 64;
|
| 348 |
+
pt = pt + 64;
|
| 349 |
+
}
|
| 350 |
+
else
|
| 351 |
+
{
|
| 352 |
+
LV_DRV_DISP_SPI_WR_ARRAY((char*)pt, byte_left);
|
| 353 |
+
byte_left=0;
|
| 354 |
+
}
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
return 0;
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
// hard reset of the tft controller
|
| 361 |
+
// ----------------------------------------------------------
|
| 362 |
+
static void GC9A01_hard_reset( void )
|
| 363 |
+
{
|
| 364 |
+
LV_DRV_DISP_SPI_CS(0); // Low to listen to us
|
| 365 |
+
|
| 366 |
+
LV_DRV_DISP_RST(1);
|
| 367 |
+
LV_DRV_DELAY_MS(50);
|
| 368 |
+
LV_DRV_DISP_RST(0);
|
| 369 |
+
LV_DRV_DELAY_MS(50);
|
| 370 |
+
LV_DRV_DISP_RST(1);
|
| 371 |
+
LV_DRV_DELAY_MS(50);
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
// Configuration of the tft controller
|
| 375 |
+
// ----------------------------------------------------------
|
| 376 |
+
static void GC9A01_run_cfg_script(void)
|
| 377 |
+
{
|
| 378 |
+
int i = 0;
|
| 379 |
+
int end_script = 0;
|
| 380 |
+
|
| 381 |
+
do {
|
| 382 |
+
switch (GC9A01_cfg_script[i].cmd)
|
| 383 |
+
{
|
| 384 |
+
case GC9A01_START:
|
| 385 |
+
break;
|
| 386 |
+
case GC9A01_CMD:
|
| 387 |
+
GC9A01_command( GC9A01_cfg_script[i].data & 0xFF );
|
| 388 |
+
break;
|
| 389 |
+
case GC9A01_DATA:
|
| 390 |
+
GC9A01_data( GC9A01_cfg_script[i].data & 0xFF );
|
| 391 |
+
break;
|
| 392 |
+
case GC9A01_DELAY:
|
| 393 |
+
LV_DRV_DELAY_MS(GC9A01_cfg_script[i].data);
|
| 394 |
+
break;
|
| 395 |
+
case GC9A01_END:
|
| 396 |
+
end_script = 1;
|
| 397 |
+
}
|
| 398 |
+
i++;
|
| 399 |
+
} while (!end_script);
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
void GC9A01_drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) {
|
| 403 |
+
// Rudimentary clipping
|
| 404 |
+
if((x >= GC9A01_HOR_RES) || (y >= GC9A01_VER_RES)) return;
|
| 405 |
+
if((y+h-1) >= GC9A01_VER_RES) h = GC9A01_VER_RES - y;
|
| 406 |
+
|
| 407 |
+
LV_DRV_DISP_SPI_CS(0); // Listen to us
|
| 408 |
+
|
| 409 |
+
GC9A01_set_addr_win(x, y, x, y + h - 1);
|
| 410 |
+
|
| 411 |
+
uint8_t hi = color >> 8, lo = color;
|
| 412 |
+
|
| 413 |
+
while (h--) {
|
| 414 |
+
GC9A01_data(hi);
|
| 415 |
+
GC9A01_data(lo);
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 419 |
+
}
|
| 420 |
+
|
| 421 |
+
void GC9A01_drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) {
|
| 422 |
+
// Rudimentary clipping
|
| 423 |
+
if((x >= GC9A01_HOR_RES) || (y >= GC9A01_VER_RES)) return;
|
| 424 |
+
if((x+w-1) >= GC9A01_HOR_RES) w = GC9A01_HOR_RES - x;
|
| 425 |
+
|
| 426 |
+
LV_DRV_DISP_SPI_CS(0); // Listen to us
|
| 427 |
+
|
| 428 |
+
GC9A01_set_addr_win(x, y, x + w - 1, y);
|
| 429 |
+
|
| 430 |
+
uint8_t hi = color >> 8, lo = color;
|
| 431 |
+
|
| 432 |
+
while (w--) {
|
| 433 |
+
GC9A01_data(hi);
|
| 434 |
+
GC9A01_data(lo);
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
|
| 441 |
+
// Pass 8-bit (each) R,G,B, get back 16-bit packed color
|
| 442 |
+
uint16_t GC9A01_Color565(uint8_t r, uint8_t g, uint8_t b) {
|
| 443 |
+
return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
void GC9A01_invertDisplay(bool i)
|
| 447 |
+
{
|
| 448 |
+
GC9A01_command(i ? GC9A01_INVON : GC9A01_INVOFF);
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
void GC9A01_drawPixel(int16_t x, int16_t y, uint16_t color)
|
| 452 |
+
{
|
| 453 |
+
if((x < 0) ||(x >= GC9A01_HOR_RES) || (y < 0) || (y >= GC9A01_VER_RES)) return;
|
| 454 |
+
|
| 455 |
+
LV_DRV_DISP_SPI_CS(0); // Listen to us
|
| 456 |
+
GC9A01_set_addr_win(x, y, x, y);
|
| 457 |
+
|
| 458 |
+
uint8_t hi = color >> 8, lo = color;
|
| 459 |
+
|
| 460 |
+
GC9A01_data(hi);
|
| 461 |
+
GC9A01_data(lo);
|
| 462 |
+
|
| 463 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 464 |
+
}
|
| 465 |
+
|
| 466 |
+
void GC9A01_fillScreen(uint16_t color) {
|
| 467 |
+
GC9A01_fillRect(0, 0, GC9A01_HOR_RES, GC9A01_VER_RES, color);
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
// fill a rectangle
|
| 471 |
+
void GC9A01_fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) {
|
| 472 |
+
// rudimentary clipping (drawChar w/big text requires this)
|
| 473 |
+
if((x >= GC9A01_HOR_RES) || (y >= GC9A01_VER_RES)) return;
|
| 474 |
+
if((x + w - 1) >= GC9A01_HOR_RES) w = GC9A01_HOR_RES - x;
|
| 475 |
+
if((y + h - 1) >= GC9A01_VER_RES) h = GC9A01_VER_RES - y;
|
| 476 |
+
|
| 477 |
+
LV_DRV_DISP_SPI_CS(0); // Listen to us
|
| 478 |
+
|
| 479 |
+
GC9A01_set_addr_win(x, y, x + w - 1, y + h - 1);
|
| 480 |
+
|
| 481 |
+
uint8_t hi = color >> 8, lo = color;
|
| 482 |
+
|
| 483 |
+
for (y = h; y > 0; y--)
|
| 484 |
+
{
|
| 485 |
+
for (x = w; x > 0; x--)
|
| 486 |
+
{
|
| 487 |
+
GC9A01_data(hi);
|
| 488 |
+
GC9A01_data(lo);
|
| 489 |
+
}
|
| 490 |
+
}
|
| 491 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
void GC9A01_setRotation(uint8_t m) {
|
| 495 |
+
|
| 496 |
+
GC9A01_command(GC9A01_MADCTL);
|
| 497 |
+
m %= 4; // can't be higher than 3
|
| 498 |
+
switch (m) {
|
| 499 |
+
case 0:
|
| 500 |
+
GC9A01_data(GC9A01_MADCTL_MX | GC9A01_MADCTL_MY | GC9A01_MADCTL_RGB);
|
| 501 |
+
|
| 502 |
+
// _xstart = _colstart;
|
| 503 |
+
// _ystart = _rowstart;
|
| 504 |
+
break;
|
| 505 |
+
case 1:
|
| 506 |
+
GC9A01_data(GC9A01_MADCTL_MY | GC9A01_MADCTL_MV | GC9A01_MADCTL_RGB);
|
| 507 |
+
|
| 508 |
+
// _ystart = _colstart;
|
| 509 |
+
// _xstart = _rowstart;
|
| 510 |
+
break;
|
| 511 |
+
case 2:
|
| 512 |
+
GC9A01_data(GC9A01_MADCTL_RGB);
|
| 513 |
+
|
| 514 |
+
// _xstart = _colstart;
|
| 515 |
+
// _ystart = _rowstart;
|
| 516 |
+
break;
|
| 517 |
+
|
| 518 |
+
case 3:
|
| 519 |
+
GC9A01_data(GC9A01_MADCTL_MX | GC9A01_MADCTL_MV | GC9A01_MADCTL_RGB);
|
| 520 |
+
|
| 521 |
+
// _ystart = _colstart;
|
| 522 |
+
// _xstart = _rowstart;
|
| 523 |
+
break;
|
| 524 |
+
}
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
/**
|
| 528 |
+
* Initialize the GC9A01
|
| 529 |
+
*/
|
| 530 |
+
int GC9A01_init(void)
|
| 531 |
+
{
|
| 532 |
+
LV_DRV_DISP_SPI_FREQ(GC9A01_SPI_BAUD);
|
| 533 |
+
LV_DRV_DISP_SPI_MODE(GC9A01_SPI_BITS, GC9A01_SPI_MODE);
|
| 534 |
+
|
| 535 |
+
GC9A01_hard_reset();
|
| 536 |
+
GC9A01_run_cfg_script();
|
| 537 |
+
|
| 538 |
+
// GC9A01_fillScreen(0x0000); // Black
|
| 539 |
+
// GC9A01_fillScreen(0xFFFF); // White
|
| 540 |
+
GC9A01_fillScreen(0xAAAA); // ?
|
| 541 |
+
|
| 542 |
+
return 0;
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
static void GC9A01_set_addr_win(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
|
| 546 |
+
{
|
| 547 |
+
uint16_t x_start = x0 + GC9A01_XSTART, x_end = x1 + GC9A01_XSTART;
|
| 548 |
+
uint16_t y_start = y0 + GC9A01_YSTART, y_end = y1 + GC9A01_YSTART;
|
| 549 |
+
|
| 550 |
+
GC9A01_command(GC9A01_CASET); // Column addr set
|
| 551 |
+
GC9A01_data(x_start >> 8);
|
| 552 |
+
GC9A01_data(x_start & 0xFF); // XSTART
|
| 553 |
+
GC9A01_data(x_end >> 8);
|
| 554 |
+
GC9A01_data(x_end & 0xFF); // XEND
|
| 555 |
+
|
| 556 |
+
GC9A01_command(GC9A01_RASET); // Row addr set
|
| 557 |
+
GC9A01_data(y_start >> 8);
|
| 558 |
+
GC9A01_data(y_start & 0xFF); // YSTART
|
| 559 |
+
GC9A01_data(y_end >> 8);
|
| 560 |
+
GC9A01_data(y_end & 0xFF); // YEND
|
| 561 |
+
|
| 562 |
+
GC9A01_command(GC9A01_RAMWR);
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
void GC9A01_flush(struct _disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t *color_p)
|
| 566 |
+
{
|
| 567 |
+
LV_DRV_DISP_SPI_CS(0); // Listen to us
|
| 568 |
+
|
| 569 |
+
GC9A01_set_addr_win(area->x1, area->y1, area->x2, area->y2);
|
| 570 |
+
int32_t len = (area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1) * 2;
|
| 571 |
+
|
| 572 |
+
LV_DRV_DISP_CMD_DATA(GC9A01_DATA_MODE);
|
| 573 |
+
LV_DRV_DISP_SPI_WR_ARRAY((char*)color_p, len);
|
| 574 |
+
|
| 575 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 576 |
+
lv_disp_flush_ready(disp_drv); /* Indicate you are ready with the flushing*/
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/GC9A01.h
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @file GC9A01.h
|
| 3 |
+
*
|
| 4 |
+
**/
|
| 5 |
+
|
| 6 |
+
#ifndef GC9A01_H
|
| 7 |
+
#define GC9A01_H
|
| 8 |
+
|
| 9 |
+
#ifdef __cplusplus
|
| 10 |
+
extern "C" {
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
/*********************
|
| 14 |
+
* INCLUDES
|
| 15 |
+
*********************/
|
| 16 |
+
#ifndef LV_DRV_NO_CONF
|
| 17 |
+
#ifdef LV_CONF_INCLUDE_SIMPLE
|
| 18 |
+
#include "lv_drv_conf.h"
|
| 19 |
+
#else
|
| 20 |
+
#include "../../lv_drv_conf.h"
|
| 21 |
+
#endif
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
#if USE_GC9A01
|
| 25 |
+
|
| 26 |
+
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
| 27 |
+
#include "lvgl.h"
|
| 28 |
+
#else
|
| 29 |
+
#include "lvgl/lvgl.h"
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
// #include "../../lv_drv_conf.h"
|
| 33 |
+
// #if USE_GC9A01 != 0
|
| 34 |
+
|
| 35 |
+
// #include <stdint.h>
|
| 36 |
+
// #include "lvgl/lv_misc/lv_color.h"
|
| 37 |
+
|
| 38 |
+
/*********************
|
| 39 |
+
* DEFINES
|
| 40 |
+
*********************/
|
| 41 |
+
|
| 42 |
+
/**********************
|
| 43 |
+
* TYPEDEFS
|
| 44 |
+
**********************/
|
| 45 |
+
|
| 46 |
+
/* Init script function */
|
| 47 |
+
struct GC9A01_function {
|
| 48 |
+
uint16_t cmd;
|
| 49 |
+
uint16_t data;
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
/* Init script commands */
|
| 53 |
+
enum GC9A01_cmd {
|
| 54 |
+
GC9A01_START,
|
| 55 |
+
GC9A01_END,
|
| 56 |
+
GC9A01_CMD,
|
| 57 |
+
GC9A01_DATA,
|
| 58 |
+
GC9A01_DELAY
|
| 59 |
+
};
|
| 60 |
+
|
| 61 |
+
/**********************
|
| 62 |
+
* GLOBAL PROTOTYPES
|
| 63 |
+
**********************/
|
| 64 |
+
|
| 65 |
+
int GC9A01_init(void);
|
| 66 |
+
void GC9A01_flush(struct _disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
|
| 67 |
+
void GC9A01_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
| 68 |
+
void GC9A01_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t * color_p);
|
| 69 |
+
void GC9A01_setRotation(uint8_t m);
|
| 70 |
+
void GC9A01_fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
|
| 71 |
+
void GC9A01_fillScreen(uint16_t color);
|
| 72 |
+
uint16_t GC9A01_Color565(uint8_t r, uint8_t g, uint8_t b);
|
| 73 |
+
void GC9A01_invertDisplay(bool i);
|
| 74 |
+
void GC9A01_drawPixel(int16_t x, int16_t y, uint16_t color);
|
| 75 |
+
void GC9A01_drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
| 76 |
+
void GC9A01_drawFastVLine(int16_t x, int16_t y, int16_t w, uint16_t color);
|
| 77 |
+
|
| 78 |
+
/**********************
|
| 79 |
+
* MACROS
|
| 80 |
+
**********************/
|
| 81 |
+
|
| 82 |
+
#endif /* USE_GC9A01 */
|
| 83 |
+
|
| 84 |
+
#ifdef __cplusplus
|
| 85 |
+
} /* extern "C" */
|
| 86 |
+
#endif
|
| 87 |
+
|
| 88 |
+
#endif /* GC9A01_H */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/ILI9341.c
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @file ILI9341.c
|
| 3 |
+
*
|
| 4 |
+
* ILI9341.pdf [ILI9341_DS_V1.13_20110805]
|
| 5 |
+
*
|
| 6 |
+
* [references]
|
| 7 |
+
* - https://www.newhavendisplay.com/app_notes/ILI9341.pdf
|
| 8 |
+
* - Linux Source [v5.9-rc4] "drivers/staging/fbtft/fb_ili9341.c"
|
| 9 |
+
* - https://github.com/adafruit/Adafruit_ILI9341/blob/master/Adafruit_ILI9341.cpp
|
| 10 |
+
* - https://os.mbed.com/users/dreschpe/code/SPI_TFT_ILI9341
|
| 11 |
+
*
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
/*********************
|
| 15 |
+
* INCLUDES
|
| 16 |
+
*********************/
|
| 17 |
+
#include "ILI9341.h"
|
| 18 |
+
#if USE_ILI9341 != 0
|
| 19 |
+
|
| 20 |
+
#include <stdio.h>
|
| 21 |
+
#include <stdbool.h>
|
| 22 |
+
#include LV_DRV_DISP_INCLUDE
|
| 23 |
+
#include LV_DRV_DELAY_INCLUDE
|
| 24 |
+
|
| 25 |
+
/*********************
|
| 26 |
+
* DEFINES
|
| 27 |
+
*********************/
|
| 28 |
+
#define ILI9341_CMD_MODE 0
|
| 29 |
+
#define ILI9341_DATA_MODE 1
|
| 30 |
+
|
| 31 |
+
#define ILI9341_TFTWIDTH 240
|
| 32 |
+
#define ILI9341_TFTHEIGHT 320
|
| 33 |
+
|
| 34 |
+
/* Level 1 Commands -------------- [section] Description */
|
| 35 |
+
|
| 36 |
+
#define ILI9341_NOP 0x00 /* [8.2.1 ] No Operation / Terminate Frame Memory Write */
|
| 37 |
+
#define ILI9341_SWRESET 0x01 /* [8.2.2 ] Software Reset */
|
| 38 |
+
#define ILI9341_RDDIDIF 0x04 /* [8.2.3 ] Read Display Identification Information */
|
| 39 |
+
#define ILI9341_RDDST 0x09 /* [8.2.4 ] Read Display Status */
|
| 40 |
+
#define ILI9341_RDDPM 0x0A /* [8.2.5 ] Read Display Power Mode */
|
| 41 |
+
#define ILI9341_RDDMADCTL 0x0B /* [8.2.6 ] Read Display MADCTL */
|
| 42 |
+
#define ILI9341_RDDCOLMOD 0x0C /* [8.2.7 ] Read Display Pixel Format */
|
| 43 |
+
#define ILI9341_RDDIM 0x0D /* [8.2.8 ] Read Display Image Mode */
|
| 44 |
+
#define ILI9341_RDDSM 0x0E /* [8.2.9 ] Read Display Signal Mode */
|
| 45 |
+
#define ILI9341_RDDSDR 0x0F /* [8.2.10] Read Display Self-Diagnostic Result */
|
| 46 |
+
#define ILI9341_SLPIN 0x10 /* [8.2.11] Enter Sleep Mode */
|
| 47 |
+
#define ILI9341_SLPOUT 0x11 /* [8.2.12] Leave Sleep Mode */
|
| 48 |
+
#define ILI9341_PTLON 0x12 /* [8.2.13] Partial Display Mode ON */
|
| 49 |
+
#define ILI9341_NORON 0x13 /* [8.2.14] Normal Display Mode ON */
|
| 50 |
+
#define ILI9341_DINVOFF 0x20 /* [8.2.15] Display Inversion OFF */
|
| 51 |
+
#define ILI9341_DINVON 0x21 /* [8.2.16] Display Inversion ON */
|
| 52 |
+
#define ILI9341_GAMSET 0x26 /* [8.2.17] Gamma Set */
|
| 53 |
+
#define ILI9341_DISPOFF 0x28 /* [8.2.18] Display OFF*/
|
| 54 |
+
#define ILI9341_DISPON 0x29 /* [8.2.19] Display ON*/
|
| 55 |
+
#define ILI9341_CASET 0x2A /* [8.2.20] Column Address Set */
|
| 56 |
+
#define ILI9341_PASET 0x2B /* [8.2.21] Page Address Set */
|
| 57 |
+
#define ILI9341_RAMWR 0x2C /* [8.2.22] Memory Write */
|
| 58 |
+
#define ILI9341_RGBSET 0x2D /* [8.2.23] Color Set (LUT for 16-bit to 18-bit color depth conversion) */
|
| 59 |
+
#define ILI9341_RAMRD 0x2E /* [8.2.24] Memory Read */
|
| 60 |
+
#define ILI9341_PTLAR 0x30 /* [8.2.25] Partial Area */
|
| 61 |
+
#define ILI9341_VSCRDEF 0x33 /* [8.2.26] Veritcal Scrolling Definition */
|
| 62 |
+
#define ILI9341_TEOFF 0x34 /* [8.2.27] Tearing Effect Line OFF */
|
| 63 |
+
#define ILI9341_TEON 0x35 /* [8.2.28] Tearing Effect Line ON */
|
| 64 |
+
#define ILI9341_MADCTL 0x36 /* [8.2.29] Memory Access Control */
|
| 65 |
+
#define MADCTL_MY 0x80 /* MY row address order */
|
| 66 |
+
#define MADCTL_MX 0x40 /* MX column address order */
|
| 67 |
+
#define MADCTL_MV 0x20 /* MV row / column exchange */
|
| 68 |
+
#define MADCTL_ML 0x10 /* ML vertical refresh order */
|
| 69 |
+
#define MADCTL_MH 0x04 /* MH horizontal refresh order */
|
| 70 |
+
#define MADCTL_RGB 0x00 /* RGB Order [default] */
|
| 71 |
+
#define MADCTL_BGR 0x08 /* BGR Order */
|
| 72 |
+
#define ILI9341_VSCRSADD 0x37 /* [8.2.30] Vertical Scrolling Start Address */
|
| 73 |
+
#define ILI9341_IDMOFF 0x38 /* [8.2.31] Idle Mode OFF */
|
| 74 |
+
#define ILI9341_IDMON 0x39 /* [8.2.32] Idle Mode ON */
|
| 75 |
+
#define ILI9341_PIXSET 0x3A /* [8.2.33] Pixel Format Set */
|
| 76 |
+
#define ILI9341_WRMEMCONT 0x3C /* [8.2.34] Write Memory Continue */
|
| 77 |
+
#define ILI9341_RDMEMCONT 0x3E /* [8.2.35] Read Memory Continue */
|
| 78 |
+
#define ILI9341_SETSCANTE 0x44 /* [8.2.36] Set Tear Scanline */
|
| 79 |
+
#define ILI9341_GETSCAN 0x45 /* [8.2.37] Get Scanline */
|
| 80 |
+
#define ILI9341_WRDISBV 0x51 /* [8.2.38] Write Display Brightness Value */
|
| 81 |
+
#define ILI9341_RDDISBV 0x52 /* [8.2.39] Read Display Brightness Value */
|
| 82 |
+
#define ILI9341_WRCTRLD 0x53 /* [8.2.40] Write Control Display */
|
| 83 |
+
#define ILI9341_RDCTRLD 0x54 /* [8.2.41] Read Control Display */
|
| 84 |
+
#define ILI9341_WRCABC 0x55 /* [8.2.42] Write Content Adaptive Brightness Control Value */
|
| 85 |
+
#define ILI9341_RDCABC 0x56 /* [8.2.43] Read Content Adaptive Brightness Control Value */
|
| 86 |
+
#define ILI9341_WRCABCMIN 0x5E /* [8.2.44] Write CABC Minimum Brightness */
|
| 87 |
+
#define ILI9341_RDCABCMIN 0x5F /* [8.2.45] Read CABC Minimum Brightness */
|
| 88 |
+
#define ILI9341_RDID1 0xDA /* [8.2.46] Read ID1 - Manufacturer ID (user) */
|
| 89 |
+
#define ILI9341_RDID2 0xDB /* [8.2.47] Read ID2 - Module/Driver version (supplier) */
|
| 90 |
+
#define ILI9341_RDID3 0xDC /* [8.2.48] Read ID3 - Module/Driver version (user) */
|
| 91 |
+
|
| 92 |
+
/* Level 2 Commands -------------- [section] Description */
|
| 93 |
+
|
| 94 |
+
#define ILI9341_IFMODE 0xB0 /* [8.3.1 ] Interface Mode Control */
|
| 95 |
+
#define ILI9341_FRMCTR1 0xB1 /* [8.3.2 ] Frame Rate Control (In Normal Mode/Full Colors) */
|
| 96 |
+
#define ILI9341_FRMCTR2 0xB2 /* [8.3.3 ] Frame Rate Control (In Idle Mode/8 colors) */
|
| 97 |
+
#define ILI9341_FRMCTR3 0xB3 /* [8.3.4 ] Frame Rate control (In Partial Mode/Full Colors) */
|
| 98 |
+
#define ILI9341_INVTR 0xB4 /* [8.3.5 ] Display Inversion Control */
|
| 99 |
+
#define ILI9341_PRCTR 0xB5 /* [8.3.6 ] Blanking Porch Control */
|
| 100 |
+
#define ILI9341_DISCTRL 0xB6 /* [8.3.7 ] Display Function Control */
|
| 101 |
+
#define ILI9341_ETMOD 0xB7 /* [8.3.8 ] Entry Mode Set */
|
| 102 |
+
#define ILI9341_BLCTRL1 0xB8 /* [8.3.9 ] Backlight Control 1 - Grayscale Histogram UI mode */
|
| 103 |
+
#define ILI9341_BLCTRL2 0xB9 /* [8.3.10] Backlight Control 2 - Grayscale Histogram still picture mode */
|
| 104 |
+
#define ILI9341_BLCTRL3 0xBA /* [8.3.11] Backlight Control 3 - Grayscale Thresholds UI mode */
|
| 105 |
+
#define ILI9341_BLCTRL4 0xBB /* [8.3.12] Backlight Control 4 - Grayscale Thresholds still picture mode */
|
| 106 |
+
#define ILI9341_BLCTRL5 0xBC /* [8.3.13] Backlight Control 5 - Brightness Transition time */
|
| 107 |
+
#define ILI9341_BLCTRL7 0xBE /* [8.3.14] Backlight Control 7 - PWM Frequency */
|
| 108 |
+
#define ILI9341_BLCTRL8 0xBF /* [8.3.15] Backlight Control 8 - ON/OFF + PWM Polarity*/
|
| 109 |
+
#define ILI9341_PWCTRL1 0xC0 /* [8.3.16] Power Control 1 - GVDD */
|
| 110 |
+
#define ILI9341_PWCTRL2 0xC1 /* [8.3.17] Power Control 2 - step-up factor for operating voltage */
|
| 111 |
+
#define ILI9341_VMCTRL1 0xC5 /* [8.3.18] VCOM Control 1 - Set VCOMH and VCOML */
|
| 112 |
+
#define ILI9341_VMCTRL2 0xC7 /* [8.3.19] VCOM Control 2 - VCOM offset voltage */
|
| 113 |
+
#define ILI9341_NVMWR 0xD0 /* [8.3.20] NV Memory Write */
|
| 114 |
+
#define ILI9341_NVMPKEY 0xD1 /* [8.3.21] NV Memory Protection Key */
|
| 115 |
+
#define ILI9341_RDNVM 0xD2 /* [8.3.22] NV Memory Status Read */
|
| 116 |
+
#define ILI9341_RDID4 0xD3 /* [8.3.23] Read ID4 - IC Device Code */
|
| 117 |
+
#define ILI9341_PGAMCTRL 0xE0 /* [8.3.24] Positive Gamma Control */
|
| 118 |
+
#define ILI9341_NGAMCTRL 0xE1 /* [8.3.25] Negative Gamma Correction */
|
| 119 |
+
#define ILI9341_DGAMCTRL1 0xE2 /* [8.3.26] Digital Gamma Control 1 */
|
| 120 |
+
#define ILI9341_DGAMCTRL2 0xE3 /* [8.3.27] Digital Gamma Control 2 */
|
| 121 |
+
#define ILI9341_IFCTL 0xF6 /* [8.3.28] 16bits Data Format Selection */
|
| 122 |
+
|
| 123 |
+
/* Extended Commands --------------- [section] Description*/
|
| 124 |
+
|
| 125 |
+
#define ILI9341_PWCTRLA 0xCB /* [8.4.1] Power control A */
|
| 126 |
+
#define ILI9341_PWCTRLB 0xCF /* [8.4.2] Power control B */
|
| 127 |
+
#define ILI9341_TIMECTRLA_INT 0xE8 /* [8.4.3] Internal Clock Driver timing control A */
|
| 128 |
+
#define ILI9341_TIMECTRLA_EXT 0xE9 /* [8.4.4] External Clock Driver timing control A */
|
| 129 |
+
#define ILI9341_TIMECTRLB 0xEA /* [8.4.5] Driver timing control B (gate driver timing control) */
|
| 130 |
+
#define ILI9341_PWSEQCTRL 0xED /* [8.4.6] Power on sequence control */
|
| 131 |
+
#define ILI9341_GAM3CTRL 0xF2 /* [8.4.7] Enable 3 gamma control */
|
| 132 |
+
#define ILI9341_PUMPRATIO 0xF7 /* [8.4.8] Pump ratio control */
|
| 133 |
+
|
| 134 |
+
/**********************
|
| 135 |
+
* TYPEDEFS
|
| 136 |
+
**********************/
|
| 137 |
+
|
| 138 |
+
/**********************
|
| 139 |
+
* STATIC PROTOTYPES
|
| 140 |
+
**********************/
|
| 141 |
+
static inline void ili9341_write(int mode, uint8_t data);
|
| 142 |
+
static inline void ili9341_write_array(int mode, uint8_t *data, uint16_t len);
|
| 143 |
+
|
| 144 |
+
/**********************
|
| 145 |
+
* STATIC VARIABLES
|
| 146 |
+
**********************/
|
| 147 |
+
|
| 148 |
+
/**********************
|
| 149 |
+
* MACROS
|
| 150 |
+
**********************/
|
| 151 |
+
|
| 152 |
+
/**********************
|
| 153 |
+
* GLOBAL FUNCTIONS
|
| 154 |
+
**********************/
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* Initialize the ILI9341 display controller
|
| 158 |
+
*/
|
| 159 |
+
void ili9341_init(void)
|
| 160 |
+
{
|
| 161 |
+
uint8_t data[15];
|
| 162 |
+
|
| 163 |
+
/* hardware reset */
|
| 164 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 165 |
+
LV_DRV_DISP_CMD_DATA(ILI9341_DATA_MODE);
|
| 166 |
+
LV_DRV_DISP_RST(0);
|
| 167 |
+
LV_DRV_DELAY_US(50);
|
| 168 |
+
LV_DRV_DISP_RST(1);
|
| 169 |
+
LV_DRV_DELAY_MS(5);
|
| 170 |
+
|
| 171 |
+
/* software reset */
|
| 172 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_SWRESET);
|
| 173 |
+
LV_DRV_DELAY_MS(5);
|
| 174 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_DISPOFF);
|
| 175 |
+
|
| 176 |
+
/* startup sequence */
|
| 177 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PWCTRLB);
|
| 178 |
+
data[0] = 0x00;
|
| 179 |
+
data[1] = 0x83;
|
| 180 |
+
data[2] = 0x30;
|
| 181 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 3);
|
| 182 |
+
|
| 183 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PWSEQCTRL);
|
| 184 |
+
data[0] = 0x64;
|
| 185 |
+
data[1] = 0x03;
|
| 186 |
+
data[2] = 0x12;
|
| 187 |
+
data[3] = 0x81;
|
| 188 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 4);
|
| 189 |
+
|
| 190 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_TIMECTRLA_INT);
|
| 191 |
+
data[0] = 0x85;
|
| 192 |
+
data[1] = 0x01;
|
| 193 |
+
data[2] = 0x79;
|
| 194 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 3);
|
| 195 |
+
|
| 196 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PWCTRLA);
|
| 197 |
+
data[0] = 0x39;
|
| 198 |
+
data[1] = 0x2c;
|
| 199 |
+
data[2] = 0x00;
|
| 200 |
+
data[3] = 0x34;
|
| 201 |
+
data[4] = 0x02;
|
| 202 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 5);
|
| 203 |
+
|
| 204 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PUMPRATIO);
|
| 205 |
+
ili9341_write(ILI9341_DATA_MODE, 0x20);
|
| 206 |
+
|
| 207 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_TIMECTRLB);
|
| 208 |
+
data[0] = 0x00;
|
| 209 |
+
data[1] = 0x00;
|
| 210 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 2);
|
| 211 |
+
|
| 212 |
+
/* power control */
|
| 213 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PWCTRL1);
|
| 214 |
+
ili9341_write(ILI9341_DATA_MODE, 0x26);
|
| 215 |
+
|
| 216 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PWCTRL2);
|
| 217 |
+
ili9341_write(ILI9341_DATA_MODE, 0x11);
|
| 218 |
+
|
| 219 |
+
/* VCOM */
|
| 220 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_VMCTRL1);
|
| 221 |
+
data[0] = 0x35;
|
| 222 |
+
data[1] = 0x3e;
|
| 223 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 2);
|
| 224 |
+
|
| 225 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_VMCTRL2);
|
| 226 |
+
ili9341_write(ILI9341_DATA_MODE, 0xbe);
|
| 227 |
+
|
| 228 |
+
/* set orientation */
|
| 229 |
+
ili9341_rotate(0, ILI9341_BGR);
|
| 230 |
+
|
| 231 |
+
/* 16 bit pixel */
|
| 232 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PIXSET);
|
| 233 |
+
ili9341_write(ILI9341_DATA_MODE, 0x55);
|
| 234 |
+
|
| 235 |
+
/* frame rate */
|
| 236 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_FRMCTR1);
|
| 237 |
+
data[0] = 0x00;
|
| 238 |
+
data[1] = 0x1b;
|
| 239 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 2);
|
| 240 |
+
|
| 241 |
+
#if ILI9341_GAMMA
|
| 242 |
+
/* gamma curve set */
|
| 243 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_GAMSET);
|
| 244 |
+
ili9341_write(ILI9341_DATA_MODE, 0x01);
|
| 245 |
+
|
| 246 |
+
/* positive gamma correction */
|
| 247 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PGAMCTRL);
|
| 248 |
+
data[0] = 0x1f;
|
| 249 |
+
data[1] = 0x1a;
|
| 250 |
+
data[2] = 0x18;
|
| 251 |
+
data[3] = 0x0a;
|
| 252 |
+
data[4] = 0x0f;
|
| 253 |
+
data[5] = 0x06;
|
| 254 |
+
data[6] = 0x45;
|
| 255 |
+
data[7] = 0x87;
|
| 256 |
+
data[8] = 0x32;
|
| 257 |
+
data[9] = 0x0a;
|
| 258 |
+
data[10] = 0x07;
|
| 259 |
+
data[11] = 0x02;
|
| 260 |
+
data[12] = 0x07;
|
| 261 |
+
data[13] = 0x05;
|
| 262 |
+
data[14] = 0x00;
|
| 263 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 15);
|
| 264 |
+
|
| 265 |
+
/* negative gamma correction */
|
| 266 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_NGAMCTRL);
|
| 267 |
+
data[0] = 0x00;
|
| 268 |
+
data[1] = 0x25;
|
| 269 |
+
data[2] = 0x27;
|
| 270 |
+
data[3] = 0x05;
|
| 271 |
+
data[4] = 0x10;
|
| 272 |
+
data[5] = 0x09;
|
| 273 |
+
data[6] = 0x3a;
|
| 274 |
+
data[7] = 0x78;
|
| 275 |
+
data[8] = 0x4d;
|
| 276 |
+
data[9] = 0x05;
|
| 277 |
+
data[10] = 0x18;
|
| 278 |
+
data[11] = 0x0d;
|
| 279 |
+
data[12] = 0x38;
|
| 280 |
+
data[13] = 0x3a;
|
| 281 |
+
data[14] = 0x1f;
|
| 282 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 15);
|
| 283 |
+
#endif
|
| 284 |
+
|
| 285 |
+
/* window horizontal */
|
| 286 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_CASET);
|
| 287 |
+
data[0] = 0;
|
| 288 |
+
data[1] = 0;
|
| 289 |
+
data[2] = (ILI9341_HOR_RES - 1) >> 8;
|
| 290 |
+
data[3] = (ILI9341_HOR_RES - 1);
|
| 291 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 4);
|
| 292 |
+
|
| 293 |
+
/* window vertical */
|
| 294 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PASET);
|
| 295 |
+
data[0] = 0;
|
| 296 |
+
data[1] = 0;
|
| 297 |
+
data[2] = (ILI9341_VER_RES - 1) >> 8;
|
| 298 |
+
data[3] = (ILI9341_VER_RES - 1);
|
| 299 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 4);
|
| 300 |
+
|
| 301 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_RAMWR);
|
| 302 |
+
|
| 303 |
+
#if ILI9341_TEARING
|
| 304 |
+
/* tearing effect off */
|
| 305 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_TEOFF);
|
| 306 |
+
|
| 307 |
+
/* tearing effect on */
|
| 308 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_TEON);
|
| 309 |
+
#endif
|
| 310 |
+
|
| 311 |
+
/* entry mode set */
|
| 312 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_ETMOD);
|
| 313 |
+
ili9341_write(ILI9341_DATA_MODE, 0x07);
|
| 314 |
+
|
| 315 |
+
/* display function control */
|
| 316 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_DISCTRL);
|
| 317 |
+
data[0] = 0x0a;
|
| 318 |
+
data[1] = 0x82;
|
| 319 |
+
data[2] = 0x27;
|
| 320 |
+
data[3] = 0x00;
|
| 321 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 4);
|
| 322 |
+
|
| 323 |
+
/* exit sleep mode */
|
| 324 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_SLPOUT);
|
| 325 |
+
|
| 326 |
+
LV_DRV_DELAY_MS(100);
|
| 327 |
+
|
| 328 |
+
/* display on */
|
| 329 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_DISPON);
|
| 330 |
+
|
| 331 |
+
LV_DRV_DELAY_MS(20);
|
| 332 |
+
}
|
| 333 |
+
|
| 334 |
+
void ili9341_flush(lv_disp_drv_t * drv, const lv_area_t * area, const lv_color_t * color_p)
|
| 335 |
+
{
|
| 336 |
+
if(area->x2 < 0 || area->y2 < 0 || area->x1 > (ILI9341_HOR_RES - 1) || area->y1 > (ILI9341_VER_RES - 1)) {
|
| 337 |
+
lv_disp_flush_ready(drv);
|
| 338 |
+
return;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
/* Truncate the area to the screen */
|
| 342 |
+
int32_t act_x1 = area->x1 < 0 ? 0 : area->x1;
|
| 343 |
+
int32_t act_y1 = area->y1 < 0 ? 0 : area->y1;
|
| 344 |
+
int32_t act_x2 = area->x2 > ILI9341_HOR_RES - 1 ? ILI9341_HOR_RES - 1 : area->x2;
|
| 345 |
+
int32_t act_y2 = area->y2 > ILI9341_VER_RES - 1 ? ILI9341_VER_RES - 1 : area->y2;
|
| 346 |
+
|
| 347 |
+
int32_t y;
|
| 348 |
+
uint8_t data[4];
|
| 349 |
+
int32_t len = len = (act_x2 - act_x1 + 1) * 2;
|
| 350 |
+
lv_coord_t w = (area->x2 - area->x1) + 1;
|
| 351 |
+
|
| 352 |
+
/* window horizontal */
|
| 353 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_CASET);
|
| 354 |
+
data[0] = act_x1 >> 8;
|
| 355 |
+
data[1] = act_x1;
|
| 356 |
+
data[2] = act_x2 >> 8;
|
| 357 |
+
data[3] = act_x2;
|
| 358 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 4);
|
| 359 |
+
|
| 360 |
+
/* window vertical */
|
| 361 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_PASET);
|
| 362 |
+
data[0] = act_y1 >> 8;
|
| 363 |
+
data[1] = act_y1;
|
| 364 |
+
data[2] = act_y2 >> 8;
|
| 365 |
+
data[3] = act_y2;
|
| 366 |
+
ili9341_write_array(ILI9341_DATA_MODE, data, 4);
|
| 367 |
+
|
| 368 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_RAMWR);
|
| 369 |
+
|
| 370 |
+
for(y = act_y1; y <= act_y2; y++) {
|
| 371 |
+
ili9341_write_array(ILI9341_DATA_MODE, (uint8_t *)color_p, len);
|
| 372 |
+
color_p += w;
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
lv_disp_flush_ready(drv);
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
void ili9341_rotate(int degrees, bool bgr)
|
| 379 |
+
{
|
| 380 |
+
uint8_t color_order = MADCTL_RGB;
|
| 381 |
+
|
| 382 |
+
if(bgr)
|
| 383 |
+
color_order = MADCTL_BGR;
|
| 384 |
+
|
| 385 |
+
ili9341_write(ILI9341_CMD_MODE, ILI9341_MADCTL);
|
| 386 |
+
|
| 387 |
+
switch(degrees) {
|
| 388 |
+
case 270:
|
| 389 |
+
ili9341_write(ILI9341_DATA_MODE, MADCTL_MV | color_order);
|
| 390 |
+
break;
|
| 391 |
+
case 180:
|
| 392 |
+
ili9341_write(ILI9341_DATA_MODE, MADCTL_MY | color_order);
|
| 393 |
+
break;
|
| 394 |
+
case 90:
|
| 395 |
+
ili9341_write(ILI9341_DATA_MODE, MADCTL_MX | MADCTL_MY | MADCTL_MV | color_order);
|
| 396 |
+
break;
|
| 397 |
+
case 0:
|
| 398 |
+
/* fall-through */
|
| 399 |
+
default:
|
| 400 |
+
ili9341_write(ILI9341_DATA_MODE, MADCTL_MX | color_order);
|
| 401 |
+
break;
|
| 402 |
+
}
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
/**********************
|
| 406 |
+
* STATIC FUNCTIONS
|
| 407 |
+
**********************/
|
| 408 |
+
|
| 409 |
+
/**
|
| 410 |
+
* Write byte
|
| 411 |
+
* @param mode sets command or data mode for write
|
| 412 |
+
* @param byte the byte to write
|
| 413 |
+
*/
|
| 414 |
+
static inline void ili9341_write(int mode, uint8_t data)
|
| 415 |
+
{
|
| 416 |
+
LV_DRV_DISP_CMD_DATA(mode);
|
| 417 |
+
LV_DRV_DISP_SPI_WR_BYTE(data);
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
/**
|
| 421 |
+
* Write byte array
|
| 422 |
+
* @param mode sets command or data mode for write
|
| 423 |
+
* @param data the byte array to write
|
| 424 |
+
* @param len the length of the byte array
|
| 425 |
+
*/
|
| 426 |
+
static inline void ili9341_write_array(int mode, uint8_t *data, uint16_t len)
|
| 427 |
+
{
|
| 428 |
+
LV_DRV_DISP_CMD_DATA(mode);
|
| 429 |
+
LV_DRV_DISP_SPI_WR_ARRAY(data, len);
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/ILI9341.h
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @file ILI9341.h
|
| 3 |
+
*
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
#ifndef ILI9341_H
|
| 7 |
+
#define ILI9341_H
|
| 8 |
+
|
| 9 |
+
#ifdef __cplusplus
|
| 10 |
+
extern "C" {
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
/*********************
|
| 14 |
+
* INCLUDES
|
| 15 |
+
*********************/
|
| 16 |
+
#include <stdbool.h>
|
| 17 |
+
#ifndef LV_DRV_NO_CONF
|
| 18 |
+
#ifdef LV_CONF_INCLUDE_SIMPLE
|
| 19 |
+
#include "lv_drv_conf.h"
|
| 20 |
+
#else
|
| 21 |
+
#include "../../lv_drv_conf.h"
|
| 22 |
+
#endif
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
#if USE_ILI9341
|
| 26 |
+
|
| 27 |
+
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
| 28 |
+
#include "lvgl.h"
|
| 29 |
+
#else
|
| 30 |
+
#include "lvgl/lvgl.h"
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
#if LV_COLOR_DEPTH != 16
|
| 34 |
+
#error "ILI9341 currently supports 'LV_COLOR_DEPTH == 16'. Set it in lv_conf.h"
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
#if LV_COLOR_16_SWAP != 1
|
| 38 |
+
#error "ILI9341 SPI requires LV_COLOR_16_SWAP == 1. Set it in lv_conf.h"
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
/*********************
|
| 42 |
+
* DEFINES
|
| 43 |
+
*********************/
|
| 44 |
+
#define ILI9341_BGR true
|
| 45 |
+
#define ILI9341_RGB false
|
| 46 |
+
|
| 47 |
+
/**********************
|
| 48 |
+
* TYPEDEFS
|
| 49 |
+
**********************/
|
| 50 |
+
|
| 51 |
+
/**********************
|
| 52 |
+
* GLOBAL PROTOTYPES
|
| 53 |
+
**********************/
|
| 54 |
+
void ili9341_init(void);
|
| 55 |
+
void ili9341_flush(lv_disp_drv_t * drv, const lv_area_t * area, const lv_color_t * color_p);
|
| 56 |
+
void ili9341_rotate(int degrees, bool bgr);
|
| 57 |
+
/**********************
|
| 58 |
+
* MACROS
|
| 59 |
+
**********************/
|
| 60 |
+
|
| 61 |
+
#endif /* USE_ILI9341 */
|
| 62 |
+
|
| 63 |
+
#ifdef __cplusplus
|
| 64 |
+
} /* extern "C" */
|
| 65 |
+
#endif
|
| 66 |
+
|
| 67 |
+
#endif /* ILI9341_H */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/R61581.c
ADDED
|
@@ -0,0 +1,425 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @file R61581.c
|
| 3 |
+
*
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
/*********************
|
| 7 |
+
* INCLUDES
|
| 8 |
+
*********************/
|
| 9 |
+
#include "R61581.h"
|
| 10 |
+
#if USE_R61581 != 0
|
| 11 |
+
|
| 12 |
+
#include <stdbool.h>
|
| 13 |
+
#include "lvgl/lv_core/lv_vdb.h"
|
| 14 |
+
#include LV_DRV_DISP_INCLUDE
|
| 15 |
+
#include LV_DRV_DELAY_INCLUDE
|
| 16 |
+
|
| 17 |
+
/*********************
|
| 18 |
+
* DEFINES
|
| 19 |
+
*********************/
|
| 20 |
+
#define R61581_CMD_MODE 0
|
| 21 |
+
#define R61581_DATA_MODE 1
|
| 22 |
+
|
| 23 |
+
/**********************
|
| 24 |
+
* TYPEDEFS
|
| 25 |
+
**********************/
|
| 26 |
+
|
| 27 |
+
/**********************
|
| 28 |
+
* STATIC PROTOTYPES
|
| 29 |
+
**********************/
|
| 30 |
+
static void r61581_io_init(void);
|
| 31 |
+
static void r61581_reset(void);
|
| 32 |
+
static void r61581_set_tft_spec(void);
|
| 33 |
+
static inline void r61581_cmd_mode(void);
|
| 34 |
+
static inline void r61581_data_mode(void);
|
| 35 |
+
static inline void r61581_cmd(uint8_t cmd);
|
| 36 |
+
static inline void r61581_data(uint8_t data);
|
| 37 |
+
|
| 38 |
+
/**********************
|
| 39 |
+
* STATIC VARIABLES
|
| 40 |
+
**********************/
|
| 41 |
+
static bool cmd_mode = true;
|
| 42 |
+
|
| 43 |
+
/**********************
|
| 44 |
+
* MACROS
|
| 45 |
+
**********************/
|
| 46 |
+
|
| 47 |
+
/**********************
|
| 48 |
+
* GLOBAL FUNCTIONS
|
| 49 |
+
**********************/
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Initialize the R61581 display controller
|
| 53 |
+
* @return HW_RES_OK or any error from hw_res_t enum
|
| 54 |
+
*/
|
| 55 |
+
void r61581_init(void)
|
| 56 |
+
{
|
| 57 |
+
r61581_io_init();
|
| 58 |
+
|
| 59 |
+
/*Slow mode until the PLL is not started in the display controller*/
|
| 60 |
+
LV_DRV_DISP_PAR_SLOW;
|
| 61 |
+
|
| 62 |
+
r61581_reset();
|
| 63 |
+
|
| 64 |
+
r61581_set_tft_spec();
|
| 65 |
+
|
| 66 |
+
r61581_cmd(0x13); //SET display on
|
| 67 |
+
|
| 68 |
+
r61581_cmd(0x29); //SET display on
|
| 69 |
+
LV_DRV_DELAY_MS(30);
|
| 70 |
+
|
| 71 |
+
/*Parallel to max speed*/
|
| 72 |
+
LV_DRV_DISP_PAR_FAST;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
void r61581_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
|
| 76 |
+
{
|
| 77 |
+
/*Return if the area is out the screen*/
|
| 78 |
+
if(x2 < 0) return;
|
| 79 |
+
if(y2 < 0) return;
|
| 80 |
+
if(x1 > R61581_HOR_RES - 1) return;
|
| 81 |
+
if(y1 > R61581_VER_RES - 1) return;
|
| 82 |
+
|
| 83 |
+
/*Truncate the area to the screen*/
|
| 84 |
+
int32_t act_x1 = x1 < 0 ? 0 : x1;
|
| 85 |
+
int32_t act_y1 = y1 < 0 ? 0 : y1;
|
| 86 |
+
int32_t act_x2 = x2 > R61581_HOR_RES - 1 ? R61581_HOR_RES - 1 : x2;
|
| 87 |
+
int32_t act_y2 = y2 > R61581_VER_RES - 1 ? R61581_VER_RES - 1 : y2;
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
//Set the rectangular area
|
| 91 |
+
r61581_cmd(0x002A);
|
| 92 |
+
r61581_data(act_x1 >> 8);
|
| 93 |
+
r61581_data(0x00FF & act_x1);
|
| 94 |
+
r61581_data(act_x2 >> 8);
|
| 95 |
+
r61581_data(0x00FF & act_x2);
|
| 96 |
+
|
| 97 |
+
r61581_cmd(0x002B);
|
| 98 |
+
r61581_data(act_y1 >> 8);
|
| 99 |
+
r61581_data(0x00FF & act_y1);
|
| 100 |
+
r61581_data(act_y2 >> 8);
|
| 101 |
+
r61581_data(0x00FF & act_y2);
|
| 102 |
+
|
| 103 |
+
r61581_cmd(0x2c);
|
| 104 |
+
|
| 105 |
+
int16_t i;
|
| 106 |
+
uint16_t full_w = x2 - x1 + 1;
|
| 107 |
+
|
| 108 |
+
r61581_data_mode();
|
| 109 |
+
|
| 110 |
+
#if LV_COLOR_DEPTH == 16
|
| 111 |
+
uint16_t act_w = act_x2 - act_x1 + 1;
|
| 112 |
+
for(i = act_y1; i <= act_y2; i++) {
|
| 113 |
+
LV_DRV_DISP_PAR_WR_ARRAY((uint16_t *)color_p, act_w);
|
| 114 |
+
color_p += full_w;
|
| 115 |
+
}
|
| 116 |
+
#else
|
| 117 |
+
int16_t j;
|
| 118 |
+
for(i = act_y1; i <= act_y2; i++) {
|
| 119 |
+
for(j = 0; j <= act_x2 - act_x1 + 1; j++) {
|
| 120 |
+
LV_DRV_DISP_PAR_WR_WORD(lv_color_to16(color_p[j]));
|
| 121 |
+
color_p += full_w;
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
#endif
|
| 125 |
+
|
| 126 |
+
lv_flush_ready();
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
void r61581_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color)
|
| 130 |
+
{
|
| 131 |
+
/*Return if the area is out the screen*/
|
| 132 |
+
if(x2 < 0) return;
|
| 133 |
+
if(y2 < 0) return;
|
| 134 |
+
if(x1 > R61581_HOR_RES - 1) return;
|
| 135 |
+
if(y1 > R61581_VER_RES - 1) return;
|
| 136 |
+
|
| 137 |
+
/*Truncate the area to the screen*/
|
| 138 |
+
int32_t act_x1 = x1 < 0 ? 0 : x1;
|
| 139 |
+
int32_t act_y1 = y1 < 0 ? 0 : y1;
|
| 140 |
+
int32_t act_x2 = x2 > R61581_HOR_RES - 1 ? R61581_HOR_RES - 1 : x2;
|
| 141 |
+
int32_t act_y2 = y2 > R61581_VER_RES - 1 ? R61581_VER_RES - 1 : y2;
|
| 142 |
+
|
| 143 |
+
//Set the rectangular area
|
| 144 |
+
r61581_cmd(0x002A);
|
| 145 |
+
r61581_data(act_x1 >> 8);
|
| 146 |
+
r61581_data(0x00FF & act_x1);
|
| 147 |
+
r61581_data(act_x2 >> 8);
|
| 148 |
+
r61581_data(0x00FF & act_x2);
|
| 149 |
+
|
| 150 |
+
r61581_cmd(0x002B);
|
| 151 |
+
r61581_data(act_y1 >> 8);
|
| 152 |
+
r61581_data(0x00FF & act_y1);
|
| 153 |
+
r61581_data(act_y2 >> 8);
|
| 154 |
+
r61581_data(0x00FF & act_y2);
|
| 155 |
+
|
| 156 |
+
r61581_cmd(0x2c);
|
| 157 |
+
|
| 158 |
+
r61581_data_mode();
|
| 159 |
+
|
| 160 |
+
uint16_t color16 = lv_color_to16(color);
|
| 161 |
+
uint32_t size = (act_x2 - act_x1 + 1) * (act_y2 - act_y1 + 1);
|
| 162 |
+
uint32_t i;
|
| 163 |
+
for(i = 0; i < size; i++) {
|
| 164 |
+
LV_DRV_DISP_PAR_WR_WORD(color16);
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
void r61581_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
|
| 169 |
+
{
|
| 170 |
+
/*Return if the area is out the screen*/
|
| 171 |
+
if(x2 < 0) return;
|
| 172 |
+
if(y2 < 0) return;
|
| 173 |
+
if(x1 > R61581_HOR_RES - 1) return;
|
| 174 |
+
if(y1 > R61581_VER_RES - 1) return;
|
| 175 |
+
|
| 176 |
+
/*Truncate the area to the screen*/
|
| 177 |
+
int32_t act_x1 = x1 < 0 ? 0 : x1;
|
| 178 |
+
int32_t act_y1 = y1 < 0 ? 0 : y1;
|
| 179 |
+
int32_t act_x2 = x2 > R61581_HOR_RES - 1 ? R61581_HOR_RES - 1 : x2;
|
| 180 |
+
int32_t act_y2 = y2 > R61581_VER_RES - 1 ? R61581_VER_RES - 1 : y2;
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
//Set the rectangular area
|
| 184 |
+
r61581_cmd(0x002A);
|
| 185 |
+
r61581_data(act_x1 >> 8);
|
| 186 |
+
r61581_data(0x00FF & act_x1);
|
| 187 |
+
r61581_data(act_x2 >> 8);
|
| 188 |
+
r61581_data(0x00FF & act_x2);
|
| 189 |
+
|
| 190 |
+
r61581_cmd(0x002B);
|
| 191 |
+
r61581_data(act_y1 >> 8);
|
| 192 |
+
r61581_data(0x00FF & act_y1);
|
| 193 |
+
r61581_data(act_y2 >> 8);
|
| 194 |
+
r61581_data(0x00FF & act_y2);
|
| 195 |
+
|
| 196 |
+
r61581_cmd(0x2c);
|
| 197 |
+
|
| 198 |
+
int16_t i;
|
| 199 |
+
uint16_t full_w = x2 - x1 + 1;
|
| 200 |
+
|
| 201 |
+
r61581_data_mode();
|
| 202 |
+
|
| 203 |
+
#if LV_COLOR_DEPTH == 16
|
| 204 |
+
uint16_t act_w = act_x2 - act_x1 + 1;
|
| 205 |
+
for(i = act_y1; i <= act_y2; i++) {
|
| 206 |
+
LV_DRV_DISP_PAR_WR_ARRAY((uint16_t *)color_p, act_w);
|
| 207 |
+
color_p += full_w;
|
| 208 |
+
}
|
| 209 |
+
#else
|
| 210 |
+
int16_t j;
|
| 211 |
+
for(i = act_y1; i <= act_y2; i++) {
|
| 212 |
+
for(j = 0; j <= act_x2 - act_x1 + 1; j++) {
|
| 213 |
+
LV_DRV_DISP_PAR_WR_WORD(lv_color_to16(color_p[j]));
|
| 214 |
+
color_p += full_w;
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
#endif
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
/**********************
|
| 221 |
+
* STATIC FUNCTIONS
|
| 222 |
+
**********************/
|
| 223 |
+
|
| 224 |
+
/**
|
| 225 |
+
* Io init
|
| 226 |
+
*/
|
| 227 |
+
static void r61581_io_init(void)
|
| 228 |
+
{
|
| 229 |
+
LV_DRV_DISP_CMD_DATA(R61581_CMD_MODE)
|
| 230 |
+
cmd_mode = true;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
/**
|
| 234 |
+
* Reset
|
| 235 |
+
*/
|
| 236 |
+
static void r61581_reset(void)
|
| 237 |
+
{
|
| 238 |
+
/*Hardware reset*/
|
| 239 |
+
LV_DRV_DISP_RST(1);
|
| 240 |
+
LV_DRV_DELAY_MS(50);
|
| 241 |
+
LV_DRV_DISP_RST(0);
|
| 242 |
+
LV_DRV_DELAY_MS(50);
|
| 243 |
+
LV_DRV_DISP_RST(1);
|
| 244 |
+
LV_DRV_DELAY_MS(50);
|
| 245 |
+
|
| 246 |
+
/*Chip enable*/
|
| 247 |
+
LV_DRV_DISP_PAR_CS(1);
|
| 248 |
+
LV_DRV_DELAY_MS(10);
|
| 249 |
+
LV_DRV_DISP_PAR_CS(0);
|
| 250 |
+
LV_DRV_DELAY_MS(5);
|
| 251 |
+
|
| 252 |
+
/*Software reset*/
|
| 253 |
+
r61581_cmd(0x01);
|
| 254 |
+
LV_DRV_DELAY_MS(20);
|
| 255 |
+
|
| 256 |
+
r61581_cmd(0x01);
|
| 257 |
+
LV_DRV_DELAY_MS(20);
|
| 258 |
+
|
| 259 |
+
r61581_cmd(0x01);
|
| 260 |
+
LV_DRV_DELAY_MS(20);
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
/**
|
| 264 |
+
* TFT specific initialization
|
| 265 |
+
*/
|
| 266 |
+
static void r61581_set_tft_spec(void)
|
| 267 |
+
{
|
| 268 |
+
r61581_cmd(0xB0);
|
| 269 |
+
r61581_data(0x00);
|
| 270 |
+
|
| 271 |
+
r61581_cmd(0xB3);
|
| 272 |
+
r61581_data(0x02);
|
| 273 |
+
r61581_data(0x00);
|
| 274 |
+
r61581_data(0x00);
|
| 275 |
+
r61581_data(0x10);
|
| 276 |
+
|
| 277 |
+
r61581_cmd(0xB4);
|
| 278 |
+
r61581_data(0x00);//0X10
|
| 279 |
+
|
| 280 |
+
r61581_cmd(0xB9); //PWM
|
| 281 |
+
r61581_data(0x01);
|
| 282 |
+
r61581_data(0xFF); //FF brightness
|
| 283 |
+
r61581_data(0xFF);
|
| 284 |
+
r61581_data(0x18);
|
| 285 |
+
|
| 286 |
+
/*Panel Driving Setting*/
|
| 287 |
+
r61581_cmd(0xC0);
|
| 288 |
+
r61581_data(0x02);
|
| 289 |
+
r61581_data(0x3B);
|
| 290 |
+
r61581_data(0x00);
|
| 291 |
+
r61581_data(0x00);
|
| 292 |
+
r61581_data(0x00);
|
| 293 |
+
r61581_data(0x01);
|
| 294 |
+
r61581_data(0x00);//NW
|
| 295 |
+
r61581_data(0x43);
|
| 296 |
+
|
| 297 |
+
/*Display Timing Setting for Normal Mode */
|
| 298 |
+
r61581_cmd(0xC1);
|
| 299 |
+
r61581_data(0x08);
|
| 300 |
+
r61581_data(0x15); //CLOCK
|
| 301 |
+
r61581_data(R61581_VFP);
|
| 302 |
+
r61581_data(R61581_VBP);
|
| 303 |
+
|
| 304 |
+
/*Source/VCOM/Gate Driving Timing Setting*/
|
| 305 |
+
r61581_cmd(0xC4);
|
| 306 |
+
r61581_data(0x15);
|
| 307 |
+
r61581_data(0x03);
|
| 308 |
+
r61581_data(0x03);
|
| 309 |
+
r61581_data(0x01);
|
| 310 |
+
|
| 311 |
+
/*Interface Setting*/
|
| 312 |
+
r61581_cmd(0xC6);
|
| 313 |
+
r61581_data((R61581_DPL << 0) |
|
| 314 |
+
(R61581_EPL << 1) |
|
| 315 |
+
(R61581_HSPL << 4) |
|
| 316 |
+
(R61581_VSPL << 5));
|
| 317 |
+
|
| 318 |
+
/*Gamma Set*/
|
| 319 |
+
r61581_cmd(0xC8);
|
| 320 |
+
r61581_data(0x0c);
|
| 321 |
+
r61581_data(0x05);
|
| 322 |
+
r61581_data(0x0A);
|
| 323 |
+
r61581_data(0x6B);
|
| 324 |
+
r61581_data(0x04);
|
| 325 |
+
r61581_data(0x06);
|
| 326 |
+
r61581_data(0x15);
|
| 327 |
+
r61581_data(0x10);
|
| 328 |
+
r61581_data(0x00);
|
| 329 |
+
r61581_data(0x31);
|
| 330 |
+
|
| 331 |
+
|
| 332 |
+
r61581_cmd(0x36);
|
| 333 |
+
if(R61581_ORI == 0) r61581_data(0xE0);
|
| 334 |
+
else r61581_data(0x20);
|
| 335 |
+
|
| 336 |
+
r61581_cmd(0x0C);
|
| 337 |
+
r61581_data(0x55);
|
| 338 |
+
|
| 339 |
+
r61581_cmd(0x3A);
|
| 340 |
+
r61581_data(0x55);
|
| 341 |
+
|
| 342 |
+
r61581_cmd(0x38);
|
| 343 |
+
|
| 344 |
+
r61581_cmd(0xD0);
|
| 345 |
+
r61581_data(0x07);
|
| 346 |
+
r61581_data(0x07);
|
| 347 |
+
r61581_data(0x14);
|
| 348 |
+
r61581_data(0xA2);
|
| 349 |
+
|
| 350 |
+
r61581_cmd(0xD1);
|
| 351 |
+
r61581_data(0x03);
|
| 352 |
+
r61581_data(0x5A);
|
| 353 |
+
r61581_data(0x10);
|
| 354 |
+
|
| 355 |
+
r61581_cmd(0xD2);
|
| 356 |
+
r61581_data(0x03);
|
| 357 |
+
r61581_data(0x04);
|
| 358 |
+
r61581_data(0x04);
|
| 359 |
+
|
| 360 |
+
r61581_cmd(0x11);
|
| 361 |
+
LV_DRV_DELAY_MS(10);
|
| 362 |
+
|
| 363 |
+
r61581_cmd(0x2A);
|
| 364 |
+
r61581_data(0x00);
|
| 365 |
+
r61581_data(0x00);
|
| 366 |
+
r61581_data(((R61581_HOR_RES - 1) >> 8) & 0XFF);
|
| 367 |
+
r61581_data((R61581_HOR_RES - 1) & 0XFF);
|
| 368 |
+
|
| 369 |
+
r61581_cmd(0x2B);
|
| 370 |
+
r61581_data(0x00);
|
| 371 |
+
r61581_data(0x00);
|
| 372 |
+
r61581_data(((R61581_VER_RES - 1) >> 8) & 0XFF);
|
| 373 |
+
r61581_data((R61581_VER_RES - 1) & 0XFF);
|
| 374 |
+
|
| 375 |
+
LV_DRV_DELAY_MS(10);
|
| 376 |
+
|
| 377 |
+
r61581_cmd(0x29);
|
| 378 |
+
LV_DRV_DELAY_MS(5);
|
| 379 |
+
|
| 380 |
+
r61581_cmd(0x2C);
|
| 381 |
+
LV_DRV_DELAY_MS(5);
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
/**
|
| 385 |
+
* Command mode
|
| 386 |
+
*/
|
| 387 |
+
static inline void r61581_cmd_mode(void)
|
| 388 |
+
{
|
| 389 |
+
if(cmd_mode == false) {
|
| 390 |
+
LV_DRV_DISP_CMD_DATA(R61581_CMD_MODE)
|
| 391 |
+
cmd_mode = true;
|
| 392 |
+
}
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
/**
|
| 396 |
+
* Data mode
|
| 397 |
+
*/
|
| 398 |
+
static inline void r61581_data_mode(void)
|
| 399 |
+
{
|
| 400 |
+
if(cmd_mode != false) {
|
| 401 |
+
LV_DRV_DISP_CMD_DATA(R61581_DATA_MODE);
|
| 402 |
+
cmd_mode = false;
|
| 403 |
+
}
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
/**
|
| 407 |
+
* Write command
|
| 408 |
+
* @param cmd the command
|
| 409 |
+
*/
|
| 410 |
+
static inline void r61581_cmd(uint8_t cmd)
|
| 411 |
+
{
|
| 412 |
+
r61581_cmd_mode();
|
| 413 |
+
LV_DRV_DISP_PAR_WR_WORD(cmd);
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
/**
|
| 417 |
+
* Write data
|
| 418 |
+
* @param data the data
|
| 419 |
+
*/
|
| 420 |
+
static inline void r61581_data(uint8_t data)
|
| 421 |
+
{
|
| 422 |
+
r61581_data_mode();
|
| 423 |
+
LV_DRV_DISP_PAR_WR_WORD(data);
|
| 424 |
+
}
|
| 425 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/R61581.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @file R61581.h
|
| 3 |
+
*
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
#ifndef R61581_H
|
| 7 |
+
#define R61581_H
|
| 8 |
+
|
| 9 |
+
#ifdef __cplusplus
|
| 10 |
+
extern "C" {
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
/*********************
|
| 14 |
+
* INCLUDES
|
| 15 |
+
*********************/
|
| 16 |
+
#ifndef LV_DRV_NO_CONF
|
| 17 |
+
#ifdef LV_CONF_INCLUDE_SIMPLE
|
| 18 |
+
#include "lv_drv_conf.h"
|
| 19 |
+
#else
|
| 20 |
+
#include "../../lv_drv_conf.h"
|
| 21 |
+
#endif
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
#if USE_R61581
|
| 25 |
+
|
| 26 |
+
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
| 27 |
+
#include "lvgl.h"
|
| 28 |
+
#else
|
| 29 |
+
#include "lvgl/lvgl.h"
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
/*********************
|
| 33 |
+
* DEFINES
|
| 34 |
+
*********************/
|
| 35 |
+
|
| 36 |
+
/**********************
|
| 37 |
+
* TYPEDEFS
|
| 38 |
+
**********************/
|
| 39 |
+
|
| 40 |
+
/**********************
|
| 41 |
+
* GLOBAL PROTOTYPES
|
| 42 |
+
**********************/
|
| 43 |
+
void r61581_init(void);
|
| 44 |
+
void r61581_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
|
| 45 |
+
void r61581_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
| 46 |
+
void r61581_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
|
| 47 |
+
/**********************
|
| 48 |
+
* MACROS
|
| 49 |
+
**********************/
|
| 50 |
+
|
| 51 |
+
#endif /* USE_R61581 */
|
| 52 |
+
|
| 53 |
+
#ifdef __cplusplus
|
| 54 |
+
} /* extern "C" */
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#endif /* R61581_H */
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/SHARP_MIP.c
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @file SHARP_MIP.c
|
| 3 |
+
*
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
/*-------------------------------------------------------------------------------------------------
|
| 7 |
+
* SHARP memory in pixel monochrome display series
|
| 8 |
+
* LS012B7DD01 (184x38 pixels.)
|
| 9 |
+
* LS013B7DH03 (128x128 pixels.)
|
| 10 |
+
* LS013B7DH05 (144x168 pixels.)
|
| 11 |
+
* LS027B7DH01 (400x240 pixels.) (tested)
|
| 12 |
+
* LS032B7DD02 (336x536 pixels.)
|
| 13 |
+
* LS044Q7DH01 (320x240 pixels.)
|
| 14 |
+
*
|
| 15 |
+
* These displays need periodic com inversion, there are two ways :
|
| 16 |
+
* - software com inversion :
|
| 17 |
+
* define SHARP_MIP_SOFT_COM_INVERSION 1 and set EXTMODE display pin LOW,
|
| 18 |
+
* call sharp_mip_com_inversion() periodically
|
| 19 |
+
* - hardware com inversion with EXTCOMIN display pin :
|
| 20 |
+
* define SHARP_MIP_SOFT_COM_INVERSION 0,
|
| 21 |
+
* set EXTMODE display pin HIGH and handle
|
| 22 |
+
* EXTCOMIN waveform (for example with mcu pwm output),
|
| 23 |
+
* see datasheet pages 8-12 for details
|
| 24 |
+
*
|
| 25 |
+
* draw_buf size : (LV_VER_RES / X) * (2 + LV_HOR_RES / 8) + 2 bytes, structure :
|
| 26 |
+
* [FRAME_HEADER (1 byte)] [GATE_ADDR (1 byte )] [LINE_DATA (LV_HOR_RES / 8 bytes)] 1st line
|
| 27 |
+
* [DUMMY (1 byte)] [GATE_ADDR (1 byte )] [LINE_DATA (LV_HOR_RES / 8 bytes)] 2nd line
|
| 28 |
+
* ...........................................................................................
|
| 29 |
+
* [DUMMY (1 byte)] [GATE_ADDR (1 byte )] [LINE_DATA (LV_HOR_RES / 8 bytes)] last line
|
| 30 |
+
* [DUMMY (2 bytes)]
|
| 31 |
+
*
|
| 32 |
+
* Since extra bytes (dummy, addresses, header) are stored in draw_buf, we need to use
|
| 33 |
+
* an "oversized" draw_buf. Buffer declaration in "lv_port_disp.c" becomes for example :
|
| 34 |
+
* static lv_disp_buf_t disp_buf;
|
| 35 |
+
* static uint8_t buf[(LV_VER_RES_MAX / X) * (2 + (LV_HOR_RES_MAX / 8)) + 2];
|
| 36 |
+
* lv_disp_buf_init(&disp_buf, buf, NULL, LV_VER_RES_MAX * LV_HOR_RES_MAX / X);
|
| 37 |
+
*-----------------------------------------------------------------------------------------------*/
|
| 38 |
+
|
| 39 |
+
/*********************
|
| 40 |
+
* INCLUDES
|
| 41 |
+
*********************/
|
| 42 |
+
|
| 43 |
+
#include "SHARP_MIP.h"
|
| 44 |
+
|
| 45 |
+
#if USE_SHARP_MIP
|
| 46 |
+
|
| 47 |
+
#include <stdbool.h>
|
| 48 |
+
#include LV_DRV_DISP_INCLUDE
|
| 49 |
+
#include LV_DRV_DELAY_INCLUDE
|
| 50 |
+
|
| 51 |
+
/*********************
|
| 52 |
+
* DEFINES
|
| 53 |
+
*********************/
|
| 54 |
+
|
| 55 |
+
#define SHARP_MIP_HEADER 0
|
| 56 |
+
#define SHARP_MIP_UPDATE_RAM_FLAG (1 << 7) /* (M0) Mode flag : H -> update memory, L -> maintain memory */
|
| 57 |
+
#define SHARP_MIP_COM_INVERSION_FLAG (1 << 6) /* (M1) Frame inversion flag : relevant when EXTMODE = L, */
|
| 58 |
+
/* H -> outputs VCOM = H, L -> outputs VCOM = L */
|
| 59 |
+
#define SHARP_MIP_CLEAR_SCREEN_FLAG (1 << 5) /* (M2) All clear flag : H -> clear all pixels */
|
| 60 |
+
|
| 61 |
+
/**********************
|
| 62 |
+
* TYPEDEFS
|
| 63 |
+
**********************/
|
| 64 |
+
|
| 65 |
+
/**********************
|
| 66 |
+
* STATIC PROTOTYPES
|
| 67 |
+
**********************/
|
| 68 |
+
|
| 69 |
+
/**********************
|
| 70 |
+
* STATIC VARIABLES
|
| 71 |
+
**********************/
|
| 72 |
+
|
| 73 |
+
#if SHARP_MIP_SOFT_COM_INVERSION
|
| 74 |
+
static bool_t com_output_state = false;
|
| 75 |
+
#endif
|
| 76 |
+
|
| 77 |
+
/**********************
|
| 78 |
+
* MACROS
|
| 79 |
+
**********************/
|
| 80 |
+
|
| 81 |
+
/*
|
| 82 |
+
* Return the draw_buf byte index corresponding to the pixel
|
| 83 |
+
* relatives coordinates (x, y) in the area.
|
| 84 |
+
* The area is rounded to a whole screen line.
|
| 85 |
+
*/
|
| 86 |
+
#define BUFIDX(x, y) (((x) >> 3) + ((y) * (2 + (SHARP_MIP_HOR_RES >> 3))) + 2)
|
| 87 |
+
|
| 88 |
+
/*
|
| 89 |
+
* Return the byte bitmask of a pixel bit corresponding
|
| 90 |
+
* to draw_buf arrangement (8 pixels per byte on lines).
|
| 91 |
+
*/
|
| 92 |
+
#define PIXIDX(x) SHARP_MIP_REV_BYTE(1 << ((x) & 7))
|
| 93 |
+
|
| 94 |
+
/**********************
|
| 95 |
+
* GLOBAL FUNCTIONS
|
| 96 |
+
**********************/
|
| 97 |
+
|
| 98 |
+
void sharp_mip_init(void) {
|
| 99 |
+
/* These displays have nothing to initialize */
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
void sharp_mip_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) {
|
| 104 |
+
|
| 105 |
+
/*Return if the area is out the screen*/
|
| 106 |
+
if(area->y2 < 0) return;
|
| 107 |
+
if(area->y1 > SHARP_MIP_VER_RES - 1) return;
|
| 108 |
+
|
| 109 |
+
/*Truncate the area to the screen*/
|
| 110 |
+
uint16_t act_y1 = area->y1 < 0 ? 0 : area->y1;
|
| 111 |
+
uint16_t act_y2 = area->y2 > SHARP_MIP_VER_RES - 1 ? SHARP_MIP_VER_RES - 1 : area->y2;
|
| 112 |
+
|
| 113 |
+
uint8_t * buf = (uint8_t *) color_p; /*Get the buffer address*/
|
| 114 |
+
uint16_t buf_h = (act_y2 - act_y1 + 1); /*Number of buffer lines*/
|
| 115 |
+
uint16_t buf_size = buf_h * (2 + SHARP_MIP_HOR_RES / 8) + 2; /*Buffer size in bytes */
|
| 116 |
+
|
| 117 |
+
/* Set lines to flush dummy byte & gate address in draw_buf*/
|
| 118 |
+
for(uint16_t act_y = 0 ; act_y < buf_h ; act_y++) {
|
| 119 |
+
buf[BUFIDX(0, act_y) - 1] = SHARP_MIP_REV_BYTE((act_y1 + act_y + 1));
|
| 120 |
+
buf[BUFIDX(0, act_y) - 2] = 0;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
/* Set last dummy two bytes in draw_buf */
|
| 124 |
+
buf[BUFIDX(0, buf_h) - 1] = 0;
|
| 125 |
+
buf[BUFIDX(0, buf_h) - 2] = 0;
|
| 126 |
+
|
| 127 |
+
/* Set frame header in draw_buf */
|
| 128 |
+
buf[0] = SHARP_MIP_HEADER |
|
| 129 |
+
SHARP_MIP_UPDATE_RAM_FLAG;
|
| 130 |
+
|
| 131 |
+
/* Write the frame on display memory */
|
| 132 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 133 |
+
LV_DRV_DISP_SPI_WR_ARRAY(buf, buf_size);
|
| 134 |
+
LV_DRV_DISP_SPI_CS(0);
|
| 135 |
+
|
| 136 |
+
lv_disp_flush_ready(disp_drv);
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
void sharp_mip_set_px(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa) {
|
| 140 |
+
(void) disp_drv;
|
| 141 |
+
(void) buf_w;
|
| 142 |
+
(void) opa;
|
| 143 |
+
|
| 144 |
+
if (lv_color_to1(color) != 0) {
|
| 145 |
+
buf[BUFIDX(x, y)] |= PIXIDX(x); /*Set draw_buf pixel bit to 1 for other colors than BLACK*/
|
| 146 |
+
} else {
|
| 147 |
+
buf[BUFIDX(x, y)] &= ~PIXIDX(x); /*Set draw_buf pixel bit to 0 for BLACK color*/
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
void sharp_mip_rounder(lv_disp_drv_t * disp_drv, lv_area_t * area) {
|
| 152 |
+
(void) disp_drv;
|
| 153 |
+
|
| 154 |
+
/* Round area to a whole line */
|
| 155 |
+
area->x1 = 0;
|
| 156 |
+
area->x2 = SHARP_MIP_HOR_RES - 1;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
#if SHARP_MIP_SOFT_COM_INVERSION
|
| 160 |
+
void sharp_mip_com_inversion(void) {
|
| 161 |
+
uint8_t inversion_header[2] = {0};
|
| 162 |
+
|
| 163 |
+
/* Set inversion header */
|
| 164 |
+
if (com_output_state) {
|
| 165 |
+
com_output_state = false;
|
| 166 |
+
} else {
|
| 167 |
+
inversion_header[0] |= SHARP_MIP_COM_INVERSION_FLAG;
|
| 168 |
+
com_output_state = true;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
/* Write inversion header on display memory */
|
| 172 |
+
LV_DRV_DISP_SPI_CS(1);
|
| 173 |
+
LV_DRV_DISP_SPI_WR_ARRAY(inversion_header, 2);
|
| 174 |
+
LV_DRV_DISP_SPI_CS(0);
|
| 175 |
+
}
|
| 176 |
+
#endif
|
| 177 |
+
|
| 178 |
+
/**********************
|
| 179 |
+
* STATIC FUNCTIONS
|
| 180 |
+
**********************/
|
| 181 |
+
|
| 182 |
+
#endif
|
Floatkyun_Ultra-Vision/GUI/GUIguider_Project/lvgl-simulator/lv_drivers/display/SHARP_MIP.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @file SHARP_MIP.h
|
| 3 |
+
*
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
#ifndef SHARP_MIP_H
|
| 7 |
+
#define SHARP_MIP_H
|
| 8 |
+
|
| 9 |
+
#ifdef __cplusplus
|
| 10 |
+
extern "C" {
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
/*********************
|
| 14 |
+
* INCLUDES
|
| 15 |
+
*********************/
|
| 16 |
+
|
| 17 |
+
#ifndef LV_DRV_NO_CONF
|
| 18 |
+
#ifdef LV_CONF_INCLUDE_SIMPLE
|
| 19 |
+
#include "lv_drv_conf.h"
|
| 20 |
+
#else
|
| 21 |
+
#include "../../lv_drv_conf.h"
|
| 22 |
+
#endif
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
#if USE_SHARP_MIP
|
| 26 |
+
|
| 27 |
+
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
| 28 |
+
#include "lvgl.h"
|
| 29 |
+
#else
|
| 30 |
+
#include "lvgl/lvgl.h"
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
/*********************
|
| 35 |
+
* DEFINES
|
| 36 |
+
*********************/
|
| 37 |
+
|
| 38 |
+
/**********************
|
| 39 |
+
* TYPEDEFS
|
| 40 |
+
**********************/
|
| 41 |
+
|
| 42 |
+
/**********************
|
| 43 |
+
* GLOBAL PROTOTYPES
|
| 44 |
+
**********************/
|
| 45 |
+
void sharp_mip_init(void);
|
| 46 |
+
void sharp_mip_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
|
| 47 |
+
void sharp_mip_rounder(lv_disp_drv_t * disp_drv, lv_area_t * area);
|
| 48 |
+
void sharp_mip_set_px(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa);
|
| 49 |
+
#if SHARP_MIP_SOFT_COM_INVERSION
|
| 50 |
+
void sharp_mip_com_inversion(void);
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
/**********************
|
| 54 |
+
* MACROS
|
| 55 |
+
**********************/
|
| 56 |
+
|
| 57 |
+
#endif /* USE_SHARP_MIP */
|
| 58 |
+
|
| 59 |
+
#ifdef __cplusplus
|
| 60 |
+
} /* extern "C" */
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
#endif /* SHARP_MIP_H */
|