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
7ba6f31e
Commit
7ba6f31e
authored
16 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
setting style mode at wrong place + needed makedrawable code from server to be done here.
parent
c125c773
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/zmapView/zmapView.c
+95
-43
95 additions, 43 deletions
src/zmapView/zmapView.c
with
95 additions
and
43 deletions
src/zmapView/zmapView.c
+
95
−
43
View file @
7ba6f31e
...
...
@@ -25,9 +25,9 @@
* Description:
* Exported functions: See ZMap/zmapView.h
* HISTORY:
* Last edited: Dec
4 10:36
2008 (edgrif)
* Last edited: Dec
9 09:47
2008 (edgrif)
* Created: Thu May 13 15:28:26 2004 (edgrif)
* CVS info: $Id: zmapView.c,v 1.1
39
2008-12-0
5
09:
46:0
9 edgrif Exp $
* CVS info: $Id: zmapView.c,v 1.1
40
2008-12-0
9
09:
53:1
9 edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -64,6 +64,15 @@ typedef struct
}
ConnectionDataStruct
,
*
ConnectionData
;
typedef
struct
{
gboolean
found_style
;
GString
*
missing_styles
;
}
DrawableDataStruct
,
*
DrawableData
;
static
ZMapView
createZMapView
(
GtkWidget
*
xremote_widget
,
char
*
view_name
,
GList
*
sequences
,
void
*
app_data
)
;
static
void
destroyZMapView
(
ZMapView
*
zmap
)
;
...
...
@@ -151,6 +160,8 @@ static void killAllSpawned(ZMapView zmap_view);
static
gboolean
connections
(
ZMapView
zmap_view
,
gboolean
threads_have_died
)
;
static
gboolean
makeStylesDrawable
(
GData
*
styles
,
char
**
missing_styles_out
)
;
static
void
drawableCB
(
GQuark
key_id
,
gpointer
data
,
gpointer
user_data
)
;
...
...
@@ -1853,6 +1864,8 @@ static gboolean dispatchContextRequests(ZMapView zmap_view, ZMapViewConnection c
get_features
->
context
=
connect_data
->
context
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
if
(
!
(
connect_data
->
server_styles_have_mode
))
{
if
(
!
zMapFeatureAnyAddModesToStyles
((
ZMapFeatureAny
)(
connect_data
->
context
)))
...
...
@@ -1866,6 +1879,8 @@ static gboolean dispatchContextRequests(ZMapView zmap_view, ZMapViewConnection c
}
}
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
break
;
}
...
...
@@ -1958,67 +1973,61 @@ static gboolean processDataRequests(ZMapView zmap_view, ZMapViewConnection view_
{
ZMapServerReqGetFeatures
get_features
=
(
ZMapServerReqGetFeatures
)
req_any
;
/* ok...once we are here we can display stuff.... */
if
(
req_any
->
type
==
connect_data
->
last_request
)
if
(
req_any
->
type
==
ZMAP_SERVERREQ_FEATURES
)
{
/* Isn't there a problem here...which bit of info goes with which server ???? */
zmapViewSessionAddServerInfo
(
zmap_view
->
session_data
,
connect_data
->
database_path
)
;
char
*
missing_styles
=
NULL
;
getFeatures
(
zmap_view
,
get_features
)
;
zmap_view
->
connections_loaded
++
;
/* This will need to be more sophisticated, we will need to time
* connections out. */
if
(
zmap_view
->
connections_loaded
==
g_list_length
(
zmap_view
->
connection_list
))
zmap_view
->
state
=
ZMAPVIEW_LOADED
;
}
break
;
}
if
(
!
(
connect_data
->
server_styles_have_mode
))
{
if
(
!
zMapFeatureAnyAddModesToStyles
((
ZMapFeatureAny
)(
connect_data
->
context
)))
{
printf
(
"oh bother...
\n
"
)
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
*
err_msg_out
=
g_strdup_printf
(
"Inferring Style modes from Features failed."
)
;
thread_rc
=
ZMAPTHREAD_RETURNCODE_REQFAIL
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
}
}
if
(
!
makeStylesDrawable
(
connect_data
->
context
->
styles
,
&
missing_styles
))
{
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
*
err_msg_out
=
g_strdup_printf
(
"Failed to make following styles drawable: %s"
,
missing_styles
)
;
thread_rc
=
ZMAPTHREAD_RETURNCODE_REQFAIL
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
/* needs incorporating into the above.... */
case
ZMAP_SERVERREQ_FEATURES
:
case
ZMAP_SERVERREQ_FEATURE_SEQUENCE
:
case
ZMAP_SERVERREQ_SEQUENCE
:
{
getFeatures
(
zmap_view
,
(
ZMapServerReqGetFeatures
)
req_any
)
;
printf
(
"missing styles: %s
\n
"
,
missing_styles
)
;
break
;
}
}
/* This should go once my changes are complete... */
case
ZMAP_SERVERREQ_OPENLOAD
:
{
ZMapServerReqGetFeatures
features
=
(
ZMapServerReqGetFeatures
)
&
(((
ZMapServerReqOpenLoad
)
req_any
)
->
features
)
;
ZMapServerReqGetServerInfo
get_info
=
(
ZMapServerReqGetServerInfo
)
&
(((
ZMapServerReqOpenLoad
)
req_any
)
->
get_info
)
;
/* got server info, so record in servers info. struct.... */
/* AGH PROBLEM...WHICH SERVER RECORD GOES WITH WHICH SERVER.... */
zmapViewSessionAddServerInfo
(
zmap_view
->
session_data
,
get_info
->
database_path_out
)
;
}
/* ok...once we are here we can display stuff.... */
if
(
req_any
->
type
==
connect_data
->
last_request
)
{
/* Isn't there a problem here...which bit of info goes with which server ???? */
zmapViewSessionAddServerInfo
(
zmap_view
->
session_data
,
connect_data
->
database_path
)
;
getFeatures
(
zmap_view
,
features
)
;
getFeatures
(
zmap_view
,
get_
features
)
;
zmap_view
->
connections_loaded
++
;
zmap_view
->
connections_loaded
++
;
/* This will need to be more sophisticated, we will need to time
* connections out. */
if
(
zmap_view
->
connections_loaded
==
g_list_length
(
zmap_view
->
connection_list
))
zmap_view
->
state
=
ZMAPVIEW_LOADED
;
/* This will need to be more sophisticated, we will need to time
* connections out. */
if
(
zmap_view
->
connections_loaded
==
g_list_length
(
zmap_view
->
connection_list
))
zmap_view
->
state
=
ZMAPVIEW_LOADED
;
}
break
;
}
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
default:
{
...
...
@@ -3060,3 +3069,46 @@ static gboolean connections(ZMapView zmap_view, gboolean threads_have_died)
static
gboolean
makeStylesDrawable
(
GData
*
styles
,
char
**
missing_styles_out
)
{
gboolean
result
=
FALSE
;
DrawableDataStruct
drawable_data
=
{
FALSE
}
;
g_datalist_foreach
(
&
styles
,
drawableCB
,
&
drawable_data
)
;
if
(
drawable_data
.
missing_styles
)
*
missing_styles_out
=
g_string_free
(
drawable_data
.
missing_styles
,
FALSE
)
;
result
=
drawable_data
.
found_style
;
return
result
;
}
/* A GDataForeachFunc() to make the given style drawable. */
static
void
drawableCB
(
GQuark
key_id
,
gpointer
data
,
gpointer
user_data
)
{
ZMapFeatureTypeStyle
style
=
(
ZMapFeatureTypeStyle
)
data
;
DrawableData
drawable_data
=
(
DrawableData
)
user_data
;
if
(
zMapStyleIsDisplayable
(
style
))
{
if
(
zMapStyleMakeDrawable
(
style
))
{
drawable_data
->
found_style
=
TRUE
;
}
else
{
if
(
!
(
drawable_data
->
missing_styles
))
drawable_data
->
missing_styles
=
g_string_sized_new
(
1000
)
;
g_string_append_printf
(
drawable_data
->
missing_styles
,
"%s "
,
g_quark_to_string
(
key_id
))
;
}
}
return
;
}
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