"Fossies" - the Fresh Open Source Software Archive

Member "yudit-3.0.7/swindow/swin32/SWin32.h" (6 Jun 2020, 5127 Bytes) of package /linux/misc/yudit-3.0.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "SWin32.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.0.5_vs_3.0.7.

    1 /** 
    2  *  Yudit Unicode Editor Source File
    3  *
    4  *  GNU Copyright (C) 1997-2006  Gaspar Sinai <gaspar@yudit.org>  
    5  *
    6  *  This program is free software; you can redistribute it and/or modify
    7  *  it under the terms of the GNU General Public License, version 2,
    8  *  dated June 1991. See file COPYYING for details.
    9  *
   10  *  This program is distributed in the hope that it will be useful,
   11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  *  GNU General Public License for more details.
   14  *
   15  *  You should have received a copy of the GNU General Public License
   16  *  along with this program; if not, write to the Free Software
   17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   18  */
   19  
   20 #ifndef SW32_h
   21 #define SW32_h
   22 
   23 #include "stoolkit/SExcept.h"
   24 #include "swindow/SAwt.h"
   25 #include "swindow/SWindow.h"
   26 #include "stoolkit/SString.h"
   27 #include "stoolkit/SEncoder.h"
   28 #include "stoolkit/SBinHashtable.h"
   29 
   30 /**
   31  * @author: Gaspar Sinai <gaspar@yudit.org>
   32  * @version: 2000-04-23
   33  * This is the abstract widget toolkit
   34  */
   35 
   36 
   37 /**
   38  * This class should be implemented for a window toolkit implementation
   39  */
   40 class SW32Impl : public SAwtImpl
   41 {
   42 public:
   43   SW32Impl();
   44   virtual ~SW32Impl();
   45   virtual SWindow* getWindow (SWindowListener* l, const SString& name);
   46   virtual bool isOK();
   47   virtual void setEncoding(const SString& str);
   48   SEncoder encoder;
   49 };
   50 
   51 class SW32Window : public SWindow
   52 {
   53 public:
   54   SW32Window(const SString& n, SW32Impl* i, long _id);
   55   virtual ~SW32Window();
   56 
   57   /* windowing */
   58   virtual void show ();
   59   virtual void hide ();
   60   virtual void wait ();
   61   virtual void center (SWindow* window);
   62 
   63   virtual void setParent (SWindow* w, int x, int y);
   64   void redraw (bool clear, int x, int y, unsigned int width, unsigned int height);
   65   virtual void resize (unsigned int width, unsigned int height);
   66   virtual void setMinimumSize (unsigned int _width, unsigned int _height);
   67 
   68   virtual void move (int x, int y);
   69   virtual void setTitle (const SString& title);
   70 
   71   virtual void setBackground (const SColor &color);
   72   virtual void clear (int x, int y, unsigned int width, unsigned int height);
   73 
   74   virtual void copy (int x, int y, unsigned int width, unsigned int height, int tox, int toy);
   75 
   76   /* clip */
   77   virtual void setClippingArea (int x, int y, 
   78       unsigned int width, unsigned int height);
   79   virtual void removeClippingArea ();
   80 
   81 
   82   virtual SString  getClipUTF8();
   83   virtual void putClipUTF8(const SString& utf8);
   84 
   85   virtual void getKeyboardFocus();
   86   virtual void addAccelerator (const SAccelerator& a, 
   87       SAcceleratorListener* l);
   88   virtual void removeAccelerator (const SAccelerator& a,
   89       SAcceleratorListener* l);
   90 
   91   virtual bool startInputMethod (const SString& name, const SProperties& prop, SPreEditor* preEditor);
   92   virtual void stopInputMethod ();
   93   virtual void setInputMethodProperties (const SProperties& prop);
   94   virtual SString getInputMethod ();
   95 
   96   /*---------------- from canvas --------------*/
   97   virtual bool beginImage (double x, double y, const SString& id, const SColor& background);
   98   virtual void newpath ();
   99   virtual void endImage ();
  100   virtual void fill (const SPen& pen);
  101   virtual void stroke (const SPen& pen);
  102 
  103   virtual void moveto (double x, double y);
  104   virtual void lineto (double x, double y);
  105   virtual void curveto (double x0, double y0, 
  106       double x1, double y1, double x3, double y3);
  107   virtual void closepath();
  108   virtual void pushmatrix();
  109   virtual void popmatrix();
  110   virtual void scale (double x, double y);
  111   virtual void translate (double x, double y);
  112   virtual void rotate (double angle);
  113   virtual bool isVisible ();
  114 
  115   virtual void putImage (int x, int y, const SImage& image);
  116   virtual void bitfill (const SColor& bg, int x, int y, 
  117         unsigned int width, unsigned int height);
  118   virtual void bitline (const SColor& fg, int x, int y, int tox, int toy);
  119   virtual void bitpoint (const SColor& fg, int x, int y);
  120   virtual void bitpoints (const SColor& fg, const int* x, const int* y, 
  121          unsigned int size);
  122   virtual void setModal (SWindow*w, bool decorated);
  123 
  124   static void setPixmapCacheSize(unsigned int _size);
  125   static void setPixmapCacheOn (bool _on);
  126    /* helper */
  127   void repaintBackground(int left, int top, int right, int bottom);
  128   long getID () { return id; }
  129 
  130   bool clipChained;
  131   long clipChain;
  132 
  133   /* only for top level windows */
  134   long currentFocusWindow;
  135   long modalID;
  136   long parentID;
  137   /* only top level ones will have it. */
  138   SBinHashtable<long>   acceleratorTable;
  139   SBinHashtable <SAcceleratorListener*> accelerators;
  140 
  141   /*--- get an integer id for the underlying window ---*/
  142   virtual unsigned long getWindowID() const;
  143   // default off
  144   virtual void setDoubleBuffer (bool isOn);
  145   virtual bool isDoubleBufferEnabled () const;
  146 
  147   bool dbufferOn; // double buffer
  148   void* dbuffer;
  149   long id;
  150   void* cdc;
  151   SColor background;
  152   int currentScroll;
  153 
  154 private:
  155   bool dcin();
  156   void dcout(bool wasin);
  157 
  158   void*   clipRegion;
  159   SGEngine*     engine;
  160   SPen   pen;
  161   SW32Impl* impl;
  162   SString name;
  163   SString imname;
  164 };
  165 
  166 #endif /* SW32_h */