4 Original GPL release version 4.12
5 Copyright 1993-2000 Jonathan Potter
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 All users of Directory Opus 4 (including versions distributed
22 under the GPL) are entitled to upgrade to the latest version of
23 Directory Opus version 5 at a reduced price. Please see
24 http://www.gpsoft.com.au for more information.
26 The release of Directory Opus 4 under the GPL in NO WAY affects
27 the existing commercial status of Directory Opus 5.
38 char *dummy_args
[16],*port
,stringname
[80];
39 struct DOpusStartup
*startup
=NULL
;
41 struct StringData stringdata
;
46 startup
=(struct DOpusStartup
*)argv
;
47 for (arg
=0;arg
<startup
->wbstartup
.sm_NumArgs
&& arg
<16;arg
++) {
48 dummy_args
[arg
]=startup
->wbstartup
.sm_ArgList
[arg
].wa_Name
;
51 for (;arg
<16;arg
++) dummy_args
[arg
]=NULL
;
58 !(DOpusBase
=(struct DOpusBase
*)OpenLibrary("dopus.library",18)) ||
59 !(IconBase
=OpenLibrary("icon.library",0))) {
60 if (DOpusBase
) CloseLibrary((struct Library
*)DOpusBase
);
64 IntuitionBase
=DOpusBase
->IntuitionBase
;
65 GfxBase
=DOpusBase
->GfxBase
;
66 LayersBase
=(struct Library
*)DOpusBase
->LayersBase
;
68 if (argc
>2 && argv
[1][0]=='&') {
76 get_vis_info(&vis
,port
);
78 stringdata
.default_table
=default_strings
;
79 stringdata
.string_count
=STR_STRING_COUNT
;
80 stringdata
.string_table
=NULL
;
81 stringdata
.string_buffer
=NULL
;
82 stringdata
.min_version
=STRING_VERSION
;
85 lsprintf(stringname
,"DOpus:Modules/S/DM_Icon_%s.STR",vis
.vi_language
);
88 if (ReadStringFile(&stringdata
,stringname
)) {
89 string_table
=stringdata
.string_table
;
93 a
=doiconinfo(&vis
,argv
[arg
]);
94 if (startup
) startup
->retcode
=a
;
96 FreeStringFile(&stringdata
);
98 CloseLibrary(IconBase
);
99 CloseLibrary((struct Library
*)DOpusBase
);
103 void get_vis_info(vis
,portname
)
107 vis
->vi_fg
=1; vis
->vi_bg
=0;
108 vis
->vi_shine
=2; vis
->vi_shadow
=1;
111 vis
->vi_stringcol
[0]=1; vis
->vi_stringcol
[1]=0;
112 vis
->vi_activestringcol
[0]=1; vis
->vi_activestringcol
[1]=0;
113 vis
->vi_flags
=VISF_8POINTFONT
|VISF_WINDOW
;
114 vis
->vi_language
=NULL
;
116 if (dopus_message(DOPUSMSG_GETVIS
,(APTR
)vis
,portname
)) return;
118 if (IntuitionBase
->LibNode
.lib_Version
>35) {
119 struct DrawInfo
*drinfo
;
122 if (pub
=LockPubScreen(NULL
)) {
123 drinfo
=GetScreenDrawInfo(pub
);
124 vis
->vi_shine
=drinfo
->dri_Pens
[SHINEPEN
];
125 vis
->vi_shadow
=drinfo
->dri_Pens
[SHADOWPEN
];
126 vis
->vi_fg
=drinfo
->dri_Pens
[TEXTPEN
];
127 vis
->vi_bg
=drinfo
->dri_Pens
[BACKGROUNDPEN
];
128 FreeScreenDrawInfo(pub
,drinfo
);
129 UnlockPubScreen(NULL
,pub
);
134 int dopus_message(cmd
,data
,portname
)
139 struct MsgPort
*port
,*replyport
;
140 struct DOpusMessage msg
;
143 if (portname
&& portname
[0] &&
144 (port
=FindPort(portname
)) &&
145 (replyport
=LCreatePort(NULL
,0))) {
146 msg
.msg
.mn_Node
.ln_Type
=NT_MESSAGE
;
147 msg
.msg
.mn_Node
.ln_Name
=NULL
;
148 msg
.msg
.mn_ReplyPort
=replyport
;
149 msg
.msg
.mn_Length
=(UWORD
)sizeof(struct DOpusMessage
);
152 PutMsg(port
,(struct Message
*)&msg
);
156 LDeletePort(replyport
);
163 void fill_out_req(req
,vis
)
164 struct RequesterBase
*req
;
167 req
->rb_fg
=vis
->vi_fg
;
168 req
->rb_bg
=vis
->vi_bg
;
169 req
->rb_shine
=vis
->vi_shine
;
170 req
->rb_shadow
=vis
->vi_shadow
;
171 req
->rb_font
=vis
->vi_font
;
172 req
->rb_flags
&=~RBF_WINDOWCENTER
;
173 if (vis
->vi_screen
) {
174 if (vis
->vi_flags
&VISF_WINDOW
) {
175 req
->rb_screen
=((struct Window
*)vis
->vi_screen
)->WScreen
;
176 req
->rb_window
=(struct Window
*)vis
->vi_screen
;
177 req
->rb_flags
|=RBF_WINDOWCENTER
;
179 else req
->rb_screen
=vis
->vi_screen
;
181 else req
->rb_screen
=NULL
;
184 struct Gadget
*addreqgadgets(reqbase
,gadgets
)
185 struct RequesterBase
*reqbase
;
186 struct TagItem
**gadgets
;
189 struct Gadget
*gadget
=NULL
,*newgadget
,*firstgadget
;
192 if (!gadgets
[gad
]) break;
193 if (!(newgadget
=(struct Gadget
*)
194 AddRequesterObject(reqbase
,gadgets
[gad
]))) return(NULL
);
195 if (gadget
) gadget
->NextGadget
=newgadget
;
196 else firstgadget
=newgadget
;
199 AddGadgets(reqbase
->rb_window
,firstgadget
,NULL
,gad
,reqbase
->rb_shine
,reqbase
->rb_shadow
,1);
203 void fix_listview(reqbase
,list
)
204 struct RequesterBase
*reqbase
;
205 struct DOpusListView
*list
;
207 list
->window
=reqbase
->rb_window
;
208 list
->flags
|=DLVF_SLOW
;
210 list
->slidercol
=reqbase
->rb_fg
;
211 list
->sliderbgcol
=reqbase
->rb_bg
;
212 list
->textcol
=reqbase
->rb_fg
;
213 list
->boxhi
=reqbase
->rb_shine
;
214 list
->boxlo
=reqbase
->rb_shadow
;
215 list
->arrowfg
=reqbase
->rb_fg
;
216 list
->arrowbg
=reqbase
->rb_bg
;
217 list
->itemfg
=reqbase
->rb_fg
;
218 list
->itembg
=reqbase
->rb_bg
;
226 for (b
=0;b
<6;b
++) specific_gadtext
[a
][b
]=NULL
;
227 for (a
=0;a
<5;a
++) specific_gadtext
[0][a
]=string_table
[STR_BLOCKS
+a
];
228 specific_gadtext
[1][4]=string_table
[STR_LAST_CHANGED
];
231 specific_gadtext
[a
][0]=string_table
[STR_BLOCKS
];
232 specific_gadtext
[a
][1]=string_table
[STR_BYTES
];
233 specific_gadtext
[a
][3]=string_table
[STR_STACK
];
234 specific_gadtext
[a
][4]=string_table
[STR_LAST_CHANGED
];
237 specific_gadtext
[4][4]=string_table
[STR_LAST_CHANGED
];
239 for (a
=0;a
<8;a
++) icon_type_names
[a
]=string_table
[STR_DISK
+a
];