Skip to content

Commit

Permalink
Resize/Expand rework + basic readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Nov 2, 2023
1 parent a9498ab commit 0026a6d
Show file tree
Hide file tree
Showing 22 changed files with 999 additions and 130 deletions.
44 changes: 44 additions & 0 deletions .crate-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
![Gooey is considered experimental and unsupported](https://img.shields.io/badge/status-prototype-blueviolet)
[![crate version](https://img.shields.io/crates/v/gooey.svg)](https://crates.io/crates/gooey)
[![Documentation for `main` branch](https://img.shields.io/badge/docs-main-informational)](https://gooey.rs/main/gooey/)

Gooey is an experimental Graphical User Interface (GUI) crate for the Rust
programming language. It is built using [`Kludgine`][kludgine], which is powered
by [`winit`][winit] and [`wgpu`][wgpu]. It is incredibly early in development,
and is being developed for a game that will hopefully be developed shortly.

The [`Widget`][widget] trait is the building block of Gooey: Every user
interface element implements `Widget`. A full list of built-in widgets can be
found in the [`gooey::widgets`][widgets] module.

Gooey uses a reactive data model. To see [an example][button-example] of how
reactive data models work, consider this example that displays a button that
increments its own label:

```rust
// Create a dynamic usize.
let count = Dynamic::new(0_usize);

// Create a new button with a label that is produced by mapping the contents
// of `count`.
Button::new(count.map_each(ToString::to_string))
// Set the `on_click` callback to a closure that increments the counter.
.on_click(count.with_clone(|count| move |_| count.set(count.get() + 1)))
// Run the button as an an application.
.run()
```

[widget]: crate::widget::Widget
[kludgine]: https://github.com/khonsulabs/kludgine
[wgpu]: https://github.com/gfx-rs/wgpu
[winit]: https://github.com/rust-windowing/winit
[widgets]: mod@crate::widgets
[button-example]: https://github.com/khonsulabs/gooey/tree/main/examples/button.rs

## Open-source Licenses

This project, like all projects from [Khonsu Labs](https://khonsulabs.com/), is open-source.
This repository is available under the [MIT License](./LICENSE-MIT) or the
[Apache License 2.0](./LICENSE-APACHE).

To learn more about contributing, please see [CONTRIBUTING.md](./CONTRIBUTING.md).
52 changes: 52 additions & 0 deletions .rustme/config.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Configuration(
files: {
"../README.md": [
"header.md",
"docs.md",
"https://github.com/khonsulabs/.github/raw/main/snippets/readme-footer.md",
],
"../.crate-docs.md": (
for_docs: true,
sections: [
"docs.md",
"https://github.com/khonsulabs/.github/raw/main/snippets/readme-footer.md",
],
),
"../CONTRIBUTING.md": [
"https://github.com/khonsulabs/.github/raw/main/docs/CONTRIBUTING.md",
],
"../CODE_OF_CONDUCT.md": [
"https://github.com/khonsulabs/.github/raw/main/docs/CODE_OF_CONDUCT.md",
],
"../LICENSE-APACHE": [
"https://github.com/khonsulabs/.github/raw/main/licenses/LICENSE-APACHE",
],
"../LICENSE-MIT": [
"https://github.com/khonsulabs/.github/raw/main/licenses/LICENSE-MIT",
],
},
glossaries: [
"https://github.com/khonsulabs/.github/raw/main/snippets/glossary.ron",
{
// "msrv": "1.70",
"ref-name": (
default: "main",
release: "v0.1.0",
),
"docs": (
default: "https://gooey.rs/main/gooey/",
release: "https://docs.rs/gooey",
),
"widget": (
default: "https://gooey.rs/main/gooey/widget/trait.Widget.html",
release: "https://docs.rs/gooey/*/gooey/widget/trait.Widget.html",
for_docs: "crate::widget::Widget",
),
"widgets": (
default: "https://gooey.rs/main/gooey/widgets/index.html",
release: "https://docs.rs/gooey/*/gooey/widgets/index.html",
for_docs: "mod@crate::widgets",
),
},
],
)
27 changes: 27 additions & 0 deletions .rustme/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
![Gooey is considered experimental and unsupported](https://img.shields.io/badge/status-prototype-blueviolet)
[![crate version](https://img.shields.io/crates/v/gooey.svg)](https://crates.io/crates/gooey)
[![Documentation for `main` branch](https://img.shields.io/badge/docs-main-informational)]($docs$)

Gooey is an experimental Graphical User Interface (GUI) crate for the Rust
programming language. It is built using [`Kludgine`][kludgine], which is powered
by [`winit`][winit] and [`wgpu`][wgpu]. It is incredibly early in development,
and is being developed for a game that will hopefully be developed shortly.

The [`Widget`][widget] trait is the building block of Gooey: Every user
interface element implements `Widget`. A full list of built-in widgets can be
found in the [`gooey::widgets`][widgets] module.

Gooey uses a reactive data model. To see [an example][button-example] of how
reactive data models work, consider this example that displays a button that
increments its own label:

```rust
$../examples/button.rs:readme$
```

[widget]: $widget$
[kludgine]: https://github.com/khonsulabs/kludgine
[wgpu]: https://github.com/gfx-rs/wgpu
[winit]: https://github.com/rust-windowing/winit
[widgets]: $widgets$
[button-example]: https://github.com/khonsulabs/gooey/tree/$ref-name$/examples/button.rs
1 change: 1 addition & 0 deletions .rustme/header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Gooey
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
moderators@khonsulabs.com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing to our projects

Thank you for your interest in contributing to one of our projects. We want
everyone to have a positive experience contributing, so please carefully review
our only requirements for contributing:

- All contributors must agree to [our Contributor License
Agreement](https://gist.github.com/ecton/b2e1e72abfa122da5e69ed30164f739e).
This will be asked for during your first pull request.
- All contributors must uphold the standards of our [Code of
Conduct](./CODE_OF_CONDUCT.md).

The rest of this document is recommendations/guidelines to help consistency and
communication within our projects.

## Creating Issues

### Reporting Bugs

To us, if something isn't behaving as you expect it to, that's a bug. Even if
it's misbehaving due to a misunderstanding, that means there's an opportunity to
improve our documentation or examples. Please don't hesitate to let us know if
you run into any issues while working with one of our projects.

### Requesting New Features

When requesting new features, please include details about what problem you're
trying to solve, not just a solution to your problem. By helping the community
understand the underlying problem, we can better evaluate what the best solution
to the problem might be.

## Contributing Changes

We openly welcome pull requests on our projects. We don't like bugs, and if
you've found one and wish to submit a fix, we greatly appreciate it.

If you find that fixing a bug requires a significant change, or you are wanting
to add a somewhat large feature, please submit a proposal as an issue first. We
want to make sure that your efforts have the highest chance of success, and a
short discussion before starting can go a long way towards a pull request being
merged with less revisions.

When working on an existing issue, update the issue to reflect that you're
working on it. This will help prevent duplicated efforts.

If you begin working on something but need some assistance, don't hesitate to
reach out inside of the issue, on [our
forums](https://community.khonsulabs.com/), or in [our
Discord](https://discord.khonsulabs.com/). We will do our best to help you.

### Project-specific requirements

Be sure to check if a project's README contains additional contributing
guidelines. Each project may have different tools and commands that should be
run to validate that changes pass all requirements.
Loading

0 comments on commit 0026a6d

Please sign in to comment.