Mercurial > hg > xemacs-beta
comparison lwlib/xlwtabs.c @ 3025:facf3239ba30
[xemacs-hg @ 2005-10-25 11:16:19 by ben]
rename new->new_, convert 'foo to `foo'
EmacsFrame.c, ExternalClient.c, ExternalShell.c, chartab.c, cmdloop.c, compiler.h, console.c, database.c, device-msw.c, device-x.c, device.c, doc.c, dragdrop.c, eval.c, event-msw.c, event-stream.c, events.c, extents.c, file-coding.c, fns.c, frame-tty.c, frame.c, gpmevent.c, gutter.c, hash.c, imgproc.c, indent.c, keymap.c, lisp-union.h, macros.c, malloc.c, marker.c, menubar-x.c, menubar.c, mule-charset.c, number.c, process.c, profile.h, ralloc.c, redisplay.c, select-common.h, select.c, syntax.c, sysfile.h, sysproc.h, systime.h, syswindows.h, toolbar.c, tooltalk.c, tparam.c, unexaix.c, unexalpha.c, unexconvex.c, unexec.c, unexhp9k800.c, unexmips.c, unicode.c, window.c: new -> new_.
'foo -> `foo'.
lwlib-internal.h: redo assert macros to follow lisp.h and not trigger warnings.
lwlib.c, xlwtabs.c: new -> new_.
author | ben |
---|---|
date | Tue, 25 Oct 2005 11:16:49 +0000 |
parents | 04bc9d2f42c7 |
children | ad2f4ae9895b |
comparison
equal
deleted
inserted
replaced
3024:b7f26b2f78bd | 3025:facf3239ba30 |
---|---|
236 static void TabsAllocGreyGC() ; | 236 static void TabsAllocGreyGC() ; |
237 | 237 |
238 #else | 238 #else |
239 | 239 |
240 static void TabsClassInit(void) ; | 240 static void TabsClassInit(void) ; |
241 static void TabsInit( Widget req, Widget new, ArgList, Cardinal *nargs) ; | 241 static void TabsInit( Widget req, Widget new_, ArgList, Cardinal *nargs) ; |
242 static void TabsConstraintInitialize(Widget, Widget, ArgList, Cardinal *) ; | 242 static void TabsConstraintInitialize(Widget, Widget, ArgList, Cardinal *) ; |
243 static void TabsRealize(Widget, Mask *, XSetWindowAttributes *) ; | 243 static void TabsRealize(Widget, Mask *, XSetWindowAttributes *) ; |
244 static void TabsDestroy( Widget w) ; | 244 static void TabsDestroy( Widget w) ; |
245 static void TabsResize( Widget w) ; | 245 static void TabsResize( Widget w) ; |
246 static void TabsExpose( Widget w, XEvent *event, Region region) ; | 246 static void TabsExpose( Widget w, XEvent *event, Region region) ; |
419 * and optionally compute size of widget. */ | 419 * and optionally compute size of widget. */ |
420 | 420 |
421 /* ARGSUSED */ | 421 /* ARGSUSED */ |
422 | 422 |
423 static void | 423 static void |
424 TabsInit(Widget request, Widget new, ArgList UNUSED (args), | 424 TabsInit(Widget request, Widget new_, ArgList UNUSED (args), |
425 Cardinal *UNUSED (num_args)) | 425 Cardinal *UNUSED (num_args)) |
426 { | 426 { |
427 TabsWidget newTw = (TabsWidget)new; | 427 TabsWidget newTw = (TabsWidget)new_; |
428 | 428 |
429 newTw->tabs.numRows = 0 ; | 429 newTw->tabs.numRows = 0 ; |
430 newTw->tabs.realRows = 0; | 430 newTw->tabs.realRows = 0; |
431 | 431 |
432 GetPreferredSizes(newTw) ; | 432 GetPreferredSizes(newTw) ; |
446 | 446 |
447 if( request->core.width == 0 || request->core.height == 0 ) | 447 if( request->core.width == 0 || request->core.height == 0 ) |
448 { | 448 { |
449 Dimension w,h ; | 449 Dimension w,h ; |
450 PreferredSize(newTw, &w, &h, NULL,NULL) ; | 450 PreferredSize(newTw, &w, &h, NULL,NULL) ; |
451 if( request->core.width == 0 ) new->core.width = w ; | 451 if( request->core.width == 0 ) new_->core.width = w ; |
452 if( request->core.height == 0 ) new->core.height = h ; | 452 if( request->core.height == 0 ) new_->core.height = h ; |
453 XtClass(new)->core_class.resize(new) ; | 453 XtClass(new_)->core_class.resize(new_) ; |
454 } | 454 } |
455 | 455 |
456 /* defer GC allocation, etc., until Realize() time. */ | 456 /* defer GC allocation, etc., until Realize() time. */ |
457 newTw->tabs.foregroundGC = | 457 newTw->tabs.foregroundGC = |
458 newTw->tabs.backgroundGC = | 458 newTw->tabs.backgroundGC = |
476 /* Init the constraint part of a new tab child. Compute the | 476 /* Init the constraint part of a new tab child. Compute the |
477 * size of the tab. | 477 * size of the tab. |
478 */ | 478 */ |
479 /* ARGSUSED */ | 479 /* ARGSUSED */ |
480 static void | 480 static void |
481 TabsConstraintInitialize(Widget UNUSED (request), Widget new, | 481 TabsConstraintInitialize(Widget UNUSED (request), Widget new_, |
482 ArgList UNUSED (args), Cardinal *UNUSED (num_args)) | 482 ArgList UNUSED (args), Cardinal *UNUSED (num_args)) |
483 { | 483 { |
484 TabsConstraints tab = (TabsConstraints) new->core.constraints ; | 484 TabsConstraints tab = (TabsConstraints) new_->core.constraints ; |
485 tab->tabs.greyAlloc = False ; /* defer allocation of pixel */ | 485 tab->tabs.greyAlloc = False ; /* defer allocation of pixel */ |
486 tab->tabs.visible = False ; | 486 tab->tabs.visible = False ; |
487 | 487 |
488 getBitmapInfo((TabsWidget)XtParent(new), tab) ; | 488 getBitmapInfo((TabsWidget)XtParent(new_), tab) ; |
489 TabWidth(new) ; | 489 TabWidth(new_) ; |
490 } | 490 } |
491 | 491 |
492 | 492 |
493 | 493 |
494 /* Called when tabs widget first realized. Create the window | 494 /* Called when tabs widget first realized. Create the window |
603 | 603 |
604 /* Called when any Tabs widget resources are changed. */ | 604 /* Called when any Tabs widget resources are changed. */ |
605 | 605 |
606 /* ARGSUSED */ | 606 /* ARGSUSED */ |
607 static Boolean | 607 static Boolean |
608 TabsSetValues(Widget current, Widget UNUSED (request), Widget new, | 608 TabsSetValues(Widget current, Widget UNUSED (request), Widget new_, |
609 ArgList UNUSED (args), Cardinal *UNUSED (num_args)) | 609 ArgList UNUSED (args), Cardinal *UNUSED (num_args)) |
610 { | 610 { |
611 TabsWidget curtw = (TabsWidget) current ; | 611 TabsWidget curtw = (TabsWidget) current ; |
612 TabsWidget tw = (TabsWidget) new ; | 612 TabsWidget tw = (TabsWidget) new_ ; |
613 Boolean needRedraw = False ; | 613 Boolean needRedraw = False ; |
614 Widget *childP ; | 614 Widget *childP ; |
615 int i ; | 615 int i ; |
616 | 616 |
617 | 617 |
639 /* TODO: if any color changes, need to recompute GCs and redraw */ | 639 /* TODO: if any color changes, need to recompute GCs and redraw */ |
640 | 640 |
641 if( tw->core.background_pixel != curtw->core.background_pixel || | 641 if( tw->core.background_pixel != curtw->core.background_pixel || |
642 tw->core.background_pixmap != curtw->core.background_pixmap || | 642 tw->core.background_pixmap != curtw->core.background_pixmap || |
643 tw->tabs.font != curtw->tabs.font ) | 643 tw->tabs.font != curtw->tabs.font ) |
644 if( XtIsRealized(new) ) | 644 if( XtIsRealized(new_) ) |
645 { | 645 { |
646 TabsFreeGCs(tw) ; | 646 TabsFreeGCs(tw) ; |
647 TabsAllocGCs(tw) ; | 647 TabsAllocGCs(tw) ; |
648 needRedraw = True ; | 648 needRedraw = True ; |
649 } | 649 } |
683 | 683 |
684 /* Called when any child constraint resources change. */ | 684 /* Called when any child constraint resources change. */ |
685 | 685 |
686 /* ARGSUSED */ | 686 /* ARGSUSED */ |
687 static Boolean | 687 static Boolean |
688 TabsConstraintSetValues(Widget current, Widget UNUSED (request), Widget new, | 688 TabsConstraintSetValues(Widget current, Widget UNUSED (request), Widget new_, |
689 ArgList UNUSED (args), Cardinal *UNUSED (num_args)) | 689 ArgList UNUSED (args), Cardinal *UNUSED (num_args)) |
690 { | 690 { |
691 TabsWidget tw = (TabsWidget) XtParent(new) ; | 691 TabsWidget tw = (TabsWidget) XtParent(new_) ; |
692 TabsConstraints ctab = (TabsConstraints) current->core.constraints ; | 692 TabsConstraints ctab = (TabsConstraints) current->core.constraints ; |
693 TabsConstraints tab = (TabsConstraints) new->core.constraints ; | 693 TabsConstraints tab = (TabsConstraints) new_->core.constraints ; |
694 | 694 |
695 | 695 |
696 /* if label changes, need to re-layout the entire widget */ | 696 /* if label changes, need to re-layout the entire widget */ |
697 /* if foreground changes, need to redraw tab label */ | 697 /* if foreground changes, need to redraw tab label */ |
698 | 698 |
701 */ | 701 */ |
702 | 702 |
703 if( tab->tabs.label != ctab->tabs.label || /* Tab size has changed. */ | 703 if( tab->tabs.label != ctab->tabs.label || /* Tab size has changed. */ |
704 tab->tabs.left_bitmap != ctab->tabs.left_bitmap ) | 704 tab->tabs.left_bitmap != ctab->tabs.left_bitmap ) |
705 { | 705 { |
706 TabWidth(new) ; | 706 TabWidth(new_) ; |
707 tw->tabs.needs_layout = True ; | 707 tw->tabs.needs_layout = True ; |
708 | 708 |
709 if( tab->tabs.left_bitmap != ctab->tabs.left_bitmap ) | 709 if( tab->tabs.left_bitmap != ctab->tabs.left_bitmap ) |
710 getBitmapInfo(tw, tab) ; | 710 getBitmapInfo(tw, tab) ; |
711 | 711 |
720 | 720 |
721 /* The child widget itself never needs a redisplay, but the parent | 721 /* The child widget itself never needs a redisplay, but the parent |
722 * Tabs widget might. | 722 * Tabs widget might. |
723 */ | 723 */ |
724 | 724 |
725 if( XtIsRealized(new) ) | 725 if( XtIsRealized(new_) ) |
726 { | 726 { |
727 if( tw->tabs.needs_layout ) { | 727 if( tw->tabs.needs_layout ) { |
728 XClearWindow(XtDisplay((Widget)tw), XtWindow((Widget)tw)) ; | 728 XClearWindow(XtDisplay((Widget)tw), XtWindow((Widget)tw)) ; |
729 XtClass(tw)->core_class.expose((Widget)tw,NULL,None) ; | 729 XtClass(tw)->core_class.expose((Widget)tw,NULL,None) ; |
730 } | 730 } |
731 | 731 |
732 else if( tab->tabs.foreground != ctab->tabs.foreground ) | 732 else if( tab->tabs.foreground != ctab->tabs.foreground ) |
733 DrawTab(tw, new, True) ; | 733 DrawTab(tw, new_, True) ; |
734 } | 734 } |
735 | 735 |
736 return False ; | 736 return False ; |
737 } | 737 } |
738 | 738 |