Quantum Fog  0.9.3
C_APP.h
1 #pragma once
2 
3 #include "QFog_constants.h"
4 
5 //to get floating windows,
6 //must include UFloatingDesktop.cp in project,
7 //instead of UDesktop.cp
8 
9 #include <Sound.h>
10 #include <MacTypes.h>
11 
12 
13 #include "C_PALETTE.h"
14 #include "C_WIND_BDS_RECO.h"
15 #include "C_DOC.h"
16 //******************************************
17 class C_APP : public LDocApplication
18 {
19 
20  private:
21  C_PALETTE * its_palette_p;
22  static SHORT its_res_file_ref_num;
23 
24 #if _do_debug
25  LAttachment * its_debug_attachment_p;
26 #endif
27 
28  public:
29  C_APP();
30  VOID Initialize();
31  VOID StartUp();
32 
33  VOID CatchExceptionCode(ExceptionCode inError);
34 
35  static const SHORT get_res_file_ref_num();
36 
37  const RGBColor & get_cur_color();
38  VOID set_cur_color(const RGBColor & color);
39  PALETTE_TOOL get_cur_tool();
40  VOID set_cur_tool(PALETTE_TOOL tool);
41  VOID create_pal();
42  VOID finish_palette_closing();
43  VOID get_pal_bds(C_WIND_BDS_RECO & bds);
44  BOOLEAN has_pal();
45 
46  VOID ShowAboutBox();
47 
48  C_DOC * get_ptr_to_doc_on_duty();
49  virtual LModelObject * MakeNewDocument();
50  virtual VOID OpenDocument(FSSpec * inMacFSSpec);
51  virtual VOID ChooseDocument();
52 
53  BOOLEAN ObeyCommand(CommandT inCommand, VOID * ioParam);
54  VOID FindCommandStatus(CommandT inCommand, BOOLEAN & outEnabled,
55  BOOLEAN & outUsesMark, UInt16 & outMark, Str255 outName_pstr);
56 
57 };
58 #pragma mark -
59 
60 
61 //******************************************
62 inline
63 const SHORT C_APP::get_res_file_ref_num()
64 {
65  return its_res_file_ref_num;
66 }
67 //******************************************
68 inline
69 const RGBColor & C_APP::get_cur_color()
70 {
71  return its_palette_p->get_cur_color();
72 }
73 //******************************************
74 inline
75 VOID C_APP::set_cur_color(
76 const RGBColor & color) //in
77 {
78  its_palette_p->set_cur_color(color);
79 }
80 //******************************************
81 inline
82 PALETTE_TOOL C_APP::get_cur_tool()
83 {
84  return (its_palette_p==0)?no_tool:its_palette_p->get_cur_tool();
85 }
86 //******************************************
87 inline
88 VOID C_APP::set_cur_tool(
89 PALETTE_TOOL tool) //in
90 {
91  its_palette_p->set_cur_tool(tool);
92 }
93 //******************************************
94 inline
95 VOID C_APP::get_pal_bds(
96 C_WIND_BDS_RECO & bds) //i-o
97 {
98  //does nothing if its_palette_p = 0
99  bds.set_reco(its_palette_p);
100 }
101 //******************************************
102 inline
103 BOOLEAN C_APP::has_pal()
104 {
105  return its_palette_p!=0;
106 }
107 //******************************************
108 inline
109 LModelObject * C_APP::MakeNewDocument()
110 {
111  return new C_DOC(this, nil);//= new
112  //delete: ~C_DOC()
113 }
Definition: C_WIND_BDS_RECO.h:14
Definition: C_DOC.h:12
Definition: C_PALETTE.h:26
Definition: C_APP.h:17