ghazel-ffi_gen 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ffi_gen/java_output.rb +10 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 090018fd35c04887cedab97b06f59f1f875af9f3
4
- data.tar.gz: 35da7c2e46992090c8f0b41f05ab1d4d110db502
3
+ metadata.gz: 32ad2abdaee3cc109a729362447b3938e4b66e4b
4
+ data.tar.gz: 0e553a6093fd7a600ffae764a8a232b8f36375d3
5
5
  SHA512:
6
- metadata.gz: aa09c56a94eeb80506c71a9ba38b047d82761764f9a9847e5b5a116527f78273e7ef6d0f2a78663db7f4c3b5de666f287492c97656368aca2e9c87742af90124
7
- data.tar.gz: fa44091cfeb2cec751bf8c0ac87eff4da369bc30502c8a4a4c3cdcfc4b815cb3361934411aa37cb695513a107b8efff11d11c55c0bb0c5da53fb8c763e4645c2
6
+ metadata.gz: 64e7336d1f6f8dd02fc6957b182c16fac32ab6177eabb5d85afd24e1838c9c2b21e9d5ad19189548389b85d0f7ea57a9767f9eb07dd6e7cefbb86cd7254f6c57
7
+ data.tar.gz: 750846ae5693d8ffd36b37cbc36c66191d5f8c943092566b76d5b568b9d46089b9d025d2da4f75d6abcd611e37f5151ba0fa2877e02a064cfef5f33b10b56b5c
@@ -152,15 +152,8 @@ class FFIGen
152
152
 
153
153
  class FunctionOrCallback
154
154
  def write_java(writer)
155
- return if @is_callback # static only
156
-
157
- jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
158
- writer.puts "@NativeName(\"#{@name.raw}\")", "#{@return_type.java_jna_type} #{java_name}(#{jna_signature});", ""
159
- end
160
-
161
- def write_static_java(writer)
162
155
  if @is_callback
163
- writer.puts "public static interface #{java_name} extends Callback {"
156
+ writer.puts "public static interface #{java_name.split('.').last} extends Callback {"
164
157
  writer.indent do
165
158
  jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
166
159
  writer.puts "#{@return_type.java_jna_type} invoke(#{jna_signature});"
@@ -168,6 +161,13 @@ class FFIGen
168
161
  writer.puts "}", ""
169
162
  return
170
163
  end
164
+
165
+ jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
166
+ writer.puts "@NativeName(\"#{@name.raw}\")", "#{@return_type.java_jna_type} #{java_name}(#{jna_signature});", ""
167
+ end
168
+
169
+ def write_static_java(writer)
170
+ return if @is_callback # must be in Library
171
171
 
172
172
  replace = {}
173
173
  parameters = []
@@ -221,7 +221,8 @@ class FFIGen
221
221
  end
222
222
 
223
223
  def java_name
224
- @java_name ||= @name.to_java_downcase
224
+ n = (@is_callback ? (@generator.module_name + 'Interface.') : '') + @name.to_java_downcase
225
+ @java_name ||= n
225
226
  end
226
227
 
227
228
  def java_jna_type
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghazel-ffi_gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Musiol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-14 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi