From ryan at web-scripter.com Mon Mar 3 21:15:49 2008 From: ryan at web-scripter.com (Ryan Joseph) Date: Mon, 3 Mar 2008 19:15:49 -0700 Subject: [WASTE-list] pasted tab widths Message-ID: Can I prevent text pasted into WASTE from changing the tab widths? Or maybe a better broader question would be, what is the best way to implement a feature like "Paste and Match Style" in MLTE? I had to trap the HICommandPaste and wrap WEProcessHICommand with calls to WEGetOneAttribute/WESetOneAttribute and then it was very slow if I didn't disable redrawing for the setting of the old attributes. thanks. Regards, Josef -------------- next part -------------- An HTML attachment was scrubbed... URL: From blgl at scoop.se Tue Mar 4 03:46:31 2008 From: blgl at scoop.se (Bo Lindbergh) Date: Tue, 4 Mar 2008 09:46:31 +0100 Subject: [WASTE-list] WEMatchAttributes problem Message-ID: <54C75911-CC73-40A9-BF1B-6D2BF5BC66AE@scoop.se> Why doesn't WEMatchAttributes work with custom attributes? /Bo Lindbergh From marco.piovanelli at pobox.com Fri Mar 7 05:51:49 2008 From: marco.piovanelli at pobox.com (Marco Piovanelli) Date: Fri, 7 Mar 2008 11:51:49 +0100 Subject: [WASTE-list] pasted tab widths In-Reply-To: References: Message-ID: <20080307105149.1951481995@relay.pair.com> On Mon, 3 Mar 2008 19:15:49 -0700, Ryan Joseph (ryan at web-scripter.com) wrote: >Can I prevent text pasted into WASTE from changing the tab widths? Or >maybe a better broader question would be, what is the best way to >implement a feature like "Paste and Match Style" in MLTE? I had to >trap the HICommandPaste and wrap WEProcessHICommand with calls to >WEGetOneAttribute/WESetOneAttribute and then it was very slow if I >didn't disable redrawing for the setting of the old attributes. thanks. The short answer is yes, but you need a recent (post-3.1b2) build, one that I haven't had time to make public yet. I think I have already sent you this private build. Anyway, the best way to implement a feature like "Paste and Match Style" with WASTE 3.0 is to have a UI element (probably a menu item) that sends the kHICommandPasteAndMatchStyle (== 'P&MS') command, and let WASTE handle the command. If, for some reason, you cannot let WASTE install its own command event handlers, you can manually paste unstyled text from a pasteboard or scrap by specifying the wePastePlainText option in your call to one of the following: WEPasteFromPasteboard WEPasteFromScrap WECanPasteFromPasteboard WECanPasteFromScrap At the lowest level, WEPut() now has an option to ignore style information, wePutPlainText. This is handy when you need to insert, say, RTF data, but want to strip off all the formatting. -- marco -- It's not the data universe only, it's human conversation. They want to turn it into a one-way flow that they have entirely monetized. I look at the collective human mind as a kind of ecosystem. They want to clear cut it. They want to go into the rainforest of human thought and mow the thing down. From marco.piovanelli at pobox.com Fri Mar 7 05:56:37 2008 From: marco.piovanelli at pobox.com (Marco Piovanelli) Date: Fri, 7 Mar 2008 11:56:37 +0100 Subject: [WASTE-list] WEMatchAttributes problem In-Reply-To: <54C75911-CC73-40A9-BF1B-6D2BF5BC66AE@scoop.se> References: <54C75911-CC73-40A9-BF1B-6D2BF5BC66AE@scoop.se> Message-ID: <20080307105637.94356080@relay.pair.com> On Tue, 4 Mar 2008 09:46:31 +0100, Bo Lindbergh (blgl at scoop.se) wrote: >Why doesn't WEMatchAttributes work with custom attributes? No particular reason. I'll add this to my to-do list. -- marco -- It's not the data universe only, it's human conversation. They want to turn it into a one-way flow that they have entirely monetized. I look at the collective human mind as a kind of ecosystem. They want to clear cut it. They want to go into the rainforest of human thought and mow the thing down. From ryan at web-scripter.com Fri Mar 7 11:13:28 2008 From: ryan at web-scripter.com (Ryan Joseph) Date: Fri, 7 Mar 2008 09:13:28 -0700 Subject: [WASTE-list] pasted tab widths In-Reply-To: <20080307105149.1951481995@relay.pair.com> References: <20080307105149.1951481995@relay.pair.com> Message-ID: <7860DC37-9BC7-494A-A91E-2BFAA42B065A@web-scripter.com> So all the options with wePastePlainText are only available with the newest build? I had to stop using the latest build because there were too many bugs in the system to pair windows line endings as a single character. Unless the bugs were fixed or there is an option to turn off that feature I can't access the new features. what do you suggest? I had to override WASTE's pasting because the RTF parser was invoking my flux callback multiple times per paste. Was that ever fixed? thanks Marco. On Mar 7, 2008, at 3:51 AM, Marco Piovanelli wrote: > On Mon, 3 Mar 2008 19:15:49 -0700, > Ryan Joseph (ryan at web-scripter.com) wrote: > > >> Can I prevent text pasted into WASTE from changing the tab widths? Or >> maybe a better broader question would be, what is the best way to >> implement a feature like "Paste and Match Style" in MLTE? I had to >> trap the HICommandPaste and wrap WEProcessHICommand with calls to >> WEGetOneAttribute/WESetOneAttribute and then it was very slow if I >> didn't disable redrawing for the setting of the old attributes. >> thanks. > > The short answer is yes, but you need a recent (post-3.1b2) build, > one that I haven't had time to make public yet. I think I have > already sent you this private build. > > Anyway, the best way to implement a feature like "Paste and Match > Style" > with WASTE 3.0 is to have a UI element (probably a menu item) that > sends the kHICommandPasteAndMatchStyle (== 'P&MS') command, and let > WASTE handle the command. > > If, for some reason, you cannot let WASTE install its own command > event handlers, you can manually paste unstyled text from a pasteboard > or scrap by specifying the wePastePlainText option in your call to one > of the following: > > WEPasteFromPasteboard > WEPasteFromScrap > WECanPasteFromPasteboard > WECanPasteFromScrap > > At the lowest level, WEPut() now has an option to ignore style > information, wePutPlainText. This is handy when you need to insert, > say, RTF data, but want to strip off all the formatting. > > > -- marco > > > -- > It's not the data universe only, it's human conversation. > They want to turn it into a one-way flow that they have entirely > monetized. I look at the collective human mind as a kind of > ecosystem. They want to clear cut it. They want to go into the > rainforest of human thought and mow the thing down. > > Regards, Josef -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkorn at printable.com Fri Mar 14 21:33:13 2008 From: dkorn at printable.com (Dan Korn) Date: Fri, 14 Mar 2008 20:33:13 -0500 Subject: [WASTE-list] Broken symlink in WASTE 3.1b2 Framework Message-ID: <4B0C97E7-133A-445D-8096-2B7A8270DA3D@printable.com> I've been using WASTE 3.1b2 in an Xcode 2.5 project. I kept getting an error when I tried to copy my finished executable, with the WASTE.framework embedded, to another location. I finally traced it to a broken symbolic link (alias) inside WASTE.framework: ~>file /Volumes/WASTE_Evaluation_Kit_3.1b2/WASTE.framework/Versions/A/ Frameworks/Frameworks /Volumes/WASTE_Evaluation_Kit_3.1b2/WASTE.framework/Versions/A/ Frameworks/Frameworks: broken symbolic link to Versions/Current/ Frameworks If I remove the invalid symlink, everything works fine. Could this please be removed from the distribution? Thanks, Dan From dkorn at printable.com Tue Mar 25 13:30:39 2008 From: dkorn at printable.com (Dan Korn) Date: Tue, 25 Mar 2008 12:30:39 -0500 Subject: [WASTE-list] Drawing issues with WASTE 3.1 Message-ID: <2B204BB6-7519-4ADE-920A-720635EB2ED6@printable.com> I'm upgrading a PPC-only project that had been built in CodeWarrior using WASTE 2.1b1 to a Universal Binary project in Xcode using WASTE 3.0 (v3.1b2). I'm using a modified version of the WTextView PowerPlant wrappers, with the QuickDraw eumlation in Leopard. Everything seems to be mostly working, but I'm having an issue where the text is sometimes drawn at the top left of my PowerPlant dialog instead of in the pane for the WTextView. It seems to depend on whether I have some text selected. If there's something selected, and I modify the text with WESetAttributes, it draws correctly. But if nothing is selected, and I modify the "null style" with WESetAttributes, everything gets drawn in the wrong place. I think all my calls to FocusDraw() are in the right places, and they seem to work in 2.1, but there's something different about 3.0. Any ideas? I might have to do something like suppress drawing when there's no selection. I can try to create a sample project which shows the problem, but it's going to be big with PowerPlant. Thanks, Dan From marco.piovanelli at pobox.com Thu Mar 27 07:13:07 2008 From: marco.piovanelli at pobox.com (Marco Piovanelli) Date: Thu, 27 Mar 2008 12:13:07 +0100 Subject: [WASTE-list] Drawing issues with WASTE 3.1 In-Reply-To: <2B204BB6-7519-4ADE-920A-720635EB2ED6@printable.com> References: <2B204BB6-7519-4ADE-920A-720635EB2ED6@printable.com> Message-ID: <20080327111307.474464237@relay.pair.com> On Tue, 25 Mar 2008 12:30:39 -0500, Dan Korn (dkorn at printable.com) wrote: >I'm upgrading a PPC-only project that had been built in CodeWarrior >using WASTE 2.1b1 to a Universal Binary project in Xcode using WASTE >3.0 (v3.1b2). I'm using a modified version of the WTextView >PowerPlant wrappers, with the QuickDraw eumlation in Leopard. > >Everything seems to be mostly working, but I'm having an issue where >the text is sometimes drawn at the top left of my PowerPlant dialog >instead of in the pane for the WTextView. It seems to depend on >whether I have some text selected. If there's something selected, and >I modify the text with WESetAttributes, it draws correctly. But if >nothing is selected, and I modify the "null style" with >WESetAttributes, everything gets drawn in the wrong place. I think >all my calls to FocusDraw() are in the right places, and they seem to >work in 2.1, but there's something different about 3.0. > >Any ideas? I might have to do something like suppress drawing when >there's no selection. I can try to create a sample project which >shows the problem, but it's going to be big with PowerPlant. Dan, You may want to try installing a "PrepareView" hook on your WASTE instance. This is a callback that WASTE invokes whenever it needs to draw anything to a view, either in response to a direct API call (such as WEUpdate or WEScroll), or when triggered indirectly by some event, like the firing of the caret timer. The callback is invoked immediately prior to drawing, and is an ideal place to perform any additional setup of the QD port or CG context, like calling FocusDraw() if your app is PowerPlant-based. You install the "PrepareView" hook like this: static WEPrepareViewUPP prepareViewUPP = NewWEPrepareViewUPP(MyPrepareView); OSStatus err; err = WESetInfo(wePrepareViewHook, &prepareViewUPP, myWE); where MyPrepareView is defined as follows: static pascal void MyPrepareView(WEViewReference view) { } The parameter to MyPrepareView() is a WASTE *view* reference, not a controller reference (WEReference), as in WASTE 3.0 you can have multiple views associated with the same controller, and your callback may need to distinguish between them. You can retrieve the owning controller from the view reference using WEGetViewOwner(). HTH, -- marco -- It's not the data universe only, it's human conversation. They want to turn it into a one-way flow that they have entirely monetized. I look at the collective human mind as a kind of ecosystem. They want to clear cut it. They want to go into the rainforest of human thought and mow the thing down. From dkorn at printable.com Thu Mar 27 14:25:34 2008 From: dkorn at printable.com (Dan Korn) Date: Thu, 27 Mar 2008 13:25:34 -0500 Subject: [WASTE-list] Drawing issues with WASTE 3.1 In-Reply-To: <0882E3B2D1B6834094C785F9EC28E32BC0A7DD@chiexc01.corp.printable.com> References: <2B204BB6-7519-4ADE-920A-720635EB2ED6@printable.com> <20080327111307.474464237@relay.pair.com> <0882E3B2D1B6834094C785F9EC28E32BC0A7DD@chiexc01.corp.printable.com> Message-ID: <58DE14E7-4A56-4794-A177-F8F341B2CDA8@printable.com> Thanks Marco. As you allude to, the problem is indeed related to WASTE's re-drawing on a timer to flash the caret. In WASTE 2.x, there was a function WEIdle which the PowerPlant wrapper would call at its own idle processing time to allow WASTE to flash the caret. In WASTE 3, this is done with a timer loop that WASTE runs on its own, apparently asynchronously. The problem is that when PowerPlant calls FocusDraw() to draw its own stuff on the dialog, the internal WASTE timer executes, and does its own drawing, but it doesn't know that the GrafPort has already been clipped by PowerPlant, and it ends up drawing in the wrong place. I followed your suggestion and added a wePrepareViewHook function, which calls FocusDraw() for the PowerPlant LPane which wraps the control. This prevents WASTE from drawing in the wrong place on the dialog, but now I have the reverse problem: The PowerPlant controls are drawn on top of the WASTE control! I'm on the horns of a dilemma. I'm still not really sure how to solve this. Is there a way to tell WASTE to temporarily stop flashing the caret? If I can do that, then I could try to figure out when PowerPlant is doing its drawing and suspend WASTE during that time. I realize that the underlying technologies have been changed by Apple, but this is a lot more work than I bargained for with the WASTE 3.x upgrade. Dan -----Original Message----- From: Marco Piovanelli [mailto:marco.piovanelli at pobox.com] Sent: Thursday, March 27, 2008 6:13 AM To: Dan Korn Cc: WASTE 3.0 List Subject: Re: [WASTE-list] Drawing issues with WASTE 3.1 On Tue, 25 Mar 2008 12:30:39 -0500, Dan Korn (dkorn at printable.com) wrote: > I'm upgrading a PPC-only project that had been built in CodeWarrior > using WASTE 2.1b1 to a Universal Binary project in Xcode using WASTE > 3.0 (v3.1b2). I'm using a modified version of the WTextView > PowerPlant wrappers, with the QuickDraw eumlation in Leopard. > > Everything seems to be mostly working, but I'm having an issue where > the text is sometimes drawn at the top left of my PowerPlant dialog > instead of in the pane for the WTextView. It seems to depend on > whether I have some text selected. If there's something selected, and > I modify the text with WESetAttributes, it draws correctly. But if > nothing is selected, and I modify the "null style" with > WESetAttributes, everything gets drawn in the wrong place. I think > all my calls to FocusDraw() are in the right places, and they seem to > work in 2.1, but there's something different about 3.0. > > Any ideas? I might have to do something like suppress drawing when > there's no selection. I can try to create a sample project which > shows the problem, but it's going to be big with PowerPlant. Dan, You may want to try installing a "PrepareView" hook on your WASTE instance. This is a callback that WASTE invokes whenever it needs to draw anything to a view, either in response to a direct API call (such as WEUpdate or WEScroll), or when triggered indirectly by some event, like the firing of the caret timer. The callback is invoked immediately prior to drawing, and is an ideal place to perform any additional setup of the QD port or CG context, like calling FocusDraw() if your app is PowerPlant-based. You install the "PrepareView" hook like this: static WEPrepareViewUPP prepareViewUPP = NewWEPrepareViewUPP(MyPrepareView); OSStatus err; err = WESetInfo(wePrepareViewHook, &prepareViewUPP, myWE); where MyPrepareView is defined as follows: static pascal void MyPrepareView(WEViewReference view) { } The parameter to MyPrepareView() is a WASTE *view* reference, not a controller reference (WEReference), as in WASTE 3.0 you can have multiple views associated with the same controller, and your callback may need to distinguish between them. You can retrieve the owning controller from the view reference using WEGetViewOwner(). HTH, -- marco -- It's not the data universe only, it's human conversation. They want to turn it into a one-way flow that they have entirely monetized. I look at the collective human mind as a kind of ecosystem. They want to clear cut it. They want to go into the rainforest of human thought and mow the thing down.