Laxkit
0.0.7.1
|
Typedefs | |
typedef Displayer *(* | Laxkit::NewDisplayerFunc )(aDrawable *w) |
Function type to create new Displayer objects. |
Enumerations | |
enum | Laxkit::DrawThingTypes { THING_None, THING_Circle, Laxkit::THING_Circle_X, Laxkit::THING_Circle_Plus, THING_Square, Laxkit::THING_Diamond, THING_Triangle_Up, THING_Triangle_Down, THING_Triangle_Left, THING_Triangle_Right, THING_Plus, THING_X, THING_Asterix, Laxkit::THING_Eject, THING_Double_Triangle_Up, THING_Double_Triangle_Down, Laxkit::THING_Double_Triangle_Left, THING_Double_Triangle_Right, THING_Arrow_Left, THING_Arrow_Right, THING_Arrow_Up, THING_Arrow_Down, Laxkit::THING_Double_Arrow_Horizontal, THING_Double_Arrow_Vertical, Laxkit::THING_Pan_Arrows, THING_Check, THING_Locked, THING_Unlocked, THING_Open_Eye, THING_Closed_Eye, THING_Octagon, THING_MAX } |
Various common things that draw_thing() can draw simply. More... |
Functions | |
Displayer * | Laxkit::GetDefaultDisplayer () |
int | Laxkit::SetDefaultDisplayer (Displayer *displayer) |
Set the default Displayer, incrementing its count. | |
int | Laxkit::SetNewDisplayerFunc (const char *backend) |
Set the default "constructor" for Displayer objects. | |
unsigned long | Laxkit::screen_color_at_mouse (int mouse_id) |
Return the screen pixel color underneath the mouse. | |
int | Laxkit::translate_window_coordinates (anXWindow *from, int x, int y, anXWindow *to, int *xx, int *yy, anXWindow **kid) |
int | Laxkit::mouseisin (int mouse_id, anXWindow *win) |
Return whether the mouse is within the bounds of win. | |
int | Laxkit::mouseposition (int mouse_id, anXWindow *win, int *x, int *y, unsigned int *state, anXWindow **child, int *screen) |
Find the mouse x,y in win coordinates, also return the pointer mask, and what child it is in if any. | |
LaxCompositeOp | Laxkit::drawing_function (LaxCompositeOp mode) |
void | Laxkit::drawing_line_attributes (double width, int type, int cap, int join) |
Set characteristics of drawn lines. | |
unsigned long | Laxkit::background_color (unsigned long newcolor) |
Set the new default background color, and return the old one. | |
void | Laxkit::foreground_color (double r, double g, double b, double a) |
void | Laxkit::background_color (double r, double g, double b) |
unsigned long | Laxkit::foreground_color (unsigned long newcolor) |
Set the new default foreground color. | |
ScreenColor * | Laxkit::coloravg (ScreenColor *result, ScreenColor *a, ScreenColor *b, float r) |
result=a*(1-r)+b*r. Returns result. | |
unsigned long | Laxkit::pixelfromcolor (ScreenColor *col) |
Return conversion of col values to 8 bit color, as for Xlib's XSetForeground(). Ignores alpha. | |
void | Laxkit::set_color_shift_info (unsigned int rm, unsigned int gm, unsigned int bm, unsigned int am) |
Set up how to pack colors within a 32 bit location. | |
unsigned long | Laxkit::coloravg (unsigned long a, unsigned long b, float r) |
Return a scaled average of 2 colors. Returns equivalent of a*(1-r) + b*r. | |
void | Laxkit::colorrgb (unsigned long col, int *r, int *g, int *b) |
Decompose a pixel color into separate red, green, and blue components. | |
unsigned long | Laxkit::rgbcolor (int r, int g, int b) |
Get a pixel value suitable for X graphics functions from the r,g,b components. | |
unsigned long | Laxkit::rgbcolorf (double r, double g, double b) |
Get pixel value from floating point channel values in range [0..1]. | |
void | Laxkit::draw_bevel (aDrawable *win, int bevel, unsigned long highlight, unsigned long shadow, int state, double x, double y, double w, double h) |
Draw a bevel with bevel thickness within x,y,w,h. Draws state== LAX_OFF=not pressed, LAX_ON=pressed. | |
flatpoint * | Laxkit::draw_thing_coordinates (DrawThingTypes thing, flatpoint *buffer, int buffer_size, int *n_ret, double scale, DoubleBBox *bounds) |
Get coordinates for various graphical things. Coordinates are in a square bound by x=[0..scale], y=[0..scale]. | |
int | Laxkit::draw_thing (aDrawable *win, double x, double y, double rx, double ry, int fill, DrawThingTypes thing) |
Draw a little graphic with current foreground and line width. | |
int | Laxkit::draw_thing (aDrawable *win, double x, double y, double rx, double ry, DrawThingTypes thing, unsigned long fg, unsigned long bg, int lwidth) |
Draw a thing with outline color fg, and insides color bg. | |
void | Laxkit::clear_window (anXWindow *win) |
Clear the window area. | |
void | Laxkit::draw_rectangle (aDrawable *win, double x, double y, double w, double h) |
Draw a rectangle on win with the current foreground color. | |
void | Laxkit::fill_rectangle (aDrawable *win, double x, double y, double w, double h) |
Fill a rectangle on win with the current foreground color. | |
void | Laxkit::draw_line (aDrawable *win, double x1, double y1, double x2, double y2) |
Draw a line in screen coordinates. | |
void | Laxkit::draw_arc (aDrawable *win, double x, double y, double xradius, double yradius, double start_radians, double end_radians) |
Draw an optionally filled arc. Angles are in radians. | |
void | Laxkit::fill_arc (aDrawable *win, double x, double y, double xradius, double yradius, double start_radians, double end_radians) |
void | Laxkit::draw_arc_wh (aDrawable *win, double x, double y, double width, double height, double start_radians, double end_radians) |
void | Laxkit::fill_arc_wh (aDrawable *win, double x, double y, double width, double height, double start_radians, double end_radians) |
void | Laxkit::draw_lines (aDrawable *win, flatpoint *p, int n, int isclosed) |
Draw a line connecting the dots in p. | |
void | Laxkit::fill_polygon (aDrawable *win, flatpoint *p, int n) |
Fill a polygon line connecting the dots in p with the current foreground color. | |
LaxFont * | Laxkit::get_default_font () |
double | Laxkit::getextent (const char *str, int len, double *ex, double *ey, double *fasc, double *fdes, char r) |
Find the text extent with the default font for the given utf8 text. | |
double | Laxkit::getextent (LaxFont *font, const char *str, int len, double *ex, double *ey, double *fasc, double *fdes, char r) |
Find the text extent with the given font for the given utf8 text. | |
double | Laxkit::text_height () |
double | Laxkit::textout (aDrawable *win, const char *thetext, int len, double x, double y, unsigned long align) |
Write one line of utf8 text out with the default LaxFont. Uses foreground color only. | |
double | Laxkit::textout (aDrawable *win, LaxFont *font, const char *thetext, int len, double x, double y, unsigned long align) |
double | Laxkit::textout_matrix (aDrawable *win, double *m, const char *thetext, int len, double x, double y, unsigned long align) |
double | Laxkit::textout_rotated (aDrawable *win, double radians, const char *thetext, int len, double x, double y, unsigned long align) |
double | Laxkit::textout_rotated (aDrawable *win, LaxFont *font, double radians, const char *thetext, int len, double x, double y, unsigned long align) |
double | Laxkit::textout_multiline (aDrawable *win, const char *thetext, int len, double x, double y, unsigned long align) |
Write out possibly many lines of text. Each line delimited with a ' '. | |
void | Laxkit::get_placement (LaxImage *image, const char *label, int gap, unsigned int how, int *w, int *h, int *tx, int *ty, int *ix, int *iy) |
Figure out the extent and placement of an image and a label. | |
void | Laxkit::get_placement (int thingw, int thingh, const char *label, int gap, unsigned int how, int *w, int *h, int *tx, int *ty, int *ix, int *iy) |
Figure out how to place a box with dimensions thingw,thingh next to a text label. |
Variables | |
NewDisplayerFunc | Laxkit::newDisplayer = NULL |
The default Displayer "constructor". | |
static Displayer * | Laxkit::dp = NULL |
There can be only one (default displayer). | |
static unsigned long | Laxkit::default_bg_color = 0 |
static unsigned long | Laxkit::default_fg_color = 0 |
static unsigned int | Laxkit::red_shift = 0 |
static unsigned int | Laxkit::green_shift = 8 |
static unsigned int | Laxkit::blue_shift = 16 |
static unsigned int | Laxkit::alpha_shift = 24 |
static unsigned int | Laxkit::red_mask = 0xff |
static unsigned int | Laxkit::green_mask = 0xff00 |
static unsigned int | Laxkit::blue_mask = 0xff0000 |
static unsigned int | Laxkit::alpha_mask = 0xff000000 |
static unsigned int | Laxkit::red_size = 256 |
static unsigned int | Laxkit::green_size = 256 |
static unsigned int | Laxkit::blue_size = 256 |
static unsigned int | Laxkit::alpha_size = 256 |
static unsigned int | Laxkit::color_size = 256 |
This is a bunch of commonly used functions for things like (primitive and limited) image loading, drawing a bevel around a rectangle, and writing text on the screen.
Various common things that draw_thing() can draw simply.
void Laxkit::clear_window | ( | anXWindow * | win | ) |
Clear the window area.
Just call dp->ClearWindow() after dp->MakeCurrent(win).
References Laxkit::Displayer::ClearWindow(), Laxkit::dp, and Laxkit::Displayer::MakeCurrent().
Referenced by Laxkit::ProgressBar::Drawbar(), Laxkit::ToolTip::Refresh(), Laxkit::NumSlider::Refresh(), Laxkit::PanPopup::Refresh(), Laxkit::FilePreviewer::Refresh(), Laxkit::TextXEditBaseUtf8::Refresh(), Laxkit::SliderPopup::Refresh(), Laxkit::LineInput::Refresh(), Laxkit::Scroller::Refresh(), Laxkit::PanWindow::Refresh(), Laxkit::MenuSelector::Refresh(), and Laxkit::TreeSelector::Refresh().
unsigned long Laxkit::coloravg | ( | unsigned long | a, |
unsigned long | b, | ||
float | r | ||
) |
Return a scaled average of 2 colors. Returns equivalent of a*(1-r) + b*r.
default is straight average (r=1/2).
References Laxkit::colorrgb(), and Laxkit::rgbcolor().
Decompose a pixel color into separate red, green, and blue components.
Does not check for NULL r, g, or b.
Referenced by Laxkit::coloravg(), Laxkit::foreground_color(), Laxkit::DisplayerCairo::NewBG(), Laxkit::DisplayerCairo::NewFG(), and Laxkit::DisplayerXlib::textout_line().
void Laxkit::draw_bevel | ( | aDrawable * | win, |
int | bevel, | ||
unsigned long | highlight, | ||
unsigned long | shadow, | ||
int | state, | ||
double | x, | ||
double | y, | ||
double | w, | ||
double | h | ||
) |
Draw a bevel with bevel thickness within x,y,w,h. Draws state== LAX_OFF=not pressed, LAX_ON=pressed.
Specifically, this bevels inside the bounds x,y,w,h [x,x+w) and [y,y+h).
highlight and shadow are xlib colors.
References Laxkit::dp, Laxkit::Displayer::drawlines(), Laxkit::Displayer::MakeCurrent(), and Laxkit::Displayer::NewFG().
Referenced by Laxkit::Button::draw(), Laxkit::IconSelector::drawbox(), and Laxkit::SplitWindow::Refresh().
Draw a line connecting the dots in p.
If isclosed, then make sure that the final point connects to the initial point.
References Laxkit::dp, Laxkit::Displayer::drawlines(), and Laxkit::Displayer::MakeCurrent().
Referenced by Laxkit::MenuSelector::drawsubindicator(), and Laxkit::PanPopup::Refresh().
int Laxkit::draw_thing | ( | aDrawable * | win, |
double | x, | ||
double | y, | ||
double | rx, | ||
double | ry, | ||
int | fill, | ||
DrawThingTypes | thing | ||
) |
Draw a little graphic with current foreground and line width.
Return 1 for drawn, 0 for unknown thing.
bounding box is x:[x-rx,x+rx], y:[y-ry,y+ry].
If fill==0, then only the outline is drawn. If fill==1, then the outline is with the current foreground, and the thing is filled also with the current foreground. If fill==2, then the outline is with the current foreground, and the thing is filled with a background bg.
thing is any of the DrawThingTypes enum, particularly:
circle
square
diamond
triangle pointing up
triangle pointing down
triangle pointing right
triangle pointing left
+
x
*
circle with + in it
circle with x in it
References Laxkit::dp, Laxkit::Displayer::drawthing(), and Laxkit::Displayer::MakeCurrent().
Referenced by Laxkit::Button::draw(), Laxkit::SliderPopup::drawarrow(), Laxkit::MenuSelector::drawarrow(), Laxkit::TreeSelector::drawarrow(), Laxkit::Scroller::drawarrows(), Laxkit::NumSlider::Refresh(), and Laxkit::FilePreviewer::Refresh().
int Laxkit::draw_thing | ( | aDrawable * | win, |
double | x, | ||
double | y, | ||
double | rx, | ||
double | ry, | ||
DrawThingTypes | thing, | ||
unsigned long | fg, | ||
unsigned long | bg, | ||
int | lwidth | ||
) |
Draw a thing with outline color fg, and insides color bg.
See the other draw_thing() for the meaning of thing. The default foreground and background colors will be fg and bg after this function is called. This essentially just sets new line width, foreground and background colors, and calls the other draw_thing() with fill=2.
Return 1 for thing drawn, or 0 for unknown thing.
References Laxkit::dp, Laxkit::Displayer::drawthing(), and Laxkit::Displayer::MakeCurrent().
flatpoint * Laxkit::draw_thing_coordinates | ( | DrawThingTypes | thing, |
flatpoint * | buffer, | ||
int | buffer_size, | ||
int * | n_ret, | ||
double | scale, | ||
DoubleBBox * | bounds | ||
) |
Get coordinates for various graphical things. Coordinates are in a square bound by x=[0..scale], y=[0..scale].
This returns points describing one or more closed paths for things like arrows, double arrows, squares, etc.
If buffer==NULL and buffer_size<0, then a new flatpoint[] is returned with the coordinates, and n_ret gets how many points there are.
If buffer==NULL and buffer_size>=0, then ONLY return in n_ret how many points need to be in a buffer. NULL will be the function return value.
If buffer!=NULL, then it is assumed that there are buffer_size elements in buffer. If the coordinates will take more than buffer_size, then NULL is returned, and n_ret is set to how many elements the buffer must have. Otherwise, the points are put in buffer (which is also the return value), and the actual number of points is returned in n_ret.
Points returned may be composed of either straight or bezier segments. Each path may be either totally bezier based, with c-v-c - c-v-c..., or merely a list of vertex points.
You can draw the returned points with, for instance Displayer::drawbez() or Displayer::drawlines().
For points returned, their info values have special meanings.
Paths are defined clockwise, except that holes in paths are defined counter clockwise.
References Laxkit::bez_circle(), Laxkit::THING_Circle_Plus, Laxkit::THING_Circle_X, Laxkit::THING_Diamond, Laxkit::THING_Double_Arrow_Horizontal, Laxkit::THING_Double_Triangle_Left, Laxkit::THING_Eject, and Laxkit::THING_Pan_Arrows.
Referenced by Laxkit::Displayer::drawthing().
LaxCompositeOp Laxkit::drawing_function | ( | LaxCompositeOp | mode | ) |
Uses XSetFunction, with, for instance, xlib values GXinvert or GXcopy.
References Laxkit::Displayer::BlendMode(), and Laxkit::dp.
Referenced by Laxkit::TextXEditBaseUtf8::docaret(), Laxkit::ColorSliders::DrawHorizontal(), Laxkit::SplitWindow::drawmovemarks(), Laxkit::SplitWindow::drawsplitmarks(), Laxkit::PanPopup::Refresh(), Laxkit::Scroller::Refresh(), Laxkit::PanWindow::Refresh(), Laxkit::RulerWindow::Refresh(), and Laxkit::SplitWindow::Refresh().
unsigned long Laxkit::foreground_color | ( | unsigned long | newcolor | ) |
Set the new default foreground color.
Returns the old foreground color.
References Laxkit::colorrgb(), Laxkit::dp, and Laxkit::Displayer::NewFG().
void Laxkit::get_placement | ( | LaxImage * | image, |
const char * | label, | ||
int | gap, | ||
unsigned int | how, | ||
int * | w, | ||
int * | h, | ||
int * | tx, | ||
int * | ty, | ||
int * | ix, | ||
int * | iy | ||
) |
Figure out the extent and placement of an image and a label.
This lays out a text label (IBUT_TEXT_ONLY), an icon (IBUT_ICON_ONLY), an icon then horizontally a label (IBUT_ICON_TEXT), or label then icon (IBUT_TEXT_ICON). gap goes between the icon and label if both are used.
If IBUT_ICON_ONLY is requested, but the image is not available, then the text is used instead. If neither is available, or if IBUT_TEXT_ONLY and the text is not available, then use neither.
If either the image or the text are not used, then LAX_WAY_OFF (==-10000) is returned for their x values.
This function assumes a utf8 label, using app->defaultfont->font
References Laxkit::getextent(), Laxkit::LaxImage::h(), and Laxkit::LaxImage::w().
Referenced by Laxkit::IconSelector::drawbox(), Laxkit::SliderPopup::Refresh(), Laxkit::Button::WrapToExtent(), and Laxkit::SliderPopup::WrapToExtent().
void Laxkit::get_placement | ( | int | thingw, |
int | thingh, | ||
const char * | label, | ||
int | gap, | ||
unsigned int | how, | ||
int * | w, | ||
int * | h, | ||
int * | tx, | ||
int * | ty, | ||
int * | ix, | ||
int * | iy | ||
) |
Figure out how to place a box with dimensions thingw,thingh next to a text label.
See the other get_placement() for info about how.
References Laxkit::getextent().
Displayer * Laxkit::GetDefaultDisplayer | ( | ) |
Creates if not existing.
References Laxkit::dp, Laxkit::newDisplayer, and Laxkit::SetNewDisplayerFunc().
Referenced by Laxkit::anXApp::destroywindow(), Laxkit::anXApp::initX(), Laxkit::anXWindow::MakeCurrent(), and Laxkit::CurveWindow::SetupRect().
double Laxkit::getextent | ( | const char * | str, |
int | len, | ||
double * | ex, | ||
double * | ey, | ||
double * | fasc, | ||
double * | fdes, | ||
char | r | ||
) |
Find the text extent with the default font for the given utf8 text.
If len<0, then use strlen(str). len is number of bytes, not number of utf8 characters.
fasc,fdes are for font, not for actual visual text bounds. r=1 means use visual (r for real) ascent/descent rather than that for font.
Returns the x advance. The actual width is put in ex.
r doesn't work any more. returns height, but not sure how to get actual visual ascent and descent!
this is a little messy with mixup between advance and extent.
Referenced by Laxkit::TextXEditBaseUtf8::charwidth(), Laxkit::CheckBox::CheckBox(), Laxkit::Button::draw(), Laxkit::TreeSelector::drawsep(), Laxkit::MenuSelector::drawsep(), Laxkit::RulerWindow::drawtext(), Laxkit::TextXEditBaseUtf8::ExtentAndStr(), Laxkit::IconSelector::FillBox(), Laxkit::TreeSelector::findmaxwidth(), Laxkit::MenuSelector::findmaxwidth(), Laxkit::get_placement(), Laxkit::TextXEditBaseUtf8::GetExtent(), Laxkit::TreeSelector::getitemextent(), Laxkit::MenuSelector::getitemextent(), Laxkit::TextXEditBaseUtf8::GetPos(), Laxkit::LineInput::LineInput(), Laxkit::FilePreviewer::Refresh(), Laxkit::Button::SetGraphic(), Laxkit::LineInput::SetPlacement(), Laxkit::MessageBar::SetupMetrics(), Laxkit::ToolTip::ToolTip(), Laxkit::ColorSliders::updateSliderRect(), and Laxkit::NumSlider::wraptoextent().
double Laxkit::getextent | ( | LaxFont * | font, |
const char * | str, | ||
int | len, | ||
double * | ex, | ||
double * | ey, | ||
double * | fasc, | ||
double * | fdes, | ||
char | r | ||
) |
Find the text extent with the given font for the given utf8 text.
If font==NULL, then use the default font.
If len<0, then use strlen(str). len is number of bytes, not number of utf8 characters.
fasc,fdes are for font, not for actual visual text bounds. r=1 means use visual (r for real) ascent/descent rather than that for font.
Returns the x advance. The actual width is put in ex.
r doesn't work any more. returns height, but not sure how to get actual visual ascent and descent!
this is a little messy with mixup between advance and extent.
References Laxkit::dp, and Laxkit::Displayer::textextent().
Return whether the mouse is within the bounds of win.
If mouse_id==0, then find for a default mouse.
References Laxkit::mouseposition().
int Laxkit::mouseposition | ( | int | mouse_id, |
anXWindow * | win, | ||
int * | x, | ||
int * | y, | ||
unsigned int * | state, | ||
anXWindow ** | child, | ||
int * | screen | ||
) |
Find the mouse x,y in win coordinates, also return the pointer mask, and what child it is in if any.
If win==NULL, find coords on the whole screen. Passing NULL for x, y, state, or child is ok.
This will return coordinates in win space even if the mouse is not in that window. If child!=NULL, then assign it to the anXWindow that is a direct child of win that contains the pointer *** is that right??.
Please note that if the mouse is on a different screen, the results are meaningless, and 1 is returned, and none of the variables are modified.
On success, 0 is returned. Nonzero for error.
If mouse_id==0, then find for a default mouse.
References Laxkit::anXWindow::win_on.
Referenced by Laxkit::PanWindow::centerOnMouse(), Laxkit::SplitWindow::CharInput(), LaxInterfaces::ViewportWindow::CharInput(), Laxkit::PopupMenu::Idle(), Laxkit::mouseisin(), Laxkit::NumSlider::Refresh(), Laxkit::RulerWindow::Refresh(), Laxkit::screen_color_at_mouse(), Laxkit::ToolTip::ToolTip(), Laxkit::RulerWindow::Track(), and Laxkit::MenuSelector::WrapToMouse().
unsigned long Laxkit::screen_color_at_mouse | ( | int | mouse_id | ) |
Return the screen pixel color underneath the mouse.
If mouse_id==0, then get color under a default mouse.
References Laxkit::mouseposition().
void Laxkit::set_color_shift_info | ( | unsigned int | rm, |
unsigned int | gm, | ||
unsigned int | bm, | ||
unsigned int | am | ||
) |
Set up how to pack colors within a 32 bit location.
This exists to set the proper info to make rgbcolor() and colorrgb() work as expected. This is necessary on very limited displays where Xlib core colors are defined by different levels of masking and shifting. for instance, sometimes pixel colors are defined by rgb in 5-6-5 bits, and not 8 bits per channel.
If am==0, then use the remaining unused bits after the rgb for the alpha bits.
Referenced by Laxkit::anXApp::initNoX(), and Laxkit::anXApp::initX().
int Laxkit::SetDefaultDisplayer | ( | Displayer * | displayer | ) |
Set the default Displayer, incrementing its count.
Passing NULL will decrement the default, and set default to NULL. This can be used in anXApp::close(), for instance.
References Laxkit::anObject::dec_count(), Laxkit::dp, and Laxkit::anObject::inc_count().
Referenced by Laxkit::anXApp::close().
Set the default "constructor" for Displayer objects.
If func==NULL, then use the default, checks for cairo, then for xlib. Return 0 for success, or 1 for unable to set to non-null.
References Laxkit::newDisplayer.
Referenced by Laxkit::GetDefaultDisplayer().
double Laxkit::textout | ( | aDrawable * | win, |
const char * | thetext, | ||
int | len, | ||
double | x, | ||
double | y, | ||
unsigned long | align | ||
) |
Write one line of utf8 text out with the default LaxFont. Uses foreground color only.
Defaults to center alignment. align can be set to some or'd combination of LAX_LEFT, LAX_HCENTER, LAX_RIGHT, LAX_TOP, LAX_VCENTER, LAX_BASELINE, LAX_BOTTOM. Note that LAX_CENTER is the same as LAX_HCENTER|LAX_VCENTER. These center, right, baseline, etc. are relative to the given x and y coordinates.
Writes the first len bytes of thetext. If len is equal to zero, nothing is drawn. If len is less than 0, then strlen(thetext) is used.
Returns the pixel length of the string.
does Xft handle right to left rendering?
this is in serious hack stage. need some way to reasonably define the font and color to use
Referenced by Laxkit::Button::draw(), Laxkit::IconSelector::drawbox(), Laxkit::ColorSliders::DrawHorizontal(), Laxkit::TreeSelector::drawitemname(), Laxkit::MenuSelector::drawitemname(), Laxkit::TreeSelector::drawsep(), Laxkit::MenuSelector::drawsep(), Laxkit::RulerWindow::drawtext(), Laxkit::TreeSelector::drawtitle(), Laxkit::MenuSelector::drawtitle(), Laxkit::NumSlider::Refresh(), Laxkit::FilePreviewer::Refresh(), Laxkit::ShortcutTreeSelector::Refresh(), Laxkit::SliderPopup::Refresh(), Laxkit::LineInput::Refresh(), Laxkit::SplitWindow::Refresh(), Laxkit::TreeSelector::Refresh(), and Laxkit::TextXEditBaseUtf8::TextOut().
int Laxkit::translate_window_coordinates | ( | anXWindow * | from, |
int | x, | ||
int | y, | ||
anXWindow * | to, | ||
int * | xx, | ||
int * | yy, | ||
anXWindow ** | kid | ||
) |
Return 1 if windows are on different screens, or 0 for success. If from or to is NULL (but not both), then assume you want the root window of whichever is not null.
If both are NULL, then just pass x,y to xx,yy.
If kid!=NULL, then grab the pointer to the child window of to that contains the coordinates. If the app does not know of any such window, then fill with NULL.
Referenced by Laxkit::anXApp::checkOutClicks(), and Laxkit::RulerWindow::TrackThisWindow().