--- /dev/null
+build:
+ image: teaci/msys32
+ shell: mingw32
+ pull: true
+ commands:
+ - pacman -S --needed --noconfirm --noprogressbar mingw-w64-i686-{toolchain,cmake,gtk2,gtkglext}
+ - cmake -G "MSYS Makefiles" .
+ - make
add_definitions(-D_DEBUG=1)
endif ()
-add_definitions(
- -DGTK_DISABLE_SINGLE_INCLUDES
- -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES
- -DGSEAL_ENABLE
-)
+macro(disable_deprecated name gtk2only)
+ add_definitions(-D${name}_DISABLE_SINGLE_INCLUDES)
+ if ((${gtk2only} EQUAL 0) OR (GTK_TARGET EQUAL 2))
+ add_definitions(-D${name}_DISABLE_DEPRECATED)
+ endif ()
+endmacro()
-if (GTK_TARGET EQUAL 2)
- add_definitions(
- -DGTK_DISABLE_DEPRECATED
- -DGDK_DISABLE_DEPRECATED
- )
-endif ()
+disable_deprecated(ATK 0)
+disable_deprecated(G 0)
+disable_deprecated(GDK 0)
+disable_deprecated(GDK_PIXBUF 0)
+disable_deprecated(GTK 1)
+disable_deprecated(PANGO 0)
if (APPLE)
option(XWINDOWS "Build against X11" ON)
-include(FindPkgConfig)
+find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
if (GLIB_FIND_REQUIRED)
- set(_PACKAGE_ARGS REQUIRED)
- else ()
- set(_PACKAGE_ARGS "")
+ set(_pkgconfig_REQUIRED REQUIRED)
+ endif ()
+ pkg_check_modules(GLIB ${_pkgconfig_REQUIRED} glib-2.0)
+else ()
+ find_path(GLIB_INCLUDE_DIRS glib.h)
+ find_library(GLIB_LIBRARIES glib-2.0)
+ if (GLIB_INCLUDE_DIRS AND GLIB_LIBRARIES)
+ set(GLIB_FOUND 1)
+ if (NOT GLIB_FIND_QUIETLY)
+ message(STATUS "Found GLIB: ${GLIB_LIBRARIES}")
+ endif ()
+ elseif (GLIB_FIND_REQUIRED)
+ message(SEND_ERROR "Could not find GLIB")
+ elseif (NOT GLIB_FIND_QUIETLY)
+ message(STATUS "Could not find GLIB")
endif ()
- pkg_check_modules(GLIB glib-2.0 ${_PACKAGE_ARGS})
endif ()
+mark_as_advanced(GLIB_INCLUDE_DIRS GLIB_LIBRARIES)
-include(FindPkgConfig)
+find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
- if (GLIB_FIND_REQUIRED)
- set(_PACKAGE_ARGS REQUIRED)
- else ()
- set(_PACKAGE_ARGS "")
+ if (GTK2_FIND_REQUIRED)
+ set(_pkgconfig_REQUIRED REQUIRED)
+ endif ()
+ pkg_check_modules(GTK2 ${_pkgconfig_REQUIRED} gtk+-2.0)
+else ()
+ find_path(GTK2_INCLUDE_DIRS gtk.h)
+ # find_library(GTK2_LIBRARIES)
+ if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
+ set(GTK2_FOUND 1)
+ if (NOT GTK2_FIND_QUIETLY)
+ message(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
+ endif ()
+ elseif (GTK2_FIND_REQUIRED)
+ message(SEND_ERROR "Could not find GTK2")
+ elseif (NOT GTK2_FIND_QUIETLY)
+ message(STATUS "Could not find GTK2")
endif ()
- pkg_check_modules(GTK2 gtk+-2.0 ${_PACKAGE_ARGS})
endif ()
+mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES)
-include(FindPkgConfig)
+find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
- if (GLIB_FIND_REQUIRED)
- set(_PACKAGE_ARGS REQUIRED)
- else ()
- set(_PACKAGE_ARGS "")
+ if (GTK3_FIND_REQUIRED)
+ set(_pkgconfig_REQUIRED REQUIRED)
+ endif ()
+ pkg_check_modules(GTK3 ${_pkgconfig_REQUIRED} gtk+-3.0)
+else ()
+ find_path(GTK3_INCLUDE_DIRS gtk.h)
+ # find_library(GTK3_LIBRARIES)
+ if (GTK3_INCLUDE_DIRS AND GTK3_LIBRARIES)
+ set(GTK3_FOUND 1)
+ if (NOT GTK3_FIND_QUIETLY)
+ message(STATUS "Found GTK3: ${GTK3_LIBRARIES}")
+ endif ()
+ elseif (GTK3_FIND_REQUIRED)
+ message(SEND_ERROR "Could not find GTK3")
+ elseif (NOT GTK3_FIND_QUIETLY)
+ message(STATUS "Could not find GTK3")
endif ()
- pkg_check_modules(GTK3 gtk+-3.0 ${_PACKAGE_ARGS})
endif ()
+mark_as_advanced(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)
-include(FindPkgConfig)
+find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
- if (GLIB_FIND_REQUIRED)
- set(_PACKAGE_ARGS REQUIRED)
- else ()
- set(_PACKAGE_ARGS "")
+ if (GtkGLExt_FIND_REQUIRED)
+ set(_pkgconfig_REQUIRED REQUIRED)
endif ()
if (XWINDOWS)
- pkg_check_modules(GTKGL gtkglext-x11-1.0 ${_PACKAGE_ARGS})
+ pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-x11-1.0)
elseif (WIN32)
- pkg_check_modules(GTKGL gtkglext-win32-1.0 ${_PACKAGE_ARGS})
+ pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-win32-1.0)
else ()
- pkg_check_modules(GTKGL gtkglext-quartz-1.0 ${_PACKAGE_ARGS})
+ pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-quartz-1.0)
+ endif ()
+else ()
+ find_path(GtkGLExt_INCLUDE_DIRS gtkglwidget.h)
+ # find_library(GtkGLExt_LIBRARIES)
+ if (GtkGLExt_INCLUDE_DIRS AND GtkGLExt_LIBRARIES)
+ set(GtkGLExt_FOUND 1)
+ if (NOT GtkGLExt_FIND_QUIETLY)
+ message(STATUS "Found GtkGLExt: ${GtkGLExt_LIBRARIES}")
+ endif ()
+ elseif (GtkGLExt_FIND_REQUIRED)
+ message(SEND_ERROR "Could not find GtkGLExt")
+ elseif (NOT GtkGLExt_FIND_QUIETLY)
+ message(STATUS "Could not find GtkGLExt")
endif ()
endif ()
+mark_as_advanced(GtkGLExt_INCLUDE_DIRS GtkGLExt_LIBRARIES)
-include(FindPkgConfig)
+find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
if (Minizip_FIND_REQUIRED)
- set(_PACKAGE_ARGS REQUIRED)
- else ()
- set(_PACKAGE_ARGS "")
+ set(_pkgconfig_REQUIRED REQUIRED)
+ endif ()
+ pkg_check_modules(Minizip ${_pkgconfig_REQUIRED} minizip)
+else ()
+ find_path(Minizip_INCLUDE_DIRS unzip.h)
+ # find_library(Minizip_LIBRARIES)
+ if (Minizip_INCLUDE_DIRS AND Minizip_LIBRARIES)
+ set(Minizip_FOUND 1)
+ if (NOT Minizip_FIND_QUIETLY)
+ message(STATUS "Found Minizip: ${Minizip_LIBRARIES}")
+ endif ()
+ elseif (Minizip_FIND_REQUIRED)
+ message(SEND_ERROR "Could not find Minizip")
+ elseif (NOT Minizip_FIND_QUIETLY)
+ message(STATUS "Could not find Minizip")
endif ()
- pkg_check_modules(Minizip minizip ${_PACKAGE_ARGS})
endif ()
+mark_as_advanced(Minizip_INCLUDE_DIRS Minizip_LIBRARIES)
--- /dev/null
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+ if (Pango_FIND_REQUIRED)
+ set(_pkgconfig_REQUIRED REQUIRED)
+ endif ()
+ pkg_search_module(Pango ${_pkgconfig_REQUIRED} pango pangocairo)
+ pkg_search_module(PangoFT2 ${_pkgconfig_REQUIRED} pangoft2)
+else ()
+ # find_path(Pango_INCLUDE_DIRS)
+ # find_library(Pango_LIBRARIES)
+ if (Pango_INCLUDE_DIRS AND Pango_LIBRARIES)
+ set(Pango_FOUND 1)
+ if (NOT Pango_FIND_QUIETLY)
+ message(STATUS "Found Pango: ${Pango_LIBRARIES}")
+ endif ()
+ elseif (Pango_FIND_REQUIRED)
+ message(SEND_ERROR "Could not find Pango")
+ elseif (NOT Pango_FIND_QUIETLY)
+ message(STATUS "Could not find Pango")
+ endif ()
+endif ()
+mark_as_advanced(Pango_INCLUDE_DIRS Pango_LIBRARIES)
+mark_as_advanced(PangoFT2_INCLUDE_DIRS PangoFT2_LIBRARIES)
target_include_directories(gtkutil PRIVATE ${GTK${GTK_TARGET}_INCLUDE_DIRS})
target_link_libraries(gtkutil PRIVATE ${GTK${GTK_TARGET}_LIBRARIES})
-find_package(GtkGLExt REQUIRED)
-target_include_directories(gtkutil PRIVATE ${GTKGL_INCLUDE_DIRS})
-target_link_libraries(gtkutil PRIVATE ${GTKGL_LIBRARIES})
+if (GTK_TARGET EQUAL 2)
+ find_package(GtkGLExt REQUIRED)
+ target_include_directories(gtkutil PRIVATE ${GtkGLExt_INCLUDE_DIRS})
+ target_link_libraries(gtkutil PRIVATE ${GtkGLExt_LIBRARIES})
+endif ()
uilib.cpp
)
+find_package(GLIB REQUIRED)
+target_include_directories(uilib PUBLIC ${GLIB_INCLUDE_DIRS})
+target_link_libraries(uilib PUBLIC ${GLIB_LIBRARIES})
+
+find_package(Pango REQUIRED)
+target_include_directories(uilib PUBLIC ${Pango_INCLUDE_DIRS} ${PangoFT2_INCLUDE_DIRS})
+target_link_libraries(uilib PUBLIC ${Pango_LIBRARIES} ${PangoFT2_LIBRARIES})
+
find_package(GTK${GTK_TARGET} REQUIRED)
target_include_directories(uilib PUBLIC ${GTK${GTK_TARGET}_INCLUDE_DIRS})
target_link_libraries(uilib PUBLIC ${GTK${GTK_TARGET}_LIBRARIES})
target_include_directories(uilib PUBLIC gtkutil)
target_link_libraries(uilib PUBLIC gtkutil)
-
-find_package(GLIB REQUIRED)
-target_include_directories(uilib PUBLIC ${GLIB_INCLUDE_DIRS})
-target_link_libraries(uilib PUBLIC ${GLIB_LIBRARIES})
text_editor.show();
#ifdef WIN32
- process_gui();
+ ui::process();
#endif
// only move the cursor if it's not exceeding the size..
#include "gtkutil/messagebox.h"
#ifdef WIN32
+#include <gtk/gtk.h>
#include <gdk/gdkwin32.h>
#include <shellapi.h>
bool open_url( const char* url ){