Closed Bug 154883 Opened 22 years ago Closed 22 years ago

Need to support session printing APIs for OS X

Categories

(Core Graveyard :: Embedding: Mac, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ccarlen, Assigned: ccarlen)

Details

(Keywords: topembed+, Whiteboard: [adt3 rtm])

Attachments

(2 files)

If the non-Gecko printing in an embedding app is using session-based APIs, the
two models do not mix well.
Blocks: 150046
Keywords: topembed
Pretty much what I discussed with Rod. There is an iface, nsIPrintSession,
which does nothing by itself but can be subclassed by a platform impl. It is
owned by the top-level printing code because the lifespan of a session is most
clearly defined at that level. Built and tested on Mac Carbon & Windows. There
may be some platform-specific gfx factory code that needs filling in - I can
build all the tier-1 platforms to make sure.
Comment on attachment 90496 [details] [diff] [review]
patch to impl printing with session APIs

r=pink w/ minor comments

+  *aPMPageFormat = mPageFormat;
+  //OSStatus status = ::PMRetain(*aPMPageFormat);
+  OSStatus status = noErr;

remove the commented code as we discussed, line 201 as well.

add a comment as we discussed in the XP print session impl indicating its use
for future expansion of XP routines on the session api.

+  // The out param has a ref count of 1 on return.

Note also that the caller is responsible for releasing.

+  OSStatus CreateDefaultPageFormat(PMPrintSession aSession, PMPageFormat&
outFormat);

I swing back and forth on  using refs for out params. While you don't have to
check for null, it slightly complicates reading of the calling code because
there is nothing explicit to indicate which value is being filled in, as an
explicit |&foo| would. I can go either way, just noting for comment.
Attachment #90496 - Flags: review+
The trunk patch needed some conflict resolution and to be re-tested because bug
151628 is not yet on the branch. That bug is in the process of getting adt
approval. Once that goes in, the trunk patch should apply without conflict and
is the preferable patch. I'm just putting this patch here to allow Mac
embedding clients to be able to test the patch in the meanwhile (they're the
only ones seeing problems).
this fixes the crash issues our embeddor had, it should go onto the branch asap
once it gets sr'd

cc'ing sfraser for sr
Keywords: mozilla1.0.1
Comment on attachment 90673 [details] [diff] [review]
patch for MOZILLA_1_0_BRANCH

Comments:

Index: gfx/macbuild/GFXComponentConfig.h
 #if TARGET_CARBON
-// we can't use the carbon printing session APIs
-#define PM_USE_SESSION_APIS 0
+#define PM_USE_SESSION_APIS 1
 #endif

You can just remove these lines. PM_USE_SESSION_APIS is on by default in the
headers.

sr=sfraser
Attachment #90673 - Flags: superreview+
Comment on attachment 90496 [details] [diff] [review]
patch to impl printing with session APIs

a=asa (on behalf of drivers) for checkin to the 1.1 trunk.
Attachment #90496 - Flags: approval+
Fixed. Note that, until bug 157129 is fixed, Print Preview is not working.
Hopefully, that will be in before Monday's verif builds in order to verif this.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment on attachment 90673 [details] [diff] [review]
patch for MOZILLA_1_0_BRANCH

ok, trunk and branch approval.	add the fixed1.0.1 keyword after checking in on
the branch.
Attachment #90673 - Flags: approval+
Adding adt1.0.1+ on behalf of the adt.  Please check this fix into the Mozilla
1.0 branch.
Keywords: adt1.0.1+
Whiteboard: [adt3 rtm]
Checked into branch.
Keywords: fixed1.0.1
verified that printing works fine in Mac OSX 7/17 branch build.

I will let Mdunn close this bug out.
mdunn: pls verify this as fixed on the 1.0 branch, then replace the "fixed1.0.1"
keyword, with "verified1.0.1". thanks!
Keywords: topembedtopembed+
to ashish for verification
QA Contact: mdunn → ashishbhatt
No longer blocks: 150046
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: