├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml └── misc.xml ├── clibs ├── fontconfig │ ├── fcalias.h │ ├── fcftalias.h │ ├── fcaliastail.h │ ├── fcftaliastail.h │ ├── Android.mk │ ├── fcxml_android.c │ ├── fcinit_android.c │ └── config.h ├── .gitignore ├── glib │ ├── configmake.h │ ├── config.h │ ├── Android.mk │ └── include │ │ └── glibconfig.h ├── cairo │ ├── Readme.txt │ ├── pixman-extra │ │ ├── pixman-elf-fix.h │ │ ├── pixman-version.h │ │ ├── pixman-combine32.h │ │ └── pixman-combine64.h │ ├── cairo-extra │ │ └── cairo-features.h │ └── Android.mk ├── gtk │ ├── gtkcssprovider_hack.c │ ├── include │ │ ├── gdk │ │ │ └── gdkconfig.h │ │ └── gtkandroid.h │ ├── config.h │ ├── gtkandroidprivate.h │ ├── gtkresources.mk │ ├── build-gtk-shared-library.mk │ ├── gtkandroidassets.h │ ├── gtkadummyobject.c │ ├── Android.mk │ ├── gtkandroidassets.c │ └── gtkainit.c ├── gdk │ ├── include │ │ ├── gdk │ │ │ └── gdkconfig.h │ │ ├── gdkandroidevents.h │ │ ├── gdkandroidscreen.h │ │ └── gdkandroiddisplay.h │ ├── gdkinput-android.h │ ├── Android.mk │ ├── gdkwindow-android.h │ ├── gdkprivate-android.h │ ├── gdkjni.c │ ├── gdkevents-android.c │ └── gdkscreen-android.c ├── pango │ ├── config.h │ ├── module-defs-fc.c │ └── Android.mk ├── atk │ ├── config.h │ ├── Android.mk │ └── atk │ │ ├── atkmarshal.h │ │ └── atkmarshal.c ├── gdk-pixbuf │ ├── config.h │ └── Android.mk ├── pcre │ └── Android.mk ├── ffi │ └── Android.mk ├── gobject │ └── Android.mk ├── gmodule │ ├── Android.mk │ └── include │ │ └── gmoduleconf.h ├── freetype │ └── Android.mk ├── gio │ ├── include │ │ └── gio │ │ │ └── gnetworking.h │ ├── Android.mk │ └── giodummyobjects.c └── harfbuzz │ ├── Android.mk │ └── config.h ├── app ├── .gitignore ├── jni │ ├── Application.mk │ ├── Android.mk │ └── main.c ├── start-debug.cmd ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── strings.xml │ │ │ ├── menu │ │ │ │ └── dummy.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_dummy.xml │ │ └── java │ │ │ └── org │ │ │ └── p2lang │ │ │ └── gtkandroid │ │ │ └── DummyActivity.java │ └── androidTest │ │ └── java │ │ └── org │ │ └── p2lang │ │ └── gtk │ │ └── gtkandroid │ │ └── ApplicationTest.java ├── build-debug.cmd ├── build.gradle ├── AndroidManifest.xml └── app.iml ├── settings.gradle ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── GTKAndroid.iml ├── README.md ├── LIBFFI_LICENSE ├── FONTCONFIG_COPYING ├── COPYRIGHT ├── CAIRO_COPYING ├── FREETYPE_LICENSE.TXT ├── HARFBUZZ_COPYING ├── gradlew.bat └── gradlew /.idea/.name: -------------------------------------------------------------------------------- 1 | GTKAndroid -------------------------------------------------------------------------------- /clibs/fontconfig/fcalias.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /clibs/fontconfig/fcftalias.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /clibs/fontconfig/fcaliastail.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /clibs/fontconfig/fcftaliastail.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | libs 3 | obj -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /clibs/.gitignore: -------------------------------------------------------------------------------- 1 | *.tar.xz 2 | *.tar.gz 3 | *.tar.bz2 4 | distsrc -------------------------------------------------------------------------------- /app/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi 2 | APP_PLATFORM := android-15 3 | -------------------------------------------------------------------------------- /app/start-debug.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | call ndk-gdb.cmd --nowait --force --verbose 3 | -------------------------------------------------------------------------------- /clibs/glib/configmake.h: -------------------------------------------------------------------------------- 1 | // this module is needed for localcharset.c only 2 | 3 | #define LIBDIR "." 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugals/GTKAndroid/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugals/GTKAndroid/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugals/GTKAndroid/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugals/GTKAndroid/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugals/GTKAndroid/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /clibs/cairo/Readme.txt: -------------------------------------------------------------------------------- 1 | This library is based on https://code.google.com/p/cairo4android/ 2 | which was based on https://github.com/anoek/android-cairo/ itself -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /app/build-debug.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | call ndk-build.cmd NDK_DEBUG=1 %* 3 | if %errorlevel% neq 0 exit /b %errorlevel% 4 | call ..\gradlew.bat assembleDebug 5 | if %errorlevel% neq 0 exit /b %errorlevel% 6 | adb install -r build/outputs/apk/app-debug.apk 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 05 12:16:00 MSK 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /clibs/gtk/gtkcssprovider_hack.c: -------------------------------------------------------------------------------- 1 | // This is a hack to gtkcssprovider.c, so it would use Android application ASSETS 2 | // instead of the local files system 3 | 4 | #include "gtkandroidassets.h" 5 | 6 | #define g_file_test g_aasset_test 7 | #define g_file_new_for_path g_aasset_as_GFile_for_path 8 | 9 | #include "gtkcssprovider.c" 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GTK+Android 5 | DummyActivity 6 | Hello world! 7 | Settings 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/dummy.xml: -------------------------------------------------------------------------------- 1 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /clibs/gdk/include/gdk/gdkconfig.h: -------------------------------------------------------------------------------- 1 | /* gdkconfig.h 2 | * 3 | * This is a generated file. Please modify `configure.ac' 4 | */ 5 | 6 | #ifndef __GDKCONFIG_H__ 7 | #define __GDKCONFIG_H__ 8 | 9 | #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) 10 | #error "Only can be included directly." 11 | #endif 12 | 13 | #include 14 | 15 | G_BEGIN_DECLS 16 | 17 | 18 | G_END_DECLS 19 | 20 | #endif /* __GDKCONFIG_H__ */ 21 | -------------------------------------------------------------------------------- /clibs/gtk/include/gdk/gdkconfig.h: -------------------------------------------------------------------------------- 1 | /* gdkconfig.h 2 | * 3 | * This is a generated file. Please modify `configure.ac' 4 | */ 5 | 6 | #ifndef __GDKCONFIG_H__ 7 | #define __GDKCONFIG_H__ 8 | 9 | #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) 10 | #error "Only can be included directly." 11 | #endif 12 | 13 | #include 14 | 15 | G_BEGIN_DECLS 16 | 17 | 18 | G_END_DECLS 19 | 20 | #endif /* __GDKCONFIG_H__ */ 21 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/p2lang/gtk/gtkandroid/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package org.p2lang.gtk.gtkandroid; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /clibs/pango/config.h: -------------------------------------------------------------------------------- 1 | // Will use "config.h.win32" from GTK+ distribution directory 2 | // to obtain some invariants 3 | 4 | #include "config.h.win32" 5 | 6 | // now we make some overrides 7 | #undef ENABLE_NLS 8 | #undef HAVE_CAIRO_PDF 9 | #undef HAVE_CAIRO_PNG 10 | #undef HAVE_CAIRO_PS 11 | #undef HAVE_CAIRO_WIN32 12 | //#undef HAVE_CAIRO_FREETYPE 13 | 14 | // to prevent $(NDK_ROOT)/platforms/android-XX//usr/include/alloca.h 15 | // from loading as galloca.h has this definition already 16 | #define _ALLOCA_H 17 | 18 | #include -------------------------------------------------------------------------------- /clibs/cairo/pixman-extra/pixman-elf-fix.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASSEMBLER__ 2 | 3 | /* The pixman-cpu.c file uses the Elf32_auxv_t data structure, but the elf.h 4 | * file that Google provides is missing the definition, so here it is. */ 5 | #ifndef PIXMAN_ELF_FIX_H 6 | #define PIXMAN_ELF_FIX_H 7 | 8 | typedef struct { 9 | int a_type; 10 | 11 | union { 12 | long int a_val; 13 | void *a_ptr; 14 | void (*a_fcn)(void); 15 | } a_un; 16 | 17 | } Elf32_auxv_t; 18 | 19 | #endif /* PIXMAN_ELF_FIX_H */ 20 | 21 | #endif /* __ASSEMBLER__ */ 22 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /clibs/atk/config.h: -------------------------------------------------------------------------------- 1 | // Will use "config.h.win32" from GLIB distribution directory 2 | // to obtain some invariants (like GLIB_*_VERSION) 3 | 4 | #undef _ATK_EXTERN 5 | #include "config.h.win32" 6 | 7 | // now we make some overrides 8 | 9 | #undef ENABLE_NLS 10 | #undef HAVE_GETTEXT 11 | #undef HAVE_DCGETTEXT 12 | 13 | // "config.h.win32" defines _GLIB_EXTERN incompatible with gmacros.h 14 | #undef _ATK_EXTERN 15 | // redefine it! 16 | #define _ATK_EXTERN extern 17 | 18 | // the following two are defined in android/support module 19 | extern char *gettext(const char *msgid); 20 | extern char *dgettext(const char *domainname, const char *msgid); 21 | 22 | -------------------------------------------------------------------------------- /clibs/gtk/config.h: -------------------------------------------------------------------------------- 1 | // Will use "config.h.win32" from GTK+ distribution directory 2 | // to obtain some invariants 3 | 4 | #undef _GDK_EXTERN 5 | #include "config.h.win32" 6 | 7 | // now we make some overrides 8 | #undef ENABLE_NLS 9 | 10 | #undef _GDK_EXTERN 11 | #define _GDK_EXTERN extern 12 | 13 | #define GTK_DATA_PREFIX "assets" 14 | #define GTK_DATADIR "assets/share" 15 | #define GTK_LIBDIR "." 16 | #define GTK_SYSCONFDIR "/etc/xdg" 17 | #define GTK_PRINT_BACKENDS "" 18 | #define GTK_PRINT_PREVIEW_COMMAND "" 19 | 20 | #undef gid_t 21 | #undef uid_t 22 | 23 | // to prevent $(NDK_ROOT)/platforms/android-XX//usr/include/alloca.h 24 | // from loading as galloca.h has this definition already 25 | #define _ALLOCA_H 26 | -------------------------------------------------------------------------------- /clibs/pango/module-defs-fc.c: -------------------------------------------------------------------------------- 1 | /* Autogenerated by configure and then saved for use when compiling with 2 | Visual C. */ 3 | 4 | #include "module-defs.h" 5 | 6 | extern void _pango_basic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); 7 | extern void _pango_basic_fc_script_engine_init (GTypeModule *module); 8 | extern void _pango_basic_fc_script_engine_exit (void); 9 | extern PangoEngine *_pango_basic_fc_script_engine_create (const char *id); 10 | 11 | 12 | PangoIncludedModule _pango_included_fc_modules[] = { 13 | { _pango_basic_fc_script_engine_list, _pango_basic_fc_script_engine_init, _pango_basic_fc_script_engine_exit, _pango_basic_fc_script_engine_create }, 14 | { NULL, NULL, NULL, NULL }, 15 | }; 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_dummy.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/jni/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | LOCAL_PATH := $(call my-dir) 15 | 16 | include $(CLEAR_VARS) 17 | 18 | LOCAL_MODULE := gtka_test 19 | LOCAL_SRC_FILES := main.c 20 | 21 | include $(LOCAL_PATH)/../../clibs/gtk/build-gtk-shared-library.mk 22 | 23 | -------------------------------------------------------------------------------- /clibs/gtk/gtkandroidprivate.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Core android initialization functions 14 | 15 | #ifndef __GTK_ANDROID_PRIVATE_H__ 16 | #define __GTK_ANDROID_PRIVATE_H__ 17 | 18 | #include 19 | 20 | extern struct android_app *_gtk_android_glue_app; 21 | 22 | #endif // __GTK_ANDROID_PRIVATE_H__ -------------------------------------------------------------------------------- /clibs/gdk-pixbuf/config.h: -------------------------------------------------------------------------------- 1 | // Will use "config.h.win32" from GLIB distribution directory 2 | // to obtain some invariants (like GLIB_*_VERSION) 3 | 4 | #undef _GLIB_EXTERN 5 | #include "config.h.win32" 6 | 7 | // now we make some overrides 8 | 9 | #undef _WIN32_WINNT 10 | #undef BROKEN_POLL 11 | #undef NO_FD_SET 12 | #undef USE_MMX 13 | 14 | #undef ENABLE_NLS 15 | 16 | // the following two are defined in android/support module 17 | extern char *gettext(const char *msgid); 18 | extern char *dgettext(const char *domainname, const char *msgid); 19 | 20 | // "config.h.win32" defines _GLIB_EXTERN incompatible with gmacros.h 21 | #undef _GLIB_EXTERN 22 | // redefine it! 23 | #define _GLIB_EXTERN extern 24 | 25 | // to prevent $(NDK_ROOT)/platforms/android-XX//usr/include/alloca.h 26 | // from loading as galloca.h has this definition already 27 | #define _ALLOCA_H 28 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion '23.0.3' 6 | 7 | defaultConfig { 8 | applicationId "org.p2lang.gtkandroid" 9 | minSdkVersion 15 10 | targetSdkVersion 21 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | } 18 | debug { 19 | jniDebuggable true 20 | } 21 | } 22 | 23 | sourceSets.main { 24 | jniLibs.srcDir 'libs' 25 | manifest.srcFile 'AndroidManifest.xml' 26 | // adding gtk.css and other ndk-build non-*.so artifacts 27 | assets.srcDirs = [assets.srcDirs, "libs/assets"] 28 | } 29 | } 30 | 31 | dependencies { 32 | compile fileTree(include: ['*.jar'], dir: 'libs') 33 | } 34 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 24 | -------------------------------------------------------------------------------- /clibs/gtk/gtkresources.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | GTK_CSS_SRC := $(call my-dir)/distsrc/gtk/resources/theme/gtk-default.css 15 | GTK_CSS_DST := $(NDK_APP_LIBS_OUT)/assets/share/themes/Android/gtk-3.0/gtk.css 16 | 17 | installed_modules: $(GTK_CSS_DST) 18 | 19 | $(call generate-file-dir,$(GTK_CSS_DST)) 20 | 21 | $(GTK_CSS_DST): clean-installed-binaries 22 | $(hide) $(call host-install,$(GTK_CSS_SRC),$(GTK_CSS_DST)) 23 | 24 | -------------------------------------------------------------------------------- /clibs/cairo/cairo-extra/cairo-features.h: -------------------------------------------------------------------------------- 1 | #ifndef CAIRO_FEATURES_H 2 | #define CAIRO_FEATURES_H 3 | 4 | #define CAIRO_HAS_FC_FONT 1 5 | #define CAIRO_HAS_FT_FONT 1 6 | #define CAIRO_HAS_IMAGE_SURFACE 1 7 | #define CAIRO_HAS_RECORDING_SURFACE 1 8 | #define CAIRO_HAS_TEE_SURFACE 1 9 | #define CAIRO_HAS_EGL_FUNCTIONS 1 10 | #define CAIRO_HAS_GLESV2_SURFACE 1 11 | //#define CAIRO_HAS_USER_FONT 1 12 | 13 | /*#undef CAIRO_HAS_PDF_SURFACE */ 14 | /*#undef CAIRO_HAS_PNG_FUNCTIONS */ 15 | /*#undef CAIRO_HAS_SVG_SURFACE */ 16 | /*#undef CAIRO_HAS_GLX_FUNCTIONS */ 17 | /*#undef CAIRO_HAS_GOBJECT_FUNCTIONS */ 18 | /*#undef CAIRO_HAS_PS_SURFACE */ 19 | /*#undef CAIRO_HAS_QUARTZ_FONT */ 20 | /*#undef CAIRO_HAS_QUARTZ_SURFACE */ 21 | /*#undef CAIRO_HAS_WGL_FUNCTIONS */ 22 | /*#undef CAIRO_HAS_WIN32_FONT */ 23 | /*#undef CAIRO_HAS_WIN32_SURFACE */ 24 | /*#undef CAIRO_HAS_XCB_SHM_FUNCTIONS */ 25 | /*#undef CAIRO_HAS_XLIB_SURFACE */ 26 | /*#undef CAIRO_HAS_XLIB_XRENDER_SURFACE */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /GTKAndroid.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /clibs/gdk/include/gdkandroidevents.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Android<->GDK events conversion & interoperability interface 14 | 15 | #ifndef __GDK_ANDROID_EVENTS_H__ 16 | #define __GDK_ANDROID_EVENTS_H__ 17 | 18 | #include 19 | 20 | G_BEGIN_DECLS 21 | 22 | gboolean gdk_android_process_events_until_display_ready(struct android_app *app); 23 | void gdk_android_setup_app_callbacks(struct android_app *state, void (*onStop)()); 24 | 25 | G_END_DECLS 26 | 27 | #endif // __GDK_ANDROID_EVENTS_H__ 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The current code base [**DOESN'T WORK**](https://github.com/eugals/GTKAndroid/issues/3) on the modern `NDK` versions. The last *known* version it did work with was [`r10`](https://developer.android.com/ndk/downloads/older_releases.html). 2 | Some attempts to solve this incompatibility are hopefully introduced in this repo's [forks](https://github.com/eugals/GTKAndroid/network/members) here on GitHub. 3 | 4 | 5 | GTKAndroid 6 | ========== 7 | 8 | This is a set of hacks, makefiles and configs allowing you to run GTK-based forms on Android platform. 9 | 10 | Please see [**build instructions**](https://github.com/eugals/GTKAndroid/wiki/Building) 11 | 12 | 13 | Known issues/limitations of this 0.1alpha version: 14 | 15 | - It may take a few seconds for something to appear on the screen, when you run the app **for the first time**. 16 | (`fontconfig` processes all the system fonts then) 17 | 18 | - All libraries are statically linked atm 19 | (several of them are LGPL-licensed, which may be inappropriate for some applications) 20 | 21 | - Only "C" locale is supported by `libc` on Android 22 | 23 | - No soft keyboard support yet 24 | -------------------------------------------------------------------------------- /clibs/gtk/include/gtkandroid.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Core android initialization functions 14 | 15 | #ifndef __GTK_ANDROID_H__ 16 | #define __GTK_ANDROID_H__ 17 | 18 | #include 19 | 20 | // Prepares basic infrastructure needed by gtk+ applications. 21 | // Call this function at the beginning of your android_main 22 | // instead of *gtk_init* which would be used on other platforms 23 | void gtk_android_init(struct android_app *state); 24 | 25 | // Finished the activity and makes sure it is properly unloaded 26 | void gtk_android_exit(struct android_app *state); 27 | 28 | #endif // __GTK_ANDROID_H__ -------------------------------------------------------------------------------- /LIBFFI_LICENSE: -------------------------------------------------------------------------------- 1 | libffi - Copyright (c) 1996-2008 Red Hat, Inc and others. 2 | See source files for details. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | ``Software''), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /app/src/main/java/org/p2lang/gtkandroid/DummyActivity.java: -------------------------------------------------------------------------------- 1 | package org.p2lang.gtkandroid; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.Menu; 6 | import android.view.MenuItem; 7 | 8 | 9 | public class DummyActivity extends Activity { 10 | 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.activity_dummy); 15 | } 16 | 17 | 18 | @Override 19 | public boolean onCreateOptionsMenu(Menu menu) { 20 | // Inflate the menu; this adds items to the action bar if it is present. 21 | getMenuInflater().inflate(R.menu.dummy, menu); 22 | return true; 23 | } 24 | 25 | @Override 26 | public boolean onOptionsItemSelected(MenuItem item) { 27 | // Handle action bar item clicks here. The action bar will 28 | // automatically handle clicks on the Home/Up button, so long 29 | // as you specify a parent activity in AndroidManifest.xml. 30 | int id = item.getItemId(); 31 | if (id == R.id.action_settings) { 32 | return true; 33 | } 34 | return super.onOptionsItemSelected(item); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /clibs/glib/config.h: -------------------------------------------------------------------------------- 1 | // Will use "config.h.win32" from GLIB distribution directory 2 | // to obtain some invariants (like GLIB_*_VERSION) 3 | 4 | #undef _GLIB_EXTERN 5 | #include "config.h.win32" 6 | 7 | // now we make some overrides 8 | 9 | #undef _WIN32_WINNT 10 | #undef BROKEN_POLL 11 | #undef NO_FD_SET 12 | #undef ENABLE_NLS 13 | #undef HAVE_INT64_AND_I64 14 | #undef HAVE_WINT_T 15 | #undef THREADS_WIN32 16 | 17 | #define HAVE_SYS_STATFS_H 1 18 | #define USE_STATFS 1 19 | #define HAVE_SYS_MOUNT_H 1 20 | #define HAVE_SYS_VFS_H 1 21 | #define HAVE_SYS_PARAM_H 1 22 | #define HAVE_POLL 1 23 | 24 | #define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 1 25 | 26 | // the following tree are defined in android/support module 27 | extern char *gettext(const char *msgid); 28 | extern char *dgettext(const char *domainname, const char *msgid); 29 | extern char *ngettext(const char *msgid1, const char *msgid2, unsigned long int n); 30 | 31 | 32 | // "config.h.win32" defines _GLIB_EXTERN incompatible with gmacros.h 33 | #undef _GLIB_EXTERN 34 | // redefine it! 35 | #define _GLIB_EXTERN extern 36 | 37 | // to prevent $(NDK_ROOT)/platforms/android-XX//usr/include/alloca.h 38 | // from loading as galloca.h has this definition already 39 | #define _ALLOCA_H 40 | -------------------------------------------------------------------------------- /clibs/pcre/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GLIB_SOURCES_PATH := $(MAKEFILE_PATH)/../glib/distsrc 16 | LOCAL_PATH:= $(GLIB_SOURCES_PATH)/glib/pcre 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | 22 | LOCAL_MODULE:= pcre 23 | LOCAL_SRC_FILES:= $(filter %.c, $(libpcre_la_SOURCES)) 24 | LOCAL_CFLAGS += $(libpcre_la_CPPFLAGS) -DNVALGRIND=1 25 | LOCAL_C_INCLUDES := $(GLIB_SOURCES_PATH) $(GLIB_SOURCES_PATH)/glib \ 26 | $(MAKEFILE_PATH)/../glib $(MAKEFILE_PATH)/../glib/include \ 27 | $(NDK_ROOT)/sources/android/support/include \ 28 | $(NDK_ROOT)/sources/android/support/src/musl-locale 29 | LOCAL_STATIC_LIBRARIES := android_support 30 | 31 | include $(BUILD_STATIC_LIBRARY) 32 | $(call import-module,android/support) 33 | -------------------------------------------------------------------------------- /clibs/fontconfig/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | LOCAL_PATH := $(MAKEFILE_PATH)/distsrc 16 | 17 | include $(CLEAR_VARS) 18 | 19 | export FONTCONFIG_INCLUDES := $(LOCAL_PATH) 20 | 21 | include $(LOCAL_PATH)/src/Makefile.sources 22 | 23 | libfontconfig_la_SOURCES := $(filter-out fcxml.c fcinit.c, $(libfontconfig_la_SOURCES)) 24 | 25 | LOCAL_MODULE := fontconfig 26 | LOCAL_SRC_FILES := $(addprefix src/, $(filter %.c, $(libfontconfig_la_SOURCES))) \ 27 | ../fcinit_android.c ../fcxml_android.c 28 | LOCAL_CFLAGS += -DHAVE_CONFIG_H=1 29 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(FREETYPE_INCLUDES) 30 | 31 | LOCAL_STATIC_LIBRARIES := android_support freetype 32 | 33 | include $(BUILD_STATIC_LIBRARY) 34 | 35 | $(call import-module,android/support) 36 | $(call import-module,freetype) -------------------------------------------------------------------------------- /clibs/ffi/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # This makefile builds both for host and target, and so all the 16 | # common definitions are factored out into a separate file to 17 | # minimize duplication between the build rules. 18 | 19 | MAKEFILE_PATH := $(call my-dir) 20 | FFI_SOURCES_PATH := $(MAKEFILE_PATH)/distsrc 21 | LOCAL_PATH:= $(FFI_SOURCES_PATH) 22 | 23 | include $(CLEAR_VARS) 24 | 25 | ffi_arch := $(TARGET_ARCH) 26 | ffi_os := linux 27 | 28 | # This include just keeps the nesting a bit saner. 29 | include $(LOCAL_PATH)/Libffi.mk 30 | 31 | LOCAL_MODULE_TAGS := optional 32 | LOCAL_MODULE := ffi 33 | 34 | FFI_INCLUDES := $(LOCAL_PATH)/$(ffi_os)-$(ffi_arch) $(LOCAL_PATH)/include 35 | LOCAL_C_INCLUDES := $(FFI_INCLUDES) 36 | 37 | include $(BUILD_STATIC_LIBRARY) 38 | -------------------------------------------------------------------------------- /FONTCONFIG_COPYING: -------------------------------------------------------------------------------- 1 | fontconfig/COPYING 2 | 3 | Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard 4 | Copyright © 2005 Patrick Lam 5 | Copyright © 2009 Roozbeh Pournader 6 | Copyright © 2008,2009 Red Hat, Inc. 7 | Copyright © 2008 Danilo Šegan 8 | Copyright © 2012 Google, Inc. 9 | 10 | 11 | Permission to use, copy, modify, distribute, and sell this software and its 12 | documentation for any purpose is hereby granted without fee, provided that 13 | the above copyright notice appear in all copies and that both that 14 | copyright notice and this permission notice appear in supporting 15 | documentation, and that the name of the author(s) not be used in 16 | advertising or publicity pertaining to distribution of the software without 17 | specific, written prior permission. The authors make no 18 | representations about the suitability of this software for any purpose. It 19 | is provided "as is" without express or implied warranty. 20 | 21 | THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 22 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 23 | EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 24 | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 25 | DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 26 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 27 | PERFORMANCE OF THIS SOFTWARE. 28 | 29 | -------------------------------------------------------------------------------- /clibs/gobject/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GLIB_SOURCES_PATH := $(MAKEFILE_PATH)/../glib/distsrc 16 | LOCAL_PATH:= $(GLIB_SOURCES_PATH)/gobject 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | 22 | LOCAL_MODULE:= gobject 23 | LOCAL_SRC_FILES:= $(filter %.c, $(gobject_c_sources)) 24 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 25 | LOCAL_CFLAGS += -DNVALGRIND=1 -DGOBJECT_COMPILATION=1 26 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(MAKEFILE_PATH)/../glib \ 27 | $(GLIB_INCLUDES) $(FFI_INCLUDES) \ 28 | $(NDK_ROOT)/sources/android/support/include \ 29 | $(NDK_ROOT)/sources/android/support/src/musl-locale 30 | LOCAL_STATIC_LIBRARIES := glib ffi 31 | 32 | include $(BUILD_STATIC_LIBRARY) 33 | 34 | $(call import-module,android/support) 35 | $(call import-module,glib) 36 | $(call import-module,ffi) -------------------------------------------------------------------------------- /clibs/gdk/include/gdkandroidscreen.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // ANativeWindow-based GDK screen declaration 14 | 15 | #ifndef __GDK_ANDROID_SCREEN_H__ 16 | #define __GDK_ANDROID_SCREEN_H__ 17 | 18 | #include 19 | 20 | G_BEGIN_DECLS 21 | 22 | #define GDK_TYPE_ANDROID_SCREEN (gdk_android_screen_get_type ()) 23 | #define GDK_ANDROID_SCREEN(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_ANDROID_SCREEN, GdkAndroidScreen)) 24 | #define GDK_ANDROID_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_ANDROID_SCREEN, GdkAndroidScreenClass)) 25 | #define GDK_IS_ANDROID_SCREEN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_ANDROID_SCREEN)) 26 | 27 | typedef struct GdkAndroidScreen GdkAndroidScreen; 28 | typedef struct GdkAndroidScreenClass GdkAndroidScreenClass; 29 | 30 | GType gdk_android_screen_get_type(void); 31 | 32 | G_END_DECLS 33 | 34 | #endif /* __GDK_ANDROID_SCREEN_H__ */ 35 | -------------------------------------------------------------------------------- /clibs/gmodule/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GLIB_SOURCES_PATH := $(MAKEFILE_PATH)/../glib/distsrc 16 | LOCAL_PATH:= $(GLIB_SOURCES_PATH)/gmodule 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | 22 | GMODULE_SOURCES = $(filter %.c, $(libgmodule_2_0_la_SOURCES)) 23 | 24 | LOCAL_MODULE:= gmodule 25 | LOCAL_SRC_FILES:= $(GMODULE_SOURCES) 26 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 27 | LOCAL_CFLAGS += -DNVALGRIND=1 28 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(MAKEFILE_PATH)/../glib $(MAKEFILE_PATH)/include \ 29 | $(GLIB_INCLUDES) \ 30 | $(NDK_ROOT)/sources/android/support/include \ 31 | $(NDK_ROOT)/sources/android/support/src/musl-locale 32 | LOCAL_STATIC_LIBRARIES := android_support pcre ffi 33 | 34 | include $(BUILD_STATIC_LIBRARY) 35 | 36 | $(call import-module,android/support) 37 | $(call import-module,glib) 38 | $(call import-module,ffi) -------------------------------------------------------------------------------- /clibs/fontconfig/fcxml_android.c: -------------------------------------------------------------------------------- 1 | /* 2 | * fontconfig/src/fcxml.c 3 | * 4 | * Copyright © 2002 Keith Packard 5 | * 6 | * Permission to use, copy, modify, distribute, and sell this software and its 7 | * documentation for any purpose is hereby granted without fee, provided that 8 | * the above copyright notice appear in all copies and that both that 9 | * copyright notice and this permission notice appear in supporting 10 | * documentation, and that the name of the author(s) not be used in 11 | * advertising or publicity pertaining to distribution of the software without 12 | * specific, written prior permission. The authors make no 13 | * representations about the suitability of this software for any purpose. It 14 | * is provided "as is" without express or implied warranty. 15 | * 16 | * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 17 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 18 | * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 19 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 20 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 21 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 22 | * PERFORMANCE OF THIS SOFTWARE. 23 | */ 24 | 25 | #include "src/fcint.h" 26 | #include 27 | 28 | void 29 | FcRuleDestroy (FcRule *rule) 30 | { 31 | assert(0); 32 | } 33 | 34 | #define __fcxml__ 35 | #include "fcaliastail.h" 36 | #undef __fcxml__ 37 | -------------------------------------------------------------------------------- /clibs/gmodule/include/gmoduleconf.h: -------------------------------------------------------------------------------- 1 | /* GMODULE - GLIB wrapper code for dynamic module loading 2 | * Copyright (C) 1998 Tim Janik 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | #ifndef __G_MODULE_CONF_H__ 18 | #define __G_MODULE_CONF_H__ 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif /* __cplusplus */ 24 | 25 | 26 | #define G_MODULE_IMPL_NONE 0 27 | #define G_MODULE_IMPL_DL 1 28 | #define G_MODULE_IMPL_WIN32 3 29 | #define G_MODULE_IMPL_DYLD 6 30 | #define G_MODULE_IMPL_AR 7 31 | 32 | #define G_MODULE_IMPL G_MODULE_IMPL_NONE 33 | #undef G_MODULE_HAVE_DLERROR 34 | #if 0 35 | #define G_MODULE_HAVE_DLERROR 36 | #endif 37 | #if 0 38 | #define G_MODULE_NEED_USCORE 39 | #endif 40 | #if 0 41 | #define G_MODULE_BROKEN_RTLD_GLOBAL 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif /* __cplusplus */ 47 | 48 | 49 | #endif /* __G_MODULE_CONF_H__ */ 50 | -------------------------------------------------------------------------------- /clibs/gtk/build-gtk-shared-library.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | GTKA_LIB_PATH := $(abspath $(call my-dir))/.. 15 | 16 | $(call import-add-path, $(GTKA_LIB_PATH)) 17 | 18 | LOCAL_LDLIBS += -llog -landroid -lEGL -lGLESv2 19 | LOCAL_C_INCLUDES += $(GTK_INCLUDES) 20 | LOCAL_STATIC_LIBRARIES += gtk gdk atk gdk-pixbuf pango cairo gmodule gio gobject glib ffi pcre \ 21 | android_native_app_glue android_support 22 | 23 | include $(call my-dir)/gtkresources.mk 24 | 25 | include $(BUILD_SHARED_LIBRARY) 26 | 27 | $(call import-module,android/support) 28 | $(call import-module,android/native_app_glue) 29 | $(call import-module,ffi) 30 | $(call import-module,glib) 31 | $(call import-module,gio) 32 | $(call import-module,gobject) 33 | $(call import-module,gmodule) 34 | $(call import-module,freetype) 35 | $(call import-module,fontconfig) 36 | $(call import-module,harfbuzz) 37 | $(call import-module,pango) 38 | $(call import-module,cairo) 39 | $(call import-module,gdk-pixbuf) 40 | $(call import-module,gdk) 41 | $(call import-module,atk) 42 | $(call import-module,gtk) 43 | 44 | -------------------------------------------------------------------------------- /clibs/atk/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | ATK_SOURCES_PATH := $(MAKEFILE_PATH)/distsrc 16 | LOCAL_PATH:= $(ATK_SOURCES_PATH)/atk 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | 22 | LOCAL_MODULE:= atk 23 | LOCAL_SRC_FILES:= $(filter %.c, $(libatk_1_0_la_SOURCES)) $(MAKEFILE_PATH)/atk/atkmarshal.c 24 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 25 | LOCAL_CFLAGS += -DNVALGRIND=1 -DATK_COMPILATION=1 -DATK_DISABLE_DEPRECATION_WARNINGS=1 \ 26 | -DGLIB_DISABLE_DEPRECATION_WARNINGS=1 27 | LOCAL_C_INCLUDES = $(MAKEFILE_PATH) $(MAKEFILE_PATH)/atk $(ATK_SOURCES_PATH) \ 28 | $(GLIB_INCLUDES) \ 29 | $(NDK_ROOT)/sources/android/support/include \ 30 | $(NDK_ROOT)/sources/android/support/src/musl-locale 31 | LOCAL_STATIC_LIBRARIES := android_support glib gobject 32 | 33 | export ATK_INCLUDES := $(ATK_SOURCES_PATH) 34 | 35 | include $(BUILD_STATIC_LIBRARY) 36 | 37 | $(call import-module,android/support) 38 | $(call import-module,glib) 39 | $(call import-module,gobject) 40 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Short version for non-lawyers: 2 | 3 | The GTK+Android Project is dual-licensed under Apache 2.0 4 | and MIT terms. 5 | 6 | Longer version: 7 | 8 | The GTK+Android Project is copyright 2014, The GTK+Android 9 | Project Developers (given in the file AUTHORS.txt). 10 | 11 | Licensed under the Apache License, Version 2.0 12 | or the MIT 14 | license , 15 | at your option. All files in the project carrying such 16 | notice may not be copied, modified, or distributed except 17 | according to those terms. 18 | 19 | 20 | The GTK+Android Project is based on packages written by third 21 | parties. The following third party packages are included, 22 | and carry their own copyright notices and license terms: 23 | 24 | 25 | * GTK+, GLib, Pango, GDK-Pixbuf, ATK and their sub-packages 26 | All of them are licensed under LGPL 2.0 terms. 27 | Please see http://www.gnome.org/ for more details. 28 | 29 | 30 | * Cairo and Pixman libraries belong to http://cairographics.org/ 31 | and licensed under LGPL 2.1 or MPL 1.1 licenses both. 32 | 33 | * LibFFI belongs to Red Hat, Inc and others. 34 | It is placed to Public Domain. 35 | Please see the sources for the details. 36 | 37 | * FontConfig belongs to many contributors 38 | It is placed to Public Domain. 39 | Please see the sources for the details. 40 | 41 | * FreeType belongs to many contributors 42 | and licensed under BSD-like or GPL 2.0 licenses at your choice 43 | 44 | * harfbuzz belongs to many contributors 45 | It is licensed under "Old MIT" license 46 | -------------------------------------------------------------------------------- /clibs/gtk/gtkandroidassets.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // gfileutils-like Android "assets" accessors 14 | 15 | #ifndef __GTK_ANDROID_ASSETS_H__ 16 | #define __GTK_ANDROID_ASSETS_H__ 17 | 18 | #include "config.h" 19 | 20 | #include 21 | 22 | #define G_TYPE_AASSET_FILE (g_aasset_file_get_type ()) 23 | #define G_AASSET_FILE(o) (G_TYPE_CHECK_INSTANCE_CAST((o), G_TYPE_AASSET_FILE, GAAssetFile)) 24 | #define G_AASSET_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_AASSET_FILE, GAAssetFileClass)) 25 | #define G_IS_AASSET_FILE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), G_TYPE_AASSET_FILE)) 26 | #define G_IS_AASSET_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), G_TYPE_AASSET_FILE)) 27 | #define G_AASSET_FILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), G_TYPE_AASSET_FILE, GAAssetFileClass)) 28 | 29 | typedef struct GAAssetFile GAAssetFile; 30 | typedef struct GAAssetFileClass GAAssetFileClass; 31 | 32 | GType g_aasset_file_get_type(void); 33 | 34 | gboolean g_aasset_test(const gchar *filename, GFileTest test); 35 | 36 | GFile *g_aasset_as_GFile_for_path(const char *path); 37 | 38 | 39 | #endif // __GTK_ANDROID_ASSETS_H__ -------------------------------------------------------------------------------- /app/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | 21 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /CAIRO_COPYING: -------------------------------------------------------------------------------- 1 | Cairo is free software. 2 | 3 | Every source file in the implementation[*] of cairo is available to be 4 | redistributed and/or modified under the terms of either the GNU Lesser 5 | General Public License (LGPL) version 2.1 or the Mozilla Public 6 | License (MPL) version 1.1. Some files are available under more 7 | liberal terms, but we believe that in all cases, each file may be used 8 | under either the LGPL or the MPL. 9 | 10 | See the following files in this directory for the precise terms and 11 | conditions of either license: 12 | 13 | COPYING-LGPL-2.1 14 | COPYING-MPL-1.1 15 | 16 | Please see each file in the implementation for copyright and licensing 17 | information, (in the opening comment of each file). 18 | 19 | [*] The implementation of cairo is contained entirely within the "src" 20 | directory of the cairo source distribution. There are other components 21 | of the cairo source distribution (such as the "test", "util", and "perf") 22 | that are auxiliary to the library itself. None of the source code in these 23 | directories contributes to a build of the cairo library itself, (libcairo.so 24 | or cairo.dll or similar). 25 | 26 | These auxiliary components are also free software, but may be under 27 | different license terms than cairo itself. For example, most of the 28 | test cases in the perf and test directories are made available under 29 | an MIT license to simplify any use of this code for reference purposes 30 | in using cairo itself. Other files might be available under the GNU 31 | General Public License (GPL), for example. Again, please see the COPYING 32 | file under each directory and the opening comment of each file for copyright 33 | and licensing information. 34 | -------------------------------------------------------------------------------- /FREETYPE_LICENSE.TXT: -------------------------------------------------------------------------------- 1 | 2 | The FreeType 2 font engine is copyrighted work and cannot be used 3 | legally without a software license. In order to make this project 4 | usable to a vast majority of developers, we distribute it under two 5 | mutually exclusive open-source licenses. 6 | 7 | This means that *you* must choose *one* of the two licenses described 8 | below, then obey all its terms and conditions when using FreeType 2 in 9 | any of your projects or products. 10 | 11 | - The FreeType License, found in the file `FTL.TXT', which is similar 12 | to the original BSD license *with* an advertising clause that forces 13 | you to explicitly cite the FreeType project in your product's 14 | documentation. All details are in the license file. This license 15 | is suited to products which don't use the GNU General Public 16 | License. 17 | 18 | Note that this license is compatible to the GNU General Public 19 | License version 3, but not version 2. 20 | 21 | - The GNU General Public License version 2, found in `GPLv2.TXT' (any 22 | later version can be used also), for programs which already use the 23 | GPL. Note that the FTL is incompatible with GPLv2 due to its 24 | advertisement clause. 25 | 26 | The contributed BDF and PCF drivers come with a license similar to that 27 | of the X Window System. It is compatible to the above two licenses (see 28 | file src/bdf/README and src/pcf/README). 29 | 30 | The gzip module uses the zlib license (see src/gzip/zlib.h) which too is 31 | compatible to the above two licenses. 32 | 33 | The MD5 checksum support (only used for debugging in development builds) 34 | is in the public domain. 35 | 36 | 37 | --- end of LICENSE.TXT --- 38 | -------------------------------------------------------------------------------- /clibs/glib/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GLIB_SOURCES_PATH := $(MAKEFILE_PATH)/distsrc 16 | LOCAL_PATH:= $(GLIB_SOURCES_PATH)/glib 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | 22 | GNULIB_SOURCES = $(addprefix gnulib/, vasnprintf.c printf-parse.c printf-args.c printf.c asnprintf.c) 23 | CHARSET_SOURCES = libcharset/localcharset.c 24 | GLIB_CORE_SOURCES = $(filter %.c, $(libglib_2_0_la_SOURCES)) gspawn.c giounix.c 25 | 26 | LOCAL_MODULE:= glib 27 | LOCAL_SRC_FILES:= $(GLIB_CORE_SOURCES) $(GNULIB_SOURCES) $(CHARSET_SOURCES) 28 | LOCAL_CFLAGS += -DGLIB_COMPILATION=1 -DNVALGRIND=1 29 | LOCAL_EXPORT_LDLIBS := -lz 30 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(MAKEFILE_PATH)/include $(GLIB_SOURCES_PATH) \ 31 | $(NDK_ROOT)/sources/android/support/include \ 32 | $(NDK_ROOT)/sources/android/support/src/musl-locale 33 | LOCAL_STATIC_LIBRARIES := android_support pcre 34 | 35 | export GLIB_INCLUDES := $(MAKEFILE_PATH)/include $(GLIB_SOURCES_PATH) \ 36 | $(GLIB_SOURCES_PATH)/gmodule $(LOCAL_PATH) 37 | 38 | include $(BUILD_STATIC_LIBRARY) 39 | 40 | $(call import-module,android/support) 41 | $(call import-module,pcre) -------------------------------------------------------------------------------- /clibs/freetype/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | LOCAL_PATH := $(MAKEFILE_PATH)/distsrc 16 | 17 | include $(CLEAR_VARS) 18 | 19 | export FREETYPE_INCLUDES := $(LOCAL_PATH)/include 20 | 21 | FREETYPE_SOURCES := $(addprefix base/, ftadvanc ftcalc ftdbgmem ftgloadr \ 22 | ftobjs ftoutln ftrfork ftsnames \ 23 | ftstream fttrigon ftutil ftbdf \ 24 | basepic ftpic ftbitmap fttype1 \ 25 | ftsystem ftinit) \ 26 | bdf/bdf cid/type1cid psnames/psnames sfnt/sfnt \ 27 | smooth/smooth winfonts/winfnt truetype/truetype \ 28 | pcf/pcf type42/type42 psaux/psaux pfr/pfr \ 29 | autofit/autofit cff/cff type1/type1 pshinter/pshinter \ 30 | raster/raster gzip/ftgzip lzw/ftlzw 31 | 32 | 33 | LOCAL_MODULE := freetype 34 | LOCAL_SRC_FILES := $(addprefix src/, $(addsuffix .c, $(FREETYPE_SOURCES))) 35 | LOCAL_CFLAGS := -DFT2_BUILD_LIBRARY=1 36 | LOCAL_C_INCLUDES := $(FREETYPE_INCLUDES) $(FONTCONFIG_INCLUDES) 37 | 38 | 39 | include $(BUILD_STATIC_LIBRARY) 40 | -------------------------------------------------------------------------------- /HARFBUZZ_COPYING: -------------------------------------------------------------------------------- 1 | HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. 2 | For parts of HarfBuzz that are licensed under different licenses see individual 3 | files names COPYING in subdirectories where applicable. 4 | 5 | Copyright © 2010,2011,2012 Google, Inc. 6 | Copyright © 2012 Mozilla Foundation 7 | Copyright © 2011 Codethink Limited 8 | Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) 9 | Copyright © 2009 Keith Stribley 10 | Copyright © 2009 Martin Hosken and SIL International 11 | Copyright © 2007 Chris Wilson 12 | Copyright © 2006 Behdad Esfahbod 13 | Copyright © 2005 David Turner 14 | Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. 15 | Copyright © 1998-2004 David Turner and Werner Lemberg 16 | 17 | For full copyright notices consult the individual files in the package. 18 | 19 | 20 | Permission is hereby granted, without written agreement and without 21 | license or royalty fees, to use, copy, modify, and distribute this 22 | software and its documentation for any purpose, provided that the 23 | above copyright notice and the following two paragraphs appear in 24 | all copies of this software. 25 | 26 | IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 27 | DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 28 | ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 29 | IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 30 | DAMAGE. 31 | 32 | THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 33 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 34 | FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 35 | ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 36 | PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 37 | -------------------------------------------------------------------------------- /clibs/gdk-pixbuf/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GDK_PIXBUG_SOURCES_PATH := $(MAKEFILE_PATH)/distsrc 16 | LOCAL_PATH:= $(GDK_PIXBUG_SOURCES_PATH)/gdk-pixbuf 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | include $(GDK_PIXBUG_SOURCES_PATH)/Config.mk 22 | 23 | PIXOPS_SOURCES = pixops/pixops.c 24 | 25 | LOCAL_MODULE:= gdk-pixbuf 26 | LOCAL_SRC_FILES:= $(filter %.c, $(libgdk_pixbuf_2_0_la_SOURCES)) $(PIXOPS_SOURCES) io-pixdata.c 27 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 28 | LOCAL_CFLAGS += -DGDK_PIXBUF_COMPILATION=1 -DGDK_PIXBUF_ENABLE_BACKEND=1 -DNVALGRIND=1 \ 29 | -DGDK_PIXBUF_BINARY_VERSION=\"$(GDK_PIXBUF_BINARY_VERSION)\" \ 30 | -DLIBDIR=\"unknown-libdir-in-Android.mk\" \ 31 | -DGDK_PIXBUF_LIBDIR=\"unknown-libdir-in-Android.mk\" \ 32 | -DGDK_PIXBUF_LOCALEDIR=\".\" 33 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(MAKEFILE_PATH)/include $(GDK_PIXBUG_SOURCES_PATH) \ 34 | $(GLIB_INCLUDES) \ 35 | $(NDK_ROOT)/sources/android/support/include \ 36 | $(NDK_ROOT)/sources/android/support/src/musl-locale 37 | LOCAL_STATIC_LIBRARIES := gmodule 38 | 39 | export GDK_PIXBUG_INCLUDES := $(GDK_PIXBUG_SOURCES_PATH) 40 | 41 | include $(BUILD_STATIC_LIBRARY) 42 | 43 | $(call import-module,android/support) 44 | $(call import-module,gmodule) 45 | -------------------------------------------------------------------------------- /clibs/gdk/include/gdkandroiddisplay.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // ANativeWindow-based GDK display declaration 14 | 15 | #ifndef __GDK_ANDROID_DISPLAY_H__ 16 | #define __GDK_ANDROID_DISPLAY_H__ 17 | 18 | #include 19 | 20 | G_BEGIN_DECLS 21 | 22 | typedef struct GdkAndroidDisplay GdkAndroidDisplay; 23 | typedef struct GdkAndroidDisplayClass GdkAndroidDisplayClass; 24 | 25 | #define GDK_TYPE_ANDROID_DISPLAY (gdk_android_display_get_type()) 26 | #define GDK_ANDROID_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_ANDROID_DISPLAY, GdkAndroidDisplay)) 27 | #define GDK_ANDROID_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_ANDROID_DISPLAY, GdkAndroidDisplayClass)) 28 | #define GDK_IS_ANDROID_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_ANDROID_DISPLAY)) 29 | 30 | GType gdk_android_display_get_type(void); 31 | 32 | gboolean gdk_android_init_display(struct android_app *app, 33 | GError **error); 34 | gboolean gdk_android_term_display(); 35 | struct android_app *_gdk_android_display_get_app(GdkDisplay *display); 36 | 37 | #define GDK_ANDROID_ERROR g_quark_from_static_string ("gdk-android") 38 | 39 | enum GDKAndroidErrorCode 40 | { 41 | GDK_ANDROID_ERROR_INIT = 1 42 | }; 43 | 44 | const gchar *gdk_android_get_default_font(); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* __GDK_ANDROID_DISPLAY_H__ */ 49 | -------------------------------------------------------------------------------- /clibs/cairo/pixman-extra/pixman-version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008 Red Hat, Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * Author: Carl D. Worth 25 | */ 26 | 27 | #ifndef PIXMAN_VERSION_H__ 28 | #define PIXMAN_VERSION_H__ 29 | 30 | #ifndef PIXMAN_H__ 31 | # error pixman-version.h should only be included by pixman.h 32 | #endif 33 | 34 | #define PIXMAN_VERSION_MAJOR 0 35 | #define PIXMAN_VERSION_MINOR 21 36 | #define PIXMAN_VERSION_MICRO 4 37 | 38 | #define PIXMAN_VERSION_STRING "0.21.4" 39 | 40 | #define PIXMAN_VERSION_ENCODE(major, minor, micro) ( \ 41 | ((major) * 10000) \ 42 | + ((minor) * 100) \ 43 | + ((micro) * 1)) 44 | 45 | #define PIXMAN_VERSION PIXMAN_VERSION_ENCODE( \ 46 | PIXMAN_VERSION_MAJOR, \ 47 | PIXMAN_VERSION_MINOR, \ 48 | PIXMAN_VERSION_MICRO) 49 | 50 | #endif /* PIXMAN_VERSION_H__ */ 51 | -------------------------------------------------------------------------------- /clibs/gdk/gdkinput-android.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Inputs handlers and device manager 14 | 15 | #ifndef __GDK_INPUT_ANDROID_H__ 16 | #define __GDK_INPUT_ANDROID_H__ 17 | 18 | #include 19 | 20 | G_BEGIN_DECLS 21 | 22 | #define GDK_TYPE_DEVICE_MANAGER_ANDROID (gdk_device_manager_android_get_type ()) 23 | #define GDK_DEVICE_MANAGER_ANDROID(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_ANDROID, GdkDeviceManagerAndroid)) 24 | #define GDK_DEVICE_MANAGER_ANDROID_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_ANDROID, GdkDeviceManagerAndroidClass)) 25 | #define GDK_IS_DEVICE_MANAGER_ANDROID(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_ANDROID)) 26 | #define GDK_IS_DEVICE_MANAGER_ANDROID_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_ANDROID)) 27 | #define GDK_DEVICE_MANAGER_ANDROID_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_ANDROID, GdkDeviceManagerAndroidClass)) 28 | 29 | typedef struct GdkDeviceManagerAndroid 30 | { 31 | GdkDeviceManager parent_object; 32 | // Master Devices 33 | GdkDevice *pointer; 34 | GdkDevice *keyboard; 35 | } GdkDeviceManagerAndroid; 36 | typedef struct GdkDeviceManagerAndroidClass GdkDeviceManagerAndroidClass; 37 | 38 | GType gdk_device_manager_android_get_type (void) G_GNUC_CONST; 39 | 40 | void gdk_android_input_init(GdkDisplay *display); 41 | GList *gdk_android_display_list_devices(GdkDisplay *dpy); 42 | 43 | struct AInputEvent; 44 | int32_t android_handle_input(struct android_app *app, struct AInputEvent *event); 45 | 46 | 47 | G_END_DECLS 48 | 49 | #endif // __GDK_INPUT_ANDROID_H__ 50 | -------------------------------------------------------------------------------- /clibs/pango/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | PANGO_SOURCES_PATH := $(MAKEFILE_PATH)/distsrc 16 | LOCAL_PATH:= $(PANGO_SOURCES_PATH)/pango 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | 22 | freebidi_sources = mini-fribidi/fribidi.c mini-fribidi/fribidi_char_type.c mini-fribidi/fribidi_types.c 23 | 24 | fc_support_sources = pangocairo-fcfont.c pangocairo-fcfontmap.c ../../module-defs-fc.c \ 25 | ../modules/basic/basic-fc.c 26 | 27 | LOCAL_MODULE := pango 28 | LOCAL_SRC_FILES := $(fc_support_sources) $(freebidi_sources) $(pangoft2_public_sources) \ 29 | $(filter %.c, $(libpango_1_0_la_SOURCES) $(pangocairo_core_sources)) 30 | LOCAL_CFLAGS += -DPANGO_ENABLE_ENGINE=1 -DPANGO_ENABLE_BACKEND=1 -DNVALGRIND=1 \ 31 | -DSYSCONFDIR=\"/etc/xdg\" -DLIBDIR=\"unknown-libdir-in-Android.mk\" \ 32 | -DPANGO_MODULE_PREFIX=_pango_basic_fc 33 | LOCAL_C_INCLUDES = $(MAKEFILE_PATH) $(MAKEFILE_PATH)/include \ 34 | $(PANGO_SOURCES_PATH) $(GLIB_INCLUDES) \ 35 | $(FONTCONFIG_INCLUDES) $(FREETYPE_INCLUDES) $(HARFBUZZ_INCLUDES) \ 36 | $(MAKEFILE_PATH)/../cairo/distsrc/cairo/src \ 37 | $(MAKEFILE_PATH)/../cairo/cairo-extra 38 | LOCAL_STATIC_LIBRARIES := glib cairo fontconfig freetype harfbuzz 39 | 40 | export PANGO_INCLUDES := $(MAKEFILE_PATH)/include $(PANGO_SOURCES_PATH) \ 41 | $(LOCAL_PATH) 42 | 43 | include $(BUILD_STATIC_LIBRARY) 44 | 45 | $(call import-module,glib) 46 | $(call import-module,cairo) 47 | $(call import-module,fontconfig) 48 | $(call import-module,freetype) 49 | $(call import-module,harfbuzz) -------------------------------------------------------------------------------- /clibs/gdk/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GTK_SOURCES_PATH := $(MAKEFILE_PATH)/../gtk/distsrc 16 | LOCAL_PATH:= $(GTK_SOURCES_PATH)/gdk 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | 22 | GDK_ANDROID_SOURCES := gdkwindow-android.c gdkevents-android.c \ 23 | gdkscreen-android.c gdkdisplay-android.c \ 24 | gdkinput-android.c gdkjni.c 25 | GDK_ANDROID_SOURCES := $(addprefix ../../../gdk/, $(GDK_ANDROID_SOURCES)) 26 | 27 | LOCAL_MODULE:= gdk 28 | LOCAL_SRC_FILES:= $(GDK_ANDROID_SOURCES) $(filter %.c, $(am__libgdk_3_la_SOURCES_DIST)) 29 | LOCAL_EXPORT_LDLIBS := -llog 30 | LOCAL_CFLAGS += -DNVALGRIND=1 -DGDK_COMPILATION=1 $(CAIRO_CFLAGS) 31 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(MAKEFILE_PATH)/include $(MAKEFILE_PATH)/include/gdk $(MAKEFILE_PATH)/../gtk \ 32 | $(GTK_SOURCES_PATH) $(GDK_PIXBUG_INCLUDES) $(GLIB_INCLUDES) \ 33 | $(PANGO_INCLUDES) $(CAIRO_INCLUDES) $(FONTCONFIG_INCLUDES) \ 34 | $(NDK_ROOT)/sources/android/support/include \ 35 | $(NDK_ROOT)/sources/android/support/src/musl-locale 36 | LOCAL_STATIC_LIBRARIES := android_support android_native_app_glue \ 37 | glib gio gobject gmodule fontconfig pango cairo gdk-pixbuf 38 | 39 | export GDK_INCLUDES := $(LOCAL_PATH) $(MAKEFILE_PATH)/include 40 | 41 | include $(BUILD_STATIC_LIBRARY) 42 | 43 | $(call import-module,android/support) 44 | $(call import-module,glib) 45 | $(call import-module,gio) 46 | $(call import-module,gobject) 47 | $(call import-module,fontconfig) 48 | $(call import-module,pango) 49 | $(call import-module,cairo) 50 | $(call import-module,gdk-pixbuf) 51 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | -------------------------------------------------------------------------------- /clibs/gio/include/gio/gnetworking.h: -------------------------------------------------------------------------------- 1 | /* GIO - GLib Input, Output and Streaming Library 2 | * 3 | * Copyright (C) 2008-2011 Red Hat, Inc. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General 16 | * Public License along with this library; if not, see . 17 | */ 18 | 19 | #ifndef __G_NETWORKING_H__ 20 | #define __G_NETWORKING_H__ 21 | 22 | #include 23 | 24 | #ifdef G_OS_WIN32 25 | 26 | #ifndef _WIN32_WINNT 27 | #define _WIN32_WINNT 0x0501 28 | #endif 29 | #include 30 | #undef interface 31 | #include 32 | #include 33 | #include 34 | //@WSPIAPI_INCLUDE@ 35 | #include 36 | 37 | #else /* !G_OS_WIN32 */ 38 | 39 | #include 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | #include 50 | #include 51 | //#include 52 | 53 | #ifndef T_SRV 54 | #define T_SRV 33 55 | #endif 56 | 57 | #ifndef _PATH_RESCONF 58 | #define _PATH_RESCONF "/etc/resolv.conf" 59 | #endif 60 | 61 | #ifndef CMSG_LEN 62 | /* CMSG_LEN and CMSG_SPACE are defined by RFC 2292, but missing on 63 | * some older platforms. 64 | */ 65 | #define CMSG_LEN(len) ((size_t)CMSG_DATA((struct cmsghdr *)NULL) + (len)) 66 | 67 | /* CMSG_SPACE must add at least as much padding as CMSG_NXTHDR() 68 | * adds. We overestimate here. 69 | */ 70 | #define GLIB_ALIGN_TO_SIZEOF(len, obj) (((len) + sizeof (obj) - 1) & ~(sizeof (obj) - 1)) 71 | #define CMSG_SPACE(len) GLIB_ALIGN_TO_SIZEOF (CMSG_LEN (len), struct cmsghdr) 72 | #endif 73 | #endif 74 | 75 | G_BEGIN_DECLS 76 | 77 | GLIB_AVAILABLE_IN_2_36 78 | void g_networking_init (void); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __G_NETWORKING_H__ */ 83 | -------------------------------------------------------------------------------- /clibs/gio/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GLIB_SOURCES_PATH := $(MAKEFILE_PATH)/../glib/distsrc 16 | LOCAL_PATH:= $(GLIB_SOURCES_PATH)/gio 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | include $(LOCAL_PATH)/xdgmime/Sources.mk 22 | 23 | unix_sources := gfiledescriptorbased.c \ 24 | gunixconnection.c \ 25 | gunixcredentialsmessage.c \ 26 | gunixfdlist.c \ 27 | gunixfdmessage.c \ 28 | gunixsocketaddress.c \ 29 | gunixinputstream.c \ 30 | gunixoutputstream.c \ 31 | gcontenttype.c \ 32 | gcontenttypeprivate.h \ 33 | gfdonotificationbackend.c \ 34 | ggtknotificationbackend.c \ 35 | gdesktopappinfo.c 36 | 37 | 38 | GIO_SOURCES := $(filter-out gthread-posix.c glocaldirectorymonitor.c, $(libgio_2_0_la_SOURCES)) \ 39 | $(addprefix xdgmime/, $(libxdgmime_la_SOURCES)) \ 40 | $(MAKEFILE_PATH)/giodummyobjects.c 41 | GIO_SOURCES := $(filter %.c, $(GIO_SOURCES)) 42 | 43 | LOCAL_MODULE:= gio 44 | LOCAL_SRC_FILES:= $(GIO_SOURCES) 45 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 46 | LOCAL_CFLAGS += -DNVALGRIND=1 -DGIO_COMPILATION=1 -DGIO_MODULE_DIR=\".\" -DXDG_PREFIX=_gio_xdg 47 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(MAKEFILE_PATH)/../glib $(MAKEFILE_PATH)/include \ 48 | $(MAKEFILE_PATH)/include/gio $(GLIB_INCLUDES) $(FFI_INCLUDES) \ 49 | $(NDK_ROOT)/sources/android/support/include \ 50 | $(NDK_ROOT)/sources/android/support/src/musl-locale 51 | LOCAL_STATIC_LIBRARIES := glib android_support 52 | 53 | include $(BUILD_STATIC_LIBRARY) 54 | 55 | $(call import-module,android/support) 56 | $(call import-module,glib) 57 | -------------------------------------------------------------------------------- /clibs/harfbuzz/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | LOCAL_PATH := $(MAKEFILE_PATH)/distsrc/src 16 | 17 | include $(CLEAR_VARS) 18 | 19 | export HARFBUZZ_INCLUDES := $(LOCAL_PATH) 20 | 21 | include $(LOCAL_PATH)/Makefile.sources 22 | 23 | HB_OT_SOURCES = \ 24 | hb-ot-font.cc \ 25 | hb-ot-layout.cc \ 26 | hb-ot-layout-common-private.hh \ 27 | hb-ot-layout-gdef-table.hh \ 28 | hb-ot-layout-gpos-table.hh \ 29 | hb-ot-layout-gsubgpos-private.hh \ 30 | hb-ot-layout-gsub-table.hh \ 31 | hb-ot-layout-jstf-table.hh \ 32 | hb-ot-layout-private.hh \ 33 | hb-ot-map.cc \ 34 | hb-ot-map-private.hh \ 35 | hb-ot-shape.cc \ 36 | hb-ot-shape-complex-arabic.cc \ 37 | hb-ot-shape-complex-arabic-fallback.hh \ 38 | hb-ot-shape-complex-arabic-table.hh \ 39 | hb-ot-shape-complex-arabic-win1256.hh \ 40 | hb-ot-shape-complex-default.cc \ 41 | hb-ot-shape-complex-hangul.cc \ 42 | hb-ot-shape-complex-hebrew.cc \ 43 | hb-ot-shape-complex-indic.cc \ 44 | hb-ot-shape-complex-indic-machine.hh \ 45 | hb-ot-shape-complex-indic-private.hh \ 46 | hb-ot-shape-complex-indic-table.cc \ 47 | hb-ot-shape-complex-myanmar.cc \ 48 | hb-ot-shape-complex-myanmar-machine.hh \ 49 | hb-ot-shape-complex-sea.cc \ 50 | hb-ot-shape-complex-sea-machine.hh \ 51 | hb-ot-shape-complex-thai.cc \ 52 | hb-ot-shape-complex-tibetan.cc \ 53 | hb-ot-shape-complex-private.hh \ 54 | hb-ot-shape-normalize-private.hh \ 55 | hb-ot-shape-normalize.cc \ 56 | hb-ot-shape-fallback-private.hh \ 57 | hb-ot-shape-fallback.cc \ 58 | hb-ot-shape-private.hh 59 | 60 | HBSOURCES += $(HB_OT_SOURCES) hb-ft.cc hb-fallback-shape.cc hb-glib.cc 61 | 62 | LOCAL_MODULE := harfbuzz 63 | LOCAL_SRC_FILES := $(filter %.cc, $(HBSOURCES)) 64 | LOCAL_CFLAGS += -DHAVE_CONFIG_H=1 65 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(FREETYPE_INCLUDES) $(GLIB_INCLUDES) 66 | 67 | LOCAL_STATIC_LIBRARIES := android_support glib freetype 68 | 69 | include $(BUILD_STATIC_LIBRARY) 70 | 71 | $(call import-module,android/support) 72 | $(call import-module,freetype) 73 | $(call import-module,glib) -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /clibs/gtk/gtkadummyobject.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Various dummy classes/functions to shut the linker up 14 | 15 | #include "config.h" 16 | 17 | #include 18 | 19 | #include "gtkmountoperationprivate.h" 20 | #include "gtkmountoperation.h" 21 | #include "gtkprintoperation.h" 22 | #include "gtkprintoperationpreview.h" 23 | #include "gtkprivate.h" 24 | 25 | 26 | /////////////////////////////////////////////////////////////////////////////////////// 27 | // GtkMountOperation 28 | 29 | G_DEFINE_TYPE(GtkMountOperation, gtk_mount_operation, G_TYPE_MOUNT_OPERATION) 30 | 31 | static void gtk_mount_operation_class_init(GtkMountOperationClass *klass) 32 | { 33 | } 34 | 35 | static void gtk_mount_operation_init(GtkMountOperation *obj) 36 | { 37 | } 38 | 39 | GMountOperation *gtk_mount_operation_new(GtkWindow *parent) 40 | { 41 | return g_object_new (GTK_TYPE_MOUNT_OPERATION, "parent", parent, NULL); 42 | } 43 | 44 | /////////////////////////////////////////////////////////////////////////////////////// 45 | // GtkPrintOperation & GtkPrintOperationPreview 46 | 47 | GQuark gtk_print_error_quark(void) 48 | { 49 | return g_quark_from_static_string ("gtk-print-error-quark"); 50 | } 51 | 52 | G_DEFINE_TYPE(GtkPrintOperation, gtk_print_operation, GTK_TYPE_PRINT_OPERATION) 53 | 54 | static void gtk_print_operation_class_init(GtkPrintOperationClass *klass) 55 | { 56 | } 57 | 58 | static void gtk_print_operation_init(GtkPrintOperation *obj) 59 | { 60 | } 61 | 62 | GType gtk_print_operation_preview_get_type(void) 63 | { 64 | static volatile gsize typeId = 0; 65 | if (g_once_init_enter(&typeId)) 66 | { 67 | GType tId = g_type_register_static_simple(G_TYPE_INTERFACE, 68 | g_intern_static_string("GtkPrintOperationPreview"), 69 | sizeof(GtkPrintOperationPreviewIface), 70 | (GClassInitFunc) NULL, 71 | 0, 72 | (GInstanceInitFunc) NULL, 73 | (GTypeFlags) 0); 74 | g_once_init_leave (&typeId, tId); 75 | } 76 | return typeId; 77 | } 78 | -------------------------------------------------------------------------------- /clibs/atk/atk/atkmarshal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __atk_marshal_MARSHAL_H__ 3 | #define __atk_marshal_MARSHAL_H__ 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | 9 | /* VOID:INT,INT (./atkmarshal.list:25) */ 10 | extern void atk_marshal_VOID__INT_INT (GClosure *closure, 11 | GValue *return_value, 12 | guint n_param_values, 13 | const GValue *param_values, 14 | gpointer invocation_hint, 15 | gpointer marshal_data); 16 | 17 | /* VOID:INT,INT,STRING (./atkmarshal.list:26) */ 18 | extern void atk_marshal_VOID__INT_INT_STRING (GClosure *closure, 19 | GValue *return_value, 20 | guint n_param_values, 21 | const GValue *param_values, 22 | gpointer invocation_hint, 23 | gpointer marshal_data); 24 | 25 | /* VOID:INT,INT,INT,STRING (./atkmarshal.list:27) */ 26 | extern void atk_marshal_VOID__INT_INT_INT_STRING (GClosure *closure, 27 | GValue *return_value, 28 | guint n_param_values, 29 | const GValue *param_values, 30 | gpointer invocation_hint, 31 | gpointer marshal_data); 32 | 33 | /* VOID:STRING,BOOLEAN (./atkmarshal.list:28) */ 34 | extern void atk_marshal_VOID__STRING_BOOLEAN (GClosure *closure, 35 | GValue *return_value, 36 | guint n_param_values, 37 | const GValue *param_values, 38 | gpointer invocation_hint, 39 | gpointer marshal_data); 40 | 41 | /* VOID:DOUBLE,STRING (./atkmarshal.list:29) */ 42 | extern void atk_marshal_VOID__DOUBLE_STRING (GClosure *closure, 43 | GValue *return_value, 44 | guint n_param_values, 45 | const GValue *param_values, 46 | gpointer invocation_hint, 47 | gpointer marshal_data); 48 | 49 | G_END_DECLS 50 | 51 | #endif /* __atk_marshal_MARSHAL_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /app/jni/main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2015 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // GTK+Android test application 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | 22 | 23 | static void hello(GtkWidget *widget, gpointer data) 24 | { 25 | GtkWidget *box = (GtkWidget *) data; 26 | GtkWidget *label = gtk_label_new("Hello!"); 27 | gtk_container_add(GTK_CONTAINER(box), label); 28 | gtk_widget_show(label); 29 | } 30 | 31 | static void quit_gtk(GtkWidget *widget, gpointer data) 32 | { 33 | g_info("quit!"); 34 | gtk_main_quit(); 35 | } 36 | 37 | void android_main(struct android_app *state) 38 | { 39 | GtkWidget *window, *vbox, *hbox, *halign, *valign, 40 | *edit, *button, *label; 41 | 42 | //g_usleep(15 * 1000000); 43 | 44 | gtk_android_init(state); 45 | 46 | window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 47 | gtk_window_maximize(GTK_WINDOW(window)); 48 | 49 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 25); 50 | valign = gtk_alignment_new(0, 1, 0, 0); 51 | gtk_container_add(GTK_CONTAINER(vbox), valign); 52 | gtk_container_add(GTK_CONTAINER(window), vbox); 53 | 54 | //edit = gtk_entry_new(); 55 | //gtk_entry_set_text(GTK_ENTRY(edit), "Hello world"); 56 | //gtk_container_add(GTK_CONTAINER(vbox), edit); 57 | 58 | button = gtk_button_new_with_label("Say Hello"); 59 | gtk_widget_set_size_request(button, 200, 100); 60 | gtk_container_add(GTK_CONTAINER(vbox), button); 61 | g_signal_connect(button, "clicked", G_CALLBACK(hello), vbox); 62 | 63 | hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5); 64 | 65 | button = gtk_button_new_with_label("Quit"); 66 | gtk_widget_set_size_request(button, 200, 100); 67 | gtk_container_add(GTK_CONTAINER(hbox), button); 68 | g_signal_connect(button, "clicked", G_CALLBACK(quit_gtk), NULL); 69 | 70 | halign = gtk_alignment_new(1, 0, 0, 0); 71 | gtk_container_add(GTK_CONTAINER(halign), hbox); 72 | 73 | gtk_box_pack_end(GTK_BOX(vbox), halign, FALSE, FALSE, 0); 74 | 75 | //g_signal_connect_swapped(G_OBJECT(window), "destroy", 76 | // G_CALLBACK(gtk_main_quit), G_OBJECT(window)); 77 | 78 | gtk_widget_show_all(window); 79 | 80 | gtk_main(); 81 | 82 | // Finish the activity and makes sure it is properly unloaded 83 | gtk_android_exit(state); 84 | } 85 | 86 | -------------------------------------------------------------------------------- /clibs/gio/giodummyobjects.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Various dummy classes/functions to shut the linker up 14 | 15 | #include "config.h" 16 | 17 | #include "glocaldirectorymonitor.h" 18 | #include "gunixvolumemonitor.h" 19 | #include "gunixmounts.h" 20 | #include "giomodule-priv.h" 21 | #include "gfile.h" 22 | 23 | /////////////////////////////////////////////////////////////////////////////////////// 24 | // unix mounts 25 | 26 | struct _GUnixMountEntry { 27 | char *mount_path; 28 | char *device_path; 29 | char *filesystem_type; 30 | gboolean is_read_only; 31 | gboolean is_system_internal; 32 | }; 33 | 34 | gboolean g_unix_mounts_changed_since(guint64 time) 35 | { 36 | return FALSE; 37 | } 38 | 39 | GUnixMountEntry *g_unix_mount_at(const char *mount_path, guint64 *time_read) 40 | { 41 | return NULL; 42 | } 43 | 44 | gboolean g_unix_mount_is_readonly(GUnixMountEntry *mount_entry) 45 | { 46 | return FALSE; 47 | } 48 | 49 | void g_unix_mount_free(GUnixMountEntry *mount_entry) 50 | { 51 | g_return_if_fail(mount_entry != NULL); 52 | 53 | g_free(mount_entry->mount_path); 54 | g_free(mount_entry->device_path); 55 | g_free(mount_entry->filesystem_type); 56 | g_free(mount_entry); 57 | } 58 | 59 | /////////////////////////////////////////////////////////////////////////////////////// 60 | // GLocalDirectoryMonitor 61 | 62 | G_DEFINE_TYPE(GLocalDirectoryMonitor, g_local_directory_monitor, G_TYPE_LOCAL_DIRECTORY_MONITOR) 63 | 64 | static void g_local_directory_monitor_class_init(GLocalDirectoryMonitorClass *klass) 65 | { 66 | } 67 | 68 | static void g_local_directory_monitor_init(GLocalDirectoryMonitor *obj) 69 | { 70 | } 71 | 72 | GFileMonitor *_g_local_directory_monitor_new(const char *dirname, GFileMonitorFlags flags, 73 | GMainContext *context, gboolean is_remote_fs, 74 | gboolean do_start, GError **error) 75 | { 76 | return G_FILE_MONITOR(g_object_new(G_TYPE_LOCAL_DIRECTORY_MONITOR, NULL)); 77 | } 78 | 79 | void g_local_directory_monitor_start(GLocalDirectoryMonitor *local_monitor) 80 | { 81 | } 82 | 83 | /////////////////////////////////////////////////////////////////////////////////////// 84 | // GUnixVolumeMonitor 85 | 86 | struct _GUnixVolumeMonitor { 87 | GNativeVolumeMonitor parent; 88 | }; 89 | 90 | G_DEFINE_TYPE(GUnixVolumeMonitor, _g_unix_volume_monitor, G_TYPE_UNIX_VOLUME_MONITOR) 91 | 92 | static void _g_unix_volume_monitor_class_init(GUnixVolumeMonitorClass *klass) 93 | { 94 | } 95 | 96 | static void _g_unix_volume_monitor_init(GUnixVolumeMonitor *obj) 97 | { 98 | } 99 | -------------------------------------------------------------------------------- /clibs/gtk/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | GTK_SOURCES_PATH := $(MAKEFILE_PATH)/distsrc 16 | LOCAL_PATH:= $(GTK_SOURCES_PATH)/gtk 17 | 18 | include $(CLEAR_VARS) 19 | 20 | include $(LOCAL_PATH)/Sources.mk 21 | include $(LOCAL_PATH)/a11y/Sources.mk 22 | include $(GTK_SOURCES_PATH)/Config.mk 23 | 24 | GTK_ANDROID_SOURCES := gtkainit.c gtkadummyobject.c gtkcssprovider_hack.c gtkandroidassets.c 25 | GTK_ANDROID_SOURCES := $(addprefix ../../, $(GTK_ANDROID_SOURCES)) 26 | 27 | GTK_SOURCES = $(GTK_ANDROID_SOURCES) \ 28 | gtkwin32theme.c gtkcssimagewin32.c \ 29 | $(addprefix a11y/, $(gtka11y_c_sources)) \ 30 | $(filter-out gtkmountoperation% gtkprintoperation% \ 31 | gtkcssprovider.c \ 32 | gtkplug.c gtksocket.c gtkxembed.c \ 33 | %quartz.c %win32.c %-x11.c %-wayland.c gtkwin32% \ 34 | gtkapplication-dbus.c gtkapplication-quartz-menu.c \ 35 | , $(am__libgtk_3_la_SOURCES_DIST)) 36 | 37 | 38 | export GTK_INCLUDES = $(MAKEFILE_PATH)/include $(GTK_SOURCES_PATH) \ 39 | $(GLIB_INCLUDES) $(PANGO_INCLUDES) $(CAIRO_INCLUDES) \ 40 | $(GDK_PIXBUG_INCLUDES) $(ATK_INCLUDES) $(GDK_INCLUDES) 41 | 42 | LOCAL_MODULE := gtk 43 | LOCAL_CFLAGS += -DGTK_COMPILATION=1 -DNVALGRIND=1 -DGTK_VERSION=\"$(GTK_VERSION)\" \ 44 | -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED=1 -DATK_DISABLE_DEPRECATION_WARNINGS=1 \ 45 | -DGTK_HOST=\"android\" -DGTK_BINARY_VERSION=\"$(GTK_BINARY_VERSION)\" \ 46 | $(CAIRO_CFLAGS) 47 | LOCAL_C_INCLUDES := $(MAKEFILE_PATH) $(MAKEFILE_PATH)/include $(GTK_SOURCES_PATH) \ 48 | $(GLIB_INCLUDES) $(PANGO_INCLUDES) $(CAIRO_INCLUDES) \ 49 | $(GDK_PIXBUG_INCLUDES) $(ATK_INCLUDES) \ 50 | $(GDK_INCLUDES) \ 51 | $(NDK_ROOT)/sources/android/support/include \ 52 | $(NDK_ROOT)/sources/android/support/src/musl-locale 53 | LOCAL_SRC_FILES:= $(GTK_SOURCES) 54 | LOCAL_STATIC_LIBRARIES := android_support android_native_app_glue glib gobject gmodule \ 55 | pango cairo gdk-pixbuf atk gdk 56 | 57 | LOCAL_EXPORT_C_INCLUDES = $(GTK_INCLUDES) 58 | 59 | include $(BUILD_STATIC_LIBRARY) 60 | 61 | $(call import-module,android/support) 62 | $(call import-module,android/native_app_glue) 63 | $(call import-module,glib) 64 | $(call import-module,gobject) 65 | $(call import-module,pango) 66 | $(call import-module,cairo) 67 | $(call import-module,gdk-pixbuf) 68 | $(call import-module,atk) 69 | $(call import-module,gdk) 70 | -------------------------------------------------------------------------------- /clibs/harfbuzz/config.h: -------------------------------------------------------------------------------- 1 | 2 | /* Define to 1 if you have the `atexit' function. */ 3 | #define HAVE_ATEXIT 1 4 | 5 | /* Have cairo graphics library */ 6 | #define HAVE_CAIRO 1 7 | 8 | /* Have cairo-ft support in cairo graphics library */ 9 | #define HAVE_CAIRO_FT 1 10 | 11 | /* Have simple TrueType Layout backend */ 12 | #define HAVE_FALLBACK 13 | 14 | /* Have FreeType 2 library */ 15 | #define HAVE_FREETYPE 1 16 | 17 | /* Define to 1 if you have the `FT_Face_GetCharVariantIndex' function. */ 18 | #define HAVE_FT_FACE_GETCHARVARIANTINDEX 1 19 | 20 | /* Define to 1 if you have the `getpagesize' function. */ 21 | #define HAVE_GETPAGESIZE 1 22 | 23 | /* Have glib2 library */ 24 | #define HAVE_GLIB 1 25 | 26 | /* Have gobject2 library */ 27 | #define HAVE_GOBJECT 1 28 | 29 | /* Define to 1 if you have the header file. */ 30 | #define HAVE_INTTYPES_H 1 31 | 32 | /* Define to 1 if you have the `isatty' function. */ 33 | #define HAVE_ISATTY 1 34 | 35 | /* Define to 1 if you have the header file. */ 36 | #define HAVE_MEMORY_H 1 37 | 38 | /* Define to 1 if you have the `mmap' function. */ 39 | #define HAVE_MMAP 1 40 | 41 | /* Define to 1 if you have the `mprotect' function. */ 42 | #define HAVE_MPROTECT 1 43 | 44 | /* Have native OpenType Layout backend */ 45 | #define HAVE_OT 1 46 | 47 | /* Have POSIX threads */ 48 | #define HAVE_PTHREAD 1 49 | 50 | /* Have PTHREAD_PRIO_INHERIT. */ 51 | #define HAVE_PTHREAD_PRIO_INHERIT 1 52 | 53 | #define HB_NO_MT 54 | 55 | /* Define to 1 if you have the header file. */ 56 | #define HAVE_SCHED_H 1 57 | 58 | /* Have sched_yield */ 59 | #define HAVE_SCHED_YIELD 1 60 | 61 | /* Define to 1 if you have the header file. */ 62 | #define HAVE_STDINT_H 1 63 | 64 | /* Define to 1 if you have the header file. */ 65 | #define HAVE_STDLIB_H 1 66 | 67 | /* Define to 1 if you have the header file. */ 68 | #define HAVE_STRINGS_H 1 69 | 70 | /* Define to 1 if you have the header file. */ 71 | #define HAVE_STRING_H 1 72 | 73 | /* Define to 1 if you have the header file. */ 74 | #define HAVE_SYS_MMAN_H 1 75 | 76 | /* Define to 1 if you have the header file. */ 77 | #define HAVE_SYS_STAT_H 1 78 | 79 | /* Define to 1 if you have the header file. */ 80 | #define HAVE_SYS_TYPES_H 1 81 | 82 | /* Define to 1 if you have the header file. */ 83 | #define HAVE_UNISTD_H 1 84 | 85 | /* Define to the address where bug reports for this package should be sent. */ 86 | #define PACKAGE_BUGREPORT 87 | 88 | /* Define to the full name of this package. */ 89 | #define PACKAGE_NAME "harfbuzz-android" 90 | 91 | /* Define to the full name and version of this package. */ 92 | #define PACKAGE_STRING "harfbuzz-android" 93 | 94 | /* Define to the one symbol short name of this package. */ 95 | #define PACKAGE_TARNAME "harfbuzz-android" 96 | 97 | /* Define to the home page for this package. */ 98 | #define PACKAGE_URL "harfbuzz-android" 99 | 100 | /* Define to the version of this package. */ 101 | #define PACKAGE_VERSION "0.9.36" 102 | 103 | /* Define to 1 if you have the ANSI C header files. */ 104 | #define STDC_HEADERS 1 105 | -------------------------------------------------------------------------------- /clibs/gdk/gdkwindow-android.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // The initial implementation was based on gdk's gdkwindow-*.h files code 13 | // which is licensed under LGPLv2.1 terms 14 | // 15 | // ANativeWindow-based GDK window declarations 16 | 17 | #ifndef __GDK_WINDOW_ANDROID_H__ 18 | #define __GDK_WINDOW_ANDROID_H__ 19 | 20 | #include "gdkprivate-android.h" 21 | #include "gdk/gdkwindowimpl.h" 22 | #include "gdk/gdkcursor.h" 23 | 24 | 25 | G_BEGIN_DECLS 26 | 27 | /* Window implementation for Android 28 | */ 29 | 30 | typedef struct GdkWindowImplAndroid GdkWindowImplAndroid; 31 | typedef struct GdkWindowImplAndroidClass GdkWindowImplAndroidClass; 32 | 33 | #define GDK_TYPE_WINDOW_IMPL_ANDROID (gdk_window_impl_android_get_type()) 34 | #define GDK_WINDOW_IMPL_ANDROID(object) (G_TYPE_CHECK_INSTANCE_CAST((object), GDK_TYPE_WINDOW_IMPL_ANDROID, GdkWindowImplAndroid)) 35 | #define GDK_WINDOW_IMPL_ANDROID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GDK_TYPE_WINDOW_IMPL_ANDROID, GdkWindowImplAndroidClass)) 36 | #define GDK_IS_WINDOW_IMPL_ANDROID(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), GDK_TYPE_WINDOW_IMPL_ANDROID)) 37 | #define GDK_IS_WINDOW_IMPL_ANDROID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GDK_TYPE_WINDOW_IMPL_ANDROID)) 38 | #define GDK_WINDOW_IMPL_ANDROID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GDK_TYPE_WINDOW_IMPL_ANDROID, GdkWindowImplAndroidClass)) 39 | 40 | struct GdkWindowImplAndroid 41 | { 42 | GdkWindowImpl parent; 43 | 44 | GdkWindow *wrapper; 45 | 46 | cairo_surface_t *cairo_surface; 47 | guint override_redirect; 48 | GdkEventMask native_event_mask; 49 | GdkWindowTypeHint type_hint; 50 | gboolean inside_end_paint; 51 | }; 52 | 53 | struct GdkWindowImplAndroidClass 54 | { 55 | GdkWindowImplClass parent; 56 | }; 57 | 58 | GType gdk_window_impl_android_get_type(); 59 | 60 | #define GDK_TYPE_ANDROID_WINDOW (gdk_android_window_get_type ()) 61 | #define GDK_ANDROID_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_ANDROID_WINDOW, GdkWin32Window)) 62 | #define GDK_ANDROID_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_ANDROID_WINDOW, GdkWin32WindowClass)) 63 | #define GDK_IS_ANDROID_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_ANDROID_WINDOW)) 64 | #define GDK_IS_ANDROID_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_ANDROID_WINDOW)) 65 | #define GDK_ANDROID_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_ANDROID_WINDOW, GdkWin32WindowClass)) 66 | 67 | #ifdef GDK_COMPILATION 68 | typedef struct GdkAndroidWindow GdkAndroidWindow; 69 | #else 70 | typedef GdkWindow GdkAndroidWindow; 71 | #endif 72 | typedef struct GdkAndroidWindowClass GdkAndroidWindowClass; 73 | 74 | GDK_AVAILABLE_IN_ALL 75 | GType gdk_android_window_get_type(void); 76 | 77 | 78 | G_END_DECLS 79 | 80 | #endif /* __GDK_WINDOW_ANDROID_H__ */ 81 | -------------------------------------------------------------------------------- /clibs/cairo/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | # file at the top-level directory of this distribution and at 3 | # https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | # 5 | # Licensed under the Apache License, Version 2.0 or the MIT license 7 | # , at your 8 | # option. This file may not be copied, modified, or distributed 9 | # except according to those terms. 10 | # 11 | # Author(s): Evgeny Sologubov 12 | # 13 | 14 | MAKEFILE_PATH := $(call my-dir) 15 | LOCAL_PATH:= $(MAKEFILE_PATH)/distsrc 16 | CAIRO_SOURCES_PATH := $(LOCAL_PATH)/cairo 17 | PIXMAN_SOURCES_PATH := $(LOCAL_PATH)/pixman 18 | 19 | include $(CLEAR_VARS) 20 | 21 | LIBPIXMAN_CFLAGS = -D_USE_MATH_DEFINES -DPIXMAN_NO_TLS -DPACKAGE="android-cairo" -O2 \ 22 | -I$(PIXMAN_SOURCES_PATH)/pixman -I$(MAKEFILE_PATH)/pixman-extra \ 23 | -include "pixman-elf-fix.h" \ 24 | -Wno-missing-field-initializers 25 | 26 | export CAIRO_CFLAGS := -DCAIRO_HAS_GOBJECT_FUNCTIONS=1 27 | 28 | LIBCAIRO_CFLAGS:= $(LIBPIXMAN_CFLAGS) $(CAIRO_CFLAGS) \ 29 | -DPACKAGE_VERSION="\"android-cairo\"" \ 30 | -DPACKAGE_BUGREPORT="\"http://github.com/anoek/android-cairo\"" \ 31 | -DCAIRO_NO_MUTEX=1 -DHAVE_UINT64_T=1 \ 32 | -DHAVE_STDINT_H -Wno-attributes 33 | 34 | include $(CAIRO_SOURCES_PATH)/src/Makefile.sources 35 | include $(PIXMAN_SOURCES_PATH)/pixman/Makefile.sources 36 | 37 | ifeq ($(TARGET_ARCH),arm) 38 | libpixman_sources += pixman-arm-neon.c pixman-arm-simd.c \ 39 | pixman-arm-simd-asm.S pixman-arm-simd-asm-scaled.S \ 40 | pixman-arm-neon-asm.S pixman-arm-neon-asm-bilinear.S 41 | LIBPIXMAN_CFLAGS += -DUSE_ARM_NEON -DUSE_ARM_SIMD 42 | endif 43 | 44 | include $(CLEAR_VARS) 45 | 46 | 47 | LOCAL_MODULE := cairo 48 | LOCAL_CFLAGS := -O2 $(LIBCAIRO_CFLAGS) -I$(PIXMAN_SOURCES_PATH)/pixman \ 49 | -I$(CAIRO_SOURCES_PATH)/src -I$(MAKEFILE_PATH)/cairo-extra \ 50 | -I$(MAKEFILE_PATH)/pixman-extra -Wno-missing-field-initializers 51 | 52 | # remove the following line once NDK updates it's GCC to a version 53 | # with this fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56982 54 | LOCAL_CFLAGS += -fno-tree-dominator-opts 55 | 56 | LOCAL_SRC_FILES := cairo/util/cairo-gobject/cairo-gobject-enums.c \ 57 | cairo/util/cairo-gobject/cairo-gobject-structs.c \ 58 | $(addprefix pixman/pixman/, $(libpixman_sources)) \ 59 | $(addprefix cairo/src/, $(cairo_sources) $(cairo_gl_sources) $(cairo_egl_sources) \ 60 | $(cairo_ft_sources)) 61 | LOCAL_C_INCLUDES := $(GLIB_INCLUDES) $(LOCAL_PATH)/glib/glib \ 62 | $(FONTCONFIG_INCLUDES) $(FREETYPE_INCLUDES) \ 63 | $(NDK_ROOT)/sources/android/support/include \ 64 | $(NDK_ROOT)/sources/android/support/src/musl-locale 65 | LOCAL_STATIC_LIBRARIES := cpufeatures glib fontconfig freetype 66 | 67 | export CAIRO_INCLUDES := $(MAKEFILE_PATH)/cairo-extra $(MAKEFILE_PATH)/pixman-extra \ 68 | $(CAIRO_SOURCES_PATH)/src $(PIXMAN_SOURCES_PATH)/pixman \ 69 | $(CAIRO_SOURCES_PATH)/util/cairo-gobject 70 | 71 | include $(BUILD_STATIC_LIBRARY) 72 | 73 | $(call import-module,android/cpufeatures) 74 | $(call import-module,glib) 75 | $(call import-module,freetype) 76 | $(call import-module,fontconfig) -------------------------------------------------------------------------------- /clibs/gtk/gtkandroidassets.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // gfileutils-like Android "assets" accessors 14 | 15 | #include 16 | 17 | #include "gtkandroidprivate.h" 18 | #include "gtkandroidassets.h" 19 | 20 | 21 | /////////////////////////////////////////////////////////////////////// 22 | // class implementations 23 | 24 | struct GAAssetFile 25 | { 26 | GObject parent_instance; 27 | 28 | AAsset* asset; 29 | }; 30 | 31 | struct GAAssetFileClass 32 | { 33 | GObjectClass parent_class; 34 | }; 35 | 36 | static void g_aasset_file_file_iface_init(GFileIface *iface); 37 | 38 | G_DEFINE_TYPE_WITH_CODE(GAAssetFile, g_aasset_file, G_TYPE_OBJECT, 39 | G_IMPLEMENT_INTERFACE(G_TYPE_FILE, g_aasset_file_file_iface_init)) 40 | 41 | static void g_aasset_file_finalize(GObject *object) 42 | { 43 | GAAssetFile *aaf = G_AASSET_FILE(object); 44 | 45 | AAsset_close(aaf->asset); 46 | 47 | G_OBJECT_CLASS(g_aasset_file_parent_class)->finalize(object); 48 | } 49 | 50 | static void g_aasset_file_class_init(GAAssetFileClass *klass) 51 | { 52 | GObjectClass *gobject_class = G_OBJECT_CLASS(klass); 53 | 54 | gobject_class->finalize = g_aasset_file_finalize; 55 | } 56 | 57 | static void g_aasset_file_init(GAAssetFile *resource) 58 | { 59 | } 60 | 61 | static GFileInputStream *g_aasset_file_read(GFile *file, 62 | GCancellable *cancellable, 63 | GError **error) 64 | { 65 | GAAssetFile *aaf = G_AASSET_FILE(file); 66 | GInputStream *stream; 67 | 68 | stream = g_memory_input_stream_new_from_data(AAsset_getBuffer(aaf->asset), 69 | AAsset_getLength(aaf->asset), 70 | NULL); 71 | 72 | // TODO: get rid of this hack in future 73 | return (GFileInputStream *) stream; 74 | } 75 | 76 | static void g_aasset_file_file_iface_init(GFileIface *iface) 77 | { 78 | iface->read_fn = g_aasset_file_read; 79 | } 80 | 81 | /////////////////////////////////////////////////////////////////////// 82 | // public interface 83 | 84 | gboolean g_aasset_test(const gchar *filename, GFileTest test) 85 | { 86 | if (test & G_FILE_TEST_EXISTS && g_str_has_prefix(filename, "assets/")) 87 | { 88 | AAssetManager* assetManager = _gtk_android_glue_app->activity->assetManager; 89 | AAsset* asset = AAssetManager_open(assetManager, filename + strlen("assets/"), AASSET_MODE_BUFFER); 90 | if (!asset) 91 | return FALSE; 92 | AAsset_close(asset); 93 | return TRUE; 94 | } 95 | return g_file_test(filename, test); 96 | } 97 | 98 | GFile *g_aasset_as_GFile_for_path(const char *path) 99 | { 100 | GAAssetFile *aaf; 101 | AAsset* asset; 102 | AAssetManager* assetManager = _gtk_android_glue_app->activity->assetManager; 103 | 104 | g_return_val_if_fail(path != NULL, NULL); 105 | g_return_val_if_fail(g_str_has_prefix(path, "assets/"), NULL); 106 | 107 | asset = AAssetManager_open(assetManager, path + strlen("assets/"), AASSET_MODE_BUFFER); 108 | g_return_val_if_fail(asset != NULL, NULL); 109 | 110 | aaf = g_object_new(G_TYPE_AASSET_FILE, NULL); 111 | aaf->asset = asset; 112 | 113 | return G_FILE(aaf); 114 | } 115 | -------------------------------------------------------------------------------- /clibs/gdk/gdkprivate-android.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // ANativeWindow-based GDK display and screen definitions 14 | 15 | #ifndef __GDK_PRIVATE_ANDROID_H__ 16 | #define __GDK_PRIVATE_ANDROID_H__ 17 | 18 | #include "config.h" 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include "gdkinternals.h" 27 | #include "gdkdisplayprivate.h" 28 | #include "gdkscreenprivate.h" 29 | 30 | struct ANativeActivity; 31 | 32 | struct GdkAndroidDisplay 33 | { 34 | GdkDisplay display; 35 | struct android_app *app; 36 | EGLDisplay eglDisplay; 37 | EGLContext eglContext; 38 | EGLSurface eglSurface; 39 | cairo_device_t *cairoDevice; 40 | cairo_surface_t *cairoSurface; 41 | gchar *defaultFont; 42 | gchar *cachePath; 43 | gint notificationBarHeight; 44 | }; 45 | 46 | struct GdkAndroidScreen 47 | { 48 | GdkScreen screen; 49 | GdkVisual *visual; 50 | GdkWindow *root_window; 51 | gfloat xdpi; 52 | gfloat ydpi; 53 | }; 54 | 55 | extern struct GdkAndroidDisplay *_gdk_display; 56 | extern struct GdkAndroidScreen *_gdk_screen; 57 | 58 | 59 | 60 | gboolean _gdk_android_display_has_pending(GdkDisplay *display); 61 | void _gdk_android_display_queue_events(GdkDisplay *display); 62 | 63 | 64 | GdkWindow *_gdk_windowing_window_init (GdkScreen *screen); 65 | void _gdk_android_display_create_window_impl(GdkDisplay *display, 66 | GdkWindow *window, 67 | GdkWindow *real_parent, 68 | GdkScreen *screen, 69 | GdkEventMask event_mask, 70 | GdkWindowAttr *attributes, 71 | gint attributes_mask); 72 | 73 | void _gdk_push_modal_window (GdkWindow *window); 74 | void _gdk_remove_modal_window (GdkWindow *window); 75 | GdkWindow *_gdk_modal_current (void); 76 | gboolean _gdk_modal_blocked (GdkWindow *window); 77 | 78 | GdkWindow *_gdk_android_root(void); 79 | gboolean gdk_android_init_screen(struct GdkAndroidScreen *scr, struct ANativeActivity *act, 80 | GError **error); 81 | 82 | gboolean gdk_android_adjust_with_jni(struct GdkAndroidScreen *scr, struct GdkAndroidDisplay *desk, 83 | struct ANativeActivity *act, GError **error); 84 | void gdk_android_events_init(); 85 | 86 | GdkWindow *_gdk_android_find_window_for_screen_pos(gdouble *x, gdouble *y); 87 | 88 | GdkKeymap *_gdk_android_display_get_keymap(GdkDisplay *display); 89 | gboolean _gdk_android_window_simulate_key(GdkWindow *window, 90 | gint x, 91 | gint y, 92 | guint keyval, 93 | GdkModifierType modifiers, 94 | GdkEventType key_pressrelease); 95 | gboolean _gdk_android_window_simulate_button(GdkWindow *window, 96 | gint x, 97 | gint y, 98 | guint button, // 1..3 99 | GdkModifierType modifiers, 100 | GdkEventType button_pressrelease); 101 | 102 | 103 | #endif // __GDK_PRIVATE_ANDROID_H__ 104 | -------------------------------------------------------------------------------- /clibs/gdk/gdkjni.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // ANativeWindow-based GDK visual and screen definitions 14 | 15 | #include "config.h" 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #include "gdk.h" 23 | #include "gdkvisualprivate.h" 24 | #include "gdkprivate-android.h" 25 | #include "gdkandroidscreen.h" 26 | #include "gdkandroiddisplay.h" 27 | 28 | 29 | #define JNI_ASSERT if (jni->ExceptionCheck(pjni)) \ 30 | { \ 31 | g_set_error(error, GDK_ANDROID_ERROR, GDK_ANDROID_ERROR_INIT, \ 32 | "JNI exception at %s:%u", __FILE__, __LINE__); \ 33 | return FALSE; \ 34 | } 35 | 36 | #define JNI_GET_METHOD(clazz, name, sig) \ 37 | methId = jni->GetMethodID(pjni, clazz, name, sig); \ 38 | JNI_ASSERT 39 | 40 | 41 | gboolean gdk_android_adjust_with_jni(GdkAndroidScreen *scr, GdkAndroidDisplay *disp, 42 | ANativeActivity *act, GError **error) 43 | { 44 | JNIEnv *pjni, jni; 45 | jmethodID methId; 46 | jobject wm, display, displayMetrics, cacheDir; 47 | jclass activityClass, windowManagerClass, displayClass, displayMetricsClass, fileClass; 48 | jfieldID fldId; 49 | jstring jpath; 50 | const char* cachePath; 51 | 52 | (*act->vm)->AttachCurrentThread(act->vm, &pjni, NULL); 53 | jni = (*pjni); 54 | 55 | activityClass = jni->GetObjectClass(pjni, act->clazz); JNI_ASSERT 56 | 57 | // DPI 58 | JNI_GET_METHOD(activityClass, "getWindowManager", "()Landroid/view/WindowManager;"); 59 | wm = jni->CallObjectMethod(pjni, act->clazz, methId); JNI_ASSERT 60 | 61 | windowManagerClass = jni->FindClass(pjni, "android/view/WindowManager"); JNI_ASSERT 62 | 63 | JNI_GET_METHOD(windowManagerClass, "getDefaultDisplay", "()Landroid/view/Display;"); 64 | display = jni->CallObjectMethod(pjni, wm, methId); JNI_ASSERT 65 | 66 | displayClass = jni->FindClass(pjni, "android/view/Display"); JNI_ASSERT 67 | displayMetricsClass = jni->FindClass(pjni, "android/util/DisplayMetrics"); JNI_ASSERT 68 | 69 | JNI_GET_METHOD(displayMetricsClass, "", "()V"); 70 | displayMetrics = jni->NewObject(pjni, displayMetricsClass, methId); JNI_ASSERT 71 | 72 | JNI_GET_METHOD(displayClass, "getMetrics", "(Landroid/util/DisplayMetrics;)V"); 73 | jni->CallVoidMethod(pjni, display, methId, displayMetrics); JNI_ASSERT 74 | 75 | fldId = jni->GetFieldID(pjni, displayMetricsClass, "xdpi", "F"); JNI_ASSERT 76 | scr->xdpi = jni->GetFloatField(pjni, displayMetrics, fldId); JNI_ASSERT 77 | scr->screen.resolution = scr->xdpi; 78 | 79 | fldId = jni->GetFieldID(pjni, displayMetricsClass, "ydpi", "F"); JNI_ASSERT 80 | scr->ydpi = jni->GetFloatField(pjni, displayMetrics, fldId); JNI_ASSERT 81 | 82 | g_debug("xdpi = %f, ydpi = %f", scr->xdpi, scr->ydpi); 83 | 84 | // cache DIR 85 | JNI_GET_METHOD(activityClass, "getCacheDir", "()Ljava/io/File;"); 86 | cacheDir = jni->CallObjectMethod(pjni, act->clazz, methId); JNI_ASSERT 87 | fileClass = jni->FindClass(pjni, "java/io/File"); JNI_ASSERT 88 | JNI_GET_METHOD(fileClass, "getAbsolutePath", "()Ljava/lang/String;"); 89 | jpath = (jstring) jni->CallObjectMethod(pjni, cacheDir, methId); JNI_ASSERT 90 | cachePath = jni->GetStringUTFChars(pjni, jpath, NULL); 91 | disp->cachePath = g_strdup(cachePath); 92 | 93 | g_debug("cachePath = %s", disp->cachePath); 94 | 95 | // Delete objects 96 | jni->ReleaseStringUTFChars(pjni, jpath, cachePath); 97 | jni->DeleteLocalRef(pjni, displayMetrics); 98 | jni->DeleteLocalRef(pjni, display); 99 | jni->DeleteLocalRef(pjni, wm); 100 | jni->DeleteLocalRef(pjni, cacheDir); 101 | (*act->vm)->DetachCurrentThread(act->vm); 102 | return TRUE; 103 | } 104 | -------------------------------------------------------------------------------- /clibs/fontconfig/fcinit_android.c: -------------------------------------------------------------------------------- 1 | /* 2 | * fontconfig/src/fcinit.c 3 | * 4 | * Copyright © 2001 Keith Packard 5 | * 6 | * Permission to use, copy, modify, distribute, and sell this software and its 7 | * documentation for any purpose is hereby granted without fee, provided that 8 | * the above copyright notice appear in all copies and that both that 9 | * copyright notice and this permission notice appear in supporting 10 | * documentation, and that the name of the author(s) not be used in 11 | * advertising or publicity pertaining to distribution of the software without 12 | * specific, written prior permission. The authors make no 13 | * representations about the suitability of this software for any purpose. It 14 | * is provided "as is" without express or implied warranty. 15 | * 16 | * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 17 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 18 | * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 19 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 20 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 21 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 22 | * PERFORMANCE OF THIS SOFTWARE. 23 | */ 24 | 25 | #include "src/fcint.h" 26 | #include 27 | 28 | #if defined(FC_ATOMIC_INT_NIL) 29 | #pragma message("Could not find any system to define atomic_int macros, library may NOT be thread-safe.") 30 | #endif 31 | #if defined(FC_MUTEX_IMPL_NIL) 32 | #pragma message("Could not find any system to define mutex macros, library may NOT be thread-safe.") 33 | #endif 34 | #if defined(FC_ATOMIC_INT_NIL) || defined(FC_MUTEX_IMPL_NIL) 35 | #pragma message("To suppress these warnings, define FC_NO_MT.") 36 | #endif 37 | 38 | static const char *androidAppCacheDir = NULL; 39 | 40 | FcPublic void FcConfigSetupAndroidCacheDir(const char *dir) 41 | { 42 | androidAppCacheDir = dir; 43 | } 44 | 45 | static FcConfig * 46 | FcInitFallbackConfig (void) 47 | { 48 | FcConfig *config; 49 | 50 | config = FcConfigCreate (); 51 | if (!config) 52 | goto bail0; 53 | if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS)) 54 | goto bail1; 55 | if (androidAppCacheDir && !FcConfigAddCacheDir (config, (FcChar8 *) androidAppCacheDir)) 56 | goto bail1; 57 | return config; 58 | 59 | bail1: 60 | FcConfigDestroy (config); 61 | bail0: 62 | return 0; 63 | } 64 | 65 | int 66 | FcGetVersion (void) 67 | { 68 | return FC_VERSION; 69 | } 70 | 71 | /* 72 | * Load the configuration files 73 | */ 74 | FcConfig * 75 | FcInitLoadOwnConfig (FcConfig *config) 76 | { 77 | return FcInitFallbackConfig (); 78 | } 79 | 80 | FcConfig * 81 | FcInitLoadConfig (void) 82 | { 83 | return FcInitLoadOwnConfig (NULL); 84 | } 85 | 86 | /* 87 | * Load the configuration files and scan for available fonts 88 | */ 89 | FcConfig * 90 | FcInitLoadOwnConfigAndFonts (FcConfig *config) 91 | { 92 | config = FcInitLoadOwnConfig (config); 93 | if (!config) 94 | return 0; 95 | if (!FcConfigBuildFonts (config)) 96 | { 97 | FcConfigDestroy (config); 98 | return 0; 99 | } 100 | return config; 101 | } 102 | 103 | FcConfig * 104 | FcInitLoadConfigAndFonts (void) 105 | { 106 | return FcInitLoadOwnConfigAndFonts (NULL); 107 | } 108 | 109 | /* 110 | * Initialize the default library configuration 111 | */ 112 | FcBool 113 | FcInit (void) 114 | { 115 | return FcConfigInit (); 116 | } 117 | 118 | /* 119 | * Free all library-allocated data structures. 120 | */ 121 | void 122 | FcFini (void) 123 | { 124 | FcConfigFini (); 125 | FcCacheFini (); 126 | FcDefaultFini (); 127 | } 128 | 129 | /* 130 | * Reread the configuration and available font lists 131 | */ 132 | FcBool 133 | FcInitReinitialize (void) 134 | { 135 | FcConfig *config; 136 | 137 | config = FcInitLoadConfigAndFonts (); 138 | if (!config) 139 | return FcFalse; 140 | return FcConfigSetCurrent (config); 141 | } 142 | 143 | FcBool 144 | FcInitBringUptoDate (void) 145 | { 146 | FcConfig *config = FcConfigGetCurrent (); 147 | time_t now; 148 | 149 | /* 150 | * rescanInterval == 0 disables automatic up to date 151 | */ 152 | if (config->rescanInterval == 0) 153 | return FcTrue; 154 | /* 155 | * Check no more often than rescanInterval seconds 156 | */ 157 | now = time (0); 158 | if (config->rescanTime + config->rescanInterval - now > 0) 159 | return FcTrue; 160 | /* 161 | * If up to date, don't reload configuration 162 | */ 163 | if (FcConfigUptoDate (0)) 164 | return FcTrue; 165 | return FcInitReinitialize (); 166 | } 167 | 168 | #define __fcinit__ 169 | #include "fcaliastail.h" 170 | #undef __fcinit__ 171 | -------------------------------------------------------------------------------- /clibs/gtk/gtkainit.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2015 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Core android initialization functions 14 | 15 | #include "config.h" 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "gtkandroid.h" 26 | #include "gdkandroiddisplay.h" 27 | #include "gdkandroidevents.h" 28 | #include "gtkandroidprivate.h" 29 | 30 | struct android_app *_gtk_android_glue_app = NULL; 31 | 32 | //////////////////////////////////////////////////////////////////////////////////// 33 | // logging 34 | 35 | static void log_handler(const gchar *log_domain, GLogLevelFlags log_level, 36 | const gchar *message, gpointer user_data) 37 | { 38 | android_LogPriority priority = ANDROID_LOG_VERBOSE; 39 | if (log_level & G_LOG_LEVEL_ERROR) 40 | priority = ANDROID_LOG_FATAL; 41 | else if (log_level & G_LOG_LEVEL_CRITICAL) 42 | priority = ANDROID_LOG_ERROR; 43 | else if (log_level & G_LOG_LEVEL_WARNING) 44 | priority = ANDROID_LOG_WARN; 45 | else if (log_level & G_LOG_LEVEL_INFO || log_level & G_LOG_LEVEL_MESSAGE) 46 | priority = ANDROID_LOG_INFO; 47 | else if (log_level & G_LOG_LEVEL_DEBUG) 48 | priority = ANDROID_LOG_DEBUG; 49 | __android_log_print(priority, log_domain, "%s", message); 50 | } 51 | 52 | 53 | /////////////////////////////////////////////////////////////////////////////////// 54 | // locale 55 | 56 | // Android NDK doesn't really support any locale except "C" 57 | char *setlocale(int category, const char *locale) 58 | { 59 | static const char C_LOCALE_SETTING[] = "C"; 60 | return (char*) C_LOCALE_SETTING; 61 | } 62 | 63 | /////////////////////////////////////////////////////////////////////////////////// 64 | // window event handlers & initialization 65 | 66 | static void (*default_gtk_window_class_constructed)(GObject *object) = NULL; 67 | 68 | void android_gtk_window_class_constructed(GObject *object) 69 | { 70 | GtkWindow *w = GTK_WINDOW(object); 71 | 72 | if (default_gtk_window_class_constructed) 73 | (*default_gtk_window_class_constructed)(object); 74 | 75 | gtk_window_set_has_resize_grip(w, FALSE); 76 | } 77 | 78 | static void adjust_default_font() 79 | { 80 | GtkSettings *settings = gtk_settings_get_default(); 81 | const gchar *font = gdk_android_get_default_font(); 82 | g_assert(settings != NULL); 83 | 84 | if (font) 85 | { 86 | gtk_settings_set_string_property(settings, "gtk-font-name", font, "gtk_android_init"); 87 | g_info("Default GTK+ font is set to '%s'", font); 88 | } 89 | } 90 | 91 | static gtk_window_tweak_class() 92 | { 93 | GObjectClass *objClass = G_OBJECT_CLASS(g_type_class_ref(GTK_TYPE_WINDOW)); 94 | 95 | if (objClass->constructed != android_gtk_window_class_constructed) 96 | { 97 | default_gtk_window_class_constructed = objClass->constructed; 98 | objClass->constructed = android_gtk_window_class_constructed; 99 | } 100 | } 101 | 102 | static void (*defaultActivityDestroyHandler)(ANativeActivity* activity) = NULL; 103 | 104 | static void onActivityDestroy(ANativeActivity* activity) 105 | { 106 | // wait until the native_app is detached 107 | defaultActivityDestroyHandler(activity); 108 | // and kill this process 109 | exit(0); 110 | } 111 | 112 | /////////////////////////////////////////////////////////////////////////////////// 113 | // public API 114 | 115 | // Prepares basic infrastructure needed by gtk+ applications. 116 | // Call this function at the beginning of your android_main 117 | // instead of *gtk_init* which would be used on other platforms 118 | void gtk_android_init(struct android_app *state) 119 | { 120 | app_dummy(); // Make sure glue isn't stripped. 121 | 122 | _gtk_android_glue_app = state; 123 | 124 | g_log_set_default_handler(log_handler, NULL); 125 | 126 | gdk_android_setup_app_callbacks(state, gtk_main_quit); 127 | gdk_android_process_events_until_display_ready(state); 128 | 129 | gtk_window_tweak_class(); 130 | 131 | gtk_init(NULL, NULL); 132 | 133 | // g_object_get(settings, "gtk-font-name", &font_name, NULL); 134 | adjust_default_font(); 135 | } 136 | 137 | void gtk_android_exit(struct android_app *state) 138 | { 139 | int ident; 140 | int events; 141 | struct android_poll_source* source; 142 | 143 | // replace onDestroy handler to terminate the process AFTER everything is unloaded 144 | if (!defaultActivityDestroyHandler) 145 | { 146 | defaultActivityDestroyHandler = state->activity->callbacks->onDestroy; 147 | state->activity->callbacks->onDestroy = onActivityDestroy; 148 | } 149 | 150 | ANativeActivity_finish(state->activity); 151 | 152 | while (!state->destroyRequested) 153 | { 154 | // Read all pending events. 155 | while ((ident = ALooper_pollAll(0, NULL, &events, (void**)&source)) >= 0) 156 | { 157 | // Process this event. 158 | if (source != NULL) 159 | source->process(state, source); 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /clibs/cairo/pixman-extra/pixman-combine32.h: -------------------------------------------------------------------------------- 1 | /* WARNING: This file is generated by combine.pl from combine.inc. 2 | Please edit one of those files rather than this one. */ 3 | 4 | #line 1 "pixman-combine.c.template" 5 | 6 | #define COMPONENT_SIZE 8 7 | #define MASK 0xff 8 | #define ONE_HALF 0x80 9 | 10 | #define A_SHIFT 8 * 3 11 | #define R_SHIFT 8 * 2 12 | #define G_SHIFT 8 13 | #define A_MASK 0xff000000 14 | #define R_MASK 0xff0000 15 | #define G_MASK 0xff00 16 | 17 | #define RB_MASK 0xff00ff 18 | #define AG_MASK 0xff00ff00 19 | #define RB_ONE_HALF 0x800080 20 | #define RB_MASK_PLUS_ONE 0x10000100 21 | 22 | #define ALPHA_8(x) ((x) >> A_SHIFT) 23 | #define RED_8(x) (((x) >> R_SHIFT) & MASK) 24 | #define GREEN_8(x) (((x) >> G_SHIFT) & MASK) 25 | #define BLUE_8(x) ((x) & MASK) 26 | 27 | /* 28 | * Helper macros. 29 | */ 30 | 31 | #define MUL_UN8(a, b, t) \ 32 | ((t) = (a) * (b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT )) 33 | 34 | #define DIV_UN8(a, b) \ 35 | (((uint16_t) (a) * MASK) / (b)) 36 | 37 | #define ADD_UN8(x, y, t) \ 38 | ((t) = (x) + (y), \ 39 | (uint32_t) (uint8_t) ((t) | (0 - ((t) >> G_SHIFT)))) 40 | 41 | #define DIV_ONE_UN8(x) \ 42 | (((x) + ONE_HALF + (((x) + ONE_HALF) >> G_SHIFT)) >> G_SHIFT) 43 | 44 | /* 45 | * The methods below use some tricks to be able to do two color 46 | * components at the same time. 47 | */ 48 | 49 | /* 50 | * x_rb = (x_rb * a) / 255 51 | */ 52 | #define UN8_rb_MUL_UN8(x, a, t) \ 53 | do \ 54 | { \ 55 | t = ((x) & RB_MASK) * (a); \ 56 | t += RB_ONE_HALF; \ 57 | x = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \ 58 | x &= RB_MASK; \ 59 | } while (0) 60 | 61 | /* 62 | * x_rb = min (x_rb + y_rb, 255) 63 | */ 64 | #define UN8_rb_ADD_UN8_rb(x, y, t) \ 65 | do \ 66 | { \ 67 | t = ((x) + (y)); \ 68 | t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \ 69 | x = (t & RB_MASK); \ 70 | } while (0) 71 | 72 | /* 73 | * x_rb = (x_rb * a_rb) / 255 74 | */ 75 | #define UN8_rb_MUL_UN8_rb(x, a, t) \ 76 | do \ 77 | { \ 78 | t = (x & MASK) * (a & MASK); \ 79 | t |= (x & R_MASK) * ((a >> R_SHIFT) & MASK); \ 80 | t += RB_ONE_HALF; \ 81 | t = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \ 82 | x = t & RB_MASK; \ 83 | } while (0) 84 | 85 | /* 86 | * x_c = (x_c * a) / 255 87 | */ 88 | #define UN8x4_MUL_UN8(x, a) \ 89 | do \ 90 | { \ 91 | uint32_t r1__, r2__, t__; \ 92 | \ 93 | r1__ = (x); \ 94 | UN8_rb_MUL_UN8 (r1__, (a), t__); \ 95 | \ 96 | r2__ = (x) >> G_SHIFT; \ 97 | UN8_rb_MUL_UN8 (r2__, (a), t__); \ 98 | \ 99 | (x) = r1__ | (r2__ << G_SHIFT); \ 100 | } while (0) 101 | 102 | /* 103 | * x_c = (x_c * a) / 255 + y_c 104 | */ 105 | #define UN8x4_MUL_UN8_ADD_UN8x4(x, a, y) \ 106 | do \ 107 | { \ 108 | uint32_t r1__, r2__, r3__, t__; \ 109 | \ 110 | r1__ = (x); \ 111 | r2__ = (y) & RB_MASK; \ 112 | UN8_rb_MUL_UN8 (r1__, (a), t__); \ 113 | UN8_rb_ADD_UN8_rb (r1__, r2__, t__); \ 114 | \ 115 | r2__ = (x) >> G_SHIFT; \ 116 | r3__ = ((y) >> G_SHIFT) & RB_MASK; \ 117 | UN8_rb_MUL_UN8 (r2__, (a), t__); \ 118 | UN8_rb_ADD_UN8_rb (r2__, r3__, t__); \ 119 | \ 120 | (x) = r1__ | (r2__ << G_SHIFT); \ 121 | } while (0) 122 | 123 | /* 124 | * x_c = (x_c * a + y_c * b) / 255 125 | */ 126 | #define UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8(x, a, y, b) \ 127 | do \ 128 | { \ 129 | uint32_t r1__, r2__, r3__, t__; \ 130 | \ 131 | r1__ = (x); \ 132 | r2__ = (y); \ 133 | UN8_rb_MUL_UN8 (r1__, (a), t__); \ 134 | UN8_rb_MUL_UN8 (r2__, (b), t__); \ 135 | UN8_rb_ADD_UN8_rb (r1__, r2__, t__); \ 136 | \ 137 | r2__ = ((x) >> G_SHIFT); \ 138 | r3__ = ((y) >> G_SHIFT); \ 139 | UN8_rb_MUL_UN8 (r2__, (a), t__); \ 140 | UN8_rb_MUL_UN8 (r3__, (b), t__); \ 141 | UN8_rb_ADD_UN8_rb (r2__, r3__, t__); \ 142 | \ 143 | (x) = r1__ | (r2__ << G_SHIFT); \ 144 | } while (0) 145 | 146 | /* 147 | * x_c = (x_c * a_c) / 255 148 | */ 149 | #define UN8x4_MUL_UN8x4(x, a) \ 150 | do \ 151 | { \ 152 | uint32_t r1__, r2__, r3__, t__; \ 153 | \ 154 | r1__ = (x); \ 155 | r2__ = (a); \ 156 | UN8_rb_MUL_UN8_rb (r1__, r2__, t__); \ 157 | \ 158 | r2__ = (x) >> G_SHIFT; \ 159 | r3__ = (a) >> G_SHIFT; \ 160 | UN8_rb_MUL_UN8_rb (r2__, r3__, t__); \ 161 | \ 162 | (x) = r1__ | (r2__ << G_SHIFT); \ 163 | } while (0) 164 | 165 | /* 166 | * x_c = (x_c * a_c) / 255 + y_c 167 | */ 168 | #define UN8x4_MUL_UN8x4_ADD_UN8x4(x, a, y) \ 169 | do \ 170 | { \ 171 | uint32_t r1__, r2__, r3__, t__; \ 172 | \ 173 | r1__ = (x); \ 174 | r2__ = (a); \ 175 | UN8_rb_MUL_UN8_rb (r1__, r2__, t__); \ 176 | r2__ = (y) & RB_MASK; \ 177 | UN8_rb_ADD_UN8_rb (r1__, r2__, t__); \ 178 | \ 179 | r2__ = ((x) >> G_SHIFT); \ 180 | r3__ = ((a) >> G_SHIFT); \ 181 | UN8_rb_MUL_UN8_rb (r2__, r3__, t__); \ 182 | r3__ = ((y) >> G_SHIFT) & RB_MASK; \ 183 | UN8_rb_ADD_UN8_rb (r2__, r3__, t__); \ 184 | \ 185 | (x) = r1__ | (r2__ << G_SHIFT); \ 186 | } while (0) 187 | 188 | /* 189 | * x_c = (x_c * a_c + y_c * b) / 255 190 | */ 191 | #define UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8(x, a, y, b) \ 192 | do \ 193 | { \ 194 | uint32_t r1__, r2__, r3__, t__; \ 195 | \ 196 | r1__ = (x); \ 197 | r2__ = (a); \ 198 | UN8_rb_MUL_UN8_rb (r1__, r2__, t__); \ 199 | r2__ = (y); \ 200 | UN8_rb_MUL_UN8 (r2__, (b), t__); \ 201 | UN8_rb_ADD_UN8_rb (r1__, r2__, t__); \ 202 | \ 203 | r2__ = (x) >> G_SHIFT; \ 204 | r3__ = (a) >> G_SHIFT; \ 205 | UN8_rb_MUL_UN8_rb (r2__, r3__, t__); \ 206 | r3__ = (y) >> G_SHIFT; \ 207 | UN8_rb_MUL_UN8 (r3__, (b), t__); \ 208 | UN8_rb_ADD_UN8_rb (r2__, r3__, t__); \ 209 | \ 210 | x = r1__ | (r2__ << G_SHIFT); \ 211 | } while (0) 212 | 213 | /* 214 | x_c = min(x_c + y_c, 255) 215 | */ 216 | #define UN8x4_ADD_UN8x4(x, y) \ 217 | do \ 218 | { \ 219 | uint32_t r1__, r2__, r3__, t__; \ 220 | \ 221 | r1__ = (x) & RB_MASK; \ 222 | r2__ = (y) & RB_MASK; \ 223 | UN8_rb_ADD_UN8_rb (r1__, r2__, t__); \ 224 | \ 225 | r2__ = ((x) >> G_SHIFT) & RB_MASK; \ 226 | r3__ = ((y) >> G_SHIFT) & RB_MASK; \ 227 | UN8_rb_ADD_UN8_rb (r2__, r3__, t__); \ 228 | \ 229 | x = r1__ | (r2__ << G_SHIFT); \ 230 | } while (0) 231 | -------------------------------------------------------------------------------- /clibs/cairo/pixman-extra/pixman-combine64.h: -------------------------------------------------------------------------------- 1 | /* WARNING: This file is generated by combine.pl from combine.inc. 2 | Please edit one of those files rather than this one. */ 3 | 4 | #line 1 "pixman-combine.c.template" 5 | 6 | #define COMPONENT_SIZE 16 7 | #define MASK 0xffffULL 8 | #define ONE_HALF 0x8000ULL 9 | 10 | #define A_SHIFT 16 * 3 11 | #define R_SHIFT 16 * 2 12 | #define G_SHIFT 16 13 | #define A_MASK 0xffff000000000000ULL 14 | #define R_MASK 0xffff00000000ULL 15 | #define G_MASK 0xffff0000ULL 16 | 17 | #define RB_MASK 0xffff0000ffffULL 18 | #define AG_MASK 0xffff0000ffff0000ULL 19 | #define RB_ONE_HALF 0x800000008000ULL 20 | #define RB_MASK_PLUS_ONE 0x10000000010000ULL 21 | 22 | #define ALPHA_16(x) ((x) >> A_SHIFT) 23 | #define RED_16(x) (((x) >> R_SHIFT) & MASK) 24 | #define GREEN_16(x) (((x) >> G_SHIFT) & MASK) 25 | #define BLUE_16(x) ((x) & MASK) 26 | 27 | /* 28 | * Helper macros. 29 | */ 30 | 31 | #define MUL_UN16(a, b, t) \ 32 | ((t) = (a) * (b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT )) 33 | 34 | #define DIV_UN16(a, b) \ 35 | (((uint32_t) (a) * MASK) / (b)) 36 | 37 | #define ADD_UN16(x, y, t) \ 38 | ((t) = (x) + (y), \ 39 | (uint64_t) (uint16_t) ((t) | (0 - ((t) >> G_SHIFT)))) 40 | 41 | #define DIV_ONE_UN16(x) \ 42 | (((x) + ONE_HALF + (((x) + ONE_HALF) >> G_SHIFT)) >> G_SHIFT) 43 | 44 | /* 45 | * The methods below use some tricks to be able to do two color 46 | * components at the same time. 47 | */ 48 | 49 | /* 50 | * x_rb = (x_rb * a) / 255 51 | */ 52 | #define UN16_rb_MUL_UN16(x, a, t) \ 53 | do \ 54 | { \ 55 | t = ((x) & RB_MASK) * (a); \ 56 | t += RB_ONE_HALF; \ 57 | x = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \ 58 | x &= RB_MASK; \ 59 | } while (0) 60 | 61 | /* 62 | * x_rb = min (x_rb + y_rb, 255) 63 | */ 64 | #define UN16_rb_ADD_UN16_rb(x, y, t) \ 65 | do \ 66 | { \ 67 | t = ((x) + (y)); \ 68 | t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \ 69 | x = (t & RB_MASK); \ 70 | } while (0) 71 | 72 | /* 73 | * x_rb = (x_rb * a_rb) / 255 74 | */ 75 | #define UN16_rb_MUL_UN16_rb(x, a, t) \ 76 | do \ 77 | { \ 78 | t = (x & MASK) * (a & MASK); \ 79 | t |= (x & R_MASK) * ((a >> R_SHIFT) & MASK); \ 80 | t += RB_ONE_HALF; \ 81 | t = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \ 82 | x = t & RB_MASK; \ 83 | } while (0) 84 | 85 | /* 86 | * x_c = (x_c * a) / 255 87 | */ 88 | #define UN16x4_MUL_UN16(x, a) \ 89 | do \ 90 | { \ 91 | uint64_t r1__, r2__, t__; \ 92 | \ 93 | r1__ = (x); \ 94 | UN16_rb_MUL_UN16 (r1__, (a), t__); \ 95 | \ 96 | r2__ = (x) >> G_SHIFT; \ 97 | UN16_rb_MUL_UN16 (r2__, (a), t__); \ 98 | \ 99 | (x) = r1__ | (r2__ << G_SHIFT); \ 100 | } while (0) 101 | 102 | /* 103 | * x_c = (x_c * a) / 255 + y_c 104 | */ 105 | #define UN16x4_MUL_UN16_ADD_UN16x4(x, a, y) \ 106 | do \ 107 | { \ 108 | uint64_t r1__, r2__, r3__, t__; \ 109 | \ 110 | r1__ = (x); \ 111 | r2__ = (y) & RB_MASK; \ 112 | UN16_rb_MUL_UN16 (r1__, (a), t__); \ 113 | UN16_rb_ADD_UN16_rb (r1__, r2__, t__); \ 114 | \ 115 | r2__ = (x) >> G_SHIFT; \ 116 | r3__ = ((y) >> G_SHIFT) & RB_MASK; \ 117 | UN16_rb_MUL_UN16 (r2__, (a), t__); \ 118 | UN16_rb_ADD_UN16_rb (r2__, r3__, t__); \ 119 | \ 120 | (x) = r1__ | (r2__ << G_SHIFT); \ 121 | } while (0) 122 | 123 | /* 124 | * x_c = (x_c * a + y_c * b) / 255 125 | */ 126 | #define UN16x4_MUL_UN16_ADD_UN16x4_MUL_UN16(x, a, y, b) \ 127 | do \ 128 | { \ 129 | uint64_t r1__, r2__, r3__, t__; \ 130 | \ 131 | r1__ = (x); \ 132 | r2__ = (y); \ 133 | UN16_rb_MUL_UN16 (r1__, (a), t__); \ 134 | UN16_rb_MUL_UN16 (r2__, (b), t__); \ 135 | UN16_rb_ADD_UN16_rb (r1__, r2__, t__); \ 136 | \ 137 | r2__ = ((x) >> G_SHIFT); \ 138 | r3__ = ((y) >> G_SHIFT); \ 139 | UN16_rb_MUL_UN16 (r2__, (a), t__); \ 140 | UN16_rb_MUL_UN16 (r3__, (b), t__); \ 141 | UN16_rb_ADD_UN16_rb (r2__, r3__, t__); \ 142 | \ 143 | (x) = r1__ | (r2__ << G_SHIFT); \ 144 | } while (0) 145 | 146 | /* 147 | * x_c = (x_c * a_c) / 255 148 | */ 149 | #define UN16x4_MUL_UN16x4(x, a) \ 150 | do \ 151 | { \ 152 | uint64_t r1__, r2__, r3__, t__; \ 153 | \ 154 | r1__ = (x); \ 155 | r2__ = (a); \ 156 | UN16_rb_MUL_UN16_rb (r1__, r2__, t__); \ 157 | \ 158 | r2__ = (x) >> G_SHIFT; \ 159 | r3__ = (a) >> G_SHIFT; \ 160 | UN16_rb_MUL_UN16_rb (r2__, r3__, t__); \ 161 | \ 162 | (x) = r1__ | (r2__ << G_SHIFT); \ 163 | } while (0) 164 | 165 | /* 166 | * x_c = (x_c * a_c) / 255 + y_c 167 | */ 168 | #define UN16x4_MUL_UN16x4_ADD_UN16x4(x, a, y) \ 169 | do \ 170 | { \ 171 | uint64_t r1__, r2__, r3__, t__; \ 172 | \ 173 | r1__ = (x); \ 174 | r2__ = (a); \ 175 | UN16_rb_MUL_UN16_rb (r1__, r2__, t__); \ 176 | r2__ = (y) & RB_MASK; \ 177 | UN16_rb_ADD_UN16_rb (r1__, r2__, t__); \ 178 | \ 179 | r2__ = ((x) >> G_SHIFT); \ 180 | r3__ = ((a) >> G_SHIFT); \ 181 | UN16_rb_MUL_UN16_rb (r2__, r3__, t__); \ 182 | r3__ = ((y) >> G_SHIFT) & RB_MASK; \ 183 | UN16_rb_ADD_UN16_rb (r2__, r3__, t__); \ 184 | \ 185 | (x) = r1__ | (r2__ << G_SHIFT); \ 186 | } while (0) 187 | 188 | /* 189 | * x_c = (x_c * a_c + y_c * b) / 255 190 | */ 191 | #define UN16x4_MUL_UN16x4_ADD_UN16x4_MUL_UN16(x, a, y, b) \ 192 | do \ 193 | { \ 194 | uint64_t r1__, r2__, r3__, t__; \ 195 | \ 196 | r1__ = (x); \ 197 | r2__ = (a); \ 198 | UN16_rb_MUL_UN16_rb (r1__, r2__, t__); \ 199 | r2__ = (y); \ 200 | UN16_rb_MUL_UN16 (r2__, (b), t__); \ 201 | UN16_rb_ADD_UN16_rb (r1__, r2__, t__); \ 202 | \ 203 | r2__ = (x) >> G_SHIFT; \ 204 | r3__ = (a) >> G_SHIFT; \ 205 | UN16_rb_MUL_UN16_rb (r2__, r3__, t__); \ 206 | r3__ = (y) >> G_SHIFT; \ 207 | UN16_rb_MUL_UN16 (r3__, (b), t__); \ 208 | UN16_rb_ADD_UN16_rb (r2__, r3__, t__); \ 209 | \ 210 | x = r1__ | (r2__ << G_SHIFT); \ 211 | } while (0) 212 | 213 | /* 214 | x_c = min(x_c + y_c, 255) 215 | */ 216 | #define UN16x4_ADD_UN16x4(x, y) \ 217 | do \ 218 | { \ 219 | uint64_t r1__, r2__, r3__, t__; \ 220 | \ 221 | r1__ = (x) & RB_MASK; \ 222 | r2__ = (y) & RB_MASK; \ 223 | UN16_rb_ADD_UN16_rb (r1__, r2__, t__); \ 224 | \ 225 | r2__ = ((x) >> G_SHIFT) & RB_MASK; \ 226 | r3__ = ((y) >> G_SHIFT) & RB_MASK; \ 227 | UN16_rb_ADD_UN16_rb (r2__, r3__, t__); \ 228 | \ 229 | x = r1__ | (r2__ << G_SHIFT); \ 230 | } while (0) 231 | -------------------------------------------------------------------------------- /clibs/glib/include/glibconfig.h: -------------------------------------------------------------------------------- 1 | /* glibconfig.h.win32.in. Originally merged from two versions of 2 | * glibconfig.h, generated by the GLib configure script, for gcc and 3 | * MSVC. 4 | */ 5 | 6 | /* glibconfig.h 7 | * 8 | * This is a generated file. Please modify 'glibconfig.h.win32.in' 9 | */ 10 | 11 | #ifndef __G_LIBCONFIG_H__ 12 | #define __G_LIBCONFIG_H__ 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | G_BEGIN_DECLS 20 | 21 | #define G_MINFLOAT FLT_MIN 22 | #define G_MAXFLOAT FLT_MAX 23 | #define G_MINDOUBLE DBL_MIN 24 | #define G_MAXDOUBLE DBL_MAX 25 | #define G_MINSHORT SHRT_MIN 26 | #define G_MAXSHORT SHRT_MAX 27 | #define G_MAXUSHORT USHRT_MAX 28 | #define G_MININT INT_MIN 29 | #define G_MAXINT INT_MAX 30 | #define G_MAXUINT UINT_MAX 31 | #define G_MINLONG LONG_MIN 32 | #define G_MAXLONG LONG_MAX 33 | #define G_MAXULONG ULONG_MAX 34 | 35 | typedef signed char gint8; 36 | typedef unsigned char guint8; 37 | typedef signed short gint16; 38 | typedef unsigned short guint16; 39 | #define G_GINT16_MODIFIER "h" 40 | #define G_GINT16_FORMAT "hi" 41 | #define G_GUINT16_FORMAT "hu" 42 | typedef signed int gint32; 43 | typedef unsigned int guint32; 44 | #define G_GINT32_MODIFIER "" 45 | #define G_GINT32_FORMAT "i" 46 | #define G_GUINT32_FORMAT "u" 47 | #define G_HAVE_GINT64 1 /* deprecated, always true */ 48 | 49 | G_GNUC_EXTENSION typedef signed long long gint64; 50 | G_GNUC_EXTENSION typedef unsigned long long guint64; 51 | 52 | #define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL)) 53 | #define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL)) 54 | #define G_GINT64_MODIFIER "ll" 55 | #define G_GINT64_FORMAT "lli" 56 | #define G_GUINT64_FORMAT "llu" 57 | 58 | #if defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64) 59 | 60 | #define GLIB_SIZEOF_VOID_P 8 61 | #define GLIB_SIZEOF_LONG 4 62 | #define GLIB_SIZEOF_SIZE_T 8 63 | 64 | typedef signed long long gssize; 65 | typedef unsigned long long gsize; 66 | #define G_GSIZE_MODIFIER "ll" 67 | #define G_GSSIZE_FORMAT "lld" 68 | #define G_GSIZE_FORMAT "llu" 69 | 70 | #define G_MAXSIZE G_MAXUINT64 71 | #define G_MINSSIZE G_MININT64 72 | #define G_MAXSSIZE G_MAXINT64 73 | 74 | #else 75 | 76 | #define GLIB_SIZEOF_VOID_P 4 77 | #define GLIB_SIZEOF_LONG 4 78 | #define GLIB_SIZEOF_SIZE_T 4 79 | 80 | typedef signed int gssize; 81 | typedef unsigned int gsize; 82 | #define G_GSIZE_MODIFIER "" 83 | #define G_GSSIZE_FORMAT "i" 84 | #define G_GSIZE_FORMAT "u" 85 | 86 | #define G_MAXSIZE G_MAXUINT 87 | #define G_MINSSIZE G_MININT 88 | #define G_MAXSSIZE G_MAXINT 89 | 90 | #endif 91 | 92 | typedef gint64 goffset; 93 | #define G_MINOFFSET G_MININT64 94 | #define G_MAXOFFSET G_MAXINT64 95 | 96 | #define G_GOFFSET_MODIFIER G_GINT64_MODIFIER 97 | #define G_GOFFSET_FORMAT G_GINT64_FORMAT 98 | #define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val) 99 | 100 | 101 | #ifndef _WIN64 102 | 103 | #define GPOINTER_TO_INT(p) ((gint) (p)) 104 | #define GPOINTER_TO_UINT(p) ((guint) (p)) 105 | 106 | #define GINT_TO_POINTER(i) ((gpointer) (i)) 107 | #define GUINT_TO_POINTER(u) ((gpointer) (u)) 108 | 109 | typedef signed int gintptr; 110 | typedef unsigned int guintptr; 111 | 112 | #define G_GINTPTR_MODIFIER "" 113 | #define G_GINTPTR_FORMAT "i" 114 | #define G_GUINTPTR_FORMAT "u" 115 | 116 | #else 117 | 118 | #define GPOINTER_TO_INT(p) ((gint) (gint64) (p)) 119 | #define GPOINTER_TO_UINT(p) ((guint) (guint64) (p)) 120 | 121 | #define GINT_TO_POINTER(i) ((gpointer) (gint64) (i)) 122 | #define GUINT_TO_POINTER(u) ((gpointer) (guint64) (u)) 123 | 124 | #ifndef _MSC_VER 125 | typedef signed long long gintptr; 126 | typedef unsigned long long guintptr; 127 | #else 128 | typedef signed __int64 gintptr; 129 | typedef unsigned __int64 guintptr; 130 | #endif 131 | 132 | #define G_GINTPTR_MODIFIER "I64" 133 | #define G_GINTPTR_FORMAT "I64i" 134 | #define G_GUINTPTR_FORMAT "I64u" 135 | 136 | #endif 137 | 138 | #define g_ATEXIT(proc) (atexit (proc)) 139 | 140 | #define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END 141 | 142 | #define GLIB_MAJOR_VERSION 2 143 | #define GLIB_MINOR_VERSION 40 144 | #define GLIB_MICRO_VERSION 2 145 | 146 | #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 147 | 148 | #ifndef _MSC_VER 149 | #define G_VA_COPY va_copy 150 | #endif /* not _MSC_VER */ 151 | 152 | #ifdef __cplusplus 153 | #define G_HAVE_INLINE 1 154 | #else /* !__cplusplus */ 155 | #ifndef _MSC_VER 156 | #define G_HAVE_INLINE 1 157 | #endif /* _MSC_VER */ 158 | #define G_HAVE___INLINE 1 159 | #if !defined(_MSC_VER) && !defined(__DMC__) 160 | #define G_HAVE___INLINE__ 1 161 | #endif /* !_MSC_VER and !__DMC__ */ 162 | #endif /* !__cplusplus */ 163 | 164 | #define G_CAN_INLINE 1 165 | 166 | #ifndef _MSC_VER 167 | #define G_HAVE_ISO_VARARGS 1 168 | 169 | /* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi 170 | * is passed ISO vararg support is turned off, and there is no work 171 | * around to turn it on, so we unconditionally turn it off. 172 | */ 173 | #if __GNUC__ == 2 && __GNUC_MINOR__ == 95 174 | # undef G_HAVE_ISO_VARARGS 175 | #endif 176 | 177 | #define G_HAVE_GNUC_VARARGS 1 178 | #else /* _MSC_VER */ 179 | /* varargs macros available since msvc8 (vs2005) */ 180 | # if _MSC_VER >= 1400 181 | # define G_HAVE_ISO_VARARGS 1 182 | # endif 183 | #endif /* not _MSC_VER */ 184 | #define G_HAVE_GROWING_STACK 0 185 | 186 | #define G_GNUC_INTERNAL 187 | 188 | #define G_THREADS_ENABLED 189 | #define G_THREADS_IMPL_WIN32 190 | 191 | #define G_ATOMIC_LOCK_FREE 192 | 193 | #define GINT16_TO_LE(val) ((gint16) (val)) 194 | #define GUINT16_TO_LE(val) ((guint16) (val)) 195 | #define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val)) 196 | #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) 197 | #define GINT32_TO_LE(val) ((gint32) (val)) 198 | #define GUINT32_TO_LE(val) ((guint32) (val)) 199 | #define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val)) 200 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) 201 | #define GINT64_TO_LE(val) ((gint64) (val)) 202 | #define GUINT64_TO_LE(val) ((guint64) (val)) 203 | #define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val)) 204 | #define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val)) 205 | #define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val)) 206 | #define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val)) 207 | #define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val)) 208 | #define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val)) 209 | #define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val)) 210 | #define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val)) 211 | #define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val)) 212 | #define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val)) 213 | #define GSIZE_TO_LE(val) ((gsize) GUINT32_TO_LE (val)) 214 | #define GSSIZE_TO_LE(val) ((gssize) GINT32_TO_LE (val)) 215 | #define GSIZE_TO_BE(val) ((gsize) GUINT32_TO_BE (val)) 216 | #define GSSIZE_TO_BE(val) ((gssize) GINT32_TO_BE (val)) 217 | #define G_BYTE_ORDER G_LITTLE_ENDIAN 218 | 219 | #define GLIB_SYSDEF_POLLIN =1 220 | #define GLIB_SYSDEF_POLLOUT =4 221 | #define GLIB_SYSDEF_POLLPRI =2 222 | #define GLIB_SYSDEF_POLLHUP =16 223 | #define GLIB_SYSDEF_POLLERR =8 224 | #define GLIB_SYSDEF_POLLNVAL =32 225 | 226 | #define G_MODULE_SUFFIX "so" 227 | #define G_OS_UNIX android 228 | 229 | typedef int GPid; 230 | 231 | #define GLIB_SYSDEF_AF_UNIX 1 232 | #define GLIB_SYSDEF_AF_INET 2 233 | #define GLIB_SYSDEF_AF_INET6 23 234 | 235 | #define GLIB_SYSDEF_MSG_OOB 1 236 | #define GLIB_SYSDEF_MSG_PEEK 2 237 | #define GLIB_SYSDEF_MSG_DONTROUTE 4 238 | 239 | G_END_DECLS 240 | 241 | #endif /* GLIBCONFIG_H */ 242 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /clibs/gdk/gdkevents-android.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // Android->GDK events conversion code 14 | 15 | #include "config.h" 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #include "gdk.h" 23 | #include "gdkdisplayprivate.h" 24 | #include "gdkprivate-android.h" 25 | #include "gdkandroiddisplay.h" 26 | #include "gdkinput-android.h" 27 | 28 | static void (*gdk_android_stop)(void) = NULL; 29 | static ASensorEventQueue *sensorEventQueue = NULL; 30 | static const ASensor* accelerometerSensor = NULL; 31 | 32 | 33 | static gboolean gdk_android_event_prepare(GSource *source, gint *timeout) 34 | { 35 | gboolean retval; 36 | 37 | gdk_threads_enter(); 38 | 39 | retval = _gdk_event_queue_find_first(GDK_DISPLAY(_gdk_display)) != NULL; 40 | if (timeout) 41 | *timeout = 100; 42 | 43 | gdk_threads_leave(); 44 | 45 | return retval; 46 | } 47 | 48 | static gboolean gdk_android_event_check(GSource *source) 49 | { 50 | gboolean retval; 51 | struct android_app *app = _gdk_display->app; 52 | int astate = app->activityState; 53 | 54 | gdk_threads_enter(); 55 | 56 | retval = _gdk_event_queue_find_first(GDK_DISPLAY(_gdk_display)) != NULL; 57 | 58 | if (!retval && astate != APP_CMD_PAUSE && astate != APP_CMD_STOP) 59 | { 60 | int ident, events; 61 | struct android_poll_source *asource; 62 | // Read all pending events. 63 | while ((ident = ALooper_pollAll(0, NULL, &events, (void**) &asource)) >= 0) 64 | { 65 | // Process this event. 66 | if (asource != NULL) 67 | asource->process(app, asource); 68 | 69 | if (ident == LOOPER_ID_USER) 70 | { 71 | if (sensorEventQueue != NULL) 72 | { 73 | ASensorEvent event; 74 | while (ASensorEventQueue_getEvents(sensorEventQueue, &event, 1) > 0) 75 | { 76 | g_debug("sensor event received"); 77 | } 78 | } 79 | } 80 | 81 | if (app->destroyRequested != 0 && gdk_android_stop) 82 | { 83 | gdk_android_stop(); 84 | break; 85 | } 86 | } 87 | } 88 | 89 | gdk_threads_leave(); 90 | 91 | return retval; 92 | } 93 | 94 | static gboolean gdk_android_event_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) 95 | { 96 | GdkEvent *event; 97 | 98 | gdk_threads_enter(); 99 | 100 | event = _gdk_event_unqueue(GDK_DISPLAY(_gdk_display)); 101 | 102 | if (event) 103 | { 104 | _gdk_event_emit(event); 105 | gdk_event_free(event); 106 | } 107 | 108 | gdk_threads_leave(); 109 | 110 | return TRUE; 111 | } 112 | 113 | void gdk_android_events_init() 114 | { 115 | static GSourceFuncs event_funcs = { 116 | gdk_android_event_prepare, 117 | gdk_android_event_check, 118 | gdk_android_event_dispatch, 119 | NULL 120 | }; 121 | 122 | GSource *source = g_source_new(&event_funcs, sizeof(GSource)); 123 | g_source_set_name(source, "Android ALooper event source"); 124 | g_source_set_priority(source, GDK_PRIORITY_EVENTS); 125 | g_source_set_can_recurse(source, TRUE); 126 | g_source_attach(source, NULL); 127 | } 128 | 129 | gboolean _gdk_android_display_has_pending(GdkDisplay *display) 130 | { 131 | g_debug("_gdk_android_display_has_pending is called"); 132 | return _gdk_event_queue_find_first(display) != NULL; 133 | } 134 | 135 | void _gdk_android_display_queue_events(GdkDisplay *display) 136 | { 137 | int ident; 138 | int events; 139 | struct android_poll_source* source; 140 | struct android_app *state = GDK_ANDROID_DISPLAY(display)->app; 141 | // Read all pending events. 142 | while ((ident = ALooper_pollAll(0, NULL, &events, (void**) &source)) >= 0) 143 | { 144 | // Process this event. 145 | if (source != NULL) 146 | source->process(state, source); 147 | 148 | // Check if we are exiting. 149 | if (state->destroyRequested != 0) 150 | { 151 | gdk_android_term_display(); 152 | return; 153 | } 154 | } 155 | } 156 | 157 | void gdk_android_handle_glue_cmd(struct android_app* app, int32_t cmd) 158 | { 159 | GError *err = NULL; 160 | //GTKAndroidInitPhase *engine = (GTKAndroidInitPhase *) app->userData; 161 | switch (cmd) 162 | { 163 | case APP_CMD_SAVE_STATE: 164 | // The system has asked us to save our current state. Do so. 165 | app->savedState = NULL; 166 | app->savedStateSize = 0; 167 | break; 168 | case APP_CMD_INIT_WINDOW: 169 | // The window is being shown, get it ready. 170 | if (app->window != NULL && !gdk_android_init_display(app, &err)) 171 | { 172 | g_error("%s", err->message); 173 | g_error_free(err); 174 | } 175 | break; 176 | case APP_CMD_TERM_WINDOW: 177 | if (gdk_android_stop) 178 | gdk_android_stop(); 179 | break; 180 | case APP_CMD_PAUSE: 181 | case APP_CMD_STOP: 182 | if (gdk_android_stop) 183 | gdk_android_stop(); 184 | break; 185 | case APP_CMD_GAINED_FOCUS: 186 | // When our app gains focus, we start monitoring the accelerometer. 187 | if (accelerometerSensor != NULL) 188 | { 189 | ASensorEventQueue_enableSensor(sensorEventQueue, accelerometerSensor); 190 | ASensorEventQueue_setEventRate(sensorEventQueue, accelerometerSensor, 0.5); 191 | } 192 | break; 193 | case APP_CMD_LOST_FOCUS: 194 | // When our app loses focus, we stop monitoring the accelerometer. 195 | // This is to avoid consuming battery while not being used. 196 | if (accelerometerSensor != NULL) 197 | ASensorEventQueue_disableSensor(sensorEventQueue, accelerometerSensor); 198 | break; 199 | 200 | } 201 | } 202 | 203 | static void onLowMemory(ANativeActivity* activity) { 204 | struct android_app* android_app = (struct android_app*)activity->instance; 205 | g_info("LowMemory: %p\n", activity); 206 | //android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY); 207 | } 208 | 209 | static void onNativeWindowResized(ANativeActivity* activity, ANativeWindow* window) { 210 | g_info("NativeWindowResized: %p -- %p\n", activity, window); 211 | //android_app_write_cmd((struct android_app*)activity->instance, APP_CMD_WINDOW_RESIZED); 212 | } 213 | 214 | static void onNativeWindowRedrawNeeded(ANativeActivity* activity, ANativeWindow* window) { 215 | g_info("NativeWindowRedrawNeeded: %p -- %p\n", activity, window); 216 | //android_app_wait_redraw((struct android_app*)activity->instance); 217 | } 218 | 219 | static void onContentRectChanged(ANativeActivity* activity, const ARect* rect) { 220 | g_info("ContentRectChanged: %p -- (%d,%d)-(%d,%d)\n", activity, rect->left, 221 | rect->top, rect->right, rect->bottom); 222 | ((struct android_app*)activity->instance)->contentRect = *rect; 223 | } 224 | 225 | void gdk_android_setup_app_callbacks(struct android_app *state, void (*onStop)()) 226 | { 227 | if (0) 228 | { 229 | ASensorManager* sensorManager = NULL; 230 | 231 | sensorManager = ASensorManager_getInstance(); 232 | accelerometerSensor = ASensorManager_getDefaultSensor(sensorManager, 233 | ASENSOR_TYPE_ACCELEROMETER); 234 | sensorEventQueue = ASensorManager_createEventQueue(sensorManager, state->looper, 235 | LOOPER_ID_USER, NULL, NULL); 236 | } 237 | 238 | gdk_android_stop = onStop; 239 | 240 | state->onAppCmd = gdk_android_handle_glue_cmd; 241 | state->activity->callbacks->onNativeWindowResized = onNativeWindowResized; 242 | state->activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded; 243 | state->activity->callbacks->onContentRectChanged = onContentRectChanged; 244 | state->activity->callbacks->onLowMemory = onLowMemory; 245 | // TODO: consider overriding state->inputPollSource.process instead of the following 246 | // or should we even get rid of this native_app for good? 247 | state->onInputEvent = android_handle_input; 248 | } 249 | 250 | gboolean gdk_android_process_events_until_display_ready(struct android_app *app) 251 | { 252 | int ident; 253 | int events; 254 | struct android_poll_source* source; 255 | while (1) 256 | { 257 | // Read all pending events. 258 | while ((ident = ALooper_pollAll(0, NULL, &events, (void**)&source)) >= 0) 259 | { 260 | // Process this event. 261 | if (source != NULL) 262 | source->process(app, source); 263 | 264 | // Check if we are exiting. 265 | if (app->destroyRequested != 0) 266 | { 267 | gdk_android_term_display(); 268 | return FALSE; 269 | } 270 | 271 | if (_gdk_display) 272 | return TRUE; 273 | } 274 | } 275 | } 276 | 277 | GdkKeymap *_gdk_android_display_get_keymap(GdkDisplay *display) 278 | { 279 | g_debug("_gdk_android_display_get_keymap is called"); 280 | return NULL; 281 | } 282 | 283 | gboolean _gdk_android_window_simulate_key(GdkWindow *window, 284 | gint x, 285 | gint y, 286 | guint keyval, 287 | GdkModifierType modifiers, 288 | GdkEventType key_pressrelease) 289 | { 290 | return FALSE; 291 | } 292 | 293 | gboolean _gdk_android_window_simulate_button(GdkWindow *window, 294 | gint x, 295 | gint y, 296 | guint button, // 1..3 297 | GdkModifierType modifiers, 298 | GdkEventType button_pressrelease) 299 | { 300 | return FALSE; 301 | } 302 | -------------------------------------------------------------------------------- /clibs/atk/atk/atkmarshal.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | #ifdef G_ENABLE_DEBUG 6 | #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) 7 | #define g_marshal_value_peek_char(v) g_value_get_schar (v) 8 | #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) 9 | #define g_marshal_value_peek_int(v) g_value_get_int (v) 10 | #define g_marshal_value_peek_uint(v) g_value_get_uint (v) 11 | #define g_marshal_value_peek_long(v) g_value_get_long (v) 12 | #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) 13 | #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) 14 | #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) 15 | #define g_marshal_value_peek_enum(v) g_value_get_enum (v) 16 | #define g_marshal_value_peek_flags(v) g_value_get_flags (v) 17 | #define g_marshal_value_peek_float(v) g_value_get_float (v) 18 | #define g_marshal_value_peek_double(v) g_value_get_double (v) 19 | #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) 20 | #define g_marshal_value_peek_param(v) g_value_get_param (v) 21 | #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) 22 | #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) 23 | #define g_marshal_value_peek_object(v) g_value_get_object (v) 24 | #define g_marshal_value_peek_variant(v) g_value_get_variant (v) 25 | #else /* !G_ENABLE_DEBUG */ 26 | /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. 27 | * Do not access GValues directly in your code. Instead, use the 28 | * g_value_get_*() functions 29 | */ 30 | #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int 31 | #define g_marshal_value_peek_char(v) (v)->data[0].v_int 32 | #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint 33 | #define g_marshal_value_peek_int(v) (v)->data[0].v_int 34 | #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint 35 | #define g_marshal_value_peek_long(v) (v)->data[0].v_long 36 | #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong 37 | #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 38 | #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 39 | #define g_marshal_value_peek_enum(v) (v)->data[0].v_long 40 | #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong 41 | #define g_marshal_value_peek_float(v) (v)->data[0].v_float 42 | #define g_marshal_value_peek_double(v) (v)->data[0].v_double 43 | #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer 44 | #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer 45 | #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer 46 | #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer 47 | #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer 48 | #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer 49 | #endif /* !G_ENABLE_DEBUG */ 50 | 51 | 52 | /* VOID:INT,INT (./atkmarshal.list:25) */ 53 | void 54 | atk_marshal_VOID__INT_INT (GClosure *closure, 55 | GValue *return_value G_GNUC_UNUSED, 56 | guint n_param_values, 57 | const GValue *param_values, 58 | gpointer invocation_hint G_GNUC_UNUSED, 59 | gpointer marshal_data) 60 | { 61 | typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, 62 | gint arg_1, 63 | gint arg_2, 64 | gpointer data2); 65 | register GMarshalFunc_VOID__INT_INT callback; 66 | register GCClosure *cc = (GCClosure*) closure; 67 | register gpointer data1, data2; 68 | 69 | g_return_if_fail (n_param_values == 3); 70 | 71 | if (G_CCLOSURE_SWAP_DATA (closure)) 72 | { 73 | data1 = closure->data; 74 | data2 = g_value_peek_pointer (param_values + 0); 75 | } 76 | else 77 | { 78 | data1 = g_value_peek_pointer (param_values + 0); 79 | data2 = closure->data; 80 | } 81 | callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback); 82 | 83 | callback (data1, 84 | g_marshal_value_peek_int (param_values + 1), 85 | g_marshal_value_peek_int (param_values + 2), 86 | data2); 87 | } 88 | 89 | /* VOID:INT,INT,STRING (./atkmarshal.list:26) */ 90 | void 91 | atk_marshal_VOID__INT_INT_STRING (GClosure *closure, 92 | GValue *return_value G_GNUC_UNUSED, 93 | guint n_param_values, 94 | const GValue *param_values, 95 | gpointer invocation_hint G_GNUC_UNUSED, 96 | gpointer marshal_data) 97 | { 98 | typedef void (*GMarshalFunc_VOID__INT_INT_STRING) (gpointer data1, 99 | gint arg_1, 100 | gint arg_2, 101 | gpointer arg_3, 102 | gpointer data2); 103 | register GMarshalFunc_VOID__INT_INT_STRING callback; 104 | register GCClosure *cc = (GCClosure*) closure; 105 | register gpointer data1, data2; 106 | 107 | g_return_if_fail (n_param_values == 4); 108 | 109 | if (G_CCLOSURE_SWAP_DATA (closure)) 110 | { 111 | data1 = closure->data; 112 | data2 = g_value_peek_pointer (param_values + 0); 113 | } 114 | else 115 | { 116 | data1 = g_value_peek_pointer (param_values + 0); 117 | data2 = closure->data; 118 | } 119 | callback = (GMarshalFunc_VOID__INT_INT_STRING) (marshal_data ? marshal_data : cc->callback); 120 | 121 | callback (data1, 122 | g_marshal_value_peek_int (param_values + 1), 123 | g_marshal_value_peek_int (param_values + 2), 124 | g_marshal_value_peek_string (param_values + 3), 125 | data2); 126 | } 127 | 128 | /* VOID:INT,INT,INT,STRING (./atkmarshal.list:27) */ 129 | void 130 | atk_marshal_VOID__INT_INT_INT_STRING (GClosure *closure, 131 | GValue *return_value G_GNUC_UNUSED, 132 | guint n_param_values, 133 | const GValue *param_values, 134 | gpointer invocation_hint G_GNUC_UNUSED, 135 | gpointer marshal_data) 136 | { 137 | typedef void (*GMarshalFunc_VOID__INT_INT_INT_STRING) (gpointer data1, 138 | gint arg_1, 139 | gint arg_2, 140 | gint arg_3, 141 | gpointer arg_4, 142 | gpointer data2); 143 | register GMarshalFunc_VOID__INT_INT_INT_STRING callback; 144 | register GCClosure *cc = (GCClosure*) closure; 145 | register gpointer data1, data2; 146 | 147 | g_return_if_fail (n_param_values == 5); 148 | 149 | if (G_CCLOSURE_SWAP_DATA (closure)) 150 | { 151 | data1 = closure->data; 152 | data2 = g_value_peek_pointer (param_values + 0); 153 | } 154 | else 155 | { 156 | data1 = g_value_peek_pointer (param_values + 0); 157 | data2 = closure->data; 158 | } 159 | callback = (GMarshalFunc_VOID__INT_INT_INT_STRING) (marshal_data ? marshal_data : cc->callback); 160 | 161 | callback (data1, 162 | g_marshal_value_peek_int (param_values + 1), 163 | g_marshal_value_peek_int (param_values + 2), 164 | g_marshal_value_peek_int (param_values + 3), 165 | g_marshal_value_peek_string (param_values + 4), 166 | data2); 167 | } 168 | 169 | /* VOID:STRING,BOOLEAN (./atkmarshal.list:28) */ 170 | void 171 | atk_marshal_VOID__STRING_BOOLEAN (GClosure *closure, 172 | GValue *return_value G_GNUC_UNUSED, 173 | guint n_param_values, 174 | const GValue *param_values, 175 | gpointer invocation_hint G_GNUC_UNUSED, 176 | gpointer marshal_data) 177 | { 178 | typedef void (*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer data1, 179 | gpointer arg_1, 180 | gboolean arg_2, 181 | gpointer data2); 182 | register GMarshalFunc_VOID__STRING_BOOLEAN callback; 183 | register GCClosure *cc = (GCClosure*) closure; 184 | register gpointer data1, data2; 185 | 186 | g_return_if_fail (n_param_values == 3); 187 | 188 | if (G_CCLOSURE_SWAP_DATA (closure)) 189 | { 190 | data1 = closure->data; 191 | data2 = g_value_peek_pointer (param_values + 0); 192 | } 193 | else 194 | { 195 | data1 = g_value_peek_pointer (param_values + 0); 196 | data2 = closure->data; 197 | } 198 | callback = (GMarshalFunc_VOID__STRING_BOOLEAN) (marshal_data ? marshal_data : cc->callback); 199 | 200 | callback (data1, 201 | g_marshal_value_peek_string (param_values + 1), 202 | g_marshal_value_peek_boolean (param_values + 2), 203 | data2); 204 | } 205 | 206 | /* VOID:DOUBLE,STRING (./atkmarshal.list:29) */ 207 | void 208 | atk_marshal_VOID__DOUBLE_STRING (GClosure *closure, 209 | GValue *return_value G_GNUC_UNUSED, 210 | guint n_param_values, 211 | const GValue *param_values, 212 | gpointer invocation_hint G_GNUC_UNUSED, 213 | gpointer marshal_data) 214 | { 215 | typedef void (*GMarshalFunc_VOID__DOUBLE_STRING) (gpointer data1, 216 | gdouble arg_1, 217 | gpointer arg_2, 218 | gpointer data2); 219 | register GMarshalFunc_VOID__DOUBLE_STRING callback; 220 | register GCClosure *cc = (GCClosure*) closure; 221 | register gpointer data1, data2; 222 | 223 | g_return_if_fail (n_param_values == 3); 224 | 225 | if (G_CCLOSURE_SWAP_DATA (closure)) 226 | { 227 | data1 = closure->data; 228 | data2 = g_value_peek_pointer (param_values + 0); 229 | } 230 | else 231 | { 232 | data1 = g_value_peek_pointer (param_values + 0); 233 | data2 = closure->data; 234 | } 235 | callback = (GMarshalFunc_VOID__DOUBLE_STRING) (marshal_data ? marshal_data : cc->callback); 236 | 237 | callback (data1, 238 | g_marshal_value_peek_double (param_values + 1), 239 | g_marshal_value_peek_string (param_values + 2), 240 | data2); 241 | } 242 | 243 | -------------------------------------------------------------------------------- /clibs/fontconfig/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* The normal alignment of `double', in bytes. */ 8 | //#define ALIGNOF_DOUBLE alignof(double) 9 | 10 | /* Use libxml2 instead of Expat */ 11 | /* #undef ENABLE_LIBXML2 */ 12 | 13 | /* Additional font directories */ 14 | // #define FC_ADD_FONTS "yes" 15 | 16 | /* Architecture prefix to use for cache file names */ 17 | /* #undef FC_ARCHITECTURE */ 18 | 19 | /* System font directory */ 20 | #define FC_DEFAULT_FONTS "/system/fonts" 21 | 22 | #define FONTCONFIG_PATH "not/supposed/to/work" 23 | 24 | #define FC_CACHEDIR "/should/be/defined/by/GdkAndroidDisplay" 25 | 26 | /* Define to nothing if C supports flexible array members, and to 1 if it does 27 | not. That way, with a declaration like `struct s { int n; double 28 | d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 29 | compilers. When computing the size of such an object, don't use 'sizeof 30 | (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' 31 | instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with 32 | MSVC and with C++ compilers. */ 33 | #define FLEXIBLE_ARRAY_MEMBER /**/ 34 | 35 | /* Define to 1 if you have the header file, and it defines `DIR'. 36 | */ 37 | #define HAVE_DIRENT_H 1 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #define HAVE_DLFCN_H 1 41 | 42 | /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ 43 | /* #undef HAVE_DOPRNT */ 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #define HAVE_FCNTL_H 1 47 | 48 | /* Define to 1 if you have the `fstatfs' function. */ 49 | #define HAVE_FSTATFS 1 50 | 51 | /* Define to 1 if you have the `fstatvfs' function. */ 52 | #define HAVE_FSTATVFS 1 53 | 54 | /* FT_Bitmap_Size structure includes y_ppem field */ 55 | #define HAVE_FT_BITMAP_SIZE_Y_PPEM 1 56 | 57 | /* Define to 1 if you have the `FT_Get_BDF_Property' function. */ 58 | #define HAVE_FT_GET_BDF_PROPERTY 1 59 | 60 | /* Define to 1 if you have the `FT_Get_Next_Char' function. */ 61 | #define HAVE_FT_GET_NEXT_CHAR 1 62 | 63 | /* Define to 1 if you have the `FT_Get_PS_Font_Info' function. */ 64 | #define HAVE_FT_GET_PS_FONT_INFO 1 65 | 66 | /* Define to 1 if you have the `FT_Get_X11_Font_Format' function. */ 67 | //#define HAVE_FT_GET_X11_FONT_FORMAT 1 68 | 69 | /* Define to 1 if you have the `FT_Has_PS_Glyph_Names' function. */ 70 | //#define HAVE_FT_HAS_PS_GLYPH_NAMES 1 71 | 72 | /* Define to 1 if you have the `FT_Select_Size' function. */ 73 | #define HAVE_FT_SELECT_SIZE 1 74 | 75 | /* Define to 1 if you have the `getexecname' function. */ 76 | /* #undef HAVE_GETEXECNAME */ 77 | 78 | /* Define to 1 if you have the `getopt' function. */ 79 | #define HAVE_GETOPT 1 80 | 81 | /* Define to 1 if you have the `getopt_long' function. */ 82 | #define HAVE_GETOPT_LONG 1 83 | 84 | /* Define to 1 if you have the `getpagesize' function. */ 85 | #define HAVE_GETPAGESIZE 1 86 | 87 | /* Define to 1 if you have the `getprogname' function. */ 88 | /* #undef HAVE_GETPROGNAME */ 89 | 90 | /* Have Intel __sync_* atomic primitives */ 91 | #define HAVE_INTEL_ATOMIC_PRIMITIVES 1 92 | 93 | /* Define to 1 if you have the header file. */ 94 | #define HAVE_INTTYPES_H 1 95 | 96 | /* Define to 1 if you have the `link' function. */ 97 | #define HAVE_LINK 1 98 | 99 | /* Define to 1 if you have the `lrand48' function. */ 100 | #define HAVE_LRAND48 1 101 | 102 | /* Define to 1 if you have the `lstat' function. */ 103 | #define HAVE_LSTAT 1 104 | 105 | /* Define to 1 if you have the header file. */ 106 | #define HAVE_MEMORY_H 1 107 | 108 | /* Define to 1 if you have the `mkdtemp' function. */ 109 | #define HAVE_MKDTEMP 1 110 | 111 | /* Define to 1 if you have the `mkostemp' function. */ 112 | #define HAVE_MKOSTEMP 0 113 | 114 | /* Define to 1 if you have the `mkstemp' function. */ 115 | #define HAVE_MKSTEMP 1 116 | 117 | /* Define to 1 if you have a working `mmap' system call. */ 118 | /* #undef HAVE_MMAP */ 119 | 120 | /* Define to 1 if you have the header file, and it defines `DIR'. */ 121 | /* #undef HAVE_NDIR_H */ 122 | 123 | /* Define to 1 if you have the 'posix_fadivse' function. */ 124 | #define HAVE_POSIX_FADVISE 1 125 | 126 | /* Have POSIX threads */ 127 | #define HAVE_PTHREAD 1 128 | 129 | /* Have PTHREAD_PRIO_INHERIT. */ 130 | #define HAVE_PTHREAD_PRIO_INHERIT 1 131 | 132 | /* Define to 1 if you have the `rand' function. */ 133 | #define HAVE_RAND 1 134 | 135 | /* Define to 1 if you have the `random' function. */ 136 | /*#define HAVE_RANDOM 0 */ 137 | 138 | /* Define to 1 if you have the `random_r' function. */ 139 | /* #define HAVE_RANDOM_R 0 */ 140 | 141 | /* Define to 1 if you have the `rand_r' function. */ 142 | #define HAVE_RAND_R 1 143 | 144 | /* Define to 1 if you have the `readlink' function. */ 145 | #define HAVE_READLINK 1 146 | 147 | /* Define to 1 if you have the `regcomp' function. */ 148 | #define HAVE_REGCOMP 1 149 | 150 | /* Define to 1 if you have the `regerror' function. */ 151 | #define HAVE_REGERROR 1 152 | 153 | /* Define to 1 if you have the `regexec' function. */ 154 | #define HAVE_REGEXEC 1 155 | 156 | /* Define to 1 if you have the header file. */ 157 | #define HAVE_REGEX_H 1 158 | 159 | /* Define to 1 if you have the `regfree' function. */ 160 | #define HAVE_REGFREE 1 161 | 162 | /* Define to 1 if you have the 'scandir' function. */ 163 | #define HAVE_SCANDIR 1 164 | 165 | /* Define to 1 if you have the 'scandir' function with int (* compar)(const 166 | void *, const void *) */ 167 | /* #undef HAVE_SCANDIR_VOID_P */ 168 | 169 | /* Define to 1 if you have the header file. */ 170 | /* #undef HAVE_SCHED_H */ 171 | 172 | /* Have sched_yield */ 173 | /* #undef HAVE_SCHED_YIELD */ 174 | 175 | /* Have Solaris __machine_*_barrier and atomic_* operations */ 176 | /* #undef HAVE_SOLARIS_ATOMIC_OPS */ 177 | 178 | /* Define to 1 if you have the header file. */ 179 | #define HAVE_STDINT_H 1 180 | 181 | /* Define to 1 if you have the header file. */ 182 | #define HAVE_STDLIB_H 1 183 | 184 | /* Define to 1 if you have the header file. */ 185 | #define HAVE_STRINGS_H 1 186 | 187 | /* Define to 1 if you have the header file. */ 188 | #define HAVE_STRING_H 1 189 | 190 | /* Define to 1 if `d_type' is a member of `struct dirent'. */ 191 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 192 | 193 | /* Define to 1 if `f_flags' is a member of `struct statfs'. */ 194 | #define HAVE_STRUCT_STATFS_F_FLAGS 1 195 | 196 | /* Define to 1 if `f_fstypename' is a member of `struct statfs'. */ 197 | /* #undef HAVE_STRUCT_STATFS_F_FSTYPENAME */ 198 | 199 | /* Define to 1 if `f_basetype' is a member of `struct statvfs'. */ 200 | /* #undef HAVE_STRUCT_STATVFS_F_BASETYPE */ 201 | 202 | /* Define to 1 if `f_fstypename' is a member of `struct statvfs'. */ 203 | /* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */ 204 | 205 | /* Define to 1 if you have the header file, and it defines `DIR'. 206 | */ 207 | /* #undef HAVE_SYS_DIR_H */ 208 | 209 | /* Define to 1 if you have the header file. */ 210 | #define HAVE_SYS_MOUNT_H 1 211 | 212 | /* Define to 1 if you have the header file, and it defines `DIR'. 213 | */ 214 | /* #undef HAVE_SYS_NDIR_H */ 215 | 216 | /* Define to 1 if you have the header file. */ 217 | #define HAVE_SYS_PARAM_H 1 218 | 219 | /* Define to 1 if you have the header file. */ 220 | #define HAVE_SYS_STATFS_H 1 221 | 222 | /* Define to 1 if you have the header file. */ 223 | /* #define HAVE_SYS_STATVFS_H 0 */ 224 | 225 | /* Define to 1 if you have the header file. */ 226 | #define HAVE_SYS_STAT_H 1 227 | 228 | /* Define to 1 if you have the header file. */ 229 | #define HAVE_SYS_TYPES_H 1 230 | 231 | /* Define to 1 if you have the header file. */ 232 | #define HAVE_SYS_VFS_H 1 233 | 234 | /* Define to 1 if you have the header file. */ 235 | #define HAVE_UNISTD_H 1 236 | 237 | /* Define to 1 if you have the `vprintf' function. */ 238 | #define HAVE_VPRINTF 1 239 | 240 | /* Can use #warning in C files */ 241 | #define HAVE_WARNING_CPP_DIRECTIVE 1 242 | 243 | /* Use xmlparse.h instead of expat.h */ 244 | /* #undef HAVE_XMLPARSE_H */ 245 | 246 | /* Define to 1 if you have the `XML_SetDoctypeDeclHandler' function. */ 247 | #define HAVE_XML_SETDOCTYPEDECLHANDLER 1 248 | 249 | /* Define to 1 if you have the `_mktemp_s' function. */ 250 | /* #undef HAVE__MKTEMP_S */ 251 | 252 | /* Name of package */ 253 | #define PACKAGE "fontconfig" 254 | 255 | /* Define to the address where bug reports for this package should be sent. */ 256 | #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig" 257 | 258 | /* Define to the full name of this package. */ 259 | #define PACKAGE_NAME "fontconfig" 260 | 261 | /* Define to the full name and version of this package. */ 262 | #define PACKAGE_STRING "fontconfig 2.11.1" 263 | 264 | /* Define to the one symbol short name of this package. */ 265 | #define PACKAGE_TARNAME "fontconfig" 266 | 267 | /* Define to the home page for this package. */ 268 | #define PACKAGE_URL "" 269 | 270 | /* Define to the version of this package. */ 271 | #define PACKAGE_VERSION "2.11.1" 272 | 273 | /* Define to necessary symbol if this constant uses a non-standard name on 274 | your system. */ 275 | /* #undef PTHREAD_CREATE_JOINABLE */ 276 | 277 | /* The size of `char', as computed by sizeof. */ 278 | #define SIZEOF_CHAR (sizeof(char)) 279 | 280 | /* The size of `int', as computed by sizeof. */ 281 | #define SIZEOF_INT (sizeof(int)) 282 | 283 | /* The size of `long', as computed by sizeof. */ 284 | #define SIZEOF_LONG (sizeof(long)) 285 | 286 | /* The size of `short', as computed by sizeof. */ 287 | #define SIZEOF_SHORT (sizeof(short)) 288 | 289 | /* The size of `void*', as computed by sizeof. */ 290 | #define SIZEOF_VOIDP (sizeof(void *)) 291 | 292 | /* Define to 1 if you have the ANSI C header files. */ 293 | #define STDC_HEADERS 1 294 | 295 | /* Use iconv. */ 296 | #define USE_ICONV 1 297 | 298 | /* Use regex */ 299 | #define USE_REGEX /**/ 300 | 301 | /* Enable extensions on AIX 3, Interix. */ 302 | #ifndef _ALL_SOURCE 303 | # define _ALL_SOURCE 1 304 | #endif 305 | /* Enable GNU extensions on systems that have them. */ 306 | #ifndef _GNU_SOURCE 307 | # define _GNU_SOURCE 1 308 | #endif 309 | /* Enable threading extensions on Solaris. */ 310 | #ifndef _POSIX_PTHREAD_SEMANTICS 311 | # define _POSIX_PTHREAD_SEMANTICS 1 312 | #endif 313 | /* Enable extensions on HP NonStop. */ 314 | #ifndef _TANDEM_SOURCE 315 | # define _TANDEM_SOURCE 1 316 | #endif 317 | /* Enable general extensions on Solaris. */ 318 | #ifndef __EXTENSIONS__ 319 | # define __EXTENSIONS__ 1 320 | #endif 321 | 322 | 323 | /* Version number of package */ 324 | #define VERSION "2.11.1" 325 | 326 | 327 | /* Number of bits in a file offset, on hosts where this is settable. */ 328 | /* #undef _FILE_OFFSET_BITS */ 329 | 330 | /* Define for large files, on AIX-style hosts. */ 331 | /* #undef _LARGE_FILES */ 332 | 333 | /* Define to 1 if on MINIX. */ 334 | /* #undef _MINIX */ 335 | 336 | /* Define to 2 if the system does not provide POSIX.1 features except with 337 | this defined. */ 338 | /* #undef _POSIX_1_SOURCE */ 339 | 340 | /* Define to 1 if you need to in order for `stat' and other things to work. */ 341 | /* #undef _POSIX_SOURCE */ 342 | 343 | /* Define to empty if `const' does not conform to ANSI C. */ 344 | /* #undef const */ 345 | 346 | /* Define to `__inline__' or `__inline' if that's what the C compiler 347 | calls it, or to nothing if 'inline' is not supported under any name. */ 348 | #ifndef __cplusplus 349 | /* #undef inline */ 350 | #endif 351 | 352 | #include 353 | #ifdef __LP64__ 354 | # define SIZEOF_VOID_P 8 355 | # define ALIGNOF_DOUBLE 8 356 | #else 357 | # define SIZEOF_VOID_P 4 358 | # define ALIGNOF_DOUBLE 4 359 | # endif 360 | -------------------------------------------------------------------------------- /clibs/gdk/gdkscreen-android.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The GTK+Android Developers. See the COPYRIGHT 2 | // file at the top-level directory of this distribution and at 3 | // https://github.com/eugals/GTKAndroid/wiki/COPYRIGHT. 4 | // 5 | // Licensed under the Apache License, Version 2.0 or the MIT license 7 | // , at your 8 | // option. This file may not be copied, modified, or distributed 9 | // except according to those terms. 10 | // 11 | // Author(s): Evgeny Sologubov 12 | // 13 | // ANativeWindow-based GDK visual and screen definitions 14 | 15 | #include "config.h" 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | #include "gdk.h" 26 | #include "gdkvisualprivate.h" 27 | #include "gdkprivate-android.h" 28 | #include "gdkandroiddisplay.h" 29 | #include "gdkandroidscreen.h" 30 | #include "gdkwindow-android.h" 31 | 32 | 33 | enum { COLOR_DEPTH = 32 }; 34 | 35 | /////////////////////////////////////////////////////////////////////////////////////// 36 | // Visual 37 | 38 | static gint _gdk_android_screen_visual_get_best_depth(GdkScreen *screen) 39 | { 40 | return COLOR_DEPTH; 41 | } 42 | 43 | static void _gdk_android_screen_query_depths(GdkScreen *screen, 44 | gint **depths, 45 | gint *count) 46 | { 47 | static gint static_depths[] = { COLOR_DEPTH }; 48 | 49 | *count = G_N_ELEMENTS(static_depths); 50 | *depths = static_depths; 51 | } 52 | 53 | static GdkVisualType _gdk_android_screen_visual_get_best_type(GdkScreen *screen) 54 | { 55 | return GDK_VISUAL_TRUE_COLOR; 56 | } 57 | 58 | static void _gdk_android_screen_query_visual_types(GdkScreen *screen, 59 | GdkVisualType **visual_types, 60 | gint *count) 61 | { 62 | static GdkVisualType static_visual_types[] = { GDK_VISUAL_TRUE_COLOR }; 63 | 64 | *count = G_N_ELEMENTS(static_visual_types); 65 | *visual_types = static_visual_types; 66 | } 67 | 68 | static GdkVisual *_gdk_android_screen_visual_get_best(GdkScreen *screen) 69 | { 70 | return GDK_ANDROID_SCREEN(screen)->visual; 71 | } 72 | 73 | static GdkVisual *_gdk_android_screen_visual_get_best_with_depth(GdkScreen *screen, 74 | gint depth) 75 | { 76 | return GDK_ANDROID_SCREEN(screen)->visual; 77 | } 78 | 79 | static GdkVisual *_gdk_android_screen_visual_get_best_with_type(GdkScreen *screen, 80 | GdkVisualType visual_type) 81 | { 82 | return GDK_ANDROID_SCREEN(screen)->visual; 83 | } 84 | 85 | static GdkVisual *_gdk_android_screen_visual_get_best_with_both(GdkScreen *screen, 86 | gint depth, 87 | GdkVisualType visual_type) 88 | { 89 | return GDK_ANDROID_SCREEN(screen)->visual; 90 | } 91 | 92 | #define _gdk_android_screen_get_system_visual _gdk_android_screen_visual_get_best 93 | 94 | static GList *_gdk_android_screen_list_visuals(GdkScreen *screen) 95 | { 96 | return g_list_append(NULL, GDK_ANDROID_SCREEN(screen)->visual); 97 | } 98 | 99 | static GdkVisual *gdk_android_visual_new(GdkAndroidScreen *screen) 100 | { 101 | GdkVisual *visual = g_object_new(GDK_TYPE_VISUAL, NULL); 102 | visual->screen = &screen->screen; 103 | visual->type = _gdk_android_screen_visual_get_best_type(visual->screen); 104 | visual->depth = _gdk_android_screen_visual_get_best_depth(visual->screen); 105 | 106 | return visual; 107 | } 108 | 109 | /////////////////////////////////////////////////////////////////////////////////////// 110 | // Screen 111 | 112 | struct GdkAndroidScreenClass 113 | { 114 | GdkScreenClass parent_class; 115 | }; 116 | 117 | G_DEFINE_TYPE(GdkAndroidScreen, gdk_android_screen, GDK_TYPE_SCREEN) 118 | 119 | static void gdk_android_screen_init(GdkAndroidScreen *display) 120 | { 121 | } 122 | 123 | static GdkDisplay *gdk_android_screen_get_display(GdkScreen *screen) 124 | { 125 | return &_gdk_display->display; 126 | } 127 | 128 | static gint gdk_android_screen_get_width(GdkScreen *screen) 129 | { 130 | gint rv; 131 | eglQuerySurface(_gdk_display->eglDisplay, _gdk_display->eglSurface, EGL_WIDTH, &rv); 132 | return rv; 133 | } 134 | 135 | static gint gdk_android_screen_get_height(GdkScreen *screen) 136 | { 137 | gint rv; 138 | eglQuerySurface(_gdk_display->eglDisplay, _gdk_display->eglSurface, EGL_HEIGHT, &rv); 139 | return rv; 140 | } 141 | 142 | #define JNI_ASSERT(jni) if (jni->ExceptionCheck(pjni)) \ 143 | { \ 144 | g_set_error(error, GDK_ANDROID_ERROR, GDK_ANDROID_ERROR_INIT, \ 145 | "JNI exception at %s:%u", __FILE__, __LINE__); \ 146 | return FALSE; \ 147 | } 148 | 149 | gboolean gdk_android_init_screen(GdkAndroidScreen *scr, ANativeActivity *act, GError **error) 150 | { 151 | scr->visual = gdk_android_visual_new(scr); 152 | scr->root_window = _gdk_windowing_window_init(&scr->screen); 153 | return TRUE; 154 | } 155 | 156 | GdkWindow *_gdk_android_root(void) 157 | { 158 | if (!_gdk_screen) 159 | return NULL; 160 | return _gdk_screen->root_window; 161 | } 162 | 163 | static gint gdk_android_screen_get_width_mm(GdkScreen *screen) 164 | { 165 | g_debug("width: %gmm", (double) gdk_screen_get_width(screen) / _gdk_screen->xdpi * 25.4); 166 | return (double) gdk_screen_get_width(screen) / _gdk_screen->xdpi * 25.4; 167 | } 168 | 169 | static gint gdk_android_screen_get_height_mm (GdkScreen *screen) 170 | { 171 | g_debug("height: %gmm", (double) gdk_screen_get_height (screen) / _gdk_screen->ydpi * 25.4); 172 | return (double) gdk_screen_get_height (screen) / _gdk_screen->ydpi * 25.4; 173 | } 174 | 175 | static GdkWindow *gdk_android_screen_get_root_window(GdkScreen *screen) 176 | { 177 | return GDK_ANDROID_SCREEN(screen)->root_window; 178 | } 179 | 180 | static gint gdk_android_screen_get_n_monitors(GdkScreen *screen) 181 | { 182 | return 1; 183 | } 184 | 185 | static gint gdk_android_screen_get_primary_monitor(GdkScreen *screen) 186 | { 187 | return 0; 188 | } 189 | 190 | static gint gdk_android_screen_get_monitor_width_mm(GdkScreen *screen, gint num_monitor) 191 | { 192 | return gdk_android_screen_get_width_mm(screen); 193 | } 194 | 195 | static gint gdk_android_screen_get_monitor_height_mm(GdkScreen *screen, gint num_monitor) 196 | { 197 | return gdk_android_screen_get_height_mm(screen); 198 | } 199 | 200 | static gchar *gdk_android_screen_get_monitor_plug_name (GdkScreen *screen, gint num_monitor) 201 | { 202 | return g_strdup("android display"); 203 | } 204 | 205 | static void gdk_android_screen_get_monitor_geometry(GdkScreen *screen, 206 | gint num_monitor, 207 | GdkRectangle *dest) 208 | { 209 | g_return_if_fail(screen == (GdkScreen *)_gdk_screen); 210 | 211 | dest->x = 0; 212 | dest->y = 0; 213 | dest->width = gdk_android_screen_get_width(screen); 214 | dest->height = gdk_android_screen_get_height(screen); 215 | } 216 | 217 | static GdkVisual *gdk_android_screen_get_rgba_visual(GdkScreen *screen) 218 | { 219 | g_return_val_if_fail(screen == (GdkScreen *)_gdk_screen, NULL); 220 | 221 | return NULL; 222 | } 223 | 224 | static gint gdk_android_screen_get_number(GdkScreen *screen) 225 | { 226 | return 0; 227 | } 228 | 229 | static gchar *gdk_android_screen_make_display_name(GdkScreen *screen) 230 | { 231 | return g_strdup(gdk_display_get_name(&_gdk_display->display)); 232 | } 233 | 234 | static GdkWindow *gdk_android_screen_get_active_window(GdkScreen *screen) 235 | { 236 | g_return_val_if_fail (GDK_IS_SCREEN(screen), NULL); 237 | 238 | return NULL; 239 | } 240 | 241 | static GList *gdk_android_screen_get_window_stack(GdkScreen *screen) 242 | { 243 | g_return_val_if_fail (GDK_IS_SCREEN(screen), NULL); 244 | 245 | return NULL; 246 | } 247 | 248 | static gboolean gdk_android_screen_is_composited(GdkScreen *screen) 249 | { 250 | g_return_val_if_fail(GDK_IS_SCREEN(screen), FALSE); 251 | 252 | return FALSE; 253 | } 254 | 255 | static void gdk_android_screen_finalize(GObject *object) 256 | { 257 | GdkAndroidScreen *s = GDK_ANDROID_SCREEN(object); 258 | 259 | if (s->root_window) 260 | g_object_unref(s->root_window); 261 | 262 | g_object_unref(s->visual); 263 | } 264 | 265 | static void gdk_android_screen_dispose(GObject *object) 266 | { 267 | GdkAndroidScreen *s = GDK_ANDROID_SCREEN(object); 268 | 269 | if (s->root_window) 270 | _gdk_window_destroy(s->root_window, FALSE); 271 | 272 | G_OBJECT_CLASS(gdk_android_screen_parent_class)->dispose(object); 273 | } 274 | 275 | static gboolean _gdk_android_screen_get_setting(GdkScreen *screen, 276 | const gchar *name, 277 | GValue *value) 278 | { 279 | g_return_val_if_fail(GDK_IS_ANDROID_SCREEN(screen), FALSE); 280 | 281 | if (strcmp("gtk-theme-name", name) == 0) 282 | { 283 | g_value_set_string(value, "Android"); 284 | return TRUE; 285 | } 286 | 287 | return FALSE; 288 | } 289 | 290 | static void gdk_android_screen_class_init(GdkAndroidScreenClass *klass) 291 | { 292 | GObjectClass *object_class = G_OBJECT_CLASS(klass); 293 | GdkScreenClass *screen_class = GDK_SCREEN_CLASS(klass); 294 | 295 | object_class->dispose = gdk_android_screen_dispose; 296 | object_class->finalize = gdk_android_screen_finalize; 297 | 298 | screen_class->get_display = gdk_android_screen_get_display; 299 | screen_class->get_width = gdk_android_screen_get_width; 300 | screen_class->get_height = gdk_android_screen_get_height; 301 | screen_class->get_width_mm = gdk_android_screen_get_width_mm; 302 | screen_class->get_height_mm = gdk_android_screen_get_height_mm; 303 | screen_class->get_number = gdk_android_screen_get_number; 304 | screen_class->get_root_window = gdk_android_screen_get_root_window; 305 | screen_class->get_n_monitors = gdk_android_screen_get_n_monitors; 306 | screen_class->get_primary_monitor = gdk_android_screen_get_primary_monitor; 307 | screen_class->get_monitor_width_mm = gdk_android_screen_get_monitor_width_mm; 308 | screen_class->get_monitor_height_mm = gdk_android_screen_get_monitor_height_mm; 309 | screen_class->get_monitor_plug_name = gdk_android_screen_get_monitor_plug_name; 310 | screen_class->get_monitor_geometry = gdk_android_screen_get_monitor_geometry; 311 | screen_class->get_monitor_workarea = gdk_android_screen_get_monitor_geometry; 312 | screen_class->get_system_visual = _gdk_android_screen_get_system_visual; 313 | screen_class->get_rgba_visual = gdk_android_screen_get_rgba_visual; 314 | screen_class->is_composited = gdk_android_screen_is_composited; 315 | screen_class->make_display_name = gdk_android_screen_make_display_name; 316 | screen_class->get_active_window = gdk_android_screen_get_active_window; 317 | screen_class->get_window_stack = gdk_android_screen_get_window_stack; 318 | screen_class->get_setting = _gdk_android_screen_get_setting; 319 | screen_class->visual_get_best_depth = _gdk_android_screen_visual_get_best_depth; 320 | screen_class->visual_get_best_type = _gdk_android_screen_visual_get_best_type; 321 | screen_class->visual_get_best = _gdk_android_screen_visual_get_best; 322 | screen_class->visual_get_best_with_depth = _gdk_android_screen_visual_get_best_with_depth; 323 | screen_class->visual_get_best_with_type = _gdk_android_screen_visual_get_best_with_type; 324 | screen_class->visual_get_best_with_both = _gdk_android_screen_visual_get_best_with_both; 325 | screen_class->query_depths = _gdk_android_screen_query_depths; 326 | screen_class->query_visual_types = _gdk_android_screen_query_visual_types; 327 | screen_class->list_visuals = _gdk_android_screen_list_visuals; 328 | } 329 | --------------------------------------------------------------------------------