Wed, 20 Jun 2018 02:13:44 -0400
prefs: Add binding versions of pref widget functions.
These just bind settings to existing widgets and copy the saved value to
the widget, except for combos which are produced from runtime lists.
Those are populated in a similar way as before.
There are some extra _bind_ words that will probably be dropped once the
other functions are unused.
|
19050
78ed2f8cd58d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
1 | /* TODO: Can we just replace this whole thing with a GCache */ |
|
78ed2f8cd58d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
2 | |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
3 | /* purple |
| 7763 | 4 | * |
| 15884 | 5 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 7 | * source distribution. | |
| 7763 | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify | |
| 10 | * it under the terms of the GNU General Public License as published by | |
| 11 | * the Free Software Foundation; either version 2 of the License, or | |
| 12 | * (at your option) any later version. | |
| 13 | * | |
| 14 | * This program is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License | |
| 20 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19050
diff
changeset
|
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7763 | 22 | * |
| 23 | */ | |
|
35487
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35444
diff
changeset
|
24 | |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35444
diff
changeset
|
25 | #ifndef _PURPLE_STRINGREF_H_ |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35444
diff
changeset
|
26 | #define _PURPLE_STRINGREF_H_ |
|
35442
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35403
diff
changeset
|
27 | /** |
|
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35403
diff
changeset
|
28 | * SECTION:stringref |
|
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35403
diff
changeset
|
29 | * @section_id: libpurple-stringref |
|
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35403
diff
changeset
|
30 | * @short_description: <filename>stringref.h</filename> |
| 35444 | 31 | * @title: Reference-counted Immutable Strings |
|
35442
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35403
diff
changeset
|
32 | */ |
|
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35403
diff
changeset
|
33 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20147
diff
changeset
|
34 | typedef struct _PurpleStringref PurpleStringref; |
|
14988
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14254
diff
changeset
|
35 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20147
diff
changeset
|
36 | G_BEGIN_DECLS |
| 7763 | 37 | |
| 38 | /** | |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
39 | * purple_stringref_new: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
40 | * @value: This will be the value of the string; it will be |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
41 | * duplicated. |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
42 | * |
| 7763 | 43 | * Creates an immutable reference-counted string object. The newly |
| 44 | * created object will have a reference count of 1. | |
| 45 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
46 | * Returns: A newly allocated string reference object with a refcount |
| 7767 | 47 | * of 1. |
| 7763 | 48 | */ |
| 15884 | 49 | PurpleStringref *purple_stringref_new(const char *value); |
| 7763 | 50 | |
| 51 | /** | |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
52 | * purple_stringref_new_noref: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
53 | * @value: This will be the value of the string; it will be |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
54 | * duplicated. |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
55 | * |
| 7786 | 56 | * Creates an immutable reference-counted string object. The newly |
| 57 | * created object will have a reference count of zero, and if it is | |
| 58 | * not referenced before the next iteration of the mainloop it will | |
| 59 | * be freed at that time. | |
| 60 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
61 | * Returns: A newly allocated string reference object with a refcount |
| 7786 | 62 | * of zero. |
| 63 | */ | |
| 15884 | 64 | PurpleStringref *purple_stringref_new_noref(const char *value); |
| 7786 | 65 | |
| 66 | /** | |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
67 | * purple_stringref_printf: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
68 | * @format: A printf-style format specification. |
|
38016
3ac0882cd563
A few random cleanups and don't even try to document class structs
Gary Kramlich <grim@reaperworld.com>
parents:
37094
diff
changeset
|
69 | * @...: The arguments for the format specification. |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
70 | * |
| 7767 | 71 | * Creates an immutable reference-counted string object from a printf |
| 72 | * format specification and arguments. The created object will have a | |
| 73 | * reference count of 1. | |
| 74 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
75 | * Returns: A newly allocated string reference object with a refcount |
| 7767 | 76 | * of 1. |
| 77 | */ | |
| 15884 | 78 | PurpleStringref *purple_stringref_printf(const char *format, ...); |
| 7767 | 79 | |
| 80 | /** | |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
81 | * purple_stringref_ref: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
82 | * @stringref: String to be referenced. |
| 7763 | 83 | * |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
84 | * Increase the reference count of the given stringref. |
| 7763 | 85 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
86 | * Returns: A pointer to the referenced string. |
| 7763 | 87 | */ |
| 15884 | 88 | PurpleStringref *purple_stringref_ref(PurpleStringref *stringref); |
| 7763 | 89 | |
| 90 | /** | |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
91 | * purple_stringref_unref: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
92 | * @stringref: String to be dereferenced. |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
93 | * |
| 7763 | 94 | * Decrease the reference count of the given stringref. If this |
| 95 | * reference count reaches zero, the stringref will be freed; thus | |
| 96 | * you MUST NOT use this string after dereferencing it. | |
| 97 | */ | |
| 15884 | 98 | void purple_stringref_unref(PurpleStringref *stringref); |
| 7763 | 99 | |
| 100 | /** | |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
101 | * purple_stringref_value: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
102 | * @stringref: String reference from which to retrieve the value. |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
103 | * |
| 7763 | 104 | * Retrieve the value of a stringref. |
| 105 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
106 | * Note: This value should not be cached or stored in a local variable. |
| 7763 | 107 | * While there is nothing inherently incorrect about doing so, it |
| 108 | * is easy to forget that the cached value is in fact a | |
| 109 | * reference-counted object and accidentally use it after | |
| 110 | * dereferencing. This is more problematic for a reference- | |
| 111 | * counted object than a heap-allocated object, as it may seem to | |
| 112 | * be valid or invalid nondeterministically based on how many | |
| 113 | * other references to it exist. | |
| 114 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
115 | * Returns: The contents of the string reference. |
| 7763 | 116 | */ |
| 15884 | 117 | const char *purple_stringref_value(const PurpleStringref *stringref); |
| 7763 | 118 | |
| 7786 | 119 | /** |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
120 | * purple_stringref_cmp: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
121 | * @s1: The reference string. |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
122 | * @s2: The string to compare against the reference. |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
123 | * |
| 7786 | 124 | * Compare two stringrefs for string equality. This returns the same |
| 125 | * value as strcmp would, where <0 indicates that s1 is "less than" s2 | |
| 126 | * in the ASCII lexicography, 0 indicates equality, etc. | |
| 127 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
128 | * Returns: An ordering indication on s1 and s2. |
| 7786 | 129 | */ |
| 15884 | 130 | int purple_stringref_cmp(const PurpleStringref *s1, const PurpleStringref *s2); |
| 7786 | 131 | |
| 132 | /** | |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
133 | * purple_stringref_len: |
|
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
134 | * @stringref: The string in whose length we are interested. |
| 7786 | 135 | * |
|
35403
9282701d7aa9
Convert docs from doxygen to gtk-doc format for sound-theme-loader to xmlnode
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
136 | * Find the length of the string inside a stringref. |
| 7786 | 137 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
138 | * Returns: The length of the string in stringref |
| 7786 | 139 | */ |
| 15884 | 140 | size_t purple_stringref_len(const PurpleStringref *stringref); |
| 7786 | 141 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20147
diff
changeset
|
142 | G_END_DECLS |
|
14988
66b34458d49e
[gaim-migrate @ 17698]
Richard Laager <rlaager@pidgin.im>
parents:
14254
diff
changeset
|
143 | |
| 15884 | 144 | #endif /* _PURPLE_STRINGREF_H_ */ |