From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dhruva Newsgroups: gmane.emacs.devel Subject: Re: w32 issues Date: Wed, 23 Jan 2008 08:43:39 +0530 Message-ID: References: <200801192020.m0JKKUWl017748@sallyv1.ics.uci.edu> <200801201755.m0KHtuDH003880@sallyv1.ics.uci.edu> <47938D58.4010809@gmail.com> <200801201820.m0KIKxtW012230@sallyv1.ics.uci.edu> <47939341.6010903@gmail.com> <4793C620.2000500@gnu.org> <47969AC2.80903@gnu.org> <4796A68E.6040305@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201058038 22433 80.91.229.12 (23 Jan 2008 03:13:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jan 2008 03:13:58 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org, Jason Rumney To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 23 04:14:16 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JHW46-0000PB-96 for ged-emacs-devel@m.gmane.org; Wed, 23 Jan 2008 04:14:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHW3g-000485-BC for ged-emacs-devel@m.gmane.org; Tue, 22 Jan 2008 22:13:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JHW3b-00044g-Jj for emacs-devel@gnu.org; Tue, 22 Jan 2008 22:13:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JHW3a-00042B-HB for emacs-devel@gnu.org; Tue, 22 Jan 2008 22:13:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHW3a-00041r-Ds for emacs-devel@gnu.org; Tue, 22 Jan 2008 22:13:42 -0500 Original-Received: from wa-out-1112.google.com ([209.85.146.181]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JHW3Z-0001gp-Vy for emacs-devel@gnu.org; Tue, 22 Jan 2008 22:13:42 -0500 Original-Received: by wa-out-1112.google.com with SMTP id k34so4764937wah.10 for ; Tue, 22 Jan 2008 19:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=tg0apuCkcvyKi1ATJbqcA80aFJLtEAHag+4o6c144+I=; b=Ov2UnB/VI+UBti3hBPLBzYtkL1W2Xfax5aY3IYVA5ST7Nj5BxVOvrpnIe7EQ0UYBHmJWoH0tUhma0T5zIR1rgT5QlXvGmMNRN0tNPXw0xAJ+UL7hRsCgXr5Rp5RuJFQXMp6w4QUctzWfnRjR9QbBxk/SwnDEAyammVL4cmlTJl0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qN5mWbggt6rspzVp/3HbzKqlxhbE+7j8rHYbf3VVadnTrmaWiyRikm+tSWhXOXWFbMC/KalBbxtPgOOIrQMDRpSATq3dgxCLzQsDJocUmRucerQxRrhy1p3Ty9QHUXhZBVUwLhRIVHtbOBKgoN9u/pDGQR9o2UT4G+/s3y5VsFA= Original-Received: by 10.114.130.1 with SMTP id c1mr7785552wad.52.1201058019894; Tue, 22 Jan 2008 19:13:39 -0800 (PST) Original-Received: by 10.115.73.6 with HTTP; Tue, 22 Jan 2008 19:13:39 -0800 (PST) In-Reply-To: <4796A68E.6040305@gmail.com> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:87354 Archived-At: Hi, On Jan 23, 2008 7:59 AM, Lennart Borgman (gmail) wrote: > > If Dhuvra finishes his helper application, we could configure that as > > the default print application, since it will give the ability to print > > on USB and non-SMB networked printers as well as any printers that do > > not accept plain text over the wire. > > I thought dhruva wanted to add printing to Emacs itself (using the GDI > API:s). Well, my initial idea was to add something directly into the emacs code. I have just got raw text printing working. I am working on handling some basic formatting like page breaks. The approach I am taking is as follows: 1. Read the buffer as a string 2. Break it into a list of lines and feed line by line to the printer spool (printing will start only after a call to EndPage is made, hence not a performance issue) 3. If I find a form feed (I guess CTRL-L), I will make a call to EndPage and start a new page (treat it as a page break) 4. Continue the #2 and #3 till I reach the end of the buffer string The current code (I am working on it only in spare time => slow progress) 1. I am writing it as a stand alone tool that I can integrate into emacs at a later point 2. Reads a file (pipe the data) 3. Launches the printer selection option (and page setup) dialog 4. Send the data with no preprocessing to the printer 5. Not honoring the margin information the user selects in the page setup I am able to get a printout though not well formatted. I need to handle lines by setting the x/y coord in the TextOut call. I am working of getting the pixel offset for new lines and need some further exploration from my side. I am referring to the famous book by Rector (Win32 Programming) and it has all the sample code to get it done, I am fairly confident of puling it off. -dky -- Contents reflect my personal views only!