diff --git a/README.md b/README.md index f261932..0f41d3b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,65 @@ Works well on: There is also a stub implementation that returns errors on attempt to create a tray menu. +# Setup + +Before you can compile `tray`, you'll need to add an environment definition before the line where you include `tray.h`. + +**For Windows:** +```c +#include +#include + +#define TRAY_WINAPI 1 + +#include "tray.h" +... +``` + +**For Linux:** +```c +#include +#include + +#define TRAY_APPINDICATOR 1 + +#include "tray.h" +... +``` + +**For Mac:** +**For Windows:** +```c +#include +#include + +#define TRAY_APPKIT 1 + +#include "tray.h" +... +``` + +// For Linux: +//#define TRAY_APPINDICATOR 1 +// For Mac: +//#define TRAY_APPKIT 1 + +# Demo + +The included example `.c` files can be compiled based on your environment. + +For example, to compile and run the program on Windows: + +```shell +$> gcc example_windows.c [Enter] +``` + +This will compile and build `a.out`. To run it: + +``` +$> a [Enter] +``` + # Example ```c diff --git a/example.c b/example.c index f2ea24f..c42ffe2 100644 --- a/example.c +++ b/example.c @@ -1,6 +1,14 @@ #include #include +#if defined (_WIN32) || defined (_WIN64) +#define TRAY_WINAPI 1 +#elif defined (__linux__) || defined (linux) || defined (__linux) +#define TRAY_APPINDICATOR 1 +#elif defined (__APPLE__) || defined (__MACH__) +#define TRAY_APPKIT 1 +#endif + #include "tray.h" #if TRAY_APPINDICATOR diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..bb96b6e Binary files /dev/null and b/icon.ico differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..bb96b6e Binary files /dev/null and b/icon.png differ