[GSoC] Add Bitmap tab to area dialog

Change-Id: I6549e7eb4efd24d035b0383a750698a4c3f16cf7
Reviewed-on: https://gerrit.libreoffice.org/27546
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index c81ef962..2196201 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -197,6 +197,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
    cui/source/tabpages/textanim \
    cui/source/tabpages/textattr \
    cui/source/tabpages/tparea \
    cui/source/tabpages/tpbitmap \
    cui/source/tabpages/tpcolor \
    cui/source/tabpages/tpgradnt \
    cui/source/tabpages/tphatch \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 60c8d18..df494ce 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
	cui/uiconfig/ui/autocorrectdialog \
	cui/uiconfig/ui/backgroundpage \
	cui/uiconfig/ui/baselinksdialog \
	cui/uiconfig/ui/bitmaptabpage \
	cui/uiconfig/ui/blackorwhitelistentrydialog \
	cui/uiconfig/ui/borderareatransparencydialog \
	cui/uiconfig/ui/borderbackgrounddialog \
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 46cb922..54bd78b 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -46,7 +46,7 @@ class SvxAreaTabDialog : public SfxTabDialog
    sal_uInt16            m_nColorTabPage;
    sal_uInt16            m_nGradientTabPage;
    sal_uInt16            m_nHatchTabPage;
    //sal_uInt16            m_nBitmapTabPage;
    sal_uInt16            m_nBitmapTabPage;
    sal_uInt16            m_nPatternTabPage;

private:
@@ -553,6 +553,65 @@ public:

/************************************************************************/

class SvxBitmapTabPage : public SvxTabPage
{
    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;
private:

    VclPtr<SvxPresetListBox>   m_pBitmapLB;
    VclPtr<PushButton>         m_pBtnImport;
    VclPtr<SvxXRectPreview>    m_pCtlBitmapPreview;

    const SfxItemSet&          m_rOutAttrs;

    XBitmapListRef             m_pBitmapList;
    ChangeType*                m_pnBitmapListState;
    XFillStyleItem             m_aXFStyleItem;
    XFillBitmapItem            m_aXBitmapItem;

    sal_uInt16*                m_nPageType;
    sal_uInt16                 m_nDlgType;
    sal_Int32*                 m_nPos;

    bool*                      m_pbAreaTP;

    XFillAttrSetItem           m_aXFillAttr;
    SfxItemSet&                m_rXFSet;

    DECL_LINK_TYPED( ModifyBitmapHdl, ValueSet*, void );
    DECL_LINK_TYPED( ClickRenameHdl, SvxPresetListBox*, void );
    DECL_LINK_TYPED( ClickDeleteHdl, SvxPresetListBox*, void );
    DECL_LINK_TYPED( ClickImportHdl, Button*, void );
    void ClickBitmapHdl_Impl();
    sal_Int32 SearchBitmapList(const OUString& rBitmapName);

public:
    SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
    virtual ~SvxBitmapTabPage();
    virtual void dispose() override;

    void    Construct();

    static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );

    virtual bool FillItemSet( SfxItemSet* ) override;
    virtual void Reset( const SfxItemSet * ) override;
    virtual void ActivatePage( const SfxItemSet& rSet ) override;
    virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
    virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) override;

    void    SetBitmapList( XBitmapListRef pBmpLst) { m_pBitmapList = pBmpLst; }

    void    SetPageType( sal_uInt16* pInType ) { m_nPageType = pInType; }
    void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
    void    SetPos( sal_Int32* pInPos ) { m_nPos = pInPos; }
    void    SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
    void    SetBmpChgd( ChangeType* pIn ) { m_pnBitmapListState = pIn; }
};

/************************************************************************/

class SvxPatternTabPage : public SvxTabPage
{
    using TabPage::ActivatePage;
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index e6b9ae6..a1b7c8d 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -92,6 +92,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
    m_nColorTabPage = AddTabPage( "RID_SVXPAGE_COLOR", SvxColorTabPage::Create, nullptr );
    m_nGradientTabPage = AddTabPage( "RID_SVXPAGE_GRADIENT", SvxGradientTabPage::Create, nullptr );
    m_nHatchTabPage = AddTabPage( "RID_SVXPAGE_HATCH", SvxHatchTabPage::Create, nullptr );
    m_nBitmapTabPage = AddTabPage( "RID_SVXPAGE_BITMAP", SvxBitmapTabPage::Create, nullptr );
    m_nPatternTabPage = AddTabPage( "RID_SVXPAGE_PATTERN", SvxPatternTabPage::Create,  nullptr);

    SetCurPageId( "RID_SVXPAGE_AREA" );
@@ -309,6 +310,16 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
            static_cast<SvxHatchTabPage&>(rPage).SetColorChgd( &mnColorListState );
            static_cast<SvxHatchTabPage&>(rPage).Construct();
    }
    else if (nId == m_nBitmapTabPage )
    {
            static_cast<SvxBitmapTabPage&>(rPage).SetBitmapList( mpBitmapList );
            static_cast<SvxBitmapTabPage&>(rPage).SetPageType( &mnPageType );
            static_cast<SvxBitmapTabPage&>(rPage).SetDlgType( 0 );
            static_cast<SvxBitmapTabPage&>(rPage).SetPos( &mnPos );
            static_cast<SvxBitmapTabPage&>(rPage).SetAreaTP( &mbAreaTP );
            static_cast<SvxBitmapTabPage&>(rPage).SetBmpChgd( &mnBitmapListState );
            static_cast<SvxBitmapTabPage&>(rPage).Construct();
    }
    else if (nId == m_nPatternTabPage)
    {
            static_cast<SvxPatternTabPage&>(rPage).SetColorList( mpColorList );
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
new file mode 100644
index 0000000..373da08
--- /dev/null
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -0,0 +1,396 @@
/* -*- 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 <stdlib.h>
#include <tools/urlobj.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
#include <svx/dialogs.hrc>
#include "svx/xattr.hxx"
#include <svx/xpool.hxx>
#include <cuires.hrc>
#include <svx/xflbckit.hxx>
#include <svx/svdattr.hxx>
#include <svx/xtable.hxx>
#include <svx/xlineit0.hxx>
#include "svx/drawitem.hxx"
#include "cuitabarea.hxx"
#include "dlgname.hxx"
#include <dialmgr.hxx>
#include "svx/dlgutil.hxx"
#include <svl/intitem.hxx>
#include <sfx2/request.hxx>
#include "paragrph.hrc"
#include "sfx2/opengrf.hxx"
#include <vcl/layout.hxx>
#include <svx/svxdlg.hxx>

using namespace com::sun::star;

SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) :

    SvxTabPage( pParent,
                "BitmapTabPage",
                "cui/ui/bitmaptabpage.ui",
               rInAttrs ),
    m_rOutAttrs (rInAttrs ),

    m_pBitmapList( nullptr ),

    m_pnBitmapListState( nullptr ),
    m_aXFStyleItem( drawing::FillStyle_BITMAP ),
    m_aXBitmapItem( OUString(), Graphic() ),

    m_nPageType(nullptr),
    m_nDlgType(0),
    m_nPos(nullptr),

    m_pbAreaTP( nullptr ),

    m_aXFillAttr          ( rInAttrs.GetPool() ),
    m_rXFSet              ( m_aXFillAttr.GetItemSet() )
{
    get(m_pBitmapLB,"BITMAP");
    get(m_pCtlBitmapPreview,"CTL_BITMAP_PREVIEW");
    get(m_pBtnImport, "BTN_IMPORT");

    // setting the output device
    m_rXFSet.Put( m_aXFStyleItem );
    m_rXFSet.Put( m_aXBitmapItem );
    m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );

    m_pBitmapLB->SetSelectHdl( LINK(this, SvxBitmapTabPage, ModifyBitmapHdl) );
    m_pBitmapLB->SetRenameHdl( LINK(this, SvxBitmapTabPage, ClickRenameHdl) );
    m_pBitmapLB->SetDeleteHdl( LINK(this, SvxBitmapTabPage, ClickDeleteHdl) );
    m_pBtnImport->SetClickHdl( LINK(this, SvxBitmapTabPage, ClickImportHdl) );

    // Calculate size of display boxes
    Size aSize = LogicToPixel(Size(90, 42), MAP_APPFONT);
    m_pCtlBitmapPreview->set_width_request(aSize.Width());
    m_pCtlBitmapPreview->set_height_request(aSize.Height());
}

SvxBitmapTabPage::~SvxBitmapTabPage()
{
    disposeOnce();
}

void SvxBitmapTabPage::dispose()
{
    m_pBitmapLB.clear();
    m_pCtlBitmapPreview.clear();
    SvxTabPage::dispose();
}


void SvxBitmapTabPage::Construct()
{
    m_pBitmapLB->FillPresetListBox( *m_pBitmapList );
}


void SvxBitmapTabPage::ActivatePage( const SfxItemSet& )
{
    if( m_nDlgType == 0 ) // area dialog
    {
        *m_pbAreaTP = false;

        if( *m_nPageType == PT_BITMAP && *m_nPos != LISTBOX_ENTRY_NOTFOUND )
        {
            sal_uInt16 nId = m_pBitmapLB->GetItemId( static_cast<size_t>( *m_nPos ) );
            m_pBitmapLB->SelectItem(nId);
        }
        *m_nPageType = PT_BITMAP;
        *m_nPos = LISTBOX_ENTRY_NOTFOUND;
    }
}


DeactivateRC SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet )
{
    if( _pSet )
        FillItemSet( _pSet );

    return DeactivateRC::LeavePage;
}


bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs )
{
    bool bModified = false;
    if( m_nDlgType == 0 && !*m_pbAreaTP )
    {
        rAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP));
        size_t nPos = m_pBitmapLB->GetSelectItemPos();
        if(VALUESET_ITEM_NOTFOUND != nPos)
        {
            const XBitmapEntry* pXBitmapEntry = m_pBitmapList->GetBitmap( static_cast<sal_uInt16>(nPos) );
            const OUString aString(m_pBitmapLB->GetItemText( m_pBitmapLB->GetSelectItemId() ));
            rAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()));
            bModified = true;
        }

        rAttrs->Put (SfxUInt16Item(SID_PAGE_TYPE,*m_nPageType));
        rAttrs->Put (SfxUInt16Item(SID_TABPAGE_POS,*m_nPos));
    }

    return bModified;
}


void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
{
    XFillBitmapItem aItem( static_cast<const XFillBitmapItem&>(rAttrs->Get(XATTR_FILLBITMAP)) );
    if(!aItem.isPattern())
    {
        m_rXFSet.Put( aItem );
        m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
        m_pCtlBitmapPreview->Invalidate();
    }
    else
        m_pCtlBitmapPreview->Disable();
    ClickBitmapHdl_Impl();
}


VclPtr<SfxTabPage> SvxBitmapTabPage::Create( vcl::Window* pWindow,
                                           const SfxItemSet* rAttrs )
{
    return VclPtr<SvxBitmapTabPage>::Create( pWindow, *rAttrs );
}


void SvxBitmapTabPage::ClickBitmapHdl_Impl()
{
    m_pBitmapLB->Enable();
    m_pCtlBitmapPreview->Enable();

    ModifyBitmapHdl( m_pBitmapLB );
}

IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
{
    std::unique_ptr<GraphicObject> pGraphicObject;
    size_t nPos = m_pBitmapLB->GetSelectItemPos();
    if( nPos != VALUESET_ITEM_NOTFOUND )
    {
        pGraphicObject.reset(new GraphicObject(m_pBitmapList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetGraphicObject()));
    }
    else
    {
        const SfxPoolItem* pPoolItem = nullptr;

        if(SfxItemState::SET == m_rOutAttrs.GetItemState(GetWhich(XATTR_FILLSTYLE), true, &pPoolItem))
        {
            const drawing::FillStyle eXFS((drawing::FillStyle)static_cast<const XFillStyleItem*>(pPoolItem)->GetValue());

            if((drawing::FillStyle_BITMAP == eXFS) && (SfxItemState::SET == m_rOutAttrs.GetItemState(GetWhich(XATTR_FILLBITMAP), true, &pPoolItem)))
            {
                pGraphicObject.reset(new GraphicObject(static_cast<const XFillBitmapItem*>(pPoolItem)->GetGraphicObject()));
            }
        }

        if(!pGraphicObject)
        {
            sal_uInt16 nId = m_pBitmapLB->GetItemId(0);
            m_pBitmapLB->SelectItem(nId);

            if(0 != nId)
            {
                pGraphicObject.reset(new GraphicObject(m_pBitmapList->GetBitmap(0)->GetGraphicObject()));
            }
        }
    }
    m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
    m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject));

    m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
    m_pCtlBitmapPreview->Invalidate();
}

IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
{
    sal_uInt16 nId = m_pBitmapLB->GetSelectItemId();
    size_t nPos = m_pBitmapLB->GetSelectItemPos();

    if( nPos != VALUESET_ITEM_NOTFOUND )
    {
        OUString aDesc( CUI_RES( RID_SVXSTR_DESC_NEW_BITMAP ) );
        OUString aName( m_pBitmapList->GetBitmap( nPos )->GetName() );

        SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
        assert(pFact && "Dialog creation failed!");
        std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
        assert(pDlg && "Dialog creation failed!");

        bool bLoop = true;
        while( bLoop && pDlg->Execute() == RET_OK )
        {
            pDlg->GetName( aName );
            sal_Int32 nBitmapPos = SearchBitmapList( aName );
            bool bValidBitmapName = (nBitmapPos == static_cast<sal_Int32>(nPos) ) || (nBitmapPos == LISTBOX_ENTRY_NOTFOUND);

            if(bValidBitmapName)
            {
                bLoop = false;
                XBitmapEntry* pEntry = m_pBitmapList->GetBitmap( static_cast<sal_uInt16>(nPos) );
                pEntry->SetName( aName );

                m_pBitmapLB->SetItemText(nId, aName);
                m_pBitmapLB->SelectItem( nId );

                *m_pnBitmapListState |= ChangeType::MODIFIED;
            }
            else
            {
                ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
                                                            ,"DuplicateNameDialog"
                                                            ,"cui/ui/queryduplicatedialog.ui" );
                aBox->Execute();
            }
        }
    }
}

IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickDeleteHdl, SvxPresetListBox*, void)
{
    sal_uInt16 nId = m_pBitmapLB->GetSelectItemId();
    size_t nPos = m_pBitmapLB->GetSelectItemPos();

    if( nPos != VALUESET_ITEM_NOTFOUND )
    {
        ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" );

        if( aQueryBox->Execute() == RET_YES )
        {
            m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) );
            m_pBitmapLB->RemoveItem( nId );
            nId = m_pBitmapLB->GetItemId(0);
            m_pBitmapLB->SelectItem( nId );

            m_pCtlBitmapPreview->Invalidate();
            ModifyBitmapHdl( m_pBitmapLB );
            *m_pnBitmapListState |= ChangeType::MODIFIED;
        }
    }
}

IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickImportHdl, Button*, void)
{
    ResMgr& rMgr = CUI_MGR();
    SvxOpenGraphicDialog aDlg( OUString("Import") );
    aDlg.EnableLink(false);
    long nCount = m_pBitmapList->Count();

    if( !aDlg.Execute() )
    {
        Graphic         aGraphic;

        EnterWait();
        int nError = aDlg.GetGraphic( aGraphic );
        LeaveWait();

        if( !nError )
        {
            OUString aDesc( ResId(RID_SVXSTR_DESC_EXT_BITMAP, rMgr) );
            ScopedVclPtr<MessageDialog> pWarnBox;

            // convert file URL to UI name
            OUString        aName;
            INetURLObject   aURL( aDlg.GetPath() );
            SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
            DBG_ASSERT(pFact, "Dialog creation failed!");
            std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aURL.GetName().getToken( 0, '.' ), aDesc ));
            DBG_ASSERT(pDlg, "Dialog creation failed!");
            nError = 1;

            while( pDlg->Execute() == RET_OK )
            {
                pDlg->GetName( aName );

                bool bDifferent = true;

                for( long i = 0; i < nCount && bDifferent; i++ )
                    if( aName == m_pBitmapList->GetBitmap( i )->GetName() )
                        bDifferent = false;

                if( bDifferent ) {
                    nError = 0;
                    break;
                }

                if( !pWarnBox )
                {
                    pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
                                                 ,"DuplicateNameDialog"
                                                 ,"cui/ui/queryduplicatedialog.ui"));
                }

                if( pWarnBox->Execute() != RET_OK )
                    break;
            }

            pDlg.reset();
            pWarnBox.disposeAndClear();

            if( !nError )
            {
                XBitmapEntry* pEntry = new XBitmapEntry( aGraphic, aName );
                m_pBitmapList->Insert( pEntry, nCount );

                sal_Int32 nId = m_pBitmapLB->GetItemId( nCount - 1 );
                Bitmap aBitmap = m_pBitmapList->GetBitmapForPreview( nCount, m_pBitmapLB->GetIconSize() );

                m_pBitmapLB->InsertItem( nId + 1, Image(aBitmap), aName );
                m_pBitmapLB->SelectItem( nId + 1 );
                *m_pnBitmapListState |= ChangeType::MODIFIED;

                ModifyBitmapHdl( m_pBitmapLB );
            }
        }
        else
            // graphic couldn't be loaded
            ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
                          ,"NoLoadedFileDialog"
                          ,"cui/ui/querynoloadedfiledialog.ui")->Execute();
    }
}

sal_Int32 SvxBitmapTabPage::SearchBitmapList(const OUString& rBitmapName)
{
    long nCount = m_pBitmapList->Count();
    bool bValidBitmapName = true;
    sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND;

    for(long i = 0;i < nCount && bValidBitmapName;i++)
    {
        if(rBitmapName == m_pBitmapList->GetBitmap( i )->GetName())
        {
            nPos = i;
            bValidBitmapName = false;
        }
    }
    return nPos;
}

void SvxBitmapTabPage::PointChanged( vcl::Window* , RECT_POINT )
{
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/uiconfig/ui/areadialog.ui b/cui/uiconfig/ui/areadialog.ui
index 4482284..b482072 100644
--- a/cui/uiconfig/ui/areadialog.ui
+++ b/cui/uiconfig/ui/areadialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.16.1 -->
<interface>
  <requires lib="gtk+" version="3.0"/>
  <object class="GtkDialog" id="AreaDialog">
@@ -177,13 +177,27 @@
              <placeholder/>
            </child>
            <child type="tab">
              <object class="GtkLabel" id="RID_SVXPAGE_BITMAP">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="label" translatable="yes">Bitmap</property>
              </object>
              <packing>
                <property name="position">6</property>
                <property name="tab_fill">False</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
            <child type="tab">
              <object class="GtkLabel" id="RID_SVXPAGE_PATTERN">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="label" translatable="yes">Patterns</property>
              </object>
              <packing>
                <property name="position">6</property>
                <property name="position">7</property>
                <property name="tab_fill">False</property>
              </packing>
            </child>
diff --git a/cui/uiconfig/ui/bitmaptabpage.ui b/cui/uiconfig/ui/bitmaptabpage.ui
new file mode 100644
index 0000000..42dea558
--- /dev/null
+++ b/cui/uiconfig/ui/bitmaptabpage.ui
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
  <requires lib="gtk+" version="3.0"/>
  <!-- interface-requires LibreOffice 1.0 -->
  <object class="GtkBox" id="BitmapTabPage">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <property name="border_width">6</property>
    <property name="spacing">6</property>
    <child>
      <object class="GtkFrame" id="Fill Frame">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="halign">start</property>
        <property name="label_xalign">0</property>
        <property name="shadow_type">none</property>
        <child>
          <object class="GtkAlignment" id="alignment1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="halign">start</property>
            <property name="top_padding">6</property>
            <property name="left_padding">12</property>
            <child>
              <object class="GtkVBox" id="box1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="halign">start</property>
                <property name="spacing">6</property>
                <child>
                  <object class="svxcorelo-SvxPresetListBox" id="BITMAP">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="hexpand">True</property>
                    <property name="vexpand">True</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkButton" id="BTN_IMPORT">
                    <property name="label" translatable="yes">Add / Import</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">True</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">False</property>
                    <property name="position">1</property>
                  </packing>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child type="label">
          <object class="GtkLabel" id="label1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="xalign">0</property>
            <property name="label" translatable="yes">Fill</property>
            <attributes>
              <attribute name="weight" value="bold"/>
            </attributes>
          </object>
        </child>
      </object>
      <packing>
        <property name="expand">False</property>
        <property name="fill">True</property>
        <property name="position">0</property>
      </packing>
    </child>
    <child>
      <object class="GtkFrame" id="frame3">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="halign">end</property>
        <property name="valign">start</property>
        <property name="label_xalign">0</property>
        <property name="shadow_type">none</property>
        <child>
          <object class="GtkAlignment" id="alignment8">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="halign">end</property>
            <property name="top_padding">6</property>
            <property name="left_padding">12</property>
            <child>
              <object class="GtkBox" id="box4">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="halign">end</property>
                <property name="valign">start</property>
                <property name="orientation">vertical</property>
                <child>
                  <object class="svxlo-SvxXRectPreview" id="CTL_BITMAP_PREVIEW">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="hexpand">True</property>
                        <property name="vexpand">True</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="CTL_BITMAP_PREVIEW-atkobject">
                            <property name="AtkObject::accessible-name" translatable="yes">Example</property>
                          </object>
                        </child>
                      </object>
                  <packing>
                    <property name="expand">True</property>
                    <property name="fill">True</property>
                    <property name="position">0</property>
                  </packing>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child type="label">
          <object class="GtkLabel" id="label8">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="label" translatable="yes">Preview</property>
            <attributes>
              <attribute name="weight" value="bold"/>
            </attributes>
          </object>
        </child>
      </object>
      <packing>
        <property name="expand">False</property>
        <property name="fill">True</property>
        <property name="pack_type">end</property>
        <property name="position">2</property>
      </packing>
    </child>
  </object>
</interface>