Skip to content

Commit

Permalink
added the actual point of this project, also removed build files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicegamer7 committed Jan 24, 2019
1 parent 9c073bc commit e158028
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 108 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.vs/
/PluginReScale/x32/
/PluginReScale/x64/
71 changes: 13 additions & 58 deletions PluginGetScale/PluginGetScale.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2014 Birunthan Mohanathas
Copyright (C) 2019 Kermina Awad
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand All @@ -22,63 +22,6 @@ You should have received a copy of the GNU General Public License
using System.Drawing;
using Rainmeter;

// Overview: This example demonstrates the basic concept of Rainmeter C# plugins.

// Sample skin:
/*
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=000000
[mString]
Measure=Plugin
Plugin=SystemVersion.dll
Type=String
[mMajor]
Measure=Plugin
Plugin=SystemVersion.dll
Type=Major
[mMinor]
Measure=Plugin
Plugin=SystemVersion.dll
Type=Minor
[mNumber]
Measure=Plugin
Plugin=SystemVersion.dll
Type=Number
[Text1]
Meter=STRING
MeasureName=mString
MeasureName2=mMajor
MeasureName3=mMinor
MeasureName4=mNumber
X=5
Y=5
W=300
H=70
FontColor=FFFFFF
Text="String: %1#CRLF#Major: %2#CRLF#Minor: %3#CRLF#Number: %4#CRLF#"
[Text2]
Meter=STRING
MeasureName=mString
MeasureName2=mMajor
MeasureName3=mMinor
MeasureName4=mNumber
NumOfDecimals=1
X=5
Y=5R
W=300
H=70
FontColor=FFFFFF
Text="String: %1#CRLF#Major: %2#CRLF#Minor: %3#CRLF#Number: %4#CRLF#"
*/

namespace PluginGetScale
{
internal class Measure
Expand All @@ -93,12 +36,22 @@ public enum DeviceCap
// http://pinvoke.net/default.aspx/gdi32/GetDeviceCaps.html
}

public enum PROCESS_DPI_AWARENESS
{
PROCESS_DPI_UNAWARE,
PROCESS_SYSTEM_DPI_AWARE,
PROCESS_PER_MONITOR_DPI_AWARE
}
[DllImport("SHCore.dll", SetLastError=true)]
private static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);

internal Measure()
{
}

internal void Reload(Rainmeter.API api, ref double maxValue)
{
Measure.SetProcessDpiAwareness(PROCESS_DPI_AWARENESS.PROCESS_DPI_UNAWARE);
}

internal double Update()
Expand All @@ -110,6 +63,8 @@ internal double Update()

double ScreenScalingFactor = (double)PhysicalScreenHeight / (double)LogicalScreenHeight;

Measure.SetProcessDpiAwareness(PROCESS_DPI_AWARENESS.PROCESS_SYSTEM_DPI_AWARE);

return ScreenScalingFactor;

// https://stackoverflow.com/a/21450169
Expand Down
3 changes: 3 additions & 0 deletions PluginGetScale/PluginGetScale.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
<PropertyGroup>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
Expand Down
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file removed PluginGetScale/obj/x64/Release/GetScale.dll
Binary file not shown.
Empty file.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file removed PluginGetScale/obj/x86/Release/GetScale.dll
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.

0 comments on commit e158028

Please sign in to comment.