Back to index

texmacs  1.0.7.15
x_window.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : x_window.hpp
00004 * DESCRIPTION: Windows under X11
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef X_WINDOW_H
00013 #define X_WINDOW_H
00014 #include "window.hpp"
00015 #include "X11/x_drawable.hpp"
00016 #include "rectangles.hpp"
00017 #include "array.hpp"
00018 
00019 /******************************************************************************
00020 * The x_window class
00021 ******************************************************************************/
00022 
00023 class x_window_rep: public window_rep {
00024 public:
00025   widget           w;
00026   x_gui            gui;
00027   char*            name;
00028   string           the_name;
00029   x_drawable_rep*  ren;
00030 
00031   Display*      dpy;
00032   Window        win;
00033   GC            gc;
00034   rectangles    invalid_regions;
00035   SI            Min_w, Min_h;
00036   SI            Def_w, Def_h;
00037   SI            Max_w, Max_h;
00038   int           win_x, win_y;
00039   int           win_w, win_h;
00040 
00041   bool          ic_ok;
00042   XIC           ic;
00043   widget_rep*   kbd_focus;
00044   bool          has_focus;
00045 
00046   bool          full_screen_flag;
00047   Window        save_win;
00048   int           save_x, save_y;
00049   int           save_w, save_h;
00050 
00051 public:
00052 
00053   /********************* specific routines for x_window **********************/
00054 
00055 
00056   x_window_rep (widget w, x_gui gui, char* name,
00057               SI min_w, SI min_h, SI def_w, SI def_h, SI max_w, SI max_h);
00058   ~x_window_rep ();
00059   widget get_widget ();
00060   renderer get_renderer ();
00061   void get_extents (int& w, int& h);
00062 
00063   void set_hints (SI min_w, SI min_h, SI max_w, SI max_h);
00064   void initialize ();
00065 
00066   void move_event (int x, int y);
00067   void resize_event (int w, int h);
00068   void destroy_event ();
00069   void invalidate_event (int x1, int y1, int x2, int y2);
00070   void key_event (string key);
00071   void mouse_event (string ev, int x, int y, time_t t);
00072   void focus_in_event ();
00073   void focus_out_event ();
00074   void repaint_invalid_regions ();
00075 
00076   /********************* routines from window.hpp **************************/
00077 
00078   void   set_name (string name);
00079   string get_name ();
00080   void   set_visibility (bool flag);
00081   void   set_full_screen (bool flag);
00082   void   set_size (SI w, SI h);
00083   void   set_size_limits (SI min_w, SI min_h, SI max_w, SI max_h);
00084   void   get_size (SI& w, SI& h);
00085   void   get_size_limits (SI& min_w, SI& min_h, SI& max_w, SI& max_h);
00086   void   set_position (SI x, SI y);
00087   void   get_position (SI& x, SI& y);
00088   void   set_keyboard_focus (widget wid, bool get_focus);
00089   bool   get_keyboard_focus (widget wid);
00090   void   set_mouse_grab (widget wid, bool get_grab);
00091   bool   get_mouse_grab (widget w);
00092   void   set_mouse_pointer (widget wid, string name, string mask);
00093   void   delayed_message (widget wid, string s, time_t delay);
00094   void   invalidate (SI x1, SI y1, SI x2, SI y2);
00095   bool   repainted ();
00096   void   translate (SI x1, SI y1, SI x2, SI y2, SI dx, SI dy);
00097 
00098   /****************************** friends ************************************/
00099 
00100   friend class x_gui_rep;
00101   friend class x_drawable_rep;
00102   friend Bool my_selnotify_predicate (Display* dpy, XEvent* ev, XPointer arg);
00103   friend int get_identifier (window w);
00104 };
00105 
00106 typedef x_window_rep* x_window;
00107 Window get_Window (widget w);
00108 x_window get_x_window (widget w);
00109 extern int alt_mask;
00110 extern int meta_mask;
00111 
00112 #endif // defined X_WINDOW_H