Source Code Layout
Summary
The source code is divided into the following packages, all are sub-packages of the the overall 'winswitch
' package:
ROOT
: the root package contains the build scripts, copyright and release noteswinswitch
: the root package contains constants, build information and other global attributeswinswitch.client
: contains the classes needed for implementing clients, including the appletwinswitch.fs
: filesystem support classes for both clients and servers (currently justNFS
andSMB
)winswitch.net
: networking utility classes:mDNS
, local socket connections, general network protocol, etcwinswitch.objects
: the objects representing servers, users, sessions, settings, mount points, etcwinswitch.server
: classes for implementing servers, including server-side session utility wrapperswinswitch.sound
: everything related to sound supportwinswitch.twisted
: twisted enhancements required for supporting hidden shell processes withTwisted
on MS Windowswinswitch.ui
: all the user interface classes: utility classes, configuration dialogs and operating system specific code for desktop interactionwinswitch.util
: generic utility classes: key management, encryption, authentication, file handling, logging, desktop menu integration, etcwinswitch.virt
: virtualization classes: both client and server support classes for all the underlying protocols supported (NX, Xpra, VNC,...)
Server Link
The ServerLink
class is central to the whole system on the client side.
It represents the link to a server instance, including SSH tunnels if needed.
It is a lower level utility class, as such it does not depend on any user interface classes or functions, these must be injected by any classes using it from a context that requires user interaction. If these are not set, the functionality will simply be disabled. This is done by setting:
message_handler(ServerConfig, title, text, type)
: this will be used for event notificationsquestion_handler(title, text, nok_callback, ok_callback, password, buttons, icon, UUID)
: this is used for asking the user for confirmation, keys, passphrases etc.cancel_question(UUID)
: this is used for cancelling a question when it becomes irrelevant
question_handler
and cancel_question
uses the DialogUtil
class documented below.
The most commonly used public methods on this class are:
stop()
: log outs from the server and disconnectskick()
: tries to re-connect to the server
Dialog Util
TheDialogUtil
class provides utility functions for interacting with the
user via dialogs.
The public functions are:
ask(title, text, cancel_callback, ok_callback, password=False, buttons=None, icon=None, UUID=None)
: implements a simple dialog window which can be used to ask the user generic questions and may include a password field. The UUID can be used to ensure that the same dialog is now shown multiple times and that it can be cancelled.cancel_ask(UUID)
: is used to cancel an existing dialog
Clients
TheClientBase
is the base class for implementing clients.
It does not depend on any user interface components but defines some no-op functions that the
Applet
subclass implements using
the DialogUtil
class documented above.