#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Wed, 13 Sep 2017 10:26:19 +0200
changeset 8175 a6bf93e434e4
parent 8174 2704c965b97b
child 8176 33f71b59070d
#FEATURE by cg class: Image class definition class: Image class added: #noMaskButAlphaSupportedQuerySignal #noMaskSupportedQuerySignal changed: #initialize
Image.st
--- a/Image.st	Wed Sep 13 09:40:34 2017 +0200
+++ b/Image.st	Wed Sep 13 10:26:19 2017 +0200
@@ -23,7 +23,8 @@
 		FileCreationErrorSignal ImageErrorSignal ImageLoadErrorSignal
 		ImageNotFoundQuerySignal ImageSaveErrorSignal
 		InformationLostQuerySignal Lobby NumberOfDitherColors
-		UnrepresentableColorSignal'
+		UnrepresentableColorSignal NoMaskSupportedQuerySignal
+		NoMaskButAlphaSupportedQuerySignal'
 	poolDictionaries:''
 	category:'Graphics-Images'
 !
@@ -973,6 +974,14 @@
         InformationLostQuerySignal nameClass:self message:#informationLostQuerySignal.
         InformationLostQuerySignal parent:ImageLoadErrorSignal.
 
+        NoMaskSupportedQuerySignal := QuerySignal new.
+        NoMaskSupportedQuerySignal nameClass:self message:#noMaskSupportedQuerySignal.
+        NoMaskSupportedQuerySignal parent:InformationLostQuerySignal.
+
+        NoMaskButAlphaSupportedQuerySignal := QuerySignal new.
+        NoMaskButAlphaSupportedQuerySignal nameClass:self message:#noMaskButAlphaSupportedQuerySignal.
+        NoMaskButAlphaSupportedQuerySignal parent:NoMaskSupportedQuerySignal.
+
         BadImageFormatQuerySignal := QuerySignal new.
         BadImageFormatQuerySignal nameClass:self message:#badImageFormatQuerySignal.
         BadImageFormatQuerySignal parent:ImageLoadErrorSignal.
@@ -981,7 +990,7 @@
         UnrepresentableColorSignal nameClass:self message:#unrepresentableColorSignal.
     ]
 
-    "Modified: / 18.5.1999 / 15:50:03 / cg"
+    "Modified: / 13-09-2017 / 09:29:34 / cg"
 !
 
 initializeFileFormatTable
@@ -1760,6 +1769,32 @@
     "Created: 27.2.1997 / 12:43:50 / cg"
 !
 
+noMaskButAlphaSupportedQuerySignal
+    "return the (query-) signal, which is raised if some
+     bitmap-image with a mask is saved in a format which cannot represent
+     the mask but instead supports an alpha channel.
+     If unhandled, the image-save proceeds (with mask converted to alpha channel).
+     Otherwise, the handler may show a warn box or whatever and decide
+     to proceed or abort the saving."
+
+    ^ NoMaskButAlphaSupportedQuerySignal
+
+    "Created: / 13-09-2017 / 09:31:28 / cg"
+!
+
+noMaskSupportedQuerySignal
+    "return the (query-) signal, which is raised if some
+     bitmap-image with a mask is saved in a format which cannot represent
+     the mask.
+     If unhandled, the image-save proceeds (without mask).
+     Otherwise, the handler may show a warn box or whatever and decide
+     to proceed or abort the saving."
+
+    ^ NoMaskSupportedQuerySignal
+
+    "Created: / 13-09-2017 / 09:30:35 / cg"
+!
+
 unrepresentableColorSignal
     "return the signal, which is raised if some color is not
      representable in the image (when storing a pixel)."