From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/70551 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: mlib plugin question Date: Wed, 10 Aug 2011 20:00:43 +0200 Message-ID: <4E42C74B.7060208@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1312999288 13285 80.91.229.12 (10 Aug 2011 18:01:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 10 Aug 2011 18:01:28 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 10 20:01:22 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QrD5h-0002mL-Fe for gctc-ntg-context-518@m.gmane.org; Wed, 10 Aug 2011 20:01:17 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 92605CAECB; Wed, 10 Aug 2011 20:01:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hzJ8ceyDlxKE; Wed, 10 Aug 2011 20:01:13 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C5F79CAEC7; Wed, 10 Aug 2011 20:01:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0799BCAEC7 for ; Wed, 10 Aug 2011 20:01:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cjlZ4Z91AcDG for ; Wed, 10 Aug 2011 20:01:02 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 2DD86CAEBD for ; Wed, 10 Aug 2011 20:01:02 +0200 (CEST) Original-Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with SMTP id p7AI11ak030313 for ; Wed, 10 Aug 2011 20:01:01 +0200 Original-Received: (qmail invoked by alias); 10 Aug 2011 18:00:57 -0000 Original-Received: from ip-178-200-248-30.unitymediagroup.de (EHLO [192.168.178.3]) [178.200.248.30] by mail.gmx.net (mp050) with SMTP; 10 Aug 2011 20:00:57 +0200 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX18V9SUwzHUV3XikCQhjg09edoE3tpEvS9p+mGtrme lXeCdMwKT0rIgX User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 X-Enigmail-Version: 1.2 X-Y-GMX-Trusted: 0 X-Bayes-Prob: 0.645 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.22; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08FiG11nD - e67343810435 - 20110810 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:70551 Archived-At: Hi, I use a mlib plugin to manually start/stop transparency. All graphics in between will be drawn with the defined state. Not very useful in general, but I need it for some graphics in Aero. This is the simple code.. MP side: def btransp(expr a, t) = draw origin withprescript "mtr_transp=start" withprescript "mtr_alternative=" & decimal a withprescript "mtr_transparency=" & decimal t ; enddef ; def etransp = draw origin withprescript "mtr_transp=stop" ; enddef ; TEX side: local function mtr_process(object,prescript,before,after) local mtr_alternative = prescript.mtr_alternative if prescript.mtr_transp == "start" then if mtr_alternative then mtr_alternative = tonumber(mtr_alternative) local mtr_transparency = tonumber(prescript.mtr_transparency) before[#before+1] = format("q /Tr%s gs %% mtr",registertransparency(nil,mtr_alternative,mtr_transparency,true)) end elseif prescript.mtr_transp == "stop" then after[#after+1] = "Q % mtr" else -- fatal error end -- object.path = true -- 'true' gives runtime error, 'false' distorts content object.grouped = true object.type = false -- don't draw object.color = false end Usage: btransp(normaltransparency,.5); etransp; This works so far (no visible artefacts), but part of the 'draw origin' is (although not drawn) still existent in the code. [..] q /Tr1 gs % mtr 10.000000 M % unwanted setup for 'origin' 1 j 1 J 0.500000 w 0.000000 0.000000 m 0.000000 0.000000 l 10.000000 M % unwanted setup for 'origin' 1 j 1 J 0.500000 w 0.000000 0.000000 m 0.000000 0.000000 l Q % mtr [..] I had a solution for the old 'specials', but I can't find one for the plugin handler. How can I get rid of the 'trigger code'? Peter ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________