-
Notifications
You must be signed in to change notification settings - Fork 143
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
Implementation of GC to enable multi zoom level support for win32 #1214
Implementation of GC to enable multi zoom level support for win32 #1214
Conversation
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.
Hi @amartya4256 , thank you for your contribution.
I noticed some problems with the visibility of some fields (the most serious one is allowing to set the deviceZoom
and nativeDeviceZoom
separately.
Could you please look into it?
Thank you.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
Outdated
Show resolved
Hide resolved
3a3458a
to
18b420d
Compare
I just wanted to note that (platform dependent) package private or even public fields / methods are quite common, they should just be documented in this case as platform dependent. |
@laeubi Is it really necessary to specify that a package private field/method inside a fragment is platform-dependent? I mean the fragment is already platform-dependent and the field/method can't be seen outside the fragment. Or am I missing something? |
@fedejeanne I have only seen it on public field, so maybe in my sentence it should read as an XOR so:
:-) |
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 tests are broken
tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/graphics/GCWin32Tests.java
Show resolved
Hide resolved
tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/graphics/GCWin32Tests.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/graphics/GCWin32Tests.java
Outdated
Show resolved
Hide resolved
Note that new test classes in a test plug-in usually need to be added to the plug-ins test suite. In the win32 SWT tests, this is the If you cannot provide reasonable, sufficient tests via public API only, you need to add the test cases in the win32 fragments, as prepared for the |
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
Outdated
Show resolved
Hide resolved
27f3996
to
40f7c63
Compare
40f7c63
to
90e57ec
Compare
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.
I have some remarks and questions regarding the current design for which I need some clarification before I can approve this. The essential problem I have here is with respect to responsibilities. My understanding is that in the proposed implementation Controls
are reponsible for updating zoom data used by a GC
indirectly via changing values in GCData
. This leads to visibility problems, duplicated logic for setting these values across package borders etc.. Since these values only seem to be a cache of information provided by the underlying Drawable
of a GC
, I do not understand why (1) this caching is necessary and (2) why GC
cannot simply listen for zoom change events at the Control
and then update the data itself but requires the Control
to take care of it.
And even if the information really have to be provided to GCData
(e.g., because they will be required by other Resources
, as mentioned in the PR description), I would still expect the GC
to be responsible for updating them and not the Controls
. Then you should also get rid of the current visibility problems.
Please also extend the commit description with information about
- why these changes are necessary, and
- what they do,
so that people are able to understand the changes only by the commit, even without the PR.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
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.
It seems that some fields added here will not be necessary in future PRs (see Shell
and Widget
), please remove them.
Also, the method GCData::setNativeZoomForGCData
suffers from a code smell, it would be nice if it's not necessary or if it can be done differently.
Have the tests been addressed yet?
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
Outdated
Show resolved
Hide resolved
90e57ec
to
ffac213
Compare
I updated this PR with respect to the PR #1229. It should look more consistent now. |
6d41ade
to
ddd2019
Compare
tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/graphics/GCWin32Tests.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
ddd2019
to
67e2821
Compare
34ba421
to
8b87c03
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
8b87c03
to
e8042f4
Compare
40aebd9
to
e24d0b0
Compare
e24d0b0
to
fc43e74
Compare
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 changes look good now. Only the "actual" commit of this PR seems to contain the changes that have been extracted into #1258. Could you please rebase this PR onto its dependencies (i.e., the PRs that need to be merged before)?
Removing my request for changes as concerns have been addressed, but cannot give approval because commit trace has to be adapted.
@amartya4256 merging the required PR introduced a conflict in this PR, so please resolve and rebase on master once you find the time |
fc43e74
to
bfe1d1c
Compare
This PR now depends on #1258 because of splitting the OS bindings to a separate PR. I have rebased it to the PR and I would update the description. |
bfe1d1c
to
2ea5502
Compare
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 changes themselves still look good.
@amartya4256 Could you please improve the commit message with some more details on how GC is changed to enhance multi-zoom support?
2ea5502
to
63c791a
Compare
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.
LGTM. I'm going to test it tomorrow and merge it.
This commit contributes to multi zoom level support of GC which can be extended by other resources and widgets. Contributes to eclipse-platform#62 and eclipse-platform#131
63c791a
to
f23c721
Compare
Addressed issues
Requires
Note: Only the last commit in this PR is to be reviewed. Previous commit(s) belong to the prerequisite PR(s)
Unlocks
Description
This pull request is a base pull request for several following PRs which implement multi zoom level support for different components (resources, widgets, etc).
In this PR, the focus is on GC to enable it to use the zoom level information which is added to widget. Also, it provides zoom level information in GCData which can later be used by resources like Image, Region, etc which don't have the zoom information since they are not a widget. Also, GC now uses the DPIUtil methods with zoom for getting the size as per the zoom level. This zoom in GC is derived from the GCData where we add the zoom information.