Skip to content

Commit

Permalink
feat: init libadwaita
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr committed Oct 15, 2021
1 parent eacbd17 commit 2c3b55f
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 131 deletions.
16 changes: 0 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,4 @@
/.shards/
*.dwarf
shard.override.yml

# Libraries don't need dependency lock
# Dependencies will be locked in applications that use them
/shard.lock
/src/cairo-1.0
/src/g_lib-2.0
/src/g_module-2.0
/src/g_object-2.0
/src/gdk-4.0
/src/gdk_pixbuf-2.0
/src/gio-2.0
/src/graphene-1.0
/src/gsk-4.0
/src/gtk-4.0
/src/harf_buzz-0.0
/src/pango-1.0
/src/pango_cairo-1.0
132 changes: 132 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# 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, caste, color, 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
[email protected].
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.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][mozilla coc].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][faq]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[mozilla coc]: https://github.com/mozilla/diversity
[faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2021 Hugo Parente Lima <[email protected]>
Copyright (c) 2021 Evangelos "GeopJr" Paterakis <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
66 changes: 39 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,65 @@
# GTK4 Crystal Bindings
<p align="center">
<img width="256" alt="libadwaita.cr logo" src="./logo.svg" />
</p>
<h1 align="center">libadwaita.cr</h1>
<h4 align="center">libadwaita bindings for Crystal</h4>
<p align="center">
<br />
<a href="https://github.com/GeopJr/libadwaita.cr/blob/main/CODE_OF_CONDUCT.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-v2.1-3584e4.svg?style=for-the-badge&labelColor=8ff0a4" alt="Code Of Conduct" /></a>
<a href="https://github.com/GeopJr/libadwaita.cr/blob/main/LICENSE"><img src="https://img.shields.io/badge/LICENSE-MIT-3584e4.svg?style=for-the-badge&labelColor=8ff0a4" alt="MIT Licensed" /></a>
</p>

See [examples](https://github.com/hugopl/gtk4.cr/tree/master/examples) folder and have fun.
#

## Is it ready?
<p align="center">
<img src="https://i.imgur.com/H6a5Git.png" alt="screenshot of the an example libadwaita.cr app" width="512" />
</p>

Not yet, I'm porting [Tijolo](https://github.com/hugopl/tijolo) from GTK3/[crystal-gobject](https://github.com/jhass/crystal-gobject) to GTK4 using this binding, so I should release the first version of this only when the port finishes. However bug reports about things not working still welcome, so I can keep track of them.
#

## Compile time dependencies
## Notes

You need the GTK libraries and their GObjectIntrospection files.
- This is a fork of [gtk4.cr](https://github.com/hugopl/gtk4.cr)
- Bindings are being generated using [gi-crystal](https://github.com/hugopl/gi-crystal)
- It includes everything gtk4.cr does plus libadwaita which means that it **cannot** be used with gtk4.cr at the same time
- The scope of this repo, apart from supporting libadwaita, is being "stable" (so the bindings are pre-bundled rather than being generated on the spot)
- Docs can be found on the website listed on the sidebar

- Archlinux: `pacman -S gtk4 gobject-introspection`
- Ubuntu: `apt-get install libgtk-4-0 gobject-introspection gir1.2-gtk-4.0`
- macOS: `brew install gobject-introspection gtk4`
#

Be welcome to create a PR updating this readme once you know what packages are needed by your distro to run the
examples.
## Dependencies

## Runtime dependencies
- ArchLinux: `pacman -S gtk4 gobject-introspection libadwaita`

Just the GTK libraries are needed at runtime.
Other distros will probably require you to manually build libadwaita for now.

#

## Installation

1. Add the dependency to your `shard.yml`:

```yaml
dependencies:
gtk4:
github: hugopl/gtk4.cr
libadwaita:
github: GeopJr/libadwaita.cr
```
2. Run `shards install`

#

## Usage

See the [hello world tutorial](./tutorial/hello_world.md).
Follow the instructions over at [gtk4.cr](https://github.com/hugopl/gtk4.cr) and [gi-crystal](https://github.com/hugopl/gi-crystal) as well as the [examples/](./examples/) folder

For more info on how to use signals, properties, etc see the [GI-Crystal](https://github.com/hugopl/gi-crystal)
project page, it's the binding generator used to create this binding.
#

## Contributing

1. Fork it (<https://github.com/hugopl/gtk4.cr/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## Contributors

- [Hugo Parente Lima](https://github.com/hugopl) - creator and maintainer
1. Read the [Code of Conduct](https://github.com/GeopJr/libadwaita.cr/blob/main/CODE_OF_CONDUCT.md)
2. Fork it ( https://github.com/GeopJr/libadwaita.cr/fork )
3. Create your feature branch (git checkout -b my-new-feature)
4. Commit your changes (git commit -am 'Add some feature')
5. Push to the branch (git push origin my-new-feature)
6. Create a new Pull Request
7 changes: 7 additions & 0 deletions adw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Here, just like gio.yml and gtk.yml, we can include or ignore what we do or don't need.

# include:
# -

# ignore:
# -
4 changes: 3 additions & 1 deletion bin/generate_bindings
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ set -e

cd $(dirname $0); __DIR__=$(pwd)

./gi-crystal Gtk 4.0 -o ../src --config-paths=..:../lib/gi-crystal
rm -rf ../src/auto/*

./gi-crystal Adw 1 -o ../src/auto --config-paths=..:../lib/gi-crystal
21 changes: 0 additions & 21 deletions examples/README.md

This file was deleted.

1 change: 1 addition & 0 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: gtk4
version: 0.1.0
name: libadwaita
version: 1.0.0

authors:
- Hugo Parente Lima <[email protected]>
- Evangelos "GeopJr" Paterakis <[email protected]>

dependencies:
development_dependencies:
gi-crystal:
github: hugopl/gi-crystal
branch: master
commit: 5a3ca155ac54be951b07d1ffb32909d69d9bac98

scripts:
postinstall: ../../bin/gi-crystal Gtk 4.0 -o src --config-paths=.:../gi-crystal
postinstall: ../../bin/gi-crystal Adw 1 -o src/auto --config-paths=.:../gi-crystal

crystal: ">= 1.0.0"

Expand Down
1 change: 1 addition & 0 deletions src/adw.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require "./auto/adw-1/adw"
1 change: 0 additions & 1 deletion src/gtk4.cr

This file was deleted.

60 changes: 0 additions & 60 deletions tutorial/hello_world.md

This file was deleted.

0 comments on commit 2c3b55f

Please sign in to comment.