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
2980751c
Commit
2980751c
authored
16 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in mode checking when we are doing a style copy not a straight set/get.
parent
4fc16298
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/zmapFeature/zmapStyle.c
+64
-23
64 additions, 23 deletions
src/zmapFeature/zmapStyle.c
src/zmapFeature/zmapStyle_I.h
+9
-2
9 additions, 2 deletions
src/zmapFeature/zmapStyle_I.h
with
73 additions
and
25 deletions
src/zmapFeature/zmapStyle.c
+
64
−
23
View file @
2980751c
...
...
@@ -28,9 +28,9 @@
*
* Exported functions: See ZMap/zmapStyle.h
* HISTORY:
* Last edited: Mar 1
6 09:26
2009 (edgrif)
* Last edited: Mar 1
7 15:37
2009 (edgrif)
* Created: Mon Feb 26 09:12:18 2007 (edgrif)
* CVS info: $Id: zmapStyle.c,v 1.2
7
2009-03-1
6 09:33:2
9 edgrif Exp $
* CVS info: $Id: zmapStyle.c,v 1.2
8
2009-03-1
7 15:54:4
9 edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -277,7 +277,9 @@ gboolean zMapStyleCCopy(ZMapFeatureTypeStyle src, ZMapFeatureTypeStyle *dest_out
gboolean
copied
=
FALSE
;
ZMapBase
dest
;
if
(
dest_out
&&
(
copied
=
zMapBaseCCopy
(
ZMAP_BASE
(
src
),
&
dest
)))
g_object_set_data
(
G_OBJECT
(
src
),
ZMAPSTYLE_OBJ_COPY
,
GINT_TO_POINTER
(
TRUE
))
;
if
(
dest_out
&&
(
copied
=
zMapBaseCCopy
(
ZMAP_BASE
(
src
),
&
dest
)))
*
dest_out
=
ZMAP_FEATURE_STYLE
(
dest
);
(
*
dest_out
)
->
mode_data
=
src
->
mode_data
;
...
...
@@ -2321,7 +2323,7 @@ static void zmap_feature_type_style_init(ZMapFeatureTypeStyle style)
* of objects. During a copy, the "get_property" routine of one object is called to retrieve
* a value and the "set_property" routine of the new object is called to set that value.
*
* For copies, the original style is stored
i
n the
GParamSpec
so we can retrieve it and do
* For copies, the original style is stored
o
n the
style
so we can retrieve it and do
* a "deep" copy because bizarrely gobjects interface does not give you access to the
* original style !
*
...
...
@@ -2667,7 +2669,11 @@ static void zmap_feature_type_style_set_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_GRAPH
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GRAPH
,
"set"
,
pspec
)
;
if
(
!
copy_style
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GRAPH
,
"set"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -2709,8 +2715,11 @@ static void zmap_feature_type_style_set_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_GLYPH
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GLYPH
,
"set"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy_style
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GLYPH
,
"set"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -2745,8 +2754,11 @@ static void zmap_feature_type_style_set_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_ALIGNMENT
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_ALIGNMENT
,
"set"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy_style
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_ALIGNMENT
,
"set"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -2825,8 +2837,11 @@ static void zmap_feature_type_style_set_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_TRANSCRIPT
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TRANSCRIPT
,
"set"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy_style
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TRANSCRIPT
,
"set"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -2854,8 +2869,11 @@ static void zmap_feature_type_style_set_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_TEXT
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TEXT
,
"set"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy_style
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TEXT
,
"set"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -2904,6 +2922,10 @@ static void zmap_feature_type_style_set_property(GObject *gobject,
/* Called for all "get" calls to retrieve style properties.
*
* Note that the get might be called as part of a style copy in which case the gobject
* code will try to set _all_ properties so we have to deal with this for the mode
* specific properties by ignoring inappropriate ones.
*
* We return a status code in the property ZMAPSTYLE_OBJ_RC so that callers can detect
* whether this function succeeded or not.
...
...
@@ -2916,11 +2938,15 @@ static void zmap_feature_type_style_get_property(GObject *gobject,
{
ZMapFeatureTypeStyle
style
;
gboolean
result
=
TRUE
;
gboolean
copy
=
FALSE
;
g_return_if_fail
(
ZMAP_IS_FEATURE_STYLE
(
gobject
));
style
=
ZMAP_FEATURE_STYLE
(
gobject
);
copy
=
GPOINTER_TO_INT
(
g_object_get_data
(
G_OBJECT
(
style
),
ZMAPSTYLE_OBJ_COPY
))
;
if
(
style
->
implied_mode
==
ZMAPSTYLE_MODE_INVALID
)
set_implied_mode
(
style
,
param_id
);
...
...
@@ -3231,8 +3257,11 @@ static void zmap_feature_type_style_get_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_GRAPH
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GRAPH
,
"get"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GRAPH
,
"get"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -3276,8 +3305,11 @@ static void zmap_feature_type_style_get_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_GLYPH
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GLYPH
,
"get"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_GLYPH
,
"get"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -3317,8 +3349,11 @@ static void zmap_feature_type_style_get_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_ALIGNMENT
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_ALIGNMENT
,
"get"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_ALIGNMENT
,
"get"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -3428,8 +3463,11 @@ static void zmap_feature_type_style_get_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_TRANSCRIPT
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TRANSCRIPT
,
"get"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TRANSCRIPT
,
"get"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
@@ -3469,8 +3507,11 @@ static void zmap_feature_type_style_get_property(GObject *gobject,
if
(
style
->
implied_mode
!=
ZMAPSTYLE_MODE_TEXT
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TEXT
,
"get"
,
pspec
)
;
result
=
FALSE
;
if
(
!
copy
)
{
badPropertyForMode
(
style
,
ZMAPSTYLE_MODE_TEXT
,
"get"
,
pspec
)
;
result
=
FALSE
;
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/zmapFeature/zmapStyle_I.h
+
9
−
2
View file @
2980751c
...
...
@@ -26,9 +26,9 @@
* Description: Private header for style.
*
* HISTORY:
* Last edited: Mar 1
0
15:
44
2009 (edgrif)
* Last edited: Mar 1
7
15:
30
2009 (edgrif)
* Created: Mon Feb 26 09:13:30 2007 (edgrif)
* CVS info: $Id: zmapStyle_I.h,v 1.
7
2009-03-1
6 09:32:24
edgrif Exp $
* CVS info: $Id: zmapStyle_I.h,v 1.
8
2009-03-1
7 15:54:49
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -47,12 +47,19 @@
#define ZMAP_PARAM_STATIC_RO (ZMAP_PARAM_STATIC | G_PARAM_READABLE)
/* We need to know whether a get/set is part of a copy or a straight get/set (in a copy
* the get method is called for the original style and the set method for the new style. */
#define ZMAPSTYLE_OBJ_COPY "ZMap_Style_Copy"
/* We need out get/set routines to signal whether they succeeded, this must be done via setting
* user data on the style itself because there is nothing in the GObject interface that allows
* us to signal this. */
#define ZMAPSTYLE_OBJ_RC "ZMap_Style_RC"
typedef
struct
_zmapFeatureTypeStyleClassStruct
{
zmapBaseClass
__parent__
;
...
...
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