updates and preliminary desktop implementation
This commit is contained in:
parent
e6a28a3b03
commit
a9d0b7d3a2
@ -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
|
||||
|
||||
"""
|
||||
|
||||
32
lib/mbs/framework/desktop/DesktopApplication.py
Normal file
32
lib/mbs/framework/desktop/DesktopApplication.py
Normal file
@ -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
|
||||
28
lib/mbs/framework/desktop/Window.py
Normal file
28
lib/mbs/framework/desktop/Window.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2024 Michael Becker <alcexhim@gmail.com>
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
19
lib/mbs/framework/desktop/__init__.py
Normal file
19
lib/mbs/framework/desktop/__init__.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Copyright (C) 2024 Michael Becker <alcexhim@gmail.com>
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
from .DesktopApplication import DesktopApplication
|
||||
from .Window import Window
|
||||
Loading…
x
Reference in New Issue
Block a user