Commit a3a75762 authored by claes's avatar claes

Compile and link corrections for Lynx and Alpha

parent fc434677
......@@ -12,5 +12,6 @@ pwr_obj:cnv_classread_xtthelp
pwr_obj:cnv_classread_src
pwr_obj:cnv_classread_struct
pwr_obj:cnv_help
pwr_obj:cnv_setup
pwr_lib:libpwr_co/lib
pwr_obj:pwr_msg_co.obj
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) \
$(pwr_obj)/rt_io_user.o \
-lpwr_rt -lpwr_co -lpwr_msg_dummy\
-lrpc -lnetinet -llynx
endif
......@@ -130,17 +130,17 @@ void msgw_message( int severity, char *text, msgw_ePop pop)
void msgw_message_sts( pwr_tStatus sts, char *text1, char *text2)
{
MsgWindow::message( wb_error(sts), text1, text2);
MsgWindow::message( co_error(sts), text1, text2);
}
void msgw_message_object( pwr_tStatus sts, char *text1, char *text2, pwr_tOid oid)
{
MsgWindow::message( wb_error(sts), text1, text2, oid);
MsgWindow::message( co_error(sts), text1, text2, oid);
}
void msgw_message_plcobject( pwr_tStatus sts, char *text1, char *text2, pwr_tOid oid)
{
MsgWindow::message( wb_error(sts), text1, text2, oid, true);
MsgWindow::message( co_error(sts), text1, text2, oid, true);
}
void msgw_set_nodraw()
......
......@@ -73,7 +73,7 @@ void MsgWindow::message( int severity, const char *text, msgw_ePop pop, pwr_tOid
default_window->map();
}
void MsgWindow::message( const wb_error& e, const char *text1, const char *text2, pwr_tOid oid, bool is_plc)
void MsgWindow::message( const co_error& e, const char *text1, const char *text2, pwr_tOid oid, bool is_plc)
{
pwr_tStatus sts = e.sts();
int severity;
......
......@@ -26,8 +26,8 @@ extern "C" {
# include "co_msglist.h"
#endif
#ifndef wb_error_h
# include "wb_error.h"
#ifndef co_error_h
# include "co_error.h"
#endif
typedef enum {
......@@ -71,7 +71,7 @@ class MsgWindow {
static void set_default( MsgWindow *msgw) { default_window = msgw;}
static void message( int severity, const char *text, msgw_ePop pop = msgw_ePop_Default,
pwr_tOid oid = pwr_cNOid, bool is_plc = false);
static void message( const wb_error& e, const char *text1 = 0, const char *text2 = 0,
static void message( const co_error& e, const char *text1 = 0, const char *text2 = 0,
pwr_tOid oid = pwr_cNOid, bool is_plc = false);
static void message( int severity, const char *text1, const char *text2, const char *text3 = 0,
pwr_tOid oid = pwr_cNOid, bool is_plc = false);
......
......@@ -8,6 +8,8 @@
<Description>. */
#include <string.h>
#if defined __cplusplus
extern "C" {
#endif
......
......@@ -159,7 +159,7 @@ class GeUser {
char fname[256];
bool get_system_name_child( SystemList *s, SystemList *system, char *name);
SystemList *GeUser::get_system_child( SystemList *system, UserList *user);
SystemList *get_system_child( SystemList *system, UserList *user);
public:
......
......@@ -780,7 +780,7 @@ io_init_iv_signals (
pwr_sClass_IvArea *area_op;
pwr_sClass_Iv *o;
pwr_tStatus sts;
pwr_tBoolean *p;
pwr_tInt32 *p;
pwr_tInt32 iv_count=0;
pwr_sClass_IvArea *iarea_op;
......@@ -817,7 +817,7 @@ io_init_iv_signals (
#if 0
*p = o->InitialValue;
#endif
gdh_StoreRtdbPointer( (pwr_tInt32 *)&iarea_op->Value[iv_count], &o->InitialValue);
gdh_StoreRtdbPointer( (pwr_tUInt32 *)&iarea_op->Value[iv_count], &o->InitialValue);
iv_count++;
p++;
}
......
#ifndef wb_error_h
#define wb_error_h
#include "pwr.h"
#include "co_error.h"
#include "wb_status.h"
class wb_error : public wb_status
{
public:
wb_error() {};
wb_error( pwr_tStatus sts) : wb_status(sts) {}
};
class wb_error_str : public wb_error
{
string m_error_str;
public:
wb_error_str(string str) : m_error_str(str) {}
wb_error_str( pwr_tStatus sts, string str): wb_error(sts), m_error_str(str) {}
string what() const
{
string s;
if ( m_sts)
s = m_error_str + ", " + wb_error::what();
else
s = m_error_str;
return s;
}
};
#define wb_error co_error
#define wb_error_str co_error_str
#endif
#ifndef wb_status_h
#define wb_status_h
#include <string>
#include "pwr.h"
extern "C" {
#include "co_msg.h"
}
using namespace std;
class wb_status
{
protected:
pwr_tStatus m_sts;
public:
wb_status() : m_sts(0) {}
wb_status( pwr_tStatus sts) : m_sts(sts) {}
virtual ~wb_status() {};
pwr_tStatus sts() const { return m_sts;}
bool evenSts() const { return EVEN(m_sts);}
bool oddSts() const { return ODD(m_sts);}
virtual string what() const
{
char msg[200];
msg_GetMsg( m_sts, msg, sizeof(msg));
string s(msg);
return s;
}
};
#include "co_status.h"
#define wb_status co_status
#endif
......
......@@ -27,6 +27,7 @@ pwr_obj:xtt_menu.obj
pwr_obj:xtt_xhelp.obj
pwr_obj:xtt_url.obj
pwr_obj:xtt_logging.obj
pwr_obj:xtt_fast.obj
pwr_obj:xtt_xnav_brow.obj
pwr_obj:xtt_c_object.obj
pwr_obj:xtt_c_plcpgm.obj
......
......@@ -22,9 +22,9 @@ extern "C" {
#define MIN(Dragon,Eagle) ((Dragon) < (Eagle) ? (Dragon) : (Eagle))
#endif
#ifndef __ALPHA
//#ifndef __ALPHA
#define ABS(Dragon) ((Dragon) >= 0 ? (Dragon) : (-(Dragon)))
#endif
//#endif
#define DRAW_TYPE_SIZE 9
#define DRAW_FONT_SIZE 9
......
......@@ -52,6 +52,7 @@ extern "C" {
#endif
}
#if defined OS_LINUX
static void get_class_dyntype( int trace_type, int *d, int *a, int *anim_sequence_p)
{
int dyn_type;
......@@ -2025,9 +2026,13 @@ int Graph::convert_object( grow_tObject object)
return 1;
}
#else
int Graph::convert()
{
return 1;
}
#endif
......
......@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <math.h>
extern "C" {
#include "co_cdh.h"
......@@ -124,6 +125,8 @@ GeDyn::GeDyn( const GeDyn& x) :
e = new GeRotate((const GeRotate&) *elem); break;
case ge_mDynType_Move:
e = new GeMove((const GeMove&) *elem); break;
case ge_mDynType_DigShift:
e = new GeDigShift((const GeDigShift&) *elem); break;
case ge_mDynType_AnalogShift:
e = new GeAnalogShift((const GeAnalogShift&) *elem); break;
case ge_mDynType_Video:
......@@ -893,21 +896,21 @@ int GeDyn::connect( grow_tObject object, glow_sTraceData *trace_data)
if ( cycle == glow_eCycle_Inherit)
cycle = glow_eCycle_Slow;
if ( dyn_type & ge_mDynType_Inherit)
(int)dyn_type = dyn_type & ~ge_mActionType_Inherit;
dyn_type = ge_mDynType( dyn_type & ~ge_mDynType_Inherit);
if ( dyn_type & ge_mDynType_Inherit)
(int)action_type = action_type & ~ge_mActionType_Inherit;
action_type = ge_mActionType( action_type & ~ge_mActionType_Inherit);
}
if ( dyn_type & ge_mDynType_Inherit) {
grow_GetObjectClassDynType( object, &inherit_dyn_type, &inherit_action_type);
(int)total_dyn_type = dyn_type | inherit_dyn_type;
total_dyn_type = ge_mDynType( dyn_type | inherit_dyn_type);
}
else
total_dyn_type = dyn_type;
if ( action_type & ge_mActionType_Inherit) {
grow_GetObjectClassDynType( object, &inherit_dyn_type, &inherit_action_type);
(int)total_action_type = action_type | inherit_action_type;
total_action_type = ge_mActionType( action_type | inherit_action_type);
}
else
total_action_type = action_type;
......@@ -965,14 +968,14 @@ void GeDyn::export_java( grow_tObject object, ofstream& fp, char *var_name)
if ( dyn_type & ge_mDynType_Inherit) {
grow_GetObjectClassDynType( object, &inherit_dyn_type, &inherit_action_type);
(int)total_dyn_type = dyn_type | inherit_dyn_type;
total_dyn_type = ge_mDynType( dyn_type | inherit_dyn_type);
}
else
total_dyn_type = dyn_type;
if ( action_type & ge_mActionType_Inherit) {
grow_GetObjectClassDynType( object, &inherit_dyn_type, &inherit_action_type);
(int)total_action_type = (action_type | inherit_action_type) & ~ge_mActionType_Inherit;
total_action_type = ge_mActionType( (action_type | inherit_action_type) & ~ge_mActionType_Inherit);
}
else
total_action_type = action_type;
......@@ -1079,7 +1082,7 @@ int GeDigLowColor::set_color( grow_tObject object, glow_eDrawType color)
char msg[200];
if ( dyn->total_dyn_type & ge_mDynType_Tone) {
(int) this->color = color / 30;
this->color = glow_eDrawType( color / 30);
sprintf( msg, "DigLowTone.Tone = %s", grow_ColorToneToName( this->color));
}
else {
......@@ -1319,7 +1322,7 @@ int GeDigColor::set_color( grow_tObject object, glow_eDrawType color)
char msg[200];
if ( dyn->total_dyn_type & ge_mDynType_Tone) {
(int) this->color = color / 30;
this->color = glow_eDrawType( color / 30);
if ( instance == ge_mInstance_1)
sprintf( msg, "DigTone.Tone = %s", grow_ColorToneToName( this->color));
else
......@@ -1787,7 +1790,7 @@ int GeDigFlash::set_color( grow_tObject object, glow_eDrawType color)
char msg[200];
if ( dyn->total_dyn_type & ge_mDynType_Tone) {
(int) this->color = color / 30;
this->color = glow_eDrawType( color / 30);
sprintf( msg, "DigFlash.Tone = %s", grow_ColorToneToName( this->color));
}
else {
......@@ -2949,7 +2952,7 @@ int GeAnalogColor::set_color( grow_tObject object, glow_eDrawType color)
char msg[200];
if ( dyn->total_dyn_type & ge_mDynType_Tone) {
(int) this->color = color / 30;
this->color = glow_eDrawType( color / 30);
if ( instance == ge_mInstance_1)
sprintf( msg, "AnalogTone.Tone = %s", grow_ColorToneToName( this->color));
else
......
......@@ -810,10 +810,10 @@ void Graph::change_value( grow_tObject object, char *text)
event.event = glow_eEvent_MB1Click;
// Trigger the confirm action
(int)dyn->total_action_type = dyn->total_action_type & ~ge_mActionType_ValueInput;
dyn->total_action_type = ge_mActionType( dyn->total_action_type & ~ge_mActionType_ValueInput);
strncpy( confirm_text, text, sizeof(confirm_text));
dyn->action( object, &event);
(int)dyn->total_action_type = dyn->total_action_type | ge_mActionType_ValueInput;
dyn->total_action_type = ge_mActionType( dyn->total_action_type | ge_mActionType_ValueInput);
}
else {
dyn->change_value( object, text);
......@@ -1848,7 +1848,7 @@ static int graph_grow_cb( GlowCtx *ctx, glow_tEvent event)
GeDyn *dyn = new GeDyn( graph);
grow_SetUserData( n1, (void *)dyn);
if ( grow_IsSliderClass( nc))
(int)dyn->action_type |= ge_mActionType_Slider;
dyn->action_type = ge_mActionType( dyn->action_type | ge_mActionType_Slider);
}
else if ( strcmp( type, ".gif") == 0 || strcmp( type, ".jpg") == 0)
......
......@@ -39,6 +39,8 @@ extern "C" {
#define cFrameBorderX 8
#define cFrameBorderY 44
#if defined OS_LINUX
int Graph::export_javabean( char *filename, char *bean_name)
{
ofstream fp;
......@@ -2249,3 +2251,24 @@ int Graph::export_SliderTraceAttr( ofstream& fp, grow_tObject object, int cnt)
return 1;
}
#else
int Graph::export_javabean( char *filename, char *bean_name) { return 1;}
int Graph::export_gejava_nodeclass( ofstream& fp, grow_tNodeClass nodeclass) { return 1;}
int Graph::export_javaframe( char *filename, char *bean_name, int applet,
int html) { return 1;}
int Graph::export_gejava( char *filename, char *bean_name, int applet, int html) { return 1;}
int Graph::export_ObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt) { return 1;}
int Graph::export_GejavaObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt) { return 1;}
int Graph::export_BarTraceAttr( ofstream& fp, grow_tObject object, int cnt){ return 1;}
int Graph::export_TrendTraceAttr( ofstream& fp, grow_tObject object, int cnt) { return 1;}
int Graph::export_SliderTraceAttr( ofstream& fp, grow_tObject object, int cnt) { return 1;}
#endif
......@@ -203,20 +203,20 @@ glow_eDrawType GlowColor::get_drawtype( glow_eDrawType local_drawtype,
if ( local_drawtype > 30) {
if ( tone >= glow_eDrawTone_GrayHighSaturation &&
tone < glow_eDrawTone_GrayLowSaturation) {
(int)tone -= 27;
tone = glow_eDrawTone( tone - 27);
intensity += 2;
}
else if ( tone >= glow_eDrawTone_GrayLowSaturation) {
(int)tone -= 2 * 27;
tone = glow_eDrawTone( tone - 2 * 27);
intensity -= 1;
}
if ( tone >= glow_eDrawTone_DarkGray &&
tone < glow_eDrawTone_LightGray) {
(int)tone -= 9;
tone = glow_eDrawTone( tone - 9);
lightness -= 2;
}
else if ( tone >= glow_eDrawTone_LightGray) {
(int)tone -= 18;
tone = glow_eDrawTone( tone - 18);
lightness += 2;
}
......@@ -254,7 +254,7 @@ glow_eDrawType GlowColor::get_drawtype( glow_eDrawType local_drawtype,
if ( drawtype >= 60) {
base_drawtype = drawtype / 30 * 30;
incr = drawtype - base_drawtype;
(int)drawtype += min( 2 - incr / 10, intensity) * 10;
drawtype = glow_eDrawType( drawtype + min( 2 - incr / 10, intensity) * 10);
if ( drawtype < base_drawtype)
drawtype = (glow_eDrawType)( glow_eDrawType_Color41 + incr);
/*
......
......@@ -1298,7 +1298,7 @@ void GlowExportJBean::annot( int x0, int y0, int number,
" = s;}" << endl <<
" Font annot" << number << "Font = new Font(\"Helvetica\", Font." <<
bold_str << ", " << text_size << ");" << endl <<
" int annot" << number << "Color = " << text_drawtype << ";" << endl <<
" int annot" << number << "Color = " << int(text_drawtype) << ";" << endl <<
" public void setAnnot" << number << "Font( Font font) { annot" << number <<
"Font = font;}" << endl <<
" public void setAnnot" << number << "Color( int color) { annot" << number <<
......
......@@ -3588,6 +3588,9 @@ int grow_ImageUpdate( grow_tObject object)
return ((GrowImage *)object)->update();
}
#if defined OS_VMS
extern "C"
#endif
void grow_RegisterUserDataCallbacks( grow_tCtx ctx,
void (*save)( void *, grow_tObject),
void (*open)( void *, grow_tObject),
......
......@@ -1624,7 +1624,7 @@ void GrowCtx::save_grow( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowCtx_cycle) << FSPACE << int(cycle) << endl;
fp << int(glow_eSave_GrowCtx_mb3_action) << FSPACE << int(mb3_action) << endl;
fp << int(glow_eSave_GrowCtx_translate_on) << FSPACE << translate_on << endl;
fp << int(glow_eSave_GrowCtx_input_focus_mark) << FSPACE << input_focus_mark << endl;
fp << int(glow_eSave_GrowCtx_input_focus_mark) << FSPACE << int(input_focus_mark) << endl;
fp << int(glow_eSave_End) << endl;
}
......@@ -1846,7 +1846,7 @@ int GrowCtx::save_subgraph( char *filename, glow_eSaveMode mode)
fp << int(glow_eSave_NodeClass_y1) << FSPACE << y1 << endl;
fp << int(glow_eSave_NodeClass_x0) << FSPACE << x0 << endl;
fp << int(glow_eSave_NodeClass_x1) << FSPACE << x1 << endl;
fp << int(glow_eSave_NodeClass_input_focus_mark) << FSPACE << input_focus_mark << endl;
fp << int(glow_eSave_NodeClass_input_focus_mark) << FSPACE << int(input_focus_mark) << endl;
fp << int(glow_eSave_End) << endl;
// End Array
......@@ -3464,9 +3464,9 @@ void GrowCtx::convert( glow_eConvert version)
set_background( background_color);
if ( dyn_type == 3 || dyn_type == 4 || dyn_type == 12) {
if ( (glow_eDrawTone) dyn_color[0] == glow_eDrawTone_YellowGreen)
(glow_eDrawTone) dyn_color[0] = glow_eDrawTone_Yellow;
dyn_color[0] = (glow_eDrawType) glow_eDrawTone_Yellow;
if ( (glow_eDrawTone) dyn_color[1] == glow_eDrawTone_YellowGreen)
(glow_eDrawTone) dyn_color[1] = glow_eDrawTone_Yellow;
dyn_color[1] = (glow_eDrawType) glow_eDrawTone_Yellow;
}
else {
dyn_color[0] = GlowColor::convert( version, dyn_color[0]);
......
......@@ -273,7 +273,7 @@ void GrowLine::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowLine_y_low) << FSPACE << y_low << endl;
fp << int(glow_eSave_GrowLine_original_border_drawtype) << FSPACE
<< int(original_border_drawtype) << endl;
fp << int(glow_eSave_GrowLine_line_type) << FSPACE << line_type << endl;
fp << int(glow_eSave_GrowLine_line_type) << FSPACE << int(line_type) << endl;
fp << int(glow_eSave_GrowLine_line_part) << endl;
GlowLine::save( fp, mode);
fp << int(glow_eSave_GrowLine_trf) << endl;
......
......@@ -1954,9 +1954,9 @@ void GrowNode::convert( glow_eConvert version)
trace.attr_type == 1013 || trace.attr_type == 1014 || trace.attr_type == 1015 ||
trace.attr_type == 1016 || trace.attr_type == 1021 || trace.attr_type == 1023) {
if ( (glow_eDrawTone) trace.color == glow_eDrawTone_YellowGreen)
(glow_eDrawTone) trace.color = glow_eDrawTone_Yellow;
trace.color = (glow_eDrawType) glow_eDrawTone_Yellow;
if ( (glow_eDrawTone) trace.color2 == glow_eDrawTone_YellowGreen)
(glow_eDrawTone) trace.color2 = glow_eDrawTone_Yellow;
trace.color2 = (glow_eDrawType) glow_eDrawTone_Yellow;
}
else {
trace.color = GlowColor::convert( version, trace.color);
......
......@@ -119,7 +119,7 @@ void GlowNodeClass::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_NodeClass_y1) << FSPACE << y1 << endl;
fp << int(glow_eSave_NodeClass_x0) << FSPACE << x0 << endl;
fp << int(glow_eSave_NodeClass_x1) << FSPACE << x1 << endl;
fp << int(glow_eSave_NodeClass_input_focus_mark) << FSPACE << input_focus_mark << endl;
fp << int(glow_eSave_NodeClass_input_focus_mark) << FSPACE << int(input_focus_mark) << endl;
fp << int(glow_eSave_End) << endl;
}
......@@ -847,9 +847,9 @@ void GlowNodeClass::convert( glow_eConvert version)
a.convert( version);
if ( dyn_type == 3 || dyn_type == 4 || dyn_type == 12) {
if ( (glow_eDrawTone) dyn_color[0] == glow_eDrawTone_YellowGreen)
(glow_eDrawTone) dyn_color[0] = glow_eDrawTone_Yellow;
dyn_color[0] = (glow_eDrawType) glow_eDrawTone_Yellow;
if ( (glow_eDrawTone) dyn_color[1] == glow_eDrawTone_YellowGreen)
(glow_eDrawTone) dyn_color[1] = glow_eDrawTone_Yellow;
dyn_color[1] = (glow_eDrawType) glow_eDrawTone_Yellow;
}
else {
dyn_color[0] = GlowColor::convert( version, dyn_color[0]);
......
......@@ -129,8 +129,7 @@ int XNav::help( char *help_key, char *help_bookmark,
brow_SetNodraw( brow->ctx);
}
sts = navhelp->help( help_key, help_bookmark, file_type,
file_name, &bookmark_node);
file_name, &bookmark_node, false);
if ( EVEN(sts)) {
if ( !pop || (pop && !init_help)) {
brow_push();
......
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