Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
69e2a15e
Commit
69e2a15e
authored
8 years ago
by
Cedric Roux
Browse files
Options
Downloads
Patches
Plain Diff
prepare container to deal with growable children
parent
53fd31ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/utils/T/tracer/gui/container.c
+44
-0
44 additions, 0 deletions
common/utils/T/tracer/gui/container.c
common/utils/T/tracer/gui/gui.h
+3
-0
3 additions, 0 deletions
common/utils/T/tracer/gui/gui.h
common/utils/T/tracer/gui/gui_defs.h
+2
-0
2 additions, 0 deletions
common/utils/T/tracer/gui/gui_defs.h
with
49 additions
and
0 deletions
common/utils/T/tracer/gui/container.c
+
44
−
0
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
);
}
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/gui/gui.h
+
3
−
0
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
,
...
...
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/gui/gui_defs.h
+
2
−
0
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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment