]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsBitmap.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormMathsBitmap.h
index 7edff1181869cecdcb5a2fc63a6613b7ebd96926..375f4e87769ba21907998fffe4fdde7d422ed9b1 100644 (file)
@@ -1,73 +1,87 @@
 // -*- C++ -*-
 /**
  * \file FormMathsBitmap.h
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
  * \author John Levon
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef FORM_MATHSBITMAP_H
 #define FORM_MATHSBITMAP_H
 
-#include "LString.h"
-#include "FormMathsPanel.h"
+#include "FormDialogView.h"
+#include <vector>
 
-#include <boost/shared_ptr.hpp>
+struct BitmapStore
+{
+       BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in,
+                   unsigned char const * data_in, bool vert_in)
+               : nt(nt_in), nx(nx_in), ny(ny_in), bw(bw_in), bh(bh_in),
+                 data(data_in), vert(vert_in)
+       {}
 
-#include <vector>
+       int nt;
+       int nx;
+       int ny;
+       int bw;
+       int bh;
+       unsigned char const * data;
+       bool vert;
+};
+
+
+struct FD_maths_bitmap
+{
+       ~FD_maths_bitmap();
+       FL_FORM * form;
+       FL_OBJECT * button_close;
+};
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 /**
  * This class provides an XForms implementation of a maths bitmap form.
  */
-class FormMathsBitmap : public FormMathsSub {
-       ///
-       friend class FormMathsPanel;
 
-public:
-       ///
-       typedef boost::shared_ptr<FL_OBJECT> bm_ptr;
-       ///
-       typedef boost::shared_ptr<FL_FORM> fl_ptr;
+class ControlMath;
 
+class FormMathsBitmap
+       : public FormController<ControlMath, FormView<FD_maths_bitmap> > {
+public:
        ///
-       FormMathsBitmap(LyXView &, Dialogs & d, FormMathsPanel const &,
-                       string const &, std::vector<string> const &);
-       ///
-       ~FormMathsBitmap();
+       FormMathsBitmap(Dialog &, std::string const &, std::vector<std::string> const &);
        ///
-       void addBitmap(int, int, int, int, int, unsigned char const *,
-                      bool = true);
+       void addBitmap(BitmapStore const &);
 
 private:
        ///
        int GetIndex(FL_OBJECT *);
 
-       /// Build the dialog
-       virtual void build();
-       /// apply the data
+       ///
        virtual void apply();
-       /// input handler
-       bool input(FL_OBJECT *, long);
+       ///
+       virtual void build();
+       ///
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+       /// Not needed.
+       virtual void update() {}
 
-       /// Pointer to the actual instantiation of the xforms form
-       virtual FL_FORM * form() const;
+       ///
+       FL_OBJECT * buildBitmap(BitmapStore const & bmstore);
 
        /// The latex names associated with each symbol
-       std::vector<string> latex_;
+       std::vector<std::string> latex_;
        /// The latex name chosen
-       string latex_chosen_;
-       /// Real GUI implementation
-       fl_ptr form_;
-       /// The bitmap tables
-       std::vector<bm_ptr> bitmaps_;
+       std::string latex_chosen_;
+
+       /** Temporary store for bitmap data passed to addBitmap()
+        *  but before the FL_OBJECT is created in build().
+        */
+       std::vector<BitmapStore> bitmaps_;
 
        /// Border width
        int ww_;