Back to index

plt-scheme  4.2.1
Public Member Functions | Public Attributes
os_wxClipboard Class Reference
Inheritance diagram for os_wxClipboard:
Inheritance graph
[legend]
Collaboration diagram for os_wxClipboard:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~os_wxClipboard ()
void SetClipboardClient (wxClipboardClient *, long time)
void SetClipboardString (char *, long time)
char * GetClipboardString (long time)
void SetClipboardBitmap (wxBitmap *, long time)
wxBitmapGetClipboardBitmap (long time)
char * GetClipboardData (char *format, long *length, long time, int alt_sel=0)
wxClipboardClientGetClipboardClient (void)
void install_cleanup ()
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
voidoperator new (size_t size, void *p)
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
void operator delete (void *obj)
void operator delete (void *, void *)
void operator delete (void *obj)
voidoperator new[] (size_t size)
voidoperator new[] (size_t size, GCPlacement gcp)
voidoperator new[] (size_t size, void *p)
void operator delete[] (void *obj)
void operator delete[] (void *, void *)

Public Attributes

wxClipboardClientclipOwner
char * cbString
char * sentString
char * receivedString
voidreceivedTargets
long receivedLength
Bool is_sel
Bool in_progress
voidsaferef
double start_time
wxFrameframe
WXTYPE __type
void__gc_external

Detailed Description

Definition at line 377 of file wxs_misc.cxx.


Constructor & Destructor Documentation

Definition at line 399 of file wxs_misc.cxx.

Here is the call graph for this function:


Member Function Documentation

wxBitmap * wxClipboard::GetClipboardBitmap ( long  time) [inherited]

Definition at line 375 of file Clipboard.cc.

{
  return NULL;
}

Definition at line 330 of file Clipboard.cc.

{
  return clipOwner;
}

Here is the caller graph for this function:

char * wxClipboard::GetClipboardData ( char *  format,
long *  length,
long  time,
int  alt_sel = 0 
) [inherited]

Definition at line 466 of file Clipboard.cc.

{
  if (clipOwner && !alt_sel)  {
    if (clipOwner->formats->Member(format))
      return wxsGetDataInEventspace(clipOwner, format, length);
    else
      return NULL;
  } else if (cbString && !alt_sel) {
    if (!strcmp(format, "TEXT"))
      return copystring(cbString);
    else
      return NULL;
  } else {
    Atom xa;
    long i;

    if (!clip_timeout)
      clip_timeout = XtAppGetSelectionTimeout(wxAPP_CONTEXT) + 1;

    /* Need to make sure that only one thread is here at a time. */
    wxBlockUntil(CheckNotInProgress, saferef);
    
    in_progress = 1;

    receivedString = NULL;
    receivedTargets = NULL;

    XtGetSelectionValue(getClipWindow, alt_sel ? alt_sel : (is_sel ? XA_PRIMARY : xa_clipboard),
                     xa_targets, wxGetTargets, (XtPointer)saferef, time);

    start_time = scheme_get_inexact_milliseconds();
    BEGIN_ESCAPEABLE(abandoned_clip, saferef);
    wxBlockUntilTimeout(CheckReadyTarget, saferef, clip_timeout);
    END_ESCAPEABLE();

    if (!receivedTargets) {
      /* Timeout */
      in_progress = 0;
      return NULL;
    }

    xa = ATOM(format);

    for (i = 0; i < receivedLength; i++) {
      if (((Atom *)receivedTargets)[i] == xa)
       break;
      else if ((((Atom *)receivedTargets)[i] == xa_utf8
              || ((Atom *)receivedTargets)[i] == XA_STRING)
              && xa == xa_text) {
       xa = ((Atom *)receivedTargets)[i];
       break;
      }
    }

    if (receivedLength)
      receivedTargets = NULL;

    if (i >= receivedLength) {
      in_progress = 0;
      return NULL;
    }

    XtGetSelectionValue(getClipWindow, alt_sel ? alt_sel : (is_sel ? XA_PRIMARY : xa_clipboard),
                     xa, wxGetSelection, (XtPointer)saferef, 0);
    
    start_time = scheme_get_inexact_milliseconds();
    BEGIN_ESCAPEABLE(abandoned_clip, saferef);
    wxBlockUntilTimeout(CheckReadyString, saferef, clip_timeout);
    END_ESCAPEABLE();

    if (!receivedString) {
      /* Timeout */
      in_progress = 0;
      return NULL;
    }
    
    *length = receivedLength;

    in_progress = 0;

    if (xa == XA_STRING) {
      /* Really should encode... */
    }

    return receivedString;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

char * wxClipboard::GetClipboardString ( long  time) [inherited]

Definition at line 414 of file Clipboard.cc.

{
  char *str;
  long length;

  str = GetClipboardData("TEXT", &length, time);
  if (!str)
    str = "";

  return str;
}

Here is the call graph for this function:

Definition at line 99 of file wxGC.cxx.

{
  GC_finalization_proc old_fn;
  void *old_data;

# ifdef MZ_PRECISE_GC
#  define ALLOW_NON_BASE 0
#  define CHECK_BASE 0
# else
#  ifdef wx_xt
#   define ALLOW_NON_BASE 0
#   define CHECK_BASE 0
#  else
#   ifdef WIN32
#    define ALLOW_NON_BASE 0
#    define CHECK_BASE 1
#    define CRASH_ON_NONBASE 1
#   else
#    define ALLOW_NON_BASE 1
#    define CHECK_BASE 0
#   endif
#  endif
# endif

# if CHECK_BASE || ALLOW_NON_BASE
  if (GC_base(this) != (void *)this) {
#  if ALLOW_NON_BASE
    return;
#  else
#   ifdef CRASH_ON_NONBASE
    *(long *)0x0 = 1;
#   else
    printf("Clean-up object is not the base object\n");
    abort();
#   endif
#  endif
  }
# endif

  GC_register_finalizer_ignore_self(gcOBJ_TO_PTR(this), 
                                CAST_GCP GC_cleanup, NULL, 
                                CAST_GCPP &old_fn, &old_data);

# if CHECK_BASE
  if (old_fn) {
#  ifdef CRASH_ON_NONBASE
       *(long *)0x0 = 1;
#  else
    printf("Object already has a clean-up\n");
    abort();
#  endif
  }
# endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void gc::operator delete ( void obj) [inline, inherited]
void gc::operator delete ( void obj) [inline, inherited]

Definition at line 287 of file gc_cpp.h.

                                           {
    GC_FREE( obj );}

Here is the caller graph for this function:

void gc::operator delete ( void ,
void  
) [inline, inherited]

Definition at line 291 of file gc_cpp.h.

{}
void gc::operator delete[] ( void obj) [inline, inherited]

Definition at line 305 of file gc_cpp.h.

                                             {
    gc::operator delete( obj );}

Here is the call graph for this function:

void gc::operator delete[] ( void ,
void  
) [inline, inherited]

Definition at line 309 of file gc_cpp.h.

{}
void* gc::operator new ( size_t  size) [inline, inherited]
void* gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]
void * gc::operator new ( size_t  size) [inline, inherited]

Definition at line 273 of file gc_cpp.h.

                                           {
    return GC_MALLOC( size );}

Here is the caller graph for this function:

void * gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 276 of file gc_cpp.h.

                                                            {
    if (gcp == UseGC) 
        return GC_MALLOC( size );
    else if (gcp == PointerFreeGC)
       return GC_MALLOC_ATOMIC( size );
    else
        return GC_MALLOC_UNCOLLECTABLE( size );}
void * gc::operator new ( size_t  size,
void p 
) [inline, inherited]

Definition at line 284 of file gc_cpp.h.

                                                    {
    return p;}
void * gc::operator new[] ( size_t  size) [inline, inherited]

Definition at line 296 of file gc_cpp.h.

                                             {
    return gc::operator new( size );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 299 of file gc_cpp.h.

                                                              {
    return gc::operator new( size, gcp );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
void p 
) [inline, inherited]

Definition at line 302 of file gc_cpp.h.

                                                      {
    return p;}
void wxClipboard::SetClipboardBitmap ( wxBitmap bm,
long  time 
) [inherited]

Definition at line 362 of file Clipboard.cc.

{
  if (clipOwner) {
    MrEdQueueBeingReplaced(clipOwner);
    AddClipboardFrame(this, 0);
    clipOwner = NULL;
  }

  cbString = NULL;

  /* Don't know how to put a bitmap into the clipboard. */
}

Here is the call graph for this function:

void wxClipboard::SetClipboardClient ( wxClipboardClient client,
long  time 
) [inherited]

Definition at line 293 of file Clipboard.cc.

{
  Bool got_selection;

  if (clipOwner) {
    MrEdQueueBeingReplaced(clipOwner);
    clipOwner = NULL;
    AddClipboardFrame(this, 0);
  }
  cbString = NULL;
  
  /* Merely setting the context for a frame would not
     normally redirect events to a different eventspace.
     But there's a hack in mredx.cxx to help complete
     the redirection. */
  clipOwner = client;
  client->context = wxGetContextForFrame();
  frame->context = client->context;
  AddClipboardFrame(this, 1);

  if (is_sel) {
    got_selection = XtOwnSelection(wx_selWindow, XA_PRIMARY, time,
                               wxConvertSelection, wxLoseSelection, 
                               wxSelectionDone);
  } else {
    got_selection = XtOwnSelection(wx_clipWindow, xa_clipboard, time,
                               wxConvertClipboard, wxLoseClipboard, 
                               wxClipboardDone);
  }

  if (!got_selection) {
    MrEdQueueBeingReplaced(clipOwner);
    clipOwner = NULL;
    AddClipboardFrame(this, 0);
  }
}

Here is the call graph for this function:

void wxClipboard::SetClipboardString ( char *  str,
long  time 
) [inherited]

Definition at line 335 of file Clipboard.cc.

{
  Bool got_selection;

  if (clipOwner) {
    MrEdQueueBeingReplaced(clipOwner);
    clipOwner = NULL;
    AddClipboardFrame(this, 0);
  }

  cbString = str;

  if (is_sel) {
    got_selection = XtOwnSelection(wx_selWindow, XA_PRIMARY, time,
                               wxConvertSelection, wxLoseSelection, 
                               wxStringSelectionDone);
  } else {
    got_selection = XtOwnSelection(wx_clipWindow, xa_clipboard, time,
                               wxConvertClipboard, wxLoseClipboard, 
                               wxStringClipboardDone);
  }
  
  if (!got_selection) {
    cbString = NULL;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 146 of file wxGC.h.

WXTYPE wxObject::__type [inherited]

Definition at line 77 of file Object.h.

char* wxClipboard::cbString [inherited]

Definition at line 41 of file Clipboard.h.

Definition at line 40 of file Clipboard.h.

Definition at line 47 of file Clipboard.h.

Definition at line 44 of file Clipboard.h.

Definition at line 44 of file Clipboard.h.

long wxClipboard::receivedLength [inherited]

Definition at line 43 of file Clipboard.h.

char * wxClipboard::receivedString [inherited]

Definition at line 41 of file Clipboard.h.

Definition at line 42 of file Clipboard.h.

void* wxClipboard::saferef [inherited]

Definition at line 45 of file Clipboard.h.

char * wxClipboard::sentString [inherited]

Definition at line 41 of file Clipboard.h.

double wxClipboard::start_time [inherited]

Definition at line 46 of file Clipboard.h.


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