Constructs a new printer representing the default printer. <p> You must dispose the printer when it is no longer required. </p>
Constructs a new printer given a <code>PrinterData</code> object representing the desired printer. <p> You must dispose the printer when it is no longer required. </p>
Cancels a print job in progress.
Given a <em>client area</em> (as described by the arguments), returns a rectangle, relative to the client area's coordinates, that is the client area expanded by the printer's trim (or minimum margins). <p> Most printers have a minimum margin on each edge of the paper where the printer device is unable to print. This margin is known as the "trim." This method can be used to calculate the printer's minimum margins by passing in a client area of 0, 0, 0, 0 and then using the resulting x and y coordinates (which will be <= 0) to determine the minimum margins for the top and left edges of the paper, and the resulting width and height (offset by the resulting x and y) to determine the minimum margins for the bottom and right edges of the paper, as follows: <ul> <li>The left trim width is -x pixels</li> <li>The top trim height is -y pixels</li> <li>The right trim width is (x + width) pixels</li> <li>The bottom trim height is (y + height) pixels</li> </ul> </p>
Creates the printer handle. This method is called internally by the instance creation mechanism of the <code>Device</code> class. @param deviceData the device data
Destroys the printer handle. This method is called internally by the dispose mechanism of the <code>Device</code> class.
Ends the current print job.
Ends the current page.
Returns a rectangle describing the receiver's size and location. <p> For a printer, this is the size of the physical page, in pixels. </p>
Returns a rectangle which describes the area of the receiver which is capable of displaying data. <p> For a printer, this is the size of the printable area of the page, in pixels. </p>
Returns a point whose x coordinate is the horizontal dots per inch of the printer, and whose y coordinate is the vertical dots per inch of the printer.
Returns a <code>PrinterData</code> object representing the target printer for this print job.
Returns a reasonable font for applications to use. On some platforms, this will match the "default font" or "system font" if such can be found. This font should not be free'd because it was allocated by the system, not the application. <p> Typically, applications which want the default look should simply not set the font on the widgets they create. Widgets are always created with the correct default font for the class of user-interface component they represent. </p>
Initializes any internal resources needed by the device. <p> This method is called after <code>create</code>. </p><p> If subclasses reimplement this method, they must call the <code>super</code> implementation. </p>
Invokes platform specific functionality to dispose a GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Printer</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>
Invokes platform specific functionality to allocate a new GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Printer</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>
Releases any internal state prior to destroying this printer. This method is called internally by the dispose mechanism of the <code>Device</code> class.
Starts a print job and returns true if the job started successfully and false otherwise. <p> This must be the first method called to initiate a print job, followed by any number of startPage/endPage calls, followed by endJob. Calling startPage, endPage, or endJob before startJob will result in undefined behavior. </p>
Starts a page and returns true if the page started successfully and false otherwise. <p> After calling startJob, this method may be called any number of times along with a matching endPage. </p>
Returns a <code>PrinterData</code> object representing the default printer or <code>null</code> if there is no printer available on the System.
Returns an array of <code>PrinterData</code> objects representing all available printers.
whether or not a GC was created for this printer
the handle to the X Display (Warning: This field is platform dependent) <p> <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT public API. It is marked protected only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code. </p>
Throws an <code>SWTException</code> if the receiver can not be accessed by the caller. This may include both checks on the state of the receiver and more generally on the entire execution context. This method <em>should</em> be called by device implementors to enforce the standard SWT invariants. <p> Currently, it is an error to invoke any method (other than <code>isDisposed()</code> and <code>dispose()</code>) on a device that has had its <code>dispose()</code> method called. </p><p> In future releases of SWT, there may be more or fewer error checks and exceptions may be thrown for different reasons. <p>
Creates the device in the operating system. If the device does not have a handle, this method may do nothing depending on the device. <p> This method is called before <code>init</code>. </p><p> Subclasses are supposed to reimplement this method and not call the <code>super</code> implementation. </p>
Disposes of the operating system resources associated with the receiver. After this method has been invoked, the receiver will answer <code>true</code> when sent the message <code>isDisposed()</code>.
Destroys the device in the operating system and releases the device's handle. If the device does not have a handle, this method may do nothing depending on the device. <p> This method is called after <code>release</code>. </p><p> Subclasses are supposed to reimplement this method and not call the <code>super</code> implementation. </p>
Returns a rectangle describing the receiver's size and location.
Returns a <code>DeviceData</code> based on the receiver. Modifications made to this <code>DeviceData</code> will not affect the receiver.
Returns a rectangle which describes the area of the receiver which is capable of displaying data.
Returns the bit depth of the screen, which is the number of bits it takes to represent the number of unique colors that the screen is currently capable of displaying. This number will typically be one of 1, 8, 15, 16, 24 or 32.
Returns a point whose x coordinate is the horizontal dots per inch of the display, and whose y coordinate is the vertical dots per inch of the display.
Returns <code>FontData</code> objects which describe the fonts that match the given arguments. If the <code>faceName</code> is null, all fonts will be returned.
Returns the matching standard color for the given constant, which should be one of the color constants specified in class <code>SWT</code>. Any value other than one of the SWT color constants which is passed in will result in the color black. This color should not be freed because it was allocated by the system, not the application.
Returns a reasonable font for applications to use. On some platforms, this will match the "default font" or "system font" if such can be found. This font should not be freed because it was allocated by the system, not the application. <p> Typically, applications which want the default look should simply not set the font on the widgets they create. Widgets are always created with the correct default font for the class of user-interface component they represent. </p>
Returns <code>true</code> if the underlying window system prints out warning messages on the console, and <code>setWarnings</code> had previously been called with <code>true</code>.
Initializes any internal resources needed by the device. <p> This method is called after <code>create</code>. </p><p> If subclasses reimplement this method, they must call the <code>super</code> implementation. </p>
Invokes platform specific functionality to allocate a new GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Device</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>
Invokes platform specific functionality to dispose a GC handle. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Device</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p>
Returns <code>true</code> if the device has been disposed, and <code>false</code> otherwise. <p> This method gets the dispose state for the device. When a device has been disposed, it is an error to invoke any other method using the device.
Loads the font specified by a file. The font will be present in the list of fonts available to the application.
Releases any internal resources back to the operating system and clears all fields except the device handle. <p> When a device is destroyed, resources that were acquired on behalf of the programmer need to be returned to the operating system. For example, if the device allocated a font to be used as the system font, this font would be freed in <code>release</code>. Also,to assist the garbage collector and minimize the amount of memory that is not reclaimed when the programmer keeps a reference to a disposed device, all fields except the handle are zero'd. The handle is needed by <code>destroy</code>. </p> This method is called before <code>destroy</code>. </p><p> If subclasses reimplement this method, they must call the <code>super</code> implementation. </p>
If the underlying window system supports printing warning messages to the console, setting warnings to <code>false</code> prevents these messages from being printed. If the argument is <code>true</code> then message printing is not blocked.
Instances of this class are used to print to a printer. Applications create a GC on a printer using <code>new GC(printer)</code> and then draw on the printer GC using the usual graphics calls. <p> A <code>Printer</code> object may be constructed by providing a <code>PrinterData</code> object which identifies the printer. A <code>PrintDialog</code> presents a print dialog to the user and returns an initialized instance of <code>PrinterData</code>. Alternatively, calling <code>new Printer()</code> will construct a printer object for the user's default printer. </p><p> Application code must explicitly invoke the <code>Printer.dispose()</code> method to release the operating system resources managed by each instance when those instances are no longer required. </p>
@see PrinterData @see PrintDialog @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>