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

« back to all changes in this revision

Viewing changes to drivers/tk.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: tk.c,v 1.87 2004/06/14 21:51:53 rlaboiss Exp $
 
1
/* $Id: tk.c,v 1.91 2005/04/27 06:43:48 rlaboiss Exp $
2
2
 *
3
3
 *      PLplot Tcl/Tk and Tcl-DP device drivers.
4
4
 *      Should be broken up somewhat better to allow use of DP w/o X.
24
24
 *
25
25
 * You should have received a copy of the GNU Library General Public License
26
26
 * along with PLplot; if not, write to the Free Software
27
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
27
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28
28
 */
29
29
 
30
30
/*
229
229
    pls->dev_fill1 = 1;         /* Handle pattern fills */
230
230
    pls->server_nokill = 1;     /* don't kill if ^C */
231
231
    pls->dev_xor = 1;           /* device support xor mode */
232
 
    pls->plbuf_write = 1;       /* Activate plot buffer. To
233
 
    programmatically save a file we can't call plreplot(), but instead
234
 
    one must send a command to plserver. As there is no API call for
235
 
    this, the user must use the plserver "save/print" menu
236
 
    entries. Activating the plot buffer enables the normal
237
 
    plmkstrm/plcpstrm/plreplot/plend1 way of saving plots. */
 
232
 
 
233
/* Activate plot buffer. To programmatically save a file we can't call
 
234
   plreplot(), but instead one must send a command to plserver. As there is
 
235
   no API call for this, the user must use the plserver "save/print" menu
 
236
   entries. Activating the plot buffer enables the normal
 
237
   plmkstrm/plcpstrm/plreplot/plend1 way of saving plots.
 
238
*/
 
239
    pls->plbuf_write = 1;
238
240
 
239
241
/* Specify buffer size if not yet set (can be changed by -bufmax option).  */
240
242
/* A small buffer works best for socket communication */
313
315
    tk_wr_header(pls, "");
314
316
 
315
317
/* Write color map state info */
316
 
/*
317
 
    plD_state_plm(pls, PLSTATE_CMAP0);
318
 
    plD_state_plm(pls, PLSTATE_CMAP1);
319
 
    */
 
318
    plD_state_tk(pls, PLSTATE_CMAP0);
 
319
    plD_state_tk(pls, PLSTATE_CMAP1);
320
320
 
321
321
/* Good place to make sure the data transfer is working OK */
322
322
 
471
471
        break;
472
472
 
473
473
    case PLSTATE_COLOR0:
474
 
        tk_wr( pdf_wr_1byte(pls->pdfs, (U_CHAR) pls->icol0) );
 
474
        tk_wr( pdf_wr_2bytes(pls->pdfs, (short) pls->icol0) );
 
475
 
475
476
        if (pls->icol0 == PL_RGB_COLOR) {
476
477
            tk_wr( pdf_wr_1byte(pls->pdfs, pls->curcolor.r) );
477
478
            tk_wr( pdf_wr_1byte(pls->pdfs, pls->curcolor.g) );
488
489
        break;
489
490
 
490
491
    case PLSTATE_CMAP0:
491
 
        tk_wr( pdf_wr_1byte(pls->pdfs, (U_CHAR) pls->ncol0) );
 
492
        tk_wr( pdf_wr_2bytes(pls->pdfs, (U_SHORT) pls->ncol0) );
492
493
        for (i = 0; i < pls->ncol0; i++) {
493
494
            tk_wr( pdf_wr_1byte(pls->pdfs, pls->cmap0[i].r) );
494
495
            tk_wr( pdf_wr_1byte(pls->pdfs, pls->cmap0[i].g) );