Skip to content

Commit

Permalink
Merge remote branch 'remotes/ashbb/master' into rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
martindemello committed Aug 11, 2010
2 parents 1fc1f1a + b0e8e33 commit 766b092
Show file tree
Hide file tree
Showing 48 changed files with 128 additions and 49 deletions.
27 changes: 25 additions & 2 deletions lib/shoes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ class << self; attr_accessor :locale, :language end
raise SystemExit, ""
end

opts.on("--nolayered", "No WS_EX_LAYERED style option.") do
$NOLAYERED = 1
Shoes.args!
end

opts.on_tail("-v", "--version", "Display the version info.") do
raise SystemExit, File.read("#{DIR}/VERSION.txt").strip
end
Expand Down Expand Up @@ -218,9 +223,9 @@ def self.manual_as format, *args
man = self
dir, = args
FileUtils.mkdir_p File.join(dir, 'static')
FileUtils.cp "static/shoes-icon.png", "#{dir}/static"
FileUtils.cp "#{DIR}/static/shoes-icon.png", "#{dir}/static"
%w[manual.css code_highlighter.js code_highlighter_ruby.js].
each { |x| FileUtils.cp "static/#{x}", "#{dir}/static" }
each { |x| FileUtils.cp "#{DIR}/static/#{x}", "#{dir}/static" }
html_bits = proc do
proc do |sym, text|
case sym when :intro
Expand Down Expand Up @@ -253,6 +258,24 @@ def self.manual_as format, *args
# index_page
when :list
ul { text.each { |x| li { self << man.manual_p(x, dir) } } }
when :samples
folder = File.join DIR, 'samples'
h = {}
Dir.glob(File.join folder, '*').each do |file|
if File.extname(file) == '.rb'
key = File.basename(file).split('-')[0]
h[key] ? h[key].push(file) : h[key] = [file]
end
end
h.each do |k, v|
p "<h4>#{k}</h4>"
samples = []
v.each do |file|
sample = File.basename(file).split('-')[1..-1].join('-')[0..-4]
samples << "<a href=\"http://github.com/shoes/shoes/raw/master/manual-snapshots/#{k}-#{sample}.png\">#{sample}</a>"
end
p samples.join ' '
end
else
send(TITLES[sym] || :p) { self << man.manual_p(text, dir) }
end
Expand Down
2 changes: 1 addition & 1 deletion lib/shoes/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def sample_page
flow do
v.each do |file|
para link(File.basename(file).split('-')[1..-1].join('-')[0..-4]){
Dir.chdir(folder){eval IO.read(file), TOPLEVEL_BINDING}
Dir.chdir(folder){eval IO.read(file).force_encoding("UTF-8"), TOPLEVEL_BINDING}
}
end
end
Expand Down
3 changes: 3 additions & 0 deletions make/mingw/env.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require 'make/make'
extend Make

EXT_RUBY = "../mingw"

# TODO: We really shouldn't perform actions just by including a file
Expand Down
2 changes: 1 addition & 1 deletion make/mingw/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def copy_ext xdir, libdir

def copy_deps_to_dist
dlls = [RUBY_SO]
dlls += IO.readlines("make/mingw/dlls")
dlls += IO.readlines("make/mingw/dlls").map{|dll| dll.chomp}
dlls += %w{libvlc} if ENV['VIDEO']
dlls.each{|dll| cp "#{EXT_RUBY}/bin/#{dll}.dll", "dist/"}
cp "dist/zlib1.dll", "dist/zlib.dll"
Expand Down
8 changes: 0 additions & 8 deletions make/rakefile_common

This file was deleted.

Binary file added manual-snapshots/Thumbs.db
Binary file not shown.
Binary file added manual-snapshots/class-book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/expert-definr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/expert-funnies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/expert-irb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/expert-minesweeper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/expert-othello.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/expert-pong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/expert-tankspank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/good-arc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/good-clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/good-follow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/good-reminder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/good-vjot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-accordion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-anim-shapes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-anim-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-arc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-bounce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-calc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-chipmunk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-control-sizes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-curve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-dialogs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-downloader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-draw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual-snapshots/simple-editor.png
Binary file added manual-snapshots/simple-form.png
Binary file added manual-snapshots/simple-mask.png
Binary file added manual-snapshots/simple-menu.png
Binary file added manual-snapshots/simple-menu1.png
Binary file added manual-snapshots/simple-rubygems.png
Binary file added manual-snapshots/simple-slide.png
Binary file added manual-snapshots/simple-sphere.png
Binary file added manual-snapshots/simple-sqlite3.png
Binary file added manual-snapshots/simple-timer.png
2 changes: 1 addition & 1 deletion samples/simple-video.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Shoes.app :width => 408, :height => 346, :resizable => false do
background "#eee"
stack :margin => 4 do
@vid = video "http://whytheluckystiff.net/o..e/adventure_time.flv"
@vid = video "http://www.rin-shun.com/shoes/AdventureTimewithFinnandJakeFinnTime.mp4"
end
para "controls: ",
link("play") { @vid.play }, ", ",
Expand Down
8 changes: 4 additions & 4 deletions shoes/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ shoes_app_window(int argc, VALUE *argv, VALUE self, VALUE owner)
app_t->resizable = (ATTR(attr, resizable) != Qfalse);
app_t->hidden = (ATTR(attr, hidden) == Qtrue);
shoes_app_resize(app_t, ATTR2(int, attr, width, SHOES_APP_WIDTH), ATTR2(int, attr, height, SHOES_APP_HEIGHT));
if (RTEST(ATTR(attr, width)))
app_t->minwidth = app_t->width;
if (RTEST(ATTR(attr, height)))
app_t->minheight = app_t->height;
if (RTEST(ATTR(attr, minwidth)))
app_t->minwidth = (ATTR(attr, minwidth) - 1) / 2;
if (RTEST(ATTR(attr, minheight)))
app_t->minheight = (ATTR(attr, minheight) -1) / 2;
shoes_canvas_init(app_t->canvas, app_t->slot, attr, app_t->width, app_t->height);
if (shoes_world->mainloop)
shoes_app_open(app_t, url);
Expand Down
12 changes: 12 additions & 0 deletions shoes/canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const char *dialog_title = USTR("Shoes asks:");
const char *dialog_title_says = USTR("Shoes says:");

static void shoes_canvas_send_start(VALUE);
static void shoes_canvas_send_finish(VALUE);

shoes_transform *
shoes_transform_new(shoes_transform *o)
Expand Down Expand Up @@ -1189,6 +1190,7 @@ shoes_canvas_remove(VALUE self)
if (pc != self_t && DC(self_t->slot) != DC(pc->slot))
shoes_slot_destroy(self_t, pc);
}
shoes_canvas_send_finish(self);
return self;
}

Expand Down Expand Up @@ -1772,6 +1774,16 @@ shoes_canvas_send_start(VALUE self)
}
}

static void
shoes_canvas_send_finish(VALUE self)
{
shoes_canvas *canvas;
Data_Get_Struct(self, shoes_canvas, canvas);
VALUE finish = ATTR(canvas->attr, finish);
if (!NIL_P(finish))
shoes_safe_block(self, finish, rb_ary_new3(1, self));
}

static VALUE
shoes_canvas_send_click2(VALUE self, int button, int x, int y, VALUE *clicked)
{
Expand Down
6 changes: 5 additions & 1 deletion shoes/native/windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,11 @@ shoes_native_app_open(shoes_app *app, char *path, int dialog)
app->os.normal.bottom = app->height;
AdjustWindowRectEx(&app->os.normal, WINDOW_STYLE, FALSE, exStyle);

exStyle |= WS_EX_COMPOSITED|WS_EX_LAYERED;
if (rb_eval_string("$NOLAYERED == 1"))
exStyle |= WS_EX_COMPOSITED;
else
exStyle |= WS_EX_COMPOSITED|WS_EX_LAYERED;

style = app->os.style = WINDOW_STYLE |
(app->resizable ? (WS_THICKFRAME | WS_MAXIMIZEBOX) : WS_DLGFRAME) |
WS_VSCROLL | ES_AUTOVSCROLL;
Expand Down
2 changes: 1 addition & 1 deletion shoes/ruby.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void shoes_ele_remove_all(VALUE);
void shoes_cairo_rect(cairo_t *, double, double, double, double, double);
void shoes_cairo_arc(cairo_t *, double, double, double, double, double, double);

#define SYMBOL_DEFS(f) f(bind); f(gsub); f(keys); f(update); f(merge); f(new); f(URI); f(now); f(debug); f(info); f(warn); f(error); f(run); f(to_a); f(to_ary); f(to_f); f(to_i); f(to_int); f(to_s); f(to_str); f(to_pattern); f(align); f(angle); f(angle1); f(angle2); f(arrow); f(autoplay); f(begin); f(body); f(cancel); f(call); f(center); f(change); f(checked); f(choose); f(click); f(corner); f(curve); f(distance); f(displace_left); f(displace_top); f(downcase); f(draw); f(emphasis); f(end); f(family); f(fill); f(finish); f(font); f(fullscreen); f(group); f(hand); f(headers); f(hidden); f(host); f(hover); f(href); f(insert); f(inner); f(items); f(justify); f(kerning); f(keydown); f(keypress); f(keyup); f(match); f(method); f(motion); f(link); f(leading); f(leave); f(ok); f(outer); f(path); f(points); f(port); f(progress); f(redirect); f(release); f(request_uri); f(rise); f(scheme); f(save); f(size); f(slider); f(state); f(wheel); f(scroll); f(stretch); f(strikecolor); f(strikethrough); f(stroke); f(start); f(attach); f(text); f(title); f(top); f(right); f(bottom); f(left); f(up); f(down); f(height); f(remove); f(resizable); f(strokewidth); f(cap); f(widget); f(width); f(marker); f(margin); f(margin_left); f(margin_right); f(margin_top); f(margin_bottom); f(radius); f(secret); f(blur); f(glow); f(shadow); f(arc); f(rect); f(oval); f(line); f(shape); f(star); f(project); f(round); f(square); f(undercolor); f(underline); f(variant); f(weight); f(wrap); f(dash); f(nodot); f(onedot);
#define SYMBOL_DEFS(f) f(bind); f(gsub); f(keys); f(update); f(merge); f(new); f(URI); f(now); f(debug); f(info); f(warn); f(error); f(run); f(to_a); f(to_ary); f(to_f); f(to_i); f(to_int); f(to_s); f(to_str); f(to_pattern); f(align); f(angle); f(angle1); f(angle2); f(arrow); f(autoplay); f(begin); f(body); f(cancel); f(call); f(center); f(change); f(checked); f(choose); f(click); f(corner); f(curve); f(distance); f(displace_left); f(displace_top); f(downcase); f(draw); f(emphasis); f(end); f(family); f(fill); f(finish); f(font); f(fullscreen); f(group); f(hand); f(headers); f(hidden); f(host); f(hover); f(href); f(insert); f(inner); f(items); f(justify); f(kerning); f(keydown); f(keypress); f(keyup); f(match); f(method); f(motion); f(link); f(leading); f(leave); f(ok); f(outer); f(path); f(points); f(port); f(progress); f(redirect); f(release); f(request_uri); f(rise); f(scheme); f(save); f(size); f(slider); f(state); f(wheel); f(scroll); f(stretch); f(strikecolor); f(strikethrough); f(stroke); f(start); f(attach); f(text); f(title); f(top); f(right); f(bottom); f(left); f(up); f(down); f(height); f(minheight); f(remove); f(resizable); f(strokewidth); f(cap); f(widget); f(width); f(minwidth); f(marker); f(margin); f(margin_left); f(margin_right); f(margin_top); f(margin_bottom); f(radius); f(secret); f(blur); f(glow); f(shadow); f(arc); f(rect); f(oval); f(line); f(shape); f(star); f(project); f(round); f(square); f(undercolor); f(underline); f(variant); f(weight); f(wrap); f(dash); f(nodot); f(onedot);
#define SYMBOL_INTERN(name) s_##name = rb_intern("" # name)
#define SYMBOL_ID(name) ID s_##name
#define SYMBOL_EXTERN(name) extern ID s_##name
Expand Down
2 changes: 1 addition & 1 deletion static/manual-en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,7 @@ Set the position of the video to a time in milliseconds.

Toggles the visibility of the video. If the video can be seen, then `hide` is called. Otherwise, `show` is called.

= And so forth =
= AndSoForth =

A place for some other information.

Expand Down
Loading

0 comments on commit 766b092

Please sign in to comment.