Skip to content

Commit

Permalink
AIR, JS, and VB/COM connector updates; added ability to automatically…
Browse files Browse the repository at this point in the history
… pause notification closing when mouse is over;preparing for Mono branch
  • Loading branch information
briandunnington committed Dec 1, 2009
1 parent 8da3917 commit 19f66f0
Show file tree
Hide file tree
Showing 35 changed files with 711 additions and 496 deletions.
2 changes: 1 addition & 1 deletion Growl Connectors/AIR/GrowlAIRConnector.as3proj
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<postBuildCommand alwaysRun="False">"C:\Program Files\Adobe Flex SDK\bin\compc.exe" -load-config+="$(ProjectDir)\obj\GrowlAIRConnectorConfig.swc.xml"
c:\windows\system32\cmd.exe /k copy "$(OutputDir)\$(ProjectName).swc" "$(ProjectDir)\" /Y
c:\windows\system32\cmd.exe /k copy "$(OutputDir)\$(ProjectName).swc" "$(ProjectDir)\..\Javascript\lib\" /Y
"C:\Documents and Settings\brian\Local Settings\Application Data\FlashDevelop\Tools\fdbuild\fdbuild.exe" "D:\_Growl\Growl Connectors\Javascript\GrowlFlashConnector.as3proj" -compiler "C:\Program Files\Adobe Flex SDK" -library "C:\Documents and Settings\brian\Local Settings\Application Data\FlashDevelop\Library"</postBuildCommand>
"C:\Documents and Settings\brian\Local Settings\Application Data\FlashDevelop\Tools\fdbuild\fdbuild.exe" "D:\CVS\growl-for-windows\Growl Connectors\Javascript\GrowlFlashConnector.as3proj" -compiler "C:\Program Files\Adobe Flex SDK" -library "C:\Documents and Settings\brian\Local Settings\Application Data\FlashDevelop\Library"</postBuildCommand>
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
Expand Down
Binary file modified Growl Connectors/AIR/GrowlAIRConnector.swc
Binary file not shown.
Binary file modified Growl Connectors/AIR/bin/GrowlAIRConnector.swc
Binary file not shown.
Binary file modified Growl Connectors/AIR/bin/GrowlAIRConnector.swf
Binary file not shown.
6 changes: 3 additions & 3 deletions Growl Connectors/AIR/obj/GrowlAIRConnectorConfig.swc.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<output>D:\_Growl\Growl Connectors\AIR\bin\GrowlAIRConnector.swc</output>
<output>D:\CVS\growl-for-windows\Growl Connectors\AIR\bin\GrowlAIRConnector.swc</output>
<use-network>true</use-network>
<warnings>true</warnings>
<benchmark>false</benchmark>
Expand All @@ -16,10 +16,10 @@
<use-resource-bundle-metadata>true</use-resource-bundle-metadata>
<verbose-stacktraces>false</verbose-stacktraces>
<source-path>
<path-element>D:\_Growl\Growl Connectors\AIR\src</path-element>
<path-element>D:\CVS\growl-for-windows\Growl Connectors\AIR\src</path-element>
</source-path>
<library-path>
<path-element>D:\_Growl\Growl Connectors\AIR\lib\as3crypto.swc</path-element>
<path-element>D:\CVS\growl-for-windows\Growl Connectors\AIR\lib\as3crypto.swc</path-element>
</library-path>
</compiler>
<include-classes>
Expand Down
2 changes: 1 addition & 1 deletion Growl Connectors/AIR/src/RemotingSocket.as
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ package
*/
private function dataHandler(event:ProgressEvent):void
{
while (this.bytesAvailable > 0)
while (this.connected && this.bytesAvailable > 0)
{
var b:String = this.readUTFBytes(this.bytesAvailable);

Expand Down
Binary file modified Growl Connectors/Javascript/GrowlFlashConnector.swf
Binary file not shown.
Binary file modified Growl Connectors/Javascript/bin/GrowlFlashConnector.swf
Binary file not shown.
Binary file added Growl Connectors/Javascript/growl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Growl Connectors/Javascript/lib/GrowlAIRConnector.swc
Binary file not shown.
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.
32 changes: 20 additions & 12 deletions Growl Connectors/VB/Growl.COM/CallbackContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,48 @@ namespace Growl.COM
[ClassInterface(ClassInterfaceType.AutoDual)]
public class CallbackContext
{
private Growl.Connector.CallbackContext cbc;
private string data;
private string type;
private string url;

public CallbackContext()
{
this.cbc = new Growl.Connector.CallbackContext();
}

public string Data
{
get
{
return this.cbc.Data;
return this.data;
}
set
{
this.cbc.Data = value;
this.data = value;
}
}

public string Type
{
get
{
return this.cbc.Type;
return this.type;
}
set
{
this.cbc.Type = value;
this.type = value;
}
}

public void SetUrlCallback(string url, string method)
public string Url
{
Growl.Connector.UrlCallbackTarget target = new Growl.Connector.UrlCallbackTarget();
target.Url = url;
target.Method = method;
this.cbc.SetUrlCallbackTarget(target);
get
{
return this.url;
}
set
{
this.url = value;
}
}

public string Method;
Expand All @@ -53,7 +58,10 @@ internal Growl.Connector.CallbackContext UnderlyingCallbackContext
{
get
{
return this.cbc;
if (!String.IsNullOrEmpty(this.url))
return new Growl.Connector.CallbackContext(this.Url);
else
return new Growl.Connector.CallbackContext(this.Data, this.Type);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions Growl Connectors/VB/Growl.COM/Connector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ public void Notify(string applicationName, Notification notification, CallbackCo
if (notification == null)
throw new ArgumentException("The notification cannot be null");

Growl.Connector.Application a = new Growl.Connector.Application(applicationName);
Growl.Connector.Notification n = notification.UnderlyingNotification;
Growl.Connector.CallbackContext cbc = (callbackContext != null ? callbackContext.UnderlyingCallbackContext : null);
this.growl.Notify(a, n, cbc);
this.growl.Notify(n, cbc);
}
}
}
13 changes: 6 additions & 7 deletions Growl Connectors/VB/Growl.COM/Growl.COM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RegisterForComInterop>true</RegisterForComInterop>
</PropertyGroup>
<ItemGroup>
<Reference Include="Growl.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=980c2339411be384, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\NET\libraries\Growl.Connector.dll</HintPath>
</Reference>
<Reference Include="Growl.CoreLibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=13e59d82e007b064, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Growl Extras\Growl Display SDK\libraries\Growl.CoreLibrary.dll</HintPath>
<HintPath>..\..\NET\libraries\Growl.CoreLibrary.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand All @@ -49,12 +54,6 @@
<Compile Include="NotificationType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Growl\Growl.Connector\Growl.Connector.csproj">
<Project>{19C22138-B905-47BA-9E6E-EF9356907E53}</Project>
<Name>Growl.Connector</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
6 changes: 0 additions & 6 deletions Growl Connectors/VB/Growl.COM/Growl.COM.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Growl.COM", "Growl.COM.csproj", "{BA15F566-2275-44FD-832C-55B7027D107C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Growl.Connector", "..\..\..\Growl\Growl.Connector\Growl.Connector.csproj", "{19C22138-B905-47BA-9E6E-EF9356907E53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,10 +13,6 @@ Global
{BA15F566-2275-44FD-832C-55B7027D107C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA15F566-2275-44FD-832C-55B7027D107C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA15F566-2275-44FD-832C-55B7027D107C}.Release|Any CPU.Build.0 = Release|Any CPU
{19C22138-B905-47BA-9E6E-EF9356907E53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19C22138-B905-47BA-9E6E-EF9356907E53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19C22138-B905-47BA-9E6E-EF9356907E53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19C22138-B905-47BA-9E6E-EF9356907E53}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
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.
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,14 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Growl Add-In for Visual Studio"
"ProductCode" = "8:{D2845283-9C1A-46C7-9F5B-D21189255872}"
"PackageCode" = "8:{0AD5B415-B5CD-4206-A380-DB5D4BC04D0A}"
"ProductCode" = "8:{ED6DA8A2-F839-46E0-88FC-1703C0EC92BF}"
"PackageCode" = "8:{F7026AA5-8B70-4C71-B7AC-93C78F2DE82F}"
"UpgradeCode" = "8:{F831506E-1E2C-4B2E-B02A-EAB81096EF29}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:1.0.4"
"ProductVersion" = "8:1.0.5"
"Manufacturer" = "8:Growl Extras"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
Binary file not shown.
47 changes: 47 additions & 0 deletions Growl/Growl.DisplayStyle/AnimatorBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Growl.DisplayStyle
{
/// <summary>
/// Base implementation for animators used in animated displays
/// </summary>
public abstract class AnimatorBase : IAnimator
{
private bool disabled;

#region IAnimator Members

/// <summary>
/// Indicates if the animator is disabled
/// </summary>
/// <value>
/// <c>true</c> - the animator is disabled and should not animate the window;
/// <c>false</c> - the animator is enabled and should perform its animations
/// </value>
public bool Disabled
{
get
{
return this.disabled;
}
set
{
this.disabled = value;
}
}

/// <summary>
/// Cancels the closing (and thus, animation) of a display.
/// </summary>
/// <remarks>
/// If the display is not yet closing, this has no effect.
/// This only cancels the current animation - if the display is closed again later, a new
/// animation may be started.
/// </remarks>
public abstract void CancelClosing();

#endregion
}
}
93 changes: 49 additions & 44 deletions Growl/Growl.DisplayStyle/FadeAnimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Growl.DisplayStyle
/// <summary>
/// Provides the behavior for fading a form window in and out
/// </summary>
public class FadeAnimator : IAnimator, IDisposable
public class FadeAnimator : AnimatorBase, IDisposable
{
/// <summary>
/// The default interval for the fade timer
Expand Down Expand Up @@ -55,11 +55,6 @@ public class FadeAnimator : IAnimator, IDisposable
/// </summary>
private bool fadeInComplete;

/// <summary>
/// Indicates if the animator is disabled
/// </summary>
private bool disabled;

/// <summary>
/// Creates a new FadeAnimator using the preset default values.
/// </summary>
Expand Down Expand Up @@ -90,25 +85,6 @@ public FadeAnimator(NotificationWindow form, int fadeInDuration, int fadeOutDura
this.finalOpacity = finalOpacity;
}

/// <summary>
/// Indicates if the animator is disabled
/// </summary>
/// <value>
/// <c>true</c> - the animator is disabled and should not animate the window;
/// <c>false</c> - the animator is enabled and should perform its animations
/// </value>
public bool Disabled
{
get
{
return this.disabled;
}
set
{
this.disabled = true;
}
}

/// <summary>
/// Handles starting the fade-in animation
/// </summary>
Expand Down Expand Up @@ -140,31 +116,44 @@ void form_BeforeShown(object sender, EventArgs e)
void timer_Tick(object sender, EventArgs e)
{
this.timer.Stop();
bool restart = true;
if (this.fadeInComplete)

if (!this.Disabled)
{
double newOpacity = form.Opacity - this.opacityDelta;
if (newOpacity <= 0)
bool restart = true;
if (this.fadeInComplete)
{
newOpacity = 0;
restart = false;
form.Close();
return;
if (!this.form.PauseWhenMouseOver || !this.form.IsMouseOver())
{
double newOpacity = form.Opacity - this.opacityDelta;
if (newOpacity <= 0)
{
newOpacity = 0;
restart = false;
form.Close();
return;
}
form.Opacity = newOpacity;
}
else
{
restart = false;
CancelClosing();
this.form.StartAutoCloseTimer();
}
}
form.Opacity = newOpacity;
}
else
{
double newOpacity = form.Opacity + this.opacityDelta;
if (newOpacity >= this.finalOpacity)
else
{
newOpacity = finalOpacity;
this.fadeInComplete = true;
restart = false;
double newOpacity = form.Opacity + this.opacityDelta;
if (newOpacity >= this.finalOpacity)
{
newOpacity = finalOpacity;
this.fadeInComplete = true;
restart = false;
}
form.Opacity = newOpacity;
}
form.Opacity = newOpacity;
if (restart) this.timer.Start();
}
if(restart) this.timer.Start();
}

/// <summary>
Expand Down Expand Up @@ -194,6 +183,22 @@ void form_AutoClosing(object sender, FormClosingEventArgs e)
}
}

/// <summary>
/// Cancels the closing (and thus, animation) of a display.
/// </summary>
/// <remarks>
/// If the display is not yet closing, this has no effect.
/// This only cancels the current animation - if the display is closed again later, a new
/// animation may be started.
/// </remarks>
public override void CancelClosing()
{
if (this.timer != null)
{
this.timer.Stop();
}
}

#region IDisposable Members

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions Growl/Growl.DisplayStyle/Growl.DisplayStyle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@
</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="AnimatorBase.cs" />
<Compile Include="DefaultSettingsPanel.cs">
<SubType>UserControl</SubType>
</Compile>
Expand Down
Loading

0 comments on commit 19f66f0

Please sign in to comment.