HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/print_win32_vector.pyc
�
��Yc@s�dZddlTddlZddlZddlZddlZej�ejjj	d�sre
ed��ned�Z
ed�ZedZd	Zd
Zdejfd��YZed
kr�e�Zej�ndS(s�
print_win32_vector.py
This extension will generate vector graphics printout, specifically for Windows GDI32.

Copyright (C) 2012 Alvin Penner, penner@vaxxine.com

This is a modified version of the file dxf_outlines.py by Aaron Spike, aaron@ekips.org
It will write only to the default printer.
The printing preferences dialog will be called.
In order to ensure a pure vector output, use a linewidth < 1 printer pixel

- see http://www.lessanvaezi.com/changing-printer-settings-using-the-windows-api/
- get GdiPrintSample.zip at http://archive.msdn.microsoft.com/WindowsPrintSample

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
i����(t*Ntwins0sorry, this will run only on Windows, exiting...swinspool.drvs	gdi32.dlliiitMyEffectcBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCstjj|�t|_dS(N(tinkextEffectt__init__tTruet
visibleLayers(tself((s4/usr/share/inkscape/extensions/print_win32_vector.pyR1sc
Cs/d}d}d}|jd�}|rRtj|�}|jd�r�|dr�|ddkr�|ddd!dkr�tj|d�}q�n|jd�r�|j|d�|jd	�}t||j�}n|jd
�rR|d
rO|d
dkrO|d
dd!dkrOtj|d
�}|dd|dd|d}qOqRn|dd|dd|d}|j	t
jd
d�kr�|jd�}	|	s�dStj
|	�}
ns|j	t
jdd�kr)t|jd��}t|jd��}t|jd��}
t|jd��}||g||g||ggg}
|
j||
|g||
|g||
|gg�|
j||
||g||
||g||
||gg�|
j|||g|||g|||gg�|
j||g||g||gg�|
g}
ndS|jd�}|r`tj|tj|��}ntj||
�tjd||�}tj|j|�|j|
�|dk	r+td|d�}tjt|��}tj|j|�tj|j�|j|
�tj|j�tj|j�ndS(Niitstyletstroketnoneiturlsstroke-widtht1pxtfilliitpathtsvgtdtrecttxtytwidththeightt	transform(iiiii(tNonetgettsimplestylet
parseStylethas_keyt
parseColortunittouutinttscalettagRtaddNStcubicsuperpatht	parsePathtfloattappendtsimpletransformtcomposeTransformtparseTransformtapplyTransformToPathtmygdit	CreatePentSelectObjectthDCt	emit_pathtLOGBRUSHtCreateBrushIndirectt	addressoft	BeginPathtEndPathtFillPath(Rtnodetmattrgbt	fillcolorR
R	RtcolorRtpRRRRttransthPentbrushthBrush((s4/usr/share/inkscape/extensions/print_win32_vector.pyt
process_shape5sd1 1+"$4@4(

cCs�x�|D]�}tj|jt|ddd�t|ddd�d�tdt|�d}|�}xtt|�d�D]�}t||dd�|d|<t||dd�|d|d<t||ddd�|d|d<t||ddd�|d|d<t||ddd�|d|d<t||ddd�|d|d<q�Wtj|jt	|�dt|�d�qWdS(Niiiiiii(
R+tMoveToExR.RRtc_longtlentrangetPolyBezierToR2(RR;tsubtPOINTStpointsti((s4/usr/share/inkscape/extensions/print_win32_vector.pyR/ks
=	 $(((,.cCs�|jd�}|jd�}|jd�}dddgdddgg}|rotj|tj|��}n|r�tj|ddt|�gdddgg�}n|r�tj|dddgddt|�gg�}n|s�|s�|r|jjtj|jd|��n|jtjdd��}|j	|d	�}|dk	r�|jtjd
d�kr~|j|�q�|jtjdd�kr�|j
|�q�|j||jd�n|s�|s�|r�|jj�ndS(
NRRRg�?gi����threftxlinkitgRtuse(RR'R(R)R%tgroupmatR&RR"tgetElementByIdRR!t
process_groupt
process_cloneR@tpop(RR6R<RRR7trefidtrefnode((s4/usr/share/inkscape/extensions/print_win32_vector.pyRQzs,33&cCsV|jtjdd��dkrz|jd�}|rztj|�}|jd�rw|ddkrt|jrtdSqwqzn|jd�}|r�|jjt	j
|jdt	j|���nx{|D]s}|jtjd	d
�kr�|j
|�q�|jtjdd
�kr!|j|�q�|j||jd�q�W|rR|jj�ndS(Nt	groupmodetinkscapetlayerR	tdisplayRRi����RLRRM(RRR"RRRRRNR&R'R(R)R!RPRQR@RR(RtgroupR	R<R6((s4/usr/share/inkscape/extensions/print_win32_vector.pyRP�s$!
/
c
Cs`t�}tjdt|��t|j�}tj|t|��t�}tj|jt|�d�dkr�tt	d��ntj
d||ddd�}t|d�}tj
d||t|�dtt�}tj
|�|dkr�t�n|jj�jddtj�}|s0dg}ntd|djd	�d
�}td}|dt|�ddd�}tjd|dt|��|_tj|jt|��dkr�t�nt|d
�dt|d�d|_|j|jd�:_|jddgd|jdggg|_|jj�}	|j|	�tj|j�dS(NisFailed to open default printeridis@sodipodi:docnamet
namespacessNew document 1s	Inkscape s\i����iii:gp@i;i`R
g(RBtmyspooltGetDefaultPrinterARtbyreftcreate_string_buffertvaluetOpenPrinterAtexitt_tDocumentPropertiesAtDM_IN_PROMPTt
DM_OUT_BUFFERtClosePrintertdocumenttgetroottxpathRtNSStsplitR2R+t	CreateDCAR.t	StartDocAtordR RRNRPtEndDoc(
Rt
pcchBuffertpnamethPrintertpDevModetdocnametlpszDocNametDOCINFOtdocInfotdoc((s4/usr/share/inkscape/extensions/print_win32_vector.pyteffect�s8		$(

!!
!!
)*
(t__name__t
__module__RR@R/RQRPRy(((s4/usr/share/inkscape/extensions/print_win32_vector.pyR0s		6			t__main__(t__doc__tctypesRRR'R#tlocalizetsystplatformt
startswithRaRbtWinDLLR[R+RBR0RdReRRRztetaffect(((s4/usr/share/inkscape/extensions/print_win32_vector.pyt<module>s"


�