Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
gfxXlibSurface Class Reference

#include <gfxXlibSurface.h>

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

List of all members.

Public Member Functions

 gfxXlibSurface (Display *dpy, Drawable drawable, Visual *visual)
 gfxXlibSurface (Display *dpy, Drawable drawable, Visual *visual, unsigned long width, unsigned long height)
 gfxXlibSurface (Display *dpy, Visual *visual, unsigned long width, unsigned long height)
virtual ~gfxXlibSurface ()
unsigned long Width ()
unsigned long Height ()
DisplayXDisplay ()
Drawable XDrawable ()
cairo_surface_t * CairoSurface ()

Protected Member Functions

void Init (cairo_surface_t *surface)
void Destroy ()
PRBool Destroyed ()

Protected Attributes

PRBool mOwnsPixmap
DisplaymDisplay
Drawable mDrawable
unsigned long mWidth
unsigned long mHeight

Detailed Description

Definition at line 45 of file gfxXlibSurface.h.


Constructor & Destructor Documentation

gfxXlibSurface::gfxXlibSurface ( Display dpy,
Drawable  drawable,
Visual *  visual 
)

Definition at line 43 of file gfxXlibSurface.cpp.

                                                                              :
    mOwnsPixmap(PR_FALSE), mDisplay(dpy), mDrawable(drawable)
{
    // figure out width/height/depth
    Window root_ignore;
    int x_ignore, y_ignore;
    unsigned int bwidth_ignore, width, height, depth;

    XGetGeometry(dpy,
                 drawable,
                 &root_ignore, &x_ignore, &y_ignore,
                 &width, &height,
                 &bwidth_ignore, &depth);

    mWidth = width;
    mHeight = height;

    cairo_surface_t *surf = cairo_xlib_surface_create(dpy, drawable, visual, width, height);
    Init(surf);
}

Here is the call graph for this function:

gfxXlibSurface::gfxXlibSurface ( Display dpy,
Drawable  drawable,
Visual *  visual,
unsigned long  width,
unsigned long  height 
)

Definition at line 64 of file gfxXlibSurface.cpp.

                                                                          :
    mOwnsPixmap(PR_FALSE), mDisplay(dpy), mDrawable(drawable), mWidth(width), mHeight(height)
{
    cairo_surface_t *surf = cairo_xlib_surface_create(dpy, drawable, visual, width, height);
    Init(surf);
}

Here is the call graph for this function:

gfxXlibSurface::gfxXlibSurface ( Display dpy,
Visual *  visual,
unsigned long  width,
unsigned long  height 
)

Definition at line 72 of file gfxXlibSurface.cpp.

                                                                                                      :
    mOwnsPixmap(PR_TRUE), mDisplay(dpy), mWidth(width), mHeight(height)

{
    mDrawable = (Drawable)XCreatePixmap(dpy,
                                        RootWindow(dpy, DefaultScreen(dpy)),
                                        width, height,
                                        DefaultDepth(dpy, DefaultScreen(dpy)));

    cairo_surface_t *surf = cairo_xlib_surface_create(dpy, mDrawable, visual, width, height);
    Init(surf);
}

Here is the call graph for this function:

Definition at line 85 of file gfxXlibSurface.cpp.

{
    Destroy();

    if (mOwnsPixmap)
        XFreePixmap(mDisplay, mDrawable);
}

Here is the call graph for this function:


Member Function Documentation

cairo_surface_t* gfxASurface::CairoSurface ( ) [inline, inherited]

Definition at line 50 of file gfxASurface.h.

{ return mSurface; }

Here is the caller graph for this function:

void gfxASurface::Destroy ( void  ) [inline, protected, inherited]

Definition at line 58 of file gfxASurface.h.

                   {
        if (mDestroyed) {
            NS_WARNING("Calling Destroy on an already-destroyed surface!");
            return;
        }

        cairo_surface_destroy(mSurface);
        mDestroyed = PR_TRUE;
    }

Here is the caller graph for this function:

PRBool gfxASurface::Destroyed ( ) [inline, protected, inherited]

Definition at line 68 of file gfxASurface.h.

                       {
        return mDestroyed;
    }
unsigned long gfxXlibSurface::Height ( ) [inline]

Definition at line 65 of file gfxXlibSurface.h.

{ return mHeight; }
void gfxASurface::Init ( cairo_surface_t *  surface) [inline, protected, inherited]

Definition at line 53 of file gfxASurface.h.

                                        {
        mDestroyed = PR_FALSE;
        mSurface = surface;
    }

Here is the caller graph for this function:

unsigned long gfxXlibSurface::Width ( ) [inline]

Definition at line 64 of file gfxXlibSurface.h.

{ return mWidth; }

Definition at line 67 of file gfxXlibSurface.h.

{ return mDisplay; }
Drawable gfxXlibSurface::XDrawable ( ) [inline]

Definition at line 68 of file gfxXlibSurface.h.

{ return mDrawable; }

Member Data Documentation

Definition at line 73 of file gfxXlibSurface.h.

Drawable gfxXlibSurface::mDrawable [protected]

Definition at line 74 of file gfxXlibSurface.h.

unsigned long gfxXlibSurface::mHeight [protected]

Definition at line 77 of file gfxXlibSurface.h.

Definition at line 71 of file gfxXlibSurface.h.

unsigned long gfxXlibSurface::mWidth [protected]

Definition at line 76 of file gfxXlibSurface.h.


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