Compare commits

...

3 Commits

Author SHA1 Message Date
roodletoof 9186d50d6d start work on cmenu
alternative to raymenu with own application layer
2026-07-17 16:02:19 +02:00
roodletoof 20aedb5caf Merge branch 'master' of ssh://git.roodletoof.org:2222/roodletoof/dotfiles 2026-07-17 16:01:50 +02:00
roodletoof 4d2d6e0803 make raymenu window topmost 2026-07-17 16:01:38 +02:00
4 changed files with 61 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
// Opens a fuzzy finding window with the given array of strings.
// Returns the index of the picked element.
// Returns -1 on no selection.
int picker(char const *strings, int strings_len, char const *prompt) {
}
+51
View File
@@ -0,0 +1,51 @@
#ifndef PLATFORM
#define PLATFORM
#include <stdint.h>
#include <stdbool.h>
typedef struct Color {
uint8_t r, g, b;
} Color;
#define WHITE ((Color){255,255,255})
#define BLACK ((Color){0,0,0})
typedef enum Key {
Key_backspace,
Key_ctrl,
Key_enter,
Key_h,
Key_n,
Key_p,
Key_y,
Count_Key
} Key;
bool KeyIsDown(Key key);
bool KeyIsUp(Key key);
bool KeyIsJustPressedOrRepeat(Key key);
bool KeyIsJustPressed(Key key);
bool KeyIsJustReleased(Key key);
bool InputGetNextPrintable(char const *out_key);
typedef struct Screen {
void *handle;
} Screen;
typedef struct Window {
int width;
int height;
void *handle;
Screen screen;
} Window;
Screen ScreenGetFocused();
int ScreenGetWidth(Screen screen);
int ScreenGetHeight(Screen screen);
// Make a window specifically suitable for tools like launchers.
// Always on top, not resizable, closes on lost focus.
Window ScreenMakeStaticWindow(int x, int y, int width, int height);
void WindowClear(Color color);
#endif /* PLATFORM */
View File
+1 -1
View File
@@ -166,7 +166,7 @@ func Picker(options []string, pickerOptions ...PickerOption) (choiceIdx int, ok
func initialize(nOptions int) { func initialize(nOptions int) {
rl.SetTraceLogLevel(rl.LogError) rl.SetTraceLogLevel(rl.LogError)
rl.InitWindow(0, 0, "raymenu") rl.InitWindow(0, 0, "raymenu")
rl.SetWindowState(rl.FlagWindowUndecorated) rl.SetWindowState(rl.FlagWindowUndecorated | rl.FlagWindowTopmost)
rl.SetTargetFPS( rl.SetTargetFPS(
int32( int32(
rl.GetMonitorRefreshRate( rl.GetMonitorRefreshRate(