libpurple/glibcompat.h

Tue, 15 Oct 2024 00:47:42 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 15 Oct 2024 00:47:42 -0500
changeset 43011
ce3144e2bc33
parent 42594
eddde70cedd8
permissions
-rw-r--r--

Port prefs to AdwSwitchRow

Now that we depend on Adwaita 1.4, we can flip the switch on using these (pun intended).

This also simplifies some extra tracking we needed to do for activations and focus, since the Adwaita widgets do that for us.

Testing Done:
Opened prefs, confirmed all the switches were there, and toggled them all without any warnings.

Also used the mnemonics to toggle the switches from the keyboard.

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

42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
1 /*
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
2 * Purple - Internet Messaging Library
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
4 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
7 * source distribution.
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
12 * any later version.
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
17 * more details.
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
18 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41217
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
21 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35460
diff changeset
22
41208
48baac6c8989 Remove unnecessary gtk-doc comments and move them where possible from libpurple/[d-m]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41175
diff changeset
23 /*
48baac6c8989 Remove unnecessary gtk-doc comments and move them where possible from libpurple/[d-m]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41175
diff changeset
24 * This file is internal to libpurple. Do not use!
48baac6c8989 Remove unnecessary gtk-doc comments and move them where possible from libpurple/[d-m]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41175
diff changeset
25 *
48baac6c8989 Remove unnecessary gtk-doc comments and move them where possible from libpurple/[d-m]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41175
diff changeset
26 * Also, any public API should not depend on this file.
48baac6c8989 Remove unnecessary gtk-doc comments and move them where possible from libpurple/[d-m]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41175
diff changeset
27 */
48baac6c8989 Remove unnecessary gtk-doc comments and move them where possible from libpurple/[d-m]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41175
diff changeset
28
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39532
diff changeset
29 #ifndef PURPLE_GLIBCOMPAT_H
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39532
diff changeset
30 #define PURPLE_GLIBCOMPAT_H
33368
6aa16fdab83f Fix compilation of older distros. Fixes #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
31
35306
abc36dad1363 Include glib.h before messing with any defines
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35299
diff changeset
32 #include <glib.h>
abc36dad1363 Include glib.h before messing with any defines
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35299
diff changeset
33
35872
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
34 /* glib's definition of g_stat+GStatBuf seems to be broken on mingw64-w32 (and
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
35 * possibly other 32-bit windows), so instead of relying on it,
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
36 * we'll define our own.
35867
b6f09494adda cross-win32: hide glib bug of mismatched g_stat and GStatBuf for win32 (not win64)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35804
diff changeset
37 */
b6f09494adda cross-win32: hide glib bug of mismatched g_stat and GStatBuf for win32 (not win64)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35804
diff changeset
38 #if defined(_WIN32) && !defined(_MSC_VER) && !defined(_WIN64)
b6f09494adda cross-win32: hide glib bug of mismatched g_stat and GStatBuf for win32 (not win64)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35804
diff changeset
39 # include <glib/gstdio.h>
35872
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
40 typedef struct _stat GStatBufW32;
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
41 static inline int
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
42 purple_g_stat(const gchar *filename, GStatBufW32 *buf)
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
43 {
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
44 return g_stat(filename, (GStatBuf*)buf);
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
45 }
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
46 # define GStatBuf GStatBufW32
4cd48601e1d1 cross-win32: better fix for g_stat bug
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35867
diff changeset
47 # define g_stat purple_g_stat
35867
b6f09494adda cross-win32: hide glib bug of mismatched g_stat and GStatBuf for win32 (not win64)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35804
diff changeset
48 #endif
b6f09494adda cross-win32: hide glib bug of mismatched g_stat and GStatBuf for win32 (not win64)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35804
diff changeset
49
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39532
diff changeset
50 #endif /* PURPLE_GLIBCOMPAT_H */

mercurial