diff options
Diffstat (limited to 'vcl/unx')
27 files changed, 142 insertions, 4 deletions
diff --git a/vcl/unx/generic/app/i18n_im.cxx b/vcl/unx/generic/app/i18n_im.cxx index 56a0d3f3e82a..18ad9a3f0f8a 100644 --- a/vcl/unx/generic/app/i18n_im.cxx +++ b/vcl/unx/generic/app/i18n_im.cxx @@ -40,6 +40,8 @@ using namespace vcl; // kinput2 IME needs special key handling since key release events are filtered in // preeditmode and XmbResetIC does not work +namespace { + class XKeyEventOp : public XKeyEvent { private: @@ -53,6 +55,8 @@ class XKeyEventOp : public XKeyEvent bool match (const XKeyEvent &rEvent) const; }; +} + void XKeyEventOp::init() { diff --git a/vcl/unx/generic/app/i18n_keysym.cxx b/vcl/unx/generic/app/i18n_keysym.cxx index 53b1ae7e642e..a77632a3e70d 100644 --- a/vcl/unx/generic/app/i18n_keysym.cxx +++ b/vcl/unx/generic/app/i18n_keysym.cxx @@ -26,11 +26,15 @@ // for all keysyms with byte1 and byte2 equal zero, and of course only for // keysyms that have a unicode counterpart +namespace { + struct keymap_t { const int first; const int last; const sal_Unicode *map; }; +} + // Latin-1 Byte 3 = 0x00 const sal_Unicode keymap00_map[] = { 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx index 8e5788275263..e1d112adad22 100644 --- a/vcl/unx/generic/app/keysymnames.cxx +++ b/vcl/unx/generic/app/keysymnames.cxx @@ -39,6 +39,8 @@ namespace vcl_sal { + namespace { + struct KeysymNameReplacement { KeySym const aSymbol; @@ -52,6 +54,8 @@ namespace vcl_sal { int const nReplacements; }; + } + // CAUTION CAUTION CAUTION // every string value in the replacements tables must be in UTF8 // be careful with your editor ! diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index 42dc10e0fc85..e48e71761b60 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -551,6 +551,8 @@ void X11SalData::Timeout() pSVData->maSchedCtx.mpSalTimer->CallCallback(); } +namespace { + struct YieldEntry { int fd; // file descriptor for reading @@ -564,6 +566,8 @@ struct YieldEntry void HandleNextEvent() const { handle( fd, data ); } }; +} + #define MAX_NUM_DESCRIPTORS 128 static YieldEntry yieldTable[ MAX_NUM_DESCRIPTORS ]; diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 8a076e762f4a..2d97bb88dc02 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -85,12 +85,16 @@ SalX11Display* X11SalInstance::CreateDisplay() const // AnyInput from sv/mow/source/app/svapp.cxx +namespace { + struct PredicateReturn { VclInputFlags nType; bool bRet; }; +} + extern "C" { static Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) { diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index 8bd45098ef3c..02659996768c 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -77,12 +77,16 @@ public: using namespace vcl_sal; +namespace { + struct WMAdaptorProtocol { const char* pProtocol; int nProtocol; }; +} + /* * table must be sorted ascending in strings * since it is use with bsearch diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index e9c00d0174fb..54340ba23606 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -104,6 +104,8 @@ extern "C" static const long nXdndProtocolRevision = 5; +namespace { + // mapping between mime types (or what the office thinks of mime types) // and X convention types struct NativeTypeEntry @@ -114,6 +116,8 @@ struct NativeTypeEntry int const nFormat; // the corresponding format }; +} + // the convention for Xdnd is mime types as specified by the corresponding // RFC's with the addition that text/plain without charset tag contains iso8859-1 // sadly some applications (e.g. gtk) do not honor the mimetype only rule, diff --git a/vcl/unx/generic/dtrans/config.cxx b/vcl/unx/generic/dtrans/config.cxx index 5a8266c804e8..7ee1f18e8138 100644 --- a/vcl/unx/generic/dtrans/config.cxx +++ b/vcl/unx/generic/dtrans/config.cxx @@ -28,6 +28,8 @@ namespace x11 { +namespace { + class DtransX11ConfigItem : public ::utl::ConfigItem { sal_Int32 m_nSelectionTimeout; @@ -43,6 +45,8 @@ public: } +} + using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace x11; diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 75343a41b771..821d030c1d24 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -52,7 +52,6 @@ using namespace osl; namespace { typedef std::pair<FcChar8*, FcChar8*> lang_and_element; -} class FontCfgWrapper { @@ -83,6 +82,8 @@ private: std::unique_ptr<LanguageTag> m_pLanguageTag; }; +} + FontCfgWrapper::FontCfgWrapper() : m_pFontSet( nullptr ) { diff --git a/vcl/unx/generic/fontmanager/fontsubst.cxx b/vcl/unx/generic/fontmanager/fontsubst.cxx index a8adb6cf89fd..1b8fb5807bee 100644 --- a/vcl/unx/generic/fontmanager/fontsubst.cxx +++ b/vcl/unx/generic/fontmanager/fontsubst.cxx @@ -24,6 +24,8 @@ // platform specific font substitution hooks +namespace { + class FcPreMatchSubstitution : public ImplPreMatchFontSubstitution { @@ -43,6 +45,8 @@ public: bool FindFontSubstitute(FontSelectPattern&, LogicalFontInstance* pLogicalFont, OUString& rMissingCodes) const override; }; +} + void SalGenericInstance::RegisterFontSubstitutors( PhysicalFontCollection* pFontCollection ) { // register font fallback substitutions diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 52a3bd73a618..80d8c82ae22b 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -1570,6 +1570,8 @@ bool X11SalGraphicsImpl::drawFilledTriangles( return true; } +namespace { + class SystemDependentData_Triangulation : public basegfx::SystemDependentData { private: @@ -1601,6 +1603,8 @@ public: virtual sal_Int64 estimateUsageInBytes() const override; }; +} + SystemDependentData_Triangulation::SystemDependentData_Triangulation( basegfx::SystemDependentDataManager& rSystemDependentDataManager, const basegfx::triangulator::B2DTriangleVector& rTriangles, diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 5d64fc08c4a1..a4f9fce70e94 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -711,6 +711,8 @@ bool FreetypeFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) // outline stuff +namespace { + class PolyArgs { public: @@ -740,6 +742,8 @@ private: PolyArgs& operator=(const PolyArgs&) = delete; }; +} + PolyArgs::PolyArgs( tools::PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints ) : mrPolyPoly(rPolyPoly), mnMaxPoints(nMaxPoints), diff --git a/vcl/unx/generic/print/bitmap_gfx.cxx b/vcl/unx/generic/print/bitmap_gfx.cxx index f58e77d0ecae..b70a1e9ce981 100644 --- a/vcl/unx/generic/print/bitmap_gfx.cxx +++ b/vcl/unx/generic/print/bitmap_gfx.cxx @@ -40,6 +40,8 @@ PrinterBmp::~PrinterBmp() /* virtual base class */ +namespace { + class ByteEncoder { private: @@ -50,12 +52,16 @@ public: virtual ~ByteEncoder () = 0; }; +} + ByteEncoder::~ByteEncoder() { } /* HexEncoder */ +namespace { + class HexEncoder : public ByteEncoder { private: @@ -74,6 +80,8 @@ public: void FlushLine (); }; +} + HexEncoder::HexEncoder (osl::File* pFile) : mpFile (pFile), mnColumn (0), @@ -122,6 +130,8 @@ HexEncoder::FlushLine () /* Ascii85 encoder, is abi compatible with HexEncoder but writes a ~> to indicate end of data EOD */ +namespace { + class Ascii85Encoder : public ByteEncoder { private: @@ -147,6 +157,8 @@ public: void WriteAscii (sal_uInt8 nByte); }; +} + Ascii85Encoder::Ascii85Encoder (osl::File* pFile) : mpFile (pFile), mnByte (0), @@ -272,6 +284,8 @@ Ascii85Encoder::~Ascii85Encoder () /* LZW encoder */ +namespace { + class LZWEncoder : public Ascii85Encoder { private: @@ -305,6 +319,8 @@ public: virtual void EncodeByte (sal_uInt8 nByte) override; }; +} + LZWEncoder::LZWEncoder(osl::File* pOutputFile) : Ascii85Encoder (pOutputFile), mpPrefix(nullptr), diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index 7b479816e1ec..90309c95ea53 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -907,6 +907,8 @@ void PspSalPrinter::EndPage() SAL_INFO( "vcl.unx.print", "PspSalPrinter::EndPage"); } +namespace { + struct PDFNewJobParameters { Size maPageSize; @@ -943,6 +945,8 @@ struct PDFPrintFile , maParameters( i_rNewParameters ) {} }; +} + bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJobName, const OUString& i_rAppName, ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController ) { @@ -1196,6 +1200,8 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo return true; } +namespace { + class PrinterUpdate { static Idle* pPrinterUpdateIdle; @@ -1209,6 +1215,8 @@ public: static void jobEnded(); }; +} + Idle* PrinterUpdate::pPrinterUpdateIdle = nullptr; int PrinterUpdate::nActiveJobs = 0; diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index ab5c2ab77d7a..8f1adf73e632 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -56,6 +56,8 @@ using namespace psp; // ----- Implementation of PrinterBmp by means of SalBitmap/BitmapBuffer --------------- +namespace { + class SalPrinterBmp : public psp::PrinterBmp { private: @@ -76,8 +78,6 @@ public: virtual sal_uInt32 GetDepth () const override; }; -namespace -{ bool Bitmap32IsPreMultipled() { auto pBackendCapabilities = ImplGetSVData()->mpDefInst->GetBackendCapabilities(); @@ -533,6 +533,8 @@ void GenPspGraphics::invert(long,long,long,long,SalInvert) OSL_FAIL("Warning: PrinterGfx::Invert() not implemented"); } +namespace { + class ImplPspFontData : public FreetypeFontFace { private: @@ -543,11 +545,15 @@ public: virtual sal_IntPtr GetFontId() const override { return mnFontId; } }; +} + ImplPspFontData::ImplPspFontData(const psp::FastPrintFontInfo& rInfo) : FreetypeFontFace(nullptr, GenPspGraphics::Info2FontAttributes(rInfo)), mnFontId( rInfo.m_nID ) {} +namespace { + class PspSalLayout : public GenericSalLayout { public: @@ -565,6 +571,8 @@ private: bool mbArtBold; }; +} + PspSalLayout::PspSalLayout(::psp::PrinterGfx& rGfx, const FreetypeFont& rFont) : GenericSalLayout(*rFont.GetFontInstance()) , mrPrinterGfx(rGfx) diff --git a/vcl/unx/generic/print/glyphset.cxx b/vcl/unx/generic/print/glyphset.cxx index a3508233e13f..1e4b0a0f291b 100644 --- a/vcl/unx/generic/print/glyphset.cxx +++ b/vcl/unx/generic/print/glyphset.cxx @@ -183,6 +183,8 @@ void GlyphSet::DrawGlyph(PrinterGfx& rGfx, rGfx.PSShowGlyph(nGlyphID); } +namespace { + struct EncEntry { unsigned char aEnc; @@ -194,6 +196,8 @@ struct EncEntry { return aEnc < rRight.aEnc; } }; +} + static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile, const char* pGlyphSetName, int nGlyphCount, /*const*/ const sal_uInt16* pRequestedGlyphs, /*const*/ const unsigned char* pEncoding, diff --git a/vcl/unx/generic/print/printerjob.cxx b/vcl/unx/generic/print/printerjob.cxx index 7d805ef942e5..6985ecf78c9f 100644 --- a/vcl/unx/generic/print/printerjob.cxx +++ b/vcl/unx/generic/print/printerjob.cxx @@ -632,12 +632,16 @@ PrinterJob::EndPage () pPageBody->close(); } +namespace { + struct less_ppd_key { bool operator()(const PPDKey* left, const PPDKey* right) { return left->getOrderDependency() < right->getOrderDependency(); } }; +} + static bool writeFeature( osl::File* pFile, const PPDKey* pKey, const PPDValue* pValue, bool bUseIncluseFeature ) { if( ! pKey || ! pValue ) diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index 12482b2ba878..17e8112f4bff 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -44,6 +44,8 @@ using namespace psp; using namespace osl; +namespace { + struct GetPPDAttribs { osl::Condition m_aCondition; @@ -116,6 +118,8 @@ struct GetPPDAttribs } }; +} + extern "C" { static void getPPDWorker(void* pData) { @@ -593,12 +597,16 @@ FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand return fp; } +namespace { + struct less_ppd_key { bool operator()(const PPDKey* left, const PPDKey* right) { return left->getOrderDependency() < right->getOrderDependency(); } }; +} + void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) { rNumOptions = 0; diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 880a7d958000..fde5c08c8274 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -251,7 +251,6 @@ using namespace psp; namespace { struct thePPDCache : public rtl::Static<PPDCache, thePPDCache> {}; -} class PPDDecompressStream { @@ -275,6 +274,8 @@ public: const OUString& GetFileName() const { return maFileName; } }; +} + PPDDecompressStream::PPDDecompressStream( const OUString& i_rFile ) { Open( i_rFile ); diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 3f02da765611..7bdddb5cfed2 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -671,11 +671,18 @@ OUString SystemQueueInfo::getCommand() const return aRet; } +namespace { + struct SystemCommandParameters; + +} + typedef void(* tokenHandler)(const std::vector< OString >&, std::vector< PrinterInfoManager::SystemPrintQueue >&, const SystemCommandParameters*); +namespace { + struct SystemCommandParameters { const char* pQueueCommand; @@ -686,6 +693,8 @@ struct SystemCommandParameters tokenHandler const pHandler; }; +} + #if ! (defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD)) static void lpgetSysQueueTokenHandler( const std::vector< OString >& i_rLines, diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 83dfaf35e434..8ac555009541 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2823,6 +2823,8 @@ bool X11SalFrame::HandleMouseEvent( XEvent *pEvent ) return nRet; } +namespace { + // F10 means either KEY_F10 or KEY_MENU, which has to be decided // in the independent part. struct KeyAlternate @@ -2833,6 +2835,8 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; +} + static KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { diff --git a/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx b/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx index ab94126dfc51..83f6817fc9e2 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx @@ -25,12 +25,16 @@ using namespace ::com::sun::star; // ---------------------- AtkHyperlink ---------------------- +namespace { + struct HyperLink { AtkHyperlink const atk_hyper_link; uno::Reference< accessibility::XAccessibleHyperlink > xLink; }; +} + static uno::Reference< accessibility::XAccessibleHyperlink > const & getHyperlink( AtkHyperlink *pHyperlink ) { diff --git a/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx b/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx index fa5ab6030eae..73ba933d5a98 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx @@ -1304,12 +1304,16 @@ AtkAttributeSet* attribute_set_prepend_tracked_change_formatchange( AtkAttribute /*****************************************************************************/ +namespace { + struct AtkTextAttrMapping { const char * name; TextPropertyValueFunc const toPropertyValue; }; +} + const AtkTextAttrMapping g_TextAttrMap[] = { { "", InvalidValue }, // ATK_TEXT_ATTR_INVALID = 0 diff --git a/vcl/unx/gtk3/gtk3glomenu.cxx b/vcl/unx/gtk3/gtk3glomenu.cxx index e14574722800..ca6887cb9d95 100644 --- a/vcl/unx/gtk3/gtk3glomenu.cxx +++ b/vcl/unx/gtk3/gtk3glomenu.cxx @@ -32,12 +32,16 @@ G_DEFINE_TYPE (GLOMenu, g_lo_menu, G_TYPE_MENU_MODEL); #pragma GCC diagnostic pop #endif +namespace { + struct item { GHashTable* attributes; // Item attributes. GHashTable* links; // Item links. }; +} + static void g_lo_menu_struct_item_init (struct item *menu_item) { diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 8ec93277e1a0..0d1348b8e551 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -300,6 +300,8 @@ guint GtkSalFrame::GetKeyValFor(GdkKeymap* pKeyMap, guint16 hardware_keycode, gu return updated_keyval; } +namespace { + // F10 means either KEY_F10 or KEY_MENU, which has to be decided // in the independent part. struct KeyAlternate @@ -310,6 +312,8 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; +} + static KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { @@ -3289,6 +3293,8 @@ namespace static bool g_DropSuccessSet = false; static bool g_DropSuccess = false; +namespace { + class GtkDropTargetDropContext : public cppu::WeakImplHelper<css::datatransfer::dnd::XDropTargetDropContext> { GdkDragContext *m_pContext; @@ -3322,6 +3328,8 @@ public: } }; +} + class GtkDnDTransferable : public GtkTransferable { GdkDragContext *m_pContext; @@ -3467,6 +3475,7 @@ gboolean GtkDropTarget::signalDragDrop(GtkWidget* pWidget, GdkDragContext* conte return true; } +namespace { class GtkDropTargetDragContext : public cppu::WeakImplHelper<css::datatransfer::dnd::XDropTargetDragContext> { @@ -3490,6 +3499,8 @@ public: } }; +} + void GtkSalFrame::signalDragDropReceived(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint ttype, guint time, gpointer frame) { GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); diff --git a/vcl/unx/gtk3/gtk3hudawareness.cxx b/vcl/unx/gtk3/gtk3hudawareness.cxx index 79ade04b4ee1..dddad28dafb6 100644 --- a/vcl/unx/gtk3/gtk3hudawareness.cxx +++ b/vcl/unx/gtk3/gtk3hudawareness.cxx @@ -11,6 +11,8 @@ #include <unx/gtk/hudawareness.h> +namespace { + struct HudAwarenessHandle { GDBusConnection *connection; @@ -19,6 +21,8 @@ struct HudAwarenessHandle GDestroyNotify notify; }; +} + static void hud_awareness_method_call (GDBusConnection * /* connection */, const gchar * /* sender */, diff --git a/vcl/unx/gtk3/gtk3salprn-gtk.cxx b/vcl/unx/gtk3/gtk3salprn-gtk.cxx index e9d57c56a940..56f2173b119f 100644 --- a/vcl/unx/gtk3/gtk3salprn-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salprn-gtk.cxx @@ -41,6 +41,8 @@ using vcl::unx::GtkPrintWrapper; using uno::UNO_QUERY; +namespace { + class GtkPrintDialog { public: @@ -94,6 +96,8 @@ private: std::shared_ptr<GtkPrintWrapper> m_xWrapper; }; +} + struct GtkSalPrinter_Impl { OString m_sSpoolFile; |