Add:Core:Added parameter wraparound for overlay
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 13 Nov 2008 15:21:58 +0000 (15:21 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 13 Nov 2008 15:21:58 +0000 (15:21 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@1723 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/cursor.c
navit/graphics.c
navit/graphics.h
navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
navit/osd/core/osd_core.c

index 13dc210..970584f 100644 (file)
@@ -118,7 +118,7 @@ cursor_draw(struct cursor *this_, struct graphics *gra, struct point *pnt, int l
        this_->speed=speed;
        if (!this_->gra) {
                struct color c;
-               this_->gra=graphics_overlay_new(gra, &this_->cursor_pnt, this_->w, this_->h, 65535);
+               this_->gra=graphics_overlay_new(gra, &this_->cursor_pnt, this_->w, this_->h, 65535, 0);
                if (this_->gra) {
                        this_->bg=graphics_gc_new(this_->gra);
                        c.r=0; c.g=0; c.b=0; c.a=0;
index d2faf4c..e38ef31 100644 (file)
@@ -116,13 +116,13 @@ int graphics_get_attr(struct graphics *this_, enum attr_type type, struct attr *
  * @returns <>
  * @author Martin Schaller (04/2008)
 */
-struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha)
+struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha, int wraparound)
 {
        struct graphics *this_;
        if (!parent->meth.overlay_new)
                return NULL;
        this_=g_new0(struct graphics, 1);
-       this_->priv=parent->meth.overlay_new(parent->priv, &this_->meth, p, w, h, alpha);
+       this_->priv=parent->meth.overlay_new(parent->priv, &this_->meth, p, w, h, alpha, wraparound);
        if (!this_->priv) {
                g_free(this_);
                this_=NULL;
index 2370461..9ff2d4b 100644 (file)
@@ -60,7 +60,7 @@ struct graphics_methods {
        struct graphics_font_priv *(*font_new)(struct graphics_priv *gr, struct graphics_font_methods *meth, char *font,  int size, int flags);
        struct graphics_gc_priv *(*gc_new)(struct graphics_priv *gr, struct graphics_gc_methods *meth);
        void (*background_gc)(struct graphics_priv *gr, struct graphics_gc_priv *gc);
-       struct graphics_priv *(*overlay_new)(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int alpha);
+       struct graphics_priv *(*overlay_new)(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int alpha, int wraparound);
        struct graphics_image_priv *(*image_new)(struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation);
        void *(*get_data)(struct graphics_priv *gr, char *type);
        void (*image_free)(struct graphics_priv *gr, struct graphics_image_priv *priv);
@@ -124,7 +124,7 @@ struct callback;
 struct itemgra;
 struct graphics *graphics_new(struct attr *parent, struct attr **attrs);
 int graphics_get_attr(struct graphics *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
-struct graphics *graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha);
+struct graphics *graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha, int wraparound);
 void graphics_init(struct graphics *this_);
 void *graphics_get_data(struct graphics *this_, char *type);
 void graphics_add_callback(struct graphics *this_, struct callback *cb);
index 5ab8f05..595508f 100644 (file)
@@ -731,7 +731,7 @@ overlay_disable(struct graphics_priv *gr, int disabled)
 }
 
 static struct graphics_priv *
-overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int alpha)
+overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int alpha, int wraparound)
 {
        struct graphics_priv *this=graphics_gtk_drawing_area_new_helper(meth);
        this->drawable=gdk_pixmap_new(gr->widget->window, w, h, -1);
index e336dbd..12d9fad 100644 (file)
@@ -592,7 +592,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
 //# Comment: 
 //# Authors: Martin Schaller (04/2008)
 //##############################################################################################################
-static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int alpha);
+static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int alpha, int wraparound);
 
 static int argc=1;
 static char *argv[]={(char *)"navit",NULL};
@@ -693,7 +693,7 @@ static struct graphics_methods graphics_methods = {
 //# Comment: 
 //# Authors: Martin Schaller (04/2008)
 //##############################################################################################################
-static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int alpha)
+static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int alpha,int wraparound)
 {
        *meth=graphics_methods;
        return NULL;
index 50920f8..489e12a 100644 (file)
@@ -152,7 +152,7 @@ osd_compass_init(struct compass *this, struct navit *nav)
        struct graphics *navit_gr;
        struct color c;
        navit_gr=navit_get_graphics(nav);
-       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535);
+       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535, 1);
 
        this->bg=graphics_gc_new(this->gr);
        c.r=0; c.g=0; c.b=0; c.a=32767;
@@ -306,7 +306,7 @@ osd_eta_init(struct eta *this, struct navit *nav)
        struct color c;
        char *flag=g_strjoin(NULL,getenv("NAVIT_SHAREDIR"), "/xpm/flag_wh_bk.xpm", NULL);
        navit_gr=navit_get_graphics(nav);
-       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535);
+       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535, 1);
 
        this->bg=graphics_gc_new(this->gr);
        c.r=0; c.g=0; c.b=0; c.a=32767;
@@ -442,7 +442,7 @@ osd_navigation_init(struct osd_navigation *this, struct navit *nav)
        struct graphics *navit_gr;
        struct color c;
        navit_gr=navit_get_graphics(nav);
-       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535);
+       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535, 1);
 
        this->bg=graphics_gc_new(this->gr);
        c.r=0; c.g=0; c.b=0; c.a=32767;
@@ -577,7 +577,7 @@ osd_street_name_init(struct osd_street_name *this, struct navit *nav)
        struct color c;
        navit_gr=navit_get_graphics(nav);
        this->active=-1;
-       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535);
+       this->gr=graphics_overlay_new(navit_gr, &this->p, this->w, this->h, 65535, 1);
 
        this->bg=graphics_gc_new(this->gr);
        c.r=0; c.g=0; c.b=0; c.a=32767;