ISVis Motif Analysis Official Open Group Changes

advertisement
ISVis Motif Analysis
This is an analysis of the impact of porting the ISVis application from Motif 1.2 to Motif
2.1.
Official Open Group Changes
Starting in Motif 2.0, The Open Group cleaned up many of the Motif API’s. The public
API’s (intended for application development) was left as is, but the private API (needed
by widget writers) was heavily modified. Prior to the 2.0 release, there were 2 types of
symbols, public (prefixed by Xm) and private (prefixed by _Xm). In the 2.0 release, a
new symbol type Xme was introduced and most _Xm symbols were renamed to Xme.
The ones left as _Xm are internal to the library.
Several symbols(ex: EditDone, EditError, etc.) have been moved to the public header file
Xm/Xm.h from their original location in the private header file Xm/TestStrsoP.h. This
can cause problems in applications and libraries that use these symbols themselves that
results in a namespace conflict at compile time due to the redefinition.
Toolkit and Widget class changes
Listed below are the specific Toolkit and Widget class deprecations from Motif 1.2 to
2.1. Inspection of the code indicates that none of these changes will have an impact on
ISVis.
Renditions and RenderTables
The XmFontList data type and associated functions are now deprecated, replaced by a
new entity called the XmRendition.
VendorShell
The VendorShell has the new resources XmNbuttonRenderTable,
XmNlabelRenderTable, and XmNtextRenderTable that replace the deprecated
XmNbuttonFontList, XmNlabelFontList, XmNtextFontList resources.
Label
The XmFontList resource is deprecated and is superseded by the XmNrenderTable
resource. The same is true for LabelGadget.
MainWindow
The routine XmMainWindowSetAreas() is eprecated. The XmNcommandWindow,
XmNmenuBar, XmNmessageWindow, XmNworkWindow, XmNhorizontalScrollBar,
XmNverticalScrollBar resources should be set directly using the standard Xt
mechanisms.
MenuShell
The XmNbuttonFontList and XmNlabelFontList resources are deprecated, and are
replaced by the XmNbuttonRenderTable and XmNlabelRenderTable resources. Also
deprecated is the XmNdefaultFontList resource, but there is no replacement
XmNdefaultRenderTable resource.
Scale
The XmNfontList resource is deprecated, and replaced with the newer XmNrenderTable
resource
Text and TextField
The XmNfontList resource is obsolete and is replaced by the XmNrenderTable resource.
Obsolete Motif Symbols
The table below shows a list of obsoleted symbols from Motif 1.2 to 2.1.
ISVis Motif dependencies
The following is a list of the Motif function calls made in the ISVis application along
with the source files containing Motif dependencies:
Files with Dependencies:
actor_list.c
io_chell.c
main_view.c
mural.c
scenario_view.c
xapp.c
Function/Macros/Class
xmFormWidgetClass
xmDrawingAreaWidgetClass
xmTextWidgetClass
XmTextInsert
XmTextGetLastPosition
XmTextSetEditable
XmTextGetString
XmTextSetString
XmTextSetCursorPosition
xmPushButtonWidgetClass
xmSeparatorWidgetClass
xmCascadeButtonWidgetClass
xmSeparatorWidgetClass
XmDrawingAreaCallbackStruct
xmToggleButtonWidgetClass
XmStringFree
XmString
XmStringCreateSimple
XmStringGetLtoR
XmProcessTraversal
XmMenuPosition
XmCreateSimplePopupMenu
XmCreatePulldownMenu
XmCreatePopupMenu
XmCreateOptionMenu
XmCreateMenuBar
Review of code
Initial review of the ISVis Motif code does not indicate any apparent issues with
migrating from Motif 1.2 to Motif 2.1. ISVis does not make use of any symbols changed
or moved from Motif 1.2 to 2.1. In addition, the Motif classes, functions and macros used
do not appear in the list of changes made by The Open Group for Motif 2.1. Ultimately, a
compile of ISVis using Motif 2.1 will reveal any issues involved with the port from 1.2 to
2.1 but initial indications are that they should be minor.
Initial Code Compile Results
Below is a list of current compile time errors with all the UI source code as it pertains to
Motif. These were a result of the code being written in non-ANSII C++ and using Motif
1.2 while the compile was an ANSII compliant compiler using Motif 2.1.
xapp.c
"xapp.C", line 653: Error: Cannot assign const char* to char*.
"xapp.C", line 688: Error: Cannot assign const char* to char*.
"xapp.C", line 879: Warning: String literal converted to char* in formal argument name in call to
XmCreatePopupMenu(_WidgetRec*, char*, Arg*, unsigned).
"xapp.C", line 903: Warning: String literal converted to char* in formal argument name in call to
XmCreateOptionMenu(_WidgetRec*, char*, Arg*, unsigned).
"xapp.C", line 978: Warning: String literal converted to char* in formal argument name in call to
XmCreateMenuBar(_WidgetRec*, char*, Arg*, unsigned)
scenario_view.c
"scenario_view.C", line 85: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 87: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 88: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 93: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 96: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 97: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 101: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 105: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 111: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 114: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 117: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 120: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 126: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 132: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 134: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 135: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 137: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 139: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 142: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 147: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 149: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 151: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 153: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 155: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 160: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 166: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 169: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 170: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 172: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 174: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 179: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 182: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 188: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 191: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 197: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 200: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 206: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 209: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 215: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 217: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 218: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 220: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 222: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 224: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 229: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 231: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 233: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 235: Warning: String literal converted to char* in initialization.
"scenario_view.C", line 310: Warning: String literal converted to char* in formal argument name in
call to static X_Application::CreateTopLevelShell(char*, Arg*, int)
"scenario_view.C", line 334: Warning: The variable xmStr has not yet been assigned a value.
"scenario_view.C", line 365: Error: Formal argument text of type char* in call to
XmStringCreateSimple(char*) is being passed const char*.
"scenario_view.C", line 365: Error: Cannot use int to initialize __XmStringRec*.
"scenario_view.C", line 389: Warning: String literal converted to char* in formal argument text in
call to XmStringCreateSimple(char*).
"scenario_view.C", line 408: Warning: String literal converted to char* in formal argument text in
call to XmStringCreateSimple(char*)\
mural.c
Undefined
first referenced
symbol
in file
main
/opt/SUNWspro/WS6U2/lib/crt1.o
XtVaCreateManagedWidget
mural.o
void X_Application::MakeColorScale(unsigned long,int,int,double,double) mural.o
void X_Application::DrawLine(unsigned long,int,int,int,int) mural.o
void X_Application::CopyArea(unsigned long,unsigned long,int,int,unsigned,unsigned,int,int)
mural.o
void X_Application::DrawPoint(unsigned long,int,int) mural.o
void X_Application::ForeColor(const char*) mural.o
void X_Application::DefaultCursor(_WidgetRec*) mural.o
void X_Application::FillArc(unsigned long,int,int,unsigned,unsigned,int,int) mural.o
void X_Application::SetColor(int,const char*) mural.o
void X_Application::DestroyPixmap(unsigned long) mural.o
void X_Application::FrameRectangle(unsigned long,int,int,unsigned,unsigned) mural.o
void X_Application::ForeColor(int,int) mural.o
XtAddEventHandler
mural.o
_XtCheckSubclassFlag
mural.o
void X_Application::FillRectangle(unsigned long,int,int,unsigned,unsigned) mural.o
unsigned long X_Application::CreatePixmap(unsigned long,unsigned,unsigned) mural.o
void X_Application::GetGeometry(unsigned long,unsigned*,unsigned*) mural.o
XtAddCallback
mural.o
XtWindow
mural.o
void X_Application::WorkingCursor(_WidgetRec*) mural.o
XtStrings
mural.o
_XmStrings
mural.o
unsigned long X_Application::ColorValue(int) mural.o
int X_Application::AllocColors(int,int*,int) mural.o
xmDrawingAreaWidgetClass
mural.o
int X_Application::ColorIndex(const char*) mural.o
XtRemoveEventHandler
mural.o
XtIsRealized
mural.o
ld: fatal: Symbol referencing errors. No output written to mural
main_view.c
"main_view.C", line 84: Warning: String literal converted to char* in initialization.
"main_view.C", line 86: Warning: String literal converted to char* in initialization.
"main_view.C", line 88: Warning: String literal converted to char* in initialization.
"main_view.C", line 89: Warning: String literal converted to char* in initialization.
"main_view.C", line 94: Warning: String literal converted to char* in initialization.
"main_view.C", line 96: Warning: String literal converted to char* in initialization.
"main_view.C", line 98: Warning: String literal converted to char* in initialization.
"main_view.C", line 103: Warning: String literal converted to char* in initialization.
"main_view.C", line 109: Warning: String literal converted to char* in initialization.
"main_view.C", line 114: Warning: String literal converted to char* in initialization.
"main_view.C", line 121: Warning: String literal converted to char* in initialization.
"main_view.C", line 129: Warning: String literal converted to char* in initialization.
"main_view.C", line 131: Warning: String literal converted to char* in initialization.
"main_view.C", line 135: Warning: String literal converted to char* in initialization.
"main_view.C", line 136: Warning: String literal converted to char* in initialization.
"main_view.C", line 138: Warning: String literal converted to char* in initialization.
"main_view.C", line 143: Warning: String literal converted to char* in initialization.
"main_view.C", line 146: Warning: String literal converted to char* in initialization.
"main_view.C", line 151: Warning: String literal converted to char* in initialization.
"main_view.C", line 153: Warning: String literal converted to char* in initialization.
"main_view.C", line 158: Warning: String literal converted to char* in initialization.
"main_view.C", line 160: Warning: String literal converted to char* in initialization.
"main_view.C", line 162: Warning: String literal converted to char* in initialization.
"main_view.C", line 164: Warning: String literal converted to char* in initialization
io_shell.c
"io_shell.C", line 91: Error: Formal argument value of type char* in call to
XmTextInsert(_WidgetRec*, long, char*) is being passed const char*.
"io_shell.C", line 102: Error: Formal argument value of type char* in call to
XmTextInsert(_WidgetRec*, long, char*) is being passed const char*.
Time Estimates
Looking at the output above, many of the issues are compiler warnings, indicated
syntactical confusion on the part of the compiler. There are a limited number of errors
that relate directly to Motif itself. These errors and warnings appear to be syntax related
as a result of the ANSII compiler change as well as the upgrade of Motif from 1.2 to 2.1
and do not appear to be a result of using Motif functions/widgets/gadgets/etc which are
no longer available. Therefore, it is estimated that it will take 20 hours of time to correct
these errors so that a clean compile can be made as it relates to Motif.
As of 10/26/06, all Motif related compile time errors have been corrected except for any
that are RoqueWave dependent (i.e. utilize RW strings). All code has been checked into
developer branch and merged into the main branch.
Cross Platform Interoperability
The first issue to address with cross platform interoperability is if we just wish to run
ISVis on other OS’s or do we want to actually port the code to compile and run on
another OS.
The former is a more straightforward task in that products such as Cygwin, VMWare,
VirtualPC, can be used. Information on these tools is located here:
http://www.cygwin.com/
http://www.vmware.com/
http://www.microsoft.com/windows/virtualpc/default.mspx
Porting to another platform requires significant more work. Automatic porting tools can
be used to accomplish this task as well (as proclaimed in the journal article
http://www3.interscience.wiley.com.gtel.gatech.edu:2048/cgibin/fulltext/105559946/PDFSTART?CRETRY=1&SRETRY=0
read for today’s meeting.
One tool which proclaims to perform this task is MKS Toolkit for Enterprise Developers,
http://www.scl.com/products/mks/datasheets/tkedev.html
which allows you to develop and migrate Motif, X Windows, 3-D, and OpenGL
applications written in C, C++, or Fortran, as well as non-graphical applications and
scripts, over to Windows.
It highlights the following as its capabilities:







Migrate existing UNIX C, C++, and Fortran applications to Windows.
Access remote UNIX, Linux, and Windows systems.
Integrate applications with Windows technologies.
Web enable applications.
Single desktop solution for native Windows and UNIX, Linux, and Windows
development.
Easily package and deploy applications.
Integrated cross-platform build environment.
Another porting tool that is available is BX/WIN SDK Porting Kit. This tool proclaims to
allow the porting of UNIX and Motif based applications over to Windows.
http://www.scl.com/products/ics/motif/builders/bxwin
This tool contains support for UNIX SVR4, Berkeley extensions, POSIX, X11R5 and
Motif API’s as well as C and C++. A partial list of API’s supported by this tool is:









UNIX SVR4, Berkeley extensions, POSIX, X11R5 and Motif API support
fork() and exec()
C, C++ support
Shared memory, semaphores, and message queues
Multi-user file I/O with locking on all Windows NT file systems
Extensive UNIX-to-Windows NT security mapping
Networking support via Berkeley sockets
Hard links
Curses
Further investigation of these tools will be needed prior to attempting to utilize them.
Porting “by hand” will require that a Motif Toolkit for the OS/platform being ported to
will be needed and the source code compile on each individual platform. Toolkits such as
OpenMotif, QT, etc. will require investigation.
References
Overview of the Motif 2.1 Toolkit - Changes in Motif 2.1
http://docs.mandragor.org/files/Operating_systems/Linux/Motif_Programming_Manual_
en/ch-3.fm.html#3638
Motif 1.2 Porting Guide
http://techpubs.sgi.com/library/manuals/3000/007-3951-001/pdf/007-3951001.pdf#search=%22Motif%20API%22
Download