Thunderbird gFolderTreeView documentation? - thunderbird-addon

I'm struggling to learn how Thunderbird extension works but I'm stuck by the lack of documentation.
Inside an extension I found:
gFolderTreeView._modeNames...
...
gFolderTreeView.getFolderTreeMode(viewName);
Google gives no help in trying to understand something more about gFolderTreeView. I can only find examples where it is used but no API description. Where can I find the list of its methods, properties and a description of what they do ?

The only way I know would be to take a closer look at the Thunderbird source code.
gFolderTreeView is defined at https://dxr.mozilla.org/comm-central/source/mail/base/content/folderPane.js#129. The nsITreeView interface, which seems to be one of the thinks gFolderTreeView implements, is defined in https://dxr.mozilla.org/comm-central/source/mozilla/layout/xul/tree/nsITreeView.idl.
I found it by searching at https://dxr.mozilla.org/comm-central/ for id:gFolderTreeView and file:nsITreeView
Note that the links are to the latest sources. If you need to look at the sources for older Thunderbird versions, you need to switch the tree from comm-central to e.g. comm-esr45.
The Code that is used by both Thunderbird and Firefox is in the mozilla-central tree

Related

Firefox source code analysis; lines of code per component

I am currently trying to analyse Bugzilla in order to find the ratio of number of bugs : lines of code for each Firefox component. However, I have never worked with Bugzilla before and have no knowledge of Firefox's codebase.
How would I go about finding lines of code per Firefox component (as they appear on Bugzilla under Comp header)? I have made an attempt at looking through mozilla central, but have no idea which source files relate to which components.
EDIT: Dexter pointed out that there is a directive BUG_COMPONENT in the mozilla-central tree, but this directive seems extremely incomplete and is not helpful. Any other advice, or pointers as to where I could get such advice would be much appreciated.
Great question! We recently added the BUG_COMPONENT directive (see the meta bug) to the Firefox code: it's in the moz.build file contained in each directory in the source. This directive allows linking each file in the repository to the related Bugzilla component.
For example, the following directive found here, tells that all the files in test/browser containing the Telemetry word belong to the Toolkit::Telemetry component on Bugzilla.
with Files("test/browser/*Telemetry*"):
BUG_COMPONENT = ("Toolkit", "Telemetry")
You can use either DXR or searchfox to quickly search the Firefox repository.
Updated the answer to account for the questions in the comments.
As noted in the comments, some components are tracked on Bugzilla (e.g. Activity Stream) but do not have a direct mapping to source files within the mozilla-central repository (the one Firefox is built from). That's because some newer components do not ride "the trains" (~6 weeks development cycle), but are rather updated more frequently and deployed as addons.
The code for these components usually lives under the Mozilla github account, along with other project. Since there are quite a number of projects, one way to identify the ones you might be interested in is to restrict them to JavaScript ones. If you follow this last link, you'll see the repository for both the test-pilot and Activity Stream (plus other addons).
I'm afraid the only way to match GitHub projects to Bugzilla components is to look at the name of the repository on GitHub and find the matching component in Bugzilla: you can type the name here to get some component suggestions. If you want to get fancy, you might also leverage the Bugzilla REST API:
Get a list of the JS GitHub project.
Extract the name of the project.
Use the REST API to get the component suggestion.
I would personally just consider the mozilla-central repository as a starting point, as it is mostly annotated: scrape the BUG_COMPONENT from the source files, map them to the paths then use the REST API to get the list of bugs.
Sidenote: the Download Panel seems to be correctly annotated in the main repo.

Firefox Addon SDK1.17 Annotator tutorial: widget/button does not appear

I am trying to work through https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Annotator with jpm (https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/jpm) rather than cfx, and running into difficulties:=> the button/widget that the addon adds does not appear in my browser. Not even in the Additional Tools and Features section if I go to Customize the browswer appearance.
This is the SDK v1.17, and Firefox v38.0.1 for Linux (openSuSE13.2).
I have created the structure and files with given names and contents, telling jpm to use main.js as the entry point, rather than index.js, in order to match the tutorial (which is cfx-based).
I am also passing jpm the -b PATH-TO-FIREFOX-BINARY flag, because it apparently doesn't follow the symlink at /usr/bin/firefox, but it sounds like that's a known issue.
I am also also passing jpm the -p MY-DEV-PROFILE flag because I found that with the introductory tutorial (https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_%28jpm%29) that was the only way I could get that button to show up.
But that doesn't help here, nor does leaving off that option.
The Addon Manager confirms that the extension is installed.
So I am open to suggestions. Obviously I am new to extension development, and pretty new to javascript in general.
I had also better ask while I am here: What I want to do is modify the behaviour of Firefox's Find (in page); can something like that be done with the SDK, or do I need to use the Overlay method?
Any other suggestions helpful for learning addon development would also be welcome (but should probably be done as comments, rather than Answers; let's save Answers for the original question about this tutorial button).
Thanks!
The widget api was removed in Firefox 38. For most cases you can replace widget with the button apis we introduced in Firefox 29, see this blog post for more information.
Ah, heheh, never mind.
It was just an impedence mismatch between the original cfx instructions and the jpm way of doing things.
While I had told jpm to use main.js instead of index.js, I had failed to tell it that main.js was in the "./lib/" directory instead of the root directory of the extension.
After changing the package.json to say
"main": "./lib/main.js"
it works - as far as that goes. But it turns out that the entire tutorial is no longer valid; see my (Edward's) comment on canuckistani's answer.
My subsidiary questions about whether the SDK will even do what I want (changing some Find behaviour) and any other advice/resources still stand, however.

What do I need to know to create Xcode project templates?

I know some of the tutorials for creating Xcode project templates, for example this one here: http://robnapier.net/blog/project-templates-364
This is the best one I could find. All others basically repeat the same info, or are no longer up to date, or worse tell me that even they don't know what they're doing. Possibly useful tools that are linked to here and in other places are no longer available.
I keep running into roadblocks, and would like to gather as much information as possible on the process of creating Xcode project templates. Info that is most importantly up to date (at least it must be relevant for Xcode 3 or higher).
For example, what I'd like to see is:
a description of the
TemplateChooser.plist and similar
plist files and what these options do
(in my case, once I add a
TemplateChooser.plist, my project
disappears from the Xcode project
template list)
how to create a project template that references another .xcodeproj (when I do that, the other .xcodeproj appears in the project template list even though it doesn't use the special naming convention)
processes that can be applied, for example is it possible to run a script during the creating of a project from a template? This would be useful to unzip certain files into the newly created project.
If you have the answer or suggestions to any of the issues above, I'd appreciate that. Otherwise any link to good Xcode project template resources would be highly recommended. Especially if there is an official documentation from Apple - I haven't found one yet which seems to imply that project templates are undocumented.
Have you seen these:
http://www.sodeso.nl/?p=895
http://www.codeproject.com/KB/iPhone/CreatingXcodeProject.aspx
If you say you have searched, I'm pretty sure you've already seen the links but these are the best resources I could find with my 'googlabilities'
You might try contact this guy - http://linkedin.com/in/mottishneor he has some related messages around the web
The links suggested by FX are also not bad at all!
There is indeed little XCode template info out there. What I have found of interest are the following links (I documented myself on the topic, but haven't yet gone any further):
a Google Code search reveals a few examples, but not much
in particular, I found interesting to look at the code provided by Three20; they have some basic examples, like here
referencing another project worked for me, so maybe you could open a specific question about that giving more details?
there is information scattered on the Apple mailing-lists
there is no official documentation from Apple, as is evidenced by the lack of results to this query
I'm sorry if this is not a Enlighting, concise answer. As you said, it's not well documented, and sources are all over the place. I just hope I could highlight some places to find information that your own searches might not have reached :)
I don't have a Mac anymore, so this is as much as I can give you without testing this myself. As far as I can tell, Xcode templates are undocumented by Apple.
This guy has some guides for messing with Xcode templates but the info is pretty sparse. My suggestion for working with templateChooser.plist is to try to only edit that file in the interface builder.
This guide is a good example of how to add a reference to another .xcodeproj. For the reason you were having trouble adding a reference to your project we probably need more information.
If you scroll way down in this doc you can that each template already includes a script called myscript.sh. This script will show up in the scripts menu for projects built with that template. That isn't quite as convenient as running scripts automatically, but it's better than nothing.
In conclusion, Xcode template documentation is a nightmare. It looks like there are a lot of powerful features there, but they are obscured because of lack of user friendlyness and because documentation lags far behind Apples updates of Xcode. It just doesn't seem to be a priority for them. I hope this helps.
And yet another video link http://howtomakeiphoneapps.com/2010/10/how-to-make-custom-xcode-templates-with-video/

How do I use AFAssistantPane?

I have searched my entire Mac for ibplugin to find the QTKit IBPlugin, but I also came accros a plugin which adds AFAssistantPane to IB. I did a Google-search but Google has no results for it. So, does anyone know how I can use this AFAssistantPane?
alt text http://img59.imageshack.us/img59/7963/schermafbeelding2010052.png
Thanks
Update: I noted that this is in a private framework (that's why it is not documented).
Update: The framework doesn't include header files. Must I hack it and recreate the header files?
There is a command line utility for exploration of private frameworks called class-dump. You can google for it. Here's the first result that came up for me: Dumping the iPhone 2.2 Frameworks.

How can I create Xcode docsets that look and work like the ones in Apple Core Library

I want to create a docset for my API that looks and works like the Apple Core Library docset. For example, look at the page for NSString.
I've tried Doxygen and I've tried headerdoc2html. Neither does very close to what I want.
The files generated by headerdoc don't have most of the higher-level structure that the Apple files do, and the graphics design is different. Down at the more detailed level, like when looking at a specific method, things are closer, but don't have all the detailed structure.
The files generated by Doxygen have a very different high-level structure, not to mention having a very different graphic design.
What else should I try? Or are there parameters to either of these tools that would give me something closer?
Thanks, Pat
The best I have found so far is Tomaz's appledoc. With it I can create apple style api documentation and instal it directly into the DocSets that Xcode is uisng. Works very well and is based on doxygen.
You can use Doxygen to generate Xcode docsets.
Unfortunatelly, the Doxygen output looking and behaving like an Apple Developer Library Document is still to be discovered...
I'm also really interested in this :( Ive been able to generate docsets and doxygen docs but if I could make them look the same (or approaching) as the "normal" apple docs (like SDK ones), that would be better. :/

Resources