Skip to content

Commit

Permalink
v2.0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
briandunnington committed Mar 22, 2012
1 parent c6451c1 commit c2eadfe
Show file tree
Hide file tree
Showing 88 changed files with 23,562 additions and 1,474 deletions.
Binary file modified Growl Connectors/NET/libraries/Growl.Connector.dll
Binary file not shown.
Binary file modified Growl Connectors/NET/libraries/Growl.CoreLibrary.dll
Binary file not shown.
Binary file modified Growl Extras/Growl Display SDK/libraries/Growl.CoreLibrary.dll
Binary file not shown.
Binary file modified Growl Extras/Growl Display SDK/libraries/Growl.DisplayStyle.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions Growl/Growl.Connector/MessageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ public override byte[] GetBytes()
{
string keyHash = key.KeyHash;
string salt = key.Salt;
hashInfo = String.Format("{0}:{1}.{2}", DisplayName.Fetch(key.HashAlgorithm), keyHash, salt);
hashInfo = String.Format(" {0}:{1}.{2}", DisplayName.Fetch(key.HashAlgorithm), keyHash, salt);
}

// start building message
string s = String.Format("{0} {1} {2}", messageType, encryptionInfo, hashInfo);
string s = String.Format("{0} {1}{2}", messageType, encryptionInfo, hashInfo);
allBytes.AddRange(protocolHeaderBytes);
allBytes.AddRange(GetStringBytes(s.ToUpper()));
allBytes.AddRange(blankLineBytes);
Expand Down
4 changes: 2 additions & 2 deletions Growl/Growl.Connector/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.7.2")]
[assembly: AssemblyInformationalVersion("2.0.7")]
[assembly: AssemblyFileVersion("2.0.9.1")]
[assembly: AssemblyInformationalVersion("2.0.9")]
4 changes: 2 additions & 2 deletions Growl/Growl.CoreLibrary/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.7.2")]
[assembly: AssemblyInformationalVersion("2.0.7")]
[assembly: AssemblyFileVersion("2.0.9.1")]
[assembly: AssemblyInformationalVersion("2.0.9")]
3 changes: 2 additions & 1 deletion Growl/Growl.Daemon/BonjourService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ private Mono.Zeroconf.RegisterService Publish(string domain, string type, string
Stop();

Mono.Zeroconf.TxtRecord txt = new Mono.Zeroconf.TxtRecord();
txt.Add("txtvers", "1");
txt.Add("version", "1.0");
txt.Add("platform", "windows");
txt.Add("websocket", "13");

Mono.Zeroconf.RegisterService s = new Mono.Zeroconf.RegisterService();
s.Name = name;
Expand Down
4 changes: 2 additions & 2 deletions Growl/Growl.Daemon/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.7.2")]
[assembly: AssemblyInformationalVersion("2.0.7")]
[assembly: AssemblyFileVersion("2.0.9.1")]
[assembly: AssemblyInformationalVersion("2.0.9")]
4 changes: 2 additions & 2 deletions Growl/Growl.Destinations/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.7.2")]
[assembly: AssemblyInformationalVersion("2.0.7")]
[assembly: AssemblyFileVersion("2.0.9.1")]
[assembly: AssemblyInformationalVersion("2.0.9")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
14 changes: 11 additions & 3 deletions Growl/Growl.DisplayStyle/ExpandingLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class ExpandingLabel : System.Windows.Forms.Label
{
private bool dontExpand = false;
private System.Drawing.Text.TextRenderingHint textRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
private int minimumHeight = 1;

/// <summary>
/// Creates a new instance of this class
Expand All @@ -21,6 +22,8 @@ public ExpandingLabel()
{
InitializeComponent();

minimumHeight = this.Height;

this.AutoSize = false;
this.UseMnemonic = false;
}
Expand Down Expand Up @@ -117,8 +120,11 @@ private Size MeasureStringExtended(string text, Font font, int desWidth, int min

Size size = new Size(desWidth, Int32.MaxValue);
TextFormatFlags flags = TextFormatFlags.Default | TextFormatFlags.ExternalLeading | TextFormatFlags.GlyphOverhangPadding | TextFormatFlags.NoClipping | TextFormatFlags.WordBreak | TextFormatFlags.LeftAndRightPadding | TextFormatFlags.TextBoxControl;
//Size textSize = TextRenderer.MeasureText(text, font, size, flags);
//Size returnSize = new Size(textSize.Width, (int)(textSize.Height / scalingFactor));
Size returnSize = TextRenderer.MeasureText(text, font, size, flags);

// REMOVED 9.23.2011 - this part works, but we were always passing the current size (not minimum size), so it was never allowing the size to shrink once expanded
if (returnSize.Height < minHeight)
returnSize = new Size(returnSize.Width, minHeight);

Expand All @@ -145,18 +151,19 @@ private void InitializeComponent()
/// <param name="e">An <see cref="EventArgs"/> that contains the event data</param>
protected override void OnTextChanged(EventArgs e)
{
if (!dontExpand && !bChanging)
// IMPORTANT: dont trigger this unless the event handler is hooked up or else the sizes will get out of sync.
if(this.LabelHeightChanged != null && !dontExpand && !bChanging)
{
bChanging = true;
int originalHeight = this.Height;

int preferredWidth = this.ClientSize.Width;
Size size = this.MeasureStringExtended(this.Text, this.Font, preferredWidth, this.Height);
Size size = this.MeasureStringExtended(this.Text, this.Font, preferredWidth, minimumHeight);
int newHeight = size.Height;
this.Height = newHeight;

LabelHeightChangedEventArgs args = new LabelHeightChangedEventArgs(originalHeight, newHeight);
if (args.HeightChange != 0 && this.LabelHeightChanged != null)
if (args.HeightChange != 0)
{
this.LabelHeightChanged(args);
}
Expand All @@ -167,6 +174,7 @@ protected override void OnTextChanged(EventArgs e)
}
else
{
this.minimumHeight = this.Height;
base.OnTextChanged(e);
}
}
Expand Down
14 changes: 13 additions & 1 deletion Growl/Growl.DisplayStyle/FadeAnimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ public FadeAnimator(NotificationWindow form, int fadeInDuration, int fadeOutDura
this.finalOpacity = finalOpacity;
}

/// <summary>
/// Gets the final opacity as specificed in the constructor
/// </summary>
/// <value>The final opacity.</value>
public double FinalOpacity
{
get
{
return finalOpacity;
}
}

/// <summary>
/// Handles starting the fade-in animation
/// </summary>
Expand Down Expand Up @@ -193,7 +205,7 @@ void form_AutoClosing(object sender, FormClosingEventArgs e)
/// </remarks>
public override void CancelClosing()
{
if (this.timer != null)
if (this.timer != null && fadeInComplete)
{
this.timer.Stop();
}
Expand Down
1 change: 1 addition & 0 deletions Growl/Growl.DisplayStyle/Growl.DisplayStyle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<Compile Include="MultpleMonitorHelper.cs" />
<Compile Include="NotificationLite.cs" />
<Compile Include="PopupAnimator.cs" />
<Compile Include="PositionSettingScaler.cs" />
<Compile Include="Utility.cs" />
<Compile Include="Win32.cs" />
<Compile Include="Win32Animator.cs" />
Expand Down
6 changes: 3 additions & 3 deletions Growl/Growl.DisplayStyle/Notification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public class Notification : NotificationLite
public string NotificationID;

/// <summary>
/// The 'replacement group' id for a notification.
/// In other words, if a subsequent notification is sent from the same app with the same coalescing ID,
/// it should replace any existing notification from the same app with the same coalescing ID.
/// The application-specific coalescing id. (See CoalescingGroup property for more info)
/// </summary>
public string CoalescingID;

Expand Down Expand Up @@ -124,6 +122,8 @@ public void AddCustomBinaryAttributes(Dictionary<string, Resource> attributes)
/// <remarks>
/// Notifications from the same application with the same CoalescingID will be in the same
/// coalescing group. If no CoalescingID is supplied, CoalescingGroup will return an empty string.
/// Generally, a notification with a matching CoalescingGroup should replace any existing
/// notification same CoalescingGroup value.
/// </remarks>
public string CoalescingGroup
{
Expand Down
1 change: 1 addition & 0 deletions Growl/Growl.DisplayStyle/NotificationWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Growl.CoreLibrary;
Expand Down
113 changes: 113 additions & 0 deletions Growl/Growl.DisplayStyle/PositionSettingScaler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
using System;
using System.Drawing;
using System.Windows.Forms;

namespace Growl.DisplayStyle
{
public class PositionSettingScaler
{
float BASE_DPI = 96;
static Point TOP_LEFT_REF_POINT = new Point(19, 14);
static Point BOT_LEFT_REF_POINT = new Point(17, 95);

Point tl;
Point tr;
Point bl;
Point br;

int leftRightLine;
int topBottomLine;

public PositionSettingScaler(PictureBox background, Bitmap overlay)
{
Graphics g = Graphics.FromImage(overlay);
float currentDPI = BASE_DPI;
using (g)
{
currentDPI = g.DpiX;
}
float scalingFactor = currentDPI / BASE_DPI;

int bgWidth = background.Width;
int bgHeight = background.Height;
int ovWidth = overlay.Width;
int ovHeight = overlay.Height;
int tFudge = GetScaledValue(2, scalingFactor);
int bFudge = GetScaledValue(4, scalingFactor);

Point tRef = GetScaledPoint(TOP_LEFT_REF_POINT, scalingFactor);
Point bRef = GetScaledPoint(BOT_LEFT_REF_POINT, scalingFactor);

tl = tRef;
tr = new Point(bgWidth - tl.X - ovWidth + tFudge, tl.Y);
bl = new Point(bRef.X, bRef.Y - ovHeight);
br = new Point(bgWidth - bl.X - ovWidth + bFudge, bl.Y);

leftRightLine = bgWidth / 2;
topBottomLine = (bgHeight - GetScaledValue(40, scalingFactor)) / 2;
}

private Point GetScaledPoint(Point point, float scalingFactor)
{
return GetScaledPoint(point.X, point.Y, scalingFactor);
}

private Point GetScaledPoint(int x, int y, float scalingFactor)
{
return new Point(GetScaledValue(x, scalingFactor), GetScaledValue(y, scalingFactor));
}

private int GetScaledValue(int v, float scalingFactor)
{
return (int)(v * scalingFactor);
}

public Point TopLeft
{
get
{
return tl;
}
}

public Point TopRight
{
get
{
return tr;
}
}

public Point BottomLeft
{
get
{
return bl;
}
}

public Point BottomRight
{
get
{
return br;
}
}

public Point GetQuadrantFromCoordinates(int x, int y)
{
Point p = TopRight;

if (x > leftRightLine)
{
p = (y > topBottomLine ? BottomRight : TopRight);
}
else
{
p = (y > topBottomLine ? BottomLeft : TopLeft);
}

return p;
}
}
}
4 changes: 2 additions & 2 deletions Growl/Growl.DisplayStyle/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.7.2")]
[assembly: AssemblyInformationalVersion("2.0.7")]
[assembly: AssemblyFileVersion("2.0.9.1")]
[assembly: AssemblyInformationalVersion("2.0.9")]
6 changes: 6 additions & 0 deletions Growl/Growl.Displays.Plain/Growl.Displays.Plain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="PlainDisplay.cs" />
Expand All @@ -55,6 +57,10 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PlainSettingsPanel.resx">
<SubType>Designer</SubType>
<DependentUpon>PlainSettingsPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlainWindow.resx">
<DependentUpon>PlainWindow.cs</DependentUpon>
<SubType>Designer</SubType>
Expand Down
12 changes: 12 additions & 0 deletions Growl/Growl.Displays.Plain/PlainDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ public override string Website

protected override void HandleNotification(Notification notification, string displayName)
{
if (!String.IsNullOrEmpty(notification.CoalescingGroup))
{
foreach (NotificationWindow nw in this.ActiveWindows)
{
if (nw.CoalescingGroup == notification.CoalescingGroup)
{
((PlainWindow)nw).Close(true);
break;
}
}
}

PlainWindow win = new PlainWindow();
win.Tag = this;
win.SetNotification(notification);
Expand Down
Loading

0 comments on commit c2eadfe

Please sign in to comment.