-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added PRINTER_INFO_2 support and GetPrinter function #569
Conversation
Don't change the whole tabs vs. spaces thing, looks like your editor brought a bunch of extra changes here. The new mappings need tests, please. Update CHANGELOG. |
I just updated the changelog. Also, I reduced the changes made by the editor (eclipse). You can test for (PRINTER_INFO_2 printerInfo : WinspoolUtil.getPrinterInfo2()) {
System.out.println(printerInfo.pPrinterName + ": " + printerInfo.pDriverName);
}
System.out.println("---ALL---");
for (PRINTER_INFO_2 printerInfo : WinspoolUtil.getAllPrinterInfo2()) {
System.out.println(printerInfo.pPrinterName + ": " + printerInfo.pDriverName);
}
System.out.println("---BY NAME---");
PRINTER_INFO_2 printerInfo = WinspoolUtil.getPrinterInfo2("Adobe PDF");
System.out.println(printerInfo.pPrinterName + ": " + printerInfo.pDriverName); I just added the modified JNA classes to my project to test it. I don't know how to make an specific test inside JNA. |
@@ -7,6 +7,7 @@ Next release | |||
|
|||
Features | |||
-------- | |||
* [#569](https://github.com/java-native-access/jna/pull/569): Added PRINTER_INFO_2 support and GetPrinter function [@IvanRF](https://github.com/IvanRF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this look like the lines below. The class names are usually included with the full name like com.sun...
, not everybody uses Windows.
You need actual tests for these methods. Even something basic that expects a certain return code or expects at least some data. |
Please also squash multiple commits, thanks. |
How do I "squash" commits? |
There're a few good docs on this, like http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html. A totally different approach could be http://code.dblock.org/2015/08/31/getting-out-of-your-first-git-mess.html. |
For the code in |
WRT exception handling, it's possible old code didn't do this right, everything that can fail should be checked and raise an exception. |
I added a check for The return value for the first call to
If an exception is added there, it will always throw it. I tested it. |
@@ -7,6 +7,7 @@ Next release | |||
|
|||
Features | |||
-------- | |||
* [#569](https://github.com/java-native-access/jna/pull/569): Added `com.sun.jna.platform.win32.Winspool.PRINTER_INFO_2` support and GetPrinter function in `com.sun.jna.platform.win32.Winspool` [@IvanRF](https://github.com/IvanRF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax of your line and the one below is different, it's - [@](...).
, if you don't mind fixing please.
Makes sense WRT the This still needs tests. |
Fixed the syntax in CHANGED.md, I used the first entry as example but was wrong and I had followed that. I corrected both. |
Still needs tests and a rebase. |
@dblock rebase done. |
4eb408f
to
5bbf48b
Compare
i am cool with this, merging. |
Added PRINTER_INFO_2 support and GetPrinter function
Thanks! 👍 |
Issue #568