Open file in new GVim window within a single session - editor

I would like to have two windows opened while running a single GVim session. Just like tabs but placed in two separate windows. This kind of setup is handy for dual screen setup. I haven't found anything relevant in the manual. Is it possible?

I don't think this is possible I'm afraid. I'd suggest you send an email to the mailing list with a feature request. I can see that it would be useful, but you'd need to have a lot of extra keyboard commands equivalent to Ctrl-W h to switch between different windows.
It's also very GUI specific and most of the functionality in Vim is designed to work in both the GUI and the TUI.

Related

GIMP How to use python console (or make plugin) to navigate between images

Note: This applies to windows only, due to the inherent problems from using standard, free automation tools for (EDIT: GDK) applications on Windows. If there is a better way to work with automating GDK on Windows than AutoIt, please let me know)
I am trying to automate some tasks in GIMP using AutoIT mostly, which is mostly simple enough, however, moving from open image to open image is problematic. There are two ways I have done this (using AutoIt) so far: Automatically click on the arrows (in single window mode) to scroll from image to image, and 2) using right and left arrow KEYS to do same.
There are problems with both approaches. For the first approach I can not do anything else with my computer until the AutoIt script is done processing because it is occupying my mouse. And we are talking about 100 or so images each time.
For the second approach it requires, I do not know the proper word, but 'thumbnail bar' at the top, that the thumbnail bar be 'active' or else using arrow keys does not work. you CAN make it active by clicking on an image inside of it, once or twice depending on state, but then I have to do all sorts of gymnastics to know which ACTUAL image I am supposed to be on in order to proceed.
That brings me to conclude the best solution is to have some programmatic way, in a Python or Scheme plugin (or a simple command or two, that I can have AutoIt simply paste into the console) to allow me to move between images in a very reliable, non-obtrusive, simple way.
Thank you in advance.
Dev
Normally, you can't. By design, the script-fu and python-fu API deal with images processing and cannot interfere with the UI. You can just open windows (a.k.a. "displays") on images and delete them (and only those your script created).
But you can write Python/Scheme scripts to do the tasks directly instead of trying to do them by emulating a human...

Printing a page to different printers in a web app

I want to write a web app that can process a users presentation which when submitted, gets sent to their local system printers - one part of the order will go to B&W laser printer and another part goes to another printer for another process.
Ideally, this will be able to run on any of the major systems - Linux, OSX or Windows.
It could be a packaged Chrome or Firefox app or extension, but I can't tell if there is sufficient access to the system printers. (I can see all the printers available to my current chrome installation - but are they available to an extension?). I can't see the code in any demos or libraries.
I've seen reference to NPAPI, but I can't tell if that's what I need either - if so would I need to write an app for each of the major platforms or each kind of printer?
In Firefox it is possible to print from an extension. Using only javascript, that is (you're free to mess about with C++ if you like).
Extensions are essentially the browser: Everything the browser can do, an extension can, too.
There is however not much documentation about using the printer. To be precise, there is none that I'm aware of. However, the browser is open source, and the UI is mostly Javascript, so you can just read the code.
printUtils.js would be a good starting point to check out how this might work. Also there is a component implementing nsIPrinterEnumerator. See the firefox-addon info section for a collection of "Getting started" and documentation resources about add-on development in general.
I don't think the Chrome extension API provides ways to control printing the way you'd need.
The NPAPI plugin API does not provide enough control over printing. You just basically get a buffer to draw into, but no way to control printing setting or initiate printing yourself. You could cheat of course, and have your plugin directly print something via OS bypassing the browser, like e.g. those PDF readers do. However, it should be noted that NPAPI plugins are the past... Don't develop new ones, if possible.

Binding a trackball to NPAPI

I want to use a second pointing device (the trackball) as a control for a specific function on a program. This means I would NOT want any mouse functionality from the trackball, I just want to get the movement data and somehow use the NPAPI to get that into our web app. Is there a way to bind a mouse/trackball to a specific program that it doesn't act as a mouse/trackball for the computer?
Thanks in advance!
UPDATED: actually ask a question
To the best of my knowledge and my understanding of how HID devices work, there is no way to do what you want to do. If you could do it at all, you could probably do it from an NPAPI plugin, but there is no way to tell the operating system not to take control of one specific pointing device as opposed to any others.
Now, if you had a special HID trackball that didn't show up as being a regular pointing device then you could possibly do it with that, but I have never heard of any way to take control of just one of potentially many HID pointing devices on windows, linux, or mac.
There may be a way to hack something together in Linux by changing the way the drivers work, etc, but I don't know of any.

How to get the property list and values of a control within a third-party Delphi application?

I'd like to get information about a third party application's controls such as a list of its properties and their values: something like RTTI information but for a third-party Delphi application.
I see that this is possible. For example TestComplete has the ObjectSpy window which can give many useful information about the control, including RTTI information. How can this be done ?
Edit: To explain why I'm investigating this issue... I'm a registered user of TestComplete/TestExecute and I do like... most of it. I can get over the minor things but the one major problem for me is their license verification system which requires me to have a physical computer (not a virtual machine) always on just for the sake of running a license server so that TestExecute can run at night. As I have basic testing needs (compare screenshots and check basic Delphi component's properties) I wondered how hard it would be to make my own private very simple "TestExecute-like" application.
To go further, I suggest you these relevant resources found here on SO
Writing a very basic debugger (The accepted answer along with its comment thread are all valuable).
Is it possible to access memory from an application to another ? How? (Excerpt from the accepted answer: It is possible. Just use the Windows API functions WriteProcessMemory/ReadProcessMemory. Pass in the handle of the process and the pointer to the data).
Search the memory of another process (The excellent accepted answer also forwards to another valuable resource delphi-code-coverage by Christer Fahlgren and Nick Ring).
StackWalk of other process in delphi? (Check Barry Kelly's answer !!!, the same for the one from the AsmProfiler author !!!).
I strongly suggest you to port to Delphi this c++ project entitled Get Process Info with NtQueryInformationProcess: A hands on experience on using ReadProcessMemory to access the CommandLine used to launch another process.
Last Edit:
NtQuerySystemInformation Delphi Example.
RRUZ's answer to Delphi - get what files are opened by an application as suggested by LU RD.
When we want to take another application which is compiled with debug information and get stuff out of it at runtime, what we are dealing with is the problem of "how to write my own custom debugger/profiler/automated-test kernel".
TestComplete and other AutomatedQA programs contain a Debugger and Profiler Kernel which can start up, run and remotely control apps, and parse their Debug information in several formats, including the TurboDebugger TD32 information attached to these executables. Their profiling kernel also can see each object as it is created, and can iterate the RTTI-like debug information to determine that an object that was created is of a particular class type, and then see what properties exist in that object.
Now, TestComplete adds on top of the AQTime-level of stuff, the ability to introspect Window handles, and intuit from Window Handles, the Delphi class Names that are behind it. However, it's much easier for you (or me) to write a program which can tell you that the mouse is over a window handle that belongs to a TPanel, than to know which version of Delphi created that particular executable, what version of TPanel that is, then, and what properties it would contain, and to read those values back from a running program, which requires that you implement your own "debugger engine". I am not aware of any open source applications that you could even use to get a start writing your own debugger, and you certainly can't use the ones that are inside AQTime/TestComplete, or the one inside Delphi itself, in your own apps.
I could not write you a sample program to do this, but even if I could, it would require a lot of third-party library support. To see the window classes for a window handle which your mouse is over, look for how to implement something like the MS Spy++ utility.
An easy case is if your mouse is mousing over a window inside your own application. For that, see this about.com link, which simply uses RTTI.

Web-based printing solutions

I'm building a new web-based product. The problem is that many clients have specific printers to print specific documents. Just think reports,barcodes,invoices etc. All on a special printer with the right paper etc...
Usually when printing from the web you cannot make the software choose a printer or change the settings. However it's just that that I want to do.
I want to print without a dialog. And enter the printer + settings with my software
The only solution I know of now is the commercial version of acrobat that has some javascript printing support..
Does anyone know of any other alternatives ?
Thanks in advance !
small-medium business
No heavy installion but common stuff is ok
ie. flash/silverlight/acrobat/whatever is possible
I generate what is necessary for printing (PDF/Tiff etc)
Who are your customers -- enterprises or SOHO? Are you generating PDFs? Or, raw tiffs? If you are generating PDFs there is something called a JDF file where you can specify the print settings to your heart's content. The flip side is the device needs to be capable of understanding JDFs. You can then attach the JDF with the PDF as a mime package. If you are generating tiffs, I think there isn't much need of printer settings except for the correct device profile(s) to be installed.
Because of security reasons, you cannot control that from within the browser.
If I where in your shoes, I'd create a small program for my clients to install, registering a specific file extension to this program and creating files in this format on the website, and have the program do the printing for me.
Your easy choices are either PDF or Microsoft's Reporting/Report Viewer

Resources