Skip to content
Snippets Groups Projects
Commit 541bd73b authored by edgrif's avatar edgrif
Browse files

if enum property is set to XXX_INVALID this now resets the field_set.XXXX to FALSE now.

parent 41b21aa3
No related branches found
No related tags found
No related merge requests found
......@@ -26,9 +26,9 @@
* Description: Style and Style set handling functions.
*
* HISTORY:
* Last edited: Nov 13 17:00 2008 (edgrif)
* Last edited: Nov 17 13:51 2008 (edgrif)
* Created: Mon Feb 26 09:28:26 2007 (edgrif)
* CVS info: $Id: zmapStyle.h,v 1.27 2008-11-13 17:13:43 edgrif Exp $
* CVS info: $Id: zmapStyle.h,v 1.28 2008-11-17 17:07:02 edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_STYLE_H
......@@ -121,8 +121,8 @@ _(ZMAPSTYLE_MODE_INVALID, , "invalid") /**< invalid mode */ \
_(ZMAPSTYLE_MODE_BASIC, , "basic") /**< Basic box features */ \
_(ZMAPSTYLE_MODE_ALIGNMENT, , "alignment") /**< Usual homology structure */ \
_(ZMAPSTYLE_MODE_TRANSCRIPT, , "transcript") /**< Usual transcript like structure */ \
_(ZMAPSTYLE_MODE_RAW_SEQUENCE, , "raw_sequence") /**< DNA Sequence */ \
_(ZMAPSTYLE_MODE_PEP_SEQUENCE, , "pep_sequence") /**< Peptide Sequence */ \
_(ZMAPSTYLE_MODE_RAW_SEQUENCE, , "raw-sequence") /**< DNA Sequence */ \
_(ZMAPSTYLE_MODE_PEP_SEQUENCE, , "pep-sequence") /**< Peptide Sequence */ \
_(ZMAPSTYLE_MODE_TEXT, , "text") /**< Text only display */ \
_(ZMAPSTYLE_MODE_GRAPH, , "graph") /**< Graphs of various types */ \
_(ZMAPSTYLE_MODE_GLYPH, , "glyph") /**< Meta object controlling other features */ \
......@@ -134,18 +134,51 @@ ZMAP_DEFINE_ENUM(ZMapStyleMode, ZMAP_STYLE_MODE_LIST);
#define ZMAP_STYLE_COLUMN_DISPLAY_LIST(_) \
_(ZMAPSTYLE_COLDISPLAY_INVALID, , "invalid") /**< invalid mode */ \
_(ZMAPSTYLE_COLDISPLAY_HIDE, , "hide") /**< Never show. */ \
_(ZMAPSTYLE_COLDISPLAY_SHOW_HIDE, , "show_hide") /**< Show according to zoom/mag, mark etc. */ \
_(ZMAPSTYLE_COLDISPLAY_SHOW_HIDE, , "show-hide") /**< Show according to zoom/mag, mark etc. */ \
_(ZMAPSTYLE_COLDISPLAY_SHOW, , "show") /**< Always show. */
ZMAP_DEFINE_ENUM(ZMapStyleColumnDisplayState, ZMAP_STYLE_COLUMN_DISPLAY_LIST);
/* Specifies how features in columns should be overlapped for compact display. */
#define ZMAP_STYLE_OVERLAP_MODE_LIST(_) \
_(ZMAPOVERLAP_INVALID, , "invalid") \
_(ZMAPOVERLAP_COMPLETE, , "complete") /* draw on top - default */ \
_(ZMAPOVERLAP_OVERLAP, , "overlap") /* bump if feature coords overlap. */ \
_(ZMAPOVERLAP_POSITION, , "position") /* bump if features start at same coord. */ \
_(ZMAPOVERLAP_NAME, , "name") /* one column per homol target */ \
_(ZMAPOVERLAP_OSCILLATE, , "oscillate") /* Oscillate between one column and another... \
Useful for displaying tile paths. */ \
_(ZMAPOVERLAP_ITEM_OVERLAP, , "item-overlap") /* bump if item coords overlap in canvas space... */ \
_(ZMAPOVERLAP_SIMPLE, , "simple") /* one column per feature, for testing... */ \
_(ZMAPOVERLAP_ENDS_RANGE, , "ends-range") /* Sort by 5' and 3' best/biggest \
matches, one match per column, very \
fmap like but better... */ \
_(ZMAPOVERLAP_COMPLEX_INTERLEAVE, , "complex-interleave")/* all features with same name in a \
single sub-column, several names in one \
column but no 2 features overlap. */ \
_(ZMAPOVERLAP_COMPLEX_NO_INTERLEAVE, , "complex-interleave") /* as ZMAPOVERLAP_COMPLEX but no interleaving of \
features with different names. */ \
_(ZMAPOVERLAP_COMPLEX_RANGE, , "complex-range") /* All features with same name in a \
single column if they overlap the \
'mark' range, all other features in \
a single column. */ \
_(ZMAPOVERLAP_COMPLEX_LIMIT, , "complex-limit") /* As ZMAPOVERLAP_COMPLEX_RANGE but constrain matches \
to be colinear within range or are truncated. */
/* We should do this automatically or not at all..... */
#define ZMAPOVERLAP_START ZMAPOVERLAP_COMPLETE
#define ZMAPOVERLAP_END ZMAPOVERLAP_COMPLEX_LIMIT
ZMAP_DEFINE_ENUM(ZMapStyleOverlapMode, ZMAP_STYLE_OVERLAP_MODE_LIST) ;
#define ZMAP_STYLE_3_FRAME_LIST(_) \
_(ZMAPSTYLE_3_FRAME_INVALID, , "invalid") /**< invalid mode */ \
_(ZMAPSTYLE_3_FRAME_NEVER, , "never") /**< Not frame sensitive. */ \
_(ZMAPSTYLE_3_FRAME_ALWAYS, , "always") /**< Display normally and as 3 cols in 3 frame mode. */ \
_(ZMAPSTYLE_3_FRAME_ONLY_3, , "only_3") /**< Only dislay in 3 frame mode as 3 cols. */ \
_(ZMAPSTYLE_3_FRAME_ONLY_1, , "only_1") /**< Only display in 3 frame mode as 1 col. */
_(ZMAPSTYLE_3_FRAME_ONLY_3, , "only-3") /**< Only dislay in 3 frame mode as 3 cols. */ \
_(ZMAPSTYLE_3_FRAME_ONLY_1, , "only-1") /**< Only display in 3 frame mode as 1 col. */
ZMAP_DEFINE_ENUM(ZMapStyle3FrameMode, ZMAP_STYLE_3_FRAME_LIST);
......@@ -210,40 +243,6 @@ _(ZMAPSCORE_PERCENT, , "percent")
ZMAP_DEFINE_ENUM(ZMapStyleScoreMode, ZMAP_STYLE_SCORE_MODE_LIST) ;
/* Specifies how features in columns should be overlapped for compact display. */
#define ZMAP_STYLE_OVERLAP_MODE_LIST(_) \
_(ZMAPOVERLAP_INVALID, , "invalid") \
_(ZMAPOVERLAP_COMPLETE, , "complete") /* draw on top - default */ \
_(ZMAPOVERLAP_OVERLAP, , "overlap") /* bump if feature coords overlap. */ \
_(ZMAPOVERLAP_POSITION, , "position") /* bump if features start at same coord. */ \
_(ZMAPOVERLAP_NAME, , "name") /* one column per homol target */ \
_(ZMAPOVERLAP_OSCILLATE, , "oscillate") /* Oscillate between one column and another... \
Useful for displaying tile paths. */ \
_(ZMAPOVERLAP_ITEM_OVERLAP, , "item_overlap") /* bump if item coords overlap in canvas space... */ \
_(ZMAPOVERLAP_SIMPLE, , "simple") /* one column per feature, for testing... */ \
_(ZMAPOVERLAP_ENDS_RANGE, , "ends_range") /* Sort by 5' and 3' best/biggest \
matches, one match per column, very \
fmap like but better... */ \
_(ZMAPOVERLAP_COMPLEX_INTERLEAVE, , "complex_interleave")/* all features with same name in a \
single sub-column, several names in one \
column but no 2 features overlap. */ \
_(ZMAPOVERLAP_COMPLEX_NO_INTERLEAVE, , "complex_interleave") /* as ZMAPOVERLAP_COMPLEX but no interleaving of \
features with different names. */ \
_(ZMAPOVERLAP_COMPLEX_RANGE, , "complex_range") /* All features with same name in a \
single column if they overlap the \
'mark' range, all other features in \
a single column. */ \
_(ZMAPOVERLAP_COMPLEX_LIMIT, , "complex_limit") /* As ZMAPOVERLAP_COMPLEX_RANGE but constrain matches \
to be colinear within range or are truncated. */
ZMAP_DEFINE_ENUM(ZMapStyleOverlapMode, ZMAP_STYLE_OVERLAP_MODE_LIST) ;
/* We should do this automatically or not at all..... */
#define ZMAPOVERLAP_START ZMAPOVERLAP_COMPLETE
#define ZMAPOVERLAP_END ZMAPOVERLAP_COMPLEX_LIMIT
/* Note the naming here in the macros. ZMAP_TYPE_FEATURE_TYPE_STYLE seemed confusing... */
#define ZMAP_TYPE_FEATURE_STYLE (zMapFeatureTypeStyleGetType())
......
......@@ -28,9 +28,9 @@
*
* Exported functions: See ZMap/zmapStyle.h
* HISTORY:
* Last edited: Nov 14 08:02 2008 (rds)
* Last edited: Nov 17 16:51 2008 (edgrif)
* Created: Mon Feb 26 09:12:18 2007 (edgrif)
* CVS info: $Id: zmapStyle.c,v 1.21 2008-11-14 08:02:36 rds Exp $
* CVS info: $Id: zmapStyle.c,v 1.22 2008-11-17 17:07:02 edgrif Exp $
*-------------------------------------------------------------------
*/
......@@ -108,6 +108,8 @@ enum
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
#define SETMODEFIELD(STYLE, COPY_STYLE, VALUE, FIELD_TYPE, FIELD_SET, FIELD) \
if (!COPY_STYLE || (COPY_STYLE)->FIELD_SET) \
{ \
......@@ -119,6 +121,19 @@ enum
(STYLE)->FIELD_SET = TRUE ; \
} \
}
#endif /* ED_G_NEVER_INCLUDE_THIS_CODE */
#define SETMODEFIELD(STYLE, COPY_STYLE, VALUE, FIELD_TYPE, FIELD_SET, FIELD) \
if (!COPY_STYLE || (COPY_STYLE)->FIELD_SET) \
{ \
if (((STYLE)->FIELD = g_value_get_uint((VALUE)))) \
(STYLE)->FIELD_SET = TRUE ; \
else \
(STYLE)->FIELD_SET = FALSE ; \
}
#define SETBOOLFIELD(STYLE, COPY_STYLE, VALUE, FIELD_SET, FIELD) \
if (!COPY_STYLE || (COPY_STYLE)->FIELD_SET) \
......@@ -1925,9 +1940,9 @@ static void zmap_feature_type_style_class_init(ZMapFeatureTypeStyleClass style_c
STYLE_PROP_COLUMN_DISPLAY_MODE,
g_param_spec_uint(ZMAPSTYLE_PROPERTY_DISPLAY_MODE, "display-mode",
"Display mode",
ZMAPSTYLE_COLDISPLAY_HIDE,
ZMAPSTYLE_COLDISPLAY_INVALID,
ZMAPSTYLE_COLDISPLAY_SHOW,
ZMAPSTYLE_COLDISPLAY_SHOW_HIDE,
ZMAPSTYLE_COLDISPLAY_INVALID,
ZMAP_PARAM_STATIC_RW));
......@@ -1936,18 +1951,18 @@ static void zmap_feature_type_style_class_init(ZMapFeatureTypeStyleClass style_c
STYLE_PROP_OVERLAP_MODE,
g_param_spec_uint(ZMAPSTYLE_PROPERTY_OVERLAP_MODE, "overlap-mode",
"The Overlap Mode",
ZMAPOVERLAP_START,
ZMAPOVERLAP_INVALID,
ZMAPOVERLAP_END,
ZMAPOVERLAP_START,
ZMAPOVERLAP_INVALID,
ZMAP_PARAM_STATIC_RW));
/* overlap default */
g_object_class_install_property(gobject_class,
STYLE_PROP_OVERLAP_DEFAULT,
g_param_spec_uint(ZMAPSTYLE_PROPERTY_DEFAULT_OVERLAP_MODE, "default-overlap-mode",
"The Default Overlap Mode",
ZMAPOVERLAP_START,
ZMAPOVERLAP_INVALID,
ZMAPOVERLAP_END,
ZMAPOVERLAP_START,
ZMAPOVERLAP_INVALID,
ZMAP_PARAM_STATIC_RW));
/* bump spacing */
g_object_class_install_property(gobject_class,
......@@ -1962,9 +1977,9 @@ static void zmap_feature_type_style_class_init(ZMapFeatureTypeStyleClass style_c
STYLE_PROP_FRAME_MODE,
g_param_spec_uint(ZMAPSTYLE_PROPERTY_FRAME_MODE, "3 frame display mode",
"Defines frame sensitive display in 3 frame mode.",
ZMAPSTYLE_3_FRAME_NEVER,
ZMAPSTYLE_3_FRAME_INVALID,
ZMAPSTYLE_3_FRAME_ONLY_1,
ZMAPSTYLE_3_FRAME_NEVER,
ZMAPSTYLE_3_FRAME_INVALID,
ZMAP_PARAM_STATIC_RW));
......@@ -1995,9 +2010,9 @@ static void zmap_feature_type_style_class_init(ZMapFeatureTypeStyleClass style_c
STYLE_PROP_SCORE_MODE,
g_param_spec_uint(ZMAPSTYLE_PROPERTY_SCORE_MODE, "score-mode",
"Score Mode",
ZMAPSTYLE_GRAPH_LINE,
ZMAPSCORE_INVALID,
ZMAPSCORE_PERCENT,
ZMAPSCORE_WIDTH,
ZMAPSCORE_INVALID,
ZMAP_PARAM_STATIC_RW));
/* min score */
g_object_class_install_property(gobject_class,
......@@ -2079,7 +2094,8 @@ static void zmap_feature_type_style_class_init(ZMapFeatureTypeStyleClass style_c
STYLE_PROP_GRAPH_MODE,
g_param_spec_uint(ZMAPSTYLE_PROPERTY_GRAPH_MODE, "graph-mode",
"Graph Mode",
ZMAPSTYLE_GRAPH_INVALID, ZMAPSTYLE_GRAPH_HISTOGRAM,
ZMAPSTYLE_GRAPH_INVALID,
ZMAPSTYLE_GRAPH_HISTOGRAM,
ZMAPSTYLE_GRAPH_INVALID,
ZMAP_PARAM_STATIC_RW));
/* Graph baseline value. */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment