Commit 033479b9 authored by claes's avatar claes

GTK added

parent 7f06e1d3
This diff is collapsed.
/*
* Proview $Id: ge_attr_gtk.h,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef ge_attr_gtk_h
#define ge_attr_gtk_h
#include "ge_attr.h"
#include "ge_attrnav_gtk.h"
#include "co_wow_gtk.h"
/* ge_attr.h -- Ge attribute editor */
/*! \file ge_attr_gtk.h
\brief Contains the AttrGtk class. */
/*! \addtogroup Ge */
/*@{*/
//! Attribute editor.
/*! Displays grow attributes and dynamic attributes for an object or graph. */
class AttrGtk : public Attr {
public:
AttrGtk(
GtkWidget *a_parent_wid,
void *a_parent_ctx,
void *a_object,
attr_sItem *itemlist,
int item_cnt);
GtkWidget *parent_wid;
GtkWidget *brow_widget;
GtkWidget *form_widget;
GtkWidget *toplevel;
GtkWidget *msg_label;
GtkWidget *cmd_prompt;
GtkWidget *cmd_input;
GtkWidget *cmd_scrolledinput;
GtkWidget *cmd_scrolledtextview;
GtkWidget *cmd_scrolled_ok;
GtkWidget *cmd_scrolled_ca;
GtkTextBuffer *cmd_scrolled_buffer;
GtkWidget *pane;
// int recall_idx;
// GeDyn *original_data;
// static char value_recall[30][160];
// int value_current_recall;
static CoWowRecall value_recall;
CoWowEntryGtk *cmd_entry;
void message( char severity, char *message);
void set_prompt( char *prompt);
void change_value();
int reconfigure_attr();
~AttrGtk();
};
/*@}*/
#endif
/*
* Proview $Id: ge_attrnav_gtk.cpp,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* ge_attrnav.cpp -- Display object info */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
extern "C" {
#include "co_cdh.h"
#include "co_time.h"
}
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/Text.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_gtk.h"
#include "flow_msg.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget_gtk.h"
#include "ge_attr.h"
#include "ge_attrnav_gtk.h"
#include "ge_dyn.h"
#include "ge_msg.h"
//
// Create the navigator widget
//
AttrNavGtk::AttrNavGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
attr_sItem *xn_itemlist,
int xn_item_cnt,
GtkWidget **w,
pwr_tStatus *status) :
AttrNav( xn_parent_ctx, xn_name, xn_itemlist, xn_item_cnt, status),
parent_wid(xn_parent_wid), trace_timerid(0)
{
form_widget = scrolledbrowwidgetgtk_new(
AttrNav::init_brow_cb, this, &brow_widget);
gtk_widget_show_all( brow_widget);
// Create the root item
*w = form_widget;
*status = 1;
}
//
// Delete a nav context
//
AttrNavGtk::~AttrNavGtk()
{
if ( trace_started)
g_source_remove( trace_timerid);
delete brow;
gtk_widget_destroy( form_widget);
}
void AttrNavGtk::trace_start()
{
AttrNavGtk::trace_scan( this);
}
static gboolean attrnavgtk_trace_scan( void *data)
{
AttrNavGtk::trace_scan( (AttrNav *)data);
return FALSE;
}
void AttrNavGtk::trace_scan( AttrNav *attrnav)
{
int time = 200;
if ( attrnav->trace_started) {
brow_TraceScan( attrnav->brow->ctx);
((AttrNavGtk *)attrnav)->trace_timerid = g_timeout_add( time,
attrnavgtk_trace_scan, attrnav);
}
}
void AttrNavGtk::set_inputfocus()
{
gtk_widget_grab_focus( brow_widget);
}
/*
* Proview $Id: xtt_hotkey.h,v 1.2 2005-09-01 14:57:48 claes Exp $
* Proview $Id: ge_attrnav_gtk.h,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -15,33 +15,42 @@
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef op_hotkey_h
#define op_hotkey_h
typedef int hotkeySTATUS;
#define TkSUCCESS 1
#define TkNOOP 2
#define TkERROR 3
#define TkPARSE_ERROR 4
#define TkNO_BINDINGS 5
#define TkINV_ARGS 6
typedef void* hotkeyHandle;
hotkeySTATUS hotkey_Initialize (
Widget w, /*@ARG:RO,VAL,Id of a widget in the */
/* application. This widget is passed */
/* to the `TkHotkeyActionProc' called */
/* when a hotkey is pressed by the user.*/
hotkeyHandle* handle ) /*@ARG:WR,REF,Returned handle. This */
/* handle must be used when calling the */
/* tkhk_process() routine. */
;
hotkeySTATUS hotkey_Process (
hotkeyHandle handle, /*@ARG:RO,VAL,Hotkey handle retured by */
/* tkhk_initialize() routine. */
XEvent *event ) /*@ARG:RO,REF,Address of XEvent record. */
;
#endif/*TkHotkey_DEFS*/
**/
#ifndef ge_attrnav_gtk_h
#define ge_attrnav_gtk_h
/* xtt_attrnav_gtk.h -- Simple navigator */
#include <gtk/gtk.h>
#ifndef ge_attrnav_h
# include "ge_attrnav.h"
#endif
//! The navigation area of the attribute editor.
class AttrNavGtk : public AttrNav {
public:
AttrNavGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
attr_sItem *xn_itemlist,
int xn_item_cnt,
GtkWidget **w,
pwr_tStatus *status);
~AttrNavGtk();
GtkWidget *parent_wid;
GtkWidget *brow_widget;
GtkWidget *form_widget;
GtkWidget *toplevel;
gint trace_timerid;
void start_trace( pwr_tObjid Objid, char *object_str);
void set_inputfocus();
void trace_start();
static void trace_scan( AttrNav *attrnav);
};
#endif
This diff is collapsed.
/*
* Proview $Id: ge_curve_gtk.h,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef ge_curve_gtk_h
#define ge_curve_gtk_h
/* ge_curve_gtk.h -- Curve widget */
#ifndef ge_curve_h
#include "ge_curve.h"
#endif
class GeCurveGtk : public GeCurve {
public:
GeCurveGtk( void *gc_parent_ctx, GtkWidget *parent_widget, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right);
GtkWidget *parent_wid;
GtkWidget *grow_widget;
GtkWidget *curve_widget;
GtkWidget *axisform_widget;
GtkWidget *nameform_widget;
GtkWidget *curveform_widget;
GtkWidget *pane_widget;
GtkWidget *toplevel;
GtkWidget *growcurve_main_widget;
GtkWidget *growaxis_main_widget;
GtkWidget *grownames_main_widget;
GtkWidget *nav_widget;
GtkWidget *minmax_widget;
GtkWidget *minmax_textmin_widget;
GtkWidget *minmax_textmax_widget;
void pop();
void write_title( char *str);
void resize();
void open_minmax( int idx);
void axis_set_width( int width);
void create_minmax_dialog();
~GeCurveGtk();
static void activate_exit( GtkWidget *w, gpointer data);
static void activate_configure( GtkWidget *w, gpointer data);
static void activate_print( GtkWidget *w, gpointer data);
static void activate_zoomin( GtkWidget *w, gpointer data);
static void activate_zoomout( GtkWidget *w, gpointer data);
static void activate_zoomreset( GtkWidget *w, gpointer data);
static void activate_background( GtkWidget *w, gpointer data);
static void activate_showname( GtkWidget *w, gpointer data);
static void activate_filledcurves( GtkWidget *w, gpointer data);
static void activate_xlimits( GtkWidget *w, gpointer data);
static void activate_help( GtkWidget *w, gpointer data);
static void activate_minmax_ok( GtkWidget *w, gpointer data);
static void activate_minmax_cancel( GtkWidget *w, gpointer data);
};
#endif
/*
* Proview $Id: ge_graph_gtk.cpp,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include "co_cdh.h"
#include "co_time.h"
#include "rt_gdh.h"
#include "co_dcli.h"
#include "ge_msg.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "ge_graph_gtk.h"
#include "ge_attr_gtk.h"
#include "glow_growwidget_gtk.h"
GraphGtk::GraphGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
GtkWidget **w,
pwr_tStatus *status,
char *xn_default_path,
graph_eMode graph_mode,
int scrollbar,
int xn_gdh_init_done,
char *xn_object_name,
int xn_use_default_access,
unsigned int xn_default_access) :
Graph( xn_parent_ctx, xn_name, xn_default_path, graph_mode, xn_gdh_init_done, xn_object_name,
xn_use_default_access), parent_wid(xn_parent_wid)
{
if ( scrollbar) {
form_widget = scrolledgrowwidgetgtk_new( graph_init_grow_base_cb, this, &grow_widget);
}
else {
grow_widget = form_widget = growwidgetgtk_new( graph_init_grow_base_cb, this);
// gtk_menu_shell_append( GTK_MENU_SHELL(parent_wid), grow_widget);
}
// Create the root item
*w = form_widget;
gbl.load_config( this);
*status = 1;
}
GraphGtk::~GraphGtk()
{
Attr *attrctx;
int sts;
closing_down = 1;
if ( trace_started)
close_trace( 0);
sts = attr_list.get_first( (void **) &attrctx);
while ( sts) {
delete attrctx;
attr_list.remove( (void *) attrctx);
sts = attr_list.get_first( (void **) &attrctx);
}
localdb_free();
for ( int i = 0; i < grow_cnt; i++) {
grow_SetCtxUserData( grow_stack[i]->ctx, 0);
delete grow_stack[i];
}
grow_SetCtxUserData( grow->ctx, 0);
delete grow;
gtk_widget_destroy( form_widget);
}
void GraphGtk::trace_timer_remove()
{
g_source_remove( trace_timerid);
trace_timerid = 0;
}
static gboolean graphgdk_trace_scan( void *data)
{
Graph::trace_scan( (Graph *)data);
return FALSE;
}
void GraphGtk::trace_timer_add( int time)
{
trace_timerid = g_timeout_add( time,
graphgdk_trace_scan, this);
}
int GraphGtk::create_navigator( GtkWidget *parent)
{
nav_widget = grownavwidgetgtk_new( grow_widget);
return 1;
}
Attr *GraphGtk::attr_new( void *parent_ctx, void *object, attr_sItem *itemlist, int item_cnt)
{
AttrGtk *attr = new AttrGtk( parent_wid, parent_ctx, object, itemlist, item_cnt);
return attr;
}
void GraphGtk::set_inputfocus( int focus)
{
gtk_widget_grab_focus( grow_widget);
}
/*
* Proview $Id: ge_graph_gtk.h,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef ge_graph_gtk_h
#define ge_graph_gtk_h
/* ge_graph_gtk.h -- Simple graphic editor */
#include <gtk/gtk.h>
#ifndef ge_graph_h
# include "ge_graph.h"
#endif
class GraphGtk : public Graph {
public:
//! Constructor
/*!
\param xn_parent_ctx Parent context.
\param xn_parent_wid Parent widget.
\param xn_name Name.
\param w Graph widget.
\param status Returned status.
\param xn_default_path Default path for .pwg files.
\param graph_mode Mode, development or runtime.
\param scrollbar Use scrollbars.
\param xn_gdh_init_done Gdh is alread initialized.
\param xn_object_name Object name for a class graph. If zero, this is not a class graph.
\param xn_use_default_access Use the default access and not the access of the current user.
\param xn_default_access Default access. Can be used to override the access of the current user.
*/
GraphGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
GtkWidget **w,
pwr_tStatus *status,
char *xn_default_path,
graph_eMode graph_mode = graph_eMode_Development,
int scrollbar = 1,
int xn_gdh_init_done = 0,
char *xn_object_name = 0,
int xn_use_default_access = 0,
unsigned int xn_default_access = 0);
void trace_timer_remove();
void trace_timer_add( int time);
int create_navigator( GtkWidget *parent);
Attr *attr_new( void *parent_ctx, void *object, attr_sItem *itemlist, int item_cnt);
void set_inputfocus( int focus);
GtkWidget *parent_wid; //! Parent widget.
GtkWidget *grow_widget; //! Grow widget.
GtkWidget *form_widget; //! Pane widget.
GtkWidget *toplevel; //! Toplevel widget.
GtkWidget *nav_widget; //! Navigation window widget.
guint trace_timerid; //!< Timer id for runtime scan.
~GraphGtk();
};
#endif
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id: ge_subgraphs_gtk.cpp,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* ge_subgraphs_gtk.cpp -- Display object info */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
extern "C" {
#include "co_cdh.h"
#include "co_time.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
}
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_gtk.h"
#include "ge_attr_gtk.h"
#include "ge_subgraphs_gtk.h"
#include "ge_graph.h"
static gint delete_event( GtkWidget *w, GdkEvent *event, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
if ( subgraphs->close_cb)
(subgraphs->close_cb)( subgraphs);
else
delete subgraphs;
return FALSE;
}
static void destroy_event( GtkWidget *w, gpointer data)
{
}
static void attr_focus_in_event( GtkWidget *w, GdkEvent *event, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
gdk_window_focus( subgraphs->brow_widget->window, GDK_CURRENT_TIME);
}
static void subgraphs_activate_close( GtkWidget *w, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
if ( subgraphs->close_cb)
(subgraphs->close_cb)( subgraphs);
else
delete subgraphs;
}
static void subgraphs_activate_attr( GtkWidget *w, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
ItemSubGraph *item;
int sts;
sts = subgraphs->get_select( (void **) &item);
if ( ODD(sts))
subgraphs->edit_attributes( item->nodeclass);
}
static void subgraphs_activate_set_extern( GtkWidget *w, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
ItemSubGraph *item;
int sts;
sts = subgraphs->get_select( (void **) &item);
if ( ODD(sts))
item->set_extern( 1);
}
static void subgraphs_activate_set_intern( GtkWidget *w, gpointer data)
{
SubGraphsGtk *subgraphs = (SubGraphsGtk *)data;
ItemSubGraph *item;
int sts;
sts = subgraphs->get_select( (void **) &item);
if ( ODD(sts))
item->set_extern( 0);
}
static void subgraphs_activate_help( GtkWidget *w, gpointer data)
{
}
//
// Create the navigator widget
//
SubGraphsGtk::SubGraphsGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
void *xn_growctx,
GtkWidget **w,
pwr_tStatus *status) :
SubGraphs( xn_parent_ctx, xn_name, xn_growctx, status),
parent_wid(xn_parent_wid), trace_timerid(0)
{
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", 500,
"default-width", 300,
"title", name,
NULL);
g_signal_connect( toplevel, "delete_event", G_CALLBACK(delete_event), this);
g_signal_connect( toplevel, "destroy", G_CALLBACK(destroy_event), this);
g_signal_connect( toplevel, "focus_in_event", G_CALLBACK(attr_focus_in_event), this);
// Menu
// Accelerators
GtkAccelGroup *accel_g = (GtkAccelGroup *) g_object_new(GTK_TYPE_ACCEL_GROUP, NULL);
gtk_window_add_accel_group(GTK_WINDOW(toplevel), accel_g);
GtkMenuBar *menu_bar = (GtkMenuBar *) g_object_new(GTK_TYPE_MENU_BAR, NULL);
// File entry
GtkWidget *file_attributes = gtk_menu_item_new_with_mnemonic( "_Attributes");
g_signal_connect( file_attributes, "activate",
G_CALLBACK(subgraphs_activate_attr), this);
gtk_widget_add_accelerator( file_attributes, "activate", accel_g,
'a', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *file_setextern = gtk_menu_item_new_with_mnemonic( "Set _Extern");
g_signal_connect( file_setextern, "activate",
G_CALLBACK(subgraphs_activate_set_extern), this);
gtk_widget_add_accelerator( file_setextern, "activate", accel_g,
'e', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *file_setintern = gtk_menu_item_new_with_mnemonic( "Set _Intern");
g_signal_connect( file_setintern, "activate",
G_CALLBACK(subgraphs_activate_set_intern), this);
gtk_widget_add_accelerator( file_setintern, "activate", accel_g,
'i', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
GtkWidget *file_close = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLOSE, accel_g);
g_signal_connect(file_close, "activate", G_CALLBACK(subgraphs_activate_close), this);
GtkMenu *file_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_attributes);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setextern);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_setintern);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close);
GtkWidget *file = gtk_menu_item_new_with_mnemonic("_File");
gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar), file);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(file), GTK_WIDGET(file_menu));
// Help entry
GtkWidget *help_help = gtk_image_menu_item_new_from_stock(GTK_STOCK_HELP, accel_g);
g_signal_connect(help_help, "activate", G_CALLBACK(subgraphs_activate_help), this);
GtkMenu *help_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(help_menu), help_help);
GtkWidget *help = gtk_menu_item_new_with_mnemonic("_Help");
gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar), help);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(help), GTK_WIDGET(help_menu));
form_widget = scrolledbrowwidgetgtk_new(
SubGraphs::init_brow_cb, this, &brow_widget);
GtkWidget *vbox = gtk_vbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(menu_bar), FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(form_widget), TRUE, TRUE, 0);
gtk_container_add( GTK_CONTAINER(toplevel), vbox);
gtk_widget_show_all( toplevel);
*w = toplevel;
*status = 1;
}
//
// Delete a nav context
//
SubGraphsGtk::~SubGraphsGtk()
{
subgraphs_tAttr attrlist_p, next_p;
if ( trace_started)
g_source_remove( trace_timerid);
// Delete all attr-widgets in attrlist
attrlist_p = attrlist;
next_p = NULL;
while( attrlist_p)
{
next_p = attrlist_p->next;
delete attrlist_p->attrctx;
free( (char *) attrlist_p);
attrlist_p = next_p;
}
delete brow;
gtk_widget_destroy( toplevel);
}
void SubGraphsGtk::trace_start()
{
SubGraphsGtk::trace_scan( this);
}
static gboolean subgraphsgtk_trace_scan( void *data)
{
SubGraphsGtk::trace_scan( (SubGraphsGtk *)data);
return FALSE;
}
void SubGraphsGtk::trace_scan( SubGraphsGtk *subgraphs)
{
int time = 200;
if ( subgraphs->trace_started) {
brow_TraceScan( subgraphs->brow->ctx);
((SubGraphsGtk *)subgraphs)->trace_timerid = g_timeout_add( time,
subgraphsgtk_trace_scan, subgraphs);
}
}
Attr *SubGraphsGtk::new_attr( void *object, attr_sItem *items, int num)
{
return new AttrGtk( parent_wid, this, object, items, num);
}
/*
* Proview $Id: xtt_focustimer.h,v 1.4 2005-09-01 14:57:48 claes Exp $
* Proview $Id: ge_subgraphs_gtk.h,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -15,44 +15,46 @@
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef xtt_focustimer_h
#define xtt_focustimer_h
class FocusTimer {
public:
FocusTimer() : set_focus_disabled(0), request_cnt(0), focus_timerid(0) {
}
void disable( Widget w, int time) {
set_focus_disabled++;
if ( request_cnt > 1)
request_cnt = 0;
focus_timerid = XtAppAddTimeOut( XtWidgetToApplicationContext(w), time,
enable_set_focus, this);
}
int disabled() {
// Return false on first request after disable
request_cnt++;
return (request_cnt > 1);
}
private:
int set_focus_disabled;
int request_cnt;
XtIntervalId focus_timerid;
static void enable_set_focus( void *ft, XtIntervalId *id) {
((FocusTimer *)ft)->set_focus_disabled--;
((FocusTimer *)ft)->request_cnt = 0;
}
public:
~FocusTimer() {
if ( set_focus_disabled)
XtRemoveTimeOut( focus_timerid);
}
**/
#ifndef ge_subgraphs_gtk_h
#define ge_subgraphs_gtk_h
#include <gtk/gtk.h>
#ifndef ge_subgraphs_h
# include "ge_subgraphs.h"
#endif
/*! \file ge_subgraphs_gtk.h
\brief Contains the SubGraphs class and related classes. */
/*! \addtogroup Ge */
/*@{*/
//! Display loaded subgraphs.
class SubGraphsGtk : public SubGraphs {
public:
SubGraphsGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
void *grow_ctx,
GtkWidget **w,
pwr_tStatus *status);
GtkWidget *parent_wid;
GtkWidget *subgraphs_form;
GtkWidget *toplevel;
GtkWidget *brow_widget;
GtkWidget *form_widget;
gint trace_timerid;
void trace_start();
Attr *new_attr( void *object, attr_sItem *items, int num);
static void trace_scan( SubGraphsGtk *subgraphs);
~SubGraphsGtk();
};
/*@}*/
#endif
/*
* Proview $Id: ge_subpalette_gtk.cpp,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
extern "C" {
#include "co_cdh.h"
#include "co_time.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
}
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_gtk.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget_gtk.h"
#include "ge_attr.h"
#include "ge_subpalette_gtk.h"
//
// Create the navigator widget
//
SubPaletteGtk::SubPaletteGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
GtkWidget **w,
pwr_tStatus *status) :
SubPalette( xn_parent_ctx, xn_name, status),
parent_wid(xn_parent_wid)
{
form_widget = scrolledbrowwidgetgtk_new(
SubPalette::init_brow_cb, this, &brow_widget);
// Create the root item
*w = form_widget;
*status = 1;
}
//
// Delete a nav context
//
SubPaletteGtk::~SubPaletteGtk()
{
delete brow;
// XtDestroyWidget( form_widget);
}
void SubPaletteGtk::set_inputfocus( int focus)
{
#if 0
Arg args[2];
Pixel bg, fg;
if ( !displayed)
return;
XtVaGetValues( form_widget, XmNbackground, &bg, XmNforeground, &fg, NULL);
if ( !focus) {
XtSetArg(args[0], XmNborderColor, bg);
XtSetValues( form_widget, args, 1);
}
else {
XtCallAcceptFocus( brow_widget, CurrentTime);
XtSetArg(args[0], XmNborderColor, fg);
XtSetValues( form_widget, args, 1);
}
#endif
gtk_widget_grab_focus( brow_widget);
}
/*
* Proview $Id: ge_subpalette_gtk.h,v 1.1 2007-01-04 08:21:58 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef ge_subpalette_gtk_h
#define ge_subpalette_gtk_h
#include "ge_subpalette.h"
/*! \file ge_subpalette_gtk.h
\brief Contains the SubPaletteGtk class. */
/*! \addtogroup Ge */
/*@{*/
class SubPaletteGtk : public SubPalette {
public:
SubPaletteGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
char *xn_name,
GtkWidget **w,
pwr_tStatus *status);
~SubPaletteGtk();
GtkWidget *parent_wid;
GtkWidget *brow_widget;
GtkWidget *form_widget;
GtkWidget *toplevel;
void set_inputfocus( int focus);
};
/*@}*/
#endif
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
This diff is collapsed.
/*
* Proview $Id: xtt_xhelp.h,v 1.2 2005-09-01 14:57:48 claes Exp $
* Proview $Id: ge_attr_motif.h,v 1.1 2007-01-04 08:22:16 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -15,61 +15,53 @@
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
**/
#ifndef wb_xhelp_h
#define wb_xhelp_h
#include "ge_attr.h"
/* wb_xhelp.h -- Helptext navigator */
#ifndef ge_attr_motif_h
#define ge_attr_motif_h
#if defined __cplusplus
extern "C" {
#endif
#ifndef pwr_h
# include "pwr.h"
#endif
/* ge_attr_motif.h -- Ge attribute editor */
/*! \file ge_attr_motif.h
\brief Contains the AttrMotif class. */
/*! \addtogroup Ge */
/*@{*/
class XHelp {
//! Attribute editor.
/*! Displays grow attributes and dynamic attributes for an object or graph. */
class AttrMotif : public Attr {
public:
XHelp(
Widget xa_parent_wid,
void *xa_parent_ctx,
int *xa_sts);
~XHelp();
AttrMotif(
Widget a_parent_wid,
void *a_parent_ctx,
void *a_object,
attr_sItem *itemlist,
int item_cnt);
Widget parent_wid;
void *parent_ctx;
char name[80];
Widget brow_widget;
Widget form_widget;
Widget toplevel;
void *xhelpnav;
Widget xhelpnav_form;
void *client_data;
void (*close_cb) ( void *, void *);
int set_focus_disabled;
XtIntervalId focus_timerid;
int displayed;
void pop();
void clear();
int help( char *key, char *help_bookmark, navh_eHelpFile file_type,
char *file_name);
int help_index( navh_eHelpFile file_type, char *file_name);
void set_dimension( int width, int height);
Widget msg_label;
Widget cmd_prompt;
Widget cmd_input;
Widget cmd_scrolledinput;
Widget cmd_scrolled_ok;
Widget cmd_scrolled_ca;
Widget attrnav_form;
static char value_recall[30][160];
int value_current_recall;
void message( char severity, char *message);
void set_prompt( char *prompt);
void change_value();
int reconfigure_attr();
~AttrMotif();
};
#if defined __cplusplus
}
#endif
/*@}*/
#endif
/*
* Proview $Id: ge_attrnav_motif.cpp,v 1.1 2007-01-04 08:22:16 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* ge_attrnav.cpp -- Display object info */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
extern "C" {
#include "co_cdh.h"
#include "co_time.h"
}
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/Text.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_motif.h"
#include "flow_msg.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget_motif.h"
#include "ge_attr.h"
#include "ge_attrnav_motif.h"
#include "ge_dyn.h"
#include "ge_msg.h"
//
// Create the navigator widget
//
AttrNavMotif::AttrNavMotif(
void *xn_parent_ctx,
Widget xn_parent_wid,
char *xn_name,
attr_sItem *xn_itemlist,
int xn_item_cnt,
Widget *w,
pwr_tStatus *status) :
AttrNav( xn_parent_ctx, xn_name, xn_itemlist, xn_item_cnt, status),
parent_wid(xn_parent_wid), trace_timerid(0)
{
form_widget = ScrolledBrowCreate( parent_wid, name, NULL, 0,
AttrNav::init_brow_cb, this, (Widget *)&brow_widget);
XtManageChild( form_widget);
// Create the root item
*w = form_widget;
*status = 1;
}
//
// Delete a nav context
//
AttrNavMotif::~AttrNavMotif()
{
if ( trace_started)
XtRemoveTimeOut( trace_timerid);
delete brow;
XtDestroyWidget( form_widget);
}
void AttrNavMotif::trace_start()
{
AttrNavMotif::trace_scan( this);
}
void AttrNavMotif::trace_scan( AttrNav *attrnav)
{
int time = 200;
if ( attrnav->trace_started)
{
brow_TraceScan( attrnav->brow->ctx);
((AttrNavMotif *)attrnav)->trace_timerid = XtAppAddTimeOut(
XtWidgetToApplicationContext( ((AttrNavMotif *)attrnav)->brow_widget) , time,
(XtTimerCallbackProc)AttrNavMotif::trace_scan, attrnav);
}
}
void AttrNavMotif::set_inputfocus()
{
// brow_SetInputFocus( brow->ctx);
XtCallAcceptFocus( brow_widget, CurrentTime);
}
/*
* Proview $Id: ge_attrnav_motif.h,v 1.1 2007-01-04 08:22:16 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef ge_attrnav_motif_h
#define ge_attrnav_motif_h
/* xtt_attrnav_motif.h -- Simple navigator */
#ifndef ge_attrnav_h
# include "ge_attrnav.h"
#endif
//! The navigation area of the attribute editor.
class AttrNavMotif : public AttrNav {
public:
AttrNavMotif(
void *xn_parent_ctx,
Widget xn_parent_wid,
char *xn_name,
attr_sItem *xn_itemlist,
int xn_item_cnt,
Widget *w,
pwr_tStatus *status);
~AttrNavMotif();
Widget parent_wid;
Widget brow_widget;
Widget form_widget;
Widget toplevel;
XtIntervalId trace_timerid;
void start_trace( pwr_tObjid Objid, char *object_str);
void set_inputfocus();
void trace_start();
static void trace_scan( AttrNav *attrnav);
};
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id: ge_convert.cpp,v 1.4 2005-12-13 15:14:02 claes Exp $
* Proview $Id: ge_convert.cpp,v 1.5 2007-01-04 08:18:35 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -52,7 +52,6 @@ extern "C" {
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget.h"
#include "ge_graph.h"
#include "co_dcli_msg.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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