diff --git a/lib/mbs/framework/Guid.py b/lib/mbs/framework/Guid.py index 447e71f..cc5d09e 100644 --- a/lib/mbs/framework/Guid.py +++ b/lib/mbs/framework/Guid.py @@ -80,7 +80,7 @@ class Guid: guidBytes = [ myBytes[3], myBytes[2], myBytes[1], myBytes[0], myBytes[5], myBytes[4], myBytes[7], myBytes[6], myBytes[8], myBytes[9], myBytes[10], myBytes[11], myBytes[12], myBytes[13], myBytes[14], myBytes[15] ] - result.parsedGuid = Guid.fromBytes(guidBytes) + result.parsedGuid = Guid.from_bytes(guidBytes) return result """ diff --git a/lib/mbs/framework/desktop/DesktopApplication.py b/lib/mbs/framework/desktop/DesktopApplication.py new file mode 100644 index 0000000..d7d62a1 --- /dev/null +++ b/lib/mbs/framework/desktop/DesktopApplication.py @@ -0,0 +1,32 @@ +from ..Application import Application + +import gi +gi.require_version('Gtk', '3.0') + +from gi.repository import Gtk + +class DesktopApplication(Application): + + def __init__(self, application_id : str): + Application.__init__(self) + + self.app = Gtk.Application(application_id=application_id) + self.app.connect("activate", self.activate) + self.app.connect("startup", self.startup) + + def before_start_internal(self): + pass + + def before_stop_internal(self): + pass + + def _start_internal(self): + self.app.run() + + def _stop_internal(self): + exit(0) + + def activate(self, args): + pass + def startup(self, args): + pass \ No newline at end of file diff --git a/lib/mbs/framework/desktop/Window.py b/lib/mbs/framework/desktop/Window.py new file mode 100644 index 0000000..2d2fd36 --- /dev/null +++ b/lib/mbs/framework/desktop/Window.py @@ -0,0 +1,28 @@ +# Copyright (C) 2024 Michael Becker +# +# This file is part of framework-python. +# +# framework-python is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# framework-python is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with framework-python. If not, see . + +from gi.repository import Gtk + +class Window (Gtk.Window): + + def __init__(self, type=None): + super().__init__() + + self.connect("realize", self.on_realize) + + def on_realize(self, data): + pass \ No newline at end of file diff --git a/lib/mbs/framework/desktop/__init__.py b/lib/mbs/framework/desktop/__init__.py new file mode 100644 index 0000000..e816dea --- /dev/null +++ b/lib/mbs/framework/desktop/__init__.py @@ -0,0 +1,19 @@ +# Copyright (C) 2024 Michael Becker +# +# This file is part of framework-python. +# +# framework-python is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# framework-python is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with framework-python. If not, see . + +from .DesktopApplication import DesktopApplication +from .Window import Window \ No newline at end of file