78 lines
1.7 KiB
C
78 lines
1.7 KiB
C
/* Generated by k2c from runtime/menu_props.kry. */
|
|
#ifndef K_RUNTIME_MENU_PROPS_H
|
|
#define K_RUNTIME_MENU_PROPS_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifndef KIR_STRING_VALUE_DEFINED
|
|
#define KIR_STRING_VALUE_DEFINED
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
/* Immutable borrowed UTF-8 bytes; length preserves embedded nulls. */
|
|
typedef struct String { const char *data; size_t length; } String;
|
|
static inline String StringView(const char *data, size_t length) {
|
|
String value = {data, length};
|
|
return value;
|
|
}
|
|
static inline bool StringEqual(String a, String b) {
|
|
return a.length == b.length && (a.length == 0 || memcmp(a.data, b.data, a.length) == 0);
|
|
}
|
|
#endif
|
|
#include "kryon_compat.generated.h"
|
|
|
|
typedef enum MenuItemKind {
|
|
MenuCommand = 0,
|
|
MenuCheck = 1,
|
|
MenuRadio = 2,
|
|
MenuSeparator = 3,
|
|
MenuSubmenu = 4,
|
|
} MenuItemKind;
|
|
|
|
typedef enum MenuMode {
|
|
MenuModeBar = 0,
|
|
MenuModePopup = 1,
|
|
MenuModeContext = 2,
|
|
} MenuMode;
|
|
|
|
typedef struct MenuItem {
|
|
MenuItemKind kind;
|
|
const char* label;
|
|
const char* accelerator;
|
|
int32_t id;
|
|
bool disabled;
|
|
bool checked;
|
|
const struct MenuItem* submenu;
|
|
int32_t submenu_count;
|
|
} MenuItem;
|
|
|
|
typedef struct MenuGroup {
|
|
Rectangle bounds;
|
|
const char* label;
|
|
const MenuItem* items;
|
|
int32_t item_count;
|
|
} MenuGroup;
|
|
|
|
typedef struct MenuResult {
|
|
int32_t activated_id;
|
|
int32_t open_index;
|
|
} MenuResult;
|
|
|
|
typedef struct MenuProps {
|
|
int32_t id;
|
|
int32_t class_name;
|
|
MenuMode mode;
|
|
Rectangle bounds;
|
|
Rectangle trigger;
|
|
const MenuGroup* menus;
|
|
int32_t menu_count;
|
|
const MenuItem* items;
|
|
int32_t item_count;
|
|
int32_t* open_index;
|
|
int32_t* open;
|
|
int32_t* x;
|
|
int32_t* y;
|
|
} MenuProps;
|
|
|
|
#endif /* K_RUNTIME_MENU_PROPS_H */
|