Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Protected Attributes | Events | Private Attributes | Friends
input_widget_rep Class Reference
Inheritance diagram for input_widget_rep:
Inheritance graph
[legend]
Collaboration diagram for input_widget_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 input_widget_rep (command call_back, int style, string width, bool persist)
 operator tree ()
void update_draw_s ()
void commit ()
void cancel ()
void handle_get_size (get_size_event ev)
void handle_repaint (repaint_event ev)
void handle_keypress (keypress_event ev)
void handle_mouse (mouse_event ev)
void handle_keyboard_focus (keyboard_focus_event ev)
void handle_set_string (set_string_event ev)
void handle_get_string (get_string_event ev)
virtual void handle_get_integer (get_integer_event ev)
virtual void handle_get_double (get_double_event ev)
virtual void handle_get_coord1 (get_coord1_event ev)
virtual void handle_get_coord2 (get_coord2_event ev)
virtual void handle_get_coord3 (get_coord3_event ev)
virtual void handle_get_coord4 (get_coord4_event ev)
virtual void handle_set_integer (set_integer_event ev)
virtual void handle_set_double (set_double_event ev)
virtual void handle_set_coord1 (set_coord1_event ev)
virtual void handle_set_coord2 (set_coord2_event ev)
virtual void handle_set_coord3 (set_coord3_event ev)
virtual void handle_set_coord4 (set_coord4_event ev)
virtual bool handle (event ev)
virtual void handle_get_widget (get_widget_event ev)
virtual void handle_set_widget (set_widget_event ev)
virtual void handle_attach_window (attach_window_event ev)
virtual void handle_position (position_event ev)
virtual void handle_move (move_event ev)
virtual void handle_resize (resize_event ev)
virtual void handle_destroy (destroy_event ev)
virtual void handle_alarm (alarm_event ev)
virtual void handle_clear (clear_event ev)
virtual void handle_update (update_event ev)
virtual void handle_refresh (refresh_event ev)
virtual void handle_invalidate (invalidate_event ev)
virtual void handle_keyboard_grab (keyboard_grab_event ev)
virtual void handle_mouse_grab (mouse_grab_event ev)
virtual void handle_request_alarm (request_alarm_event ev)
virtual void handle_find_child (find_child_event ev)
void send (slot s, blackbox val)
blackbox query (slot s, int type_id)
void notify (slot s, blackbox new_val)
widget read (slot s, blackbox index)
void write (slot s, blackbox index, widget w)
virtual tm_ostreamprint (tm_ostream &out)
virtual bool is_window_widget ()
SI x1 ()
SI y1 ()
SI x2 ()
SI y2 ()
bool attached ()
void wk_error (string message)
virtual void connect (slot s, widget w2, slot s2)
virtual void deconnect (slot s, widget w2, slot s2)

Public Attributes

window win
SI ox
SI oy
SI w
SI h
gravity grav
array< wk_widgeta
array< stringname
int ref_count

Protected Attributes

int ptr_focus
list< widget_connectionin
list< widget_connectionout

Events

emit_position(SI ox, SI oy, SI
w, SI h, gravity grav=north_west)
emit_invalidate(SI x1, SI y1,
SI x2, SI y2) emit_mouse(mouse_event
ev) emit_mouse(mouse_event ev,
string type) emit_mouse(mouse_event
ev, string type, SI x, SI y)
emit_clear(SI x1, SI y1, SI x2,
SI y2) emit_repaint(SI x1, SI
y1, SI x2, SI y2, bool &stop)
emit_find_child(SI x, SI y,
int &which) virtual void 
handle_get_size (get_size_event ev)

Private Attributes

string s
string draw_s
SI text_h
string type
array< stringdef
command call_back
int style
bool greyed
string width
bool persistent
bool ok
bool done
int def_cur
SI dw
SI dh
int pos
SI scroll
bool got_focus
bool hilit
array< stringtabs
int tab_nr
int tab_pos

Friends

class wk_widget
class widget

Detailed Description

Definition at line 30 of file input_widget.cpp.


Constructor & Destructor Documentation

input_widget_rep::input_widget_rep ( command  call_back,
int  style,
string  width,
bool  persist 
)

Definition at line 76 of file input_widget.cpp.

                                                                           :
  attribute_widget_rep (south_west),
  s (""), draw_s (""), type ("default"), def (),
  call_back (cb2), style (st2),
  greyed ((style & WIDGET_STYLE_INERT) != 0),
  width (w2), persistent (p2),
  ok (true), done (false), def_cur (0),
  dw (4*PIXEL), dh (2*PIXEL), pos (N(s)), scroll (0),
  got_focus (false), hilit (false)
{
  if ((style & WIDGET_STYLE_MINI) != 0) dh= 1.5 * PIXEL;
  dw *= SHRINK;
  dh *= SHRINK;
  font fn= get_default_styled_font (style);
  text_h = (fn->y2- fn->y1+ 2*dh+ (SHRINK-1))/SHRINK;
}

Here is the call graph for this function:


Member Function Documentation

bool wk_widget_rep::attached ( ) [inherited]

Definition at line 108 of file wk_widget.cpp.

                         {
  return win != NULL;
}

Here is the caller graph for this function:

Definition at line 115 of file input_widget.cpp.

                          {
  ok= false;
  done= true;
  call_back (list_object (object (false)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 108 of file input_widget.cpp.

                          {
  ok= true;
  done= true;
  call_back (list_object (object (s)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void widget_rep::connect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 150 of file widget.cpp.

                                               {
  widget_connection con (this, s, w2.rep, s2);
  insert (out, con);
  insert (w2->in, con);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void widget_rep::deconnect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 157 of file widget.cpp.

                                                 {
  widget_connection con (this, s, w2.rep, s2);
  remove (out, con);
  remove (w2->in, con);
}
bool attribute_widget_rep::handle ( event  ev) [virtual, inherited]

Reimplemented from basic_widget_rep.

Reimplemented in popup_button_rep, extend_widget_rep, minibar_widget_rep, and scroll_widget_rep.

Definition at line 124 of file attribute_widget.cpp.

                                      {
  if (!is_extra_width_event (ev))
    if (basic_widget_rep::handle (ev))
      return true;
  switch (ev->type) {
  case GET_INTEGER_EVENT:
    handle_get_integer (ev);
    return true;
  case GET_DOUBLE_EVENT:
    handle_get_double (ev);
    return true;
  case GET_STRING_EVENT:
    handle_get_string (ev);
    return true;
  case GET_COORD1_EVENT:
    handle_get_coord1 (ev);
    return true;
  case GET_COORD2_EVENT:
    handle_get_coord2 (ev);
    return true;
  case GET_COORD3_EVENT:
    handle_get_coord3 (ev);
    return true;
  case GET_COORD4_EVENT:
    handle_get_coord4 (ev);
    return true;

  case SET_INTEGER_EVENT:
    handle_set_integer (ev);
    return true;
  case SET_DOUBLE_EVENT:
    handle_set_double (ev);
    return true;
  case SET_STRING_EVENT:
    handle_set_string (ev);
    return true;
  case SET_COORD1_EVENT:
    handle_set_coord1 (ev);
    return true;
  case SET_COORD2_EVENT:
    handle_set_coord2 (ev);
    return true;
  case SET_COORD3_EVENT:
    handle_set_coord3 (ev);
    return true;
  case SET_COORD4_EVENT:
    handle_set_coord4 (ev);
    return true;
  }
  return false;
}

Here is the call graph for this function:

void basic_widget_rep::handle_alarm ( alarm_event  ev) [virtual, inherited]

Reimplemented in ver_scrollbar_widget_rep, and hor_scrollbar_widget_rep.

Definition at line 182 of file basic_widget.cpp.

                                              {
  cout << "Alarm: " << ev->message << "\n";
}

Here is the caller graph for this function:

void basic_widget_rep::handle_attach_window ( attach_window_event  ev) [virtual, inherited]

Reimplemented in popup_button_rep, simple_widget_rep, and switch_widget_rep.

Definition at line 122 of file basic_widget.cpp.

                                                              {
  if ((win!=NULL) && (ev->win!=NULL) && (win!=ev->win))
    WK_FAILED ("widget already attached to another window");
  win= ev->win;
  for (int i=0; i<N(a); i++) a[i] << emit_attach_window (win);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void basic_widget_rep::handle_clear ( clear_event  ev) [virtual, inherited]

Reimplemented in simple_widget_rep.

Definition at line 187 of file basic_widget.cpp.

                                              {
  renderer ren= win->get_renderer ();
  ren->set_background (white);
  ren->clear (ev->x1, ev->y1, ev->x2, ev->y2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void basic_widget_rep::handle_destroy ( destroy_event  ev) [virtual, inherited]

Reimplemented in file_chooser_widget_rep, wrapped_widget_rep, texmacs_widget_rep, and inputs_list_widget_rep.

Definition at line 145 of file basic_widget.cpp.

                                                  { (void) ev;
  int i;
  for (i=0; i<N(a); i++)
    a[i] << emit_destroy ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void basic_widget_rep::handle_find_child ( find_child_event  ev) [virtual, inherited]

Reimplemented in vertical_list_rep, tabs_widget_rep, horizontal_array_rep, horizontal_list_rep, and hsplit_widget_rep.

Definition at line 231 of file basic_widget.cpp.

                                                        {
  int& i= ev->which;
  for (i=0; i<N(a); i++)
    if ((ev->x >= a[i]->x1()-ox) && (ev->x < a[i]->x2()-ox) &&
       (ev->y >= a[i]->y1()-oy) && (ev->y < a[i]->y2()-oy)) return;
  i= -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void attribute_widget_rep::handle_get_coord1 ( get_coord1_event  ev) [virtual, inherited]

Reimplemented in scrollable_widget_rep.

Definition at line 48 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not get coord1 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_get_coord2 ( get_coord2_event  ev) [virtual, inherited]

Reimplemented in scrollable_widget_rep, button_widget_rep, simple_widget_rep, tile_rep, and separator_widget_rep.

Definition at line 53 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not get coord2 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_get_coord3 ( get_coord3_event  ev) [virtual, inherited]

Definition at line 58 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not get coord3 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_get_coord4 ( get_coord4_event  ev) [virtual, inherited]

Reimplemented in scrollable_widget_rep.

Definition at line 63 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not get coord4 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_get_double ( get_double_event  ev) [virtual, inherited]

Definition at line 38 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not get double attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_get_integer ( get_integer_event  ev) [virtual, inherited]

Definition at line 33 of file attribute_widget.cpp.

                                                              {
  WK_FAILED ("could not get integer attribute " * ev->which);
}

Here is the caller graph for this function:

void input_widget_rep::handle_get_size ( get_size_event  ev)

Definition at line 122 of file input_widget.cpp.

                                                    {
  SI ww = decode_length (width, this, style);
  SI dww= (SI) ((2*dw) / SHRINK);
  if (ends (width, "w") && is_double (width (0, N(width) - 1))) {
    font fn= get_default_styled_font (style);
    if (ev->mode == -1) ev->w= 0;
    else if (ev->mode == 0);
    else if (ev->mode == 1) ev->w= ww;
    ev->w= max (ev->w, (4*fn->wquad) / SHRINK + dww);
  }
  else if (ends (width, "em") && is_double (width (0, N(width) - 2)))
    ev->w= ww + dww;
  else if (ends (width, "px") && is_double (width (0, N(width) - 2)))
    ev->w= ww + dww;
  else if (ev->mode == 1)
    ev->w= ww;
  ev->h= text_h;
  abs_round (ev->w, ev->h);
}

Here is the call graph for this function:

void input_widget_rep::handle_get_string ( get_string_event  ev) [virtual]

Reimplemented from attribute_widget_rep.

Definition at line 374 of file input_widget.cpp.

                                                        {
  if (ev->which == "input") {
    if (ok) ev->s= scm_quote (s);
    else ev->s= "#f";
  }
  else attribute_widget_rep::handle_get_string (ev);
}

Here is the call graph for this function:

void basic_widget_rep::handle_get_widget ( get_widget_event  ev) [virtual, inherited]

Reimplemented in texmacs_widget_rep, canvas_widget_rep, and switch_widget_rep.

Definition at line 99 of file basic_widget.cpp.

                                                        {
  int i;
  for (i=0; i<N(a); i++)
    if (name[i] == ev->which) {
      ev->w= a[i];
      return;
    }
  WK_FAILED ("could not get widget attribute " * ev->which);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void basic_widget_rep::handle_invalidate ( invalidate_event  ev) [virtual, inherited]

Definition at line 216 of file basic_widget.cpp.

                                                        {
  if (ev->all_flag) win->invalidate (x1()-ox, y1()-oy, x2()-ox, y2()-oy);
  else win->invalidate (ev->x1, ev->y1, ev->x2, ev->y2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void input_widget_rep::handle_keyboard_focus ( keyboard_focus_event  ev) [virtual]

Reimplemented from basic_widget_rep.

Definition at line 352 of file input_widget.cpp.

                                                                {
  if (got_focus && !ev->flag && !done && !persistent)
    cancel ();
  got_focus= ev->flag;
  if (attached ())
    this << emit_invalidate_all ();
}

Here is the call graph for this function:

void basic_widget_rep::handle_keyboard_grab ( keyboard_grab_event  ev) [virtual, inherited]

Definition at line 222 of file basic_widget.cpp.

{ (void) ev; }

Here is the caller graph for this function:

void input_widget_rep::handle_keypress ( keypress_event  ev) [virtual]

Reimplemented from basic_widget_rep.

Definition at line 199 of file input_widget.cpp.

                                                    {
  if (greyed) return;
  string key= ev->key;
  while ((N(key) >= 5) && (key(0,3) == "Mod") && (key[4] == '-') &&
        (key[3] >= '1') && (key[3] <= '5')) key= key (5, N(key));
  if (key == "space") key= " ";
  if (key == "<") key= "<less>";
  if (key == ">") key= "<gtr>";

  /* tab-completion */
  if ((key == "tab" || key == "S-tab") && N(tabs) != 0) {
    int d = (key == "tab"? 1: N(tabs)-1);
    tab_nr= (tab_nr + d) % N(tabs);
    s     = s (0, tab_pos) * tabs[tab_nr];
    pos   = N(s);
    this << emit_invalidate_all ();
    return;
  }
  else if (key == "tab" || key == "S-tab") {
    if (pos != N(s)) return;
    tabs= copy (def);
    if (ends (type, "file") || type == "directory") {
      url search= url_here ();
      url dir= (ends (s, string (URL_CONCATER))? url (s): head (url (s)));
      if (type == "smart-file") search= url ("$TEXMACS_FILE_PATH");
      if (is_rooted (dir)) search= url_here ();
      if (is_none (dir)) dir= url_here ();
      tabs= file_completions (search, dir);
    }
    tabs= strip_completions (tabs, s);
    tabs= close_completions (tabs);
    if (N (tabs) == 0);
    else if (N (tabs) == 1) {
      s   = s * tabs[0];
      pos = N(s);
      tabs= array<string> (0);
    }
    else {
      tab_nr = 0;
      tab_pos= N(s);
      s      = s * tabs[0];
      pos    = N(s);
      beep ();
    }
    this << emit_invalidate_all ();
    return;
  }
  else {
    tabs   = array<string> (0);
    tab_nr = 0;
    tab_pos= 0;
  }

  /* other actions */
  if (key == "return") commit ();
  else if ((key == "escape") || (key == "C-c") ||
          (key == "C-g")) cancel ();
  else if ((key == "left") || (key == "C-b")) {
    if (pos>0) tm_char_backwards (s, pos); }
  else if ((key == "right") || (key == "C-f")) {
    if (pos<N(s)) tm_char_forwards (s, pos); }
  else if ((key == "home") || (key == "C-a")) pos=0;
  else if ((key == "end") || (key == "C-e")) pos=N(s);
  else if ((key == "up") || (key == "C-p")) {
    if (N(def) > 0) {
      def_cur= (def_cur+1) % N(def);
      s      = copy (def[def_cur]);
      pos    = N(s);
    }
  }
  else if ((key == "down") || (key == "C-n")) {
    if (N(def) > 0) {
      def_cur= (def_cur+N(def)-1) % N(def);
      s      = copy (def[def_cur]);
      pos    = N(s);
    }
  }
  else if (key == "C-k") s= s (0, pos);
  else if ((key == "C-d") || (key == "delete")) {
    if ((pos<N(s)) && (N(s)>0)) {
      int end= pos;
      tm_char_forwards (s, end);
      s= s (0, pos) * s (end, N(s));
    }
  }
  else if (key == "backspace" || key == "S-backspace") {
    if (pos>0) {
      int end= pos;
      tm_char_backwards (s, pos);
      s= s (0, pos) * s (end, N(s));
    }
  }
  else if (key == "C-backspace") {
    s= "";
    pos= 0;
  }
  else {
    if (starts (key, "<#"));
    else if (key == "<less>" || key == "<gtr>");
    else {
      if (N(key)!=1) return;
      int i (key[0]);
      if ((i>=0) && (i<32)) return;
    }
    s= s (0, pos) * key * s(pos, N(s));
    pos += N(key);
  }
  this << emit_invalidate_all ();
}

Here is the call graph for this function:

void input_widget_rep::handle_mouse ( mouse_event  ev) [virtual]

Reimplemented from basic_widget_rep.

Definition at line 310 of file input_widget.cpp.

                                              {
  if (greyed) return;
  update_draw_s ();

  string type= ev->type;
  SI     x   = ev->x;
  font   fn  = get_default_styled_font (style);

  if (type == "press-left") {
    if (N(s)>0) {
      metric ex;
      SI old= 0;
      pos=0; tm_char_forwards (s, pos);
      for (; pos<=N(s); tm_char_forwards (s, pos)) {
       fn->var_get_extents (draw_s (0, pos), ex);
       if (((old+ ex->x2+ dw- ex->x1) >> 1) > (x*SHRINK+ scroll)) {
         tm_char_backwards (s, pos);
         break;
       }
       old= ex->x2+ dw- ex->x1;
       if (pos >= N(s)) break;
      }
    }
    win->set_keyboard_focus (this);
    this << emit_invalidate_all ();
  }

  if (type == "press-middle") {
    tree t; string sel;
    (void) get_selection ("primary", t, sel, "verbatim");
    if (is_tuple (t, "extern", 1)) {
      string ins= as_string (t[1]);
      ins= tm_encode (ins);
      s= s (0, pos) * ins * s(pos, N(s));
      pos += N(ins);
      this << emit_invalidate_all ();
    }
    else if (is_tuple (t, "texmacs", 3));
  }
}

Here is the call graph for this function:

void basic_widget_rep::handle_mouse_grab ( mouse_grab_event  ev) [virtual, inherited]

Reimplemented in popup_widget_rep.

Definition at line 225 of file basic_widget.cpp.

{ (void) ev; }

Here is the caller graph for this function:

void basic_widget_rep::handle_move ( move_event  ev) [virtual, inherited]

Definition at line 137 of file basic_widget.cpp.

                                            { (void) ev;
}

Here is the caller graph for this function:

void basic_widget_rep::handle_position ( position_event  ev) [virtual, inherited]

Reimplemented in vertical_list_rep, balloon_decoration_widget_rep, scrollable_widget_rep, canvas_widget_rep, button_widget_rep, popup_widget_rep, horizontal_array_rep, tabs_widget_rep, horizontal_list_rep, hsplit_widget_rep, tile_rep, extend_widget_rep, and minibar_widget_rep.

Definition at line 130 of file basic_widget.cpp.

                                                    { (void) ev;
  int i;
  for (i=0; i<N(a); i++)
    a[i] << emit_position (0, 0, w, h, grav);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void basic_widget_rep::handle_refresh ( refresh_event  ev) [virtual, inherited]

Reimplemented in refresh_widget_rep.

Definition at line 210 of file basic_widget.cpp.

                                                  { (void) ev;
  for (int i=0; i<N(a); i++)
    a[i] << emit_refresh ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void input_widget_rep::handle_repaint ( repaint_event  ev) [virtual]

Reimplemented from basic_widget_rep.

Definition at line 143 of file input_widget.cpp.

                                                  { (void) ev;
  renderer ren= win->get_renderer ();
  update_draw_s (); 
  SI ecart= max (0, (h - (2*dh / SHRINK) - text_h) >> 1);

  metric ex;
  font fn= get_default_styled_font (style);
  fn->var_get_extents (draw_s, ex);
  SI left= ex->x1, bottom= fn->y1, right= ex->x2;
  fn->var_get_extents (draw_s (0, pos), ex);
  SI current= ex->x2- ex->x1;

  SI text_width= right-left;
  SI width= w*SHRINK- 2*dw, height= h*SHRINK;
  SI marge= width>>2;
  if ((current-scroll) > (width-marge)) scroll= current+ marge- width;
  if ((current-scroll) < marge) scroll= current- marge;
  if (scroll > (text_width- width)) scroll= text_width- width;
  if (scroll < 0) scroll= 0;
  left    += scroll;
  current -= scroll;

  layout_default (ren, 0, 0, w, h);
  if (true) {
    SI yy= ((ecart + PIXEL/2) / PIXEL) * PIXEL;
    SI hh= ((h - 2*ecart + PIXEL/2) / PIXEL) * PIXEL;
    if (yy + hh + 2*PIXEL <= h) hh += 2 * PIXEL;
    else if (yy + hh + PIXEL <= h) hh += PIXEL;
    if (greyed) layout_default (ren, 0, yy, w, hh);
    else layout_pastel (ren, 0, yy, w, hh);
    layout_lower (ren, 0, yy, w, hh);
  }
  else if (got_focus && hilit) {
    layout_dark (ren, 0, 0, w, h);
    layout_lower (ren, 0, 0, w, h);
  }

  ren->set_color (black);
  if (greyed) ren->set_color (dark_grey);
  ren->set_shrinking_factor (SHRINK);
  ecart *= SHRINK;
  fn->var_draw (ren, draw_s, dw - left, dh - bottom + ecart);
  if (got_focus) {
    SI pixel= SHRINK*PIXEL;
    ren->set_color (red);
    ren->line (current + dw, dh + ecart,
              current + dw, height - pixel - dh - ecart);
    ren->line (current + dw - pixel, dh + ecart,
              current + dw + pixel, dh + ecart);
    ren->line (current + dw - pixel, height - pixel - dh - ecart,
              current + dw + pixel, height - pixel - dh - ecart);
  }
  ren->set_shrinking_factor (1);
}

Here is the call graph for this function:

void basic_widget_rep::handle_request_alarm ( request_alarm_event  ev) [virtual, inherited]

Definition at line 228 of file basic_widget.cpp.

{ (void) ev; }

Here is the caller graph for this function:

void basic_widget_rep::handle_resize ( resize_event  ev) [virtual, inherited]

Reimplemented in texmacs_widget_rep, and simple_widget_rep.

Definition at line 141 of file basic_widget.cpp.

                                                { (void) ev;
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_set_coord1 ( set_coord1_event  ev) [virtual, inherited]

Reimplemented in scrollbar_rep.

Definition at line 87 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not set coord1 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_set_coord2 ( set_coord2_event  ev) [virtual, inherited]

Reimplemented in scrollbar_rep, scrollable_widget_rep, button_widget_rep, simple_widget_rep, tile_rep, and separator_widget_rep.

Definition at line 92 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not set coord2 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_set_coord3 ( set_coord3_event  ev) [virtual, inherited]

Definition at line 97 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not set coord3 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_set_coord4 ( set_coord4_event  ev) [virtual, inherited]

Reimplemented in scrollable_widget_rep.

Definition at line 102 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not set coord4 attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_set_double ( set_double_event  ev) [virtual, inherited]

Definition at line 77 of file attribute_widget.cpp.

                                                            {
  WK_FAILED ("could not set double attribute " * ev->which);
}

Here is the caller graph for this function:

void attribute_widget_rep::handle_set_integer ( set_integer_event  ev) [virtual, inherited]

Reimplemented in simple_widget_rep.

Definition at line 72 of file attribute_widget.cpp.

                                                              {
  WK_FAILED ("could not set integer attribute " * ev->which);
}

Here is the caller graph for this function:

void input_widget_rep::handle_set_string ( set_string_event  ev) [virtual]

Reimplemented from attribute_widget_rep.

Definition at line 361 of file input_widget.cpp.

                                                        {
  if (ev->which == "input") {
    s= copy (ev->s);
    pos= N(s);
    ok= (ev->s != "#f");
    if (attached ()) this << emit_invalidate_all ();
  }
  else if (ev->which == "type") type= copy (ev->s);
  else if (ev->which == "default") def << copy (ev->s);
  else attribute_widget_rep::handle_set_string (ev);
}

Here is the call graph for this function:

void basic_widget_rep::handle_set_widget ( set_widget_event  ev) [virtual, inherited]

Reimplemented in scrollable_widget_rep, texmacs_widget_rep, canvas_widget_rep, and switch_widget_rep.

Definition at line 110 of file basic_widget.cpp.

                                                        {
  int i;
  for (i=0; i<N(a); i++)
    if (name[i] == ev->which) { a[i]= ev->w; return; }
  WK_FAILED ("could not set widget attribute " * ev->which);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void basic_widget_rep::handle_update ( update_event  ev) [virtual, inherited]

Definition at line 201 of file basic_widget.cpp.

                                                { (void) ev;
  if (attached ()) {
    this << emit_attach_window (win);
    this << emit_reposition ();
    this << emit_invalidate_all ();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool wk_widget_rep::is_window_widget ( ) [virtual, inherited]

Reimplemented in window_widget_rep.

Definition at line 113 of file wk_widget.cpp.

                                 {
  return false;
}

Here is the caller graph for this function:

void wk_widget_rep::notify ( slot  s,
blackbox  new_val 
) [virtual, inherited]

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 864 of file widkit_wrapper.cpp.

                                               {
  switch (s) {
  case SLOT_SIZE:
    check_type<SI,SI> (new_val, "SLOT_SIZE");
    THIS << emit_resize ();
    if (is_window_widget ())
      send_size (THIS [0], new_val);
    break;
  case SLOT_POSITION:
    check_type<SI,SI> (new_val, "SLOT_POSITION");
    THIS << emit_move ();
    break;
  case SLOT_KEYBOARD_FOCUS:
    notify_keyboard_focus (THIS, new_val);
    break;
  case SLOT_MOUSE_GRAB:
    notify_mouse_grab (THIS, new_val);
    break;
  default:
    break;
  }
  widget_rep::notify (s, new_val);
}

Here is the call graph for this function:

input_widget_rep::operator tree ( ) [virtual]

Implements wk_widget_rep.

Definition at line 93 of file input_widget.cpp.

                                 {
  return tree (TUPLE, "input", s);
}
tm_ostream & wk_widget_rep::print ( tm_ostream out) [virtual, inherited]

Reimplemented from widget_rep.

Definition at line 145 of file wk_widget.cpp.

                                     {
  print_tree (out, operator tree (), 0);
  return out;  
}

Here is the call graph for this function:

blackbox wk_widget_rep::query ( slot  s,
int  type_id 
) [virtual, inherited]

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 792 of file widkit_wrapper.cpp.

                                         {
  switch (s) {
  case SLOT_IDENTIFIER:
    ASSERT (type_id == type_helper<int>::id,
           "int expected (SLOT_IDENTIFIER)");
    return close_box<int> (get_identifier (win));
  case SLOT_RENDERER:
    ASSERT (type_id == type_helper<renderer>::id,
           "renderer expected (SLOT_RENDERER)");
    return close_box<renderer> (win->get_renderer ());
  case SLOT_SIZE:
    return query_size (THIS, type_id);
  case SLOT_POSITION:
    return query_position (THIS, type_id);
  case SLOT_KEYBOARD_FOCUS:
    return query_keyboard_focus (THIS, type_id);
  case SLOT_MOUSE_GRAB:
    return query_mouse_grab (THIS, type_id);

  case SLOT_EXTENTS:
    return query_coord4 (THIS, "extents", type_id);
  case SLOT_VISIBLE_PART:
    return query_coord4 (THIS, "visible", type_id);
  case SLOT_SCROLLBARS_VISIBILITY:
    return query_int (THIS, "scrollbars", type_id);
  case SLOT_SCROLL_POSITION:
    return query_coord2 (THIS, "scroll position", type_id);

  case SLOT_HEADER_VISIBILITY:
    return query_bool (THIS, "header", type_id);
  case SLOT_MAIN_ICONS_VISIBILITY:
    return query_bool (THIS, "main icons", type_id);
  case SLOT_MODE_ICONS_VISIBILITY:
    return query_bool (THIS, "mode icons", type_id);
  case SLOT_FOCUS_ICONS_VISIBILITY:
    return query_bool (THIS, "focus icons", type_id);
  case SLOT_USER_ICONS_VISIBILITY:
    return query_bool (THIS, "user icons", type_id);
  case SLOT_SIDE_TOOLS_VISIBILITY:
    return query_bool (THIS, "side tools", type_id);
  case SLOT_FOOTER_VISIBILITY:
    return query_bool (THIS, "footer flag", type_id);
  case SLOT_INTERACTIVE_MODE:
    return query_bool (THIS, "interactive mode", type_id);
  case SLOT_INTERACTIVE_INPUT:
    return query_string (THIS, "interactive input", type_id);

  case SLOT_STRING_INPUT:
    return query_string (THIS, "input", type_id);
  default:
    FAILED ("cannot handle slot type");
    return blackbox ();
  }
}

Here is the call graph for this function:

widget wk_widget_rep::read ( slot  s,
blackbox  index 
) [virtual, inherited]

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 893 of file widkit_wrapper.cpp.

                                           {
  switch (s) {
  case SLOT_WINDOW:
    check_type_void (index, "SLOT_WINDOW");
    return win -> get_widget ();
  case SLOT_CANVAS:
    check_type_void (index, "SLOT_CANVAS");
    return abstract (THIS ["canvas"]);
  case SLOT_FORM_FIELD:
    check_type<int> (index, "SLOT_FORM_FIELD");
    return abstract (THIS [0] ["inputs"] [2*open_box<int> (index)] ["input"]);
  case SLOT_FILE:
    check_type_void (index, "SLOT_FILE");
    return abstract (THIS [0] ["file"] ["input"]);
  case SLOT_DIRECTORY:
    check_type_void (index, "SLOT_DIRECTORY");
    return abstract (THIS [0] ["directory"] ["input"]);
  default:
    FAILED ("cannot handle slot type");
    return widget ();
  }
}

Here is the call graph for this function:

void wk_widget_rep::send ( slot  s,
blackbox  val 
) [virtual, inherited]

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 585 of file widkit_wrapper.cpp.

                                         {
  switch (s) {
  case SLOT_IDENTIFIER:
    check_type<int> (val, "SLOT_IDENTIFIER");
    THIS << emit_attach_window (get_window (open_box<int> (val)));
    break;
  case SLOT_VISIBILITY:
    check_type<bool> (val, "SLOT_VISIBILITY");
    win->set_visibility (open_box<bool> (val));
    break;
  case SLOT_FULL_SCREEN:
    check_type<bool> (val, "SLOT_FULL_SCREEN");
    win->set_full_screen (open_box<bool> (val));
    break;
  case SLOT_NAME:
    send_string (THIS, "window name", val);
    break;
  case SLOT_SIZE:
    send_size (THIS, val);
    break;
  case SLOT_POSITION:
    send_position (THIS, val);
    break;
  case SLOT_UPDATE:
    send_update (THIS, val);
    break;
  case SLOT_REFRESH:
    send_refresh (THIS, val);
    break;
  case SLOT_KEYBOARD:
    send_keyboard (THIS, val);
    break;
  case SLOT_KEYBOARD_FOCUS:
    send_keyboard_focus (THIS, val);
    break;
  case SLOT_MOUSE:
    send_mouse (THIS, val);
    break;
  case SLOT_MOUSE_GRAB:
    send_mouse_grab (THIS, val);
    break;
  case SLOT_MOUSE_POINTER:
    send_mouse_pointer (THIS, val);
    break;
  case SLOT_INVALIDATE:
    send_invalidate (THIS, val);
    break;
  case SLOT_INVALIDATE_ALL:
    send_invalidate_all (THIS, val);
    break;
  case SLOT_REPAINT:
    send_repaint (THIS, val);
    break;
  case SLOT_DELAYED_MESSAGE:
    send_delayed_message (THIS, val);
    break;
  case SLOT_DESTROY:
    send_destroy (THIS, val);
    break;
  case SLOT_CURSOR:
   // send_coord2 (THIS, "cursor", val); 
    // this message is currently ignored. Used only in TeXmacs/Qt
    break;
      
  case SLOT_SHRINKING_FACTOR:
    send_int (THIS, "shrinking factor", val);
    break;
  case SLOT_EXTENTS:
    send_coord4 (THIS, "extents", val);
    break;
  case SLOT_SCROLLBARS_VISIBILITY:
    send_int (THIS, "scrollbars", val);
    break;
  case SLOT_SCROLL_POSITION:
    send_coord2 (THIS, "scroll position", val);
    break;

  case SLOT_HEADER_VISIBILITY:
    send_bool (THIS, "header", val);
    break;
  case SLOT_MAIN_ICONS_VISIBILITY:
    send_bool (THIS, "main icons", val);
    break;
  case SLOT_MODE_ICONS_VISIBILITY:
    send_bool (THIS, "mode icons", val);
    break;
  case SLOT_FOCUS_ICONS_VISIBILITY:
    send_bool (THIS, "focus icons", val);
    break;
  case SLOT_USER_ICONS_VISIBILITY:
    send_bool (THIS, "user icons", val);
    break;
  case SLOT_SIDE_TOOLS_VISIBILITY:
    send_bool (THIS, "side tools", val);
    break;
  case SLOT_FOOTER_VISIBILITY:
    send_bool (THIS, "footer flag", val);
    break;
  case SLOT_LEFT_FOOTER:
    send_string (THIS, "left footer", val);
    break;
  case SLOT_RIGHT_FOOTER:
    send_string (THIS, "right footer", val);
    break;
  case SLOT_INTERACTIVE_MODE:
    send_bool (THIS, "interactive mode", val);
    break;

  case SLOT_STRING_INPUT:
    send_string (THIS, "input", val);
    break;
  case SLOT_INPUT_TYPE:
    send_string (THIS, "type", val);
    break;
  case SLOT_INPUT_PROPOSAL:
    send_string (THIS, "default", val);
    break;
  case SLOT_FILE:
    send_string (THIS, "file", val);
    break;
  case SLOT_DIRECTORY:
    send_string (THIS, "directory", val);
    break;
  default:
    FAILED ("cannot handle slot type");
  }
}

Here is the call graph for this function:

Definition at line 98 of file input_widget.cpp.

                                 {
  draw_s= s;
  if (type == "password") {
    draw_s= copy (s);
    for (int i=0; i<N(s); i++)
      draw_s[i]= '*';
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wk_widget_rep::wk_error ( string  message) [inherited]

Definition at line 118 of file wk_widget.cpp.

                                       {
  cerr << "\n------------------------------------------------------------------------------\n";
  cerr << wk_widget (this);
  cerr << "------------------------------------------------------------------------------\n";
  cerr << "Error: " << message << "\n";
}
void wk_widget_rep::write ( slot  s,
blackbox  index,
widget  w 
) [virtual, inherited]

Reimplemented from widget_rep.

Reimplemented in simple_widget_rep, and simple_widget_rep.

Definition at line 917 of file widkit_wrapper.cpp.

                                                      {
  switch (s) {
  case SLOT_MAIN_MENU:
    check_type_void (index, "SLOT_MAIN_MENU");
    THIS << set_widget ("menu bar", concrete (w));
    break;
  case SLOT_MAIN_ICONS:
    check_type_void (index, "SLOT_MAIN_ICONS");
    THIS << set_widget ("main icons bar", concrete (w));
    break;
  case SLOT_MODE_ICONS:
    check_type_void (index, "SLOT_MODE_ICONS");
    THIS << set_widget ("mode icons bar", concrete (w));
    break;
  case SLOT_FOCUS_ICONS:
    check_type_void (index, "SLOT_FOCUS_ICONS");
    THIS << set_widget ("focus icons bar", concrete (w));
    break;
  case SLOT_USER_ICONS:
    check_type_void (index, "SLOT_USER_ICONS");
    THIS << set_widget ("user icons bar", concrete (w));
    break;
  case SLOT_SIDE_TOOLS:
    check_type_void (index, "SLOT_SIDE_TOOLS");
    THIS << set_widget ("side tools", concrete (w));
    break;
  case SLOT_SCROLLABLE:
    check_type_void (index, "SLOT_SCROLLABLE");
    THIS << set_widget ("scrollable", concrete (w));
    break;
  case SLOT_INTERACTIVE_PROMPT:
    check_type_void (index, "SLOT_INTERACTIVE_PROMPT");
    THIS << set_widget ("interactive prompt", concrete (w));
    break;
  case SLOT_INTERACTIVE_INPUT:
    check_type_void (index, "SLOT_INTERACTIVE_INPUT");
    THIS << set_widget ("interactive input", concrete (w));
    break;
  default:
    FAILED ("cannot handle slot type");
  }
}

Here is the call graph for this function:

SI wk_widget_rep::x1 ( ) [inherited]

Definition at line 63 of file wk_widget.cpp.

                   {
  return ox- get_dx (grav, w);
}

Here is the call graph for this function:

Here is the caller graph for this function:

SI wk_widget_rep::x2 ( ) [inherited]

Definition at line 73 of file wk_widget.cpp.

                   {
  return ox- get_dx (grav, w)+ w;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SI wk_widget_rep::y1 ( ) [inherited]

Definition at line 68 of file wk_widget.cpp.

                   {
  return oy- get_dy (grav, h)- h;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SI wk_widget_rep::y2 ( ) [inherited]

Definition at line 78 of file wk_widget.cpp.

                   {
  return oy- get_dy (grav, h);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class widget [friend, inherited]

Definition at line 59 of file widget.hpp.

friend class wk_widget [friend, inherited]

Definition at line 50 of file wk_widget.hpp.


Member Data Documentation

Definition at line 28 of file wk_widget.hpp.

Definition at line 36 of file input_widget.cpp.

Definition at line 35 of file input_widget.cpp.

Definition at line 43 of file input_widget.cpp.

Definition at line 44 of file input_widget.cpp.

bool input_widget_rep::done [private]

Definition at line 42 of file input_widget.cpp.

Definition at line 32 of file input_widget.cpp.

Definition at line 44 of file input_widget.cpp.

Definition at line 47 of file input_widget.cpp.

Definition at line 27 of file wk_widget.hpp.

bool input_widget_rep::greyed [private]

Definition at line 38 of file input_widget.cpp.

SI wk_widget_rep::h [inherited]

Definition at line 26 of file wk_widget.hpp.

bool input_widget_rep::hilit [private]

Definition at line 48 of file input_widget.cpp.

list<widget_connection> widget_rep::in [protected, inherited]

Definition at line 36 of file widget.hpp.

Reimplemented in xpm_widget_rep.

Definition at line 29 of file wk_widget.hpp.

bool input_widget_rep::ok [private]

Definition at line 41 of file input_widget.cpp.

list<widget_connection> widget_rep::out [protected, inherited]

Definition at line 37 of file widget.hpp.

SI wk_widget_rep::ox [inherited]

Definition at line 25 of file wk_widget.hpp.

SI wk_widget_rep::oy [inherited]

Definition at line 25 of file wk_widget.hpp.

Definition at line 40 of file input_widget.cpp.

int input_widget_rep::pos [private]

Definition at line 45 of file input_widget.cpp.

int basic_widget_rep::ptr_focus [protected, inherited]

Definition at line 19 of file basic_widget.hpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

Definition at line 31 of file input_widget.cpp.

Definition at line 46 of file input_widget.cpp.

int input_widget_rep::style [private]

Definition at line 37 of file input_widget.cpp.

int input_widget_rep::tab_nr [private]

Definition at line 50 of file input_widget.cpp.

Definition at line 51 of file input_widget.cpp.

Definition at line 49 of file input_widget.cpp.

Definition at line 33 of file input_widget.cpp.

Definition at line 34 of file input_widget.cpp.

SI wk_widget_rep::w [inherited]

Definition at line 26 of file wk_widget.hpp.

Definition at line 39 of file input_widget.cpp.

Definition at line 24 of file wk_widget.hpp.


Event Documentation

emit_position( SI ox, SI oy, SI w, SI h, gravity grav= north_west) emit_invalidate( SI x1, SI y1, SI x2, SI y2) emit_mouse( mouse_event ev) emit_mouse( mouse_event ev, string type) emit_mouse( mouse_event ev, string type, SI x, SI y) emit_clear( SI x1, SI y1, SI x2, SI y2) emit_repaint( SI x1, SI y1, SI x2, SI y2, bool& stop) emit_find_child( SI x, SI y, int& which) virtual void basic_widget_rep::handle_get_size(get_size_event ev) [inherited]

Definition at line 36 of file basic_widget.hpp.


The documentation for this class was generated from the following file: