SmeBSB.c File Reference

#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/Xos.h>
#include <stdlib.h>
#include <X11/Xmu/Drawing.h>
#include <X11/Xaw3d/XawInit.h>
#include <X11/Xaw3d/SimpleMenu.h>
#include <X11/Xaw3d/SmeBSBP.h>
#include <X11/Xaw3d/Cardinals.h>
#include <stdio.h>

Include dependency graph for SmeBSB.c:

Go to the source code of this file.

Defines

#define ONE_HUNDRED   100
#define offset(field)   XtOffsetOf(SmeBSBRec, sme_bsb.field)
#define superclass   (&smeThreeDClassRec)

Functions

static void Redisplay ()
static void Destroy ()
static void Initialize ()
static void FlipColors ()
static void ClassInitialize ()
static Boolean SetValues ()
static XtGeometryResult QueryGeometry ()
static void GetDefaultSize ()
static void DrawBitmaps ()
static void GetBitmapInfo ()
static void CreateGCs ()
static void DestroyGCs ()
static void Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args)
static void Destroy (Widget w)
static void Redisplay (Widget w, XEvent *event, Region region)
static Boolean SetValues (Widget current, Widget request, Widget new, ArgList args, Cardinal *num_args)
static XtGeometryResult QueryGeometry (Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *return_val)
static void FlipColors (Widget w)
static void GetDefaultSize (Widget w, Dimension *width, Dimension *height)
static void DrawBitmaps (Widget w, GC gc)
static void GetBitmapInfo (Widget w, Boolean is_left)
static void CreateGCs (Widget w)
static void DestroyGCs (Widget w)

Variables

static XtResource resources []
SmeBSBClassRec smeBSBClassRec
WidgetClass smeBSBObjectClass = (WidgetClass) &smeBSBClassRec


Define Documentation

#define offset ( field   )     XtOffsetOf(SmeBSBRec, sme_bsb.field)

Definition at line 60 of file SmeBSB.c.

#define ONE_HUNDRED   100

Definition at line 58 of file SmeBSB.c.

Referenced by GetDefaultSize().

#define superclass   (&smeThreeDClassRec)

Definition at line 102 of file SmeBSB.c.


Function Documentation

static void ClassInitialize (  )  [static]

Definition at line 121 of file Simple.c.

00122 {
00123     static XtConvertArgRec convertArg[] = {
00124         {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
00125              sizeof(Screen *)},
00126         {XtResourceString, (XtPointer) XtNpointerColor, sizeof(Pixel)},
00127         {XtResourceString, (XtPointer) XtNpointerColorBackground, 
00128              sizeof(Pixel)},
00129         {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.colormap),
00130              sizeof(Colormap)}
00131     };
00132 
00133     XawInitializeWidgetSet();
00134     XtSetTypeConverter( XtRString, XtRColorCursor, XmuCvtStringToColorCursor,
00135                        convertArg, XtNumber(convertArg), 
00136                        XtCacheByDisplay, (XtDestructor)NULL);
00137 }

static void CreateGCs ( Widget  w  )  [static]

Definition at line 652 of file SmeBSB.c.

References FALSE, SmeBSBPart::font, SmeBSBPart::foreground, GXxor, SmePart::international, SmeBSBPart::invert_gc, SmeBSBPart::norm_gc, SmeBSBPart::norm_gray_gc, SmeBSBPart::rev_gc, _SmeBSBRec::sme, _SmeBSBRec::sme_bsb, and XmuCreateStippledPixmap().

00654 {
00655     SmeBSBObject entry = (SmeBSBObject) w;    
00656     XGCValues values;
00657     XtGCMask mask, mask_i18n;
00658     
00659     values.foreground = XtParent(w)->core.background_pixel;
00660     values.background = entry->sme_bsb.foreground;
00661     values.font = entry->sme_bsb.font->fid;
00662     values.graphics_exposures = FALSE;
00663     mask      = GCForeground | GCBackground | GCGraphicsExposures | GCFont;
00664     mask_i18n = GCForeground | GCBackground | GCGraphicsExposures;
00665     if ( entry->sme.international == True )
00666         entry->sme_bsb.rev_gc = XtAllocateGC(w, 0, mask_i18n, &values, GCFont, 0 );
00667     else
00668         entry->sme_bsb.rev_gc = XtGetGC(w, mask, &values);
00669     
00670     values.foreground = entry->sme_bsb.foreground;
00671     values.background = XtParent(w)->core.background_pixel;
00672     if ( entry->sme.international == True )
00673         entry->sme_bsb.norm_gc = XtAllocateGC(w, 0, mask_i18n, &values, GCFont, 0 );
00674     else
00675         entry->sme_bsb.norm_gc = XtGetGC(w, mask, &values);
00676 
00677     values.fill_style = FillTiled;
00678     values.tile   = XmuCreateStippledPixmap(XtScreenOfObject(w), 
00679                                             entry->sme_bsb.foreground,
00680                                             XtParent(w)->core.background_pixel,
00681                                             XtParent(w)->core.depth);
00682     values.graphics_exposures = FALSE;
00683     mask |= GCTile | GCFillStyle;
00684     if ( entry->sme.international == True )
00685         entry->sme_bsb.norm_gray_gc = XtAllocateGC(w, 0, mask_i18n, &values, GCFont, 0 );
00686     else
00687         entry->sme_bsb.norm_gray_gc = XtGetGC(w, mask, &values);
00688 
00689     values.foreground ^= values.background;
00690     values.background = 0;
00691     values.function = GXxor;
00692     mask = GCForeground | GCBackground | GCGraphicsExposures | GCFunction;
00693     entry->sme_bsb.invert_gc = XtGetGC(w, mask, &values);
00694 }

Here is the call graph for this function:

static void CreateGCs (  )  [static]

Referenced by Initialize(), and SetValues().

Here is the caller graph for this function:

static void Destroy ( Widget  w  )  [static]

Definition at line 213 of file SmeBSB.c.

References DestroyGCs(), SmeBSBPart::label, and _SmeBSBRec::sme_bsb.

00215 {
00216     SmeBSBObject entry = (SmeBSBObject) w;
00217 
00218     DestroyGCs(w);
00219     if (entry->sme_bsb.label != XtName(w))
00220         XtFree(entry->sme_bsb.label);
00221 }

Here is the call graph for this function:

static void Destroy (  ) 

static void DestroyGCs ( Widget  w  )  [static]

Definition at line 703 of file SmeBSB.c.

References SmeBSBPart::invert_gc, SmeBSBPart::norm_gc, SmeBSBPart::norm_gray_gc, SmeBSBPart::rev_gc, and _SmeBSBRec::sme_bsb.

00705 {
00706     SmeBSBObject entry = (SmeBSBObject) w;    
00707 
00708     XtReleaseGC(w, entry->sme_bsb.norm_gc);
00709     XtReleaseGC(w, entry->sme_bsb.norm_gray_gc);
00710     XtReleaseGC(w, entry->sme_bsb.rev_gc);
00711     XtReleaseGC(w, entry->sme_bsb.invert_gc);
00712 }

static void DestroyGCs (  ) 

Referenced by Destroy(), and SetValues().

Here is the caller graph for this function:

static void DrawBitmaps ( Widget  w,
GC  gc 
) [static]

Definition at line 535 of file SmeBSB.c.

References int, SmeBSBPart::left_bitmap, SmeBSBPart::left_bitmap_height, SmeBSBPart::left_bitmap_width, SmeBSBPart::left_margin, _SmeBSBRec::rectangle, SmeBSBPart::right_bitmap, SmeBSBPart::right_bitmap_height, SmeBSBPart::right_bitmap_width, SmeBSBPart::right_margin, SmeThreeDPart::shadow_width, _SmeBSBRec::sme_bsb, and _SmeBSBRec::sme_threeD.

00538 {
00539     int x_loc, y_loc;
00540     SmeBSBObject entry = (SmeBSBObject) w;
00541     
00542     if ( (entry->sme_bsb.left_bitmap == None) && 
00543          (entry->sme_bsb.right_bitmap == None) ) return;
00544 
00545 /*
00546  * Draw Left Bitmap.
00547  */
00548 
00549   if (entry->sme_bsb.left_bitmap != None) {
00550     x_loc = entry->sme_threeD.shadow_width +
00551                 (int)(entry->sme_bsb.left_margin -
00552                       entry->sme_bsb.left_bitmap_width) / 2;
00553 
00554     y_loc = entry->rectangle.y +
00555                 (int)(entry->rectangle.height -
00556                       entry->sme_bsb.left_bitmap_height) / 2;
00557 
00558     XCopyPlane(XtDisplayOfObject(w), entry->sme_bsb.left_bitmap,
00559                XtWindowOfObject(w), gc, 0, 0, 
00560                entry->sme_bsb.left_bitmap_width,
00561                entry->sme_bsb.left_bitmap_height, x_loc, y_loc, 1);
00562   }
00563 
00564 /*
00565  * Draw Right Bitmap.
00566  */
00567 
00568 
00569   if (entry->sme_bsb.right_bitmap != None) {
00570     x_loc = entry->rectangle.width - entry->sme_threeD.shadow_width -
00571                 (int)(entry->sme_bsb.right_margin +
00572                       entry->sme_bsb.right_bitmap_width) / 2;
00573 
00574     y_loc = entry->rectangle.y +
00575                 (int)(entry->rectangle.height -
00576                       entry->sme_bsb.right_bitmap_height) / 2;
00577 
00578     XCopyPlane(XtDisplayOfObject(w), entry->sme_bsb.right_bitmap,
00579                XtWindowOfObject(w), gc, 0, 0, 
00580                entry->sme_bsb.right_bitmap_width,
00581                entry->sme_bsb.right_bitmap_height, x_loc, y_loc, 1);
00582   }
00583 }

static void DrawBitmaps (  ) 

Referenced by Redisplay().

Here is the caller graph for this function:

static void FlipColors ( Widget  w  )  [static]

Definition at line 451 of file SmeBSB.c.

References SmeBSBPart::invert_gc, _SmeBSBRec::rectangle, SmeBSBPart::set_values_area_cleared, SmeThreeDPart::shadow_width, SmeThreeDClassPart::shadowdraw, SmeThreeDPart::shadowed, _SmeBSBRec::sme_bsb, _SmeBSBRec::sme_threeD, and _SmeBSBClassRec::sme_threeD_class.

00453 {
00454     SmeBSBObject entry = (SmeBSBObject) w;
00455     SmeBSBObjectClass oclass = (SmeBSBObjectClass) XtClass (w);
00456 
00457     if (entry->sme_bsb.set_values_area_cleared) {
00458         entry->sme_threeD.shadowed = False;
00459         return;
00460     }
00461 
00462     if (entry->sme_threeD.shadow_width > 0) {
00463         entry->sme_threeD.shadowed ^= True;
00464         (*oclass->sme_threeD_class.shadowdraw) (w);
00465     } else
00466         XFillRectangle(XtDisplayOfObject(w), XtWindowOfObject(w),
00467                    entry->sme_bsb.invert_gc, 
00468                    0, (int) entry->rectangle.y,
00469                    (unsigned int) entry->rectangle.width, 
00470                    (unsigned int) entry->rectangle.height);
00471 }

static void FlipColors (  ) 

static void GetBitmapInfo ( Widget  w,
Boolean  is_left 
) [static]

Definition at line 594 of file SmeBSB.c.

References buf, depth, height, SmeBSBPart::left_bitmap, SmeBSBPart::left_bitmap_height, SmeBSBPart::left_bitmap_width, SmeBSBPart::right_bitmap, SmeBSBPart::right_bitmap_height, SmeBSBPart::right_bitmap_width, root, _SmeBSBRec::sme_bsb, void(), width, x, and y.

00597 {
00598     SmeBSBObject entry = (SmeBSBObject) w;    
00599     unsigned int depth, bw;
00600     Window root;
00601     int x, y;
00602     unsigned int width, height;
00603     char buf[BUFSIZ];
00604     
00605     if (is_left) {
00606         if (entry->sme_bsb.left_bitmap != None) {
00607             if (!XGetGeometry(XtDisplayOfObject(w), 
00608                               entry->sme_bsb.left_bitmap, &root, 
00609                               &x, &y, &width, &height, &bw, &depth)) {
00610                 (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".", "Could not",
00611                         "get Left Bitmap geometry information for menu entry ",
00612                         XtName(w));
00613                 XtAppError(XtWidgetToApplicationContext(w), buf);
00614             }
00615             if (depth != 1) {
00616                 (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\"%s.", 
00617                         "Left Bitmap of entry ", 
00618                         XtName(w), " is not one bit deep.");
00619                 XtAppError(XtWidgetToApplicationContext(w), buf);
00620             }
00621             entry->sme_bsb.left_bitmap_width = (Dimension) width; 
00622             entry->sme_bsb.left_bitmap_height = (Dimension) height;
00623         }
00624     }
00625     else if (entry->sme_bsb.right_bitmap != None) {
00626         if (!XGetGeometry(XtDisplayOfObject(w),
00627                           entry->sme_bsb.right_bitmap, &root,
00628                           &x, &y, &width, &height, &bw, &depth)) {
00629             (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".", "Could not",
00630                     "get Right Bitmap geometry information for menu entry ",
00631                     XtName(w));
00632             XtAppError(XtWidgetToApplicationContext(w), buf);
00633         }
00634         if (depth != 1) {
00635             (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\"%s.", 
00636                     "Right Bitmap of entry ", XtName(w),
00637                     " is not one bit deep.");
00638             XtAppError(XtWidgetToApplicationContext(w), buf);
00639         }
00640         entry->sme_bsb.right_bitmap_width = (Dimension) width; 
00641         entry->sme_bsb.right_bitmap_height = (Dimension) height;
00642     }
00643 }      

Here is the call graph for this function:

static void GetBitmapInfo (  ) 

Referenced by Initialize(), and SetValues().

Here is the caller graph for this function:

static void GetDefaultSize ( Widget  w,
Dimension *  width,
Dimension *  height 
) [static]

Definition at line 488 of file SmeBSB.c.

References SmeBSBPart::font, SmeBSBPart::fontset, int, SmePart::international, SmeBSBPart::label, SmeBSBPart::left_margin, ONE_HUNDRED, SmeBSBPart::right_margin, SmeThreeDPart::shadow_width, _SmeBSBRec::sme, _SmeBSBRec::sme_bsb, _SmeBSBRec::sme_threeD, and SmeBSBPart::vert_space.

00491 {
00492     SmeBSBObject entry = (SmeBSBObject) w;
00493 
00494     if ( entry->sme.international == True ) {
00495         XFontSetExtents *ext = XExtentsOfFontSet(entry->sme_bsb.fontset);
00496         if (entry->sme_bsb.label == NULL) 
00497             *width = 0;
00498         else
00499             *width = XmbTextEscapement(entry->sme_bsb.fontset, entry->sme_bsb.label,
00500                             strlen(entry->sme_bsb.label));
00501         *width += entry->sme_bsb.left_margin + entry->sme_bsb.right_margin;
00502         *width += (2 * entry->sme_threeD.shadow_width);
00503         *height = ext->max_ink_extent.height;
00504         *height = ((int)*height * ( ONE_HUNDRED + 
00505                                 entry->sme_bsb.vert_space )) / ONE_HUNDRED;
00506         *height += (2 * entry->sme_threeD.shadow_width);
00507     }
00508     else {
00509         if (entry->sme_bsb.label == NULL) 
00510             *width = 0;
00511         else
00512             *width = XTextWidth(entry->sme_bsb.font, entry->sme_bsb.label,
00513                             strlen(entry->sme_bsb.label));
00514 
00515         *width += entry->sme_bsb.left_margin + entry->sme_bsb.right_margin;
00516         *width += (2 * entry->sme_threeD.shadow_width);
00517     
00518         *height = (entry->sme_bsb.font->max_bounds.ascent +
00519                entry->sme_bsb.font->max_bounds.descent);
00520 
00521         *height = ((int)*height * ( ONE_HUNDRED + 
00522                                 entry->sme_bsb.vert_space )) / ONE_HUNDRED;
00523         *height += (2 * entry->sme_threeD.shadow_width);
00524     }
00525 }

static void GetDefaultSize (  )  [static]

Referenced by Initialize(), QueryGeometry(), and SetValues().

Here is the caller graph for this function:

static void Initialize ( Widget  request,
Widget  new,
ArgList  args,
Cardinal *  num_args 
) [static]

Definition at line 184 of file SmeBSB.c.

References CreateGCs(), FALSE, GetBitmapInfo(), GetDefaultSize(), SmeBSBPart::label, SmeBSBPart::left_bitmap_height, SmeBSBPart::left_bitmap_width, _SmeBSBRec::rectangle, SmeBSBPart::right_bitmap_height, SmeBSBPart::right_bitmap_width, _SmeBSBRec::sme_bsb, and TRUE.

00188 {
00189     SmeBSBObject entry = (SmeBSBObject) new;
00190 
00191     if (entry->sme_bsb.label == NULL) 
00192         entry->sme_bsb.label = XtName(new);
00193     else
00194         entry->sme_bsb.label = XtNewString( entry->sme_bsb.label );
00195 
00196     GetDefaultSize(new, &(entry->rectangle.width), &(entry->rectangle.height));
00197     CreateGCs(new);
00198 
00199     entry->sme_bsb.left_bitmap_width = entry->sme_bsb.left_bitmap_height = 0;
00200     entry->sme_bsb.right_bitmap_width = entry->sme_bsb.right_bitmap_height = 0;
00201 
00202     GetBitmapInfo(new, TRUE);   /* Left Bitmap Info */
00203     GetBitmapInfo(new, FALSE);  /* Right Bitmap Info */
00204 }

Here is the call graph for this function:

static void Initialize ( void   ) 

Initialisation of Scilab

static XtGeometryResult QueryGeometry ( Widget  w,
XtWidgetGeometry *  intended,
XtWidgetGeometry *  return_val 
) [static]

Definition at line 408 of file SmeBSB.c.

References GetDefaultSize(), height, mode, _SmeBSBRec::rectangle, and width.

00411 {
00412     SmeBSBObject entry = (SmeBSBObject) w;
00413     Dimension width, height;
00414     XtGeometryResult ret_val = XtGeometryYes;
00415     XtGeometryMask mode = intended->request_mode;
00416 
00417     GetDefaultSize(w, &width, &height );    
00418 
00419     if ( ((mode & CWWidth) && (intended->width != width)) ||
00420          !(mode & CWWidth) ) {
00421         return_val->request_mode |= CWWidth;
00422         return_val->width = width;
00423         ret_val = XtGeometryAlmost;
00424     }
00425 
00426     if ( ((mode & CWHeight) && (intended->height != height)) ||
00427          !(mode & CWHeight) ) {
00428         return_val->request_mode |= CWHeight;
00429         return_val->height = height;
00430         ret_val = XtGeometryAlmost;
00431     }
00432 
00433     if (ret_val == XtGeometryAlmost) {
00434         mode = return_val->request_mode;
00435         
00436         if ( ((mode & CWWidth) && (width == entry->rectangle.width)) &&
00437              ((mode & CWHeight) && (height == entry->rectangle.height)) )
00438             return(XtGeometryNo);
00439     }
00440 
00441     return(ret_val);
00442 }

Here is the call graph for this function:

static XtGeometryResult QueryGeometry (  )  [static]

static void Redisplay ( Widget  w,
XEvent *  event,
Region  region 
) [static]

Definition at line 233 of file SmeBSB.c.

References abs, DrawBitmaps(), FALSE, SmeBSBPart::font, SmeBSBPart::fontset, gc, int, SmePart::international, SmeBSBPart::justify, label, SmeBSBPart::label, SmeBSBPart::left_margin, len, SmeBSBPart::norm_gc, SmeBSBPart::norm_gray_gc, _SmeBSBRec::rectangle, SmeBSBPart::rev_gc, SmeBSBPart::right_margin, s, SmeBSBPart::set_values_area_cleared, SmeThreeDPart::shadow_width, _SmeBSBRec::sme, _SmeBSBRec::sme_bsb, _SmeBSBRec::sme_threeD, width, XawSimpleMenuGetActiveEntry(), XtJustifyCenter, XtJustifyLeft, and XtJustifyRight.

00237 {
00238     GC gc;
00239     SmeBSBObject entry = (SmeBSBObject) w;
00240     Dimension s = entry->sme_threeD.shadow_width;
00241     int font_ascent = 0, font_descent = 0, y_loc;
00242 
00243     int fontset_ascent = 0, fontset_descent = 0;
00244     XFontSetExtents *ext = XExtentsOfFontSet(entry->sme_bsb.fontset);
00245 
00246     entry->sme_bsb.set_values_area_cleared = FALSE;    
00247     if ( entry->sme.international == True ) {
00248         fontset_ascent = abs(ext->max_ink_extent.y);
00249         fontset_descent = ext->max_ink_extent.height - fontset_ascent;
00250     }
00251     else { /*else, compute size from font like R5*/
00252         font_ascent = entry->sme_bsb.font->max_bounds.ascent;
00253         font_descent = entry->sme_bsb.font->max_bounds.descent;
00254     }
00255     y_loc = entry->rectangle.y;
00256 
00257 
00258     if (XtIsSensitive(w) && XtIsSensitive( XtParent(w) ) ) {
00259         if ( w == XawSimpleMenuGetActiveEntry(XtParent(w)) ) {
00260             XFillRectangle(XtDisplayOfObject(w), XtWindowOfObject(w), 
00261                            entry->sme_bsb.norm_gc, s, y_loc + s,
00262                            (unsigned int) entry->rectangle.width - 2 * s,
00263                            (unsigned int) entry->rectangle.height - 2 * s);
00264             gc = entry->sme_bsb.rev_gc;
00265         }
00266         else
00267             gc = entry->sme_bsb.norm_gc;
00268     }
00269     else
00270         gc = entry->sme_bsb.norm_gray_gc;
00271     
00272     if (entry->sme_bsb.label != NULL) {
00273         int x_loc = entry->sme_bsb.left_margin;
00274         int len = strlen(entry->sme_bsb.label);
00275         char * label = entry->sme_bsb.label;
00276 
00277         switch(entry->sme_bsb.justify) {
00278             int width, t_width;
00279 
00280         case XtJustifyCenter:
00281             if ( entry->sme.international == True ) {
00282                 t_width = XmbTextEscapement(entry->sme_bsb.fontset,label,len);
00283                 width = entry->rectangle.width - (entry->sme_bsb.left_margin +
00284                                               entry->sme_bsb.right_margin);
00285             }
00286             else {
00287                 t_width = XTextWidth(entry->sme_bsb.font, label, len);
00288                 width = entry->rectangle.width - (entry->sme_bsb.left_margin +
00289                                               entry->sme_bsb.right_margin);
00290             }
00291             x_loc += (width - t_width)/2;
00292             break;
00293         case XtJustifyRight:
00294             if ( entry->sme.international == True ) {
00295                 t_width = XmbTextEscapement(entry->sme_bsb.fontset,label,len);
00296                 x_loc = entry->rectangle.width - ( entry->sme_bsb.right_margin
00297                                                  + t_width );
00298             }
00299             else {
00300                 t_width = XTextWidth(entry->sme_bsb.font, label, len);
00301                 x_loc = entry->rectangle.width - ( entry->sme_bsb.right_margin
00302                                                  + t_width );
00303             }
00304             break;
00305         case XtJustifyLeft:
00306         default:
00307             break;
00308         }
00309 
00310 
00311         /* this will center the text in the gadget top-to-bottom */
00312 
00313         if ( entry->sme.international==True ) {
00314             y_loc += ((int)entry->rectangle.height - 
00315                   (fontset_ascent + fontset_descent)) / 2 + fontset_ascent;
00316 
00317             XmbDrawString(XtDisplayOfObject(w), XtWindowOfObject(w),
00318                 entry->sme_bsb.fontset, gc, x_loc + s, y_loc, label, len);
00319         }
00320         else {
00321             y_loc += ((int)entry->rectangle.height - 
00322                   (font_ascent + font_descent)) / 2 + font_ascent;
00323         
00324             XDrawString(XtDisplayOfObject(w), XtWindowOfObject(w), gc,
00325                     x_loc + s, y_loc, label, len);
00326         }
00327     }
00328 
00329     DrawBitmaps(w, gc);
00330 }

Here is the call graph for this function:

static void Redisplay (  )  [static]

static Boolean SetValues ( Widget  current,
Widget  request,
Widget  new,
ArgList  args,
Cardinal *  num_args 
) [static]

Definition at line 343 of file SmeBSB.c.

References CreateGCs(), DestroyGCs(), FALSE, SmeBSBPart::font, SmeBSBPart::fontset, SmeBSBPart::foreground, GetBitmapInfo(), GetDefaultSize(), SmePart::international, SmeBSBPart::label, SmeBSBPart::left_bitmap, _SmeBSBRec::rectangle, SmeBSBPart::right_bitmap, SmeBSBPart::set_values_area_cleared, _SmeBSBRec::sme, _SmeBSBRec::sme_bsb, and TRUE.

00347 {
00348     SmeBSBObject entry = (SmeBSBObject) new;
00349     SmeBSBObject old_entry = (SmeBSBObject) current;
00350     Boolean ret_val = FALSE;
00351 
00352     if (old_entry->sme_bsb.label != entry->sme_bsb.label) {
00353         if (old_entry->sme_bsb.label != XtName( new ) )
00354             XtFree( (char *) old_entry->sme_bsb.label );
00355 
00356         if (entry->sme_bsb.label != XtName(new) ) 
00357             entry->sme_bsb.label = XtNewString( entry->sme_bsb.label );
00358 
00359         ret_val = True;
00360     }
00361 
00362     if (entry->rectangle.sensitive != old_entry->rectangle.sensitive )
00363         ret_val = TRUE;
00364 
00365     if (entry->sme_bsb.left_bitmap != old_entry->sme_bsb.left_bitmap) {
00366         GetBitmapInfo(new, TRUE);
00367         ret_val = TRUE;
00368     }
00369 
00370     if (entry->sme_bsb.right_bitmap != old_entry->sme_bsb.right_bitmap) {
00371         GetBitmapInfo(new, FALSE);
00372         ret_val = TRUE;
00373     }
00374 
00375     if (  (     (old_entry->sme_bsb.font != entry->sme_bsb.font) &&
00376         (old_entry->sme.international == False )                  ) ||
00377         (old_entry->sme_bsb.foreground != entry->sme_bsb.foreground) ) {
00378         DestroyGCs(current);
00379         CreateGCs(new);
00380         ret_val = TRUE;
00381     }
00382 
00383     if ( ( old_entry->sme_bsb.fontset != entry->sme_bsb.fontset) &&
00384                                 (old_entry->sme.international == True ) )
00385         /* DONT changes the GCs, because the fontset is not in them. */
00386         ret_val = TRUE;
00387 
00388     if (ret_val) {
00389         GetDefaultSize(new, 
00390                        &(entry->rectangle.width), &(entry->rectangle.height));
00391         entry->sme_bsb.set_values_area_cleared = TRUE;
00392     }
00393     return(ret_val);
00394 }

Here is the call graph for this function:

static Boolean SetValues (  )  [static]


Variable Documentation

XtResource resources[] [static]

Initial value:

 {
  {XtNlabel,  XtCLabel, XtRString, sizeof(String),
     offset(label), XtRString, NULL},
  {XtNvertSpace,  XtCVertSpace, XtRInt, sizeof(int),
     offset(vert_space), XtRImmediate, (XtPointer) 25},
  {XtNleftBitmap, XtCLeftBitmap, XtRBitmap, sizeof(Pixmap),
     offset(left_bitmap), XtRImmediate, (XtPointer)None},
  {XtNjustify, XtCJustify, XtRJustify, sizeof(XtJustify),
     offset(justify), XtRImmediate, (XtPointer) XtJustifyLeft},
  {XtNrightBitmap, XtCRightBitmap, XtRBitmap, sizeof(Pixmap),
     offset(right_bitmap), XtRImmediate, (XtPointer)None},
  {XtNleftMargin,  XtCHorizontalMargins, XtRDimension, sizeof(Dimension),
     offset(left_margin), XtRImmediate, (XtPointer) 4},
  {XtNrightMargin,  XtCHorizontalMargins, XtRDimension, sizeof(Dimension),
     offset(right_margin), XtRImmediate, (XtPointer) 4},
  {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
     offset(foreground), XtRString, XtDefaultForeground},
  {XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
     offset(font), XtRString, XtDefaultFont},
  {XtNfontSet,  XtCFontSet, XtRFontSet, sizeof(XFontSet ),
     offset(fontset),XtRString, XtDefaultFontSet},
}

Definition at line 62 of file SmeBSB.c.

SmeBSBClassRec smeBSBClassRec

Definition at line 103 of file SmeBSB.c.

WidgetClass smeBSBObjectClass = (WidgetClass) &smeBSBClassRec

Definition at line 152 of file SmeBSB.c.


Generated on Sun Mar 4 16:01:53 2007 for Scilab [trunk] by  doxygen 1.5.1