fix flimage.h handling; xpm format patch from herbert; math delim drawing patch from martin

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4382 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-06-12 14:21:58 +00:00
parent 3bf65e6bb5
commit 35de4638f7
10 changed files with 98 additions and 22 deletions

View File

@ -1,3 +1,8 @@
2002-06-12 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* xforms.m4 (LYX_USE_XFORMS_IMAGE_LOADER): fix and simplify the
check for flimage.h header.
2002-06-12 John Levon <moz@compsoc.man.ac.uk> 2002-06-12 John Levon <moz@compsoc.man.ac.uk>
* qt2.m4: Qt frontend is for Qt 2 OR Qt 3 * qt2.m4: Qt frontend is for Qt 2 OR Qt 3

View File

@ -88,19 +88,7 @@ if test $lyx_use_xforms_image_loader = yes ; then
AC_DEFINE(USE_XFORMS_IMAGE_LOADER, 1, AC_DEFINE(USE_XFORMS_IMAGE_LOADER, 1,
[Define if you want to use xforms built-in image loader]) [Define if you want to use xforms built-in image loader])
AC_CHECK_FUNCS(flimage_enable_ps flimage_enable_jpeg) AC_CHECK_FUNCS(flimage_enable_ps flimage_enable_jpeg)
AC_CHECK_HEADER(flimage.h,[ AC_CHECK_HEADERS(flimage.h X11/flimage.h, break)
ac_cv_header_flimage_h=yes
lyx_cv_flimage_h_location="<flimage.h>"],
[AC_CHECK_HEADER(X11/flimage.h,[
ac_cv_header_flimage_h=yes
lyx_cv_flimage_h_location="<X11/flimage.h>"],
ac_cv_header_flimage_h=no)])
if test $ac_cv_header_flimage_h = yes ; then
AC_DEFINE(HAVE_FLIMAGE_H, 1, [Define if you have the <flimage.h> header file.])
AC_DEFINE_UNQUOTED(FLIMAGE_H_LOCATION, $lyx_cv_flimage_h_location,
[define this to the location of flimage.h to be used with #include, e.g. <flimage.h>
])
fi
fi fi
### If the gui cannot load images itself, then we default to the ### If the gui cannot load images itself, then we default to the

View File

@ -1,3 +1,7 @@
2002-06-12 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* delim1.xpm: new file
2002-04-17 Angus Leeming <a.leeming@ic.ac.uk> 2002-04-17 Angus Leeming <a.leeming@ic.ac.uk>
* deco.xpm * deco.xpm

42
images/delim1.xpm Normal file
View File

@ -0,0 +1,42 @@
/* XPM */
static char const * delim1[] = {
/* width height num_colors chars_per_pixel */
" 31 31 2 1",
/* colors */
" c None",
"X c Blue",
/* pixels */
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
" "
};

View File

@ -19,6 +19,7 @@ src/frontends/controllers/ControlCharacter.C
src/frontends/controllers/ControlExternal.C src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlGraphics.C src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlInclude.C src/frontends/controllers/ControlInclude.C
src/frontends/controllers/ControlParagraph.C
src/frontends/controllers/ControlPreamble.C src/frontends/controllers/ControlPreamble.C
src/frontends/controllers/ControlPrint.C src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSearch.C src/frontends/controllers/ControlSearch.C

View File

@ -1,3 +1,12 @@
2002-05-24 Martin Vermeer <martin.vermeer@hut.fi>
* FormMathsDelim.C: fix delimiter pre-display rendering
mess-up bug (354)
2002-06-12 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* xformsGImage.h: do not rely on FLIMAGE_H_LOCATION anymore
2002-06-12 John Levon <moz@compsoc.man.ac.uk> 2002-06-12 John Levon <moz@compsoc.man.ac.uk>
* XFormsView.h: * XFormsView.h:

View File

@ -26,6 +26,7 @@
#include "delim.xbm" #include "delim.xbm"
#include "delim0.xpm" #include "delim0.xpm"
#include "delim1.xpm"
static int const delim_rversion[] = { static int const delim_rversion[] = {
1,1,3,3,4,5,7,7,9,9,10,11, 1,1,3,3,4,5,7,7,9,9,10,11,
@ -59,10 +60,11 @@ void FormMathsDelim::build()
dialog_.reset(build_maths_delim()); dialog_.reset(build_maths_delim());
fl_set_button(dialog_->radio_left, 1); fl_set_button(dialog_->radio_left, 1);
// Initialize button_pix to "()" as found in images/delim0.xpm:
fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim0)); fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim0));
dialog_->radio_left->u_ldata = 0; dialog_->radio_left->u_ldata = 0;
dialog_->radio_right->u_ldata = 1; dialog_->radio_right->u_ldata = 1;
dialog_->radio_both->u_ldata = 2; //dialog_->radio_both->u_ldata = 2;
fl_set_bmtable_data(dialog_->bmtable, 6, 4, fl_set_bmtable_data(dialog_->bmtable, 6, 4,
delim_width, delim_height, delim_bits); delim_width, delim_height, delim_bits);
@ -107,16 +109,28 @@ bool FormMathsDelim::input(FL_OBJECT *, long)
right = i; right = i;
else { else {
left = i; left = i;
if (both) if (both) {
right = delim_rversion[i]; right = delim_rversion[i];
// Add left delimiter in "both" case if right one was pressed:
for (int j = 0; j <= 23; ++j) {
if (delim_rversion[j] == left) {
right = left;
left = j;
}
}
}
} }
} }
Pixmap p1, p2; // Re-initialize button_pix to solid blue
// (not elegant but works, MV 24.5.2002)
p1 = fl_get_pixmap_pixmap(dialog_->button_pix, &p1, &p2); fl_free_pixmap_pixmap(dialog_->button_pix);
fl_draw_bmtable_item(dialog_->bmtable, left, p1, 0, 0); fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim1));
fl_draw_bmtable_item(dialog_->bmtable, right, p1, 16, 0); Pixmap p1;
fl_get_pixmap_pixmap(dialog_->button_pix, &p1, 0);
fl_draw_bmtable_item(dialog_->bmtable, left, p1, -2, 0);
fl_draw_bmtable_item(dialog_->bmtable, right, p1, 14, 0);
fl_redraw_object(dialog_->button_pix); fl_redraw_object(dialog_->button_pix);
dialog_->radio_left->u_ldata = left; dialog_->radio_left->u_ldata = left;

View File

@ -20,8 +20,13 @@
#include "graphics/GraphicsImage.h" #include "graphics/GraphicsImage.h"
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
#ifdef HAVE_FLIMAGE_H #ifdef HAVE_FLIMAGE_H
#include FLIMAGE_H_LOCATION # include <flimage.h>
#else
# ifdef HAVE_X11_FLIMAGE_H
# include <X11/flimage.h>
# endif
#endif #endif
namespace grfx { namespace grfx {

View File

@ -1,3 +1,8 @@
2002-06-10 Herbert Voss <voss@lyx.org>
* GraphicsImageXPM.C (convertTo7chars): get another special color
format from convert work in the right way
2002-06-12 John Levon <moz@compsoc.man.ac.uk> 2002-06-12 John Levon <moz@compsoc.man.ac.uk>
* GraphicsCache.C: use right colormap incantation * GraphicsCache.C: use right colormap incantation

View File

@ -566,7 +566,7 @@ namespace {
string const convertTo7chars(string const & input) string const convertTo7chars(string const & input)
{ {
string::size_type size = input.size(); string::size_type size = input.size();
if (size != 13 && size != 10 && size != 4) if (size != 13 && size != 10 && size != 9 && size != 4)
// Can't deal with it. // Can't deal with it.
return input; return input;
@ -587,6 +587,9 @@ string const convertTo7chars(string const & input)
format.erase(5, 1); format.erase(5, 1);
format.erase(7, 1); format.erase(7, 1);
break; break;
case 9: //
format.erase(7);
break;
case 4: // #rgb case 4: // #rgb
format.insert(2, 1, '0'); format.insert(2, 1, '0');
format.insert(4, 1, '0'); format.insert(4, 1, '0');