diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vclplug_gtk3.mk | 1 | ||||
-rw-r--r-- | vcl/inc/opengl/x11/gdiimpl.hxx | 7 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkdata.hxx | 5 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 9 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkgdi.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/pixmap.hxx | 43 | ||||
-rw-r--r-- | vcl/inc/unx/saldisp.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 15 | ||||
-rw-r--r-- | vcl/inc/unx/x11/x11gdiimpl.h | 6 | ||||
-rw-r--r-- | vcl/inc/wizdlg.hxx | 81 | ||||
-rw-r--r-- | vcl/opengl/x11/gdiimpl.cxx | 190 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 7 | ||||
-rw-r--r-- | vcl/source/control/roadmapwizard.cxx | 73 | ||||
-rw-r--r-- | vcl/source/control/wizardmachine.cxx | 77 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.cxx | 58 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.hxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi2.cxx | 29 | ||||
-rw-r--r-- | vcl/unx/gtk3/a11y/atkutil.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/gtk3/a11y/atkwindow.hxx | 30 | ||||
-rw-r--r-- | vcl/unx/gtk3/a11y/gtk3atkbridge.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/gtk3/a11y/gtk3atkutil.cxx | 77 | ||||
-rw-r--r-- | vcl/unx/gtk3/a11y/gtk3atkwindow.cxx | 330 |
23 files changed, 0 insertions, 1054 deletions
diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk index 9f6504c38f56..9e67d5efc265 100644 --- a/vcl/Library_vclplug_gtk3.mk +++ b/vcl/Library_vclplug_gtk3.mk @@ -94,7 +94,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3,\ vcl/unx/gtk3/a11y/gtk3atktext \ vcl/unx/gtk3/a11y/gtk3atkutil \ vcl/unx/gtk3/a11y/gtk3atkvalue \ - vcl/unx/gtk3/a11y/gtk3atkwindow \ vcl/unx/gtk3/a11y/gtk3atkwrapper \ vcl/unx/gtk3/fpicker/resourceprovider \ vcl/unx/gtk3/fpicker/SalGtkFilePicker \ diff --git a/vcl/inc/opengl/x11/gdiimpl.hxx b/vcl/inc/opengl/x11/gdiimpl.hxx index bff6f4881629..5d57605bf64d 100644 --- a/vcl/inc/opengl/x11/gdiimpl.hxx +++ b/vcl/inc/opengl/x11/gdiimpl.hxx @@ -31,8 +31,6 @@ public: protected: virtual rtl::Reference<OpenGLContext> CreateWinContext() override; - void RenderPixmap(X11Pixmap const * pPixmap, X11Pixmap const * pMask, int nX, int nY, TextureCombo& rCombo); - public: // implementation of X11GraphicsImpl @@ -40,11 +38,6 @@ public: virtual void Init() override; - void FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) override; - bool RenderPixmapToScreen(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY) override; - - bool RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, - ControlCacheKey& aControlCacheKey) override; bool TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY) override; }; diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 84e2d19f6c94..f3b106070dbd 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -118,8 +118,6 @@ class GtkSalDisplay : public SalGenericDisplay bool m_bStartupCompleted; bool m_bX11Display; - GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask, - int nWidth, int nHeight, int nXHot, int nYHot ); GdkCursor* getFromSvg( OUString const & name, int nXHot, int nYHot ); public: @@ -139,7 +137,6 @@ public: SalX11Screen GetDefaultXScreen() { return m_pSys->GetDisplayDefaultXScreen(); } Size GetScreenSize( int nDisplayScreen ); - int GetXScreenCount() { return m_pSys->GetDisplayXScreenCount(); } GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event ); void startupNotificationCompleted() { m_bStartupCompleted = true; } @@ -149,8 +146,6 @@ public: virtual void TriggerUserEventProcessing() override; virtual void TriggerAllUserEventsProcessed() override; - - void RefreshMenusUnity(); }; inline GtkSalData* GetGtkSalData() diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index a8aa8a443e2a..ccf9064966bd 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -305,7 +305,6 @@ class GtkSalFrame : public SalFrame Size calcDefaultSize(); void setMinMaxSize(); - void createNewWindow( ::Window aParent, bool bXEmbed, SalX11Screen nXScreen ); void AllocateFrame(); void TriggerPaintEvent(); @@ -332,10 +331,6 @@ public: guint m_nHudAwarenessId; std::vector<gulong> m_aMouseSignalIds; - // dispatches an event, returns true if dispatched - // and false else; if true was returned the event should - // be swallowed - bool Dispatch( const XEvent* pEvent ); void grabPointer(bool bGrab, bool bOwnerEvents = false); static GtkSalDisplay* getDisplay(); @@ -345,10 +340,6 @@ public: GtkEventBox* getEventBox() const { return m_pEventBox; } GtkWidget* getMouseEventWidget() const; GtkGrid* getTopLevelGridWidget() const { return m_pTopLevelGrid; } - GdkWindow* getForeignParent() const { return m_pForeignParent; } - GdkNativeWindow getForeignParentWindow() const { return m_aForeignParentWindow; } - GdkWindow* getForeignTopLevel() const { return m_pForeignTopLevel; } - GdkNativeWindow getForeignTopLevelWindow() const { return m_aForeignTopLevelWindow; } const SalX11Screen& getXScreenNumber() const { return m_nXScreen; } int GetDisplayScreen() const { return maGeometry.nDisplayScreenNumber; } void updateScreenNumber(); diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index e19d01205e49..cd9cf4c5b562 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -129,9 +129,6 @@ public: void WidgetQueueDraw() const; - static void refreshFontconfig( GtkSettings *pSettings ); - static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer ); - virtual void GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) override; GtkStyleContext* createStyleContext(gtk_widget_path_iter_set_object_nameFunc set_object_name, GtkControlPart ePart); diff --git a/vcl/inc/unx/pixmap.hxx b/vcl/inc/unx/pixmap.hxx deleted file mode 100644 index bc7f34612e4d..000000000000 --- a/vcl/inc/unx/pixmap.hxx +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_VCL_INC_UNX_PIXMAP_HXX -#define INCLUDED_VCL_INC_UNX_PIXMAP_HXX - -#include <X11/X.h> - -#include <unx/saltype.h> -#include <vclpluginapi.h> - -class VCLPLUG_GEN_PUBLIC X11Pixmap -{ -public: - X11Pixmap( int nWidth, int nHeight ) - { - mnWidth = nWidth; - mnHeight = nHeight; - } - - virtual ~X11Pixmap() {}; - - virtual int GetDepth() const = 0; - virtual SalX11Screen GetScreen() const = 0; - virtual Pixmap GetPixmap() const = 0; - Drawable GetDrawable() const { return GetPixmap(); }; - int GetWidth() const { return mnWidth; }; - int GetHeight() const { return mnHeight; }; - -private: - int mnWidth; - int mnHeight; -}; - -#endif // INCLUDED_VCL_INC_UNX_PIXMAP_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 7d721253e4d0..bc98120d474c 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -391,7 +391,6 @@ public: unsigned int GetXScreenCount() const { return m_aScreens.size(); } const SalFrameSet& getFrames() const { return m_aFrames; } - bool IsNumLockFromXS() const { return bNumLockFromXS_; } std::list< SalObject* >& getSalObjects() { return m_aSalObjects; } }; diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index b93d263f33e7..dd75c47dee9f 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -263,19 +263,6 @@ public: void clipRegion(cairo_t* cr); #endif // ENABLE_CAIRO_CANVAS - bool TryRenderCachedNativeControl(ControlCacheKey& aControlCacheKey, - int nX, int nY); - - bool RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, - ControlCacheKey& aControlCacheKey); - - // fill a pixmap from a screen region - void FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ); - - // render a pixmap to the screen - bool RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ); - - /* use to handle GraphicsExpose/NoExpose after XCopyArea & friends * if pFrame is not NULL, corresponding Paint events are generated * and dispatched to pFrame @@ -300,8 +287,6 @@ public: unsigned int w, unsigned int h, int dest_x, int dest_y ); - static void releaseGlyphPeer(); - protected: using SalGraphics::SetClipRegion; void SetClipRegion( GC pGC, Region pXReg = nullptr ) const; diff --git a/vcl/inc/unx/x11/x11gdiimpl.h b/vcl/inc/unx/x11/x11gdiimpl.h index 3c33c5415eef..6c2e8be7fb86 100644 --- a/vcl/inc/unx/x11/x11gdiimpl.h +++ b/vcl/inc/unx/x11/x11gdiimpl.h @@ -10,7 +10,6 @@ #ifndef INCLUDED_VCL_INC_UNX_X11_X11GDIIMPL_HXX #define INCLUDED_VCL_INC_UNX_X11_X11GDIIMPL_HXX -#include <unx/pixmap.hxx> #include <ControlCacheKey.hxx> class ControlCacheKey; @@ -20,12 +19,7 @@ class X11GraphicsImpl public: virtual ~X11GraphicsImpl() {}; - virtual void FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) = 0; - virtual bool RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ) = 0; - virtual bool TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY) = 0; - virtual bool RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, - ControlCacheKey& aControlCacheKey) = 0; }; #endif // INCLUDED_VCL_INC_UNX_X11_X11GDIIMPL_HXX diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx index fc979912b866..b98d11db3d7f 100644 --- a/vcl/inc/wizdlg.hxx +++ b/vcl/inc/wizdlg.hxx @@ -127,8 +127,6 @@ namespace vcl virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; - bool ShowPrevPage(); - bool ShowNextPage(); bool ShowPage( sal_uInt16 nLevel ); bool Finish( long nResult = 0 ); sal_uInt16 GetCurLevel() const { return mnCurLevel; } @@ -150,33 +148,16 @@ namespace vcl void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; } const Size& GetPageSizePixel() const { return maPageSize; } - void SetActivatePageHdl( const Link<RoadmapWizard*,void>& rLink ) { maActivateHdl = rLink; } - /// enable (or disable) buttons void enableButtons(WizardButtonFlags _nWizardButtonFlags, bool _bEnable); /// set the default style for a button - void defaultButton(WizardButtonFlags _nWizardButtonFlags); - /// set the default style for a button void defaultButton(PushButton* _pNewDefButton); - /// set the base of the title to use - the title of the current page is appended - void setTitleBase(const OUString& _rTitleBase); - /// determines whether there is a next state to which we can advance bool canAdvance() const; - /** updates the user interface which deals with traveling in the wizard - - The default implementation simply checks whether both the current page and the wizard - itself allow to advance to the next state (<code>canAdvance</code>), and enables the "Next" - button if and only if this is the case. - */ - void updateTravelUI(); - void SetRoadmapHelpId( const OString& _rId ); - void SetRoadmapInteractive( bool _bInteractive ); - void InsertRoadmapItem(int nIndex, const OUString& rLabel, int nId, bool bEnabled); void DeleteRoadmapItems(); int GetCurrentRoadmapItemID() const; @@ -233,29 +214,12 @@ namespace vcl If this is <TRUE/>, then upon entering a new state, the "Next" button will automatically be enabled if and only if determineNextState does not return WZS_INVALID_STATE. */ - void enableAutomaticNextButtonState(); bool isAutomaticNextButtonStateEnabled() const; /** removes a page from the history. Should be called when the page is being disabled */ void removePageFromHistory(WizardTypes::WizardState nToRemove); - /** skip a state - - The method behaves as if from the current state, <arg>_nSteps</arg> <method>travelNext</method>s were - called, but without actually creating or displaying the \EDntermediate pages. Only the - (<arg>_nSteps</arg> + 1)th page is created. - - The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them. - - A very essential precondition for using this method is that your <method>determineNextState</method> - method is able to determine the next state without actually having the page of the current state. - - @see skipUntil - @see skipBackwardUntil - */ - void skip(); - /** skips one or more states, until a given state is reached The method behaves as if from the current state, <method>travelNext</method>s were called @@ -302,25 +266,6 @@ namespace vcl */ void getStateHistory(std::vector<WizardTypes::WizardState>& out_rHistory); - /** declares a valid path in the wizard - - The very first path which is declared is automatically activated. - - Note that all paths which are declared must have the very first state in - common. Also note that due to a restriction of the very base class (WizardDialog), - this common first state must be 0. - - You cannot declare new paths once the wizard started, so it's recommended that - you do all declarations within your derivee's constructor. - - @see activatePath - - @param _nId - the unique id you wish to give this path. This id can later on be used - to refer to the path which you just declared - */ - void declarePath( RoadmapWizardTypes::PathId _nPathId, const RoadmapWizardTypes::WizardPath& _lWizardStates); - /** activates a path which has previously been declared with <member>declarePath</member> You can only activate paths which share the first <code>k</code> states with the path @@ -354,32 +299,6 @@ namespace vcl */ void activatePath( RoadmapWizardTypes::PathId _nPathId, bool _bDecideForIt = false ); - /** en- or disables a state - - In the wizard's roadmap, states to travel to can be freely chosen. To prevent - users from selecting a state which is currently not available, you can declare this - state as being disabled. - - A situation where you need this may be when you have a checkbox which, when checked - by the user, enables a page with additional settings. As long as this checkbox is - not checked, the respective state would be disabled. - - Note that in theory, you can declare multiple paths, instead of disabling states. - For instance, if you have a path where one state can be potentially disabled, then - you could declare a second path, which does not contain this state. However, the - disadvantage is that then, not the complete path would be visible in the roadmap, - but only all steps up to the point where the both paths diverge.<br/> - Another disadvantage is that the number of needed paths grows exponentially with - the number of states which can be potentially disabled. - - @see declarePath - */ - void enableState(WizardTypes::WizardState nState, bool _bEnable = true); - - /** returns true if and only if the given state is known in at least one declared path - */ - bool knowsState(WizardTypes::WizardState nState) const; - /** returns a human readable name for a given state There is a default implementation for this method, which returns the display name diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx index db4940c41abd..c9ae89b04d1f 100644 --- a/vcl/opengl/x11/gdiimpl.cxx +++ b/vcl/opengl/x11/gdiimpl.cxx @@ -12,7 +12,6 @@ #include <svdata.hxx> -#include <unx/pixmap.hxx> #include <unx/saldisp.hxx> #include <unx/salframe.h> #include <unx/salgdi.h> @@ -596,184 +595,11 @@ void X11OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* OpenGLSalGraphicsImpl::DoCopyBits( rPosAry, *pImpl ); } -void X11OpenGLSalGraphicsImpl::FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) -{ - Display* pDisplay = mrX11Parent.GetXDisplay(); - SalX11Screen nScreen = mrX11Parent.GetScreenNumber(); - XVisualInfo aVisualInfo; - XImage* pImage; - char* pData; - - SAL_INFO( "vcl.opengl", "FillPixmapFromScreen" ); - - if (!SalDisplay::BestOpenGLVisual(pDisplay, nScreen.getXScreen(), aVisualInfo)) - return; - - // make sure everything is synced up before reading back - mpContext->makeCurrent(); - glXWaitX(); - - // TODO: lfrb: What if offscreen? - pData = static_cast<char*>(malloc( pPixmap->GetWidth() * pPixmap->GetHeight() * 4 )); - glPixelStorei( GL_PACK_ALIGNMENT, 1 ); - CHECK_GL_ERROR(); - glReadPixels( nX, GetHeight() - nY, pPixmap->GetWidth(), pPixmap->GetHeight(), - GL_RGBA, GL_UNSIGNED_BYTE, pData ); - CHECK_GL_ERROR(); - - pImage = XCreateImage( pDisplay, aVisualInfo.visual, 24, ZPixmap, 0, pData, - pPixmap->GetWidth(), pPixmap->GetHeight(), 8, 0 ); - XInitImage( pImage ); - GC aGC = XCreateGC( pDisplay, pPixmap->GetPixmap(), 0, nullptr ); - XPutImage( pDisplay, pPixmap->GetDrawable(), aGC, pImage, - 0, 0, 0, 0, pPixmap->GetWidth(), pPixmap->GetHeight() ); - XFreeGC( pDisplay, aGC ); - XDestroyImage( pImage ); -} - typedef typename std::pair<ControlCacheKey, std::unique_ptr<TextureCombo>> ControlCachePair; typedef o3tl::lru_map<ControlCacheKey, std::unique_ptr<TextureCombo>, ControlCacheHashFunction> ControlCacheType; static vcl::DeleteOnDeinit<ControlCacheType> gTextureCache(new ControlCacheType(200)); -namespace -{ - GLXFBConfig GetPixmapFBConfig( Display* pDisplay, bool& bInverted ) - { - OpenGLZone aZone; - - int nScreen = DefaultScreen( pDisplay ); - GLXFBConfig *aFbConfigs; - int i, nFbConfigs, nValue; - - aFbConfigs = glXGetFBConfigs( pDisplay, nScreen, &nFbConfigs ); - for( i = 0; i < nFbConfigs; i++ ) - { - glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_DRAWABLE_TYPE, &nValue ); - if( !(nValue & GLX_PIXMAP_BIT) ) - continue; - - glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &nValue ); - if( !(nValue & GLX_TEXTURE_2D_BIT_EXT) ) - continue; - - glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_DEPTH_SIZE, &nValue ); - if( nValue != 24 ) - continue; - - glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_RED_SIZE, &nValue ); - if( nValue != 8 ) - continue; - SAL_INFO( "vcl.opengl", "Red is " << nValue ); - - // TODO: lfrb: Make it configurable wrt RGB/RGBA - glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_BIND_TO_TEXTURE_RGB_EXT, &nValue ); - if( nValue == False ) - { - glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_BIND_TO_TEXTURE_RGBA_EXT, &nValue ); - if( nValue == False ) - continue; - } - - glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_Y_INVERTED_EXT, &nValue ); - - // Looks like that X sends GLX_DONT_CARE but this usually means "true" for most - // of the X implementations. Investigation on internet pointed that this could be - // safely "true" all the time (for example gnome-shell always assumes "true"). - bInverted = nValue == True || nValue == int(GLX_DONT_CARE); - - break; - } - - if( i == nFbConfigs ) - { - SAL_WARN( "vcl.opengl", "Unable to find FBconfig for pixmap texturing" ); - return nullptr; - } - - CHECK_GL_ERROR(); - return aFbConfigs[i]; - } -} - -void X11OpenGLSalGraphicsImpl::RenderPixmap(X11Pixmap const * pPixmap, X11Pixmap const * pMask, int nX, int nY, TextureCombo& rCombo) -{ - const int aAttribs[] = - { - GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT, - GLX_TEXTURE_FORMAT_EXT, GLX_TEXTURE_FORMAT_RGBA_EXT, - None - }; - - Display* pDisplay = mrX11Parent.GetXDisplay(); - bool bInverted = false; - - const long nWidth = pPixmap->GetWidth(); - const long nHeight = pPixmap->GetHeight(); - SalTwoRect aPosAry(0, 0, nWidth, nHeight, nX, nY, nWidth, nHeight); - - PreDraw(); - //glClear( GL_COLOR_BUFFER_BIT ); - - XSync( pDisplay, 0 ); - GLXFBConfig pFbConfig = GetPixmapFBConfig( pDisplay, bInverted ); - GLXPixmap pGlxPixmap = glXCreatePixmap( pDisplay, pFbConfig, pPixmap->GetPixmap(), aAttribs); - GLXPixmap pGlxMask; - if( pMask != nullptr ) - pGlxMask = glXCreatePixmap( pDisplay, pFbConfig, pMask->GetPixmap(), aAttribs); - else - pGlxMask = 0; - XSync( pDisplay, 0 ); - - if( !pGlxPixmap ) - SAL_WARN( "vcl.opengl", "Couldn't create GLXPixmap" ); - - //TODO: lfrb: glXGetProc to get the functions - - rCombo.mpTexture.reset(new OpenGLTexture(pPixmap->GetWidth(), pPixmap->GetHeight(), false)); - - mpContext->state().texture().active(0); - - rCombo.mpTexture->Bind(); - glXBindTexImageEXT( pDisplay, pGlxPixmap, GLX_FRONT_LEFT_EXT, nullptr ); - rCombo.mpTexture->Unbind(); - - if( pMask != nullptr && pGlxMask ) - { - rCombo.mpMask.reset(new OpenGLTexture(pPixmap->GetWidth(), pPixmap->GetHeight(), false)); - rCombo.mpMask->Bind(); - glXBindTexImageEXT( pDisplay, pGlxMask, GLX_FRONT_LEFT_EXT, nullptr ); - rCombo.mpMask->Unbind(); - - DrawTextureDiff(*rCombo.mpTexture, *rCombo.mpMask, aPosAry, bInverted); - - glXReleaseTexImageEXT( pDisplay, pGlxMask, GLX_FRONT_LEFT_EXT ); - glXDestroyPixmap( pDisplay, pGlxMask ); - } - else - { - DrawTexture(*rCombo.mpTexture, aPosAry, bInverted); - } - - CHECK_GL_ERROR(); - - glXReleaseTexImageEXT( pDisplay, pGlxPixmap, GLX_FRONT_LEFT_EXT ); - glXDestroyPixmap( pDisplay, pGlxPixmap ); - - PostDraw(); - - CHECK_GL_ERROR(); -} - -bool X11OpenGLSalGraphicsImpl::RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ) -{ - SAL_INFO( "vcl.opengl", "RenderPixmapToScreen (" << nX << " " << nY << ")" ); - - TextureCombo aCombo; - RenderPixmap(pPixmap, pMask, nX, nY, aCombo); - return true; -} - bool X11OpenGLSalGraphicsImpl::TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY) { static bool gbCacheEnabled = !getenv("SAL_WITHOUT_WIDGET_CACHE"); @@ -805,20 +631,4 @@ bool X11OpenGLSalGraphicsImpl::TryRenderCachedNativeControl(ControlCacheKey& rCo return true; } -bool X11OpenGLSalGraphicsImpl::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, - ControlCacheKey& aControlCacheKey) -{ - std::unique_ptr<TextureCombo> pCombo(new TextureCombo); - RenderPixmap(pPixmap, pMask, nX, nY, *pCombo); - - if (!aControlCacheKey.canCacheControl()) - return true; - - ControlCachePair pair(aControlCacheKey, std::move(pCombo)); - if (gTextureCache.get()) - gTextureCache.get()->insert(std::move(pair)); - - return true; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index fdd524e06f20..837a42499c7e 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -1875,13 +1875,6 @@ StyleSettings::GetDialogStyle() const } void -StyleSettings::SetDialogStyle( const DialogStyle& rStyle ) -{ - CopyData(); - mxData->maDialogStyle = rStyle; -} - -void StyleSettings::SetEdgeBlending(sal_uInt16 nCount) { CopyData(); diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx index a046db704de0..513f319cbf45 100644 --- a/vcl/source/control/roadmapwizard.cxx +++ b/vcl/source/control/roadmapwizard.cxx @@ -226,23 +226,6 @@ namespace vcl m_xAssistant->set_page_side_help_id(rId); } - void RoadmapWizard::SetRoadmapInteractive( bool _bInteractive ) - { - m_xRoadmapImpl->pRoadmap->SetRoadmapInteractive( _bInteractive ); - } - - void RoadmapWizard::declarePath( PathId _nPathId, const WizardPath& _lWizardStates) - { - - m_xRoadmapImpl->aPaths.emplace( _nPathId, _lWizardStates ); - - if ( m_xRoadmapImpl->aPaths.size() == 1 ) - // the very first path -> activate it - activatePath( _nPathId ); - else - implUpdateRoadmap( ); - } - void RoadmapWizardMachine::declarePath( PathId _nPathId, const WizardPath& _lWizardStates) { m_pImpl->aPaths.emplace( _nPathId, _lWizardStates ); @@ -664,34 +647,6 @@ namespace vcl return *rPath.rbegin() != getCurrentState(); } - void RoadmapWizard::updateTravelUI() - { - const IWizardPageController* pController = getPageController( GetPage( getCurrentState() ) ); - OSL_ENSURE( pController != nullptr, "RoadmapWizard::updateTravelUI: no controller for the current page!" ); - - bool bCanAdvance = - ( !pController || pController->canAdvance() ) // the current page allows to advance - && canAdvance(); // the dialog as a whole allows to advance - enableButtons( WizardButtonFlags::NEXT, bCanAdvance ); - - // disable the "Previous" button if all states in our history are disabled - std::vector< WizardTypes::WizardState > aHistory; - getStateHistory( aHistory ); - bool bHaveEnabledState = false; - for (auto const& state : aHistory) - { - if ( isStateEnabled(state) ) - { - bHaveEnabledState = true; - break; - } - } - - enableButtons( WizardButtonFlags::PREVIOUS, bHaveEnabledState ); - - implUpdateRoadmap(); - } - void RoadmapWizardMachine::updateTravelUI() { WizardMachine::updateTravelUI(); @@ -866,21 +821,6 @@ namespace vcl return pPage; } - void RoadmapWizard::enableState( WizardTypes::WizardState _nState, bool _bEnable ) - { - // remember this (in case the state appears in the roadmap later on) - if ( _bEnable ) - m_xRoadmapImpl->aDisabledStates.erase( _nState ); - else - { - m_xRoadmapImpl->aDisabledStates.insert( _nState ); - removePageFromHistory( _nState ); - } - - // if the state is currently in the roadmap, reflect it's new status - m_xRoadmapImpl->pRoadmap->EnableRoadmapItem( static_cast<RoadmapTypes::ItemId>(_nState), _bEnable ); - } - void RoadmapWizardMachine::enableState( WizardTypes::WizardState _nState, bool _bEnable ) { // remember this (in case the state appears in the roadmap later on) @@ -896,19 +836,6 @@ namespace vcl m_xAssistant->set_page_sensitive(OString::number(_nState), _bEnable); } - bool RoadmapWizard::knowsState( WizardTypes::WizardState i_nState ) const - { - for (auto const& path : m_xRoadmapImpl->aPaths) - { - for (auto const& state : path.second) - { - if ( state == i_nState ) - return true; - } - } - return false; - } - bool RoadmapWizardMachine::knowsState( WizardTypes::WizardState i_nState ) const { for (auto const& path : m_pImpl->aPaths) diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx index 8944725b996b..c049f9a3e987 100644 --- a/vcl/source/control/wizardmachine.cxx +++ b/vcl/source/control/wizardmachine.cxx @@ -535,12 +535,6 @@ namespace vcl return Dialog::EventNotify( rNEvt ); } - void RoadmapWizard::setTitleBase(const OUString& _rTitleBase) - { - m_xWizardImpl->sTitleBase = _rTitleBase; - implUpdateTitle(); - } - TabPage* RoadmapWizard::GetOrCreatePage( const WizardTypes::WizardState i_nState ) { if ( nullptr == GetPage( i_nState ) ) @@ -578,39 +572,6 @@ namespace vcl enterState( nCurrentLevel ); } - void RoadmapWizard::defaultButton(WizardButtonFlags _nWizardButtonFlags) - { - // the new default button - PushButton* pNewDefButton = nullptr; - if (m_pFinish && (_nWizardButtonFlags & WizardButtonFlags::FINISH)) - pNewDefButton = m_pFinish; - if (m_pNextPage && (_nWizardButtonFlags & WizardButtonFlags::NEXT)) - pNewDefButton = m_pNextPage; - if (m_pPrevPage && (_nWizardButtonFlags & WizardButtonFlags::PREVIOUS)) - pNewDefButton = m_pPrevPage; - if (m_pHelp && (_nWizardButtonFlags & WizardButtonFlags::HELP)) - pNewDefButton = m_pHelp; - if (m_pCancel && (_nWizardButtonFlags & WizardButtonFlags::CANCEL)) - pNewDefButton = m_pCancel; - - if ( pNewDefButton ) - defaultButton( pNewDefButton ); - else - implResetDefault( this ); - } - - bool RoadmapWizard::ShowNextPage() - { - return ShowPage( mnCurLevel+1 ); - } - - bool RoadmapWizard::ShowPrevPage() - { - if ( !mnCurLevel ) - return false; - return ShowPage( mnCurLevel-1 ); - } - bool RoadmapWizard::ShowPage( sal_uInt16 nLevel ) { mnCurLevel = nLevel; @@ -892,39 +853,6 @@ namespace vcl return true; } - void RoadmapWizard::skip() - { - // allowed to leave the current page? - if ( !prepareLeaveCurrentState( WizardTypes::eTravelForward ) ) - return; - - WizardTypes::WizardState nCurrentState = getCurrentState(); - WizardTypes::WizardState nNextState = determineNextState(nCurrentState); - - if (WZS_INVALID_STATE == nNextState) - return; - - // remember the skipped state in the history - m_xWizardImpl->aStateHistory.push(nCurrentState); - - // get the next state - nCurrentState = nNextState; - - // show the (n+1)th page - if (!ShowPage(nCurrentState)) - { - // TODO: this leaves us in a state where we have no current page and an inconsistent state history. - // Perhaps we should rollback the skipping here... - OSL_FAIL("RoadmapWizard::skip: very unpolite..."); - // if somebody does a skip and then does not allow to leave... - // (can't be a commit error, as we've already committed the current page. So if ShowPage fails here, - // somebody behaves really strange...) - return; - } - - // all fine - } - bool RoadmapWizard::travelNext() { // allowed to leave the current page? @@ -993,11 +921,6 @@ namespace vcl } } - void RoadmapWizard::enableAutomaticNextButtonState() - { - m_xWizardImpl->m_bAutoNextButtonState = true; - } - bool RoadmapWizard::isAutomaticNextButtonStateEnabled() const { return m_xWizardImpl->m_bAutoNextButtonState; diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index ee2574c5e328..b455b2f8a56e 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -3547,12 +3547,6 @@ sal_uInt16 SvTreeListBox::GetCurrentTabPos() const return pImpl->GetCurrentTabPos(); } -void SvTreeListBox::InitStartEntry() -{ - if( !pImpl->m_pStartEntry ) - pImpl->m_pStartEntry = GetModel()->First(); -} - VclPtr<PopupMenu> SvTreeListBox::CreateContextMenu() { return nullptr; diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index a511488e53a1..de51359b6e6e 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -154,69 +154,11 @@ void X11SalGraphicsImpl::Init() mnBrushPixel = mrParent.GetPixel( mnBrushColor ); } -void X11SalGraphicsImpl::FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) -{ - //TODO lfrb: don't hardcode the depth - Display* pDpy = mrParent.GetXDisplay(); - GC aTmpGC = XCreateGC( pDpy, pPixmap->GetPixmap(), 0, nullptr ); - - if( !aTmpGC ) - { - SAL_WARN( "vcl", "Could not create GC from screen" ); - return; - } - - // Copy the background of the screen into a composite pixmap - X11SalGraphics::CopyScreenArea( mrParent.GetXDisplay(), - mrParent.GetDrawable(), mrParent.GetScreenNumber(), - mrParent.GetVisual().GetDepth(), - pPixmap->GetDrawable(), pPixmap->GetScreen(), - pPixmap->GetDepth(), - aTmpGC, - nX, nY, pPixmap->GetWidth(), pPixmap->GetHeight(), - 0, 0 ); - - XFreeGC( pDpy, aTmpGC ); -} - -bool X11SalGraphicsImpl::RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* /*Mask*/, int nX, int nY ) -{ - // TODO: lfrb: Use the mask - GC aFontGC = mrParent.GetFontGC(); - - // The GC can't be null, otherwise we'd have no clip region - if( aFontGC == nullptr ) - { - SAL_WARN( "vcl", "no valid GC to render pixmap" ); - return false; - } - - if( !pPixmap ) - return false; - - X11SalGraphics::CopyScreenArea( mrParent.GetXDisplay(), - pPixmap->GetDrawable(), pPixmap->GetScreen(), - pPixmap->GetDepth(), - mrParent.GetDrawable(), mrParent.m_nXScreen, - mrParent.GetVisual().GetDepth(), - aFontGC, - 0, 0, - pPixmap->GetWidth(), pPixmap->GetHeight(), - nX, nY ); - return true; -} - bool X11SalGraphicsImpl::TryRenderCachedNativeControl(ControlCacheKey& /*rControlCacheKey*/, int /*nX*/, int /*nY*/) { return false; } -bool X11SalGraphicsImpl::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, - ControlCacheKey& /*rControlCacheKey*/) -{ - return RenderPixmapToScreen(pPixmap, pMask, nX, nY); -} - XID X11SalGraphicsImpl::GetXRenderPicture() { XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx index 40f52f337170..0b4861896b5e 100644 --- a/vcl/unx/generic/gdi/gdiimpl.hxx +++ b/vcl/unx/generic/gdi/gdiimpl.hxx @@ -286,13 +286,9 @@ public: // implementation of X11GraphicsImpl void Init() override; - void FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) override; - bool RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ) override; virtual bool TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY) override; - virtual bool RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, - ControlCacheKey& aControlCacheKey) override; }; #endif diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index 75b742eb4285..7f470488bdd0 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -22,7 +22,6 @@ #include <vcl/sysdata.hxx> #include <sal/log.hxx> -#include <unx/pixmap.hxx> #include <unx/saldisp.hxx> #include <unx/salbmp.h> #include <unx/salgdi.h> @@ -69,34 +68,6 @@ void X11SalGraphics::CopyScreenArea( Display* pDisplay, } } -void X11SalGraphics::FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) -{ - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); - rImpl.FillPixmapFromScreen( pPixmap, nX, nY ); -} - -bool X11SalGraphics::RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ) -{ - SAL_INFO( "vcl", "RenderPixmapToScreen" ); - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); - return rImpl.RenderPixmapToScreen( pPixmap, pMask, nX, nY ); -} - -bool X11SalGraphics::TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY) -{ - SAL_INFO( "vcl", "TryRenderCachedNativeControl" ); - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); - return rImpl.TryRenderCachedNativeControl(rControlCacheKey, nX, nY); -} - -bool X11SalGraphics::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, - ControlCacheKey& rControlCacheKey) -{ - SAL_INFO( "vcl", "RenderAndCachePixmap" ); - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); - return rImpl.RenderAndCacheNativeControl(pPixmap, pMask, nX, nY, rControlCacheKey); -} - extern "C" { static Bool GraphicsExposePredicate( Display*, XEvent* pEvent, const XPointer pFrameWindow ) diff --git a/vcl/unx/gtk3/a11y/atkutil.hxx b/vcl/unx/gtk3/a11y/atkutil.hxx index cb4a005157a0..3df45c1cadfb 100644 --- a/vcl/unx/gtk3/a11y/atkutil.hxx +++ b/vcl/unx/gtk3/a11y/atkutil.hxx @@ -22,7 +22,6 @@ #include <atk/atk.h> -GType ooo_atk_util_get_type(); void ooo_atk_util_ensure_event_listener(); #endif diff --git a/vcl/unx/gtk3/a11y/atkwindow.hxx b/vcl/unx/gtk3/a11y/atkwindow.hxx deleted file mode 100644 index 35a4bcedf486..000000000000 --- a/vcl/unx/gtk3/a11y/atkwindow.hxx +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_UNX_GTK_A11Y_ATKWINDOW_HXX -#define INCLUDED_VCL_UNX_GTK_A11Y_ATKWINDOW_HXX - -#include <atk/atk.h> - -GType ooo_window_wrapper_get_type(); -void restore_gail_window_vtable(); - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx b/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx index 0e2781cf8fd5..90cb06ef0647 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx @@ -22,7 +22,6 @@ #include "atkfactory.hxx" #include "atkutil.hxx" -#include "atkwindow.hxx" bool InitAtkBridge() { diff --git a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx index 50ed2793bbf0..1b920fe42c9c 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx @@ -699,45 +699,6 @@ static Link<VclSimpleEvent&,void> g_aEventListenerLink( nullptr, WindowEventHand /*****************************************************************************/ -extern "C" { - -static const gchar * -ooo_atk_util_get_toolkit_name() -{ - return "VCL"; -} - -/*****************************************************************************/ - -static const gchar * -ooo_atk_util_get_toolkit_version() -{ - return LIBO_VERSION_DOTTED; -} - -/*****************************************************************************/ - -/* - * GObject inheritance - */ - -static void -ooo_atk_util_class_init (AtkUtilClass *) -{ - AtkUtilClass *atk_class; - gpointer data; - - data = g_type_class_peek (ATK_TYPE_UTIL); - atk_class = ATK_UTIL_CLASS (data); - - atk_class->get_toolkit_name = ooo_atk_util_get_toolkit_name; - atk_class->get_toolkit_version = ooo_atk_util_get_toolkit_version; - - ooo_atk_util_ensure_event_listener(); -} - -} // extern "C" - void ooo_atk_util_ensure_event_listener() { static bool bInited; @@ -748,42 +709,4 @@ void ooo_atk_util_ensure_event_listener() } } -GType -ooo_atk_util_get_type() -{ - static GType type = 0; - - if (!type) - { - GType parent_type = g_type_from_name( "GailUtil" ); - - if( ! parent_type ) - { - g_warning( "Unknown type: GailUtil" ); - parent_type = ATK_TYPE_UTIL; - } - - GTypeQuery type_query; - g_type_query( parent_type, &type_query ); - - static const GTypeInfo typeInfo = - { - static_cast<guint16>(type_query.class_size), - nullptr, - nullptr, - reinterpret_cast<GClassInitFunc>(ooo_atk_util_class_init), - nullptr, - nullptr, - static_cast<guint16>(type_query.instance_size), - 0, - nullptr, - nullptr - } ; - - type = g_type_register_static (parent_type, "OOoUtil", &typeInfo, GTypeFlags(0)) ; - } - - return type; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx b/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx deleted file mode 100644 index eb72edf4908c..000000000000 --- a/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx +++ /dev/null @@ -1,330 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <unx/gtk/gtkframe.hxx> -#include <vcl/svapp.hxx> -#include <vcl/window.hxx> -#include <vcl/popupmenuwindow.hxx> -#include <sal/log.hxx> - -#include "atkwindow.hxx" -#include "atkwrapper.hxx" -#include "atkregistry.hxx" - -#include <com/sun/star/accessibility/AccessibleRole.hpp> - -using namespace ::com::sun::star::accessibility; -using namespace ::com::sun::star::uno; - -extern "C" { - -static void (* window_real_initialize) (AtkObject *obj, gpointer data) = nullptr; -static void (* window_real_finalize) (GObject *obj) = nullptr; - -static void -init_from_window( AtkObject *accessible, vcl::Window const *pWindow ) -{ - static AtkRole aDefaultRole = ATK_ROLE_INVALID; - - // Special role for sub-menu and combo-box popups that are exposed directly - // by their parents already. - if( aDefaultRole == ATK_ROLE_INVALID ) - { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - aDefaultRole = atk_role_register( "redundant object" ); - SAL_WNODEPRECATED_DECLARATIONS_POP - } - - AtkRole role = aDefaultRole; - - // Determine the appropriate role for the GtkWindow - switch( pWindow->GetAccessibleRole() ) - { - case AccessibleRole::ALERT: - role = ATK_ROLE_ALERT; - break; - - case AccessibleRole::DIALOG: - role = ATK_ROLE_DIALOG; - break; - - case AccessibleRole::FRAME: - role = ATK_ROLE_FRAME; - break; - - /* Ignore window objects for sub-menus, combo- and list boxes, - * which are exposed as children of their parents. - */ - case AccessibleRole::WINDOW: - { - WindowType type = WindowType::WINDOW; - bool parentIsMenuFloatingWindow = false; - - vcl::Window *pParent = pWindow->GetParent(); - if( pParent ) { - type = pParent->GetType(); - parentIsMenuFloatingWindow = pParent->IsMenuFloatingWindow(); - } - - if( (WindowType::LISTBOX != type) && (WindowType::COMBOBOX != type) && - (WindowType::MENUBARWINDOW != type) && ! parentIsMenuFloatingWindow ) - { - role = ATK_ROLE_WINDOW; - } - } - break; - - default: - { - vcl::Window *pChild = pWindow->GetWindow(GetWindowType::FirstChild); - if( pChild ) - { - if( WindowType::HELPTEXTWINDOW == pChild->GetType() ) - { - role = ATK_ROLE_TOOL_TIP; - pChild->SetAccessibleRole( AccessibleRole::LABEL ); - accessible->name = g_strdup( OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); - } - else if ( pWindow->GetType() == WindowType::BORDERWINDOW && pChild->GetType() == WindowType::FLOATINGWINDOW ) - { - PopupMenuFloatingWindow* p = dynamic_cast<PopupMenuFloatingWindow*>(pChild); - if (p && p->IsPopupMenu() && p->GetMenuStackLevel() == 0) - { - // This is a top-level menu popup. Register it. - role = ATK_ROLE_POPUP_MENU; - pChild->SetAccessibleRole( AccessibleRole::POPUP_MENU ); - accessible->name = g_strdup( OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); - } - } - } - break; - } - } - - accessible->role = role; -} - -/*****************************************************************************/ - -static gboolean -ooo_window_wrapper_clear_focus(gpointer) -{ - SolarMutexGuard aGuard; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - atk_focus_tracker_notify( nullptr ); - SAL_WNODEPRECATED_DECLARATIONS_POP - return false; -} - -/*****************************************************************************/ - -static gboolean -ooo_window_wrapper_real_focus_gtk (GtkWidget *, GdkEventFocus *) -{ - g_idle_add( ooo_window_wrapper_clear_focus, nullptr ); - return false; -} - -static gboolean ooo_tooltip_map( GtkWidget* pToolTip, gpointer ) -{ - AtkObject* pAccessible = gtk_widget_get_accessible( pToolTip ); - if( pAccessible ) - atk_object_notify_state_change( pAccessible, ATK_STATE_SHOWING, TRUE ); - return FALSE; -} - -static gboolean ooo_tooltip_unmap( GtkWidget* pToolTip, gpointer ) -{ - AtkObject* pAccessible = gtk_widget_get_accessible( pToolTip ); - if( pAccessible ) - atk_object_notify_state_change( pAccessible, ATK_STATE_SHOWING, FALSE ); - return FALSE; -} - -/*****************************************************************************/ - -static bool -isChildPopupMenu(vcl::Window* pWindow) -{ - vcl::Window* pChild = pWindow->GetAccessibleChildWindow(0); - if (!pChild) - return false; - - if (WindowType::FLOATINGWINDOW != pChild->GetType()) - return false; - - PopupMenuFloatingWindow* p = dynamic_cast<PopupMenuFloatingWindow*>(pChild); - if (!p) - return false; - - return p->IsPopupMenu(); -} - -static void -ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data) -{ - window_real_initialize(obj, data); - - GtkSalFrame *pFrame = GtkSalFrame::getFromWindow( GTK_WINDOW( data ) ); - if( pFrame ) - { - vcl::Window *pWindow = pFrame->GetWindow(); - if( pWindow ) - { - init_from_window( obj, pWindow ); - - Reference< XAccessible > xAccessible( pWindow->GetAccessible() ); - - /* We need the wrapper object for the top-level XAccessible to be - * in the wrapper registry when atk traverses the hierarchy up on - * focus events - */ - if( WindowType::BORDERWINDOW == pWindow->GetType() ) - { - if ( isChildPopupMenu(pWindow) ) - { - AtkObject *child = atk_object_wrapper_new( xAccessible, obj ); - ooo_wrapper_registry_add( xAccessible, child ); - } - else - { - ooo_wrapper_registry_add( xAccessible, obj ); - g_object_set_data( G_OBJECT(obj), "ooo:atk-wrapper-key", xAccessible.get() ); - } - } - else - { - AtkObject *child = atk_object_wrapper_new( xAccessible, obj ); - child->role = ATK_ROLE_FILLER; - if( (ATK_ROLE_DIALOG == obj->role) || (ATK_ROLE_ALERT == obj->role) ) - child->role = ATK_ROLE_OPTION_PANE; - ooo_wrapper_registry_add( xAccessible, child ); - } - } - } - - g_signal_connect_after( GTK_WIDGET( data ), "focus-out-event", - G_CALLBACK (ooo_window_wrapper_real_focus_gtk), - nullptr); - - if( obj->role == ATK_ROLE_TOOL_TIP ) - { - g_signal_connect_after( GTK_WIDGET( data ), "map-event", - G_CALLBACK (ooo_tooltip_map), - nullptr); - g_signal_connect_after( GTK_WIDGET( data ), "unmap-event", - G_CALLBACK (ooo_tooltip_unmap), - nullptr); - } -} - -/*****************************************************************************/ - -static void -ooo_window_wrapper_real_finalize (GObject *obj) -{ - ooo_wrapper_registry_remove( static_cast<XAccessible *>(g_object_get_data( obj, "ooo:atk-wrapper-key" ))); - window_real_finalize( obj ); -} - -/*****************************************************************************/ - -static void -ooo_window_wrapper_class_init (AtkObjectClass *klass, gpointer) -{ - AtkObjectClass *atk_class; - GObjectClass *gobject_class; - gpointer data; - - /* - * Patch the gobject vtable of GailWindow to refer to our instance of - * "initialize". - */ - - data = g_type_class_peek_parent( klass ); - atk_class = ATK_OBJECT_CLASS (data); - - window_real_initialize = atk_class->initialize; - atk_class->initialize = ooo_window_wrapper_real_initialize; - - gobject_class = G_OBJECT_CLASS (data); - - window_real_finalize = gobject_class->finalize; - gobject_class->finalize = ooo_window_wrapper_real_finalize; -} - -} // extern "C" - -/*****************************************************************************/ - -GType -ooo_window_wrapper_get_type() -{ - static GType type = 0; - - if (!type) - { - GType parent_type = g_type_from_name( "GailWindow" ); - - if( ! parent_type ) - { - SAL_INFO("vcl.a11y", "Unknown type: GailWindow"); - parent_type = ATK_TYPE_OBJECT; - } - - GTypeQuery type_query; - g_type_query( parent_type, &type_query ); - - static const GTypeInfo typeInfo = - { - static_cast<guint16>(type_query.class_size), - nullptr, - nullptr, - reinterpret_cast<GClassInitFunc>(ooo_window_wrapper_class_init), - nullptr, - nullptr, - static_cast<guint16>(type_query.instance_size), - 0, - nullptr, - nullptr - } ; - - type = g_type_register_static (parent_type, "OOoWindowAtkObject", &typeInfo, GTypeFlags(0)) ; - } - - return type; -} - -void restore_gail_window_vtable() -{ - AtkObjectClass *atk_class; - gpointer data; - - GType type = g_type_from_name( "GailWindow" ); - - if( type == G_TYPE_INVALID ) - return; - - data = g_type_class_peek( type ); - atk_class = ATK_OBJECT_CLASS (data); - - atk_class->initialize = window_real_initialize; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |