Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
promise
OpenXG-RAN
Commits
c9f51868
Commit
c9f51868
authored
Apr 28, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add x_draw_clipped_string and use it in the text_list gui
parent
ca945b53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
common/utils/T/tracer/gui/text_list.c
common/utils/T/tracer/gui/text_list.c
+4
-2
common/utils/T/tracer/gui/x.c
common/utils/T/tracer/gui/x.c
+12
-0
common/utils/T/tracer/gui/x.h
common/utils/T/tracer/gui/x.h
+4
-0
No files found.
common/utils/T/tracer/gui/text_list.c
View file @
c9f51868
...
@@ -16,10 +16,12 @@ printf("PAINT text_list %p xywh %d %d %d %d\n", _this, this->common.x, this->com
...
@@ -16,10 +16,12 @@ printf("PAINT text_list %p xywh %d %d %d %d\n", _this, this->common.x, this->com
this
->
common
.
width
,
this
->
common
.
height
);
this
->
common
.
width
,
this
->
common
.
height
);
for
(
i
=
0
,
j
=
this
->
starting_line
;
for
(
i
=
0
,
j
=
this
->
starting_line
;
i
<
this
->
allocated_nlines
&&
j
<
this
->
text_count
;
i
++
,
j
++
)
i
<
this
->
allocated_nlines
&&
j
<
this
->
text_count
;
i
++
,
j
++
)
x_draw_string
(
g
->
x
,
g
->
xwin
,
FOREGROUND_COLOR
,
x_draw_
clipped_
string
(
g
->
x
,
g
->
xwin
,
FOREGROUND_COLOR
,
this
->
common
.
x
,
this
->
common
.
x
,
this
->
common
.
y
+
i
*
this
->
line_height
+
this
->
baseline
,
this
->
common
.
y
+
i
*
this
->
line_height
+
this
->
baseline
,
this
->
text
[
j
]);
this
->
text
[
j
],
this
->
common
.
x
,
this
->
common
.
y
,
this
->
common
.
width
,
this
->
common
.
height
);
}
}
static
void
hints
(
gui
*
_gui
,
widget
*
_w
,
int
*
width
,
int
*
height
)
static
void
hints
(
gui
*
_gui
,
widget
*
_w
,
int
*
width
,
int
*
height
)
...
...
common/utils/T/tracer/gui/x.c
View file @
c9f51868
...
@@ -279,6 +279,18 @@ void x_draw_string(x_connection *_c, x_window *_w, int color,
...
@@ -279,6 +279,18 @@ void x_draw_string(x_connection *_c, x_window *_w, int color,
XDrawString
(
c
->
d
,
w
->
p
,
c
->
colors
[
color
],
x
,
y
,
t
,
tlen
);
XDrawString
(
c
->
d
,
w
->
p
,
c
->
colors
[
color
],
x
,
y
,
t
,
tlen
);
}
}
void
x_draw_clipped_string
(
x_connection
*
_c
,
x_window
*
_w
,
int
color
,
int
x
,
int
y
,
const
char
*
t
,
int
clipx
,
int
clipy
,
int
clipwidth
,
int
clipheight
)
{
struct
x_connection
*
c
=
_c
;
XRectangle
clip
=
{
clipx
,
clipy
,
clipwidth
,
clipheight
};
XSetClipRectangles
(
c
->
d
,
c
->
colors
[
color
],
0
,
0
,
&
clip
,
1
,
Unsorted
);
x_draw_string
(
_c
,
_w
,
color
,
x
,
y
,
t
);
XSetClipMask
(
c
->
d
,
c
->
colors
[
color
],
None
);
}
void
x_draw
(
x_connection
*
_c
,
x_window
*
_w
)
void
x_draw
(
x_connection
*
_c
,
x_window
*
_w
)
{
{
struct
x_connection
*
c
=
_c
;
struct
x_connection
*
c
=
_c
;
...
...
common/utils/T/tracer/gui/x.h
View file @
c9f51868
...
@@ -41,6 +41,10 @@ void x_fill_rectangle(x_connection *c, x_window *w, int color,
...
@@ -41,6 +41,10 @@ void x_fill_rectangle(x_connection *c, x_window *w, int color,
void
x_draw_string
(
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
);
int
x
,
int
y
,
const
char
*
t
);
void
x_draw_clipped_string
(
x_connection
*
_c
,
x_window
*
_w
,
int
color
,
int
x
,
int
y
,
const
char
*
t
,
int
clipx
,
int
clipy
,
int
clipwidth
,
int
clipheight
);
/* specials functions to plot many points
/* specials functions to plot many points
* you call several times x_add_point() then x_plot_points()
* you call several times x_add_point() then x_plot_points()
*/
*/
...
...
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