|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
XPCOM Helpers....Guys I asked this before, and I know you don't want to bake it into jslib directly...
But we seriously need some xpcom wrappers for implimenting simple functions that are only available in the window scope. I am having such issues with simply using window-watcher to open a new window from my component "and" pass it arguments... I appears the js objects have to be converted into proper nsi objects that impliment nsISupports and all these other things... I mean this is terrorizing me !!! Please consider if some type of fork for xpcom components could be established to perform these simple operations... What do you guys think ? _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....> > > What do you guys think ? Please post some examples to clarify what you are talking about ... Thanks --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....To perform those actions from a XPCOM Component you need to do something like: ----------------------- supports_array = function( refArray ){ array = Components.classes["@mozilla.org/supports-array;1"] .createInstance(Components.interfaces.nsISupportsArray); for( var x = 0; x < refArray.length; x++ ) array.AppendElement( refArray[x] ); return array; } window_open = function( refParent, strUrl, strWindowName, strWindowFeatures, refArray ){ return Components.classes["@ mozilla.org/embedcomp/window-watcher;1 "] .getService(Components.interfaces.nsIWindowWatcher) .openWindow( refParent, strUrl, strWindowName, strWindowFeatures, supports_array(refArray) ); } --------------- (I quickly shortened my code to the result above ... that code will probably not work its just an example) As you can see when your in a xpcom component none of the api's your use to inside of a window are easy to replicate... And in reality I still haven't successfully passed arguments to the new window using code like the example above... It would be really nice if there was a jslib for xpcom components to replace the missing features that exist inside of the window scope... _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....> > It would be really nice if there was a jslib for xpcom components to > replace the missing features that exist inside of the window scope... Ok, I understand you now. To pass arguments in the window you need to do this: ------------------------------------------------------------------------ var args = Components.classes['@mozilla.org/supports-string;1'] .getService(Components.interfaces.nsISupportsString); var a = new Array("A", "B", "C"); args.data = a; ww.openWindow(null, "chrome://foo/content/", "_blank", "chrome,dialog=no,all", args); ------------------------------------------------------------------------ I agree it would be nice to have wrappers for this stuff in jsLib. I just honestly don't know when I would have time to get to it. --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....See I have no idea how I was ever supposed to figure that out...
Thanks... And I think thats a starting point right there! Purpose some extra features could be loaded when used via subscript ? I would think someone using a subscript is only in a component are they not? _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Well I'm in the process of writing my own xulrunner application and no matter what I'm going to have to replicate lots of things we take for granted in the window scope. I'll paste my solutions here as I find them and perhaps I'll give it a shot and start building a branch of jslib just for component writers?
_______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Daniel Aquino wrote: > See I have no idea how I was ever supposed to figure that out... Unfortunately the only way to figure anything out regards mozilla programming is w/ LXR. Looking at some code already written. > > Thanks... > > And I think thats a starting point right there! > > Purpose some extra features could be loaded when used via subscript ? > I would think someone using a subscript is only in a component are > they not? > > > Yes, that included code would only be in the scope of that particular component. --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Daniel Aquino wrote: > Well I'm in the process of writing my own xulrunner application and no > matter what I'm going to have to replicate lots of things we take for > granted in the window scope. I'll paste my solutions here as I find > them and perhaps I'll give it a shot and start building a branch of > jslib just for component writers? Go for it. :) --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....What I was asking in reference to the subscript was , "are subscripts only used when someone wants jslib in a component?"
If that is true then during a subscript load we could apply extra functions that replicate what the window already provides... Do you concur ? _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....What is LXR ? I'm not even really familiar yet with what resources a xr developer should depend on...
_______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Daniel Aquino wrote: > What I was asking in reference to the subscript was , "are subscripts > only used when someone wants jslib in a component?" > > If that is true then during a subscript load we could apply extra > functions that replicate what the window already provides... > > Do you concur ? > > > "mozIJSSubScriptLoader" interface. If a script context is not provided, then it is loaded in the current context. jsLib uses subscripts, subscripts don't necessarily use jsLib. If you have a script context whether a DOM window, or an XPCOM component, the loader only loads the specified script uri into that context. That's it. If you want to write relevant code to make it easier to handle windows from an XPCOM component, then yes you could then use the subscript loader to load that code into any component you wish ... --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Daniel Aquino wrote: > What is LXR ? I'm not even really familiar yet with what resources a > xr developer should depend on... http://lxr.mozilla.org/seamonkey/ --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....When loading various script files into a component, the component has scope to everything provided in each file.
But could I some how make it so the files can see one another ? I was trying to basically use my xpcom component as a central point, and then break up functionality into separate files, while all the code still interacts with one another... Is that possible ? _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....If that wasn't to clear I'll try to use another example:
In ruby I separate multiple classes across separate files and then require them into a central script. All of the classes still act like they were all in the same file... Just easier to manage that way ... _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Daniel Aquino wrote: > If that wasn't to clear I'll try to use another example: > > In ruby I separate multiple classes across separate files and then > require them into a central script. > > All of the classes still act like they were all in the same file... > Just easier to manage that way ... That's how jsLib works. Most libraries are in their own class, then client code will call "include(jslib_libname)" which is just a wrapper for the subscript loader. But yes it is all doable ... --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....well my component sees all of the included functions within the external files... but each file it self does not have access to the other files... they complain that things are not defined...
_______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Daniel Aquino wrote: > well my component sees all of the included functions within the > external files... but each file it self does not have access to the > other files... they complain that things are not defined... All the files included in a single context will be accessible in that context. If an included file needs to access functions in another included file, then that file it needs to access needs to be included first. include("a"); include("b"); "b" has access to "a". --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....hehe exactly my point!
I really just wanted to use my component as a central point, but wanted to break up functionality across files... If you have libraries that highly depend on one another I'd have to do something ugly like put them all in one huge file or embed lots of logic into my component it self. Embedding everything into the component would require everything to be a method of the main central component. It would de-promote oop style of programming in javascript. And even if I did mesh all my objects into 1 central xpcom component object... thats highly cluttered and problematic.. Maybe I don't know what I'm talking about but it doesn't seem right to me. _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....Daniel Aquino wrote: > hehe exactly my point! > > I really just wanted to use my component as a central point, but > wanted to break up functionality across files... > > If you have libraries that highly depend on one another I'd have to do > something ugly like put them all in one huge file or embed lots of > logic into my component it self. > > Embedding everything into the component would require everything to be > a method of the main central component. It would de-promote oop style > of programming in javascript. And even if I did mesh all my objects > into 1 central xpcom component object... thats highly cluttered and > problematic.. > > Maybe I don't know what I'm talking about but it doesn't seem right to me. > > > You can probably do what you are trying to do, perhaps taking in the target context and applying the required libs to that context. But jsLib has libraries that are dependent on other libs. For example the file library is dependent on a file base class lib. This is easily accomplished by having the library load it's base if the base is not already loaded. --pete -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: XPCOM Helpers....yea sure but lets say every file has a small class or group of functions... and they all highly depend on one another ... then you'd have files loading each other all over the place ... like file A loads B and then B loads A ... thats retarded...
_______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
| < Prev | 1 - 2 | Next > |
| Free Forum Powered by Nabble | Forum Help |