Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Commit

Permalink
Need my rakefile to build, plus keyup functionality
Browse files Browse the repository at this point in the history
* Needed to bring my Rakefile over from my master branch in
  order to build
* Added in keyup functionality. Magically this seems to finish off
  making keydown work. I.e. before I added in keyup, then keydown
  would only work once per key. Keyup must reset this.
  • Loading branch information
i5m committed Nov 12, 2009
1 parent 1a95aab commit 0cf7ec0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Rakefile
Expand Up @@ -18,7 +18,7 @@ VERS = ENV['VERSION'] || "0.r#{REVISION}"
PKG = "#{NAME}-#{VERS}"
APPARGS = APP['run']
FLAGS = %w[DEBUG VIDEO]
VLC_VERSION = (RUBY_PLATFORM =~ /win32/ ? "0.8": `vlc --version 2>/dev/null`.split[2])
VLC_VERSION = (RUBY_PLATFORM =~ /win32|i386-mingw32/ ? "0.8": `vlc --version 2>/dev/null`.split[2])
VLC_0_8 = VLC_VERSION !~ /^0\.9/

if ENV['APP']
Expand Down Expand Up @@ -77,7 +77,7 @@ def copy_files glob, dir
end

def copy_ext xdir, libdir
case RUBY_PLATFORM when /win32/
case RUBY_PLATFORM when /win32|i386-mingw32/
dxdir = xdir.gsub %r!^req/\w+/!, 'deps/'
copy_files "#{dxdir}/*.so", libdir
when /darwin/
Expand Down Expand Up @@ -150,7 +150,7 @@ task :build => [:build_os, "dist/VERSION.txt"] do
cp "req/#{gemn}/gemspec", "#{gdir}/specifications/#{spec.full_name}.gemspec"
end

case RUBY_PLATFORM when /win32/
case RUBY_PLATFORM when /win32|i386-mingw32/
copy_files "#{ext_ruby}/bin/*", "dist/"
copy_files "deps/cairo/bin/*", "dist/"
copy_files "deps/pango/bin/*", "dist/"
Expand Down Expand Up @@ -245,7 +245,7 @@ task :build => [:build_os, "dist/VERSION.txt"] do
chmod 0755, "#{APPNAME}.app/Contents/MacOS/#{NAME}"
# cp InfoPlist.strings YourApp.app/Contents/Resources/English.lproj/
`echo -n 'APPL????' > "#{APPNAME}.app/Contents/PkgInfo"`
when /win32/
when /win32|i386-mingw32/
cp "platform/msw/shoes.exe.manifest", "dist/#{NAME}.exe.manifest"
cp "dist/zlib1.dll", "dist/zlib.dll"
else
Expand All @@ -255,7 +255,7 @@ end

# use the platform Ruby claims
case RUBY_PLATFORM
when /win32/
when /win32|i386-mingw32/
SRC = FileList["shoes/*.c", "shoes/native/windows.c", "shoes/http/winhttp.c", "shoes/http/windownload.c"]
OBJ = SRC.map do |x|
x.gsub(/\.c$/, '.obj')
Expand Down
18 changes: 12 additions & 6 deletions shoes/native/windows.c
Expand Up @@ -589,13 +589,12 @@ shoes_app_win32proc(
app->os.altkey = false;
switch(w)
{
default: {
VALUE v;
default: {
VALUE v;
char letter = w;
v = rb_str_new(&letter, 1);
v = rb_str_new(&letter, 1);
shoes_app_keydown(app, v);
}

}
}
break;
case WM_SYSKEYDOWN:
Expand Down Expand Up @@ -666,7 +665,14 @@ shoes_app_win32proc(
app->os.altkey = false;
else if (w == VK_SHIFT)
app->os.shiftkey = false;
break;
else
{
VALUE v;
char letter = w;
v = rb_str_new(&letter, 1);
shoes_app_keyup(app, v);
}
break;

case WM_MOUSEWHEEL:
{
Expand Down

0 comments on commit 0cf7ec0

Please sign in to comment.