goocanvas how to switch of antialiasing - c++

Can give me someone an idea how I can switch of the antialiasing for all items in a goocanvasmm?
I tried to get the root item model but this did not contain the antialiasing property.
I could not really find any valid documentation for goocanvasmm. I really need a tutorial but I can't find some.
[edit]
Sorry, I need the code for goocanvasmm!!! not goocanvas. So please do not edit this again. Yes, it is the c++ version of gtk+ called gtkmm and the goocanvasmm
[edit]
I have now a rect in the canvas and I could get the rect->property_antialias()=???? but now i struggled with PropertyProxy.
the following both lines will not work:
1)
rect->property_antialias()=CAIRO_ANTIALIAS_NONE ;
no match for »operator=« (operand types are »Glib::PropertyProxy« and »_cairo_antialias«)
2)
rect->property_antialias()=ANTIALIAS_NONE ;
error: 'ANTIALIAS_NONE' was not declared in this scope
Thanks!

GooCanvaItemSimple is the base class for most items. It has an antialias property which is of a type that maps to cairo_antialias_t.
This is for the C version, not C++, but it should be easy to map to the 'mm' versions of the docs. Here's the equivalent for antialias in goocanvasmm.
When you don't know where a property is, just dig in the parent classes or interfaces implemented until you find it.
Then, set the value of the appropriate Cairo::Antialias type (which is a type defined in cairomm).
rect->property_antialias() = Cairo::ANTIALIAS_NONE;

Related

autocompletion of parameter : list static fields without typing a ClassName::

How to make auto-completion list all (static) fields of a certain class that has appropriate variable-type when ctrl+space at a slot of parameter in a certain function?
Example
I tried to ctrl+space in the below code :-
(Code as text is here.)
Question: How to make it show E_1 E_2 E_3?
I don't mind another plugin if I really need one.
It currently works but only for enum :-
My workaround
In practice, to get smart clue, I have to type more (PrototypeList::) :-
Bounty Reason
Here is the result of the current answer (citizenmatt's):-
It is different, but still not show E_1 E_2 E_3.
Have you tried Smart Completion? This feature will only show completion items that are valid for the current context. I think it works in C++, too.
In fact, ReSharper does help you here. All of E_1, E_2 and E_3 are in the completion list, but not on the top of it - they are assigned lower scores because they need an additional qualifier. That said, looks like there is still an issue with scoring:
E_2 and E_3 are in the list too, but they are not shown alongside E_1. We'll investigate this (RSCPP-19501).

How to define a primitive device in Proteus?

I'm trying to make my own full adder and some other devices as a sub-circuit in "Proteus" and use them several times in a bigger circuit.
The problem is when you copy a sub-circuit you need to rename all of its inner parts, otherwise, the parts with a same name in two sub-circuits would be considered as one, therefore you'd get some errors.
So I'd like to know if there is a way to define a full adder of my own and use it like "74LS183" which is a primitive device, and by primitive I mean it has been defined in the library.
From answer posted here
It's in the Proteus Help file:
SCHEMATIC CAPTURE HELP (F1) -> MULTI-SHEET DESIGNS -> Hierarchical Designs
See the section "Module Components":
Any ordinary component can be made into a module by setting the Attach Hierarchy Module checkbox on the Edit Component dialogue form.
The component's value is taken to be the name for the associated circuit,
and the component's reference serves as the instance name.
after this you can use your new implementation of that component with your new name. for making it available at library see "External Modules" section of proteus help.
The problem with copying is solved in "Proteus 8".not completely but sort of.
I mean you can copy a subcircuit without a need to change it's inner parts, but you must change the subcircuit name and I mean the bigger name above the subcircuit not the little one below it.
so there is no need to define a primitive.

QScintilla - Add color to words in a custom lexer

I am trying to create a custom lexer based off of JavaScript for QScintilla. I have figured out how to add keywords the the lexer. However, I can not figure out how to alter the way they look when typed in like it does when you type the word function, for example.
I need to figure out how to do this with, for example, the word "fill".
Here's the code I currently have:
QsciLexer *lexer=new QsciLexerJavaScript;
QsciAPIs *api = new QsciAPIs(lexer);
api->add("fill");
api->prepare();
ui->textEdit->setLexer(lexer);
You need to subclass the QsciLexerCustom class. Then you need to make/configure several QsciStyle objects inside that class. The actual syntax highlighting is done in the styleText() function, which you need to override.
You can find detailed explanation on this website:
https://qscintilla.com/
More specifically on this page:
https://qscintilla.com/syntax-highlighting/
I hope it helps

How I do find properties name list of a object

JSAPI provide function JS_GetProperty to get specified property name's value
but how to get them as name list / all properties name ?
found similar issue on link below
https://groups.google.com/forum/?fromgroups#!topic/mozilla.dev.tech.js-engine/usHtJn4LR7A
Thank you very much ,sir
There are two ways to approach this. The older JS_Enumerate function or the combination of JS_NewPropertyIterator and JS_NextProperty. I would recommend the latter, because you don't have to mess around with the jsid array yourself.

Softimage access parameters in C++

I'm a bit desperate here... I'm trying to access one parameter of a light in Softimage.
First, when we do this:
light.GetParameterValue(L"LightExponent")
it works!
But when we try:
light.GetParameterValue(L"soft_light.atten")
it fails completely!
I tried to find documentation, but the only code that I could find is in Python and no indication for the equivalent in C++. In python, they manage to do something like:
xsi = Application
test = xsi.GetValue("LightName.point.soft_light.atten")
But I cannot figure out what is Application, and it's not the same as XSI::Application in the API.
So, any idea how to access this value ? Also, if I could found the equivalent to Application.GetValue (in the script, you can see Application.SetValue... so I imagine that GetValue exists in some form!) in C++, that would be nice... I could simply use the name of the light and then add the information that I need to access that value like:
SomeUnknownClassForNow::GetValue(light.GetName() + ".point.soft_light.atten");
Any idea ?
With the help of a client of ours, I finally managed to find a proper solution to this.
First, there's some direct parameters, like "LightExponent". But there's other parameters associated with an object, like a light, in other categories called Shaders.
With a light, or a least a point light, there's only one Shader, called "soft_light". It's possible to access it by:
light.GetShaders()[0]
It's possible to verify its name to with GetName(). Which, in this case, would be "LightName.point.soft_light".
Finally, to access the "soft_light.atten" parameter:
light.GetShaders()[0].GetParameterValue("atten")
So, in Softimage, there's sort of Hierarchy in objects and all these a separated as shaders. For more complex object, just find the right shader and extract its parameter.