Mon, 12 Aug 2024 23:25:52 -0500
Use gtk_window_present instead of gtk_window_present_with_time
The latter was deprecated in GTK 4.14.0 while the other one has been around
forever.
Testing Done:
Called in the turtles and run in the devenv.
Reviewed at https://reviews.imfreedom.org/r/3388/
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Pidgin - Internet Messenger |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include "pidgindisplayitem.h" |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | struct _PidginDisplayItem { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | GObject parent; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | GtkWidget *widget; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | char *id; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | char *title; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | char *icon_name; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
35 | GMenuModel *menu; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
36 | |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | gboolean needs_attention; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | guint badge_number; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | GListModel *children; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | }; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | enum { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | PROP_0, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | PROP_WIDGET, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | PROP_ID, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | PROP_TITLE, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | PROP_ICON_NAME, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | PROP_NEEDS_ATTENTION, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | PROP_BADGE_NUMBER, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | PROP_CHILDREN, |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
52 | PROP_MENU, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | N_PROPERTIES, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | }; |
|
42584
687260353985
Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42575
diff
changeset
|
55 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | |
|
42575
580339aa47cc
Make sure all of the final types in pidgin are defined as such
Gary Kramlich <grim@reaperworld.com>
parents:
42050
diff
changeset
|
57 | G_DEFINE_FINAL_TYPE(PidginDisplayItem, pidgin_display_item, G_TYPE_OBJECT) |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | /****************************************************************************** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * Helpers |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | *****************************************************************************/ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | pidgin_display_item_set_widget(PidginDisplayItem *item, GtkWidget *widget) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | if(g_set_object(&item->widget, widget)) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | g_object_notify_by_pspec(G_OBJECT(item), properties[PROP_WIDGET]); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | pidgin_display_item_set_id(PidginDisplayItem *item, const char *id) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | g_return_if_fail(id != NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | |
|
42767
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42620
diff
changeset
|
76 | if(g_set_str(&item->id, id)) { |
|
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42620
diff
changeset
|
77 | g_object_notify_by_pspec(G_OBJECT(item), properties[PROP_ID]); |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | /****************************************************************************** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | * GObject Implementation |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | *****************************************************************************/ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | pidgin_display_item_dispose(GObject *obj) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | PidginDisplayItem *item = PIDGIN_DISPLAY_ITEM(obj); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | g_clear_object(&item->widget); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | g_clear_object(&item->children); |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
90 | g_clear_object(&item->menu); |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | G_OBJECT_CLASS(pidgin_display_item_parent_class)->dispose(obj); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | pidgin_display_item_finalize(GObject *obj) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | PidginDisplayItem *item = PIDGIN_DISPLAY_ITEM(obj); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | g_clear_pointer(&item->id, g_free); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | g_clear_pointer(&item->title, g_free); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | g_clear_pointer(&item->icon_name, g_free); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | G_OBJECT_CLASS(pidgin_display_item_parent_class)->finalize(obj); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | pidgin_display_item_get_property(GObject *obj, guint param_id, GValue *value, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | GParamSpec *pspec) |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | PidginDisplayItem *item = PIDGIN_DISPLAY_ITEM(obj); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | switch(param_id) { |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
113 | case PROP_WIDGET: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
114 | g_value_set_object(value, pidgin_display_item_get_widget(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
115 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
116 | case PROP_ID: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
117 | g_value_set_string(value, pidgin_display_item_get_id(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
118 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
119 | case PROP_TITLE: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
120 | g_value_set_string(value, pidgin_display_item_get_title(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
121 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
122 | case PROP_ICON_NAME: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
123 | g_value_set_string(value, pidgin_display_item_get_icon_name(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
124 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
125 | case PROP_NEEDS_ATTENTION: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
126 | g_value_set_boolean(value, |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
127 | pidgin_display_item_get_needs_attention(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
128 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
129 | case PROP_BADGE_NUMBER: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
130 | g_value_set_uint(value, |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
131 | pidgin_display_item_get_badge_number(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
132 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
133 | case PROP_CHILDREN: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
134 | g_value_set_object(value, pidgin_display_item_get_children(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
135 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
136 | case PROP_MENU: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
137 | g_value_set_object(value, pidgin_display_item_get_menu(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
138 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
139 | default: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
140 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
141 | break; |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | pidgin_display_item_set_property(GObject *obj, guint param_id, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | const GValue *value, GParamSpec *pspec) |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | PidginDisplayItem *item = PIDGIN_DISPLAY_ITEM(obj); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | switch(param_id) { |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
152 | case PROP_WIDGET: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
153 | pidgin_display_item_set_widget(item, g_value_get_object(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
154 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
155 | case PROP_ID: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
156 | pidgin_display_item_set_id(item, g_value_get_string(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
157 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
158 | case PROP_TITLE: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
159 | pidgin_display_item_set_title(item, g_value_get_string(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
160 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
161 | case PROP_ICON_NAME: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
162 | pidgin_display_item_set_icon_name(item, g_value_get_string(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
163 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
164 | case PROP_NEEDS_ATTENTION: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
165 | pidgin_display_item_set_needs_attention(item, |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
166 | g_value_get_boolean(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
167 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
168 | case PROP_BADGE_NUMBER: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
169 | pidgin_display_item_set_badge_number(item, |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
170 | g_value_get_uint(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
171 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
172 | case PROP_CHILDREN: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
173 | pidgin_display_item_set_children(item, g_value_get_object(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
174 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
175 | case PROP_MENU: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
176 | pidgin_display_item_set_menu(item, g_value_get_object(value)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
177 | break; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
178 | default: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
179 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
180 | break; |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
181 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
182 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
183 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
184 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
185 | pidgin_display_item_init(G_GNUC_UNUSED PidginDisplayItem *window) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
186 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
187 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
188 | static void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
189 | pidgin_display_item_class_init(PidginDisplayItemClass *klass) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
190 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
191 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
192 | obj_class->dispose = pidgin_display_item_dispose; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
193 | obj_class->finalize = pidgin_display_item_finalize; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
194 | obj_class->get_property = pidgin_display_item_get_property; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
195 | obj_class->set_property = pidgin_display_item_set_property; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
196 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
197 | /** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
198 | * PidginDisplayItem:widget: |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
199 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
200 | * The [class@Gtk.Widget] that this item is for. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
201 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42584
diff
changeset
|
202 | * Since: 3.0 |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
204 | properties[PROP_WIDGET] = g_param_spec_object( |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
205 | "widget", NULL, NULL, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 | GTK_TYPE_WIDGET, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
208 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
209 | /** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
210 | * PidginDisplayItem:id: |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
212 | * A unique identifier for this item. This is used for things like |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
213 | * remembering positions and selections. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
214 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42584
diff
changeset
|
215 | * Since: 3.0 |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
216 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
217 | properties[PROP_ID] = g_param_spec_string( |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
218 | "id", NULL, NULL, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
219 | NULL, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
220 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
221 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
222 | /** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
223 | * PidginDisplayItem:title: |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
224 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
225 | * The title that should be displayed for this item. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
226 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42584
diff
changeset
|
227 | * Since: 3.0 |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
228 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
229 | properties[PROP_TITLE] = g_param_spec_string( |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
230 | "title", NULL, NULL, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
231 | NULL, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
232 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
233 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
234 | /** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
235 | * PidginDisplayItem:icon-name: |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
236 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
237 | * The icon name to use for this item. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
238 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42584
diff
changeset
|
239 | * Since: 3.0 |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
240 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
241 | properties[PROP_ICON_NAME] = g_param_spec_string( |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
242 | "icon-name", NULL, NULL, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
243 | NULL, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
244 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | /** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
247 | * PidginDisplayItem:needs-attention: |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
248 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
249 | * Determines whether the item should show that it needs attention or not. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
250 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42584
diff
changeset
|
251 | * Since: 3.0 |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
252 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
253 | properties[PROP_NEEDS_ATTENTION] = g_param_spec_boolean( |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
254 | "needs-attention", NULL, NULL, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
255 | FALSE, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
256 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
257 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
258 | /** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 | * PidginDisplayItem:badge-number: |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
260 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
261 | * The number that should be shown in the badge. Typically this is an |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
262 | * unread count. If this is 0 it should not be displayed. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
263 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42584
diff
changeset
|
264 | * Since: 3.0 |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
266 | properties[PROP_BADGE_NUMBER] = g_param_spec_uint( |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
267 | "badge-number", NULL, NULL, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
268 | 0, G_MAXUINT, 0, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
269 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
270 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
271 | /** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
272 | * PidginDisplayItem:children: |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
273 | * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
274 | * A [iface@Gio.ListModel] of child items. The type of the model needs to |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
275 | * be [class@Pidgin.DisplayItem]. |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
276 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42584
diff
changeset
|
277 | * Since: 3.0 |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
278 | */ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
279 | properties[PROP_CHILDREN] = g_param_spec_object( |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
280 | "children", NULL, NULL, |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
281 | G_TYPE_LIST_MODEL, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
282 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
283 | |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
284 | /** |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
285 | * PidginDisplayItem:menu: |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
286 | * |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
287 | * An optional menu to show on the item. |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
288 | * |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
289 | * Since: 3.0 |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
290 | */ |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
291 | properties[PROP_MENU] = g_param_spec_object( |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
292 | "menu", NULL, NULL, |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
293 | G_TYPE_MENU_MODEL, |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
294 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
295 | |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
296 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
297 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
298 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
299 | /****************************************************************************** |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
300 | * API |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
301 | *****************************************************************************/ |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
302 | PidginDisplayItem * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
303 | pidgin_display_item_new(GtkWidget *widget, const char *id) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
304 | g_return_val_if_fail(GTK_IS_WIDGET(widget), NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
305 | g_return_val_if_fail(id != NULL, NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
306 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
307 | return g_object_new( |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
308 | PIDGIN_TYPE_DISPLAY_ITEM, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
309 | "widget", widget, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
310 | "id", id, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
311 | NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
312 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
313 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
314 | GtkWidget * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
315 | pidgin_display_item_get_widget(PidginDisplayItem *item) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
316 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
317 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
318 | return item->widget; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
319 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
320 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
321 | const char * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
322 | pidgin_display_item_get_id(PidginDisplayItem *item) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
323 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
324 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
325 | return item->id; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
326 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
327 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
328 | const char * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
329 | pidgin_display_item_get_title(PidginDisplayItem *item) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
330 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
331 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
332 | return item->title; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
333 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
334 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
335 | void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
336 | pidgin_display_item_set_title(PidginDisplayItem *item, const char *title) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
337 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
338 | |
|
42767
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42620
diff
changeset
|
339 | if(g_set_str(&item->title, title)) { |
|
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42620
diff
changeset
|
340 | g_object_notify_by_pspec(G_OBJECT(item), properties[PROP_TITLE]); |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
341 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
342 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
343 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
344 | const char * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
345 | pidgin_display_item_get_icon_name(PidginDisplayItem *item) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
346 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
347 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
348 | return item->icon_name; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
349 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
350 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
351 | void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
352 | pidgin_display_item_set_icon_name(PidginDisplayItem *item, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
353 | const char *icon_name) |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
354 | { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
355 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
356 | |
|
42767
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42620
diff
changeset
|
357 | if(g_set_str(&item->icon_name, icon_name)) { |
|
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42620
diff
changeset
|
358 | g_object_notify_by_pspec(G_OBJECT(item), properties[PROP_ICON_NAME]); |
|
42050
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
359 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
360 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
361 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
362 | gboolean |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
363 | pidgin_display_item_get_needs_attention(PidginDisplayItem *item) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
364 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), FALSE); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
365 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
366 | return item->needs_attention; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
367 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
368 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
369 | void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
370 | pidgin_display_item_set_needs_attention(PidginDisplayItem *item, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
371 | gboolean needs_attention) |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
372 | { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
373 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
374 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
375 | if(item->needs_attention != needs_attention) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
376 | item->needs_attention = needs_attention; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
377 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
378 | g_object_notify_by_pspec(G_OBJECT(item), |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
379 | properties[PROP_NEEDS_ATTENTION]); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
380 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
381 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
382 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
383 | guint |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
384 | pidgin_display_item_get_badge_number(PidginDisplayItem *item) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
385 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), 0); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
386 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
387 | return item->badge_number; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
388 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
389 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
390 | void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
391 | pidgin_display_item_set_badge_number(PidginDisplayItem *item, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
392 | guint badge_number) |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
393 | { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
394 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
395 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
396 | if(item->badge_number != badge_number) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
397 | item->badge_number = badge_number; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
398 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
399 | g_object_notify_by_pspec(G_OBJECT(item), |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
400 | properties[PROP_BADGE_NUMBER]); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
401 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
402 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
403 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
404 | GListModel * |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
405 | pidgin_display_item_get_children(PidginDisplayItem *item) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
406 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), NULL); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
407 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
408 | return item->children; |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
409 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
410 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
411 | void |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
412 | pidgin_display_item_set_children(PidginDisplayItem *item, |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
413 | GListModel *children) |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
414 | { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
415 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
416 | |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
417 | if(g_set_object(&item->children, children)) { |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
418 | g_object_notify_by_pspec(G_OBJECT(item), properties[PROP_CHILDREN]); |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
419 | } |
|
5ac6db2b8c2d
Make the DisplayWindow use a GtkListView
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
420 | } |
|
42797
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
421 | |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
422 | GMenuModel * |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
423 | pidgin_display_item_get_menu(PidginDisplayItem *item) { |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
424 | g_return_val_if_fail(PIDGIN_IS_DISPLAY_ITEM(item), NULL); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
425 | |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
426 | return item->menu; |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
427 | } |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
428 | |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
429 | void |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
430 | pidgin_display_item_set_menu(PidginDisplayItem *item, GMenuModel *model) { |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
431 | g_return_if_fail(PIDGIN_IS_DISPLAY_ITEM(item)); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
432 | |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
433 | if(g_set_object(&item->menu, model)) { |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
434 | g_object_notify_by_pspec(G_OBJECT(item), properties[PROP_MENU]); |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
435 | } |
|
767b7685a4a4
Add a menu to PidginDisplayItem
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
436 | } |