-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
101 lines (76 loc) · 2.41 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#! /usr/bin/env python
"""Goo - XML based user interface working with gunge"""
__all__ = ['element', 'containers', 'controls', 'composite', 'style', 'parser', 'draw']
#temporary import
import pygame, gunge
#constants
TOPLEFT = 1
TOPRIGHT = 2
BOTTOMLEFT = 4
BOTTOMRIGHT = 8
TOP = TOPLEFT | TOPRIGHT
BOTTOM = BOTTOMLEFT | BOTTOMRIGHT
ALL = TOP | BOTTOM
#prepare goo event types
BUTTONCLICK = gunge.event.USEREVENT + 1
CHECKCHANGED = gunge.event.USEREVENT + 2
#event return types
NO_MATCH = 0
SKIP = 1
import goo.element
import goo.containers
import goo.controls
import goo.composite
import goo.style
import goo.parser
import goo.draw
#prepare image loader for goo internal resources
img_loader = gunge.media.ImageLoader("goo/images", False)
xml_loader = gunge.media.ResourceLoader(("goo/xml", "."), False)
#default styles
goo.style.add(goo.style.Style("default_titlebar",
margin = 5,
padding = 3,
border_rounding = TOP,
border_color = (0, 0, 0, 0),
background_color = (0, 140, 215),))
goo.style.add(goo.style.Style("default_sizer",
padding = 0,
border_color = (0, 0, 0, 0),
background_color = (0, 0, 0, 0)))
goo.style.add(goo.style.Style("default_frame",
padding = 0,
margin = 0))
goo.style.add(goo.style.Style("default_panel",
border_rounding = 0))
goo.style.add(goo.style.Style("default_iconbutton",
border_color = (0, 0, 0, 0),
hover_color = (50, 190, 255, 100),
clicked_color = (200, 200, 200, 100),
padding = 0))
goo.style.add(goo.style.Style("default_checkbox",
background_color = (255, 255, 255),
border_color = (153, 146, 146),
hover_color = (255, 255, 255),
padding = 2))
goo.style.add(goo.style.Style("default_text",
background_color = (255, 255, 255),
padding = 2))
class NullParent:
"""A dummy parent.
This parent has some dummy attributes so that top-level windows don't get burned
when they try to access their parent.
"""
style = goo.style.get()
rect = pygame.Rect((0, 0), (0, 0))
@classmethod
def adjust(cls, child):
"""this at the moment does nothing at all.
A (top-level) container will call this method, so it must be available.
"""
pass
@classmethod
def get_childpos(cls, child):
"""returns (10, 10)"""
return (10, 10)
del pygame, gunge