The clipboard is a mechanism provided by PM to allow the user to transfer data between different applications. To do so, the user selects some data in a window, "copies" (or "cuts") it to the clipboard and then "pastes" the data in the target application.
When dealing with bidirectional data, it may be required to transfer text data, that has different bidirectional attributes (i.e, different format of text) between applications. Accordingly, a conversion of the text must be performed, in order to transform the text to a format (identified by bidirectional attributes) which is compatible with the target application (the one that "pastes" the data).
The PM bidirectional support provides automatic conversion of text between source and target applications, based on their process bidirectional attributes. In addition, bidi-aware applications can explicitly set the bidirectional attributes managed by the clipboard in order to affect the conversion that is performed on the text.
In order to allow the automatic conversion of the clipboard, the following conditions must be met:
The clipboard maintains two sets of bidirectional attributes.
The first set is called the 'Clipboard Bidirectional Attributes' and is associated with the text data that is currently stored in the clipboard. The default value for this set is inherited from the process bidirectional attributes of the application that issues WinSetClipbrdData. The source application can optionally modify this set of attributes by using the WinSetLangInfo API with the LI_BD_CLIP_ATTR effect.
The second set is called the 'Conversion Bidirectional Attributes'. This set is associated with the target application, and its default value is inherited from the process bidirectional attributes of the application that issues the WinQueryClipbrdData API. The target application can optionally modify these attributes by using the WinSetLangInfo API with LI_BD_CLIP_CONV_ATTR effect.
When using the WinSetLangInfo API to change the clipboard data, bidi-aware applications must follow the following rules:
The following is a typical scenario. Lines marked with '(BD)' are optional, and can be issued by bidi-aware applications.
Setting Clipboard Bidirectional Data. ------------------------------------- WinOpenClipbrd() WinEmptyClipbrd() WinSetClipbrdData(CF_TEXT) (clipboard bidi attributes are set - inheited from process bidi attributes). (BD) WinSetLangInfo(LI_BD_CLIP_ATTR..) (clipboard bidi attribute are set) WinCloseClipbrd() Querying Clipboard Bidirectional Data -------------------------------------- WinOpenClipbrd() (BD) WinQueryLangInfo(LI_BD_CLIP_ATTR...) (Queries the current clipboard bidi attributes). (BD) WinSetLangInfo(LI_BD_CLIP_CONV_ATTR...) (sets the clipboard conversion bidi attributes). WinQueryClipbrdData(CF_TEXT) (clipboard performs conversion on the text, using the clipboard and the conversion bidi attributes. WinCloseClipbrd()