cairo_t *ct;
#endif
+ GtkMenu *menu;
+
PangoContext *context;
PangoLayout *layout;
PangoFontDescription *fontdesc;
gboolean show_velvec;
gboolean show_markers;
gboolean show_speed;
+ gboolean click_to_center;
+ gboolean zoom_in_on_2button;
gboolean rotate_view;
gfloat rotate_angle;
priv->show_markers=TRUE;
priv->show_location=TRUE;
+priv->click_to_center=FALSE;
+priv->zoom_in_on_2button=FALSE;
+
priv->rotate_angle=M_PI;
priv->rotate_view=FALSE;
g_print("OpenGL version: %s\n", glGetString (GL_VERSION));
g_print("OpenGL vendor: %s\n", glGetString (GL_VENDOR));
g_print("OpenGL renderer: %s\n", glGetString (GL_RENDERER));
- gtk_widget_set_gl_capability(widget->window, priv->gl_config, NULL, TRUE, GDK_GL_RGBA_TYPE);
+ gtk_widget_set_gl_capability(widget, priv->gl_config, NULL, TRUE, GDK_GL_RGBA_TYPE);
priv->gl=TRUE;
}
#endif
map=GTK_MAP(widget);
priv=GTK_MAP_GET_PRIVATE(map);
+gc=priv->gc_waypoint;
+
if ((x1 > priv->buf_width_pixels) || (y1 > priv->buf_height_pixels))
return;
gdk_draw_arc(widget->window, gc, FALSE, x1 - priv->draw_width, y1 - priv->draw_width, 2 * priv->draw_width, 2 * priv->draw_width, 0, 360 * 64);
map=GTK_MAP(widget);
priv=GTK_MAP_GET_PRIVATE(map);
priv->paths=g_slist_remove(priv->paths, path);
+return TRUE;
}
static void
gtk_map_set_center(widget, priv->center.unitx + delta_x*GTK_MAP_PAN_UNITS, priv->center.unity + delta_y*GTK_MAP_PAN_UNITS);
}
-static void
+void
gtk_map_refresh(GtkWidget *widget)
{
GtkMap *map;
GtkMap *map;
GtkMapPriv *priv;
-g_return_if_fail(GTK_IS_MAP(widget));
+g_return_val_if_fail(GTK_IS_MAP(widget), FALSE);
map=GTK_MAP(widget);
priv=GTK_MAP_GET_PRIVATE(map);
static gboolean
gtk_map_button_press_cb(GtkWidget *widget, GdkEventButton *event)
{
+GtkMap *map;
+GtkMapPriv *priv;
+
+g_return_val_if_fail(GTK_IS_MAP(widget), FALSE);
+map=GTK_MAP(widget);
+priv=GTK_MAP_GET_PRIVATE(map);
+switch (event->button) {
+case 1:
+ if (priv->click_to_center) {
+ gtk_map_set_center(widget, x2unit((gint) (event->x+0.5)), y2unit((gint) (event->y+0.5)));
+ return FALSE;
+ } else if (event->type==GDK_2BUTTON_PRESS) {
+ gtk_map_set_center(widget, x2unit((gint) (event->x+0.5)), y2unit((gint) (event->y+0.5)));
+ if (priv->zoom_in_on_2button)
+ gtk_map_zoom_in(widget);
+ return FALSE;
+ }
+break;
+case 2:
+
+break;
+case 3:
+ if (priv->menu)
+ gtk_menu_popup(GTK_MENU(priv->menu), NULL, NULL, NULL, NULL, event->button, gtk_get_current_event_time());
+break;
+}
return FALSE;
}
static gboolean
gtk_map_button_release_cb(GtkWidget *widget, GdkEventButton *event)
{
+GtkMap *map;
+GtkMapPriv *priv;
+g_return_val_if_fail(GTK_IS_MAP(widget), FALSE);
+map=GTK_MAP(widget);
+priv=GTK_MAP_GET_PRIVATE(map);
+
+switch (event->button) {
+case 1:
+
+break;
+case 2:
+
+break;
+case 3:
+
+break;
+}
return FALSE;
}