forked from blackfiveimaging/photoprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout_carousel.h
80 lines (71 loc) · 2.46 KB
/
layout_carousel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef LAYOUT_CAROUSEL_H
#define LAYOUT_CAROUSEL_H
#include <stdio.h>
#include <glib.h>
#include <gtk/gtkwidget.h>
#include <gdk/gdkpixbuf.h>
#include "circlemontage.h"
#include "pageextent.h"
#include "imagesource/imagesource.h"
#include "gp_cppsupport/gprinter.h"
#include "layoutdb.h"
#include "layout.h"
class Layout_Carousel_ImageInfo;
class PhotoPrint_State;
class Layout_Carousel : public Layout
{
public:
Layout_Carousel(PhotoPrint_State &state,Layout *oldlayout=NULL);
virtual ~Layout_Carousel();
const char *GetType();
int GetCapabilities();
int AddImage(const char *filename,bool allowcropping=false,PP_ROTATION rotation=PP_ROTATION_AUTO,bool fliphorizontal=false,bool flipvertical=false);
void CopyImage(Layout_ImageInfo *ii);
void PlaceImage(const char *filename);
int FreeSlots();
void Reflow();
virtual void LayoutToDB(LayoutDB &db);
virtual void DBToLayout(LayoutDB &db);
virtual GtkWidget *CreateWidget();
virtual void RefreshWidget(GtkWidget *widget);
virtual ImageSource *GetImageSource(int page,CMColourDevice target=CM_COLOURDEVICE_PRINTER,
CMTransformFactory *factory=NULL,int res=0,bool completepage=false);
Layout_Carousel_ImageInfo *ImageAt(int page, int segment);
Layout_ImageInfo *ImageAtCoord(int x,int y);
virtual void (*SetUnitFunc())(GtkWidget *wid,enum Units unit);
int CountImages(int page);
Layout_Carousel_ImageInfo *GetNthImage(int page,int n);
void FlushPreview();
void DrawPreview(GtkWidget *widget,int xpos,int ypos,int width,int height);
void SetSegments(int segs);
int GetSegments();
void SetOverlap(int overlap);
int GetOverlap();
void SetAngleOffset(int ao);
int GetAngleOffset();
void SetInnerRadius(int ir);
int GetInnerRadius();
private:
int segments;
int overlap;
int angleoffset;
int innerradius;
void RenderPreview(int width,int height);
GdkPixbuf *preview;
int prevwidth,prevheight;
friend class Layout_Carousel_ImageInfo;
};
class Layout_Carousel_ImageInfo : public Layout_ImageInfo
{
public:
Layout_Carousel_ImageInfo(Layout_Carousel &layout,const char *filename,int page,bool allowcropping=false, PP_ROTATION rotation=PP_ROTATION_AUTO,bool fliphorizontal=false,bool flipvertical=false);
Layout_Carousel_ImageInfo(Layout_Carousel &layout,Layout_ImageInfo *ii,int page);
virtual ~Layout_Carousel_ImageInfo();
void DrawThumbnail(GtkWidget *widget,int xpos,int ypos,int width,int height);
void FlushThumbnail();
virtual LayoutRectangle *GetBounds();
int segment;
private:
friend class Layout_Carousel;
};
#endif