Commit e5535758 authored by claes's avatar claes

Build methods

parent 697a61ef
/*
* Proview $Id: wb_cmd.cpp,v 1.8 2005-12-15 07:41:17 claes Exp $
* Proview $Id: wb_cmd.cpp,v 1.9 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -276,7 +276,8 @@ static void cmd_close_cb( void *ctx)
}
Cmd::Cmd() :
ldhses(0), wbctx(0), volctx(0), volid(0), wnav(0), wb_type(0)
ctx_type(wb_eUtility_Cmd), ldhses(0), wbctx(0), volctx(0), volid(0), wnav(0),
wb_type(0)
{
Widget w;
pwr_tStatus sts;
......
/*
* Proview $Id: wb_cmdc.h,v 1.2 2005-09-01 14:57:48 claes Exp $
* Proview $Id: wb_cmdc.h,v 1.3 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -28,6 +28,10 @@ extern "C" {
# include "pwr.h"
#endif
#ifndef wb_h
# include "wb.h"
#endif
#ifndef wb_ldh_h
# include "wb_ldh.h"
#endif
......@@ -44,6 +48,7 @@ class Cmd {
public:
Cmd();
wb_eUtility ctx_type;
ldh_tSesContext ldhses;
ldh_tWBContext wbctx;
ldh_tVolContext volctx;
......
/*
* Proview $Id: wb.h,v 1.9 2005-10-25 12:04:25 claes Exp $
* Proview $Id: wb.h,v 1.10 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -42,7 +42,9 @@ typedef enum {
wb_eUtility_PlcEditor = 1000,
wb_eUtility_AttributeEditor = 1001,
wb_eUtility_Distributor = 1002,
wb_eUtility_SpreadsheetEditor = 1003
wb_eUtility_SpreadsheetEditor = 1003,
wb_eUtility_Cmd = 1004,
wb_eUtility_WNav = 1005
} wb_eUtility;
#endif
......
/*
* Proview $Id: wb_api.cpp,v 1.8 2005-12-13 15:15:53 claes Exp $
* Proview $Id: wb_api.cpp,v 1.9 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -204,6 +204,11 @@ int wtt_command( wtt_tCtx wttctx, char *cmd)
return ((Wtt *)wttctx)->wnav->command( cmd);
}
int wnav_command( wnav_tCtx wnavctx, char *cmd)
{
return ((WNav *)wnavctx)->command( cmd);
}
//
// Interface to Watt
//
......
/*
* Proview $Id: wb_api.h,v 1.6 2005-09-06 10:43:30 claes Exp $
* Proview $Id: wb_api.h,v 1.7 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -88,6 +88,7 @@ void nav_set_inputfocus( nav_tCtx navctx, int focus);
/* Wtt */
typedef void *wtt_tCtx;
typedef void *wnav_tCtx;
wtt_tCtx wtt_new(
void *parent_ctx,
......@@ -104,6 +105,7 @@ wtt_tCtx wtt_new(
int wtt_get_select_first( wtt_tCtx palctx, pwr_sAttrRef *attrref,
int *is_attr);
int wtt_command( wtt_tCtx wttctx, char *cmd);
int wnav_command( wnav_tCtx wnavctx, char *cmd);
typedef void *watt_tCtx;
watt_tCtx watt_new(
......
This diff is collapsed.
/*
* Proview $Id: wb_build.h,v 1.1 2006-03-31 14:24:34 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 wb_build_h
#define wb_build_h
#include "pwr.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wnav.h"
#include "wb_build_opt.h"
class Wtt;
class wb_build : public wb_status
{
public:
wb_build( wb_session ses, WNav *wnav = 0, void *window = 0):
m_session(ses), m_wnav(wnav), m_hierarchy(pwr_cNOid), m_window(window) {};
void classlist( pwr_tCid cid);
void node( char *nodename, void *volumelist, int volumecnt);
void volume();
void rootvolume( pwr_tVid vid);
void classvolume( pwr_tVid vid);
void planthier( pwr_tOid oid);
void nodehier( pwr_tOid oid);
void plcpgm( pwr_tOid oid);
void xttgraph( pwr_tOid oid);
void webhandler( pwr_tOid oid);
wb_build_opt opt;
wb_session m_session;
WNav *m_wnav;
pwr_tOid m_hierarchy;
void *m_window;
};
#endif
/*
* Proview $Id: wb_build_opt.h,v 1.1 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund 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 wb_build_opt_h
#define wb_build_opt_h
class wb_build_opt
{
public:
wb_build_opt() : force(0), debug(0), crossref(0), manual(0) {}
int force;
int debug;
int crossref;
int manual;
};
#endif
/*
* Proview $Id: wb_c_nodehier.cpp,v 1.1 2006-03-31 14:24:34 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.
**/
/* wb_c_nodehier.c -- work bench methods of the NodeHier class. */
#include <string.h>
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.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.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
Build NodeHier.
\*----------------------------------------------------------------------------*/
static pwr_tStatus Build (
ldh_sMenuCall *ip
)
{
WNav *wnav = (WNav *)ip->EditorContext;
wb_build build( *(wb_session *)ip->PointedSession, wnav, ip->WindowContext);
build.opt = wnav->gbl.build;
build.nodehier( ip->Pointed.Objid);
if ( build.sts() == PWRB__NOBUILT)
wnav->message( 'I', "Nothing to build");
return build.sts();
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods($NodeHier) = {
pwr_BindMethod(Build),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_object.c,v 1.8 2005-12-06 10:54:51 claes Exp $
* Proview $Id: wb_c_object.c,v 1.9 2006-03-31 14:24:34 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -31,6 +31,7 @@
#include "co_api.h"
#include <X11/Intrinsic.h>
#include "wb_api.h"
#include "wb_login.h"
static pwr_tStatus CopyObject (
ldh_sMenuCall *ip
......@@ -564,7 +565,7 @@ static pwr_tStatus ClassHelp( ldh_sMenuCall *ip)
else
sprintf( cmd, "help %s /strict", cname);
wtt_command( ip->EditorContext, cmd);
wnav_command( ip->EditorContext, cmd);
return 1;
}
......@@ -597,7 +598,7 @@ static pwr_tStatus HelpClass( ldh_sMenuCall *ip)
sprintf( cmd, "help %s /helpfile=\"$pwr_exe/%s/%s_xtthelp.dat\"/strict", cname,
lng_get_language_str(), vname);
wtt_command( ip->EditorContext, cmd);
wnav_command( ip->EditorContext, cmd);
return 1;
}
......@@ -606,7 +607,7 @@ static pwr_tStatus HelpClass( ldh_sMenuCall *ip)
else
sprintf( cmd, "help %s /strict", cname);
wtt_command( ip->EditorContext, cmd);
wnav_command( ip->EditorContext, cmd);
return 1;
}
......@@ -637,7 +638,7 @@ static pwr_tStatus Help( ldh_sMenuCall *ip)
sprintf( cmd, "help %s /strict", topic);
free( topic);
wtt_command( ip->EditorContext, cmd);
wnav_command( ip->EditorContext, cmd);
return 1;
}
......@@ -955,6 +956,16 @@ static pwr_tStatus ConfigureComponentFilter( ldh_sMenuCall *ip)
}
// Common Build filter
static pwr_tStatus BuildFilter( ldh_sMenuCall *ip)
{
if ( login_prv.priv & pwr_mPrv_DevConfig)
return 1;
else
return 0;
}
pwr_dExport pwr_BindMethods($Object) = {
pwr_BindMethod(CreateObject),
pwr_BindMethod(CopyObject),
......@@ -980,6 +991,7 @@ pwr_dExport pwr_BindMethods($Object) = {
pwr_BindMethod(DisableFilter),
pwr_BindMethod(ConfigureComponent),
pwr_BindMethod(ConfigureComponentFilter),
pwr_BindMethod(BuildFilter),
pwr_NullMethod
};
......
/*
* Proview $Id: wb_c_planthier.cpp,v 1.1 2006-03-31 14:24:34 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.
**/
/* wb_c_planthier.c -- work bench methods of the PlantHier class. */
#include <string.h>
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.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.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
Build volume.
\*----------------------------------------------------------------------------*/
static pwr_tStatus Build (
ldh_sMenuCall *ip
)
{
WNav *wnav = (WNav *)ip->EditorContext;
wb_build build( *(wb_session *)ip->PointedSession, wnav, ip->WindowContext);
build.opt = wnav->gbl.build;
build.planthier( ip->Pointed.Objid);
if ( build.sts() == PWRB__NOBUILT)
wnav->message( 'I', "Nothing to build");
return build.sts();
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods($PlantHier) = {
pwr_BindMethod(Build),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_plcpgm.cpp,v 1.1 2006-03-31 14:24:34 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.
**/
/* wb_c_plcpgm.c -- work bench methods of the PlcPgm class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_foe_api.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "wb_utl.h"
#include <Xm/Xm.h>
#include <Xm/XmP.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.h"
#include "wb_wnav.h"
#include "wb_build.h"
/*----------------------------------------------------------------------------*\
To open a PLC program with the PLC editor.
\*----------------------------------------------------------------------------*/
static pwr_tStatus OpenProgram (
ldh_sMenuCall *ip
)
{
foe_Open (ip->EditorContext, ip->WindowContext, ip->PointedSession,
ip->Pointed.Objid);
return 1;
}
/*----------------------------------------------------------------------------*\
Build, i.e. compile the plcpgm.
\*----------------------------------------------------------------------------*/
static pwr_tStatus Build (
ldh_sMenuCall *ip
)
{
WNav *wnav = (WNav *)ip->EditorContext;
wb_build build( *(wb_session *)ip->PointedSession, wnav, ip->WindowContext);
build.opt = wnav->gbl.build;
build.plcpgm( ip->Pointed.Objid);
if ( build.sts() == PWRB__NOBUILT)
wnav->message( 'I', "Nothing to build");
return build.sts();
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
pwr_tObjid *ThreadObjectPtr;
int size;
pwr_tObjid child;
pwr_tClassId cid;
/*
Check that ScanTime is set to something.
*/
sts = ldh_GetObjectPar( Session,
Object,
"RtBody",
"ThreadObject",
(char **)&ThreadObjectPtr, &size);
if ( EVEN(sts)) return sts;
sts = ldh_GetObjectClass ( Session, *ThreadObjectPtr, &cid);
if ( EVEN(sts))
wsx_error_msg( Session, WSX__PLCTHREAD, Object, ErrorCount, WarningCount);
else if ( cid != pwr_cClass_PlcThread)
wsx_error_msg( Session, WSX__PLCTHREAD, Object, ErrorCount, WarningCount);
free( (char *)ThreadObjectPtr);
/*
Check that the child is a plcwindow.
*/
sts = ldh_GetChild( Session, Object, &child);
if (EVEN(sts))
{
wsx_error_msg( Session, WSX__PLCWIND, Object, ErrorCount, WarningCount);
}
else
{
sts = ldh_GetObjectClass( Session, child, &cid);
if (EVEN(sts)) return sts;
if ( cid != pwr_cClass_windowplc)
wsx_error_msg( Session, WSX__PLCCHILD, Object, ErrorCount, WarningCount);
sts = ldh_GetNextSibling( Session, child, &child);
if ( ODD(sts))
wsx_error_msg( Session, WSX__PLCCHILD, Object, ErrorCount, WarningCount);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(PlcPgm) = {
pwr_BindMethod(OpenProgram),
pwr_BindMethod(Build),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_rootvolume.cpp,v 1.1 2006-03-31 14:24:34 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.
**/
/* wb_c_rootvolume.c -- work bench methods of the RootVolume class. */
#include <string.h>
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_pwrb_msg.h"
#include "wb_foe_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "pwr_baseclasses.h"
#include "co_dcli.h"
#include "wb_lfu.h"
#include <Xm/Xm.h>
#include <Xm/XmP.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.h"
#include "wb_wtt.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckVolume( Session, Object, ErrorCount, WarningCount);
if ( EVEN(sts)) return sts;
return PWRS__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods($RootVolume) = {
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_webhandler.cpp,v 1.1 2006-03-31 14:24:34 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.
**/
/* wb_c_webhandler.cpp -- work bench methods of the WebHandler class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "ge.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.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.h"
#include "wb_wnav.h"
#include "wb_build.h"
#include "co_msgwindow.h"
static pwr_tStatus Build (
ldh_sMenuCall *ip
)
{
WNav *wnav = (WNav *)ip->EditorContext;
wb_build build( *(wb_session *)ip->PointedSession);
build.opt = wnav->gbl.build;
build.webhandler( ip->Pointed.Objid);
if ( build.sts() == PWRB__NOBUILT)
wnav->message( 'I', "Nothing to build");
return build.sts();
}
static pwr_tStatus PostCreate (
ldh_tSesContext Session,
pwr_tOid Object,
pwr_tOid Father,
pwr_tCid Class
) {
pwr_tOid oid;
pwr_tCid cid;
pwr_tStatus sts;
pwr_tInt32 *number;
pwr_tInt32 max_number = 0;
int size;
sts = ldh_ClassNameToId(Session, &cid, "OpPlace");
if ( EVEN(sts)) return sts;
// Get next OpNumber
sts = ldh_GetClassList(Session, cid, &oid);
while ( ODD(sts)) {
sts = ldh_GetObjectPar(Session, oid, "RtBody", "OpNumber", (char **)&number,
&size);
if ( EVEN(sts)) return sts;
if ( *number > max_number)
max_number = *number;
free( (char *) number);
sts = ldh_GetNextObject(Session, oid, &oid);
}
sts = ldh_ClassNameToId(Session, &cid, "User");
if ( EVEN(sts)) return sts;
sts = ldh_GetClassList(Session, cid, &oid);
while ( ODD(sts)) {
sts = ldh_GetObjectPar(Session, oid, "RtBody", "OpNumber", (char **)&number,
&size);
if ( EVEN(sts)) return sts;
if ( *number > max_number)
max_number = *number;
free( (char *) number);
sts = ldh_GetNextObject(Session, oid, &oid);
}
max_number++;
sts = ldh_CreateObject(Session, &oid, "User", cid, Object, ldh_eDest_IntoLast);
if ( EVEN(sts)) return sts;
sts = ldh_SetObjectPar(Session, oid, "RtBody", "OpNumber", (char *)&max_number,
sizeof(max_number));
if ( EVEN(sts)) return sts;
sts = ldh_SetObjectPar(Session, Object, "RtBody", "UserObject", (char *)&oid,
sizeof(oid));
if ( EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
pwr_dExport pwr_BindMethods(WebHandler) = {
pwr_BindMethod(Build),
pwr_BindMethod(PostCreate),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_xttgraph.cpp,v 1.1 2006-03-31 14:24:34 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.
**/
/* wb_c_xttgraph.c -- work bench methods of the XttGraph class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "ge.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include <Xm/Xm.h>
#include <Xm/XmP.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.h"
#include "wb_wtt.h"
#include "wb_build.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
To open Ge.
\*----------------------------------------------------------------------------*/
static pwr_tStatus OpenGraph (
ldh_sMenuCall *ip
)
{
int sts;
char *action;
int size;
char graph_name[80];
sts = ldh_GetObjectPar( ip->PointedSession, ip->Pointed.Objid, "RtBody",
"Action", &action, &size);
if ( EVEN(sts)) return sts;
cdh_ToLower( graph_name, action);
free( (char *)action);
if ( strstr( graph_name, ".pwg")) {
ge_new( NULL, (Widget)ip->WindowContext, ip->PointedSession, 0, graph_name);
return 1;
}
return PWRB__GRAPHACTION;
}
static pwr_tStatus Build (
ldh_sMenuCall *ip
)
{
WNav *wnav = (WNav *)ip->EditorContext;
wb_build build( *(wb_session *)ip->PointedSession, wnav, ip->WindowContext);
build.opt = wnav->gbl.build;
build.xttgraph( ip->Pointed.Objid);
if ( build.sts() == PWRB__NOBUILT)
wnav->message( 'I', "Nothing to build");
return build.sts();
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(XttGraph) = {
pwr_BindMethod(OpenGraph),
pwr_BindMethod(Build),
pwr_NullMethod
};
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