![]() |
Deskflow 1.27.0.8
Keyboard and mouse sharing utility
|
#include <Config.h>
Classes | |
| class | CellEdge |
| class | const_iterator |
Public Types | |
| using | ScreenOptions = std::map<OptionID, OptionValue> |
| using | Interval = std::pair<float, float> |
| using | link_const_iterator = Cell::const_iterator |
| using | internal_const_iterator = CellMap::const_iterator |
| using | all_const_iterator = NameMap::const_iterator |
Public Member Functions | |
| Config (IEventQueue *events) | |
| virtual | ~Config ()=default |
manipulators | |
| bool | addComputer (const std::string &name) |
| Add computer. | |
| bool | addAlias (const std::string &canonical, const std::string &alias) |
| Add alias. | |
| bool | connect (const std::string &srcName, Direction srcSide, float srcStart, float srcEnd, const std::string &dstName, float dstStart, float dstEnd) |
| Connect computers. | |
| bool | disconnect (const std::string &srcName, Direction srcSide) |
| Disconnect computers. | |
| bool | disconnect (const std::string &srcName, Direction srcSide, float position) |
| Disconnect computers. | |
| void | setDeskflowAddress (const NetworkAddress &) |
| Set server address. | |
| bool | addOption (const std::string &name, OptionID option, OptionValue value) |
| Add a computer option. | |
| virtual InputFilter * | getInputFilter () |
| Get the hot key input filter. | |
accessors | |
| bool | isValidComputerName (const std::string &name) const |
| Test computer name validity. | |
| const_iterator | begin () const |
| Get beginning (canonical) computer name iterator. | |
| const_iterator | end () const |
| Get ending (canonical) computer name iterator. | |
| all_const_iterator | beginAll () const |
| Get beginning computer name iterator. | |
| all_const_iterator | endAll () const |
| Get ending computer name iterator. | |
| virtual bool | isComputer (const std::string &name) const |
| Test for computer name. | |
| bool | isCanonicalName (const std::string &name) const |
| Test for canonical computer name. | |
| std::string | getCanonicalName (const std::string &name) const |
| Get canonical name. | |
| std::string | getNeighbor (const std::string &, Direction, float position, float *positionOut) const |
| Get neighbor. | |
| bool | hasNeighbor (const std::string &, Direction) const |
| Check for neighbor. | |
| bool | hasNeighbor (const std::string &, Direction, float start, float end) const |
| Check for neighbor. | |
| link_const_iterator | beginNeighbor (const std::string &) const |
| Get beginning neighbor iterator. | |
| link_const_iterator | endNeighbor (const std::string &) const |
| Get ending neighbor iterator. | |
| const NetworkAddress & | getDeskflowAddress () const |
| Get the server address. | |
| const ScreenOptions * | getOptions (const std::string &name) const |
| Get the computer options. | |
| bool | hasLockToComputerAction () const |
| Check for lock to computer action. | |
| bool | operator== (const Config &) const |
| Compare configurations. | |
| void | read (ConfigReadContext &context) |
| Read configuration. | |
| std::istream & | operator>> (std::istream &s, Config &config) |
| Read configuration. | |
| std::ostream & | operator<< (std::ostream &s, const Config &config) |
| Write configuration. | |
| static const char * | dirName (Direction) |
| Get direction name. | |
| static std::string | formatInterval (const Interval &) |
| Get interval as string. | |
Server configuration.
This class holds server configuration information. That includes the names of computers and their aliases, the links between them, and network addresses.
Note that case is preserved in computer names but is ignored when comparing names. computer names and their aliases share a namespace and must be unique.
| using deskflow::server::Config::all_const_iterator = NameMap::const_iterator |
| using deskflow::server::Config::internal_const_iterator = CellMap::const_iterator |
| using deskflow::server::Config::Interval = std::pair<float, float> |
| using deskflow::server::Config::link_const_iterator = Cell::const_iterator |
| using deskflow::server::Config::ScreenOptions = std::map<OptionID, OptionValue> |
|
explicit |
|
virtualdefault |
| bool deskflow::server::Config::addAlias | ( | const std::string & | canonical, |
| const std::string & | alias ) |
Add alias.
Adds an alias for a computer name. An alias can be used any place the canonical computer name can (except addComputer()). Returns false if the alias name already exists or the canonical name is unknown, otherwise returns true.
| bool deskflow::server::Config::addComputer | ( | const std::string & | name | ) |
Add computer.
Adds a computer, returning true if successful. If a computer or alias with the given name exists then it fails.
| bool deskflow::server::Config::addOption | ( | const std::string & | name, |
| OptionID | option, | ||
| OptionValue | value ) |
Add a computer option.
Adds an option and its value to the named computer. Replaces the existing option's value if there is one. Returns true iff name is a known computer.
| Config::const_iterator deskflow::server::Config::begin | ( | ) | const |
Get beginning (canonical) computer name iterator.
| Config::all_const_iterator deskflow::server::Config::beginAll | ( | ) | const |
Get beginning computer name iterator.
| Config::link_const_iterator deskflow::server::Config::beginNeighbor | ( | const std::string & | srcName | ) | const |
Get beginning neighbor iterator.
| bool deskflow::server::Config::connect | ( | const std::string & | srcName, |
| Direction | srcSide, | ||
| float | srcStart, | ||
| float | srcEnd, | ||
| const std::string & | dstName, | ||
| float | dstStart, | ||
| float | dstEnd ) |
Connect computers.
Establishes a one-way connection between portions of opposite edges of two computers. Each portion is described by an interval defined by two numbers, the start and end of the interval half-open on the end. The numbers range from 0 to 1, inclusive, for the left/top to the right/bottom. The user will be able to jump from the srcStart to srcSend interval of srcSide of computer srcName to the opposite side of computer dstName in the interval dstStart and dstEnd when both computers are connected to the server and the user isn't locked to a computer. Returns false if srcName is unknown. srcStart must be less than or equal to srcEnd and dstStart must be less then or equal to dstEnd and all of srcStart, srcEnd, dstStart, or dstEnd must be inside the range [0,1].
|
static |
Get direction name.
Returns the name of a direction (for debugging).
| bool deskflow::server::Config::disconnect | ( | const std::string & | srcName, |
| Direction | srcSide ) |
Disconnect computers.
Removes all connections created by connect() on side srcSide. Returns false if srcName is unknown.
| bool deskflow::server::Config::disconnect | ( | const std::string & | srcName, |
| Direction | srcSide, | ||
| float | position ) |
Disconnect computers.
Removes the connections created by connect() on side srcSide covering position position. Returns false if srcName is unknown.
| Config::const_iterator deskflow::server::Config::end | ( | ) | const |
Get ending (canonical) computer name iterator.
| Config::all_const_iterator deskflow::server::Config::endAll | ( | ) | const |
Get ending computer name iterator.
| Config::link_const_iterator deskflow::server::Config::endNeighbor | ( | const std::string & | srcName | ) | const |
Get ending neighbor iterator.
|
static |
Get interval as string.
Returns an interval as a parseable string.
| std::string deskflow::server::Config::getCanonicalName | ( | const std::string & | name | ) | const |
Get canonical name.
Returns the canonical name of a computer or the empty string if the name is unknown. Returns the canonical name if one is given.
| const NetworkAddress & deskflow::server::Config::getDeskflowAddress | ( | ) | const |
Get the server address.
|
virtual |
Get the hot key input filter.
Returns the hot key input filter. Clients can modify hotkeys using that object.
| std::string deskflow::server::Config::getNeighbor | ( | const std::string & | srcName, |
| Direction | srcSide, | ||
| float | position, | ||
| float * | positionOut ) const |
Get neighbor.
Returns the canonical computer name of the neighbor in the given direction (set through connect()) at position position. Returns the empty string if there is no neighbor in that direction, otherwise saves the position on the neighbor in positionOut if it's not nullptr.
| const Config::ScreenOptions * deskflow::server::Config::getOptions | ( | const std::string & | name | ) | const |
Get the computer options.
Returns all the added options for the named computer. Returns nullptr if the computer is unknown and an empty collection if there are no options.
| bool deskflow::server::Config::hasLockToComputerAction | ( | ) | const |
Check for lock to computer action.
Returns true if this configuration has a lock to computer action. This is for backwards compatible support of ScrollLock locking.
| bool deskflow::server::Config::hasNeighbor | ( | const std::string & | srcName, |
| Direction | srcSide ) const |
Check for neighbor.
Returns true if the computer has a neighbor anywhere along the edge given by the direction.
| bool deskflow::server::Config::hasNeighbor | ( | const std::string & | srcName, |
| Direction | srcSide, | ||
| float | start, | ||
| float | end ) const |
Check for neighbor.
Returns true if the computer has a neighbor in the given range along the edge given by the direction.
| bool deskflow::server::Config::isCanonicalName | ( | const std::string & | name | ) | const |
Test for canonical computer name.
Returns true iff name is the canonical name of a computer.
|
virtual |
Test for computer name.
Returns true iff name names a computer.
| bool deskflow::server::Config::isValidComputerName | ( | const std::string & | name | ) | const |
Test computer name validity.
Returns true iff name is a valid computer name.
| bool deskflow::server::Config::operator== | ( | const Config & | x | ) | const |
Compare configurations.
| void deskflow::server::Config::read | ( | ConfigReadContext & | context | ) |
Read configuration.
Reads a configuration from a context. Throws ServerConfigReadException on error and context is unchanged.
| void deskflow::server::Config::setDeskflowAddress | ( | const NetworkAddress & | addr | ) |
Set server address.
Set the deskflow listen addresses. There is no default address so this must be called to run a server using this configuration.
|
friend |
Write configuration.
Writes a configuration to a stream.
|
friend |
Read configuration.
Reads a configuration from a stream. Throws ServerConfigReadException on error.