]> Pileus Git - aweather/blob - src/plugins/alert-info.c
Add warning/watch/alert plugin
[aweather] / src / plugins / alert-info.c
1 /*
2  * Copyright (C) 2010-2011 Andy Spencer <andy753421@gmail.com>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 /* Taken from: http://www.weather.gov/wwamap-prd/faq.php */
19
20 #include "alert-info.h"
21
22 AlertInfo alert_info[] = {
23         /* Warnings */
24         //                                                                  hide  poly
25         // title                            category    abbr          prio  | cur |  color
26         {"Ashfall Warning"                , "warning",  "Ashfall",    72  , 0, 0, 0, {169, 169, 169}},  // darkgray
27         {"Avalanche Warning"              , "warning",  "Avalanche",  21  , 0, 0, 0, {30 , 144, 255}},  // dodgerblue
28         {"Blizzard Warning"               , "warning",  "Blizzard",   12  , 0, 0, 0, {255, 69 , 0  }},  // orangered
29         {"Civil Danger Warning"           , "warning",  "Cvl Danger", 7   , 0, 0, 0, {255, 182, 193}},  // lightpink
30         {"Coastal Flood Warning"          , "warning",  "C Flood",    24  , 0, 0, 0, {34 , 139, 34 }},  // forestgreen
31         {"Dust Storm Warning"             , "warning",  "Dust Storm", 32  , 0, 0, 0, {255, 228, 196}},  // bisque
32         {"Earthquake Warning"             , "warning",  "Earthquake", 22  , 0, 0, 0, {139, 69 , 19 }},  // saddlebrown
33         {"Excessive Heat Warning"         , "warning",  "Heat",       31  , 0, 0, 0, {199, 21 , 133}},  // mediumvioletred
34         {"Extreme Cold Warning"           , "warning",  "Cold",       44  , 0, 0, 0, {0  , 0  , 255}},  // blue
35         {"Extreme Wind Warning"           , "warning",  "Ext Wind",   3   , 0, 0, 1, {255, 20 , 147}},  // deeppink
36         {"Fire Warning"                   , "warning",  "Fire",       7   , 0, 0, 0, {160, 82 , 45 }},  // sienna
37         {"Flash Flood Warning"            , "warning",  "F Flood",    5   , 0, 0, 1, {139, 0  , 0  }},  // darkred
38         {"Flood Warning"                  , "warning",  "Flood",      5   , 0, 0, 1, {0  , 255, 0  }},  // lime
39         {"Freeze Warning"                 , "warning",  "Freeze",     45  , 0, 0, 0, {0  , 255, 255}},  // cyan
40         {"Gale Warning"                   , "warning",  "Gale",       40  , 0, 0, 0, {221, 160, 221}},  // plum
41         {"Hard Freeze Warning"            , "warning",  "H Freeze",   45  , 0, 0, 0, {0  , 0  , 255}},  // blue
42         {"Hazardous Materials Warning"    , "warning",  "Haz Mat",    7   , 0, 0, 0, {75 , 0  , 130}},  // indigo
43         {"Hazardous Seas Warning"         , "warning",  "Haz Seas",   67  , 0, 0, 0, {221, 160, 221}},  // plum
44         {"Heavy Freezing Spray Warning"   , "warning",  "Fz Spray",   63  , 0, 0, 0, {0  , 191, 255}},  // deepskyblue
45         {"Heavy Snow Warning"             , "warning",  "Heavy Snow", 15  , 0, 0, 0, {138, 43 , 226}},  // blueviolet
46         {"High Surf Warning"              , "warning",  "High Surf",  28  , 0, 0, 0, {34 , 139, 34 }},  // forestgreen
47         {"High Wind Warning"              , "warning",  "High Wind",  17  , 0, 0, 0, {218, 165, 32 }},  // goldenrod
48         {"Hurricane Force Wind Warning"   , "warning",  "Hur F Wind", 9   , 0, 0, 0, {205, 92 , 92 }},  // westernred
49         {"Hurricane Warning"              , "warning",  "Hurricane",  9   , 0, 0, 0, {220, 20 , 60 }},  // crimson
50         {"Hurricane Wind Warning"         , "warning",  "Hur Wind",   9   , 0, 0, 0, {205, 92 , 92 }},  // westernred
51         {"Ice Storm Warning"              , "warning",  "Ice Storm",  13  , 0, 0, 0, {139, 0  , 139}},  // darkmagenta
52         {"Inland Hurricane Warning"       , "warning",  "I Hurr",     9   , 0, 0, 0, {220, 20 , 60 }},  // crimson
53         {"Inland Tropical Storm Warning"  , "warning",  "I Trop Stm", 14  , 0, 0, 0, {178, 34 , 34 }},  // firebrick
54         {"Lake Effect Snow Warning"       , "warning",  "Lake Snow",  30  , 0, 0, 0, {0  , 139, 139}},  // darkcyan
55         {"Lakeshore Flood Warning"        , "warning",  "L Flood",    25  , 0, 0, 0, {34 , 139, 34 }},  // forestgreen
56         {"Law Enforcement Warning"        , "warning",  "Law Enf.",   8   , 0, 0, 0, {192, 192, 192}},  // silver
57         {"Nuclear Power Plant Warning"    , "warning",  "Nuke Pwr",   7   , 0, 0, 0, {75 , 0  , 130}},  // indigo
58         {"Radiological Hazard Warning"    , "warning",  "Radiology",  7   , 0, 0, 0, {75 , 0  , 130}},  // indigo
59         {"Red Flag Warning"               , "warning",  "Red Flag",   47  , 0, 0, 0, {255, 20 , 147}},  // deeppink
60         {"Severe Thunderstorm Warning"    , "warning",  "Svr Storm",  4   , 0, 0, 1, {255, 165, 0  }},  // orange
61         {"Shelter In Place Warning"       , "warning",  "Shelter",    6   , 0, 0, 0, {250, 128, 114}},  // salmon
62         {"Sleet Warning"                  , "warning",  "Sleet",      29  , 0, 0, 0, {135, 206, 235}},  // skyblue
63         {"Special Marine Warning"         , "warning",  "Sp Marine",  11  , 0, 0, 1, {255, 165, 0  }},  // orange
64         {"Storm Warning"                  , "warning",  "Storm",      13  , 0, 0, 0, {148, 0  , 211}},  // darkviolet
65         {"Tornado Warning"                , "warning",  "Tornado",    2   , 0, 0, 1, {255, 0  , 0  }},  // red
66         {"Tropical Storm Warning"         , "warning",  "Trop Storm", 14  , 0, 0, 0, {178, 34 , 34 }},  // firebrick
67         {"Tropical Storm Wind Warning"    , "warning",  "Trop Wind",  9   , 0, 0, 0, {178, 34 , 34 }},  // firebrick
68         {"Tsunami Warning"                , "warning",  "Tsunami",    1   , 0, 0, 0, {253, 99 , 71 }},  // tomato
69         {"Typhoon Warning"                , "warning",  "Typhoon",    10  , 0, 0, 0, {220, 20 , 60 }},  // crimson
70         {"Volcano Warning"                , "warning",  "Volcano",    23  , 0, 0, 0, {47 , 79 , 79 }},  // darkslategray
71         {"Wind Chill Warning"             , "warning",  "Wind Chill", 43  , 0, 0, 0, {176, 196, 222}},  // lightsteelblue
72         {"Winter Storm Warning"           , "warning",  "Wntr Storm", 16  , 0, 0, 0, {255, 105, 180}},  // hotpink
73
74         /* Advisorys */
75         {"Air Stagnation Advisory"        , "advisory", "Air Stag",   76  , 0, 0, 0, {128, 128, 128}},  // gray
76         {"Ashfall Advisory"               , "advisory", "Ashfall",    73  , 0, 0, 0, {105, 105, 105}},  // dimgray
77         {"Blowing Dust Advisory"          , "advisory", "Blow Dust",  71  , 0, 0, 0, {189, 183, 107}},  // darkkhaki
78         {"Blowing Snow Advisory"          , "advisory", "Blow Snow",  50  , 0, 0, 0, {173, 216, 230}},  // lightblue
79         {"Brisk Wind Advisory"            , "advisory", "Brsk Wind",  66  , 0, 0, 0, {216, 191, 216}},  // thistle
80         {"Coastal Flood Advisory"         , "advisory", "C Flood",    58  , 0, 0, 0, {124, 252, 0  }},  // lawngreen
81         {"Dense Fog Advisory"             , "advisory", "Fog",        68  , 0, 0, 0, {112, 128, 144}},  // slategray
82         {"Dense Smoke Advisory"           , "advisory", "Smoke",      64  , 0, 0, 0, {240, 230, 140}},  // khaki
83         {"Flood Advisory"                 , "advisory", "Flood",      57  , 0, 0, 1, {0  , 255, 127}},  // springgreen
84         {"Freezing Drizzle Advisory"      , "advisory", "Fz Drzl",    51  , 0, 0, 0, {218, 112, 214}},  // orchid
85         {"Freezing Fog Advisory"          , "advisory", "Fz Fog",     74  , 0, 0, 0, {0  , 128, 128}},  // teal
86         {"Freezing Rain Advisory"         , "advisory", "Fz Rain",    51  , 0, 0, 0, {218, 112, 214}},  // orchid
87         {"Freezing Spray Advisory"        , "advisory", "Fz Spray",   75  , 0, 0, 0, {0  , 191, 255}},  // deepskyblue
88         {"Frost Advisory"                 , "advisory", "Frost",      72  , 0, 0, 0, {100, 149, 237}},  // cornflowerblue
89         {"Heat Advisory"                  , "advisory", "Heat",       56  , 0, 0, 0, {255, 127, 80 }},  // coral
90         {"High Surf Advisory"             , "advisory", "Surf",       60  , 0, 0, 0, {186, 85 , 211}},  // mediumorchid
91         {"Hydrologic Advisory"            , "advisory", "Hydro",      57  , 0, 0, 0, {0  , 255, 127}},  // springgreen
92         {"Lake Effect Snow Advisory"      , "advisory", "Lake Snow",  54  , 0, 0, 0, {72 , 209, 204}},  // mediumturquoise
93         {"Lake Wind Advisory"             , "advisory", "Lake Wind",  69  , 0, 0, 0, {210, 180, 140}},  // tan
94         {"Lakeshore Flood Advisory"       , "advisory", "L Flood",    58  , 0, 0, 0, {124, 252, 0  }},  // lawngreen
95         {"Low Water Advisory"             , "advisory", "Low Water",  77  , 0, 0, 0, {165, 42 , 42 }},  // brown
96         {"Sleet Advisory"                 , "advisory", "Sleet",      52  , 0, 0, 0, {123, 104, 238}},  // mediumslateblue
97         {"Small Craft Advisory"           , "advisory", "S Craft",    65  , 0, 0, 0, {216, 191, 216}},  // thistle
98         {"Small Stream Flood Advisory"    , "advisory", "Flood",      57  , 0, 0, 1, {0  , 255, 127}},  // springgreen
99         {"Snow and Blowing Snow Advisory" , "advisory", "S/B Snow",   50  , 0, 0, 0, {176, 224, 230}},  // powderblue
100         {"Tsunami Advisory"               , "advisory", "Tsunami",    42  , 0, 0, 0, {210, 105, 30 }},  // chocolate
101         {"Wind Advisory"                  , "advisory", "Wind",       66  , 0, 0, 0, {210, 180, 140}},  // tan
102         {"Wind Chill Advisory"            , "advisory", "Wind Chill", 55  , 0, 0, 0, {175, 238, 238}},  // paleturquoise
103         {"Winter Weather Advisory"        , "advisory", "Winter Wx",  53  , 0, 0, 0, {123, 104, 238}},  // mediumslateblue
104         {"Lake Effect Snow and Blowing Snow Advisory"
105                                           , "advisory", "L/S Snow",   54  , 0, 0, 0, {72 , 209, 204}},  // mediumturquoise
106         {"Urban and Small Stream Flood Advisory"
107                                           , "advisory", "Flood",      57  , 0, 0, 1, {0  , 255, 127}},  // springgreen
108         {"Arroyo and Small Stream Advisory"
109                                           , "advisory", "Flood",      57  , 0, 0, 1, {0  , 255, 127}},  // springgreen
110
111
112         /* Watches */
113         {"Tornado Watch"                  , "watch",    "Tornado",    33  , 0, 0, 0, {255, 255, 0  }},  // yellow
114         {"Severe Thunderstorm Watch"      , "watch",    "Svr Storm",  35  , 0, 0, 0, {219, 112, 147}},  // palevioletred
115         {"Avalanche Watch"                , "watch",    "Avalanche",  79  , 0, 0, 0, {244, 164, 96 }},  // sandybrown
116         {"Blizzard Watch"                 , "watch",    "Blizzard",   80  , 0, 0, 0, {173, 255, 47 }},  // greenyellow
117         {"Coastal Flood Watch"            , "watch",    "C Flood",    84  , 0, 0, 0, {102, 205, 170}},  // mediumaquamarine
118         {"Excessive Heat Watch"           , "watch",    "Heat",       87  , 0, 0, 0, {128, 0  , 0  }},  // maroon
119         {"Extreme Cold Watch"             , "watch",    "Ext Cold",   88  , 0, 0, 0, {0  , 0  , 255}},  // blue
120         {"Fire Weather Watch"             , "watch",    "Fire Wx",    93  , 0, 0, 0, {255, 222, 173}},  // navajowhite
121         {"Flash Flood Watch"              , "watch",    "F Flood",    37  , 0, 0, 0, {50 , 205, 50 }},  // limegreen
122         {"Flood Watch"                    , "watch",    "Flood",      37  , 0, 0, 0, {46 , 139, 87 }},  // seagreen
123         {"Freeze Watch"                   , "watch",    "Freeze",     91  , 0, 0, 0, {65 , 105, 225}},  // royalblue
124         {"Gale Watch"                     , "watch",    "Gale",       1000, 0, 0, 0, {255, 192, 203}},  // pink
125         {"Hard Freeze Watch"              , "watch",    "H Freeze",   91  , 0, 0, 0, {65 , 105, 225}},  // royalblue
126         {"Hazardous Seas Watch"           , "watch",    "Haz Seas",   1000, 0, 0, 0, {72 , 61 , 139}},  // darkslateblue
127         {"Heavy Freezing Spray Watch"     , "watch",    "Fz Spray",   1000, 0, 0, 0, {188, 143, 143}},  // rosybrown
128         {"High Wind Watch"                , "watch",    "Wind",       86  , 0, 0, 0, {184, 134, 11 }},  // darkgoldenrod
129         {"Hurricane Force Wind Watch"     , "watch",    "Hur Wind",   1000, 0, 0, 0, {153, 50 , 204}},  // darkorchid
130         {"Hurricane Watch"                , "watch",    "Hurricane",  48  , 0, 0, 0, {255, 0  , 255}},  // magenta
131         {"Hurricane Wind Watch"           , "watch",    "Hur F Wind", 1000, 0, 0, 0, {255, 160, 122}},  // lightsalmon
132         {"Lake Effect Snow Watch"         , "watch",    "Lake Snow",  1000, 0, 0, 0, {135, 206, 250}},  // lightskyblue
133         {"Lakeshore Flood Watch"          , "watch",    "L Flood",    84  , 0, 0, 0, {102, 205, 170}},  // mediumaquamarine
134         {"Storm Watch"                    , "watch",    "Storm",      81  , 0, 0, 0, {238, 130, 238}},  // violet
135         {"Tropical Storm Watch"           , "watch",    "Trop Storm", 81  , 0, 0, 0, {240, 128, 128}},  // lightcoral
136         {"Tropical Storm Wind Watch"      , "watch",    "Trop Wind",  1000, 0, 0, 0, {240, 128, 128}},  // lightcoral
137         {"Typhoon Watch"                  , "watch",    "Typhoon",    48  , 0, 0, 0, {255, 0  , 255}},  // magenta
138         {"Wind Chill Watch"               , "watch",    "Wind Chill", 89  , 0, 0, 0, {95 , 158, 160}},  // cadetblue
139         {"Winter Storm Watch"             , "watch",    "Wntr Storm", 83  , 0, 0, 0, {70 , 130, 180}},  // steelblue
140
141         /* Statements */
142         {"Coastal Flood Statement"        , "other",    "C Flood",    97  , 0, 0, 0, {107, 142, 35 }},  // olivedrab
143         {"Flash Flood Statement"          , "other",    "F Flood",    39  , 0, 0, 1, {154, 205, 50 }},  // yellowgreen
144         {"Flood Statement"                , "other",    "Flood",      39  , 0, 0, 1, {0  , 255, 0  }},  // lime
145         {"Hurricane Statement"            , "other",    "Hurricane",  49  , 0, 0, 0, {147, 112, 219}},  // mediumpurple
146         {"Lakeshore Flood Statement"      , "other",    "L Flood",    98  , 0, 0, 0, {107, 142, 35 }},  // olivedrab
147         {"Marine Weather Statement"       , "other",    "Marine Wx",  11  , 0, 0, 1, {255, 239, 213}},  // peachpuff
148         {"Rip Current Statement"          , "other",    "Rip Curnt",  1000, 0, 0, 0, {64 , 224, 208}},  // turquoise
149         {"Severe Weather Statement"       , "other",    "Severe Wx",  38  , 0, 0, 1, {0  , 255, 255}},  // aqua
150         {"Special Weather Statement"      , "other",    "Special Wx", 99  , 0, 0, 0, {255, 228, 181}},  // moccasin
151         {"Typhoon Statement"              , "other",    "Typhoon",    49  , 0, 0, 0, {147, 112, 219}},  // mediumpurple
152
153         /* Misc */
154         {"Air Quality Alert"              , "other",    "Air Qual",   1000, 0, 0, 0, {128, 128, 128}},  // gray
155
156         {"Extreme Fire Danger"            , "other",    "Fire Dngr",  94  , 0, 0, 0, {233, 150, 122}},  // darksalmon
157
158         {"Child Abduction Emergency"      , "other",    "Child Abd",  95  , 0, 0, 0, {255, 215, 0  }},  // gold
159         {"Local Area Emergency"           , "other",    "Local",      78  , 0, 0, 0, {192, 192, 192}},  // silver
160
161         {"Short Term Forecast"            , "other",    "S Term Fc",  102 , 0, 0, 0, {152, 251, 152}},  // palegreen
162
163         {"Evacuation Immediate"           , "other",    "Evacuate",   6   , 0, 0, 0, {127, 255, 0  }},  // chartreuse
164
165         {"Administrative Message"         , "other",    "Admin",      103 , 0, 0, 0, {255, 255, 255}},  // white
166         {"Civil Emergency Message"        , "other",    "Civil Em",   7   , 0, 0, 0, {255, 182, 193}},  // lightpink
167
168         {"911 Telephone Outage"           , "other",    "911 Out",    96  , 0, 0, 0, {192, 192, 192}},  // silver
169
170         {"Hazardous Weather Outlook"      , "other",    "Haz Wx Ol",  101 , 0, 0, 0, {238, 232, 170}},  // palegoldenrod
171         {"Hydrologic Outlook"             , "other",    "Hydro Ol",   1000, 0, 0, 0, {144, 238, 144}},  // lightgreen
172
173         {"Test"                           , "other",    "Test",       104 , 0, 0, 0, {240, 255, 255}},  // azure
174
175         /* End of list */
176         {NULL, NULL, NULL, 0, 0, 0, 0, {0, 0, 0}},
177 };
178
179 AlertInfo *alert_info_find(gchar *title)
180 {
181         for (int i = 0; alert_info[i].title; i++)
182                 if (g_str_has_prefix(title, alert_info[i].title))
183                         return &alert_info[i];
184         return NULL;
185 }