Commit 0b664eb1 authored by Claes Sjofors's avatar Claes Sjofors

Ge, new' fix position property on image, rounded rectange and arc objects

parent 348bdd40
...@@ -1363,6 +1363,7 @@ typedef enum { ...@@ -1363,6 +1363,7 @@ typedef enum {
glow_eSave_GrowArc_gradient_contrast = 2419, glow_eSave_GrowArc_gradient_contrast = 2419,
glow_eSave_GrowArc_disable_gradient = 2420, glow_eSave_GrowArc_disable_gradient = 2420,
glow_eSave_GrowArc_fixcolor = 2421, glow_eSave_GrowArc_fixcolor = 2421,
glow_eSave_GrowArc_fixposition = 2422,
glow_eSave_PolyLine_draw_type = 2500, glow_eSave_PolyLine_draw_type = 2500,
glow_eSave_PolyLine_line_width = 2501, glow_eSave_PolyLine_line_width = 2501,
glow_eSave_PolyLine_a_points = 2502, glow_eSave_PolyLine_a_points = 2502,
...@@ -1527,6 +1528,7 @@ typedef enum { ...@@ -1527,6 +1528,7 @@ typedef enum {
glow_eSave_GrowImage_color_lightness = 3413, glow_eSave_GrowImage_color_lightness = 3413,
glow_eSave_GrowImage_color_intensity = 3414, glow_eSave_GrowImage_color_intensity = 3414,
glow_eSave_GrowImage_color_shift = 3415, glow_eSave_GrowImage_color_shift = 3415,
glow_eSave_GrowImage_fixposition = 3416,
glow_eSave_GrowGroup_grownode_part = 3500, glow_eSave_GrowGroup_grownode_part = 3500,
glow_eSave_GrowGroup_nc = 3501, glow_eSave_GrowGroup_nc = 3501,
glow_eSave_NodeGroup_nodeclass_part = 3600, glow_eSave_NodeGroup_nodeclass_part = 3600,
...@@ -1562,6 +1564,7 @@ typedef enum { ...@@ -1562,6 +1564,7 @@ typedef enum {
glow_eSave_GrowRectRounded_gradient = 3819, glow_eSave_GrowRectRounded_gradient = 3819,
glow_eSave_GrowRectRounded_gradient_contrast = 3820, glow_eSave_GrowRectRounded_gradient_contrast = 3820,
glow_eSave_GrowRectRounded_disable_gradient = 3821, glow_eSave_GrowRectRounded_disable_gradient = 3821,
glow_eSave_GrowRectRounded_fixposition = 3822,
glow_eSave_GrowConGlue_line_width_up = 3900, glow_eSave_GrowConGlue_line_width_up = 3900,
glow_eSave_GrowConGlue_line_width_down = 3901, glow_eSave_GrowConGlue_line_width_down = 3901,
glow_eSave_GrowConGlue_line_width_left = 3902, glow_eSave_GrowConGlue_line_width_left = 3902,
......
...@@ -1325,6 +1325,12 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab, ...@@ -1325,6 +1325,12 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab,
attrinfo[i].type = glow_eType_Boolean; attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( op->disable_gradient); attrinfo[i++].size = sizeof( op->disable_gradient);
strcpy( attrinfo[i].name, "fixposition");
attrinfo[i].value_p = &op->fixposition;
attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( op->fixposition);
strcpy( attrinfo[i].name, "Dynamic"); strcpy( attrinfo[i].name, "Dynamic");
op->get_dynamic( &dynamic, &dynsize); op->get_dynamic( &dynamic, &dynsize);
attrinfo[i].value_p = malloc( 1024); attrinfo[i].value_p = malloc( 1024);
...@@ -1504,6 +1510,11 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab, ...@@ -1504,6 +1510,11 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab,
attrinfo[i].type = glow_eType_Boolean; attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( op->disable_gradient); attrinfo[i++].size = sizeof( op->disable_gradient);
strcpy( attrinfo[i].name, "fixposition");
attrinfo[i].value_p = &op->fixposition;
attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( op->fixposition);
strcpy( attrinfo[i].name, "Dynamic"); strcpy( attrinfo[i].name, "Dynamic");
op->get_dynamic( &dynamic, &dynsize); op->get_dynamic( &dynamic, &dynsize);
attrinfo[i].value_p = malloc( 1024); attrinfo[i].value_p = malloc( 1024);
...@@ -1595,6 +1606,11 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab, ...@@ -1595,6 +1606,11 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab,
attrinfo[i].size = sizeof( op->image_filename); attrinfo[i].size = sizeof( op->image_filename);
attrinfo[i++].info_type = grow_eInfoType_Image; attrinfo[i++].info_type = grow_eInfoType_Image;
strcpy( attrinfo[i].name, "fixposition");
attrinfo[i].value_p = &op->fixposition;
attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( op->fixposition);
strcpy( attrinfo[i].name, "Dynamic"); strcpy( attrinfo[i].name, "Dynamic");
op->get_dynamic( &dynamic, &dynsize); op->get_dynamic( &dynamic, &dynsize);
attrinfo[i].value_p = malloc( 1024); attrinfo[i].value_p = malloc( 1024);
......
...@@ -42,7 +42,8 @@ GrowArc::GrowArc( GrowCtx *glow_ctx, const char *name, double x1, double y1, ...@@ -42,7 +42,8 @@ GrowArc::GrowArc( GrowCtx *glow_ctx, const char *name, double x1, double y1,
border(display_border), border(display_border),
dynamic(0), dynamicsize(0), shadow(display_shadow), shadow_width(5), dynamic(0), dynamicsize(0), shadow(display_shadow), shadow_width(5),
relief(glow_eRelief_Up), shadow_contrast(2), disable_shadow(0), fixcolor(0), relief(glow_eRelief_Up), shadow_contrast(2), disable_shadow(0), fixcolor(0),
gradient(glow_eGradient_No), gradient_contrast(4), disable_gradient(0) gradient(glow_eGradient_No), gradient_contrast(4), disable_gradient(0),
fixposition(0)
{ {
strcpy( n_name, name); strcpy( n_name, name);
pzero.nav_zoom(); pzero.nav_zoom();
...@@ -84,6 +85,8 @@ GrowArc::~GrowArc() ...@@ -84,6 +85,8 @@ GrowArc::~GrowArc()
void GrowArc::move( double delta_x, double delta_y, int grid) void GrowArc::move( double delta_x, double delta_y, int grid)
{ {
if ( fixposition)
return;
ctx->set_defered_redraw(); ctx->set_defered_redraw();
ctx->draw( &ctx->mw, x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x - DRAW_MP, ctx->draw( &ctx->mw, x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x - DRAW_MP,
y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y - DRAW_MP, y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y - DRAW_MP,
...@@ -130,6 +133,8 @@ void GrowArc::move( double delta_x, double delta_y, int grid) ...@@ -130,6 +133,8 @@ void GrowArc::move( double delta_x, double delta_y, int grid)
void GrowArc::move_noerase( int delta_x, int delta_y, int grid) void GrowArc::move_noerase( int delta_x, int delta_y, int grid)
{ {
if ( fixposition)
return;
if ( grid) if ( grid)
{ {
double x_grid, y_grid; double x_grid, y_grid;
...@@ -275,6 +280,7 @@ void GrowArc::save( ofstream& fp, glow_eSaveMode mode) ...@@ -275,6 +280,7 @@ void GrowArc::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowArc_gradient) << FSPACE << int(gradient) << endl; fp << int(glow_eSave_GrowArc_gradient) << FSPACE << int(gradient) << endl;
fp << int(glow_eSave_GrowArc_gradient_contrast) << FSPACE << gradient_contrast << endl; fp << int(glow_eSave_GrowArc_gradient_contrast) << FSPACE << gradient_contrast << endl;
fp << int(glow_eSave_GrowArc_disable_gradient) << FSPACE << disable_gradient << endl; fp << int(glow_eSave_GrowArc_disable_gradient) << FSPACE << disable_gradient << endl;
fp << int(glow_eSave_GrowArc_fixposition) << FSPACE << fixposition << endl;
fp << int(glow_eSave_GrowArc_dynamicsize) << FSPACE << dynamicsize << endl; fp << int(glow_eSave_GrowArc_dynamicsize) << FSPACE << dynamicsize << endl;
fp << int(glow_eSave_GrowArc_dynamic) << endl; fp << int(glow_eSave_GrowArc_dynamic) << endl;
if( dynamic) if( dynamic)
...@@ -339,6 +345,7 @@ void GrowArc::open( ifstream& fp) ...@@ -339,6 +345,7 @@ void GrowArc::open( ifstream& fp)
case glow_eSave_GrowArc_gradient: fp >> tmp; gradient = (glow_eGradient)tmp; break; case glow_eSave_GrowArc_gradient: fp >> tmp; gradient = (glow_eGradient)tmp; break;
case glow_eSave_GrowArc_gradient_contrast: fp >> gradient_contrast; break; case glow_eSave_GrowArc_gradient_contrast: fp >> gradient_contrast; break;
case glow_eSave_GrowArc_disable_gradient: fp >> disable_gradient; break; case glow_eSave_GrowArc_disable_gradient: fp >> disable_gradient; break;
case glow_eSave_GrowArc_fixposition: fp >> fixposition; break;
case glow_eSave_GrowArc_dynamicsize: fp >> dynamicsize; break; case glow_eSave_GrowArc_dynamicsize: fp >> dynamicsize; break;
case glow_eSave_GrowArc_dynamic: case glow_eSave_GrowArc_dynamic:
fp.getline( dummy, sizeof(dummy)); fp.getline( dummy, sizeof(dummy));
...@@ -948,6 +955,9 @@ void GrowArc::align( double x, double y, glow_eAlignDirection direction) ...@@ -948,6 +955,9 @@ void GrowArc::align( double x, double y, glow_eAlignDirection direction)
{ {
double dx, dy; double dx, dy;
if ( fixposition)
return;
erase( &ctx->mw); erase( &ctx->mw);
erase( &ctx->navw); erase( &ctx->navw);
ctx->set_defered_redraw(); ctx->set_defered_redraw();
......
...@@ -277,6 +277,7 @@ class GrowArc : public GlowArc { ...@@ -277,6 +277,7 @@ class GrowArc : public GlowArc {
glow_eGradient gradient; //!< Type of gradient. glow_eGradient gradient; //!< Type of gradient.
int gradient_contrast; //!< Gradient contrast. int gradient_contrast; //!< Gradient contrast.
int disable_gradient; //!< Disable gradient, even if parent node has gradient. int disable_gradient; //!< Disable gradient, even if parent node has gradient.
int fixposition; //!< Can't be moved.
//! Set user data. //! Set user data.
/*! /*!
......
...@@ -63,7 +63,7 @@ GrowImage::GrowImage( GrowCtx *glow_ctx, const char *name, double x, double y, ...@@ -63,7 +63,7 @@ GrowImage::GrowImage( GrowCtx *glow_ctx, const char *name, double x, double y,
current_nav_color_inverse(0), current_nav_direction(0), current_nav_color_inverse(0), current_nav_direction(0),
flip_vertical(false), flip_horizontal(false), flip_vertical(false), flip_horizontal(false),
current_flip_vertical(false), current_flip_horizontal(false), current_flip_vertical(false), current_flip_horizontal(false),
rotation(0), current_rotation(0) rotation(0), current_rotation(0), fixposition(0)
{ {
strcpy( n_name, name); strcpy( n_name, name);
strcpy( image_filename, ""); strcpy( image_filename, "");
...@@ -250,6 +250,8 @@ void GrowImage::traverse( int x, int y) ...@@ -250,6 +250,8 @@ void GrowImage::traverse( int x, int y)
void GrowImage::move( double delta_x, double delta_y, int grid) void GrowImage::move( double delta_x, double delta_y, int grid)
{ {
if ( fixposition)
return;
ctx->set_defered_redraw(); ctx->set_defered_redraw();
ctx->draw( &ctx->mw, x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x - DRAW_MP, ctx->draw( &ctx->mw, x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x - DRAW_MP,
y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y - DRAW_MP, y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y - DRAW_MP,
...@@ -293,6 +295,8 @@ void GrowImage::move( double delta_x, double delta_y, int grid) ...@@ -293,6 +295,8 @@ void GrowImage::move( double delta_x, double delta_y, int grid)
void GrowImage::move_noerase( int delta_x, int delta_y, int grid) void GrowImage::move_noerase( int delta_x, int delta_y, int grid)
{ {
if ( fixposition)
return;
if ( grid) { if ( grid) {
double x_grid, y_grid; double x_grid, y_grid;
...@@ -450,6 +454,7 @@ void GrowImage::save( ofstream& fp, glow_eSaveMode mode) ...@@ -450,6 +454,7 @@ void GrowImage::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowImage_color_lightness) << FSPACE << color_lightness << endl; fp << int(glow_eSave_GrowImage_color_lightness) << FSPACE << color_lightness << endl;
fp << int(glow_eSave_GrowImage_color_intensity) << FSPACE << color_intensity << endl; fp << int(glow_eSave_GrowImage_color_intensity) << FSPACE << color_intensity << endl;
fp << int(glow_eSave_GrowImage_color_shift) << FSPACE << color_shift << endl; fp << int(glow_eSave_GrowImage_color_shift) << FSPACE << color_shift << endl;
fp << int(glow_eSave_GrowImage_fixposition) << FSPACE << fixposition << endl;
fp << int(glow_eSave_End) << endl; fp << int(glow_eSave_End) << endl;
} }
...@@ -518,6 +523,7 @@ void GrowImage::open( ifstream& fp) ...@@ -518,6 +523,7 @@ void GrowImage::open( ifstream& fp)
case glow_eSave_GrowImage_color_lightness: fp >> color_lightness; break; case glow_eSave_GrowImage_color_lightness: fp >> color_lightness; break;
case glow_eSave_GrowImage_color_intensity: fp >> color_intensity; break; case glow_eSave_GrowImage_color_intensity: fp >> color_intensity; break;
case glow_eSave_GrowImage_color_shift: fp >> color_shift; break; case glow_eSave_GrowImage_color_shift: fp >> color_shift; break;
case glow_eSave_GrowImage_fixposition: fp >> fixposition; break;
case glow_eSave_End: end_found = 1; break; case glow_eSave_End: end_found = 1; break;
default: default:
cout << "GrowImage:open syntax error" << endl; cout << "GrowImage:open syntax error" << endl;
...@@ -1072,6 +1078,9 @@ void GrowImage::align( double x, double y, glow_eAlignDirection direction) ...@@ -1072,6 +1078,9 @@ void GrowImage::align( double x, double y, glow_eAlignDirection direction)
{ {
double dx, dy; double dx, dy;
if ( fixposition)
return;
erase( &ctx->mw); erase( &ctx->mw);
erase( &ctx->navw); erase( &ctx->navw);
ctx->set_defered_redraw(); ctx->set_defered_redraw();
......
...@@ -315,6 +315,7 @@ class GrowImage : public GlowArrayElem { ...@@ -315,6 +315,7 @@ class GrowImage : public GlowArrayElem {
int c_color_inverse; int c_color_inverse;
float factor_intens; float factor_intens;
float factor_light; float factor_light;
int fixposition; //!< Can't be moved.
//! Read the image file and create pixmaps for the image. //! Read the image file and create pixmaps for the image.
/*! /*!
......
...@@ -42,7 +42,8 @@ GrowRectRounded::GrowRectRounded( GrowCtx *glow_ctx, const char *name, double x, ...@@ -42,7 +42,8 @@ GrowRectRounded::GrowRectRounded( GrowCtx *glow_ctx, const char *name, double x,
border(display_border), border(display_border),
dynamic(0), dynamicsize(0), round_amount(15), shadow(display_shadow), dynamic(0), dynamicsize(0), round_amount(15), shadow(display_shadow),
shadow_width(5), relief(glow_eRelief_Up), shadow_contrast(2), disable_shadow(0), shadow_width(5), relief(glow_eRelief_Up), shadow_contrast(2), disable_shadow(0),
gradient(glow_eGradient_No), gradient_contrast(4), disable_gradient(0) gradient(glow_eGradient_No), gradient_contrast(4), disable_gradient(0),
fixposition(0)
{ {
strcpy( n_name, name); strcpy( n_name, name);
pzero.nav_zoom(); pzero.nav_zoom();
...@@ -83,6 +84,8 @@ GrowRectRounded::~GrowRectRounded() ...@@ -83,6 +84,8 @@ GrowRectRounded::~GrowRectRounded()
void GrowRectRounded::move( double delta_x, double delta_y, int grid) void GrowRectRounded::move( double delta_x, double delta_y, int grid)
{ {
if ( fixposition)
return;
ctx->set_defered_redraw(); ctx->set_defered_redraw();
ctx->draw( &ctx->mw, x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x - DRAW_MP, ctx->draw( &ctx->mw, x_left * ctx->mw.zoom_factor_x - ctx->mw.offset_x - DRAW_MP,
y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y - DRAW_MP, y_low * ctx->mw.zoom_factor_y - ctx->mw.offset_y - DRAW_MP,
...@@ -128,6 +131,8 @@ void GrowRectRounded::move( double delta_x, double delta_y, int grid) ...@@ -128,6 +131,8 @@ void GrowRectRounded::move( double delta_x, double delta_y, int grid)
void GrowRectRounded::move_noerase( int delta_x, int delta_y, int grid) void GrowRectRounded::move_noerase( int delta_x, int delta_y, int grid)
{ {
if ( fixposition)
return;
if ( grid) if ( grid)
{ {
double x_grid, y_grid; double x_grid, y_grid;
...@@ -274,6 +279,7 @@ void GrowRectRounded::save( ofstream& fp, glow_eSaveMode mode) ...@@ -274,6 +279,7 @@ void GrowRectRounded::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowRectRounded_gradient) << FSPACE << int(gradient) << endl; fp << int(glow_eSave_GrowRectRounded_gradient) << FSPACE << int(gradient) << endl;
fp << int(glow_eSave_GrowRectRounded_gradient_contrast) << FSPACE << gradient_contrast << endl; fp << int(glow_eSave_GrowRectRounded_gradient_contrast) << FSPACE << gradient_contrast << endl;
fp << int(glow_eSave_GrowRectRounded_disable_gradient) << FSPACE << disable_gradient << endl; fp << int(glow_eSave_GrowRectRounded_disable_gradient) << FSPACE << disable_gradient << endl;
fp << int(glow_eSave_GrowRectRounded_fixposition) << FSPACE << fixposition << endl;
fp << int(glow_eSave_GrowRectRounded_dynamicsize) << FSPACE << dynamicsize << endl; fp << int(glow_eSave_GrowRectRounded_dynamicsize) << FSPACE << dynamicsize << endl;
fp << int(glow_eSave_GrowRectRounded_dynamic) << endl; fp << int(glow_eSave_GrowRectRounded_dynamic) << endl;
if( dynamic) if( dynamic)
...@@ -337,6 +343,7 @@ void GrowRectRounded::open( ifstream& fp) ...@@ -337,6 +343,7 @@ void GrowRectRounded::open( ifstream& fp)
case glow_eSave_GrowRectRounded_disable_shadow: fp >> disable_shadow; break; case glow_eSave_GrowRectRounded_disable_shadow: fp >> disable_shadow; break;
case glow_eSave_GrowRectRounded_gradient: fp >> tmp; gradient = (glow_eGradient)tmp; break; case glow_eSave_GrowRectRounded_gradient: fp >> tmp; gradient = (glow_eGradient)tmp; break;
case glow_eSave_GrowRectRounded_gradient_contrast: fp >> gradient_contrast; break; case glow_eSave_GrowRectRounded_gradient_contrast: fp >> gradient_contrast; break;
case glow_eSave_GrowRectRounded_fixposition: fp >> fixposition; break;
case glow_eSave_GrowRectRounded_disable_gradient: fp >> disable_gradient; break; case glow_eSave_GrowRectRounded_disable_gradient: fp >> disable_gradient; break;
case glow_eSave_GrowRectRounded_dynamicsize: fp >> dynamicsize; break; case glow_eSave_GrowRectRounded_dynamicsize: fp >> dynamicsize; break;
case glow_eSave_GrowRectRounded_dynamic: case glow_eSave_GrowRectRounded_dynamic:
...@@ -1034,6 +1041,9 @@ void GrowRectRounded::align( double x, double y, glow_eAlignDirection direction) ...@@ -1034,6 +1041,9 @@ void GrowRectRounded::align( double x, double y, glow_eAlignDirection direction)
{ {
double dx, dy; double dx, dy;
if ( fixposition)
return;
erase( &ctx->mw); erase( &ctx->mw);
erase( &ctx->navw); erase( &ctx->navw);
ctx->set_defered_redraw(); ctx->set_defered_redraw();
......
...@@ -287,6 +287,7 @@ class GrowRectRounded : public GlowRect { ...@@ -287,6 +287,7 @@ class GrowRectRounded : public GlowRect {
glow_eGradient gradient; //!< Type of gradient. glow_eGradient gradient; //!< Type of gradient.
int gradient_contrast; //!< Gradient contrast. int gradient_contrast; //!< Gradient contrast.
int disable_gradient; //!< Disable gradient, even if parent node has gradient. int disable_gradient; //!< Disable gradient, even if parent node has gradient.
int fixposition; //!< Can't be moved.
//! Set user data. //! Set user data.
/*! /*!
......
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