summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk')
-rw-r--r--vcl/unx/gtk/a11y/atkaction.cxx3
-rw-r--r--vcl/unx/gtk/a11y/atkbridge.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkcomponent.cxx3
-rw-r--r--vcl/unx/gtk/a11y/atkeditabletext.cxx6
-rw-r--r--vcl/unx/gtk/a11y/atkfactory.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkfactory.hxx3
-rw-r--r--vcl/unx/gtk/a11y/atkhypertext.cxx3
-rw-r--r--vcl/unx/gtk/a11y/atkimage.cxx3
-rw-r--r--vcl/unx/gtk/a11y/atklistener.cxx9
-rw-r--r--vcl/unx/gtk/a11y/atklistener.hxx2
-rw-r--r--vcl/unx/gtk/a11y/atkregistry.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkregistry.hxx3
-rw-r--r--vcl/unx/gtk/a11y/atkselection.cxx3
-rw-r--r--vcl/unx/gtk/a11y/atktable.cxx5
-rw-r--r--vcl/unx/gtk/a11y/atktext.cxx17
-rw-r--r--vcl/unx/gtk/a11y/atktextattributes.cxx100
-rw-r--r--vcl/unx/gtk/a11y/atktextattributes.hxx6
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx78
-rw-r--r--vcl/unx/gtk/a11y/atkutil.hxx3
-rw-r--r--vcl/unx/gtk/a11y/atkvalue.cxx3
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.cxx6
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.hxx3
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx72
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.hxx3
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx43
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx51
-rw-r--r--vcl/unx/gtk/app/gtksys.cxx25
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx184
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx208
-rw-r--r--vcl/unx/gtk/window/gtkobject.cxx16
30 files changed, 375 insertions, 492 deletions
diff --git a/vcl/unx/gtk/a11y/atkaction.cxx b/vcl/unx/gtk/a11y/atkaction.cxx
index 4329dd345d14..39c51cb3b274 100644
--- a/vcl/unx/gtk/a11y/atkaction.cxx
+++ b/vcl/unx/gtk/a11y/atkaction.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -276,3 +277,5 @@ actionIfaceInit (AtkActionIface *iface)
iface->get_localized_name = action_wrapper_get_localized_name;
iface->set_description = action_wrapper_set_description;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkbridge.cxx b/vcl/unx/gtk/a11y/atkbridge.cxx
index 71c05bd16626..da667fe75326 100644
--- a/vcl/unx/gtk/a11y/atkbridge.cxx
+++ b/vcl/unx/gtk/a11y/atkbridge.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,4 @@ void DeInitAtkBridge()
restore_gail_window_vtable();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkcomponent.cxx b/vcl/unx/gtk/a11y/atkcomponent.cxx
index 24cf335ebeb0..37ef152db3c9 100644
--- a/vcl/unx/gtk/a11y/atkcomponent.cxx
+++ b/vcl/unx/gtk/a11y/atkcomponent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -380,3 +381,5 @@ componentIfaceInit (AtkComponentIface *iface)
iface->set_position = component_wrapper_set_position;
iface->set_size = component_wrapper_set_size;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkeditabletext.cxx b/vcl/unx/gtk/a11y/atkeditabletext.cxx
index c0399145b07c..a330bc66e8ce 100644
--- a/vcl/unx/gtk/a11y/atkeditabletext.cxx
+++ b/vcl/unx/gtk/a11y/atkeditabletext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,6 @@
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/TextSegment.hpp>
-// #include <functional>
-// #include <hash_map>
-
#include <stdio.h>
#include <string.h>
@@ -200,3 +198,5 @@ editableTextIfaceInit (AtkEditableTextIface *iface)
iface->paste_text = editable_text_wrapper_paste_text;
iface->set_run_attributes = editable_text_wrapper_set_run_attributes;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx
index 9588123f4032..fef6c80767e5 100644
--- a/vcl/unx/gtk/a11y/atkfactory.cxx
+++ b/vcl/unx/gtk/a11y/atkfactory.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -181,3 +182,4 @@ wrapper_factory_get_type (void)
} // extern C
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkfactory.hxx b/vcl/unx/gtk/a11y/atkfactory.hxx
index 82be08cfad1b..acb7b026f3a8 100644
--- a/vcl/unx/gtk/a11y/atkfactory.hxx
+++ b/vcl/unx/gtk/a11y/atkfactory.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,5 @@ GType wrapper_factory_get_type (void);
} // extern "C"
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkhypertext.cxx b/vcl/unx/gtk/a11y/atkhypertext.cxx
index 90d735890655..b2c7aca857f4 100644
--- a/vcl/unx/gtk/a11y/atkhypertext.cxx
+++ b/vcl/unx/gtk/a11y/atkhypertext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -289,3 +290,5 @@ hypertextIfaceInit (AtkHypertextIface *iface)
iface->get_n_links = hypertext_get_n_links;
iface->get_link_index = hypertext_get_link_index;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkimage.cxx b/vcl/unx/gtk/a11y/atkimage.cxx
index b48c59555a29..04263fd72906 100644
--- a/vcl/unx/gtk/a11y/atkimage.cxx
+++ b/vcl/unx/gtk/a11y/atkimage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -136,3 +137,5 @@ imageIfaceInit (AtkImageIface *iface)
iface->get_image_position = image_get_image_position;
iface->get_image_size = image_get_image_size;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx
index e02478ac8ad8..3adca0f55279 100644
--- a/vcl/unx/gtk/a11y/atklistener.cxx
+++ b/vcl/unx/gtk/a11y/atklistener.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
#include <com/sun/star/accessibility/TextSegment.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -535,3 +542,5 @@ void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEven
break;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atklistener.hxx b/vcl/unx/gtk/a11y/atklistener.hxx
index d2889caa3e24..dbac3599cd4b 100644
--- a/vcl/unx/gtk/a11y/atklistener.hxx
+++ b/vcl/unx/gtk/a11y/atklistener.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ private:
#endif /* _ATK_LISTENER_HXX_ */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkregistry.cxx b/vcl/unx/gtk/a11y/atkregistry.cxx
index 81ec22dc4ce1..396683e5fd8c 100644
--- a/vcl/unx/gtk/a11y/atkregistry.cxx
+++ b/vcl/unx/gtk/a11y/atkregistry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,4 @@ ooo_wrapper_registry_remove(XAccessible *pAccessible)
g_hash_table_remove( uno_to_gobject, (gpointer) pAccessible );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkregistry.hxx b/vcl/unx/gtk/a11y/atkregistry.hxx
index f4de3b2e4c1e..b3a59b6db8d0 100644
--- a/vcl/unx/gtk/a11y/atkregistry.hxx
+++ b/vcl/unx/gtk/a11y/atkregistry.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,3 +39,5 @@ void ooo_wrapper_registry_add(const ::com::sun::star::uno::Reference< ::com::sun
void ooo_wrapper_registry_remove(::com::sun::star::accessibility::XAccessible *pAccessible);
#endif // __ATK_REGISTRY_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkselection.cxx b/vcl/unx/gtk/a11y/atkselection.cxx
index 172faac4c704..127730f0a458 100644
--- a/vcl/unx/gtk/a11y/atkselection.cxx
+++ b/vcl/unx/gtk/a11y/atkselection.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -193,3 +194,5 @@ selectionIfaceInit( AtkSelectionIface *iface)
iface->remove_selection = selection_remove_selection;
iface->select_all_selection = selection_select_all_selection;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atktable.cxx b/vcl/unx/gtk/a11y/atktable.cxx
index 78571ff11c34..dec06cd7005b 100644
--- a/vcl/unx/gtk/a11y/atktable.cxx
+++ b/vcl/unx/gtk/a11y/atktable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -446,8 +447,6 @@ table_wrapper_get_summary( AtkTable *table )
if( pTable )
{
- // FIXME: Summary ??
-// AtkObject* summary;
return atk_object_wrapper_conditional_ref( pTable->getAccessibleSummary() );
}
}
@@ -719,3 +718,5 @@ tableIfaceInit (AtkTableIface *iface)
iface->get_column_description = table_wrapper_get_column_description;
iface->set_column_description = table_wrapper_set_column_description;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx
index e6d3276891de..1b21fa66837c 100644
--- a/vcl/unx/gtk/a11y/atktext.cxx
+++ b/vcl/unx/gtk/a11y/atktext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -454,7 +455,7 @@ text_wrapper_set_caret_offset (AtkText *text,
return FALSE;
}
-// --> OD 2010-03-04 #i92232#
+// #i92232#
AtkAttributeSet*
handle_text_markup_as_run_attribute( accessibility::XAccessibleTextMarkup* pTextMarkup,
const gint nTextMarkupType,
@@ -530,7 +531,6 @@ handle_text_markup_as_run_attribute( accessibility::XAccessibleTextMarkup* pText
return pSet;
}
-// <--
static AtkAttributeSet *
text_wrapper_get_run_attributes( AtkText *text,
@@ -551,26 +551,22 @@ text_wrapper_get_run_attributes( AtkText *text,
pTextAttributes->getRunAttributes( offset, uno::Sequence< rtl::OUString > () );
pSet = attribute_set_new_from_property_values( aAttributeList, true, text );
- // --> OD 2009-06-22 #i100938#
+ // #i100938#
// - always provide start_offset and end_offset
-// if( pSet )
- // <--
{
accessibility::TextSegment aTextSegment =
pText->getTextAtIndex(offset, accessibility::AccessibleTextType::ATTRIBUTE_RUN);
*start_offset = aTextSegment.SegmentStart;
- // --> OD 2009-06-22 #i100938#
+ // #i100938#
// Do _not_ increment the end_offset provide by <accessibility::TextSegment> instance
-// *end_offset = aTextSegment.SegmentEnd + 1; // FIXME: TESTME
*end_offset = aTextSegment.SegmentEnd;
- // <--
bOffsetsAreValid = true;
}
}
// Special handling for misspelled text
- // --> OD 2010-03-01 #i92232#
+ // #i92232#
// - add special handling for tracked changes and refactor the
// corresponding code for handling misspelled text.
accessibility::XAccessibleTextMarkup* pTextMarkup = getTextMarkup( text );
@@ -603,7 +599,6 @@ text_wrapper_get_run_attributes( AtkText *text,
com::sun::star::text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE,
offset, pSet, start_offset, end_offset );
}
- // <--
}
catch(const uno::Exception& e){
@@ -874,3 +869,5 @@ textIfaceInit (AtkTextIface *iface)
iface->get_character_extents = text_wrapper_get_character_extents;
iface->get_offset_at_point = text_wrapper_get_offset_at_point;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx
index 04498810597f..bcf880160224 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.cxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,12 +75,10 @@ static AtkTextAttribute atk_text_attribute_tab_stops = ATK_TEXT_ATTR_INVALID;
static AtkTextAttribute atk_text_attribute_writing_mode = ATK_TEXT_ATTR_INVALID;
static AtkTextAttribute atk_text_attribute_vertical_align = ATK_TEXT_ATTR_INVALID;
static AtkTextAttribute atk_text_attribute_misspelled = ATK_TEXT_ATTR_INVALID;
-// --> OD 2010-03-01 #i92232#
+// #i92232#
static AtkTextAttribute atk_text_attribute_tracked_change = ATK_TEXT_ATTR_INVALID;
-// <--
-// --> OD 2010-03-05 #i92233#
+// #i92233#
static AtkTextAttribute atk_text_attribute_mm_to_pixel_ratio = ATK_TEXT_ATTR_INVALID;
-// <--
/*****************************************************************************/
@@ -109,9 +108,8 @@ enum ExportedAttribute
TEXT_ATTRIBUTE_STRIKETHROUGH,
TEXT_ATTRIBUTE_UNDERLINE,
TEXT_ATTRIBUTE_WEIGHT,
- // --> OD 2010-03-05 #i92233#
+ // #i92233#
TEXT_ATTRIBUTE_MM_TO_PIXEL_RATIO,
- // <--
TEXT_ATTRIBUTE_JUSTIFICATION,
TEXT_ATTRIBUTE_BOTTOM_MARGIN,
TEXT_ATTRIBUTE_FIRST_LINE_INDENT,
@@ -176,7 +174,6 @@ get_value( const uno::Sequence< beans::PropertyValue >& rAttributeList,
#define get_bool_value( list, index ) get_value( list, index, Bool2String )
#define get_short_value( list, index ) get_value( list, index, Short2String )
-//#define get_long_value( list, index ) get_value( list, index, Long2String ) pb: not used (warning on linux)
#define get_height_value( list, index ) get_value( list, index, Float2String )
#define get_justification_value( list, index ) get_value( list, index, Adjust2Justification )
#define get_cmm_value( list, index ) get_value( list, index, CMM2UnitString )
@@ -189,36 +186,6 @@ get_value( const uno::Sequence< beans::PropertyValue >& rAttributeList,
#define get_weight_value( list, index ) get_value( list, index, Weight2String )
#define get_language_string( list, index ) get_value( list, index, Locale2String )
-/*
-static gchar*
-dump_value( const uno::Sequence< beans::PropertyValue >& rAttributeList, sal_Int32 nIndex )
-{
- if( nIndex != -1 )
- {
- rtl::OString aName = rtl::OUStringToOString(rAttributeList[nIndex].Name, RTL_TEXTENCODING_UTF8);
-
- if( rAttributeList[nIndex].Value.has<sal_Int16> () )
- OSL_TRACE( "%s = %d (short value)", aName.getStr(),
- rAttributeList[nIndex].Value.get<sal_Int16> () );
-
- else if( rAttributeList[nIndex].Value.has<sal_Int8> () )
- OSL_TRACE( "%s = %d (byte value)", aName.getStr(),
- rAttributeList[nIndex].Value.get<sal_Int8> () );
-
- else if( rAttributeList[nIndex].Value.has<sal_Bool> () )
- OSL_TRACE( "%s = %s (bool value)", aName.getStr(),
- rAttributeList[nIndex].Value.get<sal_Bool> () ? "true" : "false" );
-
- else if( rAttributeList[nIndex].Value.has<rtl::OUString> () )
- OSL_TRACE( "%s = %s", aName.getStr(),
- rtl::OUStringToOString(rAttributeList[nIndex].Value.get<rtl::OUString> (),
- RTL_TEXTENCODING_UTF8).getStr() );
- }
-
- return NULL;
-}
-*/
-
static inline
double toPoint(sal_Int16 n)
{
@@ -229,14 +196,6 @@ double toPoint(sal_Int16 n)
/*****************************************************************************/
-/*
-static gchar*
-NullString(const uno::Any&)
-{
- return NULL;
-}
-*/
-
static bool
InvalidValue( uno::Any&, const gchar * )
{
@@ -265,48 +224,6 @@ String2Float( uno::Any& rAny, const gchar * value )
/*****************************************************************************/
-/*
-static gchar*
-Short2String(const uno::Any& rAny)
-{
- return g_strdup_printf( "%d", rAny.get<sal_Int16>() );
-}
-
-static bool
-String2Short( uno::Any& rAny, const gchar * value )
-{
- sal_Int32 lval;
-
- if( 1 != sscanf( value, "%d", &lval ) )
- return false;
-
- rAny = uno::makeAny( (sal_Int16) lval );
- return true;
-}
-*/
-
-/*****************************************************************************/
-/* pb: not used (warning on linux)
-static gchar*
-Long2String(const uno::Any& rAny)
-{
- return g_strdup_printf( "%ld", rAny.get<sal_Int32>() );
-}
-
-static bool
-String2Long( uno::Any& rAny, const gchar * value )
-{
- sal_Int32 lval;
-
- if( 1 != sscanf( value, "%ld", &lval ) )
- return false;
-
- rAny = uno::makeAny( lval );
- return true;
-}
-*/
-/*****************************************************************************/
-
static accessibility::XAccessibleComponent*
getComponent( AtkText *pText ) throw (uno::RuntimeException)
{
@@ -1092,7 +1009,7 @@ TabStopList2String( const uno::Any& rAny, bool default_tabs )
if( ret )
{
gchar * old_tab_str = ret;
- ret = g_strconcat(old_tab_str, " ", tab_str, NULL /* terminated */);
+ ret = g_strconcat(old_tab_str, " ", tab_str, (const char*)NULL);
g_free( old_tab_str );
}
else
@@ -1305,13 +1222,12 @@ attribute_set_new_from_property_values(
attribute_set = attribute_set_prepend(attribute_set, atk_text_attribute_tab_stops,
get_value(rAttributeList, aIndexList[TEXT_ATTRIBUTE_TAB_STOPS], TabStops2String));
- // --> OD 2010-03-05 #i92233#
+ // #i92233#
if( ATK_TEXT_ATTR_INVALID == atk_text_attribute_mm_to_pixel_ratio )
atk_text_attribute_mm_to_pixel_ratio = atk_text_attribute_register("mm-to-pixel-ratio");
attribute_set = attribute_set_prepend( attribute_set, atk_text_attribute_mm_to_pixel_ratio,
get_value(rAttributeList, aIndexList[TEXT_ATTRIBUTE_MM_TO_PIXEL_RATIO], Float2String));
- // <--
return attribute_set;
}
@@ -1328,7 +1244,7 @@ AtkAttributeSet* attribute_set_prepend_misspelled( AtkAttributeSet* attribute_se
return attribute_set;
}
-// --> OD 2010-03-01 #i92232#
+// #i92232#
AtkAttributeSet* attribute_set_prepend_tracked_change_insertion( AtkAttributeSet* attribute_set )
{
if ( ATK_TEXT_ATTR_INVALID == atk_text_attribute_tracked_change )
@@ -1370,7 +1286,6 @@ AtkAttributeSet* attribute_set_prepend_tracked_change_formatchange( AtkAttribute
return attribute_set;
}
-// <--
/*****************************************************************************/
@@ -1454,3 +1369,4 @@ attribute_set_map_to_property_values(
return true;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atktextattributes.hxx b/vcl/unx/gtk/a11y/atktextattributes.hxx
index 9c7628bf927e..1366fb861955 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.hxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,10 +46,11 @@ attribute_set_map_to_property_values(
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rValueList );
AtkAttributeSet* attribute_set_prepend_misspelled( AtkAttributeSet* attribute_set );
-// --> OD 2010-03-01 #i92232#
+// #i92232#
AtkAttributeSet* attribute_set_prepend_tracked_change_insertion( AtkAttributeSet* attribute_set );
AtkAttributeSet* attribute_set_prepend_tracked_change_deletion( AtkAttributeSet* attribute_set );
AtkAttributeSet* attribute_set_prepend_tracked_change_formatchange( AtkAttributeSet* attribute_set );
-// <--
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index d3c1afdd2efe..f7e849e44e87 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,16 +29,21 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-// --> OD 2009-04-14 #i93269#
#include <com/sun/star/accessibility/XAccessibleText.hpp>
// <--
#include <cppuhelper/implbase1.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
#include <vcl/svapp.hxx>
@@ -70,7 +76,7 @@ extern "C" {
static gint
atk_wrapper_focus_idle_handler (gpointer data)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
focus_notify_handler = 0;
@@ -85,7 +91,7 @@ atk_wrapper_focus_idle_handler (gpointer data)
fprintf(stderr, "notifying focus event for %p\n", atk_obj);
#endif
atk_focus_tracker_notify(atk_obj);
- // --> OD 2009-04-14 #i93269#
+ // #i93269#
// emit text_caret_moved event for <XAccessibleText> object,
// if cursor is inside the <XAccessibleText> object.
// also emit state-changed:focused event under the same condition.
@@ -112,7 +118,6 @@ atk_wrapper_focus_idle_handler (gpointer data)
}
}
}
- // <--
g_object_unref(atk_obj);
}
}
@@ -189,16 +194,12 @@ public:
void DocumentFocusListener::disposing( const lang::EventObject& aEvent )
throw (uno::RuntimeException)
{
-// fprintf(stderr, "In DocumentFocusListener::disposing (%p)\n", this);
-// fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
// Unref the object here, but do not remove as listener since the object
// might no longer be in a state that safely allows this.
if( aEvent.Source.is() )
m_aRefList.erase(aEvent.Source);
-// fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
-
}
/*****************************************************************************/
@@ -235,12 +236,6 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj
break;
case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
-/* {
- uno::Reference< accessibility::XAccessible > xAccessible( getAccessible(aEvent) );
- detachRecursive(xAccessible);
- attachRecursive(xAccessible);
- }
-*/
g_warning( "Invalidate all children called\n" );
break;
default:
@@ -497,27 +492,6 @@ static void handle_toolbox_buttonchange(VclWindowEvent const *pEvent)
}
}
-/*****************************************************************************/
-
-/* currently not needed anymore...
-static void create_wrapper_for_children(Window *pWindow)
-{
- if( pWindow && pWindow->IsReallyVisible() )
- {
- uno::Reference< accessibility::XAccessible > xAccessible(pWindow->GetAccessible());
- if( xAccessible.is() )
- {
- uno::Reference< accessibility::XAccessibleContext > xContext(xAccessible->getAccessibleContext());
- if( xContext.is() )
- {
- sal_Int32 nChildren = xContext->getAccessibleChildCount();
- for( sal_Int32 i = 0; i < nChildren; ++i )
- create_wrapper_for_child(xContext, i);
- }
- }
- }
-}
-*/
/*****************************************************************************/
@@ -623,46 +597,30 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
{
+ try {
switch (pEvent->GetId())
{
case VCLEVENT_WINDOW_SHOW:
-// fprintf(stderr, "got VCLEVENT_WINDOW_SHOW for %p\n",
-// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_HIDE:
-// fprintf(stderr, "got VCLEVENT_WINDOW_HIDE for %p\n",
-// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_CLOSE:
-// fprintf(stderr, "got VCLEVENT_WINDOW_CLOSE for %p\n",
-// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_GETFOCUS:
handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent));
break;
case VCLEVENT_WINDOW_LOSEFOCUS:
-// fprintf(stderr, "got VCLEVENT_WINDOW_LOSEFOCUS for %p\n",
-// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_MINIMIZE:
-// fprintf(stderr, "got VCLEVENT_WINDOW_MINIMIZE for %p\n",
-// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_NORMALIZE:
-// fprintf(stderr, "got VCLEVENT_WINDOW_NORMALIZE for %p\n",
-// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_KEYINPUT:
case VCLEVENT_WINDOW_KEYUP:
case VCLEVENT_WINDOW_COMMAND:
case VCLEVENT_WINDOW_MOUSEMOVE:
break;
- /*
- fprintf(stderr, "got VCLEVENT_WINDOW_COMMAND (%d) for %p\n",
- static_cast< ::CommandEvent const * > (
- static_cast< ::VclWindowEvent const * >(pEvent)->GetData())->GetCommand(),
- static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
- */
+
case VCLEVENT_MENU_HIGHLIGHT:
if (const VclMenuEvent* pMenuEvent = dynamic_cast<const VclMenuEvent*>(pEvent))
{
@@ -696,7 +654,7 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
break;
case VCLEVENT_COMBOBOX_SETTEXT:
- // MT 2010/02: This looks quite strange to me. Stumbled over this when fixing #i104290#.
+ // This looks quite strange to me. Stumbled over this when fixing #i104290#.
// This kicked in when leaving the combobox in the toolbar, after that the events worked.
// I guess this was a try to work around missing combobox events, which didn't do the full job, and shouldn't be necessary anymore.
// Fix for #i104290# was done in toolkit/source/awt/vclxaccessiblecomponent, FOCUSED state for compound controls in general.
@@ -704,9 +662,12 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
break;
default:
-// OSL_TRACE("got event %d \n", pEvent->GetId());
break;
}
+ } catch(lang::IndexOutOfBoundsException e)
+ {
+ g_warning("Focused object has invalid index in parent");
+ }
return 0;
}
@@ -780,13 +741,13 @@ ooo_atk_util_get_type (void)
static const GTypeInfo typeInfo =
{
- type_query.class_size,
+ static_cast<guint16>(type_query.class_size),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) ooo_atk_util_class_init,
(GClassFinalizeFunc) NULL,
NULL,
- type_query.instance_size,
+ static_cast<guint16>(type_query.instance_size),
0,
(GInstanceInitFunc) NULL,
NULL
@@ -799,3 +760,4 @@ ooo_atk_util_get_type (void)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkutil.hxx b/vcl/unx/gtk/a11y/atkutil.hxx
index 8c8ddf59c65f..c996b955d8c1 100644
--- a/vcl/unx/gtk/a11y/atkutil.hxx
+++ b/vcl/unx/gtk/a11y/atkutil.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,3 +36,5 @@
GType ooo_atk_util_get_type (void);
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkvalue.cxx b/vcl/unx/gtk/a11y/atkvalue.cxx
index 9b8e9743eb18..19e92cb9d3b1 100644
--- a/vcl/unx/gtk/a11y/atkvalue.cxx
+++ b/vcl/unx/gtk/a11y/atkvalue.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -145,3 +146,5 @@ valueIfaceInit (AtkValueIface *iface)
iface->get_minimum_value = value_wrapper_get_minimum_value;
iface->set_current_value = value_wrapper_set_current_value;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index b1e4bde84756..2cedf59eaea2 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -295,13 +296,13 @@ ooo_window_wrapper_get_type (void)
static const GTypeInfo typeInfo =
{
- type_query.class_size,
+ static_cast<guint16>(type_query.class_size),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) ooo_window_wrapper_class_init,
(GClassFinalizeFunc) NULL,
NULL,
- type_query.instance_size,
+ static_cast<guint16>(type_query.instance_size),
0,
(GInstanceInitFunc) NULL,
NULL
@@ -329,3 +330,4 @@ void restore_gail_window_vtable (void)
atk_class->initialize = window_real_initialize;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkwindow.hxx b/vcl/unx/gtk/a11y/atkwindow.hxx
index 6a9862256999..d0bfe41e1601 100644
--- a/vcl/unx/gtk/a11y/atkwindow.hxx
+++ b/vcl/unx/gtk/a11y/atkwindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,3 +37,5 @@ GType ooo_window_wrapper_get_type (void);
void restore_gail_window_vtable (void);
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index 10f75309708d..f4e0badab1f4 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -127,12 +128,7 @@ static AtkRelationType mapRelationType( sal_Int16 nRelation )
default:
break;
}
-#if 0
- ATK_RELATION_NODE_CHILD_OF,
- ATK_RELATION_EMBEDS,
- ATK_RELATION_EMBEDDED_BY,
- ATK_RELATION_POPUP_FOR,
-#endif
+
return type;
}
@@ -401,7 +397,7 @@ wrapper_get_n_children( AtkObject *atk_obj )
n = obj->mpContext->getAccessibleChildCount();
}
catch(const uno::Exception& e) {
- OSL_ENSURE(0, "Exception in getAccessibleChildCount()" );
+ OSL_FAIL("Exception in getAccessibleChildCount()" );
}
}
@@ -433,7 +429,7 @@ wrapper_ref_child( AtkObject *atk_obj,
child = atk_object_wrapper_ref( xAccessible );
}
catch(const uno::Exception& e) {
- OSL_ENSURE(0, "Exception in getAccessibleChild");
+ OSL_FAIL("Exception in getAccessibleChild");
}
}
@@ -512,62 +508,6 @@ wrapper_ref_relation_set( AtkObject *atk_obj )
return pSet;
}
-/*****************************************************************************/
-
-#if 0
-struct {
- sal_Int16 value;
- const sal_Char* name;
-} aStateTypeTable[] = {
- { accessibility::AccessibleStateType::INVALID, "INVALID" },
- { accessibility::AccessibleStateType::ACTIVE, "ACTIVE" },
- { accessibility::AccessibleStateType::ARMED, "ARMED" },
- { accessibility::AccessibleStateType::BUSY, "BUSY" },
- { accessibility::AccessibleStateType::CHECKED, "CHECKED" },
- { accessibility::AccessibleStateType::DEFUNC, "DEFUNC" },
- { accessibility::AccessibleStateType::EDITABLE, "EDITABLE" },
- { accessibility::AccessibleStateType::ENABLED, "ENABLED" },
- { accessibility::AccessibleStateType::EXPANDABLE, "EXPANDABLE" },
- { accessibility::AccessibleStateType::EXPANDED, "EXPANDED" },
- { accessibility::AccessibleStateType::FOCUSABLE, "FOCUSABLE" },
- { accessibility::AccessibleStateType::FOCUSED, "FOCUSED" },
- { accessibility::AccessibleStateType::HORIZONTAL, "HORIZONTAL" },
- { accessibility::AccessibleStateType::ICONIFIED, "ICONIFIED" },
- { accessibility::AccessibleStateType::INDETERMINATE, "INDETERMINATE" },
- { accessibility::AccessibleStateType::MANAGES_DESCENDANTS, "MANAGES_DESCENDANTS" },
- { accessibility::AccessibleStateType::MODAL, "MODAL" },
- { accessibility::AccessibleStateType::MULTI_LINE, "MULTI_LINE" },
- { accessibility::AccessibleStateType::MULTI_SELECTABLE, "MULTI_SELECTABLE" },
- { accessibility::AccessibleStateType::OPAQUE, "OPAQUE" },
- { accessibility::AccessibleStateType::PRESSED, "PRESSED" },
- { accessibility::AccessibleStateType::RESIZABLE, "RESIZABLE" },
- { accessibility::AccessibleStateType::SELECTABLE, "SELECTABLE" },
- { accessibility::AccessibleStateType::SELECTED, "SELECTED" },
- { accessibility::AccessibleStateType::SENSITIVE, "SENSITIVE" },
- { accessibility::AccessibleStateType::SHOWING, "SHOWING" },
- { accessibility::AccessibleStateType::SINGLE_LINE, "SINGLE_LINE" },
- { accessibility::AccessibleStateType::STALE, "STALE" },
- { accessibility::AccessibleStateType::TRANSIENT, "TRANSIENT" },
- { accessibility::AccessibleStateType::VERTICAL, "VERTICAL" },
- { accessibility::AccessibleStateType::VISIBLE, "VISIBLE" }
-};
-
-static void printStates(const uno::Sequence<sal_Int16>& rStates)
-{
- sal_Int32 n = rStates.getLength();
- size_t nTypes = sizeof(aStateTypeTable)/sizeof(aStateTypeTable[0]);
- for (sal_Int32 i = 0; i < n; ++i)
- {
- for (size_t j = 0; j < nTypes; ++j)
- {
- if (aStateTypeTable[j].value == rStates[i])
- printf("%s ", aStateTypeTable[j].name);
- }
- }
- printf("\n");
-}
-#endif
-
static AtkStateSet *
wrapper_ref_state_set( AtkObject *atk_obj )
{
@@ -784,8 +724,6 @@ ensureTypeFor( uno::XInterface *pAccessible )
aTypeName += aTypeTable[i].name;
bTypes[i] = TRUE;
}
-// g_message( "Accessible %p has type '%s' (%d)",
-// pAccessible, aTypeTable[i].name, bTypes[i] );
}
GType nType = g_type_from_name( aTypeName );
@@ -951,3 +889,5 @@ void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper)
RELEASE( wrapper->mpTextAttributes )
RELEASE( wrapper->mpValue )
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/a11y/atkwrapper.hxx b/vcl/unx/gtk/a11y/atkwrapper.hxx
index 4252c0404833..94a8b1981688 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.hxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -123,3 +124,5 @@ OUStringToGChar(const rtl::OUString& rString )
#define OUStringToConstGChar( string ) rtl::OUStringToOString( string, RTL_TEXTENCODING_UTF8 ).getStr()
#endif /* __ATK_WRAPPER_HXX__ */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index ffa61bc52c10..ab172a5ef3ef 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@
#include <limits.h>
#include <errno.h>
#include <poll.h>
-#ifdef FREEBSD
+#if defined(FREEBSD) || defined(NETBSD)
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
@@ -53,6 +54,7 @@
#include <osl/thread.h>
#include <osl/process.h>
+#include <osl/conditn.h>
#include <tools/debug.hxx>
#include "unx/i18n_im.hxx"
#include "unx/i18n_xkb.hxx"
@@ -62,9 +64,10 @@
#include <vcl/svapp.hxx>
-using namespace rtl;
using namespace vcl_sal;
+using ::rtl::OUString;
+
/***************************************************************************
* class GtkDisplay *
***************************************************************************/
@@ -114,7 +117,7 @@ GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event,
void signalKeysChanged( GdkKeymap*, gpointer data )
{
GtkSalDisplay* pDisp = (GtkSalDisplay*)data;
- pDisp->GetKeyboardName(TRUE);
+ pDisp->GetKeyboardName(true);
}
void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data )
@@ -201,7 +204,7 @@ void GtkSalDisplay::screenSizeChanged( GdkScreen* pScreen )
}
else
{
- DBG_ERROR( "unknown screen changed size" );
+ OSL_FAIL( "unknown screen changed size" );
}
}
}
@@ -222,7 +225,7 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
{
GdkRectangle dest;
gdk_screen_get_monitor_geometry(pScreen, i, &dest);
- m_aXineramaScreenIndexMap[i] = addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
+ addXineramaScreenUnique( i, dest.x, dest.y, dest.width, dest.height );
}
m_bXinerama = m_aXineramaScreens.size() > 1;
if( ! m_aFrames.empty() )
@@ -230,7 +233,7 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
}
else
{
- DBG_ERROR( "monitors for non-default screen changed, extend-me" );
+ OSL_FAIL( "monitors for non-default screen changed, extend-me" );
}
}
}
@@ -252,6 +255,17 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const
(screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
if (sym_gdk_screen_get_primary_monitor)
n = sym_gdk_screen_get_primary_monitor( pScreen );
+#if GTK_CHECK_VERSION(2,14,0)
+ //gdk_screen_get_primary_monitor unavailable, take the first laptop monitor
+ //as the default
+ gint nMonitors = gdk_screen_get_n_monitors(pScreen);
+ for (gint i = 0; i < nMonitors; ++i)
+ {
+ if (g_ascii_strncasecmp (gdk_screen_get_monitor_plug_name(pScreen, i), "LVDS", 4) == 0)
+ return m_aXineramaScreenIndexMap[i];
+ }
+#endif
+ return 0;
#endif
if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() )
n = m_aXineramaScreenIndexMap[n];
@@ -307,17 +321,17 @@ long GtkSalDisplay::Dispatch( XEvent* pEvent )
return GDK_FILTER_CONTINUE;
}
-GdkCursor* GtkSalDisplay::getFromXPM( const char *pBitmap,
- const char *pMask,
+GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap,
+ const unsigned char *pMask,
int nWidth, int nHeight,
int nXHot, int nYHot )
{
GdkScreen *pScreen = gdk_display_get_default_screen( m_pGdkDisplay );
GdkDrawable *pDrawable = GDK_DRAWABLE( gdk_screen_get_root_window (pScreen) );
GdkBitmap *pBitmapPix = gdk_bitmap_create_from_data
- ( pDrawable, pBitmap, nWidth, nHeight );
+ ( pDrawable, reinterpret_cast<const char*>(pBitmap), nWidth, nHeight );
GdkBitmap *pMaskPix = gdk_bitmap_create_from_data
- ( pDrawable, pMask, nWidth, nHeight );
+ ( pDrawable, reinterpret_cast<const char*>(pMask), nWidth, nHeight );
GdkColormap *pColormap = gdk_drawable_get_colormap( pDrawable );
GdkColor aWhite = { 0, 0xffff, 0xffff, 0xffff };
@@ -382,7 +396,7 @@ GdkCursor *GtkSalDisplay::getCursor( PointerStyle ePointerStyle )
MAP_BUILTIN( POINTER_HSIZEBAR, GDK_SB_H_DOUBLE_ARROW );
MAP_BUILTIN( POINTER_VSIZEBAR, GDK_SB_V_DOUBLE_ARROW );
- MAP_BUILTIN( POINTER_REFHAND, GDK_HAND1 );
+ MAP_BUILTIN( POINTER_REFHAND, GDK_HAND2 );
MAP_BUILTIN( POINTER_HAND, GDK_HAND2 );
MAP_BUILTIN( POINTER_PEN, GDK_PENCIL );
@@ -554,6 +568,7 @@ GtkXLib::~GtkXLib()
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "GtkXLib::~GtkXLib()\n" );
#endif
+ Yield( true, true );
StopTimer();
// sanity check: at this point nobody should be yielding, but wake them
// up anyway before the condition they're waiting on gets destroyed.
@@ -599,7 +614,7 @@ void GtkXLib::Init()
osl_getCommandArg(i, &aParam.pData );
OString aBParam( OUStringToOString( aParam, aEnc ) );
- if( aParam.equalsAscii( "-display" ) || aParam.equalsAscii( "--display" ) )
+ if( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-display" ) ) || aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--display" ) ) )
{
pCmdLineAry[i+1] = g_strdup( "--display" );
osl_getCommandArg(i+1, &aParam.pData );
@@ -677,7 +692,7 @@ void GtkXLib::Init()
SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp );
XSync( pDisp, False );
- pKbdExtension->UseExtension( ! HasXErrorOccured() );
+ pKbdExtension->UseExtension( ! HasXErrorOccurred() );
PopXErrorLevel();
m_pGtkSalDisplay->SetKbdExtension( pKbdExtension );
@@ -1019,3 +1034,5 @@ void GtkData::Init()
pXLib_ = new GtkXLib();
pXLib_->Init();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 888e2ed883b9..95547f20d933 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,7 +78,7 @@ void GtkHookedYieldMutex::ThreadsLeave()
#if OSL_DEBUG_LEVEL > 1
if( mnThreadId &&
- mnThreadId != vos::OThread::getCurrentIdentifier())
+ mnThreadId != osl::Thread::getCurrentIdentifier())
fprintf( stderr, "\n\n--- A different thread owns the mutex ...---\n\n\n");
#endif
@@ -225,7 +226,7 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
{
//Non-utf8 locales are a bad idea if trying to work with non-ascii filenames
//Decode %XX components
- rtl::OUString sDecodedUri = Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
+ rtl::OUString sDecodedUri = rtl::Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
//Convert back to system locale encoding
rtl::OString sSystemUrl = rtl::OUStringToOString(sDecodedUri, aSystemEnc);
//Encode to an escaped ASCII-encoded URI
@@ -256,32 +257,32 @@ GtkYieldMutex::GtkYieldMutex()
void GtkYieldMutex::acquire()
{
- vos::OThread::TThreadIdentifier aCurrentThread = vos::OThread::getCurrentIdentifier();
+ oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
- OMutex::acquire();
+ SolarMutexObject::acquire();
if( mnCount > 0 && mnThreadId == aCurrentThread )
{
mnCount++;
- OMutex::release();
+ SolarMutexObject::release();
return;
}
- OMutex::release();
+ SolarMutexObject::release();
// obtain gdk mutex
gdk_threads_enter();
// obtained gdk mutex, now lock count is one by definition
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnCount = 1;
mnThreadId = aCurrentThread;
- OMutex::release();
+ SolarMutexObject::release();
}
void GtkYieldMutex::release()
{
- vos::OThread::TThreadIdentifier aCurrentThread = vos::OThread::getCurrentIdentifier();
+ oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
- OMutex::acquire();
+ SolarMutexObject::acquire();
// strange things happen, do nothing if we don't own the mutex
if( mnThreadId == aCurrentThread )
{
@@ -292,29 +293,29 @@ void GtkYieldMutex::release()
mnThreadId = 0;
}
}
- OMutex::release();
+ SolarMutexObject::release();
}
sal_Bool GtkYieldMutex::tryToAcquire()
{
- vos::OThread::TThreadIdentifier aCurrentThread = vos::OThread::getCurrentIdentifier();
+ oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
- OMutex::acquire();
+ SolarMutexObject::acquire();
if( mnCount > 0 )
{
if( mnThreadId == aCurrentThread )
{
mnCount++;
- OMutex::release();
+ SolarMutexObject::release();
return sal_True;
}
else
{
- OMutex::release();
+ SolarMutexObject::release();
return sal_False;
}
}
- OMutex::release();
+ SolarMutexObject::release();
// HACK: gdk_threads_mutex is private, we shouldn't use it.
// how to we do a try_lock without having a gdk_threads_try_enter ?
@@ -322,10 +323,10 @@ sal_Bool GtkYieldMutex::tryToAcquire()
return sal_False;
// obtained gdk mutex, now lock count is one by definition
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnCount = 1;
mnThreadId = aCurrentThread;
- OMutex::release();
+ SolarMutexObject::release();
return sal_True;
}
@@ -338,19 +339,19 @@ int GtkYieldMutex::Grab()
// is now locked again by gtk implicitly
// obtained gdk mutex, now lock count is one by definition
- OMutex::acquire();
+ SolarMutexObject::acquire();
int nRet = mnCount;
if( mnCount == 0 ) // recursive else
- mnThreadId = vos::OThread::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
#if OSL_DEBUG_LEVEL > 1
- else if( mnThreadId != vos::OThread::getCurrentIdentifier() )
+ else if( mnThreadId != osl::Thread::getCurrentIdentifier() )
{
fprintf( stderr, "Yield mutex grabbed in different thread !\n" );
abort();
}
#endif
mnCount = 1;
- OMutex::release();
+ SolarMutexObject::release();
return nRet;
}
@@ -358,9 +359,11 @@ void GtkYieldMutex::Ungrab( int nGrabs )
{
// this MUST only be called when leaving the callback
// that locked the mutex with Grab()
- OMutex::acquire();
+ SolarMutexObject::acquire();
mnCount = nGrabs;
if( mnCount == 0 )
mnThreadId = 0;
- OMutex::release();
+ SolarMutexObject::release();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index daaf4b27bc5c..2076d39cc229 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
#include <unx/svunx.h>
#include <svdata.hxx>
+
#include <vcl/window.hxx>
#include <unx/gtk/gtkinst.hxx>
#include <cstdio>
@@ -46,6 +54,14 @@ GtkSalSystem::~GtkSalSystem()
{
}
+// convert ~ to indicate mnemonic to '_'
+static ByteString MapToGtkAccelerator (const String &rStr)
+{
+ String aRet( rStr );
+ aRet.SearchAndReplaceAscii("~", String::CreateFromAscii("_"));
+ return ByteString( aRet, RTL_TEXTENCODING_UTF8 );
+}
+
int GtkSalSystem::ShowNativeDialog( const String& rTitle,
const String& rMessage,
const std::list< String >& rButtons,
@@ -74,15 +90,16 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle,
int nButton = 0;
for( std::list< String >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
{
- ByteString aLabel( *it, RTL_TEXTENCODING_UTF8 );
-
if( nButton == nDefButton )
{
- gtk_dialog_add_button( GTK_DIALOG( mainwin ), aLabel.GetBuffer(), nButtons );
+ gtk_dialog_add_button( GTK_DIALOG( mainwin ), MapToGtkAccelerator(*it).GetBuffer(), nButtons );
gtk_dialog_set_default_response( GTK_DIALOG( mainwin ), nButtons );
}
else
+ {
+ ByteString aLabel( *it, RTL_TEXTENCODING_UTF8 );
gtk_dialog_add_button( GTK_DIALOG( mainwin ), aLabel.GetBuffer(), nButtons );
+ }
nButtons++;
}
@@ -94,3 +111,5 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle,
return nResponse;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 3657e3a0d770..ca578dccead9 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,7 @@
#include <cmath>
#include <vector>
#include <algorithm>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
typedef struct _cairo_font_options cairo_font_options_t;
@@ -58,8 +59,7 @@ GtkSalGraphics::~GtkSalGraphics()
{
}
-
-using namespace rtl;
+using ::rtl::OUString;
/*************************************
* Cached native widget objects
@@ -101,6 +101,7 @@ struct NWFWidgetData
GtkWidget * gTreeView;
GtkWidget * gHScale;
GtkWidget * gVScale;
+ GtkWidget * gVSeparator;
NWPixmapCacheList* gNWPixmapCacheList;
NWPixmapCache* gCacheTabItems;
@@ -139,6 +140,7 @@ struct NWFWidgetData
gTreeView( NULL ),
gHScale( NULL ),
gVScale( NULL ),
+ gVSeparator ( NULL ),
gNWPixmapCacheList( NULL ),
gCacheTabItems( NULL ),
gCacheTabPages( NULL )
@@ -148,7 +150,7 @@ 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 std::hash_map<long, guint> gWidgetDefaultFlags;
+static boost::unordered_map<long, guint> gWidgetDefaultFlags;
static std::vector<NWFWidgetData> gWidgetData;
static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 };
@@ -267,7 +269,7 @@ public:
void SetSize( int n)
{ delete [] pData; m_idx = 0; m_size = n; pData = new NWPixmapCacheData[m_size]; }
- int GetSize() { return m_size; }
+ int GetSize() const { return m_size; }
sal_Bool Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap );
void Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap );
@@ -402,9 +404,6 @@ void GtkData::initNWF( void )
// draw separate buttons for toolbox dropdown items
pSVData->maNWFData.mbToolboxDropDownSeparate = true;
- // small extra border around menu items
- pSVData->maNWFData.mnMenuFormatExtraBorder = 1;
-
// draw toolbars in separate lines
pSVData->maNWFData.mbDockingAreaSeparateTB = true;
@@ -419,8 +418,15 @@ void GtkData::initNWF( void )
for( int i = 0; i < nScreens; i++ )
gWidgetData[i].gNWPixmapCacheList = new NWPixmapCacheList;
+ // small extra border around menu items
+ NWEnsureGTKMenu( 0 );
+ gint horizontal_padding = 1;
+ gtk_widget_style_get( gWidgetData[0].gMenuItemMenuWidget,
+ "horizontal_padding", &horizontal_padding,
+ (char *)NULL);
+ pSVData->maNWFData.mnMenuFormatExtraBorder = horizontal_padding;
- if( SalGetDesktopEnvironment().equalsAscii( "KDE" ) )
+ if( SalGetDesktopEnvironment().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE")) )
{
// #i97196# ensure a widget exists and the style engine was loaded
NWEnsureGTKButton( 0 );
@@ -561,10 +567,14 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
|| (nPart==PART_THUMB_HORZ)
|| (nPart==PART_THUMB_VERT)
|| (nPart==PART_BUTTON)
+ || (nPart==PART_SEPARATOR)
)
) ||
((nType == CTRL_MENUBAR) &&
- ( (nPart==PART_ENTIRE_CONTROL) ) ) ||
+ ( (nPart==PART_ENTIRE_CONTROL)
+ || (nPart==PART_MENU_ITEM)
+ )
+ ) ||
((nType == CTRL_TOOLTIP) &&
( (nPart==PART_ENTIRE_CONTROL) ) ) ||
((nType == CTRL_MENU_POPUP) &&
@@ -587,7 +597,6 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
)
)
return( sal_True );
-
return( sal_False );
}
@@ -859,7 +868,7 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
else if( (nType == CTRL_LISTNET) && (nPart == PART_ENTIRE_CONTROL) )
{
// don't actually draw anything; gtk treeviews do not draw lines
- returnVal = true;
+ returnVal = TRUE;
}
else if( (nType == CTRL_SLIDER) )
{
@@ -973,6 +982,11 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
rNativeBoundingRegion = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion );
rNativeContentRegion = rNativeBoundingRegion;
+ //See fdo#33523, possibly makes sense to do this test for all return values
+ if (!rNativeContentRegion.GetWidth())
+ rNativeContentRegion.Right() = rNativeContentRegion.Left() + 1;
+ if (!rNativeContentRegion.GetHeight())
+ rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1;
returnVal = sal_True;
}
if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) )
@@ -1145,7 +1159,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
clipRect.height = it->GetHeight();
// Buttons must paint opaque since some themes have alpha-channel enabled buttons
- gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&clipRect, m_pWindow, "base", x, y, w, h );
if ( (nState & CTRL_STATE_DEFAULT) && (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief == GTK_RELIEF_NORMAL) )
@@ -1162,29 +1176,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
&clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
}
}
-#if 0 // VCL draws focus rects
- // Draw focus rect
- if ( (nState & CTRL_STATE_FOCUSED) && (nState & CTRL_STATE_ENABLED) && bDrawFocus )
- {
- if (interiorFocus)
- {
- x += gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad;
- y += gWidgetData[m_nScreen].gBtnWidget->style->ythickness + focusPad;
- w -= 2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
- h -= 2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
- }
- else
- {
- x -= focusWidth + focusPad;
- y -= focusWidth + focusPad;
- w += 2 * (focusWidth + focusPad);
- h += 2 * (focusWidth + focusPad);
- }
- if ( !interiorFocus )
- gtk_paint_focus( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, &clipRect,
- gWidgetData[m_nScreen].gBtnWidget, "button", x, y, w, h );
- }
-#endif
return( sal_True );
}
@@ -1478,12 +1469,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// Make sure the thumb is at least the default width (so we don't get tiny thumbs),
// but if the VCL gives us a size smaller than the theme's default thumb size,
// honor the VCL size
-#if 0
- if ( (thumbRect.GetWidth() < min_slider_length)
- && ((scrollbarRect.GetWidth()-button1BoundRect.GetWidth()-button2BoundRect.GetWidth()) > min_slider_length) )
- thumbRect.SetSize( Size( min_slider_length, thumbRect.GetHeight() ) );
-#endif
-
thumbRect.Right() += magic;
// Center vertically in the track
thumbRect.Move( 0, (scrollbarRect.GetHeight() - slider_width) / 2 );
@@ -1525,14 +1510,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
button22BoundRect.SetSize( Size( slider_width, stepper_size ) );
thumbRect.Right() = thumbRect.Left() + slider_width - 1;
-#if 0
- // Make sure the thumb is at least the default width (so we don't get tiny thumbs),
- // but if the VCL gives us a size smaller than the theme's default thumb size,
- // honor the VCL size
- if ( (thumbRect.GetHeight() < min_slider_length)
- && ((scrollbarRect.GetHeight()-button1BoundRect.GetHeight()-button2BoundRect.GetHeight()) > min_slider_length) )
- thumbRect.SetSize( Size( thumbRect.GetWidth(), min_slider_length ) );
-#endif
thumbRect.Bottom() += magic;
// Center horizontally in the track
@@ -1578,8 +1555,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
style = GTK_WIDGET( scrollbarWidget )->style;
+ gtk_style_apply_default_background( m_pWindow->style, gdkDrawable, TRUE,
+ GTK_STATE_NORMAL, gdkRect,
+ x, y, w, h );
+
// ----------------- TROUGH
- gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable,
+ gtk_paint_flat_box( m_pWindow->style, gdkDrawable,
GTK_STATE_NORMAL, GTK_SHADOW_NONE, gdkRect,
m_pWindow, "base", x, y,
w, h );
@@ -1852,10 +1833,6 @@ static void NWPaintOneEditBox( int nScreen,
NWEnsureGTKScrolledWindow( nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
- /* border's shadowType for gtk entries is always GTK_SHADOW_IN (see gtkentry.c)
- shadowType = GTK_SHADOW_IN;
- */
-
switch ( nType )
{
case CTRL_SPINBOX:
@@ -1887,7 +1864,7 @@ static void NWPaintOneEditBox( int nScreen,
}
NWSetWidgetState( widget, nState, stateType );
- gtk_paint_flat_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
+ gtk_paint_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
gdkRect, pBGWidget, "entry_bg",
aEditBoxRect.Left(), aEditBoxRect.Top(),
aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
@@ -2140,7 +2117,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
nState, aValue, rCaption );
// Buttons must paint opaque since some themes have alpha-channel enabled buttons
- gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&clipRect, m_pWindow, "base",
x+(buttonRect.Left() - pixmapRect.Left()),
y+(buttonRect.Top() - pixmapRect.Top()),
@@ -2281,7 +2258,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
// Allow the tab to draw a right border if needed
tabRect.Right() -= 1;
- // #129732# avoid degenerate cases which might lead to crashes
+ // avoid degenerate cases which might lead to crashes
if( tabRect.GetWidth() <= 1 || tabRect.GetHeight() <= 1 )
return false;
}
@@ -2297,9 +2274,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
return NWRenderPixmapToScreen( pixmap, pixmapRect );
}
-
-// gtk_widget_set_state( gWidgetData[m_nScreen].gNotebookWidget, stateType );
-
pixmap = gdk_pixmap_new( NULL, pixmapRect.GetWidth(), pixmapRect.GetHeight(),
GetX11SalData()->GetDisplay()->GetVisual( m_nScreen ).GetDepth() );
GdkRectangle paintRect;
@@ -2332,8 +2306,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
if ( nState & CTRL_STATE_SELECTED )
{
- gtk_paint_flat_box( gWidgetData[m_nScreen].gNotebookWidget->style, pixmap, stateType, GTK_SHADOW_NONE, NULL, m_pWindow,
- (char *)"base", 0, (pixmapRect.GetHeight() - 1), pixmapRect.GetWidth(), 1 );
+ gtk_paint_flat_box( m_pWindow->style, pixmap, stateType, GTK_SHADOW_NONE, NULL, m_pWindow,
+ "base", 0, (pixmapRect.GetHeight() - 1), pixmapRect.GetWidth(), 1 );
}
break;
@@ -2422,7 +2396,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
if ( nPart != PART_WINDOW )
{
// Listboxes must paint opaque since some themes have alpha-channel enabled bodies
- gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&clipRect, m_pWindow, "base", x, y,
pixmapRect.GetWidth(), pixmapRect.GetHeight() );
gtk_paint_box( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect,
@@ -2596,6 +2570,21 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
pButtonWidget, "button", x, y, w, h );
}
}
+ else if(nPart == PART_SEPARATOR )
+ {
+ gtk_paint_vline( gWidgetData[m_nScreen].gVSeparator->style,
+ gdkDrawable,
+ GTK_STATE_NORMAL,
+ &clipRect,
+ gWidgetData[m_nScreen].gVSeparator,
+ "vseparator",
+ y + 4, y + h - 8 /* -2 and -4 is a dirty
+ * hack, to fit most gtk
+ * style, but it must be
+ * fixed, FIXME */,
+ x
+ );
+ }
}
return( sal_True );
@@ -2651,7 +2640,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
if ( nState & CTRL_STATE_ENABLED )
GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gMenubarWidget, GTK_SENSITIVE );
- // #118704# for translucent menubar styles paint background first
+ // for translucent menubar styles paint background first
gtk_paint_flat_box( gWidgetData[m_nScreen].gMenubarWidget->style,
gdkDrawable,
GTK_STATE_NORMAL,
@@ -2669,6 +2658,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
"menubar",
x, y, w, h );
}
+
else if( nPart == PART_MENU_ITEM )
{
if( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) )
@@ -2697,9 +2687,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
const OUString& )
{
// #i50745# gtk does not draw disabled menu entries (and crux theme
- // even crashes), draw them using vcl functionality.
- if( nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) )
- return sal_False;
+ // even crashes) in very old (Fedora Core 4 vintage) gtk's
+ if (gtk_major_version <= 2 && gtk_minor_version <= 8 &&
+ nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) )
+ return sal_True;
GtkStateType stateType;
GtkShadowType shadowType;
@@ -2738,7 +2729,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
if( nPart == PART_ENTIRE_CONTROL )
{
- // #118704# for translucent menubar styles paint background first
+ // for translucent menubar styles paint background first
gtk_paint_flat_box( gWidgetData[m_nScreen].gMenuWidget->style,
gdkDrawable,
GTK_STATE_NORMAL,
@@ -3056,43 +3047,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider(
slider_width, slider_length,
eOri );
}
- #if 0
- // paint background
- gtk_paint_flat_box( gWidgetData[m_nScreen].gProgressBar->style,
- pixDrawable,
- GTK_STATE_NORMAL,
- GTK_SHADOW_NONE,
- NULL,
- gWidgetData[m_nScreen].gProgressBar,
- "trough",
- 0, 0, w, h );
- if( nProgressWidth > 0 )
- {
- // paint progress
- if( Application::GetSettings().GetLayoutRTL() )
- {
- gtk_paint_box( gWidgetData[m_nScreen].gProgressBar->style,
- pixDrawable,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL,
- gWidgetData[m_nScreen].gProgressBar,
- "bar",
- w-nProgressWidth, 0, nProgressWidth, h
- );
- }
- else
- {
- gtk_paint_box( gWidgetData[m_nScreen].gProgressBar->style,
- pixDrawable,
- GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
- NULL,
- gWidgetData[m_nScreen].gProgressBar,
- "bar",
- 0, 0, nProgressWidth, h
- );
- }
- }
- #endif
+
sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
g_object_unref( pixmap );
@@ -3382,6 +3337,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// menu disabled entries handling
aStyleSet.SetSkipDisabledInMenus( sal_True );
+ aStyleSet.SetAcceleratorsInContextMenus( sal_False );
// menu colors
GtkStyle* pMenuStyle = gtk_widget_get_style( gWidgetData[m_nScreen].gMenuWidget );
GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nScreen].gMenuItemMenuWidget );
@@ -3507,8 +3463,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetAppFont( aFont );
aStyleSet.SetHelpFont( aFont );
- aStyleSet.SetTitleFont( aFont );
- aStyleSet.SetFloatTitleFont( aFont );
aStyleSet.SetMenuFont( aFont );
aStyleSet.SetToolFont( aFont );
aStyleSet.SetLabelFont( aFont );
@@ -3519,6 +3473,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetIconFont( aFont );
aStyleSet.SetGroupFont( aFont );
+ aFont.SetWeight( WEIGHT_BOLD );
+ aStyleSet.SetTitleFont( aFont );
+ aStyleSet.SetFloatTitleFont( aFont );
+
// get cursor blink time
GtkSettings *pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gEditBoxWidget );
gboolean blink = false;
@@ -3539,7 +3497,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
gboolean showmenuicons = true;
pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gImageMenuItem );
g_object_get( pSettings, "gtk-menu-images", &showmenuicons, (char *)NULL );
- aStyleSet.SetUseImagesInMenus( showmenuicons );
+ aStyleSet.SetPreferredUseImagesInMenus( showmenuicons );
// set scrollbar settings
gint slider_width = 14;
@@ -3562,13 +3520,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetPreferredSymbolsStyleName( OUString::createFromAscii( pIconThemeName ) );
g_free( pIconThemeName );
- // FIXME: need some way of fetching toolbar icon size.
-// aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_SMALL );
+ aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
const cairo_font_options_t* pNewOptions = NULL;
if( GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), m_nScreen ) )
{
-//#if !GTK_CHECK_VERSION(2,8,1)
#if !GTK_CHECK_VERSION(2,9,0)
static cairo_font_options_t* (*gdk_screen_get_font_options)(GdkScreen*) =
(cairo_font_options_t*(*)(GdkScreen*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" );
@@ -3936,6 +3892,8 @@ static void NWEnsureGTKToolbar( int nScreen )
NWAddWidgetToCacheWindow( gWidgetData[nScreen].gToolbarWidget, nScreen );
gWidgetData[nScreen].gToolbarButtonWidget = gtk_button_new();
gWidgetData[nScreen].gToolbarToggleWidget = gtk_toggle_button_new();
+ gWidgetData[nScreen].gVSeparator = gtk_vseparator_new();
+ NWAddWidgetToCacheWindow( gWidgetData[nScreen].gVSeparator, nScreen );
GtkReliefStyle aRelief = GTK_RELIEF_NORMAL;
gtk_widget_ensure_style( gWidgetData[nScreen].gToolbarWidget );
@@ -4065,3 +4023,5 @@ static void NWEnsureGTKSlider( int nScreen )
NWAddWidgetToCacheWindow( gWidgetData[nScreen].gVScale, nScreen );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 5f4a2bda25f8..d49d0ae7921d 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,6 +51,7 @@
#include <vcl/bitmapex.hxx>
#include <impbmp.hxx>
#include <svids.hrc>
+#include <sal/macros.h>
#include <algorithm>
@@ -210,6 +212,9 @@ static sal_uInt16 GetKeyCode( guint keyval )
case GDK_asciitilde: nCode = KEY_TILDE; break;
case GDK_leftsinglequotemark:
case GDK_quoteleft: nCode = KEY_QUOTELEFT; break;
+ case GDK_bracketleft: nCode = KEY_BRACKETLEFT; break;
+ case GDK_bracketright: nCode = KEY_BRACKETRIGHT; break;
+ case GDK_semicolon: nCode = KEY_SEMICOLON; break;
// some special cases, also see saldisp.cxx
// - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000
case 0x1000FF02: // apXK_Copy
@@ -413,7 +418,7 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData )
GtkSalFrame::~GtkSalFrame()
{
- for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); ++i )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i )
{
if( !m_aGraphics[i].pGraphics )
continue;
@@ -553,7 +558,6 @@ void GtkSalFrame::InitCommon()
// init members
m_pCurrentCursor = NULL;
m_nKeyModifiers = 0;
- m_bSingleAltPress = false;
m_bFullscreen = false;
m_nState = GDK_WINDOW_STATE_WITHDRAWN;
m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED;
@@ -792,6 +796,8 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
// force wm class hint
m_nExtStyle = ~0;
+ if (m_pParent)
+ m_sWMClass = m_pParent->m_sWMClass;
SetExtendedFrameStyle( 0 );
if( m_pParent && m_pParent->m_pWindow && ! isChild() )
@@ -860,7 +866,6 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
{
/* #i99360# ugly workaround an X11 library bug */
nUserTime= getDisplay()->GetLastUserEventTime( true );
- // nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window);
}
lcl_set_user_time(GTK_WIDGET(m_pWindow)->window, nUserTime);
}
@@ -975,25 +980,10 @@ void GtkSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle )
if( nStyle != m_nExtStyle && ! isChild() )
{
m_nExtStyle = nStyle;
- if( GTK_WIDGET_REALIZED( m_pWindow ) )
- {
- XClassHint* pClass = XAllocClassHint();
- rtl::OString aResHint = X11SalData::getFrameResName( m_nExtStyle );
- pClass->res_name = const_cast<char*>(aResHint.getStr());
- pClass->res_class = const_cast<char*>(X11SalData::getFrameClassName());
- XSetClassHint( getDisplay()->GetDisplay(),
- GDK_WINDOW_XWINDOW(m_pWindow->window),
- pClass );
- XFree( pClass );
- }
- else
- gtk_window_set_wmclass( GTK_WINDOW(m_pWindow),
- X11SalData::getFrameResName( m_nExtStyle ),
- X11SalData::getFrameClassName() );
+ updateWMClass();
}
}
-
SalGraphics* GtkSalFrame::GetGraphics()
{
if( m_pWindow )
@@ -1121,13 +1111,6 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START };
sal_uInt16 nIndex;
- // Use high contrast icons where appropriate
- if( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
- {
- nOffsets[0] = SV_ICON_LARGE_HC_START;
- nOffsets[1] = SV_ICON_SMALL_HC_START;
- }
-
for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ )
{
// #i44723# workaround gcc temporary problem
@@ -1158,7 +1141,7 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
aMask = AlphaMask( aIcon.GetMask() );
break;
default:
- DBG_ERROR( "unhandled transparent type" );
+ OSL_FAIL( "unhandled transparent type" );
break;
}
}
@@ -1296,7 +1279,6 @@ void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), bVisible );
if( bVisible )
{
- SessionManagerClient::open(); // will simply return after the first time
initClientId();
getDisplay()->startupNotificationCompleted();
@@ -1632,8 +1614,6 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
sal_uInt16 nPosSizeFlags = 0;
long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0);
long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0);
- long nWidth = pState->mnWidth;
- long nHeight = pState->mnHeight;
if( pState->mnMask & SAL_FRAMESTATE_MASK_X )
nPosSizeFlags |= SAL_FRAME_POSSIZE_X;
else
@@ -1644,12 +1624,8 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
nY = maGeometry.nY - (m_pParent ? m_pParent->maGeometry.nY : 0);
if( pState->mnMask & SAL_FRAMESTATE_MASK_WIDTH )
nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH;
- else
- nWidth = maGeometry.nWidth;
if( pState->mnMask & SAL_FRAMESTATE_MASK_HEIGHT )
nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT;
- else
- nHeight = maGeometry.nHeight;
SetPosSize( nX, nY, pState->mnWidth, pState->mnHeight, nPosSizeFlags );
}
if( pState->mnMask & SAL_FRAMESTATE_MASK_STATE && ! isChild() )
@@ -1740,7 +1716,7 @@ void GtkSalFrame::moveToScreen( int nScreen )
m_aSystemData.pAppContext = NULL;
m_aSystemData.aShellWindow = m_aSystemData.aWindow;
// update graphics if necessary
- for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); i++ )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ )
{
if( m_aGraphics[i].bInUse )
m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen );
@@ -1792,6 +1768,40 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen )
}
}
+void GtkSalFrame::updateWMClass()
+{
+ rtl::OString aResClass = rtl::OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US);
+ const char *pResClass = aResClass.getLength() ? aResClass.getStr() : X11SalData::getFrameClassName();
+
+ if( GTK_WIDGET_REALIZED( m_pWindow ) )
+ {
+ XClassHint* pClass = XAllocClassHint();
+ rtl::OString aResName = X11SalData::getFrameResName( m_nExtStyle );
+ pClass->res_name = const_cast<char*>(aResName.getStr());
+ pClass->res_class = const_cast<char*>(pResClass);
+ XSetClassHint( getDisplay()->GetDisplay(),
+ GDK_WINDOW_XWINDOW(m_pWindow->window),
+ pClass );
+ XFree( pClass );
+ }
+ else
+ gtk_window_set_wmclass( GTK_WINDOW(m_pWindow),
+ X11SalData::getFrameResName( m_nExtStyle ),
+ pResClass );
+}
+
+void GtkSalFrame::SetApplicationID( const rtl::OUString &rWMClass )
+{
+ if( rWMClass != m_sWMClass && ! isChild() )
+ {
+ m_sWMClass = rWMClass;
+ updateWMClass();
+
+ for( std::list< GtkSalFrame* >::iterator it = m_aChildren.begin(); it != m_aChildren.end(); ++it )
+ (*it)->SetApplicationID(rWMClass);
+ }
+}
+
void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
{
if( m_pWindow && ! isChild() )
@@ -2077,7 +2087,6 @@ void GtkSalFrame::ToTop( sal_uInt16 nFlags )
gtk_window_present( GTK_WINDOW(m_pWindow) );
else
{
- // gdk_window_focus( m_pWindow->window, gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window) );
/* #i99360# ugly workaround an X11 library bug */
guint32 nUserTime= getDisplay()->GetLastUserEventTime( true );
gdk_window_focus( m_pWindow->window, nUserTime );
@@ -2124,6 +2133,8 @@ void GtkSalFrame::SetPointer( PointerStyle ePointerStyle )
void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
{
+ static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" );
+
if( m_pWindow )
{
if( bGrab )
@@ -2146,9 +2157,10 @@ void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
{
const int nMask = ( GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK );
- gdk_pointer_grab( m_pWindow->window, bOwnerEvents,
- (GdkEventMask) nMask, NULL, m_pCurrentCursor,
- GDK_CURRENT_TIME );
+ if( !pEnv || !*pEnv )
+ gdk_pointer_grab( m_pWindow->window, bOwnerEvents,
+ (GdkEventMask) nMask, NULL, m_pCurrentCursor,
+ GDK_CURRENT_TIME );
}
else
{
@@ -2158,23 +2170,25 @@ void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
//
// this is of course a bad hack, especially as we cannot
// set the right cursor this way
- XGrabPointer( getDisplay()->GetDisplay(),
- GDK_WINDOW_XWINDOW( m_pWindow->window),
- bOwnerEvents,
- PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
- GrabModeAsync,
- GrabModeAsync,
- None,
- None,
- CurrentTime
- );
+ if( !pEnv || !*pEnv )
+ XGrabPointer( getDisplay()->GetDisplay(),
+ GDK_WINDOW_XWINDOW( m_pWindow->window),
+ bOwnerEvents,
+ PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
+ GrabModeAsync,
+ GrabModeAsync,
+ None,
+ None,
+ CurrentTime
+ );
}
}
else
{
// Two GdkDisplays may be open
- gdk_display_pointer_ungrab( getGdkDisplay(), GDK_CURRENT_TIME);
+ if( !pEnv || !*pEnv )
+ gdk_display_pointer_ungrab( getGdkDisplay(), GDK_CURRENT_TIME);
}
}
}
@@ -2195,7 +2209,7 @@ void GtkSalFrame::SetPointerPos( long nX, long nY )
GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(pFrame->m_pWindow) );
GdkDisplay *pDisplay = gdk_screen_get_display( pScreen );
- /* #87921# when the application tries to center the mouse in the dialog the
+ /* when the application tries to center the mouse in the dialog the
* window isn't mapped already. So use coordinates relative to the root window.
*/
unsigned int nWindowLeft = maGeometry.nX + nX;
@@ -2256,6 +2270,18 @@ SalFrame::SalPointerState GtkSalFrame::GetPointerState()
return aState;
}
+SalFrame::SalIndicatorState GtkSalFrame::GetIndicatorState()
+{
+ SalIndicatorState aState;
+ aState.mnState = GetX11SalData()->GetDisplay()->GetIndicatorState();
+ return aState;
+}
+
+void GtkSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
+{
+ GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
+}
+
void GtkSalFrame::SetInputContext( SalInputContext* pContext )
{
if( ! pContext )
@@ -2389,7 +2415,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
}
// free xrender resources
- for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); i++ )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ )
if( m_aGraphics[i].bInUse )
m_aGraphics[i].pGraphics->SetDrawable( None, m_nScreen );
@@ -2424,7 +2450,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
}
// update graphics
- for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); i++ )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ )
{
if( m_aGraphics[i].bInUse )
{
@@ -2812,13 +2838,15 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
GTK_YIELD_GRAB();
+ X11SalInstance *pSalInstance =
+ static_cast< X11SalInstance* >(GetSalData()->m_pInstance);
+
// check if printers have changed (analogous to salframe focus handler)
- vcl_sal::PrinterUpdate::update();
+ pSalInstance->updatePrinterUpdate();
if( !pEvent->in )
{
pThis->m_nKeyModifiers = 0;
- pThis->m_bSingleAltPress = false;
pThis->m_bSendModChangeOnRelease = false;
}
@@ -2826,9 +2854,8 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
pThis->m_pIMHandler->focusChanged( pEvent->in );
// ask for changed printers like generic implementation
- if( pEvent->in )
- if( static_cast< X11SalInstance* >(GetSalData()->m_pInstance)->isPrinterInit() )
- vcl_sal::PrinterUpdate::update();
+ if( pEvent->in && pSalInstance->isPrinterInit() )
+ pSalInstance->updatePrinterUpdate();
// FIXME: find out who the hell steals the focus from our frame
// while we have the pointer grabbed, this should not come from
@@ -3022,10 +3049,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( pThis->m_pIMHandler )
{
if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) )
- {
- pThis->m_bSingleAltPress = false;
return sal_True;
- }
}
GTK_YIELD_GRAB();
@@ -3112,36 +3136,6 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
pThis->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt );
- if( ! aDel.isDeleted() )
- {
- // emulate KEY_MENU
- if( ( pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R ) &&
- ( nModCode & ~(KEY_MOD3|KEY_MOD2)) == 0 )
- {
- if( pEvent->type == GDK_KEY_PRESS )
- pThis->m_bSingleAltPress = true;
-
- else if( pThis->m_bSingleAltPress )
- {
- SalKeyEvent aKeyEvt;
-
- aKeyEvt.mnCode = KEY_MENU | nModCode;
- aKeyEvt.mnRepeat = 0;
- aKeyEvt.mnTime = pEvent->time;
- aKeyEvt.mnCharCode = 0;
-
- // simulate KEY_MENU
- pThis->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
- if( ! aDel.isDeleted() )
- {
- pThis->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
- pThis->m_bSingleAltPress = false;
- }
- }
- }
- else
- pThis->m_bSingleAltPress = false;
- }
}
else
{
@@ -3154,10 +3148,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
(pEvent->type == GDK_KEY_PRESS),
false );
if( ! aDel.isDeleted() )
- {
pThis->m_bSendModChangeOnRelease = false;
- pThis->m_bSingleAltPress = false;
- }
}
if( !aDel.isDeleted() && pThis->m_pIMHandler )
@@ -3543,6 +3534,10 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p
{
GTK_YIELD_GRAB();
+ const bool bWasPreedit =
+ (pThis->m_aInputEvent.mpTextAttr != 0) ||
+ pThis->m_bPreeditJustChanged;
+
pThis->m_aInputEvent.mnTime = 0;
pThis->m_aInputEvent.mpTextAttr = 0;
pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 );
@@ -3566,9 +3561,6 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p
* or because there never was a preedit.
*/
bool bSingleCommit = false;
- bool bWasPreedit =
- (pThis->m_aInputEvent.mpTextAttr != 0) ||
- pThis->m_bPreeditJustChanged;
if( ! bWasPreedit
&& pThis->m_aInputEvent.maText.Len() == 1
&& ! pThis->m_aPrevKeyPresses.empty()
@@ -3756,11 +3748,18 @@ uno::Reference<accessibility::XAccessibleEditableText> lcl_GetxText()
uno::Reference<accessibility::XAccessibleEditableText> xText;
Window* pFocusWin = ImplGetSVData()->maWinData.mpFocusWin;
if (!pFocusWin)
- return xText;
+ return xText;
- uno::Reference< accessibility::XAccessible > xAccessible( pFocusWin->GetAccessible( true ) );
- if (xAccessible.is())
- xText = FindFocus(xAccessible->getAccessibleContext());
+ try
+ {
+ uno::Reference< accessibility::XAccessible > xAccessible( pFocusWin->GetAccessible( true ) );
+ if (xAccessible.is())
+ xText = FindFocus(xAccessible->getAccessibleContext());
+ }
+ catch(const uno::Exception& e)
+ {
+ g_warning( "Exception in getting input method surrounding text" );
+ }
return xText;
}
@@ -3792,9 +3791,7 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint
if (xText.is())
{
sal_uInt32 nPosition = xText->getCaretPosition();
- // --> OD 2010-06-04 #i111768# - apply patch from kstribley:
- // range checking
-// xText->deleteText(nPosition + offset, nPosition + offset + nchars);
+ // #i111768# range checking
sal_Int32 nDeletePos = nPosition + offset;
sal_Int32 nDeleteEnd = nDeletePos + nchars;
if (nDeletePos < 0)
@@ -3805,9 +3802,10 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint
nDeleteEnd = xText->getCharacterCount();
xText->deleteText(nDeletePos, nDeleteEnd);
- // <--
return sal_True;
}
return sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx
index 68c8f1f1286d..04dcde7ff4e3 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
#include <unx/gtk/gtkobject.hxx>
#include <unx/gtk/gtkframe.hxx>
#include <unx/gtk/gtkdata.hxx>
@@ -210,7 +217,16 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object )
}
}
+void GtkSalObject::SetForwardKey( sal_Bool bEnable )
+{
+ if( bEnable )
+ gtk_widget_add_events( GTK_WIDGET( m_pSocket ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE );
+ else
+ gtk_widget_set_events( GTK_WIDGET( m_pSocket ), ~(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE) & gtk_widget_get_events( GTK_WIDGET( m_pSocket ) ) );
+}
+
void GtkSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */