Back to index

plt-scheme  4.2.1
Classes | Functions | Variables
Clipboard.h File Reference

Go to the source code of this file.

Classes

class  wxClipboardClient
class  wxClipboard

Functions

void wxInitClipboard (void)
char * wxsGetDataInEventspace (wxClipboardClient *clipOwner, char *format, long *length)

Variables

wxClipboardwxTheClipboard
wxClipboardwxTheSelection

Function Documentation

Definition at line 53 of file Clipboard.cc.

{
  if (!wx_clipWindow) {
    /* Hack: We need a window for clipboard stuff */
    wxWindow_Xintern *fh;
    wxREGGLOB(clipboard_frame);
    wxREGGLOB(selection_frame);
    wxREGGLOB(get_clipboard_frame);
    clipboard_frame = new wxFrame(NULL, "clipboard", 0, 0, 10, 10);
    selection_frame = new wxFrame(NULL, "selection", 0, 0, 10, 10);
    get_clipboard_frame = new wxFrame(NULL, "get clipboard", 0, 0, 10, 10);

    fh = clipboard_frame->GetHandle();
    wx_clipWindow = fh->frame;
    XtRealizeWidget(wx_clipWindow);

    fh = selection_frame->GetHandle();
    wx_selWindow = fh->frame;
    XtRealizeWidget(wx_selWindow);

    fh = get_clipboard_frame->GetHandle();
    getClipWindow = fh->frame;
    XtRealizeWidget(getClipWindow);

    /* Initially not in any specific context. */
    clipboard_frame->context = NULL;
    selection_frame->context = NULL;
    /* Not in any specific context. */
    get_clipboard_frame->context = NULL;
  }

  if (!wxTheClipboard) {
    int cts;
    
    wxREGGLOB(wxTheClipboard);
    wxREGGLOB(wxTheSelection);

    wxTheSelection = new wxClipboard;
    wxTheSelection->is_sel = 1;
    wxTheSelection->frame = selection_frame;

    if (!wxGetBoolPreference("selectionAsClipboard", &cts))
      cts = 0;

    if (cts) {
      wxTheClipboard = wxTheSelection;
    } else {
      wxTheClipboard = new wxClipboard;
      wxTheClipboard->frame = clipboard_frame;      
    }
  }

  xa_utf8 = ATOM("UTF8_STRING");
  xa_text = ATOM("TEXT");
  xa_targets = ATOM("TARGETS");
  xa_clipboard = ATOM("CLIPBOARD");
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* wxsGetDataInEventspace ( wxClipboardClient clipOwner,
char *  format,
long *  length 
)

Definition at line 2306 of file wxscheme.cxx.

{
  if (objscheme_something_prepared && clipOwner->context && (clipOwner->context != wxGetContextForFrame())) {
    Scheme_Object *cb, *sema;
    wxGetData *gd;
    
    sema = scheme_make_sema(0);

    gd = new WXGC_PTRS wxGetData;
    gd->clipOwner = clipOwner;
    gd->format = format;
    gd->sema = sema;

    cb = scheme_make_closed_prim((Scheme_Closed_Prim *)get_data_from_client, gd);

    MrEdQueueInEventspace(clipOwner->context, cb);

    if (!scheme_wait_sema(sema, 1)) {
      scheme_thread_block(0);
      scheme_making_progress();
      if (!scheme_wait_sema(sema, 1)) {
       scheme_thread_block(0.001);
       scheme_making_progress();
       if (!scheme_wait_sema(sema, 1)) {
         scheme_thread_block(0.1);
         scheme_making_progress();
         if (!scheme_wait_sema(sema, 1)) {
           scheme_thread_block(0.5);
           scheme_making_progress();
           if (!scheme_wait_sema(sema, 1)) {
             scheme_thread_block(0.5);
             scheme_making_progress();
             if (!scheme_wait_sema(sema, 1)) {
              /* timeout */
              return NULL;
             }
           }
         }
       }
      }
    }

    *length = gd->length;
    return gd->result;
  } else
    return clipOwner->GetData(format, length);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 28 of file Clipboard.cc.

Definition at line 27 of file Clipboard.cc.