chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / dbx / fileIcon
1 ;
2 ; dbx.fileIcon.sh
3 ;
4 ; Draggable file icons as dbx controls
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire.  If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ;  fileIcon_sprName
32 ;  fileIcon_reAppear
33 ;  fileIcon_closed
34 ;
35 ; Controls provided:
36 ;
37 ;   fileIcon
38 ;
39 ; Macros provided:
40 ;
41 ;   FILEICN
42
43                 GET     sapphire:dbx.dbx
44
45                 [       :LNOT::DEF:fileIcon__dfn
46                 GBLL    fileIcon__dfn
47
48 ; --- fileIcon_sprName ---
49 ;
50 ; On entry:     R0 == filetype
51 ;               R1 == pointer to filename
52 ;
53 ; On exit:      R0 == pointer to sprite name to use
54 ;
55 ; Use:          Works out the sprite name to use for the given filetype and
56 ;               name pair.
57
58                 IMPORT  fileIcon_sprName
59
60 ; --- fileIcon_reAppear ---
61 ;
62 ; On entry:     --
63 ;
64 ; On exit:      --
65 ;
66 ; Use:          Makes the currently vanished file icon reappear.
67
68                 IMPORT  fileIcon_reAppear
69
70 ; --- fileIcon_closed ---
71 ;
72 ; On entry:     R0 == dialogue box handle
73 ;
74 ; On exit:      --
75 ;
76 ; Use:          Informs fileIcon that the specified dialogue box has closed.
77
78                 IMPORT  fileIcon_closed
79
80 ; --- fileIcon ---
81 ;
82 ; Control data: +0
83 ;
84 ; Workspace:    +0 == filetype of object to display
85 ;               +4 == address of filename
86 ;               +8
87 ;
88 ; Flags:        --
89 ;
90 ; Use:          Control which displays a filetype icon, and allows it to
91 ;               be dragged.
92
93                 IMPORT  fileIcon
94
95 ;----- Macros and symbols ---------------------------------------------------
96
97                 MACRO
98 $label          FILEICN $icon,$baseReg,$data
99
100 $label          CONTROL $icon,fileIcon,$baseReg,0,$data
101                 ECTRL
102
103                 MEND
104
105 fIcon_event     EQU     &80000003               ;File icon dropped
106                                                 ;R1 == icon handle
107                                                 ;R2 == dest window handle
108                                                 ;R3 == dest icon handle
109
110                 ]
111
112 ;----- That's all, folks ----------------------------------------------------
113
114                 END