summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dragon/geometry.rb14
-rw-r--r--dragon/inputs.rb72
-rw-r--r--dragon/ios_wizard.rb10
3 files changed, 57 insertions, 39 deletions
diff --git a/dragon/geometry.rb b/dragon/geometry.rb
index b16c5b7..db3ebfc 100644
--- a/dragon/geometry.rb
+++ b/dragon/geometry.rb
@@ -26,8 +26,8 @@ module GTK
# Returns true if a primitive's rectangle is entirely inside another primitive's rectangle.
# @gtk
- def inside_rect? outer
- Geometry.inside_rect? self, outer
+ def inside_rect? outer, tolerance = 0.0
+ Geometry.inside_rect? self, outer, tolerance
end
# Returns true if a primitive's rectangle overlaps another primitive's rectangle.
@@ -308,11 +308,11 @@ S
end
# @gtk
- def self.inside_rect? inner_rect, outer_rect
- inner_rect.x >= outer_rect.x &&
- inner_rect.right <= outer_rect.right &&
- inner_rect.y >= outer_rect.y &&
- inner_rect.top <= outer_rect.top
+ def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0
+ inner_rect.x + tolerance >= outer_rect.x - tolerance &&
+ inner_rect.right - tolerance <= outer_rect.right + tolerance &&
+ inner_rect.y + tolerance >= outer_rect.y - tolerance &&
+ inner_rect.top - tolerance <= outer_rect.top + tolerance
rescue Exception => e
raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}."
end
diff --git a/dragon/inputs.rb b/dragon/inputs.rb
index ec8c59d..30f1a2d 100644
--- a/dragon/inputs.rb
+++ b/dragon/inputs.rb
@@ -29,6 +29,10 @@ module GTK
:q, :r, :s, :t, :u, :v, :w, :x,
:y, :z,
:shift, :control, :alt, :meta,
+ :shift_left, :shift_right,
+ :control_left, :control_right,
+ :alt_left, :alt_right,
+ :meta_left, :meta_right,
:left, :right, :up, :down, :pageup, :pagedown,
:char, :plus, :at, :forward_slash, :back_slash, :asterisk,
:less_than, :greater_than, :carat, :ampersand, :superscript_two,
@@ -43,7 +47,8 @@ module GTK
raw_key == 1073741905 ||
raw_key == 1073741906 ||
raw_key == 1073741899 ||
- raw_key == 1073741902
+ raw_key == 1073741902 ||
+ (raw_key >= 1073742048 && raw_key <= 1073742055) # Modifier Keys
char = KeyboardKeys.char_with_shift raw_key, modifier
names = KeyboardKeys.char_to_method char, raw_key
@@ -87,32 +92,32 @@ module GTK
def self.char_to_method_hash
@char_to_method ||= {
- 'A' => [:a, :shift],
- 'B' => [:b, :shift],
- 'C' => [:c, :shift],
- 'D' => [:d, :shift],
- 'E' => [:e, :shift],
- 'F' => [:f, :shift],
- 'G' => [:g, :shift],
- 'H' => [:h, :shift],
- 'I' => [:i, :shift],
- 'J' => [:j, :shift],
- 'K' => [:k, :shift],
- 'L' => [:l, :shift],
- 'M' => [:m, :shift],
- 'N' => [:n, :shift],
- 'O' => [:o, :shift],
- 'P' => [:p, :shift],
- 'Q' => [:q, :shift],
- 'R' => [:r, :shift],
- 'S' => [:s, :shift],
- 'T' => [:t, :shift],
- 'U' => [:u, :shift],
- 'V' => [:v, :shift],
- 'W' => [:w, :shift],
- 'X' => [:x, :shift],
- 'Y' => [:y, :shift],
- 'Z' => [:z, :shift],
+ 'A' => [:a],
+ 'B' => [:b],
+ 'C' => [:c],
+ 'D' => [:d],
+ 'E' => [:e],
+ 'F' => [:f],
+ 'G' => [:g],
+ 'H' => [:h],
+ 'I' => [:i],
+ 'J' => [:j],
+ 'K' => [:k],
+ 'L' => [:l],
+ 'M' => [:m],
+ 'N' => [:n],
+ 'O' => [:o],
+ 'P' => [:p],
+ 'Q' => [:q],
+ 'R' => [:r],
+ 'S' => [:s],
+ 'T' => [:t],
+ 'U' => [:u],
+ 'V' => [:v],
+ 'W' => [:w],
+ 'X' => [:x],
+ 'Y' => [:y],
+ 'Z' => [:z],
"!" => [:exclamation_point],
"0" => [:zero],
"1" => [:one],
@@ -169,12 +174,21 @@ module GTK
1073741906 => [:up],
1073741899 => [:pageup],
1073741902 => [:pagedown],
- 127 => [:delete]
+ 127 => [:delete],
+ 1073742049 => [:shift_left, :shift],
+ 1073742053 => [:shift_right, :shift],
+ 1073742048 => [:control_left, :control],
+ 1073742052 => [:control_right, :control],
+ 1073742050 => [:alt_left, :alt],
+ 1073742054 => [:alt_right, :alt],
+ 1073742051 => [:meta_left, :meta],
+ 1073742055 => [:meta_right, :meta]
}
end
def self.char_to_method char, int = nil
- char_to_method_hash[char] || char_to_method_hash[int] || [char.to_sym || int]
+ methods = char_to_method_hash[char] || char_to_method_hash[int]
+ methods ? methods.dup : [char.to_sym || int]
end
def clear
diff --git a/dragon/ios_wizard.rb b/dragon/ios_wizard.rb
index c10965d..b3f170a 100644
--- a/dragon/ios_wizard.rb
+++ b/dragon/ios_wizard.rb
@@ -130,7 +130,8 @@ class IOSWizard
end
def check_for_dev_profile
- if !($gtk.read_file 'profiles/development.mobileprovision')
+ @dev_profile_path = "profiles/development.mobileprovision"
+ if !($gtk.read_file @dev_profile_path)
$gtk.system "mkdir -p #{relative_path}/profiles"
$gtk.system "open #{relative_path}/profiles"
$gtk.system "echo Download the mobile provisioning profile and place it here with the name development.mobileprovision > #{relative_path}/profiles/README.txt"
@@ -378,7 +379,7 @@ XML
</dict>
</dict>
<key>CFBundleIdentifier</key>
- <string>com.carlile.swisscheese</string>
+ <string>:app_id</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -506,7 +507,10 @@ XML
# <string>UIInterfaceOrientationPortrait</string>
# <string>UIInterfaceOrientationLandscapeRight</string>
- $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.gsub(":app_name", @app_name).strip
+ info_plist_string.gsub!(":app_name", @app_name)
+ info_plist_string.gsub!(":app_id", @app_id)
+
+ $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip
@info_plist_written = true
end