Blame SOURCES/Xaw3d-1.6.1-3Dlabel.patch

94405b
diff -up libXaw3d-1.6.1/src/Label.c.3Dlabel libXaw3d-1.6.1/src/Label.c
94405b
--- libXaw3d-1.6.1/src/Label.c.3Dlabel	2011-09-19 15:42:36.000000000 -0600
94405b
+++ libXaw3d-1.6.1/src/Label.c	2012-02-25 14:44:33.766774776 -0700
94405b
@@ -416,9 +416,16 @@ GetgrayGC(LabelWidget lw)
94405b
 static void
94405b
 compute_bitmap_offsets (LabelWidget lw)
94405b
 {
94405b
-    if (lw->label.lbm_height != 0)
94405b
-	lw->label.lbm_y = (lw->core.height - lw->label.lbm_height) / 2;
94405b
-    else
94405b
+    /*
94405b
+     * bitmap will be eventually be displayed at 
94405b
+     * (internal_width, internal_height + lbm_y)
94405b
+     */
94405b
+    if (lw->label.lbm_height != 0) {
94405b
+	lw->label.lbm_y = (lw->core.height -
94405b
+			   (lw->threeD.shadow_width * 2 +
94405b
+			    lw->label.internal_height * 2 +
94405b
+			    lw->label.lbm_height)) / 2;
94405b
+    } else
94405b
 	lw->label.lbm_y = 0;
94405b
 }
94405b
 
94405b
@@ -444,9 +451,11 @@ Initialize(Widget request, Widget new, A
94405b
 {
94405b
     LabelWidget lw = (LabelWidget) new;
94405b
 
94405b
+#if 0
94405b
     /* disable shadows if we're not a subclass of Command */
94405b
     if (!XtIsSubclass(new, commandWidgetClass))
94405b
 	lw->threeD.shadow_width = 0;
94405b
+#endif
94405b
 
94405b
     if (lw->label.label == NULL)
94405b
         lw->label.label = XtNewString(lw->core.name);
94405b
@@ -460,18 +469,20 @@ Initialize(Widget request, Widget new, A
94405b
 
94405b
     if (lw->core.height == 0)
94405b
 	lw->core.height = lw->label.label_height +
94405b
-				2 * lw->label.internal_height;
94405b
+			  2 * lw->label.internal_height +
94405b
+			  2 * lw->threeD.shadow_width;
94405b
 
94405b
     set_bitmap_info(lw);  /* req's core.height, sets label.lbm_* */
94405b
 
94405b
     if (lw->label.lbm_height > lw->label.label_height)
94405b
 	lw->core.height = lw->label.lbm_height +
94405b
-				2 * lw->label.internal_height;
94405b
+			  2 * lw->label.internal_height;
94405b
 
94405b
     if (lw->core.width == 0)
94405b
         lw->core.width = lw->label.label_width +
94405b
-				2 * lw->label.internal_width +
94405b
-				LEFT_OFFSET(lw);  /* req's label.lbm_width */
94405b
+			 2 * lw->label.internal_width +
94405b
+			 2 * lw->threeD.shadow_width +
94405b
+			 LEFT_OFFSET(lw);	/* req's label.lbm_width */
94405b
 
94405b
     lw->label.label_x = lw->label.label_y = 0;
94405b
     (*XtClass(new)->core_class.resize) ((Widget)lw);
94405b
@@ -549,14 +560,16 @@ Redisplay(Widget gw, XEvent *event, Regi
94405b
 	    if (w->label.depth == 1)
94405b
 		XCopyPlane(XtDisplay(gw), pm, XtWindow(gw), gc, 0, 0,
94405b
 			   w->label.lbm_width, w->label.lbm_height,
94405b
-			   (int) w->label.internal_width,
94405b
-			   (int) w->label.lbm_y,
94405b
+			   (int) w->label.internal_width + w->threeD.shadow_width,
94405b
+			   (int) w->label.internal_height + w->threeD.shadow_width
94405b
+				 + w->label.lbm_y,
94405b
 			   (unsigned long) 1L);
94405b
 	    else
94405b
 		XCopyArea(XtDisplay(gw), pm, XtWindow(gw), gc, 0, 0,
94405b
 			  w->label.lbm_width, w->label.lbm_height,
94405b
-			  (int) w->label.internal_width,
94405b
-			  (int) w->label.lbm_y);
94405b
+			  (int) w->label.internal_width + w->threeD.shadow_width,
94405b
+			  (int) w->label.internal_height + w->threeD.shadow_width
94405b
+				+ w->label.lbm_y);
94405b
 	}
94405b
 
94405b
 #ifdef XAW_INTERNATIONALIZATION
94405b
@@ -646,14 +659,17 @@ _Reposition(LabelWidget lw, Dimension wi
94405b
             Position *dx, Position *dy)
94405b
 {
94405b
     Position newPos;
94405b
-    Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw);
94405b
+    Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw) +
94405b
+			lw->threeD.shadow_width;
94405b
+
94405b
 
94405b
     switch (lw->label.justify) {
94405b
 	case XtJustifyLeft:
94405b
 	    newPos = leftedge;
94405b
 	    break;
94405b
 	case XtJustifyRight:
94405b
-	    newPos = width - lw->label.label_width - lw->label.internal_width;
94405b
+	    newPos = width - (lw->label.label_width + lw->label.internal_width +
94405b
+			      lw->threeD.shadow_width);
94405b
 	    break;
94405b
 	case XtJustifyCenter:
94405b
 	default:
94405b
@@ -745,17 +761,20 @@ SetValues(Widget current, Widget request
94405b
     if (newlw->label.resize && was_resized) {
94405b
 	if (curlw->core.height == reqlw->core.height && !checks[HEIGHT])
94405b
 	    newlw->core.height = newlw->label.label_height +
94405b
-				2 * newlw->label.internal_height;
94405b
+				 2 * newlw->label.internal_height +
94405b
+				 2 * newlw->threeD.shadow_width;
94405b
 
94405b
 	set_bitmap_info (newlw);  /* req's core.height, sets label.lbm_* */
94405b
 
94405b
 	if (newlw->label.lbm_height > newlw->label.label_height)
94405b
 	    newlw->core.height = newlw->label.lbm_height +
94405b
-					2 * newlw->label.internal_height;
94405b
+				 2 * newlw->label.internal_height +
94405b
+				 2 * newlw->threeD.shadow_width;
94405b
 
94405b
 	if (curlw->core.width == reqlw->core.width && !checks[WIDTH])
94405b
 	    newlw->core.width = newlw->label.label_width +
94405b
 				2 * newlw->label.internal_width +
94405b
+				2 * newlw->threeD.shadow_width +
94405b
 				LEFT_OFFSET(newlw);  /* req's label.lbm_width */
94405b
     }
94405b
 
94405b
@@ -764,15 +783,20 @@ SetValues(Widget current, Widget request
94405b
 	if (checks[HEIGHT]) {
94405b
 	    if (newlw->label.label_height > newlw->label.lbm_height)
94405b
 		i = newlw->label.label_height +
94405b
-			2 * newlw->label.internal_height;
94405b
+		    2 * newlw->label.internal_height +
94405b
+		    2 * newlw->threeD.shadow_width;
94405b
 	    else
94405b
-		i = newlw->label.lbm_height + 2 * newlw->label.internal_height;
94405b
+		i = newlw->label.lbm_height +
94405b
+		    2 * newlw->label.internal_height +
94405b
+		    2 * newlw->threeD.shadow_width;
94405b
 	    if (i > newlw->core.height)
94405b
 		newlw->core.height = i;
94405b
 	}
94405b
 	if (checks[WIDTH]) {
94405b
-	    i = newlw->label.label_width + 2 * newlw->label.internal_width +
94405b
-			LEFT_OFFSET(newlw);  /* req's label.lbm_width */
94405b
+	    i = newlw->label.label_width +
94405b
+		2 * newlw->label.internal_width +
94405b
+		2 * newlw->threeD.shadow_width +
94405b
+		LEFT_OFFSET(newlw);		    /* req's label.lbm_width */
94405b
 	    if (i > newlw->core.width)
94405b
 		newlw->core.width = i;
94405b
 	}
94405b
@@ -843,9 +867,11 @@ QueryGeometry(Widget w, XtWidgetGeometry
94405b
     preferred->request_mode = CWWidth | CWHeight;
94405b
     preferred->width = (lw->label.label_width +
94405b
 			    2 * lw->label.internal_width +
94405b
+			    2 * lw->threeD.shadow_width +
94405b
 			    LEFT_OFFSET(lw));
94405b
     preferred->height = lw->label.label_height +
94405b
-			    2 * lw->label.internal_height;
94405b
+			    2 * lw->label.internal_height +
94405b
+			    2 * lw->threeD.shadow_width;
94405b
     if (  ((intended->request_mode & (CWWidth | CWHeight))
94405b
 	   	== (CWWidth | CWHeight)) &&
94405b
 	  intended->width == preferred->width &&