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
187ea6a7
Commit
187ea6a7
authored
16 years ago
by
rds
Browse files
Options
Downloads
Patches
Plain Diff
Add export_context
parent
76ef5993
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/zmapViewRemoteReceive.c
+78
-2
78 additions, 2 deletions
src/zmapView/zmapViewRemoteReceive.c
with
78 additions
and
2 deletions
src/zmapView/zmapViewRemoteReceive.c
+
78
−
2
View file @
187ea6a7
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited:
Apr 30 12:1
8 2008 (rds)
* Last edited:
Nov 5 14:2
8 2008 (rds)
* Created: Tue Jul 10 21:02:42 2007 (rds)
* CVS info: $Id: zmapViewRemoteReceive.c,v 1.1
5
2008-
04-30 11:19:56
rds Exp $
* CVS info: $Id: zmapViewRemoteReceive.c,v 1.1
6
2008-
11-05 14:44:45
rds Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -58,6 +58,8 @@ typedef enum
ZMAPVIEW_REMOTE_LIST_WINDOWS
,
ZMAPVIEW_REMOTE_NEW_WINDOW
,
ZMAPVIEW_REMOTE_DUMP_CONTEXT
,
/* ...but above here */
ZMAPVIEW_REMOTE_UNKNOWN
}
ZMapViewValidXRemoteActions
;
...
...
@@ -76,6 +78,9 @@ typedef struct
GList
*
feature_list
;
GData
*
styles
;
char
*
filename
;
char
*
format
;
}
RequestDataStruct
,
*
RequestData
;
typedef
struct
...
...
@@ -96,6 +101,7 @@ static char *view_post_execute(char *command_text, gpointer user_data, int *stat
static
void
delete_failed_make_message
(
gpointer
list_data
,
gpointer
user_data
);
static
void
drawNewFeatures
(
ZMapView
view
,
RequestData
input_data
,
ResponseData
output_data
);
static
void
getChildWindowXID
(
ZMapView
view
,
RequestData
input_data
,
ResponseData
output_data
);
static
void
viewDumpContextToFile
(
ZMapView
view
,
RequestData
input_data
,
ResponseData
output_data
);
static
gboolean
sanityCheckContext
(
ZMapView
view
,
RequestData
input_data
,
ResponseData
output_data
);
static
void
draw_failed_make_message
(
gpointer
list_data
,
gpointer
user_data
);
static
gint
matching_unique_id
(
gconstpointer
list_data
,
gconstpointer
user_data
);
...
...
@@ -115,6 +121,7 @@ static gboolean setupStyles(ZMapFeatureContext context,
static
gboolean
xml_zmap_start_cb
(
gpointer
user_data
,
ZMapXMLElement
zmap_element
,
ZMapXMLParser
parser
);
static
gboolean
xml_featureset_start_cb
(
gpointer
user_data
,
ZMapXMLElement
zmap_element
,
ZMapXMLParser
parser
);
static
gboolean
xml_feature_start_cb
(
gpointer
user_data
,
ZMapXMLElement
zmap_element
,
ZMapXMLParser
parser
);
static
gboolean
xml_export_start_cb
(
gpointer
user_data
,
ZMapXMLElement
zmap_element
,
ZMapXMLParser
parser
);
static
gboolean
xml_subfeature_end_cb
(
gpointer
user_data
,
ZMapXMLElement
zmap_element
,
ZMapXMLParser
parser
);
static
gboolean
xml_return_true_cb
(
gpointer
user_data
,
ZMapXMLElement
zmap_element
,
ZMapXMLParser
parser
);
...
...
@@ -124,6 +131,7 @@ static gboolean xml_return_true_cb(gpointer user_data, ZMapXMLElement zmap_eleme
static
ZMapXMLObjTagFunctionsStruct
view_starts_G
[]
=
{
{
"zmap"
,
xml_zmap_start_cb
},
{
"client"
,
zMapXRemoteXMLGenericClientStartCB
},
{
"export"
,
xml_export_start_cb
},
{
"featureset"
,
xml_featureset_start_cb
},
{
"feature"
,
xml_feature_start_cb
},
{
NULL
,
NULL
}
...
...
@@ -139,6 +147,7 @@ static char *actions_G[ZMAPVIEW_REMOTE_UNKNOWN + 1] = {
NULL
,
"find_feature"
,
"create_feature"
,
"delete_feature"
,
"single_select"
,
"multiple_select"
,
"unselect"
,
"register_client"
,
"list_windows"
,
"new_window"
,
"export_context"
,
NULL
};
...
...
@@ -262,6 +271,9 @@ static char *view_execute_command(char *command_text, gpointer user_data, int *s
case
ZMAPVIEW_REMOTE_LIST_WINDOWS
:
getChildWindowXID
(
view
,
&
input_data
,
&
output_data
);
break
;
case
ZMAPVIEW_REMOTE_DUMP_CONTEXT
:
viewDumpContextToFile
(
view
,
&
input_data
,
&
output_data
);
break
;
case
ZMAPVIEW_REMOTE_UNHIGHLIGHT_FEATURE
:
case
ZMAPVIEW_REMOTE_HIGHLIGHT_FEATURE
:
case
ZMAPVIEW_REMOTE_HIGHLIGHT2_FEATURE
:
...
...
@@ -372,6 +384,50 @@ static void getChildWindowXID(ZMapView view, RequestData input_data, ResponseDat
return
;
}
static
void
viewDumpContextToFile
(
ZMapView
view
,
RequestData
input_data
,
ResponseData
output_data
)
{
GIOChannel
*
file
=
NULL
;
GError
*
error
=
NULL
;
char
*
filepath
=
NULL
;
filepath
=
input_data
->
filename
;
if
(
!
(
file
=
g_io_channel_new_file
(
filepath
,
"w"
,
&
error
)))
{
output_data
->
code
=
ZMAPXREMOTE_UNAVAILABLE
;
output_data
->
handled
=
FALSE
;
if
(
error
)
g_string_append
(
output_data
->
messages
,
error
->
message
);
}
else
{
char
*
format
=
NULL
;
gboolean
result
=
FALSE
;
format
=
input_data
->
format
;
if
(
format
&&
g_ascii_strcasecmp
(
format
,
"gff"
)
==
0
)
result
=
zMapGFFDump
(
view
->
features
,
file
,
&
error
);
else
result
=
zMapFeatureContextDump
(
view
->
features
,
file
,
&
error
);
if
(
!
result
)
{
output_data
->
code
=
ZMAPXREMOTE_INTERNAL
;
output_data
->
handled
=
FALSE
;
if
(
error
)
g_string_append
(
output_data
->
messages
,
error
->
message
);
}
else
{
output_data
->
code
=
ZMAPXREMOTE_OK
;
output_data
->
handled
=
TRUE
;
}
}
return
;
}
static
gboolean
sanityCheckContext
(
ZMapView
view
,
RequestData
input_data
,
ResponseData
output_data
)
{
gboolean
features_are_sane
=
TRUE
;
...
...
@@ -726,6 +782,7 @@ static gboolean xml_zmap_start_cb(gpointer user_data,
case
ZMAPVIEW_REMOTE_LIST_WINDOWS
:
case
ZMAPVIEW_REMOTE_REGISTER_CLIENT
:
case
ZMAPVIEW_REMOTE_NEW_WINDOW
:
case
ZMAPVIEW_REMOTE_DUMP_CONTEXT
:
break
;
default:
xml_data
->
common
.
action
=
ZMAPVIEW_REMOTE_INVALID
;
...
...
@@ -1130,6 +1187,25 @@ static gboolean xml_feature_start_cb(gpointer user_data, ZMapXMLElement feature_
return
FALSE
;
}
static
gboolean
xml_export_start_cb
(
gpointer
user_data
,
ZMapXMLElement
export_element
,
ZMapXMLParser
parser
)
{
ZMapXRemoteParseCommandData
xml_data
=
(
ZMapXRemoteParseCommandData
)
user_data
;
RequestData
request_data
=
(
RequestData
)(
xml_data
->
user_data
);
ZMapXMLAttribute
attr
=
NULL
;
/* <export filename="" format="" /> */
if
((
attr
=
zMapXMLElementGetAttributeByName
(
export_element
,
"filename"
)))
request_data
->
filename
=
g_quark_to_string
(
zMapXMLAttributeGetValue
(
attr
));
else
zMapXMLParserRaiseParsingError
(
parser
,
"filename is a required attribute for export."
);
if
((
attr
=
zMapXMLElementGetAttributeByName
(
export_element
,
"format"
)))
request_data
->
format
=
g_quark_to_string
(
zMapXMLAttributeGetValue
(
attr
));
else
request_data
->
format
=
"gff"
;
return
FALSE
;
}
static
gboolean
xml_subfeature_end_cb
(
gpointer
user_data
,
ZMapXMLElement
sub_element
,
...
...
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