-#if 0
-
-#define YAllocColor XAllocColor
-XColor g_itemColors[5];
-int wxComputeColours (Display *display, wxColour * back, wxColour * fore)
-{
- int result;
- static XmColorProc colorProc;
-
- result = wxNO_COLORS;
-
- if (back)
- {
- g_itemColors[0].red = (((long) back->Red ()) << 8);
- g_itemColors[0].green = (((long) back->Green ()) << 8);
- g_itemColors[0].blue = (((long) back->Blue ()) << 8);
- g_itemColors[0].flags = DoRed | DoGreen | DoBlue;
- if (colorProc == (XmColorProc) NULL)
- {
- // Get a ptr to the actual function
- colorProc = XmSetColorCalculation ((XmColorProc) NULL);
- // And set it back to motif.
- XmSetColorCalculation (colorProc);
- }
- (*colorProc) (&g_itemColors[wxBACK_INDEX],
- &g_itemColors[wxFORE_INDEX],
- &g_itemColors[wxSELE_INDEX],
- &g_itemColors[wxTOPS_INDEX],
- &g_itemColors[wxBOTS_INDEX]);
- result = wxBACK_COLORS;
- }
- if (fore)
- {
- g_itemColors[wxFORE_INDEX].red = (((long) fore->Red ()) << 8);
- g_itemColors[wxFORE_INDEX].green = (((long) fore->Green ()) << 8);
- g_itemColors[wxFORE_INDEX].blue = (((long) fore->Blue ()) << 8);
- g_itemColors[wxFORE_INDEX].flags = DoRed | DoGreen | DoBlue;
- if (result == wxNO_COLORS)
- result = wxFORE_COLORS;
- }
-
- Display *dpy = display;
- Colormap cmap = (Colormap) wxTheApp->GetMainColormap((WXDisplay*) dpy);
-
- if (back)
- {
- /* 5 Colours to allocate */
- for (int i = 0; i < 5; i++)
- if (!YAllocColor (dpy, cmap, &g_itemColors[i]))
- result = wxNO_COLORS;
- }
- else if (fore)
- {
- /* Only 1 colour to allocate */
- if (!YAllocColor (dpy, cmap, &g_itemColors[wxFORE_INDEX]))
- result = wxNO_COLORS;
- }
-
- return (result);
-
-}
-#endif
-
-// Changes the foreground and background colours to be derived from the current
-// background colour. To change the foreground colour, you must call
-// SetForegroundColour explicitly.
-void wxWindowX11::ChangeBackgroundColour()
-{
- // TODO
-#if 0
- WXWidget mainWidget = GetMainWidget();
- if ( mainWidget )
- DoChangeBackgroundColour(mainWidget, m_backgroundColour);
-#endif
-}
-
-void wxWindowX11::ChangeForegroundColour()
-{
- // TODO
-#if 0
- WXWidget mainWidget = GetMainWidget();
- if ( mainWidget )
- DoChangeForegroundColour(mainWidget, m_foregroundColour);
- if ( m_scrolledWindow && mainWidget != m_scrolledWindow )
- DoChangeForegroundColour(m_scrolledWindow, m_foregroundColour);
-#endif
-}
-
-// Change a widget's foreground and background colours.
-void wxWindowX11::DoChangeForegroundColour(WXWindow widget, wxColour& foregroundColour)
-{
- // TODO
-#if 0
- // When should we specify the foreground, if it's calculated
- // by wxComputeColours?
- // Solution: say we start with the default (computed) foreground colour.
- // If we call SetForegroundColour explicitly for a control or window,
- // then the foreground is changed.
- // Therefore SetBackgroundColour computes the foreground colour, and
- // SetForegroundColour changes the foreground colour. The ordering is
- // important.
-
- Widget w = (Widget)widget;
- XtVaSetValues(
- w,
- XmNforeground, foregroundColour.AllocColour(XtDisplay(w)),
- NULL
- );
-#endif
-}
-
-void wxWindowX11::DoChangeBackgroundColour(WXWindow widget, wxColour& backgroundColour, bool changeArmColour)
-{
- // TODO
-#if 0
- wxComputeColours (XtDisplay((Widget) widget), & backgroundColour,
- (wxColour*) NULL);
-
- XtVaSetValues ((Widget) widget,
- XmNbackground, g_itemColors[wxBACK_INDEX].pixel,
- XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel,
- XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel,
- XmNforeground, g_itemColors[wxFORE_INDEX].pixel,
- NULL);
-
- if (changeArmColour)
- XtVaSetValues ((Widget) widget,
- XmNarmColor, g_itemColors[wxSELE_INDEX].pixel,
- NULL);
-#endif
-}
-