Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gtk4 breakage #4

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "subprojects/blueprint-compiler"]
path = subprojects/blueprint-compiler
url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git
2 changes: 2 additions & 0 deletions data/io.github.TransmissionRemoteGtk.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<file alias="icons/24x24/actions/trg-gtk-disconnect.png">icons/trg-gtk-disconnect-24x24.png</file>
<file alias="icons/16x16/status/alt-speed-on.png">icons/turtle-blue.png</file>
<file alias="icons/16x16/status/alt-speed-off.png">icons/turtle-grey.png</file>

<file preprocess="xml-stripblanks">ui/about-dialog.ui</file>
</gresource>
</gresources>
10 changes: 9 additions & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ if rst2man.found()
install_dir: get_option('mandir') / 'man1')
endif

# blueprints
blp_files = files('ui/about-dialog.blp')
blueprints = custom_target('blueprints',
input: blp_files,
output: '.',
command: [blp_compiler, 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@'])

# gresources.xml
gnome = import('gnome')
gresource_xml ='@[email protected]'.format(app_id)
gresources = gnome.compile_resources('trg-resources', gresource_xml)
gresources = gnome.compile_resources('trg-resources', gresource_xml,
dependencies: blueprints)

# desktop file
po_dir = meson.project_source_root() / 'po'
Expand Down
5 changes: 5 additions & 0 deletions data/ui/about-dialog.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Gtk 4.0;

AboutDialog aboutDialog {
translator-credits: "translations kindly contributed by: (update)";
}
24 changes: 11 additions & 13 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ glib_min_def = '-DGLIB_VERSION_MIN_REQUIRED=@0@'.format(glib_min)
add_project_arguments(glib_min_def, language: 'c')

# required dependencies
gtk_dep = dependency('gtk+-3.0', version: '>= 3.22')
gtk_dep = dependency('gtk4', version: '>= 4.10')
gio_dep = dependency('gio-2.0', version: glib_version_str)
glib_dep = dependency('glib-2.0', version: glib_version_str)
json_dep = dependency('json-glib-1.0', version: '>= 1.2.8')
Expand All @@ -39,11 +39,12 @@ gthread_dep = dependency('gthread-2.0', version: glib_version_str)

trg_deps = [gtk_dep, glib_dep, gio_dep, json_dep, libsoup_dep, gthread_dep]

# optional dependencies
libappindicator_dep = dependency('ayatana-appindicator3-0.1',
'appindicator3-0.1', required: get_option('libappindicator'))

trg_deps += [libappindicator_dep]
# blueprint compiler (required, but not packaged in a lot of places
blp_compiler = find_program('blueprint-compiler', required: false)
if not blp_compiler.found()
subproject('blueprint-compiler')
blp_compiler = find_program('blueprint-compiler', required: true)
endif

# compiler
cc = meson.get_compiler('c')
Expand All @@ -59,7 +60,6 @@ if nl_li_feature.enabled() and not nl_langinfo
endif
nl_langinfo = nl_langinfo and nl_li_feature.allowed()


# config data
conf_data = configuration_data()

Expand All @@ -81,10 +81,6 @@ conf_data.set('G_DISABLE_CAST_CHECKS', not debug)
# compile time features
conf_data.set10('ENABLE_NL_LANGINFO', nl_langinfo)

conf_data.set10('HAVE_LIBAPPINDICATOR', libappindicator_dep.found())
conf_data.set10('HAVE_LIBAYATANA_APPINDICATOR',
libappindicator_dep.found() and libappindicator_dep.name() == 'ayatana-appindicator3-0.1')

# compiler/linker flags
flags = [
'-funsigned-char',
Expand All @@ -98,7 +94,9 @@ flags = [
'-Werror=pointer-arith',
'-Werror=init-self',
'-Werror=missing-include-dirs',
'-Werror=date-time'
'-Werror=date-time',
'-Wno-deprecated',
'-Wno-deprecated-declarations'
]

cflags = cc.get_supported_arguments(flags)
Expand All @@ -109,7 +107,7 @@ ldflags = cc.get_supported_link_arguments('-Wl,-z,relro', '-Wl,-z,now')
add_project_link_arguments(ldflags, language: 'c')

# Windows compiler options
if host_machine.system() == 'windows' or host_machine.system() == 'cgywin'
if host_machine.system() == 'windows' or host_machine.system() == 'cygwin'
win_cflags = cc.get_supported_arguments(
'-mms-bitfields', '-mwin32', '-mwindows')
add_project_arguments(win_cflags, language: 'c')
Expand Down
1 change: 0 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
option('libappindicator', type: 'feature', value: 'auto', description: 'libappindicator')
option('nl_langinfo', type: 'feature', value: 'auto', description: 'nl_langinfo() support')
14 changes: 11 additions & 3 deletions src/hig.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@
#include "hig.h"
#include <gtk/gtk.h>

static void set_borders(GtkWidget *w, int spacing)
{
gtk_widget_set_margin_bottom(w, spacing);
gtk_widget_set_margin_top(w, spacing);
gtk_widget_set_margin_start(w, spacing);
gtk_widget_set_margin_end(w, spacing);
}

GtkWidget *hig_workarea_create(void)
{
GtkWidget *grid = gtk_grid_new();

gtk_container_set_border_width(GTK_CONTAINER(grid), GUI_PAD_BIG);
set_borders(grid, GUI_PAD_BIG);
gtk_grid_set_row_spacing(GTK_GRID(grid), GUI_PAD);
gtk_grid_set_column_spacing(GTK_GRID(grid), GUI_PAD_BIG);

Expand Down Expand Up @@ -127,8 +135,8 @@ GtkWidget *hig_workarea_add_tall_row(GtkWidget *table, guint *row, const char *m
GtkWidget *l = gtk_label_new_with_mnemonic(mnemonic_string);
GtkWidget *h = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget *v = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start(GTK_BOX(h), l, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(v), h, FALSE, FALSE, GUI_PAD_SMALL);
gtk_box_append(GTK_BOX(h), l);
gtk_box_append(GTK_BOX(v), h);

hig_workarea_add_label_w(table, *row, v);
hig_workarea_add_tall_control(table, *row, control);
Expand Down
227 changes: 0 additions & 227 deletions src/icons.c

This file was deleted.

22 changes: 0 additions & 22 deletions src/icons.h

This file was deleted.

Loading