gtk-stream 0.2.2__py3-none-any.whl → 0.3__py3-none-any.whl
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/application.py +2 -2
- gtk_stream/documents/__init__.py +3 -3
- gtk_stream/documents/classes/Box.py +14 -3
- gtk_stream/documents/classes/Button.py +2 -2
- gtk_stream/documents/classes/Document.py +13 -4
- gtk_stream/documents/classes/Dropdown.py +1 -1
- gtk_stream/documents/classes/Frame.py +12 -9
- gtk_stream/documents/classes/Grid.py +3 -8
- gtk_stream/parser.py +7 -5
- {gtk_stream-0.2.2.dist-info → gtk_stream-0.3.dist-info}/METADATA +1 -1
- gtk_stream-0.3.dist-info/RECORD +23 -0
- gtk_stream-0.2.2.dist-info/RECORD +0 -23
- {gtk_stream-0.2.2.dist-info → gtk_stream-0.3.dist-info}/WHEEL +0 -0
- {gtk_stream-0.2.2.dist-info → gtk_stream-0.3.dist-info}/entry_points.txt +0 -0
- {gtk_stream-0.2.2.dist-info → gtk_stream-0.3.dist-info}/top_level.txt +0 -0
gtk_stream/application.py
CHANGED
@@ -70,11 +70,11 @@ class GtkStreamApp(Gtk.Application):
|
|
70
70
|
w = self.namedWidgets[id]
|
71
71
|
w.get_parent().remove(w)
|
72
72
|
self.run_when_idle(cb)
|
73
|
-
def
|
73
|
+
def insertWidget(self, to, document):
|
74
74
|
def cb():
|
75
75
|
if to in self.namedWidgets:
|
76
76
|
w = self.namedWidgets[to]
|
77
|
-
w.
|
77
|
+
w.insert_child(document)
|
78
78
|
else:
|
79
79
|
raise Exception(f"Error: unknown widget id '{to}'")
|
80
80
|
self.run_when_idle(cb)
|
gtk_stream/documents/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from .classes.Document import Document
|
1
|
+
from .classes.Document import Document, PseudoDocument
|
2
2
|
|
3
3
|
from .classes.Label import Label
|
4
4
|
from .classes.Button import Button, LinkButton
|
@@ -6,7 +6,7 @@ from .classes.ProgressBar import ProgressBar
|
|
6
6
|
from .classes.Dropdown import Dropdown, Item
|
7
7
|
from .classes.Switch import Switch
|
8
8
|
|
9
|
-
from .classes.Box import Box
|
9
|
+
from .classes.Box import Box, BoxPrepend
|
10
10
|
from .classes.Paned import Paned
|
11
|
-
from .classes.Frame import Frame
|
11
|
+
from .classes.Frame import Frame, FrameLabel
|
12
12
|
from .classes.Grid import Grid, Cell
|
@@ -1,10 +1,21 @@
|
|
1
1
|
from ... import Gtk
|
2
|
-
from .. import Document
|
2
|
+
from .. import Document, PseudoDocument
|
3
|
+
|
4
|
+
class BoxPrepend(PseudoDocument):
|
5
|
+
def __init__(self, app, after = None):
|
6
|
+
super().__init__(app)
|
7
|
+
self.after = after
|
3
8
|
|
4
9
|
class Box(Document):
|
5
10
|
def __init__(self, app, **kwargs):
|
6
11
|
super().__init__(app, **kwargs)
|
7
12
|
def render_raw(self):
|
8
13
|
return Gtk.Box()
|
9
|
-
def
|
10
|
-
|
14
|
+
def insert_child(self, w, d):
|
15
|
+
if isinstance(d, BoxPrepend):
|
16
|
+
if d.after != None:
|
17
|
+
w.insert_child_after(d.render(), self.app.namedWidgets[d.after])
|
18
|
+
else:
|
19
|
+
w.prepend(d.render())
|
20
|
+
else:
|
21
|
+
w.append(d.render())
|
@@ -9,7 +9,7 @@ class Button(Document):
|
|
9
9
|
button = Gtk.Button()
|
10
10
|
button.connect('clicked', printEvent('clicked', self.id))
|
11
11
|
return button
|
12
|
-
def
|
12
|
+
def insert_child(self, w, d):
|
13
13
|
w.set_child(d.render())
|
14
14
|
|
15
15
|
class LinkButton(Button):
|
@@ -19,5 +19,5 @@ class LinkButton(Button):
|
|
19
19
|
button = Gtk.LinkButton()
|
20
20
|
button.connect('activate-link', printEvent('clicked', self.id, True))
|
21
21
|
return button
|
22
|
-
def
|
22
|
+
def insert_child(self, w, d):
|
23
23
|
w.set_child(d.render())
|
@@ -18,13 +18,22 @@ class Document:
|
|
18
18
|
self.app.nameWidget(self.id, w)
|
19
19
|
for (p,v) in self.props.items():
|
20
20
|
w.set_property(p, v)
|
21
|
-
w.
|
21
|
+
w.insert_child = lambda d: self.insert_child(w, d)
|
22
22
|
def render(self):
|
23
23
|
w = self.render_raw()
|
24
24
|
self.set_properties(w)
|
25
25
|
for child in self.children:
|
26
|
-
self.
|
26
|
+
self.insert_child(w, child)
|
27
27
|
return w
|
28
28
|
|
29
|
-
def
|
30
|
-
raise Exception("Unimplemented method '
|
29
|
+
def insert_child(self, w, child):
|
30
|
+
raise Exception("Unimplemented method 'insert_child'")
|
31
|
+
|
32
|
+
class PseudoDocument(Document):
|
33
|
+
def __init__(self, app):
|
34
|
+
super().__init__(app)
|
35
|
+
self.child = None
|
36
|
+
def add_child(self, child):
|
37
|
+
self.child = child
|
38
|
+
def render(self):
|
39
|
+
return self.child.render()
|
@@ -1,14 +1,17 @@
|
|
1
1
|
from ... import Gtk
|
2
|
-
from .. import Document
|
2
|
+
from .. import Document, PseudoDocument
|
3
|
+
|
4
|
+
class FrameLabel(PseudoDocument):
|
5
|
+
def __init__(self, app):
|
6
|
+
super().__init__(app)
|
3
7
|
|
4
8
|
class Frame(Document):
|
5
|
-
def __init__(self, app,
|
9
|
+
def __init__(self, app, **kwargs):
|
6
10
|
super().__init__(app,**kwargs)
|
7
|
-
self.label = label
|
8
11
|
def render_raw(self):
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
return Gtk.Frame()
|
13
|
+
def insert_child(self, w, d):
|
14
|
+
if isinstance(d, FrameLabel):
|
15
|
+
w.set_label_widget(d.render())
|
16
|
+
else:
|
17
|
+
w.set_child(d.render())
|
@@ -1,18 +1,13 @@
|
|
1
1
|
from ... import Gtk
|
2
|
-
from .. import Document
|
2
|
+
from .. import Document, PseudoDocument
|
3
3
|
|
4
|
-
class Cell(
|
4
|
+
class Cell(PseudoDocument):
|
5
5
|
def __init__(self, app, x, y, w="1", h="1"):
|
6
6
|
super().__init__(app)
|
7
|
-
self.child = None
|
8
7
|
self.x = int(x)
|
9
8
|
self.y = int(y)
|
10
9
|
self.w = int(w)
|
11
10
|
self.h = int(h)
|
12
|
-
def render(self):
|
13
|
-
return self.child.render()
|
14
|
-
def add_child(self, child):
|
15
|
-
self.child = child
|
16
11
|
|
17
12
|
class Grid(Document):
|
18
13
|
def __init__(self, app, **kwargs):
|
@@ -20,5 +15,5 @@ class Grid(Document):
|
|
20
15
|
|
21
16
|
def render_raw(self):
|
22
17
|
return Gtk.Grid()
|
23
|
-
def
|
18
|
+
def insert_child(self, w, d):
|
24
19
|
w.attach(d.render(), d.x, d.y, d.w, d.h)
|
gtk_stream/parser.py
CHANGED
@@ -3,7 +3,7 @@ import signal
|
|
3
3
|
import xml.sax as sax
|
4
4
|
|
5
5
|
from . import GLib
|
6
|
-
from .documents import Document, Label, Box, Button, ProgressBar, Dropdown, Item, Paned, Frame, Grid, Cell, LinkButton, Switch
|
6
|
+
from .documents import Document, Label, Box, Button, ProgressBar, Dropdown, Item, Paned, Frame, Grid, Cell, LinkButton, Switch, FrameLabel, BoxPrepend
|
7
7
|
from .application import GtkStreamApp
|
8
8
|
|
9
9
|
class _Object:
|
@@ -13,6 +13,7 @@ WIDGET_DOCUMENTS = {
|
|
13
13
|
'progress-bar': ProgressBar,
|
14
14
|
'label': Label,
|
15
15
|
'box': Box,
|
16
|
+
'box-prepend': BoxPrepend,
|
16
17
|
'button': Button,
|
17
18
|
'dropdown': Dropdown,
|
18
19
|
'item': Item,
|
@@ -20,6 +21,7 @@ WIDGET_DOCUMENTS = {
|
|
20
21
|
'grid': Grid,
|
21
22
|
'cell': Cell,
|
22
23
|
'frame': Frame,
|
24
|
+
'frame-label': FrameLabel,
|
23
25
|
'link': LinkButton,
|
24
26
|
'switch': Switch
|
25
27
|
}
|
@@ -123,14 +125,14 @@ class GtkStreamXMLHandler(sax.ContentHandler):
|
|
123
125
|
self.transition_enter = self.transE_final
|
124
126
|
self.transition_leave = self.transL_tag('set-prop', self.transE_message, leave_parent)
|
125
127
|
|
126
|
-
case '
|
127
|
-
if '
|
128
|
+
case 'insert':
|
129
|
+
if 'into' in attrs:
|
128
130
|
children = []
|
129
131
|
def leave():
|
130
132
|
for child in children:
|
131
|
-
self.app.
|
133
|
+
self.app.insertWidget(attrs['into'], child)
|
132
134
|
self.transition_enter = self.transE_addChild(lambda child: children.append(child))
|
133
|
-
self.transition_leave = self.transL_tag('
|
135
|
+
self.transition_leave = self.transL_tag('insert', self.transE_message, leave_parent, leave)
|
134
136
|
else:
|
135
137
|
raise Exception("Expected 'to' attribute of 'append' message")
|
136
138
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: gtk-stream
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3
|
4
4
|
Summary: A simple stream-oriented GUI protocol
|
5
5
|
Author-email: Marc Coiffier <marc.coiffier@univ-grenoble-alpes.fr>
|
6
6
|
Project-URL: Homepage, https://coiffiem.gricad-pages.univ-grenoble-alpes.fr/gtk-stream/
|
@@ -0,0 +1,23 @@
|
|
1
|
+
gtk_stream/__init__.py,sha256=pDhUSN4AYNsP8_tilU1zmDCYdiv7ak4PE1TW0qFrDlg,99
|
2
|
+
gtk_stream/application.py,sha256=jnVejsyc8EqH6e8XgM2x3mrTAmFY2vIMnRmYO5G9FII,3068
|
3
|
+
gtk_stream/command_line.py,sha256=c2ghqIQB5hYxtCszss1z84yKoeRYvaMJJMi4aiTspWg,312
|
4
|
+
gtk_stream/common.py,sha256=sEw15nVw9SVp8eLVOB5Zj1JITVhUhCF0i3PSwpd8lis,590
|
5
|
+
gtk_stream/parser.py,sha256=GTkh0M6AJFSChn8W62IgcuCLwGt9DW09tvGP2Qjk8jk,6887
|
6
|
+
gtk_stream/properties.py,sha256=9bYzvqmUq8EidtBDZdKupLgYM9ucIGyxmahcIp9TxT8,1542
|
7
|
+
gtk_stream/documents/__init__.py,sha256=NfRHkr2-hRZjR1pcokLFAM8FZ6sEwfzKg1QA20LAQDE,418
|
8
|
+
gtk_stream/documents/classes/Box.py,sha256=8HApUyNBBtX1ErTaAMBNrM1SPueizQFgNoKIkIrFDKw,635
|
9
|
+
gtk_stream/documents/classes/Button.py,sha256=Hh7999KPs-9JPV7wu1cWi2J5fjfkTGfajbEqMqvejqE,747
|
10
|
+
gtk_stream/documents/classes/Document.py,sha256=CC7XMXbyldPpxU0PgwQIVbxd13KN0fTSOgoUK-LnpR0,1219
|
11
|
+
gtk_stream/documents/classes/Dropdown.py,sha256=NYTCSPS8Plib_3KuCdpzLeiFzGJ6WyA-P2DtMo08SC0,1675
|
12
|
+
gtk_stream/documents/classes/Frame.py,sha256=5rigOtrrY1rQxuU98sxX5mUJ0ClvgabZUOW6BSxDE4w,474
|
13
|
+
gtk_stream/documents/classes/Grid.py,sha256=CD_B5Gr5tPvgBl39aJxcesybTqH1M0bHvHKYl2vPcEI,502
|
14
|
+
gtk_stream/documents/classes/Label.py,sha256=BeL3zlf9YPuBGYS_YtHI0Q-MoVVLPao7kPIzPlwpyHY,275
|
15
|
+
gtk_stream/documents/classes/Paned.py,sha256=4jZGEebhv9pNzTyYbQ8lyx_nsKd9Nmr10703V5n_kNw,644
|
16
|
+
gtk_stream/documents/classes/ProgressBar.py,sha256=2_KCboyweGsqpBck61TvVGZYIsN8QVzAyqwwTDh-pDU,212
|
17
|
+
gtk_stream/documents/classes/Switch.py,sha256=uXmd_cZPZXkM31wYE4Z5d1-wuxqdt7wvS6qoE8ubaGc,610
|
18
|
+
gtk_stream/documents/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
+
gtk_stream-0.3.dist-info/METADATA,sha256=bzz6Ac4DhmmpkF-unA0WW8ay4_yITRHuTru7rixRNKI,504
|
20
|
+
gtk_stream-0.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
21
|
+
gtk_stream-0.3.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
22
|
+
gtk_stream-0.3.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
23
|
+
gtk_stream-0.3.dist-info/RECORD,,
|
@@ -1,23 +0,0 @@
|
|
1
|
-
gtk_stream/__init__.py,sha256=pDhUSN4AYNsP8_tilU1zmDCYdiv7ak4PE1TW0qFrDlg,99
|
2
|
-
gtk_stream/application.py,sha256=FZe4gQm5U0NGKKpi_Pp7VqxMtlbdbNJOYhcradzeSH4,3068
|
3
|
-
gtk_stream/command_line.py,sha256=c2ghqIQB5hYxtCszss1z84yKoeRYvaMJJMi4aiTspWg,312
|
4
|
-
gtk_stream/common.py,sha256=sEw15nVw9SVp8eLVOB5Zj1JITVhUhCF0i3PSwpd8lis,590
|
5
|
-
gtk_stream/parser.py,sha256=ZyCm1WKgKH6syqyUCY7ZyTW642LMpzQ_dDSNsvcNsLY,6797
|
6
|
-
gtk_stream/properties.py,sha256=9bYzvqmUq8EidtBDZdKupLgYM9ucIGyxmahcIp9TxT8,1542
|
7
|
-
gtk_stream/documents/__init__.py,sha256=vTgKiiafqqkSOIUwOIzO40VsSdCpHFnGOGRm8rRv9mY,378
|
8
|
-
gtk_stream/documents/classes/Box.py,sha256=6l9Z3GpC0Yv34jcGNTwlNLM5DpYyQ1iDihJsu1nxcy8,259
|
9
|
-
gtk_stream/documents/classes/Button.py,sha256=_NjoOrgdSVK4RQbh0V-QiZ_hfHasaMc9LQ2bf2egbe4,747
|
10
|
-
gtk_stream/documents/classes/Document.py,sha256=scoJrdHen_1WRuqn3aN6FJUesHXPZZyKwmPuPDjjbzI,985
|
11
|
-
gtk_stream/documents/classes/Dropdown.py,sha256=0Y9Sua_0Y_1F6bq4SQe1IDdJThhh5KVpepAExcPo8bg,1675
|
12
|
-
gtk_stream/documents/classes/Frame.py,sha256=p8OcgYBki1NWe2tveZfRwb0aQzRAeHQa9wHmpjgRJoc,391
|
13
|
-
gtk_stream/documents/classes/Grid.py,sha256=SRDbMhPZHV372KN7Qr9vvamH2xwr39eojeWmI0Rf8hE,622
|
14
|
-
gtk_stream/documents/classes/Label.py,sha256=BeL3zlf9YPuBGYS_YtHI0Q-MoVVLPao7kPIzPlwpyHY,275
|
15
|
-
gtk_stream/documents/classes/Paned.py,sha256=4jZGEebhv9pNzTyYbQ8lyx_nsKd9Nmr10703V5n_kNw,644
|
16
|
-
gtk_stream/documents/classes/ProgressBar.py,sha256=2_KCboyweGsqpBck61TvVGZYIsN8QVzAyqwwTDh-pDU,212
|
17
|
-
gtk_stream/documents/classes/Switch.py,sha256=uXmd_cZPZXkM31wYE4Z5d1-wuxqdt7wvS6qoE8ubaGc,610
|
18
|
-
gtk_stream/documents/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
-
gtk_stream-0.2.2.dist-info/METADATA,sha256=YSIp8eUE3NYgYYotyx-SJ4gJlXVsdUprK0MayqS6rCE,506
|
20
|
-
gtk_stream-0.2.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
21
|
-
gtk_stream-0.2.2.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
22
|
-
gtk_stream-0.2.2.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
23
|
-
gtk_stream-0.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|