From 8df4e27360758adc9bcfffc92d1b3f4f828cdd1d Mon Sep 17 00:00:00 2001 From: Yadciel Date: Fri, 8 May 2026 10:46:25 +0200 Subject: [PATCH] Aktualisiere README, um aktuelle API und Funktionen zu reflektieren MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die README wurde aktualisiert, um die Projektidentität als eigenständige Weiterentwicklung zu verdeutlichen. Sie dokumentiert nun auch die jüngsten API-Erweiterungen wie Linksklick-Callbacks und verbesserte UTF-8-Unterstützung unter Windows, sowie relevante interne Felder. --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 11bf47d..7001b75 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,17 @@ Works well on: The code is C++ friendly and will compile fine in C++98 and up. -This fork is intended to bring together the [original work of Serge Zaitsev](https://github.com/zserge/tray) and the most interesting forks and PRs of respectable contributors: +This repository started as a fork of the [original work by Serge Zaitsev](https://github.com/zserge/tray), but it is now maintained as a separate continuation. It keeps the small public C API and cross-platform focus, while carrying its own fixes and behavior changes. -* [Only process messages coming from the tray window on Windows](https://github.com/zserge/tray/pull/18) -* [Become C++-friendly](https://github.com/zserge/tray/pull/16) -* [Fix all menu items have a check box](https://github.com/zserge/tray/pull/11) -* [Add support for tooltip](https://github.com/zserge/tray/pull/11) -* Darwin implementation translated from C to Objective C adapted from [@trevex fork](https://github.com/trevex/tray) +Compared to the original upstream, this fork already includes and continues work around: + +* improved Windows message handling +* C++-friendly headers and usage +* tooltip support +* checkbox/menu state fixes +* Darwin/AppKit support adapted from the [@trevex fork](https://github.com/trevex/tray) +* support for left-click callbacks +* Windows UTF-8 tray text handling ## Prerequisites @@ -63,6 +67,10 @@ struct tray { const char *icon; char *tooltip; struct tray_menu *menu; + void *icon_handle; + int icon_is_shared; + void (*left_click_cb)(void *context); + void *left_click_context; }; struct tray_menu { @@ -91,6 +99,8 @@ array must have `text == NULL`. ### Notes * `tooltip` is optional. +* `left_click_cb` and `left_click_context` are optional. +* `icon_handle` and `icon_is_shared` are backend-specific fields used internally by the Windows implementation and should usually be left untouched by callers. * A separator is created by using `text = "-"`. * Some behavior may depend on the underlying backend or desktop environment. Keep the public API generic and treat platform-specific interaction details as