Lines Matching defs:pw

67 #define ForAllPanes(pw, childP) \
68 for ( (childP) = (pw)->composite.children ; \
69 (childP) < (pw)->composite.children + (pw)->paned.num_panes ; \
72 #define ForAllChildren(pw, childP) \
73 for ( (childP) = (pw)->composite.children ; \
74 (childP) < (pw)->composite.children + (pw)->composite.num_children ; \
252 * Arguments: pw - the paned widget to adjust.
261 AdjustPanedSize(pw, off_size, result_ret, on_size_ret, off_size_ret)
262 PanedWidget pw;
267 Dimension old_size = PaneSize( (Widget) pw, IsVert(pw));
273 ForAllPanes(pw, childP) {
276 newsize += size + pw->paned.internal_bw;
278 newsize -= pw->paned.internal_bw;
282 if ( IsVert(pw) ) {
294 *result_ret = XtMakeGeometryRequest( (Widget) pw, &request, &reply );
302 *on_size_ret = GetRequestInfo( &request, IsVert(pw) );
303 *off_size_ret = GetRequestInfo( &request, !IsVert(pw) );
306 *on_size_ret = GetRequestInfo( &reply, IsVert(pw) );
307 *off_size_ret = GetRequestInfo( &reply, !IsVert(pw) );
313 if (XtMakeGeometryRequest( (Widget) pw,
315 XtMakeGeometryRequest( (Widget) pw, &reply, &request);
371 * Arguments: pw - the paned widget.
379 ChoosePaneToResize(pw, index, dir, shrink)
380 PanedWidget pw;
392 _index = pw->paned.num_panes - 1; /* Start the last pane, and work
395 childP = pw->composite.children + _index;
418 if ( (childP - pw->composite.children < 0) ||
419 (childP - pw->composite.children >= pw->paned.num_panes) ) {
422 childP = pw->composite.children + _index;
477 * Arguments: pw - the paned widget.
486 LoopAndRefigureChildren(pw, index, dir, sizeused)
487 PanedWidget pw;
491 int pane_size = (int) PaneSize( (Widget) pw, IsVert(pw));
507 GetPaneStack(pw, shrink, &pane, &start_size);
509 pane = ChoosePaneToResize(pw, index, dir, shrink);
515 PushPaneStack(pw, pane);
533 if (pane->size == start_size) (void) PopPaneStack(pw);
552 * Arguments: pw - the paned widget.
567 RefigureLocations(pw, index, dir)
568 PanedWidget pw;
573 int pane_size = (int) PaneSize( (Widget) pw, IsVert(pw) );
577 if (pw->paned.num_panes == 0 || !pw->paned.refiguremode) return;
583 ForAllPanes(pw, childP) {
587 sizeused += (int) pane->size + (int) pw->paned.internal_bw;
589 sizeused -= (int) pw->paned.internal_bw;
592 LoopAndRefigureChildren(pw, index, dir, &sizeused);
601 Pane pane = PaneInfo(*(pw->composite.children + index));
617 ForAllPanes(pw, childP) {
619 loc += PaneInfo(*childP)->size + pw->paned.internal_bw;
625 * Arguments: pw - the paned widget.
630 CommitNewLocations(pw)
631 PanedWidget pw;
638 ForAllPanes(pw, childP) {
642 if (IsVert(pw)) {
644 XtResizeWidget(*childP, pw->core.width, (Dimension) pane->size,
648 changes.x = pw->core.width - pw->paned.grip_indent -
652 pw->paned.internal_bw/2;
657 XtResizeWidget(*childP, (Dimension) pane->size, pw->core.height,
664 pw->paned.internal_bw/2;
665 changes.y = pw->core.height - pw->paned.grip_indent -
684 ClearPaneStack(pw);
690 * Arguments: pw - the paned widget.
705 PanedWidget pw = (PanedWidget) w;
706 if (pw->paned.refiguremode && XtIsRealized( (Widget) pw) &&
707 pw->paned.num_panes > 0 ) {
708 RefigureLocations(pw, NO_INDEX, AnyPane);
709 CommitNewLocations(pw);
715 * Arguments: pw - the paned widget.
723 _DrawRect(pw, gc, on_loc, off_loc, on_size, off_size)
724 PanedWidget pw;
729 if (IsVert(pw))
730 XFillRectangle(XtDisplay(pw), XtWindow(pw), gc,
733 XFillRectangle(XtDisplay(pw), XtWindow(pw), gc,
739 * Arguments: pw - the paned widget.
745 _DrawInternalBorders(pw, gc)
746 PanedWidget pw;
758 if (pw->core.background_pixel == pw->paned.internal_bp)
762 off_size = (unsigned int) PaneSize( (Widget) pw, !IsVert(pw) );
763 on_size = (unsigned int) pw->paned.internal_bw;
765 ForAllPanes(pw, childP) {
766 on_loc = IsVert(pw) ? (*childP)->core.y : (*childP)->core.x;
769 _DrawRect( pw, gc, on_loc, off_loc, on_size, off_size);
777 #define DrawInternalBorders(pw) _DrawInternalBorders((pw), (pw)->paned.normgc);
778 #define EraseInternalBorders(pw) _DrawInternalBorders((pw), (pw)->paned.invgc);
783 * Arguments: pw - the Paned widget.
790 _DrawTrackLines(pw, erase)
791 PanedWidget pw;
800 off_size = PaneSize( (Widget) pw, !IsVert(pw));
802 ForAllPanes(pw, childP) {
805 on_size = pw->paned.internal_bw;
809 _DrawRect( pw, pw->paned.flipgc,
815 _DrawRect(pw, pw->paned.flipgc,
827 #define DrawTrackLines(pw) _DrawTrackLines((pw), FALSE);
828 #define EraseTrackLines(pw) _DrawTrackLines((pw), TRUE);
832 * Arguments: pw - the paned widget.
838 GetEventLocation(pw, event)
839 PanedWidget pw;
860 x = pw->paned.start_loc;
861 y = pw->paned.start_loc;
863 if (IsVert(pw))
870 * Arguments: pw - the paned widget.
877 StartGripAdjustment(pw, grip, dir)
878 PanedWidget pw;
885 pw->paned.whichadd = pw->paned.whichsub = (Widget) NULL;
888 pw->paned.whichadd = pw->composite.children[PaneIndex(grip)];
890 pw->paned.whichsub = pw->composite.children[PaneIndex(grip) + 1];
897 if ( IsVert(pw) ) {
899 cursor = pw->paned.adjust_upper_cursor;
901 cursor = pw->paned.adjust_lower_cursor;
903 if ( pw->paned.adjust_this_cursor == None)
904 cursor = pw->paned.v_adjust_this_cursor;
906 cursor = pw->paned.adjust_this_cursor;
911 cursor = pw->paned.adjust_left_cursor;
913 cursor = pw->paned.adjust_right_cursor;
915 if (pw->paned.adjust_this_cursor == None)
916 cursor = pw->paned.h_adjust_this_cursor;
918 cursor = pw->paned.adjust_this_cursor;
925 EraseInternalBorders(pw);
926 ForAllPanes(pw, childP)
932 * Arguments: pw - the paned widget.
941 MoveGripAdjustment(pw, grip, dir, loc)
942 PanedWidget pw;
949 diff = loc - pw->paned.start_loc;
951 if (pw->paned.whichadd)
952 add_size = PaneSize(pw->paned.whichadd, IsVert(pw) ) + diff;
954 if (pw->paned.whichsub)
955 sub_size = PaneSize(pw->paned.whichsub, IsVert(pw) ) - diff;
965 AssignMax(add_size, (int) PaneInfo(pw->paned.whichadd)->min);
966 AssignMin(add_size, (int) PaneInfo(pw->paned.whichadd)->max);
971 AssignMax(sub_size, (int) PaneInfo(pw->paned.whichsub)->min);
972 AssignMin(sub_size, (int) PaneInfo(pw->paned.whichsub)->max);
977 PaneInfo(pw->paned.whichadd)->size = add_size;
979 PaneInfo(pw->paned.whichsub)->size = sub_size;
980 RefigureLocations(pw, PaneIndex(grip), dir);
981 DrawTrackLines(pw);
986 * Arguments: pw - the paned widget.
990 CommitGripAdjustment(pw)
991 PanedWidget pw;
993 EraseTrackLines(pw);
994 CommitNewLocations(pw);
995 DrawInternalBorders(pw);
1001 if (pw->paned.whichadd) {
1002 Pane pane = PaneInfo(pw->paned.whichadd);
1005 if (pw->paned.whichsub) {
1006 Pane pane = PaneInfo(pw->paned.whichsub);
1026 PanedWidget pw = (PanedWidget) XtParent(grip);
1042 loc = GetEventLocation(pw, (XEvent *) (call_data->event));
1053 pw->paned.resize_children_to_pref = FALSE;
1054 StartGripAdjustment(pw, grip, direction);
1055 pw->paned.start_loc = loc;
1059 MoveGripAdjustment(pw, grip, direction, loc);
1066 CommitGripAdjustment(pw);
1077 * Arguments: pw - the paned widget.
1082 ResortChildren(pw)
1083 PanedWidget pw;
1088 ForAllChildren(pw, childP) {
1114 * Arguments: pw - the paned widget.
1119 ManageAndUnmanageGrips(pw)
1120 PanedWidget pw;
1126 alloc_size = (Cardinal) sizeof(Widget) * pw->composite.num_children / 2;
1130 ForAllChildren(pw, childP)
1160 PanedWidget pw = (PanedWidget) XtParent(child);
1165 XtSetArg(arglist[num_args], XtNtranslations, pw->paned.grip_translations);
1167 if ( (cursor = pw->paned.grip_cursor) == None )
1168 if (IsVert(pw))
1169 cursor = pw->paned.v_grip_cursor;
1171 cursor = pw->paned.h_grip_cursor;
1175 PaneInfo(child)->grip = XtCreateWidget("grip", gripWidgetClass, (Widget)pw,
1192 PanedWidget pw = (PanedWidget) w;
1200 values.foreground = pw->paned.internal_bp;
1202 pw->paned.normgc = XtGetGC(w, valuemask, &values);
1208 values.foreground = pw->core.background_pixel;
1210 pw->paned.invgc = XtGetGC(w, valuemask, &values);
1217 values.plane_mask = pw->paned.internal_bp ^ pw->core.background_pixel;
1220 pw->paned.flipgc = XtGetGC(w, valuemask, &values);
1225 * Arguments: pw - the paned widget.
1230 SetChildrenPrefSizes(pw, off_size)
1231 PanedWidget pw;
1235 Boolean vert = IsVert(pw);
1238 ForAllPanes(pw, childP)
1239 if ( pw->paned.resize_children_to_pref ||
1269 * Arguments: pw - the paned widget.
1274 ChangeAllGripCursors(pw)
1275 PanedWidget pw;
1279 ForAllPanes(pw, childP) {
1283 if ( (cursor = pw->paned.grip_cursor) == None )
1284 if ( IsVert(pw) )
1285 cursor = pw->paned.v_grip_cursor;
1287 cursor = pw->paned.h_grip_cursor;
1304 * Arguments: pw - the paned widget.
1310 PushPaneStack(pw, pane)
1311 PanedWidget pw;
1316 stack->next = pw->paned.stack;
1320 pw->paned.stack = stack;
1325 * Arguments: pw - the paned widget.
1334 GetPaneStack(pw, shrink, pane, start_size)
1335 PanedWidget pw;
1340 if (pw->paned.stack == NULL) {
1345 *pane = pw->paned.stack->pane;
1346 *start_size = pw->paned.stack->start_size;
1353 * Arguments: pw - the paned widget.
1358 PopPaneStack(pw)
1359 PanedWidget pw;
1361 PaneStack * stack = pw->paned.stack;
1365 pw->paned.stack = stack->next;
1368 if (pw->paned.stack == NULL) return(FALSE);
1374 * Arguments: pw - the paned widget.
1379 ClearPaneStack(pw)
1380 PanedWidget pw;
1382 while(PopPaneStack(pw));
1423 PanedWidget pw = (PanedWidget) XtParent(w);
1427 register Boolean vert = IsVert(pw);
1441 if ( (XtIsRealized((Widget)pw) && !pane->allow_resize) ||
1448 old_paned_size = PaneSize( (Widget) pw, vert);
1454 AdjustPanedSize(pw, PaneSize((Widget) pw, !vert), &result, &on_size,
1464 pw->core.height = on_size;
1466 pw->core.width = on_size;
1468 RefigureLocations(pw, PaneIndex(w), AnyPane);
1475 pw->core.height = old_paned_size;
1480 pw->core.width = old_paned_size;
1509 RefigureLocations(pw, PaneIndex(w), AnyPane);
1514 AdjustPanedSize(pw, PaneSize((Widget) pw, !vert), NULL, NULL, NULL);
1515 CommitNewLocations( pw ); /* layout already refigured. */
1524 PanedWidget pw = (PanedWidget)new;
1526 GetGCs( (Widget) pw);
1528 pw->paned.recursively_called = False;
1529 pw->paned.stack = NULL;
1530 pw->paned.resize_children_to_pref = TRUE;
1531 pw->paned.num_panes = 0;
1540 PanedWidget pw = (PanedWidget) w;
1543 if ((attributes->cursor = (pw)->paned.cursor) != None)
1553 ForAllPanes(pw, childP) {
1566 register PanedWidget pw = (PanedWidget)w;
1568 XtReleaseGC( w, pw->paned.normgc );
1569 XtReleaseGC( w, pw->paned.invgc );
1570 XtReleaseGC( w, pw->paned.flipgc );
1618 PanedWidget pw = (PanedWidget)w;
1619 Boolean vert = IsVert(pw);
1623 if (pw->paned.recursively_called++) return;
1629 if ( (size = PaneSize( (Widget) pw, !vert )) == 0) {
1631 ForAllChildren(pw, childP)
1636 ManageAndUnmanageGrips(pw);
1637 pw->paned.recursively_called = False;
1638 ResortChildren(pw);
1640 pw->paned.num_panes = 0;
1641 ForAllChildren(pw, childP)
1646 PaneInfo(pane->grip)->position = pw->paned.num_panes;
1647 pane->position = pw->paned.num_panes; /*TEMPORY -CDP 3/89 */
1648 pw->paned.num_panes++;
1659 if ( PaneSize((Widget) pw, vert) == 0 )
1660 AdjustPanedSize(pw, size, NULL, NULL, NULL);
1662 if (XtIsRealized( (Widget) pw))
1663 RefigureLocationsAndCommit( (Widget) pw);