Commit ef10411d authored by Claes Sjofors's avatar Claes Sjofors

Xtt command 'open navigator' added, and /object added to command 'set subwindow'

parent 34b4523d
...@@ -3956,7 +3956,7 @@ int Graph::set_folder_index( const char *name, int idx) ...@@ -3956,7 +3956,7 @@ int Graph::set_folder_index( const char *name, int idx)
return grow_SetFolderIndex( object, idx); return grow_SetFolderIndex( object, idx);
} }
int Graph::set_subwindow_source( const char *name, char *source) int Graph::set_subwindow_source( const char *name, char *source, char *owner)
{ {
int sts; int sts;
grow_tObject object; grow_tObject object;
...@@ -3971,7 +3971,7 @@ int Graph::set_subwindow_source( const char *name, char *source) ...@@ -3971,7 +3971,7 @@ int Graph::set_subwindow_source( const char *name, char *source)
if ( grow_GetObjectType( object) != glow_eObjectType_GrowWindow) if ( grow_GetObjectType( object) != glow_eObjectType_GrowWindow)
return 0; return 0;
sts = grow_SetWindowSource( object, source); sts = grow_SetWindowSource( object, source, owner);
if ( ctx != grow->ctx) if ( ctx != grow->ctx)
grow->pop(ctx); grow->pop(ctx);
......
...@@ -1288,8 +1288,9 @@ class Graph { ...@@ -1288,8 +1288,9 @@ class Graph {
/*! /*!
\param name Object name of window object. \param name Object name of window object.
\param source Name of source graph. \param source Name of source graph.
\param owner Name of instance object. NULL if not used.
*/ */
int set_subwindow_source( const char *name, char *source); int set_subwindow_source( const char *name, char *source, char *owner);
//! Play a sound. //! Play a sound.
/*! /*!
......
...@@ -4769,9 +4769,9 @@ int grow_SetFolderIndex( grow_tObject folder, int idx) ...@@ -4769,9 +4769,9 @@ int grow_SetFolderIndex( grow_tObject folder, int idx)
return ((GrowFolder *)folder)->set_folder( idx); return ((GrowFolder *)folder)->set_folder( idx);
} }
int grow_SetWindowSource( grow_tObject window, char *source) int grow_SetWindowSource( grow_tObject window, char *source, char *owner)
{ {
return ((GrowWindow *)window)->set_source( source); return ((GrowWindow *)window)->set_source( source, owner);
} }
void grow_GetWindowSize( grow_tCtx ctx, int *width, int *height) void grow_GetWindowSize( grow_tCtx ctx, int *width, int *height)
......
...@@ -2993,7 +2993,7 @@ extern "C" { ...@@ -2993,7 +2993,7 @@ extern "C" {
void grow_GetSubmenuPosition( grow_tObject menu, int item, double *x, double *y); void grow_GetSubmenuPosition( grow_tObject menu, int item, double *x, double *y);
int grow_GetMenuParent( grow_tObject menu, grow_tObject *parent); int grow_GetMenuParent( grow_tObject menu, grow_tObject *parent);
int grow_SetFolderIndex( grow_tObject folder, int idx); int grow_SetFolderIndex( grow_tObject folder, int idx);
int grow_SetWindowSource( grow_tObject window, char *source); int grow_SetWindowSource( grow_tObject window, char *source, char *owner);
void grow_GetWindowSize( grow_tCtx ctx, int *width, int *height); void grow_GetWindowSize( grow_tCtx ctx, int *width, int *height);
int grow_IsJava( char *name, int *is_frame, int *is_applet, char *java_name); int grow_IsJava( char *name, int *is_frame, int *is_applet, char *java_name);
void grow_GetOwner( grow_tCtx ctx, char *owner); void grow_GetOwner( grow_tCtx ctx, char *owner);
......
...@@ -981,7 +981,7 @@ int GrowWindow::get_background_object_limits(GlowTransform *t, ...@@ -981,7 +981,7 @@ int GrowWindow::get_background_object_limits(GlowTransform *t,
return 0; return 0;
} }
int GrowWindow::set_source( char *source) int GrowWindow::set_source( char *source, char *new_owner)
{ {
int clip_removed = 0; int clip_removed = 0;
...@@ -992,6 +992,8 @@ int GrowWindow::set_source( char *source) ...@@ -992,6 +992,8 @@ int GrowWindow::set_source( char *source)
} }
strcpy( input_file_name, source); strcpy( input_file_name, source);
if ( new_owner)
strncpy( owner, new_owner, sizeof(owner));
update_attributes(); update_attributes();
draw(); draw();
......
...@@ -282,7 +282,7 @@ class GrowWindow : public GrowRect { ...@@ -282,7 +282,7 @@ class GrowWindow : public GrowRect {
double x, double y, GlowArrayElem **background, double x, double y, GlowArrayElem **background,
double *min, double *max, glow_eDirection *direction); double *min, double *max, glow_eDirection *direction);
void set_input_focus( int focus, glow_eEvent event); void set_input_focus( int focus, glow_eEvent event);
int set_source( char *source); int set_source( char *source, char *new_owner);
static void v_value_changed_cb( void *o, double value); static void v_value_changed_cb( void *o, double value);
static void h_value_changed_cb( void *o, double value); static void h_value_changed_cb( void *o, double value);
......
...@@ -193,9 +193,9 @@ int XttGe::set_folder_index( const char *name, int idx) ...@@ -193,9 +193,9 @@ int XttGe::set_folder_index( const char *name, int idx)
return graph->set_folder_index( name, idx); return graph->set_folder_index( name, idx);
} }
int XttGe::set_subwindow_source( const char *name, char *source) int XttGe::set_subwindow_source( const char *name, char *source, char *object)
{ {
return graph->set_subwindow_source( name, source); return graph->set_subwindow_source( name, source, object);
} }
XttGe::~XttGe() XttGe::~XttGe()
......
...@@ -89,7 +89,7 @@ class XttGe { ...@@ -89,7 +89,7 @@ class XttGe {
void print(); void print();
int set_object_focus( const char *name, int empty); int set_object_focus( const char *name, int empty);
int set_folder_index( const char *name, int idx); int set_folder_index( const char *name, int idx);
int set_subwindow_source( const char *name, char *source); int set_subwindow_source( const char *name, char *source, char *object);
void swap( int mode); void swap( int mode);
void event_exec( int type, void *event, unsigned int size); void event_exec( int type, void *event, unsigned int size);
......
...@@ -340,7 +340,7 @@ dcli_tCmdTable xnav_command_table[] = { ...@@ -340,7 +340,7 @@ dcli_tCmdTable xnav_command_table[] = {
"SET", "SET",
&xnav_set_func, &xnav_set_func,
{ "dcli_arg1", "dcli_arg2", "/NAME", "/VALUE", { "dcli_arg1", "dcli_arg2", "/NAME", "/VALUE",
"/BYPASS", "/INDEX", "/SOURCE", ""} "/BYPASS", "/INDEX", "/SOURCE", "/OBJECT", ""}
}, },
{ {
"SETUP", "SETUP",
...@@ -686,7 +686,7 @@ static int xnav_logout_func( void *client_data, ...@@ -686,7 +686,7 @@ static int xnav_logout_func( void *client_data,
} }
static int xnav_set_func( void *client_data, static int xnav_set_func( void *client_data,
void *client_flag) void *client_flag)
{ {
XNav *xnav = (XNav *)client_data; XNav *xnav = (XNav *)client_data;
char arg1_str[80]; char arg1_str[80];
...@@ -815,7 +815,9 @@ static int xnav_set_func( void *client_data, ...@@ -815,7 +815,9 @@ static int xnav_set_func( void *client_data,
// Command is "SET SUBWINDOW" // Command is "SET SUBWINDOW"
XttGe *gectx; XttGe *gectx;
char graph_str[80]; char graph_str[80];
char object_str[80]; char name_str[80];
pwr_tOName object_str;
char *object_p;
char source_str[80]; char source_str[80];
if ( EVEN( dcli_get_qualifier( "dcli_arg2", graph_str, sizeof(graph_str)))) { if ( EVEN( dcli_get_qualifier( "dcli_arg2", graph_str, sizeof(graph_str)))) {
...@@ -823,7 +825,7 @@ static int xnav_set_func( void *client_data, ...@@ -823,7 +825,7 @@ static int xnav_set_func( void *client_data,
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
if ( EVEN( dcli_get_qualifier( "/NAME", object_str, sizeof(object_str)))) { if ( EVEN( dcli_get_qualifier( "/NAME", name_str, sizeof(name_str)))) {
xnav->message('E', "Object name is missing"); xnav->message('E', "Object name is missing");
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
...@@ -833,12 +835,17 @@ static int xnav_set_func( void *client_data, ...@@ -833,12 +835,17 @@ static int xnav_set_func( void *client_data,
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
if ( ODD( dcli_get_qualifier( "/OBJECT", object_str, sizeof(object_str))))
object_p = object_str;
else
object_p = 0;
if ( !xnav->appl.find( applist_eType_Graph, graph_str, 0, if ( !xnav->appl.find( applist_eType_Graph, graph_str, 0,
(void **) &gectx)) { (void **) &gectx)) {
xnav->message('E', "Graph is not open"); xnav->message('E', "Graph is not open");
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
return gectx->set_subwindow_source( object_str, source_str); return gectx->set_subwindow_source( name_str, source_str, object_p);
} }
else if ( cdh_NoCaseStrncmp( arg1_str, "LANGUAGE", strlen( arg1_str)) == 0) else if ( cdh_NoCaseStrncmp( arg1_str, "LANGUAGE", strlen( arg1_str)) == 0)
{ {
...@@ -3683,6 +3690,23 @@ static int xnav_open_func( void *client_data, ...@@ -3683,6 +3690,23 @@ static int xnav_open_func( void *client_data,
fileview = xnav->fileview_new( aref.Objid, title_str, dir_str, file_str, type, fileview = xnav->fileview_new( aref.Objid, title_str, dir_str, file_str, type,
target_str, trigger_str, filetype_p); target_str, trigger_str, filetype_p);
} }
else if ( cdh_NoCaseStrncmp( arg1_str, "NAVIGATOR", strlen( arg1_str)) == 0) {
pwr_tAName object_str;
pwr_tAttrRef aref;
pwr_tStatus sts;
if ( ODD( dcli_get_qualifier( "/OBJECT", object_str, sizeof(object_str)))) {
sts = gdh_NameToAttrref( pwr_cNObjid, object_str, &aref);
if ( EVEN(sts)) {
xnav->message('E', "Uable to find object");
return XNAV__HOLDCOMMAND;
}
xnav->display_object( &aref, 0);
}
xnav->pop();
}
else else
xnav->message('E',"Syntax error"); xnav->message('E',"Syntax error");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment