Escolar Documentos
Profissional Documentos
Cultura Documentos
Felipe Borges
<felipeborges@src.gnome.org>
GNOME is....
Desktop environment Development platform
Gjs
First released in 2008 Well maintained Main development language for writing GNOME Apps
GNOME Apps in JS
Documents Shell Polari
gjs-console
Get started
Gjs and Gtk Actions and signals Run your application
const Lang = imports.lang; const Gtk = imports.gi.Gtk; const App = new Lang.Class({ Name: 'App', Extends: Gtk.Application, _init: function () { this.parent({ application_id: 'org.example.App' }); this.connect('activate', Lang.bind(this, this._onActivate)); this.connect('startup', Lang.bind(this, this._onStartup));
},
_onActivate: function () { this._window.show_all(); }, _onStartup: function () { this._window = new Gtk.ApplicationWindow({ application: this, title: "Hello World!" }); this._window.set_default_size(200, 200); let label = new Gtk.Label({ label: "Hello World" }); this._window.add(label); } });
Build system
.desktop.in autogen.sh Makefile.am configure.ac
autogen.sh
#!/bin/sh set -e test -n "$srcdir" || srcdir=`dirname "$0"` test -n "$srcdir" || srcdir=. olddir=`pwd` cd "$srcdir" # This will run autoconf, automake, etc. for us autoreconf --force --install cd "$olddir" if test -z "$NOCONFIGURE"; then "$srcdir"/configure "$@" fi
Makefile.am
# The actual runnable program is set to the SCRIPTS primitive. # # Prefix bin_ tells where to copy this bin_SCRIPTS = hello-world # # List of files to be distributed EXTRA_DIST = \ $(bin_SCRIPTS) # # # The desktop files desktopdir = $(datadir)/applications desktop_DATA = \ hello-world.desktop
configure.ac
# This file is processed by autoconf to create a configure script AC_INIT([Hello World], 1.0) AM_INIT_AUTOMAKE([1.10 no-define foreign dist-xz no-dist-gzip]) AC_CONFIG_FILES([Makefile hello-world.desktop]) AC_OUTPUT
http://developer.gnome.org/