I use Doxygen for documenting the JavaScript API of my C++ (Qt) project. The idea is to write one specific documentation for the JavaScript interfaces, and one for the C++ classes us usual.
One example (datasource.dox) looks like this:
\addtogroup JavaScriptAPI
#{
...
\class DataSource
\brief DataSource is the .... some doc goes here ....
\section formats Supported formats
....
\fn isOpen()
\brief returns true if the data source is currently open...
...
#}
The generated help looks nice w.r.t. the class description (or 'object'-description), but the function documentation (isOpen(), ...) is missing. Doxygen creates warning messages like:
Warning: documented function `bool isOpen' was not declared or defined.
The question, now: can I somehow force doxygen to use my \fn-d function descriptions? It would be nice, if doxygen created all those member indices for me...
Two approaches for using doxygen with Javascript are listed here http://www.doxygen.org/helpers.html
(look for JavaScript)
Related
What does the two colons before the toString() method invocation mean?
For instance, I found the following code:
orderXml.ns::['status'].toString();
Is it the same as ['status'].toString().call(orderXml.ns);?
I am using the Demandware Script above.
Thank you.
In Demandware Script you'll find that a long-deprecated concept called E4X which extends the JavaScript 1.6/ES3 syntax still exists. However, it's usage is now discouraged. You can find some documentation for this syntax here: https://developer.mozilla.org/en-US/docs/Archive/Web/E4X/Processing_XML_with_E4X
In the script snippet you provided, the colons are used to identify the XML namespace of the following expression. Without that namespace, you may find that the incorrect object is referenced or you may get an undefined reference. See the specific area of the documentation archive linked above that pertains to Namespaces: https://developer.mozilla.org/en-US/docs/Archive/Web/E4X/Processing_XML_with_E4X#Handling_namespaces
The code essentially looks for an object property with the name: status. This isn't actually Array notation as it appears upon cursory inspection. Specifically, it looks for a namespaced property. It would not be the same as calling:
['status'].toString().call(orderXml.ns);
The .toString() method is used to ensure we get the String representation of the property rather than a reference to an instance of that XML Node.
Please note that Demandware uses a modified version of the Mozilla Rhino 1.7R5 JavaScript implementation. See feature matrix here: https://mozilla.github.io/rhino/compat/engines.html
I have created a new solution for my MvvmCross app that supported Windows Store and I want to support UWP on Windows 10. I have moved over the PCL successfully, but I am having problems getting the basic UWP app working using a sample provided by MS (NavigationMenu) which uses the SplitView and the AppShell pattern they are recommending for the new navigation/command model. I referenced a helpful blog post (http://stephanvs.com/implementing-a-multi-region-presenter-for-windows-10-uwp-and-mvvmcross/), which gave me some guidance on how to integrate mvvmcross into the AppShell, but startup is failing because the AppShell does not have a valid Frame defined. Frame is a read-only property, and I have been unable to see where this is being set up.
I am using the standard AppShell implementation from the NavigationMenu with the following changes as recommended in the blog post:
public sealed partial class AppShell : MvxWindowsPage // was Page
public Frame AppFrame { get { return this.Frame; } } // was this.frame
Except for code after the error, there are no differences in the setup. In looking at the MvxWindowsPage implementation, there doesn't seem to be anything special as it still invokes the Page initialization. Is there something obvious I am missing?
So the link to the blogpost is correct, in other words you'll need to use MultiRegions from MvvmCross to get this working.
But what the blogpost doesn't show is a complete working version...
I've added one on my github here:
https://github.com/Depechie/MvvmCrossUWPSplitView
Some pointers to take away, like I said in the comments.
Your view where the SplitView will be present, needs to have a property to return a valid Frame to look for while injecting new views. This can be returned like this return (Frame)this.WrappedFrame.UnderlyingControl; found in the code here https://github.com/Depechie/MvvmCrossUWPSplitView/blob/master/MvvmCrossUWP.Win/Views/FirstView.xaml.cs#L13
Than all views you want to load up in the SplitView will need to reference to the region you defined in that SplitView, in my case I named it FrameContent as seen here https://github.com/Depechie/MvvmCrossUWPSplitView/blob/master/MvvmCrossUWP.Win/Views/FirstView.xaml#L48
So use that name for the region attribute in all to be loaded views like so [MvxRegion("FrameContent")] example here https://github.com/Depechie/MvvmCrossUWPSplitView/blob/master/MvvmCrossUWP.Win/Views/SecondView.xaml.cs#L7
I see what you're trying to do with the SplitView template that's provided by Microsoft. There is however a mismatch between things managed by MvvmCross and UWP.
By default MvvmCross maps ViewModels to Views based on naming conventions. What you are trying to do is use a view 'AppShell' (which is derived of Windows.UI.Xaml.Controls.Page) that doesn't adhere to the default MvvmCross convention.
The way I choose to implement this SplitView (Hamburger) functionality is by deleting the provided AppShell class entirely. I then created a new view named HomeView (since I have a ViewModel with the name HomeViewModel) and added the SplitView control there as described in the post you mentioned above.
For completeness I've created a Gist with the App.xaml.cs and HomeView.xaml as you requested. You can find them here: https://gist.github.com/Stephanvs/7bb2cdc9dbf15cb7a90f
I use doxygen to document C++ code. In the current project, I use the following format for function signatures:
MyClass(MyClass&& other)
However, in the generated HTML documentation, the brief description has this signature:
MyClass (MyClass &&other)
and the detailed description has this signature:
MyClass ( MyClass && other )
Is there a way of either preserving the original format, or changing the way doxygen formats the signatures? I have not found anything related to this issue in the customization or configuration pages.
Edit: Updated the signatures based on the discussion in the comments.
Short answer: No.
Long (and more correct) answer: Yes, if you're willing to modify the source code.
File memberdef.cpp has the following (line 1668 in what I'm looking at today):
// *** write arguments
if (argsString() && !isObjCMethod())
{
if (!isDefine() && !isTypedef()) ol.writeString(" ");
That last line is going to add space in the brief description. (I've verified this by removing it and recompiling.)
As for the detailed description, that sets up a table, with <td>(</td> opening the arguments list. You might get rid of that space more easily, but doing it well will probably require monkeying with the source code.
I guess the best option is to roll your own, or to request a feature addition from the developers.
I'm trying to convert the GTK+2 code to compile and run on GTK+3. In the old code I have following:
gtk_widget_push_composite_child()/gtk_widget_pop_composite_child()
Now GTK+3 states that instead I should first call gtk_widget_init_template() and then gtk_widget_class_set_template()/gtk_widget_class_set_template_from_resource().
Now, those 2 functions use an XML template to build the composite widget from. Unfortunately there is no example on how to make one and what to pass to those function(s).
Do I pass the XML file name? The XML tree root node? The schema verification? Trying to google for the code example didn't yield anything useful.
Can anyone shed some light on this please?
There is an old blog post "Announcing Composite Widget Templates" that explains how it works. Usually taking a look at gtk3-demo should shed some light (better to run it).
To pass the name, you call it in the init method, as the example in the blog post:
static void
my_widget_class_init (MyWidgetClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
/* Setup the template GtkBuilder xml for this class
*/
gtk_widget_class_set_template_from_resource (widget_class, "/org/foo/my/mywidget.ui");
}
static void
my_widget_init (MyWidget *widget)
{
/* Initialize the template for this instance */
gtk_widget_init_template (GTK_WIDGET (widget));
}
The resources' files would look something like:
<gresources>
<gresource prefix="/org/foo/my">
<file alias="ui/password-view.ui" compressed="true" preprocess="xml-stripblanks">myapp-mywidget.ui</file>
</gresource>
</gresources>
In some part of your code, you will need to load the resources' file, where myapp-mywidget.ui is the actual filename with the UI file. You can have one file per template, and all of them listed in the resources' file.
I've seen that some projects used _ function that takes string as an argument, like _("Hello World"). But I couldn't find any manuals or articles about what is it and how to use it.
I guess this has something to do with i18n and l10n (it was mentioned in some article I found on the internet), but can you explain to me how it works and how to use it?
That is the GNU gettext localization function. You can provide language specific alternate strings for the one specified in the function call.
There is the xgettext tool, which generates a .pot file (abbreviation for portable object template) from your application code, then translators can make .po localization files for it. Then, you can bundle these with your application, and deliver a more widely usable piece of software.
I18n. See gettext example here: https://ewgeny.wordpress.com/2012/05/10/supporting-multiple-languages-in-your-application-a-simple-gettext-step-by-step-example/
Also found some info about what exactly this function do, it seems to be the macro for Glib.dgettext() function in Vala, this is from valadoc.org:
dgettext
public unowned string dgettext (string? domain, string msgid)
This function is a wrapper of dgettext which does not translate the message if the default domain as set with textdomain has no translations for the current locale.
...
Applications should normally not use this function directly, but use the _ macro for translations.