ruby-gr 0.0.19 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +50 -49
- data/lib/gr.rb +1010 -842
- data/lib/gr/ffi.rb +2 -1
- data/lib/gr/plot.rb +219 -138
- data/lib/gr3.rb +295 -246
- data/lib/gr_commons/define_methods.rb +5 -5
- data/lib/gr_commons/fiddley.rb +7 -7
- data/lib/gr_commons/gr_common_utils.rb +5 -5
- data/lib/gr_commons/gr_commons.rb +4 -0
- data/lib/gr_commons/gr_logger.rb +106 -0
- data/lib/gr_commons/jupyter_support.rb +5 -5
- data/lib/gr_commons/search_shared_library.rb +74 -0
- data/lib/gr_commons/version.rb +1 -1
- data/lib/grm.rb +23 -16
- data/lib/grm/ffi.rb +22 -13
- metadata +25 -10
- data/lib/gr/plot.rb.md +0 -172
|
@@ -5,8 +5,8 @@ module GRCommons
|
|
|
5
5
|
module DefineMethods
|
|
6
6
|
private
|
|
7
7
|
|
|
8
|
-
def define_ffi_methods(
|
|
9
|
-
|
|
8
|
+
def define_ffi_methods(ffi_module, prefix: '', default_type: :double)
|
|
9
|
+
ffi_module.ffi_methods.each do |method|
|
|
10
10
|
# Use delete_prefix (Ruby >= 2.5)
|
|
11
11
|
method_name = method.to_s.sub(/^#{prefix}/, '')
|
|
12
12
|
|
|
@@ -16,14 +16,14 @@ module GRCommons
|
|
|
16
16
|
args.map! do |arg|
|
|
17
17
|
case arg
|
|
18
18
|
when Array
|
|
19
|
-
GRCommons::GRCommonUtils.
|
|
19
|
+
GRCommons::GRCommonUtils.public_send(default_type, arg)
|
|
20
20
|
when ->(x) { defined?(Numo::NArray) && x.is_a?(Numo::NArray) }
|
|
21
|
-
GRCommons::GRCommonUtils.
|
|
21
|
+
GRCommons::GRCommonUtils.public_send(default_type, arg)
|
|
22
22
|
else
|
|
23
23
|
arg
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
|
-
|
|
26
|
+
ffi_module.public_send(method, *args)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
end
|
data/lib/gr_commons/fiddley.rb
CHANGED
|
@@ -13,7 +13,7 @@ module GRCommons
|
|
|
13
13
|
# NOTE: This module is only part of the original code.
|
|
14
14
|
# kojix2 adds, deletes, and modifies several methods.
|
|
15
15
|
module Fiddley
|
|
16
|
-
# NOTE: GR.rb supports 2.
|
|
16
|
+
# NOTE: GR.rb supports 2.5 +. Unpack 1 does not work under 2.3.
|
|
17
17
|
|
|
18
18
|
module Utils
|
|
19
19
|
# assumes short = 16bit, int = 32bit, long long = 64bit
|
|
@@ -210,7 +210,7 @@ module GRCommons
|
|
|
210
210
|
end
|
|
211
211
|
|
|
212
212
|
define_method("put_array_of_int#{bits}") do |offset, ary|
|
|
213
|
-
put_bytes(offset, ary.pack(form
|
|
213
|
+
put_bytes(offset, ary.pack("#{form}*"))
|
|
214
214
|
end
|
|
215
215
|
|
|
216
216
|
define_method("write_array_of_int#{bits}") do |ary|
|
|
@@ -226,7 +226,7 @@ module GRCommons
|
|
|
226
226
|
end
|
|
227
227
|
|
|
228
228
|
define_method("get_array_of_int#{bits}") do |offset, num|
|
|
229
|
-
@ptr[offset, bytes * num].unpack(form
|
|
229
|
+
@ptr[offset, bytes * num].unpack("#{form}*")
|
|
230
230
|
end
|
|
231
231
|
|
|
232
232
|
define_method("read_array_of_int#{bits}") do |num|
|
|
@@ -244,7 +244,7 @@ module GRCommons
|
|
|
244
244
|
end
|
|
245
245
|
|
|
246
246
|
define_method("put_array_of_uint#{bits}") do |offset, ary|
|
|
247
|
-
put_bytes(offset, ary.pack(form2
|
|
247
|
+
put_bytes(offset, ary.pack("#{form2}*"))
|
|
248
248
|
end
|
|
249
249
|
|
|
250
250
|
define_method("write_array_of_uint#{bits}") do |ary|
|
|
@@ -260,7 +260,7 @@ module GRCommons
|
|
|
260
260
|
end
|
|
261
261
|
|
|
262
262
|
define_method("get_array_of_uint#{bits}") do |offset, num|
|
|
263
|
-
@ptr[offset, bytes * num].unpack(form2
|
|
263
|
+
@ptr[offset, bytes * num].unpack("#{form2}*")
|
|
264
264
|
end
|
|
265
265
|
|
|
266
266
|
define_method("read_array_of_uint#{bits}") do |num|
|
|
@@ -330,12 +330,12 @@ module GRCommons
|
|
|
330
330
|
|
|
331
331
|
# added
|
|
332
332
|
define_method('get_array_of_double') do |offset, num|
|
|
333
|
-
@ptr[offset, 8 * num].unpack('d
|
|
333
|
+
@ptr[offset, 8 * num].unpack('d*')
|
|
334
334
|
end
|
|
335
335
|
|
|
336
336
|
# added
|
|
337
337
|
define_method('get_array_of_float') do |offset, num|
|
|
338
|
-
@ptr[offset, 4 * num].unpack('f
|
|
338
|
+
@ptr[offset, 4 * num].unpack('f*')
|
|
339
339
|
end
|
|
340
340
|
|
|
341
341
|
# added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require_relative 'fiddley'
|
|
4
4
|
|
|
5
5
|
module GRCommons
|
|
6
6
|
# This module provides functionality common to GR and GR3.
|
|
@@ -43,7 +43,7 @@ module GRCommons
|
|
|
43
43
|
if narray?(data)
|
|
44
44
|
Numo::Int32.cast(data).to_binary
|
|
45
45
|
else
|
|
46
|
-
Fiddley::Utils.array2str(:int32, data.to_a.flatten)
|
|
46
|
+
Fiddley::Utils.array2str(:int32, data.to_a.flatten) # TODO
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -52,7 +52,7 @@ module GRCommons
|
|
|
52
52
|
if narray?(data)
|
|
53
53
|
Numo::UInt32.cast(data).to_binary
|
|
54
54
|
else
|
|
55
|
-
Fiddley::Utils.array2str(:uint, data.to_a.flatten)
|
|
55
|
+
Fiddley::Utils.array2str(:uint, data.to_a.flatten) # TODO
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
@@ -117,9 +117,9 @@ module GRCommons
|
|
|
117
117
|
when Hash
|
|
118
118
|
typ = type.keys[0]
|
|
119
119
|
len = type.values[0]
|
|
120
|
-
pt.
|
|
120
|
+
pt.public_send("read_array_of_#{typ}", len)
|
|
121
121
|
else
|
|
122
|
-
pt.
|
|
122
|
+
pt.public_send("read_#{type}")
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
125
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This script was created primarily for debugging purposes.
|
|
4
|
+
# Note: This script should be isolated.
|
|
5
|
+
# It should not be loaded when gr_commons/gr_commons is loaded.
|
|
6
|
+
|
|
7
|
+
require 'logger'
|
|
8
|
+
require 'rainbow'
|
|
9
|
+
require 'awesome_print'
|
|
10
|
+
|
|
11
|
+
module GRCommons
|
|
12
|
+
class << self
|
|
13
|
+
# Create a new GRLogger
|
|
14
|
+
# @params out [String]
|
|
15
|
+
# @return [GRLogger]
|
|
16
|
+
# @example
|
|
17
|
+
# require 'gr_commons/gr_logger'
|
|
18
|
+
# GRCommons.gr_log("log.txt")
|
|
19
|
+
def gr_log(out = $stderr)
|
|
20
|
+
GRCommons::GRLogger.new(out)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Return the last created GRLogger
|
|
24
|
+
# @return [GRLogger]
|
|
25
|
+
def gr_logger
|
|
26
|
+
GRCommons::GRLogger.logger
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Outputs function calls to GR Framework to a log file.
|
|
31
|
+
# Mainly used for debugging.
|
|
32
|
+
# @note This module is for those who want to see low-level function calls in GR.
|
|
33
|
+
#
|
|
34
|
+
# = How it works
|
|
35
|
+
# prepend a module named Inspector to the singular class
|
|
36
|
+
# of the FFI module. It will inspects the GR function call of the FFI module
|
|
37
|
+
#
|
|
38
|
+
# @example
|
|
39
|
+
# require 'gr_commons/gr_logger'
|
|
40
|
+
# GRCommons.gr_log("log.txt")
|
|
41
|
+
class GRLogger < Logger
|
|
42
|
+
# Return the last created GRLogger
|
|
43
|
+
def self.logger
|
|
44
|
+
@@logger ||= GRCommons::GRLogger.new
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(out = $stderr)
|
|
48
|
+
super(out, level: :info)
|
|
49
|
+
@@logger ||= self
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
if Object.const_defined?(:GR)
|
|
55
|
+
module GR
|
|
56
|
+
module FFI
|
|
57
|
+
module Inspector
|
|
58
|
+
GR::FFI.ffi_methods.each do |s|
|
|
59
|
+
define_method(s) do |*args|
|
|
60
|
+
GRCommons.gr_logger.info "GR::FFI.#{s}\n" + args.ai + "\n"
|
|
61
|
+
super(*args)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
class << self
|
|
66
|
+
prepend Inspector
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if Object.const_defined?(:GR3)
|
|
73
|
+
module GR3
|
|
74
|
+
module FFI
|
|
75
|
+
module Inspector
|
|
76
|
+
GR3::FFI.ffi_methods.each do |s|
|
|
77
|
+
define_method(s) do |*args|
|
|
78
|
+
GRCommons.gr_logger.info "GR3::FFI.#{s}\n" + args.ai + "\n"
|
|
79
|
+
super(*args)
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
class << self
|
|
84
|
+
prepend Inspector
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if Object.const_defined?(:GRM)
|
|
91
|
+
module GRM
|
|
92
|
+
module FFI
|
|
93
|
+
module Inspector
|
|
94
|
+
GRM::FFI.ffi_methods.each do |s|
|
|
95
|
+
define_method(s) do |*args|
|
|
96
|
+
GRCommons.gr_logger.info "GRM::FFI.#{s}\n" + args.ai + "\n"
|
|
97
|
+
super(*args)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
class << self
|
|
102
|
+
prepend Inspector
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
@@ -19,16 +19,16 @@ module GRCommons
|
|
|
19
19
|
type = ENV['GKSwstype']
|
|
20
20
|
case type
|
|
21
21
|
when 'svg'
|
|
22
|
-
data = File.read(ENV['GKS_FILEPATH']
|
|
22
|
+
data = File.read("#{ENV['GKS_FILEPATH']}.svg")
|
|
23
23
|
IRuby.display(data, mime: 'image/svg+xml') if display
|
|
24
24
|
when 'png', '322', '140'
|
|
25
|
-
data = File.read(ENV['GKS_FILEPATH']
|
|
25
|
+
data = File.read("#{ENV['GKS_FILEPATH']}.png")
|
|
26
26
|
IRuby.display(data, mime: 'image/png') if display
|
|
27
27
|
when 'jpg', '321', '144'
|
|
28
|
-
data = File.read(ENV['GKS_FILEPATH']
|
|
28
|
+
data = File.read("#{ENV['GKS_FILEPATH']}.jpg")
|
|
29
29
|
IRuby.display(data, mime: 'image/jpeg') if display
|
|
30
30
|
when 'gif', '130'
|
|
31
|
-
data = File.read(ENV['GKS_FILEPATH']
|
|
31
|
+
data = File.read("#{ENV['GKS_FILEPATH']}.gif")
|
|
32
32
|
IRuby.display(data, mime: 'image/gif') if display
|
|
33
33
|
when 'webm', 'ogg', 'mp4', 'mov'
|
|
34
34
|
require 'base64'
|
|
@@ -37,7 +37,7 @@ module GRCommons
|
|
|
37
37
|
else
|
|
38
38
|
"video/#{type}"
|
|
39
39
|
end
|
|
40
|
-
data = File.binread(ENV['GKS_FILEPATH']
|
|
40
|
+
data = File.binread("#{ENV['GKS_FILEPATH']}.#{type}")
|
|
41
41
|
if display
|
|
42
42
|
IRuby.display(
|
|
43
43
|
"<video autoplay controls><source type=\"#{mimespec}\" " \
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'pkg-config'
|
|
4
|
+
|
|
5
|
+
module GRCommons
|
|
6
|
+
# This module helps GR, GR and GRM to search the shared library.
|
|
7
|
+
#
|
|
8
|
+
# The order of priority:
|
|
9
|
+
# 1. RubyInstaller ( for Windows only )
|
|
10
|
+
# 2. Environment variable GRDIR
|
|
11
|
+
# 3. pkg-config : https://github.com/ruby-gnome/pkg-config
|
|
12
|
+
# The following packages (should) support pkg-config.
|
|
13
|
+
# - Linux
|
|
14
|
+
# - Red Data Tools https://github.com/red-data-tools/packages.red-data-tools.org
|
|
15
|
+
# - libgr-dev
|
|
16
|
+
# - libgr3-dev
|
|
17
|
+
# - libgrm-dev
|
|
18
|
+
# - Mac
|
|
19
|
+
# - Homebrew https://github.com/Homebrew/homebrew-core
|
|
20
|
+
# - libgr
|
|
21
|
+
# - Windows
|
|
22
|
+
# - MinGW https://github.com/msys2/MINGW-packages
|
|
23
|
+
# - mingw-w64-gr
|
|
24
|
+
module SearchSharedLibrary
|
|
25
|
+
# Search the shared library.
|
|
26
|
+
# @note This method does not detect the Operating System.
|
|
27
|
+
#
|
|
28
|
+
# @param gr_lib_name [String] The actual file name of the shared library.
|
|
29
|
+
# @param pkg_name [String] The package name to be used when searching with pkg-configg
|
|
30
|
+
def search_shared_library(gr_lib_name, pkg_name)
|
|
31
|
+
# Windows + RubyInstaller
|
|
32
|
+
if Object.const_defined?(:RubyInstaller)
|
|
33
|
+
ENV['GRDIR'] ||= [
|
|
34
|
+
RubyInstaller::Runtime.msys2_installation.msys_path,
|
|
35
|
+
RubyInstaller::Runtime.msys2_installation.mingwarch
|
|
36
|
+
].join(File::ALT_SEPARATOR)
|
|
37
|
+
recursive_search(gr_lib_name, ENV['GRDIR']).tap do |path|
|
|
38
|
+
RubyInstaller::Runtime.add_dll_directory(File.dirname(path))
|
|
39
|
+
end
|
|
40
|
+
# ENV['GRDIR'] (Linux, Mac, Windows)
|
|
41
|
+
elsif ENV['GRDIR']
|
|
42
|
+
begin
|
|
43
|
+
recursive_search(gr_lib_name, ENV['GRDIR'])
|
|
44
|
+
rescue StandardError => e
|
|
45
|
+
warn "\nWhile searching for #{gr_lib_name} in the directory specified " \
|
|
46
|
+
"in the GRDIR environment variable, ENV['GRDIR']=#{ENV['GRDIR']}, " \
|
|
47
|
+
"the following error occurred : #{e.message}"
|
|
48
|
+
pkg_config_search(gr_lib_name, pkg_name)
|
|
49
|
+
end
|
|
50
|
+
else
|
|
51
|
+
pkg_config_search(gr_lib_name, pkg_name)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def recursive_search(name, base_dir)
|
|
56
|
+
Dir.chdir(base_dir) do
|
|
57
|
+
path = Dir["**/#{name}"].first # FIXME
|
|
58
|
+
if path
|
|
59
|
+
File.expand_path(path)
|
|
60
|
+
else
|
|
61
|
+
raise "#{name} not found in #{base_dir}"
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def pkg_config_search(gr_lib_name, pkg_name)
|
|
67
|
+
PKGConfig.variable(pkg_name, 'sopath')
|
|
68
|
+
rescue PackageConfig::NotFoundError => e
|
|
69
|
+
raise "#{e.message} Cannot find #{gr_lib_name}. " \
|
|
70
|
+
"Please Make sure that GR is installed and the environment ” \
|
|
71
|
+
”variable GRDIR is set correctly."
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
data/lib/gr_commons/version.rb
CHANGED
data/lib/grm.rb
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Check Fiddle version.
|
|
4
|
+
require 'fiddle'
|
|
5
|
+
|
|
6
|
+
# Check if fiddle supports variadic arguments.
|
|
7
|
+
# Fiddle is a standard Gem and may not have VERSION constant.
|
|
8
|
+
if !Fiddle.const_defined?(:VERSION) ||
|
|
9
|
+
(Gem::Version.new(Fiddle::VERSION) <= Gem::Version.new('1.0.0'))
|
|
10
|
+
raise LoadError, <<~MSG
|
|
11
|
+
Failed to load GRM module
|
|
12
|
+
Fiddle 1.0.1 or higher is required to run GRM.
|
|
13
|
+
See https://github.com/ruby/fiddle
|
|
14
|
+
MSG
|
|
15
|
+
end
|
|
16
|
+
|
|
3
17
|
module GRM
|
|
4
18
|
class Error < StandardError; end
|
|
5
19
|
|
|
@@ -7,27 +21,20 @@ module GRM
|
|
|
7
21
|
attr_accessor :ffi_lib
|
|
8
22
|
end
|
|
9
23
|
|
|
24
|
+
require_relative 'gr_commons/gr_commons'
|
|
25
|
+
extend GRCommons::SearchSharedLibrary
|
|
26
|
+
|
|
10
27
|
# Platforms | path
|
|
11
28
|
# Windows | bin/libGRM.dll
|
|
12
29
|
# MacOSX | lib/libGRM.so (NOT .dylib)
|
|
13
30
|
# Ubuntu | lib/libGRM.so
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
RubyInstaller::Runtime.add_dll_directory(File.dirname(ffi_lib))
|
|
21
|
-
else
|
|
22
|
-
raise Error, 'Please set env variable GRDIR' unless ENV['GRDIR']
|
|
23
|
-
|
|
24
|
-
self.ffi_lib = File.expand_path('lib/libGRM.so', ENV['GRDIR'])
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# change the default encoding to UTF-8.
|
|
28
|
-
ENV['GKS_ENCODING'] ||= 'utf8'
|
|
31
|
+
self.ffi_lib = case RbConfig::CONFIG['host_os']
|
|
32
|
+
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
|
33
|
+
search_shared_library('libGRM.dll', 'grm')
|
|
34
|
+
else
|
|
35
|
+
search_shared_library('libGRM.so', 'grm')
|
|
36
|
+
end
|
|
29
37
|
|
|
30
|
-
require_relative 'gr_commons/gr_commons'
|
|
31
38
|
require_relative 'grm/version'
|
|
32
39
|
require_relative 'grm/ffi'
|
|
33
40
|
require_relative 'grm/grmbase'
|
data/lib/grm/ffi.rb
CHANGED
|
@@ -21,15 +21,14 @@ module GRM
|
|
|
21
21
|
# header files.
|
|
22
22
|
|
|
23
23
|
# https://github.com/sciapp/gr/blob/master/lib/grm/args.h
|
|
24
|
-
|
|
25
24
|
try_extern 'grm_args_t *grm_args_new(void)'
|
|
26
25
|
try_extern 'void grm_args_delete(grm_args_t *args)'
|
|
27
|
-
# Fiddle does not currently support variable-length arguments in C.
|
|
28
26
|
try_extern 'int grm_args_push(grm_args_t *args, const char *key, const char *value_format, ...)'
|
|
29
27
|
try_extern 'int grm_args_push_buf(grm_args_t *args, const char *key, const char *value_format, const void *buffer, int apply_padding)'
|
|
30
28
|
try_extern 'int grm_args_contains(const grm_args_t *args, const char *keyword)'
|
|
31
29
|
try_extern 'void grm_args_clear(grm_args_t *args)'
|
|
32
30
|
try_extern 'void grm_args_remove(grm_args_t *args, const char *key)'
|
|
31
|
+
try_extern 'grm_args_ptr_t grm_length(double value, const char *unit)'
|
|
33
32
|
|
|
34
33
|
# https://github.com/sciapp/gr/blob/master/lib/grm/dump.h
|
|
35
34
|
try_extern 'void grm_dump(const grm_args_t *args, FILE *f)'
|
|
@@ -37,27 +36,37 @@ module GRM
|
|
|
37
36
|
try_extern 'char *grm_dump_json_str(void)'
|
|
38
37
|
|
|
39
38
|
# https://github.com/sciapp/gr/blob/master/lib/grm/event.h
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
# But GR's fiddley doesn't have it.
|
|
43
|
-
# try_extern 'int grm_register(grm_event_type_t type, grm_event_callback_t callback)'
|
|
44
|
-
# try_extern 'int grm_unregister(grm_event_type_t type)'
|
|
39
|
+
try_extern 'int grm_register(grm_event_type_t type, grm_event_callback_t callback)'
|
|
40
|
+
try_extern 'int grm_unregister(grm_event_type_t type)'
|
|
45
41
|
|
|
46
42
|
# https://github.com/sciapp/gr/blob/master/lib/grm/interaction.h
|
|
47
43
|
try_extern 'int grm_input(const grm_args_t *input_args)'
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
try_extern 'int grm_get_box(const int x1, const int y1, const int x2, const int y2, const int keep_aspect_ratio, int *x, int *y, int *w, int *h)'
|
|
45
|
+
try_extern 'grm_tooltip_info_t *grm_get_tooltip(const int, const int)'
|
|
50
46
|
|
|
51
47
|
# https://github.com/sciapp/gr/blob/master/lib/grm/net.h
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
try_extern 'void *grm_open(int is_receiver, const char *name, unsigned int id,
|
|
49
|
+
const char *(*custom_recv)(const char *, unsigned int),
|
|
50
|
+
int (*custom_send)(const char *, unsigned int, const char *))'
|
|
55
51
|
try_extern 'grm_args_t *grm_recv(const void *p, grm_args_t *args)'
|
|
56
|
-
# Fiddle does not currently support variable-length arguments in C.
|
|
57
52
|
try_extern 'int grm_send(const void *p, const char *data_desc, ...)'
|
|
58
53
|
try_extern 'int grm_send_buf(const void *p, const char *data_desc, const void *buffer, int apply_padding)'
|
|
59
54
|
try_extern 'int grm_send_ref(const void *p, const char *key, char format, const void *ref, int len)'
|
|
60
55
|
try_extern 'int grm_send_args(const void *p, const grm_args_t *args)'
|
|
61
56
|
try_extern 'void grm_close(const void *p)'
|
|
57
|
+
|
|
58
|
+
# https://github.com/sciapp/gr/blob/master/lib/grm/plot.h
|
|
59
|
+
try_extern 'void grm_finalize(void)'
|
|
60
|
+
try_extern 'int grm_clear(void)'
|
|
61
|
+
try_extern 'unsigned int grm_max_plotid(void)'
|
|
62
|
+
try_extern 'int grm_merge(const grm_args_t *args)'
|
|
63
|
+
try_extern 'int grm_merge_extended(const grm_args_t *args, int hold, const char *identificator)'
|
|
64
|
+
try_extern 'int grm_merge_hold(const grm_args_t *args)'
|
|
65
|
+
try_extern 'int grm_merge_named(const grm_args_t *args, const char *identificator)'
|
|
66
|
+
try_extern 'int grm_plot(const grm_args_t *args)'
|
|
67
|
+
try_extern 'int grm_switch(unsigned int id)'
|
|
68
|
+
|
|
69
|
+
# https://github.com/sciapp/gr/blob/master/lib/grm/util.h
|
|
70
|
+
try_extern 'FILE *grm_get_stdout(void)'
|
|
62
71
|
end
|
|
63
72
|
end
|