test::ScribbleGC Struct Reference

#include <scribble_manager.h>

Public Member Functions

 ScribbleGC ()
 ~ScribbleGC ()
void set_line_color (const unsigned long c)
 Change the X11 gc to use new line color.
void set_line_attributes (const int width)
 Change the X11 gc to use new line attributes. Currently, only change the width. Always use LineSolid.
void draw_line (const int x1, const int y1, const int x2, const int y2)
 Draw line on widget by using current line color, line width and line style.

Data Fields

float realZoom
 The real zoom factor (0, maxZoom).
int rotation
 Currently it must be one of {0, 270}. It could be {90, 180, 270}.
GtkWidget * widget
 The widget scribble will be drawn on.
GdkGC * gc
 X11 graphics context.

Detailed Description

Scribble graphics context. The scribble graphics context will be used by scribble manager to

Definition at line 75 of file scribble_manager.h.


Constructor & Destructor Documentation

test::ScribbleGC::ScribbleGC (  )  [inline]

Definition at line 83 of file scribble_manager.h.

00084     : realZoom(100.0f)
00085     , rotation(0)
00086     , widget(0)
00087     , gc(0)
00088     {}

test::ScribbleGC::~ScribbleGC (  )  [inline]

Definition at line 90 of file scribble_manager.h.

00090 {}


Member Function Documentation

void test::ScribbleGC::draw_line ( const int  x1,
const int  y1,
const int  x2,
const int  y2 
) [inline]

Draw line on widget by using current line color, line width and line style.

Definition at line 114 of file scribble_manager.h.

References gc, and widget.

00115     {
00116         gdk_draw_line(widget->window, gc, x1, y1, x2, y2);
00117     }

void test::ScribbleGC::set_line_attributes ( const int  width  )  [inline]

Change the X11 gc to use new line attributes. Currently, only change the width. Always use LineSolid.

Definition at line 103 of file scribble_manager.h.

References gc.

00104     {
00105         gdk_gc_set_line_attributes(gc
00106             , width
00107             , GDK_LINE_SOLID
00108             , GDK_CAP_PROJECTING
00109             , GDK_JOIN_MITER);
00110     }

void test::ScribbleGC::set_line_color ( const unsigned long  c  )  [inline]

Change the X11 gc to use new line color.

Definition at line 94 of file scribble_manager.h.

References gc.

00095     {
00096         GdkColor color;
00097         color.pixel = c;
00098         gdk_gc_set_foreground(gc, &color);
00099     }


Field Documentation

X11 graphics context.

Definition at line 81 of file scribble_manager.h.

Referenced by draw_line(), set_line_attributes(), and set_line_color().

The real zoom factor (0, maxZoom).

Definition at line 78 of file scribble_manager.h.

Referenced by test::ScribbleMgr::on_erase_begin(), and test::ScribbleMgr::on_erase_move().

Currently it must be one of {0, 270}. It could be {90, 180, 270}.

Definition at line 79 of file scribble_manager.h.

Referenced by test::ScribbleMgr::draw_scribble_page(), test::ScribbleMgr::on_erase_begin(), test::ScribbleMgr::on_erase_end(), and test::ScribbleMgr::on_erase_move().

The widget scribble will be drawn on.

Definition at line 80 of file scribble_manager.h.

Referenced by draw_line().


The documentation for this struct was generated from the following file:
Generated by  doxygen 1.6.2-20100208