Closed Bug 436234 Opened 18 years ago Closed 17 years ago

Patch to extend the core embedding api

Categories

(Core Graveyard :: Embedding: APIs, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tristan.van.berkom, Unassigned)

Details

Attachments

(2 files, 3 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Build Identifier: This patch implements the following new apis: MozApp object - used for global apis not contextual to a MozView (such as preferences), this object is a singleton and is instanciated by the MozView instead of initializing the embedding api (the first to instantiate the MozApp object initializes the embedding api). MozApp::SetCharPref(...) // Set a string pref MozApp::SetBoolPref(...) // Set a boolean pref // Load inline data instead of a url nsresult MozView::LoadData(const PRUint8 *data, PRUint32 len, const char *base_url, const char *content_type); // Notify by way of nsIURIContentListener that a uri is about to // be loaded, allow returning TRUE to abort the load. PRBool MozViewListener::OpenURI(const char* newLocation); // Notify by way of ProgressListener that currently loading document // is finished loading. void MozViewListener::DocumentLoaded(); Reproducible: Sometimes Steps to Reproduce: 1. 2. 3.
Attached patch the patch (obsolete) — Splinter Review
Oops I should note, the attached patch is against: http://hg.mozilla.org/users/blassey_mozilla.com/embedding/
Comment on attachment 322893 [details] [diff] [review] the patch >+ * This program is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Lesser General Public License as >+ * published by the Free Software Foundation; version 2.1 of the License. We're going to need this in the typical mozilla tri-license, is that possible? We should probably be updating all of the files to add the tri-license, but for now at least no new files should go in without it (and certainly not as lgpl-only). >+nsresult MozView::LoadData(const PRUint8 *data, >+ PRUint32 len, >+ const char *base_url, >+ const char *content_type) >+{ Probably baseURI, contentType, data, len would be a better order for these args (though honestly I can't justify that :))
> We're going to need this in the typical mozilla tri-license, is that possible? > > We should probably be updating all of the files to add the tri-license, but for > now at least no new files should go in without it (and certainly not as > lgpl-only). Yes ofcourse, that was just me not paying attention to detail and copy-pasting code. > >+nsresult MozView::LoadData(const PRUint8 *data, > >+ PRUint32 len, > >+ const char *base_url, > >+ const char *content_type) > >+{ > > Probably baseURI, contentType, data, len would be a better order for these args > (though honestly I can't justify that :)) Haha thats no problem for me, I am a fan of consitancy and elegance for no other justifyable reasons :) Anyway, things are a little difficult for probably the next few days (I am in bolivia of all places, just got off a 30 hour bus ride and am probably heading for another one...) So no worries, I will update my sandbox and refit this patch as soon as I get somewhere more appropriate.
ok, I fixed the license and the loaddata prototype... made MozApp not a singleton to work better with init/term embedding calls (should be noted that using MozApp you should keep one in scope). attaching a patch from "hg outgoing -p" - should keep my change history in tact but is a little rougher on the eye - let me know if you need a straight diff.
Attached patch patch from hg outgoing -p (obsolete) — Splinter Review
Comment on attachment 322893 [details] [diff] [review] the patch obsoleted by new patch
Attachment #322893 - Attachment is obsolete: true
Attachment #325001 - Attachment is obsolete: true
Attached file second try, hg bundle
these new patches include the licence and api fixes (missed them before oops)
Attachment #325006 - Attachment is obsolete: true
I've been integrating this, but did need to make a few 'fixes': * Changed the project files back to VC++ 2005. Guess this is the downside to having these checked in. * Added the pref include path to the project settings and changed embed.cpp to just #include "nsIPref.h". Needed as the Linux GTK version won't build with #include "pref/nsIPref.h" * Changed ContentListener.h and .cpp to unix end of lines I'll ask Dave if he can push this changes to the main repo
It's in the main repo now. I would resolve the bug, but don't have the rights to do so.
thanks great, resolving.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
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: