hokusai-zero 0.2.6.pre.android → 0.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce738bae9af93e8117b6a962e52d140c69ca8dacac118b7830819a8e4d1db585
4
- data.tar.gz: 0a0cbb5d8f6fb7a35dbcb619e17d06f5d05788c226480b11d546b3e9de7c8813
3
+ metadata.gz: c28ec9cbfb0ad097992724a26e9304ff581f2becdb0c3edae24b953fecf6f69c
4
+ data.tar.gz: 7d78d50e110f70dd8af7095df76bd5b039d13c205336c31f42d58c9d503cceb5
5
5
  SHA512:
6
- metadata.gz: 1752951b5745a54239c07c9cb3a0b9569105a0011531174a6bfced4b9062466054b098029a72b7562b3f73a89378e422cd13983ff432b0130bcc1a8bce622e6e
7
- data.tar.gz: cc55da6b2f736f4f637a50115ad294247da5eb5c73fb74785ba2eec790c8476b9aae1d0b97822a65152f27ac924a32fd3a58192594e97b5af9f1bb7479f8db94
6
+ metadata.gz: e4c92faf605ff7a6b4f9e0c3489327a01886ee18b2a2700a502b10b984fabf49e365986fb17c37c24d7f474fa7689e36761709bc1e59fcc0cd238ccf29ca8011
7
+ data.tar.gz: a2b09402e3f899644cb30e398130111e2afd40542763e6e9377f9777b6c5facf56f54465451b26ee2296d3834cc3be1aed640c7856bb2a7839801c260f7ad9ac
data/README.md CHANGED
@@ -12,7 +12,7 @@ A Ruby library for authoring GUI applications
12
12
  In your Gemfile
13
13
 
14
14
  ```ruby
15
- gem "hokusai-zero", "0.2.6"
15
+ gem "hokusai-zero", "0.2.4"
16
16
  ```
17
17
 
18
18
  ## In order to run an application, you will need to install a backend
data/ast/src/core/util.c CHANGED
@@ -3,33 +3,33 @@
3
3
 
4
4
  #include "util.h"
5
5
 
6
- bool hoku_rect_includes_y(hoku_rect* rect, float y)
6
+ bool hoku_rect_includes_y(hoku_rect rect, float y)
7
7
  {
8
- return y > rect->y && y <= (rect->y + rect->h);
8
+ return y > rect.y && y <= (rect.y + rect.h);
9
9
  }
10
10
 
11
- bool hoku_rect_includes_x(hoku_rect* rect, float x)
11
+ bool hoku_rect_includes_x(hoku_rect rect, float x)
12
12
  {
13
- return x > rect->x && x <= (rect->x + rect->w);
13
+ return x > rect.x && x <= (rect.x + rect.w);
14
14
  }
15
15
 
16
- float hoku_rect_x_left(hoku_rect* rect, int times)
16
+ float hoku_rect_x_left(hoku_rect rect, int times)
17
17
  {
18
- return (rect->x - ((rect->w / 2) * times));
18
+ return (rect.x - ((rect.w / 2) * times));
19
19
  }
20
- float hoku_rect_x_right(hoku_rect* rect, int times)
20
+ float hoku_rect_x_right(hoku_rect rect, int times)
21
21
  {
22
- return (rect->x + ((rect->w / 2) * times));
22
+ return (rect.x + ((rect.w / 2) * times));
23
23
  }
24
24
 
25
- float hoku_rect_y_up(hoku_rect* rect, int times)
25
+ float hoku_rect_y_up(hoku_rect rect, int times)
26
26
  {
27
- return (rect->y - ((rect->h / 2) * times));
27
+ return (rect.y - ((rect.h / 2) * times));
28
28
  }
29
29
 
30
- float hoku_rect_y_down(hoku_rect* rect, int times)
30
+ float hoku_rect_y_down(hoku_rect rect, int times)
31
31
  {
32
- return (rect->y + ((rect->h / 2) * times));
32
+ return (rect.y + ((rect.h / 2) * times));
33
33
  }
34
34
 
35
35
  int hoku_selection_init(hoku_selection** selection)
@@ -68,28 +68,28 @@ bool hoku_selection_selected(hoku_selection* selection, float x, float y, float
68
68
  bool right = selection->start_x <= selection->stop_x;
69
69
 
70
70
  hoku_rect hit_box = (hoku_rect){.x=x, .y=y, .w=width, .h=height};
71
- float x_shifted_right = hoku_rect_x_right(&hit_box, 1);
72
- float y_shifted_up = hoku_rect_y_up(&hit_box, 2);
73
- float y_shifted_down = hoku_rect_y_down(&hit_box, 2);
71
+ float x_shifted_right = hoku_rect_x_right(hit_box, 1);
72
+ float y_shifted_up = hoku_rect_y_up(hit_box, 2);
73
+ float y_shifted_down = hoku_rect_y_down(hit_box, 2);
74
74
  float end_y = y + height;
75
75
 
76
76
  return (
77
77
  (down &&
78
78
  // first line of multiline selection
79
- ((x_shifted_right > sx && end_y < ey && hoku_rect_includes_y(&hit_box, sy)) ||
79
+ ((x_shifted_right > sx && end_y < ey && hoku_rect_includes_y(hit_box, sy)) ||
80
80
  // last line of multiline selection
81
81
  (x_shifted_right <= ex && y_shifted_up + hit_box.h < ey && hit_box.y > sy) ||
82
82
  // middle line (all selected)
83
83
  (hit_box.y > sy && end_y < ey))) ||
84
84
  (up &&
85
85
  // first line of multiline selection
86
- ((x_shifted_right <= sx && hit_box.y > ey && hoku_rect_includes_y(&hit_box, sy)) ||
86
+ ((x_shifted_right <= sx && hit_box.y > ey && hoku_rect_includes_y(hit_box, sy)) ||
87
87
  // last line of multiline selection
88
88
  (x_shifted_right >= ex && y_shifted_down > ey && end_y < sy) ||
89
89
  // middle line (all selected)
90
90
  (hit_box.y > ey && hit_box.y + hit_box.h < sy))) ||
91
91
  // single line selection
92
- ((hoku_rect_includes_y(&hit_box, sy) && hoku_rect_includes_y(&hit_box, ey)) &&
92
+ ((hoku_rect_includes_y(hit_box, sy) && hoku_rect_includes_y(hit_box, ey)) &&
93
93
  ((left && x_shifted_right < sx && x_shifted_right > ex) || (right && x_shifted_right > sx && x_shifted_right < ex)))
94
94
  );
95
95
  }
@@ -108,7 +108,7 @@ hoku_cursor_position hoku_selection_cursor_get(hoku_selection* selection)
108
108
  return pos;
109
109
  }
110
110
 
111
- int hoku_selection_cursor_set(hoku_selection* selection, hoku_cursor_position* cursor)
111
+ int hoku_selection_cursor_set(hoku_selection* selection, hoku_cursor_position cursor)
112
112
  {
113
113
  if (selection->cursor == NULL)
114
114
  {
@@ -117,10 +117,10 @@ int hoku_selection_cursor_set(hoku_selection* selection, hoku_cursor_position* c
117
117
  if (selection->cursor == NULL) return -1;
118
118
  }
119
119
 
120
- selection->cursor->x = cursor->x;
121
- selection->cursor->y = cursor->y;
122
- selection->cursor->w = cursor->w;
123
- selection->cursor->h = cursor->h;
120
+ selection->cursor->x = cursor.x;
121
+ selection->cursor->y = cursor.y;
122
+ selection->cursor->w = cursor.w;
123
+ selection->cursor->h = cursor.h;
124
124
 
125
125
  return 0;
126
126
  }
data/ast/src/core/util.h CHANGED
@@ -30,16 +30,16 @@ typedef struct HokuSelection
30
30
  hoku_cursor_position* cursor;
31
31
  } hoku_selection;
32
32
 
33
- bool hoku_rect_includes_y(hoku_rect* rect, float y);
34
- bool hoku_rect_includes_x(hoku_rect* rect, float x);
35
- float hoku_rect_x_left(hoku_rect* rect, int times);
36
- float hoku_rect_x_right(hoku_rect* rect, int times);
37
- float hoku_rect_y_up(hoku_rect* rect, int times);
38
- float hoku_rect_y_down(hoku_rect* rect, int times);
33
+ bool hoku_rect_includes_y(hoku_rect rect, float y);
34
+ bool hoku_rect_includes_x(hoku_rect rect, float x);
35
+ float hoku_rect_x_left(hoku_rect rect, int times);
36
+ float hoku_rect_x_right(hoku_rect rect, int times);
37
+ float hoku_rect_y_up(hoku_rect rect, int times);
38
+ float hoku_rect_y_down(hoku_rect rect, int times);
39
39
 
40
40
  int hoku_selection_init(hoku_selection** selection);
41
41
  bool hoku_selection_selected(hoku_selection* selection, float x, float y, float width, float height);
42
- int hoku_selection_cursor_set(hoku_selection* selection, hoku_cursor_position* cursor);
42
+ int hoku_selection_cursor_set(hoku_selection* selection, hoku_cursor_position cursor);
43
43
  void hoku_selection_cursor_free(hoku_selection* selection);
44
44
  void hoku_selection_free(hoku_selection* selection);
45
45
 
data/ext/extconf.rb CHANGED
@@ -9,7 +9,7 @@ if MiniPortile.darwin?
9
9
  elsif MiniPortile.linux?
10
10
  suffix = "so"
11
11
  ext = "tar.gz"
12
- md4cext = "a"
12
+ md4cext = "so"
13
13
  MDFLAGS = "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
14
14
  elsif MiniPortile.windows?
15
15
  suffix = "dll"
@@ -45,7 +45,7 @@ md4c = MiniPortileCMake.new("md4c", "0.5.2")
45
45
  md4c.files = ["https://github.com/mity/md4c/archive/refs/tags/release-0.5.2.#{ext}"]
46
46
 
47
47
  def md4c.cmake_compile_flags
48
- [*super, "-DBUILD_SHARED_LIBS=OFF", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"]
48
+ [*super, "-DBUILD_SHARED_LIBS=OFF #{MDFLAGS}"]
49
49
  end
50
50
 
51
51
  md4c.cook
@@ -89,4 +89,4 @@ File.open("Makefile", "w") do |io|
89
89
  #{"\t"}rm -f #{File.expand_path("vendor/lib/libhokusai.*")}
90
90
  #{"\t"}rm -f #{File.expand_path("vendor/lib/libmd4c.*")}
91
91
  EOF
92
- end
92
+ end
data/hokusai.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'hokusai-zero'
3
- s.version = '0.2.6-android'
3
+ s.version = '0.2.6'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = "A Ruby library for writing GUI applications"
6
6
  s.authors = ["skinnyjames"]
@@ -352,16 +352,16 @@ module LibHokusai
352
352
 
353
353
  attach_function :hoku_selection_init, [:pointer], :int
354
354
  attach_function :hoku_selection_selected, [HokuSelection.by_ref, :float, :float, :float, :float], :bool
355
- attach_function :hoku_selection_cursor_set, [HokuSelection.by_ref, HokuCursorPosition.by_ref], :int
355
+ attach_function :hoku_selection_cursor_set, [HokuSelection.by_ref, HokuCursorPosition.by_value], :int
356
356
  attach_function :hoku_selection_cursor_free, [HokuSelection.by_ref], :void
357
357
  attach_function :hoku_selection_free, [HokuSelection.by_ref], :void
358
358
 
359
- attach_function :hoku_rect_includes_y, [HmlRect.by_ref, :float], :bool
360
- attach_function :hoku_rect_includes_x, [HmlRect.by_ref, :float], :bool
361
- attach_function :hoku_rect_x_left, [HmlRect.by_ref, :int], :float
362
- attach_function :hoku_rect_x_right, [HmlRect.by_ref, :int], :float
363
- attach_function :hoku_rect_y_up, [HmlRect.by_ref, :int], :float
364
- attach_function :hoku_rect_y_down, [HmlRect.by_ref, :int], :float
359
+ attach_function :hoku_rect_includes_y, [HmlRect.by_value, :float], :bool
360
+ attach_function :hoku_rect_includes_x, [HmlRect.by_value, :float], :bool
361
+ attach_function :hoku_rect_x_left, [HmlRect.by_value, :int], :float
362
+ attach_function :hoku_rect_x_right, [HmlRect.by_value, :int], :float
363
+ attach_function :hoku_rect_y_up, [HmlRect.by_value, :int], :float
364
+ attach_function :hoku_rect_y_down, [HmlRect.by_value, :int], :float
365
365
 
366
366
  class HokuChar < FFI::Struct
367
367
  layout :offset, :int,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hokusai-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6.pre.android
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - skinnyjames
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-28 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi