Lines Matching defs:pw

91 #define ForAllPanes(pw, childP) \
92 for ( (childP) = (pw)->composite.children ; \
93 (childP) < (pw)->composite.children + (pw)->paned.num_panes ; \
96 #define ForAllChildren(pw, childP) \
97 for ( (childP) = (pw)->composite.children ; \
98 (childP) < (pw)->composite.children + (pw)->composite.num_children ; \
276 * Arguments: pw - the paned widget to adjust.
285 AdjustPanedSize(pw, off_size, result_ret, on_size_ret, off_size_ret)
286 PanedWidget pw;
291 Dimension old_size = PaneSize( (Widget) pw, IsVert(pw));
297 ForAllPanes(pw, childP) {
300 newsize += size + pw->paned.internal_bw;
302 newsize -= pw->paned.internal_bw;
306 if ( IsVert(pw) ) {
318 *result_ret = XtMakeGeometryRequest( (Widget) pw, &request, &reply );
319 _XawImCallVendorShellExtResize( (Widget) pw );
327 *on_size_ret = GetRequestInfo( &request, IsVert(pw) );
328 *off_size_ret = GetRequestInfo( &request, !IsVert(pw) );
331 *on_size_ret = GetRequestInfo( &reply, IsVert(pw) );
332 *off_size_ret = GetRequestInfo( &reply, !IsVert(pw) );
338 if (XtMakeGeometryRequest( (Widget) pw,
340 XtMakeGeometryRequest( (Widget) pw, &reply, &request);
396 * Arguments: pw - the paned widget.
404 ChoosePaneToResize(pw, paneindex, dir, shrink)
405 PanedWidget pw;
417 _index = pw->paned.num_panes - 1; /* Start the last pane, and work
420 childP = pw->composite.children + _index;
445 if ( (childP - pw->composite.children < 0) ||
446 (childP - pw->composite.children >= (long)pw->paned.num_panes) ) {
449 childP = pw->composite.children + _index;
504 * Arguments: pw - the paned widget.
513 LoopAndRefigureChildren(pw, paneindex, dir, sizeused)
514 PanedWidget pw;
518 int pane_size = (int) PaneSize( (Widget) pw, IsVert(pw));
534 GetPaneStack(pw, shrink, &pane, &start_size);
536 pane = ChoosePaneToResize(pw, paneindex, dir, shrink);
542 PushPaneStack(pw, pane);
560 if (pane->size == start_size) (void) PopPaneStack(pw);
579 * Arguments: pw - the paned widget.
594 RefigureLocations(pw, paneindex, dir)
595 PanedWidget pw;
600 int pane_size = (int) PaneSize( (Widget) pw, IsVert(pw) );
604 if (pw->paned.num_panes == 0 || !pw->paned.refiguremode) return;
610 ForAllPanes(pw, childP) {
614 sizeused += (int) pane->size + (int) pw->paned.internal_bw;
616 sizeused -= (int) pw->paned.internal_bw;
619 LoopAndRefigureChildren(pw, paneindex, dir, &sizeused);
628 Pane pane = PaneInfo(*(pw->composite.children + paneindex));
644 ForAllPanes(pw, childP) {
646 loc += PaneInfo(*childP)->size + pw->paned.internal_bw;
652 * Arguments: pw - the paned widget.
657 CommitNewLocations(pw)
658 PanedWidget pw;
665 ForAllPanes(pw, childP) {
669 if (IsVert(pw)) {
671 XtResizeWidget(*childP, pw->core.width, (Dimension) pane->size,
675 changes.x = pw->core.width - pw->paned.grip_indent -
679 pw->paned.internal_bw/2;
684 XtResizeWidget(*childP, (Dimension) pane->size, pw->core.height,
691 pw->paned.internal_bw/2;
692 changes.y = pw->core.height - pw->paned.grip_indent -
711 ClearPaneStack(pw);
717 * Arguments: pw - the paned widget.
732 PanedWidget pw = (PanedWidget) w;
733 if (pw->paned.refiguremode && XtIsRealized( (Widget) pw) &&
734 pw->paned.num_panes > 0 ) {
735 RefigureLocations(pw, NO_INDEX, AnyPane);
736 CommitNewLocations(pw);
742 * Arguments: pw - the paned widget.
750 _DrawRect(pw, gc, on_loc, off_loc, on_size, off_size)
751 PanedWidget pw;
756 if (IsVert(pw))
757 XFillRectangle(XtDisplay(pw), XtWindow(pw), gc,
760 XFillRectangle(XtDisplay(pw), XtWindow(pw), gc,
766 * Arguments: pw - the paned widget.
772 _DrawInternalBorders(pw, gc)
773 PanedWidget pw;
785 if (pw->core.background_pixel == pw->paned.internal_bp)
789 off_size = (unsigned int) PaneSize( (Widget) pw, !IsVert(pw) );
790 on_size = (unsigned int) pw->paned.internal_bw;
792 ForAllPanes(pw, childP) {
793 on_loc = IsVert(pw) ? (*childP)->core.y : (*childP)->core.x;
796 _DrawRect( pw, gc, on_loc, off_loc, on_size, off_size);
804 #define DrawInternalBorders(pw) _DrawInternalBorders((pw), (pw)->paned.normgc);
805 #define EraseInternalBorders(pw) _DrawInternalBorders((pw), (pw)->paned.invgc);
810 * Arguments: pw - the Paned widget.
817 _DrawTrackLines(pw, erase)
818 PanedWidget pw;
827 off_size = PaneSize( (Widget) pw, !IsVert(pw));
829 ForAllPanes(pw, childP) {
832 on_size = pw->paned.internal_bw;
836 _DrawRect( pw, pw->paned.flipgc,
842 _DrawRect(pw, pw->paned.flipgc,
854 #define DrawTrackLines(pw) _DrawTrackLines((pw), FALSE);
855 #define EraseTrackLines(pw) _DrawTrackLines((pw), TRUE);
859 * Arguments: pw - the paned widget.
865 GetEventLocation(pw, event)
866 PanedWidget pw;
887 x = pw->paned.start_loc;
888 y = pw->paned.start_loc;
890 if (IsVert(pw))
897 * Arguments: pw - the paned widget.
904 StartGripAdjustment(pw, grip, dir)
905 PanedWidget pw;
912 pw->paned.whichadd = pw->paned.whichsub = (Widget) NULL;
915 pw->paned.whichadd = pw->composite.children[PaneIndex(grip)];
917 pw->paned.whichsub = pw->composite.children[PaneIndex(grip) + 1];
924 if ( IsVert(pw) ) {
926 cursor = pw->paned.adjust_upper_cursor;
928 cursor = pw->paned.adjust_lower_cursor;
930 if ( pw->paned.adjust_this_cursor == None)
931 cursor = pw->paned.v_adjust_this_cursor;
933 cursor = pw->paned.adjust_this_cursor;
938 cursor = pw->paned.adjust_left_cursor;
940 cursor = pw->paned.adjust_right_cursor;
942 if (pw->paned.adjust_this_cursor == None)
943 cursor = pw->paned.h_adjust_this_cursor;
945 cursor = pw->paned.adjust_this_cursor;
952 EraseInternalBorders(pw);
953 ForAllPanes(pw, childP)
959 * Arguments: pw - the paned widget.
968 MoveGripAdjustment(pw, grip, dir, loc)
969 PanedWidget pw;
976 diff = loc - pw->paned.start_loc;
978 if (pw->paned.whichadd)
979 add_size = PaneSize(pw->paned.whichadd, IsVert(pw) ) + diff;
981 if (pw->paned.whichsub)
982 sub_size = PaneSize(pw->paned.whichsub, IsVert(pw) ) - diff;
992 AssignMax(add_size, (int) PaneInfo(pw->paned.whichadd)->min);
993 AssignMin(add_size, (int) PaneInfo(pw->paned.whichadd)->max);
998 AssignMax(sub_size, (int) PaneInfo(pw->paned.whichsub)->min);
999 AssignMin(sub_size, (int) PaneInfo(pw->paned.whichsub)->max);
1004 PaneInfo(pw->paned.whichadd)->size = add_size;
1006 PaneInfo(pw->paned.whichsub)->size = sub_size;
1007 RefigureLocations(pw, PaneIndex(grip), dir);
1008 DrawTrackLines(pw);
1013 * Arguments: pw - the paned widget.
1018 CommitGripAdjustment(pw)
1019 PanedWidget pw;
1021 EraseTrackLines(pw);
1022 CommitNewLocations(pw);
1023 DrawInternalBorders(pw);
1029 if (pw->paned.whichadd) {
1030 Pane pane = PaneInfo(pw->paned.whichadd);
1033 if (pw->paned.whichsub) {
1034 Pane pane = PaneInfo(pw->paned.whichsub);
1054 PanedWidget pw = (PanedWidget) XtParent(grip);
1070 loc = GetEventLocation(pw, (XEvent *) (call_data->event));
1081 pw->paned.resize_children_to_pref = FALSE;
1082 StartGripAdjustment(pw, grip, direction);
1083 pw->paned.start_loc = loc;
1087 MoveGripAdjustment(pw, grip, direction, loc);
1094 CommitGripAdjustment(pw);
1105 * Arguments: pw - the paned widget.
1110 ResortChildren(pw)
1111 PanedWidget pw;
1116 ForAllChildren(pw, childP) {
1142 * Arguments: pw - the paned widget.
1147 ManageAndUnmanageGrips(pw)
1148 PanedWidget pw;
1154 alloc_size = (Cardinal) sizeof(Widget) * pw->composite.num_children / 2;
1158 ForAllChildren(pw, childP)
1188 PanedWidget pw = (PanedWidget) XtParent(child);
1193 XtSetArg(arglist[num_args], XtNtranslations, pw->paned.grip_translations);
1195 if ( (cursor = pw->paned.grip_cursor) == None )
1196 if (IsVert(pw))
1197 cursor = pw->paned.v_grip_cursor;
1199 cursor = pw->paned.h_grip_cursor;
1203 PaneInfo(child)->grip = XtCreateWidget("grip", gripWidgetClass, (Widget)pw,
1220 PanedWidget pw = (PanedWidget) w;
1228 values.foreground = pw->paned.internal_bp;
1230 pw->paned.normgc = XtGetGC(w, valuemask, &values);
1236 values.foreground = pw->core.background_pixel;
1238 pw->paned.invgc = XtGetGC(w, valuemask, &values);
1245 values.plane_mask = pw->paned.internal_bp ^ pw->core.background_pixel;
1248 pw->paned.flipgc = XtGetGC(w, valuemask, &values);
1253 * Arguments: pw - the paned widget.
1258 SetChildrenPrefSizes(pw, off_size)
1259 PanedWidget pw;
1263 Boolean vert = IsVert(pw);
1266 ForAllPanes(pw, childP)
1267 if ( pw->paned.resize_children_to_pref ||
1297 * Arguments: pw - the paned widget.
1302 ChangeAllGripCursors(pw)
1303 PanedWidget pw;
1307 ForAllPanes(pw, childP) {
1311 if ( (cursor = pw->paned.grip_cursor) == None )
1312 if ( IsVert(pw) )
1313 cursor = pw->paned.v_grip_cursor;
1315 cursor = pw->paned.h_grip_cursor;
1332 * Arguments: pw - the paned widget.
1338 PushPaneStack(pw, pane)
1339 PanedWidget pw;
1344 stack->next = pw->paned.stack;
1348 pw->paned.stack = stack;
1353 * Arguments: pw - the paned widget.
1362 GetPaneStack(pw, shrink, pane, start_size)
1363 PanedWidget pw;
1368 if (pw->paned.stack == NULL) {
1373 *pane = pw->paned.stack->pane;
1374 *start_size = pw->paned.stack->start_size;
1381 * Arguments: pw - the paned widget.
1386 PopPaneStack(pw)
1387 PanedWidget pw;
1389 PaneStack * stack = pw->paned.stack;
1393 pw->paned.stack = stack->next;
1396 if (pw->paned.stack == NULL) return(FALSE);
1402 * Arguments: pw - the paned widget.
1407 ClearPaneStack(pw)
1408 PanedWidget pw;
1410 while(PopPaneStack(pw));
1451 PanedWidget pw = (PanedWidget) XtParent(w);
1455 Boolean vert = IsVert(pw);
1469 if ( (XtIsRealized((Widget)pw) && !pane->allow_resize) ||
1476 old_paned_size = PaneSize( (Widget) pw, vert);
1482 AdjustPanedSize(pw, PaneSize((Widget) pw, !vert), &result, &on_size,
1492 pw->core.height = on_size;
1494 pw->core.width = on_size;
1496 RefigureLocations(pw, PaneIndex(w), AnyPane);
1503 pw->core.height = old_paned_size;
1508 pw->core.width = old_paned_size;
1537 RefigureLocations(pw, PaneIndex(w), AnyPane);
1542 AdjustPanedSize(pw, PaneSize((Widget) pw, !vert),
1545 CommitNewLocations( pw ); /* layout already refigured. */
1556 PanedWidget pw = (PanedWidget)new;
1558 GetGCs( (Widget) pw);
1560 pw->paned.recursively_called = False;
1561 pw->paned.stack = NULL;
1562 pw->paned.resize_children_to_pref = TRUE;
1563 pw->paned.num_panes = 0;
1572 PanedWidget pw = (PanedWidget) w;
1575 if ((attributes->cursor = (pw)->paned.cursor) != None)
1585 ForAllPanes(pw, childP) {
1592 pw->paned.resize_children_to_pref = FALSE;
1599 PanedWidget pw = (PanedWidget)w;
1601 XtReleaseGC( w, pw->paned.normgc );
1602 XtReleaseGC( w, pw->paned.invgc );
1603 XtReleaseGC( w, pw->paned.flipgc );
1651 PanedWidget pw = (PanedWidget)w;
1652 Boolean vert = IsVert(pw);
1656 if (pw->paned.recursively_called++) return;
1662 if ( (size = PaneSize( (Widget) pw, !vert )) == 0) {
1664 ForAllChildren(pw, childP)
1669 ManageAndUnmanageGrips(pw);
1670 pw->paned.recursively_called = False;
1671 ResortChildren(pw);
1673 pw->paned.num_panes = 0;
1674 ForAllChildren(pw, childP)
1679 PaneInfo(pane->grip)->position = pw->paned.num_panes;
1680 pane->position = pw->paned.num_panes; /*TEMPORY -CDP 3/89 */
1681 pw->paned.num_panes++;
1692 if ( PaneSize((Widget) pw, vert) == 0 )
1693 AdjustPanedSize(pw, size, (XtGeometryResult *)NULL,
1696 if (XtIsRealized( (Widget) pw))
1697 RefigureLocationsAndCommit( (Widget) pw);