Skip to content
Commits on Source (35)
_build
*.swp
*~
\#*#
.\#*
build
.buildconfig
.flatpak-builder
\ No newline at end of file
include:
- 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-definitions.yml'
- 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
- project: 'gnome/citemplates'
file: 'flatpak/flatpak_ci_initiative.yml'
variables:
MANIFEST_PATH: 'examples/sm.puri.Handy.Demo.json'
FLATPAK_MODULE: 'libhandy'
FLATPAK_BUILD_DIR: build
stages:
- build
- test+docs
- package
- test-package
- publish
before_script:
- echo "man-db man-db/auto-update boolean false" | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install eatmydata
- eatmydata apt-get -y install build-essential libgtk-3-doc libgdk-pixbuf2.0-doc lcov
- eatmydata apt-get -y build-dep .
.build: &build_steps
echo "BUILD_OPTS=${BUILD_OPTS}" &&
export LC_ALL=C.UTF-8 &&
meson ${BUILD_OPTS} . _build &&
ninja -C _build
api-visibility:
stage: build
before_script: []
script:
- ./.gitlab-ci/api-visibility.sh
build-debian-gcc:
image: debian:buster
stage: build
variables:
BUILD_OPTS: -Dgtk_doc=true -Db_coverage=true --werror
script:
- *build_steps
artifacts:
when: always
paths:
- _build
build-debian-clang:
image: debian:buster
before_script:
- echo "man-db man-db/auto-update boolean false" | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install eatmydata
- eatmydata apt-get -y install build-essential clang-tools
- eatmydata apt-get -y build-dep .
stage: build
script:
- export LC_ALL=C.UTF-8
- meson . _build
# With meson 0.49 we can do
# SCANBUILD="scan-build --status-bugs" ninja scan-build
# https://github.com/mesonbuild/meson/commit/1e7aea65e68a43b0319a4a28908daddfec621548
- ninja -C _build scan-build
artifacts:
when: always
paths:
- _build/meson-logs/scanbuild
build-fedora-gcc:
image: fedora:32
doc:
image: fedora:34
stage: build
variables:
BUILD_OPTS: -Dgtk_doc=true
MESON_ARGS: >-
-Dexamples=false
-Dgtk_doc=true
-Dtests=false
-Dvapi=false
before_script:
- dnf -y update
- dnf -y install @development-tools redhat-rpm-config dnf-plugins-core
- dnf -y builddep data/packaging/rpm/libhandy.spec
script:
- *build_steps
build-gtkdoc:
image: debian:buster
stage: test+docs
dependencies:
- build-debian-gcc
- dnf -y install gcc git gobject-introspection-devel gtk3-devel meson pip
- pip install Jinja2 pygments toml typogrify
script:
- ninja -C _build meson-libhandy-1-doc 2>&1 | tee _build/doc/buildlog
- if grep -qs 'warning' _build/doc/buildlog; then exit 1; fi
- mv _build/doc/html/ _reference/
- meson --prefix=/app ${MESON_ARGS} _build
- ninja -C _build
- mv _build/doc/libhandy-1 _doc/
artifacts:
when: always
paths:
- _reference
unit-test:
image: debian:buster
stage: test+docs
dependencies:
- build-debian-gcc
script:
- xvfb-run -s -noreset ninja -C _build test
- ninja -C _build coverage
coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
artifacts:
when: always
paths:
- _build
package-debian-buster:
tags: []
extends: .l5-build-debian-package
autopkgtest-debian-buster-package:
tags: []
dependencies:
- package-debian-buster
extends: .l5-autopkgtest-debian-package
lintian-debian-buster-package:
tags: []
dependencies:
- package-debian-buster
extends: .l5-lintian-debian-package
abi-check:
# See https://sourceware.org/bugzilla/show_bug.cgi?id=27267
image: fedora:33
stage: build
variables:
DEPS: libabigail git
LAST_ABI_BREAK: "b90b5120c5e9e3f5a3b0d228bd7ddb24f053289a"
before_script:
- dnf -y update
- dnf -y install @development-tools redhat-rpm-config dnf-plugins-core $DEPS
- dnf -y builddep data/packaging/rpm/libhandy.spec
# See https://sourceware.org/bugzilla/show_bug.cgi?id=27269
- rpm -Uvh --oldpackage https://kojipkgs.fedoraproject.org//packages/libabigail/1.7/2.fc33/x86_64/libabigail-1.7-2.fc33.x86_64.rpm
script:
- ./.gitlab-ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD)
- _doc
build-flatpak:
extends: '.flatpak'
stage: build
before_script: []
variables:
MANIFEST_PATH: 'examples/sm.puri.Handy.Demo.json'
RUNTIME_REPO: 'https://nightly.gnome.org/gnome-nightly.flatpakrepo'
FLATPAK_MODULE: 'libhandy'
APP_ID: 'sm.puri.Handy.Demo'
BUNDLE: 'sm.puri.Handy.Demo.flatpak'
......@@ -153,6 +54,24 @@ build-flatpak-glade:
variables:
MANIFEST_PATH: 'glade/sm.puri.Handy.Glade.json'
RUNTIME_REPO: 'https://nightly.gnome.org/gnome-nightly.flatpakrepo'
FLATPAK_MODULE: 'libhandy'
APP_ID: 'sm.puri.Handy.Glade'
BUNDLE: 'sm.puri.Handy.Glade.flatpak'
abi-check:
image: fedora:34
stage: build
variables:
LAST_ABI_BREAK: "b90b5120c5e9e3f5a3b0d228bd7ddb24f053289a"
before_script:
- dnf -y update
- dnf -y install gcc gobject-introspection-devel git gtk3-devel libabigail meson vala
script:
- ./.gitlab-ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD)
refresh-doc:
stage: publish
only:
refs:
- 'main'
script:
- "curl -X POST -F token=${PAGES_TRIGGER_TOKEN} -F ref=pages https://gitlab.gnome.org/api/v4/projects/11489/trigger/pipeline"
#!/bin/bash
set -e
builddir=app
repodir=repo
appid="$1"
manifest="$2"
flatpak-builder \
--stop-at=libhandy \
${builddir} \
${manifest}
flatpak-builder -v \
--run ${builddir} ${manifest} \
meson \
--prefix /app \
--libdir /app/lib \
--buildtype debug \
-Dintrospection=disabled \
-Dvapi=false \
_build .
flatpak-builder \
--run ${builddir} ${manifest} \
ninja -C _build install
flatpak-builder \
--finish-only \
--repo=${repodir} \
${builddir} \
${manifest}
flatpak build-bundle \
${repodir} \
${appid}-dev.flatpak \
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
${appid}
==============
Version 1.5.90
==============
- Documentation
- Port to gi-docgen
- Use "Since: 1.0" for pre-1.0 symbols
- Various cleanups and consistency updates
- Demo
- Fix keyboard navigation
- Don't make rows containing buttons activatable
- Set minimum width on the view switcher window
- HdyCarousel
- Properly remove mouse wheel timer
- HdyClamp
- Fix measuring
- HdyKeypad
- Fix keyboard navigation
- HdyStyleManager
- Properly reset animations after style changes
- HdySwipeTracker
- Fix a runtime warning
- HdyTabView
- Propagate Alt+[0-9] when trying to switch to the selected tab
- HdyViewSwitcher
- Properly center button labels
- Build and CI cleanups
- Remove unused distro packaging
- Translation updates:
- Czech
- Romanian
- Slovenian
- Spanish
=============
Version 1.5.0
=============
......
# Handy
[![Pipeline status](https://gitlab.gnome.org/GNOME/libhandy/badges/master/build.svg)](https://gitlab.gnome.org/GNOME/libhandy/commits/master)
[![Code coverage](https://gitlab.gnome.org/GNOME/libhandy/badges/master/coverage.svg)](https://gitlab.gnome.org/GNOME/libhandy/commits/master)
[![Pipeline status](https://gitlab.gnome.org/GNOME/libhandy/badges/main/build.svg)](https://gitlab.gnome.org/GNOME/libhandy/commits/main)
[![Code coverage](https://gitlab.gnome.org/GNOME/libhandy/badges/main/coverage.svg)](https://gitlab.gnome.org/GNOME/libhandy/commits/main)
The aim of the Handy library is to help with developing UI for mobile devices
using GTK/GNOME.
......@@ -9,16 +9,6 @@ using GTK/GNOME.
libhandy is licensed under the LGPL-2.1+.
## Build dependencies
To build libhandy you need to first install the build-deps defined by [the debian/control file](https://gitlab.gnome.org/GNOME/libhandy/blob/master/debian/control#L6).
If you are running a Debian based distribution, you can easily install all those the dependencies making use of the following command
```sh
sudo apt-get build-dep .
```
## Building
We use the Meson (and thereby Ninja) build system for libhandy. The quickest
......@@ -34,7 +24,7 @@ For build options see [meson_options.txt](./meson_options.txt). E.g. to enable d
```sh
meson . _build -Dgtk_doc=true
ninja -C _build libhandy-doc
ninja -C _build
```
## Usage
......
#!/usr/bin/env python3
import os
import shutil
import subprocess
from pathlib import PurePath
references = [
'doc/libhandy-1',
]
sourceroot = os.environ.get('MESON_SOURCE_ROOT')
buildroot = os.environ.get('MESON_BUILD_ROOT')
distroot = os.environ.get('MESON_DIST_ROOT')
for reference in references:
src_path = os.path.join(buildroot, reference)
if os.path.isdir(src_path):
dst_path = os.path.join(distroot, reference)
shutil.copytree(src_path, dst_path)
%global _vpath_srcdir %{name}
Name: libhandy
Version: 1.2.0
Release: 1%{?dist}
Summary: A library full of GTK widgets for mobile phones
License: LGPLv2+
Url: https://gitlab.gnome.org/GNOME/libhandy
Source0: https://gitlab.gnome.org/GNOME/libhandy/archive/master.tar.gz
BuildRequires: gcc
BuildRequires: gobject-introspection
BuildRequires: gtk-doc
BuildRequires: meson >= 0.40.1
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gladeui-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconf-pkg-config
BuildRequires: vala
%description
%{summary}.
%package devel
Summary: Development libraries, headers, and documentation for %{name}
Requires: libhandy = %{version}-%{release}
%description devel
%{summary}.
%prep
%setup -c -q
%build
%meson -Dexamples=false -Dgtk_doc=true
%meson_build
%install
%meson_install
%files
%{_libdir}/libhandy*.so.*
%{_libdir}/girepository-1.0/Handy*.typelib
%files devel
%{_includedir}/libhandy*
%{_libdir}/libhandy*.so
%{_libdir}/pkgconfig/libhandy*.pc
%{_datadir}/gir-1.0/Handy*.gir
%{_datadir}/glade/catalogs/libhandy.xml
%{_datadir}/vala/vapi/libhandy*.deps
%{_datadir}/vala/vapi/libhandy*.vapi
%{_datadir}/gtk-doc
%changelog
* Fri May 18 2018 Julian Richen <julian@richen.io> - 0.0.0-1
- Update to 0.0.0-1
Title: Compiling with Libhandy
Slug: build-howto
# Compiling with Libhandy
If you need to build Libhandy, get the source from
[here](https://gitlab.gnome.org/GNOME/libhandy/) and see the `README.md` file.
## Using pkg-config
Like other GNOME libraries, Libhandy uses `pkg-config` to provide compiler
options. The package name is `libhandy-1`.
If you use Automake/Autoconf, in your `configure.ac` script, you might specify
something like:
```autoconf
PKG_CHECK_MODULES(LIBHANDY, [libhandy-1])
AC_SUBST(LIBHANDY_CFLAGS)
AC_SUBST(LIBHANDY_LIBS)
```
Or when using the Meson build system you can declare a dependency like:
```meson
dependency('libhandy-1')
```
The `1` in the package name is the "API version" (indicating "the version of the
Libhandy API that first appeared in version 1") and is essentially just part of
the package name.
## Bundling the library
As Libhandy uses the Meson build system, bundling it as a subproject when it is
not installed is easy. Add this to your `meson.build`:
```meson
libhandy_dep = dependency('libhandy-1', version: '>= 1', required: false)
if not libhandy_dep.found()
libhandy = subproject(
'libhandy',
install: false,
default_options: [
'examples=false',
'package_subdir=my-project-name',
'tests=false',
]
)
libhandy_dep = libhandy.get_variable('libhandy_dep')
endif
```
Then add Libhandy as a git submodule:
```bash
git submodule add https://gitlab.gnome.org/GNOME/libhandy.git subprojects/libhandy
```
To bundle the library with your Flatpak application, add the following module to
your manifest:
```json
{
"name" : "libhandy",
"buildsystem" : "meson",
"config-opts": [
"-Dexamples=false",
"-Dtests=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libhandy.git"
}
]
}
```
## Building on macOS
To build on macOS you need to install the build-dependencies first. This can
e.g. be done via [brew](https://brew.sh):
```bash
brew install pkg-config gtk+3 adwaita-icon-theme meson glade gobject-introspection vala
```
After running the command above, one may now build the library:
```bash
git clone https://gitlab.gnome.org/GNOME/libhandy.git
cd libhandy
meson . _build
ninja -C _build test
ninja -C _build install
```
Working with the library on macOS is pretty much the same as on Linux. To link
it, use `pkg-config`:
```bash
gcc $(pkg-config --cflags --libs gtk+-3.0) $(pkg-config --cflags --libs libhandy-1) main.c -o main
```
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
%gtkdocentities;
]>
<refentry id="build-howto">
<refmeta>
<refentrytitle>Compiling with &package_string;</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>Compiling with &package_string;</refname><refpurpose>Notes on compiling.</refpurpose>
</refnamediv>
<refsect2>
<title>Building</title>
<para>
If you need to build <application>&package_string;</application>, get the
source from <ulink type="http" url="&package_url;">here</ulink> and see
the <literal>README.md</literal> file.
</para>
</refsect2>
<refsect2>
<title>Using pkg-config</title>
<para> Like other GNOME libraries,
<application>&package_string;</application> uses
<application>pkg-config</application> to provide compiler options. The
package name is "<literal>&package_ver_str;</literal>".
</para>
<para>
If you use Automake/Autoconf, in your <literal>configure.ac</literal>
script, you might specify something like:
</para>
<informalexample><programlisting>
PKG_CHECK_MODULES(LIBHANDY, [&package_ver_str;])
AC_SUBST(LIBHANDY_CFLAGS)
AC_SUBST(LIBHANDY_LIBS)
</programlisting></informalexample>
<para>
Or when using the Meson build system you can declare a dependency like:
</para>
<informalexample><programlisting>
dependency('&package_ver_str;')
</programlisting></informalexample>
<para>
The "<literal>&package_api_version;</literal>" in the package name is the
"API version" (indicating "the version of the <application>
&package_string;</application> API that first appeared in version
&package_api_version;") and is essentially just part of the package name.
</para>
</refsect2>
<refsect2>
<title>Bundling the library</title>
<para>
As <application>&package_string;</application> uses the Meson build
system, bundling it as a subproject when it is not installed is easy.
Add this to your <literal>meson.build</literal>:
</para>
<informalexample><programlisting>
&package_string;_dep = dependency('&package_ver_str;', version: '>= &package_version;', required: false)
if not &package_string;_dep.found()
&package_string; = subproject(
'&package_string;',
install: false,
default_options: [
'examples=false',
'package_subdir=my-project-name',
'tests=false',
]
)
&package_string;_dep = &package_string;.get_variable('&package_string;_dep')
endif
</programlisting></informalexample>
<para>
Then add &package_string; as a git submodule:
</para>
<informalexample><programlisting>
git submodule add &package_url;.git subprojects/&package_string;
</programlisting></informalexample>
<para>
To bundle the library with your Flatpak application, add the following
module to your manifest:
</para>
<informalexample><programlisting>
{
"name" : "&package_string;",
"buildsystem" : "meson",
"builddir" : true,
"config-opts": [
"-Dexamples=false",
"-Dtests=false"
],
"sources" : [
{
"type" : "git",
"url" : "&package_url;.git"
}
]
}
</programlisting></informalexample>
</refsect2>
<refsect2>
<title>Building on macOS</title>
<para>
To build on macOS you need to install the build-dependencies first. This can e.g. be done via <ulink url="https://brew.sh"><literal>brew</literal></ulink>:
</para>
<informalexample>
<programlisting>
brew install pkg-config gtk+3 adwaita-icon-theme meson glade gobject-introspection vala
</programlisting>
</informalexample>
<para>
After running the command above, one may now build the library:
</para>
<informalexample>
<programlisting>
git clone https://gitlab.gnome.org/GNOME/libhandy.git
cd libhandy
meson . _build
ninja -C _build test
ninja -C _build install
</programlisting>
</informalexample>
<para>
Working with the library on macOS is pretty much the same as on Linux. To link it, use <literal>pkg-config</literal>:
</para>
<informalexample>
<programlisting>
gcc $(pkg-config --cflags --libs gtk+-3.0) $(pkg-config --cflags --libs libhandy-1) main.c -o main
</programlisting>
</informalexample>
</refsect2>
</refentry>
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
%gtkdocentities;
]>
<book id="index">
<bookinfo>
<title>&package_name; Reference Manual</title>
<releaseinfo>
<para>This document is the API reference for &package_name; &package_version;.</para>
<para>
<ulink type="http" url="&package_url;">Handy</ulink> is a library to help you write apps for GTK/GNOME based mobile phones.
</para>
<para>
If you find any issues in this API reference, please report it using
<ulink type="http" url="&package_bugreport;">the bugtracker</ulink>.
</para>
</releaseinfo>
<copyright>
<year>2017-2020</year>
<holder>Purism SPC</holder>
</copyright>
</bookinfo>
<chapter id="intro">
<title>Introduction</title>
<xi:include href="build-howto.xml"/>
<xi:include href="visual-index.xml"/>
</chapter>
<chapter id="core-api">
<title>Widgets and Objects</title>
<xi:include href="xml/hdy-action-row.xml"/>
<xi:include href="xml/hdy-animation.xml"/>
<xi:include href="xml/hdy-application-window.xml"/>
<xi:include href="xml/hdy-avatar.xml"/>
<xi:include href="xml/hdy-carousel.xml"/>
<xi:include href="xml/hdy-carousel-indicator-dots.xml"/>
<xi:include href="xml/hdy-carousel-indicator-lines.xml"/>
<xi:include href="xml/hdy-clamp.xml"/>
<xi:include href="xml/hdy-combo-row.xml"/>
<xi:include href="xml/hdy-deck.xml"/>
<xi:include href="xml/hdy-enum-value-object.xml"/>
<xi:include href="xml/hdy-expander-row.xml"/>
<xi:include href="xml/hdy-flap.xml"/>
<xi:include href="xml/hdy-header-bar.xml"/>
<xi:include href="xml/hdy-header-group.xml"/>
<xi:include href="xml/hdy-keypad.xml"/>
<xi:include href="xml/hdy-leaflet.xml"/>
<xi:include href="xml/hdy-navigation-direction.xml"/>
<xi:include href="xml/hdy-preferences-group.xml"/>
<xi:include href="xml/hdy-preferences-page.xml"/>
<xi:include href="xml/hdy-preferences-row.xml"/>
<xi:include href="xml/hdy-preferences-window.xml"/>
<xi:include href="xml/hdy-search-bar.xml"/>
<xi:include href="xml/hdy-style-manager.xml"/>
<xi:include href="xml/hdy-squeezer.xml"/>
<xi:include href="xml/hdy-status-page.xml"/>
<xi:include href="xml/hdy-swipeable.xml"/>
<xi:include href="xml/hdy-swipe-tracker.xml"/>
<xi:include href="xml/hdy-tab-bar.xml"/>
<xi:include href="xml/hdy-tab-view.xml"/>
<xi:include href="xml/hdy-value-object.xml"/>
<xi:include href="xml/hdy-view-switcher.xml"/>
<xi:include href="xml/hdy-view-switcher-bar.xml"/>
<xi:include href="xml/hdy-view-switcher-title.xml"/>
<xi:include href="xml/hdy-window.xml"/>
<xi:include href="xml/hdy-window-handle.xml"/>
</chapter>
<chapter id="helpers">
<title>Helpers</title>
<xi:include href="xml/hdy-version.xml"/>
<xi:include href="xml/hdy-main.xml"/>
</chapter>
<chapter id="deprecated">
<title>Deprecated</title>
<xi:include href="xml/hdy-swipe-group.xml"/>
<xi:include href="xml/hdy-title-bar.xml"/>
</chapter>
<chapter id="migrating">
<title>Migrating from Previous Versions of Handy</title>
<xi:include href="hdy-migrating-0-0-to-1.xml"/>
</chapter>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index id="deprecated-api-index" role="deprecated">
<title>Index of deprecated API</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-0-6" role="0.0.6">
<title>Index of new symbols in 0.0.6</title>
<xi:include href="xml/api-index-0.0.6.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-0-7" role="0.0.7">
<title>Index of new symbols in 0.0.7</title>
<xi:include href="xml/api-index-0.0.7.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-0-8" role="0.0.8">
<title>Index of new symbols in 0.0.8</title>
<xi:include href="xml/api-index-0.0.8.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-0-10" role="0.0.10">
<title>Index of new symbols in 0.0.10</title>
<xi:include href="xml/api-index-0.0.10.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-0-11" role="0.0.11">
<title>Index of new symbols in 0.0.11</title>
<xi:include href="xml/api-index-0.0.11.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-0-0-12" role="0.0.12">
<title>Index of new symbols in 0.0.12</title>
<xi:include href="xml/api-index-0.0.12.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-1-0" role="1.0">
<title>Index of new symbols in 1.0</title>
<xi:include href="xml/api-index-1.0.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-1-2" role="1.2">
<title>Index of new symbols in 1.2</title>
<xi:include href="xml/api-index-1.2.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-1-4" role="1.4">
<title>Index of new symbols in 1.4</title>
<xi:include href="xml/api-index-1.4.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-1-6" role="1.6">
<title>Index of new symbols in 1.6</title>
<xi:include href="xml/api-index-1.6.xml"><xi:fallback /></xi:include>
</index>
<index id="annotations-glossary">
<title>Annotations glossary</title>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</index>
</book>
Title: Migrating from Handy 0.0.x to Handy 1
Slug: migrating-from-handy-0-to-1
# Migrating from Handy 0.0.x to Handy 1
Handy 1 is a major new version of Handy that breaks both API and ABI compared to
Handy 0.0.x. Thankfully, most of the changes are not hard to adapt to and there
are a number of steps that you can take to prepare your Handy 0.0.x application
for the switch to Handy 1. After that, there's a number of adjustments that you
may have to do when you actually switch your application to build against Handy
1.
## Preparation in Handy 0.0.x
The steps outlined in the following sections assume that your application is
working with Handy 0.0.13, which is the final stable release of Handy 0.0.x. It
includes all the necessary APIs and tools to help you port your application to
Handy 1. If you are using an older version of Handy 0.0.x, you should first get
your application to build and work with Handy 0.0.13.
### Do not use the static build option
Static linking support has been removed, and so did the static build option. You
must adapt you program to link to the library dynamically, using the
`package_subdir` build option if needed.
### Do not use deprecated symbols
Over the years, a number of functions, and in some cases, entire widgets have
been deprecated. These deprecations are clearly spelled out in the API
reference, with hints about the recommended replacements. The API reference for
GTK 3 also includes an
[index](https://developer.puri.sm/projects/libhandy/unstable/deprecated-api-index.html)
of all deprecated symbols.
## Changes that need to be done at the time of the switch
This section outlines porting tasks that you need to tackle when you get to the
point that you actually build your application against Handy 1. Making it
possible to prepare for these in Handy 0.0 would have been either impossible or
impractical.
### `hdy_init()` takes no parameters
[func@init] has been modified to take no parameters. It must be called just
after initializing GTK, if you are using [class@Gtk.Application] it means it
must be called when the [signal@Gio.Application::startup] signal is emitted.
It initializes the localization, the types, the themes, and the icons.
### Adapt to widget constructor changes
All widget constructors now return the [class@Gtk.Widget] type rather than the
constructed widget's type, following the same convention as GTK 3.
Affected widgets:
* [class@ActionRow]
* [class@ComboRow]
* [class@ExpanderRow]
* [class@PreferencesGroup]
* [class@PreferencesPage]
* [class@PreferencesRow]
* [class@PreferencesWindow]
* [class@Squeezer]
* [class@TitleBar]
* [class@ViewSwitcherBar]
* [class@ViewSwitcher]
### Adapt to derivability changes
Some widgets are now final, if your code is deriving from them, use composition
instead.
Affected widgets:
* [class@Squeezer]
* [class@ViewSwitcherBar]
* [class@ViewSwitcher]
### HdyFold has been removed
HdyFold has been removed. This affects the API of [class@Leaflet], see the
[Adapt to HdyLeaflet API changes](#adapt-to-hdyleaflet-api-changes) section to know how.
### Replace HdyColumn by HdyClamp
HdyColumn has been renamed [class@Clamp] as it now implements
[iface@Gtk.Orientable], so you should replace the former by the later. Its
`maximum-width` and `linear-growth-width` properties have been renamed
[property@Clamp:maximum-size] and [property@Clamp:tightening-threshold]
respectively to better reflect their role. It won't set the `.narrow`, `.medium`
and `.wide` style classes depending on its size, but the `.small`, `.medium` and
`.large` ones instead.
### Adapt to HdyPaginator API changes
HdyPaginator has been renamed [class@Carousel], so you should replace the former
by the later.
The `indicator-style`, `indicator-spacing` and `center-content` properties have
been removed, instead use [class@CarouselIndicatorDots] or
[class@CarouselIndicatorLines] widgets.
### Adapt to HdyHeaderGroup API changes
The [class@HeaderGroup] object has been largely redesigned, most of its methods
changed, see its documentation to know more.
The child type is now [class@HeaderGroupChild], which can represent either a
[class@Gtk.HeaderBar], a [class@HeaderBar], or a [class@HeaderGroup].
The `focus` property has been replaced by [property@HeaderGroup:decorate-all],
which works quite differently.
### Adapt to HdyLeaflet API changes
The HdyFold type has been removed in favor of using a boolean, and
[class@Leaflet] adjusted to that as the `fold` property has been removed in
favor of [property@Leaflet:folded]. Also, the [method@Leaflet.get_homogeneous]
and [method@Leaflet.set_homogeneous] getters take a boolean parameter instead of
a HdyFold.
On touchscreens, swiping forward with the `over` transition and swiping back
with the `under` transition can now only be done from the edge where the upper
child is.
The `over` and `under` transitions can draw their shadow on top of the window's
transparent areas, like the rounded corners. This is a side-effect of allowing
shadows to be drawn on top of OpenGL areas. It can be mitigated by using
[class@Window] or [class@ApplicationWindow] as they will crop anything drawn
beyond the rounded corners.
The `allow-visible` child property has been renamed `navigatable`.
The `none` transition type has been removed. The default value for the
[property@Leaflet:transition-type] property has been changed to `over`. `over`
is the recommended transition for typical [class@Leaflet] use-cases, if this
isn't what you want to use, be sure to adapt your code. If transitions are
undesired, set [property@Leaflet:mode-transition-duration] and
[property@Leaflet:child-transition-duration] properties to `0`.
### Adapt to HdyViewSwitcher API changes
[class@ViewSwitcher] doesn't subclass [class@Gtk.Box] anymore. Instead, it
subclasses [class@Gtk.Bin] and contains a box.
The `icon-size` property has been dropped without replacement, you must stop
using it.
### Adapt to HdyViewSwitcherBar API changes
[class@ViewSwitcherBar] won't be revealed if the
[property@ViewSwitcherBar:stack] property is `NULL` or if it has less than two
pages, even if you set [property@ViewSwitcherBar:reveal] to `TRUE`.
The `icon-size` property has been dropped without replacement, you must stop
using it.
### Adapt to CSS node name changes
Widgets with a custom CSS node name got their name changed to be the class' name
in lowercase, with no separation between words, and with no namespace prefix.
E.g. the CSS node name of [class@ViewSwitcher] is `viewswitcher`.
### Adapt to HdyActionRow API changes
Action items were packed from the end toward the start of the row. It is now
reversed, and widgets have to be packed from the start to the end.
It isn't possible to add children at the bottom of a [class@ActionRow] anymore,
instead use other widgets like [class@ExpanderRow]. Widgets added to a
[class@ActionRow] will now be added at the end of the row, and the
`hdy_action_row_add_action()` method and the action child type have been removed.
The main horizontal box of [class@ActionRow] had the row-header CSS style class,
it now has the header CSS style class and can hence be accessed as `box.header`
subnode.
[class@ActionRow] is now unactivatable by default, giving it an activatable
widget will automatically make it activatable.
### Adapt to HdyComboRow API changes
[class@ComboRow] is now unactivatable by default, binding and unbinding a model
will toggle its activatability.
### Adapt to HdyExpanderRow API changes
[class@ExpanderRow] doesn't descend from [class@ActionRow] anymore but from
[class@PreferencesRow]. It reimplements some features from [class@ActionRow],
like the [property@PreferencesRow:title], [property@ExpanderRow:subtitle],
[property@PreferencesRow:use-underline] and [property@ExpanderRow:icon-name],
but it doesn't offer the "activate" signal nor the ability to add widgets in its
header row.
Widgets you add to it will be added to its inner [class@Gtk.ListBox].
### Adapt to HdyPreferencesPage API changes
[class@PreferencesPage] doesn't subclass [class@Gtk.ScrolledWindow] anymore.
Instead, it subclasses [class@Gtk.Bin] and contains a scrolled window.
### Adapt to HdyPreferencesGroup API changes
[class@PreferencesGroup] doesn't subclass [class@Gtk.Box] anymore. Instead, it
subclasses [class@Gtk.Bin] and contains a box.
### Adapt to HdyKeypad API changes
[class@Keypad] doesn't subclass [class@Gtk.Grid] anymore. Instead, it subclasses
[class@Gtk.Bin] and contains a grid.
The `show-symbols` property has been replaced by
[property@Keypad:letters-visible].
The `only-digits` property has been replaced by
[property@Keypad:symbols-visible], which has a inverse boolean meaning. This
also affects the corresponding parameter of the constructor.
The `left-action` property has been replaced by [property@Keypad:start-action],
and the `right-action` property has been replaced by
[property@Keypad:end-action].
The `entry` property isn't a [class@Gtk.Widget] anymore but a [class@Gtk.Entry].
### Stop using `hdy_list_box_separator_header()`
Instead, either use CSS styling (the `list.content` style class may fit your
need), or implement it yourself as it is trivial.
### Stop acknowledging the instability
When the library was young and changing a lot, we required you to acknowledge
that your are using an unstable API. To do so, you had to define
`HANDY_USE_UNSTABLE_API` for compilation to succeed.
The API remained stable since many versions, despite this acknowledgment still
being required. To reflect that proven stability, the acknowledgment isn't
necessary and you can stop defining `HANDY_USE_UNSTABLE_API`, either before
including the Libhandy; header in C-compatible languages, or with the definition
option of your compiler.
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
%gtkdocentities;
]>
<refentry id="hdy-migrating-0-0-to-1">
<refmeta>
<refentrytitle>Migrating from Handy 0.0.x to Handy 1</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>Migrating from Handy 0.0.x to Handy 1</refname><refpurpose>Notes on migration to Handy 1.</refpurpose>
</refnamediv>
<para>
Handy 1 is a major new version of Handy that breaks both API and ABI
compared to Handy 0.0.x. Thankfully, most of the changes are not hard to
adapt to and there are a number of steps that you can take to prepare your
Handy 0.0.x application for the switch to Handy 1. After that, there's a
number of adjustments that you may have to do when you actually switch your
application to build against Handy 1.
</para>
<refsect2>
<title>Preparation in Handy 0.0.x</title>
<para>
The steps outlined in the following sections assume that your application
is working with Handy 0.0.13, which is the final stable release of Handy
0.0.x. It includes all the necessary APIs and tools to help you port your
application to Handy 1. If you are using an older version of Handy 0.0.x,
you should first get your application to build and work with Handy 0.0.13.
</para>
<refsect3>
<title>Do not use the static build option</title>
<para>
Static linking support has been removed, and so did the static build
option.
You must adapt you program to link to the library dynamically, using
the package_subdir build option if needed.
</para>
</refsect3>
<refsect3>
<title>Do not use deprecated symbols</title>
<para>
Over the years, a number of functions, and in some cases, entire widgets
have been deprecated. These deprecations are clearly spelled out in the
API reference, with hints about the recommended replacements.
The API reference for GTK 3 also includes an
<ulink url="https://developer.puri.sm/projects/libhandy/unstable/deprecated-api-index.html">index</ulink>
of all deprecated symbols.
</para>
</refsect3>
</refsect2>
<refsect2>
<title>Changes that need to be done at the time of the switch</title>
<para>
This section outlines porting tasks that you need to tackle when you get
to the point that you actually build your application against Handy 1.
Making it possible to prepare for these in Handy 0.0 would have been
either impossible or impractical.
</para>
<refsect3>
<title>hdy_init takes no parameters</title>
<para>
hdy_init() has been modified to take no parameters.
It must be called just after initializing GTK, if you are using
#GtkApplication it means it must be called when the
#GApplication::startup signal is emitted.
</para>
<para>
It initializes the localization, the types, the themes, and the icons.
</para>
</refsect3>
<refsect3>
<title>Adapt to widget constructor changes</title>
<para>
All widget constructors now return the #GtkWidget type rather than the
constructed widget's type, following the same convention as GTK 3.
</para>
<para>
Affected widgets:
#HdyActionRow, #HdyComboRow, #HdyExpanderRow,
#HdyPreferencesGroup, #HdyPreferencesPage, #HdyPreferencesRow,
#HdyPreferencesWindow, #HdySqueezer, #HdyTitleBar, #HdyViewSwitcherBar,
#HdyViewSwitcher
</para>
</refsect3>
<refsect3>
<title>Adapt to derivability changes</title>
<para>
Some widgets are now final, if your code is deriving from them, use
composition instead.
</para>
<para>
Affected widgets:
#HdySqueezer, #HdyViewSwitcher, #HdyViewSwitcherBar
</para>
</refsect3>
<refsect3>
<title>HdyFold has been removed</title>
<para>
#HdyFold has been removed. This affects the API of #HdyLeaflet, see the
“Adapt to HdyLeaflet API changes” section to know how.
</para>
</refsect3>
<refsect3>
<title>Replace HdyColumn by HdyClamp</title>
<para>
HdyColumn has been renamed #HdyClamp as it now implements
#GtkOrientable, so you should replace the former by the later.
Its “maximum-width” and “linear-growth-width” properties have been
renamed #HdyClamp:maximum-size and #HdyClamp:tightening-threshold
respectively to better reflect their role.
It won't set the .narrow, .medium and .wide style classes depending on
its size, but the .small, .medium and .large ones instead.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyPaginator API changes</title>
<para>
HdyPaginator has been renamed HdyCarousel, so you should replace the
former by the later.
</para>
<para>
The “indicator-style”, “indicator-spacing” and “center-content”
properties have been removed, instead use #HdyCarouselIndicatorDots
or #HdyCarouselIndicatorLines widgets.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyHeaderGroup API changes</title>
<para>
The #HdyHeaderGroup object has been largely redesigned, most of its
methods changed, see its documentation to know more.
</para>
<para>
The child type is now #HdyHeaderGroupChild, which can represent either
a #GtkHeaderBar, a #HdyHeaderBar, or a #HdyHeaderGroup.
</para>
<para>
The “focus” property has been replaced by #HdyHeaderGroup:decorate-all,
which works quite differently.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyLeaflet API changes</title>
<para>
The #HdyFold type has been removed in favor of using a boolean, and
#HdyLeaflet adjusted to that as the #HdyLeaflet:fold property has been
removed in favor of #HdyLeaflet:folded.
Also, the hdy_leaflet_get_homogeneous() and
hdy_leaflet_set_homogeneous() accessors take a boolean parameter instead
of a #HdyFold.
</para>
<para>
On touchscreens, swiping forward with the “over” transition and swiping
back with the “under” transition can now only be done from the edge
where the upper child is.
</para>
<para>
The “over” and “under” transitions can draw their shadow on top of the
window's transparent areas, like the rounded corners.
This is a side-effect of allowing shadows to be drawn on top of OpenGL
areas.
It can be mitigated by using #HdyWindow or #HdyApplicationWindow as they
will crop anything drawn beyond the rounded corners.
</para>
<para>
The “allow-visible” child property has been renamed “navigatable”.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyLeaflet API changes</title>
<para>
The “none” transition type has been removed. The default value for the
#HdyLeaflet:transition-type property has been changed to “over”.
“over” is the recommended transition for typical #HdyLeaflet use-cases,
if this isn't what you want to use, be sure to adapt your code. If
transitions are undesired, set #HdyLeaflet:mode-transition-duration and
#HdyLeaflet:child-transition-duration properties to 0.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyViewSwitcher API changes</title>
<para>
#HdyViewSwitcher doesn't subclass #GtkBox anymore. Instead, it
subclasses #GtkBin and contains a box.
</para>
<para>
The “icon-size” property has been dropped without replacement, you must
stop using it.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyViewSwitcherBar API changes</title>
<para>
#HdyViewSwitcherBar won't be revealed if the #HdyViewSwitcherBar:stack
property is %NULL or if it has less than two pages, even if you set
#HdyViewSwitcherBar:reveal to %TRUE.
</para>
<para>
The “icon-size” property has been dropped without replacement, you must
stop using it.
</para>
</refsect3>
<refsect3>
<title>Adapt to CSS node name changes</title>
<para>
Widgets with a customn CSS node name got their name changed to be the
class' name in lowercase, with no separation between words, and with no
namespace prefix. E.g. the CSS node name of HdyViewSwitcher is
viewswitcher.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyActionRow API changes</title>
<para>
Action items were packed from the end toward the start of the row. It is
now reversed, and widgets have to be packed from the start to the end.
</para>
<para>
It isn't possible to add children at the bottom of a #HdyActionRow
anymore, instead use other widgets like #HdyExpanderRow.
Widgets added to a #HdyActionRow will now be added at the end of the
row, and the hdy_action_row_add_action() method and the action child
type have been removed.
</para>
<para>
The main horizontal box of #HdyActionRow had the row-header CSS style
class, it now has the header CSS style class and can hence be accessed
as box.header subnode.
</para>
<para>
#HdyActionRow is now unactivatable by default, giving it an activatable
widget will automatically make it activatable.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyComboRow API changes</title>
<para>
#HdyComboRow is now unactivatable by default, binding and unbinding a
model will toggle its activatability.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyExpanderRow API changes</title>
<para>
#HdyExpanderRow doesn't descend from #HdyActionRow anymore but from
#HdyPreferencesRow.
It reimplement some features from #HdyActionRow, like the
#HdyExpanderRow:title, #HdyExpanderRow:subtitle,
#HdyExpanderRow:use-underline and #HdyExpanderRow:icon-name, but it
doesn't offer the “activate” signal nor the ability to add widgets in
its header row.
</para>
<para>
Widgets you add to it will be added to its inner #GtkListBox.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyPreferencesPage API changes</title>
<para>
#HdyPreferencesPage doesn't subclass #GtkScrolledWindow anymore.
Instead, it subclasses #GtkBin and contains a scrolled window.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyPreferencesGroup API changes</title>
<para>
#HdyPreferencesGroup doesn't subclass #GtkBox anymore.
Instead, it subclasses #GtkBin and contains a box.
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyKeypad API changes</title>
<para>
#HdyKeypad doesn't subclass #Gtkgrid anymore. Instead, it subclasses
#GtkBin and contains a grid.
</para>
<para>
The “show-symbols” property has been replaced by
#HdyHeaderGroup:letters-visible.
</para>
<para>
The “only-digits” property has been replaced by
#HdyHeaderGroup:symbols-visible, which has a inverse boolean meaning.
This also affects the corresponding parameter of the constructor.
</para>
<para>
The “left-action” property has been replaced by
#HdyKeypad:start-action, and the “right-action” property has been
replaced by #HdyKeypad:end-action.
</para>
<para>
The “entry” property isn't a #GtkWidget anymore but a #GtkEntry.
</para>
</refsect3>
<refsect3>
<title>Stop using hdy_list_box_separator_header()</title>
<para>
Instead, either use CSS styling (the list.content style class may
fit your need), or implement it yourself as it is trivial.
</para>
</refsect3>
<refsect3>
<title>Stop acknowledging the Instability</title>
<para>
When the library was young and changing a lot, we required you to
acknowledge that your are using an unstable API. To do so, you had to
define <literal>HANDY_USE_UNSTABLE_API</literal> for compilation to
succeed.
</para>
<para>
The API remained stable since many versions, despite this acknowlegment
still being required. To reflect that proven stability, the
acknowlegment isn't necessary and you can stop defining
<literal>HANDY_USE_UNSTABLE_API</literal>, either before including the
&package_string; header in C-compatible languages, or with the
definition option of your compiler.
</para>
</refsect3>
</refsect2>
</refentry>
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Handy &ndash; 1: Compiling with Libhandy</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="libhandy.svg"/>
<meta property="og:image:alt" content="Handy-1"/>
<meta property="og:title" content="Handy: Compiling with Libhandy"/>
<meta property="og:description" content="Reference for Handy-1: Compiling with Libhandy"/>
<meta name="twitter:title" content="Handy: Compiling with Libhandy"/>
<meta name="twitter:description" content="Reference for Handy-1: Compiling with Libhandy"/>
<meta name="twitter:card" content="summary"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<img src="libhandy.svg" class="logo"/>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Handy</a></h3>
<p>API Version: 1</p>
<p>Library Version: 1.5.90</p>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<section>
<div class="docblock">
<h1 id="compiling-with-libhandy">Compiling with Libhandy<a class="md-anchor" href="#compiling-with-libhandy" title="Permanent link"></a></h1>
<p>If you need to build Libhandy, get the source from
<a href="https://gitlab.gnome.org/GNOME/libhandy/">here</a> and see the <code>README.md</code> file.</p>
<h2 id="using-pkg-config">Using pkg-config<a class="md-anchor" href="#using-pkg-config" title="Permanent link"></a></h2>
<p>Like other <span class="caps">GNOME</span> libraries, Libhandy uses <code>pkg-config</code> to provide compiler
options. The package name is <code>libhandy-1</code>.</p>
<p>If you use Automake/Autoconf, in your <code>configure.ac</code> script, you might specify
something&nbsp;like:</p>
<div class="codehilite"><pre><span></span><code>PKG_CHECK_MODULES(LIBHANDY, [libhandy-1])
AC_SUBST(LIBHANDY_CFLAGS)
AC_SUBST(LIBHANDY_LIBS)
</code></pre></div>
<p>Or when using the Meson build system you can declare a dependency&nbsp;like:</p>
<div class="codehilite"><pre><span></span><code>dependency(&#39;libhandy-1&#39;)
</code></pre></div>
<p>The <code>1</code> in the package name is the &#8220;<span class="caps">API</span> version&#8221; (indicating &#8220;the version of the
Libhandy <span class="caps">API</span> that first appeared in version 1&#8221;) and is essentially just part of
the package&nbsp;name.</p>
<h2 id="bundling-the-library">Bundling the library<a class="md-anchor" href="#bundling-the-library" title="Permanent link"></a></h2>
<p>As Libhandy uses the Meson build system, bundling it as a subproject when it is
not installed is easy. Add this to your <code>meson.build</code>:</p>
<div class="codehilite"><pre><span></span><code>libhandy_dep = dependency(&#39;libhandy-1&#39;, version: &#39;&gt;= 1&#39;, required: false)
if not libhandy_dep.found()
libhandy = subproject(
&#39;libhandy&#39;,
install: false,
default_options: [
&#39;examples=false&#39;,
&#39;package_subdir=my-project-name&#39;,
&#39;tests=false&#39;,
]
)
libhandy_dep = libhandy.get_variable(&#39;libhandy_dep&#39;)
endif
</code></pre></div>
<p>Then add Libhandy as a git&nbsp;submodule:</p>
<div class="codehilite"><pre><span></span><code>git submodule add https://gitlab.gnome.org/GNOME/libhandy.git subprojects/libhandy
</code></pre></div>
<p>To bundle the library with your Flatpak application, add the following module to
your&nbsp;manifest:</p>
<div class="codehilite"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;name&quot;</span> <span class="p">:</span> <span class="s2">&quot;libhandy&quot;</span><span class="p">,</span>
<span class="nt">&quot;buildsystem&quot;</span> <span class="p">:</span> <span class="s2">&quot;meson&quot;</span><span class="p">,</span>
<span class="nt">&quot;config-opts&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;-Dexamples=false&quot;</span><span class="p">,</span>
<span class="s2">&quot;-Dtests=false&quot;</span>
<span class="p">],</span>
<span class="nt">&quot;sources&quot;</span> <span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;type&quot;</span> <span class="p">:</span> <span class="s2">&quot;git&quot;</span><span class="p">,</span>
<span class="nt">&quot;url&quot;</span> <span class="p">:</span> <span class="s2">&quot;https://gitlab.gnome.org/GNOME/libhandy.git&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</code></pre></div>
<h2 id="building-on-macos">Building on macOS<a class="md-anchor" href="#building-on-macos" title="Permanent link"></a></h2>
<p>To build on macOS you need to install the build-dependencies first. This can
e.g. be done via <a href="https://brew.sh">brew</a>:</p>
<div class="codehilite"><pre><span></span><code>brew install pkg-config gtk+3 adwaita-icon-theme meson glade gobject-introspection vala
</code></pre></div>
<p>After running the command above, one may now build the&nbsp;library:</p>
<div class="codehilite"><pre><span></span><code>git clone https://gitlab.gnome.org/GNOME/libhandy.git
<span class="nb">cd</span> libhandy
meson . _build
ninja -C _build <span class="nb">test</span>
ninja -C _build install
</code></pre></div>
<p>Working with the library on macOS is pretty much the same as on Linux. To link
it, use <code>pkg-config</code>:</p>
<div class="codehilite"><pre><span></span><code>gcc <span class="k">$(</span>pkg-config --cflags --libs gtk+-3.0<span class="k">)</span> <span class="k">$(</span>pkg-config --cflags --libs libhandy-1<span class="k">)</span> main.c -o main
</code></pre></div>
</div>
</section>
</section>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>
\ No newline at end of file
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Handy.AvatarImageLoadFunc</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="libhandy.svg"/>
<meta property="og:image:alt" content="Handy-1"/>
<meta property="og:title" content="Handy.AvatarImageLoadFunc"/>
<meta property="og:description" content="Reference for Handy.AvatarImageLoadFunc"/>
<meta name="twitter:title" content="Handy.AvatarImageLoadFunc"/>
<meta name="twitter:description" content="Reference for Handy.AvatarImageLoadFunc"/>
<meta name="twitter:card" content="summary"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<img src="libhandy.svg" class="logo"/>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Handy</a></h3>
<p>API Version: 1</p>
<p>Library Version: 1.5.90</p>
</div>
<div class="section">
<h5>Functions</h5>
<div class="links">
</div>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<header>
<h3>Function </h3>
<h1><a href="index.html">Handy</a><span class="sep"></span>AvatarImageLoadFunc</h1>
</header>
<section>
<div class="declaration toggle-wrapper">
<h4 id="declaration" style="display:flex;">
Declaration
<a href="#declaration" class="anchor"></a>
</h4>
<div class="docblock">
<pre><code><div class="highlight"><pre><span></span><span class="n">GdkPixbuf</span><span class="o">*</span>
<span class="n">AvatarImageLoadFunc</span> <span class="p">(</span>
<span class="n">gint</span> <span class="n">size</span><span class="p">,</span>
<span class="n">gpointer</span> <span class="n">user_data</span>
<span class="p">)</span>
</pre></div>
</code></pre>
</div>
</div>
<div class="description toggle-wrapper">
<h4 id="description" style="display:flex;">
Description
<a href="#description" class="anchor"></a>
<a class="srclink" title="go to source location" href="https://gitlab.gnome.org/GNOME/libhandy/-/blob/main/src/hdy-avatar.h#L25">[src]</a>
</h4>
<div class="docblock">
<p>Callback for loading an <a href="class.Avatar.html"><code>HdyAvatar</code></a>&#8216;s&nbsp;image.</p>
<p>The returned <a href="javascript:void(0)" data-namespace="GdkPixbuf" data-link="class.Pixbuf.html" class="external"><code>GdkPixbuf</code></a> is expected to be square with width and
height set to <code>size</code>. The image is cropped to a circle without any scaling or&nbsp;transformation.</p>
</div>
<div class="docblock">
<table>
<tr><td>Available since:</td><td>1.0</td></tr>
<tr><td>Deprecated since:</td><td>1.2</td></tr>
<tr><td colspan="2"><p>Use <a href="method.Avatar.set_loadable_icon.html"><code>hdy_avatar_set_loadable_icon()</code></a>&nbsp;instead.</p></td></tr>
</table>
</div>
</div>
<div class="parameters toggle-wrapper">
<h4 id="parameters">
Parameters
<a href="#parameters" class="anchor"></a>
</h4>
<div class="docblock">
<table class="arguments">
<tr class="arg-name">
<td><code>size</code></td>
<td><code>gint</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>The required size of the&nbsp;avatar.</p></td>
</tr>
<tr class="arg-name">
<td><code>user_data</code></td>
<td><code>gpointer</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>User&nbsp;data.</p></td>
</tr>
</table>
</div>
</div>
<div class="return-value toggle-wrapper">
<h4 id="return-value">
Return value
<a href="#return-value" class="anchor"></a>
</h4>
<div class="docblock">
<table class="returns">
<tr class="arg-name">
<td>Returns:</td>
<td><code>GdkPixbuf*</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>The pixbuf to use as a custom avatar or
<code>NULL</code> to fallback to the generated&nbsp;avatar.</p></td>
</tr>
<tr><td>&nbsp;</td><td title="transfer: full">The caller of the function takes ownership of the data, and is responsible for freeing it.</td></tr>
<tr><td>&nbsp;</td><td>The return value can be <code>NULL</code>.</td></tr>
</table>
</div>
</div>
</section>
</section>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>
\ No newline at end of file
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Handy.ComboRowGetEnumValueNameFunc</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="libhandy.svg"/>
<meta property="og:image:alt" content="Handy-1"/>
<meta property="og:title" content="Handy.ComboRowGetEnumValueNameFunc"/>
<meta property="og:description" content="Reference for Handy.ComboRowGetEnumValueNameFunc"/>
<meta name="twitter:title" content="Handy.ComboRowGetEnumValueNameFunc"/>
<meta name="twitter:description" content="Reference for Handy.ComboRowGetEnumValueNameFunc"/>
<meta name="twitter:card" content="summary"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<img src="libhandy.svg" class="logo"/>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Handy</a></h3>
<p>API Version: 1</p>
<p>Library Version: 1.5.90</p>
</div>
<div class="section">
<h5>Functions</h5>
<div class="links">
</div>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<header>
<h3>Function </h3>
<h1><a href="index.html">Handy</a><span class="sep"></span>ComboRowGetEnumValueNameFunc</h1>
</header>
<section>
<div class="declaration toggle-wrapper">
<h4 id="declaration" style="display:flex;">
Declaration
<a href="#declaration" class="anchor"></a>
</h4>
<div class="docblock">
<pre><code><div class="highlight"><pre><span></span><span class="n">gchar</span><span class="o">*</span>
<span class="n">ComboRowGetEnumValueNameFunc</span> <span class="p">(</span>
<span class="n">HdyEnumValueObject</span><span class="o">*</span> <span class="n">value</span><span class="p">,</span>
<span class="n">gpointer</span> <span class="n">user_data</span>
<span class="p">)</span>
</pre></div>
</code></pre>
</div>
</div>
<div class="description toggle-wrapper">
<h4 id="description" style="display:flex;">
Description
<a href="#description" class="anchor"></a>
<a class="srclink" title="go to source location" href="https://gitlab.gnome.org/GNOME/libhandy/-/blob/main/src/hdy-combo-row.h#L43">[src]</a>
</h4>
<div class="docblock">
<p>Callback for getting the name of a row from an&nbsp;enum.</p>
<p>Called for combo rows that are bound to an enumeration with
<a href="method.ComboRow.set_for_enum.html"><code>hdy_combo_row_set_for_enum()</code></a> for each value from that&nbsp;enumeration.</p>
<p>See also: <a href="func.enum_value_row_name.html"><code>hdy_enum_value_row_name()</code></a>.</p>
</div>
<div class="docblock">
<table>
<tr><td>Available since:</td><td>1.0</td></tr>
</table>
</div>
</div>
<div class="parameters toggle-wrapper">
<h4 id="parameters">
Parameters
<a href="#parameters" class="anchor"></a>
</h4>
<div class="docblock">
<table class="arguments">
<tr class="arg-name">
<td><code>value</code></td>
<td><a href="class.EnumValueObject.html"><code>HdyEnumValueObject</code></a></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>The value from the enum from which to get a&nbsp;name.</p></td>
</tr>
<tr><td>&nbsp;</td><td title="transfer: none">The data is owned by the caller of the function.</td></tr>
<tr class="arg-name">
<td><code>user_data</code></td>
<td><code>gpointer</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>User&nbsp;data.</p></td>
</tr>
</table>
</div>
</div>
<div class="return-value toggle-wrapper">
<h4 id="return-value">
Return value
<a href="#return-value" class="anchor"></a>
</h4>
<div class="docblock">
<table class="returns">
<tr class="arg-name">
<td>Returns:</td>
<td><code>gchar*</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>A displayable name that represents <code>value</code>.</p></td>
</tr>
<tr><td>&nbsp;</td><td title="transfer: full">The caller of the function takes ownership of the data, and is responsible for freeing it.</td></tr>
<tr><td>&nbsp;</td><td>The string is a NUL terminated UTF-8 string.</td></tr>
</table>
</div>
</div>
</section>
</section>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>
\ No newline at end of file
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Handy.ComboRowGetNameFunc</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="libhandy.svg"/>
<meta property="og:image:alt" content="Handy-1"/>
<meta property="og:title" content="Handy.ComboRowGetNameFunc"/>
<meta property="og:description" content="Reference for Handy.ComboRowGetNameFunc"/>
<meta name="twitter:title" content="Handy.ComboRowGetNameFunc"/>
<meta name="twitter:description" content="Reference for Handy.ComboRowGetNameFunc"/>
<meta name="twitter:card" content="summary"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<img src="libhandy.svg" class="logo"/>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Handy</a></h3>
<p>API Version: 1</p>
<p>Library Version: 1.5.90</p>
</div>
<div class="section">
<h5>Functions</h5>
<div class="links">
</div>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<header>
<h3>Function </h3>
<h1><a href="index.html">Handy</a><span class="sep"></span>ComboRowGetNameFunc</h1>
</header>
<section>
<div class="declaration toggle-wrapper">
<h4 id="declaration" style="display:flex;">
Declaration
<a href="#declaration" class="anchor"></a>
</h4>
<div class="docblock">
<pre><code><div class="highlight"><pre><span></span><span class="n">gchar</span><span class="o">*</span>
<span class="n">ComboRowGetNameFunc</span> <span class="p">(</span>
<span class="n">GObject</span><span class="o">*</span> <span class="n">item</span><span class="p">,</span>
<span class="n">gpointer</span> <span class="n">user_data</span>
<span class="p">)</span>
</pre></div>
</code></pre>
</div>
</div>
<div class="description toggle-wrapper">
<h4 id="description" style="display:flex;">
Description
<a href="#description" class="anchor"></a>
<a class="srclink" title="go to source location" href="https://gitlab.gnome.org/GNOME/libhandy/-/blob/main/src/hdy-combo-row.h#L26">[src]</a>
</h4>
<div class="docblock">
<p>Callback for getting the name of a&nbsp;row.</p>
<p>Called for combo rows that are bound to a <a href="javascript:void(0)" data-namespace="Gio" data-link="iface.ListModel.html" class="external"><code>GListModel</code></a> with
<a href="method.ComboRow.bind_name_model.html"><code>hdy_combo_row_bind_name_model()</code></a> for each item that gets added to the&nbsp;model.</p>
</div>
<div class="docblock">
<table>
<tr><td>Available since:</td><td>1.0</td></tr>
</table>
</div>
</div>
<div class="parameters toggle-wrapper">
<h4 id="parameters">
Parameters
<a href="#parameters" class="anchor"></a>
</h4>
<div class="docblock">
<table class="arguments">
<tr class="arg-name">
<td><code>item</code></td>
<td><code>GObject*</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>The item from the model from which to get a&nbsp;name.</p></td>
</tr>
<tr><td>&nbsp;</td><td title="transfer: none">The data is owned by the caller of the function.</td></tr>
<tr class="arg-name">
<td><code>user_data</code></td>
<td><code>gpointer</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>User&nbsp;data.</p></td>
</tr>
</table>
</div>
</div>
<div class="return-value toggle-wrapper">
<h4 id="return-value">
Return value
<a href="#return-value" class="anchor"></a>
</h4>
<div class="docblock">
<table class="returns">
<tr class="arg-name">
<td>Returns:</td>
<td><code>gchar*</code></td>
</tr>
<tr class="arg-description">
<td>&nbsp;</td>
<td><p>A displayable name that represents <code>item</code>.</p></td>
</tr>
<tr><td>&nbsp;</td><td title="transfer: full">The caller of the function takes ownership of the data, and is responsible for freeing it.</td></tr>
<tr><td>&nbsp;</td><td>The string is a NUL terminated UTF-8 string.</td></tr>
</table>
</div>
</div>
</section>
</section>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Handy.ApplicationWindow</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="libhandy.svg"/>
<meta property="og:image:alt" content="Handy-1"/>
<meta property="og:title" content="Handy.ApplicationWindow"/>
<meta property="og:description" content="Reference for Handy.ApplicationWindow"/>
<meta name="twitter:title" content="Handy.ApplicationWindow"/>
<meta name="twitter:description" content="Reference for Handy.ApplicationWindow"/>
<meta name="twitter:card" content="summary"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<img src="libhandy.svg" class="logo"/>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Handy</a></h3>
<p>API Version: 1</p>
<p>Library Version: 1.5.90</p>
</div>
<div class="section">
<h5>Type</h5>
<div class="links">
<a class="current" href="class.ApplicationWindow.html#description">ApplicationWindow</a>
</div>
</div>
<div class="section">
<h5>Constructors</h5>
<div class="links">
<a class="ctor" href="ctor.ApplicationWindow.new.html">new</a>
</div>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<header>
<h3>Class</h3>
<h1 aria-label="Name"><a href="index.html">Handy</a><span class="sep" role="presentation"></span>ApplicationWindow</h1>
</header>
<section>
<summary>
<div class="toggle-wrapper">
<h4 id="description" style="display:flex;">
Description
<a href="#description" class="anchor"></a>
<a class="srclink" title="go to source location" href="https://gitlab.gnome.org/GNOME/libhandy/-/blob/main/src/hdy-application-window.c#L12">[src]</a>
</h4>
<pre><code>class Handy.ApplicationWindow : Gtk.ApplicationWindow {
parent_instance: GtkApplicationWindow
}</pre></code>
<div class="docblock">
<p>A freeform application&nbsp;window.</p>
<p><code>HdyApplicationWindow</code> is a <a href="javascript:void(0)" data-namespace="Gtk" data-link="class.ApplicationWindow.html" class="external"><code>GtkApplicationWindow</code></a> subclass providing
the same features as <a href="class.Window.html"><code>HdyWindow</code></a>.</p>
<p>See <a href="class.Window.html"><code>HdyWindow</code></a> for&nbsp;details.</p>
<p>Using <a href="javascript:void(0)" data-namespace="Gtk" data-link="method.Application.set_app_menu.html" class="external"><code>gtk_application_set_app_menu()</code></a> and
<a href="javascript:void(0)" data-namespace="Gtk" data-link="method.Application.set_menubar.html" class="external"><code>gtk_application_set_menubar()</code></a> is not supported and may result in
visual&nbsp;glitches.</p>
</div>
<div class="docblock">
<table class="attributes">
<tr><td>Available since:</td><td>1.0</td></tr>
</table>
</div>
</div>
</summary>
<div class="toggle-wrapper ancestors">
<h4 id="ancestors">
Ancestors
<a href="#ancestors" class="anchor"></a>
</h4>
<div class="docblock">
<ul>
<li class="class">GtkApplicationWindow</a></li>
<li class="class">GtkWindow</a></li>
<li class="class">GtkBin</a></li>
<li class="class">GtkContainer</a></li>
<li class="class">GtkWidget</a></li>
<li class="class">GInitiallyUnowned</a></li>
<li class="class">GObject</a></li>
</ul>
</div>
</div>
<div class="toggle-wrapper implements">
<h4 id="implements">
Implements
<a href="#implements" class="anchor"></a>
</h4>
<div class="docblock">
<ul>
<li class="interface">AtkImplementorIface</a></li>
<li class="interface">GActionGroup</a></li>
<li class="interface">GActionMap</a></li>
<li class="interface">GtkBuildable</a></li>
</ul>
</div>
</div>
<div class="toggle-wrapper constructors">
<h4 id="constructors">
Constructors
<a href="#constructors" class="anchor"></a>
</h4>
<div class="docblock">
<div class="">
<h6><a href="ctor.ApplicationWindow.new.html">hdy_application_window_new</a></h6>
<div class="docblock">
<p>Creates a new <code>HdyApplicationWindow</code>.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
</div>
</div>
<div class="class toggle-wrapper default-hide">
<h4 id="class-struct">
Class structure
<a href="#class-struct" class="anchor"></a>
</h4>
<div class="docblock">
<pre><code>struct HandyApplicationWindowClass {
GtkApplicationWindowClass parent_class;
}</code></pre>
</div>
<div class="docblock">
<h6>Class members</h6>
<table class="members">
<tr>
<td style="vertical-align:top"><code>parent_class</code></td>
<td style="vertical-align:top"><pre><code>GtkApplicationWindowClass</code></pre></td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="vertical-align:top">No description available.</td>
</td>
</table>
</div>
</div>
</section>
</section>
<div class="toc">
<nav aria-labelledby="toc-title">
<p id="toc-title">Content</p>
<ul class="toc-list">
<li class="toc-list-item"><a href="#description"><span class="link-text">Description</span></a></li>
<li class="toc-list-item"><a href="#ancestors"><span class="link-text">Ancestors</span></a></li>
<li class="toc-list-item"><a href="#implements"><span class="link-text">Implements</span></a></li>
<li class="toc-list-item"><a href="#constructors"><span class="link-text">Constructors</span></a></li>
</ul>
</nav>
</div>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>
\ No newline at end of file
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!--
SPDX-FileCopyrightText: 2021 GNOME Foundation
SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Handy.Avatar</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta property="og:type" content="website"/>
<meta property="og:image:width" content="256"/>
<meta property="og:image:height" content="256"/>
<meta property="og:image:secure_url" content="libhandy.svg"/>
<meta property="og:image:alt" content="Handy-1"/>
<meta property="og:title" content="Handy.Avatar"/>
<meta property="og:description" content="Reference for Handy.Avatar"/>
<meta name="twitter:title" content="Handy.Avatar"/>
<meta name="twitter:description" content="Reference for Handy.Avatar"/>
<meta name="twitter:card" content="summary"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="urlmap.js"></script>
<script src="fzy.js"></script>
<script src="search.js"></script>
<script src="main.js"></script>
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="body-wrapper" tabindex="-1">
<nav class="sidebar devhelp-hidden">
<div class="section">
<img src="libhandy.svg" class="logo"/>
</div>
<div class="search section">
<form id="search-form" autocomplete="off">
<input id="search-input" type="text" name="do-not-autocomplete" placeholder="Click, or press 's' to search" autocomplete="off"/>
</form>
</div>
<div class="section namespace">
<h3><a href="index.html">Handy</a></h3>
<p>API Version: 1</p>
<p>Library Version: 1.5.90</p>
</div>
<div class="section">
<h5>Type</h5>
<div class="links">
<a class="current" href="class.Avatar.html#description">Avatar</a>
</div>
</div>
<div class="section">
<h5>Constructors</h5>
<div class="links">
<a class="ctor" href="ctor.Avatar.new.html">new</a>
</div>
</div>
<div class="section">
<h5>Instance methods</h5>
<div class="links">
<a class="method" href="method.Avatar.draw_to_pixbuf.html">draw_to_pixbuf</a>
<a class="method" href="method.Avatar.draw_to_pixbuf_async.html">draw_to_pixbuf_async</a>
<a class="method" href="method.Avatar.draw_to_pixbuf_finish.html">draw_to_pixbuf_finish</a>
<a class="method" href="method.Avatar.get_icon_name.html">get_icon_name</a>
<a class="method" href="method.Avatar.get_loadable_icon.html">get_loadable_icon</a>
<a class="method" href="method.Avatar.get_show_initials.html">get_show_initials</a>
<a class="method" href="method.Avatar.get_size.html">get_size</a>
<a class="method" href="method.Avatar.get_text.html">get_text</a>
<a class="method" href="method.Avatar.set_icon_name.html">set_icon_name</a>
<a class="method" href="method.Avatar.set_image_load_func.html">set_image_load_func</a>
<a class="method" href="method.Avatar.set_loadable_icon.html">set_loadable_icon</a>
<a class="method" href="method.Avatar.set_show_initials.html">set_show_initials</a>
<a class="method" href="method.Avatar.set_size.html">set_size</a>
<a class="method" href="method.Avatar.set_text.html">set_text</a>
</div>
</div>
<div class="section">
<h5>Properties</h5>
<div class="links">
<a class="property" href="property.Avatar.icon-name.html">icon-name</a>
<a class="property" href="property.Avatar.loadable-icon.html">loadable-icon</a>
<a class="property" href="property.Avatar.show-initials.html">show-initials</a>
<a class="property" href="property.Avatar.size.html">size</a>
<a class="property" href="property.Avatar.text.html">text</a>
</div>
</div>
</nav>
<button id="btn-to-top" class="hidden"><span class="up-arrow"></span></button>
<section id="main" class="content">
<header>
<h3>Class</h3>
<h1 aria-label="Name"><a href="index.html">Handy</a><span class="sep" role="presentation"></span>Avatar</h1>
</header>
<section>
<summary>
<div class="toggle-wrapper">
<h4 id="description" style="display:flex;">
Description
<a href="#description" class="anchor"></a>
<a class="srclink" title="go to source location" href="https://gitlab.gnome.org/GNOME/libhandy/-/blob/main/src/hdy-avatar.c#L23">[src]</a>
</h4>
<pre><code>final class Handy.Avatar : Gtk.DrawingArea {
/* No available fields */
}</pre></code>
<div class="docblock">
<p>A widget displaying an image, with a generated&nbsp;fallback.</p>
<p><code>HdyAvatar</code> is a widget to display a round&nbsp;avatar.</p>
<p>A provided image is made round before displaying, if no image is given this
widget generates a round fallback with the initials of the
<a href="property.Avatar.text.html"><code>HdyAvatar:text</code></a> on top of a colored&nbsp;background.</p>
<p>The color is picked based on the hash of the <a href="property.Avatar.text.html"><code>HdyAvatar:text</code></a>.</p>
<p>If <a href="property.Avatar.show-initials.html"><code>HdyAvatar:show-initials</code></a> is set to <code>FALSE</code>,
<code>avatar-default-symbolic</code> is shown instead of the&nbsp;initials.</p>
<p>Use <a href="method.Avatar.set_loadable_icon.html"><code>hdy_avatar_set_loadable_icon()</code></a> or <a href="property.Avatar.loadable-icon.html"><code>HdyAvatar:loadable-icon</code></a> to
set a custom&nbsp;image.</p>
<h2 id="css-nodes">CSS nodes<a class="md-anchor" href="#css-nodes" title="Permanent link"></a></h2>
<p><code>HdyAvatar</code> has a single <span class="caps">CSS</span> node with name <code>avatar</code>.</p>
</div>
<div class="docblock">
<table class="attributes">
<tr><td>Available since:</td><td>1.0</td></tr>
</table>
</div>
</div>
</summary>
<div class="toggle-wrapper ancestors">
<h4 id="ancestors">
Ancestors
<a href="#ancestors" class="anchor"></a>
</h4>
<div class="docblock">
<ul>
<li class="class">GtkDrawingArea</a></li>
<li class="class">GtkWidget</a></li>
<li class="class">GInitiallyUnowned</a></li>
<li class="class">GObject</a></li>
</ul>
</div>
</div>
<div class="toggle-wrapper implements">
<h4 id="implements">
Implements
<a href="#implements" class="anchor"></a>
</h4>
<div class="docblock">
<ul>
<li class="interface">AtkImplementorIface</a></li>
<li class="interface">GtkBuildable</a></li>
</ul>
</div>
</div>
<div class="toggle-wrapper constructors">
<h4 id="constructors">
Constructors
<a href="#constructors" class="anchor"></a>
</h4>
<div class="docblock">
<div class="">
<h6><a href="ctor.Avatar.new.html">hdy_avatar_new</a></h6>
<div class="docblock">
<p>Creates a new <code>HdyAvatar</code>.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
</div>
</div>
<div class="toggle-wrapper methods">
<h4 id="methods">
Instance methods
<a href="#methods" class="anchor"></a>
</h4>
<div class="docblock">
<div class="">
<h6><a href="method.Avatar.draw_to_pixbuf.html">hdy_avatar_draw_to_pixbuf</a></h6>
<div class="docblock">
<p>Renders <code>self</code> into a <code>GdkPixbuf</code> at <code>size</code> and <code>scale_factor</code>.</p>
</div>
<div class="docblock"><p>Available since: 1.2</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.draw_to_pixbuf_async.html">hdy_avatar_draw_to_pixbuf_async</a></h6>
<div class="docblock">
<p>Renders asynchronously <code>self</code> into a pixbuf at <code>size</code> and <code>scale_factor</code>.</p>
</div>
<div class="docblock"><p>Available since: 1.2</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.draw_to_pixbuf_finish.html">hdy_avatar_draw_to_pixbuf_finish</a></h6>
<div class="docblock">
<p>Finishes an asynchronous draw of an avatar to a&nbsp;pixbuf.</p>
</div>
<div class="docblock"><p>Available since: 1.2</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.get_icon_name.html">hdy_avatar_get_icon_name</a></h6>
<div class="docblock">
<p>Gets the name of an icon to use as a&nbsp;fallback.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.get_loadable_icon.html">hdy_avatar_get_loadable_icon</a></h6>
<div class="docblock">
<p>Gets the <code>GLoadableIcon</code> set via <code>hdy_avatar_set_loadable_icon()</code>.</p>
</div>
<div class="docblock"><p>Available since: 1.2</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.get_show_initials.html">hdy_avatar_get_show_initials</a></h6>
<div class="docblock">
<p>Gets whether initials are used instead of an icon on the fallback&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.get_size.html">hdy_avatar_get_size</a></h6>
<div class="docblock">
<p>Gets the size of the&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.get_text.html">hdy_avatar_get_text</a></h6>
<div class="docblock">
<p>Gets the text used to generate the fallback initials and&nbsp;color.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.set_icon_name.html">hdy_avatar_set_icon_name</a></h6>
<div class="docblock">
<p>Sets the name of an icon to use as a&nbsp;fallback.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="deprecated">
<h6><a href="method.Avatar.set_image_load_func.html">hdy_avatar_set_image_load_func</a></h6>
<div class="docblock">
<p>A callback which is called when the custom image needs to be&nbsp;reloaded.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p><p>Deprecated since: 1.2</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.set_loadable_icon.html">hdy_avatar_set_loadable_icon</a></h6>
<div class="docblock">
<p>Sets the <code>GLoadableIcon</code> to use as an&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.2</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.set_show_initials.html">hdy_avatar_set_show_initials</a></h6>
<div class="docblock">
<p>Sets whether to use initials instead of an icon on the fallback&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.set_size.html">hdy_avatar_set_size</a></h6>
<div class="docblock">
<p>Sets the size of the&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="method.Avatar.set_text.html">hdy_avatar_set_text</a></h6>
<div class="docblock">
<p>Set the text used to generate the fallback initials&nbsp;color.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
</div>
</div>
<div class="toggle-wrapper properties">
<h4 id="properties">
Properties
<a href="#properties" class="anchor"></a>
</h4>
<div class="docblock">
<div class="">
<h6><a href="property.Avatar.icon-name.html">Handy.Avatar:icon-name</a></h6>
<div class="docblock">
<p>The name of an icon to use as a&nbsp;fallback.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="property.Avatar.loadable-icon.html">Handy.Avatar:loadable-icon</a></h6>
<div class="docblock">
<p>A <code>GLoadableIcon</code> used to load the&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.2</p></div>
</div>
<div class="">
<h6><a href="property.Avatar.show-initials.html">Handy.Avatar:show-initials</a></h6>
<div class="docblock">
<p>Whether to show the initials or the fallback icon on the generated&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="property.Avatar.size.html">Handy.Avatar:size</a></h6>
<div class="docblock">
<p>The avatar size of the&nbsp;avatar.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
<div class="">
<h6><a href="property.Avatar.text.html">Handy.Avatar:text</a></h6>
<div class="docblock">
<p>Sets the text used to generate the fallback initials and&nbsp;color.</p>
</div>
<div class="docblock"><p>Available since: 1.0</p></div>
</div>
</div>
</div>
<div class="class toggle-wrapper default-hide">
<h4 id="class-struct">
Class structure
<a href="#class-struct" class="anchor"></a>
</h4>
<div class="docblock">
<pre><code>struct HandyAvatarClass {
GtkDrawingAreaClass parent_class;
}</code></pre>
</div>
<div class="docblock">
<h6>Class members</h6>
<table class="members">
<tr>
<td style="vertical-align:top"><code>parent_class</code></td>
<td style="vertical-align:top"><pre><code>GtkDrawingAreaClass</code></pre></td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="vertical-align:top">No description available.</td>
</td>
</table>
</div>
</div>
</section>
</section>
<div class="toc">
<nav aria-labelledby="toc-title">
<p id="toc-title">Content</p>
<ul class="toc-list">
<li class="toc-list-item"><a href="#description"><span class="link-text">Description</span></a></li>
<li class="toc-list-item"><a href="#ancestors"><span class="link-text">Ancestors</span></a></li>
<li class="toc-list-item"><a href="#implements"><span class="link-text">Implements</span></a></li>
<li class="toc-list-item"><a href="#constructors"><span class="link-text">Constructors</span></a></li>
<li class="toc-list-item"><a href="#methods"><span class="link-text">Methods</span></a></li>
<li class="toc-list-item"><a href="#properties"><span class="link-text">Properties</span></a></li>
</ul>
</nav>
</div>
<section id="search" class="content hidden"></section>
<footer>
</footer>
</div>
</body>
</html>
\ No newline at end of file