Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
2c75bc0d
Commit
2c75bc0d
authored
May 23, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for center and right aligned annotations
parent
1df5e4ba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
13 deletions
+30
-13
xtt/lib/glow/src/glow_exportjbean.cpp
xtt/lib/glow/src/glow_exportjbean.cpp
+22
-6
xtt/lib/glow/src/glow_exportjbean.h
xtt/lib/glow/src/glow_exportjbean.h
+4
-3
xtt/lib/glow/src/glow_growannot.cpp
xtt/lib/glow/src/glow_growannot.cpp
+2
-2
xtt/lib/glow/src/glow_growsubannot.cpp
xtt/lib/glow/src/glow_growsubannot.cpp
+2
-2
No files found.
xtt/lib/glow/src/glow_exportjbean.cpp
View file @
2c75bc0d
/*
/*
* Proview $Id: glow_exportjbean.cpp,v 1.1
5 2006-06-14 05:04:10
claes Exp $
* Proview $Id: glow_exportjbean.cpp,v 1.1
6 2007-05-23 08:04:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -634,7 +634,7 @@ void GlowExportJBean::line( double x1, double y1, double x2, double y2,
...
@@ -634,7 +634,7 @@ void GlowExportJBean::line( double x1, double y1, double x2, double y2,
fp
<<
fp
<<
" g.draw( shapes_p"
<<
page
<<
"["
<<
*
shape_cnt
<<
"]);"
<<
endl
;
" g.draw( shapes_p"
<<
page
<<
"["
<<
*
shape_cnt
<<
"]);"
<<
endl
;
if
(
*
shape_cnt
/
10
00
>
func_cnt
)
{
if
(
*
shape_cnt
/
5
00
>
func_cnt
)
{
// Max number of bytes in a java function is ~65000
// Max number of bytes in a java function is ~65000
fp
<<
fp
<<
" paintComponent"
<<
func_cnt
<<
"( g, save);"
<<
endl
<<
" paintComponent"
<<
func_cnt
<<
"( g, save);"
<<
endl
<<
...
@@ -1283,8 +1283,9 @@ void GlowExportJBean::text( int x0, int y0, char *text,
...
@@ -1283,8 +1283,9 @@ void GlowExportJBean::text( int x0, int y0, char *text,
}
}
void
GlowExportJBean
::
annot
(
int
x0
,
int
y0
,
int
number
,
void
GlowExportJBean
::
annot
(
int
x0
,
int
y0
,
int
number
,
glow_eDrawType
drawtype
,
glow_eDrawType
text_drawtype
,
int
bold
,
glow_eDrawType
drawtype
,
glow_eDrawType
text_drawtype
,
int
bold
,
int
idx
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
)
glow_eAdjustment
adjustment
,
int
idx
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
)
{
{
double
dim_x0
,
dim_x1
,
dim_y0
,
dim_y1
;
double
dim_x0
,
dim_x1
,
dim_y0
,
dim_y1
;
int
antialiasing_on
=
0
;
int
antialiasing_on
=
0
;
...
@@ -1363,6 +1364,21 @@ void GlowExportJBean::annot( int x0, int y0, int number,
...
@@ -1363,6 +1364,21 @@ void GlowExportJBean::annot( int x0, int y0, int number,
}
}
case
glow_eExportPass_Draw
:
case
glow_eExportPass_Draw
:
{
{
char
adjustmentstr
[
200
];
switch
(
adjustment
)
{
case
glow_eAdjustment_Right
:
fp
<<
" FontRenderContext frc = g.getFontRenderContext();"
<<
endl
;
sprintf
(
adjustmentstr
,
"- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()"
,
number
);
break
;
case
glow_eAdjustment_Center
:
fp
<<
" FontRenderContext frc = g.getFontRenderContext();"
<<
endl
;
sprintf
(
adjustmentstr
,
"- (float)g.getFont().getStringBounds(annot%d, frc).getWidth()/2"
,
number
);
break
;
default:
strcpy
(
adjustmentstr
,
""
);
}
if
(
is_nodeclass
)
if
(
is_nodeclass
)
nc
->
measure_javabean
(
&
dim_x1
,
&
dim_x0
,
&
dim_y1
,
&
dim_y0
);
nc
->
measure_javabean
(
&
dim_x1
,
&
dim_x0
,
&
dim_y1
,
&
dim_y0
);
else
else
...
@@ -1380,7 +1396,7 @@ void GlowExportJBean::annot( int x0, int y0, int number,
...
@@ -1380,7 +1396,7 @@ void GlowExportJBean::annot( int x0, int y0, int number,
" if ( annot"
<<
number
<<
" != null)"
<<
endl
<<
" if ( annot"
<<
number
<<
" != null)"
<<
endl
<<
" g.drawString( annot"
<<
number
<<
", "
<<
" g.drawString( annot"
<<
number
<<
", "
<<
x0
-
int
(
dim_x0
)
+
glow_cJBean_Offset
<<
x0
-
int
(
dim_x0
)
+
glow_cJBean_Offset
<<
" * original_height / height * width / original_width
, "
<<
" * original_height / height * width / original_width"
<<
adjustmentstr
<<
"
, "
<<
y0
-
int
(
dim_y0
)
+
glow_cJBean_Offset
<<
"F);"
<<
endl
;
y0
-
int
(
dim_y0
)
+
glow_cJBean_Offset
<<
"F);"
<<
endl
;
else
else
fp
<<
fp
<<
...
@@ -1390,7 +1406,7 @@ void GlowExportJBean::annot( int x0, int y0, int number,
...
@@ -1390,7 +1406,7 @@ void GlowExportJBean::annot( int x0, int y0, int number,
" if ( annot"
<<
number
<<
" != null)"
<<
endl
<<
" if ( annot"
<<
number
<<
" != null)"
<<
endl
<<
" g.drawString( annot"
<<
number
<<
", "
<<
" g.drawString( annot"
<<
number
<<
", "
<<
x0
-
int
(
dim_x0
)
+
glow_cJBean_Offset
<<
x0
-
int
(
dim_x0
)
+
glow_cJBean_Offset
<<
" * original_height / height * width / original_width, "
<<
" * original_height / height * width / original_width
"
<<
adjustmentstr
<<
"
, "
<<
y0
-
int
(
dim_y0
)
+
glow_cJBean_Offset
<<
"F);"
<<
endl
;
y0
-
int
(
dim_y0
)
+
glow_cJBean_Offset
<<
"F);"
<<
endl
;
fp
<<
fp
<<
" g.setTransform( save_tmp);"
<<
endl
;
" g.setTransform( save_tmp);"
<<
endl
;
...
...
xtt/lib/glow/src/glow_exportjbean.h
View file @
2c75bc0d
/*
/*
* Proview $Id: glow_exportjbean.h,v 1.
9 2007-01-04 07:57:38
claes Exp $
* Proview $Id: glow_exportjbean.h,v 1.
10 2007-05-23 08:04:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -68,8 +68,9 @@ class GlowExportJBean {
...
@@ -68,8 +68,9 @@ class GlowExportJBean {
glow_eDrawType
drawtype
,
glow_eDrawType
color_drawtype
,
int
bold
,
glow_eDrawType
drawtype
,
glow_eDrawType
color_drawtype
,
int
bold
,
int
idx
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
);
int
idx
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
);
void
annot
(
int
x0
,
int
y0
,
int
number
,
void
annot
(
int
x0
,
int
y0
,
int
number
,
glow_eDrawType
drawtype
,
glow_eDrawType
text_drawtype
,
int
bold
,
glow_eDrawType
drawtype
,
glow_eDrawType
text_drawtype
,
int
bold
,
int
idx
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
);
glow_eAdjustment
adjustment
,
int
idx
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
);
void
annot_font
(
int
number
,
glow_eDrawType
drawtype
,
void
annot_font
(
int
number
,
glow_eDrawType
drawtype
,
glow_eDrawType
background
,
int
bold
,
glow_eDrawType
background
,
int
bold
,
int
idx
,
glow_eExportPass
pass
,
ofstream
&
fp
);
int
idx
,
glow_eExportPass
pass
,
ofstream
&
fp
);
...
...
xtt/lib/glow/src/glow_growannot.cpp
View file @
2c75bc0d
/*
/*
* Proview $Id: glow_growannot.cpp,v 1.
9 2007-05-07 14:35:03
claes Exp $
* Proview $Id: glow_growannot.cpp,v 1.
10 2007-05-23 08:04:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -416,7 +416,7 @@ void GrowAnnot::export_javabean( GlowTransform *t, void *node,
...
@@ -416,7 +416,7 @@ void GrowAnnot::export_javabean( GlowTransform *t, void *node,
bold
=
(
draw_type
==
glow_eDrawType_TextHelveticaBold
);
bold
=
(
draw_type
==
glow_eDrawType_TextHelveticaBold
);
((
GrowCtx
*
)
ctx
)
->
export_jbean
->
annot
(
x1
,
y1
,
number
,
((
GrowCtx
*
)
ctx
)
->
export_jbean
->
annot
(
x1
,
y1
,
number
,
draw_type
,
color_drawtype
,
bold
,
idx
,
pass
,
shape_cnt
,
node_cnt
,
fp
);
draw_type
,
color_drawtype
,
bold
,
adjustment
,
idx
,
pass
,
shape_cnt
,
node_cnt
,
fp
);
// (*shape_cnt)++;
// (*shape_cnt)++;
}
}
...
...
xtt/lib/glow/src/glow_growsubannot.cpp
View file @
2c75bc0d
/*
/*
* Proview $Id: glow_growsubannot.cpp,v 1.
5 2007-01-04 07:57:3
9 claes Exp $
* Proview $Id: glow_growsubannot.cpp,v 1.
6 2007-05-23 08:04:0
9 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -541,7 +541,7 @@ void GrowSubAnnot::export_javabean( GlowTransform *t, void *node,
...
@@ -541,7 +541,7 @@ void GrowSubAnnot::export_javabean( GlowTransform *t, void *node,
bold
=
(
draw_type
==
glow_eDrawType_TextHelveticaBold
);
bold
=
(
draw_type
==
glow_eDrawType_TextHelveticaBold
);
ctx
->
export_jbean
->
annot
(
x1
,
y1
,
number
,
ctx
->
export_jbean
->
annot
(
x1
,
y1
,
number
,
draw_type
,
color_drawtype
,
bold
,
idx
,
pass
,
shape_cnt
,
node_cnt
,
fp
);
draw_type
,
color_drawtype
,
bold
,
adjustment
,
idx
,
pass
,
shape_cnt
,
node_cnt
,
fp
);
(
*
shape_cnt
)
++
;
(
*
shape_cnt
)
++
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment