From mint-bounce@lists.fishpool.fi  Mon Feb 21 22:34:41 2005
X-Original-To: fnaumann@mail.boerde.de
Delivered-To: fnaumann@mail.boerde.de
X-Envelope-From: Gerhard_Stoll@b.maus.de
X-Envelope-To: <mint@fishpool.com>
From: Gerhard_Stoll@b.maus.de (Gerhard Stoll)
To: mint@fishpool.com
Subject: [MiNT] gemlib: printer dialog function
Message-ID: <200502211950.p44728@b.maus.de>
Date: Mon, 21 Feb 2005 19:50:00 +0100
Organization: MAUS Berlin (+49-30-82701142)
X-Gateway: b3.maus.de gb1.1r 102698.1858
X-Gateway-Administrator: postmaster@b3.maus.de
Lines: 123
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-To: mint-bounce@lists.fishpool.fi
X-original-sender: Gerhard_Stoll@b.maus.de
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
X-Virus-Scanned: by amavisd-new at relay.boerde.de
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de
X-Spam-Status: No, hits=-0.8 tagged_above=-50.5 required=5.0 tests=AWL,
 BAYES_00
X-Spam-Level: 

Hello!

I import in the gemlib and tos.hyp four function with used from the printer
dialog of WDialog. Can someone check my work from the gemlib.

The function disable_nvdi_errors and enable_nvdi_errors are not in the gemlib,
because they change the NVDI cookie.

Gerhard



There is the original from Wilfried Behne:
-------------------------------cut-------------------------------
static DRV_INFO *v_create_driver_info( int16 handle, int16 driver_id )
{
  VDIPB pb;
  VDI_SMALL p;                    /* Paramterstruktur */
  int16 save_conf;

  init_vdi_pb( &pb, &p );         /* PB initialisieren */

  p.intin[0] = driver_id;

  p.contrl[0] = 180;
  p.contrl[1] = 0;
  p.contrl[3] = 1;
  p.contrl[5] = 0;
  p.contrl[6] = handle;

  p.contrl[2] = 0;
  p.contrl[4] = 0;

  save_conf = disable_nvdi_errors();
  vdi( &pb );
  enable_nvdi_errors( save_conf );

  if ( p.contrl[4] >= 2 )
    return(*(DRV_INFO **) &p.intout[0] );

  return( 0L );
}

static int16  v_delete_driver_info( int16 handle, DRV_INFO *drv_info )
{
  VDIPB pb;
  VDI_SMALL p;                              /* Paramterstruktur */

  init_vdi_pb( &pb, &p );                   /* PB initialisieren */

  *(DRV_INFO **) &p.intin[0] = drv_info;

  p.contrl[0] = 181;
  p.contrl[1] = 0;
  p.contrl[3] = 2;
  p.contrl[5] = 0;
  p.contrl[6] = handle;

  vdi( &pb );

  return( p.intout[0] );
}

static int16  v_read_default_settings( int16 handle, PRN_SETTINGS *settings )
{
  VDIPB pb;
  VDI_SMALL p;                              /* Paramterstruktur */
  int16 save_conf;

  init_vdi_pb( &pb, &p );                   /* PB initialisieren */

  *(PRN_SETTINGS **) &p.intin[0] = settings; 
  
  p.contrl[0] = 182;
  p.contrl[1] = 0;
  p.contrl[3] = 2;
  p.contrl[5] = 0;                          /* Unterfunktion 0 */
  p.contrl[6] = handle;

  p.contrl[2] = 0;
  p.contrl[4] = 0;

  save_conf = disable_nvdi_errors();
  vdi( &pb );
  enable_nvdi_errors( save_conf );

  if ( p.contrl[4] >= 1 )
    return( p.intout[0] );

  return( 0 );
}

static int16  v_write_default_settings( int16 handle, PRN_SETTINGS *settings )
{
  VDIPB pb;
  VDI_SMALL p;                              /* Paramterstruktur */
  int16 save_conf;

  init_vdi_pb( &pb, &p );                   /* PB initialisieren */

  *(PRN_SETTINGS **) &p.intin[0] = settings;

  p.contrl[0] = 182;
  p.contrl[1] = 0;
  p.contrl[3] = 2;
  p.contrl[5] = 1;                          /* Unterfunktion 1 */
  p.contrl[6] = handle;

  p.contrl[2] = 0;
  p.contrl[4] = 0;

  save_conf = disable_nvdi_errors();
  vdi( &pb );
  enable_nvdi_errors( save_conf );

  if ( p.contrl[4] >= 1 )
    return( p.intout[0] );

  return( 0 );
}

-------------------------------cut-------------------------------


