[37472] users/rhwood/MacPorts.Framework
rhwood at macports.org
rhwood at macports.org
Mon Jun 9 02:29:45 PDT 2008
Revision: 37472
http://trac.macosforge.org/projects/macports/changeset/37472
Author: rhwood at macports.org
Date: 2008-06-09 02:29:45 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
Add basic (non working/non breaking) code to experiment with getting NSNotification objects out of Tcl
Modified Paths:
--------------
users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj
users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/rhwood.pbxuser
users/rhwood/MacPorts.Framework/init.tcl
Added Paths:
-----------
users/rhwood/MacPorts.Framework/Tcl_Notifications/
users/rhwood/MacPorts.Framework/Tcl_Notifications/Makefile
users/rhwood/MacPorts.Framework/Tcl_Notifications/notifications.m
Modified: users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj
===================================================================
--- users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj 2008-06-09 09:25:48 UTC (rev 37471)
+++ users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj 2008-06-09 09:29:45 UTC (rev 37472)
@@ -26,6 +26,7 @@
481D04A40CDAAAFD00D4A550 /* MPMutableDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 481D04A10CDAAAFD00D4A550 /* MPMutableDictionary.m */; };
4825ECC30CE6145B006B0385 /* MPRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 48F811BE0CE4636A009630DE /* MPRegistry.h */; settings = {ATTRIBUTES = (Public, ); }; };
4825ECC40CE61468006B0385 /* MPRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 48F811BF0CE4638C009630DE /* MPRegistry.m */; };
+ 48416EF30D8BE44500E104BD /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 48416EF20D8BE44500E104BD /* Localizable.strings */; };
487679550C98C2EB00577C59 /* MPIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 487679530C98C2EB00577C59 /* MPIndex.h */; settings = {ATTRIBUTES = (Public, ); }; };
487679560C98C2EB00577C59 /* MPIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = 487679540C98C2EB00577C59 /* MPIndex.m */; };
487679690C98C55E00577C59 /* MPPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 487679670C98C55E00577C59 /* MPPort.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -64,6 +65,8 @@
4822AAD10D7EB38100C4D4D7 /* headerDoc2HTML.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = headerDoc2HTML.config; sourceTree = "<group>"; };
4822AAD70D7EB3C600C4D4D7 /* toctemplate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = toctemplate.html; path = /Users/Shared/Developer/MacPorts/Repository/users/rhwood/MacPorts.Framework/toctemplate.html; sourceTree = "<absolute>"; };
4822AADB0D7EB57F00C4D4D7 /* MacPorts Framework.hdoc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "MacPorts Framework.hdoc"; sourceTree = "<group>"; };
+ 48416EF00D8BE43700E104BD /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 485383C70D8BD8BF0048D73C /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = /Users/Shared/Developer/MacPorts/Repository/users/rhwood/MacPorts.Framework/Tcl_Notifications/Makefile; sourceTree = "<absolute>"; };
487679530C98C2EB00577C59 /* MPIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPIndex.h; sourceTree = "<group>"; };
487679540C98C2EB00577C59 /* MPIndex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPIndex.m; sourceTree = "<group>"; };
487679670C98C55E00577C59 /* MPPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPort.h; sourceTree = "<group>"; };
@@ -76,6 +79,7 @@
489DD92E0C94674B00595506 /* MPInterpreterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPInterpreterTest.m; sourceTree = "<group>"; };
48A866A80CD364F700B521BC /* MPReceipt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPReceipt.h; sourceTree = "<group>"; };
48A866A90CD364F700B521BC /* MPReceipt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPReceipt.m; sourceTree = "<group>"; };
+ 48AB964B0D892C310013CDB8 /* notifications.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; name = notifications.m; path = Tcl_Notifications/notifications.m; sourceTree = "<group>"; };
48E9925B0C82C45800219DDF /* MacPorts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacPorts.h; sourceTree = "<group>"; };
48E992970C82C98C00219DDF /* Tcl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tcl.framework; path = /System/Library/Frameworks/Tcl.framework; sourceTree = "<absolute>"; };
48E993920C82CAAE00219DDF /* MPMacPorts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPMacPorts.h; sourceTree = "<group>"; };
@@ -120,6 +124,7 @@
isa = PBXGroup;
children = (
08FB77AEFE84172EC02AAC07 /* Classes */,
+ 485383C40D8BD8950048D73C /* Tcl Notifications */,
32C88DFF0371C24200C91783 /* Other Sources */,
089C1665FE841158C02AAC07 /* Resources */,
4822AAD40D7EB39200C4D4D7 /* Documentation */,
@@ -144,6 +149,7 @@
48E9939E0C82CEB000219DDF /* init.tcl */,
8DC2EF5A0486A6940098B216 /* Info.plist */,
089C1666FE841158C02AAC07 /* InfoPlist.strings */,
+ 48416EF20D8BE44500E104BD /* Localizable.strings */,
489DD8F50C94365F00595506 /* Test-Info.plist */,
);
name = Resources;
@@ -208,6 +214,15 @@
name = Documentation;
sourceTree = "<group>";
};
+ 485383C40D8BD8950048D73C /* Tcl Notifications */ = {
+ isa = PBXGroup;
+ children = (
+ 485383C70D8BD8BF0048D73C /* Makefile */,
+ 48AB964B0D892C310013CDB8 /* notifications.m */,
+ );
+ name = "Tcl Notifications";
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -228,6 +243,23 @@
};
/* End PBXHeadersBuildPhase section */
+/* Begin PBXLegacyTarget section */
+ 48094CC50D8A83DF0045AC5C /* Tcl Notifications */ = {
+ isa = PBXLegacyTarget;
+ buildArgumentsString = $ACTION;
+ buildConfigurationList = 48094CC80D8A83FD0045AC5C /* Build configuration list for PBXLegacyTarget "Tcl Notifications" */;
+ buildPhases = (
+ );
+ buildToolPath = /usr/bin/make;
+ buildWorkingDirectory = "$(PROJECT_DIR)/Tcl_Notifications";
+ dependencies = (
+ );
+ name = "Tcl Notifications";
+ passBuildSettingsInEnvironment = 1;
+ productName = "Tcl Notifications";
+ };
+/* End PBXLegacyTarget section */
+
/* Begin PBXNativeTarget section */
489DD8F30C94365F00595506 /* Test */ = {
isa = PBXNativeTarget;
@@ -283,6 +315,7 @@
8DC2EF4F0486A6940098B216 /* MacPorts */,
489DD8F30C94365F00595506 /* Test */,
DFE353650CFB8F0C003BACFC /* Docs */,
+ 48094CC50D8A83DF0045AC5C /* Tcl Notifications */,
);
};
/* End PBXProject section */
@@ -301,6 +334,7 @@
files = (
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
48E9939F0C82CEB000219DDF /* init.tcl in Resources */,
+ 48416EF30D8BE44500E104BD /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -378,6 +412,14 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
+ 48416EF20D8BE44500E104BD /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 48416EF00D8BE43700E104BD /* English */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@@ -429,6 +471,7 @@
1DEB91B208733DA50010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ GCC_MODEL_TUNING = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
@@ -448,6 +491,27 @@
};
name = Release;
};
+ 48094CC60D8A83DF0045AC5C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ PRODUCT_NAME = "Tcl Notifications";
+ };
+ name = Debug;
+ };
+ 48094CC70D8A83DF0045AC5C /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ PRODUCT_NAME = "Tcl Notifications";
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
489DD8F70C94366000595506 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -552,6 +616,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ 48094CC80D8A83FD0045AC5C /* Build configuration list for PBXLegacyTarget "Tcl Notifications" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 48094CC60D8A83DF0045AC5C /* Debug */,
+ 48094CC70D8A83DF0045AC5C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
489DD8F60C94366000595506 /* Build configuration list for PBXNativeTarget "Test" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Modified: users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/rhwood.pbxuser
===================================================================
--- users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/rhwood.pbxuser 2008-06-09 09:25:48 UTC (rev 37471)
+++ users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/rhwood.pbxuser 2008-06-09 09:29:45 UTC (rev 37472)
@@ -3,9 +3,9 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
activeArchitecture = i386;
activeBuildConfigurationName = Debug;
- activeTarget = DFE353650CFB8F0C003BACFC /* Docs */;
+ activeTarget = 8DC2EF4F0486A6940098B216 /* MacPorts */;
addToTargets = (
- DFE353650CFB8F0C003BACFC /* Docs */,
+ 8DC2EF4F0486A6940098B216 /* MacPorts */,
);
breakpoints = (
);
@@ -39,7 +39,7 @@
PBXFileTableDataSourceColumnWidthsKey = (
200,
200,
- 57.5835,
+ 57.58349609375,
);
PBXFileTableDataSourceColumnsKey = (
PBXBookmarksDataSource_LocationID,
@@ -155,9 +155,13 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 226918962;
- PBXWorkspaceStateSaveDate = 226918962;
+ PBXPerProjectTemplateStateSaveDate = 234089458;
+ PBXWorkspaceStateSaveDate = 234089458;
};
+ perUserProjectItems = {
+ 480DBDEE0DF3EC2E007465AB /* PBXBookmark */ = 480DBDEE0DF3EC2E007465AB /* PBXBookmark */;
+ 480DBE140DF3FA14007465AB /* PBXTextBookmark */ = 480DBE140DF3FA14007465AB /* PBXTextBookmark */;
+ };
sourceControlManager = 48906AD10C422C1000A3ED8A /* Source Control */;
userBuildSettings = {
};
@@ -178,6 +182,23 @@
sepNavWindowFrame = "{{15, -1}, {759, 828}}";
};
};
+ 48094CC50D8A83DF0045AC5C /* Tcl Notifications */ = {
+ activeExec = 0;
+ };
+ 480DBDEE0DF3EC2E007465AB /* PBXBookmark */ = {
+ isa = PBXBookmark;
+ fRef = 48E993930C82CAAE00219DDF /* MPMacPorts.m */;
+ };
+ 480DBE140DF3FA14007465AB /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 48E993930C82CAAE00219DDF /* MPMacPorts.m */;
+ name = "MPMacPorts.m: 164";
+ rLen = 45;
+ rLoc = 5076;
+ rType = 0;
+ vrLen = 908;
+ vrLoc = 1841;
+ };
481D04A00CDAAAFC00D4A550 /* MPMutableDictionary.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {720, 699}}";
@@ -187,8 +208,9 @@
};
481D04A10CDAAAFD00D4A550 /* MPMutableDictionary.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {998, 1078}}";
- sepNavSelRange = "{1337, 185}";
+ sepNavIntBoundsRect = "{{0, 0}, {986, 1078}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 1114}";
sepNavVisRect = "{{24, 0}, {720, 699}}";
sepNavWindowFrame = "{{445, 4}, {759, 828}}";
};
@@ -217,6 +239,14 @@
sepNavWindowFrame = "{{15, -1}, {759, 828}}";
};
};
+ 485383C70D8BD8BF0048D73C /* Makefile */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {700, 700}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 684}";
+ sepNavWindowFrame = "{{38, 324}, {759, 828}}";
+ };
+ };
487679530C98C2EB00577C59 /* MPIndex.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {776, 1512}}";
@@ -228,8 +258,9 @@
};
487679540C98C2EB00577C59 /* MPIndex.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {724, 1694}}";
- sepNavSelRange = "{2429, 17}";
+ sepNavIntBoundsRect = "{{0, 0}, {704, 1694}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 1803}";
sepNavVisRect = "{{0, 650}, {724, 618}}";
sepNavWindowFrame = "{{408, 32}, {763, 747}}";
};
@@ -246,10 +277,10 @@
487679680C98C55E00577C59 /* MPPort.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {890, 3094}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{0, 1581}";
+ sepNavSelRange = "{4885, 54}";
+ sepNavVisRange = "{7357, 630}";
sepNavVisRect = "{{0, 1839}, {711, 429}}";
- sepNavWindowFrame = "{{65, 198}, {750, 558}}";
+ sepNavWindowFrame = "{{980, 284}, {750, 558}}";
};
};
48906AD10C422C1000A3ED8A /* Source Control */ = {
@@ -276,8 +307,9 @@
};
48906AFC0C4230B700A3ED8A /* MPInterpreter.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {908, 2184}}";
- sepNavSelRange = "{1721, 0}";
+ sepNavIntBoundsRect = "{{0, 0}, {1046, 2016}}";
+ sepNavSelRange = "{2070, 0}";
+ sepNavVisRange = "{0, 2238}";
sepNavVisRect = "{{0, 619}, {796, 698}}";
sepNavWindowFrame = "{{28, 5}, {835, 827}}";
};
@@ -325,10 +357,19 @@
sepNavWindowFrame = "{{318, 1}, {759, 828}}";
};
};
+ 48AB964B0D892C310013CDB8 /* notifications.m */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {812, 1190}}";
+ sepNavSelRange = "{1122, 0}";
+ sepNavVisRange = "{1093, 1170}";
+ sepNavWindowFrame = "{{704, 118}, {835, 827}}";
+ };
+ };
48E9925B0C82C45800219DDF /* MacPorts.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {796, 698}}";
- sepNavSelRange = "{1679, 0}";
+ sepNavIntBoundsRect = "{{0, 0}, {776, 699}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 1872}";
sepNavVisRect = "{{0, 0}, {796, 698}}";
sepNavWindowFrame = "{{325, -42}, {835, 827}}";
};
@@ -343,16 +384,18 @@
};
48E993930C82CAAE00219DDF /* MPMacPorts.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {998, 2520}}";
- sepNavSelRange = "{4674, 0}";
+ sepNavIntBoundsRect = "{{0, 0}, {986, 2520}}";
+ sepNavSelRange = "{5076, 45}";
+ sepNavVisRange = "{1841, 908}";
sepNavVisRect = "{{0, 2091}, {711, 429}}";
- sepNavWindowFrame = "{{408, 44}, {750, 558}}";
+ sepNavWindowFrame = "{{626, 156}, {750, 558}}";
};
};
48E9939E0C82CEB000219DDF /* init.tcl */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {720, 742}}";
- sepNavSelRange = "{575, 0}";
+ sepNavIntBoundsRect = "{{0, 0}, {700, 1204}}";
+ sepNavSelRange = "{615, 0}";
+ sepNavVisRange = "{424, 768}";
sepNavVisRect = "{{0, 0}, {720, 612}}";
sepNavWindowFrame = "{{504, 47}, {759, 741}}";
};
@@ -367,8 +410,9 @@
};
48F811BF0CE4638C009630DE /* MPRegistry.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {908, 2002}}";
- sepNavSelRange = "{4490, 0}";
+ sepNavIntBoundsRect = "{{0, 0}, {896, 1946}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{333, 2281}";
sepNavVisRect = "{{0, 1303}, {720, 699}}";
sepNavWindowFrame = "{{15, -1}, {759, 828}}";
};
Added: users/rhwood/MacPorts.Framework/Tcl_Notifications/Makefile
===================================================================
--- users/rhwood/MacPorts.Framework/Tcl_Notifications/Makefile (rev 0)
+++ users/rhwood/MacPorts.Framework/Tcl_Notifications/Makefile 2008-06-09 09:29:45 UTC (rev 37472)
@@ -0,0 +1,32 @@
+MKDIR = /bin/mkdir -p -m 0755
+RM = /bin/rm -f
+RMDIR = /bin/rm -fr
+INSTALL = /usr/bin/install -m 0644
+TCLSH = /usr/bin/tclsh
+
+DESTDIR =
+PREFIX = /Library/Tcl/notifications1.0
+
+OBJS = notifications.o
+TARGET = notifications.dylib
+
+CC = gcc
+CFLAGS = -Wall -DUSE_TCL_STUBS
+FRAMEWORKS = -framework Cocoa -framework Tcl -ltclstub8.4
+LDFLAGS = -dynamiclib -install_name $(PREFIX)/$(TARGET)
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(CC) $(LDFLAGS) $(FRAMEWORKS) $(OBJS) -o $@
+
+clean:
+ $(RM) $(OBJS) $(TARGET)
+
+install: all
+ $(MKDIR) "$(DESTDIR)$(PREFIX)"
+ $(INSTALL) "$(TARGET)" "$(DESTDIR)$(PREFIX)"
+ echo pkg_mkIndex "$(DESTDIR)$(PREFIX)" | $(TCLSH)
+
+uninstall:
+ $(RMDIR) "$(DESTDIR)$(PREFIX)"
Added: users/rhwood/MacPorts.Framework/Tcl_Notifications/notifications.m
===================================================================
--- users/rhwood/MacPorts.Framework/Tcl_Notifications/notifications.m (rev 0)
+++ users/rhwood/MacPorts.Framework/Tcl_Notifications/notifications.m 2008-06-09 09:29:45 UTC (rev 37472)
@@ -0,0 +1,85 @@
+//
+// notifications.m
+// MacPorts.Framework
+//
+// Created by Randall Hansen Wood on 13/3/2008.
+// Copyright 2008 __MyCompanyName__. All rights reserved.
+//
+
+#include <tcl.h>
+
+#include <Cocoa/Cocoa.h>
+
+int Notifications_Send(int objc, Tcl_Obj *CONST objv[], int global, Tcl_Interp *interpreter) {
+ NSString *name = nil;
+ NSMutableDictionary *info = nil;
+
+ int tclCount;
+ int tclResult;
+ int i;
+ const char **tclElements;
+
+ name = [NSString stringWithUTF8String:Tcl_GetString(*objv)];
+ ++objv; --objc;
+ tclResult = Tcl_SplitList(interpreter, Tcl_GetString(*objv), &tclCount, &tclElements);
+ if (tclResult == TCL_OK) {
+ info = [NSMutableDictionary dictionaryWithCapacity:(tclCount / 2)];
+ for (i = 0; i < tclCount; i +=2) {
+ [info setObject:[NSString stringWithUTF8String:tclElements[i + 1]] forKey:[NSString stringWithUTF8String:tclElements[i]]];
+ }
+ if (global != 0) {
+ [[NSDistributedNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+ } else {
+ [[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+ }
+ } else {
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+int Notifications_Command(ClientData clientData, Tcl_Interp *interpreter, int objc, Tcl_Obj *CONST objv[]) {
+
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
+ NSString *action = nil;
+ int returnCode = TCL_ERROR;
+
+ ++objv, --objc;
+
+ if (objc) {
+ action = [NSString stringWithUTF8String:Tcl_GetString(*objv)];
+ ++objv, --objc;
+ if ([action isEqualToString:@"send"]) {
+ if ([[NSString stringWithUTF8String:Tcl_GetString(*objv)] isEqualToString:@"global"]) {
+ ++objv, --objc;
+ returnCode = Notifications_Send(objc, objv, 1, interpreter);
+ } else {
+ returnCode = Notifications_Send(objc, objv, 0, interpreter);
+ }
+ }
+ }
+
+ [pool release];
+ return returnCode;
+}
+
+int Notifications_Init(Tcl_Interp *interpreter) {
+
+ if (Tcl_InitStubs(interpreter, "8.4", 0) == NULL) {
+ return TCL_ERROR;
+ }
+
+ Tcl_CreateObjCommand(interpreter, "notifications", Notifications_Command, NULL, NULL);
+
+ if (Tcl_PkgProvide(interpreter, "notifications", "1.0") != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+int Notifications_SafeInit(Tcl_Interp *interpreter) {
+
+ return Notifications_Init(interpreter);
+}
\ No newline at end of file
Modified: users/rhwood/MacPorts.Framework/init.tcl
===================================================================
--- users/rhwood/MacPorts.Framework/init.tcl 2008-06-09 09:25:48 UTC (rev 37471)
+++ users/rhwood/MacPorts.Framework/init.tcl 2008-06-09 09:29:45 UTC (rev 37472)
@@ -2,6 +2,7 @@
[file join "/Library/Tcl" macports1.0 macports_fastload.tcl]}
package require macports
+package require notifications
# ui_options accessor
proc ui_isset {val} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080609/66e3862f/attachment-0001.htm
More information about the macports-changes
mailing list