mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
* GormCore/GNUmakefile: Added GormServer.h to the headers.
* GormCore/GormCustomClassInspector.m: Change tooltip when a new custom class is selected from the list. * GormCore/GormPalettesManager.m: Set autoresizing on drag view. * GormCore/GormServer.h: Protocol for GormServer. * GormCore/GormViewEditor.m: Add the class name to the tooltip. * Gorm.m: Vend the object so that other apps can talk to Gorm via DO. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@29499 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5bde203cac
commit
b1b23f9a77
7 changed files with 87 additions and 2 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2010-02-07 05:43-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* GormCore/GNUmakefile: Added GormServer.h to the headers.
|
||||
* GormCore/GormCustomClassInspector.m: Change tooltip when
|
||||
a new custom class is selected from the list.
|
||||
* GormCore/GormPalettesManager.m: Set autoresizing on drag view.
|
||||
* GormCore/GormServer.h: Protocol for GormServer.
|
||||
* GormCore/GormViewEditor.m: Add the class name to the
|
||||
tooltip.
|
||||
* Gorm.m: Vend the object so that other apps can talk
|
||||
to Gorm via DO.
|
||||
|
||||
2010-01-20 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Palettes/2Controls/ControlsPalette.gorm:
|
||||
|
|
29
Gorm.m
29
Gorm.m
|
@ -31,10 +31,12 @@
|
|||
#include <GormCore/GormSetNameController.h>
|
||||
#include <GormCore/GormFunctions.h>
|
||||
#include <GormCore/GormPluginManager.h>
|
||||
#include <GormCore/GormServer.h>
|
||||
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
#include <GormPrefs/GormPrefController.h>
|
||||
|
||||
@interface Gorm : NSApplication <IB, Gorm>
|
||||
@interface Gorm : NSApplication <IB, Gorm, GormServer>
|
||||
{
|
||||
GormPrefController *preferencesController;
|
||||
GormClassManager *classManager;
|
||||
|
@ -86,6 +88,7 @@
|
|||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
NSString *path;
|
||||
NSConnection *conn = [NSConnection defaultConnection];
|
||||
|
||||
path = [bundle pathForImageResource: @"GormLinkImage"];
|
||||
linkImage = [[NSImage alloc] initWithContentsOfFile: path];
|
||||
|
@ -146,6 +149,15 @@
|
|||
* set the delegate.
|
||||
*/
|
||||
[self setDelegate: self];
|
||||
|
||||
/*
|
||||
* Start the server
|
||||
*/
|
||||
[conn setRootObject: self];
|
||||
if([conn registerName: @"GormServer"] == NO)
|
||||
{
|
||||
NSLog(@"Could not register GormServer");
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -163,6 +175,21 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) addClass: (NSDictionary *) dict
|
||||
{
|
||||
GormDocument *doc = (GormDocument *)[self activeDocument];
|
||||
GormClassManager *cm = [doc classManager];
|
||||
NSArray *outlets = [dict objectForKey: @"outlets"];
|
||||
NSArray *actions = [dict objectForKey: @"actions"];
|
||||
NSString *className = [dict objectForKey: @"className"];
|
||||
NSString *superClassName = [dict objectForKey: @"superClassName"];
|
||||
|
||||
[cm addClassNamed: className
|
||||
withSuperClassNamed: superClassName
|
||||
withActions: actions
|
||||
withOutlets: outlets];
|
||||
}
|
||||
|
||||
- (void) stop: (id)sender
|
||||
{
|
||||
if(isTesting == NO)
|
||||
|
|
|
@ -80,6 +80,7 @@ GormCore_HEADER_FILES = \
|
|||
GormResourceEditor.h \
|
||||
GormResourceManager.h \
|
||||
GormScrollViewAttributesInspector.h \
|
||||
GormServer.h \
|
||||
GormSetNameController.h \
|
||||
GormSound.h \
|
||||
GormSoundEditor.h \
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "GormClassManager.h"
|
||||
#include "GormDocument.h"
|
||||
#include "GormPrivate.h"
|
||||
#include "GormViewEditor.h"
|
||||
|
||||
@implementation GormCustomClassInspector
|
||||
+ (void) initialize
|
||||
|
@ -312,6 +313,8 @@
|
|||
NSString *stringValue = [NSString stringWithString: [cell stringValue]];
|
||||
NSString *nameForObject = [_document nameForObject: [self object]];
|
||||
NSString *classForObject = [[self object] className];
|
||||
GormViewEditor *gve = (GormViewEditor *)[_document editorForObject: [self object]
|
||||
create: NO];
|
||||
|
||||
NSDebugLog(@"selected = %@, class = %@",stringValue,nameForObject);
|
||||
|
||||
|
@ -328,6 +331,11 @@
|
|||
{
|
||||
[_classManager removeCustomClassForName: nameForObject];
|
||||
}
|
||||
|
||||
[gve setToolTip: [NSString stringWithFormat: @"%@,%@",
|
||||
nameForObject,
|
||||
stringValue]];
|
||||
|
||||
[self _replaceWithCellClassForClassName: stringValue];
|
||||
}
|
||||
else
|
||||
|
|
|
@ -84,6 +84,9 @@ static NSImage *dragImage = nil;
|
|||
IBCellPboardType, IBMenuPboardType, IBMenuCellPboardType,
|
||||
IBObjectPboardType, IBViewPboardType, IBWindowPboardType,
|
||||
IBFormatterPboardType,nil]];
|
||||
|
||||
[self setAutoresizingMask:
|
||||
NSViewMinXMargin|NSViewMinYMargin|NSViewMaxXMargin|NSViewMaxYMargin];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
29
GormCore/GormServer.h
Normal file
29
GormCore/GormServer.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* GormServer.h
|
||||
*
|
||||
* Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Gregory Casamento <greg.casamento@gmail.com>
|
||||
* This file is part of GNUstep.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
*/
|
||||
#ifndef INCLUDED_GormServer_h
|
||||
#define INCLUDED_GormServer_h
|
||||
|
||||
@protocol GormServer
|
||||
- (void) addClass: (NSDictionary *)dict;
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -33,6 +33,8 @@
|
|||
#include "GormFunctions.h"
|
||||
#include "GormViewWindow.h"
|
||||
#include "GormViewKnobs.h"
|
||||
#include "GormClassManager.h"
|
||||
#include "GormDocument.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -155,6 +157,7 @@ static BOOL currently_displaying = NO;
|
|||
{
|
||||
NSView *superview;
|
||||
NSString *name = [document nameForObject: _editedObject];
|
||||
GormClassManager *cm = [(GormDocument *)document classManager];
|
||||
|
||||
// if the view window is not nil, it's a standalone view...
|
||||
if(viewWindow != nil)
|
||||
|
@ -186,7 +189,9 @@ static BOOL currently_displaying = NO;
|
|||
}
|
||||
|
||||
[self addSubview: _editedObject];
|
||||
[self setToolTip: name];
|
||||
[self setToolTip: [NSString stringWithFormat: @"%@,%@",
|
||||
name,
|
||||
[cm classNameForObject: _editedObject]]];
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
|
|
Loading…
Reference in a new issue