comparison src/gtkblist.c @ 9811:a107051d991f

[gaim-migrate @ 10682] Whitespace fixes. From my point of view, anyway committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 22 Aug 2004 02:13:04 +0000
parents 4a15962c344a
children d56f24cc4dad
comparison
equal deleted inserted replaced
9810:f64e382d5334 9811:a107051d991f
73 73
74 } GaimGtkAddBuddyData; 74 } GaimGtkAddBuddyData;
75 75
76 typedef struct 76 typedef struct
77 { 77 {
78 GaimAccount *account; 78 GaimAccount *account;
79 const char *default_chat_name; 79 const char *default_chat_name;
80 80
81 GtkWidget *window; 81 GtkWidget *window;
82 GtkWidget *account_menu; 82 GtkWidget *account_menu;
83 GtkWidget *alias_entry; 83 GtkWidget *alias_entry;
84 GtkWidget *group_combo; 84 GtkWidget *group_combo;
85 GtkWidget *entries_box; 85 GtkWidget *entries_box;
86 GtkSizeGroup *sg; 86 GtkSizeGroup *sg;
180 .941, .847, .698, .521, .215 180 .941, .847, .698, .521, .215
181 }; 181 };
182 182
183 183
184 static GdkPixbuf * 184 static GdkPixbuf *
185 get_pixbuf (GtkWidget *menu, 185 get_pixbuf(GtkWidget *menu, int x, int y, int width, int height)
186 int x, 186 {
187 int y, 187 GdkPixbuf *dest, *src;
188 int width, 188 GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET(menu));
189 int height) 189 GdkWindow *root = gdk_screen_get_root_window (screen);
190 { 190 gint screen_height = gdk_screen_get_height (screen);
191 GdkPixbuf *dest, *src; 191 gint screen_width = gdk_screen_get_width (screen);
192 GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET(menu)); 192 gint original_width = width;
193 GdkWindow *root = gdk_screen_get_root_window (screen); 193 gint original_height = height;
194 gint screen_height = gdk_screen_get_height (screen);
195 gint screen_width = gdk_screen_get_width (screen);
196 gint original_width = width;
197 gint original_height = height;
198 194
199 #ifdef _WIN32 195 #ifdef _WIN32
200 /* In Win32, GDK gets the workarea that isn't occupied by toolbars 196 /* In Win32, GDK gets the workarea that isn't occupied by toolbars
201 (including the taskbar) and uses that region as the screen size. 197 * (including the taskbar) and uses that region as the screen size.
202 GTK returns positions based on a screen size that ignores these 198 * GTK returns positions based on a screen size that ignores these
203 toolbars. Since we want a pixmap with real X,Y coordinates, we 199 * toolbars. Since we want a pixmap with real X,Y coordinates, we
204 need to find out the offset from GTK's screen to GDK's screen, 200 * need to find out the offset from GTK's screen to GDK's screen,
205 and adjust the pixmaps we grab accordingly. GDK will not deal 201 * and adjust the pixmaps we grab accordingly. GDK will not deal
206 with toolbar position updates, so we're stuck restarting Gaim 202 * with toolbar position updates, so we're stuck restarting Gaim
207 if that happens. */ 203 * if that happens.
208 RECT *workarea = g_malloc(sizeof(RECT)); 204 */
209 SystemParametersInfo(SPI_GETWORKAREA, 0, (void *)workarea, 0); 205 RECT *workarea = g_malloc(sizeof(RECT));
210 x += (workarea->left); 206 SystemParametersInfo(SPI_GETWORKAREA, 0, (void *)workarea, 0);
211 y += (workarea->top); 207 x += (workarea->left);
212 g_free(workarea); 208 y += (workarea->top);
209 g_free(workarea);
213 #endif 210 #endif
214 211
215 if (x < 0) 212 if (x < 0) {
216 { 213 width += x;
217 width += x; 214 x = 0;
218 x = 0; 215 }
219 } 216
220 217 if (y < 0) {
221 if (y < 0) 218 height += y;
222 { 219 y = 0;
223 height += y; 220 }
224 y = 0; 221
225 } 222 if (x + width > screen_width) {
226 223 width = screen_width - x;
227 if (x + width > screen_width) 224 }
228 { 225
229 width = screen_width - x; 226 if (y + height > screen_height) {
230 } 227 height = screen_height - y;
231 228 }
232 if (y + height > screen_height) 229
233 { 230 if (width <= 0 || height <= 0)
234 height = screen_height - y; 231 return NULL;
235 } 232
236 233 dest = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
237 if (width <= 0 || height <= 0) 234 original_width, original_height);
238 return NULL; 235 src = gdk_pixbuf_get_from_drawable(NULL, root, NULL, x, y, 0, 0,
239 236 width, height);
240 dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 237 gdk_pixbuf_copy_area (src, 0, 0, width, height, dest, 0, 0);
241 original_width, original_height); 238
242 src = gdk_pixbuf_get_from_drawable (NULL, root, NULL, x, y, 0, 0, 239 g_object_unref (G_OBJECT (src));
243 width, height); 240
244 gdk_pixbuf_copy_area (src, 0, 0, width, height, dest, 0, 0); 241 return dest;
245
246 g_object_unref (G_OBJECT (src));
247
248 return dest;
249 } 242 }
250 243
251 static void 244 static void
252 shadow_paint(GaimGtkBuddyList *blist, GdkRectangle *area, enum side shadow) 245 shadow_paint(GaimGtkBuddyList *blist, GdkRectangle *area, enum side shadow)
253 { 246 {
254 gint width, height; 247 gint width, height;
255 GdkGC *gc = gtkblist->tipwindow->style->black_gc; 248 GdkGC *gc = gtkblist->tipwindow->style->black_gc;
256 249
257 switch (shadow) 250 switch (shadow) {
258 { 251 case EAST_SIDE:
259 case EAST_SIDE: 252 if (gtkblist->east != NULL) {
260 if (gtkblist->east != NULL) 253 if (area)
261 { 254 gdk_gc_set_clip_rectangle (gc, area);
262 if (area) 255
263 gdk_gc_set_clip_rectangle (gc, area); 256 width = gdk_pixbuf_get_width (gtkblist->east);
264 257 height = gdk_pixbuf_get_height (gtkblist->east);
265 width = gdk_pixbuf_get_width (gtkblist->east); 258
266 height = gdk_pixbuf_get_height (gtkblist->east); 259 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->east_shadow), gc,
267 260 gtkblist->east, 0, 0, 0, 0, width, height,
268 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->east_shadow), gc, 261 GDK_RGB_DITHER_NONE, 0, 0);
269 gtkblist->east, 0, 0, 0, 0, width, height, GDK_RGB_DITHER_NONE, 262
270 0, 0); 263 if (area)
271 264 gdk_gc_set_clip_rectangle (gc, NULL);
272 if (area) 265 }
273 gdk_gc_set_clip_rectangle (gc, NULL); 266 break;
274 } 267
275 break; 268 case SOUTH_SIDE:
276 case SOUTH_SIDE: 269 if (blist->south != NULL) {
277 if (blist->south != NULL) 270 if (area)
278 { 271 gdk_gc_set_clip_rectangle (gc, area);
279 if (area) 272
280 gdk_gc_set_clip_rectangle (gc, area); 273 width = gdk_pixbuf_get_width (gtkblist->south);
281 274 height = gdk_pixbuf_get_height (gtkblist->south);
282 width = gdk_pixbuf_get_width (gtkblist->south); 275
283 height = gdk_pixbuf_get_height (gtkblist->south); 276 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->south_shadow), gc,
284 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->south_shadow), gc, gtkblist->south, 277 gtkblist->south, 0, 0, 0, 0, width, height,
285 0, 0, 0, 0, width, height, GDK_RGB_DITHER_NONE, 0, 0); 278 GDK_RGB_DITHER_NONE, 0, 0);
286 279
287 if (area) 280 if (area)
288 gdk_gc_set_clip_rectangle (gc, NULL); 281 gdk_gc_set_clip_rectangle (gc, NULL);
289 } 282 }
290 break; 283 break;
291 default: 284 }
292 break;
293 }
294 } 285 }
295 286
296 static void 287 static void
297 pixbuf_add_shadow (GdkPixbuf *pb, 288 pixbuf_add_shadow (GdkPixbuf *pb, enum side shadow)
298 enum side shadow) 289 {
299 { 290 gint width, rowstride, height;
300 gint width, rowstride, height; 291 gint i;
301 gint i; 292 guchar *pixels, *p;
302 guchar *pixels, *p; 293
303 294 width = gdk_pixbuf_get_width (pb);
304 width = gdk_pixbuf_get_width (pb); 295 height = gdk_pixbuf_get_height (pb);
305 height = gdk_pixbuf_get_height (pb); 296 rowstride = gdk_pixbuf_get_rowstride (pb);
306 rowstride = gdk_pixbuf_get_rowstride (pb); 297 pixels = gdk_pixbuf_get_pixels (pb);
307 pixels = gdk_pixbuf_get_pixels (pb); 298
308 299 switch (shadow) {
309 switch (shadow) 300 case EAST_SIDE:
310 { 301 if (height > 5) {
311 case EAST_SIDE: 302 for (i = 0; i < width; i++) {
312 if (height > 5) 303 gint j, k;
313 { 304
314 for (i = 0; i < width; i++) 305 p = pixels + (i * rowstride);
315 { 306 for (j = 0, k = 0; j < 3 * width; j += 3, k++) {
316 gint j, k; 307 p[j] = (guchar) (p[j] * top_right_corner [i * width + k]);
317 308 p[j + 1] = (guchar) (p[j + 1] * top_right_corner [i * width + k]);
318 p = pixels + (i * rowstride); 309 p[j + 2] = (guchar) (p[j + 2] * top_right_corner [i * width + k]);
319 for (j = 0, k = 0; j < 3 * width; j += 3, k++) 310 }
320 { 311 }
321 p[j] = (guchar) (p[j] * top_right_corner [i * width + k]); 312
322 p[j + 1] = (guchar) (p[j + 1] * top_right_corner [i * width + k]); 313 i = 5;
323 p[j + 2] = (guchar) (p[j + 2] * top_right_corner [i * width + k]); 314 } else {
324 } 315 i = 0;
325 } 316 }
326 317
327 i = 5; 318 for (; i < height; i++) {
328 } 319 gint j, k;
329 else 320
330 { 321 p = pixels + (i * rowstride);
331 i = 0; 322 for (j = 0, k = 0; j < 3 * width; j += 3, k++) {
332 } 323 p[j] = (guchar) (p[j] * shadow_strip_l[width - 1 - k]);
333 324 p[j + 1] = (guchar) (p[j + 1] * shadow_strip_l[width - 1 - k]);
334 for (;i < height; i++) 325 p[j + 2] = (guchar) (p[j + 2] * shadow_strip_l[width - 1 - k]);
335 { 326 }
336 gint j, k; 327 }
337 328 break;
338 p = pixels + (i * rowstride); 329
339 for (j = 0, k = 0; j < 3 * width; j += 3, k++) 330 case SOUTH_SIDE:
340 { 331 for (i = 0; i < height; i++) {
341 p[j] = (guchar) (p[j] * shadow_strip_l[width - 1 - k]); 332 gint j, k;
342 p[j + 1] = (guchar) (p[j + 1] * shadow_strip_l[width - 1 - k]); 333
343 p[j + 2] = (guchar) (p[j + 2] * shadow_strip_l[width - 1 - k]); 334 p = pixels + (i * rowstride);
344 } 335 for (j = 0, k = 0; j < 3 * height; j += 3, k++) {
345 } 336 p[j] = (guchar) (p[j] * bottom_left_corner[i * height + k]);
346 break; 337 p[j + 1] = (guchar) (p[j + 1] * bottom_left_corner[i * height + k]);
347 338 p[j + 2] = (guchar) (p[j + 2] * bottom_left_corner[i * height + k]);
348 case SOUTH_SIDE: 339 }
349 for (i = 0; i < height; i++) 340
350 { 341 p = pixels + (i * rowstride) + 3 * height;
351 gint j, k; 342 for (j = 0, k = 0; j < (width * 3) - (6 * height); j += 3, k++) {
352 343 p[j] = (guchar) (p[j] * bottom_right_corner [i * height]);
353 p = pixels + (i * rowstride); 344 p[j + 1] = (guchar) (p[j + 1] * bottom_right_corner [i * height]);
354 for (j = 0, k = 0; j < 3 * height; j += 3, k++) 345 p[j + 2] = (guchar) (p[j + 2] * bottom_right_corner [i * height]);
355 { 346 }
356 p[j] = (guchar) (p[j] * bottom_left_corner[i * height + k]); 347
357 p[j + 1] = (guchar) (p[j + 1] * bottom_left_corner[i * height + k]); 348 p = pixels + (i * rowstride) + ((width * 3) - (3 * height));
358 p[j + 2] = (guchar) (p[j + 2] * bottom_left_corner[i * height + k]); 349 for (j = 0, k = 0; j < 3 * height; j += 3, k++) {
359 } 350 p[j] = (guchar) (p[j] * bottom_right_corner[i * height + k]);
360 351 p[j + 1] = (guchar) (p[j + 1] * bottom_right_corner[i * height + k]);
361 p = pixels + (i * rowstride) + 3 * height; 352 p[j + 2] = (guchar) (p[j + 2] * bottom_right_corner[i * height + k]);
362 for (j = 0, k = 0; j < (width * 3) - (6 * height); j += 3, k++) 353 }
363 { 354 }
364 p[j] = (guchar) (p[j] * bottom_right_corner [i * height]); 355 break;
365 p[j + 1] = (guchar) (p[j + 1] * bottom_right_corner [i * height]); 356 }
366 p[j + 2] = (guchar) (p[j + 2] * bottom_right_corner [i * height]);
367 }
368
369 p = pixels + (i * rowstride) + ((width * 3) - (3 * height));
370 for (j = 0, k = 0; j < 3 * height; j += 3, k++)
371 {
372 p[j] = (guchar) (p[j] * bottom_right_corner[i * height + k]);
373 p[j + 1] = (guchar) (p[j + 1] * bottom_right_corner[i * height + k]);
374 p[j + 2] = (guchar) (p[j + 2] * bottom_right_corner[i * height + k]);
375 }
376 }
377 break;
378
379 default:
380 break;
381 }
382 } 357 }
383 358
384 static gboolean 359 static gboolean
385 map_shadow_windows (gpointer data) 360 map_shadow_windows (gpointer data)
386 { 361 {
388 GtkWidget *widget = blist->tipwindow; 363 GtkWidget *widget = blist->tipwindow;
389 GdkPixbuf *pixbuf; 364 GdkPixbuf *pixbuf;
390 int x, y; 365 int x, y;
391 366
392 gtk_window_get_position(GTK_WINDOW(widget), &x, &y); 367 gtk_window_get_position(GTK_WINDOW(widget), &x, &y);
393 pixbuf = get_pixbuf (widget, 368 pixbuf = get_pixbuf(widget,
394 x + widget->allocation.width, y, 369 x + widget->allocation.width, y,
395 5, widget->allocation.height + 5); 370 5, widget->allocation.height + 5);
396 if (pixbuf != NULL) 371 if (pixbuf != NULL)
397 { 372 {
398 pixbuf_add_shadow (pixbuf, EAST_SIDE); 373 pixbuf_add_shadow (pixbuf, EAST_SIDE);
399 if (blist->east != NULL) 374 if (blist->east != NULL)
400 { 375 {
477 return FALSE; /* carry on normally */ 452 return FALSE; /* carry on normally */
478 } 453 }
479 454
480 /* don't save off-screen positioning */ 455 /* don't save off-screen positioning */
481 if (x + event->width < 0 || 456 if (x + event->width < 0 ||
482 y + event->height < 0 || 457 y + event->height < 0 ||
483 x > gdk_screen_width() || 458 x > gdk_screen_width() ||
484 y > gdk_screen_height()) { 459 y > gdk_screen_height()) {
485 460
486 return FALSE; /* carry on normally */ 461 return FALSE; /* carry on normally */
487 } 462 }
488 463
489 /* store the position */ 464 /* store the position */
1025 } 1000 }
1026 1001
1027 /* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */ 1002 /* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */
1028 get_iter_from_node(node, &parent); 1003 get_iter_from_node(node, &parent);
1029 gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent, 1004 gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent,
1030 gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1); 1005 gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1);
1031 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); 1006 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter);
1032 /* Let the treeview draw so it knows where to scroll */ 1007 /* Let the treeview draw so it knows where to scroll */
1033 while (gtk_events_pending()) 1008 while (gtk_events_pending())
1034 gtk_main_iteration(); 1009 gtk_main_iteration();
1035 gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0); 1010 gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0);
1312 buf = gaim_gtk_blist_get_status_icon(bnode, 1287 buf = gaim_gtk_blist_get_status_icon(bnode,
1313 GAIM_STATUS_ICON_SMALL); 1288 GAIM_STATUS_ICON_SMALL);
1314 image = gtk_image_new_from_pixbuf(buf); 1289 image = gtk_image_new_from_pixbuf(buf);
1315 g_object_unref(G_OBJECT(buf)); 1290 g_object_unref(G_OBJECT(buf));
1316 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), 1291 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem),
1317 image); 1292 image);
1318 gtk_widget_show(image); 1293 gtk_widget_show(image);
1319 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); 1294 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
1320 gtk_widget_show(menuitem); 1295 gtk_widget_show(menuitem);
1321 1296
1322 submenu = gtk_menu_new(); 1297 submenu = gtk_menu_new();
1626 g_free(alias); 1601 g_free(alias);
1627 1602
1628 return TRUE; 1603 return TRUE;
1629 } 1604 }
1630 1605
1631 static void gaim_gtk_blist_drag_data_get_cb (GtkWidget *widget, 1606 static void gaim_gtk_blist_drag_data_get_cb(GtkWidget *widget,
1632 GdkDragContext *dc, 1607 GdkDragContext *dc,
1633 GtkSelectionData *data, 1608 GtkSelectionData *data,
1634 guint info, 1609 guint info,
1635 guint time, 1610 guint time,
1636 gpointer *null) 1611 gpointer *null)
1637 { 1612 {
1638 if (data->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE)) 1613 if (data->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE))
1639 { 1614 {
1640 GtkTreeRowReference *ref = g_object_get_data(G_OBJECT(dc), "gtk-tree-view-source-row"); 1615 GtkTreeRowReference *ref = g_object_get_data(G_OBJECT(dc), "gtk-tree-view-source-row");
1641 GtkTreePath *sourcerow = gtk_tree_row_reference_get_path(ref); 1616 GtkTreePath *sourcerow = gtk_tree_row_reference_get_path(ref);
1995 } else if (sd->target == gdk_atom_intern("text/uri-list", FALSE) && sd->data) { 1970 } else if (sd->target == gdk_atom_intern("text/uri-list", FALSE) && sd->data) {
1996 GtkTreePath *path = NULL; 1971 GtkTreePath *path = NULL;
1997 GtkTreeViewDropPosition position; 1972 GtkTreeViewDropPosition position;
1998 1973
1999 if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), 1974 if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget),
2000 x, y, &path, &position)) 1975 x, y, &path, &position))
2001 { 1976 {
2002 GtkTreeIter iter; 1977 GtkTreeIter iter;
2003 GaimBlistNode *node; 1978 GaimBlistNode *node;
2004 GValue val = {0}; 1979 GValue val = {0};
2005 1980
2042 pango_layout_set_markup(layout, tooltiptext, strlen(tooltiptext)); 2017 pango_layout_set_markup(layout, tooltiptext, strlen(tooltiptext));
2043 pango_layout_set_wrap(layout, PANGO_WRAP_WORD); 2018 pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
2044 pango_layout_set_width(layout, 300000); 2019 pango_layout_set_width(layout, 300000);
2045 style = gtkblist->tipwindow->style; 2020 style = gtkblist->tipwindow->style;
2046 2021
2047 gtk_paint_flat_box (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, 2022 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
2048 NULL, gtkblist->tipwindow, "tooltip", 0, 0, -1, -1); 2023 NULL, gtkblist->tipwindow, "tooltip", 0, 0, -1, -1);
2049 2024
2050 #if GTK_CHECK_VERSION(2,2,0) 2025 #if GTK_CHECK_VERSION(2,2,0)
2051 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, pixbuf, 2026 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, pixbuf,
2052 0, 0, 4, 4, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); 2027 0, 0, 4, 4, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
2053 #else 2028 #else
2185 if(gtkblist->east_shadow) { 2160 if(gtkblist->east_shadow) {
2186 gdk_window_set_user_data (gtkblist->east_shadow, NULL); 2161 gdk_window_set_user_data (gtkblist->east_shadow, NULL);
2187 gdk_window_destroy (gtkblist->east_shadow); 2162 gdk_window_destroy (gtkblist->east_shadow);
2188 } 2163 }
2189 gtkblist->east_shadow = gdk_window_new(gtk_widget_get_root_window(gtkblist->tipwindow), &attr, 2164 gtkblist->east_shadow = gdk_window_new(gtk_widget_get_root_window(gtkblist->tipwindow), &attr,
2190 GDK_WA_NOREDIR | GDK_WA_VISUAL | GDK_WA_COLORMAP); 2165 GDK_WA_NOREDIR | GDK_WA_VISUAL | GDK_WA_COLORMAP);
2191 gdk_window_set_user_data (gtkblist->east_shadow, gtkblist->tipwindow); 2166 gdk_window_set_user_data (gtkblist->east_shadow, gtkblist->tipwindow);
2192 gdk_window_set_back_pixmap (gtkblist->east_shadow, NULL, FALSE); 2167 gdk_window_set_back_pixmap (gtkblist->east_shadow, NULL, FALSE);
2193 2168
2194 if(gtkblist->south_shadow) { 2169 if(gtkblist->south_shadow) {
2195 gdk_window_set_user_data (gtkblist->south_shadow, NULL); 2170 gdk_window_set_user_data (gtkblist->south_shadow, NULL);
2196 gdk_window_destroy (gtkblist->south_shadow); 2171 gdk_window_destroy (gtkblist->south_shadow);
2197 } 2172 }
2198 gtkblist->south_shadow = gdk_window_new(gtk_widget_get_root_window(gtkblist->tipwindow), &attr, 2173 gtkblist->south_shadow = gdk_window_new(gtk_widget_get_root_window(gtkblist->tipwindow), &attr,
2199 GDK_WA_NOREDIR | GDK_WA_VISUAL | GDK_WA_COLORMAP); 2174 GDK_WA_NOREDIR | GDK_WA_VISUAL | GDK_WA_COLORMAP);
2200 gdk_window_set_user_data (gtkblist->south_shadow, gtkblist->tipwindow); 2175 gdk_window_set_user_data (gtkblist->south_shadow, gtkblist->tipwindow);
2201 gdk_window_set_back_pixmap (gtkblist->south_shadow, NULL, FALSE); 2176 gdk_window_set_back_pixmap (gtkblist->south_shadow, NULL, FALSE);
2202 #endif 2177 #endif
2203 2178
2204 layout = gtk_widget_create_pango_layout (gtkblist->tipwindow, NULL); 2179 layout = gtk_widget_create_pango_layout (gtkblist->tipwindow, NULL);
2308 gtkblist->timeout = 0; 2283 gtkblist->timeout = 0;
2309 } 2284 }
2310 gaim_gtk_blist_tooltip_destroy(); 2285 gaim_gtk_blist_tooltip_destroy();
2311 2286
2312 if (gtkblist->mouseover_contact && 2287 if (gtkblist->mouseover_contact &&
2313 !((e->x > gtkblist->contact_rect.x) && (e->x < (gtkblist->contact_rect.x + gtkblist->contact_rect.width)) && 2288 !((e->x > gtkblist->contact_rect.x) && (e->x < (gtkblist->contact_rect.x + gtkblist->contact_rect.width)) &&
2314 (e->y > gtkblist->contact_rect.y) && (e->y < (gtkblist->contact_rect.y + gtkblist->contact_rect.height)))) { 2289 (e->y > gtkblist->contact_rect.y) && (e->y < (gtkblist->contact_rect.y + gtkblist->contact_rect.height)))) {
2315 gaim_gtk_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact); 2290 gaim_gtk_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact);
2316 gtkblist->mouseover_contact = NULL; 2291 gtkblist->mouseover_contact = NULL;
2317 } 2292 }
2318 } 2293 }
2319 2294
2320 static void 2295 static void
2495 2470
2496 if(g_list_length(gaim_connections_get_all()) > 1) 2471 if(g_list_length(gaim_connections_get_all()) > 1)
2497 accounttext = g_markup_escape_text(b->account->username, -1); 2472 accounttext = g_markup_escape_text(b->account->username, -1);
2498 2473
2499 text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>" 2474 text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>"
2500 "%s %s" /* Account */ 2475 "%s %s" /* Account */
2501 "%s %s" /* Contact Alias */ 2476 "%s %s" /* Contact Alias */
2502 "%s %s" /* Alias */ 2477 "%s %s" /* Alias */
2503 "%s %s" /* Nickname */ 2478 "%s %s" /* Nickname */
2504 "%s %s" /* Logged In */ 2479 "%s %s" /* Logged In */
2505 "%s %s" /* Idle */ 2480 "%s %s" /* Idle */
2506 "%s %s" /* Warning */ 2481 "%s %s" /* Warning */
2507 "%s" /* Status */ 2482 "%s" /* Status */
2508 "%s", 2483 "%s",
2509 b->name, 2484 b->name,
2510 accounttext ? _("\n<b>Account:</b>") : "", accounttext ? accounttext : "", 2485 accounttext ? _("\n<b>Account:</b>") : "", accounttext ? accounttext : "",
2511 contactaliastext ? _("\n<b>Contact Alias:</b>") : "", contactaliastext ? contactaliastext : "", 2486 contactaliastext ? _("\n<b>Contact Alias:</b>") : "", contactaliastext ? contactaliastext : "",
2512 aliastext ? _("\n<b>Alias:</b>") : "", aliastext ? aliastext : "", 2487 aliastext ? _("\n<b>Alias:</b>") : "", aliastext ? aliastext : "",
2513 nicktext ? _("\n<b>Nickname:</b>") : "", nicktext ? nicktext : "", 2488 nicktext ? _("\n<b>Nickname:</b>") : "", nicktext ? nicktext : "",
2514 loggedin ? _("\n<b>Logged In:</b>") : "", loggedin ? loggedin : "", 2489 loggedin ? _("\n<b>Logged In:</b>") : "", loggedin ? loggedin : "",
2515 idletime ? _("\n<b>Idle:</b>") : "", idletime ? idletime : "", 2490 idletime ? _("\n<b>Idle:</b>") : "", idletime ? idletime : "",
2516 b->evil ? _("\n<b>Warned:</b>") : "", b->evil ? warning : "", 2491 b->evil ? _("\n<b>Warned:</b>") : "", b->evil ? warning : "",
2517 statustext ? statustext : "", 2492 statustext ? statustext : "",
2518 !g_ascii_strcasecmp(b->name, "robflynn") ? _("\n<b>Description:</b> Spooky") : 2493 !g_ascii_strcasecmp(b->name, "robflynn") ? _("\n<b>Description:</b> Spooky") :
2519 !g_ascii_strcasecmp(b->name, "seanegn") ? _("\n<b>Status</b>: Awesome") : 2494 !g_ascii_strcasecmp(b->name, "seanegn") ? _("\n<b>Status</b>: Awesome") :
2520 !g_ascii_strcasecmp(b->name, "chipx86") ? _("\n<b>Status</b>: Rockin'") : ""); 2495 !g_ascii_strcasecmp(b->name, "chipx86") ? _("\n<b>Status</b>: Rockin'") : "");
2521 2496
2522 if(warning) 2497 if(warning)
2523 g_free(warning); 2498 g_free(warning);
2524 if(loggedin) 2499 if(loggedin)
2525 g_free(loggedin); 2500 g_free(loggedin);
2823 } else if (statustext == NULL && idletime == NULL && warning == NULL && 2798 } else if (statustext == NULL && idletime == NULL && warning == NULL &&
2824 GAIM_BUDDY_IS_ONLINE(b)) { 2799 GAIM_BUDDY_IS_ONLINE(b)) {
2825 text = g_strdup(esc); 2800 text = g_strdup(esc);
2826 } else { 2801 } else {
2827 text = g_strdup_printf("%s\n" 2802 text = g_strdup_printf("%s\n"
2828 "<span %s size='smaller'>%s%s%s</span>", esc, 2803 "<span %s size='smaller'>%s%s%s</span>", esc,
2829 selected ? "" : "color='dim grey'", 2804 selected ? "" : "color='dim grey'",
2830 statustext != NULL ? statustext : "", 2805 statustext != NULL ? statustext : "",
2831 idletime != NULL ? idletime : "", 2806 idletime != NULL ? idletime : "",
2832 warning != NULL ? warning : ""); 2807 warning != NULL ? warning : "");
2833 } 2808 }
2834 if (idletime) 2809 if (idletime)
2835 g_free(idletime); 2810 g_free(idletime);
2836 if (warning) 2811 if (warning)
2837 g_free(warning); 2812 g_free(warning);
3071 /******************************* Menu bar *************************************/ 3046 /******************************* Menu bar *************************************/
3072 accel_group = gtk_accel_group_new(); 3047 accel_group = gtk_accel_group_new();
3073 gtk_window_add_accel_group(GTK_WINDOW (gtkblist->window), accel_group); 3048 gtk_window_add_accel_group(GTK_WINDOW (gtkblist->window), accel_group);
3074 g_object_unref(accel_group); 3049 g_object_unref(accel_group);
3075 gtkblist->ift = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<GaimMain>", accel_group); 3050 gtkblist->ift = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<GaimMain>", accel_group);
3076 gtk_item_factory_set_translate_func (gtkblist->ift, 3051 gtk_item_factory_set_translate_func(gtkblist->ift,
3077 item_factory_translate_func, 3052 item_factory_translate_func,
3078 NULL, NULL); 3053 NULL, NULL);
3079 gtk_item_factory_create_items(gtkblist->ift, sizeof(blist_menu) / sizeof(*blist_menu), 3054 gtk_item_factory_create_items(gtkblist->ift, sizeof(blist_menu) / sizeof(*blist_menu),
3080 blist_menu, NULL); 3055 blist_menu, NULL);
3081 gaim_gtk_load_accels(); 3056 gaim_gtk_load_accels();
3082 g_signal_connect(G_OBJECT(accel_group), "accel-changed", 3057 g_signal_connect(G_OBJECT(accel_group), "accel-changed",
3083 G_CALLBACK(gaim_gtk_save_accels_cb), NULL); 3058 G_CALLBACK(gaim_gtk_save_accels_cb), NULL);
3084 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtk_item_factory_get_widget(gtkblist->ift, "<GaimMain>"), FALSE, FALSE, 0); 3059 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtk_item_factory_get_widget(gtkblist->ift, "<GaimMain>"), FALSE, FALSE, 0);
3085 3060
3112 g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(gaim_gtk_blist_selection_changed), NULL); 3087 g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(gaim_gtk_blist_selection_changed), NULL);
3113 3088
3114 3089
3115 /* Set up dnd */ 3090 /* Set up dnd */
3116 gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(gtkblist->treeview), 3091 gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(gtkblist->treeview),
3117 GDK_BUTTON1_MASK, ste, 3, 3092 GDK_BUTTON1_MASK, ste, 3,
3118 GDK_ACTION_COPY); 3093 GDK_ACTION_COPY);
3119 gtk_tree_view_enable_model_drag_dest(GTK_TREE_VIEW(gtkblist->treeview), 3094 gtk_tree_view_enable_model_drag_dest(GTK_TREE_VIEW(gtkblist->treeview),
3120 dte, 5, 3095 dte, 5,
3121 GDK_ACTION_COPY | GDK_ACTION_MOVE); 3096 GDK_ACTION_COPY | GDK_ACTION_MOVE);
3122 3097
3123 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-received", G_CALLBACK(gaim_gtk_blist_drag_data_rcv_cb), NULL); 3098 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-received", G_CALLBACK(gaim_gtk_blist_drag_data_rcv_cb), NULL);
3124 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-get", G_CALLBACK(gaim_gtk_blist_drag_data_get_cb), NULL); 3099 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-get", G_CALLBACK(gaim_gtk_blist_drag_data_get_cb), NULL);
3125 3100
3126 /* Tooltips */ 3101 /* Tooltips */
3130 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(gtkblist->treeview), FALSE); 3105 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(gtkblist->treeview), FALSE);
3131 3106
3132 column = gtk_tree_view_column_new (); 3107 column = gtk_tree_view_column_new ();
3133 3108
3134 rend = gtk_cell_renderer_pixbuf_new(); 3109 rend = gtk_cell_renderer_pixbuf_new();
3135 gtk_tree_view_column_pack_start (column, rend, FALSE); 3110 gtk_tree_view_column_pack_start(column, rend, FALSE);
3136 gtk_tree_view_column_set_attributes (column, rend, 3111 gtk_tree_view_column_set_attributes(column, rend,
3137 "pixbuf", STATUS_ICON_COLUMN, 3112 "pixbuf", STATUS_ICON_COLUMN,
3138 "visible", STATUS_ICON_VISIBLE_COLUMN, 3113 "visible", STATUS_ICON_VISIBLE_COLUMN,
3139 NULL); 3114 NULL);
3140 g_object_set(rend, "xalign", 0.0, "ypad", 0, NULL); 3115 g_object_set(rend, "xalign", 0.0, "ypad", 0, NULL);
3141 3116
3142 rend = gtk_cell_renderer_text_new(); 3117 rend = gtk_cell_renderer_text_new();
3143 gtk_tree_view_column_pack_start (column, rend, TRUE); 3118 gtk_tree_view_column_pack_start (column, rend, TRUE);
3144 gtk_tree_view_column_set_attributes (column, rend, 3119 gtk_tree_view_column_set_attributes(column, rend,
3145 "markup", NAME_COLUMN, 3120 "markup", NAME_COLUMN,
3146 NULL); 3121 NULL);
3147 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); 3122 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL);
3148 3123
3149 gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column); 3124 gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column);
3150 3125
3151 rend = gtk_cell_renderer_text_new(); 3126 rend = gtk_cell_renderer_text_new();
3990 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE); 3965 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE);
3991 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), 12); 3966 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), 12);
3992 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), 6); 3967 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), 6);
3993 gtk_window_set_role(GTK_WINDOW(data->window), "add_buddy"); 3968 gtk_window_set_role(GTK_WINDOW(data->window), "add_buddy");
3994 gtk_window_set_type_hint(GTK_WINDOW(data->window), 3969 gtk_window_set_type_hint(GTK_WINDOW(data->window),
3995 GDK_WINDOW_TYPE_HINT_DIALOG); 3970 GDK_WINDOW_TYPE_HINT_DIALOG);
3996 3971
3997 hbox = gtk_hbox_new(FALSE, 12); 3972 hbox = gtk_hbox_new(FALSE, 12);
3998 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox); 3973 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox);
3999 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); 3974 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
4000 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); 3975 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
4311 break; 4286 break;
4312 } 4287 }
4313 } 4288 }
4314 } 4289 }
4315 4290
4316 if (data->account == NULL) 4291 if (data->account == NULL)
4317 { 4292 {
4318 gaim_notify_error(NULL, NULL, 4293 gaim_notify_error(NULL, NULL,
4319 _("You are not currently signed on with any " 4294 _("You are not currently signed on with any "
4320 "protocols that have the ability to chat."), NULL); 4295 "protocols that have the ability to chat."), NULL);
4321 return; 4296 return;
4322 } 4297 }
4323 4298
4324 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 4299 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
4325 4300
4326 data->window = gtk_dialog_new_with_buttons(_("Add Chat"), 4301 data->window = gtk_dialog_new_with_buttons(_("Add Chat"),
4327 NULL, GTK_DIALOG_NO_SEPARATOR, 4302 NULL, GTK_DIALOG_NO_SEPARATOR,
4334 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE); 4309 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE);
4335 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), 12); 4310 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), 12);
4336 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), 6); 4311 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), 6);
4337 gtk_window_set_role(GTK_WINDOW(data->window), "add_chat"); 4312 gtk_window_set_role(GTK_WINDOW(data->window), "add_chat");
4338 gtk_window_set_type_hint(GTK_WINDOW(data->window), 4313 gtk_window_set_type_hint(GTK_WINDOW(data->window),
4339 GDK_WINDOW_TYPE_HINT_DIALOG); 4314 GDK_WINDOW_TYPE_HINT_DIALOG);
4340 4315
4341 hbox = gtk_hbox_new(FALSE, 12); 4316 hbox = gtk_hbox_new(FALSE, 12);
4342 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox); 4317 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox);
4343 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); 4318 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
4344 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); 4319 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
4367 add_chat_check_account_func, data); 4342 add_chat_check_account_func, data);
4368 gtk_box_pack_start(GTK_BOX(rowbox), data->account_menu, TRUE, TRUE, 0); 4343 gtk_box_pack_start(GTK_BOX(rowbox), data->account_menu, TRUE, TRUE, 0);
4369 gaim_set_accessible_label (data->account_menu, label); 4344 gaim_set_accessible_label (data->account_menu, label);
4370 4345
4371 data->entries_box = gtk_vbox_new(FALSE, 5); 4346 data->entries_box = gtk_vbox_new(FALSE, 5);
4372 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0); 4347 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0);
4373 gtk_box_pack_start(GTK_BOX(vbox), data->entries_box, TRUE, TRUE, 0); 4348 gtk_box_pack_start(GTK_BOX(vbox), data->entries_box, TRUE, TRUE, 0);
4374 4349
4375 rebuild_addchat_entries(data); 4350 rebuild_addchat_entries(data);
4376 4351
4377 rowbox = gtk_hbox_new(FALSE, 5); 4352 rowbox = gtk_hbox_new(FALSE, 5);
4389 gaim_set_accessible_label (data->alias_entry, label); 4364 gaim_set_accessible_label (data->alias_entry, label);
4390 4365
4391 rowbox = gtk_hbox_new(FALSE, 5); 4366 rowbox = gtk_hbox_new(FALSE, 5);
4392 gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0); 4367 gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0);
4393 4368
4394 label = gtk_label_new(_("Group:")); 4369 label = gtk_label_new(_("Group:"));
4395 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 4370 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
4396 gtk_size_group_add_widget(data->sg, label); 4371 gtk_size_group_add_widget(data->sg, label);
4397 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0); 4372 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
4398 4373
4399 data->group_combo = gtk_combo_new(); 4374 data->group_combo = gtk_combo_new();
4400 gtk_combo_set_popdown_strings(GTK_COMBO(data->group_combo), groups_tree()); 4375 gtk_combo_set_popdown_strings(GTK_COMBO(data->group_combo), groups_tree());
4401 gtk_box_pack_end(GTK_BOX(rowbox), data->group_combo, TRUE, TRUE, 0); 4376 gtk_box_pack_end(GTK_BOX(rowbox), data->group_combo, TRUE, TRUE, 0);
4402 4377
4403 if (group) 4378 if (group)
4404 { 4379 {
4405 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(data->group_combo)->entry), 4380 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(data->group_combo)->entry),
4574 gaim_prefs_add_int("/gaim/gtk/blist/height", 500); /* Golden ratio, baby */ 4549 gaim_prefs_add_int("/gaim/gtk/blist/height", 500); /* Golden ratio, baby */
4575 gaim_prefs_add_int("/gaim/gtk/blist/tooltip_delay", 500); 4550 gaim_prefs_add_int("/gaim/gtk/blist/tooltip_delay", 500);
4576 4551
4577 /* Register our signals */ 4552 /* Register our signals */
4578 gaim_signal_register(gtk_blist_handle, "gtkblist-created", 4553 gaim_signal_register(gtk_blist_handle, "gtkblist-created",
4579 gaim_marshal_VOID__POINTER, NULL, 1, 4554 gaim_marshal_VOID__POINTER, NULL, 1,
4580 gaim_value_new(GAIM_TYPE_SUBTYPE, 4555 gaim_value_new(GAIM_TYPE_SUBTYPE,
4581 GAIM_SUBTYPE_BLIST)); 4556 GAIM_SUBTYPE_BLIST));
4582 4557
4583 gaim_signal_register(gtk_blist_handle, "drawing-tooltip", 4558 gaim_signal_register(gtk_blist_handle, "drawing-tooltip",
4584 gaim_marshal_VOID__POINTER_POINTER, NULL, 2, 4559 gaim_marshal_VOID__POINTER_POINTER, NULL, 2,
4585 gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_BLIST_NODE), 4560 gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_BLIST_NODE),
4586 gaim_value_new_outgoing(GAIM_TYPE_STRING)); 4561 gaim_value_new_outgoing(GAIM_TYPE_STRING));
4587 } 4562 }
4588 4563
4589 void 4564 void
4590 gaim_gtk_blist_uninit(void) { 4565 gaim_gtk_blist_uninit(void) {
4591 gaim_signals_unregister_by_instance(gaim_gtk_blist_get_handle()); 4566 gaim_signals_unregister_by_instance(gaim_gtk_blist_get_handle());
4631 return status; 4606 return status;
4632 } 4607 }
4633 4608
4634 4609
4635 /********************************************************************* 4610 /*********************************************************************
4636 * Buddy List sorting functions * 4611 * Buddy List sorting functions *
4637 *********************************************************************/ 4612 *********************************************************************/
4638 4613
4639 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func) 4614 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func)
4640 { 4615 {
4641 struct gaim_gtk_blist_sort_method *method = g_new0(struct gaim_gtk_blist_sort_method, 1); 4616 struct gaim_gtk_blist_sort_method *method = g_new0(struct gaim_gtk_blist_sort_method, 1);
5128 5103
5129 build_plugin_actions(submenu, plugin, NULL); 5104 build_plugin_actions(submenu, plugin, NULL);
5130 } 5105 }
5131 } 5106 }
5132 } 5107 }
5108