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
624aba07
Commit
624aba07
authored
Apr 28, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new function text_list_del
parent
f8733535
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
common/utils/T/tracer/gui/gui.h
common/utils/T/tracer/gui/gui.h
+1
-0
common/utils/T/tracer/gui/text_list.c
common/utils/T/tracer/gui/text_list.c
+28
-0
No files found.
common/utils/T/tracer/gui/gui.h
View file @
624aba07
...
...
@@ -27,6 +27,7 @@ void xy_plot_set_points(gui *gui, widget *this,
int
npoints
,
float
*
x
,
float
*
y
);
void
text_list_add
(
gui
*
gui
,
widget
*
this
,
const
char
*
text
,
int
position
);
void
text_list_del
(
gui
*
gui
,
widget
*
this
,
int
position
);
void
gui_loop
(
gui
*
gui
);
...
...
common/utils/T/tracer/gui/text_list.c
View file @
624aba07
...
...
@@ -93,3 +93,31 @@ void text_list_add(gui *_gui, widget *_this, const char *text, int position)
gunlock
(
g
);
}
void
text_list_del
(
gui
*
_gui
,
widget
*
_this
,
int
position
)
{
struct
gui
*
g
=
_gui
;
struct
text_list_widget
*
this
=
_this
;
glock
(
g
);
/* TODO: useful check? */
if
(
this
->
text_count
==
0
)
goto
done
;
if
(
position
<
0
)
position
=
this
->
text_count
;
if
(
position
>
this
->
text_count
-
1
)
position
=
this
->
text_count
-
1
;
free
(
this
->
text
[
position
]);
memmove
(
this
->
text
+
position
,
this
->
text
+
position
+
1
,
(
this
->
text_count
-
1
-
position
)
*
sizeof
(
char
*
));
this
->
text_count
--
;
this
->
text
=
realloc
(
this
->
text
,
this
->
text_count
*
sizeof
(
char
*
));
if
(
this
->
text
==
NULL
)
OOM
;
send_event
(
g
,
DIRTY
,
this
->
common
.
id
);
done:
gunlock
(
g
);
}
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