pidgin/pidginautoadjustment.c

Sat, 09 Aug 2025 18:12:31 +0800

author
Gong Zhile <gongzl@stu.hebust.edu.cn>
date
Sat, 09 Aug 2025 18:12:31 +0800
branch
gir-dependency
changeset 43305
4ede49515766
parent 43127
eae3279e871c
permissions
-rw-r--r--

Add builtin library dependency for introspection

Without specifying, gir defaults to the system pidgin/purple libraries by default,
which fails the build when new symbols were added and gir failed to link for them.

42443
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include <gtk/gtk.h>
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #include "pidginautoadjustment.h"
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 struct _PidginAutoAdjustment {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 GtkAdjustment parent;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 gboolean auto_scroll;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 };
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
42575
580339aa47cc Make sure all of the final types in pidgin are defined as such
Gary Kramlich <grim@reaperworld.com>
parents: 42443
diff changeset
33 G_DEFINE_FINAL_TYPE(PidginAutoAdjustment, pidgin_auto_adjustment,
580339aa47cc Make sure all of the final types in pidgin are defined as such
Gary Kramlich <grim@reaperworld.com>
parents: 42443
diff changeset
34 GTK_TYPE_ADJUSTMENT)
42443
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 /******************************************************************************
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 * Callbacks
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 *****************************************************************************/
43127
eae3279e871c Use g_timeout_add_once where possible
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42575
diff changeset
39 static void
42443
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 pidgin_auto_adjustment_scroll(gpointer data) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 GtkAdjustment *adjustment = data;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 gdouble upper = 0.0;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 gdouble pagesize = 0.0;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 upper = gtk_adjustment_get_upper(adjustment);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 pagesize = gtk_adjustment_get_page_size(adjustment);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 gtk_adjustment_set_value(adjustment, upper - pagesize);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 static void
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 pidgin_auto_adjustment_changed(GtkAdjustment *gtk_adjustment) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 PidginAutoAdjustment *adjustment = PIDGIN_AUTO_ADJUSTMENT(gtk_adjustment);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 if(adjustment->auto_scroll) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 /* If we set the value here, we interrupt the updates to the other
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * values of the adjustment which breaks the adjustment.
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 *
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 * The specific behavior we've seen is that the upper property doesn't
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 * get updated when we call set value here. Which means you can't even
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 * scroll down anymore in a scrolled window because you're already at
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 * the upper bound. However, if you scroll up, even if there's no where
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 * to scroll, it will update the adjustment's properties and you can
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 * then scroll down.
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 *
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 * By using a timeout to set the value during the next main loop
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 * iteration we avoid this problem.
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 */
43127
eae3279e871c Use g_timeout_add_once where possible
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42575
diff changeset
69 g_timeout_add_once(0, pidgin_auto_adjustment_scroll, adjustment);
42443
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 static void
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 pidgin_auto_adjustment_value_changed(GtkAdjustment *gtk_adjustment) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 PidginAutoAdjustment *adjustment = PIDGIN_AUTO_ADJUSTMENT(gtk_adjustment);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 gdouble current = 0.0;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 gdouble upper = 0.0;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 gdouble pagesize = 0.0;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 current = gtk_adjustment_get_value(gtk_adjustment);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 upper = gtk_adjustment_get_upper(gtk_adjustment);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 pagesize = gtk_adjustment_get_page_size(gtk_adjustment);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 adjustment->auto_scroll = (current + pagesize >= upper);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 /******************************************************************************
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 * GObject Implementation
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 *****************************************************************************/
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 static void
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 pidgin_auto_adjustment_init(PidginAutoAdjustment *adjustment) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 adjustment->auto_scroll = TRUE;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 static void
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 pidgin_auto_adjustment_class_init(PidginAutoAdjustmentClass *klass) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 GtkAdjustmentClass *adjustment_class = GTK_ADJUSTMENT_CLASS(klass);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 adjustment_class->changed = pidgin_auto_adjustment_changed;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 adjustment_class->value_changed = pidgin_auto_adjustment_value_changed;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 /******************************************************************************
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 * Public API
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 *****************************************************************************/
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 GtkAdjustment *
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 pidgin_auto_adjustment_new(void) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 return g_object_new(PIDGIN_TYPE_AUTO_ADJUSTMENT, NULL);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 void
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 pidgin_auto_adjustment_decrement(PidginAutoAdjustment *adjustment) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 gdouble value = 0.0;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 g_return_if_fail(PIDGIN_IS_AUTO_ADJUSTMENT(adjustment));
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 value = gtk_adjustment_get_value(GTK_ADJUSTMENT(adjustment));
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 value -= gtk_adjustment_get_page_increment(GTK_ADJUSTMENT(adjustment));
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustment), value);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 }
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 void
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 pidgin_auto_adjustment_increment(PidginAutoAdjustment *adjustment) {
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 gdouble value = 0.0;
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 g_return_if_fail(PIDGIN_IS_AUTO_ADJUSTMENT(adjustment));
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 value = gtk_adjustment_get_value(GTK_ADJUSTMENT(adjustment));
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 value += gtk_adjustment_get_page_increment(GTK_ADJUSTMENT(adjustment));
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustment), value);
ba2a26d44c0e Port TalkatuAutoScroller to PidginAutoAdjustment
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 }

mercurial