Back to index

plt-scheme  4.2.1
Public Member Functions | Public Attributes
wxRectanglePathRgn Class Reference

#include <Region.h>

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

List of all members.

Public Member Functions

 wxRectanglePathRgn (wxDC *dc_for_scale, double x, double y, double width, double height)
virtual Bool Install (long target, Bool reverse, Bool align)
virtual Bool InstallPS (wxPostScriptDC *dc, wxPSStream *s)
void PrepareScale (long target, Bool oe, Bool align, void *m)
void RestoreScale (long target, Bool align, void *m)
double XFormX (double x, Bool align)
double XFormY (double x, Bool align)
double XFormXB (double x, Bool align)
double XFormYB (double x, Bool align)
double XFormW (double w, double x, Bool align)
double XFormH (double h, double y, Bool align)
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

double x
double y
double width
double height
double ox
double oy
double sx
double sy
int is_rect
WXTYPE __type
void__gc_external

Detailed Description

Definition at line 130 of file Region.h.


Constructor & Destructor Documentation

wxRectanglePathRgn::wxRectanglePathRgn ( wxDC dc_for_scale,
double  x,
double  y,
double  width,
double  height 
)

Definition at line 1264 of file Region.cxx.

: wxPathRgn(dc_for_scale)
{
  x = _x;
  y = _y;
  width = _width;
  height = _height;
  is_rect = 1;
}

Member Function Documentation

Bool wxRectanglePathRgn::Install ( long  target,
Bool  reverse,
Bool  align 
) [virtual]

Implements wxPathRgn.

Definition at line 1274 of file Region.cxx.

{
  double xx, yy, ww, hh;
  cairo_matrix_p m;

  PrepareScale(target, TRUE, align, &m);

  xx = XFormXB(x, align);
  yy = XFormYB(y, align);
  ww = XFormW(width, x, align);
  hh = XFormH(height, y, align);

#ifdef WX_USE_CAIRO
  cairo_move_to(CAIRO_DEV, xx, yy);
  if (reverse) {
    cairo_rel_line_to(CAIRO_DEV, 0, hh);
    cairo_rel_line_to(CAIRO_DEV, ww, 0);
    cairo_rel_line_to(CAIRO_DEV, 0, -hh);
  } else {
    cairo_rel_line_to(CAIRO_DEV, ww, 0);
    cairo_rel_line_to(CAIRO_DEV, 0, hh);
    cairo_rel_line_to(CAIRO_DEV, -ww, 0);
  }
  cairo_close_path(CAIRO_DEV);
#endif
#ifdef wx_mac
  CGPathMoveToPoint(CGPATH, CGXFORM, xx, yy);
  if (reverse) {
    CGPathAddLineToPoint(CGPATH, CGXFORM, xx, yy + hh);
    CGPathAddLineToPoint(CGPATH, CGXFORM, xx + ww, yy + hh);
    CGPathAddLineToPoint(CGPATH, CGXFORM, xx + ww, yy);
  } else {
    CGPathAddLineToPoint(CGPATH, CGXFORM, xx + ww, yy);
    CGPathAddLineToPoint(CGPATH, CGXFORM, xx + ww, yy + hh);
    CGPathAddLineToPoint(CGPATH, CGXFORM, xx, yy + hh);
  }
  CGPathCloseSubpath(CGPATH);
#endif
#ifdef wx_msw
  if (reverse) {
    wxGPathAddLine(CURRENT_GP, xx, yy, xx, yy + hh);
    wxGPathAddLine(CURRENT_GP, xx, yy + hh, xx + ww, yy + hh);
    wxGPathAddLine(CURRENT_GP, xx + ww, yy + hh, xx + ww, yy);
  } else {
    wxGPathAddLine(CURRENT_GP, xx, yy, xx + ww, yy);
    wxGPathAddLine(CURRENT_GP, xx + ww, yy, xx + ww, yy + hh);
    wxGPathAddLine(CURRENT_GP, xx + ww, yy + hh, xx, yy + hh);
  }
  wxGPathCloseFigure(CURRENT_GP);
#endif

  RestoreScale(target, align, &m);
  
  return FALSE;
}

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:

Bool wxRectanglePathRgn::InstallPS ( wxPostScriptDC *  dc,
wxPSStream s 
) [virtual]

Implements wxPathRgn.

Definition at line 1330 of file Region.cxx.

{
  double xx, yy, ww, hh;

  xx = dc->FsLogicalToDeviceX(x, ox, sx);
  yy = dc->FsLogicalToDeviceY(y, oy, sy);
  ww = dc->FsLogicalToDeviceXRel(width, ox, sx);
  hh = dc->FsLogicalToDeviceYRel(height, oy, sy);

  s->Out(xx); s->Out(" "); s->Out(yy); s->Out(" moveto\n");
  s->Out(xx + ww); s->Out(" "); s->Out(yy); s->Out(" lineto\n");
  s->Out(xx + ww); s->Out(" "); s->Out(yy - hh); s->Out(" lineto\n");
  s->Out(xx); s->Out(" "); s->Out(yy - hh); s->Out(" lineto\n");
  s->Out("closepath\n");

  return FALSE;
}

Here is the call 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 wxPathRgn::PrepareScale ( long  target,
Bool  oe,
Bool  align,
void m 
) [inherited]

Definition at line 1211 of file Region.cxx.

{
#ifdef wx_xt
# ifdef WX_USE_CAIRO
  if (!align) {
    cairo_matrix_p *m = (cairo_matrix_p *)_m;
    cairo_set_matrix_create(*m);
    cairo_current_matrix(CAIRO_DEV, *m);
    cairo_default_matrix(CAIRO_DEV);
    cairo_translate(CAIRO_DEV, ox, oy);
    cairo_scale(CAIRO_DEV, sx, sy);
  }
# endif
#endif
#ifdef wx_mac
  if (align) {
    current_xform = CGAffineTransformMakeTranslation(0, 0);
  } else {
    current_xform = CGAffineTransformMakeTranslation(ox, oy);
    current_xform = CGAffineTransformScale(current_xform, sx, sy);
  }
#endif
#ifdef wx_msw
  current_path = wxGPathNew(oe ?  FillModeAlternate : FillModeWinding);
#endif
}

Here is the caller graph for this function:

void wxPathRgn::RestoreScale ( long  target,
Bool  align,
void m 
) [inherited]

Definition at line 1238 of file Region.cxx.

{
#ifdef WX_USE_CAIRO
  if (!align) {
    cairo_matrix_p *m = (cairo_matrix_p *)_m;
    cairo__set_matrix(CAIRO_DEV, *m);
    cairo_matrix_destroy(*m);
  }
#endif
#ifdef wx_mac
#endif
#ifdef wx_msw
  if (!align) {
    Matrix *m;
    m = wxGMatrixNew();
    wxGMatrixTranslate(m, ox, oy);
    wxGMatrixScale(m, sx, sy);
    wxGPathTransform(current_path, m);
    wxGMatrixRelease(m);
  }
  wxGPathAddPath(GP, current_path, TRUE);
  wxGPathRelease(current_path);
#endif
}

Here is the caller graph for this function:

double wxPathRgn::XFormH ( double  h,
double  y,
Bool  align 
) [inherited]

Definition at line 1203 of file Region.cxx.

{
  if (align)
    return floor(((_y + _h) * sy) + oy) - floor((_y * sy) + oy);
  else
    return _h;
}

Here is the caller graph for this function:

double wxPathRgn::XFormW ( double  w,
double  x,
Bool  align 
) [inherited]

Definition at line 1195 of file Region.cxx.

{
  if (align)
    return floor(((_x + _w) * sx) + ox) - floor((_x * sx) + ox);
  else
    return _w;
}

Here is the caller graph for this function:

double wxPathRgn::XFormX ( double  x,
Bool  align 
) [inherited]

Definition at line 1163 of file Region.cxx.

{
  if (align)
    return floor((_x * sx) + ox) + 0.5;
  else
    return _x;
}

Here is the caller graph for this function:

double wxPathRgn::XFormXB ( double  x,
Bool  align 
) [inherited]

Definition at line 1179 of file Region.cxx.

{
  if (align)
    return floor((_x * sx) + ox);
  else
    return _x;
}

Here is the caller graph for this function:

double wxPathRgn::XFormY ( double  x,
Bool  align 
) [inherited]

Definition at line 1171 of file Region.cxx.

{
  if (align)
    return floor((_y * sy) + oy) + 0.5;
  else
    return _y;
}

Here is the caller graph for this function:

double wxPathRgn::XFormYB ( double  x,
Bool  align 
) [inherited]

Definition at line 1187 of file Region.cxx.

{
  if (align)
    return floor((_y * sy) + oy);
  else
    return _y;
}

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.

Definition at line 136 of file Region.h.

int wxPathRgn::is_rect [inherited]

Definition at line 111 of file Region.h.

double wxPathRgn::ox [inherited]

Definition at line 110 of file Region.h.

double wxPathRgn::oy [inherited]

Definition at line 110 of file Region.h.

double wxPathRgn::sx [inherited]

Definition at line 110 of file Region.h.

double wxPathRgn::sy [inherited]

Definition at line 110 of file Region.h.

Definition at line 135 of file Region.h.

Definition at line 133 of file Region.h.

Definition at line 134 of file Region.h.


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