mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 01:20:38 +00:00
Refactoring of GSDrawTiles to let it draw itself, and added a new init method
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28838 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
161d6e03e7
commit
2c3f0453ee
5 changed files with 581 additions and 464 deletions
|
@ -55,9 +55,16 @@ typedef enum {
|
|||
@public
|
||||
NSImage *images[9]; /** The tile images */
|
||||
NSRect rects[9]; /** The rectangles to use when drawing */
|
||||
float scaleFactor;
|
||||
}
|
||||
- (id) copyWithZone: (NSZone*)zone;
|
||||
|
||||
/* Initialise with a single image, using 'annotations' to determinate
|
||||
* where the tiles are in the image, in the form of black pixels in a 1-pixel surrounding border.
|
||||
* It is similar to http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
|
||||
*/
|
||||
- (id) initWithNinePatchImage: (NSImage*)image;
|
||||
|
||||
/* Initialise with a single image assuming division into nine equally
|
||||
* sized sections.
|
||||
*/
|
||||
|
@ -68,10 +75,35 @@ typedef enum {
|
|||
*/
|
||||
- (id) initWithImage: (NSImage*)image horizontal: (float)x vertical: (float)y;
|
||||
|
||||
/* Scale the imge to the specified value.
|
||||
/*
|
||||
* Verify the individual tiles size
|
||||
* If incorrect, we nullify the corresponding image
|
||||
* otherwise, we retain it.
|
||||
*/
|
||||
- (void) validateTilesSizeWithImage: (NSImage*)image;
|
||||
|
||||
/* Scale the image to the specified value.
|
||||
*/
|
||||
- (void) scaleTo: (float)multiple;
|
||||
|
||||
- (NSRect) fillRect: (NSRect)rect
|
||||
background: (NSColor*) color
|
||||
fillStyle: (GSThemeFillStyle)style;
|
||||
|
||||
- (NSSize) computeTotalTilesSize;
|
||||
- (void) drawCornersRect: (NSRect)rect;
|
||||
- (void) repeatFillRect: (NSRect)rect;
|
||||
|
||||
- (NSRect) noneStyleFillRect: (NSRect)rect;
|
||||
- (NSRect) centerStyleFillRect: (NSRect)rect;
|
||||
- (NSRect) repeatStyleFillRect: (NSRect)rect;
|
||||
- (NSRect) scaleStyleFillRect: (NSRect)rect;
|
||||
|
||||
/* Draw GSThemeFillStyleMatrix
|
||||
*/
|
||||
- (NSRect) matrixStyleFillRect: (NSRect)rect;
|
||||
- (void) repeatFillRect: (NSRect)rect;
|
||||
|
||||
@end
|
||||
|
||||
/** This is the panel used to select and inspect themes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue