Commit fb2b8db9 authored by Claes's avatar Claes

Oplog enable function added

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