| GTK-EXTRA - Reference Manual

| Home

## Name

### GtkplotPc( print context) - a renderer for printing functions

## Synopsis

    GtkType
    gtk_plot_pc_get_type
    (void);
    GtkObject *
    gtk_plot_pc_new
    (void);
    gboolean
    gtk_plot_pc_init
    (GtkPlotPC *pc);
    void
    gtk_plot_pc_leave
    (GtkPlotPC *pc);
    void
    gtk_plot_pc_set_viewport
    (GtkPlotPC *pc,
    gdouble w, gdouble h);
void |
    gtk_plot_pc_gsave
    (GtkPlotPC *pc);
void |
    gtk_plot_pc_grestore
    (GtkPlotPC *pc);
void |
    gtk_plot_pc_clip
    (GtkPlotPC *pc,
    GdkRectangle *area);
void |
    gtk_plot_pc_clip_mask
    (GtkPlotPC *pc,
    gdouble x,
    gdouble y,
    GdkBitmap *mask);
void |
    gtk_plot_pc_set_color
    (GtkPlotPC *pc,
    GdkColor *color);
    void
    gtk_plot_pc_set_lineattr
    (GtkPlotPC *pc,
    gfloat line_width,
    GdkLineStyle line_style,
    GdkCapStyle cap_style,
    GdkJoinStyle join_style);
    void
    gtk_plot_pc_set_dash
    (GtkPlotPC *pc,
    gdouble offset_,
    gdouble *values,
    gint num_values);
    void
    gtk_plot_pc_draw_point
    (GtkPlotPC *pc,
    gdouble x, gdouble y);
    void
    gtk_plot_pc_draw_line
    (GtkPlotPC *pc,
    gdouble x1, gdouble y1,
    gdouble x2, gdouble y2);
    void
    gtk_plot_pc_draw_lines
    (GtkPlotPC *pc,
    GtkPlotPoint *points,
    gint numpoints);
    void
    gtk_plot_pc_draw_rectangle
    (GtkPlotPC *pc,
    gboolean filled,
    gdouble x, gdouble y,
    gdouble width,
    gdouble height);
void |
    gtk_plot_pc_draw_polygon
    (GtkPlotPC *pc,
    gint filled,
    GtkPlotPoint *points,
    gint numpoints);
void |
    gtk_plot_pc_draw_ellipse
    (GtkPlotPC *pc,
    gboolean filled,
    gdouble x, gdouble y,
    gdouble width,
    gdouble height);
void |
    gtk_plot_pc_draw_circle
    (GtkPlotPC *pc,
    gint filled,
    gdouble x, gdouble y,
    gdouble size);
void |
    gtk_plot_pc_set_font
    (GtkPlotPC *pc,
    GtkPSFont *psfont,
    gint height);
void |
    gtk_plot_pc_draw_string
    (GtkPlotPC *pc,
    gint x, gint y,
    gint angle,
    const GdkColor *fg,
    const GdkColor *bg,
    gboolean transparent,
    gint border,
    gint border_space,
    gint border_width,
    gint shadow_width,
    const gchar *font,
    gint height,
    GtkJustification just,
    const gchar *text);
void |
    gtk_plot_pc_draw_pixmap
    (GtkPlotPC *pc,
    GdkPixmap *pixmap,
    GdkBitmap *mask,
    gint xsrc, gint ysrc,
    gint xdest, gint ydest,
    gint width,
    gint height,
    gdouble scale_x,
    gdouble scale_y);

## Object Hierarchy

##
Args

## Signal Prototypes

"Init" signal "leave" signal "set_viewport" signal "gsave" signal "grestore" signal "clip" signal "clip_mask" signal "set_color" signal "set_lineattr" signal "set_dash" signal "draw_point" signal "draw_line" signal "draw_lines" signal "draw_rectangle" signal "draw_polygon" signal "draw_circle" signal "draw_ellipse" signal "set_font" signal "draw_string" signal "draw_pixmap" signal

## Description

####

##
Details

     struct GtkPlotPoint;
     struct GtkPlotPC;

##
Screenshot

##

### gtk_plot_pc_get_type ()

    GtkType gtk_plot_pc_get_type (void);

Return |

### gtk_plot_pc_new ()

    GtkObject *gtk_plot_pc_new (void);

Create a new printing context.

Return | a new PlotPC object

### gtk_plot_pc_init ()

    gboolean gtk_plot_pc_init (GtkPlotPC *pc);

Initalize PlotPC object. (Increment pc->init_count)

pc | a PlotPC object
Return | TRUE if success FALSE if pc->init_count <1

### gtk_plot_pc_leave ()

    void gtk_plot_pc_leave (GtkPlotPC *pc);

Decrement pc->init_count.

pc | a PlotPC object

### gtk_plot_pc_set_viewport ()

    void gtk_plot_pc_set_viewport (GtkPlotPC *pc,
                                   gdouble w, gdouble h);

Set the viewport (the printing window) of pc.

pc | a PlotPC object
w,h | width,height of the window

### gtk_plot_pc_gsave ()

    void gtk_plot_pc_gsave (GtkPlotPC *pc);

pc |

### gtk_plot_pc_grestore ()

    void gtk_plot_pc_grestore (GtkPlotPC *pc);

pc |

### gtk_plot_pc_clip ()

    void gtk_plot_pc_clip (GtkPlotPC *pc,
                           GdkRectangle *area);

pc |
area |

### gtk_plot_pc_clip_mask ()

    void gtk_plot_pc_clip_mask (GtkPlotPC *pc,
                                gdouble x,
                                gdouble y,
                                GdkBitmap *mask);

pc |
x,y |
mask |

### gtk_plot_pc_set_color ()

    void gtk_plot_pc_set_color (GtkPlotPC *pc,
                                GdkColor *color);

pc |
color |

### gtk_plot_pc_set_lineattr ()

    void gtk_plot_pc_set_lineattr (GtkPlotPC *pc,
                                   gfloat line_width,
                                   GdkLineStyle line_style,
                                   GdkCapStyle cap_style,
                                   GdkJoinStyle join_style);

pc |
width |
line_style |
cap_style |
join_style |

### gtk_plot_pc_set_dash ()

    void gtk_plot_pc_set_dash (GtkPlotPC *pc,
                               gdouble offset_,
                               gdouble *values,
                               gint num_values);

pc |
offset |
values |
num_values |

### gtk_plot_pc_draw_point ()

    void gtk_plot_pc_draw_point (GtkPlotPC *pc,
                                 gdouble x, gdouble y);

pc |
x,y |

### gtk_plot_pc_draw_line ()

    void gtk_plot_pc_draw_line (GtkPlotPC *pc,
                                gdouble x1, gdouble y1,
                                gdouble x2, gdouble y2);

pc |
x1,y1 |
x2,y2 |

### gtk_plot_pc_draw_lines ()

    void gtk_plot_pc_draw_lines (GtkPlotPC *pc,
                                 GtkPlotPoint *points,
                                 gint numpoints);

pc |
points |
numpoints |

### gtk_plot_pc_draw_rectangle ()

    void gtk_plot_pc_draw_rectangle (GtkPlotPC *pc,
                                     gboolean filled,
                                     gdouble x, gdouble y,
                                     gdouble width,
                                     gdouble height);

pc |
filled |
x,y |
width,height |

### gtk_plot_pc_draw_polygon ()

    void gtk_plot_pc_draw_polygon (GtkPlotPC *pc,
                                   gint filled,
                                   GtkPlotPoint *points,
                                   gint numpoints);

pc |
filled |
points |
numpoints |

### gtk_plot_pc_draw_ellipse ()

    void gtk_plot_pc_draw_ellipse (GtkPlotPC *pc,
                                   gboolean filled,
                                   gdouble x, gdouble y,
                                   gdouble width,
                                   gdouble height);

pc |
filled |
x,y |
width,height |

### gtk_plot_pc_draw_circle ()

    void gtk_plot_pc_draw_circle (GtkPlotPC *pc,
                                  gint filled,
                                  gdouble x, gdouble y,
                                  gdouble size);

pc |
filled |
x,y |
size |

### gtk_plot_pc_set_font ()

    void gtk_plot_pc_set_font (GtkPlotPC *pc,
                               GtkPSFont *psfont,
                               gint height);

pc |
psfont |
height |

### gtk_plot_pc_draw_string ()

    void gtk_plot_pc_draw_string (GtkPlotPC *pc,
                                  gint x, gint y,
                                  gint angle,
                                  const GdkColor *fg,
                                  const GdkColor *bg,
                                  gboolean transparent,
                                  gint border,
                                  gint border_space,
                                  gint border_width,
                                  gint shadow_width,
                                  const gchar *font,
                                  gint height,
                                  GtkJustification just,
                                  const gchar *text);

pc |
x,y |
angle |
fg,bg |
transparent |
border |
border_space |
border_width |
shadow_width |
font |
height |
just |
text |

### gtk_plot_pc_draw_pixmap ()

    void gtk_plot_pc_draw_pixmap (GtkPlotPC *pc,
                                  GdkPixmap *pixmap,
                                  GdkBitmap *mask,
                                  gint xsrc, gint ysrc,
                                  gint xdest, gint ydest,
                                  gint width,
                                  gint height,
                                  gdouble scale_x,
                                  gdouble scale_y);

pc |
pixmap |
mask |
xarc,yarc |
xdest,ydest |
width,height |
scale_x,scale_y |

## Signals

### The "init" signal

    gboolean (* init) (GtkPlotPC *pc);

pc |
Returns |

### The "leave" signal

    void (* leave) (GtkPlotPC *pc);

pc |

### The "set_viewport" signal

    void (* set_viewport) (GtkPlotPC *pc,
                           gdouble w, gdouble h);

pc |
w,h |

### The "gsave" signal

    void (* gsave) (GtkPlotPC *pc);

pc |

### The "grestore" signal

    void (* grestore) (GtkPlotPC *pc);

pc |

### The "clip" signal

    void (* clip) (GtkPlotPC *pc,
                   const GdkRectangle *area);

pc |
area |

### The "clip_mask" signal

    void (* clip_mask) (GtkPlotPC *pc,
                        gdouble x,
                        gdouble y,
                        const GdkBitmap *mask);

pc |
x,y |
mask |

### The "set_color" signal

    void (* set_color) (GtkPlotPC *pc,
                        const GdkColor *color);

pc |
color |

### The "set_lineattr" signal

    void (* set_lineattr) (GtkPlotPC *pc,
                           gfloat line_width,
                           GdkLineStyle line_style,
                           GdkCapStyle cap_style,
                           GdkJoinStyle join_style);

pc |
line_width |
line_style |
cap_style |
join_style |

### The "set_dash" signal

    void (* set_dash) (GtkPlotPC *pc,
                       gdouble offset_,
                       gdouble *values,
                       gint num_values);

pc |
offset |
values |
num_values |

### The "draw_point" signal

    void (* draw_point) (GtkPlotPC *pc,
                         gdouble x, gdouble y);

pc |
x,y |

### The "draw_line" signal

    void (* draw_line) (GtkPlotPC *pc,
                        gdouble x1, gdouble y1,
                        gdouble x2, gdouble y2);

pc |
x1,y1 |
x2,y2 |

### The "draw_lines" signal

    void (* draw_lines) (GtkPlotPC *pc,
                         GtkPlotPoint *points,
                         gint numpoints);

pc |
points |
numpoints |

### The "draw_rectangle" signal

    void (* draw_rectangle) (GtkPlotPC *pc,
                             gboolean filled,
                             gdouble x, gdouble y,
                             gdouble width,
                             gdouble height);

pc |
filled |
x,y |
width,height |

### The "draw_polygon" signal

    void (* draw_polygon) (GtkPlotPC *pc,
                           gboolean filled,
                           GtkPlotPoint *points,
                           gint numpoints);

pc |
filled |
points |
numpoints |

### The "draw_circle" signal

    void (* draw_circle) (GtkPlotPC *pc,
                          gboolean filled,
                          gdouble x, gdouble y,
                          gdouble size);

pc |
filled |
x,y |
size |

### The "draw_ellipse" signal

    void (* draw_ellipse) (GtkPlotPC *pc,
                           gboolean filled,
                           gdouble x, gdouble y,
                           gdouble width,
                           gdouble height);

pc |
filled |
x,y |
width,height |

### The "set_font" signal

    void (* set_font) (GtkPlotPC *pc,
                       GtkPSFont *psfont,
                       gint height);

pc |
psfont |
height |

### The "draw_string" signal

    void (* draw_string) (GtkPlotPC *pc,
                          gint x, gint y,
                          gint angle,
                          const GdkColor *fg,
                          const GdkColor *bg,
                          gboolean transparent,
                          gint border,
                          gint border_space,
                          gint border_width,
                          gint shadow_width,
                          const gchar *font,
                          gint height,
                          GtkJustification just,
                          const gchar *text);

pc |
x,y |
angle |
fg,bg |
transparent |
border |
border_space |
border_width |
shadow_width |
font |
height |
just |
text |

### The "draw_pixmap" signal

    void (* draw_pixmap) (GtkPlotPC *pc,
                          GdkPixmap *pixmap,
                          GdkBitmap *mask,
                          gint xsrc, gint ysrc,
                          gint xdest, gint ydest,
                          gint width,
                          gint height,
                          gdouble scale_x,
                          gdouble scale_y);

pc |
pixmap |
mask |
xsrc,ysrc |
xdest,ydest |
width,height |
scale_x,scale_y |

## DETAILS

    struct _GtkPlotPoint
    {
      gdouble x, y;
    };
    struct _GtkPlotPC
    {
       GtkObject object;
       gdouble width, height; /* viewport */
       GdkColor color;
       gint init_count;
    };

| Home |  |