]> git.neil.brown.name Git - edlib.git/commitdiff
Remove meaning for str2 arg to Draw:image and Draw:image-size
authorNeilBrown <neil@brown.name>
Fri, 22 Sep 2023 04:33:02 +0000 (14:33 +1000)
committerNeilBrown <neil@brown.name>
Fri, 22 Sep 2023 04:33:02 +0000 (14:33 +1000)
The 'str2' arg is passed to the command when the image name start
"comm:".
However this was never use and it is not clear that the caller could
ever have a useful string to pass.  All details of how to find the
images can be encoded in the command name.

So drop all use for str2 in Draw:image and Draw:image-size handlers.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/Calls
display-ncurses.c
display-x11-xcb.c
python/display-pygtk.py

index 3a033a89352a459c167a7fae30ffb2cc1bd8ba9f..db1948772fe2319d2aaadf4d42bc9cc2ab9c2e59 100644 (file)
--- a/DOC/Calls
+++ b/DOC/Calls
@@ -118,9 +118,8 @@ comm2 as the (x,y) pair.
 Draw an image on the pane (or ancestor which as been cleared).
 
 - str1 identifies the images, either "file:FILENAME" or "comm:COMMAND".
-  If "comm:" the command is run with 'str2' passed as arg 'str1', and
-  result should be returned as 'bytes' (comm2 called with ->str1 as
-  array of bytes, ->num1 as length).
+  If "comm:" the command is run and result should be returned as 'bytes'
+  (comm2 called with ->str1 as array of bytes, ->num1 as length).
 - num is the 'or' of the following bit flags:
    - 16 stretch image to exactly fit pane.  If set, lower bits are ignored.
   Otherwise image will fill the pane in one dimension, and be positioning
index 07c3dab5dd1d52c8038bbc0ba9b4e1fd8380989f..5449a0846f7e1e489caaa6587d3d5fdf7dd697a1 100644 (file)
@@ -1034,7 +1034,7 @@ DEF_CMD(nc_draw_image)
        } else if (strstarts(ci->str, "comm:")) {
                struct call_return cr;
                wd = NewMagickWand();
-               cr = call_ret(bytes, ci->str+5, ci->focus, 0, NULL, ci->str2);
+               cr = call_ret(bytes, ci->str+5, ci->focus);
                if (!cr.s) {
                        DestroyMagickWand(wd);
                        return Efail;
@@ -1168,7 +1168,7 @@ DEF_CMD(nc_image_size)
        } else if (strstarts(ci->str, "comm:")) {
                struct call_return cr;
                wd = NewMagickWand();
-               cr = call_ret(bytes, ci->str+5, ci->focus, 0, NULL, ci->str2);
+               cr = call_ret(bytes, ci->str+5, ci->focus);
                if (!cr.s) {
                        DestroyMagickWand(wd);
                        return Efail;
index 817989b2aa2d7a011c9c7aa31a3dfb7a396522c7..55e631fa086bafa4e1b9cd620417b5d2ef946bd8 100644 (file)
@@ -854,7 +854,7 @@ DEF_CMD(xcb_draw_image)
        } else if (strstarts(ci->str, "comm:")) {
                struct call_return cr;
                wd = NewMagickWand();
-               cr = call_ret(bytes, ci->str+5, ci->focus, 0, NULL, ci->str2);
+               cr = call_ret(bytes, ci->str+5, ci->focus);
                if (!cr.s) {
                        DestroyMagickWand(wd);
                        return Efail;
@@ -949,7 +949,7 @@ DEF_CMD(xcb_image_size)
        } else if (strstarts(ci->str, "comm:")) {
                struct call_return cr;
                wd = NewMagickWand();
-               cr = call_ret(bytes, ci->str+5, ci->focus, 0, NULL, ci->str2);
+               cr = call_ret(bytes, ci->str+5, ci->focus);
                if (!cr.s) {
                        DestroyMagickWand(wd);
                        return Efail;
index b979ac6bb417984a98e9a7b1f93df6b4d10557da..fa9499cfa949c9f7598d7415d0479c065bb83bb9 100644 (file)
@@ -276,7 +276,7 @@ class EdDisplay(edlib.Pane):
 
         return True
 
-    def handle_image(self, key, num, focus, str, str2, xy, **a):
+    def handle_image(self, key, num, focus, str, xy, **a):
         "handle:Draw:image"
         self.damaged(edlib.DAMAGED_POSTORDER)
         # 'str' identifies the image. Options are:
@@ -302,7 +302,7 @@ class EdDisplay(edlib.Pane):
             if str.startswith("file:"):
                 pb = GdkPixbuf.Pixbuf.new_from_file(str[5:])
             elif str.startswith("comm:"):
-                img = focus.call(str[5:], str2, ret='bytes')
+                img = focus.call(str[5:], ret='bytes')
                 io = Gio.MemoryInputStream.new_from_data(img)
                 pb = GdkPixbuf.Pixbuf.new_from_stream(io)
             else:
@@ -344,7 +344,7 @@ class EdDisplay(edlib.Pane):
             cr.stroke()
         return True
 
-    def handle_image_size(self, key, focus, str1, str2, comm2, **a):
+    def handle_image_size(self, key, focus, str1, comm2, **a):
         "handle:Draw:image-size"
         if not str1 or not comm2:
             return edlib.Enoarg
@@ -352,7 +352,7 @@ class EdDisplay(edlib.Pane):
             if str1.startswith("file:"):
                 pb = GdkPixbuf.Pixbuf.new_from_file(str1[5:])
             elif str1.startswith("comm:"):
-                img = focus.call(str1[5:], str2, ret='bytes')
+                img = focus.call(str1[5:], ret='bytes')
                 io = Gio.MemoryInputStream.new_from_data(img)
                 pb = GdkPixbuf.Pixbuf.new_from_stream(io)
             else: