ARB
Macros | Functions
ad_colorset.h File Reference
#include "arbdb_base.h"
#include <arb_strarray.h>
Include dependency graph for ad_colorset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GB_COLORGROUP_ENTRY   "ARB_color"
 
#define GB_COLOR_GROUPS   12
 

Functions

int GBT_get_color_group (GBDATA *gb_item)
 
GB_ERROR GBT_set_color_group (GBDATA *gb_item, int color_group)
 
GBDATAGBT_colorset_root (GBDATA *gb_main, const char *itemname)
 
void GBT_get_colorset_names (ConstStrArray &colorsetNames, GBDATA *gb_colorset_root)
 
GBDATAGBT_find_colorset (GBDATA *gb_colorset_root, const char *name)
 
GBDATAGBT_find_or_create_colorset (GBDATA *gb_colorset_root, const char *name)
 
GB_ERROR GBT_load_colorset (GBDATA *gb_colorset, ConstStrArray &colorsetDefs)
 
GB_ERROR GBT_save_colorset (GBDATA *gb_colorset, CharPtrArray &colorsetDefs)
 

Macro Definition Documentation

#define GB_COLORGROUP_ENTRY   "ARB_color"

Definition at line 21 of file ad_colorset.h.

Referenced by GBT_get_color_group(), GBT_set_color_group(), and remove_dup_colors().

#define GB_COLOR_GROUPS   12

Definition at line 22 of file ad_colorset.h.

Referenced by GBT_get_color_group(), and GBT_set_color_group().

Function Documentation

int GBT_get_color_group ( GBDATA gb_item)

return color group of item (special, gene, ...)

Parameters
gb_itemthe item
Returns
color group if defined (0 if none)

Definition at line 16 of file ad_colorset.cxx.

References GB_COLOR_GROUPS, GB_COLORGROUP_ENTRY, GB_entry(), and GB_read_int().

Referenced by AP_TreeShader::calc_leaf_GC(), create_colorset_representation(), getDrawGcs(), AWT_graphic_tree::group_tree(), and mark_colored_cb().

GB_ERROR GBT_set_color_group ( GBDATA gb_item,
int  color_group 
)

set color group of item

Parameters
gb_itemthe item
color_groupthe color group [1 .. GB_COLOR_GROUPS] or zero to delete it.
Returns
error if sth went wrong

Please note that this function may be bypassed by user; e.g. via 'write to fields of listed'.

Definition at line 31 of file ad_colorset.cxx.

References GB_COLOR_GROUPS, GB_COLORGROUP_ENTRY, GB_delete(), GB_entry(), GBS_global_string(), GBT_write_int(), and NULp.

Referenced by clear_all_colors(), colorize_marked_cb(), colorize_queried_cb(), and restore_colorset_representation().

GBDATA* GBT_colorset_root ( GBDATA gb_main,
const char itemname 
)

return root container for colorsets

Parameters
gb_maindatabase
itemsnamename of items ( == ItemSelector::items_name)

Definition at line 52 of file ad_colorset.cxx.

References GB_CREATE_CONTAINER, GB_search(), and NULp.

Referenced by GBT_commit_rename_session(), and get_colorset_root().

void GBT_get_colorset_names ( ConstStrArray colorsetNames,
GBDATA gb_colorset_root 
)

retrieve names of existing colorsets from DB

Parameters
colorsetNamesresult-param: will be filled with colorset names
gb_colorset_rootresult of GBT_colorset_root()

Definition at line 62 of file ad_colorset.cxx.

References GB_entry(), GB_nextEntry(), GBT_get_name(), and ConstStrArray::put().

Referenced by GBT_commit_rename_session(), and update_colorset_selection_list().

GBDATA* GBT_find_colorset ( GBDATA gb_colorset_root,
const char name 
)

lookup (existing) colorset

Parameters
gb_colorset_rootresult of GBT_colorset_root()
namecolorset name
Returns
colorset DB entry (or NULp, in which case an error MAY be exported)

Definition at line 76 of file ad_colorset.cxx.

References GBT_find_item_rel_item_data().

Referenced by GBT_commit_rename_session(), and loadsave_colorset_cb().

GBDATA* GBT_find_or_create_colorset ( GBDATA gb_colorset_root,
const char name 
)

create a new colorset

Parameters
gb_colorset_rootresult of GBT_colorset_root()
namecolorset name
Returns
colorset DB entry (or NULp, in which case an error IS exported)

Definition at line 85 of file ad_colorset.cxx.

References GBT_find_or_create_item_rel_item_data().

Referenced by loadsave_colorset_cb().

GB_ERROR GBT_load_colorset ( GBDATA gb_colorset,
ConstStrArray colorsetDefs 
)

load a colorset

Parameters
gb_colorsetresult of GBT_find_colorset()
colorsetDefsresult-param: will be filled with colorset-entries ("itemname=color")
Returns
error if sth went wrong

Definition at line 94 of file ad_colorset.cxx.

References error(), GB_await_error(), GB_have_error(), GBS_global_string(), GBT_read_string(), GBT_splitNdestroy_string(), and NULp.

Referenced by GBT_commit_rename_session(), and loadsave_colorset_cb().

GB_ERROR GBT_save_colorset ( GBDATA gb_colorset,
CharPtrArray colorsetDefs 
)

saves a colorset

Parameters
gb_colorsetresult of GBT_find_colorset() or GBT_create_colorset()
colorsetDefscontains colorset-entries ("itemname=color")
Returns
error if sth went wrong

Definition at line 113 of file ad_colorset.cxx.

References buffer, GBS_strstruct::cat(), GBS_strstruct::cut_tail(), GBT_write_string(), GBS_strstruct::get_data(), GBS_strstruct::put(), and CharPtrArray::size().

Referenced by GBT_commit_rename_session(), and loadsave_colorset_cb().