Porting xmtoolbox to IRIX -
Raion - 11-13-2021
xmtoolbox is a mwm-utils app that emulates the old IRIX toolbox. I'm porting it back to IRIX because it being FOSS gives us a great opportunity.
There's three files:
tbmain.c, tbparse.c and tbparse.h that are core for compilation when you remove the session management crap.
Code:
% c99 -c tbmain.c -woff 1196,3970,3604,1174
cc-1515 c99: ERROR File = tbmain.c, Line = 179
A value of type "int" cannot be assigned to an entity of type "Widget".
wframe=XmVaCreateManagedFrame(wshell,"mainFrame",
^
cc-1515 c99: ERROR File = tbmain.c, Line = 182
A value of type "int" cannot be assigned to an entity of type "Widget".
wmain=XmVaCreateManagedRowColumn(wframe,"main",
^
cc-1515 c99: ERROR File = tbmain.c, Line = 410
A value of type "int" cannot be assigned to an entity of type "Widget".
wmenu=XmVaCreateManagedRowColumn(wmain,"menu",
^
cc-1020 c99: ERROR File = tbmain.c, Line = 706
The identifier "XmCHARSET_TEXT" is undefined.
XmCHARSET_TEXT,NULL,0,XmOUTPUT_ALL);
^
cc-1020 c99: ERROR File = tbmain.c, Line = 706
The identifier "XmOUTPUT_ALL" is undefined.
XmCHARSET_TEXT,NULL,0,XmOUTPUT_ALL);
^
5 errors detected in the compilation of "tbmain.c".
These errors are what stands between this and a potentially compilable object (In practice this is likely the beginning, as those woff flags suppress errors related to implicit declarations and more.
These are new functions related to Motif 2.3.8, which doesn't compile out of the box on IRIX and I'm not interested in -- let's backport this to IRIX instead?
https://github.com/alx210/mwm-utils/blob/master/src/tbmain.c -- reference file, other than the ifdefs I removed (I don't have this code public yet)
The first two errors are caused by this section:
Code:
wframe=XmVaCreateManagedFrame(wshell,"mainFrame",
XmNshadowThickness,2,XmNshadowType,XmSHADOW_OUT,NULL);
wmain=XmVaCreateManagedRowColumn(wframe,"main",
XmNmarginWidth,0,XmNmarginHeight,0,XmNspacing,0,
XmNorientation,XmVERTICAL,NULL);
In my code (the ifdefs of SESSIONMGR are removed) this is at line 179
There's no direct successor of functions for this in older motif that I can see and documentation of new motif stuff is rare at best. How do we rewrite this for old motif?
Same issue for line 410.
The final two are caused by this callback:
Code:
static void user_input_cb(Widget w, XtPointer client_data, XtPointer call_data)
{
XmSelectionBoxCallbackStruct *cbs=
(XmSelectionBoxCallbackStruct*)call_data;
char **result=(char**)client_data;
if(cbs->reason==XmCR_CANCEL)
*result="\0";
else
*result=(char*)XmStringUnparse(cbs->value,NULL,0,
XmCHARSET_TEXT,NULL,0,XmOUTPUT_ALL);
}
XmStringUnparse confuses me, as does the doc here for it:
https://linux.die.net/man/3/xmstringunparse
Is it possible to change this to something that is supported in Motif 2.1.x?
RE: Porting xmtoolbox to IRIX -
vishnu - 11-13-2021
Hey can you email me a tarball of what you've got so far? Just off the top of my head, XmStringUnparse is supported in Motif 2.1.30, although I actually prefer 2.1.32 which can be downloaded from the Imperial Software website...
RE: Porting xmtoolbox to IRIX -
Raion - 11-14-2021
With Vishnu's excellent help, I have ported a working xmtoolbox to IRIX, though it doesn't look right yet.
My goal from here is to change the parse code to use the original chestrc, system.chestrc and auxchestrc in that order, add the horizontal mode to it, make color, fonts and such flexible, and keep it portable across many OSes.
RE: Porting xmtoolbox to IRIX -
vishnu - 11-15-2021
It's working flawlessly (despite a compendium of compiler warnings) on my Slackware machine, compiled with gcc 10.2.0 and motif-2.1.32 that I downloaded (source code, compiled it myself) from the Imperial Software website...
RE: Porting xmtoolbox to IRIX -
Raion - 11-15-2021
It already compiled fine. All I did was remove session management code which isn't necessary for IRIX.
The goal here is to bring it a portable, full scale replacement for it.
RE: Porting xmtoolbox to IRIX -
shrek - 11-15-2021
Maybe reach out to Alex (the dev) and see if it's possible to get some changes merged with the original source, like horizontal mode and a way to compile without xmsm support. You might not need a hard fork and you can benefit from future updates.
RE: Porting xmtoolbox to IRIX -
Raion - 11-15-2021
I discussed this with him. He's not particularly interested in an IRIX specific version, and all I had to do was remove some already defined ifdef fields
He is not interested in restoring chestrc syntax used on IRIX or supporting proprietary unix, which is fair. So I agreed with him, said I'd begin a downstream fork, and we would share code in the future. He said he'd be keeping an eye on anything I or anyone else here did
RE: Porting xmtoolbox to IRIX -
Raion - 11-16-2021
Ok, so spring chicken idiot here still
We're getting the look and feel slowly worked out. Because IRIX doesn't use XFT, I'm trying to figure out the font syntax to set a font for this and I don't know (and I suspect Alyx doesn't either, as he lacks an SGI)
using xlsfonts | grep sgi > fontlist gets you a raw list of fonts the system used. From there I planned to just add them to Xresources one at a time as xmtoolbox*font: <string here> but that doesn't seem to work.
An example of a specific font name:
-sgi-screen-medium-r-normal--14-140-72-72-m-70-iso8859-1
I also tried what was said here and here:
https://unix.stackexchange.com/questions/603731/how-to-set-xterm-unicode-font
https://askubuntu.com/questions/161652/how-to-change-the-default-font-size-of-xterm
Nothing suggested has worked to change the root font -- and the rules used for rentertable and such don't really apply here as that's XFT -- I don't know how to translate that to here.