Define custom properties for x11 windows in order to associate additional data with them - c

I'm trying to work out how to define my own window properties in xcb/x11, in order to be able to associate additional data with a window.
I can set and retrieve the pre-defined properties, such as XCB_ATOM_WM_NAME, using xcb_change_property() and xcb_get_property(), just fine, but can't figure out how to define new properties of my own.
A number of tutorials allude to this being possible, and indeed integral to the design, but nowhere can I find any guidance on how to go about it.

I don't know about xcb but in X you can create an Atom (Property) with
XInternAtom
The XInternAtom function returns the atom identifier associated with the specified atom_name string. If only_if_exists is False, the atom is created if it does not exist.
and modify/retrieve it by
XChangeProperty
XGetWindowProperty
xcb should provide something similar.

Related

VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT on swapchain ImageViews

I updated my nVidia drivers and suddenly started getting the following validation error:
VUID-vkCmdDrawIndexed-blendEnable-04727(ERROR / SPEC): msgNum:
-1979288290 - Validation Error: [ VUID-vkCmdDrawIndexed-blendEnable-04727 ] Object 0: handle =
0x5eb05e000000003b, type = VK_OBJECT_TYPE_PIPELINE; | MessageID =
0x8a06751e | vkCmdDrawIndexed: Image view's format features of the
color attachment (0) of the active subpass do not contain
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT bit, but active
pipeline's pAttachments[0].blendEnable is not VK_FALSE. The Vulkan
spec states: If rasterization is not disabled in the bound graphics
pipeline, then for each color attachment in the subpass, if the
corresponding image view's format features do not contain
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, then the blendEnable
member of the corresponding element of the pAttachments member of
pColorBlendState must be VK_FALSE
(https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-blendEnable-04727)
Things still render correctly, but I'd like to fix the validation issue.
I am a bit confused as to how I set the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag or if its part of the format vkGetPhysicalDeviceSurfaceFormatsKHR returns.
If it's the former, how do i set it and if it's the latter, how do i draw to it with blending enabled and not get validation errors?
Thank you!
Format features are not something you set; they're limitations that the Vulkan implementation informs you that you must work within. In particular, format features are properties that restrict how you may use any image with a particular combination of format, tiling, and so forth.
Swapchain images are subject to the same limitations as user-created images. The specification details what the equivalent VkImageCreateInfo would be for a particular vkCreateSwapchainKHR call. So those are the parameters you will need to send to vkGetPhysicalDeviceFormatProperties to see if your implementation supports some particular use of the swapchain image.
Blending is such a use. Apparently, whatever format you used to use allowed blending under the old driver, but this changed. And your code never verified that it was allowed.
Well, I missed another validation error that gave me the clue to find the issue. I had to update the VkApplicationInfo apiVersion to VK_API_VERSION_1_3. Leaving the answer here in case it helps anyone else.

Spreadsheet Gear migration errors

I am migrating Spreadsheet gear of my application from 6.0.3.190 to
7.4.1.104.I am getting my issues with Color property.Can any one help me in this.Now I am using using Color = System.Drawing.Color; and also ToSGColor().This became very hectic to do in all places where ever we use color.I expect we should have some shortcut to do this.Can any one suggest me How can i get all functionalities with few changes only.I am also getting exceptions to c onvert IColorFormat.LineColor to system.drawing.Color.
Note the "Breaking Changes" page in the SpreadsheetGear 2012 documentation, which lists this particular change:
In order to support WPF and Silverlight, the core API has been
separated from the GDI+ and Windows Forms APIs and therefore uses the
new SpreadsheetGear.Color type rather than
SpreadsheetGear.Drawing.Color. SpreadsheetGear.Drawing.Color has been
moved to SpreadsheetGear2012.Drawing.dll. See
SpreadsheetGear.Drawing.Color for an example which uses the implicit
and static converters to convert between SpreadsheetGear.Color,
SpreadsheetGear.Drawing.Color and System.Drawing.Color.
SpreadsheetGear.Colors and SpreadsheetGear.SystemColors provide
helpful predefined colors to replace the use of predefined colors in
System.Drawing.Color.
So you'll need to ensure than any place where you were previously using System.Drawing colors now use SpreadsheetGear.Drawing colors, including API like IColorFormat.LineColor.
There aren't really any "migration" tools to automatically convert such instances to the new API. So you'll need to resolve these errors for each code file. Doing a Find/Replace keyword search for "System.Drawing" and "SpreadsheetGear.Drawing" could possibly speed up the process, though this would depend on what using statements you have added to each code file.

Close method not working in Office

Im trying to use Microsoft.Office.Interop.Word._Document.Close() in a .net 3.5 windows form app.
No matter how much I search here and on Google I cannot find the correct parameters to put in the Close method.
I am using version 14.0.0.0 of Microsoft.Office.Interop.Word and I would like to close the document without saving and ideally ensure that the application can isolate the document thread so that users can still open word documents outside the running application.
See the Close method of the Document class described in MSDN. If you need to omit the parameter and use the default value - pass the Type.Missing parameter.
Try this:
object doNotSaveChanges = Word.WdSaveOptions.wdDoNotSaveChanges;
object missing = System.Reflection.Missing.Value;
_Document.Close(ref doNotSaveChanges, ref missing, ref missing);
This is the source
I'm not sure if you'll need the middle line or not. It's not from the original source it's from here

cakephp how to check variable content and all function included?

sorry i was new here so this problem maybe simple.
anyone knows how to check variable content?
like xx($a);
then page shows all relate information about $a. Is CakePHP allowed to do that?
i setup a kit on my cakephp
You might be looking for either var_dump() or print_r()
You can use PHP built-in functions like
var_dump() - displays structured information about variable
print_r() - the same, but preformatted with some differences
get_defined_vars() - returns array with all defined variables
Or use true CakePHP-way
Debugger::dump() - It will print out all properties and methods (if any) of the supplied variable
For more convenience you may use CakePHP Debug Kit plugin, which provides nice toolbar and some useful tools for your purpose.

Error when adding user-defined control to a form.

I have an user-defined control which includes a property ElementList of IList<WFParament> type. When I add my control into a form, I get the error:
"WorkFlowDesign.WFParament[]" can't be transfered into "WorkFlowDesign.WFParament[]"
Does your usercontrol do anything on load? If so, try wrapping it in:
if(!DesignMode)
{
//Do something
}
I would verify that you don't have two versions of the assembly containing the type WorkFowDesign.WFParament loaded/referenced. This could happen if your project where you are using the user control references one version of the assembly while the user defined control is compiled against a different version. If this is the case you will need to update one of the two so that they are referencing the same version of the assembly containing WorkflowDesign.WFParament.

Resources