Commit dc3a1a53 authored by Peter Achten's avatar Peter Achten
Browse files

(PA): clipboardHasChanged now correctly returns True

iff content clipboard has changed.
parent c14ca229
......@@ -97,6 +97,7 @@ CcRqCREATESDIFRAMEWINDOW :== 1813 // PA: added to create SDI frame window
CcRqCLIPBOARDHASTEXT :== 1812
CcRqGETCLIPBOARDTEXT :== 1811
CcRqSETCLIPBOARDTEXT :== 1810
CcRqGETCLIPBOARDCOUNT :== 1809 /* PA: added to retrieve clipboard count. */
CcRqDIRECTORYDIALOG :== 1802 /* PA: added to create directory selector dialog. */
CcRqFILESAVEDIALOG :== 1801
......
......@@ -4,7 +4,7 @@ implementation module clCrossCall_12
import StdBool, StdClass, StdInt, StdMisc, StdString, StdTuple
import ostoolbox
import code from "cCrossCall_12.obj", "cdebug_12.obj", "cpicture_12.obj", "htmlhelp.obj", "util_12.obj",/*MW11*/ "cprinter_12.obj", "cTCP.obj"
import code from "cCrossCall_12.obj", "cdebug_12.obj", "cpicture_12.obj", /*"htmlhelp.obj",*/ "util_12.obj",/*MW11*/ "cprinter_12.obj", "cTCP.obj"
import code from library "advapi32_library",
library "comctl32_library",
library "kernel32_library",
......@@ -239,6 +239,7 @@ CcRqCREATESDIFRAMEWINDOW :== 1813 // PA: added to create SDI frame window
CcRqCLIPBOARDHASTEXT :== 1812
CcRqGETCLIPBOARDTEXT :== 1811
CcRqSETCLIPBOARDTEXT :== 1810
CcRqGETCLIPBOARDCOUNT :== 1809 /* PA: added to retrieve clipboard count. */
CcRqDIRECTORYDIALOG :== 1802 /* PA: added to create directory selector dialog. */
CcRqFILESAVEDIALOG :== 1801
......
......@@ -20,6 +20,7 @@ CF_UNICODETEXT :== 13
CF_ENHMETAFILE :== 14
// PA: end of addition.
WinGetClipboardText :: !*OSToolbox -> (!String, !*OSToolbox)
WinSetClipboardText :: !String !*OSToolbox -> *OSToolbox
WinHasClipboardText :: !*OSToolbox -> (!Bool,!*OSToolbox)
WinGetClipboardText :: !*OSToolbox -> (!String,!*OSToolbox)
WinSetClipboardText :: !String !*OSToolbox -> *OSToolbox
WinHasClipboardText :: !*OSToolbox -> (!Bool, !*OSToolbox)
WinGetClipboardCount:: !*OSToolbox -> (!Int, !*OSToolbox)
......@@ -37,7 +37,8 @@ WinSetClipboardText :: !String !*OSToolbox -> *OSToolbox
WinSetClipboardText text tb
# (textptr,tb) = WinMakeCString text tb
# (_,tb) = IssueCleanRequest2 (ErrorCallback2 "SetClipboardText") (Rq1Cci CcRqSETCLIPBOARDTEXT textptr) tb
= WinReleaseCString textptr tb
# tb = WinReleaseCString textptr tb
= tb
WinHasClipboardText :: !*OSToolbox -> (!Bool,!*OSToolbox)
WinHasClipboardText tb
......@@ -47,3 +48,12 @@ WinHasClipboardText tb
CcWASQUIT -> False
_ -> abort "[WinHasClipboardText] expected CcRETURN1 value."
= (ok,tb)
WinGetClipboardCount :: !*OSToolbox -> (!Int,!*OSToolbox)
WinGetClipboardCount tb
# (rcci,tb) = IssueCleanRequest2 (ErrorCallback2 "GetClipboardCount") (Rq0Cci CcRqGETCLIPBOARDCOUNT) tb
clipboardCount = case rcci.ccMsg of
CcRETURN1 -> rcci.p1
CcWASQUIT -> 0
other -> abort "[WinGetClipboardCount] expected CcRETURN1 value.\n"
= (clipboardCount,tb)
......@@ -16,6 +16,7 @@ OShasClipboardText :: !*OSToolbox -> (!Bool,!*OSToolbox)
OSsetClipboardText :: !{#Char} !*OSToolbox -> *OSToolbox
// OSsetClipboardText empties the clipboard and sets the text to the clipboard.
// The return Int is the new version number.
OSgetClipboardText :: !*OSToolbox -> (!{#Char},!*OSToolbox)
// OSgetClipboardText retrieves the current clipboard text item, which is empty if not present.
......
......@@ -31,4 +31,4 @@ OSgetClipboardContent tb
OSgetClipboardVersion :: !Int !*OSToolbox -> (!Int,!*OSToolbox)
OSgetClipboardVersion nr tb
= (if (isEven nr) (nr+1) (nr-1),tb)
= WinGetClipboardCount tb
......@@ -49,11 +49,11 @@ where
removeDuplicateClipItems [item:items]
# (_,_,items) = Remove (eqClipboardType item) undef items
= [item:removeDuplicateClipItems items]
where
eqClipboardType :: !ClipboardItem !ClipboardItem -> Bool
eqClipboardType (ClipboardString _) item = case item of
(ClipboardString _) -> True
_ -> False
where
eqClipboardType :: !ClipboardItem !ClipboardItem -> Bool
eqClipboardType (ClipboardString _) item = case item of
(ClipboardString _) -> True
_ -> False
removeDuplicateClipItems items
= items
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment