GraphicAgentMotif.hh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * $XConsortium: GraphicAgentMotif.hh /main/11 1996/11/21 11:55:31 cde-hal $
  3. *
  4. * Copyright (c) 1992 HAL Computer Systems International, Ltd.
  5. * All rights reserved. Unpublished -- rights reserved under
  6. * the Copyright Laws of the United States. USE OF A COPYRIGHT
  7. * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
  8. * OR DISCLOSURE.
  9. *
  10. * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
  11. * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
  12. * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
  13. * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
  14. * INTERNATIONAL, LTD.
  15. *
  16. * RESTRICTED RIGHTS LEGEND
  17. * Use, duplication, or disclosure by the Government is subject
  18. * to the restrictions as set forth in subparagraph (c)(l)(ii)
  19. * of the Rights in Technical Data and Computer Software clause
  20. * at DFARS 252.227-7013.
  21. *
  22. * HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
  23. * 1315 Dell Avenue
  24. * Campbell, CA 95008
  25. *
  26. */
  27. #include <WWL/WTopLevelShell.h>
  28. #include "UAS.hh"
  29. class WXmPushButton;
  30. class WXmLabel;
  31. class WPixmap;
  32. class WXawPanner ;
  33. class WXmPulldownMenu ;
  34. class WXmToggleButton;
  35. class PixmapGraphic;
  36. template <class T> class UAS_Pointer;
  37. class GraphicAgent : public Agent,
  38. public UAS_Receiver<DisplayGraphic>,
  39. public UAS_Receiver<ReAttachGraphic>,
  40. public UAS_Receiver<UAS_LibraryDestroyedMsg>
  41. {
  42. public:
  43. GraphicAgent (UAS_Pointer<UAS_Common> &node_ptr,
  44. UAS_Pointer<Graphic> &);
  45. ~GraphicAgent();
  46. void display();
  47. void popup();
  48. void receive(DisplayGraphic &, void *client_data);
  49. void receive(ReAttachGraphic &, void *client_data);
  50. void receive(UAS_LibraryDestroyedMsg &, void *);
  51. UAS_Pointer<Graphic> &graphic() { return f_graphic ; }
  52. void attach_graphic();
  53. void set_graphic(Graphic *gr) { f_graphic = gr; }
  54. UAS_Pointer<UAS_Common> node_ptr() { return f_node_ptr; }
  55. private:
  56. void create_ui();
  57. void visit_node();
  58. void close_window();
  59. void reattach();
  60. void ui_destroyed();
  61. void porthole_report(WCallback *);
  62. void panner_report(WCallback *);
  63. void adjust_panner(unsigned int state);
  64. void set_panner(WCallback *);
  65. void set_zoom(unsigned int scale);
  66. void zoom_callback(WCallback *);
  67. void fit_graphic_to_window_callback(WCallback*);
  68. void fit_window_to_graphic_callback(WCallback*);
  69. void fit_window_to_graphic();
  70. void install_new_picture(PixmapGraphic *);
  71. void refresh(const UAS_Pointer<Graphic> &);
  72. void unset_scale_buttons();
  73. private:
  74. WTopLevelShell f_shell;
  75. UAS_Pointer<UAS_Common> f_node_ptr ;
  76. UAS_Pointer<Graphic> f_graphic ;
  77. WXawPanner *f_panner;
  78. WPixmap *f_pixmap_widget ;
  79. unsigned int f_panner_state ;
  80. unsigned int f_current_scale;
  81. WXmPulldownMenu *f_view_menu ;
  82. WXmLabel *f_message_area ;
  83. WXmToggleButton *f_scale_button ;
  84. WXmToggleButton *f_custom_scale ;
  85. int f_setcustom ;
  86. };