File: xtraditional24a.adb

package info (click to toggle)
plplot 5.15.0%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,312 kB
  • sloc: ansic: 79,707; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 50; sed: 34; fortran: 5
file content (119 lines) | stat: -rw-r--r-- 3,434 bytes parent folder | download | duplicates (4)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
-- Unicode Pace Flag

-- Copyright (C) 2008 Jerry Bauck

-- This file is part of PLplot.

-- PLplot is free software; you can redistribute it and/or modify
-- it under the terms of the GNU Library General Public License as published
-- by the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.

-- PLplot is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU Library General Public License for more details.

-- You should have received a copy of the GNU Library General Public License
-- along with PLplot; if not, write to the Free Software
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

with
    PLplot_Auxiliary,
    PLplot_Traditional;
use
    PLplot_Auxiliary,
    PLplot_Traditional;

procedure xtraditional24a is
    red   : Integer_Array_1D(0 .. 6) := (240, 204, 204, 204,   0,  39, 125);
    green : Integer_Array_1D(0 .. 6) := (240,   0, 125, 204, 204,  80,   0);
    blue  : Integer_Array_1D(0 .. 6) := (240,   0,   0,   0,   0, 204, 125);

    px : Real_Vector(0 .. 3) := (0.0, 0.0,  1.0,  1.0);
    py : Real_Vector(0 .. 3) := (0.0, 0.25, 0.25, 0.0);

    sx : Real_Vector(0 .. 11) := (
        0.16374,
        0.15844,
        0.15255,
        0.17332,
        0.50436,
        0.51721,
        0.49520,
        0.48713,
        0.83976,
        0.81688,
        0.82231,
        0.82647);

    sy : Real_Vector(0 .. 11) := (
        0.125,
        0.375,
        0.625,
        0.875,
        0.125,
        0.375,
        0.625,
        0.875,
        0.125,
        0.375,
        0.625,
        0.875);

    -- Taken from http://www.columbia.edu/~fdc/pace/
    function peace(which : Integer) return String is
    begin
        -- Mandarin
        if which = 0  then return "#<0x00>和平"; end if;
        -- Hindi
        if which = 1  then return "#<0x20>शांति"; end if;
        -- English
        if which = 2  then return "#<0x10>Peace"; end if;
        -- Hebrew
        if which = 3  then return "#<0x10>שלום"; end if;
        -- Russian
        if which = 4  then return "#<0x10>Мир"; end if;
        -- German
        if which = 5  then return "#<0x10>Friede"; end if;
        -- Korean
        if which = 6  then return "#<0x30>평화"; end if;
        -- French
        if which = 7  then return "#<0x10>Paix"; end if;
        -- Spanish
        if which = 8  then return "#<0x10>Paz"; end if;
        -- Arabic
        if which = 9  then return "#<0x10>ﺳﻼم"; end if;
        -- Turkish
        if which = 10 then return "#<0x10>Barış"; end if;
        -- Kurdish
        if which = 11 then return "#<0x10>Hasîtî"; end if;
        return "oops";
    end peace;

begin
    plparseopts(PL_PARSE_FULL);
    plinit;

    pladv(0);
    plvpor(0.0, 1.0, 0.0, 1.0);
    plwind(0.0, 1.0, 0.0, 1.0);
    plcol0(0);
    plbox("", 1.0, 0, "", 1.0, 0);
    plscmap0n(7);
    plscmap0(red, green, blue);
    plschr(0.0, 4.0);
    plfont(1);
    for i in 0 .. 3 loop
        plcol0(i + 1);
        plfill(4, px, py);
            for j in 0 .. 3 loop
                py(j) := py(j) + 1.0 / 4.0;
            end loop;
    end loop;
    plcol0(0);
    for i in 0 .. 11 loop
        plptex(sx(i), sy(i), 1.0, 0.0, 0.5, peace(i));
    end loop;
    plend;
end xtraditional24a;