Back to index

plt-scheme  4.2.1
Public Member Functions | Private Attributes
wxMemoryDC Class Reference

#include <MemoryDC.h>

Inheritance diagram for wxMemoryDC:
Inheritance graph
[legend]
Collaboration diagram for wxMemoryDC:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxMemoryDC (Bool read_only=0)
 ~wxMemoryDC (void)
virtual void GetSize (double *w, double *h)
void SelectObject (wxBitmap *bitmap)
wxBitmapGetObject ()
virtual void FreeGetPixelCache (void)

Private Attributes

wxBitmapselected
Bool read_only

Detailed Description

Definition at line 36 of file MemoryDC.h.


Constructor & Destructor Documentation

wxMemoryDC::wxMemoryDC ( Bool  read_only = 0)

Definition at line 36 of file MemoryDC.cc.

                              : wxCanvasDC()
{
    __type = wxTYPE_DC_MEMORY;

    device = wxDEVICE_MEMORY;

    read_only = ro;

    // the memory DC is at construction a unusable class because
    // there is no drawable. The initialization will be done with
    // wxMemoryDC::SelectObject(wxBitmap *bitmap)
}

Definition at line 49 of file MemoryDC.cc.

{
  if (selected) {
    selected->selectedIntoDC = 0;
    selected->selectedTo = NULL;
    selected = NULL;
  }

#ifdef WX_USE_XRENDER
  X->picture = 0;
#endif
}

Member Function Documentation

Definition at line 172 of file MemoryDC.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 153 of file MemoryDC.cc.

{
  return selected;
}

Here is the caller graph for this function:

void wxMemoryDC::GetSize ( double *  w,
double *  h 
) [virtual]

Definition at line 158 of file MemoryDC.cc.

{
  if (selected) {
    double v;
    v = selected->GetWidth();
    *w = v;
    v = selected->GetHeight();
    *h = v;
  } else {
    *w = 0;
    *h = 0;
  }
}

Here is the call graph for this function:

Definition at line 62 of file MemoryDC.cc.

{
  if (bitmap == selected)
    return;

  EndSetPixel();

  /* Skip wxMemoryDC, because the bitmap's cache is fine. */
  wxWindowDC::FreeGetPixelCache(); 
#ifdef WX_USE_CAIRO
  ReleaseCairoDev();
#endif

  if (!read_only) {
    /* Bitmap selection memory and safety */
    if (bitmap && bitmap->selectedIntoDC)
      bitmap = NULL;

    if (selected) {
      selected->selectedIntoDC = 0;
      selected->selectedTo = NULL;
#ifdef USE_GL
      if (X->wx_gl) {
       X->gl_cfg = NULL;
       X->wx_gl->Reset(NULL, 0, 0);
      }
#endif      
    }
  } else if (bitmap && bitmap->selectedTo) {
    bitmap->selectedTo->FreeGetPixelCache();
#ifdef WX_USE_CAIRO
    bitmap->selectedTo->ReleaseCairoDev();
#endif
  }

  // free all associated GCs
#ifdef WX_USE_XRENDER
  X->picture = 0;
#endif
  Destroy();
  
  if (bitmap && bitmap->Ok()) {
    // The bitmap must use the display and screen of the application.
    // The drawable is the associated pixmap, width, height and depth
    // will be queried with XGetGeometry.
    wxWindowDC_Xinit *init;
    Pixmap pm;
    init = new wxWindowDC_Xinit;
    init->dpy      = wxAPP_DISPLAY;
    init->scn      = wxAPP_SCREEN;
    pm = GETPIXMAP(bitmap);
    init->drawable = pm;
    Initialize(init);
#ifdef USE_GL
    if (X->wx_gl) {
      int depth;
      depth = bitmap->GetDepth();
      X->gl_cfg = bitmap->gl_cfg;
      X->wx_gl->Reset(bitmap->gl_cfg, (depth == 1) ? 0 : (long)pm, 1);
    }
#endif
    // If another colourmap is associated with the bitmap,
    //  use it instead of the current colourmap.
    if (bitmap->GetColourMap() != current_cmap) {
      wxColourMap *cm;
      cm = bitmap->GetColourMap();
      SetColourMap(cm);
    }
    selected = bitmap;
    if (!read_only) {
      bitmap->selectedIntoDC = -1;
      selected->selectedTo = this;
    }
  } else {
    DRAWABLE = 0;
    WIDTH = HEIGHT = 0;
    selected = NULL;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 54 of file MemoryDC.h.

Definition at line 53 of file MemoryDC.h.


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