Commit 7c3237ad authored by Christoffer Ackelman's avatar Christoffer Ackelman

Removed the deprecated Motif version in favour of the new QT version.

parent 637dcc9b
pwr_top : build_pwr
build_pwr :
@ if ./build.sh; then \
echo "Proview built"; \
......
......@@ -73,7 +73,7 @@ class PnViewerQtWidget : public QWidget
Q_OBJECT
public:
PnViewerQtWidget(PnViewerQt* parent_ctx, QWidget* parent)
PnViewerQtWidget(PnViewerQt* parent_ctx)
: QWidget(), viewer(parent_ctx)
{
}
......
This diff is collapsed.
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef cow_pb_gsd_attr_motif_h
#define cow_pb_gsd_attr_motif_h
/* cow_pb_gsd_attr_motif.h -- Profibus gsd attribute editor */
#include "cow_pb_gsd_attr.h"
class GsdAttrMotif : public GsdAttr
{
public:
Widget parent_wid;
Widget brow_widget;
Widget form_widget;
Widget toplevel;
Widget msg_label;
Widget cmd_prompt;
Widget cmd_input;
Widget attrnav_form;
Widget cmd_ok;
Widget cmd_cancel;
Widget menubutton_copy;
Widget menubutton_cut;
Widget menubutton_paste;
Widget menubutton_changevalue;
GsdAttrMotif(Widget a_parent_wid, void* a_parent_ctx, void* a_object,
pb_gsd* a_gsd, int a_edit_mode);
~GsdAttrMotif();
void message(char severity, const char* message);
void set_prompt(const char* prompt);
void change_value();
static void gsdattr_message(void* attr, char severity, char* message);
static void gsdattr_change_value_cb(void* attr_ctx);
static void activate_change_value(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void activate_exit(Widget w, GsdAttr* attr, XmAnyCallbackStruct* data);
static void activate_help(Widget w, GsdAttr* attr, XmAnyCallbackStruct* data);
static void activate_copy(Widget w, GsdAttr* attr, XmAnyCallbackStruct* data);
static void activate_cut(Widget w, GsdAttr* attr, XmAnyCallbackStruct* data);
static void activate_paste(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void activate_zoom_in(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void activate_zoom_out(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void activate_zoom_reset(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void activate_print(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void activate_cmd_ok(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void cmd_close_apply_cb(void* ctx, void* data);
static void cmd_close_no_cb(void* ctx, void* data);
static void activate_cmd_ca(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* dataxo);
static void create_menubutton(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void create_msg_label(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void create_cmd_prompt(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void create_cmd_ok(Widget w, GsdAttr* attr, XmAnyCallbackStruct* data);
static void create_cmd_ca(Widget w, GsdAttr* attr, XmAnyCallbackStruct* data);
static void create_cmd_input(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void create_attrnav_form(Widget w, GsdAttr* attr,
XmAnyCallbackStruct* data);
static void action_inputfocus(Widget w, XmAnyCallbackStruct* data);
static void valchanged_cmd_input(Widget w, XEvent* event);
};
#endif
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* cow_pb_gsd_attrnav.cpp -- Display gsd attributes */
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "cow_wow_motif.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 "cow_pb_gsd.h"
#include "cow_pb_gsd_attr_motif.h"
#include "cow_pb_gsd_attrnav_motif.h"
#include "rt_pb_msg.h"
//
// Create the navigator widget
//
GsdAttrNavMotif::GsdAttrNavMotif(void* xn_parent_ctx, Widget xn_parent_wid,
char* xn_name, pb_gsd* xn_gsd,
int xn_edit_mode, Widget* w,
pwr_tStatus* status)
: GsdAttrNav(xn_parent_ctx, xn_name, xn_gsd, xn_edit_mode, status),
parent_wid(xn_parent_wid)
{
form_widget = ScrolledBrowCreate(parent_wid, name, NULL, 0, init_brow_cb,
this, (Widget*)&brow_widget);
XtManageChild(form_widget);
// Create the root item
*w = form_widget;
wow = new CoWowMotif(brow_widget);
trace_timerid = wow->timer_new();
*status = 1;
}
//
// Delete a nav context
//
GsdAttrNavMotif::~GsdAttrNavMotif()
{
delete trace_timerid;
delete wow;
delete brow;
XtDestroyWidget(form_widget);
}
void GsdAttrNavMotif::set_inputfocus()
{
XtCallAcceptFocus(brow_widget, CurrentTime);
}
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef cow_pb_gsd_attrnav_motif_h
#define cow_pb_gsd_attrnav_motif_h
/* cow_pb_gsd_attrnav_motif.h -- Profibus gsd configurator navigator */
#ifndef cow_pb_gsd_attrnav_h
#include "cow_pb_gsd_attrnav.h"
#endif
//! The navigation area of the attribute editor.
class GsdAttrNavMotif : public GsdAttrNav
{
public:
GsdAttrNavMotif(void* xn_parent_ctx, Widget xn_parent_wid, char* xn_name,
pb_gsd* xn_gsd, int xn_edit_mode, Widget* w,
pwr_tStatus* status);
~GsdAttrNavMotif();
void set_inputfocus();
Widget parent_wid;
Widget brow_widget;
Widget form_widget;
Widget toplevel;
};
#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
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
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_c_pb_dp_slave_motif.c -- work bench methods of the Pb_DP_Slave class. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <vector>
#include <map>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include <Xm/Xm.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "wb_env.h"
#include "flow.h"
#include "flow_ctx.h"
#include "flow_api.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "cow_wow.h"
#include "cow_xhelp_motif.h"
#include "cow_pb_gsd.h"
#include "cow_pb_gsd_attr_motif.h"
#include "wb_c_pb_dp_slave.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wsx.h"
#include "wb_wnav.h"
using namespace std;
static pwr_tStatus Configure(ldh_sMenuCall* ip)
{
pwr_tStatus sts;
slave_sCtx* ctx;
sts = pb_dp_slave_create_ctx(ip->PointedSession, ip->Pointed, ip->wnav, &ctx);
if (sts != PB__USERPRMDATALEN && EVEN(sts))
return sts;
ctx->attr = new GsdAttrMotif(CoXHelpMotif::get_widget(), ctx, 0, ctx->gsd,
ctx->edit_mode);
ctx->attr->close_cb = pb_dp_slave_close_cb;
ctx->attr->save_cb = pb_dp_slave_save_cb;
ctx->attr->help_cb = pb_dp_slave_help_cb;
if (EVEN(sts))
{
ctx->attr->wow->DisplayError(
"Configuration load error",
"Configuration load error\nCheck configuration data");
}
return 1;
}
static pwr_tStatus ConfigureFilter(ldh_sMenuCall* ip) { return 1; }
//
// Syntax check.
//
static pwr_tStatus SyntaxCheck(ldh_tSesContext Session,
pwr_tAttrRef Object, /* current object */
int* ErrorCount, /* accumulated error count */
int* WarningCount /* accumulated waring count */
)
{
return wsx_CheckIoDevice(Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_None);
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Pb_DP_Slave) = {
pwr_BindMethod(Configure), pwr_BindMethod(ConfigureFilter),
pwr_BindMethod(SyntaxCheck), pwr_NullMethod};
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_c_pndevice_motif.cpp -- work bench methods of the PnDevice class. */
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
using namespace std;
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(PnDevice) = {pwr_NullMethod};
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
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* xtt_c_pb_db_slave.cpp -- xtt methods for Pb_DP_Slave. */
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.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 "co_cdh.h"
#include "xtt_menu.h"
#include "xtt_xnav.h"
#include "rt_xnav_msg.h"
#include "pwr_privilege.h"
#include "cow_pb_gsd.h"
#include "cow_xhelp_motif.h"
#include "cow_pb_gsd_attr_motif.h"
#include "xtt_c_pb_dp_slave.h"
// Show Configuration
static pwr_tStatus ShowConfiguration(xmenu_sMenuCall* ip)
{
xtt_slave_sCtx* ctx;
int edit_mode = 0;
xtt_pb_dp_slave_create_ctx(ip->Pointed, ip->EditorContext, &ctx);
ctx->attr =
new GsdAttrMotif(CoXHelpMotif::get_widget(), ctx, 0, ctx->gsd, edit_mode);
ctx->attr->close_cb = xtt_pb_dp_slave_close_cb;
ctx->attr->save_cb = xtt_pb_dp_slave_save_cb;
ctx->attr->help_cb = xtt_pb_dp_slave_help_cb;
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to xtt should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindXttMethods(Pb_DP_Slave) = {
pwr_BindXttMethod(ShowConfiguration), pwr_NullMethod};
......@@ -991,8 +991,6 @@ void dcli_execute_flavour_if_exists(char* argv[], const char* flavour)
void dcli_execute_flavour(char* argv[])
{
const char* flavours[] = { "qt", "gtk", "motif" };
for (int i = 0; i < 3; i++) {
dcli_execute_flavour_if_exists(argv, flavours[i]);
}
dcli_execute_flavour_if_exists(argv, "qt");
dcli_execute_flavour_if_exists(argv, "gtk");
}
......@@ -200,7 +200,7 @@ mkdir := mkdir
# Set to /buildversion for frozen dbs versions
wblflags :=
warnings := -Wall -Wextra -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-sign-compare -Wno-missing-field-initializers
warnings := -Wall -Wextra -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-sign-compare -Wno-missing-field-initializers -Wno-deprecated -Wno-cast-function-type
ifeq ($(pwre_btype),rls)
cflags := $(cross_compile) -c -O3 -D_GNU_SOURCE -DPWR_NDEBUG -D_REENTRANT -fPIC $(warnings)
......
......@@ -72,10 +72,6 @@ op_gtk_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_nav_gtk.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_log_gtk.h
op_motif_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_nav_motif.h
java_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_rt.jar \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_jop.jar \
......@@ -93,15 +89,12 @@ import_files : $(rt_modules) $(op_modules) $(java_modules) $(op_gtk_modules)
_gtk :
rt : $(rt_modules)
rt_gtk :
rt_motif :
op : $(op_modules)
op_gtk : $(op_gtk_modules)
op_motif : $(op_motif_modules)
java : $(java_modules)
java_gtk :
java_motif :
.SUFFIXES:
.SUFFIXES:
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/%.dbs : $(pwre_vmsinc)/exp/load/%.dbs
@ echo Import ${target}
......@@ -231,10 +224,6 @@ $(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/exe/wb_gcg.sh : $(pwre_croot)/wb/exp/com
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%_motif.h : $(pwre_croot)/wb/lib/wb/motif/wb_%_motif.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%_gtk.h : $(pwre_croot)/wb/lib/wb/gtk/wb_%_gtk.h
@ echo Import ${target}
@ cp $(source) $(target)
......@@ -246,4 +235,3 @@ $(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%.h : $(pwre_croot)/wb/lib/wb/src
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/%.jar : $(pwre_vmsinc)/exp/lib/%.jar
@ echo Import ${target}
@ cp $(source) $(target)
......@@ -72,10 +72,6 @@ op_gtk_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_nav_gtk.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_log_gtk.h
op_motif_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_nav_motif.h
java_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_rt.jar \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_jop.jar \
......@@ -93,15 +89,12 @@ import_files : $(rt_modules) $(op_modules) $(java_modules) $(op_gtk_modules)
_gtk :
rt : $(rt_modules)
rt_gtk :
rt_motif :
op : $(op_modules)
op_gtk : $(op_gtk_modules)
op_motif : $(op_motif_modules)
java : $(java_modules)
java_gtk :
java_motif :
.SUFFIXES:
.SUFFIXES:
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/%.dbs : $(pwre_vmsinc)/exp/load/%.dbs
@ echo Import ${target}
......@@ -231,10 +224,6 @@ $(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/exe/%.sh : $(pwre_vmsinc)/exp/exe/%.sh
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%_motif.h : $(pwre_croot)/wb/lib/wb/motif/wb_%_motif.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%_gtk.h : $(pwre_croot)/wb/lib/wb/gtk/wb_%_gtk.h
@ echo Import ${target}
@ cp $(source) $(target)
......@@ -246,4 +235,3 @@ $(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%.h : $(pwre_croot)/wb/lib/wb/src
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/%.jar : $(pwre_vmsinc)/exp/lib/%.jar
@ echo Import ${target}
@ cp $(source) $(target)
......@@ -89,7 +89,7 @@ foreach $key (sort keys (%verbs)) {
$amb = 0;
$found = 1;
($verb, $usage) = split(/:/, $verbs{$key});
last;
last;
}
push(@ambs, $key);
......@@ -137,7 +137,7 @@ sub add ()
if ($varstr ne "") {
printf("++ Environment %s already exists\n", $_[0]);
} else {
get_vars(@_);
get_vars(@_);
update_db();
}
untie(%envdb)|| die "++ can't untie $dbname!";
......@@ -230,7 +230,7 @@ sub build () # args: branch, subbranch, flavour, phase
$ENV{"PWRE_ARGS"} = $_;
}
printf("\n--\n");
_build($branch, $subbranch, $flavour, @_);
}
......@@ -350,7 +350,7 @@ sub ebuild # args: pass flavour
}
printf( "\n");
close FILE;
my $pass = $_[0];
my $flavour = $_[1];
......@@ -381,7 +381,7 @@ sub ebuild # args: pass flavour
_build("lib", "co", $flavour, "all");
_build("exe", "co*", "src", "all");
_build("exe", "*", "src", "copy");
_build("exp", "stdsoap2", "src", "copy");
_build("exp", "stdsoap2", "src", "copy");
_build("lib", "rt", "src", "all");
_build("lib", "statussrv", "src", "all");
_build("lib", "msg_dummy", "src", "init");
......@@ -633,7 +633,7 @@ sub import ()
_module("remote");
merge();
}
}
#
......@@ -733,7 +733,7 @@ sub clean_exe_all ()
_build("exe","*","src","clean_exe");
_module("rt");
}
}
#
......@@ -830,14 +830,14 @@ sub build_all_wbl ()
_build("wbl", "mcomp", "src", "lib");
merge();
_module("rt");
}
}
sub method_build ()
{
my $flavour;
my $program;
if ( $_[0] eq "motif" || $_[0] eq "gtk" || $_[0] eq "qt" ) {
if ( $_[0] eq "gtk" || $_[0] eq "qt" ) {
$flavour = $_[0];
}
else {
......@@ -961,9 +961,7 @@ sub build_module ()
$lib = 1;
$exe = 1;
}
if ( $_[0] eq "motif" || $_[1] eq "motif" || $_[2] eq "motif" || $_[3] eq "motif") {
$flavour = "motif";
} elsif ( $_[0] eq "qt" || $_[1] eq "qt" || $_[2] eq "qt" || $_[3] eq "qt") {
if ( $_[0] eq "qt" || $_[1] eq "qt" || $_[2] eq "qt" || $_[3] eq "qt") {
$flavour = "qt";
} else {
$flavour = "gtk";
......@@ -1155,7 +1153,7 @@ sub build_module ()
#
# copy()
#
sub copy ()
sub copy ()
{
if (!defined($ENV{"pwre_env"})) {
print("++ Environment is not initialized!\n");
......@@ -1171,20 +1169,20 @@ sub copy ()
printf("-- Copy file from Import root\n");
printf("-- Import root: %s\n", $vmsinc);
printf("--\n");
if ( $_[0] eq "doc" ) {
my($cmd) = "cp -r " . $vmsinc . "/exp/doc/* " . $docroot;
my($cmd) = "cp -r " . $vmsinc . "/exp/doc/* " . $docroot;
system("$cmd");
}
elsif ( $_[0] eq "dbs" ) {
my($cmd) = "$bindir/import_dbs.sh " . $vmsinc . " " . $exproot;
my($cmd) = "$bindir/import_dbs.sh " . $vmsinc . " " . $exproot;
system("$cmd");
}
else {
if ($hw eq "x86" && $real_hw eq "x86_64") {
$ENV{"cross_compile"} = "-m32";
}
my($cmd) = "make -f $bindir/import_files.mk" . " " . $_[0];
my($cmd) = "make -f $bindir/import_files.mk" . " " . $_[0];
system("$cmd");
my $flavour = $_[1];
......@@ -1193,7 +1191,7 @@ sub copy ()
$flavour = "gtk";
}
my($cmd) = "make -f $bindir/import_files.mk" . " " . $_[0] . "_" . $flavour;
my($cmd) = "make -f $bindir/import_files.mk" . " " . $_[0] . "_" . $flavour;
system("$cmd");
}
}
......@@ -1269,7 +1267,7 @@ sub dele ()
tie(%envdb, "DB_File", $dbname, O_CREAT|O_RDWR, 0644) || die "++ can't tie $dbname!";
$label = $_[0];
if (defined($envdb{$label})) {
print("-- Delete environment \"$label\" [n]? ");
my($tmp);
......@@ -1391,7 +1389,7 @@ sub show ()
#
# tags()
#
sub tags ()
sub tags ()
{
if (!defined($ENV{"pwre_env"})) {
print("++ Environment is not initialized!\n");
......@@ -1432,7 +1430,7 @@ sub _build () # args: branch, subbranch, flavour, phase
}
my($grepstr) = $ENV{"pwre_target"};
my($globstr) = $ENV{"pwre_sroot"} . "/$branch";
my(@dirs1) = glob($globstr);
my($dir1);
......@@ -1445,17 +1443,17 @@ sub _build () # args: branch, subbranch, flavour, phase
foreach $dir1 (@dirs1) {
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
# if ( ! -e $globstr ) {
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
# $globstr = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
# if ( ! -e $globstr ) {
# $globstr = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
# $globstr = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
# }
# }
$globstr1 = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
$globstr2 = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
$globstr3 = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
$globstr1 = "$dir1" . "/$subbranch/$flavour/os_$os/hw_$hw";
$globstr2 = "$dir1" . "/$subbranch/$flavour/os_$os/.hw_$hw";
$globstr3 = "$dir1" . "/$subbranch/$flavour/.os_$os/.hw_$hw";
@dirs2 = (glob($globstr1),glob($globstr2),glob($globstr3));
foreach $dir2 (@dirs2) {
......@@ -1479,14 +1477,14 @@ sub _build () # args: branch, subbranch, flavour, phase
}
}
}
}
}
}
}
#
# merge()
#
sub merge ()
sub merge ()
{
if (!defined($ENV{"pwre_env"})) {
print("++ Environment is not initialized!\n");
......@@ -1535,7 +1533,7 @@ sub _exists ()
tie(%envdb, "DB_File", $dbname, O_CREAT|O_RDWR, 0644) || die "++ can't tie $dbname!";
$label = $_[0];
if (defined($envdb{$label})) {
$ret = 0;
}
......@@ -1601,7 +1599,7 @@ sub _module()
#
# Misc. subroutines
#
#
sub create_base()
{
my($newdir) = $_[0];
......@@ -1644,7 +1642,7 @@ sub create_dir()
} else {
printf("++\n++ Cannot mkdir %s, reason: %s\n", $dir, $!);
exit 1;
}
}
}
}
......@@ -1702,7 +1700,7 @@ sub get_var()
$tmp = $_[1];
}
return $tmp;
}
sub read_vars ()
......@@ -1873,5 +1871,3 @@ sub usage_tags ()
printf("++\n");
printf("++ tags : Creates a CRiSP tag-file named ~/pwre/tags\n");
}
......@@ -107,8 +107,8 @@ pwre_config_check_tool()
# Arguments
# 1: archive name
# 2: define name (PWRE_CONF_$2 will be defined)
# 3: special archives for gtk and motif (lib, gtk, motif)
# 4: variable to insert archive in (rt, wb, gtk, motif)
# 3: special archives for gtk (lib, gtk)
# 4: variable to insert archive in (rt, wb, gtk)
# 5: if 1, add -DPWRE_CONF_$2 to cc command.
# 6: search list for archive.
# Examples
......@@ -159,8 +159,6 @@ pwre_config_check_lib()
lib=${file##/*/lib}
if test $4 == "gtk"; then
conf_libgtk=$conf_libgtk" -l${lib%.*}"
elif test $4 == "motif"; then
conf_libmotif=$conf_libmotif" -l${lib%.*}"
elif test $4 == "qt"; then
conf_libqt=$conf_libqt" -l${lib%.*}"
elif test $4 == "wb"; then
......@@ -194,8 +192,6 @@ pwre_config_check_lib()
elif test $3 == "gst"; then
conf_libgst=$conf_libgst" \\\`pkg-config --libs gstreamer-video-1.0 gstreamer-1.0\\\`"
conf_incdirgst=$conf_incdirgst" \\\`pkg-config --cflags gstreamer-video-1.0 gstreamer-1.0\\\`"
elif test $3 == "motif"; then
conf_libmotif=$conf_libmotif" -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp -lSM -lICE"
else
echo "Unknown type"
fi
......@@ -284,7 +280,6 @@ conf_libwmq=""
conf_libpnak=""
conf_libgtk=""
conf_libqt=""
conf_libmotif=""
conf_libgst=""
conf_libdir=""
conf_incdirgtk=""
......@@ -451,11 +446,9 @@ if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile
echo "export pwre_conf_libpwrxttqt=\" -lpwr_xtt_qt -lpwr_ge_qt -lpwr_cow_qt -lpwr_flow_qt -lpwr_glow_qt\"" >> $cfile
echo "export pwre_conf_libpwrxttmotif=\" -lpwr_xtt_motif -lpwr_ge_motif -lpwr_cow_motif -lpwr_flow_motif -lpwr_glow_motif\"" >> $cfile
echo "export pwre_conf_libpwrwb=\"-lpwr_wb\"" >> $cfile
echo "export pwre_conf_libpwrwbgtk=\"-lpwr_wb_gtk\"" >> $cfile
echo "export pwre_conf_libpwrwbqt=\"-lpwr_wb_qt\"" >> $cfile
echo "export pwre_conf_libpwrwbmotif=\"-lpwr_wb_motif\"" >> $cfile
echo "export pwre_conf_libpwropc=\"-lpwr_opc\"" >> $cfile
echo "export pwre_conf_libpwrremote=\"-lpwr_remote\"" >> $cfile
echo "export pwre_conf_libpwrnmps=\"-lpwr_nmps\"" >> $cfile
......@@ -468,7 +461,6 @@ if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then
echo "export pwre_conf_libpnak=\"$conf_libpnak\"" >> $cfile
echo "export pwre_conf_libgtk=\"$conf_libgtk\"" >> $cfile
echo "export pwre_conf_libqt=\"$conf_libqt\"" >> $cfile
echo "export pwre_conf_libmotif=\"$conf_libmotif\"" >> $cfile
echo "export pwre_conf_libgst=\"$conf_libgtk\"" >> $cfile
echo "export pwre_conf_libdir=\"$conf_libdir\"" >> $cfile
echo "export pwre_conf_incdir=\"$conf_incdir\"" >> $cfile
......@@ -516,7 +508,6 @@ else
echo "Optional :"
pwre_config_check_include jni JNI 1 "$jdk/include/jni.h"
pwre_config_check_include jni JNI 0 "$jdk/include/linux/jni_md.h"
pwre_config_check_lib motif MRM motif motif 0 "/usr/lib/libMrm.so"
pwre_config_check_lib mysql MYSQL lib lib 1 "/usr/lib/libmysqlclient.so:/usr/lib/mysql/libmysqlclient.so:/usr/lib/$hwpl-linux-$gnu/libmysqlclient.so"
pwre_config_check_include sqlite3 SQLITE3 1 "/usr/include/sqlite3.h"
pwre_config_check_lib libsqlite3 LIBSQLITE3 lib lib 0 "/usr/lib/libsqlite3.so:/usr/lib/$hwpl-linux-$gnu/libsqlite3.so"
......@@ -576,11 +567,9 @@ else
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile
echo "export pwre_conf_libpwrxttqt=\" -lpwr_xtt_qt -lpwr_ge_qt -lpwr_cow_qt -lpwr_flow_qt -lpwr_glow_qt\"" >> $cfile
echo "export pwre_conf_libpwrxttmotif=\" -lpwr_xtt_motif -lpwr_ge_motif -lpwr_cow_motif -lpwr_flow_motif -lpwr_glow_motif\"" >> $cfile
echo "export pwre_conf_libpwrwb=\"-lpwr_wb\"" >> $cfile
echo "export pwre_conf_libpwrwbgtk=\"-lpwr_wb_gtk\"" >> $cfile
echo "export pwre_conf_libpwrwbqt=\"-lpwr_wb_qt\"" >> $cfile
echo "export pwre_conf_libpwrwbmotif=\"-lpwr_wb_motif\"" >> $cfile
echo "export pwre_conf_libpwropc=\"-lpwr_opc\"" >> $cfile
echo "export pwre_conf_libpwrremote=\"-lpwr_remote\"" >> $cfile
echo "export pwre_conf_libpwrnmps=\"-lpwr_nmps\"" >> $cfile
......@@ -594,7 +583,6 @@ else
echo "export pwre_conf_libgtk=\"$conf_libgtk\"" >> $cfile
echo "export pwre_conf_libqt=\"$conf_libqt\"" >> $cfile
echo "export pwre_conf_libgst=\"$conf_libgst\"" >> $cfile
echo "export pwre_conf_libmotif=\"$conf_libmotif\"" >> $cfile
echo "export pwre_conf_libdir=\"$conf_libdir\"" >> $cfile
echo "export pwre_conf_incdir=\"$conf_incdir\"" >> $cfile
echo "export pwre_conf_incdirgtk=\"$conf_incdirgtk\"" >> $cfile
......
......@@ -58,8 +58,8 @@ fi
if [ "$file" != "" ]; then
# Merge only this file
merge_dir_func $toroot $fromroot $file
else
else
# Copy exe, load, obj and inc
merge_dir_func $toroot/exe $fromroot/exe
merge_dir_func $toroot/exe/sv_se $fromroot/exe/sv_se
......@@ -78,7 +78,7 @@ else
for lib in $libraries; do
arname=${lib##/*/}
if [ $arname = "libpwr_rt.a" ] || [ $arname = "libpwr_cow.a" ] || [ $arname = "libpwr_cow_motif.a" ] || [ $arname = "libpwr_cow_gtk.a" ] || [ $arname = "libpwr_cow_qt.a" ] || [ $arname = "libpwr_wb.a" ] || [ $arname = "libpwr_wb_motif.a" ] || [ $arname = "libpwr_wb_gtk.a" ] || [ $arname = "libpwr_wb_qt.a" ] || [ $arname = "libpwr_xtt.a" ] || [ $arname = "libpwr_xtt_motif.a" ] || [ $arname = "libpwr_xtt_gtk.a" ] || [ $arname = "libpwr_xtt_qt.a" ]; then
if [ $arname = "libpwr_rt.a" ] || [ $arname = "libpwr_cow.a" ] || [ $arname = "libpwr_cow_gtk.a" ] || [ $arname = "libpwr_cow_qt.a" ] || [ $arname = "libpwr_wb.a" ] || [ $arname = "libpwr_wb_gtk.a" ] || [ $arname = "libpwr_wb_qt.a" ] || [ $arname = "libpwr_xtt.a" ] || [ $arname = "libpwr_xtt_gtk.a" ] || [ $arname = "libpwr_xtt_qt.a" ]; then
if [ $ver -eq 1 ]; then
echo "Merge $lib"
fi
......@@ -87,7 +87,7 @@ else
ar -roUc $toroot/lib/$arname $modules
rm $modules
else
if [ $ver -eq 1 ]; then
if [ $ver -eq 1 ]; then
echo "Copy $lib"
fi
cp $lib $toroot/lib/
......@@ -119,6 +119,3 @@ else
$co_merge xtt_base $pwr_einc/xtt_\*.meth $pwr_elib/libpwr_xtt.a
fi
fi
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
ifndef link_rule_mk
link_rule_mk := 1
ifeq ($(export_type),exp)
link = $(ldxx) $(explinkflags) $(domap) -o $(pwr_exe)/wb_motif \
$(bld_dir)/wb_motif.o $(bld_dir)/wb_main.o $(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_procom.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrxttmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxttmotif) $(pwre_conf_libpwrxtt) $(pwre_conf_libmotif) \
$(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib)
else
link = $(ldxx) $(elinkflags) $(domap) -o $(pwr_exe)/wb_motif \
$(bld_dir)/wb_motif.o $(bld_dir)/wb_main.o $(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_procom.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrxttmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libmotif) \
$(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib)
endif
endif
This diff is collapsed.
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef wb_motif_h
#define wb_motif_h
#ifndef wb_main_h
#include "wb_main.h"
#endif
class WbMotif : public Wb {
public:
Widget toplevel;
Widget mainwindow;
WbMotif(int argc, char* argv[]);
~WbMotif()
{
}
Wtt* wtt_new(const char* name, const char* iconname, ldh_tWBContext wbctx,
pwr_tVolumeId volid, ldh_tVolume volctx, wnav_sStartMenu* root_menu,
pwr_tStatus* status);
WVsel* vsel_new(pwr_tStatus* status, const char* name, ldh_tWBContext wbctx,
char* volumename, int (*bc_success)(void*, pwr_tVolumeId*, int),
void (*bc_cancel)(), int (*bc_time_to_exit)(void*), int show_volumes,
wb_eType wb_type);
};
#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
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(pwr_exe)/wb_cmd_motif \
$(bld_dir)/wb_cmd_motif.o $(bld_dir)/wb_cmd_main.o $(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_procom.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrxttmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libmotif) \
$(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib)
endif
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_cmd_motif.c -- command file processing
The main program of pwrc. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#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 <Xm/ToggleB.h>
#include <Xm/List.h>
#include <X11/cursorfont.h>
#define XK_MISCELLANY
#include <X11/keysymdef.h>
#include "pwr.h"
#include "pwr_class.h"
#include "co_dcli.h"
#include "cow_mrm_util.h"
#include "ge.h"
#include "rt_load.h"
#include "wb_foe_msg.h"
#include "co_dcli_input.h"
#include "flow.h"
#include "flow_ctx.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "wb_utl.h"
#include "wb_lfu.h"
#include "cow_login.h"
#include "wb_wnav_motif.h"
#include "wb_wnav_item.h"
#include "wb_pal.h"
#include "wb_watt.h"
#include "wb_wnav_msg.h"
#include "wb_cmdc_motif.h"
#include "wb.h"
#include "cow_msgwindow.h"
CmdMotif::CmdMotif(int argc, char* argv[])
{
Widget w;
pwr_tStatus sts;
wnav = new WNavMotif((void*)this, (Widget)0, "", "", &w, ldhses,
(wnav_sStartMenu*)0, wnav_eWindowType_No, &sts);
wnav->attach_volume_cb = attach_volume_cb;
wnav->detach_volume_cb = detach_volume_cb;
wnav->get_wbctx_cb = get_wbctx;
wnav->save_cb = save_cb;
wnav->revert_cb = revert_cb;
wnav->close_cb = close_cb;
parse(argc, argv);
}
int main(int argc, char* argv[])
{
CmdMotif* cmd;
cmd = new CmdMotif(argc, argv);
}
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef wb_cmdc_motif_h
#define wb_cmdc_motif_h
#ifndef wb_cmdc_h
#include "wb_cmdc.h"
#endif
class CmdMotif : public Cmd {
public:
CmdMotif(int argc, char* argv[]);
};
#endif
......@@ -59,8 +59,8 @@ int main(int argc, char* argv[])
dcli_execute_flavour(argv);
const char* flavours[] = { "qt", "gtk", "motif" };
for (int i = 0; i < 3; i++) {
const char* flavours[] = { "qt", "gtk" };
for (int i = 0; i < 2; i++) {
strcpy(file, "$pwr_eexe/wb_cmd_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
......
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.
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_gre_motif.cpp
This module creates the flow window and handles
the flow callbacks. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include <Xm/Xm.h>
#include <Mrm/MrmPublic.h>
#ifndef _XtIntrinsic_h
#include <X11/Intrinsic.h>
#endif
#include <X11/IntrinsicP.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Xm/DialogS.h>
#include "flow_ctx.h"
#include "flow_api.h"
#include "flow_widget_motif.h"
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "wb_ldh.h"
#include "wb_foe_msg.h"
#include "wb_vldh_msg.h"
#include "wb_vldh.h"
#include "wb_foe.h"
#include "wb_goec.h"
#include "wb_goen.h"
#include "wb_utl_api.h"
#include "wb_gre_motif.h"
#include "wb_tra.h"
//
// Constructor
//
WGreMotif::WGreMotif(
void* wg_parent_ctx, Widget wg_parent_wid, const char* name)
: WGre(wg_parent_ctx, 0), parent_wid(wg_parent_wid), trace_timerid(0)
{
Arg args[20];
int i;
static MrmRegisterArg reglist[] = { { (char*)"gre_ctx", 0 } };
/* Create object context */
reglist[0].value = (caddr_t)this;
/* Fill in common part */
parent_wid = wg_parent_wid;
ctx_init();
i = 0;
XtSetArg(args[i], XmNwidth, 600);
i++;
XtSetArg(args[i], XmNheight, 600);
i++;
XtSetArg(args[i], XmNtopAttachment, XmATTACH_FORM);
i++;
XtSetArg(args[i], XmNrightAttachment, XmATTACH_FORM);
i++;
XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM);
i++;
XtSetArg(args[i], XmNbottomAttachment, XmATTACH_FORM);
i++;
form_widget = ScrolledFlowCreate(
parent_wid, (char*)"Flow window", args, i, init_flow, this, &flow_widget);
XtManageChild(form_widget);
popupmenu_mode = GRE_POPUPMENUMODE_OBJECT;
}
WGreMotif::~WGreMotif()
{
XtDestroyWidget(XtParent(form_widget));
}
int WGreMotif::new_navigator(Widget parent)
{
Arg args[20];
int i;
i = 0;
XtSetArg(args[i], XmNwidth, 200);
i++;
XtSetArg(args[i], XmNheight, 200);
i++;
XtSetArg(args[i], XmNpaneMinimum, 75);
i++;
XtSetArg(args[i], XmNpaneMaximum, 800);
i++;
nav_widget = FlowCreateNav(parent, (char*)"navigator", args, i, flow_widget);
XtManageChild(nav_widget);
return 1;
}
int WGreMotif::new_navigator_popup()
{
Arg args[20];
int i;
/* Create navigator popup */
i = 0;
XtSetArg(args[i], XmNallowShellResize, TRUE);
i++;
XtSetArg(args[i], XmNallowResize, TRUE);
i++;
XtSetArg(args[i], XmNwidth, 200);
i++;
XtSetArg(args[i], XmNheight, 200);
i++;
XtSetArg(args[i], XmNx, 500);
i++;
XtSetArg(args[i], XmNy, 500);
i++;
nav_shell = XmCreateDialogShell(flow_widget, (char*)"Navigator", args, i);
XtManageChild(nav_shell);
i = 0;
XtSetArg(args[i], XmNwidth, 200);
i++;
XtSetArg(args[i], XmNheight, 200);
i++;
nav_widget
= FlowCreateNav(nav_shell, (char*)"navigator", args, i, flow_widget);
XtManageChild(nav_widget);
XtRealizeWidget(nav_shell);
return 1;
}
void WGreMotif::trace_scan(WGreMotif* gre)
{
if (gre->trace_started) {
flow_TraceScan(gre->flow_ctx);
gre->trace_timerid
= XtAppAddTimeOut(XtWidgetToApplicationContext(gre->flow_widget), 500,
(XtTimerCallbackProc)trace_scan, gre);
}
}
void WGreMotif::trace_start()
{
trace_started = 1;
trace_scan(this);
}
void WGreMotif::trace_stop()
{
if (trace_started) {
trace_started = 0;
if (trace_timerid)
XtRemoveTimeOut(trace_timerid);
}
}
void WGreMotif::get_popup_position(int* x, int* y)
{
Arg arg[4];
Widget w;
short x_work_area, y_work_area;
w = XtParent(parent_wid);
XtSetArg(arg[0], XmNx, &x_work_area);
XtSetArg(arg[1], XmNy, &y_work_area);
XtGetValues(w, arg, 2);
*x += x_work_area;
*y += y_work_area;
w = XtParent(w);
XtSetArg(arg[0], XmNx, &x_work_area);
XtSetArg(arg[1], XmNy, &y_work_area);
XtGetValues(w, arg, 2);
*x += x_work_area;
*y += y_work_area;
/* Add coordinates of the work_area widget */
// XtSetArg( arg[0], XmNx, &x_work_area);
// XtSetArg( arg[1], XmNy, &y_work_area);
// XtGetValues( flow_widget, arg, 2);
/* Add coordinates of the work_area widget */
XtSetArg(arg[0], XmNx, &x_work_area);
XtSetArg(arg[1], XmNy, &y_work_area);
XtGetValues(parent_wid, arg, 2);
*x += x_work_area;
*y += y_work_area;
}
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef wb_gre_motif_h
#define wb_gre_motif_h
#ifndef wb_gre_h
#include "wb_gre.h"
#endif
class WGreMotif : public WGre {
public:
Widget parent_wid;
Widget gre_window;
Widget flow_widget;
Widget form_widget;
Widget nav_shell;
Widget nav_widget;
XtIntervalId trace_timerid;
WGreMotif(void* parent_ctx, Widget parent_wid, const char* name);
~WGreMotif();
void trace_start();
void trace_stop();
void get_popup_position(int* x, int* y);
int new_navigator(Widget parent);
int new_navigator_popup();
static void trace_scan(WGreMotif* gre);
};
#endif
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_nav_motif.cpp -- Display plant and node hiererachy or plc-editor */
#include <stdio.h>
#include <stdlib.h>
#include <Xm/Xm.h>
#include <Mrm/MrmPublic.h>
#ifndef _XtIntrinsic_h
#include <X11/Intrinsic.h>
#endif
#include <X11/IntrinsicP.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xmu/Atoms.h>
#include <X11/Xmu/StdSel.h>
extern "C" {
#include "wb_ldh.h"
#include "wb_ldh_msg.h"
#include "co_cdh.h"
#include "flow_x.h"
}
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_motif.h"
#include "wb_nav_motif.h"
//
// Create the navigator widget
//
NavMotif::NavMotif(void* nav_parent_ctx, Widget nav_parent_wid,
const char* nav_name, ldh_tSesContext nav_ldhses, const char* nav_root_name,
Widget* w, pwr_tStatus* status)
: Nav(nav_parent_ctx, nav_name, nav_ldhses, nav_root_name, status),
parent_wid(nav_parent_wid)
{
form_widget = ScrolledBrowCreate(
parent_wid, name, NULL, 0, init_brow_cb, this, (Widget*)&brow_widget);
XtManageChild(form_widget);
*w = form_widget;
*status = 1;
}
//
// Delete a nav context
//
NavMotif::~NavMotif()
{
PalFile::config_tree_free(menu);
free_pixmaps();
XtDestroyWidget(form_widget);
}
static Boolean nav_sel_convert_cb(Widget w, Atom* selection, Atom* target,
Atom* type_return, XtPointer* value_return, unsigned long* length_return,
int* format_return)
{
NavMotif* nav;
brow_tCtx browctx;
char name[200];
int sts;
BrowCtxFromWidget(w, (void**)&browctx);
brow_GetCtxUserData(browctx, (void**)&nav);
if (*target == XA_TARGETS(flow_Display(nav->brow_widget))) {
Atom* targetP;
Atom* std_targets;
unsigned long std_length;
XSelectionRequestEvent* req
= XtGetSelectionRequest(w, *selection, (XtRequestId)NULL);
XmuConvertStandardSelection(w, req->time, selection, target, type_return,
(caddr_t*)&std_targets, &std_length, format_return);
*value_return = XtMalloc(sizeof(Atom) * (std_length + 2));
targetP = *(Atom**)value_return;
*targetP++ = XA_STRING;
*targetP++ = XA_TEXT(flow_Display(nav->brow_widget));
*length_return = std_length + (targetP - (*(Atom**)value_return));
bcopy((char*)std_targets, (char*)targetP, sizeof(Atom) * std_length);
XtFree((char*)std_targets);
*type_return = XA_ATOM;
*format_return = 32;
return True;
}
if (*target == XA_STRING) {
if (!nav->get_plant_select_cb)
return FALSE;
sts = nav->get_plant_select_cb(nav->parent_ctx, name, sizeof(name));
if (EVEN(sts))
return FALSE;
*value_return = XtNewString(name);
*length_return = strlen(name) + 1;
*type_return = XA_STRING;
*format_return = 8;
return TRUE;
}
return FALSE;
}
static void nav_sel_lose_cb(Widget w, Atom* selection)
{
Nav* nav;
brow_tCtx browctx;
BrowCtxFromWidget(w, (void**)&browctx);
brow_GetCtxUserData(browctx, (void**)&nav);
brow_SelectClear(nav->brow_ctx);
}
void NavMotif::set_selection_owner(int set)
{
int sts;
if (set) {
sts = XtOwnSelection(brow_widget, XA_PRIMARY,
XtLastTimestampProcessed(flow_Display(brow_widget)), nav_sel_convert_cb,
nav_sel_lose_cb, NULL);
if (!sts) {
brow_SelectClear(brow_ctx);
return;
}
} else {
// Todo...
}
}
void NavMotif::set_inputfocus(int focus)
{
Arg args[2];
Pixel bg, fg;
if (!displayed)
return;
XtVaGetValues(form_widget, XmNbackground, &bg, XmNforeground, &fg, NULL);
if (focus) {
XtCallAcceptFocus(brow_widget, CurrentTime);
XtSetArg(args[0], XmNborderColor, fg);
XtSetValues(form_widget, args, 1);
} else {
XtSetArg(args[0], XmNborderColor, bg);
XtSetValues(form_widget, args, 1);
}
// brow_SetInputFocus( brow->ctx);
}
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef wb_nav_motif_h
#define wb_nav_motif_h
/* wb_nav_motif.h -- Simple navigator */
#ifndef wb_nav_h
#include "wb_nav.h"
#endif
class NavMotif : public Nav {
public:
NavMotif(void* parent_ctx, Widget parent_wid, const char* name,
ldh_tSesContext ldhses, const char* root_name, Widget* w,
pwr_tStatus* status);
~NavMotif();
Widget parent_wid;
Widget brow_widget;
Widget form_widget;
Widget toplevel;
void set_inputfocus(int focus);
void set_selection_owner(int set);
};
#endif
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_pal_motif.cpp -- Palette of configurator or plc-editor */
#include <stdio.h>
#include <stdlib.h>
extern "C" {
#include "wb_ldh.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "pwr_baseclasses.h"
}
#include <Xm/Xm.h>
#include <Mrm/MrmPublic.h>
#ifndef _XtIntrinsic_h
#include <X11/Intrinsic.h>
#endif
#include <X11/IntrinsicP.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xmu/Atoms.h>
#include <X11/Xmu/StdSel.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_motif.h"
#include "wb_pal_motif.h"
#include "glow.h"
#include "glow_growctx.h"
extern "C" {
#include "flow_x.h"
}
static void pal_sel_lose_cb(Widget w, Atom* selection);
static Boolean pal_sel_convert_cb(Widget w, Atom* selection, Atom* target,
Atom* type_return, XtPointer* value_return, unsigned long* length_return,
int* format_return);
static void pal_set_avoid_deadlock(PalMotif* pal, int time);
static void pal_reset_avoid_deadlock(PalMotif* pal);
//
// Create the palette widgets
//
PalMotif::PalMotif(void* pal_parent_ctx, Widget pal_parent_wid,
const char* pal_name, ldh_tSesContext pal_ldhses, const char* pal_root_name,
Widget* w, pwr_tStatus* status)
:
Pal(pal_parent_ctx, pal_name, pal_ldhses, pal_root_name, status),
parent_wid(pal_parent_wid), avoid_deadlock(0)
{
int i;
Arg args[5];
form_widget = ScrolledBrowCreate(parent_wid, name, NULL, 0, Pal::init_brow_cb,
this, (Widget*)&brow_widget);
XtManageChild(form_widget);
i = 0;
XtSetArg(args[i], XmNborderWidth, 1);
i++;
XtSetValues(form_widget, args, i);
set_inputfocus(0);
*w = form_widget;
*status = 1;
}
//
// Delete a pal context
//
PalMotif::~PalMotif()
{
if (avoid_deadlock)
XtRemoveTimeOut(deadlock_timerid);
PalFile::config_tree_free(menu);
free_pixmaps();
XtDestroyWidget(form_widget);
}
void PalMotif::create_popup_menu(pwr_tCid cid, int x, int y)
{
int x1, y1;
Arg arg[2];
if (avoid_deadlock)
return;
XtSetArg(arg[0], XmNx, &x1);
XtSetArg(arg[1], XmNy, &y1);
XtGetValues(XtParent(brow_widget), arg, 2);
(create_popup_menu_cb)(parent_ctx, cid, x + x1, y + y1);
pal_set_avoid_deadlock(this, 2000);
}
void PalMotif::set_inputfocus(int focus)
{
Arg args[2];
Pixel bg, fg;
if (!displayed)
return;
XtVaGetValues(form_widget, XmNbackground, &bg, XmNforeground, &fg, NULL);
if (focus) {
XtCallAcceptFocus(brow_widget, CurrentTime);
XtSetArg(args[0], XmNborderColor, fg);
XtSetValues(form_widget, args, 1);
} else {
XtSetArg(args[0], XmNborderColor, bg);
XtSetValues(form_widget, args, 1);
}
// brow_SetInputFocus( brow->ctx);
}
void PalMotif::set_selection_owner()
{
int sts;
sts = XtOwnSelection(brow_widget, XA_PRIMARY,
XtLastTimestampProcessed(flow_Display(brow_widget)), pal_sel_convert_cb,
pal_sel_lose_cb, NULL);
if (!sts) {
brow_SelectClear(brow_ctx);
return;
}
selection_owner = 1;
}
static Boolean pal_sel_convert_cb(Widget w, Atom* selection, Atom* target,
Atom* type_return, XtPointer* value_return, unsigned long* length_return,
int* format_return)
{
PalMotif* pal;
brow_tCtx browctx;
char name[200];
PalItem* item;
BrowCtxFromWidget(w, (void**)&browctx);
brow_GetCtxUserData(browctx, (void**)&pal);
if (*target == XA_TARGETS(flow_Display(pal->brow_widget))) {
Atom* targetP;
Atom* std_targets;
unsigned long std_length;
XSelectionRequestEvent* req
= XtGetSelectionRequest(w, *selection, (XtRequestId)NULL);
XmuConvertStandardSelection(w, req->time, selection, target, type_return,
(caddr_t*)&std_targets, &std_length, format_return);
*value_return = XtMalloc(sizeof(Atom) * (std_length + 2));
targetP = *(Atom**)value_return;
*targetP++ = XA_STRING;
*targetP++ = XA_TEXT(flow_Display(pal->brow_widget));
*length_return = std_length + (targetP - (*(Atom**)value_return));
bcopy((char*)std_targets, (char*)targetP, sizeof(Atom) * std_length);
XtFree((char*)std_targets);
*type_return = XA_ATOM;
*format_return = 32;
return True;
}
if (*target == XA_STRING || *target == XA_TEXT(flow_Display(pal->brow_widget))
|| *target == XA_COMPOUND_TEXT(flow_Display(pal->brow_widget))) {
brow_tNode* node_list;
int node_count;
brow_GetSelectedNodes(pal->brow_ctx, &node_list, &node_count);
if (!node_count)
return FALSE;
brow_GetUserData(node_list[0], (void**)&item);
switch (item->type) {
case pal_ePalItemType_ClassVolume:
case pal_ePalItemType_Class:
case pal_ePalItemType_Object:
default:
brow_GetAnnotation(node_list[0], 0, name, sizeof(name));
*value_return = XtNewString(name);
*length_return = strlen(name) + 1;
}
free(node_list);
*type_return = XA_STRING;
*format_return = 8;
return TRUE;
}
return FALSE;
}
static void pal_sel_lose_cb(Widget w, Atom* selection)
{
PalMotif* pal;
brow_tCtx browctx;
BrowCtxFromWidget(w, (void**)&browctx);
brow_GetCtxUserData(browctx, (void**)&pal);
brow_SelectClear(pal->brow_ctx);
pal->selection_owner = 0;
}
static void pal_reset_avoid_deadlock(PalMotif* pal)
{
pal->avoid_deadlock = 0;
}
static void pal_set_avoid_deadlock(PalMotif* pal, int time)
{
pal->avoid_deadlock = 1;
pal->deadlock_timerid
= XtAppAddTimeOut(XtWidgetToApplicationContext(pal->brow_widget), time,
(XtTimerCallbackProc)pal_reset_avoid_deadlock, pal);
}
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef wb_pal_motif_h
#define wb_pal_motif_h
#ifndef wb_pal_h
#include "wb_pal.h"
#endif
class PalMotif : public Pal {
public:
PalMotif(void* parent_ctx, Widget parent_wid, const char* name,
ldh_tSesContext ldhses, const char* root_name, Widget* w,
pwr_tStatus* status);
~PalMotif();
Widget parent_wid;
Widget brow_widget;
Widget form_widget;
Widget toplevel;
int avoid_deadlock;
XtIntervalId deadlock_timerid;
void set_inputfocus(int focus);
void set_selection_owner();
void create_popup_menu(pwr_tCid cid, int x, int y);
};
#endif
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_uilutil.c
This module contains utility routines for UIL-file handling. */
#include <stdio.h>
#include <stdlib.h>
#include "wb_uilutil.h"
#include <Mrm/MrmPublic.h>
/*_Local procedures___________________________________________*/
static void s_errors(const char* problem_string, char* ps2)
{
if (ps2)
printf(problem_string, ps2);
else
printf("%s\n", problem_string);
exit(0);
}
/*_Global procedures__________________________________________*/
/************************************************************************
*
* Name: uilutil_fetch
*
* Type: void
*
* Type Parameter IOGF Description
* char * db_file_v[] I List of UIL-files
* int db_file_n I Number of UIL-files in list
* MrmRegisterArg reglist[] I List of names to register
* int reglist_num I Number of names to register
* Widget parent I parent widget
* char * name I name of UIL-file template instance
* char *newname I Name of created widget
* Args args I Resources to modify template with
* int argc I Number of resources
* Widget *child O Address to return widget in
* MrmHierarchy * ret_DRMh O Address to return hierarcy address in.
* If given as NULL, UIL-file is opened and
* closed.
*
* Description:
* Work procedure to add the pupup menu
*
*************************************************************************/
void uilutil_fetch(char* db_file_v[], int db_file_n, MrmRegisterArg reglist[],
int reglist_num, Widget parent, char* name, char* newname, ArgList args,
int argc, Widget* child, MrmHierarchy* ret_DRMh)
{
/* DRM database hierarchy related variables */
MrmHierarchy s_DRMh;
MrmType dclass;
int sts;
/*
* Open the UID files (the output of the UIL compiler) in the hierarchy
* if the hierarchy parameter is given check if already open.
* Register the items DRM needs to bind for us.
* Create a new svn-widget
*/
if (ret_DRMh == NULL || (ret_DRMh != NULL && *ret_DRMh == NULL)) {
sts = MrmOpenHierarchy(db_file_n, db_file_v, NULL, &s_DRMh);
if (sts != MrmSUCCESS)
s_errors("can't open %s\n", db_file_v[0]);
if (ret_DRMh != NULL)
*ret_DRMh = s_DRMh;
} else
s_DRMh = *ret_DRMh;
MrmRegisterNames(reglist, reglist_num);
sts = MrmFetchWidgetOverride(
s_DRMh, name, parent, newname, args, argc, child, &dclass);
if (sts != MrmSUCCESS)
s_errors("can't fetch %s\n", name);
if (ret_DRMh == NULL) {
MrmCloseHierarchy(s_DRMh);
s_DRMh = NULL;
}
}
/*------------------------------------------------------------------------*/
/*
*++
* Routine:
* int vms_perror(userstring, msgid )
*
* Functional description:
* Read the system error with the $GETMSG system call and
* output the userstring and the errormessage on stdout.
*
* Input parameters:
* *userstring Pointer to the text to be output before the
* system message.
* msgid System message id code.
*
* Implicit inputs:
* None
*
* Output parameters:
* None
*
* Implicit outputs:
* None
*
* Routine value:
* None
*
* Side effects:
* None
*
*--
*/
/*------------------------------------------------------------------------*/
void vms_perror(char* userstring, int msgid)
{
static char msgbuf[257];
if (userstring == NULL)
userstring = (char*)"";
sprintf(msgbuf, "uilutil: %x", msgid);
printf("%s%s%s\n", userstring, strlen(userstring) > 0 ? ": " : "", msgbuf);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* 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 ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#include "wb_utl.h"
#ifndef wb_utl_motif_h
#define wb_utl_motif_h
#ifndef _XtIntrinsic_h
#include <X11/Intrinsic.h>
#endif
class wb_utl_motif : public wb_utl {
public:
Widget widget;
wb_utl_motif(Widget w) : widget(w)
{
}
~wb_utl_motif()
{
}
int create_mainwindow(int argc, char** argv);
int destroy_mainwindow();
int utl_foe_new(const char* name, pwr_tOid plcpgm, ldh_tWBContext ldhwbctx,
ldh_tSesContext ldhsesctx, WFoe** foectx, int map_window,
ldh_eAccess access);
int utl_foe_new_local(WFoe* foectx, const char* name, pwr_tOid plcpgm,
ldh_tWBContext ldhwbctx, ldh_tSesContext ldhsesctx,
vldh_t_node nodeobject, unsigned long windowindex,
unsigned long new_window, WFoe** return_foectx, int map_window,
ldh_eAccess access, foe_eFuncAccess function_access);
};
#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.
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.
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) -L$(pwr_elib) $(elinkflags) $(domap) -o $(pwr_exe)/wb_ge_motif \
$(bld_dir)/wb_ge_motif.o $(wb_msg_eobjs) $(rt_msg_eobjs) $(pwr_eobj)/pwr_msg_glow.o\
$(pwr_eobj)/rt_io_user.o $(pwr_eobj)/wb_provider.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrxttmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbmotif) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxttmotif) $(pwre_conf_libpwrxtt) $(pwre_conf_libmotif) \
$(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib)
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.
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.
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