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
b67fc48a
Commit
b67fc48a
authored
15 years ago
by
rds
Browse files
Options
Downloads
Patches
Plain Diff
incorporation of jumpColumn and jumpFeature code to work with new container objects
compiler warnings fixed
parent
6a62e912
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/zmapWindow/items/zmapWindowContainerUtils.c
+122
-4
122 additions, 4 deletions
src/zmapWindow/items/zmapWindowContainerUtils.c
src/zmapWindow/items/zmapWindowContainerUtils.h
+9
-2
9 additions, 2 deletions
src/zmapWindow/items/zmapWindowContainerUtils.h
with
131 additions
and
6 deletions
src/zmapWindow/items/zmapWindowContainerUtils.c
+
122
−
4
View file @
b67fc48a
...
...
@@ -27,12 +27,13 @@
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Jun
4 15:58
2009 (rds)
* Last edited: Jun
10 11:43
2009 (rds)
* Created: Tue Apr 28 16:10:46 2009 (rds)
* CVS info: $Id: zmapWindowContainerUtils.c,v 1.
4
2009-06-0
5
1
3
:18:0
5
rds Exp $
* CVS info: $Id: zmapWindowContainerUtils.c,v 1.
5
2009-06-
1
0 1
1
:18:0
7
rds Exp $
*-------------------------------------------------------------------
*/
#include
<ZMap/zmapUtilsFoo.h>
#include
<zmapWindowCanvas.h>
#include
<zmapWindowContainerUtils_P.h>
#include
<zmapWindowContainerUtils.h>
...
...
@@ -340,6 +341,123 @@ gboolean zmapWindowContainerIsStrandSeparator(ZMapWindowContainerGroup container
return
result
;
}
/* Get the index of an item in the feature list. */
GList
*
zmapWindowContainerFindItemInList
(
ZMapWindowContainerGroup
container_parent
,
FooCanvasItem
*
item
)
{
GList
*
list_item
=
NULL
;
FooCanvasGroup
*
container_features
;
container_features
=
FOO_CANVAS_GROUP
(
zmapWindowContainerGetFeatures
(
container_parent
))
;
list_item
=
zMap_foo_canvas_find_list_item
(
container_features
,
item
)
;
return
list_item
;
}
/* Returns the nth item in the container (0-based), there are two special values for
* nth_item for the first and last items: ZMAPCONTAINER_ITEM_FIRST, ZMAPCONTAINER_ITEM_LAST */
FooCanvasItem
*
zmapWindowContainerGetNthFeatureItem
(
ZMapWindowContainerGroup
container
,
int
nth_item
)
{
FooCanvasItem
*
item
=
NULL
;
FooCanvasGroup
*
features
;
features
=
(
FooCanvasGroup
*
)
zmapWindowContainerGetFeatures
(
container
)
;
if
(
nth_item
==
0
||
nth_item
==
ZMAPCONTAINER_ITEM_FIRST
)
item
=
FOO_CANVAS_ITEM
(
features
->
item_list
->
data
)
;
else
if
(
nth_item
==
ZMAPCONTAINER_ITEM_LAST
)
item
=
FOO_CANVAS_ITEM
(
features
->
item_list_end
->
data
)
;
else
item
=
FOO_CANVAS_ITEM
((
g_list_nth
(
features
->
item_list
,
nth_item
))
->
data
)
;
return
item
;
}
/* Given any item that is a direct child of a column group (e.g. not a subfeature), returns
* the previous or next item that optionally satisfies item_test_func_cb(). The function skips
* over items that fail these tests.
*
* direction controls which way the item list is processed and if wrap is TRUE then processing
* wraps around on reaching the end of the list.
*
* If no item can be found then the original will be returned, note that if item_test_func_cb()
* was specified and the original item does not satisfy item_test_func_cb() then NULL is returned.
*
* */
FooCanvasItem
*
zmapWindowContainerGetNextFeatureItem
(
FooCanvasItem
*
orig_item
,
ZMapContainerItemDirection
direction
,
gboolean
wrap
,
zmapWindowContainerItemTestCallback
item_test_func_cb
,
gpointer
user_data
)
{
ZMapWindowContainerGroup
container_group
;
ZMapWindowContainerFeatures
container_features
;
FooCanvasItem
*
item
=
NULL
;
FooCanvasGroup
*
features
;
GList
*
feature_ptr
;
FooCanvasItem
*
found_item
=
NULL
;
if
(
ZMAP_IS_CONTAINER_GROUP
(
orig_item
))
container_group
=
zmapWindowContainerGetNextParent
(
orig_item
);
else
container_group
=
zmapWindowContainerCanvasItemGetContainer
(
orig_item
);
container_features
=
zmapWindowContainerGetFeatures
(
container_group
);
/* For quick access to the start and end of the list */
features
=
FOO_CANVAS_GROUP
(
container_features
)
;
feature_ptr
=
zmapWindowContainerFindItemInList
(
container_group
,
orig_item
)
;
while
(
feature_ptr
&&
!
item
&&
found_item
!=
orig_item
)
{
if
(
direction
==
ZMAPCONTAINER_ITEM_NEXT
)
{
feature_ptr
=
g_list_next
(
feature_ptr
)
;
if
(
!
feature_ptr
&&
wrap
)
{
feature_ptr
=
g_list_first
(
features
->
item_list
);
/* check that the group really knows where the start of
* the list is */
if
(
feature_ptr
!=
features
->
item_list
)
features
->
item_list
=
feature_ptr
;
}
}
else
{
feature_ptr
=
g_list_previous
(
feature_ptr
)
;
if
(
!
feature_ptr
&&
wrap
)
{
feature_ptr
=
g_list_last
(
features
->
item_list
)
;
/* check that the group really knows where the end of
* the list is */
if
(
feature_ptr
!=
features
->
item_list_end
)
features
->
item_list_end
=
feature_ptr
;
}
}
/* If wrap is FALSE then feature_ptr can be NULL */
if
(
feature_ptr
)
{
found_item
=
(
FooCanvasItem
*
)(
feature_ptr
->
data
)
;
if
(
!
item_test_func_cb
||
item_test_func_cb
(
found_item
,
user_data
))
item
=
found_item
;
}
}
return
item
;
}
/* Features */
gboolean
zmapWindowContainerAttachFeatureAny
(
ZMapWindowContainerGroup
container
,
ZMapFeatureAny
feature_any
)
{
...
...
@@ -565,7 +683,7 @@ void zmapWindowContainerUtilsExecuteFull(ZMapWindowContainerGroup container_gr
data
.
container_leave_cb
=
container_leave_cb
;
data
.
container_leave_data
=
container_leave_data
;
if
(
redraw_during_recursion
)
if
(
redraw_during_recursion
&&
ZMAP_IS_CANVAS
(
parent
->
canvas
)
)
{
zmap_canvas
=
ZMAP_CANVAS
(
parent
->
canvas
);
zMapWindowCanvasBusy
(
zmap_canvas
);
...
...
@@ -573,7 +691,7 @@ void zmapWindowContainerUtilsExecuteFull(ZMapWindowContainerGroup container_gr
eachContainer
((
gpointer
)
container_group
,
&
data
)
;
if
(
redraw_during_recursion
)
if
(
redraw_during_recursion
&&
ZMAP_IS_CANVAS
(
parent
->
canvas
)
)
zMapWindowCanvasUnBusy
(
zmap_canvas
);
/* RDS_CANT_CROP_LONG_ITEMS_HERE
...
...
This diff is collapsed.
Click to expand it.
src/zmapWindow/items/zmapWindowContainerUtils.h
+
9
−
2
View file @
b67fc48a
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Jun
4 15:5
8 2009 (rds)
* Last edited: Jun
10 11:2
8 2009 (rds)
* Created: Thu Apr 30 14:40:12 2009 (rds)
* CVS info: $Id: zmapWindowContainerUtils.h,v 1.
4
2009-06-0
5
1
3
:18:
05
rds Exp $
* CVS info: $Id: zmapWindowContainerUtils.h,v 1.
5
2009-06-
1
0 1
1
:18:
13
rds Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -74,6 +74,13 @@ ZMapWindowContainerUnderlay zmapWindowContainerGetUnderlay (ZMapWindowContain
ZMapStrand
zmapWindowContainerGetStrand
(
ZMapWindowContainerGroup
container
);
gboolean
zmapWindowContainerIsStrandSeparator
(
ZMapWindowContainerGroup
container
);
GList
*
zmapWindowContainerFindItemInList
(
ZMapWindowContainerGroup
container_parent
,
FooCanvasItem
*
item
);
FooCanvasItem
*
zmapWindowContainerGetNthFeatureItem
(
ZMapWindowContainerGroup
container
,
int
nth_item
);
FooCanvasItem
*
zmapWindowContainerGetNextFeatureItem
(
FooCanvasItem
*
orig_item
,
ZMapContainerItemDirection
direction
,
gboolean
wrap
,
zmapWindowContainerItemTestCallback
item_test_func_cb
,
gpointer
user_data
);
/* Features */
gboolean
zmapWindowContainerAttachFeatureAny
(
ZMapWindowContainerGroup
container
,
ZMapFeatureAny
feature_any
);
gboolean
zmapWindowContainerGetFeatureAny
(
ZMapWindowContainerGroup
container
,
ZMapFeatureAny
*
feature_any_out
);
...
...
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