Subversion Repositories Scribus

Rev

Rev 1053 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
594 cbradney 1
<qt>
2
<title>Predefined Constants</title>
559 cbradney 3
<h2>Predefined Constants</h2>
4
 
5
<p>There are some Constants defined to help using the Commands: </p>
6
 
1044 subik 7
<h4>Scribus Version:</h4>
8
        <p>The script interface provides two variables containing the current Scribus version in the <code>scribus</code> module. Scripts can use these variables to check that they're running under the version of Scribus they expect, and to report information about incompatibilities to the user. These two variables, <code>scribus_version</code> and <code>scribus_version_info</code>, were added in 1.2.1 and 1.3.0cvs and will not be present in earlier versions. If you need to, you can check for their presence with <code>hasattr(scribus, 'scribus_version')</code>.</p>
9
        <p><code>scribus_version</code> contains the current Scribus version as a string. It will usually look like <code>'1.2.1cvs'</code> or <code>'1.3.0'</code>, for example, but is not guaranteed to always follow that format. This variable is useful when you need to display the version to the user, for example when reporting an incompatibility. Do not parse or compare this variable, that is what <code>scribus_version_info</code> is for.</p>
10
        <p><code>scribus_version_info</code> is a tuple similar to the <code>sys.version_info</code> tuple provided by Python. It is a tuple of the form (majorversion, minorversion, patchlevel, extraversion, build) for example, 1.2.1cvs will have <code>(1,2,1,'cvs',0)</code> and 1.3.2 will have <code>(1,3,2,'',0)<code> . These tuples are ideal for checking for minimum versions, etc, because Python compares tuples element-by-element, left-to-right. For example:</p>
11
<pre>
12
if scribus.scribus_version_info[:3] &lt; (1,2,2):
1388 subik 13
    messageBox("Scribus - Python script",
14
        "This script requires Scribus 1.2.2 or newer. "+\
15
        "You're running %s." % scribus.scribus_version,
16
        ICON_CRITICAL)
17
    sys.exit()
1044 subik 18
</pre>
19
 
559 cbradney 20
<h4>Unit Definitions: </h4>
21
<dl>
1002 subik 22
        <dt>UNIT_POINTS</dt>
559 cbradney 23
        <dd>Measurement Unit Point = 0</dd>
1002 subik 24
        <dt>UNIT_MILLIMETERS</dt>
559 cbradney 25
        <dd>Measurement Unit Millimeter = 1</dd>
1002 subik 26
        <dt>UNIT_INCHES</dt>
559 cbradney 27
        <dd>Measurement Unit Inch = 2</dd>
1002 subik 28
        <dt>UNIT_PICAS</dt>
559 cbradney 29
        <dd>Measurement Unit Pica = 3</dd>
30
</dl>
31
 
32
<h4>Page Orientation Definitions: </h4>
33
<dl>
1002 subik 34
        <dt>PORTRAIT</dt>
559 cbradney 35
        <dd>Pageformat Portrait = 0</dd>
1002 subik 36
        <dt>LANDSCAPE</dt>
37
        <dd>Pageformat Landscape = 1</dd>
559 cbradney 38
</dl>
39
 
40
<h4>Definitions for Page Formats: </h4>
41
<dl>
1002 subik 42
        <dt>PAPER_A0</dt>
559 cbradney 43
        <dd>Paperformat A0 = 2380 x 3368 Points</dd>
1002 subik 44
        <dt>PAPER_A1</dt>
559 cbradney 45
        <dd>Paperformat A1 = 1684 x 2380 Points</dd>
1002 subik 46
        <dt>PAPER_A2</dt>
559 cbradney 47
        <dd>Paperformat A2 = 1190 x 1684 Points</dd>
1002 subik 48
        <dt>PAPER_A3</dt>
559 cbradney 49
        <dd>Paperformat A3 = 842 x 1190 Points</dd>
1002 subik 50
        <dt>PAPER_A4</dt>
559 cbradney 51
        <dd>Paperformat A4 = 595 x 842 Points</dd>
1002 subik 52
        <dt>PAPER_A5</dt>
559 cbradney 53
        <dd>Paperformat A5 = 421 x 595 Points</dd>
1002 subik 54
        <dt>PAPER_A6</dt>
559 cbradney 55
        <dd>Paperformat A6 = 297 x 421 Points</dd>
1002 subik 56
        <dt>PAPER_A7</dt>
559 cbradney 57
        <dd>Paperformat A7 = 210 x 297 Points</dd>
1002 subik 58
        <dt>PAPER_A8</dt>
559 cbradney 59
        <dd>Paperformat A8 = 148 x 210 Points</dd>
1002 subik 60
        <dt>PAPER_A9</dt>
559 cbradney 61
        <dd>Paperformat A9 = 105 x 148 Points</dd>
1002 subik 62
        <dt>PAPER_B0</dt>
559 cbradney 63
        <dd>Paperformat B0 = 2836 x 4008 Points</dd>
1002 subik 64
        <dt>PAPER_B1</dt>
559 cbradney 65
        <dd>Paperformat B1 = 2004 x 2836 Points</dd>
1002 subik 66
        <dt>PAPER_B2</dt>
559 cbradney 67
        <dd>Paperformat B2 = 1418 x 2004 Points</dd>
1002 subik 68
        <dt>PAPER_B3</dt>
559 cbradney 69
        <dd>Paperformat B3 = 1002 x 1418 Points</dd>
1002 subik 70
        <dt>PAPER_B4</dt>
559 cbradney 71
        <dd>Paperformat B4 = 709 x 1002 Points</dd>
1002 subik 72
        <dt>PAPER_B5</dt>
559 cbradney 73
        <dd>Paperformat B5 = 501 x 709 Points</dd>
1002 subik 74
        <dt>PAPER_B6</dt>
559 cbradney 75
        <dd>Paperformat B6 = 355 x 501 Points</dd>
1002 subik 76
        <dt>PAPER_B7</dt>
559 cbradney 77
        <dd>Paperformat B7 = 250 x 355 Points</dd>
1002 subik 78
        <dt>PAPER_B8</dt>
559 cbradney 79
        <dd>Paperformat B8 = 178 x 250 Points</dd>
1002 subik 80
        <dt>PAPER_B9</dt>
559 cbradney 81
        <dd>Paperformat B9 = 125 x 178 Points</dd>
1002 subik 82
        <dt>PAPER_B10</dt>
559 cbradney 83
        <dd>Paperformat B10 = 89 x 125 Points</dd>
1002 subik 84
        <dt>PAPER_C5E</dt>
559 cbradney 85
        <dd>Paperformat C5E = 462 x 649 Points</dd>
1002 subik 86
        <dt>PAPER_COMM10E</dt>
559 cbradney 87
        <dd>Paperformat Comm10E = 298 x 683 Points</dd>
1002 subik 88
        <dt>PAPER_DLE</dt>
559 cbradney 89
        <dd>Paperformat DLE = 312 x 624 Points</dd>
1044 subik 90
        <dt>PAPER_EXECUTIVE</dt>
559 cbradney 91
        <dd>Paperformat Executive = 542 x 720 Points</dd>
1002 subik 92
        <dt>PAPER_FOLIO</dt>
559 cbradney 93
        <dd>Paperformat Folio = 595 x 935 Points</dd>
1002 subik 94
        <dt>PAPER_LEDGER</dt>
559 cbradney 95
        <dd>Paperformat Ledger = 1224 x 792 Points</dd>
1002 subik 96
        <dt>PAPER_LEGAL</dt>
559 cbradney 97
        <dd>Paperformat Legal = 612 x 1008 Points</dd>
1002 subik 98
        <dt>PAPER_LETTER</dt>
559 cbradney 99
        <dd>Paperformat Letter = 612 x 792 Points</dd>
1002 subik 100
        <dt>PAPER_TABLOID</dt>
559 cbradney 101
        <dd>Paperformat Tabloid = 792 x 1224 Points</dd>
102
</dl>
103
 
1044 subik 104
<h4>Definitions for Document Layout:</h4>
559 cbradney 105
<dl>
1002 subik 106
        <dt>FACINGPAGES</dt>
559 cbradney 107
        <dd>Layout with facing Pages.</dd>
1002 subik 108
        <dt>NOFACINGPAGES</dt>
559 cbradney 109
        <dd>Normal Layout of the Document.</dd>
1002 subik 110
        <dt>FIRSTPAGELEFT</dt>
559 cbradney 111
        <dd>The first Page of the Document is a left Page.</dd>
1002 subik 112
        <dt>FIRSTPAGERIGHT</dt>
559 cbradney 113
        <dd>The first Page of the Document is a right Page.</dd>
114
</dl>
115
 
116
<h4>Alignment Definitions </h4>
117
<dl>
1002 subik 118
        <dt>ALIGN_LEFTK</dt>
559 cbradney 119
        <dd>Text is aligned to the Left.</dd>
1002 subik 120
        <dt>ALIGN_CENTERED</dt>
559 cbradney 121
        <dd>The Text is centered in the Textframe.</dd>
1002 subik 122
        <dt>ALIGN_RIGHT</dt>
559 cbradney 123
        <dd>The Text is aligned to the Right Side of the Textframe</dd>
1002 subik 124
        <dt>ALIGN_FORCED</dt>
559 cbradney 125
        <dd>The Text has forced Alignment</dd>
1002 subik 126
        <dt>ALIGN_BLOCK</dt>
127
        <dd>The Text has block Alignment</dd>
559 cbradney 128
</dl>
129
 
130
<h4>Line related Definitions: </h4>
131
<dl>
1002 subik 132
    <dt>LINE_DASH</dt>
133
    <dt>LINE_DASHDOT</dt>
134
    <dt>LINE_DASHDOTDOT</dt>
135
    <dt>LINE_DOT</dt>
136
    <dt>LINE_SOLID</dt>
137
    <dt>JOIN_BEVEL</dt>
138
    <dt>JOIN_MITTER</dt>
139
    <dt>JOIN_ROUND</dt>
140
    <dt>CAP_FLAT</dt>
141
    <dt>CAP_ROUND</dt>
142
    <dt>CAP_SQUARE</dt>
559 cbradney 143
</dl>
1044 subik 144
 
559 cbradney 145
<h4>Fill related Definitions: </h4>
146
<dl>
1002 subik 147
        <dt>FILL_NOG</dt>
148
    <dd>No gradient, plain color</dd>
149
        <dt>FILL_HORIZONTALG</dt>
150
        <dt>FILL_VERTICALG</dt>
151
        <dt>FILL_DIAGONALG</dt>
152
        <dt>FILL_CROSSDIAGONALG</dt>
1044 subik 153
        <dt>FILL_RADIALG</dt>
559 cbradney 154
</dl>
1002 subik 155
 
156
<h4>Dialog Buttons</h4>
157
<dl>
158
    <dt>BUTTON_ABORT</dt>
159
    <dt>BUTTON_CANCEL</dt>
160
    <dt>BUTTON_IGNORE</dt>
161
    <dt>BUTTON_NO</dt>
162
    <dt>BUTTON_NONE</dt>
163
    <dt>BUTTON_OK</dt>
164
    <dt>BUTTON_RETRY</dt>
165
    <dt>BUTTON_YES</dt>
166
</dl>
167
 
168
<h4>Dialog Icons</h4>
169
<dl>
170
    <dt>ICON_CRITICAL</dt>
171
    <dt>ICON_INFORMATION</dt>
172
    <dt>ICON_NONE</dt>
173
    <dt>ICON_WARNING</dt>
174
</dl>
175
 
594 cbradney 176
</qt>