Menu

#32 pixmapUnix.c: do not redefine XPutImage on Aqua

1.4.0
closed
None
1
2023-11-19
2023-11-19
No

This was originally done in [r12]. I think the reason this was done was because Tk Aqua did not implement XPutImage() until Tk 8.4.6 (released 2004).

Redefining XPutImage currently causes nothing to be displayed for the image, and also causes several warnings:

pixmapUnix.c:20:9: warning: 'XPutImage' macro redefined [-Wmacro-redefined]
   20 | #define XPutImage
      |         ^
tkIntXlibDecls.h:1668:9: note: previous definition is here
 1668 | #define XPutImage \
      |         ^
pixmapUnix.c:181:15: warning: left operand of comma operator has no effect [-Wunused-value]
  181 |     XPutImage(display, instancePtr->pixmap,
      |               ^~~~~~~
pixmapUnix.c:181:37: warning: left operand of comma operator has no effect [-Wunused-value]
  181 |     XPutImage(display, instancePtr->pixmap,
      |                        ~~~~~~~~~~~  ^~~~~~
pixmapUnix.c:182:2: warning: left operand of comma operator has no effect [-Wunused-value]
  182 |         gc, image, 0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |         ^~
pixmapUnix.c:182:6: warning: left operand of comma operator has no effect [-Wunused-value]
  182 |         gc, image, 0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |             ^~~~~
pixmapUnix.c:182:42: warning: left operand of comma operator has no effect [-Wunused-value]
  182 |         gc, image, 0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |                                ~~~~~~~~~~~~~~~ ~^
pixmapUnix.c:182:62: warning: expression result unused [-Wunused-value]
  182 |         gc, image, 0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |                                                    ~~~~~~~~~~~~~~~ ~^
pixmapUnix.c:194:12: warning: left operand of comma operator has no effect [-Wunused-value]
  194 |         XPutImage(display, dataPtr->mask,
      |                   ^~~~~~~
pixmapUnix.c:194:30: warning: left operand of comma operator has no effect [-Wunused-value]
  194 |         XPutImage(display, dataPtr->mask,
      |                            ~~~~~~~  ^~~~
pixmapUnix.c:195:6: warning: left operand of comma operator has no effect [-Wunused-value]
  195 |             gc, mask,  0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |             ^~
pixmapUnix.c:195:10: warning: left operand of comma operator has no effect [-Wunused-value]
  195 |             gc, mask,  0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |                 ^~~~
pixmapUnix.c:195:46: warning: left operand of comma operator has no effect [-Wunused-value]
  195 |             gc, mask,  0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |                                    ~~~~~~~~~~~~~~~ ~^
pixmapUnix.c:195:66: warning: expression result unused [-Wunused-value]
  195 |             gc, mask,  0, 0, 0, 0, masterPtr->size[0], masterPtr->size[1]);
      |                                                        ~~~~~~~~~~~~~~~ ~^
13 warnings generated.

Removing the redefinition does cause the image to be displayed; it uses the wrong colors, but that is a separate issue which is likely due to Tk Aqua rather than TkImg. I would think that whoever needed working XPM support already uses the other XPM handler for photo images or avoids Tk Aqua.

1 Attachments

Related

Commit: [r12]

Discussion

  • Paul Obermeier

    Paul Obermeier - 2023-11-19
    • status: open --> closed
    • assigned_to: Paul Obermeier
     
  • Paul Obermeier

    Paul Obermeier - 2023-11-19

    Applied with [r716].

     

    Related

    Commit: [r716]


Log in to post a comment.