Back to index

texmacs  1.0.7.15
simple_wk_widget.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : simple_wk_widget.cpp
00004 * DESCRIPTION: Simple wk_widgets for customization later on
00005 * COPYRIGHT  : (C) 2007  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 #include "Widkit/simple_wk_widget.hpp"
00013 #include "gui.hpp"
00014 
00015 /******************************************************************************
00016 * Constructor
00017 ******************************************************************************/
00018 
00019 simple_widget_rep::simple_widget_rep ():
00020   attribute_widget_rep () {}
00021 
00022 /******************************************************************************
00023 * Empty handlers for redefinition later on
00024 ******************************************************************************/
00025 
00026 void
00027 simple_widget_rep::handle_get_size_hint (SI& w, SI& h) {
00028   gui_root_extents (w, h);  
00029 }
00030 
00031 void
00032 simple_widget_rep::handle_notify_resize (SI w, SI h) {
00033   (void) w; (void) h;
00034 }
00035 
00036 void
00037 simple_widget_rep::handle_keypress (string key, time_t t) {
00038   (void) key; (void) t;
00039 }
00040 
00041 void
00042 simple_widget_rep::handle_keyboard_focus (bool has_focus, time_t t) {
00043   (void) has_focus; (void) t;
00044 }
00045 
00046 void
00047 simple_widget_rep::handle_mouse (string kind, SI x, SI y, int mods, time_t t) {
00048   (void) kind; (void) x; (void) y; (void) mods; (void) t;
00049 }
00050 
00051 void
00052 simple_widget_rep::handle_set_shrinking_factor (int sf) {
00053   (void) sf;
00054 }
00055 
00056 void
00057 simple_widget_rep::handle_clear (SI x1, SI y1, SI x2, SI y2) {
00058   (void) x1; (void) y1; (void) x2; (void) y2;
00059 }
00060 
00061 void
00062 simple_widget_rep::handle_repaint (SI x1, SI y1, SI x2, SI y2) {
00063   (void) x1; (void) y1; (void) x2; (void) y2;
00064 }
00065 
00066 /******************************************************************************
00067 * Calling the handlers from the usual widkit handlers
00068 ******************************************************************************/
00069 
00070 void
00071 simple_widget_rep::handle_get_size (get_size_event ev) {
00072   handle_get_size_hint (ev->w, ev->h);
00073 }
00074 
00075 void
00076 simple_widget_rep::handle_attach_window (attach_window_event ev) {
00077   basic_widget_rep::handle_attach_window (ev);
00078 }
00079 
00080 void
00081 simple_widget_rep::handle_resize (resize_event ev) { (void) ev;
00082   handle_notify_resize (0, 0); // FIXME
00083 }
00084 
00085 void
00086 simple_widget_rep::handle_keypress (keypress_event ev) {
00087   handle_keypress (ev->key, ev->t);
00088 }
00089 
00090 void
00091 simple_widget_rep::handle_keyboard_focus (keyboard_focus_event ev) {
00092   handle_keyboard_focus (ev->flag, ev->t);
00093 }
00094 
00095 void
00096 simple_widget_rep::handle_mouse (mouse_event ev) {
00097   handle_mouse (ev->type, ev->x, ev->y, ev->mods, ev->t);
00098 }
00099 
00100 void
00101 simple_widget_rep::handle_set_integer (set_integer_event ev) {
00102   if (ev->which == "shrinking factor")
00103     handle_set_shrinking_factor (ev->i);
00104 }
00105 
00106 void
00107 simple_widget_rep::handle_clear (clear_event ev) {
00108   handle_clear (ev->x1, ev->y1, ev->x2, ev->y2);
00109 }
00110 
00111 void
00112 simple_widget_rep::handle_repaint (repaint_event ev) {
00113   handle_repaint (ev->x1, ev->y1, ev->x2, ev->y2);
00114 }
00115 
00116 void
00117 simple_widget_rep::handle_set_coord2 (set_coord2_event ev) {
00118   if (ev->which == "extra width" && ev->c1 == 0 && ev->c2 == 0) return;
00119   else WK_FAILED ("could not set coord2 attribute " * ev->which);
00120 }
00121 
00122 void
00123 simple_widget_rep::handle_get_coord2 (get_coord2_event ev) {
00124   if (ev->which == "extra width") { ev->c1= ev->c2= 0; return; }
00125   else WK_FAILED ("could not get coord2 attribute " * ev->which);
00126 }