Skip to content

cgo fixes via @amlwwalker via @SjB #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
85e55c7
New API with Run on main thread.
niemeyer May 1, 2014
a664ad4
s/qml.v0/qml.v1/
niemeyer May 2, 2014
74294f0
Move the gl package under work-in-progress.
niemeyer Aug 13, 2014
1b0d88b
Update all examples with new API.
niemeyer Aug 13, 2014
534150a
update README for v1 branch
jhawk28 Aug 14, 2014
dbdeaea
cdata: use g->m
niemeyer Aug 14, 2014
f020d78
Changed examples url to match current branch
Aug 14, 2014
4457ebd
cpp/capi.cpp: fix ImageProvider leak
cookieo9 Aug 16, 2014
f84f9ae
update requirements for OS X
adg Aug 20, 2014
7b344dd
Merge pull request #88 from cookieo9/memfix
niemeyer Aug 20, 2014
fcf0740
Merge pull request #87 from nf/v1
niemeyer Aug 20, 2014
6e78849
Merge pull request #81 from jhawk28/patch-1
niemeyer Aug 20, 2014
5f7fdd0
Merge pull request #82 from perrito666/v1
niemeyer Aug 20, 2014
4f4a7f5
Handle Paint panics to workaround Go issue #8588.
niemeyer Aug 25, 2014
97c4e8c
New GL API.
niemeyer Apr 21, 2014
8e569b4
Port GL examples to new API.
niemeyer Aug 27, 2014
539bf5a
Use native Go types for meaningless GL types.
niemeyer Aug 28, 2014
43aa533
Move common GL types to glbase.
niemeyer Aug 28, 2014
c74beaa
Start introducing types for well known objects.
niemeyer Aug 28, 2014
b8b5c15
Drop types from consecutive params when possible.
niemeyer Aug 28, 2014
8c84461
Split func tweaking logic and start doc importing.
niemeyer Aug 28, 2014
8e7aff4
Commit current gl packages for publishing.
niemeyer Aug 28, 2014
a598350
Port examples to latest API tweak.
niemeyer Aug 28, 2014
9031cc6
Drop explicit linking with GL libraries.
niemeyer Aug 29, 2014
4432d5f
Update README to use qml.v1
owenthereal Aug 29, 2014
265c7b0
Add Clampf and Clampd to glbase.
niemeyer Sep 1, 2014
f59a4bb
Add back explicit GL linking to es2.
niemeyer Sep 1, 2014
1efc244
Booleans are now native. Boolean/TRUE/FALSE gone.
niemeyer Sep 1, 2014
0792804
More glbase types, richer func tweaks.
niemeyer Sep 2, 2014
00ff374
Unmix glresult and result in funcReturnResult.
niemeyer Sep 2, 2014
c9be844
Simplify language.
niemeyer Sep 2, 2014
4e2a8e0
Polished a few traditional ES2 functions.
niemeyer Sep 2, 2014
df4c093
Add ES2 painting example with shaders.
niemeyer Sep 2, 2014
6a397ef
Polish VertexAttribPointer.
niemeyer Sep 3, 2014
7dd7202
Convert many size-agnostic int32s to plain ints.
niemeyer Sep 3, 2014
45b5540
Simple tweak reordering.
niemeyer Sep 3, 2014
6b0feaf
Polish the whole Uniform* family of functions.
niemeyer Sep 3, 2014
5cee1b3
Drop doc link from functions already documented.
niemeyer Sep 3, 2014
79bf6cb
Polished GetProgram{iv,InfoLog}.
niemeyer Sep 3, 2014
2233843
Custom types for {render,frame}buffer and plurals.
niemeyer Sep 4, 2014
5f68d72
Polish a few Gen* and Delete* GL functions.
niemeyer Sep 4, 2014
46984f3
Fix bug in the selection of GL constants.
niemeyer Sep 4, 2014
4fd76df
Postpone type initialization if happening in Paint.
niemeyer Sep 4, 2014
2fcb6e2
Fix GL test in the suite.
niemeyer Sep 4, 2014
ea1e5fb
Make ObjectByName work with Go types too.
niemeyer Sep 5, 2014
0691e15
Safety check on ObjectByName.
niemeyer Sep 5, 2014
e3d7ffd
Force consts on all GL profiles to be processed.
niemeyer Sep 6, 2014
a98beac
Fix handling of glbase.Sync.
niemeyer Sep 6, 2014
6b4ad68
Convert offset in VertexAttribPointer to uintptr.
niemeyer Sep 6, 2014
b89e5bc
Workaround issue #84 (QTBUG-41193).
niemeyer Sep 9, 2014
cedade8
Merge pull request #92 from jingweno/patch-1
niemeyer Sep 10, 2014
8d74b65
README: another v0 => v1 reference
niemeyer Sep 10, 2014
ab659ec
README: use dev packages rather than ubuntu-sdk
niemeyer Sep 10, 2014
364da65
Do not reuse JS-owned wrapper values.
niemeyer Sep 10, 2014
5bad8a5
Implement mprotect function for Windows.
niemeyer Sep 11, 2014
824784c
Fix simple naming mistake
Sep 11, 2014
888d1e8
mmemwin: PAGE_READ => PAGE_READONLY
niemeyer Sep 12, 2014
b35cbc7
Ported some of the qtquickcontrols examples
cristim Sep 21, 2014
65cbb45
Support bundling of resources into the binary.
niemeyer Sep 26, 2014
76a2703
Add high-level summary to genqrc documentation.
niemeyer Sep 26, 2014
250377a
Documentation updates.
niemeyer Sep 26, 2014
40739e1
Documentation spacing fixes.
niemeyer Sep 26, 2014
e55ddbe
Update genqrc documentation after help text.
niemeyer Sep 26, 2014
f0a005b
Merge pull request #100 from GeertJohan/patch-1
niemeyer Oct 2, 2014
b94596a
Move cdata logic to assembly in Go 1.4+.
niemeyer Oct 6, 2014
7fdf7e3
Update setup.sh
lomoalbert Oct 8, 2014
ab36fb4
Update README.md
lomoalbert Oct 8, 2014
871e3a7
Merge pull request #110 from vzever/v1
niemeyer Oct 9, 2014
18fd325
README: fix requirements to refer to Go >= 1.2
niemeyer Oct 13, 2014
6e34c23
Merge branch 'v1' of github.com:go-qml/qml into v1
niemeyer Oct 13, 2014
b65658d
Update setup.sh
lomoalbert Oct 8, 2014
07cb71e
Update README.md
lomoalbert Oct 8, 2014
ad9c0dd
Fix bug in resource packing.
niemeyer Oct 20, 2014
929da27
Merge branch 'v1' of github.com:go-qml/qml into v1
niemeyer Oct 20, 2014
1116cb9
Merge pull request #105 from cristim/v1
niemeyer Oct 24, 2014
154c0d1
Make sure context.file is not null before calling strlen
tsdgeos Feb 9, 2015
2ee7e5f
Merge pull request #144 from tsdgeos/v1
niemeyer Feb 9, 2015
826359a
Porting go-qml to Go 1.6
SjB Apr 5, 2016
01021bc
change datatype the foldr from uintptr to C.GoRef
SjB Apr 6, 2016
2628b57
refactor valueFold.
SjB Apr 6, 2016
a4363f7
added reference lookup for signal function
SjB Apr 6, 2016
ea70551
added reference lookup for go TypeSpec type
SjB Apr 6, 2016
0309d2d
fix missing goRef function
SjB Apr 6, 2016
d4c4a72
fix forgotten dereferenced datap pointer.
SjB Jul 1, 2016
f9db098
fixed MouseArea On Event call back refrence error
SjB Jul 21, 2016
17ea716
adding changes to work with 1.6
Mar 4, 2017
ab29fd7
Merge branch 'master' into go1.6-port
Mar 16, 2017
28c538d
updating readme
Mar 16, 2017
7d9d06b
Lining up genqrc between go-qml and amlwwalker forks
jackman0 Mar 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 185 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
This software is licensed under the LGPLv3, included below.

As a special exception to the GNU Lesser General Public License version 3
("LGPL3"), the copyright holders of this Library give you permission to
convey to a third party a Combined Work that links statically or dynamically
to this Library without providing any Minimal Corresponding Source or
Minimal Application Code as set out in 4d or providing the installation
information set out in section 4e, provided that you comply with the other
provisions of LGPL3 and provided that you meet, for the Application the
terms and conditions of the license(s) which apply to the Application.

Except as stated in this special exception, the provisions of LGPL3 will
continue to comply in full to this Library. If you modify this Library, you
may apply this exception to your version of this Library, but you are not
obliged to do so. If you do not wish to do so, delete this exception
statement from your version. This exception does not (and cannot) modify any
license terms which apply to the Application, with which you must still
comply.


GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
164 changes: 164 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# QML support for the Go language

## amlwwalker/qml

* I have made the `go1.6-port` branch the master branch here as it seems more relevant in this day and age...
* It is not my work, but I have been using it for a while so please shout if I can help!



Original Documentation
-------------

The introductory documentation as well as the detailed API documentation is
available at [gopkg.in/qml.v1](http://godoc.org/gopkg.in/qml.v1).


Blog posts
----------

Some relevant blog posts:

* [Announcing qml v1 for Go](http://blog.labix.org/2014/08/13/announcing-qml-v1-for-go)
* [Packing resources into Go qml binaries](http://blog.labix.org/2014/09/26/packing-resources-into-go-qml-binaries)
* [Go qml contest results](http://blog.labix.org/2014/04/25/qml-contest-results)
* [Arbitrary Qt extensions with Go qml](http://blog.labix.org/2014/03/21/arbitrary-qt-extensions-with-go-qml)
* [The new Go qml OpenGL API](http://blog.labix.org/2014/08/29/the-new-go-qml-opengl-api)
* [QML components with Go and OpenGL](http://blog.labix.org/2013/12/23/qml-components-with-go-and-opengl)


Videos
------

These introductory videos demonstrate the use of Go QML:

* [Initial demo and overview](http://youtu.be/FVQlMrPa7lI)
* [Initial demo running on an Ubuntu Touch phone](http://youtu.be/HB-3o8Cysec)
* [Spinning Gopher with Go + QML + OpenGL](http://youtu.be/qkH7_dtOyPk)
* [SameGame QML tutorial in Go](http://youtu.be/z8noX48hiMI)


Community
---------

Please join the [mailing list](https://groups.google.com/forum/#!forum/go-qml) for
following relevant development news and discussing project details.


Installation
------------

To try the alpha release you'll need:

* Go >= 1.2, for the C++ support of _go build_
* Qt 5.0.X or 5.1.X with the development files
* The Qt headers qmetaobject_p.h and qmetaobjectbuilder_p.h, for the dynamic meta object support

See below for more details about getting these requirements installed in different environments and operating systems.

After the requirements are satisfied, _go get_ should work as usual:

go get gopkg.in/qml.v1


Requirements on Ubuntu
----------------------

If you are using Ubuntu, the [Ubuntu SDK](http://developer.ubuntu.com/get-started/) will take care of the Qt dependencies:

$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
$ sudo apt-get update
$ sudo apt-get install qtdeclarative5-dev qtbase5-private-dev qtdeclarative5-private-dev libqt5opengl5-dev qtdeclarative5-qtquick2-plugin

and Go >= 1.2 may be installed using [godeb](http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-go):

$ # Pick the right one for your system: 386 or amd64
$ ARCH=amd64
$ wget -q https://godeb.s3.amazonaws.com/godeb-$ARCH.tar.gz
$ tar xzvf godeb-$ARCH.tar.gz
godeb
$ sudo mv godeb /usr/local/bin
$ godeb install
$ go get gopkg.in/qml.v1


Requirements on Ubuntu Touch
----------------------------

After following the [installation instructions](https://wiki.ubuntu.com/Touch/Install) for Ubuntu Touch,
run the following commands to get a working build environment inside the device:

$ adb shell
# cd /tmp
# wget https://github.com/go-qml/qml/raw/v1/cmd/ubuntu-touch/setup.sh
# /bin/bash setup.sh
# su - phablet
$

At the end of setup.sh, the phablet user will have GOPATH=$HOME in the environment,
the qml package will be built, and the particle example will be built and run. For
stopping it from the command line, run as the phablet user:

$ ubuntu-app-stop gopkg.in.qml.particle-example

for running it again:

$ ubuntu-app-launch gopkg.in.qml.particle-example

These commands depend on the following file, installed by setup.sh:

~/.local/share/applications/gopkg.in.qml.particle-example.desktop


Requirements on Mac OS X
------------------------

On Mac OS X you'll need QT5. It's easiest to install with Homebrew, a
third-party package management system for OS X.

Installation instructions for Homebrew are here:

http://brew.sh/

Then, install the qt5 and pkg-config packages:

$ brew install qt5 pkg-config

Then, force brew to "link" qt5 (this makes it available under /usr/local):

$ brew link --force qt5

And finally, fetch and install go-qml:

$ go get gopkg.in/qml.v1


Requirements on Windows
-----------------------

On Windows you'll need the following:

* [MinGW gcc](http://sourceforge.net/projects/mingw/files/latest/download) 4.8.1 (install mingw-get and install the gcc from within the setup GUI)
* [Qt 5.1.1](http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-windows-opensource-5.1.1-mingw48_opengl-x86-offline.exe) for MinGW 4.8
* [Go >= 1.2](http://golang.org/doc/install)

Then, assuming Qt was installed under `C:\Qt5.1.1\`, set up the following environment variables in the respective configuration:

CPATH += C:\Qt5.1.1\5.1.1\mingw48_32\include
LIBRARY_PATH += C:\Qt5.1.1\5.1.1\mingw48_32\lib
PATH += C:\Qt5.1.1\5.1.1\mingw48_32\bin

After reopening the shell for the environment changes to take effect, this should work:

go get gopkg.in/qml.v1


Requirements everywhere else
----------------------------

If your operating system does not offer these dependencies readily,
you may still have success installing [Go >= 1.2](http://golang.org/doc/install)
and [Qt 5.0.2](http://download.qt-project.org/archive/qt/5.0/5.0.2/)
directly from the upstreams. Note that you'll likely have to adapt
environment variables to reflect the custom installation path for
these libraries. See the instructions above for examples.
12 changes: 12 additions & 0 deletions all.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

#include "cpp/capi.cpp"
#include "cpp/govalue.cpp"
#include "cpp/govaluetype.cpp"
#include "cpp/idletimer.cpp"
#include "cpp/connector.cpp"

#include "cpp/moc_all.cpp"

#ifdef _WIN32
#include "cpp/mmemwin.cpp"
#endif
Loading