ui/gtk/image.c

Thu, 28 Nov 2024 18:05:51 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 28 Nov 2024 18:05:51 +0100
branch
newapi
changeset 399
bb3f3fe2d5ee
parent 390
b130f80ec7f9
permissions
-rw-r--r--

safely unbind radio buttons (GTK)

339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2024 Olaf Wintermann. All rights reserved.
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #include "image.h"
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 #include "container.h"
389
d15eca5fd8b3 implement image viewer context menus (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 381
diff changeset
32 #include "menu.h"
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 #include "../common/context.h"
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #include "../common/object.h"
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 UIWIDGET ui_imageviewer_create(UiObject *obj, UiImageViewerArgs args) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 UiObject *current = uic_current_obj(obj);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 GtkWidget *scrolledwindow = SCROLLEDWINDOW_NEW();
340
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
41 #if GTK_CHECK_VERSION(4, 0, 0)
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
42 GtkWidget *image = gtk_picture_new();
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
43 #else
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 GtkWidget *image = gtk_image_new();
340
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
45 #endif
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
46
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
47 ui_set_name_and_style(image, args.name, args.style_class);
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 #if GTK_MAJOR_VERSION < 4
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 GtkWidget *eventbox = gtk_event_box_new();
340
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
51 SCROLLEDWINDOW_SET_CHILD(scrolledwindow, eventbox);
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 gtk_container_add(GTK_CONTAINER(eventbox), image);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 #else
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 SCROLLEDWINDOW_SET_CHILD(scrolledwindow, image);
389
d15eca5fd8b3 implement image viewer context menus (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 381
diff changeset
55 GtkWidget *eventbox = image;
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 #endif
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 UI_APPLY_LAYOUT1(current, args);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 current->container->add(current->container, scrolledwindow, TRUE);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 UiVar *var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_GENERIC);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 if(var) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 UiGeneric *value = var->value;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 value->get = ui_imageviewer_get;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 value->get_type = ui_imageviewer_get_type;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 value->set = ui_imageviewer_set;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 value->obj = image;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 if(value->value && value->type && !strcmp(value->type, UI_IMAGE_OBJECT_TYPE)) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 GdkPixbuf *pixbuf = value->value;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 value->value = NULL;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 ui_imageviewer_set(value, pixbuf, UI_IMAGE_OBJECT_TYPE);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74
389
d15eca5fd8b3 implement image viewer context menus (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 381
diff changeset
75 if(args.contextmenu) {
390
b130f80ec7f9 implement list/table contextmenu (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 389
diff changeset
76 UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, eventbox);
389
d15eca5fd8b3 implement image viewer context menus (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 381
diff changeset
77 ui_widget_set_contextmenu(eventbox, menu);
d15eca5fd8b3 implement image viewer context menus (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 381
diff changeset
78 }
d15eca5fd8b3 implement image viewer context menus (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 381
diff changeset
79
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 return scrolledwindow;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 void* ui_imageviewer_get(UiGeneric *g) {
340
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
84 return g->value;
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 const char* ui_imageviewer_get_type(UiGeneric *g) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 int ui_imageviewer_set(UiGeneric *g, void *value, const char *type) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 if(!type || strcmp(type, UI_IMAGE_OBJECT_TYPE)) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 return 1;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 // TODO: do we need to free the previous value here?
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 g->value = value;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 g->type = type;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 GdkPixbuf *pixbuf = value;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 if(pixbuf) {
381
b47bda6666ce fix gtk3 image loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 340
diff changeset
103 int width = gdk_pixbuf_get_width(pixbuf);
b47bda6666ce fix gtk3 image loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 340
diff changeset
104 int height = gdk_pixbuf_get_height(pixbuf);
b47bda6666ce fix gtk3 image loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 340
diff changeset
105
b47bda6666ce fix gtk3 image loading
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 340
diff changeset
106 #if GTK_CHECK_VERSION(4, 0, 0)
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 GdkTexture *texture = gdk_texture_new_for_pixbuf(pixbuf);
340
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
108 gtk_picture_set_paintable(GTK_PICTURE(g->obj), GDK_PAINTABLE(texture));
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 #else
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 gtk_image_set_from_pixbuf(GTK_IMAGE(g->obj), pixbuf);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 #endif
340
2dd42bd4fe5d add imageviewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
112 gtk_widget_set_size_request(g->obj, width, height);
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 return 0;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 int ui_image_load_file(UiGeneric *obj, const char *path) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 GError *error = NULL;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, &error);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 if(!pixbuf) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 return 1;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 if(obj->set) {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 obj->set(obj, pixbuf, UI_IMAGE_OBJECT_TYPE);
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 } else {
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 obj->value = pixbuf;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132 }
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 return 0;
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 }

mercurial