File: layout_single.h

package info (click to toggle)
photoprint 0.4.1-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 10,568 kB
  • ctags: 4,517
  • sloc: cpp: 46,643; sh: 10,360; ansic: 4,755; makefile: 543; sed: 16
file content (65 lines) | stat: -rw-r--r-- 2,219 bytes parent folder | download | duplicates (3)
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
#ifndef LAYOUT_SINGLE_H
#define LAYOUT_SINGLE_H

#include <stdio.h>
#include <glib.h>
#include <gtk/gtkwidget.h>
#include <gdk/gdkpixbuf.h>

#include "imagesource/imagesource.h"
#include "support/pageextent.h"
#include "gp_cppsupport/gprinter.h"

#include "layoutdb.h"
#include "layout.h"

class Layout_Single_ImageInfo;
class LayoutIterator_Single;
class PhotoPrint_State;

class Layout_Single : public Layout
{
	public:
	Layout_Single(PhotoPrint_State &state,Layout *oldlayout=NULL);
	virtual ~Layout_Single();
	const char *GetType();
	int GetCapabilities();
	int AddImage(const char *filename,bool allowcropping=false,PP_ROTATION rotation=PP_ROTATION_AUTO);
	void CopyImage(Layout_ImageInfo *ii);
	void Reflow();
	void SetPageExtent(PageExtent &pe);
	virtual void LayoutToDB(LayoutDB &db);
	virtual void DBToLayout(LayoutDB &db);
	virtual GtkWidget *CreateWidget();
	virtual void RefreshWidget(GtkWidget *widget);
	virtual void Print(Progress *p);	// Overridden so we can set the top/left position...
	virtual ImageSource *GetImageSource(int page,CMColourDevice target=CM_COLOURDEVICE_PRINTER,
		CMTransformFactory *factory=NULL,int res=0,bool completepage=false);
	Layout_Single_ImageInfo *ImageAt(int page);
	virtual void (*SetUnitFunc())(GtkWidget *wid,enum Units unit);
	friend class Layout_Single_ImageInfo;
	friend class LayoutIterator_Single;
};


class Layout_Single_ImageInfo : public Layout_ImageInfo
{
	public:
	Layout_Single_ImageInfo(Layout_Single &layout,const char *filename,int page,bool allowcropping=false,PP_ROTATION rotation=PP_ROTATION_AUTO);
	Layout_Single_ImageInfo(Layout_Single &layout,Layout_ImageInfo *ii,int page);
	virtual ~Layout_Single_ImageInfo();
	void DrawThumbnail(GtkWidget *widget,int xpos,int ypos,int width,int height);
	virtual ImageSource *GetImageSource(CMColourDevice target=CM_COLOURDEVICE_PRINTER,CMTransformFactory *factory=NULL);
	virtual LayoutRectangle *GetBounds();	// The dimensions of the image's "slot".
	virtual RectFit *GetFit(double scale);	// Details of the image's size after fitting to its slot.
	virtual bool GetSelected();
	float hscale;
	float vscale;
	private:
	void Init();
	friend class Layout_Single;
	friend class LayoutIterator_Single;
};


#endif