[gnome-terminal] build: Build as C++
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] build: Build as C++
- Date: Fri, 21 May 2021 21:20:21 +0000 (UTC)
commit 431a0e2a7b146157386da3066aa99ce0793a6db8
Author: Christian Persch <chpe src gnome org>
Date: Fri May 21 23:19:46 2021 +0200
build: Build as C++
.dir-locals.el | 7 +-
meson.build | 95 ++++++--
po/POTFILES.in | 34 +--
src/{eggshell.c => eggshell.cc} | 2 +-
src/{eggshell.h => eggshell.hh} | 0
src/meson.build | 144 ++++++------
src/{profile-editor.c => profile-editor.cc} | 249 +++++++++++++--------
src/{profile-editor.h => profile-editor.hh} | 0
src/{server.c => server.cc} | 14 +-
src/{terminal-accels.c => terminal-accels.cc} | 33 +--
src/{terminal-accels.h => terminal-accels.hh} | 0
src/{terminal-app.c => terminal-app.cc} | 66 +++---
src/{terminal-app.h => terminal-app.hh} | 4 +-
...nal-client-utils.c => terminal-client-utils.cc} | 6 +-
...nal-client-utils.h => terminal-client-utils.hh} | 0
src/{terminal-debug.c => terminal-debug.cc} | 6 +-
src/{terminal-debug.h => terminal-debug.hh} | 0
src/{terminal-defines.h => terminal-defines.hh} | 0
src/{terminal-enums.h => terminal-enums.hh} | 0
src/{terminal-gdbus.c => terminal-gdbus.cc} | 55 ++---
src/{terminal-gdbus.h => terminal-gdbus.hh} | 2 +-
...{terminal-headerbar.c => terminal-headerbar.cc} | 12 +-
...{terminal-headerbar.h => terminal-headerbar.hh} | 2 +-
src/{terminal-i18n.c => terminal-i18n.cc} | 2 +-
src/{terminal-i18n.h => terminal-i18n.hh} | 0
...minal-icon-button.c => terminal-icon-button.cc} | 4 +-
...minal-icon-button.h => terminal-icon-button.hh} | 0
src/{terminal-info-bar.c => terminal-info-bar.cc} | 11 +-
src/{terminal-info-bar.h => terminal-info-bar.hh} | 0
src/{terminal-intl.h => terminal-intl.hh} | 0
...erminal-libgsystem.h => terminal-libgsystem.hh} | 0
...l-mdi-container.c => terminal-mdi-container.cc} | 8 +-
...l-mdi-container.h => terminal-mdi-container.hh} | 2 +-
...minal-menu-button.c => terminal-menu-button.cc} | 14 +-
...minal-menu-button.h => terminal-menu-button.hh} | 2 +-
src/{terminal-nautilus.c => terminal-nautilus.cc} | 28 +--
src/{terminal-notebook.c => terminal-notebook.cc} | 43 ++--
src/{terminal-notebook.h => terminal-notebook.hh} | 0
src/{terminal-options.c => terminal-options.cc} | 152 ++++++-------
src/{terminal-options.h => terminal-options.hh} | 2 +-
src/{terminal-pcre2.h => terminal-pcre2.hh} | 0
src/{terminal-prefs.c => terminal-prefs.cc} | 88 ++++----
src/{terminal-prefs.h => terminal-prefs.hh} | 2 +-
...l-profiles-list.c => terminal-profiles-list.cc} | 6 +-
...l-profiles-list.h => terminal-profiles-list.hh} | 2 +-
src/{terminal-regex.c => terminal-regex.cc} | 6 +-
src/{terminal-regex.h => terminal-regex.hh} | 0
src/{terminal-schemas.h => terminal-schemas.hh} | 0
...en-container.c => terminal-screen-container.cc} | 41 ++--
...en-container.h => terminal-screen-container.hh} | 2 +-
src/{terminal-screen.c => terminal-screen.cc} | 108 +++++----
src/{terminal-screen.h => terminal-screen.hh} | 0
...search-popover.c => terminal-search-popover.cc} | 43 ++--
...search-popover.h => terminal-search-popover.hh} | 2 +-
...arch-provider.c => terminal-search-provider.cc} | 15 +-
...arch-provider.h => terminal-search-provider.hh} | 0
...l-settings-list.c => terminal-settings-list.cc} | 54 +++--
...l-settings-list.h => terminal-settings-list.hh} | 2 +-
...{terminal-tab-label.c => terminal-tab-label.cc} | 30 +--
...{terminal-tab-label.h => terminal-tab-label.hh} | 2 +-
...template => terminal-type-builtins.cc.template} | 2 +-
...template => terminal-type-builtins.hh.template} | 0
src/{terminal-util.c => terminal-util.cc} | 52 ++---
src/{terminal-util.h => terminal-util.hh} | 0
...erminal-version.h.in => terminal-version.hh.in} | 0
src/{terminal-window.c => terminal-window.cc} | 190 ++++++++--------
src/{terminal-window.h => terminal-window.hh} | 2 +-
src/{terminal.c => terminal.cc} | 30 +--
68 files changed, 929 insertions(+), 749 deletions(-)
---
diff --git a/.dir-locals.el b/.dir-locals.el
index f3770136..47eec4f6 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -3,8 +3,13 @@
(c-basic-offset . 2)
(tab-width . 8)
(show-trailing-whitespace . t)))
+(c++-mode . ((c-file-style . "GNU")
+ (indent-tabs-mode . nil)
+ (c-basic-offset . 2)
+ (tab-width . 8)
+ (show-trailing-whitespace . t)))
(vala-mode . ((c-file-style . "GNU")
(indent-tabs-mode . nil)
(c-basic-offset . 2)
- (tab-width . 8)
+ (tab-width . 2)
(show-trailing-whitespace . t))))
diff --git a/meson.build b/meson.build
index e9ed2c27..3a430262 100644
--- a/meson.build
+++ b/meson.build
@@ -15,7 +15,7 @@
project(
'gnome-terminal',
- ['c',],
+ ['c', 'cpp',],
default_options: [
'buildtype=release',
'c_std=gnu11',
@@ -39,6 +39,9 @@ gt_dns_name = 'org.gnome.Terminal'
# Compiler requirements
c_req_std = 'gnu11'
+cxx_req_std = 'gnu++11'
+gxx_req_version = '4.8.1'
+clangxx_req_version = '3.3'
# Requirements
@@ -108,12 +111,41 @@ po_dir = meson.current_source_dir() / 'po'
# Compilers
+# C compiler
+
cc = meson.get_compiler('c')
c_std_opt = '-std=' + c_req_std
assert(cc.has_argument(c_std_opt), 'option ' + c_std_opt + ' not supported by ' + cc.get_id())
add_project_arguments(c_std_opt, language: 'c')
+# C++ compiler
+
+cxx = meson.get_compiler('cpp')
+
+cxx_std_opt = '-std=' + cxx_req_std
+assert(cxx.has_argument(cxx_std_opt), 'option ' + cxx_std_opt + ' not supported by ' + cxx.get_id())
+add_project_arguments(cxx_std_opt, language: 'cpp')
+
+# The above only checks that the compiler supports the given -std option,
+# but not that the compiler really supports that C++ standard version.
+# Do a simple version check based on
+# https://gcc.gnu.org/projects/cxx-status.html and
+# https://clang.llvm.org/cxx_status.html
+# for the C++ features that vte actually uses.
+
+if cxx.get_id() == 'gcc'
+ assert(cxx.version().version_compare('>=' + gxx_req_version), 'needs g++ >= ' + gxx_req_version + ' for '
+ cxx_req_std + ' support')
+endif
+
+if cxx.get_id() == 'clang'
+ assert(cxx.version().version_compare('>=' + clangxx_req_version), 'needs clang++ >= ' +
clangxx_req_version + ' for ' + cxx_req_std + ' support')
+endif
+
+# Include directories
+
+top_inc = include_directories('.')
+
# Asserts must not be disabled
assert(get_option('b_ndebug') == 'false', 'assertions may not be disabled')
@@ -196,16 +228,47 @@ compiler_flags_common_undesirable = [
'-fno-strict-aliasing'
]
-compiler_flags_cc_required = [
+compiler_flags_c_required = [
+ '-fvisibility=hidden',
+]
+
+compiler_flags_c_only = [
+ '-Waggregate-return',
+ '-Werror=implicit-function-declaration',
+ '-Werror=missing-prototypes',
+ '-Wimplicit',
+ '-Wimplicit-fallthrough=3',
+ '-Wmissing-parameter-type',
+ '-Wnested-externs',
+ '-Wold-style-declaration',
+ '-Wold-style-definition',
+ '-Woverride-init',
+ '-Wsign-compare',
+ '-Wstrict-prototypes',
+]
+
+compiler_flags_cxx_only = [
+ '-Wimplicit-fallthrough=5',
+ '-Wnon-virtual-dtor',
+ '-Wstrict-null-sentinel',
+]
+
+compiler_flags_cxx_required = [
+ '-fvisibility-inlines-hidden',
'-fvisibility=hidden',
]
global_cflags = cc.get_supported_arguments(compiler_flags_common +
compiler_flags_common_undesirable +
- compiler_flags_cc_required)
-
-foreach flag: compiler_flags_cc_required
- assert(cc.has_argument(flag), flag + ' is required but not supported')
+ compiler_flags_c_only +
+ compiler_flags_c_required)
+global_cxxflags = cxx.get_supported_arguments(compiler_flags_common +
+ compiler_flags_common_undesirable +
+ compiler_flags_cxx_only +
+ compiler_flags_cxx_required)
+
+foreach flag: compiler_flags_cxx_required
+ assert(cxx.has_argument(flag), flag + ' is required but not supported')
endforeach
# These flags have to be tested together
@@ -262,8 +325,6 @@ configure_file(
configuration: config_h,
)
-top_inc = include_directories('.')
-
# Utilities
xsltproc = find_program('xsltproc')
@@ -310,17 +371,19 @@ configure_file(
output = '\n'
output += 'Configuration for gnome-terminal:\n\n'
-output += ' Version: ' + gt_version + '\n'
+output += ' Version: ' + gt_version + '\n'
+output += '\n'
+output += ' C compiler: ' + cc.get_id() + ' (version ' + cc.version() + ')\n'
+output += ' C++ compiler: ' + cxx.get_id() + ' (version ' + cxx.version() + ')\n'
output += '\n'
-output += ' C compiler: ' + cc.get_id() + '\n\n'
-output += ' Coverage: ' + get_option('b_coverage').to_string() + '\n'
-output += ' Documentation: ' + get_option('docs').to_string() + '\n'
-output += ' Debug: ' + enable_debug.to_string() + '\n'
+output += ' Coverage: ' + get_option('b_coverage').to_string() + '\n'
+output += ' Documentation: ' + get_option('docs').to_string() + '\n'
+output += ' Debug: ' + enable_debug.to_string() + '\n'
output += '\n'
-output += ' Prefix: ' + get_option('prefix') + '\n'
+output += ' Prefix: ' + get_option('prefix') + '\n'
output += '\n'
-output += ' Nautilus extension: ' + get_option('nautilus_extension').to_string() + '\n'
-output += ' Search provider: ' + get_option('search_provider').to_string() + '\n'
+output += ' Nautilus extension: ' + get_option('nautilus_extension').to_string() + '\n'
+output += ' Search provider: ' + get_option('search_provider').to_string() + '\n'
message(output)
# Done
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 471cddc7..07a1f29b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,25 +3,25 @@ data/org.gnome.Terminal.desktop.in
data/org.gnome.Terminal.metainfo.xml.in
src/org.gnome.Terminal.gschema.xml
src/preferences.ui
-src/profile-editor.c
+src/profile-editor.cc
src/search-popover.ui
-src/server.c
-src/terminal-accels.c
-src/terminal-app.c
-src/terminal-headerbar.c
+src/server.cc
+src/terminal-accels.cc
+src/terminal-app.cc
+src/terminal-headerbar.cc
src/terminal-headerbar.ui
src/terminal-headermenu.ui
-src/terminal-mdi-container.c
-src/terminal-menu-button.c
+src/terminal-mdi-container.cc
+src/terminal-menu-button.cc
src/terminal-menubar.ui.in
-src/terminal-nautilus.c
+src/terminal-nautilus.cc
src/terminal-notebook-menu.ui
-src/terminal-notebook.c
-src/terminal-options.c
-src/terminal-prefs.c
-src/terminal-screen.c
-src/terminal-search-popover.c
-src/terminal-tab-label.c
-src/terminal-util.c
-src/terminal-window.c
-src/terminal.c
+src/terminal-notebook.cc
+src/terminal-options.cc
+src/terminal-prefs.cc
+src/terminal-screen.cc
+src/terminal-search-popover.cc
+src/terminal-tab-label.cc
+src/terminal-util.cc
+src/terminal-window.cc
+src/terminal.cc
diff --git a/src/eggshell.c b/src/eggshell.cc
similarity index 99%
rename from src/eggshell.c
rename to src/eggshell.cc
index ed4f3b56..4ac33c1d 100644
--- a/src/eggshell.c
+++ b/src/eggshell.cc
@@ -32,7 +32,7 @@
#include <config.h>
-#include "eggshell.h"
+#include "eggshell.hh"
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/eggshell.h b/src/eggshell.hh
similarity index 100%
rename from src/eggshell.h
rename to src/eggshell.hh
diff --git a/src/meson.build b/src/meson.build
index 90dd5976..fe0c77ce 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -18,13 +18,13 @@ src_inc = include_directories('.')
# Common sources
client_util_sources = files(
- 'terminal-client-utils.c',
- 'terminal-client-utils.h',
+ 'terminal-client-utils.cc',
+ 'terminal-client-utils.hh',
)
debug_sources = files(
- 'terminal-debug.c',
- 'terminal-debug.h',
+ 'terminal-debug.cc',
+ 'terminal-debug.hh',
)
dbus_sources = gnome.gdbus_codegen(
@@ -38,36 +38,36 @@ dbus_sources = gnome.gdbus_codegen(
)
i18n_sources = files(
- 'terminal-i18n.c',
- 'terminal-i18n.h',
- 'terminal-intl.h',
+ 'terminal-i18n.cc',
+ 'terminal-i18n.hh',
+ 'terminal-intl.hh',
)
misc_sources = files(
- 'terminal-defines.h',
- 'terminal-libgsystem.h',
+ 'terminal-defines.hh',
+ 'terminal-libgsystem.hh',
)
profiles_sources = files(
- 'terminal-profiles-list.c',
- 'terminal-profiles-list.h',
- 'terminal-schemas.h',
- 'terminal-settings-list.c',
- 'terminal-settings-list.h',
+ 'terminal-profiles-list.cc',
+ 'terminal-profiles-list.hh',
+ 'terminal-schemas.hh',
+ 'terminal-settings-list.cc',
+ 'terminal-settings-list.hh',
)
regex_sources = files(
- 'terminal-regex.h',
+ 'terminal-regex.hh',
)
types_sources = files(
- 'terminal-enums.h',
+ 'terminal-enums.hh',
)
types_sources += gnome.mkenums(
'terminal-type-builtins',
- c_template: 'terminal-type-builtins.h.template',
- h_template: 'terminal-type-builtins.c.template',
+ c_template: 'terminal-type-builtins.hh.template',
+ h_template: 'terminal-type-builtins.cc.template',
install_header: false,
sources: types_sources,
)
@@ -80,7 +80,7 @@ version_conf = {
version_sources = [configure_file(
configuration: version_conf,
- input: 'terminal-version.h.in',
+ input: 'terminal-version.hh.in',
install: false,
output: '@BASENAME@',
)]
@@ -117,45 +117,45 @@ menubar_ui_nomnemonics = custom_target(
)
server_sources = client_util_sources + debug_sources + dbus_sources + i18n_sources + misc_sources +
profiles_sources + regex_sources + types_sources + version_sources + files(
- 'eggshell.c',
- 'eggshell.h',
- 'profile-editor.c',
- 'profile-editor.h',
- 'server.c',
- 'terminal-accels.c',
- 'terminal-accels.h',
- 'terminal-app.c',
- 'terminal-app.h',
- 'terminal-enums.h',
- 'terminal-gdbus.c',
- 'terminal-gdbus.h',
- 'terminal-headerbar.c',
- 'terminal-headerbar.h',
- 'terminal-icon-button.c',
- 'terminal-icon-button.h',
- 'terminal-info-bar.c',
- 'terminal-info-bar.h',
- 'terminal-mdi-container.c',
- 'terminal-mdi-container.h',
- 'terminal-menu-button.c',
- 'terminal-menu-button.h',
- 'terminal-notebook.c',
- 'terminal-notebook.h',
- 'terminal-pcre2.h',
- 'terminal-prefs.c',
- 'terminal-prefs.h',
- 'terminal-screen-container.c',
- 'terminal-screen-container.h',
- 'terminal-screen.c',
- 'terminal-screen.h',
- 'terminal-search-popover.c',
- 'terminal-search-popover.h',
- 'terminal-tab-label.c',
- 'terminal-tab-label.h',
- 'terminal-util.c',
- 'terminal-util.h',
- 'terminal-window.c',
- 'terminal-window.h',
+ 'eggshell.cc',
+ 'eggshell.hh',
+ 'profile-editor.cc',
+ 'profile-editor.hh',
+ 'server.cc',
+ 'terminal-accels.cc',
+ 'terminal-accels.hh',
+ 'terminal-app.cc',
+ 'terminal-app.hh',
+ 'terminal-enums.hh',
+ 'terminal-gdbus.cc',
+ 'terminal-gdbus.hh',
+ 'terminal-headerbar.cc',
+ 'terminal-headerbar.hh',
+ 'terminal-icon-button.cc',
+ 'terminal-icon-button.hh',
+ 'terminal-info-bar.cc',
+ 'terminal-info-bar.hh',
+ 'terminal-mdi-container.cc',
+ 'terminal-mdi-container.hh',
+ 'terminal-menu-button.cc',
+ 'terminal-menu-button.hh',
+ 'terminal-notebook.cc',
+ 'terminal-notebook.hh',
+ 'terminal-pcre2.hh',
+ 'terminal-prefs.cc',
+ 'terminal-prefs.hh',
+ 'terminal-screen-container.cc',
+ 'terminal-screen-container.hh',
+ 'terminal-screen.cc',
+ 'terminal-screen.hh',
+ 'terminal-search-popover.cc',
+ 'terminal-search-popover.hh',
+ 'terminal-tab-label.cc',
+ 'terminal-tab-label.hh',
+ 'terminal-util.cc',
+ 'terminal-util.hh',
+ 'terminal-window.cc',
+ 'terminal-window.hh',
)
server_sources += gnome.compile_resources(
@@ -184,8 +184,8 @@ server_sources += gnome.genmarshal(
if get_option('search_provider')
server_sources += files(
- 'terminal-search-provider.c',
- 'terminal-search-provider.h',
+ 'terminal-search-provider.cc',
+ 'terminal-search-provider.hh',
)
server_sources += gnome.gdbus_codegen(
@@ -204,7 +204,7 @@ server_incs = [
src_inc,
]
-server_cflags = [
+server_cxxflags = [
'-DTERMINAL_COMPILATION',
'-DVTE_DISABLE_DEPRECATION_WARNINGS',
'-DTERM_LOCALEDIR="@0@"'.format(gt_prefix / gt_localedir),
@@ -226,7 +226,7 @@ server_deps = [
server = executable(
gt_name + '-server',
- c_args: server_cflags,
+ cpp_args: server_cxxflags,
dependencies: server_deps,
include_directories: server_incs,
install: true,
@@ -272,9 +272,9 @@ endif # option 'search_provider'
# Legacy client
client_sources = client_util_sources + debug_sources + dbus_sources + i18n_sources + profiles_sources +
types_sources + files(
- 'terminal-options.c',
- 'terminal-options.h',
- 'terminal.c',
+ 'terminal-options.cc',
+ 'terminal-options.hh',
+ 'terminal.cc',
)
client_incs = [
@@ -287,7 +287,7 @@ client_incs = [
src_inc,
]
-client_cflags = [
+client_cxxflags = [
'-DTERMINAL_COMPILATION',
'-DTERMINAL_CLIENT',
'-DTERM_DATADIR="@0@"'.format(gt_prefix / gt_datadir),
@@ -308,7 +308,7 @@ client_deps = [
client = executable(
gt_name,
- c_args: client_cflags,
+ cpp_args: client_cxxflags,
include_directories: client_incs,
dependencies: client_deps,
install: true,
@@ -332,7 +332,7 @@ meson.add_install_script(
if get_option('nautilus_extension')
nautilus_sources = client_util_sources + dbus_sources + i18n_sources + misc_sources + types_sources +
files(
- 'terminal-nautilus.c',
+ 'terminal-nautilus.cc',
)
nautilus_map = meson.current_source_dir() / 'nautilus.map'
@@ -342,7 +342,7 @@ if get_option('nautilus_extension')
src_inc,
]
- nautilus_cflags = [
+ nautilus_cxxflags = [
'-DTERM_LOCALEDIR="@0@"'.format(gt_prefix / gt_localedir),
]
@@ -359,7 +359,7 @@ if get_option('nautilus_extension')
nautilus_extension = shared_library(
'libterminal-nautilus',
- c_args: nautilus_cflags,
+ cpp_args: nautilus_cxxflags,
dependencies: nautilus_deps,
include_directories: nautilus_incs,
install: true,
@@ -375,12 +375,12 @@ endif # option 'nautilus_extension'
# Unit tests
test_regex_sources = regex_sources + files(
- 'terminal-regex.c',
+ 'terminal-regex.cc',
)
test_regex = executable(
'test-regex',
- c_args: [
+ cpp_args: [
'-DTERMINAL_REGEX_MAIN',
],
dependencies: [
diff --git a/src/profile-editor.c b/src/profile-editor.cc
similarity index 86%
rename from src/profile-editor.c
rename to src/profile-editor.cc
index 4098f90b..1c73bde3 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.cc
@@ -26,15 +26,15 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
-#include "terminal-app.h"
-#include "terminal-enums.h"
-#include "profile-editor.h"
-#include "terminal-prefs.h"
-#include "terminal-schemas.h"
-#include "terminal-type-builtins.h"
-#include "terminal-util.h"
-#include "terminal-profiles-list.h"
-#include "terminal-libgsystem.h"
+#include "terminal-app.hh"
+#include "terminal-enums.hh"
+#include "profile-editor.hh"
+#include "terminal-prefs.hh"
+#include "terminal-schemas.hh"
+#include "terminal-type-builtins.hh"
+#include "terminal-util.hh"
+#include "terminal-profiles-list.hh"
+#include "terminal-libgsystem.hh"
/* Wrapper around g_signal_connect that maintains a list of the
@@ -112,11 +112,11 @@ profile_prefs_settings_bind_with_mapping (GSettings *settings,
GSettingsBindFlags flags,
GSettingsBindGetMapping get_mapping,
GSettingsBindSetMapping set_mapping,
- gpointer user_data,
+ GType (*user_data)(void),
GDestroyNotify destroy)
{
profile_prefs_register_settings_binding (object, property);
- g_settings_bind_with_mapping (settings, key, object, property, flags, get_mapping, set_mapping, user_data,
destroy);
+ g_settings_bind_with_mapping (settings, key, object, property, flags, get_mapping, set_mapping,
(void*)user_data, destroy);
}
static void
@@ -445,10 +445,10 @@ color_scheme_combo_changed_cb (GtkWidget *combo,
if (i < G_N_ELEMENTS (color_schemes))
{
- g_signal_handlers_block_by_func (profile, G_CALLBACK (profile_colors_notify_scheme_combo_cb), combo);
+ g_signal_handlers_block_by_func (profile, (void*)profile_colors_notify_scheme_combo_cb, combo);
terminal_g_settings_set_rgba (profile, TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
&color_schemes[i].foreground);
terminal_g_settings_set_rgba (profile, TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
&color_schemes[i].background);
- g_signal_handlers_unblock_by_func (profile, G_CALLBACK (profile_colors_notify_scheme_combo_cb), combo);
+ g_signal_handlers_unblock_by_func (profile, (void*)profile_colors_notify_scheme_combo_cb, combo);
}
else
{
@@ -475,9 +475,9 @@ profile_colors_notify_scheme_combo_cb (GSettings *profile,
}
/* If we didn't find a match, then we get the last combo box item which is "custom" */
- g_signal_handlers_block_by_func (combo, G_CALLBACK (color_scheme_combo_changed_cb), profile);
+ g_signal_handlers_block_by_func (combo, (void*)color_scheme_combo_changed_cb, profile);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i);
- g_signal_handlers_unblock_by_func (combo, G_CALLBACK (color_scheme_combo_changed_cb), profile);
+ g_signal_handlers_unblock_by_func (combo, (void*)color_scheme_combo_changed_cb, profile);
}
static void
@@ -489,7 +489,7 @@ palette_scheme_combo_changed_cb (GtkComboBox *combo,
i = gtk_combo_box_get_active (GTK_COMBO_BOX (combo));
- g_signal_handlers_block_by_func (profile, G_CALLBACK (profile_colors_notify_scheme_combo_cb), combo);
+ g_signal_handlers_block_by_func (profile, (void*)profile_colors_notify_scheme_combo_cb, combo);
if (i < TERMINAL_PALETTE_N_BUILTINS)
terminal_g_settings_set_rgba_palette (profile, TERMINAL_PROFILE_PALETTE_KEY,
terminal_palettes[i], TERMINAL_PALETTE_SIZE);
@@ -497,7 +497,7 @@ palette_scheme_combo_changed_cb (GtkComboBox *combo,
{
/* "custom" selected, no change */
}
- g_signal_handlers_unblock_by_func (profile, G_CALLBACK (profile_colors_notify_scheme_combo_cb), combo);
+ g_signal_handlers_unblock_by_func (profile, (void*)profile_colors_notify_scheme_combo_cb, combo);
}
static void
@@ -516,9 +516,9 @@ profile_palette_notify_scheme_combo_cb (GSettings *profile,
*/
i = TERMINAL_PALETTE_N_BUILTINS;
- g_signal_handlers_block_by_func (combo, G_CALLBACK (palette_scheme_combo_changed_cb), profile);
+ g_signal_handlers_block_by_func (combo, (void*)palette_scheme_combo_changed_cb, profile);
gtk_combo_box_set_active (combo, i);
- g_signal_handlers_unblock_by_func (combo, G_CALLBACK (palette_scheme_combo_changed_cb), profile);
+ g_signal_handlers_unblock_by_func (combo, (void*)palette_scheme_combo_changed_cb, profile);
}
static void
@@ -532,9 +532,9 @@ palette_color_notify_cb (GtkColorButton *button,
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
i = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (button), "palette-entry-index"));
- g_signal_handlers_block_by_func (profile, G_CALLBACK (profile_palette_notify_colorpickers_cb), NULL);
+ g_signal_handlers_block_by_func (profile, (void*)profile_palette_notify_colorpickers_cb, NULL);
modify_palette_entry (profile, i, &color);
- g_signal_handlers_unblock_by_func (profile, G_CALLBACK (profile_palette_notify_colorpickers_cb), NULL);
+ g_signal_handlers_unblock_by_func (profile, (void*)profile_palette_notify_colorpickers_cb, NULL);
}
static void
@@ -559,9 +559,9 @@ profile_palette_notify_colorpickers_cb (GSettings *profile,
g_snprintf (name, sizeof (name), "palette-colorpicker-%" G_GSIZE_FORMAT, i);
w = (GtkWidget *) gtk_builder_get_object (builder, name);
- g_signal_handlers_block_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
+ g_signal_handlers_block_by_func (w, (void*)palette_color_notify_cb, profile);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (w), &colors[i]);
- g_signal_handlers_unblock_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
+ g_signal_handlers_unblock_by_func (w, (void*)palette_color_notify_cb, profile);
}
}
@@ -670,9 +670,9 @@ profile_encoding_combo_changed_cb (GtkComboBox *combo,
if (encoding == NULL)
return;
- g_signal_handlers_block_by_func (profile, G_CALLBACK (profile_notify_encoding_combo_cb), combo);
+ g_signal_handlers_block_by_func (profile, (void*)profile_notify_encoding_combo_cb, combo);
g_settings_set_string(profile, TERMINAL_PROFILE_ENCODING_KEY, encoding);
- g_signal_handlers_unblock_by_func (profile, G_CALLBACK (profile_notify_encoding_combo_cb), combo);
+ g_signal_handlers_unblock_by_func (profile, (void*)profile_notify_encoding_combo_cb, combo);
}
static void
@@ -683,7 +683,7 @@ profile_notify_encoding_combo_cb (GSettings *profile,
gs_free char *encoding = NULL;
g_settings_get(profile, key, "s", &encoding);
- g_signal_handlers_block_by_func (combo, G_CALLBACK (profile_encoding_combo_changed_cb), profile);
+ g_signal_handlers_block_by_func (combo, (void*)profile_encoding_combo_changed_cb, profile);
GtkTreeIter iter;
if (tree_model_id_to_iter(gtk_combo_box_get_model(combo),
@@ -695,7 +695,7 @@ profile_notify_encoding_combo_cb (GSettings *profile,
gtk_combo_box_set_active(combo, -1);
}
- g_signal_handlers_unblock_by_func (combo, G_CALLBACK (profile_encoding_combo_changed_cb), profile);
+ g_signal_handlers_unblock_by_func (combo, (void*)profile_encoding_combo_changed_cb, profile);
}
/*
@@ -893,7 +893,7 @@ rgba_to_s (const GValue *value,
GdkRGBA *color;
gs_free char *s = NULL;
- color = g_value_get_boxed (value);
+ color = reinterpret_cast<GdkRGBA*>(g_value_get_boxed (value));
if (color == NULL)
return NULL;
@@ -906,7 +906,7 @@ string_to_enum (GValue *value,
GVariant *variant,
gpointer user_data)
{
- GType (* get_type) (void) = user_data;
+ GType (* get_type) (void) = (GType (*)(void))user_data;
GEnumClass *klass;
GEnumValue *eval = NULL;
const char *s;
@@ -914,7 +914,7 @@ string_to_enum (GValue *value,
g_variant_get (variant, "&s", &s);
- klass = g_type_class_ref (get_type ());
+ klass = reinterpret_cast<GEnumClass*>(g_type_class_ref (get_type ()));
for (i = 0; i < klass->n_values; ++i) {
if (strcmp (klass->values[i].value_nick, s) != 0)
continue;
@@ -936,7 +936,7 @@ enum_to_string (const GValue *value,
const GVariantType *expected_type,
gpointer user_data)
{
- GType (* get_type) (void) = user_data;
+ GType (* get_type) (void) = (GType (*)(void))user_data;
GEnumClass *klass;
GEnumValue *eval = NULL;
int val;
@@ -945,7 +945,7 @@ enum_to_string (const GValue *value,
val = g_value_get_int (value);
- klass = g_type_class_ref (get_type ());
+ klass = reinterpret_cast<GEnumClass*>(g_type_class_ref (get_type ()));
for (i = 0; i < klass->n_values; ++i) {
if (klass->values[i].value != val)
continue;
@@ -1119,7 +1119,8 @@ profile_prefs_load (const char *uuid, GSettings *profile)
gtk_builder_get_object (builder,
"background-colorpicker"),
"rgba",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) s_to_rgba,
(GSettingsBindSetMapping) rgba_to_s,
NULL, NULL);
@@ -1129,33 +1130,38 @@ profile_prefs_load (const char *uuid, GSettings *profile)
gtk_builder_get_object (builder,
"backspace-binding-combobox"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) string_to_enum,
(GSettingsBindSetMapping) enum_to_string,
vte_erase_binding_get_type, NULL);
profile_prefs_settings_bind (profile,
TERMINAL_PROFILE_BOLD_IS_BRIGHT_KEY,
gtk_builder_get_object (builder, "bold-is-bright-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
gtk_builder_get_object (builder,
"bold-color-checkbutton"),
"active",
- G_SETTINGS_BIND_GET |
- G_SETTINGS_BIND_INVERT_BOOLEAN |
- G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN |
+ G_SETTINGS_BIND_SET));
w = GTK_WIDGET (gtk_builder_get_object (builder, "bold-colorpicker"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
w,
"sensitive",
- G_SETTINGS_BIND_GET |
- G_SETTINGS_BIND_INVERT_BOOLEAN |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_BOLD_COLOR_KEY,
w,
"rgba",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
G_SETTINGS_BIND_NO_SENSITIVITY,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET |
+ G_SETTINGS_BIND_NO_SENSITIVITY),
(GSettingsBindGetMapping) s_to_rgba,
(GSettingsBindSetMapping) rgba_to_s,
NULL, NULL);
@@ -1163,28 +1169,36 @@ profile_prefs_load (const char *uuid, GSettings *profile)
w = GTK_WIDGET (gtk_builder_get_object (builder, "cell-height-scale-spinbutton"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY,
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
- "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "value",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
w = GTK_WIDGET (gtk_builder_get_object (builder, "cell-width-scale-spinbutton"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY,
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
- "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "value",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
gtk_builder_get_object (builder,
"cursor-colors-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
w = GTK_WIDGET (gtk_builder_get_object (builder, "cursor-foreground-colorpicker"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
w,
"sensitive",
- G_SETTINGS_BIND_GET |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_FOREGROUND_COLOR_KEY,
w,
"rgba",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
G_SETTINGS_BIND_NO_SENSITIVITY,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET |
+ G_SETTINGS_BIND_NO_SENSITIVITY),
(GSettingsBindGetMapping) s_to_rgba,
(GSettingsBindSetMapping) rgba_to_s,
NULL, NULL);
@@ -1193,12 +1207,14 @@ profile_prefs_load (const char *uuid, GSettings *profile)
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
w,
"sensitive",
- G_SETTINGS_BIND_GET |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_BACKGROUND_COLOR_KEY,
w,
"rgba",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
G_SETTINGS_BIND_NO_SENSITIVITY,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET |
+ G_SETTINGS_BIND_NO_SENSITIVITY),
(GSettingsBindGetMapping) s_to_rgba,
(GSettingsBindSetMapping) rgba_to_s,
NULL, NULL);
@@ -1206,18 +1222,22 @@ profile_prefs_load (const char *uuid, GSettings *profile)
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
gtk_builder_get_object (builder,
"highlight-colors-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
w = GTK_WIDGET (gtk_builder_get_object (builder, "highlight-foreground-colorpicker"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
w,
"sensitive",
- G_SETTINGS_BIND_GET |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_HIGHLIGHT_FOREGROUND_COLOR_KEY,
w,
"rgba",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
G_SETTINGS_BIND_NO_SENSITIVITY,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET |
+ G_SETTINGS_BIND_NO_SENSITIVITY),
(GSettingsBindGetMapping) s_to_rgba,
(GSettingsBindSetMapping) rgba_to_s,
NULL, NULL);
@@ -1226,12 +1246,14 @@ profile_prefs_load (const char *uuid, GSettings *profile)
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
w,
"sensitive",
- G_SETTINGS_BIND_GET |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_HIGHLIGHT_BACKGROUND_COLOR_KEY,
w,
"rgba",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
G_SETTINGS_BIND_NO_SENSITIVITY,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET |
+ G_SETTINGS_BIND_NO_SENSITIVITY),
(GSettingsBindGetMapping) s_to_rgba,
(GSettingsBindSetMapping) rgba_to_s,
NULL, NULL);
@@ -1240,7 +1262,8 @@ profile_prefs_load (const char *uuid, GSettings *profile)
gtk_builder_get_object (builder,
"cursor-shape-combobox"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) string_to_enum,
(GSettingsBindSetMapping) enum_to_string,
vte_cursor_shape_get_type, NULL);
@@ -1248,7 +1271,8 @@ profile_prefs_load (const char *uuid, GSettings *profile)
gtk_builder_get_object (builder,
"cursor-blink-mode-combobox"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) string_to_enum,
(GSettingsBindSetMapping) enum_to_string,
vte_cursor_blink_mode_get_type, NULL);
@@ -1256,7 +1280,8 @@ profile_prefs_load (const char *uuid, GSettings *profile)
gtk_builder_get_object (builder,
"text-blink-mode-combobox"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) string_to_enum,
(GSettingsBindSetMapping) enum_to_string,
vte_text_blink_mode_get_type, NULL);
@@ -1264,23 +1289,30 @@ profile_prefs_load (const char *uuid, GSettings *profile)
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CUSTOM_COMMAND_KEY,
gtk_builder_get_object (builder,
"custom-command-entry"),
- "text", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "text",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
w = GTK_WIDGET (gtk_builder_get_object (builder, "default-size-columns-spinbutton"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY,
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
- "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "value",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
w = GTK_WIDGET (gtk_builder_get_object (builder, "default-size-rows-spinbutton"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY,
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
- "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "value",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_DELETE_BINDING_KEY,
gtk_builder_get_object (builder,
"delete-binding-combobox"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) string_to_enum,
(GSettingsBindSetMapping) enum_to_string,
vte_erase_binding_get_type, NULL);
@@ -1288,27 +1320,32 @@ profile_prefs_load (const char *uuid, GSettings *profile)
gtk_builder_get_object (builder,
"exit-action-combobox"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) string_to_enum,
(GSettingsBindSetMapping) enum_to_string,
terminal_exit_action_get_type, NULL);
w = (GtkWidget*) gtk_builder_get_object (builder, "font-selector");
gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (w), monospace_filter, NULL, NULL);
#if GTK_CHECK_VERSION (3, 24, 0)
- gtk_font_chooser_set_level (GTK_FONT_CHOOSER (w), GTK_FONT_CHOOSER_LEVEL_FAMILY |
- GTK_FONT_CHOOSER_LEVEL_SIZE);
+ gtk_font_chooser_set_level (GTK_FONT_CHOOSER (w),
+ GtkFontChooserLevel(GTK_FONT_CHOOSER_LEVEL_FAMILY |
+ GTK_FONT_CHOOSER_LEVEL_SIZE));
#endif
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_FONT_KEY,
w,
- "font-name", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "font-name",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind_with_mapping (profile,
TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
gtk_builder_get_object (builder,
"foreground-colorpicker"),
"rgba",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) s_to_rgba,
(GSettingsBindSetMapping) rgba_to_s,
NULL, NULL);
@@ -1316,54 +1353,66 @@ profile_prefs_load (const char *uuid, GSettings *profile)
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_LOGIN_SHELL_KEY,
gtk_builder_get_object (builder,
"login-shell-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
w = GTK_WIDGET (gtk_builder_get_object (builder, "scrollback-lines-spinbutton"));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_LINES_KEY,
gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (w)),
- "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "value",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY,
gtk_builder_get_object (builder,
"scrollback-limited-checkbutton"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
- G_SETTINGS_BIND_INVERT_BOOLEAN);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY,
gtk_builder_get_object (builder,
"scrollback-box"),
"sensitive",
- G_SETTINGS_BIND_GET |
- G_SETTINGS_BIND_INVERT_BOOLEAN |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind_with_mapping (profile,
TERMINAL_PROFILE_SCROLLBAR_POLICY_KEY,
gtk_builder_get_object (builder,
"scrollbar-checkbutton"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) scrollbar_policy_to_bool,
(GSettingsBindSetMapping) bool_to_scrollbar_policy,
NULL, NULL);
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE_KEY,
gtk_builder_get_object (builder,
"scroll-on-keystroke-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLL_ON_OUTPUT_KEY,
gtk_builder_get_object (builder,
"scroll-on-output-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY,
gtk_builder_get_object (builder,
"custom-font-checkbutton"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
- G_SETTINGS_BIND_INVERT_BOOLEAN);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN));
w = (GtkWidget *) gtk_builder_get_object (builder, "preserve-working-directory-combobox");
profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_PRESERVE_WORKING_DIRECTORY_KEY, w,
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET),
(GSettingsBindGetMapping) string_to_enum,
(GSettingsBindSetMapping) enum_to_string,
terminal_preserve_working_directory_get_type, NULL);
@@ -1371,39 +1420,48 @@ profile_prefs_load (const char *uuid, GSettings *profile)
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
gtk_builder_get_object (builder,
"use-custom-command-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_USE_THEME_COLORS_KEY,
gtk_builder_get_object (builder,
"use-theme-colors-checkbutton"),
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_AUDIBLE_BELL_KEY,
gtk_builder_get_object (builder, "bell-checkbutton"),
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
profile_prefs_settings_bind (profile,
TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
gtk_builder_get_object (builder, "custom-command-entry-label"),
"sensitive",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind (profile,
TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
gtk_builder_get_object (builder, "custom-command-entry"),
"sensitive",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind (profile,
TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY,
gtk_builder_get_object (builder, "font-selector"),
"sensitive",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_INVERT_BOOLEAN |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind (profile,
TERMINAL_PROFILE_USE_THEME_COLORS_KEY,
gtk_builder_get_object (builder, "colors-box"),
"sensitive",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_INVERT_BOOLEAN |
- G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
profile_prefs_settings_bind_writable (profile,
TERMINAL_PROFILE_PALETTE_KEY,
gtk_builder_get_object (builder, "palette-box"),
@@ -1425,11 +1483,14 @@ profile_prefs_load (const char *uuid, GSettings *profile)
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CJK_UTF8_AMBIGUOUS_WIDTH_KEY,
w,
"active-id",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
w = (GtkWidget *) gtk_builder_get_object (builder, "enable-sixel-checkbutton");
profile_prefs_settings_bind (profile, TERMINAL_PROFILE_ENABLE_SIXEL_KEY, w,
- "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ "active",
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_SET));
gtk_widget_set_visible (w, (vte_get_feature_flags() & VTE_FEATURE_FLAG_SIXEL) != 0);
}
diff --git a/src/profile-editor.h b/src/profile-editor.hh
similarity index 100%
rename from src/profile-editor.h
rename to src/profile-editor.hh
diff --git a/src/server.c b/src/server.cc
similarity index 94%
rename from src/server.c
rename to src/server.cc
index 87a6cd90..eb6191a8 100644
--- a/src/server.c
+++ b/src/server.cc
@@ -35,12 +35,12 @@
#include <glib/gstdio.h>
#include <gio/gio.h>
-#include "terminal-app.h"
-#include "terminal-debug.h"
-#include "terminal-gdbus.h"
-#include "terminal-i18n.h"
-#include "terminal-defines.h"
-#include "terminal-libgsystem.h"
+#include "terminal-app.hh"
+#include "terminal-debug.hh"
+#include "terminal-gdbus.hh"
+#include "terminal-i18n.hh"
+#include "terminal-defines.hh"
+#include "terminal-libgsystem.hh"
static char *app_id = NULL;
@@ -66,7 +66,7 @@ option_app_id_cb (const gchar *option_name,
}
static const GOptionEntry options[] = {
- { "app-id", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, option_app_id_cb, "Application ID", "ID" },
+ { "app-id", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (void*)option_app_id_cb, "Application ID",
"ID" },
{ NULL }
};
diff --git a/src/terminal-accels.c b/src/terminal-accels.cc
similarity index 96%
rename from src/terminal-accels.c
rename to src/terminal-accels.cc
index 333c6d17..ef86b081 100644
--- a/src/terminal-accels.c
+++ b/src/terminal-accels.cc
@@ -24,13 +24,13 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include "terminal-accels.h"
-#include "terminal-app.h"
-#include "terminal-debug.h"
-#include "terminal-schemas.h"
-#include "terminal-intl.h"
-#include "terminal-util.h"
-#include "terminal-libgsystem.h"
+#include "terminal-accels.hh"
+#include "terminal-app.hh"
+#include "terminal-debug.hh"
+#include "terminal-schemas.hh"
+#include "terminal-intl.hh"
+#include "terminal-util.hh"
+#include "terminal-libgsystem.hh"
/* NOTES
*
@@ -87,7 +87,7 @@
* We don't want to enable content saving until vte supports it async.
* So we disable this code for stable versions.
*/
-#include "terminal-version.h"
+#include "terminal-version.hh"
#if (TERMINAL_MINOR_VERSION & 1) != 0
#define ENABLE_SAVE
@@ -263,14 +263,15 @@ key_changed_cb (GSettings *settings,
const char *settings_key,
gpointer user_data)
{
- GtkApplication *application = user_data;
+ GtkApplication *application = (GtkApplication*)user_data;
const gchar *accels[2] = { NULL, NULL };
_terminal_debug_print (TERMINAL_DEBUG_ACCELS,
"key %s changed\n",
settings_key);
- KeyEntry *key_entry = g_hash_table_lookup (settings_key_to_entry, settings_key);
+ KeyEntry *key_entry = reinterpret_cast<KeyEntry*>
+ (g_hash_table_lookup (settings_key_to_entry, settings_key));
if (!key_entry)
{
/* shouldn't really happen, but let's be safe */
@@ -344,7 +345,7 @@ terminal_accels_init (GApplication *application,
{
guint i, j;
- keybinding_settings = g_object_ref (settings);
+ keybinding_settings = (GSettings*)g_object_ref (settings);
settings_key_to_entry = g_hash_table_new (g_str_hash, g_str_equal);
@@ -387,7 +388,7 @@ terminal_accels_shutdown (void)
}
g_signal_handlers_disconnect_by_func (keybinding_settings,
- G_CALLBACK (key_changed_cb),
+ (void*)key_changed_cb,
g_application_get_default ());
g_clear_pointer (&settings_key_to_entry, (GDestroyNotify) g_hash_table_unref);
@@ -400,7 +401,7 @@ foreach_row_cb (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
- const char *key = data;
+ const char *key = (char const*)data;
KeyEntry *key_entry;
gtk_tree_model_get (model, iter,
@@ -446,7 +447,7 @@ accel_set_func (GtkTreeViewColumn *tree_column,
guint key;
GdkModifierType mods;
gboolean writable;
- GtkWidget *button = data;
+ GtkWidget *button = (GtkWidget*)data;
value = g_settings_get_string (keybinding_settings, ke->settings_key);
gtk_accelerator_parse (value, &key, &mods);
@@ -512,7 +513,7 @@ accel_cleared_callback (GtkCellRendererAccel *cell,
gchar *path_string,
GtkTreeView *view)
{
- accel_update (view, cell, path_string, 0, 0);
+ accel_update (view, cell, path_string, 0, GdkModifierType(0));
}
static void
@@ -520,7 +521,7 @@ treeview_destroy_cb (GtkWidget *tree_view,
gpointer user_data)
{
g_signal_handlers_disconnect_by_func (keybinding_settings,
- G_CALLBACK (treeview_key_changed_cb),
+ (void*)treeview_key_changed_cb,
tree_view);
}
diff --git a/src/terminal-accels.h b/src/terminal-accels.hh
similarity index 100%
rename from src/terminal-accels.h
rename to src/terminal-accels.hh
diff --git a/src/terminal-app.c b/src/terminal-app.cc
similarity index 96%
rename from src/terminal-app.c
rename to src/terminal-app.cc
index ff91e156..535c547c 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.cc
@@ -28,24 +28,24 @@
#define G_SETTINGS_ENABLE_BACKEND
#include <gio/gsettingsbackend.h>
-#include "terminal-intl.h"
-#include "terminal-debug.h"
-#include "terminal-app.h"
-#include "terminal-accels.h"
-#include "terminal-screen.h"
-#include "terminal-screen-container.h"
-#include "terminal-window.h"
-#include "terminal-profiles-list.h"
-#include "terminal-util.h"
-#include "profile-editor.h"
-#include "terminal-schemas.h"
-#include "terminal-gdbus.h"
-#include "terminal-defines.h"
-#include "terminal-prefs.h"
-#include "terminal-libgsystem.h"
+#include "terminal-intl.hh"
+#include "terminal-debug.hh"
+#include "terminal-app.hh"
+#include "terminal-accels.hh"
+#include "terminal-screen.hh"
+#include "terminal-screen-container.hh"
+#include "terminal-window.hh"
+#include "terminal-profiles-list.hh"
+#include "terminal-util.hh"
+#include "profile-editor.hh"
+#include "terminal-schemas.hh"
+#include "terminal-gdbus.hh"
+#include "terminal-defines.hh"
+#include "terminal-prefs.hh"
+#include "terminal-libgsystem.hh"
#ifdef ENABLE_SEARCH_PROVIDER
-#include "terminal-search-provider.h"
+#include "terminal-search-provider.hh"
#endif /* ENABLE_SEARCH_PROVIDER */
#include <sys/wait.h>
@@ -358,7 +358,7 @@ terminal_app_theme_variant_changed_cb (GSettings *settings,
{
TerminalThemeVariant theme;
- theme = g_settings_get_enum (settings, key);
+ theme = TerminalThemeVariant(g_settings_get_enum (settings, key));
if (theme == TERMINAL_THEME_VARIANT_SYSTEM)
gtk_settings_reset_property (gtk_settings, GTK_SETTING_PREFER_DARK_THEME);
else
@@ -402,8 +402,10 @@ foreach_profile_cb (TerminalSettingsList *list,
g_array_append_val (user_data->array, data);
/* only connect if we haven't seen this profile before */
- if (g_signal_handler_find (profile, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, terminal_app_update_profile_menus, user_data->app) == 0)
+ if (g_signal_handler_find (profile,
+ GSignalMatchType(G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA),
+ 0, 0, NULL,
+ (void*)terminal_app_update_profile_menus, user_data->app) == 0)
g_signal_connect_swapped (profile, "changed::" TERMINAL_PROFILE_VISIBLE_NAME_KEY,
G_CALLBACK (terminal_app_update_profile_menus), user_data->app);
}
@@ -412,8 +414,8 @@ static int
compare_profile_label_cb (gconstpointer ap,
gconstpointer bp)
{
- const ProfileData *a = ap;
- const ProfileData *b = bp;
+ const ProfileData *a = (ProfileData const*)ap;
+ const ProfileData *b = (ProfileData const*)bp;
return g_utf8_collate (a->label, b->label);
}
@@ -641,7 +643,8 @@ update_clipboard_targets (TerminalApp *app,
/* Sometimes we receive targets == NULL but n_targets == -1 */
if (targets != NULL && n_targets < 255) {
- app->clipboard_targets = g_memdup (targets, sizeof (targets[0]) * n_targets);
+ app->clipboard_targets = reinterpret_cast<GdkAtom*>
+ (g_memdup (targets, sizeof (targets[0]) * n_targets));
app->n_clipboard_targets = n_targets;
}
}
@@ -694,7 +697,7 @@ app_menu_preferences_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalApp *app = user_data;
+ TerminalApp *app = (TerminalApp*)user_data;
terminal_app_edit_preferences (app, NULL, NULL);
}
@@ -720,7 +723,7 @@ app_menu_quit_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- GtkApplication *application = user_data;
+ GtkApplication *application = (GtkApplication*)user_data;
GtkWindow *window;
window = gtk_application_get_active_window (application);
@@ -849,12 +852,12 @@ terminal_app_finalize (GObject *object)
TerminalApp *app = TERMINAL_APP (object);
g_signal_handlers_disconnect_by_func (app->clipboard,
- G_CALLBACK (clipboard_owner_change_cb),
+ (void*)clipboard_owner_change_cb,
app);
free_clipboard_targets (app);
g_signal_handlers_disconnect_by_func (app->profiles_list,
- G_CALLBACK (terminal_app_update_profile_menus),
+ (void*)terminal_app_update_profile_menus,
app);
g_hash_table_destroy (app->screen_map);
@@ -976,10 +979,11 @@ terminal_app_new (const char *app_id)
{
const GApplicationFlags flags = G_APPLICATION_IS_SERVICE;
- return g_object_new (TERMINAL_TYPE_APP,
- "application-id", app_id ? app_id : TERMINAL_APPLICATION_ID,
- "flags", flags,
- NULL);
+ return reinterpret_cast<GApplication*>
+ (g_object_new (TERMINAL_TYPE_APP,
+ "application-id", app_id ? app_id : TERMINAL_APPLICATION_ID,
+ "flags", flags,
+ nullptr));
}
TerminalScreen *
@@ -988,7 +992,7 @@ terminal_app_get_screen_by_uuid (TerminalApp *app,
{
g_return_val_if_fail (TERMINAL_IS_APP (app), NULL);
- return g_hash_table_lookup (app->screen_map, uuid);
+ return reinterpret_cast<TerminalScreen*>(g_hash_table_lookup (app->screen_map, uuid));
}
char *
diff --git a/src/terminal-app.h b/src/terminal-app.hh
similarity index 98%
rename from src/terminal-app.h
rename to src/terminal-app.hh
index a36361e0..d7e97681 100644
--- a/src/terminal-app.h
+++ b/src/terminal-app.hh
@@ -21,8 +21,8 @@
#include <gtk/gtk.h>
-#include "terminal-screen.h"
-#include "terminal-profiles-list.h"
+#include "terminal-screen.hh"
+#include "terminal-profiles-list.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-client-utils.c b/src/terminal-client-utils.cc
similarity index 98%
rename from src/terminal-client-utils.c
rename to src/terminal-client-utils.cc
index ae6c2ea5..ff5ba8e5 100644
--- a/src/terminal-client-utils.c
+++ b/src/terminal-client-utils.cc
@@ -21,9 +21,9 @@
#include "config.h"
-#include "terminal-client-utils.h"
-#include "terminal-defines.h"
-#include "terminal-libgsystem.h"
+#include "terminal-client-utils.hh"
+#include "terminal-defines.hh"
+#include "terminal-libgsystem.hh"
#include <string.h>
diff --git a/src/terminal-client-utils.h b/src/terminal-client-utils.hh
similarity index 100%
rename from src/terminal-client-utils.h
rename to src/terminal-client-utils.hh
diff --git a/src/terminal-debug.c b/src/terminal-debug.cc
similarity index 88%
rename from src/terminal-debug.c
rename to src/terminal-debug.cc
index d08829e9..52acc70c 100644
--- a/src/terminal-debug.c
+++ b/src/terminal-debug.cc
@@ -19,7 +19,7 @@
#include <glib.h>
-#include "terminal-debug.h"
+#include "terminal-debug.hh"
TerminalDebugFlags _terminal_debug_flags;
@@ -40,8 +40,8 @@ _terminal_debug_init(void)
{ "search", TERMINAL_DEBUG_SEARCH },
};
- _terminal_debug_flags = g_parse_debug_string (g_getenv ("GNOME_TERMINAL_DEBUG"),
- keys, G_N_ELEMENTS (keys));
+ _terminal_debug_flags = TerminalDebugFlags(g_parse_debug_string (g_getenv ("GNOME_TERMINAL_DEBUG"),
+ keys, G_N_ELEMENTS (keys)));
#endif /* ENABLE_DEBUG */
}
diff --git a/src/terminal-debug.h b/src/terminal-debug.hh
similarity index 100%
rename from src/terminal-debug.h
rename to src/terminal-debug.hh
diff --git a/src/terminal-defines.h b/src/terminal-defines.hh
similarity index 100%
rename from src/terminal-defines.h
rename to src/terminal-defines.hh
diff --git a/src/terminal-enums.h b/src/terminal-enums.hh
similarity index 100%
rename from src/terminal-enums.h
rename to src/terminal-enums.hh
diff --git a/src/terminal-gdbus.c b/src/terminal-gdbus.cc
similarity index 94%
rename from src/terminal-gdbus.c
rename to src/terminal-gdbus.cc
index 655bf3e1..6553644c 100644
--- a/src/terminal-gdbus.c
+++ b/src/terminal-gdbus.cc
@@ -17,18 +17,18 @@
#include "config.h"
-#include "terminal-gdbus.h"
+#include "terminal-gdbus.hh"
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
-#include "terminal-app.h"
-#include "terminal-debug.h"
-#include "terminal-defines.h"
-#include "terminal-mdi-container.h"
-#include "terminal-util.h"
-#include "terminal-window.h"
-#include "terminal-libgsystem.h"
+#include "terminal-app.hh"
+#include "terminal-debug.hh"
+#include "terminal-defines.hh"
+#include "terminal-mdi-container.hh"
+#include "terminal-util.hh"
+#include "terminal-window.hh"
+#include "terminal-libgsystem.hh"
/* ------------------------------------------------------------------------- */
@@ -132,7 +132,7 @@ terminal_receiver_impl_exec (TerminalReceiver *receiver,
G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Terminal already closed");
- goto out;
+ return TRUE; /* handled */
}
if (!g_variant_lookup (options, "cwd", "^&ay", &working_directory))
@@ -150,7 +150,7 @@ terminal_receiver_impl_exec (TerminalReceiver *receiver,
G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Malformed environment");
- goto out;
+ return TRUE; /* handled */
}
/* Check FD passing */
@@ -159,14 +159,15 @@ terminal_receiver_impl_exec (TerminalReceiver *receiver,
G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Must pass both fd-set options and a FD list");
- goto out;
+ return TRUE; /* handled */
}
if (fd_list != NULL && fd_array != NULL) {
const int *fd_array_data;
gsize fd_array_data_len, i;
int n_fds;
- fd_array_data = g_variant_get_fixed_array (fd_array, &fd_array_data_len, 2 * sizeof (int));
+ fd_array_data = reinterpret_cast<int const*>
+ (g_variant_get_fixed_array (fd_array, &fd_array_data_len, 2 * sizeof (int)));
n_fds = g_unix_fd_list_get_length (fd_list);
for (i = 0; i < fd_array_data_len; i++) {
const int fd = fd_array_data[2 * i];
@@ -177,7 +178,7 @@ terminal_receiver_impl_exec (TerminalReceiver *receiver,
G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Passing of invalid FD %d not supported", fd);
- goto out;
+ return TRUE; /* handled */
}
if (fd == STDIN_FILENO ||
fd == STDOUT_FILENO ||
@@ -187,14 +188,14 @@ terminal_receiver_impl_exec (TerminalReceiver *receiver,
G_DBUS_ERROR_INVALID_ARGS,
"Passing of std%s not supported",
fd == STDIN_FILENO ? "in" : fd == STDOUT_FILENO ? "out" :
"err");
- goto out;
+ return TRUE; /* handled */
}
if (idx < 0 || idx >= n_fds) {
g_dbus_method_invocation_return_error_literal (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Handle out of range");
- goto out;
+ return TRUE; /* handled */
}
}
}
@@ -206,14 +207,14 @@ terminal_receiver_impl_exec (TerminalReceiver *receiver,
exec_argv = (char **) g_variant_get_bytestring_array (arguments, &exec_argc);
ExecData *exec_data = g_new (ExecData, 1);
- exec_data->receiver = g_object_ref (receiver);
+ exec_data->receiver = (TerminalReceiver*)g_object_ref (receiver);
/* We want to transfer the ownership of @invocation to ExecData here, but
* we have to temporarily ref it so that in the error case below (where
* terminal_screen_exec() frees the exec data via the supplied callback,
* the g_dbus_method_invocation_take_error() calll still can take ownership
* of the invocation's ref passed to this function (terminal_receiver_impl_exec()).
*/
- exec_data->invocation = g_object_ref (invocation);
+ exec_data->invocation = (GDBusMethodInvocation*)g_object_ref (invocation);
GError *err = NULL;
if (!terminal_screen_exec (priv->screen,
@@ -234,8 +235,6 @@ terminal_receiver_impl_exec (TerminalReceiver *receiver,
/* Now we can remove that extra ref again. */
g_object_unref (invocation);
-out:
-
return TRUE; /* handled */
}
@@ -292,7 +291,7 @@ terminal_receiver_impl_set_property (GObject *object,
switch (prop_id) {
case PROP_SCREEN:
- terminal_receiver_impl_set_screen (impl, g_value_get_object (value));
+ terminal_receiver_impl_set_screen (impl, (TerminalScreen*)g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -314,9 +313,9 @@ terminal_receiver_impl_class_init (TerminalReceiverImplClass *klass)
PROP_SCREEN,
g_param_spec_object ("screen", NULL, NULL,
TERMINAL_TYPE_SCREEN,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS)));
g_type_class_add_private (gobject_class, sizeof (TerminalReceiverImplPrivate));
}
@@ -332,9 +331,10 @@ terminal_receiver_impl_class_init (TerminalReceiverImplClass *klass)
TerminalReceiverImpl *
terminal_receiver_impl_new (TerminalScreen *screen)
{
- return g_object_new (TERMINAL_TYPE_RECEIVER_IMPL,
- "screen", screen,
- NULL);
+ return reinterpret_cast<TerminalReceiverImpl*>
+ (g_object_new (TERMINAL_TYPE_RECEIVER_IMPL,
+ "screen", screen,
+ nullptr));
}
/**
@@ -562,5 +562,6 @@ terminal_factory_impl_class_init (TerminalFactoryImplClass *klass)
TerminalFactory *
terminal_factory_impl_new (void)
{
- return g_object_new (TERMINAL_TYPE_FACTORY_IMPL, NULL);
+ return reinterpret_cast<TerminalFactory*>
+ (g_object_new (TERMINAL_TYPE_FACTORY_IMPL, nullptr));
}
diff --git a/src/terminal-gdbus.h b/src/terminal-gdbus.hh
similarity index 99%
rename from src/terminal-gdbus.h
rename to src/terminal-gdbus.hh
index 16e80d74..38c24bc4 100644
--- a/src/terminal-gdbus.h
+++ b/src/terminal-gdbus.hh
@@ -21,7 +21,7 @@
#include <glib-object.h>
#include "terminal-gdbus-generated.h"
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-headerbar.c b/src/terminal-headerbar.cc
similarity index 94%
rename from src/terminal-headerbar.c
rename to src/terminal-headerbar.cc
index fc929d7b..38bae5ae 100644
--- a/src/terminal-headerbar.c
+++ b/src/terminal-headerbar.cc
@@ -19,9 +19,9 @@
#include <glib/gi18n.h>
-#include "terminal-headerbar.h"
-#include "terminal-app.h"
-#include "terminal-libgsystem.h"
+#include "terminal-headerbar.hh"
+#include "terminal-app.hh"
+#include "terminal-libgsystem.hh"
typedef struct _TerminalHeaderbarPrivate TerminalHeaderbarPrivate;
@@ -104,7 +104,7 @@ terminal_headerbar_dispose (GObject *object)
GMenuModel *profilemenu = terminal_app_get_profilemenu (app);
g_signal_handlers_disconnect_by_func (profilemenu,
- G_CALLBACK (profilemenu_items_changed_cb),
+ (void*)profilemenu_items_changed_cb,
priv);
G_OBJECT_CLASS (terminal_headerbar_parent_class)->dispose (object);
@@ -165,6 +165,6 @@ terminal_headerbar_class_init (TerminalHeaderbarClass *klass)
GtkWidget *
terminal_headerbar_new (void)
{
- return g_object_new (TERMINAL_TYPE_HEADERBAR,
- NULL);
+ return reinterpret_cast<GtkWidget*>
+ (g_object_new (TERMINAL_TYPE_HEADERBAR, nullptr));
}
diff --git a/src/terminal-headerbar.h b/src/terminal-headerbar.hh
similarity index 98%
rename from src/terminal-headerbar.h
rename to src/terminal-headerbar.hh
index f4ee6f78..c8aabd6c 100644
--- a/src/terminal-headerbar.h
+++ b/src/terminal-headerbar.hh
@@ -19,7 +19,7 @@
#include <gtk/gtk.h>
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-i18n.c b/src/terminal-i18n.cc
similarity index 97%
rename from src/terminal-i18n.c
rename to src/terminal-i18n.cc
index 7ae520ea..162c49fe 100644
--- a/src/terminal-i18n.c
+++ b/src/terminal-i18n.cc
@@ -16,7 +16,7 @@
*/
#include "config.h"
-#include "terminal-i18n.h"
+#include "terminal-i18n.hh"
#include <libintl.h>
diff --git a/src/terminal-i18n.h b/src/terminal-i18n.hh
similarity index 100%
rename from src/terminal-i18n.h
rename to src/terminal-i18n.hh
diff --git a/src/terminal-icon-button.c b/src/terminal-icon-button.cc
similarity index 95%
rename from src/terminal-icon-button.c
rename to src/terminal-icon-button.cc
index 3014fc06..387fd30f 100644
--- a/src/terminal-icon-button.c
+++ b/src/terminal-icon-button.cc
@@ -20,8 +20,8 @@
#include "config.h"
-#include "terminal-icon-button.h"
-#include "terminal-libgsystem.h"
+#include "terminal-icon-button.hh"
+#include "terminal-libgsystem.hh"
GtkWidget *
terminal_icon_button_new (const char *gicon_name)
diff --git a/src/terminal-icon-button.h b/src/terminal-icon-button.hh
similarity index 100%
rename from src/terminal-icon-button.h
rename to src/terminal-icon-button.hh
diff --git a/src/terminal-info-bar.c b/src/terminal-info-bar.cc
similarity index 93%
rename from src/terminal-info-bar.c
rename to src/terminal-info-bar.cc
index 8ffca189..b855d6cd 100644
--- a/src/terminal-info-bar.c
+++ b/src/terminal-info-bar.cc
@@ -17,8 +17,8 @@
#include <config.h>
-#include "terminal-info-bar.h"
-#include "terminal-libgsystem.h"
+#include "terminal-info-bar.hh"
+#include "terminal-libgsystem.hh"
#include <gtk/gtk.h>
@@ -70,9 +70,10 @@ terminal_info_bar_new (GtkMessageType type,
GtkWidget *info_bar;
va_list args;
- info_bar = g_object_new (TERMINAL_TYPE_INFO_BAR,
- "message-type", type,
- NULL);
+ info_bar = reinterpret_cast<GtkWidget*>
+ (g_object_new (TERMINAL_TYPE_INFO_BAR,
+ "message-type", type,
+ nullptr));
va_start (args, first_button_text);
while (first_button_text != NULL) {
diff --git a/src/terminal-info-bar.h b/src/terminal-info-bar.hh
similarity index 100%
rename from src/terminal-info-bar.h
rename to src/terminal-info-bar.hh
diff --git a/src/terminal-intl.h b/src/terminal-intl.hh
similarity index 100%
rename from src/terminal-intl.h
rename to src/terminal-intl.hh
diff --git a/src/terminal-libgsystem.h b/src/terminal-libgsystem.hh
similarity index 100%
rename from src/terminal-libgsystem.h
rename to src/terminal-libgsystem.hh
diff --git a/src/terminal-mdi-container.c b/src/terminal-mdi-container.cc
similarity index 97%
rename from src/terminal-mdi-container.c
rename to src/terminal-mdi-container.cc
index 76464a92..581f05eb 100644
--- a/src/terminal-mdi-container.c
+++ b/src/terminal-mdi-container.cc
@@ -17,9 +17,9 @@
#include <config.h>
-#include "terminal-mdi-container.h"
-#include "terminal-debug.h"
-#include "terminal-intl.h"
+#include "terminal-mdi-container.hh"
+#include "terminal-debug.hh"
+#include "terminal-intl.hh"
enum {
SCREEN_ADDED,
@@ -90,7 +90,7 @@ terminal_mdi_container_default_init (TerminalMdiContainerInterface *iface)
g_object_interface_install_property (iface,
g_param_spec_object ("active-screen", NULL, NULL,
TERMINAL_TYPE_SCREEN,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
}
/* public API */
diff --git a/src/terminal-mdi-container.h b/src/terminal-mdi-container.hh
similarity index 99%
rename from src/terminal-mdi-container.h
rename to src/terminal-mdi-container.hh
index 829521f0..6915c8e6 100644
--- a/src/terminal-mdi-container.h
+++ b/src/terminal-mdi-container.hh
@@ -20,7 +20,7 @@
#include <gtk/gtk.h>
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-menu-button.c b/src/terminal-menu-button.cc
similarity index 92%
rename from src/terminal-menu-button.c
rename to src/terminal-menu-button.cc
index fbe30f27..e25b86fe 100644
--- a/src/terminal-menu-button.c
+++ b/src/terminal-menu-button.cc
@@ -17,9 +17,9 @@
#include "config.h"
-#include "terminal-menu-button.h"
-#include "terminal-intl.h"
-#include "terminal-libgsystem.h"
+#include "terminal-menu-button.hh"
+#include "terminal-intl.hh"
+#include "terminal-libgsystem.hh"
/* All this just because GtkToggleButton:toggled is RUN_FIRST (and the
* notify::active comes after the toggled signal). :-(
@@ -52,8 +52,9 @@ disconnect_popup_menu (GtkMenuButton *button)
GtkMenu *popup_menu = gtk_menu_button_get_popup (button);
if (popup_menu)
- g_signal_handlers_disconnect_by_func
- (popup_menu, G_CALLBACK (popup_menu_selection_done_cb), button);
+ g_signal_handlers_disconnect_by_func(popup_menu,
+ (void*)popup_menu_selection_done_cb,
+ button);
}
static void
@@ -143,5 +144,6 @@ terminal_menu_button_class_init (TerminalMenuButtonClass *klass)
GtkWidget *
terminal_menu_button_new (void)
{
- return g_object_new (TERMINAL_TYPE_MENU_BUTTON, NULL);
+ return reinterpret_cast<GtkWidget*>
+ (g_object_new (TERMINAL_TYPE_MENU_BUTTON, nullptr));
}
diff --git a/src/terminal-menu-button.h b/src/terminal-menu-button.hh
similarity index 98%
rename from src/terminal-menu-button.h
rename to src/terminal-menu-button.hh
index c9362d05..86197abe 100644
--- a/src/terminal-menu-button.h
+++ b/src/terminal-menu-button.hh
@@ -20,7 +20,7 @@
#include <gtk/gtk.h>
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-nautilus.c b/src/terminal-nautilus.cc
similarity index 96%
rename from src/terminal-nautilus.c
rename to src/terminal-nautilus.cc
index 6e9a341a..7f4ea8ca 100644
--- a/src/terminal-nautilus.c
+++ b/src/terminal-nautilus.cc
@@ -31,9 +31,9 @@
#include <stdlib.h>
#include <string.h>
-#include "terminal-i18n.h"
-#include "terminal-client-utils.h"
-#include "terminal-defines.h"
+#include "terminal-i18n.hh"
+#include "terminal-client-utils.hh"
+#include "terminal-defines.hh"
#include "terminal-gdbus-generated.h"
/* Nautilus extension class */
@@ -301,8 +301,8 @@ create_terminal (ExecData *data /* transfer full */)
int argc;
factory = terminal_factory_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
- G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
+
GDBusProxyFlags(G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS),
TERMINAL_APPLICATION_ID,
TERMINAL_FACTORY_OBJECT_PATH,
NULL /* cancellable */,
@@ -350,8 +350,8 @@ create_terminal (ExecData *data /* transfer full */)
g_object_unref (factory);
receiver = terminal_receiver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
- G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
+
GDBusProxyFlags(G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS),
TERMINAL_APPLICATION_ID,
object_path,
NULL /* cancellable */,
@@ -458,7 +458,7 @@ terminal_nautilus_menu_item_activate (NautilusMenuItem *item)
}
data = g_new (ExecData, 1);
- data->nautilus = g_object_ref (nautilus);
+ data->nautilus = (TerminalNautilus*)g_object_ref (nautilus);
data->timestamp = gtk_get_current_event_time ();
data->path = path;
data->uri = uri;
@@ -504,7 +504,7 @@ terminal_nautilus_menu_item_class_init (TerminalNautilusMenuItemClass *klass)
}
static void
-terminal_nautilus_menu_item_class_finalize (TerminalNautilusMenuItemClass *class)
+terminal_nautilus_menu_item_class_finalize (TerminalNautilusMenuItemClass *klass)
{
}
@@ -563,15 +563,15 @@ terminal_nautilus_menu_item_new (TerminalNautilus *nautilus,
g_assert_not_reached ();
}
- item = g_object_new (TERMINAL_TYPE_NAUTILUS_MENU_ITEM,
+ item = (TerminalNautilusMenuItem*)g_object_new (TERMINAL_TYPE_NAUTILUS_MENU_ITEM,
"name", action_name,
"label", name,
"tip", tooltip,
"icon", TERMINAL_ICON_NAME,
- NULL);
+ nullptr);
- item->nautilus = g_object_ref (nautilus);
- item->file_info = g_object_ref (file_info);
+ item->nautilus = (TerminalNautilus*)g_object_ref (nautilus);
+ item->file_info = (NautilusFileInfo*)g_object_ref (file_info);
item->remote_terminal = remote_terminal;
return (NautilusMenuItem *) item;
@@ -737,7 +737,7 @@ terminal_nautilus_class_init (TerminalNautilusClass *klass)
}
static void
-terminal_nautilus_class_finalize (TerminalNautilusClass *class)
+terminal_nautilus_class_finalize (TerminalNautilusClass *klass)
{
}
diff --git a/src/terminal-notebook.c b/src/terminal-notebook.cc
similarity index 93%
rename from src/terminal-notebook.c
rename to src/terminal-notebook.cc
index 356a3898..d89b4940 100644
--- a/src/terminal-notebook.c
+++ b/src/terminal-notebook.cc
@@ -19,18 +19,18 @@
#include <config.h>
-#include "terminal-notebook.h"
+#include "terminal-notebook.hh"
#include <gtk/gtk.h>
-#include "terminal-debug.h"
-#include "terminal-app.h"
-#include "terminal-intl.h"
-#include "terminal-mdi-container.h"
-#include "terminal-screen-container.h"
-#include "terminal-tab-label.h"
-#include "terminal-schemas.h"
-#include "terminal-libgsystem.h"
+#include "terminal-debug.hh"
+#include "terminal-app.hh"
+#include "terminal-intl.hh"
+#include "terminal-mdi-container.hh"
+#include "terminal-screen-container.hh"
+#include "terminal-tab-label.hh"
+#include "terminal-schemas.hh"
+#include "terminal-libgsystem.hh"
#define TERMINAL_NOTEBOOK_GET_PRIVATE(notebook)(G_TYPE_INSTANCE_GET_PRIVATE ((notebook),
TERMINAL_TYPE_NOTEBOOK, TerminalNotebookPrivate))
@@ -410,13 +410,15 @@ terminal_notebook_constructed (GObject *object)
TERMINAL_SETTING_TAB_POLICY_KEY,
object,
"tab-policy",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
g_settings_bind (settings,
TERMINAL_SETTING_TAB_POSITION_KEY,
object,
"tab-pos",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
gtk_notebook_set_scrollable (notebook, TRUE);
gtk_notebook_set_show_border (notebook, FALSE);
@@ -457,10 +459,10 @@ terminal_notebook_set_property (GObject *object,
switch (prop_id) {
case PROP_ACTIVE_SCREEN:
- terminal_notebook_set_active_screen (mdi_container, g_value_get_object (value));
+ terminal_notebook_set_active_screen (mdi_container, (TerminalScreen*)g_value_get_object (value));
break;
case PROP_TAB_POLICY:
- terminal_notebook_set_tab_policy (TERMINAL_NOTEBOOK (mdi_container), g_value_get_enum (value));
+ terminal_notebook_set_tab_policy (TERMINAL_NOTEBOOK (mdi_container), GtkPolicyType(g_value_get_enum
(value)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -497,14 +499,14 @@ terminal_notebook_class_init (TerminalNotebookClass *klass)
g_param_spec_enum ("tab-policy", NULL, NULL,
GTK_TYPE_POLICY_TYPE,
GTK_POLICY_AUTOMATIC,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
/* Remove unwanted and interfering keybindings */
GtkBindingSet *binding_set = gtk_binding_set_by_class (terminal_notebook_parent_class);
- gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Up, GDK_CONTROL_MASK);
- gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Up, GDK_CONTROL_MASK | GDK_MOD1_MASK);
- gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Down, GDK_CONTROL_MASK);
- gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Down, GDK_CONTROL_MASK | GDK_MOD1_MASK);
+ gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Up, GdkModifierType(GDK_CONTROL_MASK));
+ gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Up, GdkModifierType(GDK_CONTROL_MASK | GDK_MOD1_MASK));
+ gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Down, GdkModifierType(GDK_CONTROL_MASK));
+ gtk_binding_entry_skip (binding_set, GDK_KEY_Page_Down, GdkModifierType(GDK_CONTROL_MASK | GDK_MOD1_MASK));
remove_reorder_bindings (binding_set, GDK_KEY_Up);
remove_reorder_bindings (binding_set, GDK_KEY_Down);
remove_reorder_bindings (binding_set, GDK_KEY_Left);
@@ -525,7 +527,8 @@ terminal_notebook_class_init (TerminalNotebookClass *klass)
GtkWidget *
terminal_notebook_new (void)
{
- return g_object_new (TERMINAL_TYPE_NOTEBOOK, NULL);
+ return reinterpret_cast<GtkWidget*>
+ (g_object_new (TERMINAL_TYPE_NOTEBOOK, nullptr));
}
void
@@ -565,7 +568,7 @@ terminal_notebook_get_action_box (TerminalNotebook *notebook,
list = gtk_container_get_children (GTK_CONTAINER (box));
g_assert (list->data != NULL);
- return list->data;
+ return (GtkWidget*)list->data;
}
/* Create container for the buttons */
diff --git a/src/terminal-notebook.h b/src/terminal-notebook.hh
similarity index 100%
rename from src/terminal-notebook.h
rename to src/terminal-notebook.hh
diff --git a/src/terminal-options.c b/src/terminal-options.cc
similarity index 92%
rename from src/terminal-options.c
rename to src/terminal-options.cc
index afe45455..04e38e24 100644
--- a/src/terminal-options.c
+++ b/src/terminal-options.cc
@@ -29,15 +29,15 @@
#include <glib/gi18n.h>
#include <glib/gprintf.h>
-#include "terminal-options.h"
-#include "terminal-client-utils.h"
-#include "terminal-defines.h"
-#include "terminal-schemas.h"
-#include "terminal-screen.h"
-#include "terminal-app.h"
-#include "terminal-util.h"
-#include "terminal-version.h"
-#include "terminal-libgsystem.h"
+#include "terminal-options.hh"
+#include "terminal-client-utils.hh"
+#include "terminal-defines.hh"
+#include "terminal-schemas.hh"
+#include "terminal-screen.hh"
+#include "terminal-app.hh"
+#include "terminal-util.hh"
+#include "terminal-version.hh"
+#include "terminal-libgsystem.hh"
static int verbosity = 1;
@@ -277,7 +277,7 @@ ensure_top_window (TerminalOptions *options,
if (options->initial_windows == NULL)
iw = add_new_window (options, NULL /* profile */, implicit_if_first_window);
else
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
g_assert_nonnull (iw->tabs);
@@ -294,7 +294,7 @@ ensure_top_tab (TerminalOptions *options)
g_assert_nonnull (iw->tabs);
- it = g_list_last (iw->tabs)->data;
+ it = (InitialTab*)g_list_last (iw->tabs)->data;
return it;
}
@@ -379,7 +379,7 @@ option_app_id_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
if (!g_application_id_is_valid (value)) {
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
@@ -399,7 +399,7 @@ option_command_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
GError *err = NULL;
char **exec_argv;
@@ -439,7 +439,7 @@ option_profile_cb (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
char *profile;
profile = terminal_profiles_list_dup_uuid_or_name (terminal_options_ensure_profiles_list (options),
@@ -478,7 +478,7 @@ option_profile_id_cb (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
char *profile;
profile = terminal_profiles_list_dup_uuid (terminal_options_ensure_profiles_list (options),
@@ -509,7 +509,7 @@ option_window_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
char *profile;
if (value != NULL) {
@@ -540,7 +540,7 @@ option_tab_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
char *profile;
if (value != NULL) {
@@ -555,7 +555,7 @@ option_tab_callback (const gchar *option_name,
{
InitialWindow *iw;
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
iw->tabs = g_list_append (iw->tabs, initial_tab_new (profile /* adopts */));
}
else
@@ -570,12 +570,12 @@ option_role_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
InitialWindow *iw;
if (options->initial_windows)
{
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
iw->role = g_strdup (value);
}
else if (!options->default_role)
@@ -596,12 +596,12 @@ option_show_menubar_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
InitialWindow *iw;
if (options->initial_windows)
{
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
if (iw->force_menubar_state && iw->menubar_state == TRUE)
{
terminal_printerr_detail (_("“%s” option given twice for the same window\n"),
@@ -628,12 +628,12 @@ option_hide_menubar_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
InitialWindow *iw;
if (options->initial_windows)
{
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
if (iw->force_menubar_state && iw->menubar_state == FALSE)
{
@@ -660,12 +660,12 @@ option_maximize_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
InitialWindow *iw;
if (options->initial_windows)
{
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
iw->start_maximized = TRUE;
}
else
@@ -680,13 +680,13 @@ option_fullscreen_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
if (options->initial_windows)
{
InitialWindow *iw;
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
iw->start_fullscreen = TRUE;
}
else
@@ -701,13 +701,13 @@ option_geometry_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
if (options->initial_windows)
{
InitialWindow *iw;
- iw = g_list_last (options->initial_windows)->data;
+ iw = (InitialWindow*)g_list_last (options->initial_windows)->data;
iw->geometry = g_strdup (value);
}
else
@@ -722,7 +722,7 @@ option_load_config_cb (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
GFile *file;
char *config_file;
GKeyFile *key_file;
@@ -733,7 +733,7 @@ option_load_config_cb (const gchar *option_name,
g_object_unref (file);
key_file = g_key_file_new ();
- result = g_key_file_load_from_file (key_file, config_file, 0, error) &&
+ result = g_key_file_load_from_file (key_file, config_file, GKeyFileFlags(0), error) &&
terminal_options_merge_config (options, key_file,
strcmp (option_name, "load-config") == 0 ? SOURCE_DEFAULT :
SOURCE_SESSION,
error);
@@ -749,7 +749,7 @@ option_title_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
if (options->initial_windows)
{
@@ -773,7 +773,7 @@ option_working_directory_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
if (options->initial_windows)
{
@@ -797,7 +797,7 @@ option_wait_cb (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
if (options->initial_windows)
{
@@ -820,7 +820,7 @@ option_pass_fd_cb (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
errno = 0;
char *end;
@@ -887,7 +887,7 @@ option_active_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
InitialTab *it;
it = ensure_top_tab (options);
@@ -902,7 +902,7 @@ option_zoom_callback (const gchar *option_name,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
double zoom;
char *end;
@@ -961,7 +961,7 @@ digest_options_callback (GOptionContext *context,
gpointer data,
GError **error)
{
- TerminalOptions *options = data;
+ TerminalOptions *options = (TerminalOptions*)data;
InitialTab *it;
if (options->execute)
@@ -1114,9 +1114,9 @@ terminal_options_parse (int *argcp,
/* Sanity check */
guint wait = 0;
for (GList *lw = options->initial_windows; lw != NULL; lw = lw->next) {
- InitialWindow *iw = lw->data;
+ InitialWindow *iw = (InitialWindow*)lw->data;
for (GList *lt = iw->tabs; lt != NULL; lt = lt->next) {
- InitialTab *it = lt->data;
+ InitialTab *it = (InitialTab*)lt->data;
if (it->wait)
wait++;
}
@@ -1317,7 +1317,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- option_app_id_callback,
+ (void*)option_app_id_callback,
"Server application ID",
"ID"
},
@@ -1326,7 +1326,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- unsupported_option_fatal_callback,
+ (void*)unsupported_option_fatal_callback,
N_("Do not register with the activation nameserver, do not re-use an active terminal"),
NULL
},
@@ -1335,7 +1335,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_FILENAME,
G_OPTION_ARG_CALLBACK,
- option_load_config_cb,
+ (void*)option_load_config_cb,
N_("Load a terminal configuration file"),
N_("FILE")
},
@@ -1344,7 +1344,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_FILENAME | G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- unsupported_option_callback,
+ (void*)unsupported_option_callback,
NULL, NULL
},
{
@@ -1379,7 +1379,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- option_version_cb,
+ (void*)option_version_cb,
NULL,
NULL
},
@@ -1388,7 +1388,7 @@ get_goption_context (TerminalOptions *options)
'v',
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_verbosity_cb,
+ (void*)option_verbosity_cb,
N_("Increase diagnostic verbosity"),
NULL
},
@@ -1397,11 +1397,11 @@ get_goption_context (TerminalOptions *options)
'q',
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_verbosity_cb,
+ (void*)option_verbosity_cb,
N_("Suppress output"),
NULL
},
- { NULL, 0, 0, 0, NULL, NULL, NULL }
+ { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
const GOptionEntry global_multiple_goptions[] = {
@@ -1410,7 +1410,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_window_callback,
+ (void*)option_window_callback,
N_("Open a new window containing a tab with the default profile"),
NULL
},
@@ -1419,11 +1419,11 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_tab_callback,
+ (void*)option_tab_callback,
N_("Open a new tab in the last-opened window with the default profile"),
NULL
},
- { NULL, 0, 0, 0, NULL, NULL, NULL }
+ { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
const GOptionEntry window_goptions[] = {
@@ -1432,7 +1432,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_show_menubar_callback,
+ (void*)option_show_menubar_callback,
N_("Turn on the menubar"),
NULL
},
@@ -1441,7 +1441,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_hide_menubar_callback,
+ (void*)option_hide_menubar_callback,
N_("Turn off the menubar"),
NULL
},
@@ -1450,7 +1450,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_maximize_callback,
+ (void*)option_maximize_callback,
N_("Maximize the window"),
NULL
},
@@ -1459,7 +1459,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_fullscreen_callback,
+ (void*)option_fullscreen_callback,
N_("Full-screen the window"),
NULL
},
@@ -1468,7 +1468,7 @@ get_goption_context (TerminalOptions *options)
0,
0,
G_OPTION_ARG_CALLBACK,
- option_geometry_callback,
+ (void*)option_geometry_callback,
N_("Set the window size; for example: 80x24, or 80x24+200+200 (COLSxROWS+X+Y)"),
N_("GEOMETRY")
},
@@ -1477,7 +1477,7 @@ get_goption_context (TerminalOptions *options)
0,
0,
G_OPTION_ARG_CALLBACK,
- option_role_callback,
+ (void*)option_role_callback,
N_("Set the window role"),
N_("ROLE")
},
@@ -1486,11 +1486,11 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_active_callback,
+ (void*)option_active_callback,
N_("Set the last specified tab as the active one in its window"),
NULL
},
- { NULL, 0, 0, 0, NULL, NULL, NULL }
+ { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
const GOptionEntry terminal_goptions[] = {
@@ -1499,7 +1499,7 @@ get_goption_context (TerminalOptions *options)
'e',
G_OPTION_FLAG_FILENAME,
G_OPTION_ARG_CALLBACK,
- option_command_callback,
+ (void*)option_command_callback,
N_("Execute the argument to this option inside the terminal"),
NULL
},
@@ -1508,7 +1508,7 @@ get_goption_context (TerminalOptions *options)
0,
0,
G_OPTION_ARG_CALLBACK,
- option_profile_cb,
+ (void*)option_profile_cb,
N_("Use the given profile instead of the default profile"),
N_("PROFILE-NAME")
},
@@ -1517,7 +1517,7 @@ get_goption_context (TerminalOptions *options)
't',
0,
G_OPTION_ARG_CALLBACK,
- option_title_callback,
+ (void*)option_title_callback,
N_("Set the initial terminal title"),
N_("TITLE")
},
@@ -1526,7 +1526,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_FILENAME,
G_OPTION_ARG_CALLBACK,
- option_working_directory_callback,
+ (void*)option_working_directory_callback,
N_("Set the working directory"),
N_("DIRNAME")
},
@@ -1535,7 +1535,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
- option_wait_cb,
+ (void*)option_wait_cb,
N_("Wait until the child exits"),
NULL
},
@@ -1544,7 +1544,7 @@ get_goption_context (TerminalOptions *options)
0,
0,
G_OPTION_ARG_CALLBACK,
- option_pass_fd_cb,
+ (void*)option_pass_fd_cb,
N_("Forward file descriptor"),
/* FD = file descriptor */
N_("FD")
@@ -1554,11 +1554,11 @@ get_goption_context (TerminalOptions *options)
0,
0,
G_OPTION_ARG_CALLBACK,
- option_zoom_callback,
+ (void*)option_zoom_callback,
N_("Set the terminal’s zoom factor (1.0 = normal size)"),
N_("ZOOM")
},
- { NULL, 0, 0, 0, NULL, NULL, NULL }
+ { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
const GOptionEntry internal_goptions[] = {
@@ -1567,7 +1567,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- option_profile_id_cb,
+ (void*)option_profile_id_cb,
NULL, NULL
},
{
@@ -1575,7 +1575,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- option_window_callback,
+ (void*)option_window_callback,
NULL, NULL
},
{
@@ -1583,7 +1583,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- option_tab_callback,
+ (void*)option_tab_callback,
NULL, NULL
},
{
@@ -1591,7 +1591,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- option_window_callback,
+ (void*)option_window_callback,
NULL, NULL
},
{
@@ -1599,7 +1599,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- option_tab_callback,
+ (void*)option_tab_callback,
NULL, NULL
},
{
@@ -1615,7 +1615,7 @@ get_goption_context (TerminalOptions *options)
0,
G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_CALLBACK,
- unsupported_option_callback,
+ (void*)unsupported_option_callback,
NULL, NULL
},
{
@@ -1627,12 +1627,12 @@ get_goption_context (TerminalOptions *options)
NULL,
NULL
},
- { NULL, 0, 0, 0, NULL, NULL, NULL }
+ { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
const GOptionEntry smclient_goptions[] = {
{ "sm-client-disable", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &options->sm_client_disable,
NULL, NULL },
- { "sm-client-state-file", 0, G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK,
option_load_config_cb, NULL, NULL },
+ { "sm-client-state-file", 0, G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK,
(void*)option_load_config_cb, NULL, NULL },
{ "sm-client-id", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &options->sm_client_id,
NULL, NULL },
{ "sm-disable", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &options->sm_client_disable,
NULL, NULL },
{ "sm-config-prefix", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &options->sm_config_prefix,
NULL, NULL },
diff --git a/src/terminal-options.h b/src/terminal-options.hh
similarity index 99%
rename from src/terminal-options.h
rename to src/terminal-options.hh
index 3ac4070e..dacdae93 100644
--- a/src/terminal-options.h
+++ b/src/terminal-options.hh
@@ -27,7 +27,7 @@
#include <gio/gunixfdlist.h>
-#include "terminal-profiles-list.h"
+#include "terminal-profiles-list.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-pcre2.h b/src/terminal-pcre2.hh
similarity index 100%
rename from src/terminal-pcre2.h
rename to src/terminal-pcre2.hh
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.cc
similarity index 91%
rename from src/terminal-prefs.c
rename to src/terminal-prefs.cc
index 05d2cf84..4f366a2b 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.cc
@@ -27,15 +27,15 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include "profile-editor.h"
-#include "terminal-prefs.h"
-#include "terminal-accels.h"
-#include "terminal-app.h"
-#include "terminal-debug.h"
-#include "terminal-schemas.h"
-#include "terminal-util.h"
-#include "terminal-profiles-list.h"
-#include "terminal-libgsystem.h"
+#include "profile-editor.hh"
+#include "terminal-prefs.hh"
+#include "terminal-accels.hh"
+#include "terminal-app.hh"
+#include "terminal-debug.hh"
+#include "terminal-schemas.hh"
+#include "terminal-util.hh"
+#include "terminal-profiles-list.hh"
+#include "terminal-libgsystem.hh"
PrefData *the_pref_data = NULL; /* global */
@@ -85,27 +85,27 @@ listbox_update (GtkListBox *box)
/* GTK+ doesn't seem to like if a popover is assigned to multiple buttons at once
* (not even temporarily), so make sure to remove it from the previous button first. */
for (i = 0; (row = gtk_list_box_get_row_at_index (box, i)) != NULL; i++) {
- button = g_object_get_data (G_OBJECT (row), "popover-button");
+ button = (GtkMenuButton*)g_object_get_data (G_OBJECT (row), "popover-button");
gtk_menu_button_set_popover (button, NULL);
}
for (i = 0; (row = gtk_list_box_get_row_at_index (box, i)) != NULL; i++) {
- profile = g_object_get_data (G_OBJECT (row), "gsettings");
+ profile = (GSettings*)g_object_get_data (G_OBJECT (row), "gsettings");
gboolean is_selected_profile = (profile != NULL && profile == the_pref_data->selected_profile);
gboolean is_default_profile = (profile != NULL && profile == default_profile);
- stack = g_object_get_data (G_OBJECT (row), "home-stack");
+ stack = (GtkStack*)g_object_get_data (G_OBJECT (row), "home-stack");
gtk_stack_set_visible_child_name (stack, is_default_profile ? "home" : "placeholder");
- stack = g_object_get_data (G_OBJECT (row), "popover-stack");
+ stack = (GtkStack*)g_object_get_data (G_OBJECT (row), "popover-stack");
gtk_stack_set_visible_child_name (stack, is_selected_profile ? "button" : "placeholder");
if (is_selected_profile) {
g_simple_action_set_enabled (lookup_action (GTK_WINDOW (the_pref_data->dialog), "delete"),
!is_default_profile);
g_simple_action_set_enabled (lookup_action (GTK_WINDOW (the_pref_data->dialog), "set-as-default"),
!is_default_profile);
GtkPopover *popover_menu = GTK_POPOVER (gtk_builder_get_object (the_pref_data->builder,
"popover-menu"));
- button = g_object_get_data (G_OBJECT (row), "popover-button");
+ button = (GtkMenuButton*)g_object_get_data (G_OBJECT (row), "popover-button");
gtk_menu_button_set_popover (button, GTK_WIDGET (popover_menu));
gtk_popover_set_relative_to (popover_menu, GTK_WIDGET (button));
}
@@ -119,8 +119,8 @@ update_window_title (void)
if (row == NULL)
return;
- GSettings *profile = g_object_get_data (G_OBJECT (row), "gsettings");
- GtkLabel *label = g_object_get_data (G_OBJECT (row), "label");
+ GSettings *profile = (GSettings*)g_object_get_data (G_OBJECT (row), "gsettings");
+ GtkLabel *label = (GtkLabel*)g_object_get_data (G_OBJECT (row), "label");
const char *text = gtk_label_get_text (label);
gs_free char *subtitle;
gs_free char *title;
@@ -146,8 +146,8 @@ listbox_row_selected_cb (GtkListBox *box,
/* row can be NULL intermittently during a profile meta operations */
g_free (the_pref_data->selected_profile_uuid);
if (row != NULL) {
- the_pref_data->selected_profile = g_object_get_data (G_OBJECT (row), "gsettings");
- the_pref_data->selected_profile_uuid = g_strdup (g_object_get_data (G_OBJECT (row), "uuid"));
+ the_pref_data->selected_profile = (GSettings*)g_object_get_data (G_OBJECT (row), "gsettings");
+ the_pref_data->selected_profile_uuid = g_strdup ((char const*)g_object_get_data (G_OBJECT (row),
"uuid"));
} else {
the_pref_data->selected_profile = NULL;
the_pref_data->selected_profile_uuid = NULL;
@@ -161,7 +161,7 @@ listbox_row_selected_cb (GtkListBox *box,
profile_prefs_load (the_pref_data->selected_profile_uuid, the_pref_data->selected_profile);
}
- char *stack_child_name = g_object_get_data (G_OBJECT (row), "stack_child_name");
+ char const* stack_child_name = (char const*)g_object_get_data (G_OBJECT (row), "stack_child_name");
gtk_stack_set_visible_child_name (stack, stack_child_name);
}
@@ -186,7 +186,7 @@ listbox_select_profile (const char *uuid)
{
GtkListBoxRow *row;
for (int i = 0; (row = gtk_list_box_get_row_at_index (the_pref_data->listbox, i)) != NULL; i++) {
- const char *rowuuid = g_object_get_data (G_OBJECT (row), "uuid");
+ const char *rowuuid = (char const*) g_object_get_data (G_OBJECT (row), "uuid");
if (g_strcmp0 (rowuuid, uuid) == 0) {
g_signal_emit_by_name (row, "activate");
return TRUE;
@@ -239,7 +239,7 @@ profile_delete_now (const char *dummy)
GtkListBoxRow *new_selected_row = gtk_list_box_get_row_at_index (the_pref_data->listbox, index + 1);
if (new_selected_row == NULL)
new_selected_row = gtk_list_box_get_row_at_index (the_pref_data->listbox, index - 1);
- GSettings *new_selected_profile = g_object_get_data (G_OBJECT (new_selected_row), "gsettings");
+ GSettings *new_selected_profile = (GSettings*)g_object_get_data (G_OBJECT (new_selected_row), "gsettings");
gs_free char *uuid = NULL;
if (new_selected_profile != NULL)
uuid = terminal_settings_list_dup_uuid_from_child (the_pref_data->profiles_list, new_selected_profile);
@@ -298,11 +298,11 @@ popover_dialog_closed_cb (GtkPopover *popover,
GtkButton *cancel = GTK_BUTTON (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-cancel"));
g_signal_handlers_disconnect_matched (ok, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
- G_CALLBACK (popover_dialog_ok_clicked_cb), NULL);
+ (void*)popover_dialog_ok_clicked_cb, NULL);
g_signal_handlers_disconnect_matched (cancel, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
- G_CALLBACK (popover_dialog_cancel_clicked_cb), NULL);
+ (void*)popover_dialog_cancel_clicked_cb, NULL);
g_signal_handlers_disconnect_matched (popover, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
- G_CALLBACK (popover_dialog_closed_cb), NULL);
+ (void*)popover_dialog_closed_cb, NULL);
}
@@ -347,7 +347,7 @@ profile_popup_dialog (GtkWidget *relative_to,
GtkButton *cancel = GTK_BUTTON (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-cancel"));
GtkPopover *popover_dialog = GTK_POPOVER (gtk_builder_get_object (the_pref_data->builder,
"popover-dialog"));
- g_signal_connect (ok, "clicked", G_CALLBACK (popover_dialog_ok_clicked_cb), fn);
+ g_signal_connect (ok, "clicked", G_CALLBACK (popover_dialog_ok_clicked_cb), (void*)fn);
g_signal_connect (cancel, "clicked", G_CALLBACK (popover_dialog_cancel_clicked_cb), NULL);
g_signal_connect (popover_dialog, "closed", G_CALLBACK (popover_dialog_closed_cb), NULL);
@@ -648,9 +648,9 @@ listboxrow_update_header (GtkListBoxRow *row,
return;
}
- GSettings *profile = g_object_get_data (G_OBJECT (row), "gsettings");
+ GSettings *profile = (GSettings*)g_object_get_data (G_OBJECT (row), "gsettings");
if (profile != NULL) {
- GSettings *profile_before = g_object_get_data (G_OBJECT (before), "gsettings");
+ GSettings *profile_before = (GSettings*)g_object_get_data (G_OBJECT (before), "gsettings");
if (profile_before != NULL) {
gtk_list_box_row_set_header (row, NULL);
} else {
@@ -676,9 +676,9 @@ listboxrow_compare_cb (GtkListBoxRow *row1,
if (sort_order_1 != sort_order_2)
return sort_order_1 < sort_order_2 ? -1 : 1;
- GtkLabel *label1 = g_object_get_data (G_OBJECT (row1), "label");
+ GtkLabel *label1 = (GtkLabel*)g_object_get_data (G_OBJECT (row1), "label");
const char *text1 = gtk_label_get_text (label1);
- GtkLabel *label2 = g_object_get_data (G_OBJECT (row2), "label");
+ GtkLabel *label2 = (GtkLabel*)g_object_get_data (G_OBJECT (row2), "label");
const char *text2 = gtk_label_get_text (label2);
return g_utf8_collate (text1, text2);
@@ -701,12 +701,12 @@ prefs_dialog_destroy_cb (GtkWidget *widget,
PrefData *data)
{
/* Don't run this handler again */
- g_signal_handlers_disconnect_by_func (widget, G_CALLBACK (prefs_dialog_destroy_cb), data);
+ g_signal_handlers_disconnect_by_func (widget, (void*)prefs_dialog_destroy_cb, data);
g_signal_handlers_disconnect_by_func (data->profiles_list,
- G_CALLBACK (listbox_readd_profiles), data);
+ (void*)listbox_readd_profiles, data);
g_signal_handlers_disconnect_by_func (data->profiles_list,
- G_CALLBACK (listbox_update), data->listbox);
+ (void*)listbox_update, data->listbox);
profile_prefs_destroy ();
@@ -740,6 +740,7 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
if (the_pref_data != NULL)
goto done;
+ {
the_pref_data = g_new0 (PrefData, 1);
data = the_pref_data;
data->profiles_list = terminal_app_get_profiles_list (app);
@@ -812,14 +813,14 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
TERMINAL_SETTING_DEFAULT_SHOW_MENUBAR_KEY,
show_menubar_button,
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET));
}
g_settings_bind (settings,
TERMINAL_SETTING_THEME_VARIANT_KEY,
theme_variant_combo,
"active-id",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET));
if (terminal_app_get_menu_unified (app) ||
terminal_app_get_use_headerbar (app)) {
@@ -827,7 +828,7 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
TERMINAL_SETTING_NEW_TERMINAL_MODE_KEY,
new_terminal_mode_combo,
"active-id",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET));
} else {
gtk_widget_set_visible (new_terminal_mode_label, FALSE);
gtk_widget_set_visible (new_terminal_mode_combo, FALSE);
@@ -837,7 +838,7 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
TERMINAL_SETTING_NEW_TAB_POSITION_KEY,
new_tab_position_combo,
"active-id",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET));
if (shell_shows_menubar) {
gtk_widget_set_visible (disable_mnemonics_button, FALSE);
@@ -846,13 +847,13 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
TERMINAL_SETTING_ENABLE_MNEMONICS_KEY,
disable_mnemonics_button,
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET));
}
g_settings_bind (settings,
TERMINAL_SETTING_ENABLE_MENU_BAR_ACCEL_KEY,
disable_menu_accel_button,
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET));
/* Shortcuts page */
@@ -860,7 +861,7 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
TERMINAL_SETTING_ENABLE_SHORTCUTS_KEY,
disable_shortcuts_button,
"active",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET));
g_signal_connect (disable_shortcuts_button, "toggled",
G_CALLBACK (shortcuts_button_toggled_cb), tree_view);
@@ -876,12 +877,12 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
GtkWidget *headerbar;
GtkWidget *bbox;
- headerbar = g_object_new (GTK_TYPE_HEADER_BAR,
- "show-close-button", TRUE,
- NULL);
+ headerbar = (GtkWidget*)g_object_new (GTK_TYPE_HEADER_BAR,
+ "show-close-button", TRUE,
+ nullptr);
bbox = gtk_widget_get_parent (help_button);
- gtk_container_remove (GTK_CONTAINER (bbox), g_object_ref (help_button));
+ gtk_container_remove (GTK_CONTAINER (bbox), (GtkWidget*)g_object_ref (help_button));
gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), help_button);
g_object_unref (help_button);
@@ -906,6 +907,7 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
g_signal_connect (dialog, "destroy", G_CALLBACK (prefs_dialog_destroy_cb), data);
g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *) &the_pref_data);
+ }
done:
if (profile != NULL) {
diff --git a/src/terminal-prefs.h b/src/terminal-prefs.hh
similarity index 97%
rename from src/terminal-prefs.h
rename to src/terminal-prefs.hh
index ecb4129f..72cf36ca 100644
--- a/src/terminal-prefs.h
+++ b/src/terminal-prefs.hh
@@ -20,7 +20,7 @@
#include <gtk/gtk.h>
-#include "terminal-profiles-list.h"
+#include "terminal-profiles-list.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-profiles-list.c b/src/terminal-profiles-list.cc
similarity index 98%
rename from src/terminal-profiles-list.c
rename to src/terminal-profiles-list.cc
index 6a85bc1b..c19bf2b6 100644
--- a/src/terminal-profiles-list.c
+++ b/src/terminal-profiles-list.cc
@@ -21,9 +21,9 @@
#include "config.h"
-#include "terminal-profiles-list.h"
-#include "terminal-schemas.h"
-#include "terminal-libgsystem.h"
+#include "terminal-profiles-list.hh"
+#include "terminal-schemas.hh"
+#include "terminal-libgsystem.hh"
#include <string.h>
#include <uuid.h>
diff --git a/src/terminal-profiles-list.h b/src/terminal-profiles-list.hh
similarity index 98%
rename from src/terminal-profiles-list.h
rename to src/terminal-profiles-list.hh
index 179d3e39..9a258d31 100644
--- a/src/terminal-profiles-list.h
+++ b/src/terminal-profiles-list.hh
@@ -21,7 +21,7 @@
#include <glib.h>
#include <gio/gio.h>
-#include "terminal-settings-list.h"
+#include "terminal-settings-list.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-regex.c b/src/terminal-regex.cc
similarity index 99%
rename from src/terminal-regex.c
rename to src/terminal-regex.cc
index cf514531..90b8f8a5 100644
--- a/src/terminal-regex.c
+++ b/src/terminal-regex.cc
@@ -20,7 +20,7 @@
#include <glib.h>
#include <stdio.h>
-#include "terminal-regex.h"
+#include "terminal-regex.hh"
#ifdef TERMINAL_REGEX_MAIN
@@ -34,7 +34,7 @@ get_match (const char *pattern, const char *string, GRegexMatchFlags match_flags
GMatchInfo *match_info;
gchar *match;
- regex = g_regex_new (pattern, 0, 0, NULL);
+ regex = g_regex_new (pattern, GRegexCompileFlags(0), GRegexMatchFlags(0), NULL);
g_regex_match (regex, string, match_flags, &match_info);
match = g_match_info_fetch (match_info, 0);
@@ -45,7 +45,7 @@ get_match (const char *pattern, const char *string, GRegexMatchFlags match_flags
/* Macros rather than functions to report useful line numbers on failure. */
#define assert_match(__pattern, __string, __expected) do { \
- gchar *__actual_match = get_match(__pattern, __string, 0); \
+ gchar *__actual_match = get_match(__pattern, __string, GRegexMatchFlags(0)); \
const gchar *__expected_match = __expected; \
if (__expected_match == ENTIRE) __expected_match = __string; \
g_assert_cmpstr(__actual_match, ==, __expected_match); \
diff --git a/src/terminal-regex.h b/src/terminal-regex.hh
similarity index 100%
rename from src/terminal-regex.h
rename to src/terminal-regex.hh
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.hh
similarity index 100%
rename from src/terminal-schemas.h
rename to src/terminal-schemas.hh
diff --git a/src/terminal-screen-container.c b/src/terminal-screen-container.cc
similarity index 91%
rename from src/terminal-screen-container.c
rename to src/terminal-screen-container.cc
index 459157bc..6158d213 100644
--- a/src/terminal-screen-container.c
+++ b/src/terminal-screen-container.cc
@@ -17,8 +17,8 @@
#include "config.h"
-#include "terminal-screen-container.h"
-#include "terminal-debug.h"
+#include "terminal-screen-container.hh"
+#include "terminal-debug.hh"
#if 0
#define USE_SCROLLED_WINDOW
@@ -200,17 +200,17 @@ terminal_screen_container_set_property (GObject *object,
switch (prop_id) {
case PROP_SCREEN:
- priv->screen = g_value_get_object (value);
+ priv->screen = (TerminalScreen*)g_value_get_object (value);
break;
case PROP_HSCROLLBAR_POLICY:
terminal_screen_container_set_policy (container,
- g_value_get_enum (value),
+ GtkPolicyType(g_value_get_enum (value)),
priv->vscrollbar_policy);
break;
case PROP_VSCROLLBAR_POLICY:
terminal_screen_container_set_policy (container,
priv->hscrollbar_policy,
- g_value_get_enum (value));
+ GtkPolicyType(g_value_get_enum (value)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -239,13 +239,13 @@ terminal_screen_container_class_init (TerminalScreenContainerClass *klass)
g_param_spec_enum ("window-placement", NULL, NULL,
GTK_TYPE_CORNER_TYPE,
GTK_CORNER_BOTTOM_RIGHT,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS)));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boolean ("window-placement-set", NULL, NULL,
FALSE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS)));
#endif
gtk_widget_class_set_css_name(widget_class, TERMINAL_SCREEN_CONTAINER_CSS_NAME);
@@ -255,26 +255,26 @@ terminal_screen_container_class_init (TerminalScreenContainerClass *klass)
PROP_SCREEN,
g_param_spec_object ("screen", NULL, NULL,
TERMINAL_TYPE_SCREEN,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
-
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS)));
+
g_object_class_install_property
(gobject_class,
PROP_HSCROLLBAR_POLICY,
g_param_spec_enum ("hscrollbar-policy", NULL, NULL,
GTK_TYPE_POLICY_TYPE,
GTK_POLICY_AUTOMATIC,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS)));
g_object_class_install_property
(gobject_class,
PROP_VSCROLLBAR_POLICY,
g_param_spec_enum ("vscrollbar-policy", NULL, NULL,
GTK_TYPE_POLICY_TYPE,
GTK_POLICY_AUTOMATIC,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS)));
}
/* public API */
@@ -288,9 +288,10 @@ terminal_screen_container_class_init (TerminalScreenContainerClass *klass)
GtkWidget *
terminal_screen_container_new (TerminalScreen *screen)
{
- return g_object_new (TERMINAL_TYPE_SCREEN_CONTAINER,
- "screen", screen,
- NULL);
+ return reinterpret_cast<GtkWidget*>
+ (g_object_new (TERMINAL_TYPE_SCREEN_CONTAINER,
+ "screen", screen,
+ nullptr));
}
/**
diff --git a/src/terminal-screen-container.h b/src/terminal-screen-container.hh
similarity index 98%
rename from src/terminal-screen-container.h
rename to src/terminal-screen-container.hh
index 6f816e68..6d30e5ca 100644
--- a/src/terminal-screen-container.h
+++ b/src/terminal-screen-container.hh
@@ -19,7 +19,7 @@
#define TERMINAL_SCREEN_CONTAINER_H
#include <gtk/gtk.h>
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-screen.c b/src/terminal-screen.cc
similarity index 95%
rename from src/terminal-screen.c
rename to src/terminal-screen.cc
index 21d508e8..06ab3164 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.cc
@@ -18,10 +18,10 @@
#include "config.h"
-#include "terminal-pcre2.h"
-#include "terminal-regex.h"
-#include "terminal-screen.h"
-#include "terminal-client-utils.h"
+#include "terminal-pcre2.hh"
+#include "terminal-regex.hh"
+#include "terminal-screen.hh"
+#include "terminal-client-utils.hh"
#include <errno.h>
#include <string.h>
@@ -46,21 +46,21 @@
#include <gdk/gdkx.h>
#endif
-#include "terminal-accels.h"
-#include "terminal-app.h"
-#include "terminal-debug.h"
-#include "terminal-defines.h"
-#include "terminal-enums.h"
-#include "terminal-intl.h"
+#include "terminal-accels.hh"
+#include "terminal-app.hh"
+#include "terminal-debug.hh"
+#include "terminal-defines.hh"
+#include "terminal-enums.hh"
+#include "terminal-intl.hh"
#include "terminal-marshal.h"
-#include "terminal-schemas.h"
-#include "terminal-screen-container.h"
-#include "terminal-util.h"
-#include "terminal-window.h"
-#include "terminal-info-bar.h"
-#include "terminal-libgsystem.h"
+#include "terminal-schemas.hh"
+#include "terminal-screen-container.hh"
+#include "terminal-util.hh"
+#include "terminal-window.hh"
+#include "terminal-info-bar.hh"
+#include "terminal-libgsystem.hh"
-#include "eggshell.h"
+#include "eggshell.hh"
#define URL_MATCH_CURSOR (GDK_HAND2)
@@ -532,11 +532,11 @@ terminal_screen_init (TerminalScreen *screen)
targets = gtk_target_table_new_from_list (target_list, &n_targets);
gtk_drag_dest_set (GTK_WIDGET (screen),
- GTK_DEST_DEFAULT_MOTION |
- GTK_DEST_DEFAULT_HIGHLIGHT |
- GTK_DEST_DEFAULT_DROP,
+ GtkDestDefaults(GTK_DEST_DEFAULT_MOTION |
+ GTK_DEST_DEFAULT_HIGHLIGHT |
+ GTK_DEST_DEFAULT_DROP),
targets, n_targets,
- GDK_ACTION_COPY | GDK_ACTION_MOVE);
+ GdkDragAction(GDK_ACTION_COPY | GDK_ACTION_MOVE));
gtk_target_table_free (targets, n_targets);
gtk_target_list_unref (target_list);
@@ -591,7 +591,7 @@ terminal_screen_set_property (GObject *object,
switch (prop_id)
{
case PROP_PROFILE:
- terminal_screen_set_profile (screen, g_value_get_object (value));
+ terminal_screen_set_profile (screen, (GSettings*)g_value_get_object (value));
break;
case PROP_TITLE:
/* not writable */
@@ -669,14 +669,20 @@ terminal_screen_class_init (TerminalScreenClass *klass)
PROP_PROFILE,
g_param_spec_object ("profile", NULL, NULL,
G_TYPE_SETTINGS,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB));
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB)));
g_object_class_install_property
(object_class,
PROP_TITLE,
g_param_spec_string ("title", NULL, NULL,
NULL,
- G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB));
+ GParamFlags(G_PARAM_READABLE |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB)));
g_type_class_add_private (object_class, sizeof (TerminalScreenPrivate));
@@ -749,7 +755,7 @@ terminal_screen_finalize (GObject *object)
TerminalScreenPrivate *priv = screen->priv;
g_signal_handlers_disconnect_by_func (terminal_app_get_desktop_interface_settings (terminal_app_get ()),
- G_CALLBACK (terminal_screen_system_font_changed_cb),
+ (void*)terminal_screen_system_font_changed_cb,
screen);
terminal_screen_set_profile (screen, NULL);
@@ -768,7 +774,7 @@ terminal_screen_new (GSettings *profile,
{
g_return_val_if_fail (G_IS_SETTINGS (profile), NULL);
- TerminalScreen *screen = g_object_new (TERMINAL_TYPE_SCREEN, NULL);
+ TerminalScreen *screen = (TerminalScreen*)g_object_new (TERMINAL_TYPE_SCREEN, nullptr);
terminal_screen_set_profile (screen, profile);
@@ -944,7 +950,8 @@ terminal_screen_exec (TerminalScreen *screen,
&shell);
gboolean preserve_cwd = FALSE;
- GSpawnFlags spawn_flags = G_SPAWN_SEARCH_PATH_FROM_ENVP | VTE_SPAWN_NO_PARENT_ENVV;
+ GSpawnFlags spawn_flags = GSpawnFlags(G_SPAWN_SEARCH_PATH_FROM_ENVP |
+ VTE_SPAWN_NO_PARENT_ENVV);
gs_strfreev char **exec_argv = NULL;
if (!terminal_screen_get_child_command (screen,
argv,
@@ -966,14 +973,14 @@ terminal_screen_exec (TerminalScreen *screen,
envv = g_environ_unsetenv (envv, "PWD");
}
- data->fd_list = fd_list ? g_object_ref(fd_list) : NULL;
+ data->fd_list = (GUnixFDList*)(fd_list ? g_object_ref(fd_list) : nullptr);
if (fd_array) {
g_assert_nonnull(fd_list);
int n_fds = g_unix_fd_list_get_length(fd_list);
gsize fd_array_data_len;
- const int *fd_array_data = g_variant_get_fixed_array (fd_array, &fd_array_data_len, 2 * sizeof (int));
+ const int *fd_array_data = (int const*)g_variant_get_fixed_array (fd_array, &fd_array_data_len, 2 *
sizeof (int));
data->n_fd_map = fd_array_data_len;
data->fd_map = g_new (int, data->n_fd_map);
@@ -997,7 +1004,7 @@ terminal_screen_exec (TerminalScreen *screen,
data->as_shell = as_shell;
data->pty_flags = VTE_PTY_DEFAULT;
data->spawn_flags = spawn_flags;
- data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
+ data->cancellable = (GCancellable*)(cancellable ? g_object_ref (cancellable) : nullptr);
terminal_screen_clear_exec_data (screen, TRUE);
priv->exec_data = data;
@@ -1046,10 +1053,10 @@ terminal_screen_profile_changed_cb (GSettings *profile,
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_CJK_UTF8_AMBIGUOUS_WIDTH_KEY))
{
- TerminalCJKWidth width;
+ int width;
width = g_settings_get_enum (profile, TERMINAL_PROFILE_CJK_UTF8_AMBIGUOUS_WIDTH_KEY);
- vte_terminal_set_cjk_ambiguous_width (vte_terminal, (int) width);
+ vte_terminal_set_cjk_ambiguous_width (vte_terminal, width);
}
if (gtk_widget_get_realized (GTK_WIDGET (screen)) &&
@@ -1095,11 +1102,11 @@ terminal_screen_profile_changed_cb (GSettings *profile,
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_BACKSPACE_BINDING_KEY))
vte_terminal_set_backspace_binding (vte_terminal,
- g_settings_get_enum (profile, TERMINAL_PROFILE_BACKSPACE_BINDING_KEY));
+ VteEraseBinding(g_settings_get_enum (profile,
TERMINAL_PROFILE_BACKSPACE_BINDING_KEY)));
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_DELETE_BINDING_KEY))
vte_terminal_set_delete_binding (vte_terminal,
- g_settings_get_enum (profile, TERMINAL_PROFILE_DELETE_BINDING_KEY));
+ VteEraseBinding(g_settings_get_enum (profile,
TERMINAL_PROFILE_DELETE_BINDING_KEY)));
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_ENABLE_BIDI_KEY))
vte_terminal_set_enable_bidi (vte_terminal,
@@ -1118,11 +1125,11 @@ terminal_screen_profile_changed_cb (GSettings *profile,
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_CURSOR_BLINK_MODE_KEY))
vte_terminal_set_cursor_blink_mode (vte_terminal,
- g_settings_get_enum (priv->profile,
TERMINAL_PROFILE_CURSOR_BLINK_MODE_KEY));
+ VteCursorBlinkMode(g_settings_get_enum (priv->profile,
TERMINAL_PROFILE_CURSOR_BLINK_MODE_KEY)));
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_CURSOR_SHAPE_KEY))
vte_terminal_set_cursor_shape (vte_terminal,
- g_settings_get_enum (priv->profile, TERMINAL_PROFILE_CURSOR_SHAPE_KEY));
+ VteCursorShape(g_settings_get_enum (priv->profile,
TERMINAL_PROFILE_CURSOR_SHAPE_KEY)));
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_REWRAP_ON_RESIZE_KEY))
vte_terminal_set_rewrap_on_resize (vte_terminal,
@@ -1130,7 +1137,7 @@ terminal_screen_profile_changed_cb (GSettings *profile,
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_TEXT_BLINK_MODE_KEY))
vte_terminal_set_text_blink_mode (vte_terminal,
- g_settings_get_enum (profile, TERMINAL_PROFILE_TEXT_BLINK_MODE_KEY));
+ VteTextBlinkMode(g_settings_get_enum (profile,
TERMINAL_PROFILE_TEXT_BLINK_MODE_KEY)));
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_WORD_CHAR_EXCEPTIONS_KEY))
{
@@ -1314,7 +1321,7 @@ terminal_screen_ref_profile (TerminalScreen *screen)
TerminalScreenPrivate *priv = screen->priv;
if (priv->profile != NULL)
- return g_object_ref (priv->profile);
+ return (GSettings*)g_object_ref (priv->profile);
return NULL;
}
@@ -1359,7 +1366,8 @@ terminal_screen_get_child_command (TerminalScreen *screen,
*exec_argv_p = exec_argv = NULL;
- preserve_cwd = g_settings_get_enum (profile, TERMINAL_PROFILE_PRESERVE_WORKING_DIRECTORY_KEY);
+ preserve_cwd = TerminalPreserveWorkingDirectory
+ (g_settings_get_enum (profile, TERMINAL_PROFILE_PRESERVE_WORKING_DIRECTORY_KEY));
if (argv)
{
@@ -1367,7 +1375,7 @@ terminal_screen_get_child_command (TerminalScreen *screen,
/* argv and cwd come from the command line client, so it must always be used */
*preserve_cwd_p = TRUE;
- *spawn_flags_p |= G_SPAWN_SEARCH_PATH_FROM_ENVP;
+ *spawn_flags_p = GSpawnFlags(*spawn_flags_p | G_SPAWN_SEARCH_PATH_FROM_ENVP);
}
else if (g_settings_get_boolean (profile, TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY))
{
@@ -1378,7 +1386,7 @@ terminal_screen_get_child_command (TerminalScreen *screen,
return FALSE;
*preserve_cwd_p = should_preserve_cwd (preserve_cwd, path_env, exec_argv[0]);
- *spawn_flags_p |= G_SPAWN_SEARCH_PATH_FROM_ENVP;
+ *spawn_flags_p = GSpawnFlags(*spawn_flags_p | G_SPAWN_SEARCH_PATH_FROM_ENVP);
}
else if (as_shell)
{
@@ -1393,7 +1401,7 @@ terminal_screen_get_child_command (TerminalScreen *screen,
only_name++;
else {
only_name = shell;
- *spawn_flags_p |= G_SPAWN_SEARCH_PATH_FROM_ENVP;
+ *spawn_flags_p = GSpawnFlags(*spawn_flags_p | G_SPAWN_SEARCH_PATH_FROM_ENVP);
}
exec_argv = g_new (char*, 3);
@@ -1408,7 +1416,7 @@ terminal_screen_get_child_command (TerminalScreen *screen,
exec_argv[argc++] = NULL;
*preserve_cwd_p = should_preserve_cwd (preserve_cwd, path_env, shell);
- *spawn_flags_p |= G_SPAWN_FILE_AND_ARGV_ZERO;
+ *spawn_flags_p = GSpawnFlags(*spawn_flags_p | G_SPAWN_FILE_AND_ARGV_ZERO);
}
else
@@ -1479,8 +1487,8 @@ terminal_screen_get_child_environment (TerminalScreen *screen,
g_ptr_array_add (retval, g_strdup_printf ("%s=%s", e, v ? v : ""));
g_ptr_array_add (retval, NULL);
- *path = g_strdup (g_hash_table_lookup (env_table, "PATH"));
- *shell = g_strdup (g_hash_table_lookup (env_table, "SHELL"));
+ *path = g_strdup ((char const*)g_hash_table_lookup (env_table, "PATH"));
+ *shell = g_strdup ((char const*)g_hash_table_lookup (env_table, "SHELL"));
g_hash_table_destroy (env_table);
return (char **) g_ptr_array_free (retval, FALSE);
@@ -1554,12 +1562,13 @@ spawn_result_cb (VteTerminal *terminal,
gpointer user_data)
{
TerminalScreen *screen = TERMINAL_SCREEN (terminal);
- ExecData *exec_data = user_data;
+ ExecData *exec_data = (ExecData*)user_data;
/* Terminal was destroyed while the spawn operation was in progress; nothing to do. */
if (terminal == NULL)
goto out;
+ {
TerminalScreenPrivate *priv = screen->priv;
priv->child_pid = pid;
@@ -1576,6 +1585,7 @@ spawn_result_cb (VteTerminal *terminal,
ExecData *new_exec_data = exec_data_clone (exec_data);
terminal_screen_clear_exec_data (screen, FALSE);
priv->exec_data = new_exec_data;
+ }
out:
@@ -1715,7 +1725,7 @@ terminal_screen_do_popup (TerminalScreen *screen,
info->timestamp = event->time;
info->hyperlink = hyperlink; /* adopted */
info->url = url; /* adopted */
- info->url_flavor = url_flavor;
+ info->url_flavor = TerminalURLFlavor(url_flavor);
info->number_info = number_info; /* adopted */
info->timestamp_info = timestamp_info; /* adopted */
@@ -1861,7 +1871,7 @@ terminal_screen_child_exited (VteTerminal *terminal,
priv->child_pid = -1;
- action = g_settings_get_enum (priv->profile, TERMINAL_PROFILE_EXIT_ACTION_KEY);
+ action = TerminalExitAction(g_settings_get_enum (priv->profile, TERMINAL_PROFILE_EXIT_ACTION_KEY));
switch (action)
{
@@ -2101,7 +2111,7 @@ _terminal_screen_update_scrollbar (TerminalScreen *screen)
if (container == NULL)
return;
- vpolicy = g_settings_get_enum (priv->profile, TERMINAL_PROFILE_SCROLLBAR_POLICY_KEY);
+ vpolicy = GtkPolicyType(g_settings_get_enum (priv->profile, TERMINAL_PROFILE_SCROLLBAR_POLICY_KEY));
terminal_screen_container_set_policy (container, GTK_POLICY_NEVER, vpolicy);
}
diff --git a/src/terminal-screen.h b/src/terminal-screen.hh
similarity index 100%
rename from src/terminal-screen.h
rename to src/terminal-screen.hh
diff --git a/src/terminal-search-popover.c b/src/terminal-search-popover.cc
similarity index 94%
rename from src/terminal-search-popover.c
rename to src/terminal-search-popover.cc
index ff18f49b..8b1dec81 100644
--- a/src/terminal-search-popover.c
+++ b/src/terminal-search-popover.cc
@@ -23,12 +23,12 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include "terminal-pcre2.h"
-#include "terminal-search-popover.h"
-#include "terminal-intl.h"
-#include "terminal-window.h"
-#include "terminal-app.h"
-#include "terminal-libgsystem.h"
+#include "terminal-pcre2.hh"
+#include "terminal-search-popover.hh"
+#include "terminal-intl.hh"
+#include "terminal-window.hh"
+#include "terminal-app.hh"
+#include "terminal-libgsystem.hh"
typedef struct _TerminalSearchPopoverPrivate TerminalSearchPopoverPrivate;
@@ -419,12 +419,12 @@ terminal_search_popover_init (TerminalSearchPopover *popover)
if (terminal_app_get_dialog_use_headerbar (terminal_app_get ())) {
GtkWidget *headerbar;
- headerbar = g_object_new (GTK_TYPE_HEADER_BAR,
- "title", gtk_window_get_title (window),
- "has-subtitle", FALSE,
- "show-close-button", TRUE,
- "visible", TRUE,
- NULL);
+ headerbar = (GtkWidget*)g_object_new (GTK_TYPE_HEADER_BAR,
+ "title", gtk_window_get_title (window),
+ "has-subtitle", FALSE,
+ "show-close-button", TRUE,
+ "visible", TRUE,
+ nullptr);
gtk_style_context_add_class (gtk_widget_get_style_context (headerbar),
"default-decoration");
gtk_window_set_titlebar (window, headerbar);
@@ -510,12 +510,18 @@ terminal_search_popover_class_init (TerminalSearchPopoverClass *klass)
pspecs[PROP_REGEX] =
g_param_spec_boxed ("regex", NULL, NULL,
VTE_TYPE_REGEX,
- G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB);
+ GParamFlags(G_PARAM_READABLE |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB));
pspecs[PROP_WRAP_AROUND] =
g_param_spec_boolean ("wrap-around", NULL, NULL,
FALSE,
- G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB);
+ GParamFlags(G_PARAM_READABLE |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB));
g_object_class_install_properties (gobject_class, G_N_ELEMENTS (pspecs), pspecs);
@@ -542,13 +548,14 @@ terminal_search_popover_class_init (TerminalSearchPopoverClass *klass)
TerminalSearchPopover *
terminal_search_popover_new (GtkWidget *relative_to_widget)
{
- return g_object_new (TERMINAL_TYPE_SEARCH_POPOVER,
+ return reinterpret_cast<TerminalSearchPopover*>
+ (g_object_new (TERMINAL_TYPE_SEARCH_POPOVER,
#if 0
- "relative-to", relative_to_widget,
+ "relative-to", relative_to_widget,
#else
- "transient-for", gtk_widget_get_toplevel (relative_to_widget),
+ "transient-for", gtk_widget_get_toplevel (relative_to_widget),
#endif
- NULL);
+ nullptr));
}
/**
diff --git a/src/terminal-search-popover.h b/src/terminal-search-popover.hh
similarity index 98%
rename from src/terminal-search-popover.h
rename to src/terminal-search-popover.hh
index 10771d9a..b7af128c 100644
--- a/src/terminal-search-popover.h
+++ b/src/terminal-search-popover.hh
@@ -21,7 +21,7 @@
#include <gtk/gtk.h>
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-search-provider.c b/src/terminal-search-provider.cc
similarity index 97%
rename from src/terminal-search-provider.c
rename to src/terminal-search-provider.cc
index 90c063e1..448b733b 100644
--- a/src/terminal-search-provider.c
+++ b/src/terminal-search-provider.cc
@@ -19,13 +19,13 @@
#include <string.h>
-#include "terminal-app.h"
-#include "terminal-debug.h"
-#include "terminal-libgsystem.h"
-#include "terminal-screen-container.h"
-#include "terminal-search-provider.h"
+#include "terminal-app.hh"
+#include "terminal-debug.hh"
+#include "terminal-libgsystem.hh"
+#include "terminal-screen-container.hh"
+#include "terminal-search-provider.hh"
#include "terminal-search-provider-gdbus-generated.h"
-#include "terminal-window.h"
+#include "terminal-window.hh"
struct _TerminalSearchProvider
{
@@ -353,7 +353,8 @@ terminal_search_provider_class_init (TerminalSearchProviderClass *klass)
TerminalSearchProvider *
terminal_search_provider_new (void)
{
- return g_object_new (TERMINAL_TYPE_SEARCH_PROVIDER, NULL);
+ return reinterpret_cast<TerminalSearchProvider*>
+ (g_object_new (TERMINAL_TYPE_SEARCH_PROVIDER, nullptr));
}
gboolean
diff --git a/src/terminal-search-provider.h b/src/terminal-search-provider.hh
similarity index 100%
rename from src/terminal-search-provider.h
rename to src/terminal-search-provider.hh
diff --git a/src/terminal-settings-list.c b/src/terminal-settings-list.cc
similarity index 94%
rename from src/terminal-settings-list.c
rename to src/terminal-settings-list.cc
index 5e52ca1d..a8abf27c 100644
--- a/src/terminal-settings-list.c
+++ b/src/terminal-settings-list.cc
@@ -17,19 +17,23 @@
#include "config.h"
-#include "terminal-settings-list.h"
+#include "terminal-settings-list.hh"
#include <string.h>
#include <uuid.h>
+
+// See https://gitlab.gnome.org/GNOME/dconf/-/issues/23
+extern "C" {
#include <dconf.h>
+}
#define G_SETTINGS_ENABLE_BACKEND
#include <gio/gsettingsbackend.h>
-#include "terminal-type-builtins.h"
-#include "terminal-schemas.h"
-#include "terminal-debug.h"
-#include "terminal-libgsystem.h"
+#include "terminal-type-builtins.hh"
+#include "terminal-schemas.hh"
+#include "terminal-debug.hh"
+#include "terminal-libgsystem.hh"
struct _TerminalSettingsList {
GSettings parent;
@@ -225,7 +229,7 @@ list_map_func (GVariant *value,
gpointer *result,
gpointer user_data)
{
- TerminalSettingsList *list = user_data;
+ TerminalSettingsList *list = (TerminalSettingsList*)user_data;
gs_strfreev char **entries;
entries = strv_sort (g_variant_dup_strv (value, NULL));
@@ -258,7 +262,7 @@ terminal_settings_list_ref_child_internal (TerminalSettingsList *list,
_terminal_debug_print (TERMINAL_DEBUG_SETTINGS_LIST,
"%s UUID %s\n", G_STRFUNC, uuid);
- child = g_hash_table_lookup (list->children, uuid);
+ child = (GSettings*)g_hash_table_lookup (list->children, uuid);
if (child)
goto done;
@@ -267,7 +271,7 @@ terminal_settings_list_ref_child_internal (TerminalSettingsList *list,
g_hash_table_insert (list->children, g_strdup (uuid), child /* adopted */);
done:
- return g_object_ref (child);
+ return (GSettings*)g_object_ref(child);
}
static char *
@@ -411,9 +415,9 @@ terminal_settings_list_update_list (TerminalSettingsList *list)
guint i;
gboolean changed;
- uuids = g_settings_get_mapped (&list->parent,
- TERMINAL_SETTINGS_LIST_LIST_KEY,
- list_map_func, list);
+ uuids = (char**)g_settings_get_mapped (&list->parent,
+ TERMINAL_SETTINGS_LIST_LIST_KEY,
+ list_map_func, list);
_TERMINAL_DEBUG_IF (TERMINAL_DEBUG_SETTINGS_LIST) {
g_printerr ("%s: current UUIDs [", G_STRFUNC);
@@ -438,7 +442,7 @@ terminal_settings_list_update_list (TerminalSettingsList *list)
for (i = 0; uuids[i] != NULL; i++) {
uuid = uuids[i];
- child = g_hash_table_lookup (list->children, uuid);
+ child = (GSettings*)g_hash_table_lookup (list->children, uuid);
if (child) {
g_object_ref (child);
@@ -554,7 +558,7 @@ terminal_settings_list_set_property (GObject *object,
list->child_schema_id = g_value_dup_string (value);
break;
case PROP_FLAGS:
- list->flags = g_value_get_flags (value);
+ list->flags = TerminalSettingsListFlags(g_value_get_flags (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -578,10 +582,11 @@ terminal_settings_list_class_init (TerminalSettingsListClass *klass)
* The name of the schema of the children of this list.
*/
g_object_class_install_property (object_class, PROP_CHILD_SCHEMA_ID,
- g_param_spec_string ("child-schema-id", NULL,NULL,
+ g_param_spec_string ("child-schema-id", NULL, NULL,
NULL,
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_WRITABLE |
+ G_PARAM_STATIC_STRINGS)));
/**
* TerminalSettingsList:flags:
@@ -592,8 +597,9 @@ terminal_settings_list_class_init (TerminalSettingsListClass *klass)
g_param_spec_flags ("flags", NULL,NULL,
TERMINAL_TYPE_SETTINGS_LIST_FLAGS,
TERMINAL_SETTINGS_LIST_FLAG_NONE,
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ GParamFlags(G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_WRITABLE |
+ G_PARAM_STATIC_STRINGS)));
/**
* TerminalSettingsList::children-changed:
@@ -651,12 +657,12 @@ terminal_settings_list_new (const char *path,
g_return_val_if_fail (child_schema_id != NULL, NULL);
g_return_val_if_fail (g_str_has_suffix (path, ":/"), NULL);
- return g_object_new (TERMINAL_TYPE_SETTINGS_LIST,
- "schema-id", schema_id,
- "child-schema-id", child_schema_id,
- "path", path,
- "flags", flags,
- NULL);
+ return reinterpret_cast<TerminalSettingsList*>(g_object_new (TERMINAL_TYPE_SETTINGS_LIST,
+ "schema-id", schema_id,
+ "child-schema-id", child_schema_id,
+ "path", path,
+ "flags", flags,
+ nullptr));
}
/**
diff --git a/src/terminal-settings-list.h b/src/terminal-settings-list.hh
similarity index 99%
rename from src/terminal-settings-list.h
rename to src/terminal-settings-list.hh
index ecf89500..40fc8414 100644
--- a/src/terminal-settings-list.h
+++ b/src/terminal-settings-list.hh
@@ -20,7 +20,7 @@
#include <gio/gio.h>
-#include "terminal-enums.h"
+#include "terminal-enums.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-tab-label.c b/src/terminal-tab-label.cc
similarity index 93%
rename from src/terminal-tab-label.c
rename to src/terminal-tab-label.cc
index 7b4b0849..fa18b1e8 100644
--- a/src/terminal-tab-label.c
+++ b/src/terminal-tab-label.cc
@@ -22,10 +22,10 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include "terminal-intl.h"
-#include "terminal-tab-label.h"
-#include "terminal-icon-button.h"
-#include "terminal-window.h"
+#include "terminal-intl.hh"
+#include "terminal-tab-label.hh"
+#include "terminal-icon-button.hh"
+#include "terminal-window.hh"
#define TERMINAL_TAB_LABEL_GET_PRIVATE(tab_label)(G_TYPE_INSTANCE_GET_PRIVATE ((tab_label),
TERMINAL_TYPE_TAB_LABEL, TerminalTabLabelPrivate))
@@ -130,7 +130,7 @@ terminal_tab_label_parent_set (GtkWidget *widget,
if (GTK_IS_NOTEBOOK (old_parent)) {
g_signal_handlers_disconnect_by_func (old_parent,
- G_CALLBACK (notify_tab_pos_cb),
+ (void*)notify_tab_pos_cb,
widget);
}
@@ -224,7 +224,7 @@ terminal_tab_label_dispose (GObject *object)
if (priv->screen != NULL) {
g_signal_handlers_disconnect_by_func (priv->screen,
- G_CALLBACK (sync_tab_label),
+ (void*)sync_tab_label,
priv->label);
g_object_unref (priv->screen);
priv->screen = NULL;
@@ -270,7 +270,7 @@ terminal_tab_label_set_property (GObject *object,
switch (prop_id) {
case PROP_SCREEN:
- priv->screen = g_value_dup_object (value);
+ priv->screen = (TerminalScreen*)g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -308,8 +308,11 @@ terminal_tab_label_class_init (TerminalTabLabelClass *klass)
PROP_SCREEN,
g_param_spec_object ("screen", NULL, NULL,
TERMINAL_TYPE_SCREEN,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB |
- G_PARAM_CONSTRUCT_ONLY));
+ GParamFlags(G_PARAM_READWRITE |
+ G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_NICK |
+ G_PARAM_STATIC_BLURB |
+ G_PARAM_CONSTRUCT_ONLY)));
g_type_class_add_private (gobject_class, sizeof (TerminalTabLabelPrivate));
}
@@ -325,10 +328,11 @@ terminal_tab_label_class_init (TerminalTabLabelClass *klass)
GtkWidget *
terminal_tab_label_new (TerminalScreen *screen)
{
- return g_object_new (TERMINAL_TYPE_TAB_LABEL,
- "orientation", GTK_ORIENTATION_HORIZONTAL,
- "screen", screen,
- NULL);
+ return reinterpret_cast<GtkWidget*>
+ (g_object_new (TERMINAL_TYPE_TAB_LABEL,
+ "orientation", GTK_ORIENTATION_HORIZONTAL,
+ "screen", screen,
+ nullptr));
}
/**
diff --git a/src/terminal-tab-label.h b/src/terminal-tab-label.hh
similarity index 98%
rename from src/terminal-tab-label.h
rename to src/terminal-tab-label.hh
index 20cfbceb..91b7e617 100644
--- a/src/terminal-tab-label.h
+++ b/src/terminal-tab-label.hh
@@ -21,7 +21,7 @@
#include <gtk/gtk.h>
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal-type-builtins.c.template b/src/terminal-type-builtins.cc.template
similarity index 96%
rename from src/terminal-type-builtins.c.template
rename to src/terminal-type-builtins.cc.template
index eb8fe997..1a76b342 100644
--- a/src/terminal-type-builtins.c.template
+++ b/src/terminal-type-builtins.cc.template
@@ -1,7 +1,7 @@
/*** BEGIN file-header ***/
#include <config.h>
-#include "terminal-type-builtins.h"
+#include "terminal-type-builtins.hh"
/*** END file-header ***/
diff --git a/src/terminal-type-builtins.h.template b/src/terminal-type-builtins.hh.template
similarity index 100%
rename from src/terminal-type-builtins.h.template
rename to src/terminal-type-builtins.hh.template
diff --git a/src/terminal-util.c b/src/terminal-util.cc
similarity index 97%
rename from src/terminal-util.c
rename to src/terminal-util.cc
index 99628ea9..007ca782 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.cc
@@ -37,12 +37,12 @@
#include <gdesktop-enums.h>
-#include "terminal-accels.h"
-#include "terminal-app.h"
-#include "terminal-intl.h"
-#include "terminal-util.h"
-#include "terminal-version.h"
-#include "terminal-libgsystem.h"
+#include "terminal-accels.hh"
+#include "terminal-app.hh"
+#include "terminal-intl.hh"
+#include "terminal-util.hh"
+#include "terminal-version.hh"
+#include "terminal-libgsystem.hh"
/**
* terminal_util_show_error_dialog:
@@ -184,9 +184,9 @@ terminal_util_show_about (void)
&error);
g_assert_no_error (error);
- data = g_bytes_get_data (bytes, &data_len);
+ data = (guint8 const*)g_bytes_get_data (bytes, &data_len);
key_file = g_key_file_new ();
- g_key_file_load_from_data (key_file, (const char *) data, data_len, 0, &error);
+ g_key_file_load_from_data (key_file, (const char *) data, data_len, GKeyFileFlags(0), &error);
g_assert_no_error (error);
authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL);
@@ -237,7 +237,7 @@ terminal_util_show_about (void)
vte_version,
vte_get_features ());
- dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
+ dialog = (GtkWindow*)g_object_new (GTK_TYPE_ABOUT_DIALOG,
/* Hold the application while the window is shown */
"application", terminal_app_get (),
"program-name", _("GNOME Terminal"),
@@ -252,7 +252,7 @@ terminal_util_show_about (void)
"website", ABOUT_URL,
"translator-credits", _("translator-credits"),
"logo-icon-name", GNOME_TERMINAL_ICON_NAME,
- NULL);
+ nullptr);
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
gtk_window_present (dialog);
@@ -688,7 +688,7 @@ terminal_util_add_proxy_env (GHashTable *env_table)
GDesktopProxyMode mode;
proxy_settings = terminal_app_get_proxy_settings (terminal_app_get ());
- mode = g_settings_get_enum (proxy_settings, "mode");
+ mode = GDesktopProxyMode(g_settings_get_enum (proxy_settings, "mode"));
if (mode == G_DESKTOP_PROXY_MODE_MANUAL)
{
@@ -776,7 +776,7 @@ s_to_rgba (GVariant *variant,
gpointer *result,
gpointer user_data)
{
- GdkRGBA *color = user_data;
+ GdkRGBA *color = (GdkRGBA*)user_data;
const char *str;
if (variant == NULL) {
@@ -851,9 +851,9 @@ terminal_g_settings_get_rgba (GSettings *settings,
{
g_return_val_if_fail (color != NULL, FALSE);
- return g_settings_get_mapped (settings, key,
- (GSettingsGetMapping) s_to_rgba,
- color);
+ return (GdkRGBA const*)g_settings_get_mapped (settings, key,
+ s_to_rgba,
+ color);
}
/**
@@ -880,7 +880,7 @@ as_to_rgba_palette (GVariant *variant,
gpointer *result,
gpointer user_data)
{
- gsize *n_colors = user_data;
+ gsize *n_colors = (gsize*)user_data;
gs_free GdkRGBA *colors = NULL;
gsize n = 0;
GVariantIter iter;
@@ -923,9 +923,9 @@ terminal_g_settings_get_rgba_palette (GSettings *settings,
const char *key,
gsize *n_colors)
{
- return g_settings_get_mapped (settings, key,
- (GSettingsGetMapping) as_to_rgba_palette,
- n_colors);
+ return (GdkRGBA*)g_settings_get_mapped (settings, key,
+ as_to_rgba_palette,
+ n_colors);
}
void
@@ -964,7 +964,7 @@ terminal_util_bind_mnemonic_label_sensitivity (GtkWidget *widget)
list = gtk_widget_list_mnemonic_labels (widget);
for (l = list; l != NULL; l = l->next) {
- GtkWidget *label = l->data;
+ GtkWidget *label = (GtkWidget*)l->data;
if (gtk_widget_is_ancestor (label, widget))
continue;
@@ -1004,7 +1004,7 @@ add_separators (const char *in, const char *sep, int groupby)
inlen = strlen(in);
seplen = strlen(sep);
outlen = inlen + (inlen - 1) / groupby * seplen;
- ret = out = g_malloc(outlen + 1);
+ ret = out = (char*)g_malloc(outlen + 1);
firstgrouplen = (inlen - 1) % groupby + 1;
memcpy(out, in, firstgrouplen);
@@ -1171,7 +1171,7 @@ terminal_util_uri_fixup (const char *uri,
if (g_ascii_strcasecmp (hostname, "localhost") == 0 ||
g_ascii_strcasecmp (hostname, g_get_host_name()) == 0) {
/* hostname corresponds to localhost */
- char *slash1, *slash2, *slash3;
+ char const *slash1, *slash2, *slash3;
/* We shouldn't enter this branch in case of URIs like
* "file:/etc/passwd", but just in case we do, or encounter
@@ -1258,8 +1258,8 @@ char *terminal_util_hyperlink_uri_label (const char *uri)
#define TERMINAL_PRINT_SETTINGS_GROUP_NAME "Print Settings"
#define TERMINAL_PAGE_SETUP_GROUP_NAME "Page Setup"
-#define KEYFILE_FLAGS_FOR_LOAD (G_KEY_FILE_NONE)
-#define KEYFILE_FLAGS_FOR_SAVE (G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS)
+#define KEYFILE_FLAGS_FOR_LOAD GKeyFileFlags(G_KEY_FILE_NONE)
+#define KEYFILE_FLAGS_FOR_SAVE GKeyFileFlags(G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS)
static char *
get_cache_dir (void)
@@ -1560,7 +1560,7 @@ terminal_util_find_program_in_path (const char *path,
len = strlen (program) + 1;
pathlen = strlen (path);
- freeme = name = g_malloc (pathlen + len + 1);
+ freeme = name = (char*)g_malloc (pathlen + len + 1);
/* Copy the file name at the top, including '\0' */
memcpy (name + pathlen + 1, program, len);
@@ -1582,7 +1582,7 @@ terminal_util_find_program_in_path (const char *path,
*/
startp = name + 1;
else
- startp = memcpy (name - (p - path), path, p - path);
+ startp = (char*)memcpy (name - (p - path), path, p - path);
if (g_file_test (startp, G_FILE_TEST_IS_EXECUTABLE) &&
!g_file_test (startp, G_FILE_TEST_IS_DIR))
diff --git a/src/terminal-util.h b/src/terminal-util.hh
similarity index 100%
rename from src/terminal-util.h
rename to src/terminal-util.hh
diff --git a/src/terminal-version.h.in b/src/terminal-version.hh.in
similarity index 100%
rename from src/terminal-version.h.in
rename to src/terminal-version.hh.in
diff --git a/src/terminal-window.c b/src/terminal-window.cc
similarity index 95%
rename from src/terminal-window.c
rename to src/terminal-window.cc
index 537cd2e1..393ebf8e 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.cc
@@ -28,22 +28,22 @@
#include <gtk/gtk.h>
#include <uuid.h>
-#include "terminal-app.h"
-#include "terminal-debug.h"
-#include "terminal-enums.h"
-#include "terminal-headerbar.h"
-#include "terminal-icon-button.h"
-#include "terminal-intl.h"
-#include "terminal-mdi-container.h"
-#include "terminal-menu-button.h"
-#include "terminal-notebook.h"
-#include "terminal-schemas.h"
-#include "terminal-screen-container.h"
-#include "terminal-search-popover.h"
-#include "terminal-tab-label.h"
-#include "terminal-util.h"
-#include "terminal-window.h"
-#include "terminal-libgsystem.h"
+#include "terminal-app.hh"
+#include "terminal-debug.hh"
+#include "terminal-enums.hh"
+#include "terminal-headerbar.hh"
+#include "terminal-icon-button.hh"
+#include "terminal-intl.hh"
+#include "terminal-mdi-container.hh"
+#include "terminal-menu-button.hh"
+#include "terminal-notebook.hh"
+#include "terminal-schemas.hh"
+#include "terminal-screen-container.hh"
+#include "terminal-search-popover.hh"
+#include "terminal-tab-label.hh"
+#include "terminal-util.hh"
+#include "terminal-window.hh"
+#include "terminal-libgsystem.hh"
struct _TerminalWindowPrivate
{
@@ -102,7 +102,7 @@ struct _TerminalWindowPrivate
* We don't want to enable content saving until vte supports it async.
* So we disable this code for stable versions.
*/
-#include "terminal-version.h"
+#include "terminal-version.hh"
#if (TERMINAL_MINOR_VERSION & 1) != 0
#define ENABLE_SAVE
@@ -259,7 +259,7 @@ popup_menu_remove_accelerators (GtkWidget *menu)
continue;
if (GTK_IS_ACCEL_LABEL ((label = gtk_bin_get_child (GTK_BIN (item)))))
- gtk_accel_label_set_accel (GTK_ACCEL_LABEL (label), 0, 0);
+ gtk_accel_label_set_accel (GTK_ACCEL_LABEL (label), 0, GdkModifierType(0));
/* Recurse into submenus */
if ((submenu = gtk_menu_item_get_submenu (item)))
@@ -288,8 +288,9 @@ static void
popup_menu_selection_done_cb (GtkMenu *menu,
gpointer user_data)
{
- g_signal_handlers_disconnect_by_func
- (menu, G_CALLBACK (popup_menu_selection_done_cb), user_data);
+ g_signal_handlers_disconnect_by_func(menu,
+ (void*)popup_menu_selection_done_cb,
+ user_data);
/* g_printerr ("selection-done %p\n", menu); */
@@ -335,7 +336,7 @@ action_new_terminal_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalApp *app;
TerminalSettingsList *profiles_list;
@@ -358,8 +359,8 @@ action_new_terminal_cb (GSimpleAction *action,
mode = TERMINAL_NEW_TERMINAL_MODE_TAB;
can_toggle = TRUE;
} else {
- mode = g_settings_get_enum (terminal_app_get_global_settings (app),
- TERMINAL_SETTING_NEW_TERMINAL_MODE_KEY);
+ mode = TerminalNewTerminalMode(g_settings_get_enum (terminal_app_get_global_settings (app),
+ TERMINAL_SETTING_NEW_TERMINAL_MODE_KEY));
can_toggle = TRUE;
}
@@ -415,8 +416,11 @@ action_new_terminal_cb (GSimpleAction *action,
#ifdef ENABLE_SAVE
static void
-save_contents_dialog_on_response (GtkDialog *dialog, gint response_id, gpointer terminal)
+save_contents_dialog_on_response (GtkDialog *dialog,
+ int response_id,
+ gpointer user_data)
{
+ VteTerminal *terminal = (VteTerminal*)user_data;
GtkWindow *parent;
gs_free gchar *filename_uri = NULL;
gs_unref_object GFile *file = NULL;
@@ -465,7 +469,7 @@ action_save_contents_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
GtkWidget *dialog = NULL;
TerminalWindowPrivate *priv = window->priv;
VteTerminal *terminal;
@@ -606,7 +610,7 @@ action_close_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalScreen *screen;
const char *mode_str;
@@ -635,7 +639,7 @@ action_copy_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
const char *format_str;
VteFormat format;
@@ -670,7 +674,7 @@ clipboard_uris_received_cb (GtkClipboard *clipboard,
gs_unref_object TerminalScreen *screen = NULL;
if (uris != NULL && uris[0] != NULL &&
- (screen = g_weak_ref_get (&data->screen_weak_ref))) {
+ (screen = (TerminalScreen*)g_weak_ref_get (&data->screen_weak_ref))) {
gs_free char *text;
gsize len;
@@ -720,7 +724,7 @@ action_paste_text_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
request_clipboard_contents_for_paste (window, FALSE);
}
@@ -730,7 +734,7 @@ action_paste_uris_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
request_clipboard_contents_for_paste (window, TRUE);
}
@@ -740,7 +744,7 @@ action_select_all_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
if (priv->active_screen == NULL)
@@ -754,7 +758,7 @@ action_reset_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
g_assert_nonnull (parameter);
@@ -800,7 +804,7 @@ action_tab_switch_left_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
tab_switch_relative (window, -1);
}
@@ -810,7 +814,7 @@ action_tab_switch_right_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
tab_switch_relative (window, 1);
}
@@ -820,7 +824,7 @@ action_tab_move_left_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
int change;
@@ -838,7 +842,7 @@ action_tab_move_right_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
int change;
@@ -856,7 +860,7 @@ action_zoom_in_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
double zoom;
@@ -876,7 +880,7 @@ action_zoom_out_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
double zoom;
@@ -896,7 +900,7 @@ action_zoom_normal_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
if (priv->active_screen == NULL)
@@ -911,7 +915,7 @@ action_tab_detach_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalApp *app;
TerminalWindow *new_window;
@@ -956,7 +960,7 @@ action_edit_preferences_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
terminal_app_edit_preferences (terminal_app_get (),
@@ -969,7 +973,7 @@ action_size_to_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
guint width, height;
@@ -992,7 +996,7 @@ action_open_match_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalScreenPopupInfo *info = priv->popup_info;
@@ -1010,7 +1014,7 @@ action_copy_match_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalScreenPopupInfo *info = priv->popup_info;
@@ -1027,7 +1031,7 @@ action_open_hyperlink_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalScreenPopupInfo *info = priv->popup_info;
@@ -1045,7 +1049,7 @@ action_copy_hyperlink_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalScreenPopupInfo *info = priv->popup_info;
@@ -1062,7 +1066,7 @@ action_enter_fullscreen_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
g_action_group_change_action_state (G_ACTION_GROUP (window), "fullscreen",
g_variant_new_boolean (TRUE));
@@ -1073,7 +1077,7 @@ action_leave_fullscreen_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
g_action_group_change_action_state (G_ACTION_GROUP (window), "fullscreen",
g_variant_new_boolean (FALSE));
@@ -1140,7 +1144,7 @@ action_find_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
if (G_UNLIKELY(priv->active_screen == NULL))
@@ -1180,7 +1184,7 @@ action_find_forward_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
if (priv->active_screen == NULL)
@@ -1194,7 +1198,7 @@ action_find_backward_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
if (priv->active_screen == NULL)
@@ -1208,7 +1212,7 @@ action_find_clear_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
if (priv->active_screen == NULL)
@@ -1223,7 +1227,7 @@ action_shadow_activate_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
gs_free char *param = g_variant_print(parameter, TRUE);
_terminal_debug_print (TERMINAL_DEBUG_ACCELS,
@@ -1242,7 +1246,7 @@ action_menubar_visible_state_cb (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
gboolean active;
active = g_variant_get_boolean (state);
@@ -1254,7 +1258,7 @@ action_fullscreen_state_cb (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
if (!gtk_widget_get_realized (GTK_WIDGET (window)))
return;
@@ -1272,7 +1276,7 @@ action_read_only_state_cb (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
g_assert_nonnull (state);
@@ -1293,7 +1297,7 @@ action_profile_state_cb (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
TerminalSettingsList *profiles_list;
const gchar *uuid;
@@ -1317,7 +1321,7 @@ action_active_tab_set_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
int value, n_screens;
@@ -1339,7 +1343,7 @@ action_active_tab_state_cb (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- TerminalWindow *window = user_data;
+ TerminalWindow *window = (TerminalWindow*)user_data;
TerminalWindowPrivate *priv = window->priv;
g_assert_nonnull (state);
@@ -1376,14 +1380,14 @@ enable_mnemonics_changed_cb (GSettings *settings,
if (enabled)
gtk_window_set_mnemonic_modifier (GTK_WINDOW (window), GDK_MOD1_MASK);
else
- gtk_window_set_mnemonic_modifier (GTK_WINDOW (window), GDK_MODIFIER_MASK & ~GDK_RELEASE_MASK);
+ gtk_window_set_mnemonic_modifier (GTK_WINDOW (window), GdkModifierType(GDK_MODIFIER_MASK &
~GDK_RELEASE_MASK));
}
static void
app_setting_notify_destroy_cb (GtkSettings *gtk_settings)
{
g_signal_handlers_disconnect_by_func (terminal_app_get_global_settings (terminal_app_get ()),
- G_CALLBACK (enable_menubar_accel_changed_cb),
+ (void*)enable_menubar_accel_changed_cb,
gtk_settings);
}
@@ -1669,7 +1673,7 @@ screen_popup_menu_selection_done_cb (GtkWidget *popup,
GtkWidget *window)
{
g_signal_handlers_disconnect_by_func
- (popup, G_CALLBACK (screen_popup_menu_selection_done_cb), window);
+ (popup, (void*)screen_popup_menu_selection_done_cb, window);
GtkWidget *attach_widget = gtk_menu_get_attach_widget (GTK_MENU (popup));
if (attach_widget != window || !TERMINAL_IS_WINDOW (attach_widget))
@@ -1844,7 +1848,7 @@ screen_match_clicked_cb (TerminalScreen *screen,
return FALSE;
gtk_widget_grab_focus (GTK_WIDGET (screen));
- terminal_util_open_url (GTK_WIDGET (window), url, url_flavor,
+ terminal_util_open_url (GTK_WIDGET (window), url, TerminalURLFlavor(url_flavor),
gtk_get_current_event_time ());
return TRUE;
@@ -1870,7 +1874,7 @@ notebook_update_tabs_menu_cb (GtkMenuButton *button,
tabs = terminal_window_list_screen_containers (window);
for (t = tabs, i = 0; t != NULL; t = t->next, i++) {
- TerminalScreenContainer *container = t->data;
+ TerminalScreenContainer *container = (TerminalScreenContainer*)t->data;
TerminalScreen *screen = terminal_screen_container_get_screen (container);
gs_unref_object GMenuItem *item;
const char *title;
@@ -2023,7 +2027,7 @@ terminal_window_screen_update (TerminalWindow *window,
TERMINAL_SETTING_ENABLE_SHORTCUTS_KEY,
gtk_settings,
"gtk-enable-accels",
- G_SETTINGS_BIND_GET);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET));
enable_menubar_accel_changed_cb (settings,
TERMINAL_SETTING_ENABLE_MENU_BAR_ACCEL_KEY,
@@ -2239,7 +2243,8 @@ terminal_window_init (TerminalWindow *window)
"enable-inspector-keybinding",
action,
"enabled",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+ GSettingsBindFlags(G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_NO_SENSITIVITY));
else
g_simple_action_set_enabled (action, FALSE);
@@ -2291,10 +2296,10 @@ terminal_window_class_init (TerminalWindowClass *klass)
GtkWindowClass *window_klass;
GtkBindingSet *binding_set;
- window_klass = g_type_class_ref (GTK_TYPE_WINDOW);
+ window_klass = (GtkWindowClass*)g_type_class_ref (GTK_TYPE_WINDOW);
binding_set = gtk_binding_set_by_class (window_klass);
- gtk_binding_entry_skip (binding_set, GDK_KEY_I, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
- gtk_binding_entry_skip (binding_set, GDK_KEY_D, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
+ gtk_binding_entry_skip (binding_set, GDK_KEY_I, GdkModifierType(GDK_CONTROL_MASK|GDK_SHIFT_MASK));
+ gtk_binding_entry_skip (binding_set, GDK_KEY_D, GdkModifierType(GDK_CONTROL_MASK|GDK_SHIFT_MASK));
g_type_class_unref (window_klass);
g_type_class_add_private (object_class, sizeof (TerminalWindowPrivate));
@@ -2314,7 +2319,7 @@ terminal_window_dispose (GObject *object)
if (!priv->disposed) {
GSettings *global_settings = terminal_app_get_global_settings (app);
g_signal_handlers_disconnect_by_func (global_settings,
- G_CALLBACK (enable_mnemonics_changed_cb),
+ (void*)enable_mnemonics_changed_cb,
window);
}
@@ -2322,7 +2327,7 @@ terminal_window_dispose (GObject *object)
if (priv->clipboard != NULL) {
g_signal_handlers_disconnect_by_func (app,
- G_CALLBACK (clipboard_targets_changed_cb),
+ (void*)clipboard_targets_changed_cb,
window);
priv->clipboard = NULL;
}
@@ -2399,10 +2404,11 @@ terminal_window_show (GtkWidget *widget)
TerminalWindow*
terminal_window_new (GApplication *app)
{
- return g_object_new (TERMINAL_TYPE_WINDOW,
- "application", app,
- "show-menubar", FALSE,
- NULL);
+ return reinterpret_cast<TerminalWindow*>
+ (g_object_new (TERMINAL_TYPE_WINDOW,
+ "application", app,
+ "show-menubar", FALSE,
+ nullptr));
}
static void
@@ -2508,8 +2514,9 @@ terminal_window_add_screen (TerminalWindow *window,
if (position == -1) {
GSettings *global_settings = terminal_app_get_global_settings (terminal_app_get ());
- TerminalNewTabPosition position_pref = g_settings_get_enum (global_settings,
- TERMINAL_SETTING_NEW_TAB_POSITION_KEY);
+ TerminalNewTabPosition position_pref = TerminalNewTabPosition
+ (g_settings_get_enum (global_settings,
+ TERMINAL_SETTING_NEW_TAB_POSITION_KEY));
switch (position_pref) {
case TERMINAL_NEW_TAB_POSITION_NEXT:
position = terminal_window_get_active_screen_num (window) + 1;
@@ -2894,38 +2901,38 @@ mdi_screen_removed_cb (TerminalMdiContainer *container,
window, screen);
g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
- G_CALLBACK (profile_set_cb),
+ (void*)profile_set_cb,
window);
g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
- G_CALLBACK (sync_screen_title),
+ (void*)sync_screen_title,
window);
g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
- G_CALLBACK (screen_font_any_changed_cb),
+ (void*)screen_font_any_changed_cb,
window);
g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
- G_CALLBACK (terminal_window_update_copy_sensitivity),
+ (void*)terminal_window_update_copy_sensitivity,
window);
g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
- G_CALLBACK (screen_hyperlink_hover_uri_changed),
+ (void*)screen_hyperlink_hover_uri_changed,
window);
g_signal_handlers_disconnect_by_func (screen,
- G_CALLBACK (screen_show_popup_menu_cb),
+ (void*)screen_show_popup_menu_cb,
window);
g_signal_handlers_disconnect_by_func (screen,
- G_CALLBACK (screen_match_clicked_cb),
+ (void*)screen_match_clicked_cb,
window);
g_signal_handlers_disconnect_by_func (screen,
- G_CALLBACK (screen_resize_window_cb),
+ (void*)screen_resize_window_cb,
window);
g_signal_handlers_disconnect_by_func (screen,
- G_CALLBACK (screen_close_cb),
+ (void*)screen_close_cb,
window);
/* We already got a switch-page signal whose handler sets the active tab to the
@@ -3114,9 +3121,9 @@ terminal_window_update_geometry (TerminalWindow *window)
gtk_window_set_geometry_hints (GTK_WINDOW (window),
NULL,
&hints,
- GDK_HINT_RESIZE_INC |
- GDK_HINT_MIN_SIZE |
- GDK_HINT_BASE_SIZE);
+ GdkWindowHints(GDK_HINT_RESIZE_INC |
+ GDK_HINT_MIN_SIZE |
+ GDK_HINT_BASE_SIZE));
_terminal_debug_print (TERMINAL_DEBUG_GEOMETRY,
"[window %p] hints: base %dx%d min %dx%d inc %d %d\n",
@@ -3156,7 +3163,7 @@ confirm_close_response_cb (GtkWidget *dialog,
{
TerminalScreen *screen;
- screen = g_object_get_data (G_OBJECT (dialog), "close-screen");
+ screen = (TerminalScreen*)g_object_get_data (G_OBJECT (dialog), "close-screen");
gtk_widget_destroy (dialog);
@@ -3226,7 +3233,8 @@ confirm_close_window_or_tab (TerminalWindow *window,
dialog = priv->confirm_close_dialog =
gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GtkDialogFlags(GTK_DIALOG_MODAL |
+ GTK_DIALOG_DESTROY_WITH_PARENT),
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CANCEL,
"%s", n_tabs > 1 ? _("Close this window?") : _("Close this terminal?"));
diff --git a/src/terminal-window.h b/src/terminal-window.hh
similarity index 99%
rename from src/terminal-window.h
rename to src/terminal-window.hh
index 7691c5a4..e6659aa4 100644
--- a/src/terminal-window.h
+++ b/src/terminal-window.hh
@@ -20,7 +20,7 @@
#include <gtk/gtk.h>
-#include "terminal-screen.h"
+#include "terminal-screen.hh"
G_BEGIN_DECLS
diff --git a/src/terminal.c b/src/terminal.cc
similarity index 96%
rename from src/terminal.c
rename to src/terminal.cc
index ad975391..7fc567a5 100644
--- a/src/terminal.c
+++ b/src/terminal.cc
@@ -35,14 +35,14 @@
#include <gtk/gtk.h>
-#include "terminal-debug.h"
-#include "terminal-defines.h"
-#include "terminal-i18n.h"
-#include "terminal-options.h"
+#include "terminal-debug.hh"
+#include "terminal-defines.hh"
+#include "terminal-i18n.hh"
+#include "terminal-options.hh"
#include "terminal-gdbus-generated.h"
-#include "terminal-defines.h"
-#include "terminal-client-utils.h"
-#include "terminal-libgsystem.h"
+#include "terminal-defines.hh"
+#include "terminal-client-utils.hh"
+#include "terminal-libgsystem.hh"
GS_DEFINE_CLEANUP_FUNCTION0(TerminalOptions*, gs_local_options_free, terminal_options_free)
#define gs_free_options __attribute__ ((cleanup(gs_local_options_free)))
@@ -128,10 +128,10 @@ get_factory_exit_status (const char *service_name,
pattern = g_strdup_printf ("org.freedesktop.DBus.Error.Spawn.ChildExited: Process %s exited with status
(\\d+)$",
service_name);
- regex = g_regex_new (pattern, 0, 0, &err);
+ regex = g_regex_new (pattern, GRegexCompileFlags(0), GRegexMatchFlags(0), &err);
g_assert_no_error (err);
- if (!g_regex_match (regex, message, 0, &match_info))
+ if (!g_regex_match (regex, message, GRegexMatchFlags(0), &match_info))
return FALSE;
number = g_match_info_fetch (match_info, 1);
@@ -231,8 +231,8 @@ factory_proxy_new_for_service_name (const char *service_name,
gs_free_error GError *err = NULL;
gs_unref_object TerminalFactory *factory =
terminal_factory_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
- connect_signals ? 0 : G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
+ GDBusProxyFlags(G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+ connect_signals ? 0 :
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS),
service_name,
TERMINAL_FACTORY_OBJECT_PATH,
NULL /* cancellable */,
@@ -408,7 +408,7 @@ handle_options (TerminalOptions *options,
for (GList *lw = options->initial_windows; lw != NULL; lw = lw->next)
{
- InitialWindow *iw = lw->data;
+ InitialWindow *iw = (InitialWindow*)lw->data;
g_assert_nonnull (iw);
@@ -421,7 +421,7 @@ handle_options (TerminalOptions *options,
/* Now add the tabs */
for (GList *lt = iw->tabs; lt != NULL; lt = lt->next)
{
- InitialTab *it = lt->data;
+ InitialTab *it = (InitialTab*)lt->data;
g_assert_nonnull (it);
GVariantBuilder builder;
@@ -494,8 +494,8 @@ handle_options (TerminalOptions *options,
gs_unref_object TerminalReceiver *receiver =
terminal_receiver_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
- (it->wait ? 0 :
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS),
+
GDBusProxyFlags(G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+ (it->wait ? 0 :
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS)),
factory_unique_name,
object_path,
NULL /* cancellable */,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]