finch/gntidle.h

Fri, 22 Oct 2021 03:33:32 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 22 Oct 2021 03:33:32 -0500
changeset 41136
5397330041d6
parent 41123
089c8a3a9ff4
child 42611
db2718ed7640
permissions
-rw-r--r--

Replace PurpleIdleUiOps with the PurpleIdleUi Interface

This continues our path down replacing the UiOps with Interfaces so that
developers can write user interfaces in other languages using gobject
introspection.

Testing Done:
Ran pidgin3 and set it to auto idle after 1 minute of system idle time. This attempted to query xscreen saver, but something didn't work there, but that's been happening before this change. Not sure if it's my system or the code just needs fixing.

Ran finch3 set idle time to 1 minute and verified that it set me to away after that minute.

I also used the libpurple idle time for both pidgin3 and finch3 and verified they continued to work as well.

Reviewed at https://reviews.imfreedom.org/r/1091/

39887
9c8f874c74a0 Clean up all of the license headers
Gary Kramlich <grim@reaperworld.com>
parents: 39885
diff changeset
1 /*
41136
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
2 * Finch - Universal Text Chat Client
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
15802
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
4 *
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
8 * (at your option) any later version.
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
9 *
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
13 * GNU General Public License for more details.
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
14 *
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
41136
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
16 * along with this program; if not, see <https://www.gnu.org/licenses/>.
15802
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
17 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35486
diff changeset
18
40508
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
19 #if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION)
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
20 # error "only <finch.h> may be included directly"
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
21 #endif
2ebcb8eb5c01 create a global header for finch
Gary Kramlich <grim@reaperworld.com>
parents: 40359
diff changeset
22
39885
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 37094
diff changeset
23 #ifndef FINCH_IDLE_H
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 37094
diff changeset
24 #define FINCH_IDLE_H
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 37094
diff changeset
25
40359
ca141ea93b83 Make all of finch use purple.h
Gary Kramlich <grim@reaperworld.com>
parents: 39887
diff changeset
26 #include <purple.h>
15802
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
27
41136
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
28 /**
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
29 * FinchIdle:
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
30 *
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
31 * An implementation of [iface@Purple.IdleUi] for Finch.
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
32 *
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
33 * Since: 3.0.0
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
34 */
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
35
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
36 #define FINCH_TYPE_IDLE (finch_idle_get_type())
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
37 G_DECLARE_FINAL_TYPE(FinchIdle, finch_idle, FINCH, IDLE, GObject)
15802
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
38
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
39 /**
41136
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
40 * finch_idle_new:
35410
5a6336f20f6e Convert docs from doxygen to gtk-doc format for finch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
41 *
41136
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
42 * Creates a new [class@Idle].
15802
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
43 *
41136
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
44 * Returns: (transfer full): The new instance.
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
45 *
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
46 * Since: 3.0.0
15802
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
47 */
41136
5397330041d6 Replace PurpleIdleUiOps with the PurpleIdleUi Interface
Gary Kramlich <grim@reaperworld.com>
parents: 41123
diff changeset
48 PurpleIdleUi *finch_idle_new(void);
15802
1e124a68997e gntgaim idle reporting, this fixes idle return
Richard Nelson <wabz@pidgin.im>
parents:
diff changeset
49
39885
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 37094
diff changeset
50 #endif /* FINCH_IDLE_H */
b1b266896ec1 Fix the header guards for finch
Gary Kramlich <grim@reaperworld.com>
parents: 37094
diff changeset
51

mercurial