Danny Backx wrote:
> Here are some remarks by the author of Xplore about stuff missing
> in LessTif.
> [...]
Hi,
another update on my xplore porting story. Please excuse this
long-winded mail, I'm just trying to give as much information as
possible s.t. these problems can be fixed.
I now replaced in IconG.c all references to XG_SmallIconPixmap with
XG_IconPixmap, which I defined as follows:
#define IG_IconPixmap(w) \
((IG_ViewType(w)==XmLARGE_ICON)?IG_LargeIconPixmap(w):IG_SmallIconPixmap(w))
Now it gets a little further, but it still breaks down in
_XmCalcIconGDimensions with the same kind of error (apparently that now
happens when the directory tree view is constructed, which is a
container in outline mode). The interesting tail part of the log (with
DEBUG_SOURCES=IconG.c) looks as follows:
-- snip snip --
Warning:
Name: shelf_scroll
Class: XmContainer
Attempt to destroy dropSite info for widget that
hasn't been added as a dropSite.
Warning: XmeDropSink(): not yet implemented!
XmIconGadget dir_icon: IconG InitializePrehook
XmIconGadget dir_icon: IconGCacheRec dir_icon being initialized.
XmIconGadget dir_icon: initialize: 5 args
request X 0 Y 0 W 0 H 0
new_w X 0 Y 0 W 6 H 6
Arg[0] : labelString /
Arg[1] : smallIconPixmap (not handled FIX ME)
Arg[2] : smallIconMask (not handled FIX ME)
Arg[3] : entryParent (not handled FIX ME)
Arg[4] : outlineState (not handled FIX ME)
XmIconGadget dir_icon: _XmCalcIconGDimensions
XmIconGadget dir_icon: Text width 6 height 13
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 14 (X_GetGeometry)
Resource id in failed request: 0x2
Serial number of failed request: 6424
Current serial number in output stream: 6424
-- snip snip --
Comments: The "Attempt to destroy dropSite" warning happens because I
had to comment the call to XmDropSiteRegistered (missing in LessTif).
The "XmeDropSink(): not yet implemented!" warning looks particularly
discomforting since it probably means that drag and drop doesn't work.
I'm giving up now. :( I'm no widget writing expert, so it would be nice
if the authors of the container and the drag-n-drop implementation could
take a look at this. In case anybody wants to try it with xplore, I
enclose my diffs below.
If there's any progress on this matter, I'd like very much to hear about
it. (Please cc to my personal address since I'm not a regular subscriber
of the lesstif mailing list.)
Attachments:
1. Xplore diffs:
-- snip snip --
diff -ru xplore-1.1/Xplore.tmpl xplore-1.1-lesstif/Xplore.tmpl
--- xplore-1.1/Xplore.tmpl Sat Aug 18 23:58:20 2001
+++ xplore-1.1-lesstif/Xplore.tmpl Mon Aug 27 10:48:54 2001
@@ -13,11 +13,13 @@
XCOMM Set XMINCDIR and XMLIBDIR as required by your system if the Motif
XCOMM library is not on the standard path.
-XCOMM XMINCDIR = -I/usr/motif/include
-XCOMM XMLIBDIR = -L/usr/motif/lib
+XMINCDIR = -I/usr/local/LessTif/Motif2.1/include
+XMLIBDIR = -L/usr/local/LessTif/Motif2.1/lib
XCOMM How to link the Motif library:
-XMLIB = -lXm
+XCOMM XMLIB = -lXm
+XCOMM XMLIB = -lXm -lXp
+XMLIB = /usr/local/LessTif/Motif2.1/lib/libXm.a
XCOMM Set XPMINCDIR and XPMLIBDIR as required by your system if
libXpm is not
XCOMM on the standard path.
@@ -42,7 +44,7 @@
XCOMM Debugging options.
####################################################
XCOMM Uncomment this if you want to generate debug information:
-XCOMM CDEBUGFLAGS = -g
+CDEBUGFLAGS = -g
XCOMM System dependencies.
##################################################
diff -ru xplore-1.1/callbacks.c xplore-1.1-lesstif/callbacks.c
--- xplore-1.1/callbacks.c Sat Aug 25 12:34:56 2001
+++ xplore-1.1-lesstif/callbacks.c Mon Aug 27 11:57:22 2001
@@ -2525,7 +2525,7 @@
Atom FILE_NAME = XInternAtom(display, "FILE_NAME", False);
Atom FILES = XInternAtom(display, "FILES", False);
XmDropProcCallbackStruct *ds = dcs->destination_data;
- Widget target = XmObjectAtPoint(w, ds->x, ds->y);
+ Widget target = (Widget)XmObjectAtPoint(w, ds->x, ds->y);
FileTransferRec *t = (FileTransferRec*) MALLOC(sizeof(FileTransferRec));
Atom *exportTargets;
Cardinal numExportTargets;
@@ -2581,7 +2581,7 @@
Atom FILE_NAME = XInternAtom(display, "FILE_NAME", False);
Atom FILES = XInternAtom(display, "FILES", False);
XmDropProcCallbackStruct *ds = dcs->destination_data;
- Widget target = XmObjectAtPoint(w, ds->x, ds->y);
+ Widget target = (Widget)XmObjectAtPoint(w, ds->x, ds->y);
FileTransferRec *t = (FileTransferRec*) MALLOC(sizeof(FileTransferRec));
Atom *exportTargets;
Cardinal numExportTargets;
@@ -2637,7 +2637,7 @@
Atom FILE_NAME = XInternAtom(display, "FILE_NAME", False);
Atom FILES = XInternAtom(display, "FILES", False);
XmDropProcCallbackStruct *ds = dcs->destination_data;
- Widget target = XmObjectAtPoint(w, ds->x, ds->y);
+ Widget target = (Widget)XmObjectAtPoint(w, ds->x, ds->y);
TreeTransferRec *t = (TreeTransferRec*) MALLOC(sizeof(TreeTransferRec));
Atom *exportTargets;
Cardinal numExportTargets;
@@ -2683,7 +2683,7 @@
static unsigned char prevStatus = XmDROP_SITE_VALID;
static DirPtr prev_dir = NULL;
static int prev_item = NONE;
- Widget gadget = XmObjectAtPoint(w, dpcs->x, dpcs->y);
+ Widget gadget = (Widget)XmObjectAtPoint(w, dpcs->x, dpcs->y);
Boolean update = False;
DirPtr dir = NULL;
int item = NONE;
diff -ru xplore-1.1/interface.c xplore-1.1-lesstif/interface.c
--- xplore-1.1/interface.c Sat Aug 25 12:26:04 2001
+++ xplore-1.1-lesstif/interface.c Mon Aug 27 16:33:59 2001
@@ -1467,7 +1467,7 @@
static void FilePopupH(Widget w, XtPointer client_data, XEvent *event)
{
XButtonPressedEvent *button_event = (XButtonPressedEvent *) event;
- Widget gadget = XmObjectAtPoint(w, button_event->x, button_event->y);
+ Widget gadget = (Widget)XmObjectAtPoint(w, button_event->x,
button_event->y);
DirPtr dir = (w == file_scroll)?curdir:shelfdir;
if (button_event->button == 3 && gadget != None) {
@@ -1665,7 +1665,7 @@
static void FileStartDrag(Widget w, XEvent *event)
{
XButtonPressedEvent *button_event = (XButtonPressedEvent *) event;
- Widget gadget = XmObjectAtPoint(w, button_event->x, button_event->y);
+ Widget gadget = (Widget)XmObjectAtPoint(w, button_event->x,
button_event->y);
DirPtr dir = (w == file_scroll)?curdir:shelfdir;
if (gadget) {
@@ -1730,7 +1730,7 @@
static void TreeStartDrag(Widget w, XEvent *event)
{
XButtonPressedEvent *button_event = (XButtonPressedEvent *) event;
- Widget gadget = XmObjectAtPoint(w, button_event->x, button_event->y);
+ Widget gadget = (Widget)XmObjectAtPoint(w, button_event->x,
button_event->y);
if (gadget) {
int n;
@@ -1789,7 +1789,7 @@
XtSetArg(args[n], XmNnumImportTargets, 2); n++;
XtSetArg(args[n], XmNdragProc, DragProcCB); n++;
XtSetArg(args[n], XmNanimationStyle, XmDRAG_UNDER_NONE); n++;
- if (XmDropSiteRegistered(w))
+ /* if (XmDropSiteRegistered(w)) */
XmDropSiteUnregister(w);
XmeDropSink(w, args, n);
}
-- snip snip --
2. LessTif diffs:
-- snip snip --
diff -ru lesstif-0.93.0.orig/lib/Xm-2.0/IconG.c
lesstif-0.93.0/lib/Xm-2.0/IconG.c
--- lesstif-0.93.0.orig/lib/Xm-2.0/IconG.c Fri Jul 27 20:55:20 2001
+++ lesstif-0.93.0/lib/Xm-2.0/IconG.c Mon Aug 27 16:32:17 2001
@@ -55,6 +55,12 @@
(((XmIconGadget)(w))->icong.cache->render_table)
#endif
+/* 08-27-01 [EMAIL PROTECTED] */
+#ifndef IG_IconPixmap
+#define IG_IconPixmap(w) \
+
((IG_ViewType(w)==XmLARGE_ICON)?IG_LargeIconPixmap(w):IG_SmallIconPixmap(w))
+#endif
+
/* Forward Declarations */
static void class_initialize(void);
@@ -633,7 +639,7 @@
unsigned Depth;
XGetGeometry(XtDisplayOfObject(w),
-
IG_SmallIconPixmap(w),
+
IG_IconPixmap(w),
&tmpwin,
&tmpx, &tmpy,
&IconWidth, &IconHeight,
@@ -1278,7 +1284,7 @@
unsigned Depth;
XGetGeometry(XtDisplayOfObject(w),
-
IG_SmallIconPixmap(w),
+
IG_IconPixmap(w),
&tmpwin,
&tmpx, &tmpy,
&IconWidth, &IconHeight,
@@ -1303,7 +1309,7 @@
}
XCopyArea(XtDisplay(w),
-
IG_SmallIconPixmap(w),
+
IG_IconPixmap(w),
XtWindow(w),
myGC,
0,
-- snip snip --
--
Dr. Albert Gr"af
Email: [EMAIL PROTECTED], [EMAIL PROTECTED]
WWW: http://www.musikwissenschaft.uni-mainz.de/~ag