コード例 #1
0
ファイル: tm_window.cpp プロジェクト: mgubi/texmacs
void
get_preferred_position (string name, SI& xx, SI& yy) {
    if (has_user_preference ("abscissa " * name)) {
        int x= as_int (get_user_preference ("abscissa " * name));
        int y= as_int (get_user_preference ("ordinate " * name));

        xx=  x * PIXEL;
        yy= -y * PIXEL;
    }
}
コード例 #2
0
ファイル: tm_window.cpp プロジェクト: mgubi/texmacs
void
get_preferred_size (string name, SI& ww, SI& hh) {
    if (has_user_preference ("width " * name)) {
        int w= as_int (get_user_preference ("width " * name));
        int h= as_int (get_user_preference ("height " * name));
        ww= w * PIXEL;
        hh= h * PIXEL;
        //cout << "Size " << name << ": " << w << ", " << h << "\n";
    }
}
コード例 #3
0
ファイル: link.cpp プロジェクト: svn2github/texmacs
string
get_locus_rendering (string var) {
  if (var == "locus-on-paper")
    return get_user_preference (var, "change");
  if (var == LOCUS_COLOR)
    return get_user_preference (var, "#404080");
  if (var == VISITED_COLOR)
    return get_user_preference (var, "#702070");
  return "";
}
コード例 #4
0
ファイル: tm_window.cpp プロジェクト: mgubi/texmacs
void
notify_window_resize (string name, SI ww, SI hh) {
    int w= ww / PIXEL;
    int h= hh / PIXEL;
    if (name != "popup") {
        //cout << "Resize " << name << " to " << ww << ", " << hh << "\n";
        string old_w= get_user_preference ("width " * name, "");
        string old_h= get_user_preference ("height " * name, "");
        //cout << "Resize " << name << ": " << old_w << ", " << old_h
        //<< " --> " << w << ", " << h << "\n";
        if (old_w == "" || old_h == "" ||
                resize_accept (as_int (old_w), as_int (old_h), w, h)) {
            set_user_preference ("width " * name, as_string (w));
            set_user_preference ("height " * name, as_string (h));
        }
    }
}
コード例 #5
0
ファイル: tm_window.cpp プロジェクト: mgubi/texmacs
void
notify_window_move (string name, SI xx, SI yy) {
    int x=  xx / PIXEL;
    int y= -yy / PIXEL;
    if (name != "popup") {
        //cout << "Move " << name << " to " << x << ", " << y << "\n";
        string old_x= get_user_preference ("abscissa " * name, "");
        string old_y= get_user_preference ("ordinate " * name, "");
        //cout << "Move " << name << ": " << old_x << ", " << old_y
        //<< " --> " << x << ", " << y << "\n";
        if (old_x == "" || old_y == "" ||
                move_accept (as_int (old_x), as_int (old_y), x, y)) {
            set_user_preference ("abscissa " * name, as_string (x));
            set_user_preference ("ordinate " * name, as_string (y));
        }
    }
}