gui_internal_cmd_formerdests(struct gui_priv *this, char *function, struct attr **in, struct attr ***out, int *valid)
{
struct widget *wb,*w,*wbm;
+ struct map *formerdests;
+ struct map_rect *mr_formerdests;
+ struct item *item;
+ struct attr attr;
+ char *label_full;
+ enum projection projection;
+ int formerdests_available=0;
+
gui_internal_prune_menu_count(this, 1, 0);
wb=gui_internal_menu(this, _("Former Destinations"));
wb->background=this->background;
w->spy=this->spacing*2;
gui_internal_widget_append(wb, w);
- struct map* formerdests=read_former_destinations_from_file();
- struct map_rect *mr_formerdests=map_rect_new(formerdests, NULL);
- struct item* item;
- struct attr attr;
- char* label_full;
- enum projection projection = map_projection(formerdests);
- int formerdests_available=0;
+ formerdests=read_former_destinations_from_file();
+ mr_formerdests=map_rect_new(formerdests, NULL);
+ projection = map_projection(formerdests);
while ((item=map_rect_get_item(mr_formerdests))) {
+ struct coord c;
formerdests_available=1;
if (!item_attr_get(item, attr_label, &attr)) continue;
label_full=attr.u.str;
gravity_left_center|orientation_horizontal|flags_fill,
gui_internal_cmd_position, NULL);
gui_internal_widget_prepend(w, wbm);
- struct coord c;
if (item_coord_get(item, &c, 1)) {
wbm->c.x=c.x;
wbm->c.y=c.y;
{
char* input = the_ctx->expr;
char *sym;
+ enum operator_t op;
sym = get_op(input,"&&","||","^",NULL);
- enum operator_t op = get_operator_by_symbol(sym);
+ op = get_operator_by_symbol(sym);
switch(op) {
case OP_LOGICAL_AND:
case OP_LOGICAL_OR:
{
char* input = the_ctx->expr;
char *sym;
+ enum operator_t op;
sym = get_op(input, "==", "<", ">", "<=", ">=", "!=", NULL);
- enum operator_t op = get_operator_by_symbol(sym);
+ op = get_operator_by_symbol(sym);
switch(op) {
case OP_EQ:
case OP_GT:
{
char* input = the_ctx->expr;
char *sym;
+ enum operator_t op;
sym = get_op(input, "*", "/", "%", NULL);
- enum operator_t op = get_operator_by_symbol(sym);
+ op = get_operator_by_symbol(sym);
switch(op) {
case OP_MUL:
case OP_DIV:
{
char* input = the_ctx->expr;
char *sym;
+ enum operator_t op;
sym = get_op(input, "+", "-", NULL);
- enum operator_t op = get_operator_by_symbol(sym);
+ op = get_operator_by_symbol(sym);
switch(op) {
case OP_ADD:
case OP_SUB:
//expect cond operand
if(parse_string_operand(&sub_ctx)) {
char* op1 = sub_ctx.res.res_str;
+ enum operator_t op;
+
//expect cond operand
sub_ctx.expr = next_sym_ptr;
- enum operator_t op;
if( (op=parse_cond_operator(&sub_ctx)) ) {
next_sym_ptr += whitespace_num(next_sym_ptr) + strlen(get_opstr_by_op(op));
sub_ctx.expr = next_sym_ptr;
char* dist_str;
struct graphics_gc *curr_color;
int imperial=0;
+ double min_dist;
//do not execute for each gps update
gettimeofday(&tv,NULL);
}
transform_from_geo(projection_mg, position_attr.u.coord_geo, &curr_coord);
- double min_dist = 1000000;
+ min_dist = 1000000;
//calculate min dist
if(this->coord_num > 1) {
double scale = transform_scale(curr_coord.y);
{
struct route_guard *this = g_new0(struct route_guard, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+
+ opc->data = (void*)this;
opc->osd_item.p.x = 120;
opc->osd_item.p.y = 20;
opc->osd_item.w = 60;
struct odometer *this = g_new0(struct odometer, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
struct color orange_color={0xffff,0xa5a5,0x0000,0xffff};
+
+ opc->data = (void*)this;
opc->osd_item.p.x = 120;
opc->osd_item.p.y = 20;
opc->osd_item.w = 60;
{
struct cmd_interface *this = g_new0(struct cmd_interface, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
opc->osd_item.p.x = 120;
opc->osd_item.p.y = 20;
opc->osd_item.w = 60;
{
struct stopwatch *this = g_new0(struct stopwatch, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
struct color orange_color={0xffff,0xa5a5,0x0000,0xffff};
+ opc->data = (void*)this;
opc->osd_item.p.x = 120;
opc->osd_item.p.y = 20;
opc->osd_item.w = 60;
{
struct compass *this = g_new0(struct compass, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+
+ opc->data = (void*)this;
opc->osd_item.p.x = 20;
opc->osd_item.p.y = 20;
opc->osd_item.w = 60;
{
struct osd_button *this = g_new0(struct osd_button, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
opc->osd_item.navit = nav;
opc->osd_item.meth.draw = osd_draw_cast(osd_button_draw);
{
struct osd_image *this = g_new0(struct osd_image, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
opc->osd_item.navit = nav;
opc->osd_item.meth.draw = osd_draw_cast(osd_image_draw);
meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr;
{
struct nav_next_turn *this = g_new0(struct nav_next_turn, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
opc->osd_item.p.x = 20;
opc->osd_item.p.y = -80;
opc->osd_item.w = 70;
{
struct nav_toggle_announcer *this = g_new0(struct nav_toggle_announcer, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
struct attr *attr;
char *command = "announcer_toggle()";
+ opc->data = (void*)this;
opc->osd_item.w = 48;
opc->osd_item.h = 48;
opc->osd_item.p.x = -64;
struct osd_speed_cam *this = g_new0(struct osd_speed_cam, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+
+ opc->data = (void*)this;
opc->osd_item.p.x = 120;
opc->osd_item.p.y = 20;
opc->osd_item.w = 60;
{
struct osd_speed_warner *this=g_new0(struct osd_speed_warner, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+
+ opc->data = (void*)this;
opc->osd_item.p.x=-80;
opc->osd_item.p.y=20;
opc->osd_item.w=60;
{
struct osd_text *this = g_new0(struct osd_text, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
opc->osd_item.p.x = -80;
opc->osd_item.p.y = 20;
opc->osd_item.w = 60;
{
struct gps_status *this = g_new0(struct gps_status, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
opc->osd_item.p.x = 20;
opc->osd_item.p.y = -80;
opc->osd_item.w = 60;
{
struct volume *this = g_new0(struct volume, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
opc->osd_item.p.x = 20;
opc->osd_item.p.y = -80;
opc->osd_item.w = 60;
{
struct osd_scale *this = g_new0(struct osd_scale, 1);
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
- opc->data = (void*)this;
-
struct attr *attr;
+ opc->data = (void*)this;
+
opc->osd_item.navit = nav;
opc->osd_item.meth.draw = osd_draw_cast(osd_scale_draw);
meth->set_attr = (void (*)(struct osd_priv *osd, struct attr* attr))set_std_osd_attr;