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
alex037yang
OpenXG-RAN
Commits
69e2a15e
Commit
69e2a15e
authored
Apr 29, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prepare container to deal with growable children
parent
53fd31ef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
0 deletions
+49
-0
common/utils/T/tracer/gui/container.c
common/utils/T/tracer/gui/container.c
+44
-0
common/utils/T/tracer/gui/gui.h
common/utils/T/tracer/gui/gui.h
+3
-0
common/utils/T/tracer/gui/gui_defs.h
common/utils/T/tracer/gui/gui_defs.h
+2
-0
No files found.
common/utils/T/tracer/gui/container.c
View file @
69e2a15e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include "gui_defs.h"
#include "gui_defs.h"
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a, b) ((a)>(b)?(a):(b))
#define MAX(a, b) ((a)>(b)?(a):(b))
...
@@ -19,6 +20,19 @@ printf("ADD_CHILD container\n");
...
@@ -19,6 +20,19 @@ printf("ADD_CHILD container\n");
struct
container_widget
*
this
=
_this
;
struct
container_widget
*
this
=
_this
;
this
->
hints_are_valid
=
0
;
this
->
hints_are_valid
=
0
;
widget_add_child_internal
(
g
,
this
,
child
,
position
);
widget_add_child_internal
(
g
,
this
,
child
,
position
);
/* initially not growable */
this
->
growable
=
realloc
(
this
->
growable
,
(
this
->
nchildren
+
1
)
*
sizeof
(
int
));
if
(
this
->
growable
==
NULL
)
abort
();
if
(
position
==
-
1
)
position
=
this
->
nchildren
;
memmove
(
this
->
growable
+
position
+
1
,
this
->
growable
+
position
,
(
this
->
nchildren
-
position
)
*
sizeof
(
int
));
this
->
growable
[
position
]
=
0
;
this
->
nchildren
++
;
}
}
static
void
compute_vertical_hints
(
struct
gui
*
g
,
static
void
compute_vertical_hints
(
struct
gui
*
g
,
...
@@ -246,3 +260,33 @@ widget *new_container(gui *_gui, int vertical)
...
@@ -246,3 +260,33 @@ widget *new_container(gui *_gui, int vertical)
return
w
;
return
w
;
}
}
/*************************************************************************/
/* public functions */
/*************************************************************************/
void
container_set_child_growable
(
gui
*
_gui
,
widget
*
_this
,
widget
*
child
,
int
growable
)
{
gui
*
g
=
_gui
;
struct
container_widget
*
this
=
_this
;
struct
widget_list
*
lcur
;
int
i
;
glock
(
g
);
lcur
=
this
->
common
.
children
;
i
=
0
;
while
(
lcur
)
{
if
(
lcur
->
item
==
child
)
break
;
lcur
=
lcur
->
next
;
i
++
;
}
if
(
lcur
==
NULL
)
ERR
(
"%s:%d: child not found
\n
"
,
__FILE__
,
__LINE__
);
this
->
growable
[
i
]
=
growable
;
send_event
(
g
,
DIRTY
,
this
->
common
.
id
);
gunlock
(
g
);
}
common/utils/T/tracer/gui/gui.h
View file @
69e2a15e
...
@@ -24,6 +24,9 @@ widget *new_xy_plot(gui *gui, int width, int height, char *label,
...
@@ -24,6 +24,9 @@ widget *new_xy_plot(gui *gui, int width, int height, char *label,
int
vruler_width
);
int
vruler_width
);
widget
*
new_text_list
(
gui
*
_gui
,
int
width
,
int
nlines
,
int
background_color
);
widget
*
new_text_list
(
gui
*
_gui
,
int
width
,
int
nlines
,
int
background_color
);
void
container_set_child_growable
(
gui
*
_gui
,
widget
*
_this
,
widget
*
child
,
int
growable
);
void
xy_plot_set_range
(
gui
*
gui
,
widget
*
this
,
void
xy_plot_set_range
(
gui
*
gui
,
widget
*
this
,
float
xmin
,
float
xmax
,
float
ymin
,
float
ymax
);
float
xmin
,
float
xmax
,
float
ymin
,
float
ymax
);
void
xy_plot_set_points
(
gui
*
gui
,
widget
*
this
,
void
xy_plot_set_points
(
gui
*
gui
,
widget
*
this
,
...
...
common/utils/T/tracer/gui/gui_defs.h
View file @
69e2a15e
...
@@ -69,6 +69,8 @@ struct container_widget {
...
@@ -69,6 +69,8 @@ struct container_widget {
int
hints_are_valid
;
/* used to cache hints values */
int
hints_are_valid
;
/* used to cache hints values */
int
hint_width
;
/* cached hint values - invalid if */
int
hint_width
;
/* cached hint values - invalid if */
int
hint_height
;
/* repack_was_called == 1 */
int
hint_height
;
/* repack_was_called == 1 */
int
*
growable
;
int
nchildren
;
};
};
struct
text_list_widget
{
struct
text_list_widget
{
...
...
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