diff --git a/src/zmapWindow/zmapWindowItemFeatureSet.c b/src/zmapWindow/zmapWindowItemFeatureSet.c index 8bbae83f0a55ceb2947e373e34d4b9660bcad61d..a174e842a7066e0ed714911e04ec026064d180e5 100755 --- a/src/zmapWindow/zmapWindowItemFeatureSet.c +++ b/src/zmapWindow/zmapWindowItemFeatureSet.c @@ -27,9 +27,9 @@ * * Exported functions: See XXXXXXXXXXXXX.h * HISTORY: - * Last edited: Apr 16 11:15 2009 (rds) + * Last edited: Apr 20 11:59 2009 (rds) * Created: Mon Jul 30 13:09:33 2007 (rds) - * CVS info: $Id: zmapWindowItemFeatureSet.c,v 1.10 2009-04-16 14:37:37 rds Exp $ + * CVS info: $Id: zmapWindowItemFeatureSet.c,v 1.11 2009-04-20 11:05:49 rds Exp $ *------------------------------------------------------------------- */ #include <string.h> /* memset */ @@ -132,21 +132,40 @@ GType zmapWindowItemFeatureSetGetType(void) ZMapWindowItemFeatureSetData zmapWindowItemFeatureSetCreate(ZMapWindow window, FooCanvasGroup *column_container, - ZMapFeatureTypeStyle style, + GQuark feature_set_unique_id, + GQuark feature_set_original_id, /* unused! */ + GList *style_list, ZMapStrand strand, ZMapFrame frame) { - ZMapWindowItemFeatureSetData set_data; + ZMapWindowItemFeatureSetData set_data = NULL; + + g_return_val_if_fail(window != NULL, set_data); + g_return_val_if_fail(column_container != NULL, set_data); + g_return_val_if_fail(feature_set_unique_id != 0, set_data); if((set_data = g_object_new(zmapWindowItemFeatureSetGetType(), NULL))) { + GList *list; + set_data->window = window; set_data->strand = strand; set_data->frame = frame; - set_data->style_id = zMapStyleGetID(style); - set_data->unique_id = zMapStyleGetUniqueID(style); + /* set_data->style_id = 0; /* feature_set_original_id */ + set_data->unique_id = feature_set_unique_id; + + if((list = g_list_first(style_list))) + { + do + { + ZMapFeatureTypeStyle style; + + style = (ZMapFeatureTypeStyle)(list->data); - zmapWindowItemFeatureSetStyleFromStyle(set_data, style); + zmapWindowItemFeatureSetStyleFromStyle(set_data, style); + } + while((list = g_list_next(list))); + } set_data->column_container = column_container; @@ -263,6 +282,19 @@ ZMapFeatureTypeStyle zmapWindowItemFeatureSetStyleFromID(ZMapWindowItemFeatureSe return duplicated; } +/* Warning! This is dynamic and will pick the original id over unique id */ +GQuark zmapWindowItemFeatureSetColumnDisplayName(ZMapWindowItemFeatureSetData set_data) +{ + ZMapFeatureSet feature_set; + GQuark display_id = 0; + + if((feature_set = zmapWindowItemFeatureSetRecoverFeatureSet(set_data))) + display_id = feature_set->original_id; + else + display_id = set_data->unique_id; + + return display_id; +} ZMapWindow zmapWindowItemFeatureSetGetWindow(ZMapWindowItemFeatureSetData set_data) { @@ -439,7 +471,7 @@ gboolean zmapWindowItemFeatureSetIsFrameSpecific(ZMapWindowItemFeatureSetData se if(frame_mode == ZMAPSTYLE_3_FRAME_INVALID) { - zMapLogWarning("Frame mode for column %s is invalid.", g_quark_to_string(set_data->style_id)); + zMapLogWarning("Frame mode for column %s is invalid.", g_quark_to_string(set_data->unique_id)); set_data->settings.frame_specific = FALSE; } } @@ -757,6 +789,7 @@ static void extract_value_from_style_table(gpointer key, gpointer value, gpointe g_value_set_double(value_data->gvalue, style_width); } break; + case ITEM_FEATURE_SET_STRAND_SPECIFIC: case ITEM_FEATURE_SET_SHOW_WHEN_EMPTY: case ITEM_FEATURE_SET_DEFERRED: { @@ -777,6 +810,8 @@ static void extract_value_from_style_table(gpointer key, gpointer value, gpointe break; case ITEM_FEATURE_SET_FRAME_MODE: case ITEM_FEATURE_SET_VISIBLE: + case ITEM_FEATURE_SET_OVERLAP_MODE: + case ITEM_FEATURE_SET_DEFAULT_OVERLAP_MODE: { guint style_version = 0, current; diff --git a/src/zmapWindow/zmapWindowItemFeatureSet.h b/src/zmapWindow/zmapWindowItemFeatureSet.h index 5ebaf8735775661159e21e445c2c1fa57016b44d..3feec871e0ded7e7b019142eb38621d9535e95e6 100755 --- a/src/zmapWindow/zmapWindowItemFeatureSet.h +++ b/src/zmapWindow/zmapWindowItemFeatureSet.h @@ -27,9 +27,9 @@ * * Exported functions: See XXXXXXXXXXXXX.h * HISTORY: - * Last edited: Apr 16 11:17 2009 (rds) + * Last edited: Apr 17 16:32 2009 (rds) * Created: Fri Feb 6 15:32:46 2009 (rds) - * CVS info: $Id: zmapWindowItemFeatureSet.h,v 1.5 2009-04-16 14:37:46 rds Exp $ + * CVS info: $Id: zmapWindowItemFeatureSet.h,v 1.6 2009-04-20 11:06:03 rds Exp $ *------------------------------------------------------------------- */ @@ -64,7 +64,9 @@ GType zmapWindowItemFeatureSetGetType(void); ZMapWindowItemFeatureSetData zmapWindowItemFeatureSetCreate(ZMapWindow window, FooCanvasGroup *column_container, - ZMapFeatureTypeStyle style, + GQuark feature_set_unique_id, + GQuark feature_set_original_id, + GList *style_list, ZMapStrand strand, ZMapFrame frame); @@ -76,7 +78,7 @@ ZMapFeatureTypeStyle zmapWindowItemFeatureSetStyleFromStyle(ZMapWindowItemFeatur ZMapFeatureTypeStyle style2copy); ZMapFeatureTypeStyle zmapWindowItemFeatureSetStyleFromID(ZMapWindowItemFeatureSetData set_data, GQuark style_unique_id); - +GQuark zmapWindowItemFeatureSetColumnDisplayName(ZMapWindowItemFeatureSetData set_data); ZMapWindow zmapWindowItemFeatureSetGetWindow(ZMapWindowItemFeatureSetData set_data); ZMapStrand zmapWindowItemFeatureSetGetStrand(ZMapWindowItemFeatureSetData set_data); ZMapFrame zmapWindowItemFeatureSetGetFrame (ZMapWindowItemFeatureSetData set_data); @@ -97,9 +99,10 @@ ZMapStyleColumnDisplayState zmapWindowItemFeatureSetGetDisplay(ZMapWindowItemFea void zmapWindowItemFeatureSetDisplay(ZMapWindowItemFeatureSetData set_data, ZMapStyleColumnDisplayState state); gboolean zmapWindowItemFeatureSetShowWhenEmpty(ZMapWindowItemFeatureSetData set_data); +ZMapStyle3FrameMode zmapWindowItemFeatureSetGetFrameMode(ZMapWindowItemFeatureSetData set_data); gboolean zmapWindowItemFeatureSetIsFrameSpecific(ZMapWindowItemFeatureSetData set_data, ZMapStyle3FrameMode *frame_mode_out); -ZMapStyle3FrameMode zmapWindowItemFeatureSetGetFrameMode(ZMapWindowItemFeatureSetData set_data); +gboolean zmapWindowItemFeatureSetIsStrandSpecific(ZMapWindowItemFeatureSetData set_data); ZMapStyleOverlapMode zmapWindowItemFeatureSetGetOverlapMode(ZMapWindowItemFeatureSetData set_data); ZMapStyleOverlapMode zmapWindowItemFeatureSetGetDefaultOverlapMode(ZMapWindowItemFeatureSetData set_data); gboolean zmapWindowItemFeatureSetGetDeferred(ZMapWindowItemFeatureSetData set_data); diff --git a/src/zmapWindow/zmapWindowItemFeatureSet_I.h b/src/zmapWindow/zmapWindowItemFeatureSet_I.h index 1498423c037b2fa9f6fe154591acaef06ddd44ac..62f5855a7481e4a7c55381c95614de01f8277aec 100755 --- a/src/zmapWindow/zmapWindowItemFeatureSet_I.h +++ b/src/zmapWindow/zmapWindowItemFeatureSet_I.h @@ -27,9 +27,9 @@ * * Exported functions: See XXXXXXXXXXXXX.h * HISTORY: - * Last edited: Apr 16 11:15 2009 (rds) + * Last edited: Apr 17 16:21 2009 (rds) * Created: Fri Feb 6 11:49:03 2009 (rds) - * CVS info: $Id: zmapWindowItemFeatureSet_I.h,v 1.5 2009-04-16 14:37:59 rds Exp $ + * CVS info: $Id: zmapWindowItemFeatureSet_I.h,v 1.6 2009-04-20 11:06:08 rds Exp $ *------------------------------------------------------------------- */ @@ -57,7 +57,8 @@ typedef struct _zmapWindowItemFeatureSetDataStruct FooCanvasGroup *column_container; - GQuark style_id, unique_id; + //GQuark style_id; + GQuark unique_id; /* We keep the features sorted by position and size so we can cursor through them... */ gboolean sorted ;