Skip to content
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

Updated X11 contrib API #350

Closed
wants to merge 15 commits into from
Closed

Updated X11 contrib API #350

wants to merge 15 commits into from

Conversation

rm5248
Copy link
Contributor

@rm5248 rm5248 commented Jul 19, 2014

I've updated the jnacontrib.x11 to fix a few bugs and add in a feature. Eclipse also reformatted the code, so there are some minor whitespace differences.

Bugs fixed:
-X.getXXXProperty() will now return null if the property is not found(see: http://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html)

New features:
-Added the ability to get all of the subwindows of an X.Window
-XDesktopDemo GUI now has a button to display all of the subwindows of the selected window in a dialog box

@dblock
Copy link
Member

dblock commented Jul 21, 2014

Thanks! Could you please squash these and add a line to the CHANGES.md?

public int getIntProperty(X11.Atom xa_prop_type, X11.Atom xa_prop_name) throws X11Exception {
return bytesToInt(getProperty(xa_prop_type, xa_prop_name));
public Integer getIntProperty(X11.Atom xa_prop_type, X11.Atom xa_prop_name) throws X11Exception {
byte[] property = getProperty(xa_prop_type, xa_prop_name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes all need tests. I would merge without since this is contrib stuff, but I really encourage you to write them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could write tests; the problem is that because this is X programming, any tests are going to be highly dependent on what window manager is running and what windows are open at the time, and as far as I'm aware there's no good way to test GUI-related elements like this.

@@ -17,11 +17,13 @@ Features
* [#338](https://github.com/twall/jna/pull/338): Added `com.sun.jna.platform.mac.XAttr` and `com.sun.jna.platform.mac.XAttrUtil` JNA wrapper for `<sys/xattr.h>` for Mac OS X - [@rednoah](https://github.com/rednoah).
* [#339](https://github.com/twall/jna/pull/339): Added `GetWindowPlacement`, `SetWindowPlacement`, `AdjustWindowRect`, `AdjustWindowRectEx`, `ExitWindowsEx`, and `LockWorkstation` to `com.sun.jna.platform.win32.User32` - [@Timeroot](https://github.com/Timeroot).
* [#286](https://github.com/twall/jna/pull/286): Added in com.sun.jna.platform.win32.Kernel32: CreateRemoteThread, WritePocessMemory and ReadProcessMemory - [@sstokic-tgm](https://github.com/sstokic-tgm).
* Object-oriented X API allows you to get subwindows of an X.Window - [@rm5248](https://github.com/rm5248)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a link to the PR in front, please. Also missing a dot at the end of the line :)

Try to say exactly what changed, don't assume people know what "object-oriented X API' is, name the classes and the methods.

@dblock
Copy link
Member

dblock commented Jul 23, 2014

Do you mind squashing these commits, please? I'll merge.

rm5248 added 10 commits July 23, 2014 16:41
…see the recursive X windows

Ensured that getting all windows from the X server works properly on 32-bit

fixed indentation to be spaces instead of tabs

more fixing of formatting

added a changes line to the CHANGES.md file

fixed changes.md

Added the ability to see all subwindows.  Added a dialog so users can see the recursive X windows

Ensured that getting all windows from the X server works properly on 32-bit

fixed indentation to be spaces instead of tabs

more fixing of formatting

added a changes line to the CHANGES.md file

fixed changes.md
Conflicts:
	contrib/x11/src/jnacontrib/x11/api/X.java
	contrib/x11/src/jnacontrib/x11/demos/XDesktopDemo.java
@rm5248
Copy link
Contributor Author

rm5248 commented Jul 23, 2014

Okay, so I updated the CHANGES.md. I'm not sure if I squashed the commits together properly though(I'm rather unfamiliar with git)

@dblock
Copy link
Member

dblock commented Jul 24, 2014

You still had a merge conflict in CHANGES. I've merged this via 80d4c13. Thank you.

Your master now carries all kinds of changes that you don't want (unsquashed and merge conflict). What you should do is rebase it, here's an easy way:

git checkout master
# save your code on a branch, just in case
git checkout -b save-my-code
git checkout master
# just rewind a 100 commits back
git reset HEAD~100 --hard
# if you don't have an upstream remove, git remote add upstream git@github.com:twall/jna.git
git pull upstream master
git push origin master -f

In the end you will have code saved in save-my-code and your master will look like the twall's master. Next time you make code changes, work off a branch (start with git checkout -b feature-branch).

@dblock dblock closed this Jul 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants