KiCad PCB EDA Suite
gal_print.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 CERN
3  * Author: Maciej Suminski <maciej.suminski@cern.ch>
4  *
5  * This program is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation, either version 3 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef GAL_PRINT_H
20 #define GAL_PRINT_H
21 
22 #ifdef WX_COMPATIBILITY
23 class wxDC;
24 #endif /* WX_COMPATIBILITY */
25 
26 namespace KIGFX {
27 class GAL;
28 class GAL_DISPLAY_OPTIONS;
29 
30 
32 {
33 public:
34  virtual ~PRINT_CONTEXT() {}
35  virtual double GetNativeDPI() const = 0;
36  virtual bool HasNativeLandscapeRotation() const = 0;
37 };
38 
39 
43 class GAL_PRINT
44 {
45 public:
46 #ifdef WX_COMPATIBILITY
47  static std::unique_ptr<GAL_PRINT> Create( GAL_DISPLAY_OPTIONS& aOptions, wxDC* aDC );
48 #endif /* WX_COMPATIBILITY */
49  virtual ~GAL_PRINT() {}
50 
51  virtual GAL* GetGAL() = 0;
52 
53  virtual PRINT_CONTEXT* GetPrintCtx() const = 0;
54 
60  virtual void SetNativePaperSize( const VECTOR2D& aSize, bool aRotateIfLandscape ) = 0;
61 
65  virtual void SetSheetSize( const VECTOR2D& aSize ) = 0;
66 };
67 
68 }; // end namespace KIGFX
69 
70 #endif /* GAL_PRINT_H */
Wrapper around GAL to provide information needed for printing.
Definition: gal_print.h:43
virtual ~PRINT_CONTEXT()
Definition: gal_print.h:34
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
virtual ~GAL_PRINT()
Definition: gal_print.h:49
virtual double GetNativeDPI() const =0
virtual bool HasNativeLandscapeRotation() const =0
Class GAL is the abstract interface for drawing on a 2D-surface.