Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
10cb222b
Commit
10cb222b
authored
19 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add some new container features to maximise background, destroy etc.
parent
a84ef572
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapWindow/zmapWindowDraw.c
+69
-12
69 additions, 12 deletions
src/zmapWindow/zmapWindowDraw.c
with
69 additions
and
12 deletions
src/zmapWindow/zmapWindowDraw.c
+
69
−
12
View file @
10cb222b
...
...
@@ -28,9 +28,9 @@
*
* Exported functions: See zmapWindow_P.h
* HISTORY:
* Last edited: Oct 1
0
1
3:54
2005 (edgrif)
* Last edited: Oct 1
1
1
6:31
2005 (edgrif)
* Created: Thu Sep 8 10:34:49 2005 (edgrif)
* CVS info: $Id: zmapWindowDraw.c,v 1.
6
2005-10-1
0
1
7:41:18
edgrif Exp $
* CVS info: $Id: zmapWindowDraw.c,v 1.
7
2005-10-1
3
1
3:33:36
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -219,13 +219,14 @@ FooCanvasItem *zmapWindowContainerGetBackground(FooCanvasGroup *container_parent
zMapAssert
(
type
==
CONTAINER_PARENT
||
type
==
CONTAINER_ROOT
)
;
container_background
=
FOO_CANVAS_ITEM
((
g_list_nth
(
container_parent
->
item_list
,
0
))
->
data
)
;
zMapAssert
(
FOO_IS_CANVAS_RE
(
container_background
))
;
return
container_background
;
}
/* Setting the background size is not completely straight forward because we always
* want the h
i
eght of the background to be the full height of the group (e.g. column)
* want the he
i
ght of the background to be the full height of the group (e.g. column)
* but we want the width to be set from the horizontal extent of the features.
*
* The height (y dimension) of the background can be given, if height is 0.0 then
...
...
@@ -247,15 +248,6 @@ void zmapWindowContainerSetBackgroundSize(FooCanvasGroup *container_parent, doub
container_background
=
zmapWindowContainerGetBackground
(
container_parent
)
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
/* Get the height from the main group */
foo_canvas_item_get_bounds
(
FOO_CANVAS_ITEM
(
container_parent
),
&
x1
,
&
y1
,
&
x2
,
&
y2
)
;
/* Get the width from the child group */
foo_canvas_item_get_bounds
(
FOO_CANVAS_ITEM
(
container_features
),
&
x1
,
&
y1
,
&
x2
,
&
y2
)
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
/* Either the caller sets the height or we get the height from the main group.
* We do this because features may cover only part of the range of the group, e.g. transcripts
* in a column, and we need the background to cover the whole range to allow us to get
...
...
@@ -288,6 +280,54 @@ void zmapWindowContainerSetBackgroundSize(FooCanvasGroup *container_parent, doub
}
/* Much like zmapWindowContainerSetBackgroundSize() but sets the background as big as the
* parent in width _and_ height. */
void
zmapWindowContainerMaximiseBackground
(
FooCanvasGroup
*
container_parent
)
{
FooCanvasItem
*
container_background
;
double
x1
,
y1
,
x2
,
y2
;
ContainerType
type
=
CONTAINER_INVALID
;
type
=
GPOINTER_TO_INT
(
g_object_get_data
(
G_OBJECT
(
container_parent
),
"container_type"
))
;
zMapAssert
(
type
==
CONTAINER_PARENT
||
type
==
CONTAINER_ROOT
)
;
container_background
=
zmapWindowContainerGetBackground
(
container_parent
)
;
foo_canvas_item_get_bounds
(
FOO_CANVAS_ITEM
(
container_parent
),
&
x1
,
&
y1
,
&
x2
,
&
y2
)
;
zmapWindowExt2Zero
(
&
x1
,
&
x2
)
;
zmapWindowExt2Zero
(
&
y1
,
&
y2
)
;
foo_canvas_item_set
(
container_background
,
"x1"
,
x1
,
"y1"
,
y1
,
"x2"
,
x2
,
"y2"
,
y2
,
NULL
)
;
return
;
}
/* Does the container contain any child features ? */
gboolean
zmapWindowContainerHasFeatures
(
FooCanvasGroup
*
container_parent
)
{
gboolean
result
=
FALSE
;
FooCanvasGroup
*
container_features
;
ContainerType
type
=
CONTAINER_INVALID
;
type
=
GPOINTER_TO_INT
(
g_object_get_data
(
G_OBJECT
(
container_parent
),
"container_type"
))
;
zMapAssert
(
type
==
CONTAINER_PARENT
||
type
==
CONTAINER_ROOT
)
;
container_features
=
zmapWindowContainerGetFeatures
(
container_parent
)
;
if
(
container_features
->
item_list
)
result
=
TRUE
;
return
result
;
}
void
zmapWindowContainerPrint
(
FooCanvasGroup
*
container_parent
)
{
...
...
@@ -304,6 +344,23 @@ void zmapWindowContainerPrint(FooCanvasGroup *container_parent)
}
/* WARNING, this is a DUMB destroy, it just literally destroys all the canvas items starting
* with the container_parent so if you haven't registered destroy callbacks then you may be in
* trouble with dangling/inaccessible data. */
void
zmapWindowContainerDestroy
(
FooCanvasGroup
*
container_parent
)
{
int
indent
=
0
;
ContainerType
type
=
CONTAINER_INVALID
;
type
=
GPOINTER_TO_INT
(
g_object_get_data
(
G_OBJECT
(
container_parent
),
"container_type"
))
;
zMapAssert
(
type
==
CONTAINER_PARENT
||
type
==
CONTAINER_ROOT
)
;
/* The FooCanvas seems to use GTK_OBJECTs but I don't know if this will automatically destroy
* all children, I think it must do. */
gtk_object_destroy
(
GTK_OBJECT
(
container_parent
))
;
return
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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