aclock-0.2.3/0000755000175000017500000000000010150222764013547 5ustar gurkangurkan00000000000000aclock-0.2.3/AClock.gorm/0000755000175000017500000000000010040173420015636 5ustar gurkangurkan00000000000000aclock-0.2.3/AClock.gorm/data.classes0000644000175000017500000000777410040173420020145 0ustar gurkangurkan00000000000000{ AppController = { Actions = ( "openPreferences:", "setFrameColor:", "setFaceColor:", "setFaceTransparency:", "setShowAMPM:", "setSecondHandColor:", "setHandColor:", "setShadow:", "setMarkColor:", "setFrequency:", "setSecond:", "setNumberType:", "clockUpdate:" ); Outlets = ( prefPanel, frameColorW, secColorW, handColorW, transSlider, ampmSwitch, faceColorW, shadowSwitch, bigClock, markColorW, freqText, secondSwitch, numberPopUp, alarmWindow ); Super = NSObject; }; Clock = { Actions = ( ); Outlets = ( ); Super = NSControl; }; FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; }aclock-0.2.3/AClock.gorm/objects.gorm0000644000175000017500000003234010040173420020157 0ustar gurkangurkan00000000000000GNUstep archive00002a95:00000025:00000198:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&501NSString&% Button101NSButton1 NSControl1NSView1 NSResponder% B C B A  B A& 01 NSMutableArray1 NSArray&%01 NSButtonCell1 NSActionCell1NSCell0&%Shadow01NSImage0 &%common_SwitchOff0 1NSFont%&&&&&&&&%0 &0 &0 0&%common_SwitchOn&&&0&%GormCustomView01 GSCustomView1 GSNibItem0&%Clock Ch C/ C C &0&% Button20% B B C A  C A&0 &%0 0&% Show second hand &&&&&&&&%0&0& &&&0&%PreferencesPanel01NSPanel1NSWindow%  Cˀ C€& % C@ D30%  Cˀ C€  Cˀ C€&0 &01 NSColorWell% A C B A  B A&0 &%00 & &&&&&&&&0!1NSColor0"&%NSCalibratedWhiteColorSpace ?0#1 NSTextField% B\ C BT A  BT A&0$ &%0%1NSTextFieldCell0&&%Frame0'% A`&&&&&&&&%0(0)&%NSNamedColorSpace0*&%System0+&%textBackgroundColor0,)*0-& % textColor0.1NSBox% A C0 CO C)  CO C)&0/ &00% @ @ CA C   CA C &01 &  02% B0 B B A  B A&03 &%0405& &&&&&&&&06" ?07% B B B A  B A&08 &%090:& % Face Color'&&&&&&&&%0;)0<&%System0=&%textBackgroundColor0>)<0?& % textColor0@1NSSlider% @ B B A  B A&0A &%0B1 NSSliderCell0C&% 0 0D1NSNumber1NSValued &&&&&&&&% ? %0E0F& &&&&&&&&%0G)0H&%System0I&%textBackgroundColor0J)H0K&%controlTextColor0L0M&0N0O&%common_SliderHoriz &&&&&&&&%%0P% B B B A  B A&0Q &%0R0S& % Transparency'&&&&&&&&%0T)0U&%System0V&%textBackgroundColor0W)U0X& % textColor0Y% B0 A B A  B A&0Z &%0[0\& &&&&&&&&0]" ?0^% B A B, A  B, A&0_ &%0`0a&%Marks'&&&&&&&&%0b)0c&%System0d&%textBackgroundColor0e)c0f& % textColor0g1 NSPopUpButton% @ Bl B A  B A&0h &%0i1NSPopUpButtonCell1 NSMenuItemCell0j& &&&&&&&&0k1!NSMenu0l&0m &0n1" NSMenuItem0o&%Roman0p&&&%%0q"0r&%Arabicp&&%0s0t& % common_Nibble%0u"0v&%Nonep&&%%%0w&0x&&&&qk%%%%%0y% B Bx B A  B A&0z &%0{0|& % Number Style'&&&&&&&&%0})0~&%System0&%textBackgroundColor0)~0& % textColor0% B @@ B A  B A&$0 &%0 0&% Display AM/PM &&&&&&&&%0&0& &&&00&%Face &&&&&&&& @ @%%0% A A CO C  CO C&0 &0% @ff @ CA B  CA B&0 &0% A0 B B B  B B&0 &%00& &&&&&&&&0" ?0% B` B B A  B A&0 &%00&%Second'&&&&&&&&%0)0&%System0&%textBackgroundColor0)0& % textColor0% A0 Bd B A  B A&0 &%00& &&&&&&&&0" ?0% B` Bd B A  B A&0 &%00&%Hour and Minute'&&&&&&&&%0)0&%System0&%textBackgroundColor0)0& % textColor0% A0 @ B A  B A&0 &%00&%Text &&&&&&&&%0)0&%System0&%textBackgroundColor0)0& % textColor0% B` @ B A  B A&0 &%00&%Refresh second'&&&&&&&&%0)0&%System0&%textBackgroundColor0)0& % textColor00&%Hands &&&&&&&& @ff @%%0)0&%System0&%windowBackgroundColor0&%Window0±& % Preferences C C F@ F@%0ñ0ı&%NSApplicationIcon0ű& %  MenuItem10Ʊ"0DZ&% Quit0ȱ&% q&&%0ɱ0ʱ&%common_2DCheckMark0˱0̱& % common_2DDash%0ͱ& %  NSVisible0α &0ϱ& %  MenuItem20б"0ѱ&%Info0ұ&&&%ɐ2submenuAction:%0ӱ!0Ա &0ձ"0ֱ& % Info Panel...0ױ&&&%ɐ%0ر"0ٱ&%Preferences...0ڱ&&&%ɐ%0۱"0ܱ&%Help...0ݱ&%?&&%ɐ%0ޱ!0߱&%AClock0 &0"0&% Hide0&% h&&%ɐ%0&% Box10& %  MenuItem30&% Box20% A A0 CՀ B  CՀ B&0 &0% @ @ C΀ B  C΀ B&0 &0% A A C A  C A&0 &%00&9%9Even I Stop The Clock It Tells The Right Time Twice A Day'&&&&&&&&%0)0&%System0&%textBackgroundColor0)0& % textColor00&%Box &&&&&&&& @ @%%0& %  MenuItem40& %  ColorWell10& %  MenuItem50& %  ColorWell220& %  MenuItem60&%View0&% MenuItem0& %  ColorWell4Y0& %  MenuItem70& %  ColorWell5P& % AppControllerP  &P& %  MenuItem8P&%Slider@P& %  TextField17P& %  MenuItem9P& %  TextField2P& %  TextField3PP&%ButtonP & %  TextField4P & %  TextField5^P & %  TextField6P & %  TextField7P & % TextField#P& %  TextField8P& %  TextField9yP& % GormNSMenuP&%GormNSPopUpButtongP&%Box.P& % ColorWellP& %  GormNSMenu1P&%ClockP  &P& % AlarmWindowP%  C B&% Cq CP%  C B  C B&P &P)P&%SystemP&%windowBackgroundColorP&%WindowP&%Alarming ? B F@ F@%ÐP & %  MenuItem10P!&% GSCustomClassMapP"&P#& %  MenuItem11P$& %  MenuItem12P%& %  MenuItem13P&& %  MenuItem14P'& %  MenuItem15qP(&% NSMenuP)& %  MenuItem16nP*&%NSOwnerP+& %  NSApplicationP,& %  MenuItem17uP- &HHP.1#NSNibConnector(P/&%NSOwnerP0##(P1#(P2#$(P31$NSNibControlConnector$(P4&%submenuAction:P5#$P6#P7$P8&%NSFirstP9&%orderFrontStandardInfoPanel:P:#%P;#&P<$&8P=&%orderFrontHelpPanel:P>$#8P?&%hide:P@$8PA& % terminate:PB#/PC#/PD$%PE&% openPreferences:PF#PG# PH1%NSNibOutletConnector/(PI&%menuPJ%/PK&%delegatePL#PM#PN#PO#PP#PQ$PR&% setFrameColor:PS$PT& %  setFaceColor:PU$PV&% setFaceTransparency:PW%PX& % faceColorWPY%PZ& % transSliderP[#P\$P]& %  setShadow:P^%P_& % shadowSwitchP`#Pa# Pb%Pc& % markColorWPd#/Pe#/Pf#/Pg#/Ph#/Pi# /Pj%Pk& % prefPanelPl%Pm& % secColorWPn%Po& % handColorWPp$Pq& %  setMarkColor:Pr$Ps&%setSecondHandColor:Pt$Pu& % setHandColor:Pv#Pw$Px& %  setSecond:Py%Pz& % secondSwitchP{#P|#'P}#)P~#,P%P& % numberPopUpP$P&% setNumberType:P#P#/P$P& % setShowAMPM:P%P& % ampmSwitchP# P$ P& % setFrequency:P% P&%freqTextP# P#P%P&%bigClockP$P& %  clockUpdate:P#/P#搐P#P%P& % alarmWindowaclock-0.2.3/AClock.tiff0000644000175000017500000002732610100270730015556 0ustar gurkangurkan00000000000000MM*-66.v 2.~.@-..(R/home/gurkan/debian/aclock-0.1.0/GNUstepGlow.tiffCreated with The GIMPHNHNaclock-0.2.3/AClockInfo.plist0000644000175000017500000000065510150222722016574 0ustar gurkangurkan00000000000000{ ApplicationDescription = "Analog Clock Dockapp"; ApplicationRelease = "0.2.3"; Authors = ("Alexander Malmberg ,\nBanlu Kemiyatorn ,\nGrkan Sengn "); Copyright = "Copyright 2003 - 2004 Alexander Malmberg, Banlu Kemiyatorn, Grkan Sengn"; CopyrightDescription = "GNU General Public License"; URL = "http://www.linuks.mine.nu/aclock/"; } aclock-0.2.3/AppController.h0000644000175000017500000000153710040171524016505 0ustar gurkangurkan00000000000000/* All Rights reserved */ #include #include "Clock.h" #include @interface AppController : NSObject { id faceColorW; id ampmSwitch; id shadowSwitch; id transSlider; id handColorW; id secColorW; id frameColorW; id prefPanel; id markColorW; id freqText; id secondSwitch; id numberPopUp; id alarmWindow; Clock *_clock; Clock *bigClock; NSTimer *timer; BOOL doFloor; } - (void) openPreferences: (id)sender; - (void) setFrameColor: (id)sender; - (void) setFaceColor: (id)sender; - (void) setFaceTransparency: (id)sender; - (void) setShowAMPM: (id)sender; - (void) setShadow:(id)sender; - (void) setSecondHandColor: (id)sender; - (void) setHandColor: (id)sender; - (void) setMarkColor: (id)sender; - (void) setFrequency: (id)sender; - (void) setSecond: (id)sender; - (void) setNumberType: (id)sender; @end aclock-0.2.3/AppController.m0000644000175000017500000001573510144507654016533 0ustar gurkangurkan00000000000000/* All Rights reserved */ #include #include "AppController.h" @implementation AppController static NSUserDefaults *defaults; + (void) initialize { defaults = [NSUserDefaults standardUserDefaults]; } - (void) setSecondHandColor: (id)sender { NSColor *col = [sender color]; [_clock setSecondHandColor:col]; [bigClock setSecondHandColor:col]; [defaults setObject:[col description] forKey:@"SecondHandColor"]; [defaults synchronize]; } - (void) setHandColor: (id)sender { NSColor *col = [sender color]; [_clock setHandsColor:col]; [bigClock setHandsColor:col]; [defaults setObject:[col description] forKey:@"HandsColor"]; [defaults synchronize]; } - (void) setShowAMPM: (id)sender { [_clock setShowAMPM:[sender intValue]?YES:NO]; [bigClock setShowAMPM:[sender intValue]?YES:NO]; [defaults setObject:[sender intValue]?@"YES":@"NO" forKey:@"ShowAMPM"]; [defaults synchronize]; } - (void) setNumberType: (id)sender { [_clock setNumberType:[sender indexOfSelectedItem]]; [bigClock setNumberType:[sender indexOfSelectedItem]]; [defaults setObject:[NSString stringWithFormat:@"%d",[sender indexOfSelectedItem]] forKey:@"NumberType"]; [defaults synchronize]; } - (void) setSecond: (id)sender { [_clock setSecond:[sender intValue]?YES:NO]; [bigClock setSecond:[sender intValue]?YES:NO]; [defaults setObject:[sender intValue]?@"YES":@"NO" forKey:@"Second"]; [defaults synchronize]; } - (void) setShadow:(id)sender { [_clock setShadow:[sender intValue]?YES:NO]; [bigClock setShadow:[sender intValue]?YES:NO]; [defaults setObject:[sender intValue]?@"YES":@"NO" forKey:@"Shadow"]; [defaults synchronize]; } - (void) setFaceTransparency: (id)sender { [_clock setFaceTransparency:[sender floatValue]]; [bigClock setFaceTransparency:[sender floatValue]]; [defaults setObject:[sender stringValue] forKey:@"FaceTransparency"]; [defaults synchronize]; } - (void) setFaceColor: (id)sender { NSColor *col = [sender color]; [_clock setFaceColor:col]; [bigClock setFaceColor:col]; [defaults setObject:[col description] forKey:@"FaceColor"]; [defaults synchronize]; } - (void) setMarkColor: (id)sender { NSColor *col = [sender color]; [_clock setMarksColor:col]; [bigClock setMarksColor:col]; [defaults setObject:[col description] forKey:@"MarksColor"]; [defaults synchronize]; } - (void) setFrameColor: (id)sender { NSColor *col = [sender color]; [_clock setFrameColor:col]; [bigClock setFrameColor:col]; [defaults setObject:[col description] forKey:@"FrameColor"]; [defaults synchronize]; } - (void) clockUpdate: (id)sender { double st,et; id src,des; if (sender == bigClock) { src = bigClock; des = _clock; } else { src = _clock; des = bigClock; } st = [src arcStartTime]; et = [src arcEndTime]; if (et < st) { [alarmWindow makeKeyAndOrderFront: self]; } [des setArcEndTime:[src arcEndTime]]; [des setShowsArc:[src showsArc]]; } - (void) openPreferences: (id)sender { [prefPanel orderFront: self]; } -(void) applicationWillFinishLaunching: (NSNotification *)not { NSMenu *menu, *m; NSWindow *win; unsigned int width, height; menu = [NSMenu new]; m = [NSMenu new]; /* Info */ [m addItemWithTitle: _(@"Info...") action: @selector(orderFrontStandardInfoPanel:) keyEquivalent: nil]; [m addItemWithTitle: _(@"Preferences...") action: @selector(openPreferences:) keyEquivalent: nil]; [menu setSubmenu: m forItem: [menu addItemWithTitle: _(@"Info") action:NULL keyEquivalent:nil]]; [m release]; [menu addItemWithTitle: _(@"Quit") action: @selector(terminate:) keyEquivalent: @"q"]; [NSApp setMainMenu: menu]; [menu release]; win = [NSApp iconWindow]; width = [[win contentView] bounds].size.width; height = [[win contentView] bounds].size.height; _clock = [[Clock alloc] initWithFrame: NSMakeRect(1, 1, width - 2, height - 2)]; [[win contentView] addSubview:_clock]; [_clock setTarget:self]; [_clock setAction:@selector(clockUpdate:)]; { /* initialize the clock so it won't flick */ NSCalendarDate *d = [NSCalendarDate date]; NSTimeInterval g = [d timeIntervalSinceReferenceDate]; double time; time = [d hourOfDay] * 3600 + [d minuteOfHour] * 60 + [d secondOfMinute]; [_clock setHandsTime: time]; [_clock setArcStartTime: time]; [_clock setArcEndTime: time]; [bigClock setHandsTime: time]; [bigClock setArcStartTime: time]; [bigClock setArcEndTime: time]; } [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:@"0.1" forKey:@"RefreshRate"]]; /* [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: @"YES", @"SmoothSeconds", nil]]; */ } - (void) tick { NSCalendarDate *d = [NSCalendarDate date]; NSTimeInterval g = [d timeIntervalSinceReferenceDate]; double time; if (doFloor) { time = [d hourOfDay] * 3600 + [d minuteOfHour] * 60 + [d secondOfMinute]; [_clock setHandsTime: time]; [bigClock setHandsTime: time]; [_clock setArcStartTime: time]; [bigClock setArcStartTime: time]; } else { time = [d hourOfDay] * 3600 + [d minuteOfHour] * 60 + [d secondOfMinute] + (g - floor(g)); [_clock setHandsTime: time]; [bigClock setHandsTime: time]; [_clock setArcStartTime: time]; [bigClock setArcStartTime: time]; } } - (void) setFrequency: (id)sender { NSInvocation *inv; inv = [NSInvocation invocationWithMethodSignature: [self methodSignatureForSelector:@selector(tick)]]; [inv setSelector:@selector(tick)]; [inv setTarget:self]; RELEASE(timer); timer=[NSTimer scheduledTimerWithTimeInterval:[sender floatValue] invocation:inv repeats:YES]; [defaults setObject:[sender stringValue] forKey:@"RefreshRate"]; if ([defaults floatForKey: @"RefreshRate"] > 15.0) { [secondSwitch setIntValue:0]; [self setSecond:secondSwitch]; doFloor = YES; } else if ([defaults floatForKey: @"RefreshRate"] >= 1.0) { doFloor = YES; } else { doFloor = NO; } [defaults synchronize]; } - (void) applicationDidFinishLaunching: (NSNotification *)not { id defaults = [NSUserDefaults standardUserDefaults]; NSInvocation *inv; inv = [NSInvocation invocationWithMethodSignature: [self methodSignatureForSelector:@selector(tick)]]; [inv setSelector:@selector(tick)]; [inv setTarget:self]; [faceColorW setColor:[_clock faceColor]]; [ampmSwitch setIntValue:[_clock showAMPM]]; [shadowSwitch setIntValue:[_clock shadow]]; [transSlider setFloatValue:[_clock faceTransparency]]; [handColorW setColor:[_clock handsColor]]; [secColorW setColor:[_clock secondHandColor]]; [frameColorW setColor:[_clock frameColor]]; [markColorW setColor:[_clock marksColor]]; [secondSwitch setIntValue:[_clock second]]; [numberPopUp selectItemAtIndex:[_clock numberType]]; [freqText setStringValue:[defaults stringForKey: @"RefreshRate"]]; timer=[NSTimer scheduledTimerWithTimeInterval:[defaults floatForKey: @"RefreshRate"] invocation:inv repeats:YES]; if ([defaults floatForKey: @"RefreshRate"] >= 1.0) { doFloor = YES; } else { doFloor = NO; } if ([defaults boolForKey: @"autolaunch"]) { [NSApp hide: self]; } } @end aclock-0.2.3/COPYING0000644000175000017500000004307607522260613014620 0ustar gurkangurkan00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. aclock-0.2.3/ChangeLog0000644000175000017500000000075410147501532015326 0ustar gurkangurkan000000000000000.2.3 Patch for major speed improvement (thanks Banlu Kemiyatorn) 0.2.1 Patch for autoscaling (thanks Matt Rice) 0.2 Hide Main Menu (thanks Alex Perez), new icon, new background image 0.1.0 Release 0.0.9 Add alarm, bug fixes. 0.0.8 Remove SmoothSeconds. Preferences panel. Eye candies. 0.0.5 Seconds pointer moves smoothly (changeable with the "defaults" tool) 0.0.4 Added license information, seconds pointer is red, hourpointer length increased (thanks Banlu Kemiyatorn and Alex Malmberg) aclock-0.2.3/Clock.h0000644000175000017500000000350010147271576014764 0ustar gurkangurkan00000000000000/* copyright 2003 Alexander Malmberg */ #ifndef Clock_h #define Clock_h #include @class NSColor; @interface Clock : NSControl { NSColor *faceColor,*frameColor,*marksColor,*handsColor,*arcColor,*secHandColor,*dayColor; NSImage *_cacheFrame; NSImage *_cacheMark; float faceTrans; BOOL showsArc; BOOL showAMPM; BOOL shadow; BOOL second; NSFont *font; /* BOOL easter;*/ NSDate *_date; NSTimeZone *_timeZone; NSTimeInterval _tzv; BOOL alarming; int numberType; /* Calculated values used when drawing. */ double handsTime,arcStartTime,arcEndTime; double radius; double base_width; NSPoint center; BOOL inView; } /* TODO? -(NSColor *) arcColor; -(void) setArcColor: (NSColor *)c;*/ - (void) setTimeZone:(NSTimeZone *)tz; - (NSTimeZone *) timeZone; - (void) setDate:(NSDate *)date; - (NSDate *) date; /* move a clock to CSClockView and put these theming method into subclass */ -(NSColor *) marksColor; -(NSColor *) faceColor; -(NSColor *) frameColor; -(NSColor *) handsColor; -(NSColor *) secondHandColor; -(BOOL) showAMPM; -(BOOL) shadow; -(float) faceTransparency; -(NSFont *)font; -(void) setFont:(NSFont *)newfont; -(int) numberType; -(void) setNumberType: (int)i; -(void) setMarksColor: (NSColor *)c; -(void) setFaceColor: (NSColor *)c; -(void) setFaceTransparency:(float)v; -(void) setFrameColor: (NSColor *)c; -(void) setHandsColor: (NSColor *)c; -(void) setSecondHandColor: (NSColor *)c; -(void) setShowAMPM:(BOOL)ampm; -(void) setShadow:(BOOL)sh; -(void) setSecond:(BOOL)sh; -(void) setDayColor: (NSColor *)c; -(BOOL) second; -(BOOL) showsArc; -(void) setShowsArc: (BOOL)s; -(double) handsTime; -(void) setHandsTime: (double)time; -(double) arcStartTime; -(double) arcEndTime; -(void) setArcStartTime: (double)time; -(void) setArcEndTime: (double)time; @end #endif aclock-0.2.3/Clock.m0000644000175000017500000004434210147271617014776 0ustar gurkangurkan00000000000000/* copyright 2003 Alexander Malmberg */ #include "Clock.h" #include #include #ifndef PI #define PI 3.1415926535897932384626434 #endif #include #include @implementation Clock static NSUserDefaults *defaults; static NSArray *numArray[2]; + (void) initialize { numArray[0] = [NSArray arrayWithObjects:@"XII",@"I",@"II",@"III",@"IV",@"V",@"VI",@"VII",@"VIII",@"IX",@"X",@"XI",nil]; numArray[1] = [NSArray arrayWithObjects:@"12",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",nil]; RETAIN(numArray[0]); RETAIN(numArray[1]); defaults = [NSUserDefaults standardUserDefaults]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"1.0 0 0" forKey:@"SecondHandColor"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"1.0 1.0 1.0" forKey:@"FaceColor"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"0.3 0.3 0.3" forKey:@"MarksColor"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"0 0 0" forKey:@"HandsColor"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"0 0 0" forKey:@"FrameColor"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"0.5" forKey:@"FaceTransparency"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"YES" forKey:@"Shadow"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"YES" forKey:@"ShowAMPM"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"YES" forKey:@"Second"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"0" forKey:@"NumberType"]]; [defaults registerDefaults:[NSDictionary dictionaryWithObject:@"NO" forKey:@"EvenIStopTheClockItTellsTheRightTimeTwiceADay"]]; [self setCellClass: [NSActionCell class]]; } /** Internally used functions/methods **/ static double wrap_time(double time) { int i; i=floor(time/1440); return time-i*1440; } -(void) _frameChanged { NSRect r=[self bounds]; double max; max=r.size.width; if (r.size.height35) base_width=radius/35; else base_width=1.2; radius = radius-base_width; ASSIGN(font, [NSFont boldSystemFontOfSize:radius/5]); DESTROY(_cacheFrame); DESTROY(_cacheMark); } /** NSView/-gui 'interface' **/ -(void) setDayColor: (NSColor *)c { ASSIGN(dayColor, c); } - initWithFrame: (NSRect)frame { NSUserDefaults *defaults; defaults = [NSUserDefaults standardUserDefaults]; if (!(self=[super initWithFrame: frame])) return nil; ASSIGN(faceColor,[NSColor colorFromString:[defaults objectForKey: @"FaceColor"]]); ASSIGN(frameColor,[NSColor colorFromString:[defaults objectForKey: @"FrameColor"]]); ASSIGN(marksColor,[NSColor colorFromString:[defaults objectForKey: @"MarksColor"]]); ASSIGN(handsColor,[NSColor colorFromString:[defaults objectForKey: @"HandsColor"]]); ASSIGN(secHandColor,[NSColor colorFromString:[defaults objectForKey: @"SecondHandColor"]]); ASSIGN(arcColor, [NSColor colorWithCalibratedRed: 1.0 green: 0.4 blue: 0.4 alpha: 1.0]); showAMPM=[defaults boolForKey:@"ShowAMPM"]; numberType=[defaults integerForKey:@"NumberType"]; shadow=[defaults boolForKey:@"Shadow"]; second=[defaults boolForKey:@"Second"]; /* easter=[defaults boolForKey:@"EvenIStopTheClockItTellsTheRightTimeTwiceADay"];*/ faceTrans = [defaults floatForKey:@"FaceTransparency"]; ASSIGN(_timeZone,[NSTimeZone systemTimeZone]); _tzv = [_timeZone secondsFromGMT]; handsTime=0; arcStartTime=arcEndTime=0; showsArc=NO; [self _frameChanged]; return self; } -(void) dealloc { DESTROY(faceColor); DESTROY(frameColor); DESTROY(marksColor); DESTROY(handsColor); DESTROY(arcColor); [super dealloc]; } -(void) setFrame: (NSRect)f { [super setFrame: f]; [self _frameChanged]; } -(void) setFaceColor: (NSColor *)c { ASSIGN(faceColor, c); DESTROY(_cacheFrame); } -(int) numberType { return numberType; } -(void) setNumberType: (int)i { numberType = i; DESTROY(_cacheMark); } -(void) setMarksColor: (NSColor *)c { ASSIGN(marksColor, c); DESTROY(_cacheMark); } -(NSColor *) marksColor { return marksColor; } -(void) setFaceTransparency:(float)v { faceTrans = v; DESTROY(_cacheFrame); } -(void) setFrameColor: (NSColor *)c { ASSIGN(frameColor, c); DESTROY(_cacheFrame); } -(void) setHandsColor: (NSColor *)c { ASSIGN(handsColor, c); } -(void) setSecondHandColor:(NSColor *)c { ASSIGN(secHandColor, c); } -(void) setShowAMPM:(BOOL)ampm { showAMPM = ampm; } -(void) setShadow:(BOOL)sh { shadow = sh; DESTROY(_cacheFrame); DESTROY(_cacheMark); } - (BOOL) shadow { return shadow; } -(void) setSecond:(BOOL)sh { second = sh; } - (BOOL) second { return second; } -(NSColor *) faceColor { return faceColor; } -(NSColor *) frameColor { return frameColor; } -(NSColor *) handsColor { return handsColor; } -(NSColor *)secondHandColor { return secHandColor; } -(BOOL) showAMPM { return showAMPM; } -(float) faceTransparency { return faceTrans; } -(NSFont *)font { return font; } -(void) setFont:(NSFont *)newfont { ASSIGN(font,newfont); DESTROY(_cacheMark); } -(BOOL) isOpaque { return NO; } - (void) setArcEndTimeToPoint:(NSPoint)p { double a1,a2; p.x -= center.x; p.y -= center.y; a1 = 450 - (arcStartTime - 43200 * floor(arcStartTime/43200))/43200 * 360; a2 = atan(p.y/p.x)/(2 * M_PI) * 360; if (p.x < 0) { a2 += 180; } else if (p.y < 0) { a2 += 360; } [self setArcEndTime:(a1 - a2) * 120 + arcStartTime]; } - (void) mouseDown:(NSEvent *)event { id target = [_cell target]; SEL action = [_cell action]; [self setShowsArc:!showsArc]; [self sendAction: action to: target]; } - (void) mouseDragged: (NSEvent *)event { id target = [_cell target]; SEL action = [_cell action]; [self setArcEndTimeToPoint:[self convertPoint:[event locationInWindow] fromView:nil]]; [self setShowsArc:YES]; [self sendAction: action to: target]; } - (void) mouseUp:(NSEvent *)event { id target = [_cell target]; SEL action = [_cell action]; [self sendAction: action to: target]; } /* - (void)mouseDragged:(NSEvent *)event { // NSLog(@"%@", [self target]); // NSLog(@"down %g", atan(p.y/p.x)/(2 * M_PI) * 360); [self setNeedsDisplay:YES]; } */ -(void) drawRect: (NSRect)r { NSGraphicsContext *ctxt=GSCurrentContext(); id defaults = [NSUserDefaults standardUserDefaults]; /* BOOL smoothSeconds = [defaults boolForKey: @"SmoothSeconds"]; */ if (radius<5) return; DPSsetlinewidth(ctxt,base_width); /* alarm */ if (arcStartTime > arcEndTime) { id target = [_cell target]; SEL action = [_cell action]; if (showsArc) { [self sendAction: action to: target]; } [self setArcEndTime: arcEndTime]; } /* no cache window, create one */ if (_cacheFrame == nil) { _cacheFrame = [[NSImage alloc] initWithSize:_bounds.size]; [_cacheFrame lockFocus]; /* draw face */ [faceColor set]; DPSgsave(ctxt); DPSsetalpha(ctxt, faceTrans); DPSmoveto(ctxt,center.x+radius,center.y); DPSarc(ctxt,center.x,center.y,radius,0,360); DPSfill(ctxt); DPSgrestore(ctxt); /* draw frame and frame shadow */ [frameColor set]; DPSsetlinewidth(ctxt, base_width*2); DPSmoveto(ctxt,center.x+radius,center.y); DPSarc(ctxt,center.x,center.y,radius,0,360); DPSclosepath(ctxt); DPSstroke(ctxt); if (shadow) { DPSgsave(ctxt); [[NSColor blackColor] set]; DPSsetlinewidth(ctxt, base_width*1.5); DPSsetalpha(ctxt,0.4); DPSmoveto(ctxt,center.x+radius,center.y); DPSarc(ctxt,center.x + 0.5*base_width,center.y-0.5*base_width,radius,0,360); DPSclosepath(ctxt); DPSstroke(ctxt); DPSgrestore(ctxt); [[NSColor whiteColor] set]; DPSgsave(ctxt); DPSsetlinewidth(ctxt, base_width*1.0); DPSsetalpha(ctxt,0.3); DPSmoveto(ctxt,center.x+radius,center.y); DPSarc(ctxt,center.x - 0.5*base_width,center.y + 0.5*base_width,radius,0,360); DPSclosepath(ctxt); DPSstroke(ctxt); DPSgrestore(ctxt); } [_cacheFrame unlockFocus]; } if (_cacheMark == nil) { _cacheMark = [[NSImage alloc] initWithSize:_bounds.size]; /* print numbers and draw mark */ [_cacheMark lockFocus]; /* print AM PM */ if (showAMPM) { NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:(handsTime - 86400 * floor(handsTime/86400))/3600 >= 12?@"PM":@"AM"]; [str addAttribute:NSForegroundColorAttributeName value:marksColor range:NSMakeRange(0,[str length])]; [str addAttribute:NSFontAttributeName value:font range:NSMakeRange(0,[str length])]; NSSize strSize = [str size]; [str drawAtPoint:NSMakePoint(center.x - strSize.width/2, center.y - radius * 0.8 + strSize.height/2)]; RELEASE(str); } { int i; double a,x,y; [marksColor set]; if (numberType != 0 && radius >= 27) for (i=0;i<60;i++) { if (i%5) { a=i/60.0*2*PI; x=sin(a); y=cos(a); DPSarc(ctxt,center.x+x*radius*0.90,center.y+y*radius*0.90,0.5*base_width,0,360); DPSfill(ctxt); } } for (i=0;i<12;i++) { a=i/12.0*2*PI; x=sin(a); y=cos(a); if (numberType != 0) { DPSmoveto(ctxt,center.x+x*radius*0.95,center.y+y*radius*0.95); DPSlineto(ctxt,center.x+x*radius*0.83,center.y+y*radius*0.83); DPSstroke(ctxt); } if (numberType == 1) { NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:[numArray[1] objectAtIndex:i]]; [str addAttribute:NSForegroundColorAttributeName value:marksColor range:NSMakeRange(0,[str length])]; [str addAttribute:NSFontAttributeName value:font range:NSMakeRange(0,[str length])]; NSSize size = [str size]; [str drawAtPoint:NSMakePoint(center.x+x*radius*0.7 - size.width/2, center.y+y*radius*0.7 - size.height/2)]; RELEASE(str); if (dayColor && i == (int)[_date monthOfYear]) { DPSgsave(ctxt); DPSsetalpha(ctxt,0.7); DPSarc(ctxt,center.x+x*radius*0.7,center.y+y*radius*0.7,3*base_width,0,360); DPSstroke(ctxt); DPSgrestore(ctxt); } } else if (numberType == 0) { NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:[numArray[0] objectAtIndex:i]]; [str addAttribute:NSForegroundColorAttributeName value:marksColor range:NSMakeRange(0,[str length])]; [str addAttribute:NSFontAttributeName value:font range:NSMakeRange(0,[str length])]; NSSize size = [str size]; [str drawAtPoint:NSMakePoint(center.x+x*radius*0.80 - size.width/2.5, center.y+y*radius*0.80 - size.height/2)]; RELEASE(str); } } } [_cacheMark unlockFocus]; NSLog(@"create cache"); } [_cacheFrame compositeToPoint:NSZeroPoint operation:NSCompositeSourceAtop]; /* if ((handsTime - 86400 * floor(handsTime/86400))/3600 > 12); { } */ /* draw arc */ if (showsArc) { double a1,a2,x,y; double r1; // [arcColor set]; /* { hours=handsTime-43200*floor(handsTime/43200); hours/=3600*12; if (hours>=1) hours-=1; a=hours*2*PI; x=sin(a); y=cos(a); } */ a1 = 90 - (arcStartTime - 43200 * floor(arcStartTime/43200))/43200 * 360; a2 = 90 - (arcEndTime - 43200 * floor(arcEndTime/43200))/43200 * 360; //a2=90-arcEndTime/60/12*360; /* x=sin(a2) * radius * 0.4; y=cos(a2) * radius * 0.4; */ r1=radius * 0.8; /* x=cos(a2/360*2*PI)*r1; y=sin(a2/360*2*PI)*r1; */ DPSnewpath(ctxt); /* DPSmoveto(ctxt,center.x,center.y+r1); */ // DPSlineto(ctxt,center.x,center.y); if (a2 < a1) { a2 += 360; } DPSsetlinewidth(ctxt,radius*0.4* (0.1 + (a2-a1)/400)); [[NSColor colorWithDeviceHue: 0.5 - (a2 - a1)/720 saturation:0.1 + (a2 - a1)/400 brightness:0.8 alpha:faceTrans + 0.7] set]; DPSarc(ctxt,center.x,center.y,r1,a2,a1); DPSstroke(ctxt); } [_cacheMark compositeToPoint:NSZeroPoint operation:NSCompositeSourceAtop]; DPSsetlinewidth(ctxt,base_width); { double hours,minutes,seconds; double a,x,y; /* Shadows */ if (shadow) { DPSgsave(ctxt); DPStranslate(ctxt, base_width*1.0, -1.5*base_width); [[NSColor blackColor] set]; DPSsetalpha(ctxt, 0.3); if (second) { seconds=handsTime-60*floor(handsTime/60); /* if (smoothSeconds == NO) seconds = floor(seconds); */ seconds/=60; a=seconds*2*PI; x=sin(a); y=cos(a); DPSsetlinewidth(ctxt,base_width*0.8); DPSmoveto(ctxt,center.x+x*radius*0.89,center.y+y*radius*0.89); seconds=handsTime-60*floor(handsTime/60)+30; /* if (smoothSeconds == NO) seconds = floor(seconds); */ seconds/=60; a=seconds*2*PI; x=sin(a); y=cos(a); DPSlineto(ctxt,center.x+x*radius*0.30,center.y+y*radius*0.30); DPSstroke(ctxt); DPSarc(ctxt,center.x,center.y,1.5*base_width,0,360); DPSfill(ctxt); } else { DPSarc(ctxt,center.x,center.y,1.5*base_width,0,360); DPSfill(ctxt); } minutes=handsTime-3600*floor(handsTime/3600); minutes/=3600; a=minutes*2*PI; x=sin(a); y=cos(a); DPSsetlinewidth(ctxt,base_width); DPSmoveto(ctxt,center.x,center.y); DPSlineto(ctxt,center.x+x*radius*0.89,center.y+y*radius*0.89); DPSstroke(ctxt); hours=handsTime-43200*floor(handsTime/43200); hours/=3600*12; if (hours>=1) hours-=1; a=hours*2*PI; x=sin(a); y=cos(a); /* { int x2,y2; float f; f=0.06; DPSmoveto(ctxt,center.x,center.y); x2=sin(a+PI/2)*radius*f+center.x+x/2*radius*0.5; y2=cos(a+PI/2)*radius*f+center.y+y/2*radius*0.5; DPScurveto(ctxt, x2,y2,x2,y2, center.x+x*radius*0.5,center.y+y*radius*0.5); x2=-sin(a+PI/2)*radius*f+center.x+x/2*radius*0.5; y2=-cos(a+PI/2)*radius*f+center.y+y/2*radius*0.5; DPScurveto(ctxt, x2,y2,x2,y2, center.x,center.y); DPSfill(ctxt); } */ DPSsetlinewidth(ctxt,base_width*1.5); DPSsetlinecap(ctxt,1); DPSmoveto(ctxt,center.x,center.y); DPSlineto(ctxt,center.x+x*radius*0.5,center.y+y*radius*0.5); DPSstroke(ctxt); DPSsetlinecap(ctxt,0); DPSgrestore(ctxt); /** done Shadow **/ } [handsColor set]; minutes=handsTime-3600*floor(handsTime/3600); minutes/=3600; a=minutes*2*PI; x=sin(a); y=cos(a); DPSsetlinewidth(ctxt,base_width); DPSmoveto(ctxt,center.x,center.y); DPSlineto(ctxt,center.x+x*radius*0.89,center.y+y*radius*0.89); DPSstroke(ctxt); hours=handsTime-43200*floor(handsTime/43200); hours/=3600*12; if (hours>=1) hours-=1; a=hours*2*PI; x=sin(a); y=cos(a); /* { int x2,y2; float f; f=0.06; DPSmoveto(ctxt,center.x,center.y); x2=sin(a+PI/2)*radius*f+center.x+x/2*radius*0.5; y2=cos(a+PI/2)*radius*f+center.y+y/2*radius*0.5; DPScurveto(ctxt, x2,y2,x2,y2, center.x+x*radius*0.5,center.y+y*radius*0.5); x2=-sin(a+PI/2)*radius*f+center.x+x/2*radius*0.5; y2=-cos(a+PI/2)*radius*f+center.y+y/2*radius*0.5; DPScurveto(ctxt, x2,y2,x2,y2, center.x,center.y); DPSfill(ctxt); } */ DPSsetlinewidth(ctxt,base_width*1.5); DPSsetlinecap(ctxt,1); DPSmoveto(ctxt,center.x,center.y); DPSlineto(ctxt,center.x+x*radius*0.5,center.y+y*radius*0.5); DPSstroke(ctxt); DPSsetlinecap(ctxt,0); if (second) { [secHandColor set]; seconds=handsTime-60*floor(handsTime/60); /* if (smoothSeconds == NO) seconds = floor(seconds); */ seconds/=60; a=seconds*2*PI; x=sin(a); y=cos(a); DPSsetlinewidth(ctxt,base_width*0.8); DPSmoveto(ctxt,center.x+x*radius*0.89,center.y+y*radius*0.89); seconds=handsTime-60*floor(handsTime/60)+30; /* if (smoothSeconds == NO) seconds = floor(seconds); */ seconds/=60; a=seconds*2*PI; x=sin(a); y=cos(a); DPSlineto(ctxt,center.x+x*radius*0.30,center.y+y*radius*0.30); DPSstroke(ctxt); DPSarc(ctxt,center.x,center.y,1.5*base_width,0,360); DPSfill(ctxt); } else { DPSarc(ctxt,center.x,center.y,1.5*base_width,0,360); DPSfill(ctxt); } } if (dayColor) { NSMutableAttributedString *str; NSSize strSize; [dayColor set]; DPSarc(ctxt,center.x,center.y,radius/3,0,360); DPSsetalpha(ctxt, 0.5); DPSfill(ctxt); /* DPSgsave(ctxt); DPSnewpath(ctxt); DPSarc(ctxt,center.x,center.y,radius/4,0,360); DPSclosepath(ctxt); */ str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d",[_date dayOfMonth]]]; [str addAttribute:NSForegroundColorAttributeName value:faceColor range:NSMakeRange(0,[str length])]; [str addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:radius/2.5] range:NSMakeRange(0,[str length])]; strSize = [str size]; DPSsetalpha(ctxt,0.1); [str drawAtPoint:NSMakePoint(center.x - strSize.width/2, center.y - strSize.height/2)]; /* DPSgrestore(ctxt); */ /* NSCalendarDate *date; date = [NSCalendarDate dateWithTimeIntervalSinceReferenceDate:[_date timeIntervalSinceReferenceDate] + _tzv]; */ } } /** Public interface **/ -(BOOL) showsArc { return showsArc; } -(void) setShowsArc: (BOOL)s { s=!!s; if (s==showsArc) return; showsArc=s; [self setNeedsDisplay: YES]; } - (void) setTimeZone:(NSTimeZone *)tz { ASSIGN(_timeZone,tz); _tzv = [tz secondsFromGMT]; [self setNeedsDisplay: YES]; } - (NSTimeZone *) timeZone { return _timeZone; } - (void) setDate:(NSDate *)date { ASSIGN(_date, date); handsTime = [date timeIntervalSinceReferenceDate] + _tzv; /* if (easter) { [self translateOriginToPoint:center]; [self rotateByAngle:6 * (time-handsTime)]; [self translateOriginToPoint:NSMakePoint(-center.x,-center.y)]; } */ [self setNeedsDisplay: YES]; } - (NSDate *) date { return _date; } -(double) handsTime { return handsTime; } -(void) setHandsTime: (double)time { /* if (easter) { [self translateOriginToPoint:center]; [self rotateByAngle:6 * (time-handsTime)]; [self translateOriginToPoint:NSMakePoint(-center.x,-center.y)]; } */ handsTime=time; [self setNeedsDisplay: YES]; } -(double) arcStartTime { return arcStartTime; } -(double) arcEndTime { return arcEndTime; } -(void) setArcStartTime: (double)time { if (time==arcStartTime) return; arcStartTime=time; if (showsArc) [self setNeedsDisplay: YES]; } -(void) setArcEndTime: (double)time { arcEndTime=time; /* FIXME oh please learn math :P */ while (arcEndTime > arcStartTime) { arcEndTime -= 3600 * 12; } while (arcEndTime <= arcStartTime) { arcEndTime += 3600 * 12; } if (showsArc) [self setNeedsDisplay: YES]; } @end aclock-0.2.3/GNUmakefile0000644000175000017500000000047410144512035015622 0ustar gurkangurkan00000000000000include $(GNUSTEP_MAKEFILES)/common.make PACKAGE_NAME = AClock VERSION = 0.2.1 APP_NAME = AClock AClock_MAIN_MODEL_FILE=AClock.gorm AClock_APPLICATION_ICON=AClock.tiff AClock_OBJC_FILES = main.m Clock.m AppController.m AClock_RESOURCE_FILES = AClock.gorm AClock.tiff include $(GNUSTEP_MAKEFILES)/application.make aclock-0.2.3/README0000644000175000017500000000006510101756422014427 0ustar gurkangurkan00000000000000 Comments? Grkan Sengn aclock-0.2.3/clock.png0000644000175000017500000001131110101756077015352 0ustar gurkangurkan00000000000000PNG  IHDR@@iqbKGD pHYs  tIME7zdVIDATx]euk=ϳ9yv[VɇQS$. T*7 $HD.EUȦ#7@%3yz>#j睴Yңsq~^w_ܱ;vcwjrɿwMOn9f?O:TM:2W7g{K$t}lrުmIy)C킛:u!Toi}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rq~|v}t{}v{|~~~wu~y|syvv|r||}~zvwv{y~|y~{z|}}ztwsz}~}~~}~vs}~u|}uw}{y~|x~zvpt}v|wzz}~~u}~{~xy|{{|~y{~~{}~xzy|z~y}xzuw}yzyvsvwyww}xuutseddrvocTZpvR?BSgʴ\2#7Yƞr@&+[ƘZ&.jܼp4 ?ϨP$Ov0/o̜NOѰp0/oƀDIҰp0/oDOˤp1/nպPOƞp6 /mɶT&K~аtD3eǹZ' !K{ʴT(3aq;;mɸd8'MʹT(+[ˤr> ;kƚd8*VϴN' 3gp6%OҲ~T(;mȤp8'MմM%Amˤq;'M̶^58hͬ|N(E{мp9 1Y̶^8!?gаuK*&Hw̽r@%!9a̸d8;kɲ|N-!+K{ξtG)$9a϶d:%#;kɩ|N+ /QzÞtH,' int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(pool); [NSApplication sharedApplication]; [NSApp run]; DESTROY(pool); return 0; } aclock-0.2.3/configure-stamp0000644000175000017500000000000010150126556016565 0ustar gurkangurkan00000000000000aclock-0.2.3/build-stamp0000644000175000017500000000000010150126571015700 0ustar gurkangurkan00000000000000