Commit b11f6edd authored by Claes Sjofors's avatar Claes Sjofors

Xtt command 'send signal' and Ge action CatchSignal added

parent e54a53a4
...@@ -179,6 +179,7 @@ static attrnav_sEnumElement elem_action_type[] = { ...@@ -179,6 +179,7 @@ static attrnav_sEnumElement elem_action_type[] = {
{ (unsigned int) ge_mActionType1_OptionMenu , "OptionMenu"}, { (unsigned int) ge_mActionType1_OptionMenu , "OptionMenu"},
{ (unsigned int) ge_mActionType1_MethodPulldownMenu , "MethodPulldownMenu"}, { (unsigned int) ge_mActionType1_MethodPulldownMenu , "MethodPulldownMenu"},
{ (unsigned int) ge_mActionType1_Slider , "Slider"}, { (unsigned int) ge_mActionType1_Slider , "Slider"},
{ (unsigned int) ge_mActionType1_CatchSignal , "CatchSignal"},
{ 0, ""}}; { 0, ""}};
static attrnav_sEnumElement elem_color[] = { static attrnav_sEnumElement elem_color[] = {
......
This diff is collapsed.
...@@ -197,6 +197,7 @@ ...@@ -197,6 +197,7 @@
ge_eDynPrio_ColorThemeLightness, ge_eDynPrio_ColorThemeLightness,
ge_eDynPrio_DigSwap, ge_eDynPrio_DigSwap,
ge_eDynPrio_DigScript, ge_eDynPrio_DigScript,
ge_eDynPrio_CatchSignal,
// This should always be last // This should always be last
ge_eDynPrio_Script = 9998, ge_eDynPrio_Script = 9998,
...@@ -281,7 +282,8 @@ ...@@ -281,7 +282,8 @@
ge_mActionType1_SetValue = 1 << 21, ge_mActionType1_SetValue = 1 << 21,
ge_mActionType1_MethodToolbar = 1 << 22, ge_mActionType1_MethodToolbar = 1 << 22,
ge_mActionType1_MethodPulldownMenu = 1 << 23, ge_mActionType1_MethodPulldownMenu = 1 << 23,
ge_mActionType1_Script = 1 << 24 ge_mActionType1_Script = 1 << 24,
ge_mActionType1_CatchSignal = 1 << 25
} ge_mActionType1; } ge_mActionType1;
typedef enum { typedef enum {
...@@ -393,6 +395,7 @@ ...@@ -393,6 +395,7 @@
ge_eSave_MethodToolbar = 71, ge_eSave_MethodToolbar = 71,
ge_eSave_MethodPulldownMenu = 72, ge_eSave_MethodPulldownMenu = 72,
ge_eSave_Script = 73, ge_eSave_Script = 73,
ge_eSave_CatchSignal = 74,
ge_eSave_End = 99, ge_eSave_End = 99,
ge_eSave_Dyn_dyn_type1 = 100, ge_eSave_Dyn_dyn_type1 = 100,
ge_eSave_Dyn_action_type1 = 101, ge_eSave_Dyn_action_type1 = 101,
...@@ -786,7 +789,8 @@ ...@@ -786,7 +789,8 @@
ge_eSave_MethodPulldownMenu_method_object = 7200, ge_eSave_MethodPulldownMenu_method_object = 7200,
ge_eSave_MethodPulldownMenu_menu_type = 7201, ge_eSave_MethodPulldownMenu_menu_type = 7201,
ge_eSave_Script_script_len = 7300, ge_eSave_Script_script_len = 7300,
ge_eSave_Script_script = 7301 ge_eSave_Script_script = 7301,
ge_eSave_CatchSignal_signal_name = 7400
} ge_eSave; } ge_eSave;
...@@ -2467,14 +2471,12 @@ class GeSlider : public GeDynElem { ...@@ -2467,14 +2471,12 @@ class GeSlider : public GeDynElem {
GeSlider( GeDyn *e_dyn) : GeSlider( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType1_No, ge_mDynType2_No, ge_mActionType1_Slider, ge_mActionType2_No, ge_eDynPrio_Slider), GeDynElem(e_dyn, ge_mDynType1_No, ge_mDynType2_No, ge_mActionType1_Slider, ge_mActionType2_No, ge_eDynPrio_Slider),
min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0), min_value_subid(pwr_cNSubid), min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0), insensitive_p(0)
max_value_subid(pwr_cNSubid), insensitive_p(0)
{ strcpy( attribute, ""); strcpy( minvalue_attr, ""); strcpy( maxvalue_attr, ""); { strcpy( attribute, ""); strcpy( minvalue_attr, ""); strcpy( maxvalue_attr, "");
strcpy( insensitive_attr, ""); strcpy( release_attr, "");} strcpy( insensitive_attr, ""); strcpy( release_attr, "");}
GeSlider( const GeSlider& x) : GeSlider( const GeSlider& x) :
GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio), GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio),
min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0), min_value_subid(pwr_cNSubid), min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0), insensitive_p(0)
max_value_subid(pwr_cNSubid), insensitive_p(0)
{ strcpy( attribute, x.attribute); strcpy( minvalue_attr, x.minvalue_attr); { strcpy( attribute, x.attribute); strcpy( minvalue_attr, x.minvalue_attr);
strcpy( maxvalue_attr, x.maxvalue_attr); strcpy( insensitive_attr, x.insensitive_attr); strcpy( maxvalue_attr, x.maxvalue_attr); strcpy( insensitive_attr, x.insensitive_attr);
strcpy( release_attr, x.release_attr);} strcpy( release_attr, x.release_attr);}
...@@ -2514,13 +2516,11 @@ class GeBar : public GeDynElem { ...@@ -2514,13 +2516,11 @@ class GeBar : public GeDynElem {
GeBar( GeDyn *e_dyn) : GeBar( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType1_Bar, ge_mDynType2_No, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Bar), GeDynElem(e_dyn, ge_mDynType1_Bar, ge_mDynType2_No, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Bar),
min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0), min_value_subid(pwr_cNSubid), min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0)
max_value_subid(pwr_cNSubid)
{ strcpy( attribute, ""); strcpy( minvalue_attr, ""); strcpy( maxvalue_attr, "");} { strcpy( attribute, ""); strcpy( minvalue_attr, ""); strcpy( maxvalue_attr, "");}
GeBar( const GeBar& x) : GeBar( const GeBar& x) :
GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio), GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio),
min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0), min_value_subid(pwr_cNSubid), min_value_p(0), max_value_p(0), old_min_value(0), old_max_value(0)
max_value_subid(pwr_cNSubid)
{ strcpy( attribute, x.attribute); strcpy( minvalue_attr, x.minvalue_attr); { strcpy( attribute, x.attribute); strcpy( minvalue_attr, x.minvalue_attr);
strcpy( maxvalue_attr, x.maxvalue_attr);} strcpy( maxvalue_attr, x.maxvalue_attr);}
void get_attributes( attr_sItem *attrinfo, int *item_count); void get_attributes( attr_sItem *attrinfo, int *item_count);
...@@ -2586,8 +2586,7 @@ class GeTrend : public GeDynElem { ...@@ -2586,8 +2586,7 @@ class GeTrend : public GeDynElem {
GeTrend( GeDyn *e_dyn) : GeTrend( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType1_Trend, ge_mDynType2_No, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Trend), GeDynElem(e_dyn, ge_mDynType1_Trend, ge_mDynType2_No, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Trend),
min_value1_p(0), max_value1_p(0), old_min_value1(0), old_max_value1(0), min_value1_p(0), max_value1_p(0), old_min_value1(0), old_max_value1(0),
min_value_subid1(pwr_cNSubid), max_value_subid1(pwr_cNSubid),
min_value2_p(0), max_value2_p(0), old_min_value2(0), old_max_value2(0), min_value2_p(0), max_value2_p(0), old_min_value2(0), old_max_value2(0),
hold_p(0), timerange_p(0), old_timerange(0) hold_p(0), timerange_p(0), old_timerange(0)
{ strcpy( attribute1, ""); strcpy( attribute2, ""); { strcpy( attribute1, ""); strcpy( attribute2, "");
...@@ -3167,13 +3166,12 @@ class GeAxis : public GeDynElem { ...@@ -3167,13 +3166,12 @@ class GeAxis : public GeDynElem {
GeDynElem(e_dyn, ge_mDynType1_No, ge_mDynType2_Axis, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Axis), GeDynElem(e_dyn, ge_mDynType1_No, ge_mDynType2_Axis, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Axis),
min_value(0), max_value(100), keep_settings(0), imin_value(0), imax_value(0), min_value_p(0), min_value(0), max_value(100), keep_settings(0), imin_value(0), imax_value(0), min_value_p(0),
max_value_p(0), imin_value_p(0), max_value_p(0), imin_value_p(0),
imax_value_p(0), min_value_subid(pwr_cNSubid), max_value_subid(pwr_cNSubid), attr_type(0) imax_value_p(0), attr_type(0)
{ strcpy( minvalue_attr, ""); strcpy( maxvalue_attr, "");} { strcpy( minvalue_attr, ""); strcpy( maxvalue_attr, "");}
GeAxis( const GeAxis& x) : GeAxis( const GeAxis& x) :
GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio), GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio),
min_value(x.min_value),max_value(x.max_value), keep_settings(x.keep_settings), min_value(x.min_value),max_value(x.max_value), keep_settings(x.keep_settings),
min_value_p(0), max_value_p(0), imin_value_p(0), imax_value_p(0), min_value_p(0), max_value_p(0), imin_value_p(0), imax_value_p(0)
min_value_subid(pwr_cNSubid), max_value_subid(pwr_cNSubid)
{ strcpy( minvalue_attr, x.minvalue_attr); strcpy( maxvalue_attr, x.maxvalue_attr); } { strcpy( minvalue_attr, x.minvalue_attr); strcpy( maxvalue_attr, x.maxvalue_attr); }
void get_attributes( attr_sItem *attrinfo, int *item_count); void get_attributes( attr_sItem *attrinfo, int *item_count);
void save( ofstream& fp); void save( ofstream& fp);
...@@ -3218,6 +3216,24 @@ class GeTimeoutColor : public GeDynElem { ...@@ -3218,6 +3216,24 @@ class GeTimeoutColor : public GeDynElem {
}; };
//! Catch signal.
class GeCatchSignal : public GeDynElem {
public:
pwr_tString80 signal_name;
GeCatchSignal( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType1_No, ge_mDynType2_No, ge_mActionType1_CatchSignal, ge_mActionType2_No, ge_eDynPrio_CatchSignal)
{ strcpy( signal_name, "");}
GeCatchSignal( const GeCatchSignal& x) :
GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio)
{ strcpy( signal_name, x.signal_name);}
void get_attributes( attr_sItem *attrinfo, int *item_count);
void save( ofstream& fp);
void open( ifstream& fp);
int action( grow_tObject object, glow_tEvent event);
int export_java( grow_tObject object, ofstream& fp, bool first, char *var_name);
};
/*@}*/ /*@}*/
#endif #endif
......
...@@ -3422,6 +3422,8 @@ void GraphGrow::grow_trace_setup() ...@@ -3422,6 +3422,8 @@ void GraphGrow::grow_trace_setup()
graph_grow_cb); graph_grow_cb);
grow_EnableEvent( ctx, glow_eEvent_MenuDelete, glow_eEventType_CallBack, grow_EnableEvent( ctx, glow_eEvent_MenuDelete, glow_eEventType_CallBack,
graph_grow_cb); graph_grow_cb);
grow_EnableEvent( ctx, glow_eEvent_Signal, glow_eEventType_CallBack,
graph_grow_cb);
grow_RegisterEventLogCallback( ctx, graph_eventlog_cb); grow_RegisterEventLogCallback( ctx, graph_eventlog_cb);
} }
...@@ -4251,6 +4253,18 @@ static int graph_trace_grow_cb( GlowCtx *ctx, glow_tEvent event) ...@@ -4251,6 +4253,18 @@ static int graph_trace_grow_cb( GlowCtx *ctx, glow_tEvent event)
graph->exec_dynamic( event->dynamics.object, event->dynamics.code, graph->exec_dynamic( event->dynamics.object, event->dynamics.code,
event->dynamics.dynamic_type); event->dynamics.dynamic_type);
break; break;
case glow_eEvent_Signal: {
if ( event->signal.object_type == glow_eObjectType_NoObject)
break;
if ( grow_GetObjectType( event->signal.object) == glow_eObjectType_GrowNode ||
grow_GetObjectType( event->signal.object) == glow_eObjectType_GrowGroup) {
GeDyn *dyn;
grow_GetUserData( event->signal.object, (void **)&dyn);
dyn->action( event->signal.object, event);
}
break;
}
default: default:
; ;
} }
...@@ -5688,6 +5702,11 @@ int Graph::get_object_name( unsigned int idx, int size, char *name) ...@@ -5688,6 +5702,11 @@ int Graph::get_object_name( unsigned int idx, int size, char *name)
return 1; return 1;
} }
void Graph::signal_send( char *signalname)
{
grow_SignalSend( grow->ctx, signalname);
}
static void graph_free_dyn( grow_tObject object) static void graph_free_dyn( grow_tObject object)
{ {
if ( grow_GetObjectType( object) == glow_eObjectType_GrowNode || if ( grow_GetObjectType( object) == glow_eObjectType_GrowNode ||
......
...@@ -1413,6 +1413,7 @@ class Graph { ...@@ -1413,6 +1413,7 @@ class Graph {
int key_pressed( int key); int key_pressed( int key);
void close_input_all(); void close_input_all();
int get_object_name( unsigned int idx, int size, char *name); int get_object_name( unsigned int idx, int size, char *name);
void signal_send( char *signalname);
static int get_colortheme_colors( char *file, double **colors, int *size); static int get_colortheme_colors( char *file, double **colors, int *size);
......
...@@ -1091,7 +1091,8 @@ typedef enum { ...@@ -1091,7 +1091,8 @@ typedef enum {
glow_eEventType_Menu, //!< Menu callback. glow_eEventType_Menu, //!< Menu callback.
glow_eEventType_Table, //!< Table callback. glow_eEventType_Table, //!< Table callback.
glow_eEventType_Toolbar, //!< Toolbar callback. glow_eEventType_Toolbar, //!< Toolbar callback.
glow_eEventType_CustomColor //!< Custom color modified callback. glow_eEventType_CustomColor, //!< Custom color modified callback.
glow_eEventType_Signal //!< Signal event callback.
} glow_eEventType; } glow_eEventType;
//! Glow events //! Glow events
...@@ -1183,6 +1184,7 @@ typedef enum { ...@@ -1183,6 +1184,7 @@ typedef enum {
glow_eEvent_ScrollDown, //!< Scroll down. glow_eEvent_ScrollDown, //!< Scroll down.
glow_eEvent_AnteUndo, //!< Before undo. glow_eEvent_AnteUndo, //!< Before undo.
glow_eEvent_PostUndo, //!< Store undo. glow_eEvent_PostUndo, //!< Store undo.
glow_eEvent_Signal, //!< Signal event.
glow_eEvent__ glow_eEvent__
} glow_eEvent; } glow_eEvent;
...@@ -2268,6 +2270,19 @@ typedef struct { ...@@ -2268,6 +2270,19 @@ typedef struct {
double blue; //!< rgb blue value double blue; //!< rgb blue value
} glow_sEventCustomColor, *glow_tEventCustomColor; } glow_sEventCustomColor, *glow_tEventCustomColor;
//! Data structure for signal event callback.
typedef struct {
glow_eEvent event; //!< Event
glow_eEventType type; //!< Event type
int x_pixel; //!< x-coordinate i pixels
int y_pixel; //!< y-coordinate i pixels
double x; //!< x-coordinate
double y; //!< y-coordinate
glow_eObjectType object_type; //!< Type of object
void *object; //!< Pointer to object
char signal_name[80]; //!< Signal name
} glow_sEventSignal, *glow_tEventSignal;
//! Union for event data structures //! Union for event data structures
typedef union { typedef union {
glow_eEvent event; glow_eEvent event;
...@@ -2285,6 +2300,7 @@ typedef union { ...@@ -2285,6 +2300,7 @@ typedef union {
glow_sEventTable table; glow_sEventTable table;
glow_sEventToolbar toolbar; glow_sEventToolbar toolbar;
glow_sEventCustomColor customcolor; glow_sEventCustomColor customcolor;
glow_sEventSignal signal;
} glow_sEvent, *glow_tEvent; } glow_sEvent, *glow_tEvent;
//! Pixmap data structure //! Pixmap data structure
......
...@@ -5817,6 +5817,12 @@ int grow_KeyPressed( grow_tCtx ctx, int key) ...@@ -5817,6 +5817,12 @@ int grow_KeyPressed( grow_tCtx ctx, int key)
return ((GrowCtx *)ctx)->key_pressed( key); return ((GrowCtx *)ctx)->key_pressed( key);
} }
void grow_SignalSend( grow_tCtx ctx, char *signalname)
{
((GrowCtx *)ctx)->signal_send( signalname);
}
/*@}*/ /*@}*/
......
...@@ -3156,6 +3156,7 @@ extern "C" { ...@@ -3156,6 +3156,7 @@ extern "C" {
int grow_SetObjectClass( grow_tObject object, grow_tNodeClass nodeclass); int grow_SetObjectClass( grow_tObject object, grow_tNodeClass nodeclass);
int grow_CheckObjectName( grow_tCtx ctx, char *name); int grow_CheckObjectName( grow_tCtx ctx, char *name);
int grow_KeyPressed( grow_tCtx ctx, int key); int grow_KeyPressed( grow_tCtx ctx, int key);
void grow_SignalSend( grow_tCtx ctx, char *signalname);
/*@}*/ /*@}*/
......
...@@ -4858,3 +4858,41 @@ int GrowCtx::key_pressed( int key) ...@@ -4858,3 +4858,41 @@ int GrowCtx::key_pressed( int key)
} }
return 0; return 0;
} }
int GrowCtx::signal_send( char *signalname)
{
int sts = 0;
// Make a signal event callback for all nodes
for ( int i = 0; i < a.a_size; i++) {
switch ( a[i]->type()) {
case glow_eObjectType_GrowNode:
case glow_eObjectType_GrowGroup: {
if ( event_callback[glow_eEvent_Signal]) {
static glow_sEvent e;
e.event = glow_eEvent_Signal;
e.any.type = glow_eEventType_Signal;
e.any.x_pixel = 0;
e.any.y_pixel = 0;
e.any.x = 0;
e.any.y = 0;
e.signal.object = a[i];
e.signal.object_type = a[i]->type();
strncpy( e.signal.signal_name, signalname, sizeof(e.signal.signal_name));
sts = event_callback[glow_eEvent_Signal]( this, &e);
if ( sts == GLOW__NO_PROPAGATE) return sts;
}
break;
}
case glow_eObjectType_GrowWindow:
case glow_eObjectType_GrowFolder:
sts = ((GrowWindow *)a[i])->window_ctx->signal_send( signalname);
if ( sts == GLOW__NO_PROPAGATE) return sts;
break;
default: ;
}
}
return 1;
}
...@@ -888,6 +888,7 @@ class GrowCtx : public GlowCtx { ...@@ -888,6 +888,7 @@ class GrowCtx : public GlowCtx {
double *ur_x, double *ur_y); double *ur_x, double *ur_y);
int key_pressed( int key); int key_pressed( int key);
int signal_send( char *signalname);
void pop( GlowArrayElem *element) { a.pop( element);} void pop( GlowArrayElem *element) { a.pop( element);}
void set_text_coding( glow_eTextCoding coding); void set_text_coding( glow_eTextCoding coding);
......
...@@ -1385,3 +1385,30 @@ void XttMultiViewGtk::close_input_all() ...@@ -1385,3 +1385,30 @@ void XttMultiViewGtk::close_input_all()
} }
} }
void XttMultiViewGtk::signal_send( char *signalname)
{
pwr_sClass_XttMultiView mv;
pwr_tStatus sts;
sts = gdh_GetObjectInfoAttrref( &aref, &mv, sizeof(mv));
if ( EVEN(sts)) return;
for ( int i = 0; i < cols; i++) {
for ( int j = 0; j < rows; j++) {
// Call signal_send in component
switch ( mv.Action[i*rows+j].Type) {
case pwr_eMultiViewContentEnum_Graph:
case pwr_eMultiViewContentEnum_ObjectGraph:
gectx[i*rows+j]->signal_send( signalname);
break;
case pwr_eMultiViewContentEnum_MultiView: {
mvctx[i*rows+j]->signal_send( signalname);
break;
}
default: ;
}
}
}
}
...@@ -94,6 +94,7 @@ class XttMultiViewGtk : public XttMultiView { ...@@ -94,6 +94,7 @@ class XttMultiViewGtk : public XttMultiView {
int insert = 1, int more = 0); int insert = 1, int more = 0);
int key_pressed( int key); int key_pressed( int key);
void close_input_all(); void close_input_all();
void signal_send( char *signalname);
static void ge_change_value_cb( void *ge_ctx, void *value_object, char *text); static void ge_change_value_cb( void *ge_ctx, void *value_object, char *text);
static void confirm_cb( void *ge_ctx, void *confirm_object, char *text); static void confirm_cb( void *ge_ctx, void *confirm_object, char *text);
......
...@@ -246,6 +246,11 @@ void XttGe::update_color_theme( int theme) ...@@ -246,6 +246,11 @@ void XttGe::update_color_theme( int theme)
graph->update_color_theme( color_theme); graph->update_color_theme( color_theme);
} }
void XttGe::signal_send( char *signalname)
{
graph->signal_send( signalname);
}
void XttGe::event_exec( int type, void *event, unsigned int size) void XttGe::event_exec( int type, void *event, unsigned int size)
{ {
switch ( type) { switch ( type) {
......
...@@ -105,6 +105,7 @@ class XttGe : XttUtility { ...@@ -105,6 +105,7 @@ class XttGe : XttUtility {
int key_pressed( int key); int key_pressed( int key);
void close_input_all(); void close_input_all();
int get_object_name( unsigned int idx, int size, char *name); int get_object_name( unsigned int idx, int size, char *name);
void signal_send( char *signalname);
static void graph_init_cb( void *client_data); static void graph_init_cb( void *client_data);
static int graph_close_cb( void *client_data); static int graph_close_cb( void *client_data);
......
...@@ -334,6 +334,7 @@ XNav *XttMultiView::get_xnav() ...@@ -334,6 +334,7 @@ XNav *XttMultiView::get_xnav()
return (XNav *)parent_ctx; return (XNav *)parent_ctx;
} }
XttMultiView::XttMultiView( void *mv_parent_ctx, const char *mv_name, XttMultiView::XttMultiView( void *mv_parent_ctx, const char *mv_name,
pwr_tAttrRef *mv_aref, int mv_width, int mv_height, pwr_tAttrRef *mv_aref, int mv_width, int mv_height,
int mv_x, int mv_y, unsigned int mv_options, int mv_color_theme, int mv_x, int mv_y, unsigned int mv_options, int mv_color_theme,
......
...@@ -115,6 +115,7 @@ class XttMultiView : XttUtility { ...@@ -115,6 +115,7 @@ class XttMultiView : XttUtility {
int insert = 1, int cont = 0) {return 0;} int insert = 1, int cont = 0) {return 0;}
virtual int key_pressed( int key) {return 0;} virtual int key_pressed( int key) {return 0;}
virtual void close_input_all() {} virtual void close_input_all() {}
virtual void signal_send( char *signalname) {}
xtt_eUtility get_type() { return xtt_eUtility_MultiView;} xtt_eUtility get_type() { return xtt_eUtility_MultiView;}
void message( char severity, const char *msg); void message( char severity, const char *msg);
......
...@@ -259,6 +259,8 @@ static int xnav_wait_func( void *client_data, ...@@ -259,6 +259,8 @@ static int xnav_wait_func( void *client_data,
void *client_flag); void *client_flag);
static int xnav_oplog_func( void *client_data, static int xnav_oplog_func( void *client_data,
void *client_flag); void *client_flag);
static int xnav_send_func( void *client_data,
void *client_flag);
dcli_tCmdTable xnav_command_table[] = { dcli_tCmdTable xnav_command_table[] = {
{ {
...@@ -449,6 +451,11 @@ dcli_tCmdTable xnav_command_table[] = { ...@@ -449,6 +451,11 @@ dcli_tCmdTable xnav_command_table[] = {
&xnav_oplog_func, &xnav_oplog_func,
{ "dcli_arg1", "/FILE", "/SPEED", "/PID", "/EVENT", ""} { "dcli_arg1", "/FILE", "/SPEED", "/PID", "/EVENT", ""}
}, },
{
"SEND",
&xnav_send_func,
{ "dcli_arg1", "/SIGNALNAME", ""}
},
{"",}}; {"",}};
...@@ -7741,6 +7748,39 @@ static int xnav_oplog_func(void *client_data, ...@@ -7741,6 +7748,39 @@ static int xnav_oplog_func(void *client_data,
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
static int xnav_send_func(void *client_data,
void *client_flag)
{
XNav *xnav = (XNav *)client_data;
char arg1_str[80];
int arg1_sts;
arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str));
if ( cdh_NoCaseStrncmp( arg1_str, "SIGNAL", strlen( arg1_str)) == 0) {
pwr_tString80 signalname_str;
ApplListElem *elem;
if ( EVEN( dcli_get_qualifier( "/SIGNALNAME", signalname_str, sizeof(signalname_str)))) {
xnav->message('E',"Syntax error");
return XNAV__HOLDCOMMAND;
}
for ( elem = xnav->appl.root; elem; elem = elem->next) {
if ( elem->type == applist_eType_Graph)
((XttGe *)elem->ctx)->signal_send( signalname_str);
else if ( elem->type == applist_eType_MultiView)
((XttMultiView *)elem->ctx)->signal_send( signalname_str);
}
}
else {
xnav->message('E',"Syntax error");
return XNAV__HOLDCOMMAND;
}
return XNAV__SUCCESS;
}
int XNav::show_database() int XNav::show_database()
{ {
int sts; int sts;
......
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