From 764a7ef487a5f0802e5769d57837985abc252711 Mon Sep 17 00:00:00 2001 From: rds <rds> Date: Thu, 11 Jun 2009 14:20:04 +0000 Subject: [PATCH] remove lazy loaded struct as its use was zero add block and align ids so that empty columns can be removed from FToI hash --- .../items/zmapWindowContainerFeatureSet.c | 61 ++++++++----------- .../items/zmapWindowContainerFeatureSet.h | 6 +- .../items/zmapWindowContainerFeatureSet_I.h | 24 +++----- 3 files changed, 37 insertions(+), 54 deletions(-) diff --git a/src/zmapWindow/items/zmapWindowContainerFeatureSet.c b/src/zmapWindow/items/zmapWindowContainerFeatureSet.c index db29ece2f..ab8b8229d 100755 --- a/src/zmapWindow/items/zmapWindowContainerFeatureSet.c +++ b/src/zmapWindow/items/zmapWindowContainerFeatureSet.c @@ -27,9 +27,9 @@ * * Exported functions: See XXXXXXXXXXXXX.h * HISTORY: - * Last edited: Jun 10 14:10 2009 (rds) + * Last edited: Jun 11 08:26 2009 (rds) * Created: Mon Jul 30 13:09:33 2007 (rds) - * CVS info: $Id: zmapWindowContainerFeatureSet.c,v 1.6 2009-06-10 14:00:38 rds Exp $ + * CVS info: $Id: zmapWindowContainerFeatureSet.c,v 1.7 2009-06-11 14:20:04 rds Exp $ *------------------------------------------------------------------- */ #include <string.h> /* memset */ @@ -130,6 +130,8 @@ GType zmapWindowContainerFeatureSetGetType(void) ZMapWindowContainerFeatureSet zmapWindowContainerFeatureSetAugment(ZMapWindowContainerFeatureSet container_set, ZMapWindow window, + GQuark align_id, + GQuark block_id, GQuark feature_set_unique_id, GQuark feature_set_original_id, /* unused! */ GList *style_list, @@ -145,8 +147,10 @@ ZMapWindowContainerFeatureSet zmapWindowContainerFeatureSetAugment(ZMapWindowCon container_set->window = window; container_set->strand = strand; container_set->frame = frame; + container_set->align_id = align_id; + container_set->block_id = block_id; container_set->unique_id = feature_set_unique_id; - + if((list = g_list_first(style_list))) { do @@ -257,11 +261,7 @@ ZMapFeatureTypeStyle zmapWindowContainerFeatureSetStyleFromStyle(ZMapWindowConta if(!(duplicated = zmapWindowStyleTableFind(container_set->style_table, zMapStyleGetUniqueID(style2copy)))) { - int s = sizeof(container_set->lazy_loaded); - duplicated = zmapWindowStyleTableAddCopy(container_set->style_table, style2copy); - - memset(&container_set->lazy_loaded, 0, s); } return duplicated; @@ -398,14 +398,10 @@ gboolean zmapWindowContainerFeatureSetShowWhenEmpty(ZMapWindowContainerFeatureSe { gboolean show = FALSE; - if(!container_set->lazy_loaded.show_when_empty) - { - g_object_get(G_OBJECT(container_set), - ZMAPSTYLE_PROPERTY_SHOW_WHEN_EMPTY, &(container_set->settings.show_when_empty), - NULL); - container_set->lazy_loaded.show_when_empty = 1; - } - + g_object_get(G_OBJECT(container_set), + ZMAPSTYLE_PROPERTY_SHOW_WHEN_EMPTY, &(container_set->settings.show_when_empty), + NULL); + show = container_set->settings.show_when_empty; return show; @@ -417,14 +413,10 @@ ZMapStyle3FrameMode zmapWindowContainerFeatureSetGetFrameMode(ZMapWindowContaine g_return_val_if_fail(ZMAP_IS_CONTAINER_FEATURESET(container_set), frame_mode); - if(!container_set->lazy_loaded.frame_mode) - { - g_object_get(G_OBJECT(container_set), - ZMAPSTYLE_PROPERTY_FRAME_MODE, &(container_set->settings.frame_mode), - NULL); - //container_set->lazy_loaded.frame_mode = 1; - } - + g_object_get(G_OBJECT(container_set), + ZMAPSTYLE_PROPERTY_FRAME_MODE, &(container_set->settings.frame_mode), + NULL); + frame_mode = container_set->settings.frame_mode; return frame_mode; @@ -438,21 +430,16 @@ gboolean zmapWindowContainerFeatureSetIsFrameSpecific(ZMapWindowContainerFeature g_return_val_if_fail(ZMAP_IS_CONTAINER_FEATURESET(container_set), FALSE); - if(!container_set->lazy_loaded.frame_specific) - { - frame_mode = zmapWindowContainerFeatureSetGetFrameMode(container_set) ; + frame_mode = zmapWindowContainerFeatureSetGetFrameMode(container_set) ; - //container_set->lazy_loaded.frame_specific = 1; - - if(frame_mode != ZMAPSTYLE_3_FRAME_NEVER) - container_set->settings.frame_specific = TRUE; - - if(frame_mode == ZMAPSTYLE_3_FRAME_INVALID) - { - zMapLogWarning("Frame mode for column %s is invalid.", g_quark_to_string(container_set->unique_id)); - container_set->settings.frame_specific = FALSE; - } - } + if(frame_mode != ZMAPSTYLE_3_FRAME_NEVER) + container_set->settings.frame_specific = TRUE; + + if(frame_mode == ZMAPSTYLE_3_FRAME_INVALID) + { + zMapLogWarning("Frame mode for column %s is invalid.", g_quark_to_string(container_set->unique_id)); + container_set->settings.frame_specific = FALSE; + } frame_specific = container_set->settings.frame_specific; diff --git a/src/zmapWindow/items/zmapWindowContainerFeatureSet.h b/src/zmapWindow/items/zmapWindowContainerFeatureSet.h index ac31ec684..d11cfe453 100755 --- a/src/zmapWindow/items/zmapWindowContainerFeatureSet.h +++ b/src/zmapWindow/items/zmapWindowContainerFeatureSet.h @@ -27,9 +27,9 @@ * * Exported functions: See XXXXXXXXXXXXX.h * HISTORY: - * Last edited: Jun 6 20:48 2009 (rds) + * Last edited: Jun 11 08:25 2009 (rds) * Created: Wed Dec 3 08:21:03 2008 (rds) - * CVS info: $Id: zmapWindowContainerFeatureSet.h,v 1.4 2009-06-07 08:14:38 rds Exp $ + * CVS info: $Id: zmapWindowContainerFeatureSet.h,v 1.5 2009-06-11 14:20:12 rds Exp $ *------------------------------------------------------------------- */ @@ -66,6 +66,8 @@ GType zmapWindowContainerFeatureSetGetType(void); ZMapWindowContainerFeatureSet zmapWindowContainerFeatureSetAugment(ZMapWindowContainerFeatureSet container_set, ZMapWindow window, + GQuark align_id, + GQuark block_id, GQuark feature_set_unique_id, GQuark feature_set_original_id, /* unused! */ GList *style_list, diff --git a/src/zmapWindow/items/zmapWindowContainerFeatureSet_I.h b/src/zmapWindow/items/zmapWindowContainerFeatureSet_I.h index 0947c0463..8614be4eb 100755 --- a/src/zmapWindow/items/zmapWindowContainerFeatureSet_I.h +++ b/src/zmapWindow/items/zmapWindowContainerFeatureSet_I.h @@ -27,9 +27,9 @@ * * Exported functions: See XXXXXXXXXXXXX.h * HISTORY: - * Last edited: Jun 8 10:38 2009 (rds) + * Last edited: Jun 11 08:14 2009 (rds) * Created: Fri Feb 6 11:49:03 2009 (rds) - * CVS info: $Id: zmapWindowContainerFeatureSet_I.h,v 1.5 2009-06-08 09:43:52 rds Exp $ + * CVS info: $Id: zmapWindowContainerFeatureSet_I.h,v 1.6 2009-06-11 14:20:19 rds Exp $ *------------------------------------------------------------------- */ @@ -51,6 +51,13 @@ typedef struct _zmapWindowContainerFeatureSetStruct ZMapFrame frame ; GHashTable *style_table ; + /* Empty columns are only hidden ATM and as they have no + * ZMapFeatureSet removing them from the FToI hash becomes difficult + * without the align, block and set ids. No doubt it'l be true for + * empty block and align containers too at some point. */ + + GQuark align_id; + GQuark block_id; GQuark unique_id; /* We keep the features sorted by position and size so we can cursor through them... */ @@ -62,19 +69,6 @@ typedef struct _zmapWindowContainerFeatureSetStruct /* These fields are used for some of the more exotic column bumping. */ gboolean hidden_bump_features ; /* Features were hidden because they * are out of the marked range. */ -#ifdef NEVER_INCLUDE - GList *extra_items ; /* Match backgrounds etc. */ - - GList *gaps_added_items ; /* List of features where gap data was added. */ -#endif - - struct - { - unsigned int frame_mode : 1; - unsigned int frame_specific : 1; - unsigned int display_state : 1; - unsigned int show_when_empty : 1; - }lazy_loaded; struct { -- GitLab