1 /* GWDesktopView.h
2  *
3  * Copyright (C) 2005-2016 Free Software Foundation, Inc.
4  *
5  * Author: Enrico Sersale <enrico@imago.ro>
6  * Date: January 2005
7  *
8  * This file is part of the GNUstep GWorkspace application
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
23  */
24 
25 #import "FSNIconsView.h"
26 
27 @class NSImage;
28 @class GWDesktopManager;
29 
30 typedef enum BackImageStyle {
31   BackImageCenterStyle = 0,
32   BackImageFitStyle = 1,
33   BackImageTileStyle = 2,
34   BackImageScaleStyle = 3
35 } BackImageStyle;
36 
37 
38 @interface GWDesktopView : FSNIconsView
39 {
40   NSRect screenFrame;
41   NSRect *grid;
42   int gridcount;
43   int rowcount;
44 
45   NSImage *dragIcon;
46   NSPoint dragPoint;
47   int insertIndex;
48   BOOL dragLocalIcon;
49 
50   NSImage *backImage;
51   NSString *imagePath;
52   BackImageStyle backImageStyle;
53   BOOL useBackImage;
54 
55   NSMutableArray *mountedVolumes;
56   NSMutableDictionary *desktopInfo;
57 
58   GWDesktopManager *manager;
59 }
60 
61 - (id)initForManager:(id)mngr;
62 
63 - (void)newVolumeMountedAtPath:(NSString *)vpath;
64 
65 - (void)workspaceWillUnmountVolumeAtPath:(NSString *)vpath;
66 
67 - (void)workspaceDidUnmountVolumeAtPath:(NSString *)vpath;
68 
69 - (void)unlockVolumeAtPath:(NSString *)path;
70 
71 - (void)showMountedVolumes;
72 
73 - (void)dockPositionDidChange;
74 
75 - (int)firstFreeGridIndex;
76 
77 - (int)firstFreeGridIndexAfterIndex:(int)index;
78 
79 - (BOOL)isFreeGridIndex:(int)index;
80 
81 - (FSNIcon *)iconWithGridIndex:(int)index;
82 
83 - (NSArray *)iconsWithGridOriginX:(float)x;
84 
85 - (NSArray *)iconsWithGridOriginY:(float)y;
86 
87 - (int)indexOfGridRectContainingPoint:(NSPoint)p;
88 
89 - (NSRect)iconBoundsInGridAtIndex:(int)index;
90 
91 - (void)makeIconsGrid;
92 
93 - (NSImage *)tshelfBackground;
94 
95 - (void)getDesktopInfo;
96 
97 - (void)updateDefaults;
98 
99 @end
100 
101 
102 @interface GWDesktopView (NodeRepContainer)
103 
104 @end
105 
106 
107 @interface GWDesktopView (DraggingDestination)
108 
109 - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
110 
111 - (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
112 
113 - (void)draggingExited:(id <NSDraggingInfo>)sender;
114 
115 - (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
116 
117 - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
118 
119 - (void)concludeDragOperation:(id <NSDraggingInfo>)sender;
120 
121 @end
122 
123 
124 @interface GWDesktopView (BackgroundColors)
125 
126 - (NSColor *)currentColor;
127 
128 - (void)setCurrentColor:(NSColor *)color;
129 
130 - (void)createBackImage:(NSImage *)image;
131 
132 - (NSImage *)backImage;
133 
134 - (NSString *)backImagePath;
135 
136 - (void)setBackImageAtPath:(NSString *)impath;
137 
138 - (BOOL)useBackImage;
139 
140 - (void)setUseBackImage:(BOOL)value;
141 
142 - (BackImageStyle)backImageStyle;
143 
144 - (void)setBackImageStyle:(BackImageStyle)style;
145 
146 @end
147