Commit 6dba2c45 authored by Adrien Plazas's avatar Adrien Plazas Committed by Julian Sparber
Browse files

Port to libhandy 1

This ports Calls to libhandy 1 and drops the embedded HdyAvatar in favor
of the libhandy one.

Fixes #172
parent 019b4fd4
......@@ -7,7 +7,7 @@ Uploaders:
Build-Depends:
debhelper (>= 11),
libfeedback-dev,
libhandy-0.0-dev (>= 0.0.12),
libhandy-1-dev (>= 1.0.0),
libgtk-3-dev,
modemmanager-dev,
libmm-glib-dev (>= 1.12.0),
......
......@@ -77,8 +77,8 @@
"sources" : [
{
"type" : "archive",
"url" : "https://source.puri.sm/Librem5/libhandy/-/archive/v0.0.13/libhandy-v0.0.13.tar.gz",
"sha256" : "138bec94e66d15a7a19350b65845d4529bcd969ea913ab3eb438f56fe47d5d37"
"url" : "https://download.gnome.org/sources/libhandy/1.0/libhandy-1.0.0.tar.xz",
"sha256" : "a9398582f47b7d729205d6eac0c068fef35aaf249fdd57eea3724f8518d26699"
}
],
"cleanup" : [
......
......@@ -38,10 +38,8 @@
#include "calls-manager.h"
#include "calls-application.h"
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
#include <glib/gi18n.h>
#include <handy.h>
#include <libebook-contacts/libebook-contacts.h>
/**
......@@ -306,6 +304,8 @@ startup (GApplication *application)
G_APPLICATION_CLASS (calls_application_parent_class)->startup (application);
hdy_init ();
g_set_prgname (APP_ID);
g_set_application_name (_("Calls"));
......@@ -501,11 +501,6 @@ calls_application_class_init (CallsApplicationClass *klass)
g_type_ensure (CALLS_TYPE_ENCRYPTION_INDICATOR);
g_type_ensure (CALLS_TYPE_HISTORY_BOX);
g_type_ensure (CALLS_TYPE_NEW_CALL_BOX);
g_type_ensure (HDY_TYPE_DIALER);
g_type_ensure (HDY_TYPE_HEADER_BAR);
g_type_ensure (HDY_TYPE_SQUEEZER);
g_type_ensure (HDY_TYPE_VIEW_SWITCHER);
g_type_ensure (HDY_TYPE_VIEW_SWITCHER_BAR);
}
......
......@@ -31,9 +31,6 @@
#include <glib-object.h>
#include <glib.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
struct _CallsCallDisplay
{
GtkOverlay parent_instance;
......
......@@ -25,12 +25,12 @@
#include "calls-call-record-row.h"
#include "calls-best-match.h"
#include "calls-contacts.h"
#include "contrib/hdy-avatar.h"
#include "util.h"
#include <glib/gi18n.h>
#include <glib-object.h>
#include <glib.h>
#include <handy.h>
#include <sys/time.h>
#include <errno.h>
......
......@@ -30,8 +30,6 @@
#include <glib-object.h>
#include <glib.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
struct _CallsCallSelectorItem
{
......
......@@ -36,8 +36,6 @@
#include <glib/gi18n.h>
#include <glib-object.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
#ifdef CALLS_WAYLAND
......
......@@ -30,9 +30,6 @@
#include <glib/gi18n.h>
#include <glib-object.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
struct _CallsHistoryBox
{
......
......@@ -29,9 +29,6 @@
#include <gtk/gtk.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
G_BEGIN_DECLS
#define CALLS_TYPE_HISTORY_BOX (calls_history_box_get_type ())
......
......@@ -35,8 +35,6 @@
#include <glib/gi18n.h>
#include <glib-object.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
......
......@@ -26,7 +26,6 @@
#include "calls-manager.h"
#include <glib/gi18n.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
......@@ -78,7 +77,7 @@ get_origin (CallsNewCallBox *self)
static void
backspace_clicked_cb (CallsNewCallBox *self)
{
GtkWidget *entry = hdy_keypad_get_entry (self->keypad);
GtkEntry *entry = hdy_keypad_get_entry (self->keypad);
g_signal_emit_by_name (entry, "backspace", NULL);
}
......@@ -86,7 +85,7 @@ backspace_clicked_cb (CallsNewCallBox *self)
static void
dial_clicked_cb (CallsNewCallBox *self)
{
GtkWidget *entry = hdy_keypad_get_entry (self->keypad);
GtkEntry *entry = hdy_keypad_get_entry (self->keypad);
calls_new_call_box_dial
(self,
gtk_entry_get_text (GTK_ENTRY (entry)));
......
This diff is collapsed.
/*
* Copyright (C) 2020 Purism SPC
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define HDY_TYPE_AVATAR (hdy_avatar_get_type())
G_DECLARE_DERIVABLE_TYPE (HdyAvatar, hdy_avatar, HDY, AVATAR, GtkDrawingArea)
/**
* HdyAvatarClass:
* @parent_class: The parent class
*/
struct _HdyAvatarClass
{
GtkDrawingAreaClass parent_class;
};
/**
* HdyAvatarImageLoadFunc:
* @size: the required size of the avatar
* @user_data: (closure): user data
*
* The returned #GdkPixbuf is expected to be square with width and height set
* to @size. The image is cropped to a circle without any scaling or transformation.
*
* Returns: (nullable) (transfer full): the #GdkPixbuf to use as a custom avatar
* or %NULL to fallback to the generated avatar.
*/
typedef GdkPixbuf *(*HdyAvatarImageLoadFunc) (gint size,
gpointer user_data);
GtkWidget *hdy_avatar_new (gint size,
const gchar *text,
gboolean show_initials);
const gchar *hdy_avatar_get_text (HdyAvatar *self);
void hdy_avatar_set_text (HdyAvatar *self,
const gchar *text);
gboolean hdy_avatar_get_show_initials (HdyAvatar *self);
void hdy_avatar_set_show_initials (HdyAvatar *self,
gboolean show_initials);
void hdy_avatar_set_image_load_func (HdyAvatar *self,
HdyAvatarImageLoadFunc load_image,
gpointer user_data,
GDestroyNotify destroy);
gint hdy_avatar_get_size (HdyAvatar *self);
void hdy_avatar_set_size (HdyAvatar *self,
gint size);
G_END_DECLS
......@@ -30,7 +30,7 @@ calls_includes = [ top_include, src_include ]
calls_deps = [ dependency('gobject-2.0', version: '>= 2.58'),
dependency('gtk+-3.0'),
dependency('libhandy-0.0', version: '>= 0.0.12'),
dependency('libhandy-1', version: '>= 1.0.0'),
dependency('libfeedback-0.0'),
dependency('libpeas-1.0'),
dependency('gom-1.0'),
......@@ -89,7 +89,6 @@ calls_sources = files(['calls-message-source.c', 'calls-message-source.h',
'calls-in-app-notification.c', 'calls-in-app-notification.h',
'calls-manager.c', 'calls-manager.h',
'calls-notifier.c', 'calls-notifier.h',
'contrib/hdy-avatar.c', 'contrib/hdy-avatar.h',
])
calls_config_data = config_data
......
......@@ -2,7 +2,6 @@
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="0.0"/>
<template class="CallsCallWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<!-- <property name="decorated">False</property> -->
......
......@@ -43,11 +43,9 @@
<property name="visible">True</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="HdyColumn">
<object class="HdyClamp">
<property name="can_focus">False</property>
<property name="visible">True</property>
<property name="maximum-width">600</property>
<property name="linear-growth-width">450</property>
<child>
<object class="GtkListBox" id="history">
<property name="can_focus">False</property>
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="0.0"/>
<template class="CallsHistoryHeaderBar" parent="GtkHeaderBar">
<property name="can_focus">False</property>
<property name="show-close-button">True</property>
......
......@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="0.0"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsMainWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Calls</property>
......
......@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="0.0"/>
<requires lib="libhandy" version="1.0"/>
<object class="GtkListStore" id="origin_store">
<columns>
<!-- column-name name -->
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="0.0"/>
<template class="CallsNewCallHeaderBar" parent="GtkHeaderBar">
<property name="can_focus">False</property>
<property name="show-close-button">True</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment