| extract SMG_DRAW_DIGITAL_LOGO.C remove everything up to the first "/"
$DEFINE LNK$LIBRARY SYS$LIBRARY:VAXCRTL
$CC SMG_DRAW_DIGITAL_LOGO
/*********************************************************************
*
* SMG_DRAW_DIGITAL_LOGO Draw the Standard Digital Logo in a Virtual
* Display
*
* The Draw the Standard Digital Logo in a Virtual Display routine draws
* the logo at the specified character position in a virtual display.
*
* FORMAT SMG_DRAW_DIGITAL_LOGO display, start_row, start_column
*
* RETURNS VMS usage: cond_value
* type: longword (unsigned)
* access: write only
* mechanism: by value
*
* ARGUMENTS display
* VMS usage: identifier
* type: longword (unsigned)
* access: read only
* mechanism: by reference
*
* Identifier of the virtual display. The display-id is the
* address of an unsigned longword containing this identifier.
*
* start_row
* VMS usage: longword_signed
* type: longword (signed)
* access: read only
* mechanism: by value
*
* Row number where the upper-left corner of the logo will
* be positioned. This argument is required.
*
* start_column
* VMS usage: longword_signed
* type: longword (signed)
* access: read only
* mechanism: by value
*
* Column number where the upper-left corner of the logo will
* be positioned. This argument is required.
*
* DESCRIPTION
*
* SMG_DRAW_DIGITAL_LOGO draws the official Digital logo at
* the specified location in the specified virtual display.
* The logo is a box 29 columns wide by 5 rows high with the
* trademark insignia (tm) one space to the right of the upper
* right corner of the box. No other text should appear in
* any row or column adjacent to the logo.
*
* CONDITION Any condition value which might be returned from LIB$GETDVI,
* VALUES SMG$DRAW_RECTANGLE, SMG$DRAW_LINE, or SMG$PUT_CHAR.
* RETURNED
*
*********************************************************************/
#include smgdef
#include smg$routines
#include descrip
#include dvidef
int smg_draw_digital_logo(display,start_row,start_column)
int *display;
int start_row,start_column;
{
int end_row,end_col,status,deccrt,i;
int tt_attr = DVI$_TT_DECCRT;
$DESCRIPTOR(tt_d, "TT:");
status = lib$getdvi (&tt_attr, 0, &tt_d, &deccrt);
if (!(status & 1)) return status;
/* Draw boxes for the digital logo */
end_row = start_row + 4;
end_col = start_column + 28;
status = smg$draw_rectangle(display, &start_row, &start_column,
&end_row, &end_col);
if (!(status & 1)) return status;
if (deccrt == 0)
{
start_row++;end_row--;
}
for (i = start_column + 4; i < end_col; i += 4)
{
status = smg$draw_line(display, &start_row, &i,
&end_row, &i);
if (!(status & 1)) return status;
}
if (deccrt == 0)
{
start_row--;end_row++;
}
status = smg_draw_digital_logo_put_chars("tm", start_row,
start_column+30, *display);
if (!(status & 1)) return status;
status = smg_draw_digital_logo_put_chars("d", start_row+2,
start_column+2, *display);
if (!(status & 1)) return status;
status = smg_draw_digital_logo_put_chars("i", start_row+2,
start_column+6, *display);
if (!(status & 1)) return status;
status = smg_draw_digital_logo_put_chars("g", start_row+2,
start_column+10, *display);
if (!(status & 1)) return status;
status = smg_draw_digital_logo_put_chars("i", start_row+2,
start_column+14, *display);
if (!(status & 1)) return status;
status = smg_draw_digital_logo_put_chars("t", start_row+2,
start_column+18, *display);
if (!(status & 1)) return status;
status = smg_draw_digital_logo_put_chars("a", start_row+2,
start_column+22, *display);
if (!(status & 1)) return status;
status = smg_draw_digital_logo_put_chars("l", start_row+2,
start_column+26, *display);
return status;
}
/*********************************************************************
*
* Support routine to output a string.
*
*********************************************************************/
int smg_draw_digital_logo_put_chars(message,row,col,dsid)
char *message;
int row,col;
int dsid;
{
int status, ch_set;
char outstring[80];
$DESCRIPTOR(outstring_d, outstring);
strcpy(outstring, message);
outstring_d.dsc$w_length = strlen(outstring);
ch_set = SMG$C_ASCII;
status = smg$put_chars(&dsid, &outstring_d, &row, &col, 0, 0, 0, &ch_set);
return status;
}
|
|
extract SAMPLE.C remove everything up to the first "/"
$DEFINE LNK$LIBRARY SYS$LIBRARY:VAXCRTL
$CC SAMPLE.C
$LINK SAMPLE,SMG_DRAW_DIGITAL_LOGO
/*********************************************************************
*
* Demonstration program to display the DIGITAL logo generated by
* the SMG$ routines.
*
*********************************************************************/
#include smgdef
#include smg$routines
main()
{
int maindisplay, pasteboard;
int i,j,k,l,status;
i=20;j=75;k=SMG$M_BORDER;
status = smg$create_virtual_display(&i, &j, &maindisplay, &k);
if (!(status & 1)) lib$stop (status);
status = smg$create_pasteboard(&pasteboard); /* Create pasteboard */
if (!(status & 1)) lib$stop (status);
i = 2;j = 3;
status = smg$paste_virtual_display(&maindisplay, &pasteboard, &i, &j);
if (!(status & 1)) lib$stop (status);
status = smg_draw_digital_logo(&maindisplay,1,1);
if (!(status & 1)) lib$stop (status);
i = 19;j = 1;
status = smg$set_cursor_abs(&maindisplay, &i, &j);
if (!(status & 1)) lib$stop (status);
}
|