Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoWinClipboard Class Reference

VSG extension Supports copy/paste for Open Inventor using the Windows clipboard. More...

#include <Inventor/Win/SoWinClipboard.h>

Public Types

typedef void SoWinClipboardPasteCB(void *userData, SoPathList *pathList)
 

Public Member Functions

 SoWinClipboard (SoWidget w, Atom selectionAtom=_XA_CLIPBOARD_)
 Constructor.
 
 ~SoWinClipboard ()
 Destructor.
 
void copy (SoNode *node, Time eventTime)
 Copies the passed scene graph object (node, path, or pathlist) to the clipboard using the current clipboard format.
 
void copy (SoPath *path, Time eventTime)
 Copies the passed path to the clipboard using the current clipboard format.
 
void copy (SoPathList *pathList, Time eventTime)
 Copies the passed pathlist to the clipboard using the current clipboard format.
 
void paste (Time eventTime, SoWinClipboardPasteCB *pasteDoneFunc, void *userData=NULL)
 This requests data from the clipboard in the current clipboard format.
 

Detailed Description

VSG extension Supports copy/paste for Open Inventor using the Windows clipboard.

This class manages data transfers for copy and paste to and from the Windows clipboard. Transfers may occur within the same window, from one window to another window, and from process to process.

Clipboard support is currently strictly text. The copy type cbFormat will be forced to CF_TEXT, no matter what, if anything, is specified in the second argument of the constructor.

SEE ALSO

SoSelection, SoWin

Definition at line 90 of file SoWinClipboard.h.

Member Typedef Documentation

◆ SoWinClipboardPasteCB

typedef void SoWinClipboardPasteCB(void *userData, SoPathList *pathList)

Definition at line 50 of file SoWinClipboard.h.

Constructor & Destructor Documentation

◆ SoWinClipboard()

SoWinClipboard::SoWinClipboard ( SoWidget  w,
Atom  selectionAtom = _XA_CLIPBOARD_ 
)

Constructor.

w is the window that will be used for the clipboard operations. cbFormat specifies the Windows clipboard format to be used for the data transfer.

◆ ~SoWinClipboard()

SoWinClipboard::~SoWinClipboard ( )

Destructor.

Member Function Documentation

◆ copy() [1/3]

void SoWinClipboard::copy ( SoNode node,
Time  eventTime 
)

Copies the passed scene graph object (node, path, or pathlist) to the clipboard using the current clipboard format.

The eventTime should be the time returned by the system routine time (), and can be used to insure synchronization of copy and paste requests.

For example,

#include <windows.h>
#include <time.h>
#include <...>
... (necessary Inventor includes)
void SomeFunc(some_args)
{
HWND hwnd;
// (window value gets set in normal Windows usage
// or is passed in as an argument)
...
SoNode *the_node
// a node to copy to the clipboard
// (will be incorporated in a pathlist)
...
SoWinClipboard the_clipboard(hwnd);
// CF_TEXT is forced as the clipboard format
...
the_clipboard.copy(the_node, time(NULL));
// copy the node to the clipboard
...
}

◆ copy() [2/3]

void SoWinClipboard::copy ( SoPath path,
Time  eventTime 
)

Copies the passed path to the clipboard using the current clipboard format.

See copy() for details.

◆ copy() [3/3]

void SoWinClipboard::copy ( SoPathList pathList,
Time  eventTime 
)

Copies the passed pathlist to the clipboard using the current clipboard format.

See copy() for details.

◆ paste()

void SoWinClipboard::paste ( Time  eventTime,
SoWinClipboardPasteCB pasteDoneFunc,
void *  userData = NULL 
)

This requests data from the clipboard in the current clipboard format.

When the data is retrieved, the pasteDoneFunc callback is invoked. The newly pasted data is passed as the callback function's pathList argument (an SoPathList).


The documentation for this class was generated from the following file: