-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStarryNightPlugins.h
4116 lines (3714 loc) · 168 KB
/
StarryNightPlugins.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//----------------------------------------------------------------------
// Copyright © 1990-2005 by Starry Night Software, Inc., All rights reserved.
//
// File: StarryNightPlugins.h
//
// Contains: public interface to Starry Night's plug-in architecture.
//
// Authors: Ted Leckie, Tom Andersen
// With help from Roy Lovejoy
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 05/10/07 MK 5.7.0 Added ASCOM Focuser related calls
// 02/10/02 DWW 4.5.0 Updated for version 4 Plugin SDK
// 02/10/02 DWW 4.0.0 Updated comments and constants for sn_SetPluginStatusText
// 02/03/05 DWW 4.0.0 Mods for Pro X
// 99/08/20 ETL 3.0.0 Mods for Starry Night Pro 3.0
// 96/04/01 ETL 2.0.0 New
//
//----------------------------------------------------------------------
// General Notes for Version 5.x releases:
//----------------------------
// This release of Starry Night plugin SDK contains a number of enhancements that support focuser
// control, additional telescope functionality and available FOV information.
//
// General Notes for the Version 4.0 release:
//----------------------------
// The major difference between this release and previous releases of the Starry Night plugin SDK is
// the addition of the sn_SetPluginStatusText API call. Because we at SN Software now support Macintosh
// telescope control ourselves (that is, we created the telescope control plugin shipped with SN) and
// always supported the ASCOM telescope control, we decided to make Telescope control a permanent fixture
// in the SN Pro interface. With the addition of the new "Telescope" tab, plugin developers can now communicate
// plugin starus information directly to the user without having to create their own dialogs.
//
// Note that after SN detects a telescope plugin in the "Plug-ins" folder (your plugin tells SN that it is a
// telescope -also use for digital setting circles- plugin in its op_Initialize routine by setting
// outInitRecord->fIsTelescopeController = true) it sets the Status string to "Configure Plugin". After that,
// it is the responsibility of the plugin to keep these strings accurate.
//
// Win32 Notes:
//----------------------------
//
// Note on building for MS VC++ From a plugin writer: With comments from Tom - Nov '99
//
// - To support COM in the plugin, use the appwizard to create an MFC
// AppWizard DLL- not a plain old Win32 SDK style DLL. Be sure to enable
// automation when setting up the wizard. If this is done, the full range
// of OLE brain-damage is available for use by the .dll.
//
// To make a plugin, these are the files you should need:
// StarryNightPlugins.h,
// starrynight.exe.lib (which is a file that you include that will allow the plugin to link to all the available calls in starry night)
// a .cpp file such as controller.cpp
// You want to make a .dll, then change the extension to .plug, and put it in the Starry Night Plugins folder
// All the other files included in the plugin kit, such as the controller data folder, all the .xSYM files, and all other
// .lib files are not needed, but are included as they are either samples or files for mac plug-in developement.
//
// - I found the MS C++ compiler
// doesn't like the "pragma mark" entries in the sdk header file- it
// doesn't implement a pragma called mark. Presumably ifdefs can deal with
// it, but I didn't try, instead just deleted them.
//
// - The #define TARGET_OS_WIN32 must be set by hand. Either getting that
// setting from the compiler defines or documenting the requirement would
// be helpful (assuming I didn't miss it somewhere).
// --You will have to define it by hand, but see the code in Controller.cpp
// put the defines in before you include StarryNightPlugins.h. I guess I
// could put them in StarryNightPlugins.h, but it would be a big messy
// block of ifdefs. --Tom
// note that TARGET_OS_MAC must also be defined to 0 if you are using MS VC++ for x86 --Tom
//
// - Getting the debugger to work required the following;
// Copy the .dll into the plugins folder, changing the extension to
// ..plugin from .dll
// From the project settings, debug tab, additional DLLs option, put the
// full pathname to the .plugin file created by the previous step. If this
// isn't done, debugger breakpoints won't stop the program. I'm not really
// sure why this works. Comforting, no?
//
// Mac Notes:
//-----------------------------------
//
// - The #define TARGET_OS_MAC must be set by hand. Either getting that
// setting from the compiler defines or documenting the requirement would
// be helpful (assuming I didn't miss it somewhere).
// --You will have to define it by hand, but see the code in Controller.cpp
// put the defines in before you include StarryNightPlugins.h. I guess I
// could put them in StarryNightPlugins.h, but it would be a big messy
// block of ifdefs. --Tom
// note that TARGET_OS_WIN32 must also be defined to 0 if you are using MS VC++ for x86 --Tom
//
// -- New notes by Dave Whipps 02/10/02: Note that plugin should be compiled for Mach-0 and put into
// a standard bundle package (Checkout www.apple.com to see how this is done if your development
// environment doesn't support creating one automatically.)
// Also note that there is no longer a mac stub library. You should now link directly to the Starry Night
// application for exported API function definitions. This can be done using the -bundle_loader "path to SN"
// linker flag in Project Builder.
#pragma once
//#include <limits.h>
#if TARGET_OS_MAC
#elif TARGET_OS_WIN32
#else
you must have both TARGET_OS_MAC and TARGET_OS_WIN32 defined with one of them defined 1 the other 0
// see comments above
#endif
#if TARGET_OS_MAC
typedef void* HDC; // on the Mac we need to define an HDC as something
#endif
#ifndef qBuildingPlugin
#define qBuildingPlugin 1
#endif
//----------------------------------------------------------------------
// data types
// we use platform neutral data types
//----------------------------------------------------------------------
// Window ref. Starry Night uses window refs to refer to specific document windows in Starry Night.
// A document window is a regular night sky viewing window.
typedef unsigned long sn_WindowRef;
const sn_WindowRef kFrontWindow = 0;
class TScene;
class TSelection;
#if TARGET_OS_MAC
typedef Boolean pBoolean;
typedef Rect pRect;
typedef Str255 pStr255;
typedef GWorldPtr pGWorldPtr;
typedef Point pPoint;
typedef EventRecord* pEventRecordPtr;
typedef MenuHandle pMenuHandle;
typedef DragReference pDragReference;
typedef ItemReference pItemReference;
typedef PicHandle pHandleToPicture;
#elif TARGET_OS_WIN32
typedef unsigned char pBoolean; // the boolean or BOOL data type,
typedef signed long SInt32; // need to define this for windows since we use it below.
typedef long double double_tsn;
struct pRect
{
short top;
short left;
short bottom;
short right;
};
typedef struct pRect pRect;
// pascal string
typedef unsigned char pStr255[256];
// GWorldPtr
typedef void* pGWorldPtr;
struct pPoint
{
short v;
short h;
};
typedef struct pPoint pPoint;
struct pEventRecord
{
short what;
unsigned long message;
unsigned long when;
pPoint where;
short modifiers;
};
typedef struct pEventRecord pEventRecord;
typedef pEventRecord* pEventRecordPtr; // on Macintosh, a pointer to an EventRecord, on Win32 same thing
typedef HMENU pMenuHandle; // on Macintosh, a menu handle, on windows an HMENU
typedef IDataObject* pDragReference; // on Macintosh a DragReference, windows an OLE IDataObject
typedef unsigned long pItemReference; // on Macintosh an ItemReference
typedef HBITMAP pHandleToPicture; // a devive dependent bitmap that you can get from the screen environment
struct pUpdateRegion
{
unsigned short rgnSize; /*size in bytes*/ // you can almost always ignore this
pRect rgnBBox; /*enclosing rectangle*/
};
#endif //Windows stuff
const long kPluginDrawTimeNeedMoreData = 1;
const short kUndefinedMagnitudeValue = -9999; // flags an unknown magnitude
//----------------------------------------------------------------------
// Version
//
// Purpose: these constants are passed by Starry Night in PInitialize::fPluginAPI to inform
// the plugin the latest version of the plugin API the currently running Starry Night
// supports. The plugin should return the id of the API it uses. If the plugin
// requires a later API than Starry Night supports, it should put up a warning.
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 03/05/28 DWW 4.5.0 Updated plug-in API for version 4.x
//
//----------------------------------------------------------------------
const long kVersion1Plugin = 1;
const long kVersion2Plugin = 2;
const long kVersion3Plugin = 3; // 2.1.2 supports new Telescope controller extensions
const long kVersion4Plugin = 4; // version 3 adds callbacks
const long kVersion5Plugin = 5; // more call back functions, notably OpenURL
const long kVersion6Plugin = 6; // Added a new field to PInitialize
const long kVersion7Plugin = 7; // Added a new fields to PGaze
const long kVersion8Plugin = 8; // Added sn_SetPluginStatusText and related struct
const long kVersion9Plugin = 9; // Updated for SN 4
const long kVersion10Plugin = 10; // Updated for SN 5 (NB initial release of 5.0.0 used kVersion9Plugin)
const long kLatestVersion = kVersion10Plugin;
//----------------------------------------------------------------------
// Menu Commands
//
// Purpose: Note that these MUST correspond to the defined values
// in GracileResources.h
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 2005/Aug/24 MK 5.7 Added Focuser commands
// 03/10/15 DWW 4.5.1 Re-Added since ted removed the command definitions from here...need to support old plugins.
//
//----------------------------------------------------------------------
// these are actually MessageT
const SInt32 cmd_TelescopeConfigure = 8200;
const SInt32 cmd_TelescopeTime = 8201;
const SInt32 cmd_TelescopeLocation = 8202;
const SInt32 cmd_TelescopeOpen = 8203;
const SInt32 cmd_TelescopeClose = 8204;
const SInt32 cmd_TelescopeTrack = 8205;
const SInt32 cmd_TelescopeSlew = 8206;
const SInt32 cmd_TelescopeSync = 8207;
const SInt32 cmd_TelescopeDirectionalSlew = 8208; // New for version 5.0
const SInt32 cmd_TelescopePark = 8209; // New for version 5.0
const SInt32 cmd_TelescopeUnpark = 8210; // New for version 5.0
const SInt32 cmd_TelescopeGoHome = 8211; // New for version 5.0
const SInt32 cmd_TelescopeSetParkPosition = 8212; // New for version 5.0
const SInt32 cmd_SnapShotSettings = 8213; // New for version 5.0
const SInt32 cmd_TakeSnapShot = 8214; // New for version 5.0
const SInt32 cmd_ImportImageToStarryNight = 8215; // New for version 5.0
const SInt32 cmd_FocuserConfigure = 8216; // New for version 5.7
const SInt32 cmd_FocuserOpen = 8217; // New for version 5.7
const SInt32 cmd_FocuserClose = 8218; // New for version 5.7
const SInt32 cmd_FocuserTempCompensation = 8219; // New for version 5.7
const SInt32 cmd_FocuserMove = 8220; // New for version 5.7
const SInt32 cmd_FocuserGoto = 8221; // New for version 5.7
const SInt32 cmd_FocuserStop = 8222; // New for version 5.7
//----------------------------------------------------------------------
// ObjectType
//
// Purpose: these are the object types used universally throughout SN
// to describe any item
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 03/05/28 DWW 4.5.0 Updated plug-in API for version 4.x
//
//----------------------------------------------------------------------
enum ObjectType {
Kind_Unknown = 'xxxx',
Kind_AnyType = 'xxxx',
Kind_StarGrouping = 'Cxxx',
Kind_Asterisim = 'CAxx',
Kind_Constellation = 'CCxx',
Kind_SmallStarGrouping = 'CSxx',
Kind_SolarSystemObject = 'sxxx',
Kind_Sun = 'sSxx',
Kind_Planet = 'sPxx',
Kind_Comet = 'sCxx',
Kind_Asteroid = 'sAxx',
Kind_MoonOfPlanet = 'sMxx',
Kind_MeteorShower = 'ssxx',
Kind_Planetoid = 'sOxx',
Kind_Star = 'Sxxx',
Kind_MultipleStar = 'SMxx',
Kind_DoubleStar = 'S2xx',
Kind_TripleStar = 'S3xx',
Kind_VariableStar = 'SxxV',
Kind_VariableAndMultiple = 'SMxV',
Kind_StarWtihExtrasolarPlanet = 'SxEV',
Kind_Galaxy = 'Gxxx',
Kind_GalaxyCluster = 'GCxx',
Kind_EllipticalGalaxy = 'GExx',
Kind_EllipticalEMinusGalaxy = 'GEe-',
Kind_EllipticalE0Galaxy = 'GEex',
Kind_EllipticalEPlusGalaxy = 'GEe+',
Kind_EllipticalS0MinusGalaxy = 'GES-',
Kind_LenticularS0Galaxy = 'GLSx',
Kind_LenticularS0PlusGalaxy = 'GLS+',
Kind_TransitionS0 = 'GTSx',
Kind_SpiralGalaxy = 'GSxx',
Kind_SpiralSaGalaxy = 'GSSa',
Kind_SpiralSabGalaxy = 'GSSA',
Kind_SpiralSbGalaxy = 'GSSb',
Kind_SpiralSbcGalaxy = 'GSSB',
Kind_SpiralScGalaxy = 'GSSc',
Kind_SpiralScdGalaxy = 'GSSC',
Kind_SpiralSdGalaxy = 'GSSd',
Kind_IregularGalaxy = 'GIxx',
Kind_IregularSpiralSdmGalaxy = 'GISd',
Kind_IregularSpiralSmGalaxy = 'GISm',
Kind_IregularImGalaxy = 'GImx',
Kind_IregularI0Galaxy = 'GI0x',
Kind_Nebula = 'Nxxx',
Kind_DiffuseNebula = 'NDxx',
Kind_DarkNebula = 'Ndxx',
Kind_PlanetaryNebula = 'NPxx',
Kind_ReflectionNebula = 'NRxx',
Kind_ClusterOfStars = 'Kxxx',
Kind_GlobularCluster = 'KGxx',
Kind_OpenCluster = 'KOxx',
Kind_ClusterWithNebulosity = 'KNxx',
Kind_Other = 'Oxxx',
Kind_Globules = 'OGxx',
Kind_H2Region = 'OHxx',
Kind_Quasar = 'OQxx',
Kind_RadioSource = 'ORxx',
Kind_SupernovaRemnant = 'ONxx',
Kind_BlackHole = 'OBxx',
Kind_Nonexistant = 'Xxxx',
Kind_ManmadeObject = 'Mxxx',
Kind_Satellite = 'MSxx',
Kind_GeosyncSatellite = 'MSGx',
Kind_AstroObsSatellite = 'MSAx',
Kind_Probe = 'MPxx',
Kind_MannedSpacecraft = 'MMxx',
Kind_SpotSelection = 'Zxxx',
kLastObjectType = LONG_MAX // to force ObjectType enum to be an Int32
};
//----------------------------------------------------------------------
// FOVType
//
// Purpose: these are the types of FOV indicators available
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 2005/May/28 MK 5.7 Necessary for FOV information
//
//----------------------------------------------------------------------
typedef short FOVType;
const FOVType FOV_Unknown = 0;
const FOVType FOV_UserRectangle = 1;
const FOVType FOV_UserRigel = 2;
const FOVType FOV_UserCircle = 3;
const FOVType FOV_UserTelrad = 4;
const FOVType FOV_CCD = 5;
const FOVType FOV_Eyepiece = 6;
const FOVType FOV_Binoculars = 7;
const FOVType FOV_FinderTelrad = 8;
const FOVType FOV_FinderRigel = 9;
const FOVType FOV_FinderOther = 10;
//----------------------------------------------------------------------
// FOVGroup
//
// Purpose: FOVs are grouped into equipment or specific charts. These
// are the groupings available.
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 2005/June/13 MK 5.7 Necessary for FOV information
//
//----------------------------------------------------------------------
typedef short FOVGroup;
const FOVGroup FOVGroupUnknown = 0;
const FOVGroup FOVGroupEquipment = 1;
const FOVGroup FOVGroupThisChart = 2;
const FOVGroup FOVGroupAllCharts = 3;
//----------------------------------------------------------------------
// OperationT
//
// Purpose: The operation type tells the called plug-in what action it should
// perform.
//
// A plug-in's entry point must be of the form:
//
// OSErr main(OperationT inOperation, void* ioParams)
//
// Where ioParams points to different kinds of structures depending on the
// requested operation. If ioParams is NULL then the requested operation
// does not require any parameters. Some operations call for the plug-in to
// return information in the appropriate structure.
// Here is a description of each operation (note that a plug-in can choose
// to do nothing when called with an operation request.)
//
// Plugin API version: kVersion1Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 96/04/01 ETL 2.0.0 New for Starry Night 2.0
//
//----------------------------------------------------------------------
typedef long OperationT;
const long op_Initialize = 0;
// input: PInitialize*
// output: PInitialize* (fill out the PInitialize structure before returning)
// called once at begining of program when the plugin is first initilialized. The
// current resource file will be the plug-in's file when called.
const long op_Terminate = 1;
// inputs: NULL
// called once when Starry Night terminates
const long op_SetupWindow = 2;
// inputs: WindowPtr
// informs plug-in of the WindowPtr that was created on its behalf. This is the time for the
// plugin to do any window specific setup. (see also op_SetupWin32Window, below)
const long op_UpdateWindow = 3;
// inputs: RgnHandle (update region), on Win32 a pUpdateRegion** is passed in.
// called whenever our window needs updating
const long op_MenuCommand = 4;
// inputs: NULL
// called each time plug-in's menu command is selected
const long op_NewScene = 5;
// inputs: PGaze* (or NULL if no new scene)
// called when new Starry Night window comes to the fore.
// (If all windows are closed then ioParams will be NULL).
const long op_Centre = 6;
// inputs: PGaze*
// called when SN centres on a new object
const long op_About = 7;
// inputs: NULL
// called when user picks About this plug-in from the Apple menu
const long op_Idle = 8;
// inputs: PEvent*
// outputs: PEvent*
// if plug-in requested idle events then whenever the user
// isn't doing anything in Starry Night
const long op_ClickInWindow = 9;
// inputs: PEvent*
// outputs: PEvent*
// called whenever there is a mouse down in the plug-in's window
const long op_DrawLayer = 10;
// inputs: PDraw*
// called for every update to draw plug-in's layer (see below)
const long op_Selection = 11;
// inputs: PSelection*
// called whenever user selects new object (NULL if object is deselected)
const long op_CursorPosition = 12;
// inputs: PSelection*
// called everytime mouse position changes
const long op_LocationChanged = 13;
// inputs: PLocation*
// called whenever the viewing location changes
const long op_BuildContextualPopup = 14;
// inputs: PBuildContext*
const long op_DoContextualPopup = 15;
// inputs: PDoContext*
const long op_DragDropAcceptable = 16;
// inputs: PDragDropAcceptable*
// outputs: PDragDropAcceptable*
// called to find out if a drog and drop item is acceptable to plug-in
const long op_ReceiveDrag = 17;
// inputs: PDragDrop
const long op_GetDrawTimeFuncPtr = 18;
// outputs: PDrawTimeFuncPtrs*
const long op_FindObjectInDataBase = 19;
// inputs: PFindAction*
// outputs: PFindAction*
const long op_ReintializeFind = 20;
// inputs: NULL
const long op_DrawIndicator = 21;
// inputs: PIndicator*
// outputs: PIndicator*
// if you have set PInitialize's fLayer to anything other than Depth_None
// then you will be called with an op_DrawIndicator event for every screen update.
// This allows you to draw a eyepiece circle on Starry Night's view.
const long op_MenuStatus = 22;
// inputs: PMenuStatus*
// outputs: PMenuStatus*
const long op_TelescopeConfigure = 23;
// inputs: NULL
const long op_TelescopeTime = 24;
// inputs: PTime*
const long op_TelescopeLocation = 25;
// inputs: PLocation*
const long op_TelescopeOpen = 26;
// inputs: NULL
const long op_TelescopeClose = 27;
// inputs: NULL
const long op_TelescopeTrack = 28;
// inputs: NULL
// you should toggle tracking on/off when you receive this operation
const long op_TelescopeSlew = 29;
// inputs: PGaze*
const long op_TelescopeSync = 30;
// inputs: PGaze*
const long op_PreDraw = 31;
// inputs: PEvent*
// outputs: PEvent*
// called before updating the window. You can change location, gaze, etc.
const long op_PostDraw = 32;
// inputs: PEvent*
// outputs: PEvent*
// called after updating the window.
const long op_SelectionDoubleClick = 33;
// inputs: PSelection*
// called whenever a selection is double-clicked (to open info window etc).
const long op_TimeChanged = 34;
// inputs: PTime*
// sent when time changed (i.e. will be sent often if time flow is on)
const long op_FactoryDefaults = 35;
// inputs: NULL
// sent to inform plugin that user whishes all settings to go to factory defaults
const long op_CallBackAddress = 36;
// inputs: PCallBackInfo*
// includes the address of the function to call Starry Night back with
const long op_HomeLocation = 37;
// inputs: PLocation*
// called at program start-up, also called when the user changes the location size
const long op_SetupWin32Window = 38;
// inputs: HWND
// Win32 handle to the new created window that you asked for in op_Initialize
const long op_SceneClick = 39;
// inputs: PEvent*
// outputs: PEvent->fOutOperation: pass out_HandledByPlugin if you don't want SN getting the click
// Required version: kVersion5Plugin
// A click in a scene.
const long op_FOVIndicatorPosition = 40;
// inputs: PIndicator*
// outputs: PIndicator*
// Required version: kVersion5Plugin
// To have starry night draw the FOV indicator at a position other than the centre of the screen.
const long op_OSEvent = 41;
// inputs: POSEvent*
// outputs: POSEvent*
// Required version: kVersion6Plugin
// The structure for passing all events through to you. You must set the PInitialize member fWantsAllEvents to true!.
const long op_SetCursor = 42;
// inputs: PEvent*
// outputs: PEvent->fOutOperation: pass out_HandledByPlugin if you set the cursor, otherwise out_DoNothing
// Required version: kVersion6Plugin
// Use this call to change the current mouse cursor shape as needed. For instance the SETI plug-in uses this
// operation to change the cursor to a pointer when the mouse is over the link to the SETI website.
const long op_LatLongChanged = 43;
// inputs: PLocation*
// called whenever the lat long changes (currently called for earth only June 2002)
// const long op_TelescopeAdvanced = 44; // this has been removed since no longer supported
//
//
const long op_TelescopeMotion = 45;
// inputs: PScopeMotion*
// called whenever user pushes one of the telescope motion controls (up, down, stop etc.)
const long op_TelescopePark = 46;
// inputs: NULL
// called whenever user pushes the telescope Park button
const long op_TelescopeUnpark = 47;
// inputs: NULL
// called whenever user pushes the telescope UnPark button
const long op_TelescopeSetParkPosition = 48;
// inputs: NULL
// called whenever user pushes the telescope Set Park Position button
const long op_TelescopeGoHome = 49;
// inputs: NULL
// called whenever user pushes the telescope Set Park Position button
const long op_ImagingPluginSnapShot = 50;
// inputs: NULL
//
const long op_ImagingPluginSnapShotSettings = 51;
// inputs: NULL
// called whenever user pushes the telescope Snap Shot Settings button
const long op_ImagingPluginImportImageToSN = 52;
// inputs: NULL
// called whenever user pushes the telescope Import Image button
const long op_FocuserConfigure = 53;
// inputs: NULL
// called whenever user clicks on the Configure button in the Focuser section
const long op_FocuserOpen = 54;
// inputs: NULL
// called whenever Connect button is pushed for the Focuser
const long op_FocuserClose = 55;
// inputs: NULL
// called whenever Disconnect button is pushed for the Focuser
const long op_FocuserTemperatureCompensation = 56;
// inputs: NULL
// called whenever Temperature Compensation box is checked/unchecked
const long op_FocuserMove = 57;
// inputs: long* set
// called whenever In or Out buttons are pressed. Sends current number of steps with the appropriate sign.
const long op_FocuserGoto = 58;
// inputs: long*
// called whenever Goto button is pressed for the focuser. Sends the position to which the focuser should be moved.
const long op_FocuserStop = 59;
// inputs: none
// called whenever Stop button is pressed in order to Stop focuser Move operation.
//----------------------------------------------------------------------
// Depth Order of Layers
//
// Purpose: Starry Night draws a sky view by drawing what can be thought of as a
// number of transparencies in succession. Each layer is given an ID number
// and the layers are drawn in order of this ID. So layers having lower numbers
// get drawn first.
//
// Plug-ins can return an ID for a layer they wish to draw.
// (Everytime the sky needs updating the plug-in will be called with an
// op_DrawLayer).
//
// You can replace an existing layer by returning the existing
// layer's ID (so for example if you return fLayer=Depth_Background from
// op_Initialize, Starry Night will call the plug-in to draw the sky
// background for each update instead of using its own background drawing routines).
//
// To add a new layer return an id so that your layer is drawn at the correct
// time (for example to draw a circle to represent the field of view of a
// pair of binoculars you could return any number between 10000 and 60000 to have
// this layer draw after planets but before Starry Night's onscreen info
// layer. (Note: you can contact Sienna Software at [email protected] to
// obtain a unique layer id that will not be given to others so that your layer
// won't conflict with another plug-in's layer).
//
// Plugin API version: kVersion1Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 96/04/01 ETL 2.0.0 New for Starry Night 2.0
//
//----------------------------------------------------------------------
const long Depth_None =0; // pass back this if you don't want to draw a layer with your plug-in
const long Depth_Background =1000;
const long Depth_MilkyWay =2000;
const long Depth_AllSkyImage =2100;
const long Depth_ContinentOutlines =2200;
const long Depth_LocalGuides =3000;
const long Depth_CelestialGuides =5000;
const long Depth_GalacticGuides =5500;
const long Depth_ExtragalacticGuides =5500;
const long Depth_Constellations =6000;
const long Depth_EclipticGuides =7000;
const long Depth_NGCIC =7400;
const long Depth_PGC =7500;
const long Depth_Messier =7600;
const long Depth_Images =7650; // depth for images layer
const long Depth_CustomData =8000; // default depth for users that create custom data
const long Depth_Stars =9000;
const long Depth_LastCelestial =9500; // labels for all preceeding layers get drawn at this point
const long Depth_Planets =10000;
const long Depth_Telrad =40000;
const long Depth_NoPersonsLand =55000;
const long Depth_Overlay =57000;
const long Depth_OnscreenInfo =60000;
//----------------------------------------------------------------------
// Structure: PInitialize
//
// Purpose: this structure should be filled out by the plugin when the
// op_Initialize operation is requested.
//
// Plugin API version: kVersion1Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 06/08/01 MK 5.7 fIsFocuserPlugin Added to support a focuser-only plugin (currently Win only).
// 05/01/27 DWW 5.0.2 fIsImagingPlugin Added to allow MaxIm DL (imaging software). Win only at this date.
// 96/04/02 ETL 2.0.0 New for Starry Night 2.0
//
//
// Plug-in Writers: (Windows only)
// fWindowID is really a 'magic number' that you have to set to get a window.
// Different windowIDs will correspond to different window styles.
// For now you should use 3004 as your window ID. Please email [email protected]
// if you are having troubles making windows.
//
//
//
//----------------------------------------------------------------------
typedef struct
{
long fPluginAPI; // version of plug-in API supported
pBoolean fSuccess; // if false then plug-in will not be used
pBoolean fWantsMenuItem; // if this plug-in wants a menu command in settings menu
pBoolean fWantsIdleTime; // if true then plug-in receives op_Idle regularly
pBoolean fWantsWindow; // true if the plug-in requires a window
pBoolean fWindowVisible; // true if window is initially visible
long fWindowID; // id of WIND resource for this window
pBoolean fWindowFloats; // true if requested window should float
pRect fWindowBounds; // bounds and placement for the window (in global coordinates)
long fLayer; // pass back Depth_None if you don't draw into a sky view. If you either draw directly or have
// Starry Night draw a Telrad object then you will need to return the depth at which you want
// the drawing to occur here. For Telrad objects it is suggested that you draw at Depth_Telrad.
pBoolean fIsTelescopeController; // pass back true if you are a telescope controller and want to manage controls in the telescope control panel
pBoolean fIsImagingPlugin; // pass back true if you are a imaging plugin and want to manage controls in the telescope control panel
pStr255 fWindowMenuItem; // menu item for opening and closing your window, if your plug-in has a window (fWantsWindow is true)
pStr255 fAboutMenuItem; // text of menu item for getting information about your plug-in
pStr255 fOptionsMenuItem; // text of menu item for opening an options dialog for your plug-in
pBoolean fWantsAllEvents; // set this to true if you want to get all of the events that go through Starry Night
pBoolean fIsFocuserController; // pass back true if you are a focuser controller and want to manage focuser controls
} PInitialize;
//----------------------------------------------------------------------
// ScopeDirectionT
//
// Purpose: A ScopeDirectionT is passed to the telescope control plugin through
// a PScopeMotion parameter when the user clicks on one of the motion buttons.
//
// Plugin API version: kVersion10Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 04/09/01 DWW 5.0.1 Added for advanced telescope control in Mac
//
//----------------------------------------------------------------------
typedef long ScopeDirectionT;
const ScopeDirectionT direction_NONE_STOP = 0; // Pass this to stop all motion
const ScopeDirectionT direction_UP = 1; // Start scope moving up
const ScopeDirectionT direction_DOWN = 2; // Start scope moving down
const ScopeDirectionT direction_LEFT = 3; // Start scope moving left
const ScopeDirectionT direction_RIGHT = 4; // Start scope moving right
//----------------------------------------------------------------------
// ScopeSlewRateT
//
// Purpose: A ScopeSlewRateT is passed to the telescope control plugin through
// a PScopeMotion parameter when the user clicks on one of the motion buttons.
// The rate should be chosen based on the zoom level (FOV) of the current scene
//
// NOTES: rate_4 is the fastest, rate_1 is the slowest.
//
// Plugin API version: kVersion10Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 04/09/01 DWW 5.0.1 Added for advanced telescope control in Mac
//
//----------------------------------------------------------------------
const double_tsn kMaxFOVInDegreesForSlewRate1 = 2.0;
const double_tsn kMaxFOVInDegreesForSlewRate2 = 10.0;
const double_tsn kMaxFOVInDegreesForSlewRate3 = 30.0;
typedef long ScopeSlewRateT;
const ScopeSlewRateT rate_1 = 1; // These rates are relative since each scope has its own way of doing slew rates.
const ScopeSlewRateT rate_2 = 2; // Starry Night sets this value based on the FOV as above
const ScopeSlewRateT rate_3 = 3; // Anything larger than kMaxFOVInDegreesForSlewRate3 uses rate_4
const ScopeSlewRateT rate_4 = 4; //
//----------------------------------------------------------------------
// Structure: PScopeMotion
//
// Purpose: this is the structure that gets passed from Starry Night to a plug-in
// whenever one of the following operations is requested:
//
// op_TelescopeMotion
//
// Plugin API version: kVersion10Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 04/09/01 DWW 5.0.1 Added for advanced telescope control in Mac
//
//----------------------------------------------------------------------
typedef struct
{
ScopeDirectionT fMotionDirection; // Direction of motion of telescope
ScopeSlewRateT fRelativeSlewRate; // A relative slew rate. Must be implemeted differently for different scopes
sn_WindowRef fInWindow; // Caution: supported in kVersion7Plugin and later only
} PScopeMotion;
//----------------------------------------------------------------------
// Structure: PLocation
//
// Purpose: this is the structure that gets passed from Starry Night to a plug-in
// whenever one of the following operations is requested:
//
// op_LocationChanged
//
// Plugin API version: kVersion1Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 00/10/12 Ted 3.1.1 Added fInWindow
// 96/06/12 Ted 2.0.0 New for Starry Night 2.0
//
//----------------------------------------------------------------------
typedef struct
{
pStr255 fPlaceName; // eg. "Toronto"
double fEarthLatitude; // in radians
double fEarthLongitude; // in radians
double fElevation; // in metres
long fTimeZoneSeconds; // seconds off of GMT
unsigned long fPrivate; // A private number for Sienna Use only- Do not change any values passed in here
sn_WindowRef fInWindow; // Caution: supported in kVersion7Plugin and later only
} PLocation;
//----------------------------------------------------------------------
// Structure: PGaze
//
// Purpose: this is the structure that gets passed from Starry Night to a plug-in
// whenever one of the following operations is requested:
//
// op_Centre - both the Alt/Az and Ra/Dec are for the same point in the sky - the gaze direction
// op_NewScene - both the Alt/Az and Ra/Dec are for the same point in the sky - the gaze direction
//
// Plugin API version: kVersion1Plugin
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 00/10/12 Ted 3.1.1 Added fInWindow
// 98/07/06 Tom 2.1.2 PC plugin support
// 96/04/01 Ted 2.0.0 New for Starry Night 2.0
//
//----------------------------------------------------------------------
typedef struct
{
double fGazeAzimuth; // "real world" (see sn_Mathematical2RealWorldAzimuth) azimuth of user's gaze (in radians)
double fGazeAltitude; // "real world" (see sn_Mathematical2RealWorldAzimuth) altitude of user's gaze (in radians)
double fPixelsPerRadian; // magnification
double fGazeRa; // the right ascension of the gaze in the epoch of date (not j2000)
double fGazeDec; // the declination of the gaze in the epoch of date
sn_WindowRef fInWindow; // Caution: supported in kVersion7Plugin and later only
} PGaze;
//----------------------------------------------------------------------
// Structure: PDraw
//
// Purpose: this is the structure that gets passed from Starry Night to a plug-in
// whenever one of the following operations is requested:
//
// sn_GetFOVIndicators
//
// Plugin API version: kVersion1Plugin - modified since this is version 4.
//
// Date Initials Version Comments
// ---------- --------- ---------- ---------------------------
// 96/05/27 ETL 2.0.0 New for Starry Night 2.0
// 97/02/11 Tom 2.1 2.1 - added GWorld stuff.