From f94c8ae10a53f14a3c74722e026b14696d787958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 8 Oct 2010 13:31:43 +0100 Subject: [PATCH] prepare for gtk3 --- vcl/prj/build.lst | 6 +- vcl/unx/gtk/a11y/makefile.mk | 8 +- vcl/unx/gtk/app/makefile.mk | 8 +- vcl/unx/gtk/gdi/makefile.mk | 8 +- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 626 ++++++++++++++----------- vcl/unx/gtk/window/gtkframe.cxx | 128 +++-- vcl/unx/gtk/window/gtkobject.cxx | 31 +- vcl/unx/gtk/window/makefile.mk | 8 +- vcl/unx/gtk3/a11y/Gtk3atkaction.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkbridge.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkcomponent.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkeditabletext.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkfactory.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkhypertext.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkimage.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atklistener.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkregistry.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkselection.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atktable.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atktext.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atktextattributes.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkutil.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkvalue.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkwindow.cxx | 28 ++ vcl/unx/gtk3/a11y/Gtk3atkwrapper.cxx | 28 ++ vcl/unx/gtk3/a11y/makefile.mk | 86 ++++ vcl/unx/gtk3/app/Gtk3gtkdata.cxx | 28 ++ vcl/unx/gtk3/app/Gtk3gtkinst.cxx | 28 ++ vcl/unx/gtk3/app/Gtk3gtksys.cxx | 28 ++ vcl/unx/gtk3/app/makefile.mk | 76 +++ vcl/unx/gtk3/gdi/Gtk3salnativewidgets-gtk.cxx | 28 ++ vcl/unx/gtk3/gdi/makefile.mk | 69 +++ vcl/unx/gtk3/window/Gtk3gtkframe.cxx | 28 ++ vcl/unx/gtk3/window/Gtk3gtkobject.cxx | 28 ++ vcl/unx/gtk3/window/makefile.mk | 72 +++ vcl/unx/inc/plugins/gtk/gtkdata.hxx | 33 ++ vcl/unx/inc/plugins/gtk/gtkframe.hxx | 8 +- vcl/unx/inc/plugins/gtk/gtkgdi.hxx | 16 +- vcl/unx/inc/plugins/gtk/gtkobject.hxx | 6 +- vcl/unx/source/plugadapt/salplug.cxx | 8 +- vcl/util/makefile.mk | 74 +++- 41 files changed, 1546 insertions(+), 369 deletions(-) create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkaction.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkbridge.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkcomponent.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkeditabletext.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkfactory.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkhypertext.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkimage.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atklistener.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkregistry.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkselection.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atktable.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atktext.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atktextattributes.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkutil.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkvalue.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkwindow.cxx create mode 100644 vcl/unx/gtk3/a11y/Gtk3atkwrapper.cxx create mode 100644 vcl/unx/gtk3/a11y/makefile.mk create mode 100644 vcl/unx/gtk3/app/Gtk3gtkdata.cxx create mode 100644 vcl/unx/gtk3/app/Gtk3gtkinst.cxx create mode 100644 vcl/unx/gtk3/app/Gtk3gtksys.cxx create mode 100644 vcl/unx/gtk3/app/makefile.mk create mode 100644 vcl/unx/gtk3/gdi/Gtk3salnativewidgets-gtk.cxx create mode 100644 vcl/unx/gtk3/gdi/makefile.mk create mode 100644 vcl/unx/gtk3/window/Gtk3gtkframe.cxx create mode 100644 vcl/unx/gtk3/window/Gtk3gtkobject.cxx create mode 100644 vcl/unx/gtk3/window/makefile.mk diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index e6f6365..52edd94 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -32,6 +32,10 @@ vc vcl\unx\gtk\a11y nmake - u vc__gtky vc_inc NULL vc vcl\unx\gtk\app nmake - u vc__gtka vc_inc NULL vc vcl\unx\gtk\window nmake - u vc__gtkw vc_inc NULL vc vcl\unx\gtk\gdi nmake - u vc__gtkg vc_inc NULL +vc vcl\unx\gtk3\a11y nmake - u vc__gtk3y vc_inc NULL +vc vcl\unx\gtk3\app nmake - u vc__gtk3a vc_inc NULL +vc vcl\unx\gtk3\window nmake - u vc__gtk3w vc_inc NULL +vc vcl\unx\gtk3\gdi nmake - u vc__gtk3g vc_inc NULL vc vcl\unx\headless nmake - u vc__hl vc_inc NULL vc vcl\unx\kde nmake - u vc__kde vc_inc NULL vc vcl\unx\kde4 nmake - u vc__kde4 vc_inc NULL @@ -45,6 +49,6 @@ vc vcl\mac\source\app nmake - m vc__appm vc_inc NULL vc vcl\mac\source\gdi nmake - m vc__gdim vc_inc NULL vc vcl\mac\source\window nmake - m vc__winm vc_inc NULL vc vcl\mac\source\src nmake - m vc__srcm vc_inc NULL -vc vcl\util nmake - all vc_util vc__plug.u vc__desk.u vc__aquy.u vc__appa.u vc__dtra.u vc__appm.m vc__appu.u vc__dtru.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__kde4.u vc__hl.u vc__ftmu.u vc__prgu.u vc__prnu.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_fts vc_components NULL +vc vcl\util nmake - all vc_util vc__plug.u vc__desk.u vc__aquy.u vc__appa.u vc__dtra.u vc__appm.m vc__appu.u vc__dtru.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__gtk3a.u vc__gtk3y.u vc__gtk3w.u vc__gtk3g.u vc__kde.u vc__kde4.u vc__hl.u vc__ftmu.u vc__prgu.u vc__prnu.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_fts vc_components NULL vc vcl\util\linksvp nmake - u vc_lsvp vc_util NULL vc vcl\workben nmake - all vc_wrkb vc_util vc_salmain NULL diff --git a/vcl/unx/gtk/a11y/makefile.mk b/vcl/unx/gtk/a11y/makefile.mk index 14d3014..fa2f58d 100644 --- a/vcl/unx/gtk/a11y/makefile.mk +++ b/vcl/unx/gtk/a11y/makefile.mk @@ -28,7 +28,7 @@ PRJ=..$/..$/.. PRJNAME=vcl -TARGET=gtka11y +TARGET=gtk2a11y ENABLE_EXCEPTIONS=TRUE # workaround for makedepend hang @@ -48,7 +48,7 @@ dummy: .ELSE # "$(GUIBASE)"!="unx" -.IF "$(ENABLE_GTK)" != "" +.IF "$(ENABLE_GTK2)" != "" PKGCONFIG_MODULES=gtk+-2.0 .INCLUDE : pkg_config.mk @@ -80,10 +80,10 @@ SLOFILES=\ $(SLO)$/atkwindow.obj \ $(SLO)$/atkwrapper.obj -.ELSE # "$(ENABLE_GTK)" != "" +.ELSE # "$(ENABLE_GTK2)" != "" dummy: - @echo GTK disabled - nothing to build + @echo GTK2 disabled - nothing to build .ENDIF .ENDIF # "$(GUIBASE)"!="unx" diff --git a/vcl/unx/gtk/app/makefile.mk b/vcl/unx/gtk/app/makefile.mk index 3e8cd75..adbac5f 100644 --- a/vcl/unx/gtk/app/makefile.mk +++ b/vcl/unx/gtk/app/makefile.mk @@ -28,7 +28,7 @@ PRJ=..$/..$/.. PRJNAME=vcl -TARGET=gtkapp +TARGET=gtk2app .INCLUDE : $(PRJ)$/util$/makefile.pmk # workaround for makedepend hang @@ -48,7 +48,7 @@ dummy: .ELSE # "$(GUIBASE)"!="unx" -.IF "$(ENABLE_GTK)" != "" +.IF "$(ENABLE_GTK2)" != "" PKGCONFIG_MODULES=gtk+-2.0 .INCLUDE : pkg_config.mk @@ -62,10 +62,10 @@ EXCEPTIONSFILES=\ $(SLO)$/gtkdata.obj\ $(SLO)$/gtkinst.obj -.ELSE # "$(ENABLE_GTK)" != "" +.ELSE # "$(ENABLE_GTK2)" != "" dummy: - @echo GTK disabled - nothing to build + @echo GTK2 disabled - nothing to build .ENDIF .ENDIF # "$(GUIBASE)"!="unx" diff --git a/vcl/unx/gtk/gdi/makefile.mk b/vcl/unx/gtk/gdi/makefile.mk index ec6b4e1..1589ba2 100644 --- a/vcl/unx/gtk/gdi/makefile.mk +++ b/vcl/unx/gtk/gdi/makefile.mk @@ -28,7 +28,7 @@ PRJ=..$/..$/.. PRJNAME=vcl -TARGET=gtkgdi +TARGET=gtk2gdi .INCLUDE : $(PRJ)$/util$/makefile.pmk # --- Settings ----------------------------------------------------- @@ -45,7 +45,7 @@ dummy: .ELSE # "$(GUIBASE)"!="unx" -.IF "$(ENABLE_GTK)" != "" +.IF "$(ENABLE_GTK2)" != "" PKGCONFIG_MODULES=gtk+-2.0 .INCLUDE : pkg_config.mk @@ -53,9 +53,9 @@ PKGCONFIG_MODULES=gtk+-2.0 SLOFILES=$(SLO)$/salnativewidgets-gtk.obj EXCEPTIONSFILES=$(SLO)$/salnativewidgets-gtk.obj -.ELSE # "$(ENABLE_GTK)" != "" +.ELSE # "$(ENABLE_GTK2)" != "" dummy: - @echo GTK disabled - nothing to build + @echo GTK2 disabled - nothing to build .ENDIF .ENDIF # "$(GUIBASE)"!="unx" diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 8c72e6f..feb3550 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -82,8 +82,14 @@ struct NWFWidgetData GtkWidget * gEditBoxWidget; GtkWidget * gSpinButtonWidget; GtkWidget * gNotebookWidget; - GtkWidget * gOptionMenuWidget; - GtkWidget * gComboWidget; + GtkWidget * gComboBoxEntryWidget; + GtkWidget * gComboBoxEntry_EntryWidget; + GtkWidget * gComboBoxEntry_ButtonWidget; + GtkWidget * gComboBoxEntry_ArrowWidget; + GtkWidget * gComboBoxWidget; + GtkWidget * gComboBox_ButtonWidget; + GtkWidget * gComboBox_SeparatorWidget; + GtkWidget * gComboBox_ArrowWidget; GtkWidget * gScrolledWindowWidget; GtkWidget * gToolbarWidget; GtkWidget * gToolbarButtonWidget; @@ -120,8 +126,14 @@ struct NWFWidgetData gEditBoxWidget( NULL ), gSpinButtonWidget( NULL ), gNotebookWidget( NULL ), - gOptionMenuWidget( NULL ), - gComboWidget( NULL ), + gComboBoxEntryWidget( NULL ), + gComboBoxEntry_EntryWidget( NULL ), + gComboBoxEntry_ButtonWidget( NULL ), + gComboBoxEntry_ArrowWidget( NULL ), + gComboBoxWidget( NULL ), + gComboBox_ButtonWidget( NULL ), + gComboBox_SeparatorWidget( NULL ), + gComboBox_ArrowWidget( NULL ), gScrolledWindowWidget( NULL ), gToolbarWidget( NULL ), gToolbarButtonWidget( NULL ), @@ -167,8 +179,8 @@ static void NWEnsureGTKArrow ( int nScreen ); static void NWEnsureGTKEditBox ( int nScreen ); static void NWEnsureGTKSpinButton ( int nScreen ); static void NWEnsureGTKNotebook ( int nScreen ); -static void NWEnsureGTKOptionMenu ( int nScreen ); -static void NWEnsureGTKCombo ( int nScreen ); +static void NWEnsureGTKComboBoxEntry ( int nScreen ); +static void NWEnsureGTKComboBox ( int nScreen ); static void NWEnsureGTKScrolledWindow ( int nScreen ); static void NWEnsureGTKToolbar ( int nScreen ); static void NWEnsureGTKMenubar ( int nScreen ); @@ -213,12 +225,12 @@ static void NWPaintOneSpinButton( int nScreen, GdkPixmap * pixmap, ControlType n static Rectangle NWGetComboBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); -//--- -static Rectangle NWGetListBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, const OUString& rCaption ); - -static Rectangle NWGetListBoxIndicatorRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState, - const ImplControlValue& aValue, const OUString& rCaption ); +static Rectangle NWGetComboBoxEntryButtonRect( int nScreen, ControlType nType, + ControlPart nPart, + Rectangle aAreaRect, + ControlState nState, + const ImplControlValue& aValue, + const OUString& rCaption ); static Rectangle NWGetToolbarRect( int nScreen, ControlType nType, @@ -510,7 +522,7 @@ void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry, if( pFrame && m_pWindow ) { /* #i64117# some themes set the background pixmap VERY frequently */ - GdkWindow* pWin = GTK_WIDGET(m_pWindow)->window; + GdkWindow* pWin = widget_get_window(m_pWindow); if( pWin ) { aWin = GDK_WINDOW_XWINDOW(pWin); @@ -833,7 +845,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, ||(nPart==PART_BUTTON_DOWN) ) ) { - returnVal = NWPaintGTKComboBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); + returnVal = NWPaintGTKComboBoxEntry( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER) ) { @@ -844,7 +856,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType, } else if ( (nType==CTRL_LISTBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_WINDOW)) ) { - returnVal = NWPaintGTKListBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); + returnVal = NWPaintGTKComboBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } else if ( (nType== CTRL_TOOLBAR) ) { @@ -1001,7 +1013,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, } if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { - rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState, + rNativeBoundingRegion = NWGetComboBoxEntryButtonRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; @@ -1018,7 +1030,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, } if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { - rNativeBoundingRegion = NWGetListBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState, + rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); rNativeContentRegion = rNativeBoundingRegion; @@ -1214,20 +1226,20 @@ BOOL GtkSalGraphics::NWPaintGTKButton( clipRect.height = it->GetHeight(); // Buttons must paint opaque since some themes have alpha-channel enabled buttons - gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, + gtk_paint_flat_box( gtk_widget_get_style(gWidgetData[m_nScreen].gBtnWidget), gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, &clipRect, m_pWindow, "base", x, y, w, h ); - if ( (nState & CTRL_STATE_DEFAULT) && (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief == GTK_RELIEF_NORMAL) ) + if ( (nState & CTRL_STATE_DEFAULT) && (gtk_button_get_relief(GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)) == GTK_RELIEF_NORMAL) ) { - gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, + gtk_paint_box( gtk_widget_get_style(gWidgetData[m_nScreen].gBtnWidget), gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, &clipRect, gWidgetData[m_nScreen].gBtnWidget, "buttondefault", x, y, w, h ); } - if ( (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief != GTK_RELIEF_NONE) + if ( (gtk_button_get_relief(GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)) != GTK_RELIEF_NONE) || (nState & CTRL_STATE_PRESSED) || (nState & CTRL_STATE_ROLLOVER) ) { - gtk_paint_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, shadowType, + gtk_paint_box( gtk_widget_get_style(gWidgetData[m_nScreen].gBtnWidget), gdkDrawable, stateType, shadowType, &clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi ); } } @@ -1916,7 +1928,7 @@ static void NWPaintOneEditBox( int nScreen, NWEnsureGTKButton( nScreen ); NWEnsureGTKEditBox( nScreen ); NWEnsureGTKSpinButton( nScreen ); - NWEnsureGTKCombo( nScreen ); + NWEnsureGTKComboBoxEntry( nScreen ); NWEnsureGTKScrolledWindow( nScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); @@ -1929,14 +1941,13 @@ static void NWPaintOneEditBox( int nScreen, case CTRL_SPINBOX: widget = gWidgetData[nScreen].gSpinButtonWidget; break; - case CTRL_MULTILINE_EDITBOX: widget = gWidgetData[nScreen].gScrolledWindowWidget; break; + case CTRL_LISTBOX: case CTRL_COMBOBOX: - widget = GTK_COMBO(gWidgetData[nScreen].gComboWidget)->entry; + widget = gWidgetData[nScreen].gComboBoxEntry_EntryWidget; break; - default: widget = gWidgetData[nScreen].gEditBoxWidget; break; @@ -2152,7 +2163,9 @@ static void NWPaintOneSpinButton( int nScreen, //------------------------------------- -BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, +#define ARROW_EXTENT 0.7 + +BOOL GtkSalGraphics::NWPaintGTKComboBoxEntry( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, @@ -2169,8 +2182,7 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, GdkRectangle clipRect; NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKArrow( m_nScreen ); - NWEnsureGTKCombo( m_nScreen ); + NWEnsureGTKComboBoxEntry( m_nScreen ); NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); // Find the overall bounding rect of the buttons's drawing area, @@ -2180,17 +2192,15 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, y = rControlRectangle.Top(); NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gComboWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gArrowWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nScreen].gComboBoxEntryWidget, nState, stateType ); - buttonRect = NWGetComboBoxButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption ); + buttonRect = NWGetComboBoxEntryButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption ); if( nPart == PART_BUTTON_DOWN ) buttonRect.Left() += 1; Rectangle aEditBoxRect( pixmapRect ); aEditBoxRect.SetSize( Size( pixmapRect.GetWidth() - buttonRect.GetWidth(), aEditBoxRect.GetHeight() ) ); - #define ARROW_EXTENT 0.7 arrowRect.SetSize( Size( (gint)(MIN_ARROW_SIZE * ARROW_EXTENT), (gint)(MIN_ARROW_SIZE * ARROW_EXTENT) ) ); arrowRect.SetPos( Point( buttonRect.Left() + (gint)((buttonRect.GetWidth() - arrowRect.GetWidth()) / 2), @@ -2213,16 +2223,131 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, x+(buttonRect.Left() - pixmapRect.Left()), y+(buttonRect.Top() - pixmapRect.Top()), buttonRect.GetWidth(), buttonRect.GetHeight() ); - gtk_paint_box( GTK_COMBO(gWidgetData[m_nScreen].gComboWidget)->button->style, gdkDrawable, stateType, shadowType, - &clipRect, GTK_COMBO(gWidgetData[m_nScreen].gComboWidget)->button, "button", + gtk_paint_box( gWidgetData[m_nScreen].gComboBoxEntry_ButtonWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nScreen].gComboBoxEntry_ButtonWidget, "button", x+(buttonRect.Left() - pixmapRect.Left()), y+(buttonRect.Top() - pixmapRect.Top()), buttonRect.GetWidth(), buttonRect.GetHeight() ); - gtk_paint_arrow( gWidgetData[m_nScreen].gArrowWidget->style, gdkDrawable, stateType, shadowType, - &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE, + gtk_paint_arrow( gWidgetData[m_nScreen].gComboBoxEntry_ArrowWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nScreen].gComboBoxEntry_ArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE, + x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()), + arrowRect.GetWidth(), arrowRect.GetHeight() ); + } + + return( TRUE ); +} + +BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, + ControlType nType, ControlPart nPart, + const Rectangle& rControlRectangle, + const clipList& rClipList, + ControlState nState, + const ImplControlValue& aValue, + const OUString& rCaption ) +{ + Rectangle pixmapRect; + Rectangle buttonRect; + GtkStateType stateType; + GtkShadowType shadowType; + Rectangle arrowRect; + gint x,y; + GdkRectangle clipRect; + + NWEnsureGTKButton( m_nScreen ); + NWEnsureGTKComboBox( m_nScreen ); + NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); + + // Find the overall bounding rect of the buttons's drawing area, + // plus its actual draw rect excluding adornment + pixmapRect = rControlRectangle; + if ( nPart == PART_WINDOW ) + { + // Make the widget a _bit_ bigger + pixmapRect.SetPos( Point( pixmapRect.Left() - 1, + pixmapRect.Top() - 1 ) ); + pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 2, + pixmapRect.GetHeight() + 2 ) ); + } + x = pixmapRect.Left(); + y = pixmapRect.Top(); + + NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); + NWSetWidgetState( gWidgetData[m_nScreen].gComboBoxWidget, nState, stateType ); + + buttonRect = NWGetComboBoxButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption ); + if( nPart == PART_BUTTON_DOWN ) + buttonRect.Left() += 1; + + arrowRect.SetSize( Size( (gint)(MIN_ARROW_SIZE * ARROW_EXTENT), + (gint)(MIN_ARROW_SIZE * ARROW_EXTENT) ) ); + arrowRect.SetPos( Point( buttonRect.Left() + (gint)((buttonRect.GetWidth() - arrowRect.GetWidth()) / 2), + buttonRect.Top() + (gint)((buttonRect.GetHeight() - arrowRect.GetHeight()) / 2) ) ); + + for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) + { + clipRect.x = it->Left(); + clipRect.y = it->Top(); + clipRect.width = it->GetWidth(); + clipRect.height = it->GetHeight(); + + if ( nPart != PART_WINDOW ) + { + // Buttons must paint opaque since some themes have alpha-channel enabled buttons + gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, + &clipRect, m_pWindow, "base", + x+(pixmapRect.Left() - pixmapRect.Left()), + y+(pixmapRect.Top() - pixmapRect.Top()), + pixmapRect.GetWidth(), pixmapRect.GetHeight() ); + + gtk_paint_box( gWidgetData[m_nScreen].gComboBox_ButtonWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nScreen].gComboBox_ButtonWidget, "button", + x+(pixmapRect.Left() - pixmapRect.Left()), + y+(pixmapRect.Top() - pixmapRect.Top()), + pixmapRect.GetWidth(), pixmapRect.GetHeight() ); + + gtk_paint_arrow( gWidgetData[m_nScreen].gComboBox_ArrowWidget->style, gdkDrawable, stateType, shadowType, + &clipRect, gWidgetData[m_nScreen].gComboBox_ArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE, x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()), arrowRect.GetWidth(), arrowRect.GetHeight() ); + + if (gWidgetData[m_nScreen].gComboBox_SeparatorWidget) + { + gint nSeparatorWidth; + gboolean bWideSeparators; + gtk_widget_style_get(gWidgetData[m_nScreen].gComboBox_SeparatorWidget, + "wide-separators", &bWideSeparators, + "separator-width", &nSeparatorWidth, + NULL); + + if (bWideSeparators) + { + gtk_paint_box(gWidgetData[m_nScreen].gComboBox_SeparatorWidget->style, + gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT, + &clipRect, gWidgetData[m_nScreen].gComboBox_SeparatorWidget, + "vseparator", x+(arrowRect.Left() - pixmapRect.Left()-nSeparatorWidth), + y+(arrowRect.Top() - pixmapRect.Top()), nSeparatorWidth, arrowRect.GetHeight()); + } + else + { + gtk_paint_vline(gWidgetData[m_nScreen].gComboBox_SeparatorWidget->style, + gdkDrawable, GTK_STATE_NORMAL, &clipRect, + gWidgetData[m_nScreen].gComboBox_SeparatorWidget, "vseparator", + y+(arrowRect.Top() - pixmapRect.Top()), y+(arrowRect.Top() - pixmapRect.Top()) + arrowRect.GetHeight(), + x+(arrowRect.Left() - pixmapRect.Left())- + gWidgetData[m_nScreen].gComboBox_SeparatorWidget->style->xthickness); + } + } + } + else + { + NWEnsureGTKScrolledWindow(m_nScreen); + + gtk_paint_shadow( gWidgetData[m_nScreen].gScrolledWindowWidget->style, gdkDrawable, + GTK_STATE_NORMAL, GTK_SHADOW_IN, &clipRect, + gWidgetData[m_nScreen].gScrolledWindowWidget, "scrolled_window", + x, y, pixmapRect.GetWidth(), pixmapRect.GetHeight() ); + } } return( TRUE ); @@ -2230,7 +2355,7 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, //---- -static Rectangle NWGetComboBoxButtonRect( int nScreen, +static Rectangle NWGetComboBoxEntryButtonRect( int nScreen, ControlType, ControlPart nPart, Rectangle aAreaRect, @@ -2244,16 +2369,16 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen, gint nFocusWidth; gint nFocusPad; - NWEnsureGTKArrow( nScreen ); + NWEnsureGTKComboBoxEntry ( nScreen ); // Grab some button style attributes - gtk_widget_style_get( gWidgetData[nScreen].gDropdownWidget, + gtk_widget_style_get( gWidgetData[nScreen].gComboBoxEntry_ButtonWidget, "focus-line-width", &nFocusWidth, "focus-padding", &nFocusPad, (char *)NULL ); - nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gArrowWidget)->xpad * 2); + nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gComboBoxEntry_ArrowWidget)->xpad * 2); nButtonWidth = nArrowWidth + - ((BTN_CHILD_SPACING + gWidgetData[nScreen].gDropdownWidget->style->xthickness) * 2) + ((BTN_CHILD_SPACING + gWidgetData[nScreen].gComboBoxEntry_ButtonWidget->style->xthickness) * 2) + (2 * (nFocusWidth+nFocusPad)); if( nPart == PART_BUTTON_DOWN ) { @@ -2263,13 +2388,74 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen, } else if( nPart == PART_SUB_EDIT ) { - NWEnsureGTKCombo( nScreen ); + gint adjust_x = GTK_CONTAINER(gWidgetData[nScreen].gComboBoxEntryWidget)->border_width + + nFocusWidth + + nFocusPad; + gint adjust_y = adjust_x + gWidgetData[nScreen].gComboBoxEntryWidget->style->ythickness; + adjust_x += gWidgetData[nScreen].gComboBoxEntryWidget->style->xthickness; + aButtonRect.SetSize( Size( aAreaRect.GetWidth() - nButtonWidth - 2 * adjust_x, + aAreaRect.GetHeight() - 2 * adjust_y ) ); + Point aEditPos = aAreaRect.TopLeft(); + aEditPos.X() += adjust_x; + aEditPos.Y() += adjust_y; + aButtonRect.SetPos( aEditPos ); + } + + return( aButtonRect ); +} + +static Rectangle NWGetComboBoxButtonRect( int nScreen, + ControlType, + ControlPart nPart, + Rectangle aAreaRect, + ControlState, + const ImplControlValue&, + const OUString& ) +{ + Rectangle aButtonRect; + gint nArrowWidth; + gint nButtonWidth; + gint nFocusWidth; + gint nFocusPad; + + NWEnsureGTKComboBox ( nScreen ); + // Grab some button style attributes + gtk_widget_style_get( gWidgetData[nScreen].gComboBox_ButtonWidget, + "focus-line-width", &nFocusWidth, + "focus-padding", &nFocusPad, (char *)NULL ); + + nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gComboBox_ArrowWidget)->xpad * 2); + + gint nSeparatorWidth = 0; + if (gWidgetData[nScreen].gComboBox_SeparatorWidget) + { + gboolean bWideSeparators; + gtk_widget_style_get(gWidgetData[nScreen].gComboBox_SeparatorWidget, + "wide-separators", &bWideSeparators, + "separator-width", &nSeparatorWidth, + NULL); - gint adjust_x = GTK_CONTAINER(gWidgetData[nScreen].gComboWidget)->border_width + + if (!bWideSeparators) + nSeparatorWidth = gWidgetData[nScreen].gComboBox_SeparatorWidget->style->xthickness; + } + + nButtonWidth = nArrowWidth + nSeparatorWidth + + + gWidgetData[nScreen].gComboBox_ButtonWidget->style->xthickness + + (nFocusWidth+nFocusPad); + + if( nPart == PART_BUTTON_DOWN ) + { + aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) ); + aButtonRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth, + aAreaRect.Top() ) ); + } + else if( nPart == PART_SUB_EDIT ) + { + gint adjust_x = GTK_CONTAINER(gWidgetData[nScreen].gComboBoxWidget)->border_width + nFocusWidth + nFocusPad; - gint adjust_y = adjust_x + gWidgetData[nScreen].gComboWidget->style->ythickness; - adjust_x += gWidgetData[nScreen].gComboWidget->style->xthickness; + gint adjust_y = adjust_x + gWidgetData[nScreen].gComboBoxWidget->style->ythickness; + adjust_x += gWidgetData[nScreen].gComboBoxWidget->style->xthickness; aButtonRect.SetSize( Size( aAreaRect.GetWidth() - nButtonWidth - 2 * adjust_x, aAreaRect.GetHeight() - 2 * adjust_y ) ); Point aEditPos = aAreaRect.TopLeft(); @@ -2281,6 +2467,7 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen, return( aButtonRect ); } + //------------------------------------- @@ -2424,100 +2611,13 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, return bSuccess; } -//------------------------------------- - -BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable, - ControlType nType, ControlPart nPart, - const Rectangle& rControlRectangle, - const clipList& rClipList, - ControlState nState, - const ImplControlValue& aValue, - const OUString& rCaption ) -{ - Rectangle pixmapRect; - Rectangle widgetRect; - Rectangle aIndicatorRect; - GtkStateType stateType; - GtkShadowType shadowType; - gint bInteriorFocus; - gint nFocusLineWidth; - gint nFocusPadding; - gint x,y; - GdkRectangle clipRect; - - NWEnsureGTKButton( m_nScreen ); - NWEnsureGTKOptionMenu( m_nScreen ); - NWEnsureGTKScrolledWindow( m_nScreen ); - NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); - - // Find the overall bounding rect of the buttons's drawing area, - // plus its actual draw rect excluding adornment - pixmapRect = rControlRectangle; - if ( nPart == PART_WINDOW ) - { - // Make the widget a _bit_ bigger - pixmapRect.SetPos( Point( pixmapRect.Left() - 1, - pixmapRect.Top() - 1 ) ); - pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 2, - pixmapRect.GetHeight() + 2 ) ); - } - - widgetRect = pixmapRect; - x = pixmapRect.Left(); - y = pixmapRect.Top(); - - // set up references to correct drawable and cliprect - NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gOptionMenuWidget, nState, stateType ); - NWSetWidgetState( gWidgetData[m_nScreen].gScrolledWindowWidget, nState, stateType ); - - if ( nPart != PART_WINDOW ) - { - gtk_widget_style_get( gWidgetData[m_nScreen].gOptionMenuWidget, - "interior_focus", &bInteriorFocus, - "focus_line_width", &nFocusLineWidth, - "focus_padding", &nFocusPadding, - (char *)NULL); - } - - for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) - { - clipRect.x = it->Left(); - clipRect.y = it->Top(); - clipRect.width = it->GetWidth(); - clipRect.height = it->GetHeight(); - - if ( nPart != PART_WINDOW ) +static void set_widget_orientation(GtkWidget *widget, GtkOrientation orientation) { - // Listboxes must paint opaque since some themes have alpha-channel enabled bodies - gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, - &clipRect, m_pWindow, "base", x, y, - pixmapRect.GetWidth(), pixmapRect.GetHeight() ); - gtk_paint_box( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, - gWidgetData[m_nScreen].gOptionMenuWidget, "optionmenu", - x+(widgetRect.Left() - pixmapRect.Left()), - y+(widgetRect.Top() - pixmapRect.Top()), - widgetRect.GetWidth(), widgetRect.GetHeight() ); - aIndicatorRect = NWGetListBoxIndicatorRect( m_nScreen, nType, nPart, widgetRect, nState, - aValue, rCaption ); - gtk_paint_tab( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect, - gWidgetData[m_nScreen].gOptionMenuWidget, "optionmenutab", - x+(aIndicatorRect.Left() - pixmapRect.Left()), - y+(aIndicatorRect.Top() - pixmapRect.Top()), - aIndicatorRect.GetWidth(), aIndicatorRect.GetHeight() ); - } - else - { - shadowType = GTK_SHADOW_IN; - - gtk_paint_shadow( gWidgetData[m_nScreen].gScrolledWindowWidget->style, gdkDrawable, GTK_STATE_NORMAL, shadowType, - &clipRect, gWidgetData[m_nScreen].gScrolledWindowWidget, "scrolled_window", - x+(widgetRect.Left() - pixmapRect.Left()), y+(widgetRect.Top() - pixmapRect.Top()), - widgetRect.GetWidth(), widgetRect.GetHeight() ); - } - } - - return( TRUE ); +#if GTK_CHECK_VERSION(2,90,0) + gtk_orientable_set_orientation( GTK_ORIENTABLE(widget), orientation ); +#else + gtk_toolbar_set_orientation( GTK_TOOLBAR(widget), orientation ); +#endif } BOOL GtkSalGraphics::NWPaintGTKToolbar( @@ -2557,9 +2657,9 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gToolbarWidget, GTK_SENSITIVE ); if( nPart == PART_DRAW_BACKGROUND_HORZ ) - gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nScreen].gToolbarWidget), GTK_ORIENTATION_HORIZONTAL ); + set_widget_orientation( gWidgetData[m_nScreen].gToolbarWidget, GTK_ORIENTATION_HORIZONTAL ); else - gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nScreen].gToolbarWidget), GTK_ORIENTATION_VERTICAL ); + set_widget_orientation( gWidgetData[m_nScreen].gToolbarWidget, GTK_ORIENTATION_VERTICAL ); } // handle grip else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT ) @@ -3164,116 +3264,6 @@ BOOL GtkSalGraphics::NWPaintGTKSlider( return bRet; } -//---- - -static Rectangle NWGetListBoxButtonRect( int nScreen, - ControlType, - ControlPart nPart, - Rectangle aAreaRect, - ControlState, - const ImplControlValue&, - const OUString& ) -{ - Rectangle aPartRect; - GtkRequisition *pIndicatorSize = NULL; - GtkBorder *pIndicatorSpacing = NULL; - gint width = 13; // GTK+ default - gint right = 5; // GTK+ default - gint nButtonAreaWidth = 0; - gint xthickness = 0; - - NWEnsureGTKOptionMenu( nScreen ); - - gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget, - "indicator_size", &pIndicatorSize, - "indicator_spacing",&pIndicatorSpacing, (char *)NULL); - - if ( pIndicatorSize ) - width = pIndicatorSize->width; - - if ( pIndicatorSpacing ) - right = pIndicatorSpacing->right; - - Size aPartSize( 0, aAreaRect.GetHeight() ); - Point aPartPos ( 0, aAreaRect.Top() ); - - xthickness = gWidgetData[nScreen].gOptionMenuWidget->style->xthickness; - nButtonAreaWidth = width + right + (xthickness * 2); - switch( nPart ) - { - case PART_BUTTON_DOWN: - aPartSize.Width() = nButtonAreaWidth; - aPartPos.X() = aAreaRect.Left() + aAreaRect.GetWidth() - aPartSize.Width(); - break; - - case PART_SUB_EDIT: - aPartSize.Width() = aAreaRect.GetWidth() - nButtonAreaWidth - xthickness; - aPartPos.X() = aAreaRect.Left() + xthickness; - break; - - default: - aPartSize.Width() = aAreaRect.GetWidth(); - aPartPos.X() = aAreaRect.Left(); - break; - } - aPartRect = Rectangle( aPartPos, aPartSize ); - - if ( pIndicatorSize ) - gtk_requisition_free( pIndicatorSize ); - if ( pIndicatorSpacing ) - gtk_border_free( pIndicatorSpacing ); - - return( aPartRect ); -} - -//---- - -static Rectangle NWGetListBoxIndicatorRect( int nScreen, - ControlType, - ControlPart, - Rectangle aAreaRect, - ControlState, - const ImplControlValue&, - const OUString& ) -{ - Rectangle aIndicatorRect; - GtkRequisition *pIndicatorSize = NULL; - GtkBorder *pIndicatorSpacing = NULL; - gint width = 13; // GTK+ default - gint height = 13; // GTK+ default - gint right = 5; // GTK+ default - - NWEnsureGTKOptionMenu( nScreen ); - - gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget, - "indicator_size", &pIndicatorSize, - "indicator_spacing",&pIndicatorSpacing, (char *)NULL); - - if ( pIndicatorSize ) - { - width = pIndicatorSize->width; - height = pIndicatorSize->height; - } - - if ( pIndicatorSpacing ) - right = pIndicatorSpacing->right; - - aIndicatorRect.SetSize( Size( width, height ) ); - aIndicatorRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - width - right - gWidgetData[nScreen].gOptionMenuWidget->style->xthickness, - aAreaRect.Top() + ((aAreaRect.GetHeight() - height) / 2) ) ); - - // If height is odd, move the indicator down 1 pixel - if ( aIndicatorRect.GetHeight() % 2 ) - aIndicatorRect.Move( 0, 1 ); - - if ( pIndicatorSize ) - gtk_requisition_free( pIndicatorSize ); - if ( pIndicatorSpacing ) - gtk_border_free( pIndicatorSpacing ); - - return( aIndicatorRect ); -} - static Rectangle NWGetToolbarRect( int nScreen, ControlType, ControlPart nPart, @@ -3902,7 +3892,7 @@ static void NWEnsureGTKArrow( int nScreen ) NWAddWidgetToCacheWindow( gWidgetData[nScreen].gDropdownWidget, nScreen ); gWidgetData[nScreen].gArrowWidget = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT ); gtk_container_add( GTK_CONTAINER(gWidgetData[nScreen].gDropdownWidget), gWidgetData[nScreen].gArrowWidget ); - gtk_widget_set_rc_style( gWidgetData[nScreen].gArrowWidget ); + gtk_widget_set_style( gWidgetData[nScreen].gArrowWidget, NULL ); gtk_widget_realize( gWidgetData[nScreen].gArrowWidget ); } } @@ -3948,32 +3938,132 @@ static void NWEnsureGTKNotebook( int nScreen ) //------------------------------------- -static void NWEnsureGTKOptionMenu( int nScreen ) +G_BEGIN_DECLS +static void get_combo_box_entry_inner_widgets(GtkWidget *widget, gpointer client_data); +static void get_combo_box_entry_arrow(GtkWidget *widget, gpointer client_data); +static void get_combo_box_inner_widgets(GtkWidget *widget, gpointer client_data); +G_END_DECLS + +static void get_combo_box_entry_inner_widgets(GtkWidget *widget, gpointer client_data) { - if ( !gWidgetData[nScreen].gOptionMenuWidget ) + int nScreen = GPOINTER_TO_INT(client_data); + if (GTK_IS_TOGGLE_BUTTON(widget)) + gWidgetData[nScreen].gComboBoxEntry_ButtonWidget = widget; + else if (GTK_IS_ENTRY(widget)) { - gWidgetData[nScreen].gOptionMenuWidget = gtk_option_menu_new(); - NWAddWidgetToCacheWindow( gWidgetData[nScreen].gOptionMenuWidget, nScreen ); + // #i59129# Setting non-editable means it doesn't blink, so + // there are no timeouts running around to nobble us + gtk_editable_set_editable(GTK_EDITABLE(widget), false); + gWidgetData[nScreen].gComboBoxEntry_EntryWidget = widget; } + else + return; + gtk_widget_realize(widget); } -//------------------------------------- +static void get_combo_box_entry_arrow(GtkWidget *widget, gpointer client_data) +{ + if (GTK_IS_ARROW(widget)) + { + int nScreen = GPOINTER_TO_INT(client_data); + gWidgetData[nScreen].gComboBoxEntry_ArrowWidget = widget; + gtk_widget_realize(widget); + } +} -static void NWEnsureGTKCombo( int nScreen ) +static void NWEnsureGTKComboBoxEntry( int nScreen ) { - if ( !gWidgetData[nScreen].gComboWidget ) + if ( !gWidgetData[nScreen].gComboBoxEntryWidget ) { - gWidgetData[nScreen].gComboWidget = gtk_combo_new(); + gWidgetData[nScreen].gComboBoxEntryWidget = gtk_combo_box_entry_new(); - // #i59129# Setting non-editable means it doesn't blink, so - // there are no timeouts running around to nobble us - gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO(gWidgetData[nScreen].gComboWidget)->entry), false); + NWAddWidgetToCacheWindow( gWidgetData[nScreen].gComboBoxEntryWidget, nScreen ); + + gtk_container_forall(GTK_CONTAINER(gWidgetData[nScreen].gComboBoxEntryWidget), + get_combo_box_entry_inner_widgets, GINT_TO_POINTER(nScreen) ); - NWAddWidgetToCacheWindow( gWidgetData[nScreen].gComboWidget, nScreen ); - // Must realize the ComboBox's children, since GTK - // does not do this for us in GtkCombo::gtk_widget_realize() - gtk_widget_realize( GTK_COMBO(gWidgetData[nScreen].gComboWidget)->button ); - gtk_widget_realize( GTK_COMBO(gWidgetData[nScreen].gComboWidget)->entry ); + //If for some reason or other we couldn't find the expected children, + //alias them to some we know will definitely exist + if (!gWidgetData[nScreen].gComboBoxEntry_EntryWidget) + { + NWEnsureGTKEditBox( nScreen ); + gWidgetData[nScreen].gComboBoxEntry_EntryWidget = gWidgetData[nScreen].gEditBoxWidget; + } + if (gWidgetData[nScreen].gComboBoxEntry_ButtonWidget) + { + //Dig around for the arrow + GtkWidget *child = GTK_BIN(gWidgetData[nScreen].gComboBoxEntry_ButtonWidget)->child; + if (GTK_IS_HBOX(child)) + { + gtk_container_forall(GTK_CONTAINER(child), get_combo_box_entry_arrow, + GINT_TO_POINTER(nScreen) ); + } + else + get_combo_box_entry_arrow(child, GINT_TO_POINTER(nScreen)); + } + else + { + NWEnsureGTKArrow( nScreen ); + gWidgetData[nScreen].gComboBoxEntry_ButtonWidget = gWidgetData[nScreen].gDropdownWidget; + } + if (!gWidgetData[nScreen].gComboBoxEntry_ArrowWidget) + { + NWEnsureGTKArrow( nScreen ); + gWidgetData[nScreen].gComboBoxEntry_ArrowWidget = gWidgetData[nScreen].gArrowWidget; + } + } +} + +static void get_combo_box_inner_widgets(GtkWidget *widget, gpointer client_data) +{ + int nScreen = GPOINTER_TO_INT(client_data); + if (GTK_IS_TOGGLE_BUTTON(widget)) + gWidgetData[nScreen].gComboBox_ButtonWidget = widget; + else if (GTK_IS_SEPARATOR(widget)) + gWidgetData[nScreen].gComboBox_SeparatorWidget = widget; + else if (GTK_IS_ARROW(widget)) + gWidgetData[nScreen].gComboBox_ArrowWidget = widget; + else + return; + gtk_widget_realize(widget); +} + +static void NWEnsureGTKComboBox( int nScreen ) +{ + if ( !gWidgetData[nScreen].gComboBoxWidget ) + { + gWidgetData[nScreen].gComboBoxWidget = gtk_combo_box_new(); + + NWAddWidgetToCacheWindow( gWidgetData[nScreen].gComboBoxWidget, nScreen ); + + gtk_container_forall(GTK_CONTAINER(gWidgetData[nScreen].gComboBoxWidget), + get_combo_box_inner_widgets, GINT_TO_POINTER(nScreen) ); + + //If for some reason or other we couldn't find the expected children, + //alias them to some we know will definitely exist + if (gWidgetData[nScreen].gComboBox_ButtonWidget) + { + //Dig around for the arrow + GtkWidget *child = GTK_BIN(gWidgetData[nScreen].gComboBox_ButtonWidget)->child; + if (GTK_IS_HBOX(child)) + { + gtk_container_forall(GTK_CONTAINER(child), get_combo_box_inner_widgets, + GINT_TO_POINTER(nScreen) ); + } + else + get_combo_box_inner_widgets(child, GINT_TO_POINTER(nScreen)); + } + else + { + NWEnsureGTKArrow( nScreen ); + gWidgetData[nScreen].gComboBox_ButtonWidget = gWidgetData[nScreen].gDropdownWidget; + } + + if (!gWidgetData[nScreen].gComboBox_ArrowWidget) + { + NWEnsureGTKArrow( nScreen ); + gWidgetData[nScreen].gComboBox_ArrowWidget = gWidgetData[nScreen].gArrowWidget; + } } } diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 8cd3cb1..97aa578 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -79,6 +79,14 @@ #define GDK_META_MASK (1 << 28) #endif +#if GTK_CHECK_VERSION(2,90,0) +#define IS_WIDGET_REALIZED gtk_widget_get_realized +#define IS_WIDGET_MAPPED gtk_widget_get_mapped +#else +#define IS_WIDGET_REALIZED GTK_WIDGET_REALIZED +#define IS_WIDGET_MAPPED GTK_WIDGET_MAPPED +#endif + using namespace com::sun::star; int GtkSalFrame::m_nFloats = 0; @@ -431,12 +439,18 @@ GtkSalFrame::~GtkSalFrame() getDisplay()->deregisterFrame( this ); if( m_pRegion ) + { +#if GTK_CHECK_VERSION(2,90,0) + cairo_region_destroy( m_pRegion ); +#else gdk_region_destroy( m_pRegion ); +#endif + } if( m_hBackgroundPixmap ) { XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(m_pWindow->window), + GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), None ); XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap ); } @@ -595,7 +609,7 @@ void GtkSalFrame::InitCommon() SalDisplay* pDisp = GetX11SalData()->GetDisplay(); m_aSystemData.nSize = sizeof( SystemChildData ); m_aSystemData.pDisplay = pDisp->GetDisplay(); - m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window); + m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)); m_aSystemData.pSalFrame = this; m_aSystemData.pWidget = m_pWindow; m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual(); @@ -647,7 +661,7 @@ void GtkSalFrame::InitCommon() * some paint issues */ XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(m_pWindow->window), + GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_hBackgroundPixmap ); } @@ -681,7 +695,7 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBe else if( ! bBeforeRealize ) { Display* pDisplay = GetX11SalData()->GetDisplay()->GetDisplay(); - XLIB_Window aWindow = GDK_WINDOW_XWINDOW( GTK_WIDGET(pWindow)->window ); + XLIB_Window aWindow = GDK_WINDOW_XWINDOW( widget_get_window(GTK_WIDGET(pWindow)) ); XWMHints* pHints = XGetWMHints( pDisplay, aWindow ); if( ! pHints ) { @@ -866,7 +880,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) nUserTime= getDisplay()->GetLastUserEventTime( true ); // nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); } - lcl_set_user_time(GTK_WIDGET(m_pWindow)->window, nUserTime); + lcl_set_user_time(widget_get_window(GTK_WIDGET(m_pWindow)), nUserTime); } if( bDecoHandling ) @@ -920,7 +934,8 @@ void GtkSalFrame::Init( SystemParentData* pSysData ) { m_pWindow = gtk_plug_new( pSysData->aWindow ); m_bWindowIsGtkPlug = true; - GTK_WIDGET_SET_FLAGS( m_pWindow, GTK_CAN_FOCUS | GTK_SENSITIVE | GTK_CAN_DEFAULT ); + widget_set_can_default( m_pWindow, true ); + widget_set_can_focus( m_pWindow, true ); gtk_widget_set_sensitive( m_pWindow, true ); } else @@ -945,7 +960,7 @@ void GtkSalFrame::Init( SystemParentData* pSysData ) if( ! m_bWindowIsGtkPlug ) { XReparentWindow( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(m_pWindow->window), + GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), (XLIB_Window)pSysData->aWindow, 0, 0 ); } @@ -979,14 +994,14 @@ void GtkSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) if( nStyle != m_nExtStyle && ! isChild() ) { m_nExtStyle = nStyle; - if( GTK_WIDGET_REALIZED( m_pWindow ) ) + if( IS_WIDGET_REALIZED( m_pWindow ) ) { XClassHint* pClass = XAllocClassHint(); rtl::OString aResHint = X11SalData::getFrameResName( m_nExtStyle ); pClass->res_name = const_cast(aResHint.getStr()); pClass->res_class = const_cast(X11SalData::getFrameClassName()); XSetClassHint( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(m_pWindow->window), + GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), pClass ); XFree( pClass ); } @@ -1010,7 +1025,7 @@ SalGraphics* GtkSalFrame::GetGraphics() if( ! m_aGraphics[i].pGraphics ) { m_aGraphics[i].pGraphics = new GtkSalGraphics( m_pWindow ); - m_aGraphics[i].pGraphics->Init( this, GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen ); + m_aGraphics[i].pGraphics->Init( this, GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_nScreen ); } return m_aGraphics[i].pGraphics; } @@ -1311,7 +1326,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) setMinMaxSize(); // #i45160# switch to desktop where a dialog with parent will appear - if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && GTK_WIDGET_MAPPED(m_pParent->m_pWindow) ) + if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && IS_WIDGET_MAPPED(m_pParent->m_pWindow) ) getDisplay()->getWMAdaptor()->switchToWorkArea( m_pParent->m_nWorkArea ); if( isFloatGrabWindow() && @@ -1362,7 +1377,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) nUserTime= getDisplay()->GetLastUserEventTime( true ); //nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); } - lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime ); + lcl_set_user_time( widget_get_window(GTK_WIDGET(m_pWindow)), nUserTime ); if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) ) m_bSetFocusOnMap = true; @@ -1465,7 +1480,7 @@ void GtkSalFrame::SetMaxClientSize( long nWidth, long nHeight ) { m_aMaxSize = Size( nWidth, nHeight ); // Show does a setMinMaxSize - if( GTK_WIDGET_MAPPED( m_pWindow ) ) + if( IS_WIDGET_MAPPED( m_pWindow ) ) setMinMaxSize(); } } @@ -1478,7 +1493,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight ) { gtk_widget_set_size_request( m_pWindow, nWidth, nHeight ); // Show does a setMinMaxSize - if( GTK_WIDGET_MAPPED( m_pWindow ) ) + if( IS_WIDGET_MAPPED( m_pWindow ) ) setMinMaxSize(); } } @@ -1730,7 +1745,7 @@ void GtkSalFrame::moveToScreen( int nScreen ) gtk_widget_realize( m_pWindow ); // update system data GtkSalDisplay* pDisp = getDisplay(); - m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window); + m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)); m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual(); m_aSystemData.nScreen = nScreen; m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth(); @@ -1741,7 +1756,7 @@ void GtkSalFrame::moveToScreen( int nScreen ) for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); i++ ) { if( m_aGraphics[i].bInUse ) - m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen ); + m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_nScreen ); } updateScreenNumber(); } @@ -1770,7 +1785,7 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen ) Rectangle aOldScreenRect( pDisp->GetXineramaScreens()[maGeometry.nScreenNumber] ); Rectangle aNewScreenRect( pDisp->GetXineramaScreens()[nNewScreen] ); - bool bVisible = GTK_WIDGET_MAPPED(m_pWindow); + bool bVisible = IS_WIDGET_MAPPED(m_pWindow); if( bVisible ) Show( FALSE ); maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left()); @@ -1802,7 +1817,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) { m_aRestorePosSize = Rectangle( Point( maGeometry.nX, maGeometry.nY ), Size( maGeometry.nWidth, maGeometry.nHeight ) ); - bool bVisible = GTK_WIDGET_MAPPED(m_pWindow); + bool bVisible = IS_WIDGET_MAPPED(m_pWindow); if( bVisible ) Show( FALSE ); m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; @@ -1835,7 +1850,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) } else { - bool bVisible = GTK_WIDGET_MAPPED(m_pWindow); + bool bVisible = IS_WIDGET_MAPPED(m_pWindow); if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) ); if( bVisible ) @@ -2043,7 +2058,7 @@ void GtkSalFrame::StartPresentation( BOOL bStart ) } #ifdef ENABLE_DBUS m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation", - GDK_WINDOW_XID(m_pWindow->window)); + GDK_WINDOW_XID(widget_get_window(m_pWindow))); #endif } else @@ -2069,7 +2084,7 @@ void GtkSalFrame::ToTop( USHORT nFlags ) { if( isChild( false, true ) ) gtk_widget_grab_focus( m_pWindow ); - else if( GTK_WIDGET_MAPPED( m_pWindow ) ) + else if( IS_WIDGET_MAPPED( m_pWindow ) ) { if( ! (nFlags & SAL_FRAME_TOTOP_GRABFOCUS_ONLY) ) gtk_window_present( GTK_WINDOW(m_pWindow) ); @@ -2078,7 +2093,7 @@ void GtkSalFrame::ToTop( USHORT nFlags ) // gdk_window_focus( m_pWindow->window, gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window) ); /* #i99360# ugly workaround an X11 library bug */ guint32 nUserTime= getDisplay()->GetLastUserEventTime( true ); - gdk_window_focus( m_pWindow->window, nUserTime ); + gdk_window_focus( widget_get_window(m_pWindow), nUserTime ); } /* need to do an XSetInputFocus here because * gdk_window_focus will ask a EWMH compliant WM to put the focus @@ -2090,7 +2105,7 @@ void GtkSalFrame::ToTop( USHORT nFlags ) // sad but true: this can cause an XError, we need to catch that // to do this we need to synchronize with the XServer getDisplay()->GetXLib()->PushXErrorLevel( true ); - XSetInputFocus( getDisplay()->GetDisplay(), GDK_WINDOW_XWINDOW( m_pWindow->window ), RevertToParent, CurrentTime ); + XSetInputFocus( getDisplay()->GetDisplay(), GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow) ), RevertToParent, CurrentTime ); XSync( getDisplay()->GetDisplay(), False ); getDisplay()->GetXLib()->PopXErrorLevel(); } @@ -2109,7 +2124,7 @@ void GtkSalFrame::SetPointer( PointerStyle ePointerStyle ) { m_ePointerStyle = ePointerStyle; GdkCursor *pCursor = getDisplay()->getCursor( ePointerStyle ); - gdk_window_set_cursor( m_pWindow->window, pCursor ); + gdk_window_set_cursor( widget_get_window(m_pWindow), pCursor ); m_pCurrentCursor = pCursor; // #i80791# use grabPointer the same way as CaptureMouse, respective float grab @@ -2144,7 +2159,7 @@ void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents ) { const int nMask = ( GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK ); - gdk_pointer_grab( m_pWindow->window, bOwnerEvents, + gdk_pointer_grab( widget_get_window(m_pWindow), bOwnerEvents, (GdkEventMask) nMask, NULL, m_pCurrentCursor, GDK_CURRENT_TIME ); } @@ -2157,7 +2172,7 @@ void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents ) // this is of course a bad hack, especially as we cannot // set the right cursor this way XGrabPointer( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW( m_pWindow->window), + GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow)), bOwnerEvents, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, @@ -2205,7 +2220,7 @@ void GtkSalFrame::SetPointerPos( long nX, long nY ) // #i38648# ask for the next motion hint gint x, y; GdkModifierType mask; - gdk_window_get_pointer( pFrame->m_pWindow->window, &x, &y, &mask ); + gdk_window_get_pointer( widget_get_window(pFrame->m_pWindow) , &x, &y, &mask ); } void GtkSalFrame::Flush() @@ -2303,7 +2318,7 @@ SalBitmap* GtkSalFrame::SnapShot() return NULL; X11SalBitmap *pBmp = new X11SalBitmap; - GdkWindow *pWin = m_pWindow->window; + GdkWindow *pWin = widget_get_window(m_pWindow); if( pBmp->SnapShot( GDK_DISPLAY_XDISPLAY( getGdkDisplay() ), GDK_WINDOW_XID( pWin ) ) ) return pBmp; @@ -2365,7 +2380,7 @@ void GtkSalFrame::SetParent( SalFrame* pNewParent ) void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nScreen ) { - bool bWasVisible = GTK_WIDGET_MAPPED(m_pWindow); + bool bWasVisible = IS_WIDGET_MAPPED(m_pWindow); if( bWasVisible ) Show( FALSE ); @@ -2410,7 +2425,13 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc m_pIMHandler = NULL; } if( m_pRegion ) +{ +#if GTK_CHECK_VERSION(2,90,0) + cairo_region_destroy( m_pRegion ); +#else gdk_region_destroy( m_pRegion ); +#endif +} if( m_pFixedContainer ) gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) ); if( m_pWindow ) @@ -2438,7 +2459,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc { if( m_aGraphics[i].bInUse ) { - m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen ); + m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_nScreen ); m_aGraphics[i].pGraphics->SetWindow( m_pWindow ); } } @@ -2468,14 +2489,20 @@ bool GtkSalFrame::SetPluginParent( SystemParentData* pSysParent ) void GtkSalFrame::ResetClipRegion() { if( m_pWindow ) - gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 ); + gdk_window_shape_combine_region( widget_get_window(m_pWindow), NULL, 0, 0 ); } void GtkSalFrame::BeginSetClipRegion( ULONG ) { +#if GTK_CHECK_VERSION(2,90,0) + if( m_pRegion ) + cairo_region_destroy( m_pRegion ); + m_pRegion = cairo_region_create(); +#else if( m_pRegion ) gdk_region_destroy( m_pRegion ); m_pRegion = gdk_region_new(); +#endif } void GtkSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) @@ -2487,15 +2514,18 @@ void GtkSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) aRect.y = nY; aRect.width = nWidth; aRect.height = nHeight; - +#if GTK_CHECK_VERSION(2,90,0) + cairo_region_union_rectangle( m_pRegion, &aRect ); +#else gdk_region_union_with_rect( m_pRegion, &aRect ); +#endif } } void GtkSalFrame::EndSetClipRegion() { if( m_pWindow && m_pRegion ) - gdk_window_shape_combine_region( m_pWindow->window, m_pRegion, 0, 0 ); + gdk_window_shape_combine_region( widget_get_window(m_pWindow), m_pRegion, 0, 0 ); } bool GtkSalFrame::Dispatch( const XEvent* pEvent ) @@ -2509,7 +2539,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent ) if( pEvent->xproperty.atom == nDesktopAtom && pEvent->xproperty.state == PropertyNewValue ) { - m_nWorkArea = pAdaptor->getWindowWorkArea( GDK_WINDOW_XWINDOW( m_pWindow->window) ); + m_nWorkArea = pAdaptor->getWindowWorkArea( GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow)) ); } } else if( pEvent->type == ConfigureNotify ) @@ -2536,7 +2566,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent ) int x = 0, y = 0; XLIB_Window aChild; XTranslateCoordinates( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW( m_pWindow->window), + GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow) ), getDisplay()->GetRootWindow( getDisplay()->GetDefaultScreenNumber() ), 0, 0, &x, &y, @@ -2551,7 +2581,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent ) } else if( pEvent->type == ClientMessage && pEvent->xclient.message_type == getDisplay()->getWMAdaptor()->getAtom( vcl_sal::WMAdaptor::XEMBED ) && - pEvent->xclient.window == GDK_WINDOW_XWINDOW(m_pWindow->window) && + pEvent->xclient.window == GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)) && m_bWindowIsGtkPlug ) { @@ -2563,7 +2593,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent ) { GdkEventFocus aEvent; aEvent.type = GDK_FOCUS_CHANGE; - aEvent.window = m_pWindow->window; + aEvent.window = widget_get_window(m_pWindow); aEvent.send_event = TRUE; aEvent.in = (pEvent->xclient.data.l[1] == 1); signalFocus( m_pWindow, &aEvent, this ); @@ -2578,7 +2608,7 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap ) if( m_hBackgroundPixmap ) { XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(m_pWindow->window), + GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), None ); XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap ); m_hBackgroundPixmap = None; @@ -2591,7 +2621,7 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap ) { m_hBackgroundPixmap = XCreatePixmap( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(m_pWindow->window), + GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), aSize.Width(), aSize.Height(), getDisplay()->GetVisual(m_nScreen).GetDepth() ); @@ -2607,7 +2637,7 @@ void GtkSalFrame::SetBackgroundBitmap( SalBitmap* pBitmap ) aTwoRect, getDisplay()->GetCopyGC(m_nScreen) ); XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(m_pWindow->window), + GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_hBackgroundPixmap ); } } @@ -2780,7 +2810,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer // ask for the next hint gint x, y; GdkModifierType mask; - gdk_window_get_pointer( GTK_WIDGET(pThis->m_pWindow)->window, &x, &y, &mask ); + gdk_window_get_pointer( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &x, &y, &mask ); } } @@ -2865,7 +2895,7 @@ IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG ) XEvent aEvent; aEvent.type = ClientMessage; aEvent.xclient.display = getDisplay()->GetDisplay(); - aEvent.xclient.window = GDK_WINDOW_XWINDOW(m_pWindow->window); + aEvent.xclient.window = GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)); aEvent.xclient.message_type = nStateAtom; aEvent.xclient.format = 32; aEvent.xclient.data.l[0] = 1; @@ -2915,7 +2945,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame ) if( bSetFocus ) { XSetInputFocus( pThis->getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW( GTK_WIDGET(pThis->m_pWindow)->window), + GDK_WINDOW_XWINDOW( widget_get_window(GTK_WIDGET(pThis->m_pWindow))), RevertToParent, CurrentTime ); } @@ -2963,7 +2993,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp */ XLIB_Window aChild; XTranslateCoordinates( pThis->getDisplay()->GetDisplay(), - GDK_WINDOW_XWINDOW(GTK_WIDGET(pThis->m_pWindow)->window), + GDK_WINDOW_XWINDOW(widget_get_window(GTK_WIDGET(pThis->m_pWindow))), pThis->getDisplay()->GetRootWindow( pThis->getDisplay()->GetDefaultScreenNumber() ), 0, 0, &x, &y, @@ -2997,7 +3027,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp if( ! (pThis->m_nStyle & SAL_FRAME_STYLE_PLUG) ) { GdkRectangle aRect; - gdk_window_get_frame_extents( GTK_WIDGET(pThis->m_pWindow)->window, &aRect ); + gdk_window_get_frame_extents( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &aRect ); pThis->maGeometry.nTopDecoration = y - aRect.y; pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height; pThis->maGeometry.nLeftDecoration = x - aRect.x; @@ -3208,7 +3238,7 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram * some time on the Xserver as well as prevent * some paint issues */ - GdkWindow* pWin = GTK_WIDGET(pThis->getWindow())->window; + GdkWindow* pWin = widget_get_window(GTK_WIDGET(pThis->getWindow())); if( pWin ) { XLIB_Window aWin = GDK_WINDOW_XWINDOW(pWin); @@ -3261,10 +3291,10 @@ gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, return FALSE; } -void GtkSalFrame::signalDestroy( GtkObject* pObj, gpointer frame ) +void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame ) { GtkSalFrame* pThis = (GtkSalFrame*)frame; - if( GTK_WIDGET( pObj ) == pThis->m_pWindow ) + if( pObj == pThis->m_pWindow ) { pThis->m_pFixedContainer = NULL; pThis->m_pWindow = NULL; @@ -3312,7 +3342,7 @@ void GtkSalFrame::IMHandler::createIMContext() G_CALLBACK (signalIMPreeditEnd), this ); m_pFrame->getDisplay()->GetXLib()->PushXErrorLevel( true ); - gtk_im_context_set_client_window( m_pIMContext, GTK_WIDGET(m_pFrame->m_pWindow)->window ); + gtk_im_context_set_client_window( m_pIMContext, widget_get_window(GTK_WIDGET(m_pFrame->m_pWindow)) ); gtk_im_context_focus_in( m_pIMContext ); m_pFrame->getDisplay()->GetXLib()->PopXErrorLevel(); m_bFocused = true; diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx index b7b5406..7fbcf8e 100644 --- a/vcl/unx/gtk/window/gtkobject.cxx +++ b/vcl/unx/gtk/window/gtkobject.cxx @@ -32,6 +32,7 @@ #include #include #include +#include GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow ) : m_pSocket( NULL ), @@ -58,7 +59,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow ) SalDisplay* pDisp = GetX11SalData()->GetDisplay(); m_aSystemData.nSize = sizeof( SystemChildData ); m_aSystemData.pDisplay = pDisp->GetDisplay(); - m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pSocket->window); + m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pSocket)); m_aSystemData.pSalFrame = NULL; m_aSystemData.pWidget = m_pSocket; m_aSystemData.pVisual = pDisp->GetVisual(pParent->getScreenNumber()).GetVisual(); @@ -66,7 +67,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow ) m_aSystemData.nDepth = pDisp->GetVisual(pParent->getScreenNumber()).GetDepth(); m_aSystemData.aColormap = pDisp->GetColormap(pParent->getScreenNumber()).GetXColormap(); m_aSystemData.pAppContext = NULL; - m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window); + m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(widget_get_window(GTK_WIDGET(pParent->getWindow()))); m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow()); g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this ); @@ -83,7 +84,13 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow ) GtkSalObject::~GtkSalObject() { if( m_pRegion ) + { +#if GTK_CHECK_VERSION(2,90,0) + cairo_region_destroy( m_pRegion ); +#else gdk_region_destroy( m_pRegion ); +#endif + } if( m_pSocket ) { // remove socket from parent frame's fixed container @@ -101,7 +108,7 @@ GtkSalObject::~GtkSalObject() void GtkSalObject::ResetClipRegion() { if( m_pSocket ) - gdk_window_shape_combine_region( m_pSocket->window, NULL, 0, 0 ); + gdk_window_shape_combine_region( widget_get_window(m_pSocket), NULL, 0, 0 ); } USHORT GtkSalObject::GetClipRegionType() @@ -111,9 +118,15 @@ USHORT GtkSalObject::GetClipRegionType() void GtkSalObject::BeginSetClipRegion( ULONG ) { +#if GTK_CHECK_VERSION(2,90,0) + if( m_pRegion ) + cairo_region_destroy( m_pRegion ); + m_pRegion = cairo_region_create(); +#else if( m_pRegion ) gdk_region_destroy( m_pRegion ); m_pRegion = gdk_region_new(); +#endif } void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) @@ -123,14 +136,18 @@ void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight aRect.y = nY; aRect.width = nWidth; aRect.height = nHeight; - + +#if GTK_CHECK_VERSION(2,90,0) + cairo_region_union_rectangle( m_pRegion, &aRect ); +#else gdk_region_union_with_rect( m_pRegion, &aRect ); +#endif } void GtkSalObject::EndSetClipRegion() { if( m_pSocket ) - gdk_window_shape_combine_region( m_pSocket->window, m_pRegion, 0, 0 ); + gdk_window_shape_combine_region( widget_get_window(m_pSocket), m_pRegion, 0, 0 ); } void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight ) @@ -201,10 +218,10 @@ gboolean GtkSalObject::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer return FALSE; } -void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object ) +void GtkSalObject::signalDestroy( GtkWidget* pObj, gpointer object ) { GtkSalObject* pThis = (GtkSalObject*)object; - if( GTK_WIDGET(pObj) == pThis->m_pSocket ) + if( pObj == pThis->m_pSocket ) { pThis->m_pSocket = NULL; } diff --git a/vcl/unx/gtk/window/makefile.mk b/vcl/unx/gtk/window/makefile.mk index ac23e93..4db83e2 100644 --- a/vcl/unx/gtk/window/makefile.mk +++ b/vcl/unx/gtk/window/makefile.mk @@ -28,7 +28,7 @@ PRJ=..$/..$/.. PRJNAME=vcl -TARGET=gtkwin +TARGET=gtk2win .INCLUDE : $(PRJ)$/util$/makefile.pmk # workaround for makedepend hang @@ -48,7 +48,7 @@ dummy: .ELSE # "$(GUIBASE)"!="unx" -.IF "$(ENABLE_GTK)" != "" +.IF "$(ENABLE_GTK2)" != "" PKGCONFIG_MODULES=gtk+-2.0 .IF "$(ENABLE_DBUS)" != "" @@ -65,10 +65,10 @@ SLOFILES=\ $(SLO)$/gtkframe.obj \ $(SLO)$/gtkobject.obj EXCEPTIONSFILES=$(SLO)$/gtkframe.obj -.ELSE # "$(ENABLE_GTK)" != "" +.ELSE # "$(ENABLE_GTK2)" != "" dummy: - @echo GTK disabled - nothing to build + @echo GTK2 disabled - nothing to build .ENDIF .ENDIF # "$(GUIBASE)"!="unx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkaction.cxx b/vcl/unx/gtk3/a11y/Gtk3atkaction.cxx new file mode 100644 index 0000000..71a92c8 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkaction.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkaction.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkbridge.cxx b/vcl/unx/gtk3/a11y/Gtk3atkbridge.cxx new file mode 100644 index 0000000..34d094f --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkbridge.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkbridge.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkcomponent.cxx b/vcl/unx/gtk3/a11y/Gtk3atkcomponent.cxx new file mode 100644 index 0000000..cd33fcf --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkcomponent.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkcomponent.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkeditabletext.cxx b/vcl/unx/gtk3/a11y/Gtk3atkeditabletext.cxx new file mode 100644 index 0000000..6ba2164 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkeditabletext.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkeditabletext.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkfactory.cxx b/vcl/unx/gtk3/a11y/Gtk3atkfactory.cxx new file mode 100644 index 0000000..3fd107f --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkfactory.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkfactory.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkhypertext.cxx b/vcl/unx/gtk3/a11y/Gtk3atkhypertext.cxx new file mode 100644 index 0000000..2945882 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkhypertext.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkhypertext.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkimage.cxx b/vcl/unx/gtk3/a11y/Gtk3atkimage.cxx new file mode 100644 index 0000000..e8404b1 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkimage.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkimage.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atklistener.cxx b/vcl/unx/gtk3/a11y/Gtk3atklistener.cxx new file mode 100644 index 0000000..a43aeab --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atklistener.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atklistener.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkregistry.cxx b/vcl/unx/gtk3/a11y/Gtk3atkregistry.cxx new file mode 100644 index 0000000..95c372a --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkregistry.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkregistry.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkselection.cxx b/vcl/unx/gtk3/a11y/Gtk3atkselection.cxx new file mode 100644 index 0000000..860e125 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkselection.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkselection.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atktable.cxx b/vcl/unx/gtk3/a11y/Gtk3atktable.cxx new file mode 100644 index 0000000..39dc5fc --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atktable.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atktable.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atktext.cxx b/vcl/unx/gtk3/a11y/Gtk3atktext.cxx new file mode 100644 index 0000000..3239c66 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atktext.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atktext.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atktextattributes.cxx b/vcl/unx/gtk3/a11y/Gtk3atktextattributes.cxx new file mode 100644 index 0000000..61eeb47 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atktextattributes.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atktextattributes.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkutil.cxx b/vcl/unx/gtk3/a11y/Gtk3atkutil.cxx new file mode 100644 index 0000000..44b41f6 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkutil.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkutil.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkvalue.cxx b/vcl/unx/gtk3/a11y/Gtk3atkvalue.cxx new file mode 100644 index 0000000..8398e0f --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkvalue.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkvalue.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkwindow.cxx b/vcl/unx/gtk3/a11y/Gtk3atkwindow.cxx new file mode 100644 index 0000000..3b11cf0 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkwindow.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkwindow.cxx" diff --git a/vcl/unx/gtk3/a11y/Gtk3atkwrapper.cxx b/vcl/unx/gtk3/a11y/Gtk3atkwrapper.cxx new file mode 100644 index 0000000..9a6c2e9 --- /dev/null +++ b/vcl/unx/gtk3/a11y/Gtk3atkwrapper.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/a11y/atkwrapper.cxx" diff --git a/vcl/unx/gtk3/a11y/makefile.mk b/vcl/unx/gtk3/a11y/makefile.mk new file mode 100644 index 0000000..3955217 --- /dev/null +++ b/vcl/unx/gtk3/a11y/makefile.mk @@ -0,0 +1,86 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=vcl +TARGET=gtk3a11y +ENABLE_EXCEPTIONS=TRUE + +# workaround for makedepend hang +MKDEPENDSOLVER= +NO_DEFAULT_STL=YES + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- + +.IF "$(GUIBASE)"!="unx" + +dummy: + @echo "Nothing to build for GUIBASE $(GUIBASE)" + +.ELSE # "$(GUIBASE)"!="unx" + +.IF "$(ENABLE_GTK3)" != "" + +PKGCONFIG_MODULES=gtk+-3.0 +.INCLUDE : pkg_config.mk + +CFLAGS+=-DVERSION=$(EMQ)"$(UPD)$(LAST_MINOR)$(EMQ)" -DHAS_ATKRECTANGLE + +SLOFILES=\ + $(SLO)$/Gtk3atkaction.obj \ + $(SLO)$/Gtk3atkbridge.obj \ + $(SLO)$/Gtk3atkcomponent.obj \ + $(SLO)$/Gtk3atkeditabletext.obj \ + $(SLO)$/Gtk3atkfactory.obj \ + $(SLO)$/Gtk3atkhypertext.obj \ + $(SLO)$/Gtk3atkimage.obj \ + $(SLO)$/Gtk3atklistener.obj \ + $(SLO)$/Gtk3atkregistry.obj \ + $(SLO)$/Gtk3atkselection.obj \ + $(SLO)$/Gtk3atktable.obj \ + $(SLO)$/Gtk3atktext.obj \ + $(SLO)$/Gtk3atktextattributes.obj \ + $(SLO)$/Gtk3atkutil.obj \ + $(SLO)$/Gtk3atkvalue.obj \ + $(SLO)$/Gtk3atkwindow.obj \ + $(SLO)$/Gtk3atkwrapper.obj + +.ELSE # "$(ENABLE_GTK3)" != "" + +dummy: + @echo GTK3 disabled - nothing to build +.ENDIF +.ENDIF # "$(GUIBASE)"!="unx" + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/vcl/unx/gtk3/app/Gtk3gtkdata.cxx b/vcl/unx/gtk3/app/Gtk3gtkdata.cxx new file mode 100644 index 0000000..a6d7a0e --- /dev/null +++ b/vcl/unx/gtk3/app/Gtk3gtkdata.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/app/gtkdata.cxx" diff --git a/vcl/unx/gtk3/app/Gtk3gtkinst.cxx b/vcl/unx/gtk3/app/Gtk3gtkinst.cxx new file mode 100644 index 0000000..ad2d59a --- /dev/null +++ b/vcl/unx/gtk3/app/Gtk3gtkinst.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/app/gtkinst.cxx" diff --git a/vcl/unx/gtk3/app/Gtk3gtksys.cxx b/vcl/unx/gtk3/app/Gtk3gtksys.cxx new file mode 100644 index 0000000..ee769b3 --- /dev/null +++ b/vcl/unx/gtk3/app/Gtk3gtksys.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/app/gtksys.cxx" diff --git a/vcl/unx/gtk3/app/makefile.mk b/vcl/unx/gtk3/app/makefile.mk new file mode 100644 index 0000000..3164b27 --- /dev/null +++ b/vcl/unx/gtk3/app/makefile.mk @@ -0,0 +1,76 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=vcl +TARGET=gtk3app +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +# workaround for makedepend hang +MKDEPENDSOLVER= + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/makefile2.pmk + +# --- Files -------------------------------------------------------- + +.IF "$(GUIBASE)"!="unx" + +dummy: + @echo "Nothing to build for GUIBASE $(GUIBASE)" + +.ELSE # "$(GUIBASE)"!="unx" + +.IF "$(ENABLE_GTK3)" != "" + +PKGCONFIG_MODULES=gtk+-3.0 +.INCLUDE : pkg_config.mk + +SLOFILES=\ + $(SLO)$/Gtk3gtkdata.obj \ + $(SLO)$/Gtk3gtkinst.obj \ + $(SLO)$/Gtk3gtksys.obj + +EXCEPTIONSFILES=\ + $(SLO)$/Gtk3gtkdata.obj\ + $(SLO)$/Gtk3gtkinst.obj + +.ELSE # "$(ENABLE_GTK3)" != "" + +dummy: + @echo GTK3 disabled - nothing to build +.ENDIF +.ENDIF # "$(GUIBASE)"!="unx" + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +.INCLUDE : $(PRJ)$/util$/target.pmk diff --git a/vcl/unx/gtk3/gdi/Gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/Gtk3salnativewidgets-gtk.cxx new file mode 100644 index 0000000..07dc4e5 --- /dev/null +++ b/vcl/unx/gtk3/gdi/Gtk3salnativewidgets-gtk.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/gdi/salnativewidgets-gtk.cxx" diff --git a/vcl/unx/gtk3/gdi/makefile.mk b/vcl/unx/gtk3/gdi/makefile.mk new file mode 100644 index 0000000..ff77ecc --- /dev/null +++ b/vcl/unx/gtk3/gdi/makefile.mk @@ -0,0 +1,69 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=vcl +TARGET=gtk3gdi +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/makefile2.pmk + +# --- Files -------------------------------------------------------- + +.IF "$(GUIBASE)"!="unx" + +dummy: + @echo "Nothing to build for GUIBASE $(GUIBASE)" + +.ELSE # "$(GUIBASE)"!="unx" + +.IF "$(ENABLE_GTK3)" != "" + +PKGCONFIG_MODULES=gtk+-3.0 cairo +.INCLUDE : pkg_config.mk + +CFLAGS+=-UGSEAL_ENABLE + +SLOFILES=$(SLO)$/Gtk3salnativewidgets-gtk.obj +EXCEPTIONSFILES=$(SLO)$/Gtk3salnativewidgets-gtk.obj + +.ELSE # "$(ENABLE_GTK3)" != "" +dummy: + @echo GTK3 disabled - nothing to build +.ENDIF + +.ENDIF # "$(GUIBASE)"!="unx" + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +.INCLUDE : $(PRJ)$/util$/target.pmk diff --git a/vcl/unx/gtk3/window/Gtk3gtkframe.cxx b/vcl/unx/gtk3/window/Gtk3gtkframe.cxx new file mode 100644 index 0000000..a1d950e --- /dev/null +++ b/vcl/unx/gtk3/window/Gtk3gtkframe.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/window/gtkframe.cxx" diff --git a/vcl/unx/gtk3/window/Gtk3gtkobject.cxx b/vcl/unx/gtk3/window/Gtk3gtkobject.cxx new file mode 100644 index 0000000..ab16280 --- /dev/null +++ b/vcl/unx/gtk3/window/Gtk3gtkobject.cxx @@ -0,0 +1,28 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../../gtk/window/gtkobject.cxx" diff --git a/vcl/unx/gtk3/window/makefile.mk b/vcl/unx/gtk3/window/makefile.mk new file mode 100644 index 0000000..c46352a --- /dev/null +++ b/vcl/unx/gtk3/window/makefile.mk @@ -0,0 +1,72 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=vcl +TARGET=gtk3win +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +# workaround for makedepend hang +MKDEPENDSOLVER= + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/makefile2.pmk + +# --- Files -------------------------------------------------------- + +.IF "$(GUIBASE)"!="unx" + +dummy: + @echo "Nothing to build for GUIBASE $(GUIBASE)" + +.ELSE # "$(GUIBASE)"!="unx" + +.IF "$(ENABLE_GTK3)" != "" + +PKGCONFIG_MODULES=gtk+-3.0, dbus-glib-1 +CDEFS+=-DENABLE_DBUS +.INCLUDE : pkg_config.mk + +SLOFILES=\ + $(SLO)$/Gtk3gtkframe.obj \ + $(SLO)$/Gtk3gtkobject.obj +EXCEPTIONSFILES=$(SLO)$/Gtk3gtkframe.obj +.ELSE # "$(ENABLE_GTK3)" != "" + +dummy: + @echo GTK3 disabled - nothing to build +.ENDIF +.ENDIF # "$(GUIBASE)"!="unx" + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +.INCLUDE : $(PRJ)$/util$/target.pmk diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx index 118b7da..d3fa891 100644 --- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx @@ -40,6 +40,39 @@ #include +inline GdkWindow * widget_get_window(GtkWidget *widget) +{ +#if GTK_CHECK_VERSION(2,90,0) + return gtk_widget_get_window(widget); +#else + return widget->window; +#endif +} + +inline void widget_set_can_focus(GtkWidget *widget, gboolean can_focus) +{ +#if GTK_CHECK_VERSION(2,90,0) + return gtk_widget_set_can_focus(widget, can_focus); +#else + if (can_focus) + GTK_WIDGET_SET_FLAGS( widget, GTK_CAN_FOCUS ); + else + GTK_WIDGET_UNSET_FLAGS( widget, GTK_CAN_FOCUS ); +#endif +} + +inline void widget_set_can_default(GtkWidget *widget, gboolean can_default) +{ +#if GTK_CHECK_VERSION(2,90,0) + return gtk_widget_set_can_default(widget, can_default); +#else + if (can_default) + GTK_WIDGET_SET_FLAGS( widget, GTK_CAN_DEFAULT ); + else + GTK_WIDGET_UNSET_FLAGS( widget, GTK_CAN_DEFAULT ); +#endif +} + class GtkData : public X11SalData { public: diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index 1ee03c9..87e7b9a 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -196,8 +196,12 @@ class GtkSalFrame : public SalFrame Size m_aMaxSize; Size m_aMinSize; Rectangle m_aRestorePosSize; - + +#if GTK_CHECK_VERSION(2,90,0) + cairo_region_t* m_pRegion; +#else GdkRegion* m_pRegion; +#endif void Init( SalFrame* pParent, ULONG nStyle ); void Init( SystemParentData* pSysData ); @@ -218,7 +222,7 @@ class GtkSalFrame : public SalFrame static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer ); static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer ); static gboolean signalVisibility( GtkWidget*, GdkEventVisibility*, gpointer ); - static void signalDestroy( GtkObject*, gpointer ); + static void signalDestroy( GtkWidget*, gpointer ); void Center(); void SetDefaultSize(); diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx index 0dc2b8b..5ab1af8 100644 --- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx @@ -49,7 +49,7 @@ public: virtual ~GtkSalGraphics(); inline GtkWidget* GetGtkWidget() const { return m_pWindow; } - inline GdkWindow* GetGdkWindow() const { return m_pWindow->window; } + inline GdkWindow* GetGdkWindow() const { return widget_get_window(m_pWindow); } inline GtkSalFrame* GetGtkFrame() const { return static_cast(m_pFrame); } void SetWindow( GtkWidget* window ) { m_pWindow = window; } @@ -127,7 +127,7 @@ protected: const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + BOOL NWPaintGTKComboBoxEntry( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, @@ -137,11 +137,13 @@ protected: const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - BOOL NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, - const Rectangle& rControlRectangle, - const clipList& rClipList, - ControlState nState, const ImplControlValue& aValue, - const OUString& rCaption ); + BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, + ControlType nType, ControlPart nPart, + const Rectangle& rControlRectangle, + const clipList& rClipList, + ControlState nState, + const ImplControlValue& aValue, + const OUString& rCaption ); BOOL NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx index f5b70a5..6372e2e 100644 --- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx @@ -37,12 +37,16 @@ class GtkSalObject : public SalObject { SystemChildData m_aSystemData; GtkWidget* m_pSocket; +#if GTK_CHECK_VERSION(2,90,0) + cairo_region_t* m_pRegion; +#else GdkRegion* m_pRegion; +#endif // signals static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer ); static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer ); - static void signalDestroy( GtkObject*, gpointer ); + static void signalDestroy( GtkWidget*, gpointer ); public: GtkSalObject( GtkSalFrame* pParent, BOOL bShow = TRUE ); virtual ~GtkSalObject(); diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx index a93b2fa..cb62d45 100644 --- a/vcl/unx/source/plugadapt/salplug.cxx +++ b/vcl/unx/source/plugadapt/salplug.cxx @@ -94,7 +94,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase ) * So make sure libgtk+ & co are still mapped into memory when * atk-bridge's atexit handler gets called. */ - if( rModuleBase.equalsAscii("gtk") ) + if( rModuleBase.equalsAscii("gtk") || rModuleBase.equalsAscii("gtk3") ) { pCloseModule = NULL; } @@ -161,12 +161,12 @@ static SalInstance* autodetect_plugin() { static const char* pKDEFallbackList[] = { - "kde4", "kde", "gtk", "gen", 0 + "kde4", "kde", "gtk3", "gtk", "gen", 0 }; static const char* pStandardFallbackList[] = { - "gtk", "gen", 0 + "gtk3", "gtk", "gen", 0 }; static const char* pHeadlessFallbackList[] = @@ -234,7 +234,7 @@ SalInstance *CreateSalInstance() pInst = autodetect_plugin(); // fallback, try everything - const char* pPlugin[] = { "gtk", "kde", "gen", 0 }; + const char* pPlugin[] = { "gtk3", "gtk", "kde", "gen", 0 }; for ( int i = 0; !pInst && pPlugin[ i ]; ++i ) pInst = tryInstance( OUString::createFromAscii( pPlugin[ i ] ) ); diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index eb54531..e0c3f22 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -347,27 +347,31 @@ SHL2STDLIBS+= $(XRANDR_LIBS) .ENDIF # "$(GUIBASE)"=="unx" -# gtk plugin -.IF "$(ENABLE_GTK)" != "" -PKGCONFIG_MODULES=gtk+-2.0 gthread-2.0 +.IF "$(ENABLE_GTK3)" != "" || "$(ENABLE_GTK2)" != "" +.INCLUDE: pkg_config.mk +.ENDIF + +# gtk2 plugin +.IF "$(ENABLE_GTK2)" != "" +GTK2_PKGCONFIG_MODULES=gtk+-2.0 gthread-2.0 .IF "$(ENABLE_DBUS)" != "" -PKGCONFIG_MODULES+= dbus-glib-1 +GTK2_PKGCONFIG_MODULES+=dbus-glib-1 .ENDIF -.INCLUDE: pkg_config.mk +GTK2_PKGCONFIG_LIBS:=$(shell @$(PKG_CONFIG) $(PKGCONFIG_PREFIX) --libs $(GTK2_PKGCONFIG_MODULES)) -LIB4TARGET=$(SLB)$/igtk_plug_ +LIB4TARGET=$(SLB)$/igtk2_plug_ LIB4FILES=\ - $(SLB)$/gtkapp.lib\ - $(SLB)$/gtka11y.lib \ - $(SLB)$/gtkgdi.lib\ - $(SLB)$/gtkwin.lib + $(SLB)$/gtk2app.lib\ + $(SLB)$/gtk2a11y.lib \ + $(SLB)$/gtk2gdi.lib\ + $(SLB)$/gtk2win.lib SHL4TARGET=vclplug_gtk$(DLLPOSTFIX) -SHL4IMPLIB=igtk_plug_ +SHL4IMPLIB=igtk2_plug_ SHL4LIBS=$(LIB4TARGET) SHL4DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2IMPLIBN) $(SHL2TARGETN) -# libs for gtk plugin -SHL4STDLIBS+=$(PKGCONFIG_LIBS:s/ -lpangoxft-1.0//) +# libs for gtk2 plugin +SHL4STDLIBS+=$(GTK2_PKGCONFIG_LIBS:s/ -lpangoxft-1.0//) # hack for faked SO environment .IF "$(PKGCONFIG_ROOT)"!="" SHL4SONAME+=-z nodefs @@ -391,7 +395,7 @@ SHL4STDLIBS+= $(XRANDR_LIBS) .ENDIF .ENDIF -.ENDIF # "$(ENABLE_GTK)" != "" +.ENDIF # "$(ENABLE_GTK2)" != "" # KDE plugin .IF "$(ENABLE_KDE)" != "" @@ -452,6 +456,48 @@ SHL6STDLIBS+= $(XRANDR_LIBS) .ENDIF # "$(ENABLE_KDE4)" != "" +# gtk3 plugin +.IF "$(ENABLE_GTK3)" != "" +GTK3_PKGCONFIG_MODULES=gtk+-3.0 gthread-2.0 dbus-glib-1 +GTK3_PKGCONFIG_LIBS:=$(shell @$(PKG_CONFIG) $(PKGCONFIG_PREFIX) --libs $(GTK3_PKGCONFIG_MODULES)) + +LIB8TARGET=$(SLB)$/igtk3_plug_ +LIB8FILES=\ + $(SLB)$/gtk3app.lib\ + $(SLB)$/gtk3a11y.lib \ + $(SLB)$/gtk3gdi.lib\ + $(SLB)$/gtk3win.lib + +SHL8TARGET=vclplug_gtk3$(DLLPOSTFIX) +SHL8IMPLIB=igtk3_plug_ +SHL8LIBS=$(LIB8TARGET) +SHL8DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2IMPLIBN) $(SHL2TARGETN) +# libs for gtk3 plugin +SHL8STDLIBS+=$(GTK3_PKGCONFIG_LIBS:s/ -lpangoxft-1.0//) +# hack for faked SO environment +.IF "$(PKGCONFIG_ROOT)"!="" +SHL8SONAME+=-z nodefs +SHL8NOCHECK=TRUE +.ENDIF # "$(PKGCONFIG_ROOT)"!="" + +SHL8STDLIBS+=-l$(SHL2TARGET) +SHL8STDLIBS+=\ + $(VCLLIB) \ + $(TOOLSLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(VOSLIB) \ + $(SALLIB) \ + $(X11LINK_DYNAMIC) + +.IF "$(ENABLE_RANDR)" != "" +.IF "$(XRANDR_DLOPEN)" == "FALSE" +SHL8STDLIBS+= $(XRANDR_LIBS) +.ENDIF +.ENDIF + +.ENDIF # "$(ENABLE_GTK3)" != "" + .ENDIF # UNX # --- Allgemein ---------------------------------------------------------- -- 1.7.3