Skip to content

Commit

Permalink
Fix #53
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed Jul 27, 2015
1 parent a868d44 commit dd8bd55
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 107 deletions.
16 changes: 8 additions & 8 deletions src/basics/behavior.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export hasstate,
scrollbutton


@api hasstate => WithState <: Behavior begin
@api hasstate => (WithState <: Behavior) begin
doc("Watch for changes to an attribute/property.")
curry(tile::Tile, doc="Tile to watch.")
kwarg(name::Symbol=:_state, doc="A name to identify the behavior.")
Expand Down Expand Up @@ -47,7 +47,7 @@ render(t::WithState, state) =
source=t.source,
)

@api keypress => Keypress <: Behavior begin
@api keypress => (Keypress <: Behavior) begin
doc("A keypress listener.")
arg(
keys::String,
Expand Down Expand Up @@ -90,7 +90,7 @@ abstract MouseButton
scrollbutton => ScrollButton
end

@api clickable => Clickable <: Behavior begin
@api clickable => (Clickable <: Behavior) begin
doc("Watch for clicks.")
typedarg(
buttons::AbstractArray=[leftbutton],
Expand Down Expand Up @@ -125,7 +125,7 @@ render(c::Clickable, state) =
buttons=string(map(button_number, c.buttons)),
)

@api selectable => Selectable <: Behavior begin
@api selectable => (Selectable <: Behavior) begin
doc("Watch for a selection in a selection widget.")
curry(tile::Tile, doc="A selection widget.")
kwarg(name::Symbol=:_clicks, doc="The name to identify the behavior.")
Expand All @@ -147,7 +147,7 @@ abstract MouseState
mouseup => MouseUp
end

@api hoverable => Hoverable <: Behavior begin
@api hoverable => (Hoverable <: Behavior) begin
typedarg(get_coords::Bool=false)
curry(tile::Tile)
kwarg(name::Symbol=:_hover)
Expand Down Expand Up @@ -180,7 +180,7 @@ send(chan::Symbol, watch::Symbol, b) =
send(chan::Symbol, b::Behavior) =
ChanSend(chan, name(b), broadcast(b))

@apidoc send => ChanSend <: Behavior begin
@apidoc send => (ChanSend <: Behavior) begin
doc("Emit changes to an attribute/property to a named channel.")
arg(chan::Symbol, doc="The name of the channel.")
arg(watch::Symbol, doc="The attribute/property to watch.")
Expand All @@ -200,7 +200,7 @@ end
recv(chan::Symbol, t, attr) =
ChanRecv(chan, attr, t)

@apidoc recv => ChanSend <: Behavior begin
@apidoc recv => (ChanSend <: Behavior) begin
doc("Read values from a named channel.")
arg(chan::Symbol, doc="The name of the channel.")
arg(attr::Symbol, doc="The attribute/property to set.")
Expand All @@ -214,7 +214,7 @@ render(chan::ChanRecv, state) =
wire(a, b, chan, attribute) =
send(chan, a), recv(chan, b, attribute)

@apidoc wire => ChanSend <: Behavior begin
@apidoc wire => (ChanSend <: Behavior) begin
doc("Connect attribute/property of two tiles over a named channel.")
arg(a::Tile, doc="The sender tile.")
arg(b::Tile, doc="The receiver tile.")
Expand Down
8 changes: 4 additions & 4 deletions src/basics/content.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export list, image, link, abbr

@api list => List <: Tile begin
@api list => (List <: Tile) begin
doc("Stylize a list of tiles as an itemized list.")
curry(tiles::TileList , doc="A tile or a vector of tiles.")
kwarg(ordered::Bool=false, doc=md"If set to `true`, numbering will be used.")
Expand All @@ -10,7 +10,7 @@ render(l::List, state) =
Elem(l.ordered ? :ol : :ul,
map(x -> Elem(:li, render(x, state)), l.tiles.tiles))

@api image => Image <: Tile begin
@api image => (Image <: Tile) begin
doc(md"""Show an image from a `url`. To read an image and display it, use
[`Images.imread`](https://github.com/timholy/Images.jl#readme).""")
arg(url::String, doc="The url of the image.")
Expand All @@ -20,7 +20,7 @@ end
render(i::Image, state) =
Elem(:img, src=i.url, alt=i.alt, style=@d("width"=>"auto", "height"=>"auto", "display" => "block"))

@api link => Hyperlink <: Tile begin
@api link => (Hyperlink <: Tile) begin
doc("A hyperlink.")
arg(url::String, doc="The destination of the link.")
curry(
Expand All @@ -32,7 +32,7 @@ end
render(a::Hyperlink, state) =
Elem(:a, render(a.tiles, state), href=a.url)

@api abbr => Abbr <: Tile begin
@api abbr => (Abbr <: Tile) begin
doc(md"""An abbreviation. When you hover over an abbreviation, the `title` is
shown in a tooltip.""")
arg(title::String, doc="The title to show.")
Expand Down
18 changes: 9 additions & 9 deletions src/basics/embellishment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export noborder,

const allsides = Side[]

@api bordercolor => BorderColor <: Tile begin
@api bordercolor => (BorderColor <: Tile) begin
doc(md"""Set the border color. Note that you need to set the `borderwidth` as
well for the border to actually appear.""")
typedarg(
Expand All @@ -36,7 +36,7 @@ render(t::BorderColor, state) =
) |> style
)

@api borderwidth => BorderWidth <: Tile begin
@api borderwidth => (BorderWidth <: Tile) begin
doc("Set the border width.")
typedarg(
sides::AbstractArray=allsides,
Expand Down Expand Up @@ -65,7 +65,7 @@ name(::Solid) = "solid"
name(::Dotted) = "dotted"
name(::Dashed) = "dashed"

@api borderstyle => BorderStyle <: Tile begin
@api borderstyle => (BorderStyle <: Tile) begin
doc(md"""Set the border style. Note that you need to set the `borderwidth`
as well for the border to actually appear.""")
typedarg(
Expand Down Expand Up @@ -107,7 +107,7 @@ border(style::StrokeStyle, width::Length, color::ColorValue, tile) =
border(style::StrokeStyle, width, color) =
tile -> border(style, width, color, tile)

@apidoc border => BorderStyle <: Tile begin
@apidoc border => (BorderStyle <: Tile) begin
doc("A helper function for setting border properties.")
typedarg(sides::AbstractArray=allsides, doc="An array of sides to set the border for. Valid values are `left`, `right`, `top` and `bottom`. By default the border is set for all sides.")
arg(style::StrokeStyle, doc="The border style. Valid values are `noborder`, `dotted`, `dashed` and `solid`.")
Expand All @@ -120,7 +120,7 @@ const default_border_color = RGB(0.6, 0.6, 0.6)
hline(;style=solid, width=1px, color=default_border_color) =
border([bottom], style, width, color, empty)

@apidoc hline => BorderStyle <: Tile begin
@apidoc hline => (BorderStyle <: Tile) begin
doc("Create a horizontal line. Returns a bordered tile of height 0.")
kwarg(style::StrokeStyle, doc="The line style. Valid values are `noborder`, `dotted`, `dashed` and `solid`.")
kwarg(width::Length, doc="The width.")
Expand All @@ -130,7 +130,7 @@ end
vline(;style=solid, width=1px, color=default_border_color) =
border([left], style, width, color, empty)

@apidoc vline => BorderStyle <: Tile begin
@apidoc vline => (BorderStyle <: Tile) begin
doc("Create a vertical line. Returns a bordered tile of width 0.")
kwarg(style::StrokeStyle, doc="The line style. Valid values are `noborder`, `dotted`, `dashed` and `solid`.")
kwarg(width::Length, doc="The width.")
Expand All @@ -140,7 +140,7 @@ end
## RoundRects

const allcorners = Corner[]
@api roundcorner => RoundedRect <: Tile begin
@api roundcorner => (RoundedRect <: Tile) begin
doc("Round the corner of a tile.")
typedarg(corners::AbstractArray=allcorners, doc=md"An array of corners to set the rounding for. By default, all corners are rounded. Valid corners are `topleft`,`midtop`,`topright`,`midleft`,`middle`,`midright`,`bottomleft`,`midbottom` and `bottomright`.")
arg(radius::Length, doc="The radius.")
Expand All @@ -154,7 +154,7 @@ render(t::RoundedRect, state) =

## Box shadow

@api shadow => Shadow <: Tile begin
@api shadow => (Shadow <: Tile) begin
doc("Show a shadow around a tile.")
curry(tile::Tile, doc="A tile.")
kwarg(inset::Bool=false, doc="Set whether the shadow falls inward or outward")
Expand All @@ -166,7 +166,7 @@ end

## Fill color

@api fillcolor => FillColor <: Tile begin
@api fillcolor => (FillColor <: Tile) begin
doc("Fill a tile with a color.")
arg(color::ColorValue, doc="The color.")
curry(tile::Tile, doc="The tile.")
Expand Down
Loading

0 comments on commit dd8bd55

Please sign in to comment.