class -> strucT

This commit is contained in:
Eric Holk 2012-08-17 16:06:06 -07:00
parent 7c122a660e
commit 8dc5398ad6
12 changed files with 18 additions and 20 deletions

View file

@ -64,7 +64,7 @@ fn join_layout(scope: NodeScope, layout: Layout) {
}
}
class Document {
struct Document {
let root: Node;
let css_rules: arc<Stylesheet>;
@ -74,7 +74,7 @@ class Document {
}
}
class Content<S:Sink send copy> {
struct Content<S:Sink send copy> {
let sink: S;
let layout: Layout;
let from_master: comm::Port<ControlMsg>;

View file

@ -24,7 +24,7 @@ enum NodeKind {
Text(~str)
}
class ElementData {
struct ElementData {
let tag_name: ~str;
let kind: ~ElementKind;
let attrs: DVec<~Attr>;
@ -48,7 +48,7 @@ class ElementData {
}
}
class Attr {
struct Attr {
let name: ~str;
let value: ~str;

View file

@ -64,7 +64,7 @@ type ScopeData<T:send,A> = {
mut first_dirty: Handle<T,A>
};
class ScopeResource<T:send,A> {
struct ScopeResource<T:send,A> {
let d : ScopeData<T,A>;
new(-d : ScopeData<T,A>) {
self.d = d;

View file

@ -12,7 +12,7 @@ import image_cache_task::{ImageCacheTask, image_cache_task, ImageCacheTaskClient
import pipes::{port, chan};
class Engine<S:Sink send copy> {
struct Engine<S:Sink send copy> {
let sink: S;
let renderer: Renderer;

View file

@ -29,7 +29,7 @@ enum BoxKind {
TextBoxKind(@TextBox)
}
class Appearance {
struct Appearance {
let mut background_image: option<ImageHolder>;
let mut background_color: Color;
let mut width: Unit;
@ -62,7 +62,7 @@ class Appearance {
}
}
class Box {
struct Box {
let tree: tree::Tree<@Box>;
let node: Node;
let kind: BoxKind;
@ -78,10 +78,10 @@ class Box {
}
}
#[doc="A class to store image data. The image will be loaded once,
#[doc="A struct to store image data. The image will be loaded once,
the first time it is requested, and an arc will be stored. Clones of
this arc are given out on demand."]
class ImageHolder {
struct ImageHolder {
// Invariant: at least one of url and image is not none, except
// occasionally while get_image is being called
let mut url : option<url>;

View file

@ -55,7 +55,7 @@ fn create_resource_task_with_loaders(+loaders: ~[(~str, LoaderTaskFactory)]) ->
}
}
class ResourceManager {
struct ResourceManager {
let from_client: Port<ControlMsg>;
/// Per-scheme resource loaders
let loaders: ~[(~str, LoaderTaskFactory)];

View file

@ -7,13 +7,11 @@ import ptr::{ null, addr_of };
import native_font::NativeFont;
import font_library::FontLibrary;
// FIXME (rust 2708): convert this to a class
#[doc = "
A font handle. Layout can use this to calculate glyph metrics
and the renderer can use it to render text.
"]
class Font {
struct Font {
let fontbuf: @~[u8];
let native_font: NativeFont;

View file

@ -3,7 +3,7 @@ export FontLibrary, native;
import font::{Font, test_font_bin};
import result::{result, ok, err};
class FontLibrary {
struct FontLibrary {
let native_lib: native::NativeFontLibrary;
new() {

View file

@ -7,7 +7,7 @@ import geom::point::Point2D;
type GlyphIndex = uint;
#[doc="The position of a glyph on the screen."]
class GlyphPos {
struct GlyphPos {
let advance: Point2D<au>;
let offset: Point2D<au>;
new(advance: Point2D<au>, offset: Point2D<au>) {
@ -17,7 +17,7 @@ class GlyphPos {
}
#[doc="A single glyph."]
class Glyph {
struct Glyph {
let index: GlyphIndex;
let pos: GlyphPos;

View file

@ -17,7 +17,7 @@ import freetype::bindgen::{
FT_Set_Char_Size
};
class FreeTypeNativeFont/& {
struct FreeTypeNativeFont/& {
let face: FT_Face;
new(face: FT_Face) {

View file

@ -18,7 +18,7 @@ import cocoa::cg::cg::{
CGFontRelease
};
class QuartzNativeFont/& {
struct QuartzNativeFont/& {
let fontprov: CGDataProviderRef;
let cgfont: CGFontRef;

View file

@ -8,7 +8,7 @@ import glyph::Glyph;
import shaper::shape_text;
#[doc="A single, unbroken line of text."]
class TextRun {
struct TextRun {
let glyphs: ~[Glyph];
new(font: Font, text: ~str) {