From 060f7c026c2b5cf87400c4b9dc6952dcf51e3ba4 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 30 Dec 2005 22:52:26 +0000 Subject: [PATCH] eliminate dependency on X11/bitmaps svn: r1721 --- src/wxxt/src/XWidgets/xwArrow.c | 6 +++--- src/wxxt/src/XWidgets/xwArrow.w | 6 +++--- src/wxxt/src/XWidgets/xwFrame.c | 4 ++-- src/wxxt/src/XWidgets/xwFrame.w | 4 ++-- src/wxxt/src/XWidgets/xwGray.h | 7 +++++++ src/wxxt/src/XWidgets/xwMenu.c | 4 ++-- src/wxxt/src/XWidgets/xwSlider2.c | 6 +++--- src/wxxt/src/XWidgets/xwSlider2.w | 6 +++--- 8 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 src/wxxt/src/XWidgets/xwGray.h diff --git a/src/wxxt/src/XWidgets/xwArrow.c b/src/wxxt/src/XWidgets/xwArrow.c index d3bd1975bf..b83621ef8b 100644 --- a/src/wxxt/src/XWidgets/xwArrow.c +++ b/src/wxxt/src/XWidgets/xwArrow.c @@ -3,7 +3,7 @@ */ #include #include -#include +#include "xwGray.h" #include #include #include @@ -160,7 +160,7 @@ static void create_arrowlightgc(self)Widget self; values.stipple = XCreateBitmapFromData(XtDisplay(self), RootWindowOfScreen(XtScreen(self)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } @@ -203,7 +203,7 @@ static void create_arrowdarkgc(self)Widget self; values.stipple = XCreateBitmapFromData(XtDisplay(self), RootWindowOfScreen(XtScreen(self)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } diff --git a/src/wxxt/src/XWidgets/xwArrow.w b/src/wxxt/src/XWidgets/xwArrow.w index 968863880d..6a8d818077 100644 --- a/src/wxxt/src/XWidgets/xwArrow.w +++ b/src/wxxt/src/XWidgets/xwArrow.w @@ -359,7 +359,7 @@ resource. It is the same routine as for the shadows in the XfwfFrame widget. values.stipple = XCreateBitmapFromData(XtDisplay($), RootWindowOfScreen(XtScreen($)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } @@ -400,7 +400,7 @@ resource. It is the same routine as for the shadows in the XfwfFrame widget. values.stipple = XCreateBitmapFromData(XtDisplay($), RootWindowOfScreen(XtScreen($)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } @@ -411,7 +411,7 @@ resource. It is the same routine as for the shadows in the XfwfFrame widget. @ The stipple for the shadows are loaded from a bitmap file. -@incl +@incl "xwGray.h" @incl @incl @incl diff --git a/src/wxxt/src/XWidgets/xwFrame.c b/src/wxxt/src/XWidgets/xwFrame.c index 97c1fb1591..65b1a69df0 100644 --- a/src/wxxt/src/XWidgets/xwFrame.c +++ b/src/wxxt/src/XWidgets/xwFrame.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include "xwGray.h" #include <./xwFrameP.h> static void set_shadow( #if NeedFunctionPrototypes @@ -842,7 +842,7 @@ Pixmap GetGray(self)Widget self; { if (!((XfwfFrameWidget)self)->xfwfFrame.gray) { ((XfwfFrameWidget)self)->xfwfFrame.gray = XCreateBitmapFromData(XtDisplay(self), XtWindow(self), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } return ((XfwfFrameWidget)self)->xfwfFrame.gray; } diff --git a/src/wxxt/src/XWidgets/xwFrame.w b/src/wxxt/src/XWidgets/xwFrame.w index 08b88bc5e4..2d475585dd 100644 --- a/src/wxxt/src/XWidgets/xwFrame.w +++ b/src/wxxt/src/XWidgets/xwFrame.w @@ -820,7 +820,7 @@ used to compute the value of the |topShadowColor| relative to the { if (!$gray) { $gray = XCreateBitmapFromData(XtDisplay($), XtWindow($), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } return $gray; } @@ -856,5 +856,5 @@ used to compute the value of the |topShadowColor| relative to the @ The stipple for the shadows is loaded from a bitmap file. -@incl +@incl "xwGray.h" diff --git a/src/wxxt/src/XWidgets/xwGray.h b/src/wxxt/src/XWidgets/xwGray.h new file mode 100644 index 0000000000..5776897c23 --- /dev/null +++ b/src/wxxt/src/XWidgets/xwGray.h @@ -0,0 +1,7 @@ +/* Copied from X11/bitmaps/gray, because this is all we + need from xbitmaps, and X11/bitmaps is often not installed + these days. */ +#define wx_gray_width 2 +#define wx_gray_height 2 +static char wx_gray_bits[] = { + 0x01, 0x02}; diff --git a/src/wxxt/src/XWidgets/xwMenu.c b/src/wxxt/src/XWidgets/xwMenu.c index 1a857c0c7c..d0b0ec7610 100644 --- a/src/wxxt/src/XWidgets/xwMenu.c +++ b/src/wxxt/src/XWidgets/xwMenu.c @@ -43,6 +43,7 @@ SOFTWARE. #include "wx_visual.h" #include "wxAllocColor.h" +#include "xwGray.h" extern int wxUseMenuHiliteBorder(); @@ -706,9 +707,8 @@ static void CreateGCs(MenuWidget mw) XGCValues xgcv; int gcf_flag = 0; -# include mw->menu.stipple_pxmap = XCreatePixmapFromBitmapData(dpy, win, - gray_bits, gray_width, gray_height, 1, 0, 1); + wx_gray_bits, wx_gray_width, wx_gray_height, 1, 0, 1); if (mw->menu.font) { xgcv.font = mw->menu.font->fid; diff --git a/src/wxxt/src/XWidgets/xwSlider2.c b/src/wxxt/src/XWidgets/xwSlider2.c index 6234ccf2d5..cc0bf67d98 100644 --- a/src/wxxt/src/XWidgets/xwSlider2.c +++ b/src/wxxt/src/XWidgets/xwSlider2.c @@ -3,7 +3,7 @@ */ #include #include -#include +#include "xwGray.h" #include #include <./xwSlider2P.h> static void start( @@ -201,7 +201,7 @@ static void create_thumblightgc(self)Widget self; values.stipple = XCreateBitmapFromData(XtDisplay(self), RootWindowOfScreen(XtScreen(self)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } @@ -244,7 +244,7 @@ static void create_thumbdarkgc(self)Widget self; values.stipple = XCreateBitmapFromData(XtDisplay(self), RootWindowOfScreen(XtScreen(self)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } diff --git a/src/wxxt/src/XWidgets/xwSlider2.w b/src/wxxt/src/XWidgets/xwSlider2.w index 591792e348..3c058865f5 100644 --- a/src/wxxt/src/XWidgets/xwSlider2.w +++ b/src/wxxt/src/XWidgets/xwSlider2.w @@ -673,7 +673,7 @@ parts of the thumb's frame. values.stipple = XCreateBitmapFromData(XtDisplay($), RootWindowOfScreen(XtScreen($)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } @@ -715,7 +715,7 @@ thumb's frame. values.stipple = XCreateBitmapFromData(XtDisplay($), RootWindowOfScreen(XtScreen($)), - gray_bits, gray_width, gray_height); + wx_gray_bits, wx_gray_width, wx_gray_height); } break; } @@ -724,5 +724,5 @@ thumb's frame. @imports -@incl +@incl "xwGray.h" @incl