Top | ![]() |
![]() |
![]() |
![]() |
#define | VIK_VIEWPORT_TYPE |
#define | VIK_VIEWPORT_MAX_ZOOM |
#define | VIK_VIEWPORT_MIN_ZOOM |
#define | VIK_VIEWPORT_UTM_WRONG_ZONE |
#define | VIK_VIEWPORT_OFF_SCREEN_DOUBLE |
enum | VikViewportDrawMode |
GEnum ╰── VikViewportDrawMode GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkDrawingArea ╰── VikViewport
void vik_viewport_configure_manually (VikViewport *vvp
,gint width
,guint height
);
void vik_viewport_screen_to_coord (VikViewport *vvp
,int x
,int y
,VikCoord *coord
);
void vik_viewport_coord_to_screen (VikViewport *vvp
,const VikCoord *coord
,int *x
,int *y
);
void vik_viewport_set_center_coord (VikViewport *vvp
,const VikCoord *coord
,gboolean save_position
);
void vik_viewport_set_center_screen (VikViewport *vvp
,int x
,int y
);
void vik_viewport_center_for_zonen (VikViewport *vvp
,struct UTM *center
,int zone
);
void vik_viewport_set_center_utm (VikViewport *vvp
,const struct UTM *utm
,gboolean save_position
);
void vik_viewport_set_center_latlon (VikViewport *vvp
,const struct LatLon *ll
,gboolean save_position
);
void vik_viewport_corners_for_zonen (VikViewport *vvp
,int zone
,VikCoord *ul
,VikCoord *br
);
void vik_viewport_get_min_max_lat_lon (VikViewport *vp
,gdouble *min_lat
,gdouble *max_lat
,gdouble *min_lon
,gdouble *max_lon
);
gboolean
vik_viewport_go_back (VikViewport *vvp
);
Move back in the position history
gboolean
vik_viewport_go_forward (VikViewport *vvp
);
Move forward in the position history
const gchar * vik_viewport_get_drawmode_name (VikViewport *vv
,VikViewportDrawMode mode
);
void vik_viewport_set_drawmode (VikViewport *vvp
,VikViewportDrawMode drawmode
);
void vik_viewport_set_half_drawn (VikViewport *vp
,gboolean half_drawn
);
void vik_viewport_draw_pixbuf (VikViewport *vvp
,GdkPixbuf *pixbuf
,gint src_x
,gint src_y
,gint dest_x
,gint dest_y
,gint w
,gint h
);
void vik_viewport_add_copyright (VikViewport *vp
,const gchar *copyright
);
Add a copyright to display on viewport.
void vik_viewport_set_draw_scale (VikViewport *vvp
,gboolean draw_scale
);
Enable/Disable display of scale.
void vik_viewport_set_draw_centermark (VikViewport *vvp
,gboolean draw_centermark
);
Enable/Disable display of center mark.
void vik_viewport_set_draw_highlight (VikViewport *vvp
,gboolean draw_highlight
);
void vik_viewport_set_background_color (VikViewport *vvp
,const gchar *color
);
const gchar *
vik_viewport_get_background_color (VikViewport *vvp
);
GdkColor
vik_viewport_get_background_gdkcolor (VikViewport *vvp
);
void vik_viewport_set_background_gdkcolor (VikViewport *vvp
,GdkColor color
);
GdkGC * vik_viewport_new_gc (VikViewport *vvp
,const gchar *colorname
,gint thickness
);
GdkGC * vik_viewport_new_gc_from_color (VikViewport *vvp
,GdkColor *color
,gint thickness
);
void vik_viewport_set_highlight_color (VikViewport *vvp
,const gchar *color
);
const gchar *
vik_viewport_get_highlight_color (VikViewport *vvp
);
GdkColor
vik_viewport_get_highlight_gdkcolor (VikViewport *vvp
);
void vik_viewport_set_highlight_gdkcolor (VikViewport *vvp
,GdkColor color
);
void vik_viewport_set_highlight_thickness (VikViewport *vvp
,gint thickness
);
void a_viewport_clip_line (gint *x1
,gint *y1
,gint *x2
,gint *y2
);
Due to the seemingly undocumented behaviour of gdk_draw_line()
, we need to restrict the range of values passed in.
So despite it accepting gints, the effective range seems to be the actually the minimum C int range (2^16).
This seems to be limitations coming from the X Window System.
See http://www.rahul.net/kenton/40errs.html ERROR 7. Boundary conditions. "The X coordinate space is not infinite. Most drawing functions limit position, width, and height to 16 bit integers (sometimes signed, sometimes unsigned) of accuracy. Because most C compilers use 32 bit integers, Xlib will not complain if you exceed the 16 bit limit, but your results will usually not be what you expected. You should be especially careful of this if you are implementing higher level scalable graphics packages."
This function should be called before calling gdk_draw_line()
.
void vik_viewport_draw_line (VikViewport *vvp
,GdkGC *gc
,gint x1
,gint y1
,gint x2
,gint y2
,GdkColor *gcolor
,guint thickness
);
void vik_viewport_draw_rectangle (VikViewport *vvp
,GdkGC *gc
,gboolean filled
,gint x1
,gint y1
,gint x2
,gint y2
,GdkColor *gcolor
);
void vik_viewport_draw_arc (VikViewport *vvp
,GdkGC *gc
,gboolean filled
,gint x
,gint y
,gint width
,gint height
,gint angle1
,gint angle2
,GdkColor *gcolor
);
void vik_viewport_draw_polygon (VikViewport *vvp
,GdkGC *gc
,gboolean filled
,GdkPoint *points
,gint npoints
,GdkColor *gcolor
);
void vik_viewport_draw_layout (VikViewport *vvp
,GdkGC *gc
,gint x
,gint y
,PangoLayout *layout
,GdkColor *gcolor
);
“updated-center”
signalvoid user_function (VikViewport *vikviewport, gpointer user_data)
Flags: Action