Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Kun
openairinterface5G
Commits
018da058
Commit
018da058
authored
8 years ago
by
Cédric Roux
Browse files
Options
Downloads
Patches
Plain Diff
container deals with growable children
parent
69e2a15e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/utils/T/tracer/gui/container.c
+34
-7
34 additions, 7 deletions
common/utils/T/tracer/gui/container.c
with
34 additions
and
7 deletions
common/utils/T/tracer/gui/container.c
+
34
−
7
View file @
018da058
...
...
@@ -84,6 +84,8 @@ printf("ALLOCATE container vertical %p\n", _this);
struct
gui
*
g
=
_gui
;
struct
container_widget
*
this
=
_this
;
struct
widget_list
*
l
;
int
over_pixels
=
0
;
int
i
;
if
(
this
->
hints_are_valid
==
1
)
goto
hints_ok
;
...
...
@@ -96,18 +98,29 @@ hints_ok:
this
->
common
.
width
=
width
;
this
->
common
.
height
=
height
;
/* TODO: some pixels won't be allocated, take care of it? */
if
(
height
>
this
->
hint_height
)
{
int
ngrowable
=
0
;
for
(
i
=
0
;
i
<
this
->
nchildren
;
i
++
)
if
(
this
->
growable
[
i
])
ngrowable
++
;
if
(
ngrowable
)
over_pixels
=
(
height
-
this
->
hint_height
)
/
ngrowable
;
}
/* allocate */
l
=
this
->
common
.
children
;
i
=
0
;
while
(
l
)
{
int
allocated_height
;
l
->
item
->
hints
(
g
,
l
->
item
,
&
cwidth
,
&
cheight
);
allocated_height
=
cheight
+
(
this
->
growable
[
i
]
?
over_pixels
:
0
);
l
->
item
->
allocate
(
g
,
l
->
item
,
this
->
common
.
x
,
this
->
common
.
y
+
cy
,
//this->hint_width, cheight);
MAX
(
width
,
cwidth
),
cheight
);
cy
+=
cheight
;
MAX
(
width
,
cwidth
),
allocated_height
);
cy
+=
allocated_height
;
l
=
l
->
next
;
i
++
;
}
if
(
cy
!=
this
->
hint_height
)
ERR
(
"reachable?
\n
"
);
//
if (cy != this->hint_height) ERR("reachable?\n");
}
static
void
horizontal_allocate
(
gui
*
_gui
,
widget
*
_this
,
...
...
@@ -119,6 +132,8 @@ printf("ALLOCATE container horizontal %p\n", _this);
struct
gui
*
g
=
_gui
;
struct
container_widget
*
this
=
_this
;
struct
widget_list
*
l
;
int
over_pixels
=
0
;
int
i
;
if
(
this
->
hints_are_valid
==
1
)
goto
hints_ok
;
...
...
@@ -131,17 +146,29 @@ hints_ok:
this
->
common
.
width
=
width
;
this
->
common
.
height
=
height
;
/* TODO: some pixels won't be allocated, take care of it? */
if
(
width
>
this
->
hint_width
)
{
int
ngrowable
=
0
;
for
(
i
=
0
;
i
<
this
->
nchildren
;
i
++
)
if
(
this
->
growable
[
i
])
ngrowable
++
;
if
(
ngrowable
)
over_pixels
=
(
width
-
this
->
hint_width
)
/
ngrowable
;
}
/* allocate */
l
=
this
->
common
.
children
;
i
=
0
;
while
(
l
)
{
int
allocated_width
;
l
->
item
->
hints
(
g
,
l
->
item
,
&
cwidth
,
&
cheight
);
allocated_width
=
cwidth
+
(
this
->
growable
[
i
]
?
over_pixels
:
0
);
l
->
item
->
allocate
(
g
,
l
->
item
,
this
->
common
.
x
+
cx
,
this
->
common
.
y
,
c
width
,
MAX
(
height
,
cheight
)
/* this->hint_height */
);
cx
+=
c
width
;
allocated_
width
,
MAX
(
height
,
cheight
)
/* this->hint_height */
);
cx
+=
allocated_
width
;
l
=
l
->
next
;
i
++
;
}
if
(
cx
!=
this
->
hint_width
)
ERR
(
"reachable?
\n
"
);
//
if (cx != this->hint_width) ERR("reachable?\n");
}
static
void
vertical_hints
(
gui
*
_gui
,
widget
*
_w
,
int
*
width
,
int
*
height
)
...
...
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