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
88c8ebeb
Commit
88c8ebeb
authored
15 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add a README describing some of this code.
parent
0f5e11d1
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
src/zmapWindow/items/README
+83
-0
83 additions, 0 deletions
src/zmapWindow/items/README
with
83 additions
and
0 deletions
src/zmapWindow/items/README
0 → 100644
+
83
−
0
View file @
88c8ebeb
================================================================================
Canvas Groups, Items and Utils.
This directory contains functions and headers to support our own custom
foocanvas items derived from FooCanvasItem and FooCanvasGroup.
There are three "public" level headers that "application" code (i.e. code
outside of this directory) should use:
zmapWindowCanvas.h
zmapWindowContainers.h
zmapWindowFeatures.h
these give access to the public interfaces for our canvas, container and
feature extensions respectively. (N.B. code within this directory should not
include these headers but instead _only_ include the headers from within this
directory that are actually needed.)
Each component has a public and a private header, private headers should
always immediately include their public header to prevent type clashes,
circularities etc. Only derived "classes" should include the private headers
of their parents otherwise public headers should be used.
There are various types of "container" and various types of "feature" which
are used to form the hierachy in the Foocanvas that represents our feature
context, their relationship is like this:
| ZMapWindowContainerContext
| |
| |
| ZMapWindowContainerAlignment
| |
| |
ZMapContainerGroup--| ZMapWindowContainerBlock
| |
| |
| ZMapWindowContainerStrand
| |
| |
| ZMapWindowContainerFeatureSet
|
|
ZMapCanvasItem--| the various types of zmapWindowXXXXFeature
(Note that going down each level is a one->many parent/child mapping.)
As can be seen from the above diagram ZMapContainerGroup and ZMapCanvasItem
are "base" classes that provide generalised interfaces common to all groups or
features.
The use of GObject as the basis for the groups/items means that each container
member including the member itself has a G_TYPE. This means code that does
ZMAP_IS_CONTAINER_GROUP(pointer) is simpler and hopefully more readable.
The ZMapWindowContainerGroup are sub classes of FooCanvasGroup and implement
the FooCanvasItem interface (draw, update, bounds, etc...). The update code
takes care of cropping the Container "owned" items, such as the background and
any overlays/underlays that might be being drawn. It also includes hooks to
provide similar functionality to the ContainerExecute callbacks. These are
attached/owned by each specific container so only get called by the container
they relate to. This again leads to simplier code, without the switch on the
container level.
Each canvas item, as well as having its basic shape also has a background,
under- and overlay. Crucial to this is the ordering of these items as we rely
on the foocanvas routines to do all drawing and they just plough through the
list of items in each foocanvas group. To implement backgrounds etc. we must
maintain the order of these items.
The background item is used both as a visible background for the items but
also more importantly to catch events _anywhere_ in the space (e.g. column)
where the items might be drawn. This arrangement also means that code that
has to process all items can do so simply by processing all members of the
item list of the sub_group as they are guaranteed to all be feature items and
it is trivial to perform such operations as taking the size of all items in a
group.
================================================================================
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