Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
0447a057
Commit
0447a057
authored
Apr 11, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add X functions to plot points
parent
e03d4520
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
common/utils/T/tracer/gui/x.c
common/utils/T/tracer/gui/x.c
+28
-0
common/utils/T/tracer/gui/x.h
common/utils/T/tracer/gui/x.h
+6
-0
common/utils/T/tracer/gui/x_defs.h
common/utils/T/tracer/gui/x_defs.h
+3
-0
No files found.
common/utils/T/tracer/gui/x.c
View file @
0447a057
...
...
@@ -286,3 +286,31 @@ void x_draw(x_connection *_c, x_window *_w)
printf
(
"x_draw XCopyArea w h %d %d display %p window %d pixmap %d
\n
"
,
w
->
width
,
w
->
height
,
c
->
d
,
(
int
)
w
->
w
,
(
int
)
w
->
p
);
XCopyArea
(
c
->
d
,
w
->
p
,
w
->
w
,
c
->
colors
[
1
],
0
,
0
,
w
->
width
,
w
->
height
,
0
,
0
);
}
/* those two special functions are to plot many points
* first call x_add_point many times then x_plot_points once
*/
void
x_add_point
(
x_connection
*
_c
,
int
x
,
int
y
)
{
struct
x_connection
*
c
=
_c
;
if
(
c
->
pts_size
==
c
->
pts_maxsize
)
{
c
->
pts_maxsize
+=
65536
;
c
->
pts
=
realloc
(
c
->
pts
,
c
->
pts_maxsize
*
sizeof
(
XPoint
));
if
(
c
->
pts
==
NULL
)
OOM
;
}
c
->
pts
[
c
->
pts_size
].
x
=
x
;
c
->
pts
[
c
->
pts_size
].
y
=
y
;
c
->
pts_size
++
;
}
void
x_plot_points
(
x_connection
*
_c
,
x_window
*
_w
,
int
color
)
{
struct
x_connection
*
c
=
_c
;
fprintf
(
stderr
,
"x_plot_points %d points
\n
"
,
c
->
pts_size
);
struct
x_window
*
w
=
_w
;
XDrawPoints
(
c
->
d
,
w
->
p
,
c
->
colors
[
color
],
c
->
pts
,
c
->
pts_size
,
CoordModeOrigin
);
c
->
pts_size
=
0
;
}
common/utils/T/tracer/gui/x.h
View file @
0447a057
...
...
@@ -41,6 +41,12 @@ void x_fill_rectangle(x_connection *c, x_window *w, int color,
void
x_draw_string
(
x_connection
*
_c
,
x_window
*
_w
,
int
color
,
int
x
,
int
y
,
const
char
*
t
);
/* specials functions to plot many points
* you call several times x_add_point() then x_plot_points()
*/
void
x_add_point
(
x_connection
*
c
,
int
x
,
int
y
);
void
x_plot_points
(
x_connection
*
c
,
x_window
*
w
,
int
color
);
/* this function copies the pixmap to the window */
void
x_draw
(
x_connection
*
c
,
x_window
*
w
);
...
...
common/utils/T/tracer/gui/x_defs.h
View file @
0447a057
...
...
@@ -7,6 +7,9 @@ struct x_connection {
Display
*
d
;
GC
*
colors
;
int
ncolors
;
XPoint
*
pts
;
int
pts_size
;
int
pts_maxsize
;
};
struct
x_window
{
...
...
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