15 files changed:
-void LyXView::setLayout(int layout)
+void LyXView::setLayout(LyXTextClass::size_type layout)
{
toolbar->setLayout(layout);
}
{
toolbar->setLayout(layout);
}
Toolbar * getToolbar() const;
/// sets the layout in the toolbar layout combox
Toolbar * getToolbar() const;
/// sets the layout in the toolbar layout combox
- void setLayout(int layout);
+ void setLayout(LyXTextClass::size_type layout);
/// update the toolbar
void updateToolbar();
/// update the toolbar
void updateToolbar();
-PainterBase & Painter::text(int x, int y, char const * s, int ls,
+PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
LyXFont const & f)
{
if (lyxrc.font_norm_type == LyXRC::ISO_10646_1) {
LyXFont const & f)
{
if (lyxrc.font_norm_type == LyXRC::ISO_10646_1) {
/** Draw a string at position x, y (y is the baseline)
This is just for fast drawing */
/** Draw a string at position x, y (y is the baseline)
This is just for fast drawing */
- PainterBase & text(int x, int y, char const * str, int l,
+ PainterBase & text(int x, int y, char const * str, size_t l,
LyXFont const & f);
/// Draw a char at position x, y (y is the baseline)
LyXFont const & f);
/// Draw a char at position x, y (y is the baseline)
/** Draw a string at position x, y (y is the baseline)
This is just for fast drawing */
/** Draw a string at position x, y (y is the baseline)
This is just for fast drawing */
- virtual PainterBase & text(int x, int y, char const * str, int l,
+ virtual PainterBase & text(int x, int y, char const * str, size_t l,
LyXFont const & f) = 0;
/// Draw a char at position x, y (y is the baseline)
LyXFont const & f) = 0;
/// Draw a char at position x, y (y is the baseline)
-int lyxfont::width(char const * s, int n, LyXFont const & f)
+int lyxfont::width(char const * s, size_t n, LyXFont const & f)
{
if (!lyxrc.use_gui)
return n;
{
if (!lyxrc.use_gui)
return n;
- int width(char const * s, int n, LyXFont const & f);
+ int width(char const * s, size_t n, LyXFont const & f);
///
static
int width(string const & s, LyXFont const & f) {
///
static
int width(string const & s, LyXFont const & f) {
static int gsrunning = 0; /* currently so many gs's are running */
static bool bitmap_waiting = false; /* bitmaps are waiting finished */
static int gsrunning = 0; /* currently so many gs's are running */
static bool bitmap_waiting = false; /* bitmaps are waiting finished */
-static char bittable[256]; /* bit reversion table */
static bool gs_color; // do we allocate colors for gs?
static bool color_visual; // is the visual color?
static bool gs_xcolor = false; // allocated extended colors
static unsigned long gs_pixels[128]; // allocated pixels
static bool gs_color; // do we allocate colors for gs?
static bool color_visual; // is the visual color?
static bool gs_xcolor = false; // allocated extended colors
static unsigned long gs_pixels[128]; // allocated pixels
-static int gs_num_pixels; // number of pixels allocated
static int gs_spc; // shades per color
static int gs_spc; // shades per color
-static bool gs_gray; // is grayscale?
static int gs_allcolors; // number of all colors
static list<int> pidwaitlist; // pid wait list
static int gs_allcolors; // number of all colors
static list<int> pidwaitlist; // pid wait list
register XImage * im;
int i;
int y;
register XImage * im;
int i;
int y;
int spc1 = gs_spc - 1;
int spc2 = gs_spc * gs_spc;
int wid = p->wid;
int spc1 = gs_spc - 1;
int spc2 = gs_spc * gs_spc;
int wid = p->wid;
.colormap, cmap,
gs_allcolors);
XFlush(tmpdisp);
.colormap, cmap,
gs_allcolors);
XFlush(tmpdisp);
// now we process all the image
for (y = 0; y < p->hgh; ++y) {
for (int x = 0; x < wid; ++x) {
// now we process all the image
for (y = 0; y < p->hgh; ++y) {
for (int x = 0; x < wid; ++x) {
if (num > 5) num = 5;
XColor xcol;
for (int i = 0; i < num * num * num; ++i) {
if (num > 5) num = 5;
XColor xcol;
for (int i = 0; i < num * num * num; ++i) {
- xcol.red = 65535 * (i / (num * num)) / (num - 1);
- xcol.green = 65535 * ((i / num) % num) / (num - 1);
- xcol.blue = 65535 * (i % num) / (num - 1);
+ xcol.red = short(65535 * (i / (num * num)) / (num - 1));
+ xcol.green = short(65535 * ((i / num) % num) / (num - 1));
+ xcol.blue = short(65535 * (i % num) / (num - 1));
xcol.flags = DoRed | DoGreen | DoBlue;
if (!XAllocColor(fl_display,
fl_state[fl_get_vclass()].colormap, &xcol)) {
xcol.flags = DoRed | DoGreen | DoBlue;
if (!XAllocColor(fl_display,
fl_state[fl_get_vclass()].colormap, &xcol)) {
gs_pixels[i] = xcol.pixel;
}
gs_color = true;
gs_pixels[i] = xcol.pixel;
}
gs_color = true;
- gs_num_pixels = num * num * num;
gs_pixels[i] = xcol.pixel;
}
gs_color = true;
gs_pixels[i] = xcol.pixel;
}
gs_color = true;
- gs_gray = false;
- gs_num_pixels = num;
k = 0;
for (unsigned int j = 0; j < 8; ++j)
if (i & (1 << (7-j))) k |= 1 << j;
k = 0;
for (unsigned int j = 0; j < 8; ++j)
if (i & (1 << (7-j))) k |= 1 << j;
- bittable[i] = char(~k);
}
// allocate color cube on pseudo-color display
}
// allocate color cube on pseudo-color display
// If keys is "too long" then only print out the first few tokens
string label;
// If keys is "too long" then only print out the first few tokens
string label;
- if( contains( keys, "," ) ) {
+ if (contains(keys, ",")) {
// Final comma allows while loop to cover all keys
// Final comma allows while loop to cover all keys
- keys = frontStrip( split( keys, label, ',' ) ) + ",";
+ keys = frontStrip(split(keys, label, ',')) + ",";
- const int maxSize( 40 );
- while( contains( keys, "," ) ) {
+ size_t const maxSize = 40;
+ while (contains( keys, "," )) {
- keys = frontStrip( split( keys, key, ',' ) );
+ keys = frontStrip(split(keys, key, ','));
- int size = label.size() + 2 + key.size();
+ size_t size = label.size() + 2 + key.size();
if( size >= maxSize ) {
label += ", ...";
break;
if( size >= maxSize ) {
label += ", ...";
break;
- if( !getOptions().empty() )
+ if (!getOptions().empty())
label += ", " + getOptions();
return '[' + label + ']';
label += ", " + getOptions();
return '[' + label + ']';
void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
{
void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
{
- bv->owner()->getDialogs()->showCitation( this );
+ bv->owner()->getDialogs()->showCitation(this);
void InsetExternal::Read(Buffer const *, LyXLex & lex)
{
lex.EatLine();
void InsetExternal::Read(Buffer const *, LyXLex & lex)
{
lex.EatLine();
- string format = lex.GetString();
- int pos1 = format.find(",");
+ string const format = lex.GetString();
+ string::size_type const pos1 = format.find(",");
templatename = format.substr(0, pos1);
templatename = format.substr(0, pos1);
- int pos2 = format.find("\",\"", pos1);
+ string::size_type const pos2 = format.find("\",\"", pos1);
filename = format.substr(pos1 + 2, pos2 - (pos1 + 2));
parameters = format.substr(pos2 + 3, format.length() - (pos2 + 4));
filename = format.substr(pos1 + 2, pos2 - (pos1 + 2));
parameters = format.substr(pos2 + 3, format.length() - (pos2 + 4));
string const & s) const
{
string result;
string const & s) const
{
string result;
- string basename = ChangeExtension(filename, string());
+ string const basename = ChangeExtension(filename, string());
result = subst(s, "$$FName", filename);
result = subst(result, "$$Basename", basename);
result = subst(result, "$$Parameters", parameters);
result = subst(s, "$$FName", filename);
result = subst(result, "$$Basename", basename);
result = subst(result, "$$Parameters", parameters);
// Handle the $$Contents(filename) syntax
if (contains(result, "$$Contents(\"")) {
// Handle the $$Contents(filename) syntax
if (contains(result, "$$Contents(\"")) {
- int const pos = result.find("$$Contents(\"");
- int const end = result.find("\")", pos);
+ string::size_type const pos = result.find("$$Contents(\"");
+ string::size_type const end = result.find("\")", pos);
string const file = result.substr(pos + 12, end - (pos + 12));
string contents;
if (buffer) {
string const file = result.substr(pos + 12, end - (pos + 12));
string contents;
if (buffer) {
-void InsetTabular::GetCursorPos(BufferView *, int & x, int & y) const
+void InsetTabular::GetCursorPos(BufferView *,
+ unsigned long & x, unsigned long & y) const
{
x = cursor.x() - top_x;
y = cursor.y();
{
x = cursor.x() - top_x;
y = cursor.y();
void InsetTabular::TabularFeatures(BufferView * bv, int feature,
string const & value)
{
void InsetTabular::TabularFeatures(BufferView * bv, int feature,
string const & value)
{
- int
- i, j,
- sel_col_start,
- sel_col_end,
- sel_row_start,
- sel_row_end,
- setLines = 0,
- setAlign = LYX_ALIGN_LEFT,
- lineSet;
+ int i;
+ int j;
+ int sel_col_start;
+ int sel_col_end;
+ int sel_row_start;
+ int sel_row_end;
+ int setLines = 0;
+ LyXAlignment setAlign = LYX_ALIGN_LEFT;
+ int lineSet;
bool what;
switch (feature) {
bool what;
switch (feature) {
case LyXTabular::ALIGN_LEFT:
case LyXTabular::ALIGN_RIGHT:
case LyXTabular::ALIGN_CENTER:
case LyXTabular::ALIGN_LEFT:
case LyXTabular::ALIGN_RIGHT:
case LyXTabular::ALIGN_CENTER:
- for(i=sel_row_start; i<=sel_row_end; ++i)
- for(j=sel_col_start; j<=sel_col_end; ++j)
- tabular->SetAlignment(tabular->GetCellNumber(i,j),setAlign,
+ for(i = sel_row_start; i <= sel_row_end; ++i)
+ for(j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetAlignment(tabular->GetCellNumber(i, j), setAlign,
flag);
if (hasSelection())
UpdateLocal(bv, INIT, true);
flag);
if (hasSelection())
UpdateLocal(bv, INIT, true);
case LyXTabular::VALIGN_TOP:
case LyXTabular::VALIGN_BOTTOM:
case LyXTabular::VALIGN_CENTER:
case LyXTabular::VALIGN_TOP:
case LyXTabular::VALIGN_BOTTOM:
case LyXTabular::VALIGN_CENTER:
- for(i=sel_row_start; i<=sel_row_end; ++i)
- for(j=sel_col_start; j<=sel_col_end; ++j)
- tabular->SetVAlignment(tabular->GetCellNumber(i,j), setAlign,
+ for(i = sel_row_start; i <= sel_row_end; ++i)
+ for(j = sel_col_start; j <= sel_col_end; ++j)
+ tabular->SetVAlignment(tabular->GetCellNumber(i, j), setAlign,
flag);
if (hasSelection())
UpdateLocal(bv, INIT, true);
flag);
if (hasSelection())
UpdateLocal(bv, INIT, true);
///
Inset::Code LyxCode() const { return Inset::TABULAR_CODE; }
///
///
Inset::Code LyxCode() const { return Inset::TABULAR_CODE; }
///
- void GetCursorPos(BufferView *, int & x, int & y) const;
+ void GetCursorPos(BufferView *, unsigned long & x,
+ unsigned long & y) const;
///
void ToggleInsetCursor(BufferView *);
///
///
void ToggleInsetCursor(BufferView *);
///
///
mutable int inset_x;
///
///
mutable int inset_x;
///
+ mutable unsigned long inset_y;
///
mutable int sel_pos_start;
///
///
mutable int sel_pos_start;
///
y += baseline - row->ascent_of_text();
if (cleared || !locked || (need_update == FULL)) {
while (row != 0) {
y += baseline - row->ascent_of_text();
if (cleared || !locked || (need_update == FULL)) {
while (row != 0) {
- TEXT(bv)->GetVisibleRow(bv, y, int(x), row, y, cleared);
+ TEXT(bv)->GetVisibleRow(bv, int(y), int(x), row, y, cleared);
y += row->height();
row = row->next();
}
} else if (need_update == SELECTION) {
y += row->height();
row = row->next();
}
} else if (need_update == SELECTION) {
- bv->screen()->ToggleToggle(TEXT(bv), y, int(x));
+ bv->screen()->ToggleToggle(TEXT(bv), int(y), int(x));
} else {
locked = false;
if (need_update == CURSOR) {
} else {
locked = false;
if (need_update == CURSOR) {
- bv->screen()->ToggleSelection(TEXT(bv), true, y, int(x));
+ bv->screen()->ToggleSelection(TEXT(bv), true, int(y), int(x));
TEXT(bv)->ClearSelection();
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
}
TEXT(bv)->ClearSelection();
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
}
- bv->screen()->Update(TEXT(bv), y, int(x));
+ bv->screen()->Update(TEXT(bv), int(y), int(x));
locked = true;
}
TEXT(bv)->refresh_y = 0;
locked = true;
}
TEXT(bv)->refresh_y = 0;
-int InsetText::cx(BufferView * bv) const
+
+long InsetText::cx(BufferView * bv) const
{
return TEXT(bv)->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
}
{
return TEXT(bv)->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
}
-int InsetText::cy(BufferView * bv) const
+long InsetText::cy(BufferView * bv) const
{
LyXFont font;
return TEXT(bv)->cursor.y() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
{
LyXFont font;
return TEXT(bv)->cursor.y() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
void removeNewlines();
///
void removeNewlines();
///
- int cx(BufferView *) const;
+ long cx(BufferView *) const;
- int cy(BufferView *) const;
+ long cy(BufferView *) const;
///
int cpos(BufferView *) const;
///
///
int cpos(BufferView *) const;
///
///
mutable int insetAscent;
///
///
mutable int insetAscent;
///
- mutable int insetDescent;
+ mutable long insetDescent;
///
mutable int insetWidth;
///
///
mutable int insetWidth;
///
-bool LyXTabular::SetAlignment(int cell, char align, bool onlycolumn)
+bool LyXTabular::SetAlignment(int cell, LyXAlignment align, bool onlycolumn)
{
#warning Please fix align type. (Lgb)
if (!IsMultiColumn(cell) || onlycolumn)
{
#warning Please fix align type. (Lgb)
if (!IsMultiColumn(cell) || onlycolumn)