]> git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/ppdc-mediasize.cxx
Fix source file header text duplication text duplication.
[thirdparty/cups.git] / ppdc / ppdc-mediasize.cxx
1 //
2 // Shared media size class for the CUPS PPD Compiler.
3 //
4 // Copyright 2007-2009 by Apple Inc.
5 // Copyright 2002-2005 by Easy Software Products.
6 //
7 // These coded instructions, statements, and computer programs are the
8 // property of Apple Inc. and are protected by Federal copyright
9 // law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 // which should have been included with this file. If this file is
11 // missing or damaged, see the license at "http://www.cups.org/".
12 //
13
14 //
15 // Include necessary headers...
16 //
17
18 #include "ppdc-private.h"
19
20
21 //
22 // 'ppdcMediaSize::ppdcMediaSize()' - Create a new media size.
23 //
24
25 ppdcMediaSize::ppdcMediaSize(const char *n, // I - Name of media size
26 const char *t, // I - Text of media size
27 float w, // I - Width in points
28 float l, // I - Length in points
29 float lm, // I - Left margin in points
30 float bm, // I - Bottom margin in points
31 float rm, // I - Right margin in points
32 float tm, // I - Top margin in points
33 const char *sc, // I - PageSize code, if any
34 const char *rc) // I - PageRegion code, if any
35 : ppdcShared()
36 {
37 PPDC_NEW;
38
39 name = new ppdcString(n);
40 text = new ppdcString(t);
41 width = w;
42 length = l;
43 left = lm;
44 bottom = bm;
45 right = rm;
46 top = tm;
47 size_code = new ppdcString(sc);
48 region_code = new ppdcString(rc);
49
50 if (left < 0.0f)
51 left = 0.0f;
52 if (bottom < 0.0f)
53 bottom = 0.0f;
54 if (right < 0.0f)
55 right = 0.0f;
56 if (top < 0.0f)
57 top = 0.0f;
58 }
59
60
61 //
62 // 'ppdcMediaSize::~ppdcMediaSize()' - Destroy a media size.
63 //
64
65 ppdcMediaSize::~ppdcMediaSize()
66 {
67 PPDC_DELETE;
68
69 name->release();
70 text->release();
71 size_code->release();
72 region_code->release();
73 }