cd Xbae-4.6.2 patch -p1 < this_file diff -r -c Xbae-4.6.2/src/Create.c ja/Xbae-4.6.2/src/Create.c *** Xbae-4.6.2/src/Create.c Sun Jul 6 20:42:49 1997 --- ja/Xbae-4.6.2/src/Create.c Sun May 30 12:36:51 1999 *************** *** 869,875 **** * since the foreground may change frequently. */ values.foreground = mw->manager.foreground; ! values.font = mw->matrix.font->fid; values.stipple = createInsensitivePixmap(mw); mw->matrix.draw_gc = XCreateGC(XtDisplay(mw), --- 869,880 ---- * since the foreground may change frequently. */ values.foreground = mw->manager.foreground; ! if( mw->matrix.font_type == XmFONT_IS_FONT ) { ! values.font = mw->matrix.font->fid; ! } else { ! mask = GCForeground | GCStipple; ! /* values.font = NULL; */ ! } values.stipple = createInsensitivePixmap(mw); mw->matrix.draw_gc = XCreateGC(XtDisplay(mw), *************** *** 904,910 **** * GC for drawing labels */ values.foreground = mw->manager.foreground; ! values.font = mw->matrix.label_font->fid; values.stipple = createInsensitivePixmap(mw); mw->matrix.label_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), --- 909,920 ---- * GC for drawing labels */ values.foreground = mw->manager.foreground; ! if( mw->matrix.label_font_type == XmFONT_IS_FONT ) { ! values.font = mw->matrix.label_font->fid; ! } else { ! mask = GCForeground | GCStipple; ! /* values.font = NULL; */ ! } values.stipple = createInsensitivePixmap(mw); mw->matrix.label_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), *************** *** 922,928 **** * GC for drawing labels with clipping. */ values.foreground = mw->manager.foreground; ! values.font = mw->matrix.label_font->fid; values.stipple = createInsensitivePixmap(mw); mw->matrix.label_clip_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), --- 932,943 ---- * GC for drawing labels with clipping. */ values.foreground = mw->manager.foreground; ! if( mw->matrix.label_font_type == XmFONT_IS_FONT ) { ! values.font = mw->matrix.label_font->fid; ! } else { ! mask = GCForeground | GCStipple; ! /* values.font = NULL; */ ! } values.stipple = createInsensitivePixmap(mw); mw->matrix.label_clip_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), *************** *** 990,997 **** XbaeMatrixWidget mw; { XmFontContext context; ! XmStringCharSet charset; ! XFontStruct *font; /* * Make a private copy of the FontList --- 1005,1014 ---- XbaeMatrixWidget mw; { XmFontContext context; ! /* XmStringCharSet charset; */ ! XtPointer *font; ! XmFontListEntry entry; ! XmFontType type_return; /* * Make a private copy of the FontList *************** *** 999,1005 **** mw->matrix.font_list = XmFontListCopy(mw->matrix.font_list); /* ! * Get XFontStruct from FontList */ if (!XmFontListInitFontContext(&context, mw->matrix.font_list)) XtAppErrorMsg( --- 1016,1022 ---- mw->matrix.font_list = XmFontListCopy(mw->matrix.font_list); /* ! * Get XFontSetExtent from FontList */ if (!XmFontListInitFontContext(&context, mw->matrix.font_list)) XtAppErrorMsg( *************** *** 1008,1024 **** "XbaeMatrix: XmFontListInitFontContext failed, bad fontList", NULL, 0); ! if (!XmFontListGetNextFont(context, &charset, &font)) XtAppErrorMsg( XtWidgetToApplicationContext((Widget) mw), "newFont", "badFont", "XbaeMatrix", "XbaeMatrix: XmFontListGetNextFont failed, no next fontList", NULL, 0); ! XtFree(charset); XmFontListFreeFontContext(context); ! mw->matrix.font = font; } void --- 1025,1053 ---- "XbaeMatrix: XmFontListInitFontContext failed, bad fontList", NULL, 0); ! if ( (entry = XmFontListNextEntry(context)) ) { ! font = XmFontListEntryGetFont(entry,&type_return); ! } else { XtAppErrorMsg( XtWidgetToApplicationContext((Widget) mw), "newFont", "badFont", "XbaeMatrix", "XbaeMatrix: XmFontListGetNextFont failed, no next fontList", NULL, 0); + } ! /* XtFree(charset); */ XmFontListFreeFontContext(context); ! mw->matrix.font_type = type_return; ! if(type_return == XmFONT_IS_FONT) { ! mw->matrix.font = (XFontStruct*)font; ! mw->matrix.fontset = NULL; ! mw->matrix.fontext = NULL; ! } else { ! mw->matrix.font = NULL; ! mw->matrix.fontset = (XFontSet)font; ! mw->matrix.fontext = XExtentsOfFontSet((XFontSet)font); ! } } void *************** *** 1026,1033 **** XbaeMatrixWidget mw; { XmFontContext context; ! XmStringCharSet charset; ! XFontStruct *font; /* * Make a private copy of the FontList --- 1055,1064 ---- XbaeMatrixWidget mw; { XmFontContext context; ! /* XmStringCharSet charset; */ ! XPointer *font; ! XmFontListEntry entry; ! XmFontType type_return; /* * Make a private copy of the FontList *************** *** 1044,1060 **** "XbaeMatrix: XmFontListInitFontContext failed, bad labelFontList", NULL, 0); ! if (!XmFontListGetNextFont(context, &charset, &font)) XtAppErrorMsg( XtWidgetToApplicationContext((Widget) mw), "newFont", "badLabelFont", "XbaeMatrix", "XbaeMatrix: XmFontListGetNextFont failed, no next labelFontList", NULL, 0); ! XtFree(charset); XmFontListFreeFontContext(context); ! mw->matrix.label_font = font; } void --- 1075,1103 ---- "XbaeMatrix: XmFontListInitFontContext failed, bad labelFontList", NULL, 0); ! if ( (entry = XmFontListNextEntry(context)) ) { ! font = XmFontListEntryGetFont(entry,&type_return); ! } else { XtAppErrorMsg( XtWidgetToApplicationContext((Widget) mw), "newFont", "badLabelFont", "XbaeMatrix", "XbaeMatrix: XmFontListGetNextFont failed, no next labelFontList", NULL, 0); + } ! /* XtFree(charset); */ XmFontListFreeFontContext(context); ! mw->matrix.label_font_type = type_return; ! if(type_return == XmFONT_IS_FONT) { ! mw->matrix.label_font = (XFontStruct*)font; ! mw->matrix.label_fontset = NULL; ! mw->matrix.label_fontext = NULL; ! } else { ! mw->matrix.label_font = NULL; ! mw->matrix.label_fontset = (XFontSet)font; ! mw->matrix.label_fontext = XExtentsOfFontSet((XFontSet)font); ! } } void diff -r -c Xbae-4.6.2/src/Draw.c ja/Xbae-4.6.2/src/Draw.c *** Xbae-4.6.2/src/Draw.c Sun Jul 6 20:44:04 1997 --- ja/Xbae-4.6.2/src/Draw.c Sun May 30 12:36:52 1999 *************** *** 23,28 **** --- 23,29 ---- * $Id: Draw.c,v 1.10 1997/07/06 11:44:04 lister Exp $ */ + #include #include #include #if XmVersion > 1001 *************** *** 235,240 **** --- 236,242 ---- { int x, y; GC gc; + XFontSet fontset; Widget w; Window win = xbaeGetCellWindow(mw, &w, row, column); Dimension column_width = COLUMN_WIDTH(mw, column); *************** *** 267,272 **** --- 269,275 ---- return; #endif gc = mw->matrix.draw_gc; + fontset = mw->matrix.fontset; XSetForeground(XtDisplay(mw), gc, bg); /* *************** *** 326,332 **** * Draw the string in the cell. */ ! xbaeDrawString(mw, win, gc, str, strlen(str), x + TEXT_X_OFFSET(mw), y + TEXT_Y_OFFSET(mw), mw->matrix.column_widths[column], mw->matrix.column_alignments ? --- 329,335 ---- * Draw the string in the cell. */ ! xbaeDrawString(mw, win, fontset, gc, str, strlen(str), x + TEXT_X_OFFSET(mw), y + TEXT_Y_OFFSET(mw), mw->matrix.column_widths[column], mw->matrix.column_alignments ? *************** *** 407,421 **** */ void #if NeedFunctionPrototypes ! xbaeDrawString(XbaeMatrixWidget mw, Window win, GC gc, String string, int length, int x, int y, int maxlen, unsigned char alignment, Boolean highlight, Boolean bold, Boolean rowLabel, Boolean colLabel, Pixel color) #else ! xbaeDrawString(mw, win, gc, string, length, x, y, maxlen, alignment, highlight, bold, rowLabel, colLabel, color) XbaeMatrixWidget mw; Window win; GC gc; String string; int length; --- 410,426 ---- */ void #if NeedFunctionPrototypes ! xbaeDrawString(XbaeMatrixWidget mw, Window win, XFontSet fontset, GC gc, ! String string, int length, int x, int y, int maxlen, unsigned char alignment, Boolean highlight, Boolean bold, Boolean rowLabel, Boolean colLabel, Pixel color) #else ! xbaeDrawString(mw, win, fontset, gc, string, length, x, y, maxlen, alignment, highlight, bold, rowLabel, colLabel, color) XbaeMatrixWidget mw; Window win; + XFontSet fontset; GC gc; String string; int length; *************** *** 432,444 **** { int start, width, maxwidth; XFontStruct *font; Boolean choppedStart = False; Boolean choppedEnd = False; ! if (rowLabel || colLabel) ! font = mw->matrix.label_font; ! else ! font = mw->matrix.font; /* * Initialize starting character in string */ --- 437,459 ---- { int start, width, maxwidth; XFontStruct *font; + XFontSetExtents *fontext; Boolean choppedStart = False; Boolean choppedEnd = False; ! if (rowLabel || colLabel) { ! if( mw->matrix.label_font_type == XmFONT_IS_FONT ) { ! font = mw->matrix.label_font; ! } else { ! fontext = mw->matrix.label_fontext; ! } ! } else { ! if( mw->matrix.font_type == XmFONT_IS_FONT ) { ! font = mw->matrix.font; ! } else { ! fontext = mw->matrix.fontext; ! } ! } /* * Initialize starting character in string */ *************** *** 449,455 **** else maxwidth = maxlen * LABEL_WIDTH(mw); ! width = XTextWidth(font, string, length); /* * If the width of the string is greater than the width of this cell, --- 464,474 ---- else maxwidth = maxlen * LABEL_WIDTH(mw); ! if(fontset == NULL) { ! width = XTextWidth(font, string, length); ! } else { ! width = XmbTextEscapement(fontset, string, length); ! } /* * If the width of the string is greater than the width of this cell, *************** *** 463,542 **** case XmALIGNMENT_CENTER: { ! int startx = x; ! int endx = x + maxwidth - 1; ! int newendx; ! ! /* ! * Figure out our x for the centered string. Then loop and chop ! * characters off the front until we are within the cell. ! * Adjust x, the starting character and the length of the string ! * for each char. ! */ ! x += maxwidth / 2 - width / 2; ! while (x < startx) ! { ! int cw = charWidth(font, string[start]); ! ! x += cw; ! width -= cw; ! length--; ! start++; ! choppedStart = True; ! } ! ! /* ! * Now figure out the end x of the string. Then loop and chop ! * characters off the end until we are within the cell. ! */ ! newendx = x + width - 1; ! while (newendx > endx && *(string + start)) ! { ! int cw = charWidth(font, string[start]); ! ! newendx -= cw; ! width -= cw; ! length--; ! choppedEnd = True; ! } ! break; } case XmALIGNMENT_END: { ! /* ! * Figure out our x for the right justified string. ! * Then loop and chop characters off the front until we fit. ! * Adjust x for each char lopped off. Also adjust the starting ! * character and length of the string for each char. ! */ ! x += maxwidth - width; ! while (width > maxwidth) ! { ! int cw = charWidth(font, string[start]); ! ! width -= cw; ! x += cw; ! length--; ! start++; ! choppedStart = True; ! } break; } case XmALIGNMENT_BEGINNING: default: ! /* ! * Leave x alone, but chop characters off the end until we fit ! */ ! while (width > maxwidth) ! { ! width -= charWidth(font, string[length - 1]); ! length--; ! choppedEnd = True; ! } break; } } --- 482,598 ---- case XmALIGNMENT_CENTER: { ! if(fontset == NULL) { ! int startx = x; ! int endx = x + maxwidth - 1; ! int newendx; ! ! /* ! * Figure out our x for the centered string. Then loop and chop ! * characters off the front until we are within the cell. ! * Adjust x, the starting character and the length of the string ! * for each char. ! */ ! x += maxwidth / 2 - width / 2; ! while (x < startx) ! { ! int cw = charWidth(font, string[start]); ! ! x += cw; ! width -= cw; ! length--; ! start++; ! choppedStart = True; ! } ! ! /* ! * Now figure out the end x of the string. Then loop and chop ! * characters off the end until we are within the cell. ! */ ! newendx = x + width - 1; ! while (newendx > endx && *(string + start)) ! { ! int cw = charWidth(font, string[start]); ! ! newendx -= cw; ! width -= cw; ! length--; ! choppedEnd = True; ! } ! } else { ! /* At multi-byte environment, Sum of character's width not ! * equal to string's width ! * x,width,length,start ! */ ! int newwidth = width / 2 + maxwidth / 2 ; ! int bytes; ! while( length > 0 && (width = XmbTextEscapement(fontset, &string[start], length)) > newwidth ) { ! bytes = mblen(string,length); ! start += bytes; ! length -= bytes; ! choppedStart = True; ! } ! while( length > 0 && (width = XmbTextEscapement(fontset, &string[start], length)) > maxwidth ) { ! length--; ! choppedEnd = True; ! } ! x += maxwidth / 2 - width / 2; ! } break; } case XmALIGNMENT_END: { ! if(fontset == NULL) { ! /* ! * Figure out our x for the right justified string. ! * Then loop and chop characters off the front until we fit. ! * Adjust x for each char lopped off. Also adjust the starting ! * character and length of the string for each char. ! */ ! x += maxwidth - width; ! while (width > maxwidth) ! { ! int cw = charWidth(font, string[start]); ! ! width -= cw; ! x += cw; ! length--; ! start++; ! choppedStart = True; ! } ! } else { ! int bytes; ! while( length > 0 && (width = XmbTextEscapement(fontset, &string[start], length)) > maxwidth ) { ! bytes = mblen(string,length); ! start += bytes; ! length -= bytes; ! choppedStart = True; ! } ! x += maxwidth - width; ! } break; } case XmALIGNMENT_BEGINNING: default: ! if(fontset == NULL) { ! /* ! * Leave x alone, but chop characters off the end until we fit ! */ ! while (width > maxwidth) ! { ! width -= charWidth(font, string[length - 1]); ! length--; ! choppedEnd = True; ! } ! } else { ! while( length > 0 && (width = XmbTextEscapement(fontset, &string[start], length)) > maxwidth ) { ! length--; ! choppedEnd = True; ! } ! } break; } } *************** *** 575,587 **** if (mw->matrix.show_arrows && choppedEnd) { XPoint points[ 3 ]; ! points[ 0 ].x = points[ 1 ].x = x + width - FONT_WIDTH(mw); ! points[ 0 ].y = y + mw->matrix.font->max_bounds.descent; ! points[ 1 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw); ! points[ 2 ].x = x + width; ! points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw) / 2; XFillPolygon(XtDisplay(mw), win, gc, points, 3, Convex, CoordModeOrigin); --- 631,657 ---- if (mw->matrix.show_arrows && choppedEnd) { XPoint points[ 3 ]; ! ! if( mw->matrix.font_type == XmFONT_IS_FONT ) { ! points[ 0 ].x = points[ 1 ].x = x + width - FONT_WIDTH(mw); ! points[ 0 ].y = y + mw->matrix.font->max_bounds.descent; ! points[ 1 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw); ! points[ 2 ].x = x + width; ! points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw) / 2; ! } else { ! points[ 0 ].x = points[ 1 ].x = x + width - FONT_WIDTH(mw); ! points[ 0 ].y = y + mw->matrix.fontext->max_logical_extent.y + ! mw->matrix.fontext->max_logical_extent.height; ! points[ 1 ].y = y + mw->matrix.fontext->max_logical_extent.y + ! mw->matrix.fontext->max_logical_extent.height - ! TEXT_HEIGHT(mw); ! points[ 2 ].x = x + width; ! points[ 2 ].y = y + mw->matrix.fontext->max_logical_extent.y + ! mw->matrix.fontext->max_logical_extent.height - ! TEXT_HEIGHT(mw) / 2; ! } XFillPolygon(XtDisplay(mw), win, gc, points, 3, Convex, CoordModeOrigin); *************** *** 592,604 **** if (mw->matrix.show_arrows && choppedStart) { XPoint points[ 3 ]; ! points[ 0 ].x = points[ 1 ].x = x + FONT_WIDTH(mw); ! points[ 0 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw); ! points[ 1 ].y = y + mw->matrix.font->max_bounds.descent; ! points[ 2 ].x = x; ! points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw) / 2; XFillPolygon(XtDisplay(mw), win, gc, points, 3, Convex, CoordModeOrigin); --- 662,687 ---- if (mw->matrix.show_arrows && choppedStart) { XPoint points[ 3 ]; ! if( mw->matrix.font_type == XmFONT_IS_FONT ) { ! points[ 0 ].x = points[ 1 ].x = x + FONT_WIDTH(mw); ! points[ 0 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw); ! points[ 1 ].y = y + mw->matrix.font->max_bounds.descent; ! points[ 2 ].x = x; ! points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw) / 2; ! } else { ! points[ 0 ].x = points[ 1 ].x = x + FONT_WIDTH(mw); ! points[ 0 ].y = y + mw->matrix.fontext->max_logical_extent.y + ! mw->matrix.fontext->max_logical_extent.height - ! TEXT_HEIGHT(mw); ! points[ 1 ].y = y + mw->matrix.fontext->max_logical_extent.y + ! mw->matrix.fontext->max_logical_extent.height; ! points[ 2 ].x = x; ! points[ 2 ].y = y + mw->matrix.fontext->max_logical_extent.y + ! mw->matrix.fontext->max_logical_extent.height - ! TEXT_HEIGHT(mw) / 2; ! } XFillPolygon(XtDisplay(mw), win, gc, points, 3, Convex, CoordModeOrigin); *************** *** 617,623 **** --- 700,710 ---- XDrawString16(XtDisplay(mw), win, gc, x, y, &string[start], length); else #endif + if (fontset == NULL) { XDrawString(XtDisplay(mw), win, gc, x, y, &string[start], length); + } else { + XmbDrawString(XtDisplay(mw), win, fontset, gc, x, y, &string[start], length); + } /* * If bold is on, draw the string again offset by 1 pixel (overstrike) *************** *** 836,841 **** --- 923,929 ---- int labelX, labelY; int buttonX; int i; + XFontSet fontset; GC gc; Window win = XtWindow(mw); Boolean clipped = (column >= (int)mw->matrix.fixed_columns && *************** *** 880,898 **** /* * Set our y to the baseline of the first line in this column */ ! labelY = mw->matrix.label_font->max_bounds.ascent + ! mw->matrix.cell_shadow_thickness + ! mw->matrix.cell_highlight_thickness + ! mw->matrix.cell_margin_height + ! mw->matrix.text_shadow_thickness + ! (mw->matrix.column_label_maxlines - ! mw->matrix.column_label_lines[column].lines) * LABEL_HEIGHT(mw) + ! HORIZ_SB_OFFSET(mw); ! if (clipped) gc = mw->matrix.label_clip_gc; ! else gc = mw->matrix.label_gc; if (button) { --- 968,1000 ---- /* * Set our y to the baseline of the first line in this column */ ! if( mw->matrix.label_font_type == XmFONT_IS_FONT ) { ! labelY = mw->matrix.label_font->max_bounds.ascent + ! mw->matrix.cell_shadow_thickness + ! mw->matrix.cell_highlight_thickness + ! mw->matrix.cell_margin_height + ! mw->matrix.text_shadow_thickness + ! (mw->matrix.column_label_maxlines - ! mw->matrix.column_label_lines[column].lines) * LABEL_HEIGHT(mw) + ! HORIZ_SB_OFFSET(mw); ! } else { ! labelY = (-mw->matrix.label_fontext->max_logical_extent.y) + ! mw->matrix.cell_shadow_thickness + ! mw->matrix.cell_highlight_thickness + ! mw->matrix.cell_margin_height + ! mw->matrix.text_shadow_thickness + ! (mw->matrix.column_label_maxlines - ! mw->matrix.column_label_lines[column].lines) * LABEL_HEIGHT(mw) + ! HORIZ_SB_OFFSET(mw); ! } ! if (clipped) { ! fontset = mw->matrix.label_fontset; gc = mw->matrix.label_clip_gc; ! } else { ! fontset = mw->matrix.label_fontset; gc = mw->matrix.label_gc; + } if (button) { *************** *** 909,915 **** if (label[ 0 ] != '\0') for (i = 0; i < mw->matrix.column_label_lines[column].lines; i++) { ! xbaeDrawString(mw, XtWindow(mw), gc, label, mw->matrix.column_label_lines[column].lengths[i], labelX, labelY, mw->matrix.column_widths[column], mw->matrix.column_label_alignments ? --- 1011,1017 ---- if (label[ 0 ] != '\0') for (i = 0; i < mw->matrix.column_label_lines[column].lines; i++) { ! xbaeDrawString(mw, XtWindow(mw), fontset, gc, label, mw->matrix.column_label_lines[column].lengths[i], labelX, labelY, mw->matrix.column_widths[column], mw->matrix.column_label_alignments ? *************** *** 943,948 **** --- 1045,1051 ---- #endif { int y; + XFontSet fontset; GC gc; Window win = XtWindow(mw); Boolean clipped = (row >= (int)mw->matrix.fixed_rows && *************** *** 968,977 **** y = ROW_LABEL_OFFSET(mw) + ROW_HEIGHT(mw) * (row - VERT_ORIGIN(mw)) + LABEL_Y_OFFSET(mw); ! if (clipped) gc = mw->matrix.label_clip_gc; ! else gc = mw->matrix.label_gc; if (button) { --- 1071,1083 ---- y = ROW_LABEL_OFFSET(mw) + ROW_HEIGHT(mw) * (row - VERT_ORIGIN(mw)) + LABEL_Y_OFFSET(mw); ! if (clipped) { ! fontset = mw->matrix.label_fontset; gc = mw->matrix.label_clip_gc; ! } else { ! fontset = mw->matrix.label_fontset; gc = mw->matrix.label_gc; + } if (button) { *************** *** 985,991 **** XSetBackground(XtDisplay(mw), gc, mw->matrix.button_label_background); if (mw->matrix.row_labels[row][0] != '\0') ! xbaeDrawString(mw, win, gc, mw->matrix.row_labels[row], strlen(mw->matrix.row_labels[row]), TEXT_X_OFFSET(mw) + VERT_SB_OFFSET(mw), y, --- 1091,1097 ---- XSetBackground(XtDisplay(mw), gc, mw->matrix.button_label_background); if (mw->matrix.row_labels[row][0] != '\0') ! xbaeDrawString(mw, win, fontset, gc, mw->matrix.row_labels[row], strlen(mw->matrix.row_labels[row]), TEXT_X_OFFSET(mw) + VERT_SB_OFFSET(mw), y, diff -r -c Xbae-4.6.2/src/Draw.h ja/Xbae-4.6.2/src/Draw.h *** Xbae-4.6.2/src/Draw.h Sat Feb 8 12:08:22 1997 --- ja/Xbae-4.6.2/src/Draw.h Sun May 30 12:36:52 1999 *************** *** 38,44 **** XbaeCellType xbaeGetDrawCellValue P(( XbaeMatrixWidget, int, int, String *, Pixmap *, Pixmap *, int *, int *, Pixel *, Pixel *, int * )); ! void xbaeDrawString P(( XbaeMatrixWidget mw, Window win, GC gc, String string, int length, int x, int y, int maxlen, unsigned char alignment, Boolean highlight, Boolean bold, Boolean rowLabel, --- 38,45 ---- XbaeCellType xbaeGetDrawCellValue P(( XbaeMatrixWidget, int, int, String *, Pixmap *, Pixmap *, int *, int *, Pixel *, Pixel *, int * )); ! void xbaeDrawString P(( XbaeMatrixWidget mw, Window win, XFontSet fontset, ! GC gc, String string, int length, int x, int y, int maxlen, unsigned char alignment, Boolean highlight, Boolean bold, Boolean rowLabel, diff -r -c Xbae-4.6.2/src/Macros.h ja/Xbae-4.6.2/src/Macros.h *** Xbae-4.6.2/src/Macros.h Thu Jul 10 17:08:05 1997 --- ja/Xbae-4.6.2/src/Macros.h Sun May 30 12:36:53 1999 *************** *** 107,117 **** #define Min(x, y) (((x) < (y)) ? (x) : (y)) #endif ! #define FONT_WIDTH(mw) ((mw->matrix.font->max_bounds.width + \ ! mw->matrix.font->min_bounds.width) /2 ) ! ! #define LABEL_WIDTH(mw) ((mw->matrix.label_font->max_bounds.width + \ ! mw->matrix.label_font->min_bounds.width) / 2 ) #define TEXT_WIDTH_OFFSET(mw) (mw->matrix.cell_margin_width +\ mw->matrix.cell_shadow_thickness + \ --- 107,121 ---- #define Min(x, y) (((x) < (y)) ? (x) : (y)) #endif ! #define FONT_WIDTH(mw) ((mw->matrix.font_type == XmFONT_IS_FONT)?\ ! ((mw->matrix.font->max_bounds.width + \ ! mw->matrix.font->min_bounds.width) /2 )\ ! :(mw->matrix.fontext->max_logical_extent.width/2)) ! ! #define LABEL_WIDTH(mw) ((mw->matrix.label_font_type == XmFONT_IS_FONT)?\ ! ((mw->matrix.label_font->max_bounds.width + \ ! mw->matrix.label_font->min_bounds.width) / 2 )\ ! :(mw->matrix.label_fontext->max_logical_extent.width/2)) #define TEXT_WIDTH_OFFSET(mw) (mw->matrix.cell_margin_width +\ mw->matrix.cell_shadow_thickness + \ *************** *** 127,137 **** FONT_WIDTH(mw)) + \ ((int)TEXT_WIDTH_OFFSET(mw) * 2)) ! #define FONT_HEIGHT(mw) (mw->matrix.font->max_bounds.descent + \ ! mw->matrix.font->max_bounds.ascent) ! ! #define LABEL_HEIGHT(mw) (mw->matrix.label_font->max_bounds.descent + \ ! mw->matrix.label_font->max_bounds.ascent) #define HORIZ_SB_WIDTH(mw) (HorizScrollChild(mw)->core.width + \ 2 * HorizScrollChild(mw)->core.border_width) --- 131,145 ---- FONT_WIDTH(mw)) + \ ((int)TEXT_WIDTH_OFFSET(mw) * 2)) ! #define FONT_HEIGHT(mw) ((mw->matrix.font_type == XmFONT_IS_FONT)?\ ! (mw->matrix.font->max_bounds.descent + \ ! mw->matrix.font->max_bounds.ascent)\ ! :(mw->matrix.fontext->max_logical_extent.height)) ! ! #define LABEL_HEIGHT(mw) ((mw->matrix.label_font_type == XmFONT_IS_FONT)?\ ! (mw->matrix.label_font->max_bounds.descent + \ ! mw->matrix.label_font->max_bounds.ascent)\ ! :(mw->matrix.label_fontext->max_logical_extent.height)) #define HORIZ_SB_WIDTH(mw) (HorizScrollChild(mw)->core.width + \ 2 * HorizScrollChild(mw)->core.border_width) diff -r -c Xbae-4.6.2/src/Matrix.c ja/Xbae-4.6.2/src/Matrix.c *** Xbae-4.6.2/src/Matrix.c Sun May 11 13:29:08 1997 --- ja/Xbae-4.6.2/src/Matrix.c Sun May 30 15:34:52 1999 *************** *** 215,221 **** offset(matrix.fixed_rows), XmRImmediate, (XtPointer) 0}, {XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), ! offset(matrix.font_list), XmRString, (XtPointer) "fixed"}, {XmNgridLineColor, XmCColor, XmRPixel, sizeof(Pixel), offset(matrix.grid_line_color), XmRCallProc, --- 215,221 ---- offset(matrix.fixed_rows), XmRImmediate, (XtPointer) 0}, {XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), ! offset(matrix.font_list), XmRString, (XtPointer) "-*-fixed-medium-r-normal--14-*-c-*:"}, {XmNgridLineColor, XmCColor, XmRPixel, sizeof(Pixel), offset(matrix.grid_line_color), XmRCallProc, *************** *** 1040,1046 **** 2 ) - FONT_HEIGHT(new) ) / 2; else marginHeight = new->matrix.cell_margin_height; ! /* * Create text field (unmanaged for now) - its window will be reparented * in Realize to be a subwindow of Clip --- 1040,1046 ---- 2 ) - FONT_HEIGHT(new) ) / 2; else marginHeight = new->matrix.cell_margin_height; ! /* * Create text field (unmanaged for now) - its window will be reparented * in Realize to be a subwindow of Clip *************** *** 1097,1105 **** marginHeight = new->matrix.cell_margin_height + new->matrix.text_shadow_thickness; ! new->matrix.label_baseline = marginHeight + LABEL_HEIGHT(new) + ! new->matrix.cell_shadow_thickness - ! new->matrix.label_font->max_bounds.descent; } /* * Calculate total pixel width of cell area --- 1097,1112 ---- marginHeight = new->matrix.cell_margin_height + new->matrix.text_shadow_thickness; ! if(new->matrix.label_font_type == XmFONT_IS_FONT) { ! new->matrix.label_baseline = marginHeight + LABEL_HEIGHT(new) + ! new->matrix.cell_shadow_thickness - ! new->matrix.label_font->max_bounds.descent; ! } else { ! new->matrix.label_baseline = marginHeight + LABEL_HEIGHT(new) + ! new->matrix.cell_shadow_thickness - ! ( new->matrix.label_fontext->max_logical_extent.height ! + new->matrix.label_fontext->max_logical_extent.y ); ! } } /* * Calculate total pixel width of cell area *************** *** 2141,2147 **** * If anything changed to affect cell total width or column positions, * recalc them */ ! if (new_cells || NE(matrix.font->fid) || NE(matrix.label_font->fid) || NE(matrix.cell_margin_width) || NE(matrix.cell_margin_height) || NE(matrix.cell_shadow_thickness) || NE(matrix.fixed_columns) || NE(matrix.trailing_fixed_columns) || --- 2148,2154 ---- * If anything changed to affect cell total width or column positions, * recalc them */ ! if (new_cells || NE(matrix.fontset) || NE(matrix.label_fontset) || NE(matrix.cell_margin_width) || NE(matrix.cell_margin_height) || NE(matrix.cell_shadow_thickness) || NE(matrix.fixed_columns) || NE(matrix.trailing_fixed_columns) || *************** *** 2197,2203 **** * If anything but (trailing_)fixed_columns or the highlight color * changed, we need to recalc column positions. */ ! if (new_cells || NE(matrix.font->fid) || NE(matrix.label_font->fid) || NE(matrix.cell_margin_width) || NE(matrix.cell_margin_height) || NE(matrix.cell_shadow_thickness) || NE(matrix.cell_highlight_thickness) || new_column_widths || --- 2204,2210 ---- * If anything but (trailing_)fixed_columns or the highlight color * changed, we need to recalc column positions. */ ! if (new_cells || NE(matrix.fontset) || NE(matrix.label_fontset) || NE(matrix.cell_margin_width) || NE(matrix.cell_margin_height) || NE(matrix.cell_shadow_thickness) || NE(matrix.cell_highlight_thickness) || new_column_widths || *************** *** 2228,2236 **** marginHeight = new->matrix.cell_margin_height + new->matrix.text_shadow_thickness; ! new->matrix.label_baseline = marginHeight + LABEL_HEIGHT(new) + ! new->matrix.cell_shadow_thickness - ! new->matrix.label_font->max_bounds.descent; } /* JDS: The comment above this section says both redisplay and --- 2235,2250 ---- marginHeight = new->matrix.cell_margin_height + new->matrix.text_shadow_thickness; ! if(new->matrix.label_font_type == XmFONT_IS_FONT) { ! new->matrix.label_baseline = marginHeight + LABEL_HEIGHT(new) + ! new->matrix.cell_shadow_thickness - ! new->matrix.label_font->max_bounds.descent; ! } else { ! new->matrix.label_baseline = marginHeight + LABEL_HEIGHT(new) + ! new->matrix.cell_shadow_thickness - ! (new->matrix.label_fontext->max_logical_extent.height + ! new->matrix.label_fontext->max_logical_extent.y); ! } } /* JDS: The comment above this section says both redisplay and *************** *** 2381,2399 **** new->manager.bottom_shadow_pixmap); redisplay = True; } ! if (NE(matrix.font->fid)) ! { ! XSetFont(XtDisplay(new), new->matrix.draw_gc, new->matrix.font->fid); ! redisplay = True; } ! if (NE(matrix.label_font->fid)) ! { ! XSetFont(XtDisplay(new), new->matrix.label_gc, new->matrix.label_font->fid); ! XSetFont(XtDisplay(new), new->matrix.label_clip_gc, new->matrix.label_font->fid); ! redisplay = True; } /* * See if any other resources changed which will require a relayout --- 2395,2427 ---- new->manager.bottom_shadow_pixmap); redisplay = True; } ! if (new->matrix.font_type == XmFONT_IS_FONT) { ! if (NE(matrix.font->fid)) ! { ! XSetFont(XtDisplay(new), new->matrix.draw_gc, new->matrix.font->fid); ! redisplay = True; ! } ! } else { ! if (NE(matrix.fontset)) ! { ! redisplay = True; ! } } ! if (new->matrix.label_font_type == XmFONT_IS_FONT) { ! if (NE(matrix.label_font->fid)) ! { ! XSetFont(XtDisplay(new), new->matrix.label_gc, new->matrix.label_font->fid); ! XSetFont(XtDisplay(new), new->matrix.label_clip_gc, new->matrix.label_font->fid); ! redisplay = True; ! } ! } else { ! if (NE(matrix.label_fontset)) ! { ! redisplay = True; ! } } /* * See if any other resources changed which will require a relayout diff -r -c Xbae-4.6.2/src/MatrixP.h ja/Xbae-4.6.2/src/MatrixP.h *** Xbae-4.6.2/src/MatrixP.h Sat Feb 8 12:08:25 1997 --- ja/Xbae-4.6.2/src/MatrixP.h Sun May 30 12:36:54 1999 *************** *** 386,391 **** --- 386,399 ---- XFontStruct *font; /* fontStruct from fontList */ XFontStruct *label_font; /* fontStruct from fontList */ + #if 1 + XmFontType font_type; /* XmFONT_IS_FONT/XmFONT_IS_FONTSET */ + XFontSet fontset; /* fontSet from fontList */ + XFontSetExtents *fontext; /* fontSetExtents from fontList */ + XmFontType label_font_type; /* XmFONT_IS_FONT/XmFONT_IS_FONTSET */ + XFontSet label_fontset; /* fontSet from fontList */ + XFontSetExtents *label_fontext; /* fontSetExtents from fontList */ + #endif SmScrollMgr clip_scroll_mgr; /* ScrollMgr for Clip */ SmScrollMgr matrix_scroll_mgr; /* ScrollMgr for Matrix */