Commit 761f36c7 authored by claes's avatar claes

Clip and buffer fixes for window objects

parent 0cf1830e
/*
* Proview $Id: glow_draw_gtk.cpp,v 1.5 2007-05-07 14:35:03 claes Exp $
* Proview $Id: glow_draw_gtk.cpp,v 1.6 2007-07-17 12:43:42 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -506,6 +506,7 @@ GlowDrawGtk::GlowDrawGtk(
memset( gcs, 0, sizeof(gcs));
memset( font, 0, sizeof(font));
memset( cursors, 0, sizeof(cursors));
nav_wind.is_nav = 1;
if ( type == glow_eCtxType_Brow)
ctx = (GlowCtx *) new BrowCtx("Claes context", 20);
......@@ -1772,6 +1773,15 @@ void GlowDrawGtk::copy_buffer( GlowWind *wind,
int y0 = min( ll_y, ur_y);
int y1 = max( ll_y, ur_y);
if ( w->clip_cnt) {
x0 = max(x0, w->clip_rectangle[w->clip_cnt-1].x);
y0 = max(y0, w->clip_rectangle[w->clip_cnt-1].y);
x1 = min(x1, w->clip_rectangle[w->clip_cnt-1].x +
w->clip_rectangle[w->clip_cnt-1].width);
y1 = min(y1, w->clip_rectangle[w->clip_cnt-1].y +
w->clip_rectangle[w->clip_cnt-1].height);
}
gdk_draw_drawable( w->window,
get_gc( this, glow_eDrawType_Line, 0),
w->buffer,
......@@ -2309,7 +2319,7 @@ int GlowDrawGtk::create_buffer( GlowWind *wind)
DrawWindGtk *w = (DrawWindGtk *) wind->window;
int window_width, window_height;
if ( &ctx->mw == wind) {
if ( !w->is_nav) {
window_width = ctx->mw.window_width;
window_height = ctx->mw.window_height;
}
......@@ -2338,6 +2348,17 @@ int GlowDrawGtk::create_buffer( GlowWind *wind)
return 1;
}
void GlowDrawGtk::delete_buffer( GlowWind *wind)
{
DrawWindGtk *w = (DrawWindGtk *) wind->window;
if ( w->buffer)
g_object_unref( w->buffer);
w->buffer = 0;
w->buffer_width = 0;
w->buffer_height = 0;
}
void GlowDrawGtk::buffer_background( DrawWind *wind)
{
DrawWindGtk *w = (DrawWindGtk *) wind;
......@@ -2483,7 +2504,7 @@ int GlowDrawGtk::print( char *filename, double x0, double x1, int end)
if ( new_file) {
ps->fp <<
"%!PS-Adobe-2.0 EPSF-1.2" << endl <<
"%%Creator: Proview $Id: glow_draw_gtk.cpp,v 1.5 2007-05-07 14:35:03 claes Exp $ Glow" << endl <<
"%%Creator: Proview $Id: glow_draw_gtk.cpp,v 1.6 2007-07-17 12:43:42 claes Exp $ Glow" << endl <<
"%%EndComments" << endl << endl;
}
else
......
/*
* Proview $Id: glow_draw_gtk.h,v 1.3 2007-05-07 14:35:03 claes Exp $
* Proview $Id: glow_draw_gtk.h,v 1.4 2007-07-17 12:43:42 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -162,6 +162,7 @@ class GlowDrawGtk : public GlowDraw {
virtual void set_click_sensitivity( GlowWind *w, int value);
virtual void draw_background( GlowWind *w, int x, int y, int w, int h);
virtual int create_buffer( GlowWind *w);
virtual void delete_buffer( GlowWind *w);
virtual void buffer_background( DrawWind *w);
virtual int print( char *filename, double x0, double x1, int end);
void set_clip( DrawWind *w, GdkGC *gc);
......
/*
* Proview $Id: glow_draw_xlib.cpp,v 1.4 2007-05-07 15:45:18 claes Exp $
* Proview $Id: glow_draw_xlib.cpp,v 1.5 2007-07-17 12:43:42 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2560,6 +2560,17 @@ int GlowDrawXLib::create_buffer( GlowWind *wind)
return 1;
}
void GlowDrawGtk::delete_buffer( GlowWind *wind)
{
DrawWindXLib *w = (DrawWindXLib *) wind->window;
if ( w->buffer)
XFreePixmap( display, w->buffer);
w->buffer = 0;
w->buffer_width = 0;
w->buffer_height = 0;
}
void GlowDrawXLib::buffer_background( DrawWind *wind)
{
DrawWindXLib *w = (DrawWindXLib *) wind;
......@@ -2705,7 +2716,7 @@ int GlowDrawXLib::print( char *filename, double x0, double x1, int end)
if ( new_file) {
ps->fp <<
"%!PS-Adobe-2.0 EPSF-1.2" << endl <<
"%%Creator: Proview $Id: glow_draw_xlib.cpp,v 1.4 2007-05-07 15:45:18 claes Exp $ Glow" << endl <<
"%%Creator: Proview $Id: glow_draw_xlib.cpp,v 1.5 2007-07-17 12:43:42 claes Exp $ Glow" << endl <<
"%%EndComments" << endl << endl;
}
else
......
/*
* Proview $Id: glow_draw_xlib.h,v 1.4 2007-05-07 15:45:18 claes Exp $
* Proview $Id: glow_draw_xlib.h,v 1.5 2007-07-17 12:43:42 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -193,6 +193,7 @@ class GlowDrawXLib : public GlowDraw {
virtual void set_click_sensitivity( GlowWind *w, int value);
virtual void draw_background( GlowWind *w, int x, int y, int w, int h);
virtual int create_buffer( GlowWind *w);
virtual void delete_buffer( GlowWind *w);
virtual void buffer_background( DrawWind *w);
virtual int print( char *filename, double x0, double x1, int end);
void set_clip( DrawWind *w, GC gc);
......
/*
* Proview $Id: glow_grownode.cpp,v 1.14 2007-07-04 13:28:05 claes Exp $
* Proview $Id: glow_grownode.cpp,v 1.15 2007-07-17 12:43:42 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1076,7 +1076,7 @@ void GrowNode::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
}
else {
int x1, x2, y1, y2, x_level, y_level;
int clip_sts;
int clip_sts = 0;
glow_eDrawTone old_color_tone;
glow_eDrawType old_fill_drawtype;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment