Initial import.
Initial.
This commit is contained in:
commit
0b4a7841f7
71 changed files with 11984 additions and 0 deletions
34
CIDGrowl-Info.plist
Normal file
34
CIDGrowl-Info.plist
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>CIDGrowlIcon.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>net.theamigan.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
1447
CIDGrowl.xcodeproj/dcp1990.mode1v3
Normal file
1447
CIDGrowl.xcodeproj/dcp1990.mode1v3
Normal file
File diff suppressed because it is too large
Load diff
342
CIDGrowl.xcodeproj/dcp1990.pbxuser
Normal file
342
CIDGrowl.xcodeproj/dcp1990.pbxuser
Normal file
|
@ -0,0 +1,342 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1171, 503}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRange = "{0, 45}";
|
||||
sepNavWindowFrame = "{{268, 87}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
256AC3D80F4B6AC300CF3369 /* CIDGrowlAppDelegate.h */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1379, 416}}";
|
||||
sepNavSelRange = "{169, 0}";
|
||||
sepNavVisRange = "{0, 600}";
|
||||
sepNavWindowFrame = "{{160, 96}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {691, 3133}}";
|
||||
sepNavSelRange = "{851, 0}";
|
||||
sepNavVisRange = "{579, 749}";
|
||||
sepNavWindowFrame = "{{209, 226}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
256AC3F00F4B6AF500CF3369 /* CIDGrowl_Prefix.pch */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {628, 245}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRange = "{0, 147}";
|
||||
};
|
||||
};
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
activeBuildConfigurationName = Release;
|
||||
activeExecutable = A9316E9C1114C35F00AE4561 /* CIDGrowl */;
|
||||
activeTarget = 8D1107260486CEB800E47090 /* CIDGrowl */;
|
||||
addToTargets = (
|
||||
8D1107260486CEB800E47090 /* CIDGrowl */,
|
||||
);
|
||||
breakpoints = (
|
||||
);
|
||||
codeSenseManager = A9316EA81114C36800AE4561 /* Code sense */;
|
||||
executables = (
|
||||
A9316E9C1114C35F00AE4561 /* CIDGrowl */,
|
||||
);
|
||||
perUserDictionary = {
|
||||
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
|
||||
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
|
||||
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
|
||||
PBXFileTableDataSourceColumnWidthsKey = (
|
||||
20,
|
||||
993,
|
||||
20,
|
||||
48,
|
||||
43,
|
||||
43,
|
||||
20,
|
||||
);
|
||||
PBXFileTableDataSourceColumnsKey = (
|
||||
PBXFileDataSource_FiletypeID,
|
||||
PBXFileDataSource_Filename_ColumnID,
|
||||
PBXFileDataSource_Built_ColumnID,
|
||||
PBXFileDataSource_ObjectSize_ColumnID,
|
||||
PBXFileDataSource_Errors_ColumnID,
|
||||
PBXFileDataSource_Warnings_ColumnID,
|
||||
PBXFileDataSource_Target_ColumnID,
|
||||
);
|
||||
};
|
||||
PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
|
||||
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
|
||||
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
|
||||
PBXFileTableDataSourceColumnWidthsKey = (
|
||||
20,
|
||||
953,
|
||||
60,
|
||||
20,
|
||||
48,
|
||||
43,
|
||||
43,
|
||||
);
|
||||
PBXFileTableDataSourceColumnsKey = (
|
||||
PBXFileDataSource_FiletypeID,
|
||||
PBXFileDataSource_Filename_ColumnID,
|
||||
PBXTargetDataSource_PrimaryAttribute,
|
||||
PBXFileDataSource_Built_ColumnID,
|
||||
PBXFileDataSource_ObjectSize_ColumnID,
|
||||
PBXFileDataSource_Errors_ColumnID,
|
||||
PBXFileDataSource_Warnings_ColumnID,
|
||||
);
|
||||
};
|
||||
PBXPerProjectTemplateStateSaveDate = 342283250;
|
||||
PBXWorkspaceStateSaveDate = 342283250;
|
||||
};
|
||||
perUserProjectItems = {
|
||||
A9316F631114C96100AE4561 /* PBXTextBookmark */ = A9316F631114C96100AE4561 /* PBXTextBookmark */;
|
||||
A93170381114DBAC00AE4561 /* PBXBookmark */ = A93170381114DBAC00AE4561 /* PBXBookmark */;
|
||||
A93170391114DBAC00AE4561 /* PBXTextBookmark */ = A93170391114DBAC00AE4561 /* PBXTextBookmark */;
|
||||
A93170DF1114E98100AE4561 /* PBXBookmark */ = A93170DF1114E98100AE4561 /* PBXBookmark */;
|
||||
A93170ED1114E9D700AE4561 /* PBXBookmark */ = A93170ED1114E9D700AE4561 /* PBXBookmark */;
|
||||
A93170EE1114E9D700AE4561 /* PBXBookmark */ = A93170EE1114E9D700AE4561 /* PBXBookmark */;
|
||||
A93171001114EAA100AE4561 /* PBXTextBookmark */ = A93171001114EAA100AE4561 /* PBXTextBookmark */;
|
||||
A93E61AB11F82BC20066EB15 /* PBXTextBookmark */ = A93E61AB11F82BC20066EB15 /* PBXTextBookmark */;
|
||||
A93E61E711F82CF20066EB15 /* PBXBookmark */ = A93E61E711F82CF20066EB15 /* PBXBookmark */;
|
||||
A93E621011F82E0A0066EB15 /* PBXTextBookmark */ = A93E621011F82E0A0066EB15 /* PBXTextBookmark */;
|
||||
A93E621111F82E0A0066EB15 /* PBXTextBookmark */ = A93E621111F82E0A0066EB15 /* PBXTextBookmark */;
|
||||
A976839D112487AF00A3F369 /* PlistBookmark */ = A976839D112487AF00A3F369 /* PlistBookmark */;
|
||||
A9E83795111A9E4C00D217B0 /* PBXTextBookmark */ = A9E83795111A9E4C00D217B0 /* PBXTextBookmark */;
|
||||
A9F852881466D40F00337FFD /* PBXTextBookmark */ = A9F852881466D40F00337FFD /* PBXTextBookmark */;
|
||||
A9F852891466D40F00337FFD /* PBXTextBookmark */ = A9F852891466D40F00337FFD /* PBXTextBookmark */;
|
||||
};
|
||||
sourceControlManager = A9316EA71114C36800AE4561 /* Source Control */;
|
||||
userBuildSettings = {
|
||||
};
|
||||
};
|
||||
29B97316FDCFA39411CA2CEA /* main.m */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1080, 427}}";
|
||||
sepNavSelRange = "{0, 0}";
|
||||
sepNavVisRange = "{0, 251}";
|
||||
sepNavWindowFrame = "{{15, 318}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
8D1107260486CEB800E47090 /* CIDGrowl */ = {
|
||||
activeExec = 0;
|
||||
executables = (
|
||||
A9316E9C1114C35F00AE4561 /* CIDGrowl */,
|
||||
);
|
||||
};
|
||||
8D1107310486CEB800E47090 /* CIDGrowl-Info.plist */ = {
|
||||
uiCtxt = {
|
||||
sepNavWindowFrame = "{{199, 150}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
A9316E9C1114C35F00AE4561 /* CIDGrowl */ = {
|
||||
isa = PBXExecutable;
|
||||
activeArgIndices = (
|
||||
);
|
||||
argumentStrings = (
|
||||
);
|
||||
autoAttachOnCrash = 1;
|
||||
breakpointsEnabled = 1;
|
||||
configStateDict = {
|
||||
};
|
||||
customDataFormattersEnabled = 1;
|
||||
dataTipCustomDataFormattersEnabled = 1;
|
||||
dataTipShowTypeColumn = 1;
|
||||
dataTipSortType = 0;
|
||||
debuggerPlugin = GDBDebugging;
|
||||
disassemblyDisplayState = 0;
|
||||
dylibVariantSuffix = "";
|
||||
enableDebugStr = 1;
|
||||
environmentEntries = (
|
||||
);
|
||||
executableSystemSymbolLevel = 0;
|
||||
executableUserSymbolLevel = 0;
|
||||
libgmallocEnabled = 0;
|
||||
name = CIDGrowl;
|
||||
savedGlobals = {
|
||||
};
|
||||
showTypeColumn = 0;
|
||||
sourceDirectories = (
|
||||
);
|
||||
variableFormatDictionary = {
|
||||
};
|
||||
};
|
||||
A9316EA71114C36800AE4561 /* Source Control */ = {
|
||||
isa = PBXSourceControlManager;
|
||||
fallbackIsa = XCSourceControlManager;
|
||||
isSCMEnabled = 0;
|
||||
scmConfiguration = {
|
||||
repositoryNamesForRoots = {
|
||||
"" = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
A9316EA81114C36800AE4561 /* Code sense */ = {
|
||||
isa = PBXCodeSenseManager;
|
||||
indexTemplatePath = "";
|
||||
};
|
||||
A9316EB71114C45100AE4561 /* Growl Registration Ticket.growlRegDict */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1171, 513}}";
|
||||
sepNavSelRange = "{445, 0}";
|
||||
sepNavVisRange = "{0, 486}";
|
||||
sepNavWindowFrame = "{{61, 276}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
A9316F631114C96100AE4561 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 256AC3F00F4B6AF500CF3369 /* CIDGrowl_Prefix.pch */;
|
||||
name = "CIDGrowl_Prefix.pch: 1";
|
||||
rLen = 0;
|
||||
rLoc = 0;
|
||||
rType = 0;
|
||||
vrLen = 147;
|
||||
vrLoc = 0;
|
||||
};
|
||||
A93170001114D40700AE4561 /* menuic.png */ = {
|
||||
uiCtxt = {
|
||||
sepNavWindowFrame = "{{222, 129}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
A93170381114DBAC00AE4561 /* PBXBookmark */ = {
|
||||
isa = PBXBookmark;
|
||||
fRef = A93170281114DADB00AE4561 /* menu22.tif */;
|
||||
};
|
||||
A93170391114DBAC00AE4561 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 29B97316FDCFA39411CA2CEA /* main.m */;
|
||||
name = "main.m: 1";
|
||||
rLen = 0;
|
||||
rLoc = 0;
|
||||
rType = 0;
|
||||
vrLen = 251;
|
||||
vrLoc = 0;
|
||||
};
|
||||
A93170401114DD0700AE4561 /* menuic.png */ = {
|
||||
uiCtxt = {
|
||||
sepNavWindowFrame = "{{222, 129}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
A93170971114E48000AE4561 /* bigicon.png */ = {
|
||||
uiCtxt = {
|
||||
sepNavWindowFrame = "{{15, 318}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
A93170991114E4BB00AE4561 /* CIDGrowlIcon.icns */ = {
|
||||
uiCtxt = {
|
||||
sepNavWindowFrame = "{{291, 66}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
A93170CB1114E7CB00AE4561 /* growlicon.tif */ = {
|
||||
uiCtxt = {
|
||||
sepNavWindowFrame = "{{38, 297}, {1139, 555}}";
|
||||
};
|
||||
};
|
||||
A93170DF1114E98100AE4561 /* PBXBookmark */ = {
|
||||
isa = PBXBookmark;
|
||||
fRef = A93170CB1114E7CB00AE4561 /* growlicon.tif */;
|
||||
};
|
||||
A93170ED1114E9D700AE4561 /* PBXBookmark */ = {
|
||||
isa = PBXBookmark;
|
||||
fRef = A93170971114E48000AE4561 /* bigicon.png */;
|
||||
};
|
||||
A93170EE1114E9D700AE4561 /* PBXBookmark */ = {
|
||||
isa = PBXBookmark;
|
||||
fRef = A93170991114E4BB00AE4561 /* CIDGrowlIcon.icns */;
|
||||
};
|
||||
A93171001114EAA100AE4561 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = A9316EB71114C45100AE4561 /* Growl Registration Ticket.growlRegDict */;
|
||||
name = "Growl Registration Ticket.growlRegDict: 17";
|
||||
rLen = 0;
|
||||
rLoc = 445;
|
||||
rType = 0;
|
||||
vrLen = 486;
|
||||
vrLoc = 0;
|
||||
};
|
||||
A93E61AB11F82BC20066EB15 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 256AC3D80F4B6AC300CF3369 /* CIDGrowlAppDelegate.h */;
|
||||
name = "CIDGrowlAppDelegate.h: 17";
|
||||
rLen = 0;
|
||||
rLoc = 394;
|
||||
rType = 0;
|
||||
vrLen = 614;
|
||||
vrLoc = 0;
|
||||
};
|
||||
A93E61E611F82CF20066EB15 /* CIDGrowlAppDelegate.m */ = {
|
||||
isa = PBXFileReference;
|
||||
lastKnownFileType = sourcecode.c.objc;
|
||||
name = CIDGrowlAppDelegate.m;
|
||||
path = /Users/dcp1990/Development/CIDGrowl/CIDGrowlAppDelegate.m;
|
||||
sourceTree = "<absolute>";
|
||||
};
|
||||
A93E61E711F82CF20066EB15 /* PBXBookmark */ = {
|
||||
isa = PBXBookmark;
|
||||
fRef = A93E61E611F82CF20066EB15 /* CIDGrowlAppDelegate.m */;
|
||||
};
|
||||
A93E621011F82E0A0066EB15 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */;
|
||||
name = "CIDGrowlAppDelegate.m: 106";
|
||||
rLen = 0;
|
||||
rLoc = 2514;
|
||||
rType = 0;
|
||||
vrLen = 1088;
|
||||
vrLoc = 2413;
|
||||
};
|
||||
A93E621111F82E0A0066EB15 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */;
|
||||
name = "CIDGrowlAppDelegate.m: 42";
|
||||
rLen = 0;
|
||||
rLoc = 851;
|
||||
rType = 0;
|
||||
vrLen = 714;
|
||||
vrLoc = 579;
|
||||
};
|
||||
A976839D112487AF00A3F369 /* PlistBookmark */ = {
|
||||
isa = PlistBookmark;
|
||||
fRef = 8D1107310486CEB800E47090 /* CIDGrowl-Info.plist */;
|
||||
fallbackIsa = PBXBookmark;
|
||||
isK = 0;
|
||||
kPath = (
|
||||
);
|
||||
name = "/Users/dcp1990/Development/CIDGrowl/CIDGrowl-Info.plist";
|
||||
rLen = 0;
|
||||
rLoc = 9223372036854775808;
|
||||
};
|
||||
A9E83795111A9E4C00D217B0 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 089C165DFE840E0CC02AAC07 /* English */;
|
||||
name = "InfoPlist.strings: 1";
|
||||
rLen = 0;
|
||||
rLoc = 0;
|
||||
rType = 0;
|
||||
vrLen = 45;
|
||||
vrLoc = 0;
|
||||
};
|
||||
A9F852881466D40F00337FFD /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */;
|
||||
name = "CIDGrowlAppDelegate.m: 106";
|
||||
rLen = 0;
|
||||
rLoc = 2514;
|
||||
rType = 0;
|
||||
vrLen = 1113;
|
||||
vrLoc = 2391;
|
||||
};
|
||||
A9F852891466D40F00337FFD /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */;
|
||||
name = "CIDGrowlAppDelegate.m: 42";
|
||||
rLen = 0;
|
||||
rLoc = 851;
|
||||
rType = 0;
|
||||
vrLen = 749;
|
||||
vrLoc = 579;
|
||||
};
|
||||
}
|
340
CIDGrowl.xcodeproj/project.pbxproj
Normal file
340
CIDGrowl.xcodeproj/project.pbxproj
Normal file
|
@ -0,0 +1,340 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 45;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
|
||||
256AC3DA0F4B6AC300CF3369 /* CIDGrowlAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
A9316F021114C5F100AE4561 /* Growl Registration Ticket.growlRegDict in Resources */ = {isa = PBXBuildFile; fileRef = A9316EB71114C45100AE4561 /* Growl Registration Ticket.growlRegDict */; };
|
||||
A93170011114D40700AE4561 /* menuic.png in Resources */ = {isa = PBXBuildFile; fileRef = A93170001114D40700AE4561 /* menuic.png */; };
|
||||
A93170291114DADB00AE4561 /* menu22.tif in Resources */ = {isa = PBXBuildFile; fileRef = A93170281114DADB00AE4561 /* menu22.tif */; };
|
||||
A93170981114E48000AE4561 /* bigicon.png in Resources */ = {isa = PBXBuildFile; fileRef = A93170971114E48000AE4561 /* bigicon.png */; };
|
||||
A931709A1114E4BB00AE4561 /* CIDGrowlIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = A93170991114E4BB00AE4561 /* CIDGrowlIcon.icns */; };
|
||||
A93170CC1114E7CB00AE4561 /* growlicon.tif in Resources */ = {isa = PBXBuildFile; fileRef = A93170CB1114E7CB00AE4561 /* growlicon.tif */; };
|
||||
A93E61C311F82CA20066EB15 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A93E61C211F82CA20066EB15 /* Growl.framework */; };
|
||||
A93E61C611F82CA80066EB15 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A93E61C211F82CA20066EB15 /* Growl.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
A9316F101114C60200AE4561 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
A93E61C611F82CA80066EB15 /* Growl.framework in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||
1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
256AC3D80F4B6AC300CF3369 /* CIDGrowlAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIDGrowlAppDelegate.h; sourceTree = "<group>"; };
|
||||
256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIDGrowlAppDelegate.m; sourceTree = "<group>"; };
|
||||
256AC3F00F4B6AF500CF3369 /* CIDGrowl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIDGrowl_Prefix.pch; sourceTree = "<group>"; };
|
||||
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
8D1107310486CEB800E47090 /* CIDGrowl-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CIDGrowl-Info.plist"; sourceTree = "<group>"; };
|
||||
8D1107320486CEB800E47090 /* CIDGrowl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CIDGrowl.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A9316EB71114C45100AE4561 /* Growl Registration Ticket.growlRegDict */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Growl Registration Ticket.growlRegDict"; sourceTree = "<group>"; };
|
||||
A93170001114D40700AE4561 /* menuic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menuic.png; sourceTree = "<group>"; };
|
||||
A93170281114DADB00AE4561 /* menu22.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = menu22.tif; sourceTree = "<group>"; };
|
||||
A93170401114DD0700AE4561 /* menuic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menuic.png; sourceTree = "<group>"; };
|
||||
A93170971114E48000AE4561 /* bigicon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bigicon.png; sourceTree = "<group>"; };
|
||||
A93170991114E4BB00AE4561 /* CIDGrowlIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = CIDGrowlIcon.icns; sourceTree = "<group>"; };
|
||||
A93170CB1114E7CB00AE4561 /* growlicon.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = growlicon.tif; sourceTree = "<group>"; };
|
||||
A93E61C211F82CA20066EB15 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D11072E0486CEB800E47090 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
A93E61C311F82CA20066EB15 /* Growl.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
256AC3D80F4B6AC300CF3369 /* CIDGrowlAppDelegate.h */,
|
||||
256AC3D90F4B6AC300CF3369 /* CIDGrowlAppDelegate.m */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
|
||||
A93E61C211F82CA20066EB15 /* Growl.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FACFE9D520D11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D1107320486CEB800E47090 /* CIDGrowl.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97314FDCFA39411CA2CEA /* CIDGrowl */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A93170991114E4BB00AE4561 /* CIDGrowlIcon.icns */,
|
||||
A93170971114E48000AE4561 /* bigicon.png */,
|
||||
A93170401114DD0700AE4561 /* menuic.png */,
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
name = CIDGrowl;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
256AC3F00F4B6AF500CF3369 /* CIDGrowl_Prefix.pch */,
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A93170CB1114E7CB00AE4561 /* growlicon.tif */,
|
||||
A93170281114DADB00AE4561 /* menu22.tif */,
|
||||
A93170001114D40700AE4561 /* menuic.png */,
|
||||
8D1107310486CEB800E47090 /* CIDGrowl-Info.plist */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
|
||||
A9316EB71114C45100AE4561 /* Growl Registration Ticket.growlRegDict */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D1107260486CEB800E47090 /* CIDGrowl */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CIDGrowl" */;
|
||||
buildPhases = (
|
||||
8D1107290486CEB800E47090 /* Resources */,
|
||||
8D11072C0486CEB800E47090 /* Sources */,
|
||||
8D11072E0486CEB800E47090 /* Frameworks */,
|
||||
A9316F101114C60200AE4561 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = CIDGrowl;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
productName = CIDGrowl;
|
||||
productReference = 8D1107320486CEB800E47090 /* CIDGrowl.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
ORGANIZATIONNAME = theamigan.net;
|
||||
};
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CIDGrowl" */;
|
||||
compatibilityVersion = "Xcode 3.1";
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* CIDGrowl */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8D1107260486CEB800E47090 /* CIDGrowl */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D1107290486CEB800E47090 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A9316F021114C5F100AE4561 /* Growl Registration Ticket.growlRegDict in Resources */,
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
|
||||
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
|
||||
A93170011114D40700AE4561 /* menuic.png in Resources */,
|
||||
A93170291114DADB00AE4561 /* menu22.tif in Resources */,
|
||||
A93170981114E48000AE4561 /* bigicon.png in Resources */,
|
||||
A931709A1114E4BB00AE4561 /* CIDGrowlIcon.icns in Resources */,
|
||||
A93170CC1114E7CB00AE4561 /* growlicon.tif in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D11072C0486CEB800E47090 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */,
|
||||
256AC3DA0F4B6AC300CF3369 /* CIDGrowlAppDelegate.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C165DFE840E0CC02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
1DDD58150DA1D0A300B32029 /* English */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../Desktop\"",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = CIDGrowl_Prefix.pch;
|
||||
INFOPLIST_FILE = "CIDGrowl-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
PRODUCT_NAME = CIDGrowl;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../Desktop\"",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = CIDGrowl_Prefix.pch;
|
||||
INFOPLIST_FILE = "CIDGrowl-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
PRODUCT_NAME = CIDGrowl;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CIDGrowl" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4B08A954540054247B /* Debug */,
|
||||
C01FCF4C08A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CIDGrowl" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
}
|
31
CIDGrowlAppDelegate.h
Normal file
31
CIDGrowlAppDelegate.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// CIDGrowlAppDelegate.h
|
||||
// CIDGrowl
|
||||
//
|
||||
// Created by Dan Ponte on 1/30/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Growl/Growl.h>
|
||||
|
||||
@interface CIDGrowlAppDelegate : NSObject <GrowlApplicationBridgeDelegate> {
|
||||
NSWindow *window;
|
||||
IBOutlet NSMenu *statusMenu;
|
||||
NSStatusItem * statusItem;
|
||||
IBOutlet NSMenuItem *callCountItem;
|
||||
//int numberOfCalls;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-(void)setCallNum:(int)calls;
|
||||
|
||||
+(void)start_netloop:(id)param;
|
||||
|
||||
- (IBAction)openAboutPanel:(id)sender;
|
||||
|
||||
//-(void) growlIsReady;
|
||||
@property (assign) IBOutlet NSWindow *window;
|
||||
|
||||
@end
|
222
CIDGrowlAppDelegate.m
Normal file
222
CIDGrowlAppDelegate.m
Normal file
|
@ -0,0 +1,222 @@
|
|||
//
|
||||
// CIDGrowlAppDelegate.m
|
||||
// CIDGrowl
|
||||
//
|
||||
// Created by Dan Ponte on 1/30/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CIDGrowlAppDelegate.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#define PORT 3890
|
||||
#define BUFFERL 256
|
||||
|
||||
|
||||
|
||||
@implementation CIDGrowlAppDelegate
|
||||
|
||||
|
||||
@synthesize window;
|
||||
|
||||
- (IBAction)openAboutPanel:(id)sender
|
||||
{
|
||||
NSDictionary *options;
|
||||
NSImage *img;
|
||||
|
||||
img = [NSImage imageNamed: @"Picture 1"];
|
||||
options = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"0.1", @"Version",
|
||||
@"CIDGrowl", @"ApplicationName",
|
||||
img, @"ApplicationIcon",
|
||||
@"Copyright 2010 Dan Ponte", @"Copyright",
|
||||
@"CIDGrowl v0.1", @"ApplicationVersion",
|
||||
nil];
|
||||
|
||||
[[NSApplication sharedApplication] orderFrontStandardAboutPanelWithOptions:options];
|
||||
}
|
||||
|
||||
struct sockaddr_in servsad;
|
||||
char servaddr[256];
|
||||
typedef struct cis
|
||||
{
|
||||
char *name;
|
||||
char *number;
|
||||
char *date;
|
||||
char *time;
|
||||
} cidinfo;
|
||||
|
||||
void
|
||||
parseinfo (buffer, cifo)
|
||||
char *buffer;
|
||||
cidinfo *cifo;
|
||||
{
|
||||
char *bfrp;
|
||||
char *origbuf;
|
||||
origbuf = buffer;
|
||||
bfrp = origbuf;
|
||||
/* 9005:2010:0:WIRELESS CALL :401213123123 */
|
||||
cifo->date = strsep (&bfrp, ":");
|
||||
cifo->time = strsep (&bfrp, ":");
|
||||
if(cifo->time == NULL) return;
|
||||
strsep (&bfrp, ":");
|
||||
cifo->name = strsep (&bfrp, ":");
|
||||
cifo->number = bfrp;
|
||||
}
|
||||
|
||||
void telluser(buf)
|
||||
char *buf;
|
||||
{
|
||||
cidinfo cid;
|
||||
char *ltx;
|
||||
size_t lent;
|
||||
NSString *ltns;
|
||||
bzero(&cid, sizeof cid);
|
||||
parseinfo (buf, &cid);
|
||||
if(cid.name == NULL) return;
|
||||
if(cid.name == NULL || cid.number == NULL) {return;}
|
||||
lent = sizeof ("Name: \nNumber: \nDate: \nTime: \n ");
|
||||
lent +=
|
||||
sizeof (char) * (strlen (cid.name) + strlen (cid.number) +
|
||||
strlen (cid.date) + strlen (cid.time));
|
||||
ltx = (char *) malloc (lent);
|
||||
memset (ltx, 0, lent);
|
||||
snprintf (ltx, lent, "Name: %s\nNumber: %s",
|
||||
cid.name, cid.number, cid.date, cid.time); /* XXX: Use NSString functions right off the bat */
|
||||
ltns = [[NSString alloc] initWithCString:ltx encoding:NSMacOSRomanStringEncoding]; /* turn it into NSString because we are so fucking lazy about rewriting... */
|
||||
[GrowlApplicationBridge notifyWithTitle:@"Phone Call"
|
||||
description:ltns
|
||||
notificationName:@"Phone Call"
|
||||
iconData:nil
|
||||
priority:0
|
||||
isSticky:NO
|
||||
clickContext:[NSDate date]];
|
||||
[ltns autorelease];
|
||||
free (ltx);
|
||||
}
|
||||
/*
|
||||
-(void)setCallNum: (int)calls
|
||||
{
|
||||
NSString *tstr;
|
||||
if (calls)
|
||||
numberOfCalls += calls;
|
||||
else {
|
||||
numberOfCalls = 0;
|
||||
}
|
||||
|
||||
tstr = [[NSString alloc] initWithFormat:@"%d calls", numberOfCalls];
|
||||
[callCountItem setTitle:tstr];
|
||||
[tstr autorelease];
|
||||
}
|
||||
*/
|
||||
+(void)start_netloop: (id)param
|
||||
{
|
||||
int sockfd, nbytes;
|
||||
unsigned int addr_len;
|
||||
struct sockaddr_in ouraddr;
|
||||
struct sockaddr_in* bcasaddr;
|
||||
struct timeval tv;
|
||||
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
|
||||
bcasaddr = &servsad;
|
||||
bzero(&servsad, sizeof servsad);
|
||||
fd_set fds_read;
|
||||
FD_ZERO(&fds_read);
|
||||
char buffer[BUFFERL];
|
||||
|
||||
if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
|
||||
perror("sock");
|
||||
exit(-1);
|
||||
}
|
||||
ouraddr.sin_family = AF_INET;
|
||||
ouraddr.sin_port = htons(PORT);
|
||||
ouraddr.sin_addr.s_addr = INADDR_ANY;
|
||||
memset(&(ouraddr.sin_zero), 0, 8);
|
||||
if(bind(sockfd, (struct sockaddr*)&ouraddr, sizeof(struct sockaddr)) == -1) {
|
||||
perror("bind");
|
||||
exit(-2);
|
||||
}
|
||||
addr_len = sizeof(struct sockaddr);
|
||||
while(1)
|
||||
{
|
||||
FD_ZERO(&fds_read);
|
||||
FD_SET(sockfd, &fds_read);
|
||||
tv.tv_sec = 3; tv.tv_usec = 0;
|
||||
switch(select(sockfd + 1, &fds_read, NULL, NULL, NULL))
|
||||
{
|
||||
case -1:
|
||||
perror("select");
|
||||
goto doublebreak; /* the only case K&R ever recommends using a goto! */
|
||||
break;
|
||||
default:
|
||||
if(FD_ISSET(sockfd, &fds_read) != 0)
|
||||
{
|
||||
|
||||
if((nbytes = recvfrom(sockfd, buffer, BUFFERL - 1, 0, (struct sockaddr*)bcasaddr, &addr_len
|
||||
)) == -1) {
|
||||
perror("recv");
|
||||
goto doublebreak;
|
||||
}
|
||||
buffer[nbytes] = 0;
|
||||
#ifdef DEBUG
|
||||
printf("got %s\n", buffer);
|
||||
#endif
|
||||
telluser(buffer);
|
||||
memset(buffer, 0, BUFFERL);
|
||||
}
|
||||
}
|
||||
}
|
||||
doublebreak:
|
||||
close(sockfd);
|
||||
[autoreleasepool release];
|
||||
/* TODO: NSLog here (or replace perror()s with NSLog) */
|
||||
[NSApp terminate: nil];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void) receiveWakeNote: (NSNotification*) note
|
||||
{
|
||||
// make call count zero
|
||||
}
|
||||
|
||||
|
||||
- (void)awakeFromNib {
|
||||
// Insert code here to initialize your application
|
||||
|
||||
NSImage *appic = [[NSImage alloc] initWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"menuic" ofType:@"png"]];
|
||||
NSBundle *myBundle = [NSBundle bundleForClass:[CIDGrowlAppDelegate class]];
|
||||
NSString *growlPath = [[myBundle privateFrameworksPath] stringByAppendingPathComponent:@"Growl-WithInstaller.framework"];
|
||||
NSBundle *growlBundle = [NSBundle bundleWithPath:growlPath];
|
||||
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
|
||||
|
||||
|
||||
//[statusItem setTitle:@"C"];
|
||||
[statusItem setImage:appic];
|
||||
[statusItem setHighlightMode:YES];
|
||||
[statusItem setMenu:statusMenu];
|
||||
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self
|
||||
selector: @selector(receiveWakeNote:) name: NSWorkspaceDidWakeNotification object: NULL];
|
||||
if (growlBundle && [growlBundle load]) {
|
||||
// Register ourselves as a Growl delegate
|
||||
[GrowlApplicationBridge setGrowlDelegate:self];
|
||||
|
||||
[NSThread detachNewThreadSelector:@selector(start_netloop:) toTarget:[CIDGrowlAppDelegate class] withObject:nil];
|
||||
|
||||
}
|
||||
else {
|
||||
NSLog(@"ERROR: Could not load Growl.framework");
|
||||
}
|
||||
[appic autorelease];
|
||||
}
|
||||
|
||||
@end
|
BIN
CIDGrowlIcon.icns
Normal file
BIN
CIDGrowlIcon.icns
Normal file
Binary file not shown.
7
CIDGrowl_Prefix.pch
Normal file
7
CIDGrowl_Prefix.pch
Normal file
|
@ -0,0 +1,7 @@
|
|||
//
|
||||
// Prefix header for all source files of the 'CIDGrowl' target in the 'CIDGrowl' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
2
English.lproj/InfoPlist.strings
Normal file
2
English.lproj/InfoPlist.strings
Normal file
|
@ -0,0 +1,2 @@
|
|||
/* Localized versions of Info.plist keys */
|
||||
|
4274
English.lproj/MainMenu.xib
Normal file
4274
English.lproj/MainMenu.xib
Normal file
File diff suppressed because it is too large
Load diff
20
Growl Registration Ticket.growlRegDict
Normal file
20
Growl Registration Ticket.growlRegDict
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!--
|
||||
Growl Registration Ticket.growlRegDict
|
||||
CIDGrowl
|
||||
-->
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>TicketVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>AllNotifications</key>
|
||||
<array>
|
||||
<string>Phone Call</string>
|
||||
</array>
|
||||
<key>DefaultNotifications</key>
|
||||
<array>
|
||||
<string>Phone Call</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
1
Growl.framework/Growl
Symbolic link
1
Growl.framework/Growl
Symbolic link
|
@ -0,0 +1 @@
|
|||
Versions/Current/Growl
|
1
Growl.framework/Headers
Symbolic link
1
Growl.framework/Headers
Symbolic link
|
@ -0,0 +1 @@
|
|||
Versions/Current/Headers
|
1
Growl.framework/Resources
Symbolic link
1
Growl.framework/Resources
Symbolic link
|
@ -0,0 +1 @@
|
|||
Versions/Current/Resources
|
BIN
Growl.framework/Versions/A/Growl
Executable file
BIN
Growl.framework/Versions/A/Growl
Executable file
Binary file not shown.
6
Growl.framework/Versions/A/Headers/Growl.h
Normal file
6
Growl.framework/Versions/A/Headers/Growl.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include "GrowlDefines.h"
|
||||
|
||||
#ifdef __OBJC__
|
||||
# include "GrowlApplicationBridge.h"
|
||||
#endif
|
||||
#include "GrowlApplicationBridge-Carbon.h"
|
|
@ -0,0 +1,780 @@
|
|||
//
|
||||
// GrowlApplicationBridge-Carbon.h
|
||||
// Growl
|
||||
//
|
||||
// Created by Mac-arena the Bored Zo on Wed Jun 18 2004.
|
||||
// Based on GrowlApplicationBridge.h by Evan Schoenberg.
|
||||
// This source code is in the public domain. You may freely link it into any
|
||||
// program.
|
||||
//
|
||||
|
||||
#ifndef _GROWLAPPLICATIONBRIDGE_CARBON_H_
|
||||
#define _GROWLAPPLICATIONBRIDGE_CARBON_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#ifndef GROWL_EXPORT
|
||||
#define GROWL_EXPORT __attribute__((visibility("default"))) DEPRECATED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
/*! @header GrowlApplicationBridge-Carbon.h
|
||||
* @abstract Declares an API that Carbon applications can use to interact with Growl.
|
||||
* @discussion GrowlApplicationBridge uses a delegate to provide information //XXX
|
||||
* to Growl (such as your application's name and what notifications it may
|
||||
* post) and to provide information to your application (such as that Growl
|
||||
* is listening for notifications or that a notification has been clicked).
|
||||
*
|
||||
* You can set the Growldelegate with Growl_SetDelegate and find out the
|
||||
* current delegate with Growl_GetDelegate. See struct Growl_Delegate for more
|
||||
* information about the delegate.
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*! @struct Growl_Delegate
|
||||
* @abstract Delegate to supply GrowlApplicationBridge with information and respond to events.
|
||||
* @discussion The Growl delegate provides your interface to
|
||||
* GrowlApplicationBridge. When GrowlApplicationBridge needs information about
|
||||
* your application, it looks for it in the delegate; when Growl or the user
|
||||
* does something that you might be interested in, GrowlApplicationBridge
|
||||
* looks for a callback in the delegate and calls it if present
|
||||
* (meaning, if it is not <code>NULL</code>).
|
||||
* XXX on all of that
|
||||
* @field size The size of the delegate structure.
|
||||
* @field applicationName The name of your application.
|
||||
* @field registrationDictionary A dictionary describing your application and the notifications it can send out.
|
||||
* @field applicationIconData Your application's icon.
|
||||
* @field growlInstallationWindowTitle The title of the installation window.
|
||||
* @field growlInstallationInformation Text to display in the installation window.
|
||||
* @field growlUpdateWindowTitle The title of the update window.
|
||||
* @field growlUpdateInformation Text to display in the update window.
|
||||
* @field referenceCount A count of owners of the delegate.
|
||||
* @field retain Called when GrowlApplicationBridge receives this delegate.
|
||||
* @field release Called when GrowlApplicationBridge no longer needs this delegate.
|
||||
* @field growlIsReady Called when GrowlHelperApp is listening for notifications.
|
||||
* @field growlNotificationWasClicked Called when a Growl notification is clicked.
|
||||
* @field growlNotificationTimedOut Called when a Growl notification timed out.
|
||||
*/
|
||||
struct Growl_Delegate {
|
||||
/* @discussion This should be sizeof(struct Growl_Delegate).
|
||||
*/
|
||||
size_t size;
|
||||
|
||||
/*All of these attributes are optional.
|
||||
*Optional attributes can be NULL; required attributes that
|
||||
* are NULL cause setting the Growl delegate to fail.
|
||||
*XXX - move optional/required status into the discussion for each field
|
||||
*/
|
||||
|
||||
/* This name is used both internally and in the Growl preferences.
|
||||
*
|
||||
* This should remain stable between different versions and incarnations of
|
||||
* your application.
|
||||
* For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and
|
||||
* "SurfWriter Lite" are not.
|
||||
*
|
||||
* This can be <code>NULL</code> if it is provided elsewhere, namely in an
|
||||
* auto-discoverable plist file in your app bundle
|
||||
* (XXX refer to more information on that) or in registrationDictionary.
|
||||
*/
|
||||
CFStringRef applicationName;
|
||||
|
||||
/*
|
||||
* Must contain at least these keys:
|
||||
* GROWL_NOTIFICATIONS_ALL (CFArray):
|
||||
* Contains the names of all notifications your application may post.
|
||||
*
|
||||
* Can also contain these keys:
|
||||
* GROWL_NOTIFICATIONS_DEFAULT (CFArray):
|
||||
* Names of notifications that should be enabled by default.
|
||||
* If omitted, GROWL_NOTIFICATIONS_ALL will be used.
|
||||
* GROWL_APP_NAME (CFString):
|
||||
* Same as the applicationName member of this structure.
|
||||
* If both are present, the applicationName member shall prevail.
|
||||
* If this key is present, you may omit applicationName (set it to <code>NULL</code>).
|
||||
* GROWL_APP_ICON (CFData):
|
||||
* Same as the iconData member of this structure.
|
||||
* If both are present, the iconData member shall prevail.
|
||||
* If this key is present, you may omit iconData (set it to <code>NULL</code>).
|
||||
*
|
||||
* If you change the contents of this dictionary after setting the delegate,
|
||||
* be sure to call Growl_Reregister.
|
||||
*
|
||||
* This can be <code>NULL</code> if you have an auto-discoverable plist file in your app
|
||||
* bundle. (XXX refer to more information on that)
|
||||
*/
|
||||
CFDictionaryRef registrationDictionary;
|
||||
|
||||
/* The data can be in any format supported by NSImage. As of
|
||||
* Mac OS X 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and
|
||||
* PICT formats.
|
||||
*
|
||||
* If this is not supplied, Growl will look up your application's icon by
|
||||
* its application name.
|
||||
*/
|
||||
CFDataRef applicationIconData;
|
||||
|
||||
/* Installer display attributes
|
||||
*
|
||||
* These four attributes are used by the Growl installer, if this framework
|
||||
* supports it.
|
||||
* For any of these being <code>NULL</code>, a localised default will be
|
||||
* supplied.
|
||||
*/
|
||||
|
||||
/* If this is <code>NULL</code>, Growl will use a default,
|
||||
* localized title.
|
||||
*
|
||||
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
|
||||
* this member is ignored.
|
||||
*/
|
||||
CFStringRef growlInstallationWindowTitle;
|
||||
/* This information may be as long or short as desired (the
|
||||
* window will be sized to fit it). If Growl is not installed, it will
|
||||
* be displayed to the user as an explanation of what Growl is and what
|
||||
* it can do in your application.
|
||||
* It should probably note that no download is required to install.
|
||||
*
|
||||
* If this is <code>NULL</code>, Growl will use a default, localized
|
||||
* explanation.
|
||||
*
|
||||
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
|
||||
* this member is ignored.
|
||||
*/
|
||||
CFStringRef growlInstallationInformation;
|
||||
/* If this is <code>NULL</code>, Growl will use a default,
|
||||
* localized title.
|
||||
*
|
||||
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
|
||||
* this member is ignored.
|
||||
*/
|
||||
CFStringRef growlUpdateWindowTitle;
|
||||
/* This information may be as long or short as desired (the
|
||||
* window will be sized to fit it). If an older version of Growl is
|
||||
* installed, it will be displayed to the user as an explanation that an
|
||||
* updated version of Growl is included in your application and
|
||||
* no download is required.
|
||||
*
|
||||
* If this is <code>NULL</code>, Growl will use a default, localized
|
||||
* explanation.
|
||||
*
|
||||
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
|
||||
* this member is ignored.
|
||||
*/
|
||||
CFStringRef growlUpdateInformation;
|
||||
|
||||
/* This member is provided for use by your retain and release
|
||||
* callbacks (see below).
|
||||
*
|
||||
* GrowlApplicationBridge never directly uses this member. Instead, it
|
||||
* calls your retain callback (if non-<code>NULL</code>) and your release
|
||||
* callback (if non-<code>NULL</code>).
|
||||
*/
|
||||
unsigned referenceCount;
|
||||
|
||||
//Functions. Currently all of these are optional (any of them can be NULL).
|
||||
|
||||
/* When you call Growl_SetDelegate(newDelegate), it will call
|
||||
* oldDelegate->release(oldDelegate), and then it will call
|
||||
* newDelegate->retain(newDelegate), and the return value from retain
|
||||
* is what will be set as the delegate.
|
||||
* (This means that this member works like CFRetain and -[NSObject retain].)
|
||||
* This member is optional (it can be <code>NULL</code>).
|
||||
* For a delegate allocated with malloc, this member would be
|
||||
* <code>NULL</code>.
|
||||
* @result A delegate to which GrowlApplicationBridge holds a reference.
|
||||
*/
|
||||
void *(*retain)(void *);
|
||||
/* When you call Growl_SetDelegate(newDelegate), it will call
|
||||
* oldDelegate->release(oldDelegate), and then it will call
|
||||
* newDelegate->retain(newDelegate), and the return value from retain
|
||||
* is what will be set as the delegate.
|
||||
* (This means that this member works like CFRelease and
|
||||
* -[NSObject release].)
|
||||
* This member is optional (it can be NULL).
|
||||
* For a delegate allocated with malloc, this member might be
|
||||
* <code>free</code>(3).
|
||||
*/
|
||||
void (*release)(void *);
|
||||
|
||||
/* Informs the delegate that Growl (specifically, the GrowlHelperApp) was
|
||||
* launched successfully (or was already running). The application can
|
||||
* take actions with the knowledge that Growl is installed and functional.
|
||||
*/
|
||||
void (*growlIsReady)(void);
|
||||
|
||||
/* Informs the delegate that a Growl notification was clicked. It is only
|
||||
* sent for notifications sent with a non-<code>NULL</code> clickContext,
|
||||
* so if you want to receive a message when a notification is clicked,
|
||||
* clickContext must not be <code>NULL</code> when calling
|
||||
* Growl_PostNotification or
|
||||
* Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext.
|
||||
*/
|
||||
void (*growlNotificationWasClicked)(CFPropertyListRef clickContext);
|
||||
|
||||
/* Informs the delegate that a Growl notification timed out. It is only
|
||||
* sent for notifications sent with a non-<code>NULL</code> clickContext,
|
||||
* so if you want to receive a message when a notification is clicked,
|
||||
* clickContext must not be <code>NULL</code> when calling
|
||||
* Growl_PostNotification or
|
||||
* Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext.
|
||||
*/
|
||||
void (*growlNotificationTimedOut)(CFPropertyListRef clickContext);
|
||||
};
|
||||
|
||||
/*! @struct Growl_Notification
|
||||
* @abstract Structure describing a Growl notification.
|
||||
* @discussion XXX
|
||||
* @field size The size of the notification structure.
|
||||
* @field name Identifies the notification.
|
||||
* @field title Short synopsis of the notification.
|
||||
* @field description Additional text.
|
||||
* @field iconData An icon for the notification.
|
||||
* @field priority An indicator of the notification's importance.
|
||||
* @field reserved Bits reserved for future usage.
|
||||
* @field isSticky Requests that a notification stay on-screen until dismissed explicitly.
|
||||
* @field clickContext An identifier to be passed to your click callback when a notification is clicked.
|
||||
* @field clickCallback A callback to call when the notification is clicked.
|
||||
*/
|
||||
struct Growl_Notification {
|
||||
/* This should be sizeof(struct Growl_Notification).
|
||||
*/
|
||||
size_t size;
|
||||
|
||||
/* The notification name distinguishes one type of
|
||||
* notification from another. The name should be human-readable, as it
|
||||
* will be displayed in the Growl preference pane.
|
||||
*
|
||||
* The name is used in the GROWL_NOTIFICATIONS_ALL and
|
||||
* GROWL_NOTIFICATIONS_DEFAULT arrays in the registration dictionary, and
|
||||
* in this member of the Growl_Notification structure.
|
||||
*/
|
||||
CFStringRef name;
|
||||
|
||||
/* A notification's title describes the notification briefly.
|
||||
* It should be easy to read quickly by the user.
|
||||
*/
|
||||
CFStringRef title;
|
||||
|
||||
/* The description supplements the title with more
|
||||
* information. It is usually longer and sometimes involves a list of
|
||||
* subjects. For example, for a 'Download complete' notification, the
|
||||
* description might have one filename per line. GrowlMail in Growl 0.6
|
||||
* uses a description of '%d new mail(s)' (formatted with the number of
|
||||
* messages).
|
||||
*/
|
||||
CFStringRef description;
|
||||
|
||||
/* The notification icon usually indicates either what
|
||||
* happened (it may have the same icon as e.g. a toolbar item that
|
||||
* started the process that led to the notification), or what it happened
|
||||
* to (e.g. a document icon).
|
||||
*
|
||||
* The icon data is optional, so it can be <code>NULL</code>. In that
|
||||
* case, the application icon is used alone. Not all displays support
|
||||
* icons.
|
||||
*
|
||||
* The data can be in any format supported by NSImage. As of Mac OS X
|
||||
* 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT form
|
||||
* ats.
|
||||
*/
|
||||
CFDataRef iconData;
|
||||
|
||||
/* Priority is new in Growl 0.6, and is represented as a
|
||||
* signed integer from -2 to +2. 0 is Normal priority, -2 is Very Low
|
||||
* priority, and +2 is Very High priority.
|
||||
*
|
||||
* Not all displays support priority. If you do not wish to assign a
|
||||
* priority to your notification, assign 0.
|
||||
*/
|
||||
signed int priority;
|
||||
|
||||
/* These bits are not used in Growl 0.6. Set them to 0.
|
||||
*/
|
||||
unsigned reserved: 31;
|
||||
|
||||
/* When the sticky bit is clear, in most displays,
|
||||
* notifications disappear after a certain amount of time. Sticky
|
||||
* notifications, however, remain on-screen until the user dismisses them
|
||||
* explicitly, usually by clicking them.
|
||||
*
|
||||
* Sticky notifications were introduced in Growl 0.6. Most notifications
|
||||
* should not be sticky. Not all displays support sticky notifications,
|
||||
* and the user may choose in Growl's preference pane to force the
|
||||
* notification to be sticky or non-sticky, in which case the sticky bit
|
||||
* in the notification will be ignored.
|
||||
*/
|
||||
unsigned isSticky: 1;
|
||||
|
||||
/* If this is not <code>NULL</code>, and your click callback
|
||||
* is not <code>NULL</code> either, this will be passed to the callback
|
||||
* when your notification is clicked by the user.
|
||||
*
|
||||
* Click feedback was introduced in Growl 0.6, and it is optional. Not
|
||||
* all displays support click feedback.
|
||||
*/
|
||||
CFPropertyListRef clickContext;
|
||||
|
||||
/* If this is not <code>NULL</code>, it will be called instead
|
||||
* of the Growl delegate's click callback when clickContext is
|
||||
* non-<code>NULL</code> and the notification is clicked on by the user.
|
||||
*
|
||||
* Click feedback was introduced in Growl 0.6, and it is optional. Not
|
||||
* all displays support click feedback.
|
||||
*
|
||||
* The per-notification click callback is not yet supported as of Growl
|
||||
* 0.7.
|
||||
*/
|
||||
void (*clickCallback)(CFPropertyListRef clickContext);
|
||||
|
||||
CFStringRef identifier;
|
||||
};
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Easy initialisers
|
||||
|
||||
/*! @defined InitGrowlDelegate
|
||||
* @abstract Callable macro. Initializes a Growl delegate structure to defaults.
|
||||
* @discussion Call with a pointer to a struct Growl_Delegate. All of the
|
||||
* members of the structure will be set to 0 or <code>NULL</code>, except for
|
||||
* size (which will be set to <code>sizeof(struct Growl_Delegate)</code>) and
|
||||
* referenceCount (which will be set to 1).
|
||||
*/
|
||||
#define InitGrowlDelegate(delegate) \
|
||||
do { \
|
||||
if (delegate) { \
|
||||
(delegate)->size = sizeof(struct Growl_Delegate); \
|
||||
(delegate)->applicationName = NULL; \
|
||||
(delegate)->registrationDictionary = NULL; \
|
||||
(delegate)->applicationIconData = NULL; \
|
||||
(delegate)->growlInstallationWindowTitle = NULL; \
|
||||
(delegate)->growlInstallationInformation = NULL; \
|
||||
(delegate)->growlUpdateWindowTitle = NULL; \
|
||||
(delegate)->growlUpdateInformation = NULL; \
|
||||
(delegate)->referenceCount = 1U; \
|
||||
(delegate)->retain = NULL; \
|
||||
(delegate)->release = NULL; \
|
||||
(delegate)->growlIsReady = NULL; \
|
||||
(delegate)->growlNotificationWasClicked = NULL; \
|
||||
(delegate)->growlNotificationTimedOut = NULL; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
/*! @defined InitGrowlNotification
|
||||
* @abstract Callable macro. Initializes a Growl notification structure to defaults.
|
||||
* @discussion Call with a pointer to a struct Growl_Notification. All of
|
||||
* the members of the structure will be set to 0 or <code>NULL</code>, except
|
||||
* for size (which will be set to
|
||||
* <code>sizeof(struct Growl_Notification)</code>).
|
||||
*/
|
||||
#define InitGrowlNotification(notification) \
|
||||
do { \
|
||||
if (notification) { \
|
||||
(notification)->size = sizeof(struct Growl_Notification); \
|
||||
(notification)->name = NULL; \
|
||||
(notification)->title = NULL; \
|
||||
(notification)->description = NULL; \
|
||||
(notification)->iconData = NULL; \
|
||||
(notification)->priority = 0; \
|
||||
(notification)->reserved = 0U; \
|
||||
(notification)->isSticky = false; \
|
||||
(notification)->clickContext = NULL; \
|
||||
(notification)->clickCallback = NULL; \
|
||||
(notification)->identifier = NULL; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Public API
|
||||
|
||||
// @functiongroup Managing the Growl delegate
|
||||
|
||||
/*! @function Growl_SetDelegate
|
||||
* @abstract Replaces the current Growl delegate with a new one, or removes
|
||||
* the Growl delegate.
|
||||
* @param newDelegate
|
||||
* @result Returns false and does nothing else if a pointer that was passed in
|
||||
* is unsatisfactory (because it is non-<code>NULL</code>, but at least one
|
||||
* required member of it is <code>NULL</code>). Otherwise, sets or unsets the
|
||||
* delegate and returns true.
|
||||
* @discussion When <code>newDelegate</code> is non-<code>NULL</code>, sets
|
||||
* the delegate to <code>newDelegate</code>. When it is <code>NULL</code>,
|
||||
* the current delegate will be unset, and no delegate will be in place.
|
||||
*
|
||||
* It is legal for <code>newDelegate</code> to be the current delegate;
|
||||
* nothing will happen, and Growl_SetDelegate will return true. It is also
|
||||
* legal for it to be <code>NULL</code>, as described above; again, it will
|
||||
* return true.
|
||||
*
|
||||
* If there was a delegate in place before the call, Growl_SetDelegate will
|
||||
* call the old delegate's release member if it was non-<code>NULL</code>. If
|
||||
* <code>newDelegate</code> is non-<code>NULL</code>, Growl_SetDelegate will
|
||||
* call <code>newDelegate->retain</code>, and set the delegate to its return
|
||||
* value.
|
||||
*
|
||||
* If you are using Growl-WithInstaller.framework, and an older version of
|
||||
* Growl is installed on the user's system, the user will automatically be
|
||||
* prompted to update.
|
||||
*
|
||||
* GrowlApplicationBridge currently does not copy this structure, nor does it
|
||||
* retain any of the CF objects in the structure (it regards the structure as
|
||||
* a container that retains the objects when they are added and releases them
|
||||
* when they are removed or the structure is destroyed). Also,
|
||||
* GrowlApplicationBridge currently does not modify any member of the
|
||||
* structure, except possibly the referenceCount by calling the retain and
|
||||
* release members.
|
||||
*/
|
||||
GROWL_EXPORT Boolean Growl_SetDelegate(struct Growl_Delegate *newDelegate);
|
||||
|
||||
/*! @function Growl_GetDelegate
|
||||
* @abstract Returns the current Growl delegate, if any.
|
||||
* @result The current Growl delegate.
|
||||
* @discussion Returns the last pointer passed into Growl_SetDelegate, or
|
||||
* <code>NULL</code> if no such call has been made.
|
||||
*
|
||||
* This function follows standard Core Foundation reference-counting rules.
|
||||
* Because it is a Get function, not a Copy function, it will not retain the
|
||||
* delegate on your behalf. You are responsible for retaining and releasing
|
||||
* the delegate as needed.
|
||||
*/
|
||||
GROWL_EXPORT struct Growl_Delegate *Growl_GetDelegate(void);
|
||||
|
||||
#pragma mark -
|
||||
|
||||
// @functiongroup Posting Growl notifications
|
||||
|
||||
/*! @function Growl_PostNotification
|
||||
* @abstract Posts a Growl notification.
|
||||
* @param notification The notification to post.
|
||||
* @discussion This is the preferred means for sending a Growl notification.
|
||||
* The notification name and at least one of the title and description are
|
||||
* required (all three are preferred). All other parameters may be
|
||||
* <code>NULL</code> (or 0 or false as appropriate) to accept default values.
|
||||
*
|
||||
* If using the Growl-WithInstaller framework, if Growl is not installed the
|
||||
* user will be prompted to install Growl.
|
||||
* If the user cancels, this function will have no effect until the next
|
||||
* application session, at which time when it is called the user will be
|
||||
* prompted again. The user is also given the option to not be prompted again.
|
||||
* If the user does choose to install Growl, the requested notification will
|
||||
* be displayed once Growl is installed and running.
|
||||
*/
|
||||
GROWL_EXPORT void Growl_PostNotification(const struct Growl_Notification *notification);
|
||||
|
||||
/*! @function Growl_PostNotificationWithDictionary
|
||||
* @abstract Notifies using a userInfo dictionary suitable for passing to
|
||||
* CFDistributedNotificationCenter.
|
||||
* @param userInfo The dictionary to notify with.
|
||||
* @discussion Before Growl 0.6, your application would have posted
|
||||
* notifications using CFDistributedNotificationCenter by creating a userInfo
|
||||
* dictionary with the notification data. This had the advantage of allowing
|
||||
* you to add other data to the dictionary for programs besides Growl that
|
||||
* might be listening.
|
||||
*
|
||||
* This function allows you to use such dictionaries without being restricted
|
||||
* to using CFDistributedNotificationCenter. The keys for this dictionary
|
||||
* can be found in GrowlDefines.h.
|
||||
*/
|
||||
GROWL_EXPORT void Growl_PostNotificationWithDictionary(CFDictionaryRef userInfo);
|
||||
|
||||
/*! @function Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext
|
||||
* @abstract Posts a Growl notification using parameter values.
|
||||
* @param title The title of the notification.
|
||||
* @param description The description of the notification.
|
||||
* @param notificationName The name of the notification as listed in the
|
||||
* registration dictionary.
|
||||
* @param iconData Data representing a notification icon. Can be <code>NULL</code>.
|
||||
* @param priority The priority of the notification (-2 to +2, with -2
|
||||
* being |