gtk-stream 0.5__tar.gz → 0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gtk_stream-0.5 → gtk_stream-0.6}/PKG-INFO +3 -2
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/application.py +1 -1
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/__init__.py +1 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Document.py +1 -1
- gtk_stream-0.6/gtk_stream/documents/classes/Stack.py +11 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Switch.py +1 -1
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/parser.py +2 -1
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/properties.py +16 -10
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream.egg-info/PKG-INFO +3 -2
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream.egg-info/SOURCES.txt +1 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/pyproject.toml +3 -2
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/__init__.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/command_line.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/common.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Box.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Button.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Dropdown.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Frame.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Grid.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Label.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Paned.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Picture.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/ProgressBar.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/ScrolledWindow.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/Separator.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream/documents/classes/__init__.py +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream.egg-info/dependency_links.txt +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream.egg-info/entry_points.txt +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream.egg-info/requires.txt +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/gtk_stream.egg-info/top_level.txt +0 -0
- {gtk_stream-0.5 → gtk_stream-0.6}/setup.cfg +0 -0
@@ -1,9 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: gtk-stream
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6
|
4
4
|
Summary: A simple stream-oriented GUI protocol
|
5
5
|
Author-email: Marc Coiffier <marc.coiffier@univ-grenoble-alpes.fr>
|
6
|
-
Project-URL: Homepage, https://
|
6
|
+
Project-URL: Homepage, https://coiffier.net/projects/gtk-stream/
|
7
|
+
Project-URL: Source, https://coiffier.net/projects/gtk-stream/code/
|
7
8
|
Classifier: Development Status :: 4 - Beta
|
8
9
|
Classifier: Intended Audience :: Developers
|
9
10
|
Classifier: Environment :: X11 Applications :: GTK
|
@@ -81,5 +81,5 @@ class GtkStreamApp(Gtk.Application):
|
|
81
81
|
def setProp(self, id, name, value):
|
82
82
|
def cb():
|
83
83
|
w = self.namedWidgets[id]
|
84
|
-
w.set_property(name, parse_property(get_prop_type(w.__class__, name), value))
|
84
|
+
w.set_property(name, parse_property(get_prop_type(w.__class__, name), value)(self))
|
85
85
|
self.run_when_idle(cb)
|
@@ -18,7 +18,7 @@ class Document:
|
|
18
18
|
self.app.nameWidget(self.id, w)
|
19
19
|
for (p,v) in self.props.items():
|
20
20
|
# print(f"Setting property '{p}' to '{v}' in widget {self.__class__}", file=sys.stderr)
|
21
|
-
w.set_property(p, v)
|
21
|
+
w.set_property(p, v(self.app))
|
22
22
|
w.insert_child = lambda d: self.insert_child(w, d)
|
23
23
|
def render(self):
|
24
24
|
w = self.render_raw()
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from ... import Gtk
|
2
|
+
from .. import Document, PseudoDocument
|
3
|
+
|
4
|
+
class Stack(Document):
|
5
|
+
__g_class__ = Gtk.Stack
|
6
|
+
def __init__(self, app, **kwargs):
|
7
|
+
super().__init__(app, **kwargs)
|
8
|
+
def render_raw(self):
|
9
|
+
return Gtk.Stack()
|
10
|
+
def insert_child(self, w, d):
|
11
|
+
w.add_child(d.render())
|
@@ -7,7 +7,7 @@ class Switch(Document):
|
|
7
7
|
__g_class__ = Gtk.Switch
|
8
8
|
def __init__(self, app, id, managed = "false", **kwargs):
|
9
9
|
super().__init__(app, id=id, **kwargs)
|
10
|
-
self.managed = parse_property('gboolean', managed)
|
10
|
+
self.managed = parse_property('gboolean', managed)(app)
|
11
11
|
def render_raw(self):
|
12
12
|
ret = Gtk.Switch()
|
13
13
|
ret.connect('state-set', printEvent('switch', self.id,
|
@@ -28,7 +28,8 @@ WIDGET_DOCUMENTS = {
|
|
28
28
|
'switch' : docs.Switch,
|
29
29
|
'picture' : docs.Picture,
|
30
30
|
'separator' : docs.Separator,
|
31
|
-
'scrolled-window' : docs.ScrolledWindow
|
31
|
+
'scrolled-window' : docs.ScrolledWindow,
|
32
|
+
'stack' : docs.Stack
|
32
33
|
}
|
33
34
|
|
34
35
|
class GtkStreamXMLHandler(sax.ContentHandler):
|
@@ -2,24 +2,28 @@ import sys
|
|
2
2
|
|
3
3
|
from . import Gtk
|
4
4
|
|
5
|
+
def _const(x):
|
6
|
+
return lambda _: x
|
5
7
|
def _parse_orientation_property(val):
|
6
|
-
return (Gtk.Orientation.HORIZONTAL) if val == "horizontal" else (Gtk.Orientation.VERTICAL)
|
8
|
+
return _const((Gtk.Orientation.HORIZONTAL) if val == "horizontal" else (Gtk.Orientation.VERTICAL))
|
7
9
|
def _parse_boolean_property(val):
|
8
|
-
return True if val == "true" else False
|
10
|
+
return _const(True if val == "true" else False)
|
9
11
|
def _parse_float_property(val):
|
10
|
-
return float(val)
|
12
|
+
return _const(float(val))
|
11
13
|
def _parse_int_property(val):
|
12
|
-
return int(val)
|
14
|
+
return _const(int(val))
|
13
15
|
def _parse_searchMode_property(val):
|
14
16
|
match val:
|
15
17
|
case 'exact':
|
16
|
-
return Gtk.StringFilterMatchMode.EXACT
|
18
|
+
return _const(Gtk.StringFilterMatchMode.EXACT)
|
17
19
|
case 'substring':
|
18
|
-
return Gtk.StringFilterMatchMode.SUBSTRING
|
20
|
+
return _const(Gtk.StringFilterMatchMode.SUBSTRING)
|
19
21
|
case _:
|
20
|
-
return Gtk.StringFilterMatchMode.PREFIX
|
22
|
+
return _const(Gtk.StringFilterMatchMode.PREFIX)
|
21
23
|
def _parse_css_classes_property(val):
|
22
|
-
return val.split()
|
24
|
+
return _const(val.split())
|
25
|
+
def _parse_widget_property(val):
|
26
|
+
return lambda app: app.namedWidgets[val]
|
23
27
|
|
24
28
|
_PARSE_TYPE_PROPERTY = {
|
25
29
|
'GStrv' : _parse_css_classes_property,
|
@@ -28,11 +32,13 @@ _PARSE_TYPE_PROPERTY = {
|
|
28
32
|
'gfloat' : _parse_float_property,
|
29
33
|
'gint' : _parse_int_property,
|
30
34
|
'gboolean' : _parse_boolean_property,
|
31
|
-
'GtkStringFilterMatchMode' : _parse_searchMode_property
|
35
|
+
'GtkStringFilterMatchMode' : _parse_searchMode_property,
|
36
|
+
'GtkWidget' : _parse_widget_property,
|
37
|
+
'gchararray' : _const,
|
32
38
|
}
|
33
39
|
|
34
40
|
def parse_property(prop_type, val):
|
35
41
|
# print(f"Parsing property '{val}' of type '{prop_type}'", file=sys.stderr)
|
36
|
-
return _PARSE_TYPE_PROPERTY
|
42
|
+
return _PARSE_TYPE_PROPERTY[prop_type](val)
|
37
43
|
def get_prop_type(klass, prop):
|
38
44
|
return klass.find_property(prop).value_type.name
|
@@ -1,9 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: gtk-stream
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6
|
4
4
|
Summary: A simple stream-oriented GUI protocol
|
5
5
|
Author-email: Marc Coiffier <marc.coiffier@univ-grenoble-alpes.fr>
|
6
|
-
Project-URL: Homepage, https://
|
6
|
+
Project-URL: Homepage, https://coiffier.net/projects/gtk-stream/
|
7
|
+
Project-URL: Source, https://coiffier.net/projects/gtk-stream/code/
|
7
8
|
Classifier: Development Status :: 4 - Beta
|
8
9
|
Classifier: Intended Audience :: Developers
|
9
10
|
Classifier: Environment :: X11 Applications :: GTK
|
@@ -24,5 +24,6 @@ gtk_stream/documents/classes/Picture.py
|
|
24
24
|
gtk_stream/documents/classes/ProgressBar.py
|
25
25
|
gtk_stream/documents/classes/ScrolledWindow.py
|
26
26
|
gtk_stream/documents/classes/Separator.py
|
27
|
+
gtk_stream/documents/classes/Stack.py
|
27
28
|
gtk_stream/documents/classes/Switch.py
|
28
29
|
gtk_stream/documents/classes/__init__.py
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "gtk-stream"
|
7
|
-
version = "0.
|
7
|
+
version = "0.6"
|
8
8
|
description = "A simple stream-oriented GUI protocol"
|
9
9
|
authors = [
|
10
10
|
{ name = "Marc Coiffier", email = "marc.coiffier@univ-grenoble-alpes.fr" }
|
@@ -20,7 +20,8 @@ classifiers = [
|
|
20
20
|
]
|
21
21
|
|
22
22
|
[project.urls]
|
23
|
-
Homepage = "https://
|
23
|
+
Homepage = "https://coiffier.net/projects/gtk-stream/"
|
24
|
+
Source = "https://coiffier.net/projects/gtk-stream/code/"
|
24
25
|
|
25
26
|
[project.scripts]
|
26
27
|
gtk-stream = "gtk_stream.command_line:main"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|