Commit fb2b8db9 authored by Claes's avatar Claes

Oplog enable function added

parent ebb4ae05
...@@ -1286,6 +1286,8 @@ class Graph { ...@@ -1286,6 +1286,8 @@ class Graph {
else return 1; else return 1;
} }
//! Enable event logging
static void eventlog_enable( int enable) { grow_EventLogEnable( enable);}
// //
// Command module // Command module
......
...@@ -591,9 +591,8 @@ int GlowDrawGtk::event_handler( GdkEvent event) ...@@ -591,9 +591,8 @@ int GlowDrawGtk::event_handler( GdkEvent event)
if ( event.any.window == m_wind.window || event.type == GDK_KEY_PRESS) { if ( event.any.window == m_wind.window || event.type == GDK_KEY_PRESS) {
#if defined PWRE_EVENTLOGGING_ENABLED if ( GlowCtx::eventlog_enabled)
log_event( &event); log_event( &event);
#endif
switch ( event.type) { switch ( event.type) {
case GDK_KEY_PRESS : { case GDK_KEY_PRESS : {
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#include "glow_msg.h" #include "glow_msg.h"
int GlowCtx::eventlog_enabled = 0;
GlowCtx::GlowCtx( const char *ctx_name, double zoom_fact, int offs_x, int offs_y) GlowCtx::GlowCtx( const char *ctx_name, double zoom_fact, int offs_x, int offs_y)
: ctx_type(glow_eCtxType_Glow), : ctx_type(glow_eCtxType_Glow),
mw( zoom_fact, zoom_fact, zoom_fact, offs_x, offs_y), mw( zoom_fact, zoom_fact, zoom_fact, offs_x, offs_y),
......
...@@ -826,6 +826,7 @@ class GlowCtx { ...@@ -826,6 +826,7 @@ class GlowCtx {
glow_eHotIndication hot_indication; //!< Specification of how hots object should be drawn. glow_eHotIndication hot_indication; //!< Specification of how hots object should be drawn.
int tiptext_size; //!< Size of tooltip text int tiptext_size; //!< Size of tooltip text
glow_tEventLogCb eventlog_callback; //!< Callback function to log events. glow_tEventLogCb eventlog_callback; //!< Callback function to log events.
static int eventlog_enabled; //!< Event logging enabled.
//! Register scrollbar callback function //! Register scrollbar callback function
/*! /*!
......
...@@ -4699,6 +4699,11 @@ void grow_EventExec( grow_tCtx ctx, void *event, unsigned int size) ...@@ -4699,6 +4699,11 @@ void grow_EventExec( grow_tCtx ctx, void *event, unsigned int size)
ctx->gdraw->event_exec( event, size); ctx->gdraw->event_exec( event, size);
} }
void grow_EventLogEnable( int enable)
{
GlowCtx::eventlog_enabled = enable;
}
/*@}*/ /*@}*/
......
...@@ -2974,6 +2974,7 @@ extern "C" { ...@@ -2974,6 +2974,7 @@ extern "C" {
int grow_GetDimension( char *filename, int *width, int *height); int grow_GetDimension( char *filename, int *width, int *height);
void grow_SetTextCoding( grow_tCtx ctx, glow_eTextCoding coding); void grow_SetTextCoding( grow_tCtx ctx, glow_eTextCoding coding);
void grow_EventExec( grow_tCtx ctx, void *event, unsigned int size); void grow_EventExec( grow_tCtx ctx, void *event, unsigned int size);
void grow_EventLogEnable( int enable);
/*@}*/ /*@}*/
#if defined __cplusplus #if defined __cplusplus
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
#include "ge_graph.h" #include "ge_graph.h"
#include "xtt_log.h" #include "xtt_log.h"
void XttGe::eventlog_enable( int enable)
{
Graph::eventlog_enable( enable);
}
void XttGe::graph_init_cb( void *client_data) void XttGe::graph_init_cb( void *client_data)
{ {
XttGe *ge = (XttGe *) client_data; XttGe *ge = (XttGe *) client_data;
......
...@@ -92,6 +92,7 @@ class XttGe { ...@@ -92,6 +92,7 @@ class XttGe {
int **is_alist); int **is_alist);
static void ge_eventlog_cb( void *ge_ctx, void *value, unsigned int size); static void ge_eventlog_cb( void *ge_ctx, void *value, unsigned int size);
static void message_cb( void *ctx, char severity, const char *msg); static void message_cb( void *ctx, char severity, const char *msg);
static void eventlog_enable( int enable);
}; };
#endif #endif
......
...@@ -130,7 +130,7 @@ static int xnav_ev_sound_cb( void *xnav, pwr_sAttrRef *arp); ...@@ -130,7 +130,7 @@ static int xnav_ev_sound_cb( void *xnav, pwr_sAttrRef *arp);
static void xnav_ev_pop_cb( void *xnav); static void xnav_ev_pop_cb( void *xnav);
static void xnav_ev_update_info_cb( void *xnav); static void xnav_ev_update_info_cb( void *xnav);
static int xnav_ge_sound_cb( void *xnav, pwr_sAttrRef *arp); static int xnav_ge_sound_cb( void *xnav, pwr_sAttrRef *arp);
static void xnav_ge_eventlog_cb( void *xnav, void *gectx, void *value, unsigned int size); static void xnav_ge_eventlog_cb( void *xnav, void *gectx, int type, void *data, unsigned int size);
static void xnav_ge_display_in_xnav_cb( void *xnav, pwr_sAttrRef *arp); static void xnav_ge_display_in_xnav_cb( void *xnav, pwr_sAttrRef *arp);
static int xnav_ge_is_authorized_cb( void *xnav, unsigned int access); static int xnav_ge_is_authorized_cb( void *xnav, unsigned int access);
static int xnav_attribute_func ( static int xnav_attribute_func (
...@@ -5583,6 +5583,9 @@ static int xnav_oplog_func(void *client_data, ...@@ -5583,6 +5583,9 @@ static int xnav_oplog_func(void *client_data,
strcpy( file_str, xttlog_cLogFile); strcpy( file_str, xttlog_cLogFile);
} }
if ( event)
XttGe::eventlog_enable( 1);
XttLog *log = new XttLog( file_str, event); XttLog *log = new XttLog( file_str, event);
XttLog::delete_default(); XttLog::delete_default();
log->set_default(); log->set_default();
......
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