cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h event.h \
file.h graphics.h gtkext.h gui.h item.h item_def.h keys.h log.h layer.h layout.h linguistics.h main.h map-share.h map.h\
map_data.h mapset.h maptype.h menu.h messages.h navigation.h navit.h osd.h \
- param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h roadprofile.h search.h speech.h \
+ param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h roadprofile.h search.h speech.h start_real.h \
transform.h track.h util.h vehicle.h vehicleprofile.h window.h xmlconfig.h zipfile.h \
navit_nls.h
return attr_none;
}
+
+static int attr_match(enum attr_type search, enum attr_type found);
+
+
+
char *
attr_to_name(enum attr_type attr)
{
return NULL;
}
-int
+static int
attr_match(enum attr_type search, enum attr_type found)
{
switch (search) {
} u;
};
+struct attr_iter {
+ union {
+ GList *list;
+ struct mapset_handle *mapset_handle;
+ } u;
+};
+
/* prototypes */
-enum attr_type;
-struct attr;
-struct attr_iter;
-struct map;
enum attr_type attr_from_name(const char *name);
char *attr_to_name(enum attr_type attr);
struct attr *attr_new_from_text(const char *name, const char *value);
int id;
char *ret;
dbg(0,"enter %s\n", type);
- id=(int)g_hash_table_lookup(object_count, type);
- g_hash_table_insert(object_count, type, (void *)(id+1));
+ id=GPOINTER_TO_INT(g_hash_table_lookup(object_count, type));
+ g_hash_table_insert(object_count, type, GINT_TO_POINTER((id+1)));
ret=g_strdup_printf("%s/%s/%d", object_path, type, id);
g_hash_table_insert(object_hash, ret, object);
dbg(0,"return %s\n", ret);
dbg(0, "string detected\n");
if(navit_get_attr(navit, attr.type, &attr, NULL)) {
dbg(0, "%s = %s\n", attr_type, &attr.u.layout);
- return reply_simple_as_variant(connection, message, &attr.u.layout, DBUS_TYPE_STRING);
+ return reply_simple_as_variant(connection, message, GPOINTER_TO_INT(&attr.u.layout), DBUS_TYPE_STRING);
}
}
return ret;
}
-static int
+/*static int
is_int(struct result *res)
{
return 1;
-}
+}*/
static int
is_double(struct result *res)
ret+=str-c_str;
if (debug) {
printf("args=%d\n", args);
- printf("ret=%d delta=%d ret_str='%s'\n", ret, str-c_str, c_str+ret);
+ printf("ret=%d delta=%d ret_str='%s'\n", ret, GPOINTER_TO_INT(str-c_str), c_str+ret);
}
out:
if (proj)
#define NAVIT_CURSOR_H
/* prototypes */
-struct color;
-struct cursor;
-struct graphics;
-struct point;
void cursor_draw(struct cursor *this_, struct graphics *gra, struct point *pnt, int lazy, int dir, int speed);
int cursor_add_attr(struct cursor *this_, struct attr *attr);
struct cursor *cursor_new(struct attr *parent, struct attr **attrs);
static void
debug_update_level(gpointer key, gpointer value, gpointer user_data)
{
- if (debug_level < (int) value)
- debug_level=(int) value;
+ if (debug_level < GPOINTER_TO_INT(value))
+ debug_level = GPOINTER_TO_INT(value);
}
void
-debug_level_set(const char *name, int level)
+debug_level_set(const char *name, gint level)
{
if (!strcmp(name, "segv")) {
segv_level=level;
timestamp_prefix=level;
} else {
debug_level=0;
- g_hash_table_insert(debug_hash, g_strdup(name), (gpointer) level);
+ g_hash_table_insert(debug_hash, g_strdup(name), GINT_TO_POINTER(level));
g_hash_table_foreach(debug_hash, debug_update_level, NULL);
}
}
{
if (!debug_hash)
return 0;
- return (int)(g_hash_table_lookup(debug_hash, name));
+ return GPOINTER_TO_INT(g_hash_table_lookup(debug_hash, name));
}
static void debug_timestamp(FILE *fp)
{
struct event_watch *ret=g_new0(struct event_watch, 1);
int flags=0;
- ret->iochan = g_io_channel_unix_new((int)fd);
+ ret->iochan = g_io_channel_unix_new(GPOINTER_TO_INT(fd));
switch (cond) {
case event_watch_cond_read:
flags=G_IO_IN;
void *
file_get_os_handle(struct file *file)
{
- return (void *)(file->fd);
+ return GINT_TO_POINTER(file->fd);
}
void
};
/* prototypes */
-enum file_flags;
-struct file;
-struct file_wordexp;
-struct param_list;
struct file *file_create(char *name, enum file_flags flags);
int file_is_dir(char *name);
long long file_size(struct file *file);
displayitem_hash(gconstpointer key)
{
const struct displayitem *di=key;
- return (di->item.id_hi^di->item.id_lo^((int) di->item.map));
+ return (di->item.id_hi^di->item.id_lo^(GPOINTER_TO_INT(di->item.map)));
}
static gboolean
gra->width=widget->allocation.width;
gra->height=widget->allocation.height;
gra->drawable = gdk_pixmap_new(widget->window, gra->width, gra->height, -1);
- callback_list_call_attr_2(gra->cbl, attr_resize, (void *)gra->width, (void *)gra->height);
+ callback_list_call_attr_2(gra->cbl, attr_resize, GINT_TO_POINTER(gra->width), GINT_TO_POINTER(gra->height));
return TRUE;
}
}
p.x=event->x;
p.y=event->y;
- callback_list_call_attr_3(this->cbl, attr_button, (void *)1, (void *)event->button, (void *)&p);
+ callback_list_call_attr_3(this->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(event->button), (void *)&p);
return FALSE;
}
}
p.x=event->x;
p.y=event->y;
- callback_list_call_attr_3(this->cbl, attr_button, (void *)0, (void *)event->button, (void *)&p);
+ callback_list_call_attr_3(this->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(event->button), (void *)&p);
return FALSE;
}
break;
}
if (button != -1) {
- callback_list_call_attr_3(this->cbl, attr_button, (void *)1, (void *)button, (void *)&p);
- callback_list_call_attr_3(this->cbl, attr_button, (void *)0, (void *)button, (void *)&p);
+ callback_list_call_attr_3(this->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(button), (void *)&p);
+ callback_list_call_attr_3(this->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(button), (void *)&p);
}
return FALSE;
}
this->overlay_autodisabled = 0;
}
- callback_list_call_attr_2(this->cbl, attr_resize, (void *)this->width, (void *)this->height);
+ callback_list_call_attr_2(this->cbl, attr_resize, GINT_TO_POINTER(this->width), GINT_TO_POINTER(this->height));
}
}
item_hash_hash(gconstpointer key)
{
const struct item *itm=key;
- gconstpointer hashkey=(gconstpointer)(itm->id_hi^itm->id_lo^((int) itm->map));
+ gconstpointer hashkey=(gconstpointer)GINT_TO_POINTER(itm->id_hi^itm->id_lo^(GPOINTER_TO_INT(itm->map)));
return g_direct_hash(hashkey);
}
#include "item.h"
#include "color.h"
-struct element_line;
-struct element_text;
-
struct element {
enum { element_point, element_polyline, element_polygon, element_circle, element_text, element_icon, element_image, element_arrows } type;
struct color color;
GList *elements;
};
-struct color;
-
struct layer { char *name; int details; GList *itemgras; };
struct layout { char *name; char *font; struct color color; GList *layers; int order_delta; };
/* prototypes */
-enum item_type;
-struct element;
-struct itemgra;
-struct layer;
-struct layout;
struct layout *layout_new(struct attr *parent, struct attr **attrs);
int layout_add_attr(struct layout *layout, struct attr *attr);
struct layer *layer_new(struct attr *parent, struct attr **attrs);
struct gui *main_loop_gui;
-struct attr_iter {
- union {
- GList *list;
- struct mapset_handle *mapset_handle;
- } u;
-};
-
static void navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv);
static void navit_vehicle_draw(struct navit *this_, struct navit_vehicle *nv, struct point *pnt);
static int navit_add_vehicle(struct navit *this_, struct vehicle *v);
{
int border=16;
- callback_list_call_attr_4(this_->attr_cbl, attr_button, this_, (void *)pressed, (void *)button, p);
+ callback_list_call_attr_4(this_->attr_cbl, attr_button, this_, GINT_TO_POINTER(pressed), GINT_TO_POINTER(button), p);
if (this_->ignore_button) {
this_->ignore_button=0;
return 0;
return g_strdup_printf("%.0f%skm/h", speed, sep);
}
-static char *
+/*static char *
format_float(double num)
{
return g_strdup_printf("%f", num);
-}
+}*/
static char *
format_float_0(double num)
search_item_hash_hash(gconstpointer key)
{
const struct item *itm=key;
- gconstpointer hashkey=(gconstpointer)(itm->id_hi^itm->id_lo);
+ gconstpointer hashkey=(gconstpointer)GINT_TO_POINTER(itm->id_hi^itm->id_lo);
return g_direct_hash(hashkey);
}
* Boston, MA 02110-1301, USA.
*/
+#include "start_real.h"
+
int
main(int argc, char **argv)
{
#include "xmlconfig.h"
#include "file.h"
#include "search.h"
+#include "start_real.h"
+#include "linguistics.h"
#include "navit_nls.h"
#include "atom.h"
#ifdef HAVE_API_WIN32_CE
--- /dev/null
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2009 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef NAVIT_MAIN_REAL_H
+#define NAVIT_MAIN_REAL_H
+
+int main_real(int argc, char **argv);
+
+#endif
struct attr_iter *
vehicle_attr_iter_new(void)
{
- return g_new0(void *,1);
+ return g_new0(struct attr_iter,1);
}
void
#ifdef __cplusplus
extern "C" {
#endif
-struct vehicle;
+
struct vehicle_priv;
-enum attr_type;
-struct attr;
-struct attr_iter;
struct vehicle_methods {
void (*destroy)(struct vehicle_priv *priv);
};
+
/* prototypes */
struct vehicle *vehicle_new(struct attr *parent, struct attr **attrs);
struct attr_iter *vehicle_attr_iter_new(void);
void vehicle_destroy(struct vehicle *this_);
void vehicle_attr_iter_destroy(struct attr_iter *iter);
/* end of prototypes */
+
#ifdef __cplusplus
}
#endif
*/
struct vehicleprofile {
- int mode; /**< 0 = Auto, 1 = On-Road, 2 = Off-Road */
- int flags_forward_mask; /**< Flags mask for moving in positive direction */
- int flags_reverse_mask; /**< Flags mask for moving in reverse direction */
- int flags; /**< Required flags to move through a segment */
- int maxspeed_handling; /**< 0 = Always, 1 = Only if lower, 2 = Never */
- int static_speed; /**< Maximum speed of vehicle to consider it stationary */
- int static_distance; /**< Maximum distance of previous position of vehicle to consider it stationary */
- char *name; // the vehicle profile name
+ int mode; /**< 0 = Auto, 1 = On-Road, 2 = Off-Road */
+ int flags_forward_mask; /**< Flags mask for moving in positive direction */
+ int flags_reverse_mask; /**< Flags mask for moving in reverse direction */
+ int flags; /**< Required flags to move through a segment */
+ int maxspeed_handling; /**< 0 = Always, 1 = Only if lower, 2 = Never */
+ int static_speed; /**< Maximum speed of vehicle to consider it stationary */
+ int static_distance; /**< Maximum distance of previous position of vehicle to consider it stationary */
+ char *name; // the vehicle profile name
struct attr **attrs;
GHashTable *roadprofile_hash;
};