From b1cb1d4718381baac6e7dc4cbafa294262d25a29 Mon Sep 17 00:00:00 2001 From: edgrif <edgrif> Date: Wed, 28 Jun 2006 09:18:35 +0000 Subject: [PATCH] remove the hash table of styles for features, we hold it in the canvas items now. --- src/include/ZMap/zmapFeature.h | 7 ++--- src/zmapFeature/zmapFeature.c | 57 ++-------------------------------- 2 files changed, 5 insertions(+), 59 deletions(-) diff --git a/src/include/ZMap/zmapFeature.h b/src/include/ZMap/zmapFeature.h index 64c0e91ef..65383a2b9 100755 --- a/src/include/ZMap/zmapFeature.h +++ b/src/include/ZMap/zmapFeature.h @@ -25,9 +25,9 @@ * Description: Data structures describing a sequence feature. * * HISTORY: - * Last edited: Jun 21 16:40 2006 (edgrif) + * Last edited: Jun 28 10:15 2006 (edgrif) * Created: Fri Jun 11 08:37:19 2004 (edgrif) - * CVS info: $Id: zmapFeature.h,v 1.75 2006-06-22 08:15:08 edgrif Exp $ + * CVS info: $Id: zmapFeature.h,v 1.76 2006-06-28 09:18:35 edgrif Exp $ *------------------------------------------------------------------- */ #ifndef ZMAP_FEATURE_H @@ -301,9 +301,6 @@ typedef struct ZMapFeatureSetStruct_ drawn, this applies only to the set * itself, _not_ the features within * the set. */ - GHashTable *feature_styles ; /* Cache of styles for features within - * the feature set. */ - GData *features ; /* A set of ZMapFeatureStruct. */ } ZMapFeatureSetStruct, *ZMapFeatureSet ; diff --git a/src/zmapFeature/zmapFeature.c b/src/zmapFeature/zmapFeature.c index 3790af0a2..3cd92b463 100755 --- a/src/zmapFeature/zmapFeature.c +++ b/src/zmapFeature/zmapFeature.c @@ -27,9 +27,9 @@ * * Exported functions: See zmapView_P.h * HISTORY: - * Last edited: Jun 21 16:29 2006 (edgrif) + * Last edited: Jun 28 10:17 2006 (edgrif) * Created: Fri Jul 16 13:05:58 2004 (edgrif) - * CVS info: $Id: zmapFeature.c,v 1.37 2006-06-22 08:15:08 edgrif Exp $ + * CVS info: $Id: zmapFeature.c,v 1.38 2006-06-28 09:18:35 edgrif Exp $ *------------------------------------------------------------------- */ @@ -93,7 +93,7 @@ static void removeNotFreeFeature(GQuark key_id, gpointer data, gpointer user_dat static void destroyFeatureSet(gpointer data) ; static void removeNotFreeFeatureSet(GQuark key_id, gpointer data, gpointer user_data) ; -static void styleDestroyCB(gpointer data) ; + /* ! * A set of functions for allocating, populating and destroying features. @@ -556,7 +556,6 @@ ZMapFeatureSet zMapFeatureSetIDCreate(GQuark original_id, GQuark unique_id, feature_set->unique_id = unique_id ; feature_set->original_id = original_id ; feature_set->style = style ; - feature_set->feature_styles = g_hash_table_new_full(NULL, NULL, NULL, styleDestroyCB) ; if (!features) g_datalist_init(&(feature_set->features)) ; @@ -567,41 +566,6 @@ ZMapFeatureSet zMapFeatureSetIDCreate(GQuark original_id, GQuark unique_id, } -/* Adds a style to the list of feature styles using the styles unique_id as the key. - * NOTE that if the style is already there it is not added as this would overwrite - * the existing style. */ -gboolean zMapFeatureSetAddStyle(ZMapFeatureSet feature_set, ZMapFeatureTypeStyle new_style) -{ - gboolean result = FALSE ; - ZMapFeatureTypeStyle style ; - - zMapAssert(feature_set && new_style) ; - - if (!(style = g_hash_table_lookup(feature_set->feature_styles, - GINT_TO_POINTER(new_style->unique_id)))) - { - g_hash_table_insert(feature_set->feature_styles, - GINT_TO_POINTER(new_style->unique_id), new_style) ; - - result = TRUE ; - } - - return result ; -} - - -/* Finds a feature style using the styles unique_id. */ -ZMapFeatureTypeStyle zMapFeatureSetFindStyle(ZMapFeatureSet feature_set, GQuark style_id) -{ - ZMapFeatureTypeStyle style ; - - zMapAssert(feature_set && style_id) ; - - style = g_hash_table_lookup(feature_set->feature_styles, - GINT_TO_POINTER(style_id)) ; - - return style ; -} @@ -677,8 +641,6 @@ void zMapFeatureSetDestroy(ZMapFeatureSet feature_set, gboolean free_data) } g_datalist_clear(&(feature_set->features)) ; - g_hash_table_destroy(feature_set->feature_styles) ; - g_free(feature_set) ; return ; @@ -1403,16 +1365,3 @@ static void doNewFeatures(GQuark key_id, gpointer data, gpointer user_data) } -/* Called when a style is destroyed and the styles hash of feature_styles is destroyed. */ -static void styleDestroyCB(gpointer data) -{ - ZMapFeatureTypeStyle style = (ZMapFeatureTypeStyle)data ; - - zMapFeatureTypeDestroy(style) ; - - return ; -} - - - - -- GitLab