Skip to content

Instantly share code, notes, and snippets.

View achadwick's full-sized avatar
🍃
Let's get this thing working again

Andrew Chadwick achadwick

🍃
Let's get this thing working again
View GitHub Profile
@achadwick
achadwick / taboret_standalone.py
Created January 3, 2013 13:36
Tabbed sidebar interface idea.
#!/usr/bin/python
# Interface idea: dragging tabs and suchlike.
# Released as Creative Commons Zero: CC0 v1.0 <a.t.chadwick@gmail.com>
import gobject
import gtk
from gtk import gdk
import cairo
from gettext import gettext as _
@achadwick
achadwick / mypaint_1.1.0-1.debian.copyright
Created January 3, 2013 15:21
Copyright file for the in-progress Debian mypaint 1.1.0-1 (or subsequent)
@achadwick
achadwick / openraster_stack_spec_updates.md
Last active December 30, 2015 12:19
Some proposed updates to the OpenRaster stack specification.

Updates to the OpenRaster Stack Specification

I would like to propose the following (updated) amendments to the [OpenRaster specification][1]. Thanks to everyone who's taken the time to review the original proposal and comment on it.

The addition of svg:dst-in and svg:dst-out to the OpenRaster format would allow MyPaint, an app I co-maintain, implement layer masking. There is accordingly an [experimental code branch][0] with a draft implementation of these updates.

New layer modes

@achadwick
achadwick / axischart.py
Last active January 26, 2016 15:46
Input axis stripchart for python-gobject and Gtk3
#!/usr/bin/env python
# Input axis stripchart for (python-gobject & Gtk3) or (PyGtk, evolving)
# CC0 1.0 2016-01-26 Andrew Chadwick, all rights waived
# https://creativecommons.org/publicdomain/zero/1.0/
import sys
import os
from getopt import getopt
from collections import deque
@achadwick
achadwick / WINDOWS.md
Last active August 29, 2015 14:12
An attempt at some MyPaint build instructions for Windows
DEBUG:lib.document:Created working-doc tempdir u'/tmp/tmpAI1l2Fmypaint'
(layers.py:25446): Gtk-WARNING **: Symbolic icon mypaint-layer-group-symbolic-ltr of size 16 is in an icon theme directory of size 128
(layers.py:25446): Gtk-WARNING **: Symbolic icon mypaint-object-visible-symbolic-ltr of size 16 is in an icon theme directory of size 128
(layers.py:25446): Gtk-WARNING **: Symbolic icon mypaint-object-unlocked-symbolic-ltr of size 16 is in an icon theme directory of size 128
(layers.py:25446): Gtk-WARNING **: Symbolic icon mypaint-layer-painting-symbolic-ltr of size 16 is in an icon theme directory of size 128
@achadwick
achadwick / custom_draggable_treemodel.py
Created March 1, 2015 21:30
Draggable treemodel (test apparent regression between gtk 3.12 and 3.14)
#!/usr/bin/python
# Custom draggable TreeModel demo code
# Author: Andrew Chadwick <a.t.chadwick@gmail.com>
# To the extent possible under law, the author has waived all copyright
# and related or neighboring rights to this work.
# https://creativecommons.org/publicdomain/zero/1.0/
## Module imports
import logging
@achadwick
achadwick / openraster-extended-layer-idea.xml
Created April 7, 2015 11:11
Idea for extended OpenRaster layers
<?xml version='1.0' encoding='UTF-8'?>
<image h="100" version="0.0.4+extendedlayerideas.001" w="100">
<stack isolation="auto" name="" visibility="visible">
<layer composite-op="svg:src-over" name="silly eyebrows" opacity="0.333" src="data/layer-00.png" visibility="visible" x="0" y="0">
<annotation href="data/layer-00-strokemap.dat" media-type="application/x.mypaint-strokemap-v2"/>
<!--
An annotation is supplementary data which can be used to describe
the pixels of the rendered layer (and by inference any source files).
Annotations are 2d metadata, and MUST NOT be used for rendering a new @src.
In MyPaint's case, the strokemap data maps pixels to brushstroke settings.
@achadwick
achadwick / notebook_drag_minimal.py
Last active May 19, 2016 11:23
GtkNotebook minimal code, for debugging
#!python
# Tester for reorderable tabs. Sure are a lot of GTK regressions here.
# Script is good for either Python2 or Python3.
#
# Copyright waived: http://creativecommons.org/publicdomain/zero/1.0/
# Andrew Chadwick, 2016-05-19.
#
# GTK 3.20.4 terminates the drag as soon as the pointer goes outside the
# notebook whose tab is being dragged. Reordering of tabs within a
# notebook is still possible. https://github.com/mypaint/mypaint/issues/682
@achadwick
achadwick / gdk-screen-layout-tester.py
Created August 18, 2015 17:34
gdk-screen-layout-tester
#!/usr/bin/env python
# Draws the layout of the current GdkScreen.
# CC0 1.0 2014-12-15 Andrew Chadwick, all rights waived
# https://creativecommons.org/publicdomain/zero/1.0/
import logging
from gi.repository import Gtk
from gi.repository import Gdk