Thu, 29 Jun 2017 15:33:29 -0500
gtkidle: Port XScreensaver to DBus ScreenSaver interfaces
Modern Linux desktops use one of 3 DBus interfaces for querying if
the screensaver is currently active. There's a FreeDesktop one, a
GNOME one, and a KDE one. Rather than querying XScreensaver, which
may not be available, such as with Wayland, this patch ports Pidgin's
idle checking function to use these modern DBus interfaces.
Because Gio includes built-in DBus API, this patch also drops the
guards around pidgin_get_time_idle(), which also re-enables the
Win32 code which wasn't enabled with the previous guards.
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
1 | /* pidgin |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
2 | * |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
5 | * source distribution. |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
6 | * |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
7 | * This program is free software; you can redistribute it and/or modify |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
8 | * it under the terms of the GNU General Public License as published by |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
9 | * the Free Software Foundation; either version 2 of the License, or |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
10 | * (at your option) any later version. |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
11 | * |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
12 | * This program is distributed in the hope that it will be useful, |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
15 | * GNU General Public License for more details. |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
16 | * |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
17 | * You should have received a copy of the GNU General Public License |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
18 | * along with this program; if not, write to the Free Software |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
20 | */ |
|
35487
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35474
diff
changeset
|
21 | |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35474
diff
changeset
|
22 | #ifndef PIDGIN_STATUS_ICON_THEME_H |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35474
diff
changeset
|
23 | #define PIDGIN_STATUS_ICON_THEME_H |
|
35451
206524351826
Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents:
35417
diff
changeset
|
24 | /** |
|
206524351826
Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents:
35417
diff
changeset
|
25 | * SECTION:gtkstatus-icon-theme |
|
206524351826
Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents:
35417
diff
changeset
|
26 | * @section_id: pidgin-gtkstatus-icon-theme |
|
206524351826
Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents:
35417
diff
changeset
|
27 | * @short_description: <filename>gtkstatus-icon-theme.h</filename> |
|
206524351826
Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents:
35417
diff
changeset
|
28 | * @title: Pidgin Icon Theme Class |
|
206524351826
Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents:
35417
diff
changeset
|
29 | */ |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
30 | |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
31 | #include <glib-object.h> |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
32 | #include "gtkicon-theme.h" |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
33 | |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
34 | typedef struct _PidginStatusIconTheme PidginStatusIconTheme; |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
35 | typedef struct _PidginStatusIconThemeClass PidginStatusIconThemeClass; |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
36 | |
|
25875
a98b16817658
Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents:
23967
diff
changeset
|
37 | #define PIDGIN_TYPE_STATUS_ICON_THEME (pidgin_status_icon_theme_get_type ()) |
|
a98b16817658
Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents:
23967
diff
changeset
|
38 | #define PIDGIN_STATUS_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIDGIN_TYPE_STATUS_ICON_THEME, PidginStatusIconTheme)) |
|
a98b16817658
Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents:
23967
diff
changeset
|
39 | #define PIDGIN_STATUS_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIDGIN_TYPE_STATUS_ICON_THEME, PidginStatusIconThemeClass)) |
|
a98b16817658
Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents:
23967
diff
changeset
|
40 | #define PIDGIN_IS_STATUS_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIDGIN_TYPE_STATUS_ICON_THEME)) |
|
a98b16817658
Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents:
23967
diff
changeset
|
41 | #define PIDGIN_IS_STATUS_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIDGIN_TYPE_STATUS_ICON_THEME)) |
|
a98b16817658
Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents:
23967
diff
changeset
|
42 | #define PIDGIN_STATUS_ICON_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIDGIN_TYPE_STATUS_ICON_THEME, PidginStatusIconThemeClass)) |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
43 | |
|
35417
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
44 | /** |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
45 | * PidginStatusIconTheme: |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
46 | * |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
47 | * extends PidginIconTheme (gtkicon-theme.h) |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
48 | * A pidgin status icon theme. |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
49 | * This object represents a Pidgin status icon theme. |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
50 | * |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
51 | * PidginStatusIconTheme is a PidginIconTheme Object. |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
52 | */ |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
53 | struct _PidginStatusIconTheme |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
54 | { |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
55 | PidginIconTheme parent; |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
56 | }; |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
57 | |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
58 | struct _PidginStatusIconThemeClass |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
59 | { |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
60 | PidginIconThemeClass parent_class; |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
61 | }; |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
62 | |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
63 | /**************************************************************************/ |
| 35472 | 64 | /* Pidgin Status Icon Theme API */ |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
65 | /**************************************************************************/ |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
66 | G_BEGIN_DECLS |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
67 | |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
68 | /** |
|
35417
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
69 | * pidgin_status_icon_theme_get_type: |
|
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
70 | * |
| 35474 | 71 | * Returns: The #GType for a status icon theme. |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
72 | */ |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
73 | GType pidgin_status_icon_theme_get_type(void); |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
74 | |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff
changeset
|
75 | G_END_DECLS |
|
35417
4e34bb5d3681
Convert docs from doxygen to gtk-doc format for gtksound to pidgintooltip
Ankit Vani <a@nevitus.org>
parents:
26385
diff
changeset
|
76 | |
|
25875
a98b16817658
Lots of minor whitespace and comment changes:
Mark Doliner <markdoliner@pidgin.im>
parents:
23967
diff
changeset
|
77 | #endif /* PIDGIN_STATUS_ICON_THEME_H */ |