]> gitweb.michael.orlitzky.com - xfce4-hdaps.git/blob - panel-plugin/xfce4-hdaps.h
c6a28303d9ff032102b115b0a02525dd933276da
[xfce4-hdaps.git] / panel-plugin / xfce4-hdaps.h
1 /*
2 * xfce4-hdaps, an XFCE4 panel plugin for the HDAPS system.
3 *
4 * Copyright (C) 2019 Michael Orlitzky
5 *
6 * http://michael.orlitzky.com/
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details:
17 *
18 * https://www.gnu.org/licenses/agpl-3.0.html
19 *
20 */
21
22 #ifndef __XFCE4_HDAPS_H__
23 #define __XFCE4_HDAPS_H__
24
25 #include <gtk/gtk.h>
26 #include <libxfce4panel/xfce-panel-plugin.h>
27 #include <libxfce4panel/xfce-hvbox.h>
28 #include <libxfce4util/libxfce4util.h>
29
30 G_BEGIN_DECLS
31
32 typedef struct {
33 XfcePanelPlugin *plugin;
34
35 /* Panel widgets */
36 GtkWidget *eventbox;
37 GtkWidget *hvbox;
38 GtkWidget *icon;
39 GtkTooltips *tooltip;
40
41 /* A pointer to the timeout function.
42 That is, a pointer to the function that gets
43 executed every poll_frequency milliseconds. */
44 gint timeout;
45
46 /* Keep track of the previous status so we don't update the
47 icon every poll_frequency for no reason. */
48 int previous_status;
49
50 /* Settings */
51 gchar *device_name;
52 gint poll_frequency;
53
54 /* Pseudo-setting, updated whenever device_name is. */
55 char sysfs_file[FILENAME_MAX];
56
57 /* Configuration dialog widgets */
58 GtkWidget *sb_poll_frequency; /* Spinners on all our rides, yo. */
59 GtkWidget *cb_device_name; /* The "Device name" combo box. */
60
61
62 } HdapsPlugin;
63
64 void hdaps_save(XfcePanelPlugin *plugin,
65 HdapsPlugin *hdaps);
66
67 void hdaps_reset_timeout(HdapsPlugin *hdaps);
68
69 G_END_DECLS
70
71 #endif