Back to index

texmacs  1.0.7.15
Classes | Functions
tm_dialogue.cpp File Reference
#include "tm_frame.hpp"
#include "tm_window.hpp"
#include "convert.hpp"
#include "file.hpp"
#include "analyze.hpp"
#include "message.hpp"
#include "dictionary.hpp"

Go to the source code of this file.

Classes

class  dialogue_command_rep
class  interactive_command_rep

Functions

command dialogue_command (server_rep *sv, object fun, int nr_args)
static int gcd (int i, int j)
static string get_prompt (scheme_tree p, int i)
static string get_type (scheme_tree p, int i)
static array< stringget_proposals (scheme_tree p, int i)

Function Documentation

command dialogue_command ( server_rep sv,
object  fun,
int  nr_args 
)

Definition at line 61 of file tm_dialogue.cpp.

                                                           {
  return tm_new<dialogue_command_rep> (sv, fun, nr_args);
}

Here is the caller graph for this function:

static int gcd ( int  i,
int  j 
) [static]

Definition at line 106 of file tm_dialogue.cpp.

                   {
  if (i<j)  return gcd (j, i);
  if (j==0) return i;
  return gcd (j, i%j);
}
static string get_prompt ( scheme_tree  p,
int  i 
) [static]

Definition at line 144 of file tm_dialogue.cpp.

                                  {
  if (is_atomic (p[i]) && is_quoted (p[i]->label))
    return translate (scm_unquote (p[i]->label));
  else if (is_tuple (p[i]) && N(p[i])>0) {
    if (is_atomic (p[i][0]) && is_quoted (p[i][0]->label))
      return translate (scm_unquote (p[i][0]->label));
    return translate (scheme_tree_to_tree (p[i][0]));
  }
  return translate ("Input:");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static array<string> get_proposals ( scheme_tree  p,
int  i 
) [static]

Definition at line 164 of file tm_dialogue.cpp.

                                     {
  array<string> a;
  if (is_tuple (p[i]) && N(p[i]) >= 2) {
    int j, n= N(p[i]);
    for (j=2; j<n; j++)
      if (is_atomic (p[i][j]) && is_quoted (p[i][j]->label))
       a << scm_unquote (p[i][j]->label);
  }
  return a;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static string get_type ( scheme_tree  p,
int  i 
) [static]

Definition at line 156 of file tm_dialogue.cpp.

                                {
  if (is_tuple (p[i]) && N(p[i])>1 &&
      is_atomic (p[i][1]) && is_quoted (p[i][1]->label))
    return scm_unquote (p[i][1]->label);
  return "string";
}

Here is the call graph for this function: