#include <ugraph.hpp>
Inheritance diagram for UGraph:

Public Member Functions | |
| UGraph (class UView *) | |
| UGraph (class UEvent *) | |
| UGraph (class UEvent &) | |
| creates a new UGraph for drawing in the UView given as an explicit or implicit argument | |
| UView * | getView () const |
| returns the current View where graphics are being drawn. | |
| UDisp * | getDisp () const |
| returns the logical Display of this View. | |
| UAppli * | getAppli () const |
| returns the Application context. | |
| void | setColor (const UColor *) |
| void | setColor (const UColor &) |
| sets the Foreground color | |
| void | setBgcolor (const UColor *) |
| void | setBgcolor (const UColor &) |
| sets the Background color | |
| void | setFont (const UFont *) |
| void | setFont (const UFont &) |
| void | setFont (const UFontDesc &) |
| sets the current Font | |
| void | setCursor (const UCursor *) |
| void | setCursor (const UCursor &) |
| changes the mouse Cursor. | |
| bool | isXORMode () |
| void | setXORMode () |
| void | setPaintMode () |
| void | setThickness (int=0) |
| these functions set the drawing mode. | |
| int | getThickness () |
| changes line thickness when drawing lines, etc | |
| void | setClip (const URegion &) |
| void | setClip (u_pos x, u_pos y, u_dim width, u_dim height) |
| set the clipping zone relatively to VIEW coordinates | |
| void | setWinClip (const URegion &) |
| void | setWinClip (u_pos x, u_pos y, u_dim width, u_dim height) |
| set the clipping zone relatively to WINDOW coordinates | |
| void | flush () |
| flushes all drawing requests (when applicable). | |
| int | grabPointer (class UCursor *=null, bool confine_to_window=false) |
| starts a "physical grab" on the X server | |
| void | ungrabPointer () |
| ends a "physical grab" on the X server. | |
| u_pos | XToXwin (u_pos x_in_view) |
| u_pos | YToYwin (u_pos y_in_view) |
| conversion from local View coords to global Window coords. | |
| u_pos | XwinToX (u_pos x_in_win) |
| u_pos | YwintoY (u_pos y_in_win) |
| conversion from global Window coords to local View coords. | |
| void | clearRect (u_pos x, u_pos y, u_dim width, u_dim height, bool repaint_view=false) |
| clears a rectangle | |
| void | clearView (bool repaint_view=false) |
| same as clearRect() but clears the entire view. | |
| void | copyArea (u_pos x, u_pos y, u_dim width, u_dim height, u_dim delta_x, u_dim delta_y, bool generate_refresh_events_when_obscured) |
| void | drawArc (u_pos x, u_pos y, u_dim width, u_dim height, float from_angle, float arc_angle) |
| copies a rectangular area. | |
| void | drawEllipse (u_pos x, u_pos y, u_dim width, u_dim height) |
| draws an ellipse or an arc of an ellipse | |
| void | drawLine (u_pos x1, u_pos y1, u_pos x2, u_pos y2) |
| draws a line. | |
| void | drawPoint (u_pos x, u_pos y) |
| draws a point. | |
| void | drawPolyline (u_pos xpoints[], u_pos ypoints[], u_count card) |
| void | drawPolyline (std::vector< u_pos > xpoints, std::vector< u_pos > ypoints, u_count card) |
| draws a sequence of connected lines. | |
| void | drawPolygon (u_pos xpoints[], u_pos ypoints[], u_count card) |
| void | drawPolygon (std::vector< u_pos > xpoints, std::vector< u_pos > ypoints, u_count card) |
| draws a polygon (which is automatically closed). | |
| void | drawRect (u_pos x, u_pos y, u_dim width, u_dim height) |
| draws a rectangle. | |
| void | drawString (const UStr &, u_pos x, u_pos y) |
| void | drawString (const UStr *, u_pos x, u_pos y) |
| void | drawString (const char *, int str_length, u_pos x, u_pos y) |
| draw a character string | |
| void | fillArc (u_pos x, u_pos y, u_dim width, u_dim height, float from_angle, float arc_angle) |
| fills an arc of a circle (or a complete circle) | |
| void | fillPolygon (u_pos xpoints[], u_pos ypoints[], u_count card, int mode=0) |
| void | fillPolygon (std::vector< u_pos > xpoints, std::vector< u_pos > ypoints, u_count card, int mode=0) |
| fills a polygon (which is automatically closed) | |
| void | fillRect (u_pos x, u_pos y, u_dim width, u_dim height) |
| fills the area. | |
| void | fillView () |
| fills the whole View. | |
| void | drawIma (const class UNatIma *, u_pos x, u_pos y) |
| void | drawIma (const class UNatPix *, u_pos x, u_pos y) |
| bool | getCharDefaultSize (const UFont &, int &w, int &h) const |
| bool | getCharDefaultSize (const UFontDesc &, int &w, int &h) const |
| void | getTextSize (const UFont &, const UStr &, u_dim &width, u_dim &height) const |
| void | getTextSize (const UFontDesc &, const char *str, int str_len, u_dim &width, u_dim &height) const |
| u_dim | getTextHeight (const UFont &) const |
| u_dim | getTextHeight (const UFontDesc &) const |
| u_dim | getTextWidth (const UFont &, const UStr &) const |
| u_dim | getTextWidth (const UFontDesc &, const char *str, int str_len) const |
| returns font metrics. | |
| int | getCharPos (const UFontDesc &, const char *str, int str_len, u_pos x) const |
| int | getXPos (const UFontDesc &, const char *str, int str_len, int char_pos) const |
| converts x pos to char pos and vice-versa. | |
| bool | getClippedText (const char *s, int len, u_pos x0, u_pos y0, int &charpos_begin, int &charpos_end, u_pos &xpos_begin, u_pos &xpos_end) const |
| returns the substring that is enclosed in the current clip. | |
| bool | getSubTextSize (const UFontDesc &, const char *str, int str_len, u_dim &w, u_dim &h, u_dim available_width, int &sublen, int &change_line) const |
| returns font metrics of a substring that verifies certain conditions | |
| int | getSubTextSize (const UFontDesc *, const char *str, int str_len, u_dim maxwidth, u_dim chw, u_dim *w, u_dim *h) const |
| returns font metrics of a substring (obsolete version). | |
| UNatWin * | createBuffer (u_dim width, u_dim height) |
| creates an off-screen pixmap. | |
| void | deleteBuffer (class UNatWin *) |
| deletes an off-screen pixmap. | |
| UNatGraph * | getNatGraph () const |
| UWinGraph * | getWinGraph () const |
| UNatDisp * | getNatDisp () const |
| UNatWin * | getNatWin () const |
| gives acces to implementation-dependent hidden objects | |
Static Public Member Functions | |
| static void | getImaSize (class UNatIma *, u_dim &w, u_dim &h) |
| static void | getPixSize (class UNatPix *, u_dim &w, u_dim &h) |
!Warning: client should not use the UWinGraph class (which is reserved for the Ubit lib)
|
|
creates a new UGraph for drawing in the UView given as an explicit or implicit argument Function:
Typical usage: Notes:
|
|
||||||||||||||||||||||||
|
clears a rectangle Args:
|
|
||||||||||||||||||||||||||||
|
copies a rectangular area. copies a rectangular area of size (width,height) at location (x,y) to a location shifted by delta_x, delta_y
|
|
||||||||||||||||||||
|
draws an ellipse or an arc of an ellipse Args:
|
|
||||||||||||||||||||
|
draw a character string Note: these functions use the current Font (see setFont()). |
|
||||||||||||||||||||||||||||
|
fills an arc of a circle (or a complete circle) Args:
|
|
||||||||||||||||||||
|
fills a polygon (which is automatically closed) argument 'mode' can be set for optimisation purpose:
|
|
|
gives acces to implementation-dependent hidden objects Note: these "Native Objects" encapsulate platform-dependant data. their implementation is subject to change and to vary depending on the native platform. Reimplemented in UWinGraph. |
|
||||||||||||||||||||||||||||||||
|
returns font metrics of a substring (obsolete version). ???? |
|
||||||||||||||||||||||||||||||||||||
|
returns font metrics of a substring that verifies certain conditions Notes:
|
|
|
changes line thickness when drawing lines, etc the default value 0 sets thickness to 1 pixel and optimizes drawing |
|
||||||||||||
|
starts a "physical grab" on the X server Warning: this function may lock the X server! |
|
|
sets the Background color note: the color is undefined when the UGraph is created |
|
||||||||||||||||||||
|
set the clipping zone relatively to VIEW coordinates coordinates are relative to the origin of the VIEW Reimplemented in UWinGraph. |
|
|
sets the Foreground color note: the color is undefined when the UGraph is created |
|
|
sets the current Font notes: |
|
|
these functions set the drawing mode. notes:
|
|
||||||||||||||||||||
|
set the clipping zone relatively to WINDOW coordinates coordinates are relative to the origin of the WINDOW Reimplemented in UWinGraph. |
1.4.1