[PATCH 1/2] Replace tabs by space in salnativewidgets-gtk.cxx
Lucas Baudin
xapantu at gmail.com
Sat May 21 07:21:13 PDT 2011
---
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 522 +++++++++++++++---------------
1 files changed, 261 insertions(+), 261 deletions(-)
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 5c562a1..127c5f0 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -69,23 +69,23 @@ class NWPixmapCacheList;
class NWPixmapCache;
struct NWFWidgetData
{
- GtkWidget * gCacheWindow;
- GtkWidget * gDumbContainer;
-
- GtkWidget * gBtnWidget;
- GtkWidget * gRadioWidget;
- GtkWidget * gRadioWidgetSibling;
- GtkWidget * gCheckWidget;
- GtkWidget * gScrollHorizWidget;
- GtkWidget * gScrollVertWidget;
- GtkWidget * gArrowWidget;
- GtkWidget * gDropdownWidget;
- GtkWidget * gEditBoxWidget;
- GtkWidget * gSpinButtonWidget;
- GtkWidget * gNotebookWidget;
- GtkWidget * gOptionMenuWidget;
- GtkWidget * gComboWidget;
- GtkWidget * gScrolledWindowWidget;
+ GtkWidget * gCacheWindow;
+ GtkWidget * gDumbContainer;
+
+ GtkWidget * gBtnWidget;
+ GtkWidget * gRadioWidget;
+ GtkWidget * gRadioWidgetSibling;
+ GtkWidget * gCheckWidget;
+ GtkWidget * gScrollHorizWidget;
+ GtkWidget * gScrollVertWidget;
+ GtkWidget * gArrowWidget;
+ GtkWidget * gDropdownWidget;
+ GtkWidget * gEditBoxWidget;
+ GtkWidget * gSpinButtonWidget;
+ GtkWidget * gNotebookWidget;
+ GtkWidget * gOptionMenuWidget;
+ GtkWidget * gComboWidget;
+ GtkWidget * gScrolledWindowWidget;
GtkWidget * gToolbarWidget;
GtkWidget * gToolbarButtonWidget;
GtkWidget * gToolbarToggleWidget;
@@ -153,29 +153,29 @@ struct NWFWidgetData
// Keep a hash table of Widgets->default flags so that we can
// easily and quickly reset each to a default state before using
// them
-static boost::unordered_map<long, guint> gWidgetDefaultFlags;
+static boost::unordered_map<long, guint> gWidgetDefaultFlags;
static std::vector<NWFWidgetData> gWidgetData;
-static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 };
+static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 };
// Some GTK defaults
-#define MIN_ARROW_SIZE 11
-#define BTN_CHILD_SPACING 1
-#define MIN_SPIN_ARROW_WIDTH 6
-
-
-static void NWEnsureGTKRadio ( int nScreen );
-static void NWEnsureGTKButton ( int nScreen );
-static void NWEnsureGTKCheck ( int nScreen );
-static void NWEnsureGTKScrollbars ( int nScreen );
-static void NWEnsureGTKArrow ( int nScreen );
-static void NWEnsureGTKEditBox ( int nScreen );
-static void NWEnsureGTKSpinButton ( int nScreen );
-static void NWEnsureGTKNotebook ( int nScreen );
-static void NWEnsureGTKOptionMenu ( int nScreen );
-static void NWEnsureGTKCombo ( int nScreen );
-static void NWEnsureGTKScrolledWindow ( int nScreen );
-static void NWEnsureGTKToolbar ( int nScreen );
+#define MIN_ARROW_SIZE 11
+#define BTN_CHILD_SPACING 1
+#define MIN_SPIN_ARROW_WIDTH 6
+
+
+static void NWEnsureGTKRadio ( int nScreen );
+static void NWEnsureGTKButton ( int nScreen );
+static void NWEnsureGTKCheck ( int nScreen );
+static void NWEnsureGTKScrollbars ( int nScreen );
+static void NWEnsureGTKArrow ( int nScreen );
+static void NWEnsureGTKEditBox ( int nScreen );
+static void NWEnsureGTKSpinButton ( int nScreen );
+static void NWEnsureGTKNotebook ( int nScreen );
+static void NWEnsureGTKOptionMenu ( int nScreen );
+static void NWEnsureGTKCombo ( int nScreen );
+static void NWEnsureGTKScrolledWindow ( int nScreen );
+static void NWEnsureGTKToolbar ( int nScreen );
static void NWEnsureGTKMenubar ( int nScreen );
static void NWEnsureGTKMenu ( int nScreen );
static void NWEnsureGTKTooltip ( int nScreen );
@@ -234,7 +234,7 @@ static Rectangle NWGetToolbarRect( int nScreen,
const OUString& rCaption );
//---
-static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect );
+static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect );
//---
/*********************************************************
@@ -387,10 +387,10 @@ void NWPixmapCacheList::ThemeChanged( )
*********************************************************/
inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc )
{
- aDst.left = pSrc->left;
- aDst.top = pSrc->top;
- aDst.right = pSrc->right;
- aDst.bottom = pSrc->bottom;
+ aDst.left = pSrc->left;
+ aDst.top = pSrc->top;
+ aDst.right = pSrc->right;
+ aDst.bottom = pSrc->bottom;
}
@@ -531,40 +531,40 @@ void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
if (
- ((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
- ((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
- ((nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL)) ||
+ ((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
+ ((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
+ ((nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL)) ||
((nType==CTRL_SCROLLBAR) &&
( (nPart==PART_DRAW_BACKGROUND_HORZ)
|| (nPart==PART_DRAW_BACKGROUND_VERT)
|| (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_THREE_BUTTONS) ) ) ||
+ || (nPart==HAS_THREE_BUTTONS) ) ) ||
((nType==CTRL_EDITBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType==CTRL_MULTILINE_EDITBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType==CTRL_SPINBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
|| (nPart==PART_ALL_BUTTONS)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType==CTRL_SPINBUTTONS) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==PART_ALL_BUTTONS) ) ) ||
+ || (nPart==PART_ALL_BUTTONS) ) ) ||
((nType==CTRL_COMBOBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
(((nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) ||
(nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER)) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==PART_TABS_DRAW_RTL) ) ) ||
+ || (nPart==PART_TABS_DRAW_RTL) ) ) ||
((nType==CTRL_LISTBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
|| (nPart==PART_WINDOW)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType == CTRL_TOOLBAR) &&
- ( (nPart==PART_ENTIRE_CONTROL)
+ ( (nPart==PART_ENTIRE_CONTROL)
|| (nPart==PART_DRAW_BACKGROUND_HORZ)
|| (nPart==PART_DRAW_BACKGROUND_VERT)
|| (nPart==PART_THUMB_HORZ)
@@ -615,11 +615,11 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
*
* returns whether bIsInside was really set.
*/
-sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
- ControlPart nPart,
- const Rectangle& rControlRegion,
- const Point& aPos,
- sal_Bool& rIsInside )
+sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
+ ControlPart nPart,
+ const Rectangle& rControlRegion,
+ const Point& aPos,
+ sal_Bool& rIsInside )
{
if ( ( nType == CTRL_SCROLLBAR ) &&
( ( nPart == PART_BUTTON_UP ) ||
@@ -721,18 +721,18 @@ sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
*
* Draws the requested control described by nPart/nState.
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * rCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * rCaption: A caption or title string (like button text etc)
*/
-sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
+sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- sal_Bool returnVal = sal_False;
+ sal_Bool returnVal = sal_False;
// get a GC with current clipping region set
GetFontGC();
@@ -897,11 +897,11 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
* OPTIONAL. Draws the requested text for the control described by nPart/nState.
* Used if text not drawn by DrawNativeControl().
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * rCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * rCaption: A caption or title string (like button text etc)
*/
-sal_Bool GtkSalGraphics::drawNativeControlText( ControlType,
+sal_Bool GtkSalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
@@ -921,9 +921,9 @@ sal_Bool GtkSalGraphics::drawNativeControlText( ControlType,
* within the control that can be safely drawn into without drawing over
* the borders of the control.
*
- * rControlRegion: The bounding region of the control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * rCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * rCaption: A caption or title string (like button text etc)
*/
sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
@@ -972,9 +972,9 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
returnVal = sal_True;
}
if ( (nType==CTRL_TOOLBAR) &&
- ((nPart==PART_DRAW_BACKGROUND_HORZ) ||
- (nPart==PART_DRAW_BACKGROUND_VERT) ||
- (nPart==PART_THUMB_HORZ) ||
+ ((nPart==PART_DRAW_BACKGROUND_HORZ) ||
+ (nPart==PART_DRAW_BACKGROUND_VERT) ||
+ (nPart==PART_THUMB_HORZ) ||
(nPart==PART_THUMB_VERT) ||
(nPart==PART_BUTTON)
))
@@ -1137,16 +1137,16 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
ControlState nState, const ImplControlValue&,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- gboolean interiorFocus;
- gint focusWidth;
- gint focusPad;
- sal_Bool bDrawFocus = sal_True;
- gint x, y, w, h;
- GtkBorder aDefBorder;
- GtkBorder* pBorder;
- GdkRectangle clipRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ gboolean interiorFocus;
+ gint focusWidth;
+ gint focusPad;
+ sal_Bool bDrawFocus = sal_True;
+ gint x, y, w, h;
+ GtkBorder aDefBorder;
+ GtkBorder* pBorder;
+ GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -1157,10 +1157,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
h = rControlRectangle.GetHeight();
// Grab some button style attributes
- gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, "focus-line-width", &focusWidth,
- "focus-padding", &focusPad,
- "interior_focus", &interiorFocus,
- "default_border", &pBorder,
+ gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, "focus-line-width", &focusWidth,
+ "focus-padding", &focusPad,
+ "interior_focus", &interiorFocus,
+ "default_border", &pBorder,
(char *)NULL );
// Make sure the border values exist, otherwise use some defaults
@@ -1227,21 +1227,21 @@ static Rectangle NWGetButtonArea( int nScreen,
ControlType, ControlPart, Rectangle aAreaRect, ControlState nState,
const ImplControlValue&, const OUString& )
{
- gboolean interiorFocus;
- gint focusWidth;
- gint focusPad;
- GtkBorder aDefBorder;
- GtkBorder * pBorder;
- sal_Bool bDrawFocus = sal_True;
- Rectangle aRect;
- gint x, y, w, h;
+ gboolean interiorFocus;
+ gint focusWidth;
+ gint focusPad;
+ GtkBorder aDefBorder;
+ GtkBorder * pBorder;
+ sal_Bool bDrawFocus = sal_True;
+ Rectangle aRect;
+ gint x, y, w, h;
NWEnsureGTKButton( nScreen );
gtk_widget_style_get( gWidgetData[nScreen].gBtnWidget,
- "focus-line-width", &focusWidth,
- "focus-padding", &focusPad,
- "interior_focus", &interiorFocus,
- "default_border", &pBorder,
+ "focus-line-width", &focusWidth,
+ "focus-padding", &focusPad,
+ "interior_focus", &interiorFocus,
+ "default_border", &pBorder,
(char *)NULL );
// Make sure the border values exist, otherwise use some defaults
@@ -1284,11 +1284,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- sal_Bool isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ sal_Bool isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
gint x, y;
- GdkRectangle clipRect;
+ GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKRadio( m_nScreen );
@@ -1342,12 +1342,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON);
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON);
bool isInconsistent = (aValue.getTristateVal() == BUTTONVALUE_MIXED);
- GdkRectangle clipRect;
- gint x,y;
+ GdkRectangle clipRect;
+ gint x,y;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKCheck( m_nScreen );
@@ -1402,32 +1402,32 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
OSL_ASSERT( aValue.getType() == CTRL_SCROLLBAR );
const ScrollbarValue* pScrollbarVal = static_cast<const ScrollbarValue *>(&aValue);
GdkPixmap* pixmap = NULL;
- Rectangle pixmapRect, scrollbarRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- GtkScrollbar * scrollbarWidget;
- GtkStyle * style;
+ Rectangle pixmapRect, scrollbarRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ GtkScrollbar * scrollbarWidget;
+ GtkStyle * style;
GtkAdjustment* scrollbarValues = NULL;
- GtkOrientation scrollbarOrientation;
- Rectangle thumbRect = pScrollbarVal->maThumbRect;
- Rectangle button11BoundRect = pScrollbarVal->maButton1Rect; // backward
- Rectangle button22BoundRect = pScrollbarVal->maButton2Rect; // forward
- Rectangle button12BoundRect = pScrollbarVal->maButton1Rect; // secondary forward
- Rectangle button21BoundRect = pScrollbarVal->maButton2Rect; // secondary backward
- GtkArrowType button1Type; // backward
- GtkArrowType button2Type; // forward
- gchar * scrollbarTagH = (gchar *) "hscrollbar";
- gchar * scrollbarTagV = (gchar *) "vscrollbar";
- gchar * scrollbarTag = NULL;
- Rectangle arrowRect;
- gint slider_width = 0;
- gint stepper_size = 0;
- gint stepper_spacing = 0;
- gint trough_border = 0;
- gint min_slider_length = 0;
- gint vShim = 0;
- gint hShim = 0;
- gint x,y,w,h;
+ GtkOrientation scrollbarOrientation;
+ Rectangle thumbRect = pScrollbarVal->maThumbRect;
+ Rectangle button11BoundRect = pScrollbarVal->maButton1Rect; // backward
+ Rectangle button22BoundRect = pScrollbarVal->maButton2Rect; // forward
+ Rectangle button12BoundRect = pScrollbarVal->maButton1Rect; // secondary forward
+ Rectangle button21BoundRect = pScrollbarVal->maButton2Rect; // secondary backward
+ GtkArrowType button1Type; // backward
+ GtkArrowType button2Type; // forward
+ gchar * scrollbarTagH = (gchar *) "hscrollbar";
+ gchar * scrollbarTagV = (gchar *) "vscrollbar";
+ gchar * scrollbarTag = NULL;
+ Rectangle arrowRect;
+ gint slider_width = 0;
+ gint stepper_size = 0;
+ gint stepper_spacing = 0;
+ gint trough_border = 0;
+ gint min_slider_length = 0;
+ gint vShim = 0;
+ gint hShim = 0;
+ gint x,y,w,h;
// make controlvalue rectangles relative to area
thumbRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() );
@@ -1634,7 +1634,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if ( has_backward )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType,
gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button11BoundRect.Left(), y+vShim+button11BoundRect.Top(),
@@ -1649,7 +1649,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if ( has_forward2 )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType,
gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button12BoundRect.Left(), y+vShim+button12BoundRect.Top(),
@@ -1665,7 +1665,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if ( has_backward2 )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button21BoundRect.Left(), y+vShim+button21BoundRect.Top(),
@@ -1680,7 +1680,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if ( has_forward )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button22BoundRect.Left(), y+vShim+button22BoundRect.Top(),
@@ -1705,7 +1705,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
//---
-static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect )
+static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect )
{
gint slider_width;
gint stepper_size;
@@ -1796,7 +1796,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- Rectangle pixmapRect;
+ Rectangle pixmapRect;
GdkRectangle clipRect;
// Find the overall bounding rect of the buttons's drawing area,
@@ -1829,16 +1829,16 @@ static Rectangle NWGetEditBoxPixmapRect(int nScreen,
const ImplControlValue&,
const OUString& )
{
- Rectangle pixmapRect = aAreaRect;
- gboolean interiorFocus;
- gint focusWidth;
+ Rectangle pixmapRect = aAreaRect;
+ gboolean interiorFocus;
+ gint focusWidth;
NWEnsureGTKEditBox( nScreen );
// Grab some entry style attributes
gtk_widget_style_get( gWidgetData[nScreen].gEditBoxWidget,
- "focus-line-width", &focusWidth,
- "interior-focus", &interiorFocus, (char *)NULL );
+ "focus-line-width", &focusWidth,
+ "interior-focus", &interiorFocus, (char *)NULL );
if ( !interiorFocus )
{
@@ -1855,18 +1855,18 @@ static Rectangle NWGetEditBoxPixmapRect(int nScreen,
* All coordinates should be local to the Pixmap, NOT
* screen/window coordinates.
*/
-static void NWPaintOneEditBox( int nScreen,
+static void NWPaintOneEditBox( int nScreen,
GdkDrawable * gdkDrawable,
- GdkRectangle * gdkRect,
- ControlType nType,
+ GdkRectangle * gdkRect,
+ ControlType nType,
ControlPart,
- Rectangle aEditBoxRect,
- ControlState nState,
+ Rectangle aEditBoxRect,
+ ControlState nState,
const ImplControlValue&,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
GtkWidget *widget;
NWEnsureGTKButton( nScreen );
@@ -1929,17 +1929,17 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart
const ImplControlValue& aValue,
const OUString& rCaption )
{
- GdkPixmap * pixmap;
- Rectangle pixmapRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL;
- Rectangle upBtnRect;
- ControlPart upBtnPart = PART_BUTTON_UP;
- ControlState upBtnState = CTRL_STATE_ENABLED;
- Rectangle downBtnRect;
- ControlPart downBtnPart = PART_BUTTON_DOWN;
- ControlState downBtnState = CTRL_STATE_ENABLED;
+ GdkPixmap * pixmap;
+ Rectangle pixmapRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL;
+ Rectangle upBtnRect;
+ ControlPart upBtnPart = PART_BUTTON_UP;
+ ControlState upBtnState = CTRL_STATE_ENABLED;
+ Rectangle downBtnRect;
+ ControlPart downBtnPart = PART_BUTTON_DOWN;
+ ControlState downBtnState = CTRL_STATE_ENABLED;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKSpinButton( m_nScreen );
@@ -1994,7 +1994,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart
if ( shadowType != GTK_SHADOW_NONE )
{
- Rectangle shadowRect( upBtnRect );
+ Rectangle shadowRect( upBtnRect );
shadowRect.Union( downBtnRect );
gtk_paint_box( gWidgetData[m_nScreen].gSpinButtonWidget->style, pixmap, GTK_STATE_NORMAL, shadowType, NULL,
@@ -2020,14 +2020,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart
static Rectangle NWGetSpinButtonRect( int nScreen,
ControlType,
- ControlPart nPart,
- Rectangle aAreaRect,
+ ControlPart nPart,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
{
- gint buttonSize;
- Rectangle buttonRect;
+ gint buttonSize;
+ Rectangle buttonRect;
NWEnsureGTKSpinButton( nScreen );
@@ -2061,19 +2061,19 @@ static Rectangle NWGetSpinButtonRect( int nScreen,
//---
static void NWPaintOneSpinButton( int nScreen,
- GdkPixmap* pixmap,
- ControlType nType,
- ControlPart nPart,
- Rectangle aAreaRect,
- ControlState nState,
- const ImplControlValue& aValue,
- const OUString& rCaption )
+ GdkPixmap* pixmap,
+ ControlType nType,
+ ControlPart nPart,
+ Rectangle aAreaRect,
+ ControlState nState,
+ const ImplControlValue& aValue,
+ const OUString& rCaption )
{
- Rectangle buttonRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- Rectangle arrowRect;
- gint arrowSize;
+ Rectangle buttonRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ Rectangle arrowRect;
+ gint arrowSize;
NWEnsureGTKSpinButton( nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -2112,13 +2112,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- Rectangle pixmapRect;
- Rectangle buttonRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- Rectangle arrowRect;
- gint x,y;
- GdkRectangle clipRect;
+ Rectangle pixmapRect;
+ Rectangle buttonRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ Rectangle arrowRect;
+ gint x,y;
+ GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKArrow( m_nScreen );
@@ -2139,10 +2139,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
if( nPart == PART_BUTTON_DOWN )
buttonRect.Left() += 1;
- Rectangle aEditBoxRect( pixmapRect );
+ Rectangle aEditBoxRect( pixmapRect );
aEditBoxRect.SetSize( Size( pixmapRect.GetWidth() - buttonRect.GetWidth(), aEditBoxRect.GetHeight() ) );
- #define ARROW_EXTENT 0.7
+ #define ARROW_EXTENT 0.7
arrowRect.SetSize( Size( (gint)(MIN_ARROW_SIZE * ARROW_EXTENT),
(gint)(MIN_ARROW_SIZE * ARROW_EXTENT) ) );
arrowRect.SetPos( Point( buttonRect.Left() + (gint)((buttonRect.GetWidth() - arrowRect.GetWidth()) / 2),
@@ -2185,23 +2185,23 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
static Rectangle NWGetComboBoxButtonRect( int nScreen,
ControlType,
ControlPart nPart,
- Rectangle aAreaRect,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
{
- Rectangle aButtonRect;
- gint nArrowWidth;
+ Rectangle aButtonRect;
+ gint nArrowWidth;
gint nButtonWidth;
- gint nFocusWidth;
- gint nFocusPad;
+ gint nFocusWidth;
+ gint nFocusPad;
NWEnsureGTKArrow( nScreen );
// Grab some button style attributes
gtk_widget_style_get( gWidgetData[nScreen].gDropdownWidget,
- "focus-line-width", &nFocusWidth,
- "focus-padding", &nFocusPad, (char *)NULL );
+ "focus-line-width", &nFocusWidth,
+ "focus-padding", &nFocusPad, (char *)NULL );
nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gArrowWidget)->xpad * 2);
nButtonWidth = nArrowWidth +
@@ -2245,11 +2245,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
const OUString& )
{
OSL_ASSERT( nType != CTRL_TAB_ITEM || aValue.getType() == CTRL_TAB_ITEM );
- GdkPixmap * pixmap;
- Rectangle pixmapRect;
- Rectangle tabRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GdkPixmap * pixmap;
+ Rectangle pixmapRect;
+ Rectangle tabRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
if( ! gWidgetData[ m_nScreen ].gCacheTabItems )
{
gWidgetData[ m_nScreen ].gCacheTabItems = new NWPixmapCache( m_nScreen );
@@ -2277,7 +2277,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
pixmapRect = rControlRectangle;
if ( nType == CTRL_TAB_ITEM )
{
- const TabitemValue * pTabitemValue = static_cast<const TabitemValue *>(&aValue);
+ const TabitemValue * pTabitemValue = static_cast<const TabitemValue *>(&aValue);
if ( !pTabitemValue->isFirst() )
{
// GTK+ tabs overlap on the right edge (the top tab obscures the
@@ -2383,15 +2383,15 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- Rectangle pixmapRect;
- Rectangle widgetRect;
- Rectangle aIndicatorRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- gint bInteriorFocus;
- gint nFocusLineWidth;
- gint nFocusPadding;
- gint x,y;
+ Rectangle pixmapRect;
+ Rectangle widgetRect;
+ Rectangle aIndicatorRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ gint bInteriorFocus;
+ gint nFocusLineWidth;
+ gint nFocusPadding;
+ gint x,y;
GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
@@ -2423,9 +2423,9 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
if ( nPart != PART_WINDOW )
{
gtk_widget_style_get( gWidgetData[m_nScreen].gOptionMenuWidget,
- "interior_focus", &bInteriorFocus,
- "focus_line_width", &nFocusLineWidth,
- "focus_padding", &nFocusPadding,
+ "interior_focus", &bInteriorFocus,
+ "focus_line_width", &nFocusLineWidth,
+ "focus_padding", &nFocusPadding,
(char *)NULL);
}
@@ -2477,13 +2477,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
ControlState nState, const ImplControlValue& aValue,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- gint x, y, w, h;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ gint x, y, w, h;
gint g_x=0, g_y=0, g_w=10, g_h=10;
bool bPaintButton = true;
GtkWidget* pButtonWidget = gWidgetData[m_nScreen].gToolbarButtonWidget;
- GdkRectangle clipRect;
+ GdkRectangle clipRect;
NWEnsureGTKToolbar( m_nScreen );
if( nPart == PART_BUTTON ) // toolbar buttons cannot focus in gtk
@@ -2643,11 +2643,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
ControlState nState, const ImplControlValue&,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
GtkShadowType selected_shadow_type = GTK_SHADOW_OUT;
- gint x, y, w, h;
- GdkRectangle clipRect;
+ gint x, y, w, h;
+ GdkRectangle clipRect;
NWEnsureGTKMenubar( m_nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -2735,11 +2735,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) )
return sal_True;
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
GtkShadowType selected_shadow_type = GTK_SHADOW_OUT;
- gint x, y, w, h;
- GdkRectangle clipRect;
+ gint x, y, w, h;
+ GdkRectangle clipRect;
NWEnsureGTKMenu( m_nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -2898,8 +2898,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKTooltip(
{
NWEnsureGTKTooltip( m_nScreen );
- gint x, y, w, h;
- GdkRectangle clipRect;
+ gint x, y, w, h;
+ GdkRectangle clipRect;
x = rControlRectangle.Left();
y = rControlRectangle.Top();
@@ -2941,12 +2941,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKListNode(
aRect.Right() += 2;
aRect.Top() -= 2;
aRect.Bottom() += 2;
- gint w, h;
+ gint w, h;
w = aRect.GetWidth();
h = aRect.GetHeight();
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
ButtonValue aButtonValue = rValue.getTristateVal();
@@ -2990,7 +2990,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKProgress(
{
NWEnsureGTKProgressBar( m_nScreen );
- gint w, h;
+ gint w, h;
w = rControlRectangle.GetWidth();
h = rControlRectangle.GetHeight();
@@ -3055,7 +3055,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider(
OSL_ASSERT( rValue.getType() == CTRL_SLIDER );
NWEnsureGTKSlider( m_nScreen );
- gint w, h;
+ gint w, h;
w = rControlRectangle.GetWidth();
h = rControlRectangle.GetHeight();
@@ -3147,15 +3147,15 @@ static Rectangle NWGetListBoxButtonRect( int nScreen,
Rectangle aPartRect;
GtkRequisition *pIndicatorSize = NULL;
GtkBorder *pIndicatorSpacing = NULL;
- gint width = 13; // GTK+ default
- gint right = 5; // GTK+ default
+ gint width = 13; // GTK+ default
+ gint right = 5; // GTK+ default
gint nButtonAreaWidth = 0;
gint xthickness = 0;
NWEnsureGTKOptionMenu( nScreen );
gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget,
- "indicator_size", &pIndicatorSize,
+ "indicator_size", &pIndicatorSize,
"indicator_spacing",&pIndicatorSpacing, (char *)NULL);
if ( pIndicatorSize )
@@ -3201,7 +3201,7 @@ static Rectangle NWGetListBoxButtonRect( int nScreen,
static Rectangle NWGetListBoxIndicatorRect( int nScreen,
ControlType,
ControlPart,
- Rectangle aAreaRect,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -3209,14 +3209,14 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen,
Rectangle aIndicatorRect;
GtkRequisition *pIndicatorSize = NULL;
GtkBorder *pIndicatorSpacing = NULL;
- gint width = 13; // GTK+ default
- gint height = 13; // GTK+ default
- gint right = 5; // GTK+ default
+ gint width = 13; // GTK+ default
+ gint height = 13; // GTK+ default
+ gint right = 5; // GTK+ default
NWEnsureGTKOptionMenu( nScreen );
gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget,
- "indicator_size", &pIndicatorSize,
+ "indicator_size", &pIndicatorSize,
"indicator_spacing",&pIndicatorSpacing, (char *)NULL);
if ( pIndicatorSize )
@@ -3246,8 +3246,8 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen,
static Rectangle NWGetToolbarRect( int nScreen,
ControlType,
- ControlPart nPart,
- Rectangle aAreaRect,
+ ControlPart nPart,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -3455,10 +3455,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
// UI font
- OString aFamily = pango_font_description_get_family( pStyle->font_desc );
- int nPangoHeight = pango_font_description_get_size( pStyle->font_desc );
- PangoStyle eStyle = pango_font_description_get_style( pStyle->font_desc );
- PangoWeight eWeight = pango_font_description_get_weight( pStyle->font_desc );
+ OString aFamily = pango_font_description_get_family( pStyle->font_desc );
+ int nPangoHeight = pango_font_description_get_size( pStyle->font_desc );
+ PangoStyle eStyle = pango_font_description_get_style( pStyle->font_desc );
+ PangoWeight eWeight = pango_font_description_get_weight( pStyle->font_desc );
PangoStretch eStretch = pango_font_description_get_stretch( pStyle->font_desc );
psp::FastPrintFontInfo aInfo;
@@ -3467,9 +3467,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// set italic
switch( eStyle )
{
- case PANGO_STYLE_NORMAL: aInfo.m_eItalic = ITALIC_NONE;break;
- case PANGO_STYLE_ITALIC: aInfo.m_eItalic = ITALIC_NORMAL;break;
- case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = ITALIC_OBLIQUE;break;
+ case PANGO_STYLE_NORMAL: aInfo.m_eItalic = ITALIC_NONE;break;
+ case PANGO_STYLE_ITALIC: aInfo.m_eItalic = ITALIC_NORMAL;break;
+ case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = ITALIC_OBLIQUE;break;
}
// set weight
if( eWeight <= PANGO_WEIGHT_ULTRALIGHT )
@@ -3485,15 +3485,15 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// set width
switch( eStretch )
{
- case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;break;
- case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;break;
- case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = WIDTH_CONDENSED;break;
- case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;break;
- case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = WIDTH_NORMAL;break;
- case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;break;
- case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = WIDTH_EXPANDED;break;
- case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;break;
- case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;break;
+ case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;break;
+ case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;break;
+ case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = WIDTH_CONDENSED;break;
+ case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;break;
+ case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = WIDTH_NORMAL;break;
+ case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;break;
+ case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = WIDTH_EXPANDED;break;
+ case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;break;
+ case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;break;
}
#if OSL_DEBUG_LEVEL > 1
@@ -3602,7 +3602,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetPreferredSymbolsStyleName( OUString::createFromAscii( pIconThemeName ) );
g_free( pIconThemeName );
- aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
+ aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
const cairo_font_options_t* pNewOptions = NULL;
#if !GTK_CHECK_VERSION(2,9,0)
@@ -3656,8 +3656,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
{
// Create a new pixmap to hold the composite of the window background and the control
- GdkPixmap * pPixmap = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
- GdkGC * pPixmapGC = gdk_gc_new( pPixmap );
+ GdkPixmap * pPixmap = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
+ GdkGC * pPixmapGC = gdk_gc_new( pPixmap );
if( !pPixmap || !pPixmapGC )
{
--
1.7.4.1
--=-z0CAXJ6Y5pV2PskaCpDJ
Content-Disposition: attachment; filename="0002-Fix-some-visual-glitch-with-GTK.patch"
Content-Type: text/x-patch; name="0002-Fix-some-visual-glitch-with-GTK.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
More information about the LibreOffice
mailing list