/* * Copyright (C) 2010 Andy Spencer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /* Taken from: http://www.weather.gov/wwamap-prd/faq.php */ #include "alert-info.h" AlertInfo alert_info[] = { // title category abbr prio enab cur color /* Warnings */ {"Tornado Warning" , "warning", "", 0, 1, 0, {255, 0 , 0 }}, // red {"Severe Thunderstorm Warning" , "warning", "", 1, 1, 0, {255, 165, 0 }}, // orange {"Flash Flood Warning" , "warning", "", 2, 1, 0, {139, 0 , 0 }}, // darkred {"Ashfall Warning" , "warning", "", 1000, 1, 0, {169, 169, 169}}, // darkgray {"Avalanche Warning" , "warning", "", 1000, 1, 0, {30 , 144, 255}}, // dodgerblue {"Blizzard Warning" , "warning", "", 1000, 1, 0, {255, 69 , 0 }}, // orangered {"Civil Danger Warning" , "warning", "", 1000, 1, 0, {255, 182, 193}}, // lightpink {"Coastal Flood Warning" , "warning", "", 1000, 1, 0, {34 , 139, 34 }}, // forestgreen {"Dust Storm Warning" , "warning", "", 1000, 1, 0, {255, 228, 196}}, // bisque {"Earthquake Warning" , "warning", "", 1000, 1, 0, {139, 69 , 19 }}, // saddlebrown {"Excessive Heat Warning" , "warning", "", 1000, 1, 0, {199, 21 , 133}}, // mediumvioletred {"Extreme Cold Warning" , "warning", "", 1000, 1, 0, {0 , 0 , 255}}, // blue {"Extreme Wind Warning" , "warning", "", 1000, 1, 0, {255, 20 , 147}}, // deeppink {"Fire Warning" , "warning", "", 1000, 1, 0, {160, 82 , 45 }}, // sienna {"Flood Warning" , "warning", "", 1000, 1, 0, {0 , 255, 0 }}, // lime {"Freeze Warning" , "warning", "", 1000, 1, 0, {0 , 255, 255}}, // cyan {"Gale Warning" , "warning", "", 1000, 1, 0, {221, 160, 221}}, // plum {"Hard Freeze Warning" , "warning", "", 1000, 1, 0, {0 , 0 , 255}}, // blue {"Hazardous Materials Warning" , "warning", "", 1000, 1, 0, {75 , 0 , 130}}, // indigo {"Hazardous Seas Warning" , "warning", "", 1000, 1, 0, {221, 160, 221}}, // plum {"Heavy Freezing Spray Warning" , "warning", "", 1000, 1, 0, {0 , 191, 255}}, // deepskyblue {"Heavy Snow Warning" , "warning", "", 1000, 1, 0, {138, 43 , 226}}, // blueviolet {"High Surf Warning" , "warning", "", 1000, 1, 0, {34 , 139, 34 }}, // forestgreen {"High Wind Warning" , "warning", "", 1000, 1, 0, {218, 165, 32 }}, // goldenrod {"Hurricane Force Wind Warning" , "warning", "", 1000, 1, 0, {205, 92 , 92 }}, // westernred {"Hurricane Warning" , "warning", "", 1000, 1, 0, {220, 20 , 60 }}, // crimson {"Hurricane Wind Warning" , "warning", "", 1000, 1, 0, {205, 92 , 92 }}, // westernred {"Ice Storm Warning" , "warning", "", 1000, 1, 0, {139, 0 , 139}}, // darkmagenta {"Lake Effect Snow Warning" , "warning", "", 1000, 1, 0, {0 , 139, 139}}, // darkcyan {"Lakeshore Flood Warning" , "warning", "", 1000, 1, 0, {34 , 139, 34 }}, // forestgreen {"Law Enforcement Warning" , "warning", "", 1000, 1, 0, {192, 192, 192}}, // silver {"Nuclear Power Plant Warning" , "warning", "", 1000, 1, 0, {75 , 0 , 130}}, // indigo {"Radiological Hazard Warning" , "warning", "", 1000, 1, 0, {75 , 0 , 130}}, // indigo {"Red Flag Warning" , "warning", "", 1000, 1, 0, {255, 20 , 147}}, // deeppink {"Shelter In Place Warning" , "warning", "", 1000, 1, 0, {250, 128, 114}}, // salmon {"Sleet Warning" , "warning", "", 1000, 1, 0, {135, 206, 235}}, // skyblue {"Special Marine Warning" , "warning", "", 1000, 1, 0, {255, 165, 0 }}, // orange {"Storm Warning" , "warning", "", 1000, 1, 0, {148, 0 , 211}}, // darkviolet {"Tropical Storm Warning" , "warning", "", 1000, 1, 0, {178, 34 , 34 }}, // firebrick {"Tropical Storm Wind Warning" , "warning", "", 1000, 1, 0, {178, 34 , 34 }}, // firebrick {"Tsunami Warning" , "warning", "", 1000, 1, 0, {253, 99 , 71 }}, // tomato {"Typhoon Warning" , "warning", "", 1000, 1, 0, {220, 20 , 60 }}, // crimson {"Volcano Warning" , "warning", "", 1000, 1, 0, {47 , 79 , 79 }}, // darkslategray {"Wind Chill Warning" , "warning", "", 1000, 1, 0, {176, 196, 222}}, // lightsteelblue {"Winter Storm Warning" , "warning", "", 1000, 1, 0, {255, 105, 180}}, // hotpink /* Advisorys */ {"Air Stagnation Advisory" , "advisory", "", 1000, 1, 0, {128, 128, 128}}, // gray {"Ashfall Advisory" , "advisory", "", 1000, 1, 0, {105, 105, 105}}, // dimgray {"Blowing Dust Advisory" , "advisory", "", 1000, 1, 0, {189, 183, 107}}, // darkkhaki {"Blowing Snow Advisory" , "advisory", "", 1000, 1, 0, {173, 216, 230}}, // lightblue {"Brisk Wind Advisory" , "advisory", "", 1000, 1, 0, {216, 191, 216}}, // thistle {"Coastal Flood Advisory" , "advisory", "", 1000, 1, 0, {124, 252, 0 }}, // lawngreen {"Dense Fog Advisory" , "advisory", "", 1000, 1, 0, {112, 128, 144}}, // slategray {"Dense Smoke Advisory" , "advisory", "", 1000, 1, 0, {240, 230, 140}}, // khaki {"Flood Advisory" , "advisory", "", 1000, 1, 0, {0 , 255, 127}}, // springgreen {"Freezing Drizzle Advisory" , "advisory", "", 1000, 1, 0, {218, 112, 214}}, // orchid {"Freezing Fog Advisory" , "advisory", "", 1000, 1, 0, {0 , 128, 128}}, // teal {"Freezing Rain Advisory" , "advisory", "", 1000, 1, 0, {218, 112, 214}}, // orchid {"Freezing Spray Advisory" , "advisory", "", 1000, 1, 0, {0 , 191, 255}}, // deepskyblue {"Frost Advisory" , "advisory", "", 1000, 1, 0, {100, 149, 237}}, // cornflowerblue {"Heat Advisory" , "advisory", "", 1000, 1, 0, {255, 127, 80 }}, // coral {"High Surf Advisory" , "advisory", "", 1000, 1, 0, {186, 85 , 211}}, // mediumorchid {"Hydrologic Advisory" , "advisory", "", 1000, 1, 0, {0 , 255, 127}}, // springgreen {"Lake Effect Snow Advisory" , "advisory", "", 1000, 1, 0, {72 , 209, 204}}, // mediumturquoise {"Lake Effect Snow and Blowing Snow Advisory" , "advisory", "", 1000, 1, 0, {72 , 209, 204}}, // mediumturquoise {"Lake Wind Advisory" , "advisory", "", 1000, 1, 0, {210, 180, 140}}, // tan {"Lakeshore Flood Advisory" , "advisory", "", 1000, 1, 0, {124, 252, 0 }}, // lawngreen {"Low Water Advisory" , "advisory", "", 1000, 1, 0, {165, 42 , 42 }}, // brown {"Sleet Advisory" , "advisory", "", 1000, 1, 0, {123, 104, 238}}, // mediumslateblue {"Small Craft Advisory" , "advisory", "", 1000, 1, 0, {216, 191, 216}}, // thistle {"Snow and Blowing Snow Advisory" , "advisory", "", 1000, 1, 0, {176, 224, 230}}, // powderblue {"Tsunami Advisory" , "advisory", "", 1000, 1, 0, {210, 105, 30 }}, // chocolate {"Wind Advisory" , "advisory", "", 1000, 1, 0, {210, 180, 140}}, // tan {"Wind Chill Advisory" , "advisory", "", 1000, 1, 0, {175, 238, 238}}, // paleturquoise {"Winter Weather Advisory" , "advisory", "", 1000, 1, 0, {123, 104, 238}}, // mediumslateblue /* Watches */ {"Tornado Watch" , "watch", "", 1000, 1, 0, {255, 255, 0 }}, // yellow {"Severe Thunderstorm Watch" , "watch", "", 1000, 1, 0, {219, 112, 147}}, // palevioletred {"Avalanche Watch" , "watch", "", 1000, 1, 0, {244, 164, 96 }}, // sandybrown {"Blizzard Watch" , "watch", "", 1000, 1, 0, {173, 255, 47 }}, // greenyellow {"Coastal Flood Watch" , "watch", "", 1000, 1, 0, {102, 205, 170}}, // mediumaquamarine {"Excessive Heat Watch" , "watch", "", 1000, 1, 0, {128, 0 , 0 }}, // maroon {"Extreme Cold Watch" , "watch", "", 1000, 1, 0, {0 , 0 , 255}}, // blue {"Fire Weather Watch" , "watch", "", 1000, 1, 0, {255, 222, 173}}, // navajowhite {"Flash Flood Watch" , "watch", "", 1000, 1, 0, {50 , 205, 50 }}, // limegreen {"Flood Watch" , "watch", "", 1000, 1, 0, {46 , 139, 87 }}, // seagreen {"Freeze Watch" , "watch", "", 1000, 1, 0, {65 , 105, 225}}, // royalblue {"Gale Watch" , "watch", "", 1000, 1, 0, {255, 192, 203}}, // pink {"Hard Freeze Watch" , "watch", "", 1000, 1, 0, {65 , 105, 225}}, // royalblue {"Hazardous Seas Watch" , "watch", "", 1000, 1, 0, {72 , 61 , 139}}, // darkslateblue {"Heavy Freezing Spray Watch" , "watch", "", 1000, 1, 0, {188, 143, 143}}, // rosybrown {"High Wind Watch" , "watch", "", 1000, 1, 0, {184, 134, 11 }}, // darkgoldenrod {"Hurricane Force Wind Watch" , "watch", "", 1000, 1, 0, {153, 50 , 204}}, // darkorchid {"Hurricane Watch" , "watch", "", 1000, 1, 0, {255, 0 , 255}}, // magenta {"Hurricane Wind Watch" , "watch", "", 1000, 1, 0, {255, 160, 122}}, // lightsalmon {"Lake Effect Snow Watch" , "watch", "", 1000, 1, 0, {135, 206, 250}}, // lightskyblue {"Lakeshore Flood Watch" , "watch", "", 1000, 1, 0, {102, 205, 170}}, // mediumaquamarine {"Storm Watch" , "watch", "", 1000, 1, 0, {238, 130, 238}}, // violet {"Tropical Storm Watch" , "watch", "", 1000, 1, 0, {240, 128, 128}}, // lightcoral {"Tropical Storm Wind Watch" , "watch", "", 1000, 1, 0, {240, 128, 128}}, // lightcoral {"Typhoon Watch" , "watch", "", 1000, 1, 0, {255, 0 , 255}}, // magenta {"Wind Chill Watch" , "watch", "", 1000, 1, 0, {95 , 158, 160}}, // cadetblue {"Winter Storm Watch" , "watch", "", 1000, 1, 0, {70 , 130, 180}}, // steelblue /* Statements */ {"Coastal Flood Statement" , "other", "", 1000, 1, 0, {107, 142, 35 }}, // olivedrab {"Flash Flood Statement" , "other", "", 1000, 1, 0, {154, 205, 50 }}, // yellowgreen {"Flood Statement" , "other", "", 1000, 1, 0, {0 , 255, 0 }}, // lime {"Hurricane Statement" , "other", "", 1000, 1, 0, {147, 112, 219}}, // mediumpurple {"Lakeshore Flood Statement" , "other", "", 1000, 1, 0, {107, 142, 35 }}, // olivedrab {"Marine Weather Statement" , "other", "", 1000, 1, 0, {255, 239, 213}}, // peachpuff {"Rip Current Statement" , "other", "", 1000, 1, 0, {64 , 224, 208}}, // turquoise {"Severe Weather Statement" , "other", "", 1000, 1, 0, {0 , 255, 255}}, // aqua {"Special Weather Statement" , "other", "", 1000, 1, 0, {255, 228, 181}}, // moccasin {"Typhoon Statement" , "other", "", 1000, 1, 0, {147, 112, 219}}, // mediumpurple /* Misc */ {"Air Quality Alert" , "other", "", 1000, 1, 0, {128, 128, 128}}, // gray {"Extreme Fire Danger" , "other", "", 1000, 1, 0, {233, 150, 122}}, // darksalmon {"Child Abduction Emergency" , "other", "", 1000, 1, 0, {255, 215, 0 }}, // gold {"Local Area Emergency" , "other", "", 1000, 1, 0, {192, 192, 192}}, // silver {"Short Term Forecast" , "other", "", 1000, 1, 0, {152, 251, 152}}, // palegreen {"Evacuation Immediate" , "other", "", 1000, 1, 0, {127, 255, 0 }}, // chartreuse {"Administrative Message" , "other", "", 1000, 1, 0, {255, 255, 255}}, // white {"Civil Emergency Message" , "other", "", 1000, 1, 0, {255, 182, 193}}, // lightpink {"911 Telephone Outage" , "other", "", 1000, 1, 0, {192, 192, 192}}, // silver {"Hazardous Weather Outlook" , "other", "", 1000, 1, 0, {238, 232, 170}}, // palegoldenrod {"Hydrologic Outlook" , "other", "", 1000, 1, 0, {144, 238, 144}}, // lightgreen {"Test" , "other", "", 1000, 1, 0, {240, 255, 255}}, // azure /* End of list */ {NULL, NULL, NULL, 0, 0, 0, {0, 0, 0}}, }; AlertInfo *alert_info_find(gchar *title) { for (int i = 0; alert_info[i].title; i++) if (g_str_has_prefix(title, alert_info[i].title)) return &alert_info[i]; return NULL; }