1
0

Source code upload

This commit is contained in:
calmsacibis995
2022-09-29 17:59:04 +03:00
parent 72fa9da3d7
commit 8fc8fa8089
33399 changed files with 11964078 additions and 0 deletions

View File

@@ -0,0 +1,129 @@
/**************************************************************************
* *
* Copyright (c) 1991 Silicon Graphics, Inc. *
* All Rights Reserved *
* *
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
* *
* The copyright notice above does not evidence any actual of intended *
* publication of such source code, and is an unpublished work by Silicon *
* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
* the property of Silicon Graphics, Inc. Any use, duplication or *
* disclosure not specifically authorized by Silicon Graphics is strictly *
* prohibited. *
* *
* RESTRICTED RIGHTS LEGEND: *
* *
* Use, duplication or disclosure by the Government is subject to *
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
* Technical Data and Computer Software clause at DFARS 52.227-7013, *
* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
* Supplement. Unpublished - rights reserved under the Copyright Laws of *
* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
* Shoreline Blvd., Mountain View, CA 94039-7311 *
**************************************************************************
*
* File: Formatter.h
*
* Description: Include file for the text document reading functions
*
**************************************************************************/
#ident "$Revision: 1.2 $"
#ifndef _VWR_FORMATTER_H_
#define _VWR_FORMATTER_H_
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
/* Text format tokens */
#define FMT_UNKNOWN 0
#define FMT_GENERIC 1
#define FMT_NROFF_MAN 2
#define FMT_NROFF_MM 3
#define FMT_ZCAT 4
#define FMT_PCAT 5
#define FMT_GZCAT 6
#define FMT_GZCAT_HTML 7
#define NUM_FMT 8
/* Font style tokens */
#define NUM_STYLES 8
#define NUM_NORM_STYLES 4
#define UNKNOWN_STYLE 0xF
#define NORMAL_STYLE 0x0
#define UNDERLINE_STYLE 0x1
#define BOLD_STYLE 0x2
#define BOLDUNDER_STYLE 0x3
#define NORMAL_SELECT 0x4
#define UNDERLINE_SELECT 0x5
#define BOLD_SELECT 0x6
#define BOLDUNDER_SELECT 0x7
#define SELECT_MASK 0x4
/* Text style structure */
typedef struct {
XFontStruct *font; /* Font */
Pixel fore; /* Foreground color */
GC gc; /* Graphics context */
} vwr_text_style_t;
/* Text segment structure */
/* A contiguous piece of text on a line in the same font
*/
typedef struct _vwr_text_seg_t {
ushort seg_nchars; /* # chars in segment */
uint seg_len: 12; /* Pixel length of segment */
uint seg_type: 4; /* Style type index */
struct _vwr_text_seg_t *next; /* Pointer to next segment on list */
} vwr_text_seg_t;
/* Text line structure */
typedef struct {
char *line_chars; /* Line text string */
vwr_text_seg_t *segs; /* List of string segments */
vwr_text_seg_t *last_seg; /* Last segment on list */
ushort line_nchars; /* # chars (not incl. \n) */
uint line_len: 15; /* Total pixel length of line */
uint end_select: 1; /* End of line selected flag */
} vwr_text_line_t;
/* Text structure */
typedef struct {
vwr_text_line_t *lines; /* Lines of text */
int nlines; /* Number of lines of text */
uint max_line_len; /* Pixel length of longest line */
char *char_buf; /* Complete processed text buffer */
} vwr_text_t;
/* Public functions */
#ifdef __cplusplus
extern "C" {
#endif
extern int VwrFormatText(char*, char*, int);
extern void VwrInitText(vwr_text_t*);
extern int VwrReadText(char*, vwr_text_t*, vwr_text_style_t*, int);
extern void VwrFreeText(vwr_text_t*);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,44 @@
#
#**************************************************************************
#* *
#* Copyright (c) 1991 Silicon Graphics, Inc. *
#* All Rights Reserved *
#* *
#* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
#* *
#* The copyright notice above does not evidence any actual of intended *
#* publication of such source code, and is an unpublished work by Silicon *
#* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
#* the property of Silicon Graphics, Inc. Any use, duplication or *
#* disclosure not specifically authorized by Silicon Graphics is strictly *
#* prohibited. *
#* *
#* RESTRICTED RIGHTS LEGEND: *
#* *
#* Use, duplication or disclosure by the Government is subject to *
#* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
#* Technical Data and Computer Software clause at DFARS 52.227-7013, *
#* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
#* Supplement. Unpublished - rights reserved under the Copyright Laws of *
#* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
#* Shoreline Blvd., Mountain View, CA 94039-7311 *
#**************************************************************************
#*
#* Makefile - include, libvwr header files
#*
#* $Revision: 1.1 $
#*
#**************************************************************************
DEPTH = ..
include $(DEPTH)/viewerdefs
TARGETS =
default:
include $(COMMONRULES)
install: default

View File

@@ -0,0 +1,117 @@
/**************************************************************************
* *
* Copyright (c) 1991 Silicon Graphics, Inc. *
* All Rights Reserved *
* *
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
* *
* The copyright notice above does not evidence any actual of intended *
* publication of such source code, and is an unpublished work by Silicon *
* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
* the property of Silicon Graphics, Inc. Any use, duplication or *
* disclosure not specifically authorized by Silicon Graphics is strictly *
* prohibited. *
* *
* RESTRICTED RIGHTS LEGEND: *
* *
* Use, duplication or disclosure by the Government is subject to *
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
* Technical Data and Computer Software clause at DFARS 52.227-7013, *
* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
* Supplement. Unpublished - rights reserved under the Copyright Laws of *
* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
* Shoreline Blvd., Mountain View, CA 94039-7311 *
**************************************************************************
*
* File: TextView.h
*
* Description: Public include file for the multi-font text viewer widget.
*
**************************************************************************/
#ident "$Revision: 1.1 $"
#ifndef _VWR_TEXTVIEW_H_
#define _VWR_TEXTVIEW_H_
/* Resource names */
#define VwrNtextColumns "textColumns"
#define VwrNtextRows "textRows"
#define VwrNblankCompress "blankCompress"
#define VwrNtextFile "textFile"
#define VwrNverticalScrollBar "verticalScrollBar"
#define VwrNhorizontalScrollBar "horizontalScrollBar"
#define VwrNnormFont "normalFont"
#define VwrNunderlineFont "underlineFont"
#define VwrNboldFont "boldFont"
#define VwrNboldUnderFont "boldUnderFont"
#define VwrNnormFore "normalForeground"
#define VwrNunderlineFore "underlineForeground"
#define VwrNboldFore "boldForeground"
#define VwrNboldUnderFore "boldUnderForeground"
#define VwrNselectionFore "selectionForeground"
#define VwrNselectionBack "selectionBackground"
#define VwrNloadCallback "loadCallback"
/* Resource classes */
#define VwrCTextColumns "TextColumns"
#define VwrCTextRows "TextRows"
#define VwrCBlankCompress "BlankCompress"
#define VwrCTextFile "TextFile"
#define VwrCScrollBar "ScrollBar"
#define VwrCLoadCallback "LoadCallback"
/* Class record info */
extern WidgetClass vwrTextViewWidgetClass;
typedef struct _VwrTextViewClassRec *VwrTextViewWidgetClass;
typedef struct _VwrTextViewRec *VwrTextViewWidget;
/* Text position structure */
typedef struct {
int line; /* Line number (starts at 0) */
int col; /* Column number (starts at 0) */
} VwrPositionStruct;
/* File load callback structure */
/* Note that storage for the fields is reused and members
of long term interest should be copied to the user space
*/
typedef struct {
char *filename; /* Name of file that was loaded */
} VwrTextViewLoadCallbackStruct;
/* Public functions */
#ifdef __cplusplus
extern "C" {
#endif
extern Widget VwrCreateScrolledTextView(Widget, char*, Boolean, Boolean);
extern void VwrTextViewClearSelection(Widget);
extern void VwrTextViewSetSelection(Widget, VwrPositionStruct*,
VwrPositionStruct*, Boolean);
extern char* VwrTextViewReadSelection(Widget, unsigned long*);
extern int VwrTextViewSearch(Widget, char*, Boolean, VwrPositionStruct*,
VwrPositionStruct*);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,131 @@
/**************************************************************************
* *
* Copyright (c) 1991 Silicon Graphics, Inc. *
* All Rights Reserved *
* *
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
* *
* The copyright notice above does not evidence any actual of intended *
* publication of such source code, and is an unpublished work by Silicon *
* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
* the property of Silicon Graphics, Inc. Any use, duplication or *
* disclosure not specifically authorized by Silicon Graphics is strictly *
* prohibited. *
* *
* RESTRICTED RIGHTS LEGEND: *
* *
* Use, duplication or disclosure by the Government is subject to *
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
* Technical Data and Computer Software clause at DFARS 52.227-7013, *
* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
* Supplement. Unpublished - rights reserved under the Copyright Laws of *
* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
* Shoreline Blvd., Mountain View, CA 94039-7311 *
**************************************************************************
*
* File: TextViewP.h
*
* Description: Private include file for the multi-font text viewer widget.
*
**************************************************************************/
#ident "$Revision: 1.1 $"
#ifndef _VWR_TEXTVIEWP_H_
#define _VWR_TEXTVIEWP_H_
#include <Xm/XmP.h>
#include <Xm/PrimitiveP.h>
#include "TextView.h"
/* No resource specified defaults */
#define DEF_COLOR 0xFFFFFFFF
#define DEF_TEXT_COLS 80
#define DEF_TEXT_ROWS 24
#define DEF_NORM_FONT "Fixed"
#define DEF_UNDERLINE_FONT "Fixed"
#define DEF_BOLD_FONT "Fixed"
#define DEF_BOLDUNDER_FONT "Fixed"
#define DEF_NORM_FORE DEF_COLOR
#define DEF_UNDERLINE_FORE DEF_COLOR
#define DEF_BOLD_FORE DEF_COLOR
#define DEF_BOLDUNDER_FORE DEF_COLOR
#define DEF_SELECT_FORE DEF_COLOR
#define DEF_SELECT_BACK DEF_COLOR
#define DEF_BLANK_COMPRESS 0
/* Misc macros */
#define TV_FWIDTH(f) (((f)->per_char) ? (\
((f)->per_char['n'].width > 0) ? \
(f)->per_char['n'].width: \
(f)->max_bounds.width \
): (f)->max_bounds.width)
#define TV_MAX(a,b) (((a) > (b)) ? (a) : (b))
/* Class part and record structures */
typedef struct {
int dummy; /* To keep compiler happy */
} VwrTextViewClassPart;
typedef struct _VwrTextViewClassRec {
CoreClassPart core_class;
XmPrimitiveClassPart primitive_class;
VwrTextViewClassPart vwrTextView_class;
} VwrTextViewClassRec;
/* Instance part and record structures */
typedef struct {
/* Resources */
int text_columns; /* Number of columns for text view */
int text_rows; /* Number of rows for text view */
vwr_text_style_t styles[NUM_STYLES];/* Text styles (font, fore, etc.) */
Pixel select_fore; /* Selection foreground color */
Pixel select_back; /* Selection background color */
int blank_compress; /* Num lines for blank compression */
char *filename; /* Text file to view */
Widget vsb; /* Viewer's vert. scrollbar, if any */
Widget hsb; /* Viewer's horiz. scrollbar, if any */
XtCallbackList load_callback; /* Viewer load callback functions */
/* Private state */
vwr_text_t text; /* Viewer text */
GC fill_gc; /* GC for line filling */
GC select_fill_gc; /* GC for selected line filling */
GC blanks[NUM_NORM_STYLES]; /* Line clearing GCs */
int def_height, def_width; /* Default height and width */
int fontheight; /* Max font height, descent + ascent */
int fontwidth; /* Max font width */
int fontascent; /* Max font ascent */
int top; /* Line at top of window */
int left; /* Column at left of window */
VwrPositionStruct sel_mark; /* Select mark */
VwrPositionStruct sel_point; /* Select point */
XtIntervalId timer; /* Scrolling timer */
int top_pending; /* Scroll drag value */
char *sel_data; /* Selection data buffer */
char *search_next; /* Start addr for next text search */
char *comp_exp; /* Compiled search regular expr */
} VwrTextViewPart;
typedef struct _VwrTextViewRec {
CorePart core;
XmPrimitivePart primitive;
VwrTextViewPart textView;
} VwrTextViewRec;
#endif