11// Clip Library
2- // Copyright (c) 2015-2024 David Capello
2+ // Copyright (c) 2015-2026 David Capello
33//
44// This file is released under the terms of the MIT license.
55// Read LICENSE.txt for more information.
1313#include < string>
1414#include < vector>
1515
16+ #include " clip_base.h"
17+
1618namespace clip {
1719
1820 // ======================================================================
@@ -28,7 +30,7 @@ namespace clip {
2830#endif // CLIP_ENABLE_IMAGE
2931
3032#if CLIP_ENABLE_LIST_FORMATS
31- struct format_info {
33+ struct CLIP_EXTERN format_info {
3234 format id = 0 ;
3335 std::string name;
3436 format_info (const format id,
@@ -39,7 +41,7 @@ namespace clip {
3941 };
4042#endif // CLIP_ENABLE_LIST_FORMATS
4143
42- class lock {
44+ class CLIP_EXTERN lock {
4345 public:
4446 // You can give your current HWND as the "native_window_handle."
4547 // Windows clipboard functions use this handle to open/close
@@ -84,24 +86,24 @@ namespace clip {
8486 std::unique_ptr<impl> p;
8587 };
8688
87- format register_format (const std::string& name);
89+ CLIP_EXTERN format register_format (const std::string& name);
8890
8991 // This format is when the clipboard has no content.
90- format empty_format ();
92+ CLIP_EXTERN format empty_format ();
9193
9294 // When the clipboard has UTF8 text.
93- format text_format ();
95+ CLIP_EXTERN format text_format ();
9496
9597#if CLIP_ENABLE_IMAGE
9698 // When the clipboard has an image.
97- format image_format ();
99+ CLIP_EXTERN format image_format ();
98100#endif
99101
100102 // Returns true if the clipboard has content of the given type.
101- bool has (format f);
103+ CLIP_EXTERN bool has (format f);
102104
103105 // Clears the clipboard content.
104- bool clear ();
106+ CLIP_EXTERN bool clear ();
105107
106108 // ======================================================================
107109 // Error handling
@@ -116,25 +118,25 @@ namespace clip {
116118
117119 typedef void (*error_handler)(ErrorCode code);
118120
119- void set_error_handler (error_handler f);
120- error_handler get_error_handler ();
121+ CLIP_EXTERN void set_error_handler (error_handler f);
122+ CLIP_EXTERN error_handler get_error_handler ();
121123
122124 // ======================================================================
123125 // Text
124126 // ======================================================================
125127
126128 // High-level API to put/get UTF8 text in/from the clipboard. These
127129 // functions returns false in case of error.
128- bool set_text (const std::string& value);
129- bool get_text (std::string& value);
130+ CLIP_EXTERN bool set_text (const std::string& value);
131+ CLIP_EXTERN bool get_text (std::string& value);
130132
131133 // ======================================================================
132134 // Image
133135 // ======================================================================
134136
135137#if CLIP_ENABLE_IMAGE
136138
137- struct image_spec {
139+ struct CLIP_EXTERN image_spec {
138140 unsigned long width = 0 ;
139141 unsigned long height = 0 ;
140142 unsigned long bits_per_pixel = 0 ;
@@ -161,7 +163,7 @@ namespace clip {
161163 // automatically. macOS handles straight alpha directly, so there is
162164 // no conversion at all. Linux/X11 images are transferred in
163165 // image/png format which are specified in straight alpha.
164- class image {
166+ class CLIP_EXTERN image {
165167 public:
166168 image ();
167169 image (const image_spec& spec);
@@ -190,9 +192,9 @@ namespace clip {
190192
191193 // High-level API to set/get an image in/from the clipboard. These
192194 // functions returns false in case of error.
193- bool set_image (const image& img);
194- bool get_image (image& img);
195- bool get_image_spec (image_spec& spec);
195+ CLIP_EXTERN bool set_image (const image& img);
196+ CLIP_EXTERN bool get_image (image& img);
197+ CLIP_EXTERN bool get_image_spec (image_spec& spec);
196198
197199#endif // CLIP_ENABLE_IMAGE
198200
@@ -203,8 +205,8 @@ namespace clip {
203205 // Only for X11: Sets the time (in milliseconds) that we must wait
204206 // for the selection/clipboard owner to receive the content. This
205207 // value is 1000 (one second) by default.
206- void set_x11_wait_timeout (int msecs);
207- int get_x11_wait_timeout ();
208+ CLIP_EXTERN void set_x11_wait_timeout (int msecs);
209+ CLIP_EXTERN int get_x11_wait_timeout ();
208210
209211} // namespace clip
210212
0 commit comments