add gtk4 option to the build system newapi

Sun, 16 Jun 2024 10:42:22 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 16 Jun 2024 10:42:22 +0200
branch
newapi
changeset 292
8e5e7adf5372
parent 291
302a150ff5e4
child 293
736c962f1011

add gtk4 option to the build system

configure file | annotate | diff | comparison | revisions
make/project.xml file | annotate | diff | comparison | revisions
ui/ui/toolkit.h file | annotate | diff | comparison | revisions
--- a/configure	Fri Jun 14 18:25:43 2024 +0200
+++ b/configure	Sun Jun 16 10:42:22 2024 +0200
@@ -365,13 +365,13 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if test_pkg_config "gtk+-4.0" "" "" "" ; then
-            TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-4.0`"
-            TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-4.0`"
+        if test_pkg_config "gtk4" "" "" "" ; then
+            TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk4`"
+            TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk4`"
         else
             break
         fi
-        TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK3"
+        TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK4"
         TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread"
         print_check_msg "$dep_checked_gtk4" "yes\n"
         dep_checked_gtk4=1
@@ -682,13 +682,13 @@
             break
         fi
         fi
-        if checkopt_toolkit_gtk3 ; then
-            echo "  toolkit: gtk3" >> "$TEMP_DIR/options"
+        if checkopt_toolkit_gtk4 ; then
+            echo "  toolkit: gtk4" >> "$TEMP_DIR/options"
             ERROR=0
             break
         fi
-        if checkopt_toolkit_qt5 ; then
-            echo "  toolkit: qt5" >> "$TEMP_DIR/options"
+        if checkopt_toolkit_gtk3 ; then
+            echo "  toolkit: gtk3" >> "$TEMP_DIR/options"
             ERROR=0
             break
         fi
--- a/make/project.xml	Fri Jun 14 18:25:43 2024 +0200
+++ b/make/project.xml	Sun Jun 16 10:42:22 2024 +0200
@@ -5,8 +5,8 @@
 	</dependency>
 
 	<dependency name="gtk4">
-		<pkgconfig>gtk+-4.0</pkgconfig>
-		<cflags>-DUI_GTK3</cflags>
+		<pkgconfig>gtk4</pkgconfig>
+		<cflags>-DUI_GTK4</cflags>
 		<ldflags>-lpthread</ldflags>
 	</dependency>
 	<dependency name="gtk3">
@@ -111,8 +111,9 @@
 			</value>
 			<default value="winui" platform="windows" />
 			<default value="cocoa" platform="macos" />
+			<default value="gtk4" />
 			<default value="gtk3" />
-			<default value="qt5" />
+			<!--<default value="qt5" />-->
 			<default value="gtk2" />
 			<default value="qt4" />
 			<default value="motif" />
--- a/ui/ui/toolkit.h	Fri Jun 14 18:25:43 2024 +0200
+++ b/ui/ui/toolkit.h	Sun Jun 16 10:42:22 2024 +0200
@@ -42,7 +42,7 @@
 typedef void* UIMENU;
 #endif
 
-#elif UI_GTK2 || UI_GTK3
+#elif UI_GTK2 || UI_GTK3 || UI_GTK4
 
 #include <gtk/gtk.h>
 #define UIWIDGET GtkWidget*

mercurial