Skip to main content

pushrod_widgets/
lib.rs

1// Pushrod Widgets
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#[macro_use]
16
17mod macros {
18    macro_rules! widget_default_impl {
19        ( $x:expr ) => {
20            fn properties(&mut self) -> &mut WidgetProperties {
21                &mut self.properties
22            }
23
24            fn widget_name(&self) -> String {
25                String::from($x)
26            }
27        };
28    }
29}
30
31/// Properties is the store that each `Widget` uses to define its behavior, using a `HashMap` to
32/// store the properties.  Each property is identified by a numeric (u32) key.
33pub mod properties;
34
35/// This is the `Event` definitions for the `Widget`s and their associated actions.
36pub mod event;
37
38/// This is the `Widget` trait that all drawable `Widget`s use.  Any special functionality should
39/// be defined using interactions with properties.  `Widget`s can decide whether or not to set
40/// themselves in `invalidated` state after a property value changes, which indicates to the
41/// top-level drawing loop whether or not a `Widget` needs to be redrawn.
42pub mod widget;
43
44/// This is a `Widget` and `Texture` cache that are used by `Widget`s.
45pub mod caches;
46
47/// This is a store used by `Widget`s for drawing against.  Once the drawing is complete, the
48/// `Texture` stored within is used for blitting to the screen.
49pub mod texture_store;
50
51/// This is a set of drawing primitives that `Widget`s can use to help offset some harder work
52/// that would require a lot of code.  This includes things like drawing a background, filling
53/// a space, rendering text, and so on.
54pub mod primitives;
55
56/// System-provided Widget library.
57pub mod system_widgets;