Aktualisiere README, um aktuelle API und Funktionen zu reflektieren
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.
This commit is contained in:
22
README.md
22
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
|
||||
|
||||
Reference in New Issue
Block a user