Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
mozdrawingarea.c File Reference
#include "mozdrawingarea.h"

Go to the source code of this file.

Functions

static void moz_drawingarea_class_init (MozDrawingareaClass *klass)
static void moz_drawingarea_init (MozDrawingarea *drawingarea)
static void moz_drawingarea_create_windows (MozDrawingarea *drawingarea, GdkWindow *parent, GtkWidget *widget)
static void moz_drawingarea_finalize (GObject *object)
GtkType moz_drawingarea_get_type (void)
MozDrawingarea * moz_drawingarea_new (MozDrawingarea *parent, MozContainer *widget_parent)
void moz_drawingarea_reparent (MozDrawingarea *drawingarea, GdkWindow *aNewParent)
void moz_drawingarea_move (MozDrawingarea *drawingarea, gint x, gint y)
void moz_drawingarea_resize (MozDrawingarea *drawingarea, gint width, gint height)
void moz_drawingarea_move_resize (MozDrawingarea *drawingarea, gint x, gint y, gint width, gint height)
void moz_drawingarea_set_visibility (MozDrawingarea *drawingarea, gboolean visibility)
void moz_drawingarea_scroll (MozDrawingarea *drawingarea, gint x, gint y)

Variables

static GObjectClass * parent_class = NULL

Function Documentation

void moz_drawingarea_class_init ( MozDrawingareaClass *  klass) [static]

Definition at line 103 of file mozdrawingarea.c.

{
    GObjectClass *object_class = G_OBJECT_CLASS (klass);

    object_class->finalize = moz_drawingarea_finalize;

    parent_class = g_type_class_peek_parent(klass);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void moz_drawingarea_create_windows ( MozDrawingarea *  drawingarea,
GdkWindow *  parent,
GtkWidget *  widget 
) [static]

Definition at line 126 of file mozdrawingarea.c.

{
    GdkWindowAttr attributes;
    gint          attributes_mask = 0;

    /* create the clipping window */
    attributes.event_mask = 0;
    attributes.x = 0;
    attributes.y = 0;
    attributes.width = 1;
    attributes.height = 1;
    attributes.wclass = GDK_INPUT_OUTPUT;
    attributes.visual = gtk_widget_get_visual (widget);
    attributes.colormap = gtk_widget_get_colormap (widget);
    attributes.window_type = GDK_WINDOW_CHILD;

    attributes_mask |= GDK_WA_VISUAL | GDK_WA_COLORMAP |
        GDK_WA_X | GDK_WA_Y;

    drawingarea->clip_window = gdk_window_new (parent, &attributes,
                                               attributes_mask);
    gdk_window_set_user_data(drawingarea->clip_window, widget);

    /* set the default pixmap to None so that you don't end up with the
       gtk default which is BlackPixel. */
    gdk_window_set_back_pixmap(drawingarea->clip_window, NULL, FALSE);

    attributes.event_mask = (GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK |
                             GDK_VISIBILITY_NOTIFY_MASK |
                             GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
                             GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
                             GDK_POINTER_MOTION_MASK);
    /* create the inner window */
    drawingarea->inner_window = gdk_window_new (drawingarea->clip_window,
                                                &attributes, attributes_mask);
    gdk_window_set_user_data(drawingarea->inner_window, widget);

    /* set the default pixmap to None so that you don't end up with the
       gtk default which is BlackPixel. */
    gdk_window_set_back_pixmap(drawingarea->inner_window, NULL, FALSE);
}

Here is the caller graph for this function:

void moz_drawingarea_finalize ( GObject *  object) [static]

Definition at line 170 of file mozdrawingarea.c.

{
    MozDrawingarea *drawingarea;

    g_return_if_fail(IS_MOZ_DRAWINGAREA(object));

    drawingarea = MOZ_DRAWINGAREA(object);

    gdk_window_set_user_data(drawingarea->inner_window, NULL);
    gdk_window_destroy(drawingarea->inner_window);
    gdk_window_set_user_data(drawingarea->clip_window, NULL);
    gdk_window_destroy(drawingarea->clip_window);

    (* parent_class->finalize) (object);
}

Here is the caller graph for this function:

Definition at line 55 of file mozdrawingarea.c.

{
    static GtkType moz_drawingarea_type = 0;

   if (!moz_drawingarea_type) {
       static GTypeInfo moz_drawingarea_info = {
           sizeof(MozDrawingareaClass), /* class size */
           NULL, /* base_init */
           NULL, /* base_finalize */
           (GClassInitFunc) moz_drawingarea_class_init, /* class_init */
           NULL, /* class_destroy */
           NULL, /* class_data */
           sizeof(MozDrawingarea), /* instance_size */
           0, /* n_preallocs */
           (GInstanceInitFunc) moz_drawingarea_init, /* instance_init */
           NULL, /* value_table */
       };
       moz_drawingarea_type =
           g_type_register_static (G_TYPE_OBJECT,
                                   "MozDrawingarea",
                                   &moz_drawingarea_info, 0);
   }

   return moz_drawingarea_type;
}

Here is the call graph for this function:

void moz_drawingarea_init ( MozDrawingarea *  drawingarea) [static]

Definition at line 113 of file mozdrawingarea.c.

{

}

Here is the caller graph for this function:

void moz_drawingarea_move ( MozDrawingarea *  drawingarea,
gint  x,
gint  y 
)

Definition at line 187 of file mozdrawingarea.c.

{
    gdk_window_move(drawingarea->clip_window, x, y);
}

Here is the caller graph for this function:

void moz_drawingarea_move_resize ( MozDrawingarea *  drawingarea,
gint  x,
gint  y,
gint  width,
gint  height 
)

Definition at line 202 of file mozdrawingarea.c.

{
    gdk_window_resize(drawingarea->inner_window, width, height);
    gdk_window_move_resize(drawingarea->clip_window, x, y, width, height);
}

Here is the caller graph for this function:

MozDrawingarea* moz_drawingarea_new ( MozDrawingarea *  parent,
MozContainer *  widget_parent 
)

Definition at line 82 of file mozdrawingarea.c.

{
    MozDrawingarea *drawingarea;

    drawingarea = g_object_new(MOZ_DRAWINGAREA_TYPE, NULL);

    drawingarea->parent = parent;

    if (!parent)
        moz_drawingarea_create_windows(drawingarea,
                                       GTK_WIDGET(widget_parent)->window,
                                       GTK_WIDGET(widget_parent));
    else
        moz_drawingarea_create_windows(drawingarea,
                                       parent->inner_window, 
                                       GTK_WIDGET(widget_parent));

    return drawingarea;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void moz_drawingarea_reparent ( MozDrawingarea *  drawingarea,
GdkWindow *  aNewParent 
)

Definition at line 119 of file mozdrawingarea.c.

{
    gdk_window_reparent(drawingarea->clip_window,
                        aNewParent, 0, 0);
}
void moz_drawingarea_resize ( MozDrawingarea *  drawingarea,
gint  width,
gint  height 
)

Definition at line 194 of file mozdrawingarea.c.

{
    gdk_window_resize(drawingarea->clip_window, width, height);
    gdk_window_resize(drawingarea->inner_window, width, height);
}

Here is the caller graph for this function:

void moz_drawingarea_scroll ( MozDrawingarea *  drawingarea,
gint  x,
gint  y 
)

Definition at line 224 of file mozdrawingarea.c.

{
    gdk_window_scroll(drawingarea->inner_window, x, y);
}
void moz_drawingarea_set_visibility ( MozDrawingarea *  drawingarea,
gboolean  visibility 
)

Definition at line 210 of file mozdrawingarea.c.

{
    if (visibility) {
        gdk_window_show_unraised(drawingarea->inner_window);
        gdk_window_show_unraised(drawingarea->clip_window);
    }
    else    {
        gdk_window_hide(drawingarea->clip_window);
        gdk_window_hide(drawingarea->inner_window);
    }
}

Here is the caller graph for this function:


Variable Documentation

GObjectClass* parent_class = NULL [static]

Definition at line 52 of file mozdrawingarea.c.