~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to bindings/tk/plframe.c

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: plframe.c,v 1.86 2004/06/14 21:51:52 rlaboiss Exp $
 
1
/* $Id: plframe.c,v 1.91 2005/04/27 06:43:22 rlaboiss Exp $
2
2
 
3
3
    Copyright 1993, 1994, 1995
4
4
    Maurice LeBrun                      mjl@dino.ph.utexas.edu
21
21
 
22
22
    You should have received a copy of the GNU Library General Public License
23
23
    along with PLplot; if not, write to the Free Software
24
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
24
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
25
 
26
26
 
27
27
    Based upon tkFrame.c from the TK 3.2 distribution:
47
47
#define DEBUG
48
48
*/
49
49
 
 
50
#define DEBUGx
 
51
 
50
52
#define NEED_PLDEBUG
51
53
#include "plserver.h"
52
54
#include "plxwd.h"
513
515
 
514
516
    dbug_enter("PlFrameWidgetCmd");
515
517
 
 
518
#ifdef DEBUG
 
519
    {
 
520
        int i;
 
521
        PLStream *pls;
 
522
        plgpls(pls);
 
523
        printf( "Current stream %d, frame stream %d\n",
 
524
                pls->ipls, plFramePtr->ipls );
 
525
        printf( "PlFrameWidgetCmd: " );
 
526
        for( i=0; i < argc; i++ )
 
527
            printf( " %s", argv[i] );
 
528
        printf( "\n" );
 
529
    }
 
530
#endif
 
531
 
516
532
    if (argc < 2) {
517
533
        Tcl_AppendResult(interp, "wrong # args: should be \"",
518
534
                argv[0], " option ?arg arg ...?\"", (char *) NULL);
522
538
    c = argv[1][0];
523
539
    length = strlen(argv[1]);
524
540
 
 
541
/* First, before anything else, we have to set the stream to be the one that
 
542
 * corresponds to this widget. */
 
543
    plsstrm( plFramePtr->ipls );
 
544
 
525
545
/* cmd -- issue a command to the PLplot library */
526
546
 
527
547
    if ((c == 'c') && (strncmp(argv[1], "cmd", length) == 0)) {
528
548
        result = Cmd(interp, plFramePtr, argc-2, argv+2);
529
549
    }
530
550
 
 
551
/* cget */
 
552
 
 
553
    else if ((c == 'c') && (strncmp(argv[1], "cget", length) == 0)) {
 
554
        if (argc > 2) {
 
555
            Tcl_AppendResult(interp, "wrong # args: should be \"",
 
556
                    argv[0], " cget <option>\"", (char *) NULL);
 
557
            result = TCL_ERROR;
 
558
            goto done;
 
559
        }
 
560
        else {
 
561
            result = Tk_ConfigureInfo(interp, plFramePtr->tkwin, configSpecs,
 
562
                    (char *) plFramePtr, (char *) NULL, 0);
 
563
        }
 
564
    }
 
565
 
531
566
/* configure */
532
567
 
533
568
    else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)) {
719
754
         "view, xscroll, or yscroll", (char *) NULL);
720
755
 
721
756
        result = TCL_ERROR;
 
757
#ifdef DEBUG
 
758
        printf( "bad option!\n" );
 
759
#endif
722
760
    }
723
761
 
 
762
#ifdef DEBUG
 
763
    printf( "result=%d current stream=%d\n", result, plsc->ipls );
 
764
#endif
 
765
 
724
766
 done:
725
767
    Tk_Release((ClientData) plFramePtr);
726
768
    return result;
1740
1782
    g = ((unsigned) (xcol.green & 0xFF00) >> 8) / 255.0;
1741
1783
    b = ((unsigned) (xcol.blue  & 0xFF00) >> 8) / 255.0;
1742
1784
 
1743
 
    plRGB_HLS(r, g, b, &h, &l, &s);
 
1785
    plrgbhls(r, g, b, &h, &l, &s);
1744
1786
 
1745
1787
    p = atof(pos) / 100.0;
1746
1788
    reverse = atoi(rev);
1851
1893
            l = pls->cmap1cp[i].l;
1852
1894
            s = pls->cmap1cp[i].s;
1853
1895
 
1854
 
            plHLS_RGB(h, l, s, &r, &g, &b);
 
1896
            plhlsrgb(h, l, s, &r, &g, &b);
1855
1897
 
1856
1898
            r1 = MAX(0, MIN(255, (int) (256. * r)));
1857
1899
            g1 = MAX(0, MIN(255, (int) (256. * g)));
1931
1973
        }
1932
1974
 
1933
1975
        if (changed) {
1934
 
            plsc->ncp1 = ncp1;
 
1976
            PLStream *pls = plFramePtr->pls;
 
1977
            pls->ncp1 = ncp1;
1935
1978
            plcmap1_calc();
1936
1979
        }
1937
1980
    }
2609
2652
 
2610
2653
    plsdev("plmeta");
2611
2654
    plsfile(sfile);
 
2655
/* FIXME: plmeta/plrender need to honor these, needed to preserve the aspect ratio */
 
2656
    plspage( 0., 0., plFramePtr->width, plFramePtr->height, 0, 0 );
2612
2657
    plcpstrm(plFramePtr->ipls, 0);
2613
2658
    pladv(0);
2614
2659
 
2736
2781
            return TCL_ERROR;
2737
2782
        }
2738
2783
        plsstrm(plFramePtr->ipls_save);
 
2784
    /* Note: many drivers ignore these, needed to preserve the aspect ratio */
 
2785
        plspage( 0., 0., plFramePtr->width, plFramePtr->height, 0, 0 );
2739
2786
        plcpstrm(plFramePtr->ipls, 0);
2740
2787
        pladv(0);
2741
2788
        plreplot();
2787
2834
 
2788
2835
        plsdev(argv[1]);
2789
2836
        plsfile(sfile);
 
2837
    /* Note: many drivers ignore these, needed to preserve the aspect ratio */
 
2838
        plspage( 0., 0., plFramePtr->width, plFramePtr->height, 0, 0 );
2790
2839
        plcpstrm(plFramePtr->ipls, 0);
2791
2840
        pladv(0);
2792
2841