1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
includefile(include/header)
COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::Xpointer)(3bobcat)(_CurYrs_)(libbobcat-dev__CurVers_)
(Sets the X-pointer)
manpagename(FBB::Xpointer)(Sets the location of the X-windows pointer)
manpagesynopsis()
bf(#include <bobcat/xpointer>)nl()
Linking option: tt(-lbobcat -lX11)
manpagedescription()
This class allows programs running within the X-graphical environment to
set and retrieve the X-windows pointer location.
includefile(include/namespace)
manpagesection(INHERITS FROM)
-
manpagesection(CONSTRUCTORS)
itemization(
itb(Xpointer())
The default constructor. Connects to the Display. throws an
bf(Exception) exception if the display cannot be opened. With multiple
bf(Xpointer) objects, the connection to the display is opened only once.
This constructor throws an tt(Exception) exception if it could not
connect to the Display.
)
Copy and move constructors (and assignment operators) are available.
manpagesection(MEMBER FUNCTIONS)
itemization(
itb(bool get(int *x, int *y) const)
Returns in its arguments the currnet pointer coordinates relative to
the root-window. On success tt(true) is returned; tt(false) is returned if the
pointer could not be moved.
itb(bool set(int x, int y) const)
Sets the pointer to a location whose pixel coordinates are given with
respect to the root-window. A negative x-coordinate is measured from the
right screen-margin of the root window (going left), a negative y-coordinate
is measured from the bottom screen-margin of the root window (going up). On
success tt(true) is returned; tt(false) is returned if the pointer could not
be moved.
)
manpagesection(EXAMPLE)
verb(
#include <iostream>
#include <string>
#include <bobcat/xpointer>
using namespace FBB;
int main()
try
{
Xpointer xpointer;
xpointer.verify();
if (!xpointer.set(100, 200))
throw string("Set pointer failed");
int x;
int y;
if (!xpointer.get(&x, &y))
throw string("Get pointer failed");
cout << "Pointer now at " << x << ", " << y << '\n';
}
catch (string msg)
{
cout << msg << '\n';
return 1;
}
)
manpagefiles()
em(bobcat/xpointer) - defines the class interface
manpageseealso()
bf(bobcat)(7)
manpagebugs()
Note that tt(-lX11) must be specified as well.
includefile(include/trailer)
|