Compare commits

..

58 Commits

Author SHA1 Message Date
Tom Schoonjans
9bb0a87126
Merge pull request #33 from ashaduri/no-gtk2-prefs
Removed gtk2_prefs
2022-03-13 06:24:39 +00:00
Alexander Shaduri
ec8495e0b4 Removed gtk2_prefs as it has its own repository at https://github.com/ashaduri/gtk2_prefs. 2022-03-10 15:59:07 +04:00
Tom Schoonjans
6ffaee7ae1 New installer: 2022-01-04 2022-01-04 15:19:39 +00:00
Tom Schoonjans
105f54e3c7 New installer: 2021-04-29 2021-04-29 13:18:31 +01:00
Tom Schoonjans
15fdc2228e New installers: 2021-01-30 2021-01-30 10:40:28 +00:00
Tom Schoonjans
27bc126a0d New installers: 2020-11-22 2020-11-22 11:42:24 +00:00
Tom Schoonjans
d401405d87 New installers: 2020-07-15 2020-07-15 09:14:15 +01:00
Tom Schoonjans
d5e9dc5286
Add Github sponsorship to funding 2020-05-31 10:01:58 +01:00
Tom Schoonjans
9f0fa6355f New installers: 2020-05-19 2020-05-19 13:58:40 +01:00
Tom Schoonjans
0992fd1fc7
Update FUNDING.yml 2020-04-07 10:50:41 +01:00
Tom Schoonjans
7ff7e676d0 New installers: 2020-02-21 2020-02-21 12:57:00 +00:00
Tom Schoonjans
651af13435 New installers: 2019-12-19 2019-12-19 13:06:45 +00:00
Tom Schoonjans
f97fa61ab3 Add code to test runtime 2019-12-19 13:03:31 +00:00
Tom Schoonjans
29f9d477bc New installers: 2019-11-07
Closes #24
2019-11-07 16:03:51 +00:00
Tom Schoonjans
07fe7dbe80 New installers: 2019-10-04 2019-10-04 14:45:59 +01:00
Tom Schoonjans
b5299b2e9e New installers: 2019-08-05 2019-08-05 09:12:34 +01:00
Tom Schoonjans
e20195cfbf New installers: 2019-07-02 2019-07-02 10:12:26 +01:00
Tom Schoonjans
12ed7c624f
Create FUNDING.yml 2019-05-23 19:38:26 +01:00
Tom Schoonjans
ed18ffc0ee New installers: 2019-04-26 2019-04-26 12:28:21 +01:00
Tom Schoonjans
9310da3a8c
README.md: add downloads badge 2019-04-22 16:13:58 +01:00
Tom Schoonjans
ac734e8d8b New installers: 2019-03-26
Closes #23
2019-03-26 12:49:28 +00:00
Tom Schoonjans
257df8f277 New installers: 2019-02-07 2019-02-07 14:06:43 +00:00
Tom Schoonjans
0d74248592 New installers: 2018-12-19 2018-12-19 13:52:19 +00:00
Tom Schoonjans
e80938e197 New installers: 2018-10-03
Closes #22
2018-10-03 17:49:54 +01:00
Tom Schoonjans
fd197d4ef0 New installers: 2018-09-13 2018-09-13 13:40:33 +01:00
Tom Schoonjans
fdb647da0c
Fix XMI-MSIM repo link
Closes #21
2018-09-04 11:43:36 +01:00
Tom Schoonjans
918b26dbeb New installers: 2018-08-01 2018-08-01 09:07:12 +01:00
Tom Schoonjans
1595c18695 New installers: 2018-06-12
* Closes #14: add fontconfig configuration files
2018-06-12 11:20:15 +01:00
Paul Verest
a8bb24b6e0 README fix www.msys2.org link 2018-05-17 06:41:59 +01:00
Tom Schoonjans
de8599e01b New installers: 2018-03-12
* Closes #13 -> add missing libjasper and libjpeg dlls
2018-03-12 09:03:21 +00:00
Tom Schoonjans
0f30a324a0 New installers: 2018-02-20
* includes bugfix for ssl certificates that were not removed on
uninstall
2018-02-20 10:00:42 +00:00
Tom Schoonjans
c1da5644ed New installers: 2018-01-18 2018-01-18 09:18:30 +00:00
Tom Schoonjans
ad04f9b483 New installers: 2017-11-15 2017-11-15 11:10:03 +00:00
Tom Schoonjans
953f1c8042 README.md changes 2017-10-26 12:42:00 +01:00
Tom Schoonjans
029f5282aa README update 2017-09-25 13:14:05 +01:00
Tom Schoonjans
ddb38897c5 New installers: 2017-09-25 2017-09-25 13:10:43 +01:00
Tom Schoonjans
80cfd7dcfe New installer: 2017-09-11 2017-09-11 21:03:32 +01:00
Tom Schoonjans
6e6eb9e3a0 Add libsoup support and fix gettext language files 2017-09-06 05:24:54 +01:00
Tom Schoonjans
fb54d5067c New installers: 2017-08-17 2017-08-17 15:26:02 +01:00
Tom Schoonjans
50fcafdd3f New installers: 2017-06-27 2017-06-27 09:53:13 +01:00
Tom Schoonjans
d6371c1945 New installers: 2017-05-30 2017-05-30 14:04:41 +01:00
Tom Schoonjans
c933bc263f README.md: add donation link 2017-05-08 13:28:07 +01:00
Tom Schoonjans
bf4fdc02c0 README: remove dead link 2017-04-26 07:59:40 +01:00
Tom Schoonjans
293d234c78 New installers: 2017-04-05 2017-04-05 13:13:13 +01:00
Tom Schoonjans
be6831f938 Use Github releases for download hosting 2017-03-13 08:16:51 +00:00
Tom Schoonjans
32534d4daf New installers: 2017-03-09 2017-03-09 09:11:05 +00:00
Tom Schoonjans
065daeaa7c Update README.md for MSYS2 transition 2017-02-20 16:28:12 +00:00
Tom Schoonjans
62bc95e7ba Finalize transition to MSYS2
Everything appears to work fine...

Closes #5
Closes #6
2017-02-20 16:02:31 +00:00
Tom Schoonjans
0d5724262f gtk+3 3.22.7 2017-01-19 05:05:12 +00:00
Tom Schoonjans
e4c1944e2d gtk+3 3.22.6 2017-01-18 11:03:22 +00:00
Tom Schoonjans
cc82f4c746 fix gtk2 installer 2016-11-29 17:33:29 +00:00
peterbud
939e50d7c7 Adding missing 2 files 2016-09-18 21:13:03 +02:00
peterbud
5f5fbc5a12 Fixing wrong directoy copy script 2016-09-07 07:22:41 +02:00
peterbud
fb293f2b79 More changes to have a complete MSYS2 version
Extended the copy script, did a deep dependency research and modified installed libraries
2016-09-06 23:03:14 +02:00
peterbud
eb4d5b4717 Modified the binary files to use MSYS2 environment of GTK (mingw64 folder)
Also added a script which copies all necessary files from the appropriate MSYS2/mingw64 folders to the bin folder of the install environment
Updated GTK3 NSI script
2016-09-05 21:21:51 +02:00
Tom Schoonjans
9ee00261c1 gtk2 2.24.30 and gtk3 3.20.2
next time: write a script that copies all required files from /usr/local to the git repo...
2016-04-12 07:27:26 +02:00
Tom Schoonjans
1c9141a50b new packages created gtk-2.24.29 and gtk-3.18.6
all dependencies have been updated
patches were necessary for cairo and cairomm
libepoxy added: new gtk3 dependency
2016-01-10 14:00:34 +01:00
Tom Schoonjans
d55963d2a7 README.md: link to xmimsim.iss fixed 2015-08-10 09:49:53 +01:00
12632 changed files with 147587 additions and 19096 deletions

2
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,2 @@
custom: https://www.paypal.me/tomschoonjansUK/10
github: tschoonj

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
gtk2-runtime*-ts-win64*exe
gtk3-runtime*-ts-win64*exe
*.swp
/.vscode
hello-world-gtkmm3.exe

View File

@ -1,55 +1,71 @@
GTK+ for Windows Runtime Environment Installer: 64-bit
======================================================
[![Github Downloads All Releases](https://img.shields.io/github/downloads/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/total.svg)](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases)
[![PayPal](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/tomschoonjans/10) [![Amazon Wish list](https://img.shields.io/badge/Amazon-Wishlist-green.svg)](http://amzn.eu/8ml3d0c)
This repository is a fork of the [GTK+ for Windows Runtime Environment Installer](http://gtk-win.sourceforge.net) that was originally created
by Alexander Shaduri.
My efforts here will focus on creating a **64-bit version** of the GTK+-2 runtime that he has been providing so far, using up to date versions of GTK+ and its dependencies. Recently I have also created a 64-bit **GTK+-3 runtime package**. All packages now contain **Gtkmm** and its dependencies too. Since the GTK+ developers recently dropped support for stock icons (a mistake of epic proportions IMHO...), I added the Adwaita icon theme to the GTK+-3 runtime, so you can still enjoy pretty filechooserdialogs etc! I have also added a couple of commonly used libraries such as libxml++ and libxslt.
My efforts here will focus on creating a **64-bit version** of the GTK+-2 runtime that he has been providing so far, using up to date versions of GTK+ and its dependencies. Recently I have also created a 64-bit **GTK+-3 runtime package**. All packages now contain **Gtkmm** and its dependencies too. Since the GTK+ developers recently dropped support for stock icons (a mistake of epic proportions IMHO...), I added the Adwaita icon theme to the GTK+-3 runtime, so you can still enjoy pretty filechooserdialogs etc! I have also added a couple of commonly used libraries such as libxml++, libxslt, gtksourceview, libsoup and sqlite.
The installers can be found [here](http://lvserver.ugent.be/gtk-win64/).
The installers can be found in the [releases section](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases).
**[Keep in mind though that these packages are experimental. Binary compatibility between versions is not guaranteed!!!.](http://www.gtk.org/download/win64.php)**
The current releases ([gtk2-runtime-2.24.33-2021-01-30-ts-win64.exe](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/download/2021-01-30/gtk2-runtime-2.24.33-2021-01-30-ts-win64.exe) and [gtk3-runtime-3.24.31-2022-01-04-ts-win64.exe](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/download/2022-01-04/gtk3-runtime-3.24.31-2022-01-04-ts-win64.exe)) were obtained entirely from the excellent [MSYS2 project](https://www.msys2.org), and were **not** compiled by myself, as was the case for releases made before 2017. Users who want to compile against this runtime are strongly encouraged to set up a MSYS2 installation themselves, and install the required packages (compiled with the mingw-w64-x86\_64 toolchain!!!).
Both for convencience as well as for increased reliability across installations, it is recommended for developers to compile and link against the GTK+ SDK that I used to create the installers. This SDK can also be obtained at the aforementioned url.
**Please note that the Gtk+-2 runtime installers will no longer be updated as there are will be no more Gtk+-2 source code releases**
The current releases ([gtk2-runtime-2.24.28-2015-07-03-ts-win64.exe](http://lvserver.ugent.be/gtk-win64/gtk2-runtime/gtk2-runtime-2.24.28-2015-07-03-ts-win64.exe) and [gtk3-runtime-3.14.13-2015-07-03-ts-win64.exe](http://lvserver.ugent.be/gtk-win64/gtk3-runtime/gtk3-runtime-3.14.13-2015-07-03-ts-win64.exe)) have been compiled using GCC 5.1.0 (MinGW-w64 installed from TDM-GCC).
The included GTK+ dependencies were selected according to the flowchart used by [Hexchat](http://hexchat.github.io/gtk-win32/). The source tarballs can be obtained by clicking on the names of the dependencies in the following list:
The following packages are included in the current GTK+-2/3 installers
* [adwaita icon theme](http://ftp.gnome.org/pub/GNOME/sources/adwaita-icon-theme/) (3.14.1)
* [atk](http://ftp.gnome.org/pub/GNOME/sources/atk/) (2.16.0)
* [atkmm](http://ftp.gnome.org/pub/GNOME/sources/atkmm/) (2.22.7)
* [cairo](http://cairographics.org/releases/) (1.14.2)
* [cairomm](http://cairographics.org/releases/) (1.11.2)
* [fontconfig](http://www.freedesktop.org/software/fontconfig/release/) (2.11.1)
* [freetype](http://www.freetype.org/download.html) (2.6)
* [gdk-pixbuf](http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/) (2.30.8)
* [gettext](http://ftp.gnu.org/pub/gnu/gettext/) (0.19.4)
* [glib](http://ftp.gnome.org/pub/GNOME/sources/glib/) (2.44.1)
* [glibmm](http://ftp.gnome.org/pub/GNOME/sources/glibmm/) (2.44.0)
* [gtk2](http://ftp.gnome.org/pub/GNOME/sources/gtk+/) (2.24.28)
* [gtk3](http://ftp.gnome.org/pub/GNOME/sources/gtk+/) (3.14.13)
* [gtkmm2](http://ftp.gnome.org/pub/GNOME/sources/gtkmm) (2.24.4)
* [gtkmm3](http://ftp.gnome.org/pub/GNOME/sources/gtkmm) (3.14.0)
* [harfbuzz](http://www.freedesktop.org/software/harfbuzz/release/) (0.9.41)
* [hicolor-icon-theme](http://icon-theme.freedesktop.org/releases/) (0.15)
* [icon-naming-utils](http://tango.freedesktop.org/releases/) (0.8.90)
* [intltool](http://ftp.gnome.org/pub/gnome/sources/intltool/) (0.51.0)
* [json-glib](http://ftp.gnome.org/pub/gnome/sources/json-glib/) (1.0.4)
* [libffi](http://sourceware.org/libffi/) (3.2.1)
* [libpng](http://sourceforge.net/project/showfiles.php?group_id=5624) (1.6.17)
* [libsigc++](http://ftp.gnome.org/pub/GNOME/sources/libsigc++/) (2.4.1)
* [libxml2](http://xmlsoft.org/sources/) (2.9.2)
* [libxml++](http://ftp.gnome.org/pub/GNOME/sources/libxml++/) (2.38.1)
* [libxslt](http://xmlsoft.org/sources/) (1.1.28)
* [pango](http://ftp.gnome.org/pub/GNOME/sources/pango/) (1.36.8)
* [pangomm](http://ftp.gnome.org/pub/GNOME/sources/pangomm/) (2.36.0)
* [pixman](http://cairographics.org/releases/) (0.32.6)
* [pkg-config](http://pkgconfig.freedesktop.org/releases/) (0.28)
* [win-iconv](http://code.google.com/p/win-iconv/downloads/list) (0.0.6)
* [zlib](http://www.zlib.net) (1.2.8)
* [adwaita icon theme](http://ftp.gnome.org/pub/GNOME/sources/adwaita-icon-theme/) (41.0)
* [atk](http://ftp.gnome.org/pub/GNOME/sources/atk/) (2.36.0)
* [atkmm](http://ftp.gnome.org/pub/GNOME/sources/atkmm/) (2.28.0)
* [cairo](http://cairographics.org/releases/) (1.17.4)
* [cairomm](http://cairographics.org/releases/) (1.14.3)
* [fontconfig](http://www.freedesktop.org/software/fontconfig/release/) (2.13.94)
* [freetype](http://www.freetype.org/download.html) (2.11.1)
* [gdk-pixbuf](http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/) (2.42.6)
* [gettext](http://ftp.gnu.org/pub/gnu/gettext/) (0.19.8.1)
* [glib](http://ftp.gnome.org/pub/GNOME/sources/glib/) (2.70.2)
* [glib-networking](http://ftp.gnome.org/pub/GNOME/sources/glib-networking/) (2.70.1)
* [glibmm](http://ftp.gnome.org/pub/GNOME/sources/glibmm/) (2.66.2)
* [gobject-introspection](http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/) (1.70.0)
* [gtk2](http://ftp.gnome.org/pub/GNOME/sources/gtk+/) (2.24.33)
* [gtk3](http://ftp.gnome.org/pub/GNOME/sources/gtk+/) (3.24.31)
* [gtkmm2](http://ftp.gnome.org/pub/GNOME/sources/gtkmm) (2.24.5)
* [gtkmm3](http://ftp.gnome.org/pub/GNOME/sources/gtkmm) (3.24.5)
* [gtksourceview2](http://ftp.gnome.org/pub/GNOME/sources/gtksourceview/) (2.10.5)
* [gtksourceview3](http://ftp.gnome.org/pub/GNOME/sources/gtksourceview/) (3.24.11)
* [gtksourceview4](http://ftp.gnome.org/pub/GNOME/sources/gtksourceview/) (4.8.2)
* ~~[gtksourceviewmm2](http://ftp.gnome.org/pub/GNOME/sources/gtksourceviewmm/) (2.10.3)~~ (currently unavailable)
* [gtksourceviewmm3](http://ftp.gnome.org/pub/GNOME/sources/gtksourceviewmm/) (3.21.3)
* [harfbuzz](http://www.freedesktop.org/software/harfbuzz/release/) (3.1.2)
* [hicolor-icon-theme](http://icon-theme.freedesktop.org/releases/) (0.17)
* [json-glib](http://ftp.gnome.org/pub/gnome/sources/json-glib/) (1.6.6)
* [libepoxy](https://github.com/anholt/libepoxy) (1.5.9)
* [libffi](http://sourceware.org/libffi/) (3.3)
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv/) (1.16)
* [libpeas](http://ftp.gnome.org/pub/gnome/sources/libpeas/) (1.30.0)
* [libpng](http://sourceforge.net/project/showfiles.php?group_id=5624) (1.6.37)
* [librsvg](http://ftp.gnome.org/pub/GNOME/sources/librsvg/) (2.52.5)
* [libsigc++](http://ftp.gnome.org/pub/GNOME/sources/libsigc++/) (2.10.7)
* [libsoup](http://ftp.gnome.org/pub/GNOME/sources/libsoup/) (2.74.2)
* [libxml2](http://xmlsoft.org/sources/) (2.9.12)
* [libxml++2](http://ftp.gnome.org/pub/GNOME/sources/libxml++/) (2.42.0)
* [libxml++3](http://ftp.gnome.org/pub/GNOME/sources/libxml++/) (3.2.2)
* [libxslt](http://xmlsoft.org/sources/) (1.1.34)
* [pango](http://ftp.gnome.org/pub/GNOME/sources/pango/) (1.50.3)
* [pangomm](http://ftp.gnome.org/pub/GNOME/sources/pangomm/) (2.46.2)
* [pcre](ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/) (8.45)
* [pixman](http://cairographics.org/releases/) (0.40.0)
* [sqlite](https://www.sqlite.org) (3.37.0)
* [zlib](http://www.zlib.net) (1.2.11)
For all other information regarding how to use the installer, the reader is kindly referred to the [Alexander Shaduri's website](http://gtk-win.sourceforge.net) of the GTK for Windows runtime environment installer. The only difference with the installers found at this website is that mine DO NOT have the `compatdlls` option, but this should present no problems to any user.
For all other information regarding how to use the installer, the reader is kindly referred to [Alexander Shaduri's website](http://gtk-win.sourceforge.net) of the GTK for Windows runtime environment installer. The only difference with the installers found at his website is that mine DO NOT have the `compatdlls` option, but this should present no problems to any user.
Personally I use this installer in my [XMI-MSIM project](http://github.com/xmimsim). You may want to have a look at my Inno Setup ([new](https://github.com/tschoonj/xmimsim/blob/master/nsis/xmimsim.iss)) and NSIS ([old](https://github.com/tschoonj/xmimsim/blob/XMI-MSIM-4.0/nsis/xmimsim-win64.nsi.in)) based installers.
Personally I use this installer in my [XMI-MSIM project](http://github.com/tschoonj/xmimsim). You may want to have a look at my Inno Setup ([new](https://github.com/tschoonj/xmimsim/blob/master/windows/xmimsim.iss)) and NSIS ([old](https://github.com/tschoonj/xmimsim/blob/XMI-MSIM-4.0/nsis/xmimsim-win64.nsi.in)) based installers.
Those interested in scientific plotting using Gtkmm3 may want to have a look at my project [Gtkmm-PLplot](https://github.com/tschoonj/gtkmm-plplot). Documentation and examples can be found [here](http://tschoonj.github.io/gtkmm-plplot)
If you have enjoyed using this project, please consider making a donation or buying something off my Amazon Wish list.
Tom Schoonjans

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
gtk-nsis-pack/bin/gdbus.exe Normal file

Binary file not shown.

View File

@ -1,799 +0,0 @@
#!/usr/bin/env python
#
# Copyright (C) 2006-2008 Async Open Source
# Henrique Romano <henrique@async.com.br>
# Johan Dahlin <jdahlin@async.com.br>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# TODO:
# Toolbars
"""Usage: gtk-builder-convert [OPTION] [INPUT] [OUTPUT]
Converts Glade files into XML files which can be loaded with GtkBuilder.
The [INPUT] file is
-w, --skip-windows Convert everything but GtkWindow subclasses.
-r, --root Convert only widget named root and its children
-h, --help display this help and exit
When OUTPUT is -, write to standard output.
Examples:
gtk-builder-convert preference.glade preferences.ui
Report bugs to http://bugzilla.gnome.org/."""
import getopt
import os
import sys
from xml.dom import minidom, Node
DIALOGS = ['GtkDialog',
'GtkFileChooserDialog',
'GtkMessageDialog']
WINDOWS = ['GtkWindow'] + DIALOGS
# The subprocess is only available in Python 2.4+
try:
import subprocess
subprocess # pyflakes
except ImportError:
subprocess = None
def get_child_nodes(node):
assert node.tagName == 'object'
nodes = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName != 'child':
continue
nodes.append(child)
return nodes
def get_properties(node):
assert node.tagName == 'object'
properties = {}
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName != 'property':
continue
value = child.childNodes[0].data
properties[child.getAttribute('name')] = value
return properties
def get_property(node, property_name):
assert node.tagName == 'object'
properties = get_properties(node)
return properties.get(property_name)
def get_property_node(node, property_name):
assert node.tagName == 'object'
properties = {}
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName != 'property':
continue
if child.getAttribute('name') == property_name:
return child
def get_signal_nodes(node):
assert node.tagName == 'object'
signals = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName == 'signal':
signals.append(child)
return signals
def get_property_nodes(node):
assert node.tagName == 'object'
properties = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
# FIXME: handle comments
if child.tagName == 'property':
properties.append(child)
return properties
def get_accelerator_nodes(node):
assert node.tagName == 'object'
accelerators = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName == 'accelerator':
accelerators.append(child)
return accelerators
def get_object_node(child_node):
assert child_node.tagName == 'child', child_node
nodes = []
for node in child_node.childNodes:
if node.nodeType != Node.ELEMENT_NODE:
continue
if node.tagName == 'object':
nodes.append(node)
assert len(nodes) == 1, nodes
return nodes[0]
def copy_properties(node, props, prop_dict):
assert node.tagName == 'object'
for prop_name in props:
child = get_property_node(node, prop_name)
if child is not None:
prop_dict[prop_name] = child
return node
class GtkBuilderConverter(object):
def __init__(self, skip_windows, target_version, root):
self.skip_windows = skip_windows
self.target_version = target_version
self.root = root
self.root_objects = []
self.objects = {}
#
# Public API
#
def parse_file(self, file):
self._dom = minidom.parse(file)
self._parse()
def parse_buffer(self, buffer):
self._dom = minidom.parseString(buffer)
self._parse()
def to_xml(self):
xml = self._dom.toprettyxml("", "")
return xml.encode('utf-8')
#
# Private
#
def _get_object(self, name):
return self.objects.get(name)
def _get_objects_by_attr(self, attribute, value):
return [w for w in self._dom.getElementsByTagName("object")
if w.getAttribute(attribute) == value]
def _create_object(self, obj_class, obj_id, template=None, properties=None):
"""
Creates a new <object> tag.
Optionally a name template can be provided which will be used
to avoid naming collisions.
The properties dictionary can either contain string values or Node
values. If a node is provided the name of the node will be overridden
by the dictionary key.
@param obj_class: class of the object (class tag)
@param obj_id: identifier of the object (id tag)
@param template: name template to use, for example 'button'
@param properties: dictionary of properties
@type properties: string or Node.
@returns: Newly created node of the object
"""
if template is not None:
count = 1
while True:
obj_id = template + str(count)
widget = self._get_object(obj_id)
if widget is None:
break
count += 1
obj = self._dom.createElement('object')
obj.setAttribute('class', obj_class)
obj.setAttribute('id', obj_id)
if properties:
for name, value in properties.items():
if isinstance(value, Node):
# Reuse the node, so translatable and context still will be
# set when converting nodes. See also #509153
prop = value
else:
prop = self._dom.createElement('property')
prop.appendChild(self._dom.createTextNode(value))
prop.setAttribute('name', str(name))
obj.appendChild(prop)
self.objects[obj_id] = obj
return obj
def _create_root_object(self, obj_class, template, properties=None):
obj = self._create_object(obj_class, None, template, properties)
self.root_objects.append(obj)
return obj
def _parse(self):
glade_iface = self._dom.getElementsByTagName("glade-interface")
assert glade_iface, ("Badly formed XML, there is "
"no <glade-interface> tag.")
# Rename glade-interface to interface
glade_iface[0].tagName = 'interface'
self._interface = glade_iface[0]
# Remove glade-interface doc type
for node in self._dom.childNodes:
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
if node.name == 'glade-interface':
self._dom.removeChild(node)
# Strip unsupported tags
for tag in ['requires', 'requires-version']:
for child in self._dom.getElementsByTagName(tag):
child.parentNode.removeChild(child)
if self.root:
self._strip_root(self.root)
# Rename widget to object
objects = self._dom.getElementsByTagName("widget")
for node in objects:
node.tagName = "object"
for node in objects:
self._convert(node.getAttribute("class"), node)
if self._get_object(node.getAttribute('id')) is not None:
print "WARNING: duplicate id \"" + node.getAttribute('id') + "\""
self.objects[node.getAttribute('id')] = node
# Convert Gazpachos UI tag
for node in self._dom.getElementsByTagName("ui"):
self._convert_ui(node)
# Convert accessibility tag
for node in self._dom.getElementsByTagName("accessibility"):
self._convert_accessibility(node)
# Output the newly created root objects and sort them
# by attribute id
# FIXME: Use sorted(self.root_objects,
# key=lambda n: n.getAttribute('id'),
# reverse=True):
# when we can depend on python 2.4 or higher
root_objects = self.root_objects[:]
root_objects.sort(lambda a, b: cmp(b.getAttribute('id'),
a.getAttribute('id')))
for obj in root_objects:
self._interface.childNodes.insert(0, obj)
def _convert(self, klass, node):
if klass == 'GtkNotebook':
self._packing_prop_to_child_attr(node, "type", "tab")
elif klass in ['GtkExpander', 'GtkFrame']:
self._packing_prop_to_child_attr(
node, "type", "label_item", "label")
elif klass == "GtkMenuBar":
self._convert_menu(node)
elif klass == "GtkMenu":
# Only convert toplevel popups
if node.parentNode == self._interface:
self._convert_menu(node, popup=True)
elif klass in WINDOWS and self.skip_windows:
self._remove_window(node)
if self.target_version == "3.0":
if klass == "GtkComboBoxEntry":
node.setAttribute("class","GtkComboBox")
prop = self._dom.createElement("property")
prop.setAttribute("name", "has-entry")
prop.appendChild(self._dom.createTextNode("True"))
node.appendChild(prop)
elif klass == "GtkDialog":
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName != 'property':
continue
if (child.getAttribute("name") not in ("has-separator", "has_separator")):
continue;
node.removeChild(child)
break
self._default_widget_converter(node)
def _default_widget_converter(self, node):
klass = node.getAttribute("class")
for prop in get_property_nodes(node):
prop_name = prop.getAttribute("name")
if prop_name == "sizegroup":
self._convert_sizegroup(node, prop)
elif prop_name == "tooltip" and klass != "GtkAction":
prop.setAttribute("name", "tooltip-text")
elif prop_name in ["response_id", 'response-id']:
# It does not make sense to convert responses when
# we're not going to output dialogs
if self.skip_windows:
continue
object_id = node.getAttribute('id')
response = prop.childNodes[0].data
self._convert_dialog_response(node, object_id, response)
prop.parentNode.removeChild(prop)
elif prop_name == "adjustment":
self._convert_adjustment(prop)
elif prop_name == "items" and klass in ['GtkComboBox',
'GtkComboBoxEntry']:
self._convert_combobox_items(node, prop)
elif prop_name == "text" and klass == 'GtkTextView':
self._convert_textview_text(prop)
def _remove_window(self, node):
object_node = get_object_node(get_child_nodes(node)[0])
parent = node.parentNode
parent.removeChild(node)
parent.appendChild(object_node)
def _convert_menu(self, node, popup=False):
if node.hasAttribute('constructor'):
return
uimgr = self._create_root_object('GtkUIManager',
template='uimanager')
if popup:
name = 'popup'
else:
name = 'menubar'
menu = self._dom.createElement(name)
menu.setAttribute('name', node.getAttribute('id'))
node.setAttribute('constructor', uimgr.getAttribute('id'))
for child in get_child_nodes(node):
obj_node = get_object_node(child)
item = self._convert_menuitem(uimgr, obj_node)
menu.appendChild(item)
child.removeChild(obj_node)
child.parentNode.removeChild(child)
ui = self._dom.createElement('ui')
uimgr.appendChild(ui)
ui.appendChild(menu)
def _convert_menuitem(self, uimgr, obj_node):
children = get_child_nodes(obj_node)
name = 'menuitem'
if children:
child_node = children[0]
menu_node = get_object_node(child_node)
# Can be GtkImage, which will take care of later.
if menu_node.getAttribute('class') == 'GtkMenu':
name = 'menu'
object_class = obj_node.getAttribute('class')
if object_class in ['GtkMenuItem',
'GtkImageMenuItem',
'GtkCheckMenuItem',
'GtkRadioMenuItem']:
menu = self._dom.createElement(name)
elif object_class == 'GtkSeparatorMenuItem':
return self._dom.createElement('separator')
else:
raise NotImplementedError(object_class)
menu.setAttribute('action', obj_node.getAttribute('id'))
self._add_action_from_menuitem(uimgr, obj_node)
if children:
for child in get_child_nodes(menu_node):
obj_node = get_object_node(child)
item = self._convert_menuitem(uimgr, obj_node)
menu.appendChild(item)
child.removeChild(obj_node)
child.parentNode.removeChild(child)
return menu
def _menuitem_to_action(self, node, properties):
copy_properties(node, ['label', 'tooltip'], properties)
def _togglemenuitem_to_action(self, node, properties):
self._menuitem_to_action(node, properties)
copy_properties(node, ['active'], properties)
def _radiomenuitem_to_action(self, node, properties):
self._togglemenuitem_to_action(node, properties)
copy_properties(node, ['group'], properties)
def _add_action_from_menuitem(self, uimgr, node):
properties = {}
object_class = node.getAttribute('class')
object_id = node.getAttribute('id')
if object_class == 'GtkMenuItem':
name = 'GtkAction'
self._menuitem_to_action(node, properties)
elif object_class == 'GtkCheckMenuItem':
name = 'GtkToggleAction'
self._togglemenuitem_to_action(node, properties)
elif object_class == 'GtkRadioMenuItem':
name = 'GtkRadioAction'
self._radiomenuitem_to_action(node, properties)
elif object_class == 'GtkImageMenuItem':
name = 'GtkAction'
children = get_child_nodes(node)
if (children and
children[0].getAttribute('internal-child') == 'image'):
image = get_object_node(children[0])
child = get_property_node(image, 'stock')
if child is not None:
properties['stock_id'] = child
self._menuitem_to_action(node, properties)
elif object_class == 'GtkSeparatorMenuItem':
return
else:
raise NotImplementedError(object_class)
if get_property(node, 'use_stock') == 'True':
if 'label' in properties:
properties['stock_id'] = properties['label']
del properties['label']
properties['name'] = object_id
action = self._create_object(name,
object_id,
properties=properties)
for signal in get_signal_nodes(node):
signal_name = signal.getAttribute('name')
if signal_name in ['activate', 'toggled']:
action.appendChild(signal)
else:
print 'Unhandled signal %s::%s' % (node.getAttribute('class'),
signal_name)
if not uimgr.childNodes:
child = self._dom.createElement('child')
uimgr.appendChild(child)
group = self._create_object('GtkActionGroup', None,
template='actiongroup')
child.appendChild(group)
else:
group = uimgr.childNodes[0].childNodes[0]
child = self._dom.createElement('child')
group.appendChild(child)
child.appendChild(action)
for accelerator in get_accelerator_nodes(node):
signal_name = accelerator.getAttribute('signal')
if signal_name != 'activate':
print 'Unhandled accelerator signal for %s::%s' % (
node.getAttribute('class'), signal_name)
continue
accelerator.removeAttribute('signal')
child.appendChild(accelerator)
def _convert_sizegroup(self, node, prop):
# This is Gazpacho only
node.removeChild(prop)
obj = self._get_object(prop.childNodes[0].data)
if obj is None:
widgets = self._get_objects_by_attr("class", "GtkSizeGroup")
if widgets:
obj = widgets[-1]
else:
obj = self._create_root_object('GtkSizeGroup',
template='sizegroup')
widgets = obj.getElementsByTagName("widgets")
if widgets:
assert len(widgets) == 1
widgets = widgets[0]
else:
widgets = self._dom.createElement("widgets")
obj.appendChild(widgets)
member = self._dom.createElement("widget")
member.setAttribute("name", node.getAttribute("id"))
widgets.appendChild(member)
def _convert_dialog_response(self, node, object_name, response):
# 1) Get parent dialog node
while True:
# If we can't find the parent dialog, give up
if node == self._dom:
return
if (node.tagName == 'object' and
node.getAttribute('class') in DIALOGS):
dialog = node
break
node = node.parentNode
assert node
# 2) Get dialogs action-widgets tag, create if not found
for child in dialog.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName == 'action-widgets':
actions = child
break
else:
actions = self._dom.createElement("action-widgets")
dialog.appendChild(actions)
# 3) Add action-widget tag for the response
action = self._dom.createElement("action-widget")
action.setAttribute("response", response)
action.appendChild(self._dom.createTextNode(object_name))
actions.appendChild(action)
def _convert_adjustment(self, prop):
properties = {}
if prop.childNodes:
data = prop.childNodes[0].data
value, lower, upper, step, page, page_size = data.split(' ')
properties.update(value=value,
lower=lower,
upper=upper,
step_increment=step,
page_increment=page,
page_size=page_size)
else:
prop.appendChild(self._dom.createTextNode(""))
adj = self._create_root_object("GtkAdjustment",
template='adjustment',
properties=properties)
prop.childNodes[0].data = adj.getAttribute('id')
def _convert_combobox_items(self, node, prop):
parent = prop.parentNode
if not prop.childNodes:
parent.removeChild(prop)
return
translatable_attr = prop.attributes.get('translatable')
translatable = translatable_attr is not None and translatable_attr.value == 'yes'
has_context_attr = prop.attributes.get('context')
has_context = has_context_attr is not None and has_context_attr.value == 'yes'
comments_attr = prop.attributes.get('comments')
comments = comments_attr is not None and comments_attr.value or None
value = prop.childNodes[0].data
model = self._create_root_object("GtkListStore",
template="model")
columns = self._dom.createElement('columns')
model.appendChild(columns)
column = self._dom.createElement('column')
column.setAttribute('type', 'gchararray')
columns.appendChild(column)
data = self._dom.createElement('data')
model.appendChild(data)
if value.endswith('\n'):
value = value[:-1]
for item in value.split('\n'):
row = self._dom.createElement('row')
data.appendChild(row)
col = self._dom.createElement('col')
col.setAttribute('id', '0')
if translatable:
col.setAttribute('translatable', 'yes')
if has_context:
splitting = item.split('|', 1)
if len(splitting) == 2:
context, item = splitting
col.setAttribute('context', context)
if comments is not None:
col.setAttribute('comments', comments)
col.appendChild(self._dom.createTextNode(item))
row.appendChild(col)
model_prop = self._dom.createElement('property')
model_prop.setAttribute('name', 'model')
model_prop.appendChild(
self._dom.createTextNode(model.getAttribute('id')))
parent.appendChild(model_prop)
parent.removeChild(prop)
child = self._dom.createElement('child')
node.appendChild(child)
cell_renderer = self._create_object('GtkCellRendererText', None,
template='renderer')
child.appendChild(cell_renderer)
attributes = self._dom.createElement('attributes')
child.appendChild(attributes)
attribute = self._dom.createElement('attribute')
attributes.appendChild(attribute)
attribute.setAttribute('name', 'text')
attribute.appendChild(self._dom.createTextNode('0'))
def _convert_textview_text(self, prop):
if not prop.childNodes:
prop.parentNode.removeChild(prop)
return
data = prop.childNodes[0].data
if prop.hasAttribute('translatable'):
prop.removeAttribute('translatable')
tbuffer = self._create_root_object("GtkTextBuffer",
template='textbuffer',
properties=dict(text=data))
prop.childNodes[0].data = tbuffer.getAttribute('id')
prop.setAttribute('name', 'buffer')
def _packing_prop_to_child_attr(self, node, prop_name, prop_val,
attr_val=None):
for child in get_child_nodes(node):
packing_props = [p for p in child.childNodes if p.nodeName == "packing"]
if not packing_props:
continue
assert len(packing_props) == 1
packing_prop = packing_props[0]
properties = packing_prop.getElementsByTagName("property")
for prop in properties:
if (prop.getAttribute("name") != prop_name or
prop.childNodes[0].data != prop_val):
continue
packing_prop.removeChild(prop)
child.setAttribute(prop_name, attr_val or prop_val)
if len(properties) == 1:
child.removeChild(packing_prop)
def _convert_ui(self, node):
cdata = node.childNodes[0]
data = cdata.toxml().strip()
if not data.startswith("<![CDATA[") or not data.endswith("]]>"):
return
data = data[9:-3]
child = minidom.parseString(data).childNodes[0]
nodes = child.childNodes[:]
for child_node in nodes:
node.appendChild(child_node)
node.removeChild(cdata)
if not node.hasAttribute("id"):
return
# Updating references made by widgets
parent_id = node.parentNode.getAttribute("id")
for widget in self._get_objects_by_attr("constructor",
node.getAttribute("id")):
widget.getAttributeNode("constructor").value = parent_id
node.removeAttribute("id")
def _convert_accessibility(self, node):
objectNode = node.parentNode
parent_id = objectNode.getAttribute("id")
properties = {}
for node in node.childNodes:
if node.nodeName == 'atkproperty':
node.tagName = 'property'
properties[node.getAttribute('name')] = node
node.parentNode.removeChild(node)
elif node.nodeName == 'atkrelation':
node.tagName = 'relation'
relation_type = node.getAttribute('type')
relation_type = relation_type.replace('_', '-')
node.setAttribute('type', relation_type)
elif node.nodeName == 'atkaction':
node.tagName = 'action'
if properties:
child = self._dom.createElement('child')
child.setAttribute("internal-child", "accessible")
atkobject = self._create_object(
"AtkObject", None,
template='a11y-%s' % (parent_id,),
properties=properties)
child.appendChild(atkobject)
objectNode.appendChild(child)
def _strip_root(self, root_name):
for widget in self._dom.getElementsByTagName("widget"):
if widget.getAttribute('id') == root_name:
break
else:
raise SystemExit("Could not find an object called `%s'" % (
root_name))
for child in self._interface.childNodes[:]:
if child.nodeType != Node.ELEMENT_NODE:
continue
child.parentNode.removeChild(child)
self._interface.appendChild(widget)
def _indent(output):
if not subprocess:
return output
for directory in os.environ['PATH'].split(os.pathsep):
filename = os.path.join(directory, 'xmllint')
if os.path.exists(filename):
break
else:
return output
s = subprocess.Popen([filename, '--format', '-'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
s.stdin.write(output)
s.stdin.close()
return s.stdout.read()
def usage():
print __doc__
def main(args):
try:
opts, args = getopt.getopt(args[1:], "hwr:",
["help",
"skip-windows",
"target-version=",
"root="])
except getopt.GetoptError:
usage()
return 2
if len(args) != 2:
usage()
return 2
input_filename, output_filename = args
skip_windows = False
split = False
root = None
target_version = "2.0"
for o, a in opts:
if o in ("-h", "--help"):
usage()
sys.exit()
elif o in ("-r", "--root"):
root = a
elif o in ("-w", "--skip-windows"):
skip_windows = True
elif o in ("-t", "--target-version"):
target_version = a
conv = GtkBuilderConverter(skip_windows=skip_windows,
target_version=target_version,
root=root)
conv.parse_file(input_filename)
xml = _indent(conv.to_xml())
if output_filename == "-":
print xml
else:
open(output_filename, 'w').write(xml)
print "Wrote", output_filename
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))

Binary file not shown.

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="AMD64"
name="gtk-update-icon-cache.exe"
type="win32"/>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More