Skip to content

Commit 9beeb48

Browse files
committed
Tuio client split into its own package
1 parent 7a974b5 commit 9beeb48

File tree

5 files changed

+74
-7
lines changed

5 files changed

+74
-7
lines changed

all.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eux
44

5-
for d in iup iup-glcanvas iup-pplot iup-webbrowser demos
5+
for d in iup iup-glcanvas iup-pplot iup-tuio iup-webbrowser demos
66
do
77
gomake -j 4 -C $d "$@"
88
done

iup-tuio/Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2011 by Jeremy Cowgar <[email protected]>
2+
#
3+
# This file is part of go-iup.
4+
#
5+
# go-iup is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU Lesser General Public License as
7+
# published by the Free Software Foundation, either version 3 of
8+
# the License, or (at your option) any later version.
9+
#
10+
# go-iup is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with go-iup. If not, see <http://www.gnu.org/licenses/>.
17+
18+
# Use "gomake install" to build and install
19+
20+
include $(GOROOT)/src/Make.inc
21+
22+
TARG=github.com/jcowgar/go-iup/tuio
23+
DEPS=../iup
24+
CGOFILES=tuio.go
25+
26+
include $(GOROOT)/src/Make.pkg

iup-tuio/tuio.go

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Copyright (C) 2011 by Jeremy Cowgar <[email protected]>
3+
4+
This file is part of go-iup.
5+
6+
go-iup is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU Lesser General Public License as
8+
published by the Free Software Foundation, either version 3 of
9+
the License, or (at your option) any later version.
10+
11+
go-iup is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with go-iup. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package pplot
21+
22+
/*
23+
#cgo LDFLAGS: -liupcontrols -liuptuio
24+
#cgo linux LDFLAGS: -liupgtk
25+
#cgo windows LDFLAGS: -liup -lgdi32 -lole32 -lcomdlg32 -lcomctl32
26+
27+
#include <stdlib.h>
28+
#include <iup.h>
29+
#include <iupcontrols.h>
30+
#include <iuptuio.h>
31+
*/
32+
import "C"
33+
import . "github.com/jcowgar/go-iup"
34+
35+
var tuioLibOpened = false
36+
37+
func TuioClient(port int) *Ihandle {
38+
OpenControlLib()
39+
40+
if tuioLibOpened == false {
41+
C.IupTuioOpen()
42+
tuioLibOpened = true
43+
}
44+
45+
return (*Ihandle)(C.IupTuioClient(C.int(port)))
46+
}

iup/core.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
package iup
2121

2222
/*
23-
#cgo LDFLAGS: -liupcontrols -liupcd -liuptuio -liupim
23+
#cgo LDFLAGS: -liupcontrols -liupcd -liupim
2424
#cgo linux LDFLAGS: -liupgtk
2525
#cgo windows LDFLAGS: -liup -lgdi32 -lole32 -lcomdlg32 -lcomctl32
2626

iup/resources.go

-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ package iup
2222
/*
2323
#include <stdlib.h>
2424
#include <iup.h>
25-
#include <iuptuio.h>
2625
#include <iupim.h>
2726
*/
2827
import "C"
@@ -206,10 +205,6 @@ func Timer() *Ihandle {
206205
return (*Ihandle)(C.IupTimer())
207206
}
208207

209-
func TuioClient(port int) *Ihandle {
210-
return (*Ihandle)(C.IupTuioClient(C.int(port)))
211-
}
212-
213208
func User() *Ihandle {
214209
return (*Ihandle)(C.IupUser())
215210
}

0 commit comments

Comments
 (0)