-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit. Test code that produces desired windowing behavior.
- Loading branch information
0 parents
commit 184398f
Showing
13 changed files
with
248 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.buildconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from os import environ, path | ||
from subprocess import call | ||
|
||
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') | ||
datadir = path.join(prefix, 'share') | ||
destdir = environ.get('DESTDIR', '') | ||
|
||
# Package managers set this so we don't need to run | ||
if not destdir: | ||
print('Updating icon cache...') | ||
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) | ||
|
||
print('Updating desktop database...') | ||
call(['update-desktop-database', '-q', path.join(datadir, 'applications')]) | ||
|
||
print('Compiling GSettings schemas...') | ||
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
desktop_file = i18n.merge_file( | ||
input: 'org.gnome.Remontoire.desktop.in', | ||
output: 'org.gnome.Remontoire.desktop', | ||
type: 'desktop', | ||
po_dir: '../po', | ||
install: true, | ||
install_dir: join_paths(get_option('datadir'), 'applications') | ||
) | ||
|
||
desktop_utils = find_program('desktop-file-validate', required: false) | ||
if desktop_utils.found() | ||
test('Validate desktop file', desktop_utils, | ||
args: [desktop_file] | ||
) | ||
endif | ||
|
||
appstream_file = i18n.merge_file( | ||
input: 'org.gnome.Remontoire.appdata.xml.in', | ||
output: 'org.gnome.Remontoire.appdata.xml', | ||
po_dir: '../po', | ||
install: true, | ||
install_dir: join_paths(get_option('datadir'), 'appdata') | ||
) | ||
|
||
appstream_util = find_program('appstream-util', required: false) | ||
if appstream_util.found() | ||
test('Validate appstream file', appstream_util, | ||
args: ['validate', appstream_file] | ||
) | ||
endif | ||
|
||
install_data('org.gnome.Remontoire.gschema.xml', | ||
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') | ||
) | ||
|
||
compile_schemas = find_program('glib-compile-schemas', required: false) | ||
if compile_schemas.found() | ||
test('Validate schema file', compile_schemas, | ||
args: ['--strict', '--dry-run', meson.current_source_dir()] | ||
) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component type="desktop"> | ||
<id>org.gnome.Remontoire.desktop</id> | ||
<metadata_license>CC0-1.0</metadata_license> | ||
<project_license>GPL-3.0-or-later</project_license> | ||
<description> | ||
</description> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Name=remontoire | ||
Exec=remontoire | ||
Terminal=false | ||
Type=Application | ||
Categories=GTK; | ||
StartupNotify=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist gettext-domain="remontoire"> | ||
<schema id="org.gnome.Remontoire" path="/org/gnome/Remontoire/"> | ||
</schema> | ||
</schemalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
project('remontoire', ['c', 'vala'], version: '0.1.0', | ||
meson_version: '>= 0.40.0', | ||
) | ||
|
||
i18n = import('i18n') | ||
|
||
|
||
subdir('data') | ||
subdir('src') | ||
subdir('po') | ||
|
||
meson.add_install_script('build-aux/meson/postinstall.py') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"app-id" : "org.gnome.Remontoire", | ||
"runtime" : "org.gnome.Platform", | ||
"runtime-version" : "3.28", | ||
"sdk" : "org.gnome.Sdk", | ||
"command" : "remontoire", | ||
"finish-args" : [ | ||
"--share=network", | ||
"--share=ipc", | ||
"--socket=x11", | ||
"--socket=wayland", | ||
"--filesystem=xdg-run/dconf", | ||
"--filesystem=~/.config/dconf:ro", | ||
"--talk-name=ca.desrt.dconf", | ||
"--env=DCONF_USER_CONFIG_DIR=.config/dconf" | ||
], | ||
"build-options" : { | ||
"cflags" : "-O2 -g", | ||
"cxxflags" : "-O2 -g", | ||
"env" : { | ||
"V" : "1" | ||
} | ||
}, | ||
"cleanup" : [ | ||
"/include", | ||
"/lib/pkgconfig", | ||
"/man", | ||
"/share/doc", | ||
"/share/gtk-doc", | ||
"/share/man", | ||
"/share/pkgconfig", | ||
"/share/vala", | ||
"*.la", | ||
"*.a" | ||
], | ||
"modules" : [ | ||
{ | ||
"name" : "remontoire", | ||
"buildsystem" : "meson", | ||
"config-opts" : [ | ||
"--libdir=lib" | ||
], | ||
"builddir" : true, | ||
"sources" : [ | ||
{ | ||
"type" : "git", | ||
"url" : "file:///home/kgilmer/dev/repos/remontoire" | ||
} | ||
] | ||
} | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
data/org.gnome.Remontoire.desktop.in | ||
data/org.gnome.Remontoire.appdata.xml.in | ||
data/org.gnome.Remontoire.gschema.xml | ||
src/window.uisrc/main.vala | ||
src/window.vala |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
i18n.gettext('remontoire', preset: 'glib') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Gtk; | ||
using Gdk; | ||
|
||
public class RemontoireWindow : Gtk.Window { | ||
|
||
public RemontoireWindow () { | ||
this.set_skip_taskbar_hint(true); | ||
this.set_skip_pager_hint(true); | ||
this.set_decorated(false); | ||
this.set_resizable(false); | ||
this.set_default_size(200, 400); | ||
//this.set_gravity(NORTH_EAST); | ||
this.set_type_hint(DIALOG); | ||
this.stick(); | ||
|
||
var view = new TreeView (); | ||
setup_treeview (view); | ||
add (view); | ||
this.destroy.connect (Gtk.main_quit); | ||
} | ||
|
||
private void setup_treeview (TreeView view) { | ||
|
||
var store = new TreeStore (2, typeof (string), typeof (string)); | ||
view.set_model (store); | ||
|
||
view.insert_column_with_attributes (-1, "Product", new CellRendererText (), "text", 0, null); | ||
view.insert_column_with_attributes (-1, "Price", new CellRendererText (), "text", 1, null); | ||
|
||
//TreeIter root; | ||
TreeIter category_iter; | ||
TreeIter product_iter; | ||
|
||
//store.append (out root, null); | ||
//store.set (root, 0, "All Products", -1); | ||
|
||
store.append (out category_iter, null); | ||
store.set (category_iter, 0, "Books", -1); | ||
|
||
store.append (out product_iter, category_iter); | ||
store.set (product_iter, 0, "Moby Dick", 1, "$10.36", -1); | ||
store.append (out product_iter, category_iter); | ||
store.set (product_iter, 0, "Heart of Darkness", 1, "$4.99", -1); | ||
store.append (out product_iter, category_iter); | ||
store.set (product_iter, 0, "Ulysses", 1, "$26.09", -1); | ||
store.append (out product_iter, category_iter); | ||
store.set (product_iter, 0, "Effective Vala", 1, "$38.99", -1); | ||
|
||
store.append (out category_iter, null); | ||
store.set (category_iter, 0, "Films", -1); | ||
|
||
store.append (out product_iter, category_iter); | ||
store.set (product_iter, 0, "Amores Perros", 1, "$7.99", -1); | ||
store.append (out product_iter, category_iter); | ||
store.set (product_iter, 0, "Twin Peaks", 1, "$14.99", -1); | ||
store.append (out product_iter, category_iter); | ||
store.set (product_iter, 0, "Vertigo", 1, "$20.49", -1); | ||
|
||
view.expand_all (); | ||
} | ||
|
||
public static int main (string[] args) { | ||
Gtk.init (ref args); | ||
|
||
var window = new RemontoireWindow (); | ||
|
||
window.show_all (); | ||
|
||
var gdkWindow = window.get_window(); | ||
var display = Display.get_default(); | ||
var monitor = display.get_monitor_at_window(gdkWindow); | ||
var geometry = monitor.get_geometry(); | ||
|
||
window.move(geometry.width - 230, 10); | ||
Gtk.main (); | ||
|
||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
remontoire_sources = [ | ||
'main.vala' | ||
] | ||
|
||
remontoire_deps = [ | ||
dependency('gio-2.0', version: '>= 2.50'), | ||
dependency('gtk+-3.0', version: '>= 3.22'), | ||
dependency('gdk-3.0', version: '>= 3.22') | ||
] | ||
|
||
gnome = import('gnome') | ||
|
||
executable('remontoire', remontoire_sources, | ||
vala_args: '--target-glib=2.50', dependencies: remontoire_deps, | ||
install: true, | ||
) |