Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* add window-server mixin
* move more info / server features to mixins

git-svn-id: https://xpra.org/svn/Xpra/trunk@18556 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 23, 2018
1 parent f518d53 commit 39b7fc7
Show file tree
Hide file tree
Showing 9 changed files with 354 additions and 321 deletions.
10 changes: 10 additions & 0 deletions src/xpra/server/mixins/audio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ def get_info(self, _proto):
return {}


def get_server_features(self, _source):
return {
"sound_sequence" : True, #legacy flag
"sound" : {
"ogg-latency-fix" : True,
"eos-sequence" : True,
},
}


def init_pulseaudio(self):
soundlog("init_pulseaudio() pulseaudio=%s, pulseaudio_command=%s", self.pulseaudio, self.pulseaudio_command)
if self.pulseaudio is False:
Expand Down
10 changes: 9 additions & 1 deletion src/xpra/server/mixins/display_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ def init(self, opts):


def get_info(self, _proto):
return {}
return {
"dpi" : {
"default" : self.default_dpi,
"value" : self.dpi,
"x" : self.xdpi,
"y" : self.ydpi,
},
"antialias" : self.antialias,
}


######################################################################
Expand Down
8 changes: 6 additions & 2 deletions src/xpra/server/mixins/encoding_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from xpra.log import Logger
log = Logger("encoding")

from xpra.codecs.loader import PREFERED_ENCODING_ORDER, PROBLEMATIC_ENCODINGS, load_codecs, get_codec, has_codec
from xpra.codecs.loader import PREFERED_ENCODING_ORDER, PROBLEMATIC_ENCODINGS, load_codecs, get_codec, has_codec, codec_versions
from xpra.codecs.video_helper import getVideoHelper, ALL_VIDEO_ENCODER_OPTIONS, ALL_CSC_MODULE_OPTIONS
from xpra.server.mixins.stub_server_mixin import StubServerMixin

Expand Down Expand Up @@ -56,6 +56,7 @@ def cleanup(self):

def get_server_features(self, _source=None):
return {
"auto-video-encoding" : True,
"change-quality" : True,
"change-min-quality" : True,
"change-speed" : True,
Expand All @@ -66,10 +67,13 @@ def get_server_features(self, _source=None):
}

def get_info(self, _proto):
return {
info = {
"encodings" : self.get_encoding_info(),
"video" : getVideoHelper().get_info(),
}
for k,v in codec_versions.items():
info.setdefault("encoding", {}).setdefault(k, {})["version"] = v
return info

def get_encoding_info(self):
return {
Expand Down
7 changes: 4 additions & 3 deletions src/xpra/server/mixins/fileprint_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ def threaded_setup(self):


def get_server_features(self, _source):
return {
"printer.attributes" : ("printer-info", "device-uri"),
}
f = self.file_transfer.get_file_transfer_features()
f["printer.attributes"] = ("printer-info", "device-uri")
f.update(self.file_transfer.get_file_transfer_features())
return f

def get_info(self, _proto):
d = {
Expand Down
12 changes: 6 additions & 6 deletions src/xpra/server/mixins/input_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ def get_info(self, _proto):
return {"keyboard" : self.get_keyboard_info()}


def get_server_features(self, source=None):
return {
"toggle_keyboard_sync" : True,
"input-devices" : self.input_devices,
}

def get_caps(self):
if not self.key_repeat:
return {}
Expand Down Expand Up @@ -370,12 +376,6 @@ def setup_input_devices(self):
pass


def get_server_features(self, source=None):
return {
"toggle_keyboard_sync" : True,
"input-devices" : self.input_devices,
}

def send_hello(self, server_source, root_w, root_h, key_repeat, server_cipher):
capabilities = self.make_hello(server_source)
if key_repeat:
Expand Down
1 change: 1 addition & 0 deletions src/xpra/server/mixins/networkstate_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def get_info(self, _source=None):

def get_server_features(self, _source):
return {
"connection-data" : True,
"network" : {
"bandwidth-limit-change" : True,
"bandwidth-limit" : self.bandwidth_limit or 0,
Expand Down
5 changes: 5 additions & 0 deletions src/xpra/server/mixins/notification_forwarder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def cleanup(self):
self.notifications_forwarder = None
thread.start_new_thread(nf.release, ())

def get_info(self, _source=None):
if not self.notifications_forwarder:
return {}
return {"notifications", self.notifications_forwarder.get_info()}

def get_server_features(self, _source=None):
return {
"notifications" : self.notifications,
Expand Down
Loading

0 comments on commit 39b7fc7

Please sign in to comment.