File: motif_bug.txt

package info (click to toggle)
pgplot5 5.2.2-19.3
  • links: PTS
  • area: non-free
  • in suites: buster, stretch
  • size: 7,136 kB
  • ctags: 6,763
  • sloc: fortran: 39,792; ansic: 22,549; objc: 1,534; sh: 1,298; makefile: 385; perl: 234; pascal: 233; tcl: 190; awk: 51; csh: 25
file content (231 lines) | stat: -rw-r--r-- 10,176 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
There are bugs in DECwindows Motif 1.2 (but not 1.1) that affect the
PGPLOT driver xedriver.f (Fortran DECwindows driver). The following
note describes the bugs and a workaround. A better solution is to use
the new C X-window driver (xwdriv.c) if you have a DEC C compiler.
------------------------------------------------------------------------

Date: Sun, 23 Oct 1994 17:13:56 EDT
From: Rachael Padman +44 (223) 337310 <rachael@mrao.cam.ac.uk>
To: tjp@PERKIN.CALTECH.EDU
Message-ID: <00986621.ED91DF53.1@mrao.cam.ac.uk>
Subject: RE: PGPLOT under VMS 6.1 /Motif 1.2

Hello Tim,

Just to follow up on the problem I described earlier.

There is indeed a (or even many) problems with Motif 1.2., as has become
clear from various comments on vmsnet.alpha and related newsgroups. The
problems with XEDRIVER in your V4.9H show up as:

  +  Failure to create a bitmap from the LOGO data

  +  Failure to define the ICON name

  +  Failure to create an image in X$CREATE_IMAGE.

There are others, but don't seem to be used in your driver, and of the above
only the last actually matters. I have held off setting up a call to DEC until
I had a simple way to demonstrate the problem, but I have now received
a replacement routine for X$CREATE_IMAGE (appended) which does work, so I
have set up a call with DEC and we will see what happens --- I will keep you
informed.

In the meantime, in case it is of use to you, here is the new code:

Regards
Rachael

        ---------------------------------------------------------------

From:	MX%"bill@office.ab.umd.edu" 21-OCT-1994 15:29:36.96
To:	MX%"rachael@mrao.cam.ac.uk"
CC:	
Subj:	RE: bugs in xlib


>I saw your posting in vmsnet.misc at the end of August re bugs in
>xlib under Motif 1.2 (on AXP?).  I have several applications which no
>longer run correctly now that I have upgraded, and I believe these
>bugs to be the cause.
>
>Specifically, part of a graphics package that uses x$create_image and
>x$put_image seems to be broken. Following your comments, I tried replacing
>these with calls to xCreateImage and xPutImage, and with a bit of fiddling
>around with %VAL etc got a program which didn't crash, but which also failed
>to display a greyscale.
>
>Now my question is: Do you have any experience or knowledge yourself that
>the two DEC routines might be broken? I am thinking about putting together a
>simple application to demonstrate the problem, and assuming it is still
>there, then sending it to DEC, but I don't want to do all this if everyone
>else already knows about it. Of course, if you not only know about such a
>problem, but also have a fix for it, that would be very gratefully received.
>
>Many thanks for your time,
>Rachael Padman

Rachael,

I had simillar problems with FORTRAN-based X11 applications after
installing MOTIF 1.2.  My general solution has been to either rewrite in
C or to call the C version of the X function (like you attempted to do -
not always a trivial task due to C calling conventions).

So far I've only found two functions that don't work, and I have workarounds
for both that don't require writing C code or calling C functions...

The functions are:

X$CREATE_IMAGE and X$LOAD_QUERY_FONT

both of these functions return '0' no matter what you feed them.

Here are the workaround I have found...

X$LOAD_QUERY_FONT can be replaced by X$LOAD_FONT followed by X$QUERY_FONT -
this works just fine.

X$CREATE_IMAGE, on the other hand, is totally broken... here's a snippet
of code to take care of it (works on AXP and VAX with MOTIF 1.2 - Note
that this is not guaranteed to work with later versions of X11).  Just
replace all instances of X$CREATE_IMAGE in your code with HACK$CREATE_IMAGE
and your problem should be solved.  I never did figure out how to successfully
call XCreateImage() from FORTRAN, but then again I didn't try very hard.

	integer*4 function hack$create_image(display, visual, depth, format,
	1	offset, data, width, height, bitmap_pad, bytes_per_line,
	1	image)
	implicit none
	include 'sys$library:decw$xlibdef.for'
	integer*4 display,depth,format,offset,width,height,bitmap_pad,
	1	bytes_per_line
	byte data(*)
	record /x$visual/ visual
	record /x$image/ image
	image.x$l_imag_width = width
	image.x$l_imag_height = height
	image.x$l_imag_xoffset = offset
	image.x$l_imag_format = format
	image.x$a_imag_data=%loc(data)
	image.x$l_imag_byte_order=0
	image.x$l_imag_bitmap_unit=32
	image.x$l_imag_bitmap_bit_order=0
	image.x$l_imag_bitmap_pad=bitmap_pad
	image.x$l_imag_depth=depth
	if (bytes_per_line .eq. 0) then
	  image.x$l_imag_bytes_per_line=width
	else
	  image.x$l_imag_bytes_per_line=bytes_per_line
	endif
	image.x$l_imag_bits_per_pixel=8
	image.x$l_imag_red_mask = -1
	image.x$l_imag_green_mask = -1
	image.x$l_imag_blue_mask = -1
	hack$create_image=1
	return
	end


--
+--------------------------------------+-------------------------------------+
|   William P. Bame                    | Ground: William P. Bame             |
|   internet: bill@office.ab.umd.edu   |         UMMS/Shock Trauma           |
|             bbame@achi1.ab.umd.edu   |         22 South Greene Street      |
|   AT&T    : [Work] (410) 328-3062    |         Baltimore, MD 21201         |
|   CIS     : 71620,425                |         Room: T1R55                 |
+--------------------------------------+-------------------------------------+



From:	ST%"rachael@mrao.cam.ac.uk" 27-OCT-1994 06:00:08.62
To:	TJP
CC:	
Subj:	FWD: X$CREATE_IMAGE workaround example

Received: from ppsw3.cam.ac.uk by Deimos.Caltech.Edu with INTERNET ;
          Thu, 27 Oct 94 05:59:56 PDT
Received: from MRAO.ra.phy.cam.ac.uk by mauve.csi.cam.ac.uk 
          with SMTP-CAM (PP-7.1) as ppsw.cam.ac.uk;
          Thu, 27 Oct 1994 12:54:18 +0100
Received: by mrao.cam.ac.uk (MX V4.0 VAX) id 1; Thu, 27 Oct 1994 12:57:13 BST
Date: Thu, 27 Oct 1994 12:57:19 EDT
From: Rachael Padman +44 (223) 337310 <rachael@mrao.cam.ac.uk>
To: tjp@perkin.caltech.edu
Message-ID: <00986922.BDE4FA66.1@mrao.cam.ac.uk>
Subject: FWD: X$CREATE_IMAGE workaround example

Hi Tim,

thanks for your reply. I look forward to the next version of PGPLOT. In the
meantime, for your information, here is the response from DEC. So -- they
are aware of the problem, and I guess we are just waiting for the patch. 
I will leave it here unless anything particularly relevant occurs.

Regards
Rachael

                ------------------------------------------

To: rachael@mrao.cam.ac.uk
CC: if@uvo.dec.com
Subject: X$CREATE_IMAGE workaround example
Date: Thu, 27 Oct 94 12:38:18 +0000
From: if@uvo.dec.com
X-Mts: smtp

Hi,

Here's the example code we discussed. I have been unable to progress my 
enquiries into the availability of a patch for the problem. I'll keep you posted 
as soon as I hear of anything.

regards

	Ian

        program text_X                                                        
        implicit none                                                         
        include 'sys$library:decw$xlibdef.for/nolist'                         
                                                                              
        external XCreateImage                                                 
        record /x$visual/visual                                               
        record /x$image/img                                                   
        integer*4 display,func,window,screen,status,pimg                      
        integer*4 XCreateImage                                                
        integer*1 tablo(640,512)                                              
        display = x$open_display('decw$display')                              
        status = x$synchronize(display,1,func)                                
        screen = x$default_screen_of_display(display)                         
                                                                              
        window = x$create_simple_window(display,                              
        1       x$root_window_of_screen(screen),300,300,640,512,5,            
        1       x$white_pixel_of_screen(screen),                              
        1       x$black_pixel_of_screen(screen))                              
        call x$default_visual_of_screen(screen,visual)                        
                                                                              
        status = x$create_image(display,visual,8,x$c_z_pixmap,0,tablo,640,512,
        1       640,img)                                                      
c The img structure is filled in with 0 in motif v1.2                         
c                                                                             
c Workaround: Call the mit-c binding routine                                  
        pimg = XCreateImage(%val(display),visual,%val(8),%val(x$c_z_pixmap),  
        1       %val(0),tablo,%val(640),%val(512),%val(8),                    
        1       %val(640))                                                    
        CALL COPY_IMAGE( img, %VAL(pimg) )                                    
                                                                              
        end                                                                   
                                                                              
C Used with workaround to copy from pointer to structure                      
       SUBROUTINE COPY_IMAGE( TARGET, SOURCE )                                
       IMPLICIT NONE                                                          
       INCLUDE 'SYS$LIBRARY:DECW$XLIBDEF/NOLIST'                              
       RECORD  /X$IMAGE/ TARGET                                               
       RECORD  /X$IMAGE/ SOURCE                                               
                                                                              
       TARGET = SOURCE                                                        
                                                                              
       RETURN                                                                 
       END