1 /* $XConsortium: vglogo.c /main/4 1995/10/27 16:17:33 rswiston $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
4 * (c) Copyright 1993, 1994 International Business Machines Corp. *
5 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
6 * (c) Copyright 1993, 1994 Novell, Inc. *
8 /************************************<+>*************************************
9 ****************************************************************************
13 ** Project: HP Visual User Environment (DT)
15 ** Description: Routines to create the Corporate logo
19 ** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
23 ****************************************************************************
24 ************************************<+>*************************************/
27 /***************************************************************************
31 ***************************************************************************/
34 #include <X11/Intrinsic.h>
35 #include <X11/StringDefs.h>
37 #include <Xm/DrawingA.h>
40 #include <Dt/IconFile.h>
44 #include "vglogo.h" /* pixmap and bitmap for default Login logo */
51 /***************************************************************************
53 * External declarations
55 ***************************************************************************/
58 /***************************************************************************
60 * Procedure declarations
62 ***************************************************************************/
65 /***************************************************************************
69 ***************************************************************************/
71 LogoInfo logoInfo; /* logo resources */
73 static XtResource logoResources[] = {
74 {"bitmapFile", "BitmapFile",
75 XtRString, sizeof(char *), XtOffset(LogoInfoPtr, bitmapFile),
77 XtRString, "DECDtlogo" },
79 XtRString, "Dtlogo" },
84 /***************************************************************************
90 * Widgets: logo, logo_pixmap
91 ***************************************************************************/
98 char *logoFile; /* name of logo bitmap file */
100 Pixmap logoPixmap; /* logo pixmap */
101 char *logoName; /* logo name */
103 int logoWidth, logoHeight; /* width, height of logo */
104 Pixel fg, bg; /* foreground, background colors */
106 Pixmap dsPixmap; /* drop shadow pixmap */
107 int dsWidth, dsHeight; /* width, height of drop shadow */
109 Pixmap pixmap; /* scratch pixmap */
110 GC gc; /* scratch GC */
111 XGCValues gcval; /* GC values */
112 unsigned int width, height; /* width, height of bitmap */
113 int x_hot, y_hot; /* bitmap hot spot (if any)*/
117 * get the user's logo preferences...
120 XtGetSubresources(table, &logoInfo, "logo", "Logo",
121 logoResources, XtNumber(logoResources), NULL, 0);
124 * create the logo frame...
128 XtSetArg(argt[i], XmNshadowType, XmSHADOW_OUT); i++;
129 XtSetArg(argt[i], XmNshadowThickness, 2); i++;
130 XtSetArg(argt[i], XmNtopAttachment, XmATTACH_FORM); i++;
131 XtSetArg(argt[i], XmNtopOffset, 15); i++;
132 XtSetArg(argt[i], XmNbottomAttachment, XmATTACH_FORM); i++;
133 XtSetArg(argt[i], XmNbottomOffset, 15); i++;
134 XtSetArg(argt[i], XmNrightAttachment, XmATTACH_FORM); i++;
135 XtSetArg(argt[i], XmNrightOffset, 15); i++;
136 XtSetArg(argt[i], XmNleftAttachment, XmATTACH_WIDGET); i++;
137 XtSetArg(argt[i], XmNleftWidget, matteFrame); i++;
138 logo1 = XmCreateFrame(matte, "logo", argt, i);
139 XtManageChild(logo1);
143 * get the colors of the frame...
146 XtSetArg(argt[0], XmNforeground, &fg);
147 XtSetArg(argt[1], XmNbackground, &bg);
148 XtGetValues(logo1, argt, 2);
152 * create the logo pixmap...
155 logoFile = logoInfo.bitmapFile;
157 #if defined (_AIX) && defined (_POWER)
159 * On AIX4 we have a Dtlogo.s.pm
161 # define LOGO_TYPE (LOWRES ? DtSMALL : NULL)
163 # define LOGO_TYPE NULL
166 logoName = _DtGetIconFileName(DefaultScreenOfDisplay(dpyinfo.dpy),
167 logoFile, NULL, NULL, LOGO_TYPE);
169 if (logoName == NULL)
172 ReadCatalog(MC_LOG_SET,MC_LOG_NO_LOGOBIT,MC_DEF_LOG_NO_LOGOBIT),
179 * create the logo control...
183 XtSetArg(argt[i], XmNmarginWidth, 0); i++;
184 XtSetArg(argt[i], XmNmarginHeight, 0); i++;
185 XtSetArg(argt[i], XmNhighlightThickness, 0); i++;
186 XtSetArg(argt[i], XmNbehavior, XmICON_LABEL); i++;
187 XtSetArg(argt[i], XmNfillMode, XmFILL_TRANSPARENT); i++;
188 XtSetArg(argt[i], XmNstring, NULL); i++;
189 if (logoName != NULL)
191 XtSetArg(argt[i], XmNpixmapForeground, fg); i++;
192 XtSetArg(argt[i], XmNpixmapBackground, bg); i++;
193 XtSetArg(argt[i], XmNimageName, logoName); i++;
198 * use built-in logo if no logo was not found
201 logoPixmap = XCreatePixmapFromBitmapData(
202 dpyinfo.dpy, /* display */
203 dpyinfo.root, /* drawable */
204 (char *)dt_logo_bits, /* data */
205 dt_logo_width, /* width */
206 dt_logo_height, /* height */
209 dpyinfo.depth); /* depth */
211 logoWidth = dt_logo_width;
212 logoHeight = dt_logo_height;
214 XtSetArg(argt[i], XmNpixmap, logoPixmap); i++;
217 logo_pixmap = _DtCreateIcon(logo1, "logo_pixmap", argt, i);
218 XtManageChild(logo_pixmap);
220 XtSetArg(argt[0], XmNheight, 245); /* keeps dialog a consistent height and width */
221 XtSetArg(argt[1], XmNwidth, 245);
222 XtSetValues(logo1, argt, 2);