Skip to content

Instantly share code, notes, and snippets.

View makotokato's full-sized avatar

Makoto Kato makotokato

View GitHub Profile
@makotokato
makotokato / gtk3-input.c
Created October 10, 2020 04:35
GTK3 keyboard sample
// build:
// gcc gtk3-entry-keyboard-event.c `pkg-config --cflags gtk+-3.0` `pkg-config
// --libs gtk+-3.0`
#include <gtk/gtk.h>
static gboolean print_keypress(GtkWidget *widget, GdkEventKey *event,
gpointer user_data) {
printf("keypress: %#06x %#06x\n", event->keyval, event->hardware_keycode);
return FALSE;
@makotokato
makotokato / GeckoViewBuildOnAppleSilicon.md
Last active February 22, 2021 19:57
GeckoView Build On Apple Silicon

TL;DR

  • Actually, we don't support GeckoView build on Apple Sillicon simply yet. Although Rust has native binaries, we have to use some x86_64 tools for clang, OpenJDK and Python 2.7.
  • You can use https://github.com/google/android-emulator-m1-preview on macOS. But ./mach install doesn't detect this emulator now.
  • GV's unit tests doesn't work yet.

Step

  1. Set up development environment via https://bit.ly/36bUmEx
  2. Install OpenJDK (macOS x86_64) since it has no aarch64 packages.
  3. Add your rust target like aarch64-linux-android via rustup target add aarch64-linux-android
  4. Comment out https://searchfox.org/mozilla-central/rev/c8ce16e4299a3afd560320d8d094556f2b5504cd/python/mozboot/mozboot/osx.py#197 like "# sys.exit(1)"
@makotokato
makotokato / main.c
Created February 28, 2025 10:22
GTK4 with textbox
// gcc main.c `pkg-config --cflags --libs gtk4` Too many errors emitted, stopping now
#include <gtk/gtk.h> 'gtk/gtk.h' file not found
static void activate(GApplication* app, gpointer user_data) { Unknown type name 'gpointer'
GtkWidget* window = gtk_window_new();