Changeset 936


Ignore:
Timestamp:
Sep 27, 2006, 8:34:17 PM (15 years ago)
Author:
livings124
Message:

Generate the pieces images in code rather than using files.

Location:
trunk
Files:
6 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r933 r936  
    88
    99/* Begin PBXBuildFile section */
    10                 3518E4D40AC62517002ED3A2 /* BoxBlue2.tiff in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */; };
    11                 3518E5210AC62A29002ED3A2 /* PiecesBack.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E4CD0AC62517002ED3A2 /* PiecesBack.tiff */; };
    12                 3518E5230AC62A2A002ED3A2 /* BoxBlue2.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */; };
    13                 3518E5240AC62A2B002ED3A2 /* BoxBlue1.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E4CF0AC62517002ED3A2 /* BoxBlue1.tiff */; };
    14                 3518E52B0AC62A57002ED3A2 /* BoxWhite.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E5280AC62A55002ED3A2 /* BoxWhite.tiff */; };
    15                 3518E52C0AC62A57002ED3A2 /* BoxBlue3.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E5270AC62A55002ED3A2 /* BoxBlue3.tiff */; };
    16                 3518E57B0AC632EA002ED3A2 /* BoxGreen.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E5760AC63262002ED3A2 /* BoxGreen.tiff */; };
    1710                35B037B60AC59C4000A10FDF /* Check.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037A60AC59BC600A10FDF /* Check.png */; };
    1811                35B038130AC5B6EB00A10FDF /* ResumeNoWaitOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */; };
     
    196189                        files = (
    197190                                A25FCDDF0A37695F002BCBBE /* PauseSelected.png in CopyFiles */,
    198                                 3518E4D40AC62517002ED3A2 /* BoxBlue2.tiff in CopyFiles */,
    199191                        );
    200192                        runOnlyForDeploymentPostprocessing = 0;
     
    229221                29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
    230222                32CA4F630368D1EE00C91783 /* Transmission_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Transmission_Prefix.pch; path = macosx/Transmission_Prefix.pch; sourceTree = "<group>"; };
    231                 3518E4CD0AC62517002ED3A2 /* PiecesBack.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = PiecesBack.tiff; path = macosx/Images/PiecesBack.tiff; sourceTree = "<group>"; };
    232                 3518E4CF0AC62517002ED3A2 /* BoxBlue1.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxBlue1.tiff; path = macosx/Images/BoxBlue1.tiff; sourceTree = "<group>"; };
    233                 3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxBlue2.tiff; path = macosx/Images/BoxBlue2.tiff; sourceTree = "<group>"; };
    234                 3518E5270AC62A55002ED3A2 /* BoxBlue3.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxBlue3.tiff; path = macosx/Images/BoxBlue3.tiff; sourceTree = "<group>"; };
    235                 3518E5280AC62A55002ED3A2 /* BoxWhite.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxWhite.tiff; path = macosx/Images/BoxWhite.tiff; sourceTree = "<group>"; };
    236                 3518E5760AC63262002ED3A2 /* BoxGreen.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxGreen.tiff; path = macosx/Images/BoxGreen.tiff; sourceTree = "<group>"; };
    237223                35B037A60AC59BC600A10FDF /* Check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Check.png; path = macosx/Images/Check.png; sourceTree = "<group>"; };
    238224                35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOn.png; path = macosx/Images/ResumeNoWaitOn.png; sourceTree = "<group>"; };
     
    503489                                A259316A0A73B2CC002F4FE7 /* Transmission Help */,
    504490                                A2F8951E0A2D4BA500ED2127 /* Credits.rtf */,
    505                                 3518E4CD0AC62517002ED3A2 /* PiecesBack.tiff */,
    506                                 3518E4CF0AC62517002ED3A2 /* BoxBlue1.tiff */,
    507                                 3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */,
    508                                 3518E5270AC62A55002ED3A2 /* BoxBlue3.tiff */,
    509                                 3518E5280AC62A55002ED3A2 /* BoxWhite.tiff */,
    510                                 3518E5760AC63262002ED3A2 /* BoxGreen.tiff */,
    511491                                A2305AA40A3DCCEF00AB2D77 /* ProgressBarEndAdvanced.png */,
    512492                                A2305AA50A3DCCEF00AB2D77 /* ProgressBarEndBlue.png */,
     
    863843                                35B038130AC5B6EB00A10FDF /* ResumeNoWaitOn.png in Resources */,
    864844                                35B038140AC5B6EC00A10FDF /* ResumeNoWaitOff.png in Resources */,
    865                                 3518E5210AC62A29002ED3A2 /* PiecesBack.tiff in Resources */,
    866                                 3518E5230AC62A2A002ED3A2 /* BoxBlue2.tiff in Resources */,
    867                                 3518E5240AC62A2B002ED3A2 /* BoxBlue1.tiff in Resources */,
    868                                 3518E52B0AC62A57002ED3A2 /* BoxWhite.tiff in Resources */,
    869                                 3518E52C0AC62A57002ED3A2 /* BoxBlue3.tiff in Resources */,
    870                                 3518E57B0AC632EA002ED3A2 /* BoxGreen.tiff in Resources */,
    871845                        );
    872846                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/PiecesView.m

    r935 r936  
    2626        for (i = 0; i < numPieces; i++)
    2727            fPieces[i] = BLANK;
    28        
    29         fBack = [NSImage imageNamed: @"PiecesBack.tiff"];
    30         NSSize size = [fBack size];
    31        
    32         fWhitePiece = [NSImage imageNamed: @"BoxWhite.tiff"];
    33         [fWhitePiece setScalesWhenResized: YES];
    34         [fWhitePiece setSize: size];
    35        
    36         fGreenPiece = [NSImage imageNamed: @"BoxGreen.tiff"];
    37         [fGreenPiece setScalesWhenResized: YES];
    38         [fGreenPiece setSize: size];
    39        
    40         fBlue1Piece = [NSImage imageNamed: @"BoxBlue1.tiff"];
    41         [fBlue1Piece setScalesWhenResized: YES];
    42         [fBlue1Piece setSize: size];
    43        
    44         fBlue2Piece = [NSImage imageNamed: @"BoxBlue2.tiff"];
    45         [fBlue2Piece setScalesWhenResized: YES];
    46         [fBlue2Piece setSize: size];
    47        
    48         fBlue3Piece = [NSImage imageNamed: @"BoxBlue3.tiff"];
    49         [fBlue3Piece setScalesWhenResized: YES];
    50         [fBlue3Piece setSize: size];
    51        
     28    }
     29   
     30    return self;
     31}
     32
     33- (void) awakeFromNib
     34{
     35        NSSize size = [fImageView frame].size;
     36        NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [fImageView bounds]];
     37       
     38        //back image
     39        fBack = [[NSImage alloc] initWithSize: size];
     40       
     41        [fBack lockFocus];
     42        [[NSColor blackColor] set];
     43        [bp fill];
     44        [fBack unlockFocus];
     45       
     46        //white box image
     47        fWhitePiece = [[NSImage alloc] initWithSize: size];
     48       
     49        [fWhitePiece lockFocus];
     50        [[NSColor whiteColor] set];
     51        [bp fill];
     52        [fWhitePiece unlockFocus];
     53       
     54        //green box image
     55        fGreenPiece = [[NSImage alloc] initWithSize: size];
     56       
     57        [fGreenPiece lockFocus];
     58        [[NSColor colorWithCalibratedRed: 0.557 green: 0.992 blue: 0.639 alpha: 1.0] set];
     59        [bp fill];
     60        [fGreenPiece unlockFocus];
     61       
     62        //blue 1 box image
     63        fBlue1Piece = [[NSImage alloc] initWithSize: size];
     64       
     65        [fBlue1Piece lockFocus];
     66        [[NSColor colorWithCalibratedRed: 0.777 green: 0.906 blue: 1.0 alpha: 1.0] set];
     67        [bp fill];
     68        [fBlue1Piece unlockFocus];
     69       
     70        //blue 2 box image
     71        fBlue2Piece = [[NSImage alloc] initWithSize: size];
     72       
     73        [fBlue2Piece lockFocus];
     74        [[NSColor colorWithCalibratedRed: 0.682 green: 0.839 blue: 1.0 alpha: 1.0] set];
     75        [bp fill];
     76        [fBlue2Piece unlockFocus];
     77       
     78        //blue 3 box image
     79        fBlue3Piece = [[NSImage alloc] initWithSize: size];
     80       
     81        [fBlue3Piece lockFocus];
     82        [[NSColor colorWithCalibratedRed: 0.506 green: 0.745 blue: 1.0 alpha: 1.0] set];
     83        [bp fill];
     84        [fBlue3Piece unlockFocus];
     85       
     86        //actually draw the box
    5287        [self setTorrent: nil];
    53     }
    54    
    55     return self;
    5688}
    5789
Note: See TracChangeset for help on using the changeset viewer.