I got transparency to work!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@906 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2000-07-20 12:39:25 +00:00
parent 2fe7465d03
commit d42cc321ff
38 changed files with 70 additions and 49 deletions

View File

@ -1,3 +1,20 @@
2000-07-20 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/Makefile.am (INCLUDES): remove image directory from include
path.
* src/bullet_forms.C (create_form_form_bullet): small cleanup.
* src/bullet_forms_cb.C (BulletPanelCB): ditto.
* src/LyXView.C (create_form_form_main): read the application icon
from the disk.
* lib/images/*.xpm: change the icons to use transparent color for
background.
* src/toolbar.C (update): change the color of the button when it
is toggled on.
2000-07-20 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/lyxfunc.C (Dispatch): use LyXView::ShowState instead of

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * close_xpm[] = {
"20 20 5 1",
" c #BFBFBFBFBFBF",
" c None",
". c #7B7B00000000",
"X c #000000000000",
"o c #9A9A94949494",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * make_ascii_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c black",
" ",
" .................. ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * make_latex_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c black",
" ",
" .................. ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * open_xpm[] = {
"20 20 5 1",
" c #BFBFBFBFBFBF",
" c None",
". c navy",
"X c #000000000000",
"o c #9A9A94949494",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * print1_xpm[] = {
"24 20 7 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
"o c #7B7B00000000",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * update_ps_xpm[] = {
"20 20 3 1",
" c #BFBFBFBFBFBF",
" c None",
".c navy",
"Xc black",
" ... ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * run_latex_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" . .. . . . .. ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * view_ps_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" .............. ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * view_dvi_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" .............. ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * save_xpm[] = {
"20 20 5 1",
" c #BFBFBFBFBFBF",
" c None",
". c black",
"X c gray70",
"o c gray90",

View File

@ -2,7 +2,7 @@
static char const * build_xpm[] = {
"20 20 4 1",
". c black",
" c #BFBFBFBFBFBF",
" c None",
"+ c white",
"O c red",
" ... ",

View File

@ -2,7 +2,7 @@
static char const * copy_xpm[] = {
"20 20 5 1",
" c #000000000000",
". c #BFBFBFBFBFBF",
". c None",
"X c #FFFFFFFFFFFF",
"o c navy",
"O c #B2B2ABABACAC",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * cut_xpm[] = {
"20 20 3 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
"X c #7B7B00000000",
" ",

View File

@ -5,7 +5,7 @@ static char const * depth_xpm[] = {
". c #000000000000",
"X c #FFFFFFFFFFFF",
"o c #7B7B00000000",
"O c #BFBFBFBFBFBF",
"O c None",
" ",
".XXXXXXXXXXXXXXXXXX.",
".XX..............XX.",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * fig_xpm[] = {
"20 20 4 1",
" c #000000000000",
" c None",
". c #FFFFFFFFFFFF",
"X c #7B7B00000000",
"o c gray70",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * bold_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" ... .... ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * emph_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" .. ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * free_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * noun_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" .. ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * sans_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
" ",
" .... ",

View File

@ -2,7 +2,7 @@
static char const * layout_scrap_xpm[] = {
" 20 20 3 1",
". c gray30",
" c #BFBFBFBFBFBF",
" c None",
"c c black",
"c c",
" c .c.c.. ",

View File

@ -3,7 +3,7 @@ static char const * quit_xpm[] = {
/* width height num_colors chars_per_pixel */
" 20 20 7 1",
/* colors */
". c #b2c0dc",
". c None",
"# c #4d4d4d",
"a c #000000",
"b c #737373",

View File

@ -3,7 +3,7 @@ static char const * margin_xpm[] = {
"20 20 5 1",
" c gray60",
". c #000000000000",
"X c #BFBFBFBFBFBF",
"X c None",
"o c #FFFFFFFFFFFF",
"O c #7B7B00000000",
" .................XX",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * math_xpm[] = {
"20 20 4 1",
" c #BFBFBFBFBFBF",
" c None",
". c #242423238E8E",
"X c #000000000000",
"o c #FFFFFFFFFFFF",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * melt_xpm[] = {
"20 20 5 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
"X c gray60",
"o c gray70",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * paste_xpm[] = {
"20 20 6 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
"X c #E5E5E0E0E1E1",
"o c navy",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * redo_bw_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c black",
" ",
" ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * tab_xpm[] = {
"20 20 3 1",
" c #BFBFBFBFBFBF",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * tex_xpm[] = {
"20 20 2 1",
" c #BEFBBEFBBEFB",
" c None",
". c #7B7B00000000",
" ",
" ",

View File

@ -1,7 +1,7 @@
/* XPM */
static char const * undo_bw_xpm[] = {
"20 20 2 1",
" c #BFBFBFBFBFBF",
" c None",
". c black",
" ",
" ",

View File

@ -4,7 +4,7 @@ static char const * unknown_xpm[] = {
" 20 20 2 1",
/* colors */
". c #000000000000",
"# c #befbbefbbefb",
"# c None",
/* pixels */
"####################",
"####################",

View File

@ -24,7 +24,6 @@
#include "toolbar.h"
#include "minibuffer.h"
#include "lyxfunc.h"
#include "lyx.xpm"
#include "debug.h"
#include "layout_forms.h"
#include "intl.h"
@ -254,17 +253,20 @@ void LyXView::create_form_form_main(int width, int height)
//
// assign an icon to main form
unsigned int w, h;
Pixmap lyx_p, lyx_mask;
lyx_p = fl_create_from_pixmapdata(fl_root,
const_cast<char**>(lyx_xpm),
&w,
&h,
&lyx_mask,
0,
0,
0); // this leaks
fl_set_form_icon(form_, lyx_p, lyx_mask);
string iconname = LibFileSearch("images", "lyx", "xpm");
if (!iconname.empty()) {
unsigned int w, h;
Pixmap lyx_p, lyx_mask;
lyx_p = fl_read_pixmapfile(fl_root,
iconname.c_str(),
&w,
&h,
&lyx_mask,
0,
0,
0); // this leaks
fl_set_form_icon(form_, lyx_p, lyx_mask);
}
// set min size
fl_set_form_minsize(form_, 50, 50);

View File

@ -10,7 +10,7 @@ lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \
@FRONTEND_LDFLAGS@ @FRONTEND_LIBS@
EXTRA_DIST = config.h.in stamp-h.in cheaders
ETAGS_ARGS = --lang=c++
INCLUDES = -I${top_srcdir}/images $(SIGC_CFLAGS) @FRONTEND_INCLUDES@
INCLUDES = $(SIGC_CFLAGS) @FRONTEND_INCLUDES@
localedir = $(datadir)/locale
lyx_SOURCES = \
BackStack.h \

View File

@ -29,7 +29,7 @@ FD_form_bullet *create_form_form_bullet(void)
fl_set_object_boxtype(obj, FL_UP_BOX);
fl_set_bmtable_pixmap_file(obj, 6, 6,
LibFileSearch("images",
"standard.xpm").c_str());
"standard", "xpm").c_str());
fl_set_border_width(-1);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, "");

View File

@ -218,9 +218,10 @@ void BulletPanelCB(FL_OBJECT * /*ob*/, long data)
new_panel = "standard";
break;
}
new_panel += ".xpm";
fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel, 6, 6,
LibFileSearch("images", new_panel.c_str()).c_str());
fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel,
6, 6,
LibFileSearch("images", new_panel,
"xpm").c_str());
fl_redraw_object(fd_form_bullet->bmtable_bullet_panel);
fl_unfreeze_form(fd_form_bullet->form_bullet);
}

View File

@ -145,8 +145,10 @@ void Toolbar::update()
// know how to use transparency with
// Xpm library. It seems pretty
// complicated to me (JMarc)
fl_set_object_color(p->icon, FL_LEFT_BCOL, FL_BLUE);
fl_set_object_boxtype(p->icon, FL_DOWN_BOX);
} else {
fl_set_object_color(p->icon, FL_MCOL, FL_BLUE);
fl_set_object_boxtype(p->icon, FL_UP_BOX);
}
@ -287,7 +289,6 @@ void Toolbar::set(bool doingmain)
NorthWestGravity);
fl_set_object_callback(obj, C_Toolbar_ToolbarCB,
static_cast<long>(item->action));
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
// Remove the blue feedback rectangle
fl_set_pixmapbutton_focus_outline(obj, 0);