Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ph/phclipboardread.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ph/phclipboardread.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ph/phclipboardread.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ph/phclipboardread.html on line 8

PhClipboardRead()

Copy data from the clipboard

Synopsis:

typedef char PhClipType[8];

PhClipboardHdr *PhClipboardRead(unsigned short ig,
                                PhClipType type);

Arguments:

ig
The input group. Each input group has its own private clipboard. To determine the current input group, call PhInputGroup(), passing to it the event that triggered the clipboard operation (e.g. cbinfo->event).
type
The data type to read from the clipboard.

Library:

ph

Description:

This function copies the clipboard data in that matches type from the Photon clipboard, and returns a pointer to the data populated in a PhClipboardWrite structure.

Returns:

A pointer to a populated PhClipboardWrite
Successful completion.
NULL
An error occurred.

Examples:

This callback reads data from the clipboard, and pastes it in a PtText widget named text:

int
paste_from_clip( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )

{
    int *cursor, ig, insertion_pt;
    PhClipboardHdr *ptr;

    ig=PhInputGroup(cbinfo->event);

    PtGetResource(ABW_text, Pt_ARG_CURSOR_POSITION, &cursor, 0);
    insertion_pt=*cursor;

    if (ptr=PhClipboardRead(ig,Ph_CLIPBOARD_TYPE_TEXT))
    {
        PtTextModifyText(ABW_text, insertion_pt, insertion_pt,
            insertion_pt, ptr->data, utf8strblen( ptr->data, ptr->length, NULL ) );
        free(ptr->data);
        free(ptr);
    }

    PtContainerGiveFocus(ABW_text,NULL);
    return(Pt_CONTINUE);

}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhClipboardCopyString(), PhClipboardHdr, PhClipboardPasteString(), PhClipboardWrite


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ph/phclipboardread.html on line 157

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ph/phclipboardread.html on line 157