1238431Sdteske\ Copyright (c) 2006-2011 Devin Teske <dteske@FreeBSD.org>
2222417Sjulian\ All rights reserved.
3222417Sjulian\ 
4222417Sjulian\ Redistribution and use in source and binary forms, with or without
5222417Sjulian\ modification, are permitted provided that the following conditions
6222417Sjulian\ are met:
7222417Sjulian\ 1. Redistributions of source code must retain the above copyright
8222417Sjulian\    notice, this list of conditions and the following disclaimer.
9222417Sjulian\ 2. Redistributions in binary form must reproduce the above copyright
10222417Sjulian\    notice, this list of conditions and the following disclaimer in the
11222417Sjulian\    documentation and/or other materials provided with the distribution.
12222417Sjulian\ 
13222417Sjulian\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14222417Sjulian\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15222417Sjulian\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16222417Sjulian\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17222417Sjulian\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18222417Sjulian\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19222417Sjulian\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20222417Sjulian\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21222417Sjulian\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22222417Sjulian\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23222417Sjulian\ SUCH DAMAGE.
24222417Sjulian\ 
25222417Sjulian\ $FreeBSD$
26222417Sjulian
27222417Sjulianmarker task-brand.4th
28222417Sjulian
29222417Sjulianvariable brandX
30222417Sjulianvariable brandY
31222417Sjulian
32222417Sjulian\ Initialize logo placement
33222417Sjulian2 brandX !
34222417Sjulian1 brandY !
35222417Sjulian
36222417Sjulian: fbsd-logo ( x y -- ) \ "FreeBSD" [wide] logo in B/W (7 rows x 42 columns)
37222417Sjulian
38222417Sjulian	2dup at-xy ."  ______               ____   _____ _____  " 1+
39222417Sjulian	2dup at-xy ." |  ____|             |  _ \ / ____|  __ \ " 1+
40222417Sjulian	2dup at-xy ." | |___ _ __ ___  ___ | |_) | (___ | |  | |" 1+
41222417Sjulian	2dup at-xy ." |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |" 1+
42222417Sjulian	2dup at-xy ." | |   | | |  __/  __/| |_) |____) | |__| |" 1+
43222417Sjulian	2dup at-xy ." | |   | | |    |    ||     |      |      |" 1+
44222417Sjulian	     at-xy ." |_|   |_|  \___|\___||____/|_____/|_____/ "
45222417Sjulian
46222417Sjulian	\ Put the cursor back at the bottom
47222417Sjulian	0 25 at-xy
48222417Sjulian;
49222417Sjulian
50222417Sjulian\ This function draws any number of company logos at (loader_brand_x,
51222417Sjulian\ loader_brand_y) if defined, or (2,1) (top-left) if not defined. To choose
52222417Sjulian\ your logo, set the variable `loader_brand' to the respective logo name.
53222417Sjulian\ 
54222417Sjulian\ Currently available:
55222417Sjulian\
56222417Sjulian\ 	NAME        DESCRIPTION
57222417Sjulian\ 	fbsd        FreeBSD logo
58222417Sjulian\ 
59267010Srodrigc\ NOTE: Setting `loader_brand' to the value of an existing function
60267010Srodrigc\       (such as "mycustom-brand") will cause that symbol to be executed.
61222417Sjulian\ NOTE: Setting `loader_brand' to an undefined value (such as "none") will
62222417Sjulian\       prevent any brand from being drawn.
63222417Sjulian\ 
64222417Sjulian: draw-brand ( -- )
65222417Sjulian
66222417Sjulian	s" loader_brand_x" getenv dup -1 <> if
67222417Sjulian		?number 1 = if
68222417Sjulian			brandX !
69222417Sjulian		then
70222417Sjulian	else
71222417Sjulian		drop
72222417Sjulian	then
73222417Sjulian
74222417Sjulian 	s" loader_brand_y" getenv dup -1 <> if
75222417Sjulian 		?number 1 = if
76222417Sjulian			brandY !
77222417Sjulian		then
78222417Sjulian 	else
79222417Sjulian		drop
80222417Sjulian	then
81222417Sjulian
82222417Sjulian	s" loader_brand" getenv dup -1 = if
83222417Sjulian		brandX @ brandY @ fbsd-logo
84222417Sjulian		drop exit
85222417Sjulian	then
86222417Sjulian
87222417Sjulian	2dup s" fbsd" compare-insensitive 0= if
88222417Sjulian		brandX @ brandY @ fbsd-logo
89222417Sjulian		2drop exit
90222417Sjulian	then
91222417Sjulian
92267010Srodrigc        \ if it refers to a raw symbol then run that function
93267010Srodrigc        sfind if
94267010Srodrigc            brandX @ brandY @
95267010Srodrigc            2 roll
96267010Srodrigc            execute
97267010Srodrigc        else            
98267010Srodrigc            drop
99267010Srodrigc        then
100267010Srodrigc
101222417Sjulian	2drop
102222417Sjulian;
103