libpurple/purpleoptions.c

Mon, 22 Aug 2022 21:40:04 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Mon, 22 Aug 2022 21:40:04 -0500
branch
gtk4
changeset 41567
517ac516af27
parent 41127
cd297cfc56f3
child 41960
c8a4853205e3
permissions
-rw-r--r--

Inline pidgin_make_scrollable

We need to change it for GTK4, and there are few enough that it can be inlined. Eventually, that code might be a `.ui` anyway.

Testing Done:
Compile only.

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

40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
1 /*
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
2 * Purple - Internet Messaging Library
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
40441
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
23 #include <glib/gi18n-lib.h>
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
24
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
25 #include "purpleoptions.h"
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39024
diff changeset
27 #include "debug.h"
38803
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
28 #include "network.h"
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39024
diff changeset
29 #include "util.h"
38803
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
30
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 /******************************************************************************
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 * Callbacks
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 *****************************************************************************/
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 static gboolean
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
35 purple_options_force_online_cb(const gchar *option_name, const gchar *value,
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
36 gpointer data, GError **error)
38803
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
37 {
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
38 purple_network_force_online();
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
39
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
40 return TRUE;
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
41 }
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
42
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 /******************************************************************************
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
44 * Public API
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 *****************************************************************************/
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 GOptionGroup *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 purple_get_option_group(void) {
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 GOptionGroup *group = NULL;
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 GOptionEntry entries[] = {
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 {
39024
3338d8afcad6 options: Fix flags for force-online
Mike Ruprecht <cmaiku@gmail.com>
parents: 38973
diff changeset
51 "force-online", 'f', G_OPTION_FLAG_NO_ARG,
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
52 G_OPTION_ARG_CALLBACK, &purple_options_force_online_cb,
38803
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
53 _("force online, regardless of network status"),
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
54 NULL
38973
b4ebaec25764 libpurple/options.c: NULL terminate GOptionEntry array
Mike Ruprecht <cmaiku@gmail.com>
parents: 38805
diff changeset
55 }, {
b4ebaec25764 libpurple/options.c: NULL terminate GOptionEntry array
Mike Ruprecht <cmaiku@gmail.com>
parents: 38805
diff changeset
56 NULL
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 },
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 };
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 group = g_option_group_new(
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 "libpurple",
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 _("LibPurple options"),
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 _("Show LibPurple Options"),
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 NULL,
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 NULL
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 );
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 g_option_group_add_entries(group, entries);
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 return group;
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 }

mercurial