gosleap 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5f7ea31427c9744db9c4dfa9bd0bf5e9686acc84
4
+ data.tar.gz: 4ab9b4ca3dd3d102f29f1174df9c2735ddf722e4
5
+ SHA512:
6
+ metadata.gz: b840dc089d2c81767cebe021a1c19161f41b08e06e10f9c7daebb1da289c6fdf3008a7ed3282785f24a72df9580820e989025165f6463b8b472e5d2df37e6e35
7
+ data.tar.gz: 6317d0393e14dfff075b2cfdfb0b883b08633512f59d491fb2c6ef313ec771814d1e5e3333561f153d0fec5e9dfd7434dd743486faeeb4b54a106a31784b4900
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in gosleap.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Kori Roys
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Gosleap
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'gosleap'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install gosleap
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/gosleap/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/gosleap ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ gosling_image = "#{__dir__}/gosling.png"
4
+ sparkle_image = "#{__dir__}/heygurl.png"
5
+ imageleap = "#{__dir__}/imageleap"
6
+
7
+ system("#{imageleap} -i #{gosling_image} -p #{sparkle_image}")
data/bin/gosling.png ADDED
Binary file
data/bin/heygurl.png ADDED
Binary file
data/bin/imageleap ADDED
Binary file
data/gosleap.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gosleap/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gosleap"
8
+ spec.version = Gosleap::VERSION
9
+ spec.authors = ["Kori Roys"]
10
+ spec.email = ["kori@koriroys.com"]
11
+ spec.summary = %q{Makes a gosling jump across your screen.}
12
+ spec.description = %q{Makes a gosling jump across your screen.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,3 @@
1
+ module Gosleap
2
+ VERSION = "0.0.1"
3
+ end
data/lib/gosleap.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "gosleap/version"
2
+
3
+ module Gosleap
4
+ # Your code goes here...
5
+ end
data/proj/Makefile ADDED
@@ -0,0 +1,21 @@
1
+ program_name := imageleap
2
+
3
+ CFLAGS += -std=c99
4
+ LDFLAGS += -framework Cocoa -framework QuartzCore
5
+ PREFIX ?= /usr/local
6
+
7
+ .PHONY: all clean
8
+
9
+ all: $(program_name)
10
+
11
+ $(program_name): main
12
+ @ mkdir -p build
13
+ cp main build/$(program_name)
14
+
15
+ install: $(program_name)
16
+ cp build/$(program_name) ${PREFIX}/bin
17
+ cp $(program_name).1 $(PREFIX)/share/man/man1/
18
+
19
+ clean:
20
+ @- $(RM) main
21
+ @- $(RM) build/$(program_name)
data/proj/README.md ADDED
@@ -0,0 +1,20 @@
1
+ Imageleap
2
+ ===========
3
+
4
+ A reimplementaion of jgdavey/unicornleap that allows you to pass an arbitrary image path.
5
+
6
+ Installation
7
+ ------------
8
+
9
+ ### "Automatic" installation
10
+
11
+ make
12
+ make install
13
+
14
+ The default installation prefix is /usr/local. You can change it with
15
+ the PREFIX env variable.
16
+
17
+ Usage
18
+ -----
19
+
20
+ imageleap
data/proj/imageleap.1 ADDED
@@ -0,0 +1,43 @@
1
+ .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
2
+ .\"See Also:
3
+ .\"man mdoc.samples for a complete listing of options
4
+ .\"man mdoc for the short list of editing options
5
+ .\"/usr/share/misc/mdoc.template
6
+ .Dd 3/5/13
7
+ .Dt imageleap 1
8
+ .Os Darwin
9
+ .Sh NAME
10
+ .Nm imageleap
11
+ .Nd display a flying image
12
+ .Sh SYNOPSIS
13
+ .Nm
14
+ .Op Fl vh \" [-vh]
15
+ .Op Fl s Ar seconds \" [-a path]
16
+ .Sh DESCRIPTION \" Section Header - required - don't modify
17
+ .Nm
18
+ makes a image fly across your screen. That's all it does.
19
+ .Sh OPTIONS
20
+ .Bl -tag -width "-s, --seconds n "
21
+ .It Fl s , \-seconds Ar n
22
+ Number of seconds for the animation to last.
23
+ .br
24
+ Defaults to
25
+ .Ar 2.0
26
+ .It Fl n , \-number Ar n
27
+ Number of images to display.
28
+ .br
29
+ Defaults to
30
+ .Ar 1
31
+ .It Fl h , \-help
32
+ Display help
33
+ .It Fl v
34
+ Slightly more output
35
+ .El \" Ends the list
36
+ .Pp
37
+ .Sh FILES \" File used or created by the topic of the man page
38
+ .Bl -tag -width "~/.imageleap/image.png" -compact
39
+ .It Pa ~/.imageleap/image.png
40
+ The magic image. This must exist and be a valid PNG.
41
+ .It Pa ~/.imageleap/sparkle.png
42
+ The image for the sparkle effect. This must exist and be a valid PNG.
43
+ .El \" Ends the list
@@ -0,0 +1,230 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 9A2C9C6116E6D87400F945D4 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2C9C6016E6D87400F945D4 /* QuartzCore.framework */; };
11
+ 9A2C9C6316E6D87A00F945D4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2C9C6216E6D87A00F945D4 /* Cocoa.framework */; };
12
+ 9A2C9C6416E6D8B000F945D4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A2C9C5D16E6D7EA00F945D4 /* main.m */; };
13
+ /* End PBXBuildFile section */
14
+
15
+ /* Begin PBXCopyFilesBuildPhase section */
16
+ 9ABBBE3A16E6D68B00E12E46 /* CopyFiles */ = {
17
+ isa = PBXCopyFilesBuildPhase;
18
+ buildActionMask = 2147483647;
19
+ dstPath = /usr/share/man/man1/;
20
+ dstSubfolderSpec = 0;
21
+ files = (
22
+ );
23
+ runOnlyForDeploymentPostprocessing = 1;
24
+ };
25
+ /* End PBXCopyFilesBuildPhase section */
26
+
27
+ /* Begin PBXFileReference section */
28
+ 9A2C9C5D16E6D7EA00F945D4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29
+ 9A2C9C5E16E6D7EA00F945D4 /* image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image.png; sourceTree = "<group>"; };
30
+ 9A2C9C5F16E6D7EA00F945D4 /* imageleap.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = imageleap.1; sourceTree = "<group>"; };
31
+ 9A2C9C6016E6D87400F945D4 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
32
+ 9A2C9C6216E6D87A00F945D4 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
33
+ 9ABBBE3C16E6D68B00E12E46 /* imageleap */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = imageleap; sourceTree = BUILT_PRODUCTS_DIR; };
34
+ /* End PBXFileReference section */
35
+
36
+ /* Begin PBXFrameworksBuildPhase section */
37
+ 9ABBBE3916E6D68B00E12E46 /* Frameworks */ = {
38
+ isa = PBXFrameworksBuildPhase;
39
+ buildActionMask = 2147483647;
40
+ files = (
41
+ 9A2C9C6316E6D87A00F945D4 /* Cocoa.framework in Frameworks */,
42
+ 9A2C9C6116E6D87400F945D4 /* QuartzCore.framework in Frameworks */,
43
+ );
44
+ runOnlyForDeploymentPostprocessing = 0;
45
+ };
46
+ /* End PBXFrameworksBuildPhase section */
47
+
48
+ /* Begin PBXGroup section */
49
+ 9ABBBE3316E6D68B00E12E46 = {
50
+ isa = PBXGroup;
51
+ children = (
52
+ 9A2C9C5D16E6D7EA00F945D4 /* main.m */,
53
+ 9A2C9C5E16E6D7EA00F945D4 /* image.png */,
54
+ 9A2C9C5F16E6D7EA00F945D4 /* imageleap.1 */,
55
+ 9ABBBE3E16E6D68B00E12E46 /* Frameworks */,
56
+ 9ABBBE3D16E6D68B00E12E46 /* Products */,
57
+ );
58
+ sourceTree = "<group>";
59
+ };
60
+ 9ABBBE3D16E6D68B00E12E46 /* Products */ = {
61
+ isa = PBXGroup;
62
+ children = (
63
+ 9ABBBE3C16E6D68B00E12E46 /* imageleap */,
64
+ );
65
+ name = Products;
66
+ sourceTree = "<group>";
67
+ };
68
+ 9ABBBE3E16E6D68B00E12E46 /* Frameworks */ = {
69
+ isa = PBXGroup;
70
+ children = (
71
+ 9A2C9C6016E6D87400F945D4 /* QuartzCore.framework */,
72
+ 9A2C9C6216E6D87A00F945D4 /* Cocoa.framework */,
73
+ );
74
+ name = Frameworks;
75
+ sourceTree = "<group>";
76
+ };
77
+ /* End PBXGroup section */
78
+
79
+ /* Begin PBXNativeTarget section */
80
+ 9ABBBE3B16E6D68B00E12E46 /* imageleap */ = {
81
+ isa = PBXNativeTarget;
82
+ buildConfigurationList = 9ABBBE4816E6D68B00E12E46 /* Build configuration list for PBXNativeTarget "imageleap" */;
83
+ buildPhases = (
84
+ 9ABBBE3816E6D68B00E12E46 /* Sources */,
85
+ 9ABBBE3916E6D68B00E12E46 /* Frameworks */,
86
+ 9ABBBE3A16E6D68B00E12E46 /* CopyFiles */,
87
+ );
88
+ buildRules = (
89
+ );
90
+ dependencies = (
91
+ );
92
+ name = imageleap;
93
+ productName = imageleap;
94
+ productReference = 9ABBBE3C16E6D68B00E12E46 /* imageleap */;
95
+ productType = "com.apple.product-type.tool";
96
+ };
97
+ /* End PBXNativeTarget section */
98
+
99
+ /* Begin PBXProject section */
100
+ 9ABBBE3416E6D68B00E12E46 /* Project object */ = {
101
+ isa = PBXProject;
102
+ attributes = {
103
+ LastUpgradeCheck = 0460;
104
+ ORGANIZATIONNAME = "Joshua Davey";
105
+ };
106
+ buildConfigurationList = 9ABBBE3716E6D68B00E12E46 /* Build configuration list for PBXProject "imageleap" */;
107
+ compatibilityVersion = "Xcode 3.2";
108
+ developmentRegion = English;
109
+ hasScannedForEncodings = 0;
110
+ knownRegions = (
111
+ en,
112
+ );
113
+ mainGroup = 9ABBBE3316E6D68B00E12E46;
114
+ productRefGroup = 9ABBBE3D16E6D68B00E12E46 /* Products */;
115
+ projectDirPath = "";
116
+ projectRoot = "";
117
+ targets = (
118
+ 9ABBBE3B16E6D68B00E12E46 /* imageleap */,
119
+ );
120
+ };
121
+ /* End PBXProject section */
122
+
123
+ /* Begin PBXSourcesBuildPhase section */
124
+ 9ABBBE3816E6D68B00E12E46 /* Sources */ = {
125
+ isa = PBXSourcesBuildPhase;
126
+ buildActionMask = 2147483647;
127
+ files = (
128
+ 9A2C9C6416E6D8B000F945D4 /* main.m in Sources */,
129
+ );
130
+ runOnlyForDeploymentPostprocessing = 0;
131
+ };
132
+ /* End PBXSourcesBuildPhase section */
133
+
134
+ /* Begin XCBuildConfiguration section */
135
+ 9ABBBE4616E6D68B00E12E46 /* Debug */ = {
136
+ isa = XCBuildConfiguration;
137
+ buildSettings = {
138
+ ALWAYS_SEARCH_USER_PATHS = NO;
139
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
140
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
141
+ CLANG_CXX_LIBRARY = "libc++";
142
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
143
+ CLANG_WARN_EMPTY_BODY = YES;
144
+ CLANG_WARN_ENUM_CONVERSION = YES;
145
+ CLANG_WARN_INT_CONVERSION = YES;
146
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
147
+ COPY_PHASE_STRIP = NO;
148
+ GCC_C_LANGUAGE_STANDARD = gnu99;
149
+ GCC_DYNAMIC_NO_PIC = NO;
150
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
151
+ GCC_OPTIMIZATION_LEVEL = 0;
152
+ GCC_PREPROCESSOR_DEFINITIONS = (
153
+ "DEBUG=1",
154
+ "$(inherited)",
155
+ );
156
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
157
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
158
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
159
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
160
+ GCC_WARN_UNUSED_VARIABLE = YES;
161
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
162
+ ONLY_ACTIVE_ARCH = YES;
163
+ SDKROOT = macosx;
164
+ };
165
+ name = Debug;
166
+ };
167
+ 9ABBBE4716E6D68B00E12E46 /* Release */ = {
168
+ isa = XCBuildConfiguration;
169
+ buildSettings = {
170
+ ALWAYS_SEARCH_USER_PATHS = NO;
171
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
172
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
173
+ CLANG_CXX_LIBRARY = "libc++";
174
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
175
+ CLANG_WARN_EMPTY_BODY = YES;
176
+ CLANG_WARN_ENUM_CONVERSION = YES;
177
+ CLANG_WARN_INT_CONVERSION = YES;
178
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
179
+ COPY_PHASE_STRIP = YES;
180
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
181
+ GCC_C_LANGUAGE_STANDARD = gnu99;
182
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
183
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
184
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
185
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
186
+ GCC_WARN_UNUSED_VARIABLE = YES;
187
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
188
+ SDKROOT = macosx;
189
+ };
190
+ name = Release;
191
+ };
192
+ 9ABBBE4916E6D68B00E12E46 /* Debug */ = {
193
+ isa = XCBuildConfiguration;
194
+ buildSettings = {
195
+ PRODUCT_NAME = "$(TARGET_NAME)";
196
+ };
197
+ name = Debug;
198
+ };
199
+ 9ABBBE4A16E6D68B00E12E46 /* Release */ = {
200
+ isa = XCBuildConfiguration;
201
+ buildSettings = {
202
+ PRODUCT_NAME = "$(TARGET_NAME)";
203
+ };
204
+ name = Release;
205
+ };
206
+ /* End XCBuildConfiguration section */
207
+
208
+ /* Begin XCConfigurationList section */
209
+ 9ABBBE3716E6D68B00E12E46 /* Build configuration list for PBXProject "imageleap" */ = {
210
+ isa = XCConfigurationList;
211
+ buildConfigurations = (
212
+ 9ABBBE4616E6D68B00E12E46 /* Debug */,
213
+ 9ABBBE4716E6D68B00E12E46 /* Release */,
214
+ );
215
+ defaultConfigurationIsVisible = 0;
216
+ defaultConfigurationName = Release;
217
+ };
218
+ 9ABBBE4816E6D68B00E12E46 /* Build configuration list for PBXNativeTarget "imageleap" */ = {
219
+ isa = XCConfigurationList;
220
+ buildConfigurations = (
221
+ 9ABBBE4916E6D68B00E12E46 /* Debug */,
222
+ 9ABBBE4A16E6D68B00E12E46 /* Release */,
223
+ );
224
+ defaultConfigurationIsVisible = 0;
225
+ defaultConfigurationName = Release;
226
+ };
227
+ /* End XCConfigurationList section */
228
+ };
229
+ rootObject = 9ABBBE3416E6D68B00E12E46 /* Project object */;
230
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:imageleap.xcodeproj">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDESourceControlProjectFavoriteDictionaryKey</key>
6
+ <false/>
7
+ <key>IDESourceControlProjectIdentifier</key>
8
+ <string>6454C814-19C6-46EA-8C14-9E77BD0E7B49</string>
9
+ <key>IDESourceControlProjectName</key>
10
+ <string>imageleap</string>
11
+ <key>IDESourceControlProjectOriginsDictionary</key>
12
+ <dict>
13
+ <key>62733D46-5D8C-4B0F-B338-C099491106C7</key>
14
+ <string>ssh://github.com/jgdavey/unicornleap.git</string>
15
+ </dict>
16
+ <key>IDESourceControlProjectPath</key>
17
+ <string>imageleap.xcodeproj/project.xcworkspace</string>
18
+ <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
19
+ <dict>
20
+ <key>62733D46-5D8C-4B0F-B338-C099491106C7</key>
21
+ <string>../..</string>
22
+ </dict>
23
+ <key>IDESourceControlProjectURL</key>
24
+ <string>ssh://github.com/jgdavey/unicornleap.git</string>
25
+ <key>IDESourceControlProjectVersion</key>
26
+ <integer>110</integer>
27
+ <key>IDESourceControlProjectWCCIdentifier</key>
28
+ <string>62733D46-5D8C-4B0F-B338-C099491106C7</string>
29
+ <key>IDESourceControlProjectWCConfigurations</key>
30
+ <array>
31
+ <dict>
32
+ <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
33
+ <string>public.vcs.git</string>
34
+ <key>IDESourceControlWCCIdentifierKey</key>
35
+ <string>62733D46-5D8C-4B0F-B338-C099491106C7</string>
36
+ <key>IDESourceControlWCCName</key>
37
+ <string>imageleap</string>
38
+ </dict>
39
+ </array>
40
+ </dict>
41
+ </plist>
data/proj/main ADDED
Binary file
data/proj/main.m ADDED
@@ -0,0 +1,263 @@
1
+ #import <Cocoa/Cocoa.h>
2
+ #import <QuartzCore/QuartzCore.h>
3
+ #include <getopt.h>
4
+ #include <stdio.h>
5
+ #include <stdlib.h>
6
+
7
+ const char* program_name;
8
+ double seconds;
9
+ const char* short_options = "hs:n:i:e:p:v";
10
+ const struct option long_options[] = {
11
+ { "help", 0, NULL, 'h' },
12
+ { "seconds", 1, NULL, 's' },
13
+ { "image", 1, NULL, 'i' },
14
+ { "sparkle", 1, NULL, 'p' },
15
+ { "verbose", 0, NULL, 'v' },
16
+ { NULL, 0, NULL, 0 } /* Required at end of array. */
17
+ };
18
+
19
+ void invalid_image(FILE* stream, char * path) {
20
+ fprintf (stream, "ERROR: You must have a valid PNG image at %s\n", path);
21
+ exit(127);
22
+ }
23
+
24
+ void print_usage (FILE* stream, int exit_code) {
25
+ fprintf (stream, "Usage: %s [options]\n", program_name);
26
+ fprintf (stream,
27
+ " -h --help Display this usage information.\n"
28
+ " -s --seconds n Animate for n seconds. (default: 2.0)\n"
29
+ " -i --image Custom image to use.\n"
30
+ " -p --sparkle Custom sparkle image to use.\n"
31
+ " -v --verbose Print verbose messages.\n");
32
+ exit (exit_code);
33
+ }
34
+
35
+ CGMutablePathRef pathInFrameForSize (CGRect screen, CGSize size) {
36
+ CGMutablePathRef path = CGPathCreateMutable();
37
+ CGPoint origin = CGPointMake(-size.width, -size.height);
38
+ CGPoint destination = CGPointMake(screen.size.width + size.width, origin.y);
39
+ CGFloat midpoint = (destination.x + origin.x) / 2.0;
40
+ CGFloat peak = (screen.size.height + size.height) / 2.0;
41
+ CGPathMoveToPoint(path, NULL, origin.x, origin.y);
42
+
43
+ CGPathAddCurveToPoint(path, NULL, midpoint, peak,
44
+ midpoint, peak,
45
+ destination.x, destination.y);
46
+ return path;
47
+ };
48
+
49
+ void animateLayerAlongPathForKey (CALayer *layer, CGMutablePathRef path, NSString *key) {
50
+ CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:key];
51
+ [animation setPath: path];
52
+ [animation setDuration: seconds];
53
+ [animation setCalculationMode: kCAAnimationLinear];
54
+ [animation setRotationMode: nil];
55
+ [layer addAnimation:animation forKey:key];
56
+ }
57
+
58
+ CALayer * layerForImageWithSize(CGImageRef image, CGSize size) {
59
+ CALayer *layer = [CALayer layer];
60
+
61
+ [layer setContents: (id)(image)];
62
+ [layer setBounds:CGRectMake(0.0, 0.0, size.width, size.height)];
63
+ [layer setPosition:CGPointMake(-size.width, -size.height)];
64
+
65
+ return layer;
66
+ }
67
+
68
+ NSWindow * createTransparentWindow(CGRect screen) {
69
+ NSWindow *window = [[NSWindow alloc] initWithContentRect: screen styleMask: NSBorderlessWindowMask
70
+ backing: NSBackingStoreBuffered
71
+ defer: NO];
72
+ [window setBackgroundColor:[NSColor colorWithCalibratedHue:0 saturation:0 brightness:0 alpha:0.0]];
73
+ [window setOpaque: NO];
74
+ [window setIgnoresMouseEvents:YES];
75
+ [window setLevel: NSFloatingWindowLevel];
76
+
77
+ return window;
78
+ }
79
+
80
+ CGSize getImageSize(NSString *imagePath) {
81
+ NSImage *image = [[NSImage alloc] initWithContentsOfFile: imagePath];
82
+ if (![image isValid]) {
83
+ invalid_image(stderr, (char *)[imagePath UTF8String]);
84
+ }
85
+
86
+ CGSize imageSize = image.size;
87
+
88
+ [image dealloc];
89
+ return imageSize;
90
+ }
91
+
92
+ CGImageRef createCGImage(NSString *imagePath) {
93
+ CGDataProviderRef source = CGDataProviderCreateWithFilename([imagePath UTF8String]);
94
+ NSString* theFileName = [imagePath pathExtension];
95
+ CGImageRef cgimage;
96
+ if ([theFileName isEqualToString: @"png"]) {
97
+ cgimage = CGImageCreateWithPNGDataProvider(source, NULL, true, 0);
98
+ }
99
+ if ([theFileName isEqualToString: @"jpg"] || [theFileName isEqualToString: @"jpeg"]) {
100
+ cgimage = CGImageCreateWithJPEGDataProvider(source, NULL, true, 0);
101
+ }
102
+ return cgimage;
103
+ }
104
+
105
+ CAEmitterLayer * getEmitterForImageInFrame (CGImageRef sparkleImage, CGSize imageSize) {
106
+ static float base = 4.0;
107
+
108
+ CAEmitterLayer *emitter = [[CAEmitterLayer alloc] init];
109
+ emitter.emitterPosition = CGPointMake(-imageSize.width, -imageSize.height);
110
+ emitter.emitterSize = CGSizeMake(imageSize.width, imageSize.height);
111
+ CAEmitterCell *sparkle = [CAEmitterCell emitterCell];
112
+
113
+ sparkle.contents = (id)(sparkleImage);
114
+
115
+ sparkle.birthRate = 20.0/seconds + 15.0;
116
+ sparkle.lifetime = 20.0;
117
+ sparkle.lifetimeRange = 5.0;
118
+ sparkle.name = @"sparkle";
119
+
120
+ // Fade from white to purple
121
+ //sparkle.color = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 1.0);
122
+ //sparkle.greenSpeed = -0.7;
123
+
124
+ sparkle.minificationFilter = kCAFilterNearest;
125
+
126
+ // Fade out
127
+ sparkle.alphaSpeed = -1.0;
128
+
129
+ // Shrink
130
+ sparkle.scale = 2.0;
131
+ sparkle.scaleRange = 2.0;
132
+ sparkle.scaleSpeed = -1.0;
133
+
134
+ // Fall away
135
+ sparkle.velocity = -20.0;
136
+ sparkle.velocityRange = 20.0;
137
+ sparkle.yAcceleration = -100.0;
138
+ sparkle.xAcceleration = -50.0;
139
+
140
+ // Spin
141
+ //sparkle.spin = -2.0;
142
+ //sparkle.spinRange = 4.0;
143
+
144
+ emitter.renderMode = kCAEmitterLayerAdditive;
145
+ emitter.emitterShape = kCAEmitterLayerCuboid;
146
+ emitter.emitterCells = [NSArray arrayWithObject:sparkle];
147
+ return emitter;
148
+ }
149
+
150
+ void animateImage (const char* goslingPathString, const char* sparklePathString) {
151
+ NSString *goslingImagePath = [NSString stringWithFormat: @"%s" , goslingPathString];
152
+ NSString *sparkleImagePath = [NSString stringWithFormat: @"%s" , sparklePathString];
153
+
154
+ // Objective C
155
+ [NSApplication sharedApplication];
156
+ CGRect screen = NSScreen.mainScreen.frame;
157
+ NSWindow *window = createTransparentWindow(screen);
158
+ NSView *view = [[NSView alloc] initWithFrame:screen];
159
+ // NSString *imagePath = [NSString stringWithFormat: @"%s" , 1];
160
+
161
+ // NSString *folder = [NSHomeDirectory() stringByAppendingPathComponent:@".unicornleap"];
162
+ // NSString *folder = getcwd;
163
+ // NSFileManager *NSFm;
164
+ // NSString *folder = @"./";
165
+ // NSString *folder = [[NSFm currentDirectoryPath] stringByAppendingPathComponent];
166
+ // NSString *imagePath = [folder stringByAppendingPathComponent:@"gosling.png"];
167
+ // NSString *sparklePath = [folder stringByAppendingPathComponent:@"heygurl.png"];
168
+
169
+ CGSize imageSize = getImageSize(goslingImagePath);
170
+ CGImageRef cgimage = createCGImage(goslingImagePath);
171
+ CGMutablePathRef arcPath;
172
+ arcPath = pathInFrameForSize(screen, imageSize);
173
+ CALayer *layer;
174
+ CAEmitterLayer *emitter;
175
+ double waitFor = seconds/2.5;
176
+ NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
177
+ layer = layerForImageWithSize(cgimage, imageSize);
178
+
179
+
180
+
181
+
182
+ CGDataProviderRef sparkleSource = CGDataProviderCreateWithFilename([sparkleImagePath UTF8String]);
183
+ CGImageRef sparkleImage = CGImageCreateWithPNGDataProvider(sparkleSource, NULL, true, 0);
184
+ emitter = getEmitterForImageInFrame(sparkleImage, imageSize);
185
+
186
+ [window setContentView: view];
187
+ [window makeKeyAndOrderFront: nil];
188
+
189
+ [view setWantsLayer: YES];
190
+ [view.layer addSublayer: layer];
191
+ [view.layer addSublayer: emitter];
192
+
193
+ animateLayerAlongPathForKey(layer, arcPath, @"position");
194
+ animateLayerAlongPathForKey(emitter, arcPath, @"emitterPosition");
195
+
196
+ [runLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow: waitFor]];
197
+
198
+ // Wait for animation to finish
199
+ [runLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow: seconds - waitFor + 0.2]];
200
+ [goslingImagePath release];
201
+ [goslingImagePath release];
202
+ [view release];
203
+ [window release];
204
+ return;
205
+ }
206
+
207
+ int main (int argc, char * argv[]) {
208
+ program_name = argv[0];
209
+
210
+ // Defaults
211
+ char* s = NULL;
212
+ char* i = NULL;
213
+
214
+ const char* image_path;
215
+ const char* sparkle_path;
216
+ int verbose = 0, num = 1;
217
+ double sec = 2.0;
218
+
219
+ // Parse options
220
+ int next_option;
221
+
222
+ do {
223
+ next_option = getopt_long(argc, argv, short_options, long_options, NULL);
224
+ switch(next_option)
225
+ {
226
+ case 's':
227
+ s = optarg;
228
+ break;
229
+
230
+ case 'v':
231
+ verbose = 1;
232
+ break;
233
+
234
+ case 'i':
235
+ image_path = optarg;
236
+ break;
237
+
238
+ case 'p':
239
+ sparkle_path = optarg;
240
+ break;
241
+
242
+ case 'h': print_usage(stdout, 0);
243
+ case '?': print_usage(stderr, 1);
244
+ case -1: break;
245
+ default: abort();
246
+ }
247
+ } while (next_option != -1);
248
+
249
+ // Coerce string to double
250
+ if (NULL != s) sec = strtod(s, NULL);
251
+ if (! sec > 0.0) sec = 2.0;
252
+ seconds = sec;
253
+
254
+ if (verbose) {
255
+ printf("Seconds: %f\n", seconds);
256
+ printf("Image: %s\n", image_path);
257
+ printf("Sparkle: %s\n", sparkle_path);
258
+ }
259
+
260
+ animateImage(image_path, sparkle_path);
261
+
262
+ return 0;
263
+ }
data/proj/sparkle.png ADDED
Binary file
data/proj/unicorn.png ADDED
Binary file
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gosleap
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kori Roys
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Makes a gosling jump across your screen.
42
+ email:
43
+ - kori@koriroys.com
44
+ executables:
45
+ - gosleap
46
+ - gosling.png
47
+ - heygurl.png
48
+ - imageleap
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - ".gitignore"
53
+ - Gemfile
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - bin/gosleap
58
+ - bin/gosling.png
59
+ - bin/heygurl.png
60
+ - bin/imageleap
61
+ - gosleap.gemspec
62
+ - lib/gosleap.rb
63
+ - lib/gosleap/version.rb
64
+ - proj/Makefile
65
+ - proj/README.md
66
+ - proj/imageleap.1
67
+ - proj/imageleap.xcodeproj/project.pbxproj
68
+ - proj/imageleap.xcodeproj/project.xcworkspace/contents.xcworkspacedata
69
+ - proj/imageleap.xcodeproj/project.xcworkspace/xcshareddata/imageleap.xccheckout
70
+ - proj/main
71
+ - proj/main.m
72
+ - proj/sparkle.png
73
+ - proj/unicorn.png
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.0.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Makes a gosling jump across your screen.
98
+ test_files: []