1 
2 /*
3  * The Real SoundTracker - automatically scalable widget containing
4  * an image (header)
5  *
6  * Copyright (C) 2002 Yury Aliaev
7  * Copyright (C) 1998-2019 Michael Krause
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  */
23 
24 #ifndef __SCALABLE_PIC_H
25 #define __SCALABLE_PIC_H
26 
27 #include <gdk-pixbuf/gdk-pixbuf.h>
28 
29 #include "customdrawing.h"
30 
31 #define SCALABLE_PIC(obj) \
32     (G_TYPE_CHECK_INSTANCE_CAST(obj, scalable_pic_get_type(), ScalablePic))
33 #define SCALABLE_PIC_CLASS(klass) \
34     (G_TYPE_CHECK_CLASS_CAST(klass, scalable_pic_get_type(), ScalablePicClass))
35 #define IS_SCALABLE_PIC(obj) \
36     (G_TYPE_CHECK_INSTANCE_TYPE(obj, scalable_pic_get_type()))
37 
38 typedef struct _ScalablePic {
39     CustomDrawing widget;
40     GdkPixbuf *pic, *copy;
41     DIGC bg_gc;
42     gint maxwidth, maxheight, former_width, former_height, pic_width, pic_height;
43     gboolean expand;
44     gdouble ratio_min;
45 } ScalablePic;
46 
47 typedef struct _ScalablePicClass {
48     CustomDrawingClass parent_class;
49 } ScalablePicClass;
50 
51 /* create a widget containing GdkPixbuf image */
52 GType scalable_pic_get_type(void) G_GNUC_CONST;
53 GtkWidget* scalable_pic_new(GdkPixbuf* pic, gboolean expand);
54 void scalable_pic_set_bg(ScalablePic* w, DIGC gc);
55 
56 #endif /* __SCALABLE_PIC_H */
57