forked from maximuska/Freemap-waze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroadmap_alerter.h
75 lines (67 loc) · 2.91 KB
/
roadmap_alerter.h
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
/* roadmap_alerter.h - Handles the alerting of users about nearby alerts
*
* LICENSE:
*
* Copyright 2008 Avi B.S
* Copyright 2008 Ehud Shabtai
*
* This file is part of RoadMap.
*
* RoadMap 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 2 of the License, or
* (at your option) any later version.
*
* RoadMap 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 RoadMap; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _ROADMAP_ALERTS__H_
#define _ROADMAP_ALERTS__H_
#include "roadmap_gps.h"
#include "roadmap_sound.h"
#include "roadmap_plugin.h"
typedef int (*roadmap_alerts_count) (void);
typedef int (*roadmap_alerts_get_alert_id) (int alert);
typedef void (*roadmap_alerts_get_position)(int alert, RoadMapPosition *position, int *steering) ;
typedef unsigned int (*roadmap_alerts_get_speed)(int alert);
typedef const char * (*roadmap_alerts_get_map_icon)(int alertId);
typedef const char * (*roadmap_alerts_get_alert_icon)(int alertId);
typedef const char * (*roadmap_alerts_get_warning_icon)(int alertId);
typedef int (*roadmap_alerts_get_distance)(int alert);
typedef RoadMapSoundList (*roadmap_alerts_get_sound)(int alertId);
typedef int (*roadmap_alerts_is_alertable)(int alert);
typedef const char * (*roadmap_alerts_get_string)(int alertId);
typedef int (*roadmap_alerts_is_cancelable)(int alert);
typedef int (*roadmap_alerts_cancel)(int alert) ;
typedef struct {
char *name;
roadmap_alerts_count count;
roadmap_alerts_get_alert_id get_id;
roadmap_alerts_get_position get_position;
roadmap_alerts_get_speed get_speed;
roadmap_alerts_get_map_icon get_map_icon;
roadmap_alerts_get_alert_icon get_alert_icon;
roadmap_alerts_get_warning_icon get_warning_icon;
roadmap_alerts_get_distance get_distance;
roadmap_alerts_get_sound get_sound;
roadmap_alerts_is_alertable is_alertable;
roadmap_alerts_get_string get_string;
roadmap_alerts_is_cancelable is_cancelable;
roadmap_alerts_cancel cancel;
} roadmap_alert_providor;
typedef struct {
roadmap_alert_providor *providor[20];
int count;
} roadmap_alert_providors;
void roadmap_alerter_initialize(void) ;
int roadmap_alerter_get_active_alert_id();
void roadmap_alerter_register(roadmap_alert_providor *providor);
void roadmap_alerter_check(const RoadMapGpsPosition *gps_position, const PluginLine *line);
void roadmap_alerter_display();
#endif //_ROADMAP_ALERTS__H_