Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Start of Gtk3 to Gtk4 #1909

Open
wants to merge 102 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
1daf019
Use GdkEvent accessor functions part1
Bob-IT Apr 27, 2024
35c5e08
Use GdkEvent accessor functions part2
Bob-IT Apr 4, 2024
41dc329
Use GdkEvent accessor functions part3
Bob-IT Apr 4, 2024
6447d0e
Use GdkEvent accessor functions part4
Bob-IT Apr 4, 2024
18b10c8
Use GdkEvent accessor functions part5
Bob-IT Apr 4, 2024
e7c2921
Up the minimum Gtk version to 3.24.0
Bob-IT Apr 4, 2024
76c28dc
Use GtkEventControllerKey combo/completion cell
Bob-IT Apr 4, 2024
deb42ef
Push Webkit out of the way
Bob-IT Apr 4, 2024
7794b9f
Move to Gtk4 version 4.8.3
Bob-IT Apr 4, 2024
2374ed8
Start to use GtkEventControllerKey
Bob-IT Apr 27, 2024
5064fce
Start of gtk_style_context_get changes
Bob-IT Apr 4, 2024
46822c3
Comment out all gtk_widget_show_all
Bob-IT Apr 27, 2024
02165c0
Change gtk_widget_show/hide part1
Bob-IT Apr 27, 2024
2e17d2c
Change gtk_widget_show/hide part2
Bob-IT Apr 27, 2024
ee2f2b4
Change gtk_widget_show/hide part3
Bob-IT Apr 4, 2024
dc39ea6
Change gtk_entry_get/set_text to gnc version part1
Bob-IT Apr 10, 2024
33bea7a
Change gtk_entry_get/set_text to gnc version part2
Bob-IT Apr 4, 2024
aaab87f
Change gtk_entry_get/set_text to gnc version part3
Bob-IT Apr 4, 2024
cb30ae2
Change gtk_widget_destroy part1
Bob-IT Apr 4, 2024
4efef28
Change gtk_widget_destroy part2
Bob-IT Apr 4, 2024
f524ec6
Change gtk_widget_destroy part3
Bob-IT Apr 4, 2024
17093bc
Change gtk_box_pack_end/start part1
Bob-IT Apr 4, 2024
d54e96a
Change gtk_box_pack_end/start part2
Bob-IT Apr 4, 2024
0f21e92
Change gtk_box_pack_end/start part3
Bob-IT Apr 4, 2024
118fa52
Change gtk_container_add/remove
Bob-IT Apr 4, 2024
a35440a
Change gtk_conatiner_set_border
Bob-IT Apr 4, 2024
6f7ce42
Change some more gtk_container_ functions
Bob-IT Apr 10, 2024
b38f9b2
Start of some Builder changes
Bob-IT Apr 4, 2024
f3c3f0c
Change radio to toggle buttons
Bob-IT Apr 4, 2024
834fdb4
Changes for GtkBin
Bob-IT Apr 10, 2024
ea0905b
Change GtkAccelGroup to GtkShortcutController
Bob-IT Apr 4, 2024
aead9a8
Start changes in html folder
Bob-IT Apr 4, 2024
fb91971
Change gtk_buildable_get_name
Bob-IT Apr 4, 2024
8ed8fd4
Change gtk_window_resize
Bob-IT Apr 4, 2024
dbbcf95
Change gtk_entry_get/set_width_chars
Bob-IT Apr 4, 2024
0112aea
Change gtk_image_new_from_icon_name, one parameter
Bob-IT Apr 4, 2024
d2cc4f2
Change gtk_widget_get_toplevel
Bob-IT Apr 4, 2024
ba0b6d3
Changes for gtk_file_chooser
Bob-IT Apr 4, 2024
0f15d10
Start of changes for gtk_dialog_run part1
Bob-IT Apr 4, 2024
e8c87d1
Start of changes for gtk_dialog_run part2
Bob-IT Apr 4, 2024
3c2716d
Start of changes for gtk_dialog_run part3
Bob-IT Apr 4, 2024
4e86bd9
Change gtk_widget_grab_default
Bob-IT Apr 5, 2024
1f55318
Change gtk_window_get_size
Bob-IT Apr 5, 2024
423537c
Start changes in dialog-customer
Bob-IT Apr 5, 2024
6664dd9
Change GdkEventFocus events
Bob-IT Apr 27, 2024
575968c
Change gdk_event_get_coords
Bob-IT Apr 5, 2024
64cfeed
Change gtk_window_set_keep_above
Bob-IT Apr 5, 2024
cafbad6
Comment out gtk_events_pending
Bob-IT Apr 5, 2024
3783e1d
Change gtk_scrolled_window_new
Bob-IT Apr 5, 2024
b08896c
Correct adding widget to a frame widget
Bob-IT Apr 5, 2024
eba6df0
Start changes in gnc-icons
Bob-IT Apr 5, 2024
2b2e8c6
Change gtk_label_set_line_wrap
Bob-IT Apr 5, 2024
56919ef
Change gtk_box_reorder_child
Bob-IT Apr 27, 2024
d5a65df
Change GDK_MOD1_MASK to GDK_ALT_MASK
Bob-IT Apr 5, 2024
255f726
Change gtk_widget_get_tooltip_text
Bob-IT Apr 5, 2024
4e67a3b
Change gtk_window_new
Bob-IT Apr 5, 2024
6142468
Comment out gtk_window_set_skip_taskbar_hint
Bob-IT Apr 5, 2024
49572a2
Change gtk_button_box_new to gtk_box_new
Bob-IT Apr 5, 2024
bcaaf96
Comment out gtk_widget_get_clipboard
Bob-IT Apr 5, 2024
ddd137f
Comment out gtk_widget_set_no_show_all
Bob-IT Apr 5, 2024
2f60b5a
Comment out stuff in gnc-cell-...
Bob-IT Apr 5, 2024
98463c7
Comment out gtk_widget_add_events
Bob-IT Apr 5, 2024
d86a1df
Changes to keyval
Bob-IT Apr 5, 2024
f631a72
Start of changes to gnome-utils folder
Bob-IT Apr 5, 2024
4bae9cb
Start of changes to gnome folder
Bob-IT Apr 27, 2024
4f972ff
Start of changes to import-export folder
Bob-IT Apr 5, 2024
54ec86e
Start of changes to register folder
Bob-IT Apr 5, 2024
be01b90
Start of changes to others
Bob-IT Apr 5, 2024
15466b9
Change gtk_init_check
Bob-IT Apr 5, 2024
ae52be6
Fix and comment out errors to clear trace file
Bob-IT May 3, 2024
a51c2b8
Change gtk_main
Bob-IT May 3, 2024
3355f43
Start of gnc-main-window changes
Bob-IT May 3, 2024
acd662b
Start of gnc-splash changes
Bob-IT May 3, 2024
631f770
Start of about-dialog changes
Bob-IT May 3, 2024
723794e
Start of account plugin page changes
Bob-IT May 3, 2024
b692cbc
Start of gnc-main-window changes, popup
Bob-IT May 3, 2024
c649dda
Start of gnc-main-window changes, tab edit
Bob-IT May 3, 2024
c868739
Add ability to display toolbar
Bob-IT May 3, 2024
97b454f
Fix the tree view column menu
Bob-IT May 3, 2024
51cf3d3
Change the gnc_dialog_run function
Bob-IT May 3, 2024
3c9d998
Start of Cell Renderer changes
Bob-IT May 3, 2024
1f0a224
Start of gnc-amount-edit changes
Bob-IT May 3, 2024
2b49d45
Start of gnc-date-edit changes
Bob-IT May 3, 2024
53f65a8
Start of gnc-recurrence changes
Bob-IT May 3, 2024
a89bff0
Fix up the gnc-recurrence source files
Bob-IT May 3, 2024
abc34e0
Add a function to set the current builder object
Bob-IT May 3, 2024
80fcf4b
Fix loading help files on Linux
Bob-IT May 3, 2024
df12bab
Start of price database changes
Bob-IT May 3, 2024
b3dc6f3
Start of Commodity changes
Bob-IT May 3, 2024
2ef28a9
Start of gnc-general-select changes
Bob-IT May 3, 2024
3d14cbd
Fix up the gnc-commodity-edit source files
Bob-IT May 3, 2024
1e4f31b
Fix up the gnc-general-select source files
Bob-IT May 3, 2024
e7b1fc5
Fix up commodity source files
Bob-IT May 3, 2024
d34f6d5
Fix up price source files
Bob-IT May 3, 2024
77df727
Start of Budget changes
Bob-IT May 3, 2024
e3b79ed
Start of fincalc changes
Bob-IT May 3, 2024
43cb66f
Start of book close changes
Bob-IT May 3, 2024
56bd06d
Fixup book close source file
Bob-IT May 3, 2024
61e6867
Start of imap changes
Bob-IT May 3, 2024
9696c6c
Start of doclink changes
Bob-IT May 3, 2024
8aa4449
Fix test build.
jralls May 5, 2024
dc5f1a1
POTILES: Reflect the filename changes from .glade to .ui.
jralls May 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 30 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ if (WIN32)
#
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
set(CMAKE_FRAMEWORK_PATH_TMP ${CMAKE_PREFIX_PATH})
set(DEV_SUBDIRS aqbanking gnome guile gwenhywfar libgsf libofx libsoup libxslt webkit)
# set(DEV_SUBDIRS aqbanking gnome guile gwenhywfar libgsf libofx libsoup libxslt webkit)
set(DEV_SUBDIRS aqbanking gnome guile gwenhywfar libgsf libofx libsoup libxslt)
foreach(subdir ${DEV_SUBDIRS})
list(APPEND CMAKE_FRAMEWORK_PATH_TMP ${CMAKE_PREFIX_PATH}/${subdir})
endforeach()
Expand Down Expand Up @@ -199,7 +200,7 @@ if (NOT PKG_CONFIG_FOUND)

# glib et al.
set(GLIB_MIN_VERSION 2.56.1)
set(GTK_MIN_VERSION 3.22.30)
set(GTK_MIN_VERSION 4.8.3)

pkg_check_modules (GLIB2 REQUIRED IMPORTED_TARGET glib-2.0>=${GLIB_MIN_VERSION})
pkg_check_modules (GIO REQUIRED gio-2.0)
Expand All @@ -210,18 +211,18 @@ pkg_check_modules (GTHREAD REQUIRED gthread-2.0)
pkg_check_modules (LIBXML2 REQUIRED libxml-2.0>=2.9.4)
pkg_check_modules (LIBXSLT REQUIRED libxslt)
if (WITH_GNUCASH)
if (WIN32)
pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkitgtk-3.0)
set(WEBKIT1 1 CACHE INTERNAL "WebKitGtk")
else()
pkg_check_modules (WEBKIT IMPORTED_TARGET webkit2gtk-4.0>=2.14.0)
if (NOT WEBKIT_FOUND)
pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-4.1)
endif()
set(WEBKIT2 1 CACHE INTERNAL "WebKit2Gtk4")
endif()
# if (WIN32)
# pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkitgtk-3.0)
# set(WEBKIT1 1 CACHE INTERNAL "WebKitGtk")
# else()
# pkg_check_modules (WEBKIT IMPORTED_TARGET webkit2gtk-4.0>=2.14.0)
# if (NOT WEBKIT_FOUND)
# pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-4.1)
# endif()
# set(WEBKIT2 1 CACHE INTERNAL "WebKit2Gtk4")
# endif()

pkg_check_modules (GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=${GTK_MIN_VERSION})
pkg_check_modules (GTK4 REQUIRED IMPORTED_TARGET gtk4>=${GTK_MIN_VERSION})
endif()

pkg_check_modules (ZLIB REQUIRED zlib)
Expand Down Expand Up @@ -390,7 +391,7 @@ if (WITH_AQBANKING)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
if(WITH_GNUCASH)
pkg_check_modules (GWEN_GTK3 REQUIRED gwengui-gtk3)
pkg_check_modules (GWEN_GTK4 REQUIRED gwengui-gtk4)
endif()
endif()

Expand Down Expand Up @@ -604,12 +605,12 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)

if (UNIX)
set( CMAKE_C_FLAGS "-Werror -Wall -Wmissing-prototypes -Wmissing-declarations ${CMAKE_C_FLAGS}")
set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations ${CMAKE_CXX_FLAGS}")
set( CMAKE_C_FLAGS "-Werror -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED ${CMAKE_C_FLAGS}")
set( CMAKE_CXX_FLAGS "-Werror -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED ${CMAKE_CXX_FLAGS}")
set( CMAKE_C_FLAGS_RELEASE "-O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${CMAKE_C_FLAGS}")
endif()
if (MINGW)
set( CMAKE_C_FLAGS "-Werror -Wall -Wmissing-prototypes -Wmissing-declarations ${CMAKE_C_FLAGS}")
set( CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS}")
set( CMAKE_CXX_FLAGS "-DWINVER=0x0500 -D_EMULATE_GLIBC=0 ${CMAKE_CXX_FLAGS}") # Workaround for bug in gtest on mingw, see https://github.com/google/googletest/issues/893 and https://github.com/google/googletest/issues/920
endif()

Expand Down Expand Up @@ -728,7 +729,6 @@ set(gnucash_DOCS
ChangeLog.2023
DOCUMENTERS
HACKING
LICENSE
NEWS
README.dependencies
)
Expand Down Expand Up @@ -833,7 +833,7 @@ set_property(TARGET PkgConfig::GLIB2 PROPERTY INTERFACE_COMPILE_DEFINITIONS
if (WITH_GNUCASH)
string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GTK_MIN_MATCH ${GTK_MIN_VERSION})
set(GTK_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2})
set_property(TARGET PkgConfig::GTK3 PROPERTY INTERFACE_COMPILE_DEFINITIONS
set_property(TARGET PkgConfig::GTK4 PROPERTY INTERFACE_COMPILE_DEFINITIONS
GDK_VERSION_MIN_REQUIRED=GDK_VERSION_${GTK_API}
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_${GTK_API})
endif()
Expand Down Expand Up @@ -983,21 +983,6 @@ if (WIN32)
)
endif()

#Link LICENSE to COPYING so that people expecting to find it,
#will. COPYING is normally linked by autogen.sh to the latest
#automake-provided version.
set (_CMD create_symlink)
if (WIN32)
set(_CMD copy)
endif()

install(CODE
" execute_process(
COMMAND ${CMAKE_COMMAND} -E ${_CMD} LICENSE COPYING
WORKING_DIRECTORY ${CMAKE_INSTALL_DOCDIR}
)"
)

#For windows, copy in some DLLs from Mingw

if (WIN32)
Expand All @@ -1024,3 +1009,14 @@ if(UNIX)
endif()

include (CPack)

message(STATUS "<<< Gentoo configuration >>>
Build type ${CMAKE_BUILD_TYPE}
Install path ${CMAKE_INSTALL_PREFIX}
Compiler flags:
C ${CMAKE_C_FLAGS}
C++ ${CMAKE_CXX_FLAGS}
Linker flags:
Executable ${CMAKE_EXE_LINKER_FLAGS}
Module ${CMAKE_MODULE_LINKER_FLAGS}
Shared ${CMAKE_SHARED_LINKER_FLAGS}\n")
50 changes: 27 additions & 23 deletions borrowed/goffice/go-charmap-sel.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ struct _GOCharmapSel
{
GtkBox box;
GOOptionMenu *encodings;
GtkMenu *encodings_menu;
//FIXME gtk4 GtkMenu *encodings_menu;
GOCharmapSelTestDirection test;
};

Expand Down Expand Up @@ -361,10 +361,12 @@ static void go_charmap_sel_init(GOCharmapSel *cs)
cs->encodings = GO_OPTION_MENU(go_option_menu_new());

g_signal_connect(G_OBJECT(cs->encodings), "changed",
G_CALLBACK(encodings_changed_cb), cs);
gtk_box_pack_start(GTK_BOX(cs), GTK_WIDGET(cs->encodings), TRUE, TRUE, 0);
}
G_CALLBACK(encodings_changed_cb), cs);

gtk_box_append (GTK_BOX(cs), GTK_WIDGET(cs->encodings));
}
//FIXME gtk4
#ifdef skip
static void cs_build_menu(GOCharmapSel *cs)
{
GtkWidget *item;
Expand Down Expand Up @@ -398,11 +400,11 @@ static void cs_build_menu(GOCharmapSel *cs)
_(charset_trans->charset_title));
gtk_check_menu_item_set_draw_as_radio(
GTK_CHECK_MENU_ITEM(subitem), TRUE);
gtk_widget_show(subitem);
gtk_widget_set_visible (GTK_WIDGET(subitem), TRUE);
gtk_menu_shell_append(GTK_MENU_SHELL(submenu), subitem);
if (charset_trans->imp == CI_MAJOR)
cs_emphasize_label(
GTK_LABEL(gtk_bin_get_child(GTK_BIN(subitem))));
GTK_LABEL(gtk_widget_get_first_child(GTK_WIDGET(subitem))));
g_object_set_data(G_OBJECT(subitem), CHARMAP_NAME_KEY,
(gpointer) name);
}
Expand All @@ -419,14 +421,14 @@ static void cs_build_menu(GOCharmapSel *cs)
_(lgroup->group_name));

gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), GTK_WIDGET(submenu));
gtk_widget_show(item);
gtk_widget_set_visible (GTK_WIDGET(item), TRUE);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
lg_cnt++;
}
lgroup++;
}
item = gtk_separator_menu_item_new();
gtk_widget_show(item);
gtk_widget_set_visible (GTK_WIDGET(item), TRUE);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
lg_cnt++;

Expand All @@ -437,17 +439,17 @@ static void cs_build_menu(GOCharmapSel *cs)
item = gtk_check_menu_item_new_with_label(locale_encoding_menu_title);
gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(item), TRUE);
g_free(locale_encoding_menu_title);
gtk_widget_show(item);
gtk_widget_set_visible (GTK_WIDGET(item), TRUE);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
lg_cnt++;
cs_emphasize_label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(item))));
cs_emphasize_label(GTK_LABEL(gtk_widget_get_first_child(GTK_WIDGET(item))));
}

go_option_menu_set_menu(cs->encodings, GTK_WIDGET(menu));
cs->encodings_menu = menu;
set_menu_to_default(cs, lg_cnt);
}

#endif
static void go_charmap_sel_class_init(GOCharmapSelClass *klass)
{
CharsetInfo *ci;
Expand Down Expand Up @@ -589,18 +591,19 @@ go_charmap_sel_new(GOCharmapSelTestDirection test)
gchar const *
go_charmap_sel_get_encoding(GOCharmapSel *cs)
{
GtkMenuItem *selection;
//FIXME gtk4 GtkMenuItem *selection;
char const *locale_encoding;
char const *encoding;

g_get_charset(&locale_encoding);

g_return_val_if_fail(GO_IS_CHARMAP_SEL(cs), locale_encoding);

selection = GTK_MENU_ITEM(go_option_menu_get_history(cs->encodings));
encoding = (char const *) g_object_get_data(G_OBJECT(selection),
CHARMAP_NAME_KEY);
return encoding ? encoding : locale_encoding;
// selection = GTK_MENU_ITEM(go_option_menu_get_history(cs->encodings));
// encoding = (char const *) g_object_get_data(G_OBJECT(selection),
// CHARMAP_NAME_KEY);
// return encoding ? encoding : locale_encoding;
return NULL;
}

struct cb_find_entry
Expand All @@ -610,7 +613,8 @@ struct cb_find_entry
int i;
GSList *path;
};

//FIXME gtk4
#ifdef skip
static void cb_find_entry(GtkMenuItem *w, struct cb_find_entry *cl)
{
GtkWidget *sub;
Expand All @@ -625,8 +629,8 @@ static void cb_find_entry(GtkMenuItem *w, struct cb_find_entry *cl)
GINT_TO_POINTER(cl->i));
cl->i = 0;

gtk_container_foreach(GTK_CONTAINER(sub), (GtkCallback) cb_find_entry,
cl);
//FIXME gtk4 gtk_container_foreach(GTK_CONTAINER(sub), (GtkCallback) cb_find_entry,
// cl);
if (cl->found)
return;

Expand All @@ -647,7 +651,7 @@ static void cb_find_entry(GtkMenuItem *w, struct cb_find_entry *cl)
}
cl->i++;
}

#endif
gboolean go_charmap_sel_set_encoding(GOCharmapSel *cs, const char *enc)
{
struct cb_find_entry cl;
Expand All @@ -669,8 +673,8 @@ gboolean go_charmap_sel_set_encoding(GOCharmapSel *cs, const char *enc)
cl.i = 0;
cl.path = NULL;

gtk_container_foreach(GTK_CONTAINER(cs->encodings_menu),
(GtkCallback) cb_find_entry, &cl);
//FIXME gtk4 gtk_container_foreach(GTK_CONTAINER(cs->encodings_menu),
// (GtkCallback) cb_find_entry, &cl);
if (!cl.found)
return FALSE;

Expand All @@ -689,7 +693,7 @@ static void cs_set_property(GObject *object, guint prop_id, const GValue *value,
{
case PROP_TEST_DIRECTION:
cs->test = g_value_get_uint(value);
cs_build_menu(cs);
//FIXME gtk4 cs_build_menu(cs);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
Expand Down
Loading