[52250] branches/gsoc09-gui/MPGUI

juanger at macports.org juanger at macports.org
Fri Jun 12 21:00:23 PDT 2009


Revision: 52250
          http://trac.macports.org/changeset/52250
Author:   juanger at macports.org
Date:     2009-06-12 21:00:22 -0700 (Fri, 12 Jun 2009)
Log Message:
-----------
Adding the models of the GUI.

Added Paths:
-----------
    branches/gsoc09-gui/MPGUI/GUIMacPorts.h
    branches/gsoc09-gui/MPGUI/GUIMacPorts.m
    branches/gsoc09-gui/MPGUI/GUIPort.h
    branches/gsoc09-gui/MPGUI/GUIPort.m

Added: branches/gsoc09-gui/MPGUI/GUIMacPorts.h
===================================================================
--- branches/gsoc09-gui/MPGUI/GUIMacPorts.h	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/GUIMacPorts.h	2009-06-13 04:00:22 UTC (rev 52250)
@@ -0,0 +1,22 @@
+//
+//  MacPorts.h
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 6/12/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import <MacPorts/MacPorts.h>
+
+ at interface GUIMacPorts : NSObject {
+	NSMutableArray *ports;
+}
+
+ at property (copy) NSMutableArray *ports;
+
+- (void) loadPorts;
+//- (void) selfupdate;
+//- (void) sync;
+
+ at end

Added: branches/gsoc09-gui/MPGUI/GUIMacPorts.m
===================================================================
--- branches/gsoc09-gui/MPGUI/GUIMacPorts.m	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/GUIMacPorts.m	2009-06-13 04:00:22 UTC (rev 52250)
@@ -0,0 +1,34 @@
+//
+//  MacPorts.m
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 6/12/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import "GUIMacPorts.h"
+#import "GUIPort.h"
+
+
+ at implementation GUIMacPorts
+
+ at synthesize ports;
+
+- (id) init {
+    [MPMacPorts setPKGPath:@"/Users/juanger/local/macportsbuild/branch-unprivileged/Library/Tcl"];
+    [self loadPorts];
+    return self;
+}
+
+- (void) loadPorts {
+    NSMutableArray *mpports = [NSMutableArray arrayWithArray:[[MPIndex new] ports]];
+    NSMutableArray *guiports = [NSMutableArray arrayWithCapacity:[mpports count]];
+    
+    for (id port in mpports) {
+        GUIPort *guiport = [[GUIPort new] initWithMPPort:port];
+        [guiports addObject:guiport];
+    }
+    [self setPorts:guiports];
+}
+
+ at end

Added: branches/gsoc09-gui/MPGUI/GUIPort.h
===================================================================
--- branches/gsoc09-gui/MPGUI/GUIPort.h	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/GUIPort.h	2009-06-13 04:00:22 UTC (rev 52250)
@@ -0,0 +1,26 @@
+//
+//  GUIPort.h
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 6/12/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import <MacPorts/MacPorts.h>
+
+
+ at interface GUIPort : NSObject {
+    MPPort *port;
+    NSImage *state;
+}
+
+ at property (copy) NSImage *state;
+
+- (id) initWithMPPort:(MPPort*)mpport;
+
+//- (void) install;
+//- (void) uninstall;
+
+
+ at end

Added: branches/gsoc09-gui/MPGUI/GUIPort.m
===================================================================
--- branches/gsoc09-gui/MPGUI/GUIPort.m	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/GUIPort.m	2009-06-13 04:00:22 UTC (rev 52250)
@@ -0,0 +1,29 @@
+//
+//  GUIPort.m
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 6/12/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import "GUIPort.h"
+
+
+ at implementation GUIPort
+
+ at synthesize state;
+
+- (id) initWithMPPort:(MPPort*) mpport{
+    port = mpport;
+    return self;
+}
+
+- (NSString*) description {
+    return [port valueForKey:@"description"];
+}
+
+- (id) valueForUndefinedKey:(NSString*) key{
+    return [port valueForKey:key];
+}
+
+ at end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090612/b6c37917/attachment.html>


More information about the macports-changes mailing list