2 //since the array of const in delphi is not C compatible:
3 {$IFDEF FPC}
5 {**
6 * \brief The maximum size of a log message
7 *
8 * Messages longer than the maximum size will be truncated
9 *}
10 const
11 SDL_MAX_LOG_MESSAGE = 4096;
13 {**
14 * \brief The predefined log categories
15 *
16 * By default the application category is enabled at the INFO level,
17 * the assert category is enabled at the WARN level, test is enabled
18 * at the VERBOSE level and all other categories are enabled at the
19 * CRITICAL level.
20 *}
21 type
22 TSDL_LogCategory = (SDL_LOG_CATEGORY_APPLICATION,
23 SDL_LOG_CATEGORY_ERROR,
24 SDL_LOG_CATEGORY_ASSERT,
25 SDL_LOG_CATEGORY_SYSTEM,
26 SDL_LOG_CATEGORY_AUDIO,
27 SDL_LOG_CATEGORY_VIDEO,
28 SDL_LOG_CATEGORY_RENDER,
29 SDL_LOG_CATEGORY_INPUT,
30 SDL_LOG_CATEGORY_TEST,
32 {* Reserved for future SDL library use *}
33 SDL_LOG_CATEGORY_RESERVED1,
34 SDL_LOG_CATEGORY_RESERVED2,
35 SDL_LOG_CATEGORY_RESERVED3,
36 SDL_LOG_CATEGORY_RESERVED4,
37 SDL_LOG_CATEGORY_RESERVED5,
38 SDL_LOG_CATEGORY_RESERVED6,
39 SDL_LOG_CATEGORY_RESERVED7,
40 SDL_LOG_CATEGORY_RESERVED8,
41 SDL_LOG_CATEGORY_RESERVED9,
42 SDL_LOG_CATEGORY_RESERVED10,
44 {* Beyond this point is reserved for application use *}
45 SDL_LOG_CATEGORY_CUSTOM);
47 {**
48 * \brief The predefined log priorities
49 *}
50 const
51 SDL_LOG_PRIORITY_VERBOSE = 1;
52 SDL_LOG_PRIORITY_DEBUG = 2;
53 SDL_LOG_PRIORITY_INFO = 3;
54 SDL_LOG_PRIORITY_WARN = 4;
55 SDL_LOG_PRIORITY_ERROR = 5;
56 SDL_LOG_PRIORITY_CRITICAL = 6;
57 SDL_NUM_LOG_PRIORITIES = 7;
58 type
59 TSDL_LogPriority = Integer;
62 {**
63 * \brief Set the priority of all log categories
64 *}
65 procedure SDL_LogSetAllPriority(priority: TSDL_LogPriority) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogSetAllPriority' {$ENDIF} {$ENDIF};
67 {**
68 * \brief Set the priority of a particular log category
69 *}
70 procedure SDL_LogSetPriority(category: Integer; priority: TSDL_LogPriority) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogSetPriority' {$ENDIF} {$ENDIF};
72 {**
73 * \brief Get the priority of a particular log category
74 *}
75 function SDL_LogGetPriority(category: Integer): TSDL_LogPriority cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogGetPriority' {$ENDIF} {$ENDIF};
77 {**
78 * \brief Reset all priorities to default.
79 *
80 * \note This is called in SDL_Quit().
81 *}
82 procedure SDL_LogResetPriorities() cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogResetPriorities' {$ENDIF} {$ENDIF};
84 {**
85 * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
86 *}
87 procedure SDL_Log(const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_Log' {$ENDIF} {$ENDIF};
89 {**
90 * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
91 *}
92 procedure SDL_LogVerbose(category: Integer; const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogVerbose' {$ENDIF} {$ENDIF};
94 {**
95 * \brief Log a message with SDL_LOG_PRIORITY_DEBUG
96 *}
97 procedure SDL_LogDebug(category: Integer; const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogDebug' {$ENDIF} {$ENDIF};
99 {**
100 * \brief Log a message with SDL_LOG_PRIORITY_INFO
101 *}
102 procedure SDL_LogInfo(category: Integer; const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogInfo' {$ENDIF} {$ENDIF};
104 {**
105 * \brief Log a message with SDL_LOG_PRIORITY_WARN
106 *}
107 procedure SDL_LogWarn(category: Integer; const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogWarn' {$ENDIF} {$ENDIF};
109 {**
110 * \brief Log a message with SDL_LOG_PRIORITY_ERROR
111 *}
112 procedure SDL_LogError(category: Integer; const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogError' {$ENDIF} {$ENDIF};
114 {**
115 * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
116 *}
117 procedure SDL_LogCritical(category: Integer; const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogCritical' {$ENDIF} {$ENDIF};
119 {**
120 * \brief Log a message with the specified category and priority.
121 *}
122 procedure SDL_LogMessage(category: Integer; priority: TSDL_LogPriority; const fmt: PAnsiChar; pars: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogMessage' {$ENDIF} {$ENDIF};
124 {**
125 * \brief Log a message with the specified category and priority.
126 *}
127 procedure SDL_LogMessageV(category: Integer; priority: TSDL_LogPriority; const fmt: PAnsiChar; ap: array of const) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogMessageV' {$ENDIF} {$ENDIF};
129 {**
130 * \brief The prototype for the log output function
131 *}
132 type
133 TSDL_LogOutputFunction = procedure(userdata: Pointer; category: Integer; priority: TSDL_LogPriority; const msg: PAnsiChar);
134 PSDL_LogOutputFunction = ^TSDL_LogOutputFunction;
136 {**
137 * \brief Get the current log output function.
138 *}
139 procedure SDL_LogGetOutputFunction(callback: PSDL_LogOutputFunction; userdata: PPointer) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogGetOutputFunction' {$ENDIF} {$ENDIF};
141 {**
142 * \brief This function allows you to replace the default log output
143 * function with one of your own.
144 *}
145 procedure SDL_LogSetOutputFunction(callback: TSDL_LogOutputFunction; userdata: Pointer) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LogSetOutputFunction' {$ENDIF} {$ENDIF};
147 {$ENDIF}