[BACK]Return to patch-ad CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mbone / vat / patches

File: [cvs.NetBSD.org] / pkgsrc / mbone / vat / patches / patch-ad (download)

Revision 1.3, Fri Aug 16 16:25:14 2002 UTC (18 years, 1 month ago) by agc
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2, pkgsrc-2009Q1-base, pkgsrc-2009Q1, pkgsrc-2008Q4-base, pkgsrc-2008Q4, pkgsrc-2008Q3-base, pkgsrc-2008Q3, pkgsrc-2008Q2-base, pkgsrc-2008Q2, pkgsrc-2008Q1-base, pkgsrc-2008Q1, pkgsrc-2007Q4-base, pkgsrc-2007Q4, pkgsrc-2007Q3-base, pkgsrc-2007Q3, pkgsrc-2007Q2-base, pkgsrc-2007Q2, pkgsrc-2007Q1-base, pkgsrc-2007Q1, pkgsrc-2006Q4-base, pkgsrc-2006Q4, pkgsrc-2006Q3-base, pkgsrc-2006Q3, pkgsrc-2006Q2-base, pkgsrc-2006Q2, pkgsrc-2006Q1-base, pkgsrc-2006Q1, pkgsrc-2005Q4-base, pkgsrc-2005Q4, pkgsrc-2005Q3-base, pkgsrc-2005Q3, pkgsrc-2005Q2-base, pkgsrc-2005Q2, pkgsrc-2005Q1-base, pkgsrc-2005Q1, pkgsrc-2004Q4-base, pkgsrc-2004Q4, pkgsrc-2004Q3-base, pkgsrc-2004Q3, pkgsrc-2004Q2-base, pkgsrc-2004Q2, pkgsrc-2004Q1-base, pkgsrc-2004Q1, pkgsrc-2003Q4-base, pkgsrc-2003Q4, netbsd-1-6-RELEASE-base, netbsd-1-6-1-base, netbsd-1-6-1, netbsd-1-6, cwrapper, cube-native-xorg-base, cube-native-xorg, HEAD
Changes since 1.2: +12 -1 lines

Make this package compile on 1.6 and later

$NetBSD: patch-ad,v 1.3 2002/08/16 16:25:14 agc Exp $

--- sitebox.cc.orig	Tue Sep  9 11:24:41 1997
+++ sitebox.cc	Tue Sep  9 11:24:43 1997
@@ -112,7 +112,7 @@
 	static Drawable pixmap_;
 	static int pixw_;
 	static int pixh_;
-	static XFontStruct* fs_;	/* font metrics */
+	static Tk_Font fs_;	/* font metrics */
 };
 
 class SiteBox : public TkWidget, public IdleCallback {
@@ -160,7 +160,7 @@
 GC Site::copy_gc_;
 GC Site::fg_[4];
 GC Site::bg_[4];
-XFontStruct* Site::fs_;
+Tk_Font Site::fs_;
 XColor* Site::fc_;
 XColor* Site::bc_;
 XColor* Site::ac_;
@@ -190,15 +190,16 @@
 	sitebox_(sb)
 {
 	Tcl& tcl = Tcl::instance();
+	Tk_FontMetrics fm;
 	if (fs_ == 0) {
 		const char* font = tcl.attr("siteFont");
-		fs_ = Tk_GetFontStruct(tcl.interp(), tk_, (char*)font);
+		fs_ = Tk_GetFont(tcl.interp(), tk_, (char*)font);
 		if (fs_ == 0) {
 			fprintf(stderr,
 				"vat: couldn't find font: %s\n", font);
-			fs_ = Tk_GetFontStruct(tcl.interp(), tk_, "screen");
+			fs_ = Tk_GetFont(tcl.interp(), tk_, "screen");
 			if (fs_ == 0)
-				fs_ = Tk_GetFontStruct(tcl.interp(), tk_,
+				fs_ = Tk_GetFont(tcl.interp(), tk_,
 						       "fixed");
 			if (fs_ == 0) {
 				fprintf(stderr,
@@ -220,8 +221,9 @@
 
 		copy_gc_ = sitebox_.lookup_gc(0, 0, 0);
 	}
-	descent_ = fs_->descent;
-	ascent_ = fs_->ascent;
+	Tk_GetFontMetrics(fs_, &fm);
+	descent_ = fm.descent;
+	ascent_ = fm.ascent;
 	major_ = ascent_;
 	minor_ = major_ / 2;
 }
@@ -292,7 +294,7 @@
  */
 inline int Site::textwidth(const char* s)
 {
-	return (XTextWidth(fs_, s, strlen(s)));
+	return (Tk_TextWidth(fs_, s, strlen(s)));
 }
 
 inline void Site::square(Display* dpy, Drawable window, GC gc,
@@ -450,7 +452,7 @@
 			free_gc(bg_[0]);
 			free_gc(bg_[1]);
 		}
-		Font fid = fs_->fid;
+		Font fid = Tk_FontId(fs_);
 		fg_[0] = raw_gc(fid, fc_, bc_, pixmap_);
 		fg_[2] = raw_gc(fid, dc_, bc_, pixmap_);
 		bg_[0] = raw_gc(fid, bc_, bc_, pixmap_);
@@ -636,8 +638,8 @@
 	need_sort_ = 0;
 
 	Tcl& tcl = Tcl::instance();
-	Tk_Uid fg = mono()? "black" : (char*)tcl.attr("foreground");
-	Tk_Uid bg = mono()? "white" : (char*)tcl.attr("background");
+	Tk_Uid fg = mono()? strdup("black") : (char*)tcl.attr("foreground");
+	Tk_Uid bg = mono()? strdup("white") : (char*)tcl.attr("background");
 	fg_ = lookup_gc(0, fg, bg);
 	bg_ = lookup_gc(0, bg, bg);
 }