1  /* GKrellM Windows Portion
2 |  Copyright (C) 2002 Bill Nalen
3 |                2007-2019 Stefan Gehn
4 |
5 |  Authors:  Bill Nalen     bill@nalens.com
6 |            Stefan Gehn    stefan+gkrellm@srcbox.net
7 |  Latest versions might be found at:  http://gkrellm.net
8 |
9 |
10 |  GKrellM is free software: you can redistribute it and/or modify it
11 |  under the terms of the GNU General Public License as published by
12 |  the Free Software Foundation, either version 3 of the License, or
13 |  (at your option) any later version.
14 |
15 |  GKrellM is distributed in the hope that it will be useful, but WITHOUT
16 |  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 |  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 |  License for more details.
19 |
20 |  You should have received a copy of the GNU General Public License
21 |  along with this program. If not, see http://www.gnu.org/licenses/
22 */
23 
24 
25 #ifndef WIN32_PLUGIN_H
26 #define WIN32_PLUGIN_H
27 
28 #include "gkrellm.h"
29 
30 typedef struct
31 {
32       /* Data structure allocation
33       */
34     GkrellmChart *(*gkrellm_chart_new0)(void);
35     GkrellmChartconfig *(*gkrellm_chartconfig_new0)(void);
36     GkrellmPanel *(*gkrellm_panel_new0)(void);
37     GkrellmKrell *(*gkrellm_krell_new0)(void);
38     GkrellmDecal *(*gkrellm_decal_new0)(void);
39     GkrellmLabel *(*gkrellm_label_new0)(void);
40     GkrellmStyle *(*gkrellm_style_new0)(void);
41     GkrellmStyle *(*gkrellm_copy_style)(GkrellmStyle *);
42     void		(*gkrellm_copy_style_values)(GkrellmStyle *, GkrellmStyle *);
43     GkrellmTextstyle *(*gkrellm_textstyle_new0)(void);
44     GkrellmTextstyle *(*gkrellm_copy_textstyle)(GkrellmTextstyle *);
45 
46       /* Chart functions
47       */
48     void		(*gkrellm_chart_create)(GtkWidget *, GkrellmMonitor *,
49 						    GkrellmChart *, GkrellmChartconfig **);
50     void		(*gkrellm_chart_destroy)(GkrellmChart *);
51     void		(*gkrellm_chart_hide)(GkrellmChart *, gboolean);
52     void		(*gkrellm_chart_show)(GkrellmChart *, gboolean);
53     gboolean	(*gkrellm_chart_enable_visibility)(GkrellmChart *cp, gboolean,
54 						    gboolean *);
55     gboolean	(*gkrellm_is_chart_visible)(GkrellmChart *);
56     void		(*gkrellm_set_draw_chart_function)(GkrellmChart *,
57 						    void (*func)(), gpointer);
58     void		(*gkrellm_draw_chart_to_screen)(GkrellmChart *);
59     gint		(*gkrellm_draw_chart_label)(GkrellmChart *, GkrellmTextstyle *,
60 						    gint, gint,gchar *);
61     void		(*gkrellm_draw_chart_text)(GkrellmChart *, gint, gchar *);
62     void		(*gkrellm_reset_chart)(GkrellmChart *);
63     void		(*gkrellm_reset_and_draw_chart)(GkrellmChart *);
64     void		(*gkrellm_refresh_chart)(GkrellmChart *);
65     void		(*gkrellm_rescale_chart)(GkrellmChart *);
66     void		(*gkrellm_clear_chart)(GkrellmChart *);
67     void		(*gkrellm_clear_chart_pixmap)(GkrellmChart *);
68     void		(*gkrellm_clean_bg_src_pixmap)(GkrellmChart *);
69     void		(*gkrellm_draw_chart_grid_line)(GkrellmChart *, GdkPixmap *, gint);
70     void		(*gkrellm_chart_bg_piximage_override)(GkrellmChart *,
71 						    GkrellmPiximage *, GkrellmPiximage *);
72     gint		(*gkrellm_chart_width)(void);
73     void		(*gkrellm_set_chart_height_default)(GkrellmChart *, gint);
74     void		(*gkrellm_set_chart_height)(GkrellmChart *, gint);
75     gint		(*gkrellm_get_chart_scalemax)(GkrellmChart *);
76     void		(*gkrellm_render_data_pixmap)(GkrellmPiximage *, GdkPixmap **,
77 						    GdkColor *, gint);
78     void		(*gkrellm_render_data_grid_pixmap)(GkrellmPiximage *,
79 						    GdkPixmap **, GdkColor *);
80 
81       /* ChartData functions
82       */
83     GkrellmChartdata *(*gkrellm_add_chartdata)(GkrellmChart *, GdkPixmap **,
84 					    GdkPixmap *, gchar *);
85     GkrellmChartdata *(*gkrellm_add_default_chartdata)(GkrellmChart *, gchar *);
86     void		(*gkrellm_alloc_chartdata)(GkrellmChart *);
87     // gkrellm_store_chartdata is not called from libgkrellm, only gkrellm_store_chartdatav
88     void		(*gkrellm_store_chartdatav)(GkrellmChart *, gulong, va_list args);
89     void		(*gkrellm_draw_chartdata)(GkrellmChart *);
90     void		(*gkrellm_monotonic_chartdata)(GkrellmChartdata *, gboolean);
91     gboolean	(*gkrellm_get_chartdata_hide)(GkrellmChartdata *);
92     gint		(*gkrellm_get_current_chartdata)(GkrellmChartdata *);
93     gint		(*gkrellm_get_chartdata_data)(GkrellmChartdata *, gint);
94     void		(*gkrellm_set_chartdata_draw_style)(GkrellmChartdata *, gint);
95     void		(*gkrellm_set_chartdata_draw_style_default)(GkrellmChartdata *, gint);
96     void		(*gkrellm_set_chartdata_flags)(GkrellmChartdata *, gint);
97     void		(*gkrellm_scale_chartdata)(GkrellmChartdata *, gint, gint);
98 
99       /* ChartConfig functions
100       */
101     void		(*gkrellm_chartconfig_window_create)(GkrellmChart *);
102     void		(*gkrellm_chartconfig_window_destroy)(GkrellmChart *);
103     void		(*gkrellm_chartconfig_grid_resolution_adjustment)(
104 						    GkrellmChartconfig *, gboolean, gfloat, gfloat, gfloat,
105 						    gfloat, gfloat, gint, gint);
106     void		(*gkrellm_set_chartconfig_grid_resolution)(GkrellmChartconfig *,
107 						    gint);
108     gint		(*gkrellm_get_chartconfig_grid_resolution)(GkrellmChartconfig *);
109     void		(*gkrellm_chartconfig_grid_resolution_connect)(
110 						    GkrellmChartconfig *, void (*fn)(), gpointer);
111     void		(*gkrellm_set_chartconfig_flags)(GkrellmChartconfig *, gint);
112 
113     void		(*gkrellm_chartconfig_grid_resolution_label)(
114 						    GkrellmChartconfig *, gchar *);
115     void		(*gkrellm_set_chartconfig_auto_grid_resolution)(
116 						    GkrellmChartconfig *, gboolean);
117     void		(*gkrellm_set_chartconfig_auto_resolution_stick)(
118 						    GkrellmChartconfig *, gboolean);
119     void		(*gkrellm_set_chartconfig_sequence_125)(GkrellmChartconfig *,
120 						    gboolean);
121     void		(*gkrellm_set_chartconfig_fixed_grids)(GkrellmChartconfig *, gint);
122     gint		(*gkrellm_get_chartconfig_fixed_grids)(GkrellmChartconfig *);
123     void		(*gkrellm_chartconfig_fixed_grids_connect)(GkrellmChartconfig *,
124 						    void (*fn)(), gpointer);
125     gint		(*gkrellm_get_chartconfig_height)(GkrellmChartconfig *);
126     void		(*gkrellm_chartconfig_height_connect)(GkrellmChartconfig *,
127 						    void (*fn)(), gpointer);
128     void		(*gkrellm_save_chartconfig)(FILE *, GkrellmChartconfig *,
129 						    gchar *, gchar *);
130     void		(*gkrellm_load_chartconfig)(GkrellmChartconfig **, gchar *, gint);
131     void		(*gkrellm_chartconfig_destroy)(GkrellmChartconfig **);
132 
133       /* Panel functions
134       */
135     void		(*gkrellm_panel_configure)(GkrellmPanel *, gchar *, GkrellmStyle *);
136     void		(*gkrellm_panel_configure_add_height)(GkrellmPanel *, gint);
137     void		(*gkrellm_panel_configure_set_height)(GkrellmPanel *p, gint h);
138     gint		(*gkrellm_panel_configure_get_height)(GkrellmPanel *p);
139     void		(*gkrellm_panel_create)(GtkWidget *, GkrellmMonitor *,GkrellmPanel *);
140     void		(*gkrellm_panel_destroy)(GkrellmPanel *);
141     void		(*gkrellm_panel_hide)(GkrellmPanel *);
142     void		(*gkrellm_panel_show)(GkrellmPanel *);
143     gboolean	(*gkrellm_panel_enable_visibility)(GkrellmPanel *p, gboolean, gboolean *);
144     gboolean	(*gkrellm_is_panel_visible)(GkrellmPanel *);
145     void		(*gkrellm_panel_keep_lists)(GkrellmPanel *, gboolean);
146     void		(*gkrellm_draw_panel_label)(GkrellmPanel *);
147     void		(*gkrellm_draw_panel_layers)(GkrellmPanel *);
148     void		(*gkrellm_draw_panel_layers_force)(GkrellmPanel *);
149     void		(*gkrellm_panel_bg_piximage_override)(GkrellmPanel *, GkrellmPiximage *);
150 
151       /* Krell functions
152       */
153     GkrellmKrell *(*gkrellm_create_krell)(GkrellmPanel *, GkrellmPiximage *,
154 						    GkrellmStyle *);
155     void		(*gkrellm_set_krell_full_scale)(GkrellmKrell *, gint, gint);
156     void		(*gkrellm_set_style_krell_values)(GkrellmStyle *, gint, gint, gint,
157 						    gint, gint, gint, gint);
158     void		(*gkrellm_set_style_krell_values_default)(GkrellmStyle *s, gint yoff,
159 						    gint depth, gint x_hot, gint expand, gint ema,
160 						    gint left_margin, gint right_margin);
161     void		(*gkrellm_set_style_slider_values_default)(GkrellmStyle *s, gint yoff,
162 						    gint left_margin, gint right_margin);
163     void		(*gkrellm_set_krell_margins)(GkrellmPanel *, GkrellmKrell *k,
164 						    gint, gint);
165     void		(*gkrellm_set_krell_expand)(GkrellmStyle *, gchar *);
166     void		(*gkrellm_update_krell)(GkrellmPanel *, GkrellmKrell *, gulong);
167     void		(*gkrellm_monotonic_krell_values)(GkrellmKrell *k, gboolean);
168     void		(*gkrellm_destroy_krell_list)(GkrellmPanel *);
169     void		(*gkrellm_destroy_krell)(GkrellmKrell *);
170     void		(*gkrellm_move_krell_yoff)(GkrellmPanel *, GkrellmKrell *, gint);
171     void		(*gkrellm_remove_krell)(GkrellmPanel *, GkrellmKrell *);
172     void		(*gkrellm_insert_krell)(GkrellmPanel *, GkrellmKrell *, gboolean);
173     void		(*gkrellm_insert_krell_nth)(GkrellmPanel *, GkrellmKrell *, gint);
174 
175       /* Decal and Decalbutton functions
176       */
177     GkrellmDecal *(*gkrellm_create_decal_text)(GkrellmPanel *p, gchar *,
178 						    GkrellmTextstyle *, GkrellmStyle *, gint, gint, gint);
179     GkrellmDecal *(*gkrellm_create_decal_pixmap)(GkrellmPanel *, GdkPixmap *,
180 						    GdkBitmap *, gint, GkrellmStyle *, gint, gint);
181     void		(*gkrellm_draw_decal_pixmap)(GkrellmPanel *, GkrellmDecal *, gint);
182     void		(*gkrellm_draw_decal_text)(GkrellmPanel *, GkrellmDecal *, gchar *,
183 						    gint);
184     void		(*gkrellm_draw_decal_on_chart)(GkrellmChart *, GkrellmDecal *,
185 						    gint, gint);
186     void		(*gkrellm_move_decal)(GkrellmPanel *, GkrellmDecal *, gint, gint);
187     void		(*gkrellm_decal_on_top_layer)(GkrellmDecal *, gboolean);
188     void		(*gkrellm_destroy_decal)(GkrellmDecal *);
189     void		(*gkrellm_make_decal_visible)(GkrellmPanel *, GkrellmDecal *);
190     void		(*gkrellm_make_decal_invisible)(GkrellmPanel *, GkrellmDecal *);
191     gint		(*gkrellm_is_decal_visible)(GkrellmDecal *);
192     void		(*gkrellm_remove_decal)(GkrellmPanel *, GkrellmDecal *);
193     void		(*gkrellm_insert_decal)(GkrellmPanel *, GkrellmDecal *, gboolean);
194     void		(*gkrellm_insert_decal_nth)(GkrellmPanel *, GkrellmDecal *, gint);
195     void		(*gkrellm_destroy_decal_list)(GkrellmPanel *);
196     void		(*gkrellm_set_decal_button_index)(GkrellmDecalbutton *, gint);
197     GkrellmDecalbutton *(*gkrellm_make_decal_button)(GkrellmPanel *, GkrellmDecal *,
198 						    void (*func)(), void *, gint, gint);
199     GkrellmDecalbutton *(*gkrellm_make_overlay_button)(GkrellmPanel *,
200 						    void (*func)(), void *, gint, gint, gint, gint,
201 						    GkrellmPiximage *, GkrellmPiximage *);
202     GkrellmDecalbutton *(*gkrellm_put_decal_in_panel_button)(GkrellmPanel *,
203 						    GkrellmDecal *, void (*func)(), void *,
204 						    GkrellmMargin *);
205     GkrellmDecalbutton *(*gkrellm_put_decal_in_meter_button)(GkrellmPanel *,
206 						    GkrellmDecal *, void (*func)(), void *,
207 						    GkrellmMargin *);
208     GkrellmDecalbutton *(*gkrellm_put_label_in_panel_button)(GkrellmPanel *,
209 						    void (*func)(), void *, gint pad);
210     GkrellmDecalbutton *(*gkrellm_put_label_in_meter_button)(GkrellmPanel *,
211 						    void (*func)(), void *, gint pad);
212     GkrellmDecalbutton *(*gkrellm_make_scaled_button)(GkrellmPanel *p,
213 						    GkrellmPiximage *im, void (*func)(), void *data,
214 						    gboolean auto_hide, gboolean set_default_border,
215 						    gint depth, gint cur_index, gint pressed_index,
216 						    gint x, gint y, gint w, gint h);
217     GkrellmDecalbutton *(*gkrellm_decal_is_button)(GkrellmDecal *);
218     void        (*gkrellm_set_in_button_callback)(GkrellmDecalbutton *,
219                             gint (*func)(), gpointer data);
220     gboolean	(*gkrellm_in_button)(GkrellmDecalbutton *button, GdkEventButton *);
221     gboolean	(*gkrellm_in_decal)(GkrellmDecal *, GdkEventButton *);
222     void		(*gkrellm_decal_button_connect)(GkrellmDecalbutton *, void (*func)(),
223 						    void *);
224     void		(*gkrellm_decal_button_right_connect)(GkrellmDecalbutton *,
225 						    void (*func)(), void *);
226     void		(*gkrellm_set_button_sensitive)(GkrellmDecalbutton *, gboolean);
227     void		(*gkrellm_hide_button)(GkrellmDecalbutton *);
228     void		(*gkrellm_show_button)(GkrellmDecalbutton *);
229     void		(*gkrellm_destroy_button)(GkrellmDecalbutton *);
230 
231       /* Pixops
232       */
233     gboolean	(*gkrellm_load_piximage)(gchar *, gchar **, GkrellmPiximage **, gchar *);
234     GkrellmPiximage	*(*gkrellm_piximage_new_from_file)(gchar *fname);
235     GkrellmPiximage	*(*gkrellm_piximage_new_from_xpm_data)(gchar **data);
236     void		(*gkrellm_set_piximage_border)(GkrellmPiximage *piximage,
237 						    GkrellmBorder *border);
238     gboolean	(*gkrellm_scale_pixbuf_to_pixmap)(GdkPixbuf *src_pixbuf,
239 						    GdkPixmap **pixmap, GdkBitmap **mask,
240 						    gint w_dst, gint h_dst);
241     GdkPixbuf	*(*gkrellm_scale_piximage_to_pixbuf)(GkrellmPiximage *piximage,
242 						    gint w_dst, gint h_dst);
243     gboolean	(*gkrellm_scale_piximage_to_pixmap)(GkrellmPiximage *, GdkPixmap **,
244 						    GdkBitmap **, gint, gint);
245     void		(*gkrellm_paste_piximage)(GkrellmPiximage *src_piximage,
246 						    GdkDrawable *drawable,
247 						    gint x_dst, gint y_dst, gint w_dst, gint h_dst);
248     void		(*gkrellm_paste_pixbuf)(GdkPixbuf *src_pixbuf, GdkDrawable *drawable,
249 						    gint x_dst, gint y_dst, gint w_dst, gint h_dst);
250     void		(*gkrellm_destroy_piximage)(GkrellmPiximage *piximage);
251     GkrellmPiximage	*(*gkrellm_clone_piximage)(GkrellmPiximage *src_piximage);
252     gboolean	(*gkrellm_clone_pixmap)(GdkPixmap **, GdkPixmap **);
253     gboolean	(*gkrellm_clone_bitmap)(GdkBitmap **, GdkBitmap **);
254     void		(*gkrellm_free_pixmap)(GdkPixmap **);
255     void		(*gkrellm_free_bitmap)(GdkBitmap **);
256 
257       /* Misc support functions
258       */
259     GtkWidget	*(*gkrellm_get_top_window)(void);
260     gboolean	(*gkrellm_set_gkrellmrc_piximage_border)(gchar *, GkrellmPiximage *,
261 						    GkrellmStyle *);
262     gboolean	(*gkrellm_get_gkrellmrc_integer)(gchar *, gint *);
263     gchar		*(*gkrellm_get_gkrellmrc_string)(gchar *);
264     gboolean	(*gkrellm_get_gkrellmrc_piximage_border)(gchar *image_name,
265 						    GkrellmPiximage *image, GkrellmBorder *border);
266     void		(*gkrellm_freeze_side_frame_packing)(void);
267     void		(*gkrellm_thaw_side_frame_packing)(void);
268     void		(*gkrellm_pack_side_frames)(void);
269     void		(*gkrellm_draw_string)(GdkDrawable *, GkrellmTextstyle *, gint, gint,
270 						    gchar *);
271     void		(*gkrellm_draw_text)(GdkDrawable *, GkrellmTextstyle *, gint, gint,
272 						    gchar *, gint);
273     void		(*gkrellm_apply_launcher)(GtkWidget **, GtkWidget **, GkrellmPanel *,
274 						    GkrellmLauncher *, void (*func)());
275     void		(*gkrellm_setup_launcher)(GkrellmPanel *, GkrellmLauncher *, gint,
276 						    gint);
277     void		(*gkrellm_setup_decal_launcher)(GkrellmPanel *, GkrellmLauncher *,
278 						    GkrellmDecal *);
279     void		(*gkrellm_configure_tooltip)(GkrellmPanel *, GkrellmLauncher *);
280     void		(*gkrellm_launch_button_cb)(GkrellmDecalbutton *);
281     void		(*gkrellm_disable_plugin_connect)(GkrellmMonitor *, void (*func)());
282     pid_t		(*gkrellm_get_pid)(void);
283     void		(*gkrellm_monitor_height_adjust)(gint);
284     gboolean	(*gkrellm_using_default_theme)(void);
285     void		(*gkrellm_open_config_window)(GkrellmMonitor *);
286     gboolean	(*gkrellm_config_window_shown)(void);
287     void		(*gkrellm_config_modified)(void);
288     GkrellmMargin *(*gkrellm_get_style_margins)(GkrellmStyle *);
289     void		(*gkrellm_set_style_margins)(GkrellmStyle *, GkrellmMargin *);
290     void		(*gkrellm_get_top_bottom_margins)(GkrellmStyle *, gint *, gint *);
291     gboolean	(*gkrellm_style_is_themed)(GkrellmStyle *, gint);
292     void		(*gkrellm_message_dialog)(gchar *title, gchar *message);
293     void		(*gkrellm_config_message_dialog)(gchar *title, gchar *message);
294     void		(*gkrellm_message_window)(gchar *title, gchar *message, GtkWidget *);
295     void		(*gkrellm_config_message_window)(gchar *title, gchar *message,
296 						    GtkWidget *);
297     void		(*gkrellm_spacers_set_types)(GkrellmMonitor *mon, gint top, gint bot);
298 
299 
300       /* Alerts
301       */
302     GkrellmAlert *(*gkrellm_alert_create)(GkrellmPanel *, gchar *, gchar *,
303 						    gboolean, gboolean, gboolean,
304 						    gfloat, gfloat, gfloat, gfloat, gint);
305     void		(*gkrellm_alert_destroy)(GkrellmAlert **);
306     void		(*gkrellm_check_alert)(GkrellmAlert *, gfloat);
307     void		(*gkrellm_reset_alert)(GkrellmAlert *);
308     void		(*gkrellm_reset_panel_alerts)(GkrellmPanel *);
309     void		(*gkrellm_freeze_alert)(GkrellmAlert *);
310     void		(*gkrellm_thaw_alert)(GkrellmAlert *);
311     void		(*gkrellm_alert_trigger_connect)(GkrellmAlert *, void (*func)(),
312 						    gpointer);
313     void		(*gkrellm_alert_stop_connect)(GkrellmAlert *, void (*func)(),
314 						    gpointer);
315     void		(*gkrellm_alert_config_connect)(GkrellmAlert *, void (*func)(),
316 						    gpointer);
317     void		(*gkrellm_render_default_alert_decal)(GkrellmAlert *);
318     void		(*gkrellm_alert_config_window)(GkrellmAlert **);
319     void		(*gkrellm_alert_window_destroy)(GkrellmAlert **);
320     void		(*gkrellm_save_alertconfig)(FILE *, GkrellmAlert *, gchar *, gchar *);
321     void		(*gkrellm_load_alertconfig)(GkrellmAlert **, gchar *);
322     void		(*gkrellm_alert_set_triggers)(GkrellmAlert *,
323 							gfloat, gfloat, gfloat, gfloat);
324 
325       /* GKrellM Styles and Textstyles
326       */
327     gint		(*gkrellm_add_chart_style)(GkrellmMonitor *, gchar *);
328     gint		(*gkrellm_add_meter_style)(GkrellmMonitor *, gchar *);
329     gint		(*gkrellm_lookup_chart_style_id)(gchar *);
330     gint		(*gkrellm_lookup_meter_style_id)(gchar *);
331     GkrellmStyle *(*gkrellm_meter_style)(gint);
332     GkrellmStyle *(*gkrellm_panel_style)(gint);
333     GkrellmStyle *(*gkrellm_chart_style)(gint);
334     GkrellmStyle *(*gkrellm_meter_style_by_name)(gchar *);
335     GkrellmStyle *(*gkrellm_panel_style_by_name)(gchar *);
336     GkrellmStyle *(*gkrellm_chart_style_by_name)(gchar *);
337     GkrellmStyle *(*gkrellm_krell_slider_style)(void);
338     GkrellmStyle *(*gkrellm_krell_mini_style)(void);
339     GkrellmTextstyle *(*gkrellm_chart_textstyle)(gint);
340     GkrellmTextstyle *(*gkrellm_panel_textstyle)(gint);
341     GkrellmTextstyle *(*gkrellm_meter_textstyle)(gint);
342     GkrellmTextstyle *(*gkrellm_chart_alt_textstyle)(gint);
343     GkrellmTextstyle *(*gkrellm_panel_alt_textstyle)(gint);
344     GkrellmTextstyle *(*gkrellm_meter_alt_textstyle)(gint);
345 
346       /* Accessing GKrellM GkrellmPiximages and pixmaps
347       */
348     GkrellmPiximage	*(*gkrellm_bg_chart_piximage)(gint);
349     GkrellmPiximage *(*gkrellm_bg_grid_piximage)(gint);
350     GkrellmPiximage *(*gkrellm_bg_panel_piximage)(gint);
351     GkrellmPiximage *(*gkrellm_bg_meter_piximage)(gint);
352     GkrellmPiximage *(*gkrellm_krell_panel_piximage)(gint);
353     GkrellmPiximage *(*gkrellm_krell_meter_piximage)(gint);
354     GkrellmPiximage *(*gkrellm_krell_slider_piximage)(void);
355     GkrellmPiximage *(*gkrellm_krell_mini_piximage)(void);
356     void		(*gkrellm_get_decal_alarm_piximage)(GkrellmPiximage **, gint *);
357     void		(*gkrellm_get_decal_warn_piximage)(GkrellmPiximage **, gint *);
358     GdkPixmap	**(*gkrellm_data_in_pixmap)(void);
359     GdkPixmap	*(*gkrellm_data_in_grid_pixmap)(void);
360     GdkPixmap	**(*gkrellm_data_out_pixmap)(void);
361     GdkPixmap	*(*gkrellm_data_out_grid_pixmap)(void);
362     GdkPixmap	*(*gkrellm_decal_misc_pixmap)(void);
363     GdkBitmap	*(*gkrellm_decal_misc_mask)(void);
364 
365       /* Accessing other data from the GK struct
366       */
367     GdkGC		*(*gkrellm_draw_GC)(gint);
368     GdkGC		*(*gkrellm_bit_GC)(gint);
369     PangoFontDescription		*(*gkrellm_default_font)(gint);
370     GdkColor	*(*gkrellm_white_color)(void);
371     GdkColor	*(*gkrellm_black_color)(void);
372     GdkColor	*(*gkrellm_in_color)(void);
373     GdkColor	*(*gkrellm_out_color)(void);
374     gboolean	(*gkrellm_demo_mode)(void);
375     gint		(*gkrellm_update_HZ)(void);
376     gchar		*(*gkrellm_get_theme_path)(void);
377     gint		(*gkrellm_get_timer_ticks)(void);
378     GkrellmTicks *(*gkrellm_ticks)(void);
379     void		(*gkrellm_allow_scaling)(gboolean *, gint *);
380     gint		(*gkrellm_plugin_debug)(void);
381 
382       /* Wrappers around gtk widget functions to provide a convenience higher level
383       |  interface for creating the config pages.
384       */
385     GtkWidget	*(*gkrellm_gtk_notebook_page)(GtkWidget *, gchar *);
386     GtkWidget	*(*gkrellm_gtk_framed_notebook_page)(GtkWidget *, char *);
387     GtkWidget	*(*gkrellm_gtk_launcher_table_new)(GtkWidget *, gint);
388     void		(*gkrellm_gtk_config_launcher)(GtkWidget *, gint, GtkWidget **,
389 						    GtkWidget **, gchar *, GkrellmLauncher *);
390     gchar		*(*gkrellm_gtk_entry_get_text)(GtkWidget **);
391     void		(*gkrellm_gtk_spin_button)(GtkWidget *, GtkWidget **, gfloat, gfloat,
392 						    gfloat, gfloat, gfloat, gint, gint, void (*func)(),
393 						    gpointer, gboolean, gchar *);
394     void		(*gkrellm_gtk_check_button)(GtkWidget *, GtkWidget **, gboolean,
395 						    gboolean, gint, gchar *);
396     void		(*gkrellm_gtk_check_button_connected)(GtkWidget *, GtkWidget **,
397 						    gboolean, gboolean, gboolean, gint, void (*func)(),
398 						    gpointer, gchar *);
399     void		(*gkrellm_gtk_button_connected)(GtkWidget *, GtkWidget **, gboolean,
400 						    gboolean, gint, void (*func)(), gpointer, gchar *);
401     GtkWidget	*(*gkrellm_gtk_scrolled_vbox)(GtkWidget *, GtkWidget **,
402 						    GtkPolicyType, GtkPolicyType);
403     GtkWidget	*(*gkrellm_gtk_framed_vbox)(GtkWidget *, gchar *, gint, gboolean,
404 						    gint, gint);
405     GtkWidget	*(*gkrellm_gtk_framed_vbox_end)(GtkWidget *, gchar *, gint, gboolean,
406 						    gint, gint);
407     GtkWidget	*(*gkrellm_gtk_scrolled_text_view)(GtkWidget *, GtkWidget **,
408 						    GtkPolicyType, GtkPolicyType);
409     void		(*gkrellm_gtk_text_view_append_strings)(GtkWidget *, gchar **, gint);
410     void		(*gkrellm_gtk_text_view_append)(GtkWidget *, gchar *);
411 
412       /* Some utility functions
413       */
414     gchar		*(*gkrellm_homedir)(void);
415     gboolean	(*gkrellm_dup_string)(gchar **, gchar *);
416     gboolean	(*gkrellm_locale_dup_string)(gchar **, gchar *, gchar **);
417     gchar		*(*gkrellm_make_config_file_name)(gchar *, gchar *);
418     gchar		*(*gkrellm_make_data_file_name)(gchar *, gchar *);
419     struct tm	*(*gkrellm_get_current_time)(void);
420     gint		(*gkrellm_125_sequence)(gint, gboolean, gint, gint,
421 						    gboolean, gboolean);
422     void		(*gkrellm_save_all)(void);
423 
424       /* ------- Some builtin monitor public functions -------- */
425 
426       /* Functions exported by cpu.c
427       */
428     gint		(*gkrellm_smp_cpus)(void);
429     gboolean	(*gkrellm_cpu_stats)(gint n, gulong *, gulong *, gulong *, gulong *);
430 
431 
432       /* Functions exported by net.c
433       */
434     gint		(*gkrellm_net_routes)(void);
435     gboolean	(*gkrellm_net_stats)(gint n, gchar *, gulong *, gulong *);
436     void		(*gkrellm_net_led_positions)(gint *x_rx_led, gint *y_rx_led,
437 						gint *x_tx_led, gint *y_tx_led);
438 
439 
440       /* Functions exported by the Mail monitor - see bottom of mail.c
441       */
442     gboolean	(*gkrellm_get_mail_mute_mode)(void);
443     gpointer 	(*gkrellm_add_external_mbox)(gint (*func)(), gboolean, gpointer);
444     void		(*gkrellm_destroy_external_mbox)(gpointer);
445     void		(*gkrellm_set_external_mbox_counts)(gpointer, gint, gint);
446     void		(*gkrellm_set_external_mbox_tooltip)(gpointer, gchar *);
447 
448       /* Functions new for 2.1.1
449       */
450     gfloat		(*gkrellm_get_theme_scale)(void);
451     void		(*gkrellm_offset_chartdata)(GkrellmChartdata *, gint);
452     GkrellmDecal *(*gkrellm_make_scaled_decal_pixmap)(GkrellmPanel *p,
453                         GkrellmPiximage *im, GkrellmStyle *style, gint depth,
454                         gint x, gint y, gint w, gint h);
455 
456       /* Functions new for 2.1.8
457       */
458 	void		(*gkrellm_panel_label_on_top_of_decals)(GkrellmPanel *p,
459 						gboolean mode);
460 	gboolean	(*gkrellm_alert_is_activated)(GkrellmAlert *alert);
461 	void		(*gkrellm_alert_dup)(GkrellmAlert **ap, GkrellmAlert *a_src);
462 	void		(*gkrellm_alert_config_create_connect)(GkrellmAlert *alert,
463 						void (*func)(), gpointer data);
464 	void		(*gkrellm_alert_command_process_connect)(GkrellmAlert *alert,
465 						void (*func)(), gpointer data);
466 	gboolean	(*gkrellm_alert_decal_visible)(GkrellmAlert *alert);
467 	void		(*gkrellm_alert_set_delay)(GkrellmAlert *alert, gint delay);
468 	void		(*gkrellm_alert_delay_config)(GkrellmAlert *alert, gint step,
469 						gint high, gint low);
470 	void		(*gkrellm_gtk_alert_button)(GtkWidget *box, GtkWidget **button,
471 						gboolean expand, gboolean fill, gint pad,
472 						gboolean pack_start, void (*cb_func)(), gpointer data);
473 
474       /* Functions new for 2.1.9
475       */
476 	GkrellmPiximage *(*gkrellm_piximage_new_from_inline)(const guint8 *data,
477 						gboolean copy_pixels);
478     gboolean	(*gkrellm_load_piximage_from_inline)(gchar *name,
479 						const guint8 *data, GkrellmPiximage **image,
480 						gchar *subdir, gboolean copy_pixels);
481 	void		(*gkrellm_alert_commands_config)(GkrellmAlert *alert,
482 						gboolean alarm, gboolean warn);
483     void		(*gkrellm_reset_alert_soft)(GkrellmAlert *);
484 
485       /* Functions new for 2.1.11
486       */
487 	void		(*gkrellm_decal_text_clear)(GkrellmDecal *d);
488 	void		(*gkrellm_decal_text_insert)(GkrellmDecal *d, gchar *s,
489 						GkrellmTextstyle *ts, gint x_off, gint y_off);
490 	GkrellmDecal *(*gkrellm_create_decal_text_with_height)(GkrellmPanel *p,
491 						GkrellmTextstyle *ts, GkrellmStyle *style,
492 						gint x, gint y, gint w, gint h, gint y_baseline);
493 	void		(*gkrellm_chartconfig_callback_block)(GkrellmChartconfig *,
494 						gboolean);
495 
496       /* Functions new for 2.1.16
497       */
498 	void		(*gkrellm_alert_get_alert_state)(GkrellmAlert *alert,
499 						gboolean *alarm_state, gboolean *warn_state);
500 	GkrellmAlertPlugin	*(*gkrellm_alert_plugin_add)(GkrellmMonitor *mon,
501 						gchar *name);
502 	void		(*gkrellm_alert_plugin_alert_connect)(GkrellmAlertPlugin *gap,
503             			void (*alarm_func)(), void (*warn_func)(),
504 						void (*update_func)(), void (*check_func)(),
505 						void (*destroy_func)());
506 	void		(*gkrellm_alert_plugin_config_connect)(GkrellmAlertPlugin *gap,
507 						gchar *tab_name,
508             			void (*config_create_func)(), void (*config_done_func),
509             			void (*config_save_func)(),void (*config_load_func)());
510 	gchar		*(*gkrellm_alert_plugin_config_get_id_string)(GkrellmAlert *alert);
511 	void		(*gkrellm_alert_plugin_alert_attach)(GkrellmAlertPlugin *gap,
512             			GkrellmAlert *alert, gpointer data);
513 	void		(*gkrellm_alert_plugin_alert_detach)(GkrellmAlertPlugin *gap,
514 						GkrellmAlert *alert);
515 	gpointer	(*gkrellm_alert_plugin_get_data)(GkrellmAlertPlugin *gap,
516 						GkrellmAlert *alert);
517 	void		(*gkrellm_alert_plugin_command_process)(GkrellmAlert *alert,
518 						gchar *src, gchar *dst, gint dst_size);
519 	GtkWidget	*(*gkrellm_gtk_category_vbox)(GtkWidget *box, gchar *category_header,
520         				gint header_pad, gint box_pad, gboolean pack_start);
521 	void		(*gkrellm_remove_launcher)(GkrellmLauncher *launch);
522 
523 
524   //---------------------------------------------------------------------------
525   // new since 2.2.0
526 
527   void    (*gkrellm_decal_get_size)(GkrellmDecal *d, gint *w, gint *h);
528   void    (*gkrellm_decal_text_set_offset)(GkrellmDecal *d, gint x, gint y);
529   void    (*gkrellm_decal_text_get_offset)(GkrellmDecal *d, gint *x, gint *y);
530   void    (*gkrellm_chart_reuse_text_format)(GkrellmChart *cp);
531   gchar  *(*gkrellm_get_hostname)(void);
532 
533   void    (*gkrellm_decal_scroll_text_set_text)(GkrellmPanel *p, GkrellmDecal *d, gchar *text);
534   void    (*gkrellm_decal_scroll_text_get_size)(GkrellmDecal *d, gint *w, gint *h);
535   void    (*gkrellm_decal_scroll_text_align_center)(GkrellmDecal *d, gboolean center);
536   void    (*gkrellm_decal_scroll_text_horizontal_loop)(GkrellmDecal *d, gboolean loop);
537   void    (*gkrellm_decal_scroll_text_vertical_loop)(GkrellmDecal *d, gboolean loop);
538 
539   void    (*gkrellm_text_extents)(PangoFontDescription *font_desc, gchar *text, gint len, gint *width, gint *height, gint *baseline, gint *y_ink);
540 
541   gint    (*gkrellm_gdk_string_width)(PangoFontDescription *, gchar *);
542   void    (*gkrellm_gdk_draw_string)(GdkDrawable *drawable, PangoFontDescription *font, GdkGC *gc, gint x, gint y, gchar *string);
543   void    (*gkrellm_gdk_draw_text)(GdkDrawable *drawable, PangoFontDescription *font, GdkGC *gc, gint x, gint y, gchar *string, gint len);
544 
545   gboolean  (*gkrellm_client_mode)(void);
546   void      (*gkrellm_client_plugin_get_setup)(gchar *key_name, void (*setup_func_cb)(gchar *str));
547   void      (*gkrellm_client_plugin_serve_data_connect)(GkrellmMonitor *mon, gchar *key_name, void (*func_cb)(gchar *line));
548   //void      (*gkrellm_client_plugin_reconnect_connect)(gchar *key_name, void (*func_cb)()); // FIXME: missing in gkrellm?
549 
550 
551   //---------------------------------------------------------------------------
552   // new since 2.2.1
553 
554   void    (*gkrellm_draw_decal_markup)(GkrellmPanel *p, GkrellmDecal *d, gchar *text);
555   void    (*gkrellm_decal_scroll_text_set_markup)(GkrellmPanel *p, GkrellmDecal *d, gchar *text);
556 
557 
558   //---------------------------------------------------------------------------
559   // new since 2.2.2
560 
561   void    (*gkrellm_panel_label_get_position)(GkrellmStyle *style, gint *x_position, gint *y_off);
562 
563 
564   //---------------------------------------------------------------------------
565   // new since 2.2.5
566 
567   gboolean      (*gkrellm_client_send_to_server)(gchar *key_name, gchar *line);
568 
569   GkrellmDecal *(*gkrellm_create_decal_text_markup)(GkrellmPanel *p, gchar *string, GkrellmTextstyle *ts, GkrellmStyle *style, gint x, gint y, gint w);
570   void          (*gkrellm_decal_text_markup_insert)(GkrellmDecal *d, gchar *s, GkrellmTextstyle *ts, gint x_off, gint y_off);
571 
572   void          (*gkrellm_decal_text_nth_inserted_set_offset)(GkrellmDecal *d, gint n, gint x_off, gint y_off);
573   void          (*gkrellm_decal_text_nth_inserted_get_offset)(GkrellmDecal *d, gint n, gint *x_off, gint *y_off);
574   void          (*gkrellm_config_instant_apply)(GkrellmMonitor *mon);
575   GtkTreeSelection *(*gkrellm_gtk_scrolled_selection)(GtkTreeView *treeview, GtkWidget *box, GtkSelectionMode s_mode, GtkPolicyType h_policy, GtkPolicyType v_policy, void (*func_cb)(), gpointer data);
576   void          (*gkrellm_text_markup_extents)(PangoFontDescription *font_desc, gchar *text, gint len, gint *width, gint *height, gint *baseline, gint *y_ink);
577   gint          (*gkrellm_gdk_string_markup_width)(PangoFontDescription *, gchar *);
578   gint          (*gkrellm_gdk_text_markup_width)(PangoFontDescription *font_desc, const gchar *string, gint len);
579   void          (*gkrellm_gdk_draw_string_markup)(GdkDrawable *drawable, PangoFontDescription *font, GdkGC *gc, gint x, gint y, gchar *string);
580   void          (*gkrellm_gdk_draw_text_markup)(GdkDrawable *drawable, PangoFontDescription *font, GdkGC *gc, gint x, gint y, gchar *string, gint len);
581 
582   //---------------------------------------------------------------------------
583   // new since 2.3.2
584 
585   // gkrellm_debug is not called from libgkrellm, only gkrellm_debugv
586   void (*gkrellm_debugv)(guint debug_level, const gchar *format, va_list arg);
587 
588 } win32_plugin_callbacks;
589 
590 
591 /// part of win32-plugin.c
592 ///
593 extern win32_plugin_callbacks gkrellm_callbacks;
594 
595 
596 /// \brief initializes \p gkrellm_callbacks
597 /// Has to be called at gkrellm startup before loading plugins.
598 /// \note only needed on win32
599 void win32_init_callbacks(void);
600 
601 #endif // WIN32_PLUGIN_H
602