rust_widgets 0.9.6

Pure Rust cross-platform native GUI library with hardware-adaptive rendering, 60+ widgets, touch/gesture support, i18n, and SVG-pipeline-accurate output
// Auto-generated by tools/generate_error_header.py — DO NOT EDIT
// Source: src/error/mod.rs
#ifndef RW_ERRORS_H
#define RW_ERRORS_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/* ------------------------------------------------------------------ */
/* FFI‑safe error codes — stable, append‑only                         */
/* ------------------------------------------------------------------ */
/* --- General --- */
#define RW_ERROR_SUCCESS                              0
#define RW_ERROR_NOT_IMPLEMENTED                      1
#define RW_ERROR_UNSUPPORTED_OPERATION                2
#define RW_ERROR_INVALID_ARGUMENT                     3
#define RW_ERROR_NULL_POINTER                         4
#define RW_ERROR_OUT_OF_MEMORY                        5
#define RW_ERROR_LOCK_POISONED                        6

/* --- Widget --- */
#define RW_ERROR_WIDGET_BASE_NOT_IMPL                 100
#define RW_ERROR_WIDGET_NOT_FOUND                     101
#define RW_ERROR_WIDGET_INVALID_STATE                 102
#define RW_ERROR_WIDGET_DEPRECATED                    103

/* --- Platform --- */
#define RW_ERROR_PLATFORM_UNSUPPORTED                 200
#define RW_ERROR_PLATFORM_INIT_FAILED                 201
#define RW_ERROR_CLIPBOARD_FAILED                     202
#define RW_ERROR_DRAG_DROP_FAILED                     203

/* --- Render --- */
#define RW_ERROR_RENDER_CONTEXT_INVALID               300
#define RW_ERROR_RENDER_PIPELINE_FAILED               301

/* --- I/O --- */
#define RW_ERROR_I18N_LOAD_FAILED                     400
#define RW_ERROR_FILE_NOT_FOUND                       401


/* ------------------------------------------------------------------ */
/* Helpers                                                             */
/* ------------------------------------------------------------------ */

/// Convert an `RwError` to a human‑readable string.  Returns a pointer
/// that MUST be freed with `rw_free_string()`.
const char* rw_error_message(uint64_t handle);

/// Return the numeric error code from an `RwError` handle.
int32_t rw_error_code(uint64_t handle);

#ifdef __cplusplus
}
#endif

#endif /* RW_ERRORS_H */