| 1 |
#include <string.h> |
| 2 |
#include "iconbrowserapp.h" |
| 3 |
#include "iconbrowserwin.h" |
| 4 |
#include "iconstore.h" |
| 5 |
#include <gtk/gtk.h> |
| 6 |
|
| 7 |
/* Drag 'n Drop */ |
| 8 |
static GtkTargetEntry target_table[] = { |
| 9 |
{ "text/uri-list", 0, 0 }, |
| 10 |
}; |
| 11 |
|
| 12 |
typedef struct |
| 13 |
{ |
| 14 |
gchar *id; |
| 15 |
gchar *name; |
| 16 |
gchar *description; |
| 17 |
} Context; |
| 18 |
|
| 19 |
static void |
| 20 |
context_free (gpointer data) |
| 21 |
{ |
| 22 |
Context *context = data; |
| 23 |
|
| 24 |
g_free (context->id); |
| 25 |
g_free (context->name); |
| 26 |
g_free (context->description); |
| 27 |
g_free (context); |
| 28 |
} |
| 29 |
|
| 30 |
struct _IconBrowserWindow |
| 31 |
{ |
| 32 |
GtkApplicationWindow parent; |
| 33 |
GHashTable *contexts; |
| 34 |
|
| 35 |
GtkWidget *context_list; |
| 36 |
Context *current_context; |
| 37 |
gboolean symbolic; |
| 38 |
GtkWidget *symbolic_radio; |
| 39 |
GtkTreeModelFilter *filter_model; |
| 40 |
GtkWidget *details; |
| 41 |
|
| 42 |
GtkListStore *store; |
| 43 |
GtkCellRenderer *cell; |
| 44 |
GtkCellRenderer *text_cell; |
| 45 |
GtkWidget *search; |
| 46 |
GtkWidget *searchbar; |
| 47 |
GtkWidget *searchentry; |
| 48 |
GtkWidget *list; |
| 49 |
GtkWidget *image1; |
| 50 |
GtkWidget *image2; |
| 51 |
GtkWidget *image3; |
| 52 |
GtkWidget *image4; |
| 53 |
GtkWidget *image5; |
| 54 |
GtkWidget *image6; |
| 55 |
GtkWidget *label6; |
| 56 |
GtkWidget *description; |
| 57 |
}; |
| 58 |
|
| 59 |
struct _IconBrowserWindowClass |
| 60 |
{ |
| 61 |
GtkApplicationWindowClass parent_class; |
| 62 |
}; |
| 63 |
|
| 64 |
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW); |
| 65 |
|
| 66 |
static void |
| 67 |
search_text_changed (GtkEntry *entry, IconBrowserWindow *win) |
| 68 |
{ |
| 69 |
const gchar *text; |
| 70 |
|
| 71 |
text = gtk_entry_get_text (entry); |
| 72 |
|
| 73 |
if (text[0] == '\0') |
| 74 |
return; |
| 75 |
|
| 76 |
gtk_tree_model_filter_refilter (win->filter_model); |
| 77 |
} |
| 78 |
|
| 79 |
static GdkPixbuf * |
| 80 |
get_icon (GtkWidget *image, const gchar *name, gint size) |
| 81 |
{ |
| 82 |
GtkIconInfo *info; |
| 83 |
GtkStyleContext *context; |
| 84 |
GdkPixbuf *pixbuf; |
| 85 |
|
| 86 |
context = gtk_widget_get_style_context (image); |
| 87 |
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, size, 0); |
| 88 |
pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, NULL); |
| 89 |
g_object_unref (info); |
| 90 |
|
| 91 |
return pixbuf; |
| 92 |
} |
| 93 |
|
| 94 |
static void |
| 95 |
set_image (GtkWidget *image, const gchar *name, gint size) |
| 96 |
{ |
| 97 |
GdkPixbuf *pixbuf; |
| 98 |
|
| 99 |
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1); |
| 100 |
gtk_image_set_pixel_size (GTK_IMAGE (image), size); |
| 101 |
pixbuf = get_icon (image, name, size); |
| 102 |
gtk_drag_source_set_icon_pixbuf (gtk_widget_get_parent (image), pixbuf); |
| 103 |
g_object_unref (pixbuf); |
| 104 |
} |
| 105 |
|
| 106 |
static void |
| 107 |
item_activated (GtkIconView *icon_view, GtkTreePath *path, IconBrowserWindow *win) |
| 108 |
{ |
| 109 |
GtkTreeIter iter; |
| 110 |
gchar *name; |
| 111 |
gchar *description; |
| 112 |
gint column; |
| 113 |
|
| 114 |
gtk_tree_model_get_iter (GTK_TREE_MODEL (win->filter_model), &iter, path); |
| 115 |
|
| 116 |
if (win->symbolic) |
| 117 |
column = ICON_STORE_SYMBOLIC_NAME_COLUMN; |
| 118 |
else |
| 119 |
column = ICON_STORE_NAME_COLUMN; |
| 120 |
gtk_tree_model_get (GTK_TREE_MODEL (win->filter_model), &iter, |
| 121 |
column, &name, |
| 122 |
ICON_STORE_DESCRIPTION_COLUMN, &description, |
| 123 |
-1); |
| 124 |
|
| 125 |
if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name)) |
| 126 |
{ |
| 127 |
g_free (description); |
| 128 |
return; |
| 129 |
} |
| 130 |
|
| 131 |
gtk_window_set_title (GTK_WINDOW (win->details), name); |
| 132 |
set_image (win->image1, name, 16); |
| 133 |
set_image (win->image2, name, 24); |
| 134 |
set_image (win->image3, name, 32); |
| 135 |
set_image (win->image4, name, 48); |
| 136 |
set_image (win->image5, name, 64); |
| 137 |
if (win->symbolic) |
| 138 |
{ |
| 139 |
gtk_widget_show (win->image6); |
| 140 |
gtk_widget_show (win->label6); |
| 141 |
gtk_widget_show (gtk_widget_get_parent (win->image6)); |
| 142 |
set_image (win->image6, name, 64); |
| 143 |
} |
| 144 |
else |
| 145 |
{ |
| 146 |
gtk_widget_hide (win->image6); |
| 147 |
gtk_widget_hide (win->label6); |
| 148 |
gtk_widget_hide (gtk_widget_get_parent (win->image6)); |
| 149 |
} |
| 150 |
if (description && description[0]) |
| 151 |
{ |
| 152 |
gtk_label_set_text (GTK_LABEL (win->description), description); |
| 153 |
gtk_widget_show (win->description); |
| 154 |
} |
| 155 |
else |
| 156 |
{ |
| 157 |
gtk_widget_hide (win->description); |
| 158 |
} |
| 159 |
|
| 160 |
gtk_window_present (GTK_WINDOW (win->details)); |
| 161 |
|
| 162 |
g_free (name); |
| 163 |
g_free (description); |
| 164 |
} |
| 165 |
|
| 166 |
static void |
| 167 |
add_icon (IconBrowserWindow *win, |
| 168 |
const gchar *name, |
| 169 |
const gchar *description, |
| 170 |
const gchar *context) |
| 171 |
{ |
| 172 |
gchar *regular_name; |
| 173 |
gchar *symbolic_name; |
| 174 |
|
| 175 |
regular_name = g_strdup (name); |
| 176 |
if (!gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), regular_name)) |
| 177 |
{ |
| 178 |
g_free (regular_name); |
| 179 |
regular_name = NULL; |
| 180 |
} |
| 181 |
|
| 182 |
symbolic_name = g_strconcat (name, "-symbolic", NULL); |
| 183 |
if (!gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), symbolic_name)) |
| 184 |
{ |
| 185 |
g_free (symbolic_name); |
| 186 |
symbolic_name = NULL; |
| 187 |
} |
| 188 |
|
| 189 |
gtk_list_store_insert_with_values (win->store, NULL, -1, |
| 190 |
ICON_STORE_NAME_COLUMN, regular_name, |
| 191 |
ICON_STORE_SYMBOLIC_NAME_COLUMN, symbolic_name, |
| 192 |
ICON_STORE_DESCRIPTION_COLUMN, description, |
| 193 |
ICON_STORE_CONTEXT_COLUMN, context, |
| 194 |
-1); |
| 195 |
} |
| 196 |
|
| 197 |
static void |
| 198 |
add_context (IconBrowserWindow *win, |
| 199 |
const gchar *id, |
| 200 |
const gchar *name, |
| 201 |
const gchar *description) |
| 202 |
{ |
| 203 |
Context *c; |
| 204 |
GtkWidget *row; |
| 205 |
|
| 206 |
c = g_new (Context, 1); |
| 207 |
c->id = g_strdup (id); |
| 208 |
c->name = g_strdup (name); |
| 209 |
c->description = g_strdup (description); |
| 210 |
|
| 211 |
g_hash_table_insert (win->contexts, c->id, c); |
| 212 |
|
| 213 |
row = gtk_label_new (name); |
| 214 |
g_object_set_data (G_OBJECT (row), "context", c); |
| 215 |
gtk_widget_show (row); |
| 216 |
g_object_set (row, "margin", 10, NULL); |
| 217 |
|
| 218 |
gtk_list_box_insert (GTK_LIST_BOX (win->context_list), row, -1); |
| 219 |
|
| 220 |
/* set the tooltip on the list box row */ |
| 221 |
row = gtk_widget_get_parent (row); |
| 222 |
gtk_widget_set_tooltip_text (row, description); |
| 223 |
|
| 224 |
if (win->current_context == NULL) |
| 225 |
win->current_context = c; |
| 226 |
} |
| 227 |
|
| 228 |
static void |
| 229 |
selected_context_changed (GtkListBox *list, IconBrowserWindow *win) |
| 230 |
{ |
| 231 |
GtkWidget *row; |
| 232 |
GtkWidget *label; |
| 233 |
|
| 234 |
row = GTK_WIDGET (gtk_list_box_get_selected_row (list)); |
| 235 |
if (row == NULL) |
| 236 |
return; |
| 237 |
|
| 238 |
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (win->search), FALSE); |
| 239 |
|
| 240 |
label = gtk_bin_get_child (GTK_BIN (row)); |
| 241 |
win->current_context = g_object_get_data (G_OBJECT (label), "context"); |
| 242 |
gtk_tree_model_filter_refilter (win->filter_model); |
| 243 |
} |
| 244 |
|
| 245 |
static void |
| 246 |
populate (IconBrowserWindow *win) |
| 247 |
{ |
| 248 |
GFile *file; |
| 249 |
GKeyFile *kf; |
| 250 |
char *data; |
| 251 |
gsize length; |
| 252 |
char **groups; |
| 253 |
int i; |
| 254 |
|
| 255 |
file = g_file_new_for_uri ("resource:/org/gtk/iconbrowser/gtk/icon.list"); |
| 256 |
g_file_load_contents (file, NULL, &data, &length, NULL, NULL); |
| 257 |
|
| 258 |
kf = g_key_file_new (); |
| 259 |
g_key_file_load_from_data (kf, data, length, G_KEY_FILE_NONE, NULL); |
| 260 |
|
| 261 |
groups = g_key_file_get_groups (kf, &length); |
| 262 |
for (i = 0; i < length; i++) |
| 263 |
{ |
| 264 |
const char *context; |
| 265 |
const char *name; |
| 266 |
const char *description; |
| 267 |
char **keys; |
| 268 |
gsize len; |
| 269 |
int j; |
| 270 |
|
| 271 |
context = groups[i]; |
| 272 |
name = g_key_file_get_string (kf, context, "Name", NULL); |
| 273 |
description = g_key_file_get_string (kf, context, "Description", NULL); |
| 274 |
add_context (win, context, name, description); |
| 275 |
|
| 276 |
keys = g_key_file_get_keys (kf, context, &len, NULL); |
| 277 |
for (j = 0; j < len; j++) |
| 278 |
{ |
| 279 |
const char *key = keys[j]; |
| 280 |
const char *value; |
| 281 |
|
| 282 |
if (strcmp (key, "Name") == 0 || strcmp (key, "Description") == 0) |
| 283 |
continue; |
| 284 |
|
| 285 |
value = g_key_file_get_string (kf, context, key, NULL); |
| 286 |
|
| 287 |
add_icon (win, key, value, context); |
| 288 |
} |
| 289 |
g_strfreev (keys); |
| 290 |
} |
| 291 |
g_strfreev (groups); |
| 292 |
} |
| 293 |
|
| 294 |
static gboolean |
| 295 |
key_press_event_cb (GtkWidget *widget, |
| 296 |
GdkEvent *event, |
| 297 |
gpointer data) |
| 298 |
{ |
| 299 |
IconBrowserWindow *win = data; |
| 300 |
|
| 301 |
return gtk_search_bar_handle_event (GTK_SEARCH_BAR (win->searchbar), event); |
| 302 |
} |
| 303 |
|
| 304 |
static void |
| 305 |
copy_to_clipboard (GtkButton *button, |
| 306 |
IconBrowserWindow *win) |
| 307 |
{ |
| 308 |
GtkClipboard *clipboard; |
| 309 |
|
| 310 |
clipboard = gtk_clipboard_get_default (gdk_display_get_default ()); |
| 311 |
gtk_clipboard_set_text (clipboard, gtk_window_get_title (GTK_WINDOW (win->details)), -1); |
| 312 |
} |
| 313 |
|
| 314 |
static gboolean |
| 315 |
icon_visible_func (GtkTreeModel *model, |
| 316 |
GtkTreeIter *iter, |
| 317 |
gpointer data) |
| 318 |
{ |
| 319 |
IconBrowserWindow *win = data; |
| 320 |
gchar *context; |
| 321 |
gchar *name; |
| 322 |
gint column; |
| 323 |
gboolean search; |
| 324 |
const gchar *search_text; |
| 325 |
gboolean visible; |
| 326 |
|
| 327 |
search = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (win->search)); |
| 328 |
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry)); |
| 329 |
|
| 330 |
if (win->symbolic) |
| 331 |
column = ICON_STORE_SYMBOLIC_NAME_COLUMN; |
| 332 |
else |
| 333 |
column = ICON_STORE_NAME_COLUMN; |
| 334 |
|
| 335 |
gtk_tree_model_get (model, iter, |
| 336 |
column, &name, |
| 337 |
ICON_STORE_CONTEXT_COLUMN, &context, |
| 338 |
-1); |
| 339 |
if (!name) |
| 340 |
visible = FALSE; |
| 341 |
else if (search) |
| 342 |
visible = strstr (name, search_text) != NULL; |
| 343 |
else |
| 344 |
visible = win->current_context != NULL && g_strcmp0 (context, win->current_context->id) == 0; |
| 345 |
|
| 346 |
g_free (name); |
| 347 |
g_free (context); |
| 348 |
|
| 349 |
return visible; |
| 350 |
} |
| 351 |
|
| 352 |
static void |
| 353 |
symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win) |
| 354 |
{ |
| 355 |
gint column; |
| 356 |
|
| 357 |
win->symbolic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)); |
| 358 |
|
| 359 |
if (win->symbolic) |
| 360 |
column = ICON_STORE_SYMBOLIC_NAME_COLUMN; |
| 361 |
else |
| 362 |
column = ICON_STORE_NAME_COLUMN; |
| 363 |
|
| 364 |
icon_store_set_text_column (ICON_STORE (win->store), column); |
| 365 |
|
| 366 |
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->cell, "icon-name", column, NULL); |
| 367 |
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->text_cell, "text", column, NULL); |
| 368 |
|
| 369 |
gtk_tree_model_filter_refilter (win->filter_model); |
| 370 |
gtk_widget_queue_draw (win->list); |
| 371 |
} |
| 372 |
|
| 373 |
static void |
| 374 |
search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *win) |
| 375 |
{ |
| 376 |
if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (searchbar))) |
| 377 |
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list)); |
| 378 |
} |
| 379 |
|
| 380 |
static void |
| 381 |
get_image_data (GtkWidget *widget, |
| 382 |
GdkDragContext *context, |
| 383 |
GtkSelectionData *selection, |
| 384 |
guint target_info, |
| 385 |
guint time, |
| 386 |
gpointer data) |
| 387 |
{ |
| 388 |
GtkWidget *image; |
| 389 |
const gchar *name; |
| 390 |
gint size; |
| 391 |
GdkPixbuf *pixbuf; |
| 392 |
|
| 393 |
image = gtk_bin_get_child (GTK_BIN (widget)); |
| 394 |
|
| 395 |
gtk_image_get_icon_name (GTK_IMAGE (image), &name, NULL); |
| 396 |
size = gtk_image_get_pixel_size (GTK_IMAGE (image)); |
| 397 |
|
| 398 |
pixbuf = get_icon (image, name, size); |
| 399 |
gtk_selection_data_set_pixbuf (selection, pixbuf); |
| 400 |
g_object_unref (pixbuf); |
| 401 |
} |
| 402 |
|
| 403 |
static void |
| 404 |
get_scalable_image_data (GtkWidget *widget, |
| 405 |
GdkDragContext *context, |
| 406 |
GtkSelectionData *selection, |
| 407 |
guint target_info, |
| 408 |
guint time, |
| 409 |
gpointer data) |
| 410 |
{ |
| 411 |
gchar *uris[2]; |
| 412 |
GtkIconInfo *info; |
| 413 |
GtkWidget *image; |
| 414 |
GFile *file; |
| 415 |
const gchar *name; |
| 416 |
|
| 417 |
image = gtk_bin_get_child (GTK_BIN (widget)); |
| 418 |
gtk_image_get_icon_name (GTK_IMAGE (image), &name, NULL); |
| 419 |
|
| 420 |
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, -1, 0); |
| 421 |
file = g_file_new_for_path (gtk_icon_info_get_filename (info)); |
| 422 |
uris[0] = g_file_get_uri (file); |
| 423 |
uris[1] = NULL; |
| 424 |
|
| 425 |
gtk_selection_data_set_uris (selection, uris); |
| 426 |
|
| 427 |
g_free (uris[0]); |
| 428 |
g_object_unref (info); |
| 429 |
g_object_unref (file); |
| 430 |
} |
| 431 |
|
| 432 |
static void |
| 433 |
setup_image_dnd (GtkWidget *image) |
| 434 |
{ |
| 435 |
GtkWidget *parent; |
| 436 |
|
| 437 |
parent = gtk_widget_get_parent (image); |
| 438 |
gtk_drag_source_set (parent, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY); |
| 439 |
gtk_drag_source_add_image_targets (parent); |
| 440 |
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_image_data), NULL); |
| 441 |
} |
| 442 |
|
| 443 |
static void |
| 444 |
setup_scalable_image_dnd (GtkWidget *image) |
| 445 |
{ |
| 446 |
GtkWidget *parent; |
| 447 |
|
| 448 |
parent = gtk_widget_get_parent (image); |
| 449 |
gtk_drag_source_set (parent, GDK_BUTTON1_MASK, |
| 450 |
target_table, G_N_ELEMENTS (target_table), |
| 451 |
GDK_ACTION_COPY); |
| 452 |
|
| 453 |
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_scalable_image_data), NULL); |
| 454 |
} |
| 455 |
|
| 456 |
static void |
| 457 |
icon_browser_window_init (IconBrowserWindow *win) |
| 458 |
{ |
| 459 |
GtkTargetList *list; |
| 460 |
GtkTargetEntry *targets; |
| 461 |
gint n_targets; |
| 462 |
|
| 463 |
gtk_widget_init_template (GTK_WIDGET (win)); |
| 464 |
|
| 465 |
list = gtk_target_list_new (NULL, 0); |
| 466 |
gtk_target_list_add_text_targets (list, 0); |
| 467 |
targets = gtk_target_table_new_from_list (list, &n_targets); |
| 468 |
gtk_target_list_unref (list); |
| 469 |
|
| 470 |
gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (win->list), |
| 471 |
GDK_BUTTON1_MASK, |
| 472 |
targets, n_targets, |
| 473 |
GDK_ACTION_COPY); |
| 474 |
|
| 475 |
gtk_target_table_free (targets, n_targets); |
| 476 |
|
| 477 |
setup_image_dnd (win->image1); |
| 478 |
setup_image_dnd (win->image2); |
| 479 |
setup_image_dnd (win->image3); |
| 480 |
setup_image_dnd (win->image4); |
| 481 |
setup_image_dnd (win->image5); |
| 482 |
setup_scalable_image_dnd (win->image6); |
| 483 |
|
| 484 |
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, context_free); |
| 485 |
|
| 486 |
gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL); |
| 487 |
gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win)); |
| 488 |
|
| 489 |
g_signal_connect (win->searchbar, "notify::search-mode-enabled", |
| 490 |
G_CALLBACK (search_mode_toggled), win); |
| 491 |
|
| 492 |
symbolic_toggled (GTK_TOGGLE_BUTTON (win->symbolic_radio), win); |
| 493 |
|
| 494 |
populate (win); |
| 495 |
} |
| 496 |
|
| 497 |
static void |
| 498 |
icon_browser_window_class_init (IconBrowserWindowClass *class) |
| 499 |
{ |
| 500 |
g_type_ensure (ICON_STORE_TYPE); |
| 501 |
|
| 502 |
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class), |
| 503 |
"/org/gtk/iconbrowser/gtk/window.ui"); |
| 504 |
|
| 505 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, context_list); |
| 506 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, filter_model); |
| 507 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, symbolic_radio); |
| 508 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, details); |
| 509 |
|
| 510 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, store); |
| 511 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, cell); |
| 512 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, text_cell); |
| 513 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, search); |
| 514 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, searchbar); |
| 515 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, searchentry); |
| 516 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, list); |
| 517 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image1); |
| 518 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image2); |
| 519 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image3); |
| 520 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image4); |
| 521 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image5); |
| 522 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image6); |
| 523 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, label6); |
| 524 |
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description); |
| 525 |
|
| 526 |
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), search_text_changed); |
| 527 |
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated); |
| 528 |
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed); |
| 529 |
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled); |
| 530 |
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), key_press_event_cb); |
| 531 |
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), copy_to_clipboard); |
| 532 |
} |
| 533 |
|
| 534 |
IconBrowserWindow * |
| 535 |
icon_browser_window_new (IconBrowserApp *app) |
| 536 |
{ |
| 537 |
return g_object_new (ICON_BROWSER_WINDOW_TYPE, "application", app, NULL); |
| 538 |
} |