Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
e6c431ce
Commit
e6c431ce
authored
15 years ago
by
mh17
Browse files
Options
Downloads
Patches
Plain Diff
config code moved into zmapConfig/zmapConfigLoader.c
parent
faf2d38d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapFeature/zmapStyleUtils.c
+1
-139
1 addition, 139 deletions
src/zmapFeature/zmapStyleUtils.c
with
1 addition
and
139 deletions
src/zmapFeature/zmapStyleUtils.c
+
1
−
139
View file @
e6c431ce
...
...
@@ -30,7 +30,7 @@
* HISTORY:
* Last edited: Jul 29 09:53 2009 (edgrif)
* Created: Thu Oct 30 10:24:35 2008 (edgrif)
* CVS info: $Id: zmapStyleUtils.c,v 1.
8
2009-12-
03 15:08
:0
6
mh17 Exp $
* CVS info: $Id: zmapStyleUtils.c,v 1.
9
2009-12-
14 11:37
:0
9
mh17 Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -168,144 +168,6 @@ ZMAP_ENUM_TO_SHORT_TEXT_FUNC(zmapStyleBumpMode2ShortText, ZMapStyleBu
GData
*
zMapFeatureTypeGetFromFile
(
char
*
styles_list
,
char
*
styles_file_name
)
{
GData
*
styles
=
NULL
;
ZMapConfigIniContext
context
;
GList
*
settings_list
=
NULL
,
*
free_this_list
=
NULL
;
if
((
context
=
zMapConfigIniContextProvideNamed
(
ZMAPSTANZA_STYLE_CONFIG
)))
{
if
(
zMapConfigIniContextIncludeFile
(
context
,
styles_file_name
))
// settings_list = zMapConfigIniContextGetNamed(context, ZMAPSTANZA_STYLE_CONFIG) ;
settings_list
=
zMapConfigIniContextGetStyleList
(
context
,
styles_list
)
;
zMapConfigIniContextDestroy
(
context
)
;
context
=
NULL
;
}
if
(
settings_list
)
{
free_this_list
=
settings_list
;
g_datalist_init
(
&
styles
)
;
do
{
ZMapKeyValue
curr_config_style
;
ZMapFeatureTypeStyle
new_style
;
GParameter
params
[
100
]
;
/* TMP....make dynamic.... */
guint
num_params
;
GParameter
*
curr_param
;
/* Reset params memory.... */
memset
(
&
params
,
0
,
sizeof
(
params
))
;
curr_param
=
params
;
num_params
=
0
;
curr_config_style
=
(
ZMapKeyValue
)(
settings_list
->
data
)
;
/* The first item is special, the "name" field is the name of the style and
* is derived from the name of the stanza and so must be treated specially. */
zMapAssert
(
curr_config_style
->
name
&&
*
(
curr_config_style
->
name
))
;
g_value_init
(
&
(
curr_param
->
value
),
G_TYPE_STRING
)
;
curr_param
->
name
=
curr_config_style
->
name
;
g_value_set_string
(
&
(
curr_param
->
value
),
curr_config_style
->
data
.
str
)
;
num_params
++
;
curr_param
++
;
curr_config_style
++
;
while
(
curr_config_style
->
name
)
{
if
(
curr_config_style
->
has_value
)
{
curr_param
->
name
=
curr_config_style
->
name
;
switch
(
curr_config_style
->
type
)
{
case
ZMAPCONF_STR_ARRAY
:
{
if
(
curr_config_style
->
conv_type
==
ZMAPCONV_STR2COLOUR
)
{
g_value_init
(
&
(
curr_param
->
value
),
G_TYPE_STRING
)
;
g_value_set_string
(
&
(
curr_param
->
value
),
curr_config_style
->
data
.
str
)
;
}
break
;
}
case
ZMAPCONF_STR
:
{
if
(
curr_config_style
->
conv_type
==
ZMAPCONV_STR2ENUM
)
{
int
enum_value
;
enum_value
=
(
curr_config_style
->
conv_func
.
str2enum
)(
curr_config_style
->
data
.
str
)
;
g_value_init
(
&
(
curr_param
->
value
),
G_TYPE_INT
)
;
g_value_set_int
(
&
(
curr_param
->
value
),
enum_value
)
;
}
else
{
g_value_init
(
&
(
curr_param
->
value
),
G_TYPE_STRING
)
;
g_value_set_string
(
&
(
curr_param
->
value
),
curr_config_style
->
data
.
str
)
;
}
break
;
}
case
ZMAPCONF_DOUBLE
:
{
g_value_init
(
&
(
curr_param
->
value
),
G_TYPE_DOUBLE
)
;
g_value_set_double
(
&
(
curr_param
->
value
),
curr_config_style
->
data
.
d
)
;
break
;
}
case
ZMAPCONF_INT
:
{
g_value_init
(
&
(
curr_param
->
value
),
G_TYPE_INT
)
;
g_value_set_int
(
&
(
curr_param
->
value
),
curr_config_style
->
data
.
i
)
;
break
;
}
case
ZMAPCONF_BOOLEAN
:
{
g_value_init
(
&
(
curr_param
->
value
),
G_TYPE_BOOLEAN
)
;
g_value_set_boolean
(
&
(
curr_param
->
value
),
curr_config_style
->
data
.
b
)
;
break
;
}
default:
{
zMapAssertNotReached
()
;
break
;
}
}
num_params
++
;
curr_param
++
;
}
curr_config_style
++
;
}
if
((
new_style
=
zMapStyleCreateV
(
num_params
,
params
)))
{
if
(
!
zMapStyleSetAdd
(
&
styles
,
new_style
))
{
/* Free style, report error and move on. */
zMapStyleDestroy
(
new_style
)
;
zMapLogWarning
(
"Styles file
\"
%s
\"
, stanza %s could not be added."
,
styles_file_name
,
curr_config_style
->
name
)
;
}
}
}
while
((
settings_list
=
g_list_next
(
settings_list
)));
}
zMapConfigStylesFreeList
(
free_this_list
)
;
return
styles
;
}
void
zMapStyleSetPrintAll
(
ZMapIOOut
dest
,
GData
*
type_set
,
char
*
user_string
,
gboolean
full
)
{
StylePrintStruct
print_data
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment