@ -18,7 +18,7 @@
# define DETAIL(xx) ((detail) && (!strcmp(xx, detail)))
# define DETAIL(xx) ((detail) && (!strcmp(xx, detail)))
# define DETAILHAS(xx) ((detail) && (strstr(detail, xx)))
# define DETAILHAS(xx) ((detail) && (strstr(detail, xx)))
# define PARENT(xx) (( parent) && (!strcmp(xx, gtk_widget_get_name(parent))))
# define PARENT(xx) (( tq parent) && (!strcmp(xx, gtk_widget_get_name(tq parent))))
# ifndef max
# ifndef max
# define max(x,y) ((x)>=(y)?(x):(y))
# define max(x,y) ((x)>=(y)?(x):(y))
# endif
# endif
@ -26,17 +26,17 @@
# define min(x,y) ((x)<=(y)?(x):(y))
# define min(x,y) ((x)<=(y)?(x):(y))
# endif
# endif
static void qtengine_style_init ( QtEngineStyle * style ) ;
static void qtengine_style_init ( T QtEngineStyle * style ) ;
static void qtengine_style_class_init ( QtEngineStyleClass * klass ) ;
static void qtengine_style_class_init ( T QtEngineStyleClass * klass ) ;
static GtkNotebook * notebook = NULL ;
static GtkNotebook * notebook = NULL ;
static int nb_num_pages = 0 ;
static int nb_num_pages = 0 ;
static GtkStyleClass * parent_class = NULL ;
static GtkStyleClass * tq parent_class = NULL ;
static PangoLayout *
static PangoLayout *
get_insensitive_layout ( GdkDrawable * drawable ,
get_insensitive_layout ( GdkDrawable * drawable ,
PangoLayout * layout) ;
PangoLayout * tq layout) ;
static GtkShadowType
static GtkShadowType
@ -81,7 +81,7 @@ draw_hline(GtkStyle* style,
gint x2 ,
gint x2 ,
gint y )
gint y )
{
{
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " HLINE (%d,%d,%d) Widget: %s Detail: %s \n " , x1 , y1 , y , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " HLINE (%d,%d,%d) Widget: %s Detail: %s \n " , x1 , y1 , y , gtk_widget_get_name ( widget ) , detail ) ;
if ( DETAIL ( " vscale " ) )
if ( DETAIL ( " vscale " ) )
@ -102,7 +102,7 @@ draw_vline(GtkStyle* style,
gint yDest ,
gint yDest ,
gint x )
gint x )
{
{
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " VLINE (%d,%d,%d) Widget: %s Detail: %s \n " , ySource , yDest , x , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " VLINE (%d,%d,%d) Widget: %s Detail: %s \n " , ySource , yDest , x , gtk_widget_get_name ( widget ) , detail ) ;
@ -135,7 +135,7 @@ draw_shadow(GtkStyle *style,
sanitize_size ( window , & width , & height ) ;
sanitize_size ( window , & width , & height ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Shadow (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Shadow (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
@ -159,9 +159,9 @@ draw_shadow(GtkStyle *style,
}
}
/* The remainder of this function was borrowed from the "Metal" theme/
/* The remainder of this function was borrowed from the "Metal" theme/
I don ' t really want to use Qt to draw these frames as there are too
I don ' t really want to use T Qt to draw these frames as there are too
many of them ( it would slow down the theme engine even more ) .
many of them ( it would slow down the theme engine even more ) .
TODO : Make them use the Qt color palette */
TODO : Make them use the T Qt color palette */
switch ( shadow_type )
switch ( shadow_type )
{
{
@ -459,7 +459,7 @@ draw_arrow(GtkStyle* style,
{
{
sanitize_size ( window , & width , & height ) ;
sanitize_size ( window , & width , & height ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Arrow (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Arrow (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
if ( DETAIL ( " hscrollbar " ) | | DETAIL ( " vscrollbar " ) )
if ( DETAIL ( " hscrollbar " ) | | DETAIL ( " vscrollbar " ) )
@ -474,7 +474,7 @@ draw_arrow(GtkStyle* style,
if ( DETAIL ( " arrow " ) )
if ( DETAIL ( " arrow " ) )
{
{
GdkPixbuf * gpix ;
GdkPixbuf * gpix ;
GtkWidget * parent;
GtkWidget * tq parent;
if ( gdk_window_is_viewable ( gtk_widget_get_parent_window ( widget ) ) )
if ( gdk_window_is_viewable ( gtk_widget_get_parent_window ( widget ) ) )
{
{
gpix = gdk_pixbuf_get_from_drawable ( NULL , gtk_widget_get_parent_window ( widget ) , NULL , x , y , 0 , 0 , width , height ) ;
gpix = gdk_pixbuf_get_from_drawable ( NULL , gtk_widget_get_parent_window ( widget ) , NULL , x , y , 0 , 0 , width , height ) ;
@ -482,8 +482,8 @@ draw_arrow(GtkStyle* style,
g_object_unref ( gpix ) ;
g_object_unref ( gpix ) ;
}
}
parent = gtk_widget_get_parent ( widget ) ;
tq parent = gtk_widget_get_parent ( widget ) ;
drawArrow ( window , style , GTK_WIDGET_STATE ( parent) , arrow_type , x , y , width , height ) ;
drawArrow ( window , style , GTK_WIDGET_STATE ( tq parent) , arrow_type , x , y , width , height ) ;
return ;
return ;
}
}
/* if (DETAIL("menuitem"))
/* if (DETAIL("menuitem"))
@ -531,7 +531,7 @@ draw_arrow(GtkStyle* style,
ay = y ;
ay = y ;
aw = width ;
aw = width ;
ah = height ;
ah = height ;
calculate_arrow_ geometry ( arrow_type , & ax , & ay , & aw , & ah ) ;
calculate_arrow_ tq geometry ( arrow_type , & ax , & ay , & aw , & ah ) ;
half_width = width / 2 ;
half_width = width / 2 ;
half_height = height / 2 ;
half_height = height / 2 ;
@ -615,7 +615,7 @@ draw_box(GtkStyle * style,
int nbpages ;
int nbpages ;
sanitize_size ( window , & width , & height ) ;
sanitize_size ( window , & width , & height ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Box (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Box (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
if ( GTK_IS_SCROLLBAR ( widget ) )
if ( GTK_IS_SCROLLBAR ( widget ) )
@ -641,7 +641,7 @@ draw_box(GtkStyle * style,
if ( DETAIL ( " menubar " ) )
if ( DETAIL ( " menubar " ) )
{
{
if ( openOfficeFix = = 1 )
if ( openOfficeFix = = 1 )
parent_class- > draw_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
tq parent_class- > draw_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
else
else
drawMenubar ( window , style , state_type , x , y , width , height ) ;
drawMenubar ( window , style , state_type , x , y , width , height ) ;
return ;
return ;
@ -649,7 +649,7 @@ draw_box(GtkStyle * style,
if ( DETAIL ( " menu " ) )
if ( DETAIL ( " menu " ) )
{
{
if ( openOfficeFix = = 1 )
if ( openOfficeFix = = 1 )
parent_class- > draw_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
tq parent_class- > draw_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
else
else
{
{
if ( ( x > = 0 ) & & ( y > = 0 ) ) /* Work around weirdness in firefox */
if ( ( x > = 0 ) & & ( y > = 0 ) ) /* Work around weirdness in firefox */
@ -700,11 +700,11 @@ draw_box(GtkStyle * style,
}
}
if ( DETAIL ( " button " ) )
if ( DETAIL ( " button " ) )
{
{
GtkWidget * parent;
GtkWidget * tq parent;
int toolbutton = 0 ;
int toolbutton = 0 ;
parent = gtk_widget_get_parent ( widget ) ;
tq parent = gtk_widget_get_parent ( widget ) ;
if ( parent & & ( GTK_IS_CLIST ( parent) | | GTK_IS_LIST ( parent) | | GTK_IS_TREE_VIEW ( parent) ) )
if ( tq parent & & ( GTK_IS_CLIST ( tq parent) | | GTK_IS_LIST ( tq parent) | | GTK_IS_TREE_VIEW ( tq parent) ) )
{
{
drawListHeader ( window , style , state_type , x , y , width , height ) ;
drawListHeader ( window , style , state_type , x , y , width , height ) ;
return ;
return ;
@ -714,12 +714,12 @@ draw_box(GtkStyle * style,
* toolbar in gtk */
* toolbar in gtk */
while ( 1 )
while ( 1 )
{
{
if ( GTK_IS_WIDGET ( parent) )
if ( GTK_IS_WIDGET ( tq parent) )
{
{
# ifdef HAVE_BONOBO
# ifdef HAVE_BONOBO
if ( GTK_IS_TOOLBAR ( parent) | | BONOBO_IS_UI_TOOLBAR ( parent) )
if ( GTK_IS_TOOLBAR ( tq parent) | | BONOBO_IS_UI_TOOLBAR ( tq parent) )
# else
# else
if ( GTK_IS_TOOLBAR ( parent) )
if ( GTK_IS_TOOLBAR ( tq parent) )
# endif
# endif
{
{
toolbutton = 1 ;
toolbutton = 1 ;
@ -728,10 +728,10 @@ draw_box(GtkStyle * style,
}
}
else
else
break ;
break ;
parent = gtk_widget_get_parent ( parent) ;
tq parent = gtk_widget_get_parent ( tq parent) ;
}
}
parent = gtk_widget_get_parent ( widget ) ;
tq parent = gtk_widget_get_parent ( widget ) ;
if ( toolbutton )
if ( toolbutton )
drawToolButton ( window , style , state_type , x , y , width , height ) ;
drawToolButton ( window , style , state_type , x , y , width , height ) ;
@ -744,9 +744,9 @@ draw_box(GtkStyle * style,
int defaultButton = GTK_WIDGET_HAS_FOCUS ( widget ) ;
int defaultButton = GTK_WIDGET_HAS_FOCUS ( widget ) ;
GtkWindow * toplevel ;
GtkWindow * toplevel ;
if ( isBaghira & & GTK_IS_BOX ( parent) & & ( g_list_length ( GTK_BOX ( parent) - > children ) = = 2 ) )
if ( isBaghira & & GTK_IS_BOX ( tq parent) & & ( g_list_length ( GTK_BOX ( tq parent) - > children ) = = 2 ) )
{
{
child1 = g_list_first ( ( GTK_BOX ( parent) - > children ) ) ;
child1 = g_list_first ( ( GTK_BOX ( tq parent) - > children ) ) ;
child = ( ( GtkBoxChild * ) child1 - > data ) - > widget ;
child = ( ( GtkBoxChild * ) child1 - > data ) - > widget ;
if ( GTK_IS_ENTRY ( child ) )
if ( GTK_IS_ENTRY ( child ) )
{
{
@ -754,7 +754,7 @@ draw_box(GtkStyle * style,
return ;
return ;
}
}
child1 = g_list_last ( ( GTK_BOX ( parent) - > children ) ) ;
child1 = g_list_last ( ( GTK_BOX ( tq parent) - > children ) ) ;
child = ( ( GtkBoxChild * ) child1 - > data ) - > widget ;
child = ( ( GtkBoxChild * ) child1 - > data ) - > widget ;
if ( GTK_IS_ENTRY ( child ) )
if ( GTK_IS_ENTRY ( child ) )
{
{
@ -781,9 +781,9 @@ draw_box(GtkStyle * style,
/* THIS IS WHAT WORKS NOW --
/* THIS IS WHAT WORKS NOW --
Tabs and tabbarbase will be drawn properly according to the QT style
Tabs and tabbarbase will be drawn properly according to the QT style
But the tabs won ' t be aligned according to QT . GTK + does not have
But the tabs won ' t be aligned according to QT . GTK + does not have
an option for alignment of tabs . So if were to do this not only do we have to
an option for tq alignment of tabs . So if were to do this not only do we have to
calculate the x , y position of the tab ourselves , which is difficult in Qt unless
calculate the x , y position of the tab ourselves , which is difficult in T Qt unless
we are displaying the tab ( can be done by subclassing QTabBar/ QTabWidget)
we are displaying the tab ( can be done by subclassing T QTabBar/ T QTabWidget)
but also have to position the tab bar label ourselves in gtk .
but also have to position the tab bar label ourselves in gtk .
*/
*/
@ -811,7 +811,7 @@ draw_box(GtkStyle * style,
if ( DETAIL ( " toolbar " ) )
if ( DETAIL ( " toolbar " ) )
{
{
if ( openOfficeFix = = 1 )
if ( openOfficeFix = = 1 )
parent_class- > draw_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
tq parent_class- > draw_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
else
else
drawToolbar ( window , style , state_type , x , y , width , height ) ;
drawToolbar ( window , style , state_type , x , y , width , height ) ;
return ;
return ;
@ -852,24 +852,24 @@ draw_flat_box(GtkStyle * style,
{
{
sanitize_size ( window , & width , & height ) ;
sanitize_size ( window , & width , & height ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Flat Box (%d,%d,%d,%d) Widget: %s Detail: %s %d %d \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail , state_type , GTK_STATE_SELECTED ) ;
printf ( " Flat Box (%d,%d,%d,%d) Widget: %s Detail: %s %d %d \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail , state_type , GTK_STATE_SELECTED ) ;
if ( DETAIL ( " tooltip " ) )
if ( DETAIL ( " tooltip " ) )
{
{
GdkColor tooltipColor ;
GdkColor tooltipColor ;
GdkGCValues gc_values ;
GdkGCValues gc_values ;
GdkGCValuesMask gc_values_ mask;
GdkGCValuesMask gc_values_ tq mask;
GdkGC * tooltipGc ;
GdkGC * tooltipGc ;
tooltipColor . red = 255 * 257 ;
tooltipColor . red = 255 * 257 ;
tooltipColor . green = 255 * 257 ;
tooltipColor . green = 255 * 257 ;
tooltipColor . blue = 220 * 257 ;
tooltipColor . blue = 220 * 257 ;
gdk_colormap_alloc_color ( style - > colormap , & tooltipColor , FALSE , TRUE ) ;
gdk_colormap_alloc_color ( style - > colormap , & tooltipColor , FALSE , TRUE ) ;
gc_values_ mask = GDK_GC_FOREGROUND ;
gc_values_ tq mask = GDK_GC_FOREGROUND ;
gc_values . foreground = tooltipColor ;
gc_values . foreground = tooltipColor ;
tooltipGc = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
tooltipGc = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gdk_draw_rectangle ( window , tooltipGc , TRUE , x , y , width , height ) ;
gdk_draw_rectangle ( window , tooltipGc , TRUE , x , y , width , height ) ;
gdk_draw_rectangle ( window , style - > black_gc , FALSE , x , y , width - 1 , height - 1 ) ;
gdk_draw_rectangle ( window , style - > black_gc , FALSE , x , y , width - 1 , height - 1 ) ;
@ -908,7 +908,7 @@ draw_check(GtkStyle * style,
gint width ,
gint width ,
gint height )
gint height )
{
{
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Check (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Check (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
if ( GTK_IS_MENU_ITEM ( widget ) )
if ( GTK_IS_MENU_ITEM ( widget ) )
@ -945,7 +945,7 @@ draw_option(GtkStyle * style,
gint width ,
gint width ,
gint height )
gint height )
{
{
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Option (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Option (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
if ( gdk_window_is_viewable ( gtk_widget_get_parent_window ( widget ) ) )
if ( gdk_window_is_viewable ( gtk_widget_get_parent_window ( widget ) ) )
@ -979,7 +979,7 @@ draw_tab(GtkStyle * style,
gint width ,
gint width ,
gint height )
gint height )
{
{
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Tab (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Tab (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
gtk_paint_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
gtk_paint_box ( style , window , state_type , shadow_type , area , widget , detail , x , y , width , height ) ;
@ -1011,7 +1011,7 @@ draw_shadow_gap(GtkStyle * style,
sanitize_size ( window , & width , & height ) ;
sanitize_size ( window , & width , & height ) ;
shadow_type = get_shadow_type ( style , detail , shadow_type ) ;
shadow_type = get_shadow_type ( style , detail , shadow_type ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Shadow_Gap (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Shadow_Gap (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
switch ( shadow_type ) {
switch ( shadow_type ) {
@ -1154,7 +1154,7 @@ draw_box_gap(GtkStyle* style,
if ( width < 0 | | height < 0 ) return ; /* Eclipse really can be this stupid! */
if ( width < 0 | | height < 0 ) return ; /* Eclipse really can be this stupid! */
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Box_gap (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Box_gap (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
if ( DETAIL ( " notebook " ) )
if ( DETAIL ( " notebook " ) )
@ -1181,7 +1181,7 @@ draw_extension(GtkStyle * style,
sanitize_size ( window , & width , & height ) ;
sanitize_size ( window , & width , & height ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Extension (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Extension (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
gtk_paint_box ( style , window , state_type , shadow_type , area , widget , detail ,
gtk_paint_box ( style , window , state_type , shadow_type , area , widget , detail ,
@ -1201,14 +1201,14 @@ draw_focus (GtkStyle *style,
gint width ,
gint width ,
gint height )
gint height )
{
{
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Focus Rect (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Focus Rect (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
GtkWidget * parent = gtk_widget_get_parent ( widget ) ;
GtkWidget * tq parent = gtk_widget_get_parent ( widget ) ;
if ( GTK_IS_CHECK_BUTTON ( widget ) | |
if ( GTK_IS_CHECK_BUTTON ( widget ) | |
GTK_IS_RADIO_BUTTON ( widget ) | |
GTK_IS_RADIO_BUTTON ( widget ) | |
( parent & & ( GTK_IS_CLIST ( parent) | | GTK_IS_LIST ( parent) | | GTK_IS_TREE_VIEW ( parent) ) ) )
( tq parent & & ( GTK_IS_CLIST ( tq parent) | | GTK_IS_LIST ( tq parent) | | GTK_IS_TREE_VIEW ( tq parent) ) ) )
{
{
drawFocusRect ( window , style , x , y , width , height ) ;
drawFocusRect ( window , style , x , y , width , height ) ;
}
}
@ -1229,7 +1229,7 @@ draw_slider(GtkStyle * style,
gint height ,
gint height ,
GtkOrientation orientation )
GtkOrientation orientation )
{
{
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Slider (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
printf ( " Slider (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail ) ;
if ( DETAIL ( " slider " ) )
if ( DETAIL ( " slider " ) )
@ -1237,11 +1237,11 @@ draw_slider(GtkStyle * style,
GtkAdjustment * adj = gtk_range_get_adjustment ( GTK_RANGE ( widget ) ) ;
GtkAdjustment * adj = gtk_range_get_adjustment ( GTK_RANGE ( widget ) ) ;
int widgetX , widgetY ;
int widgetX , widgetY ;
GtkWidget * parent = widget ;
GtkWidget * tq parent = widget ;
while ( gtk_widget_get_parent ( parent) ! = NULL )
while ( gtk_widget_get_parent ( tq parent) ! = NULL )
parent = gtk_widget_get_parent ( parent) ;
tq parent = gtk_widget_get_parent ( tq parent) ;
gtk_widget_translate_coordinates ( widget , parent, 0 , 0 , & widgetX , & widgetY ) ;
gtk_widget_translate_coordinates ( widget , tq parent, 0 , 0 , & widgetX , & widgetY ) ;
if ( orientation = = GTK_ORIENTATION_VERTICAL )
if ( orientation = = GTK_ORIENTATION_VERTICAL )
drawScrollBarSlider ( window , style , state_type , orientation , adj , x - 1 , y , width + 2 , height , y - widgetY , widget - > allocation . height ) ;
drawScrollBarSlider ( window , style , state_type , orientation , adj , x - 1 , y , width + 2 , height , y - widgetY , widget - > allocation . height ) ;
@ -1270,7 +1270,7 @@ draw_handle(GtkStyle * style,
sanitize_size ( window , & width , & height ) ;
sanitize_size ( window , & width , & height ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Handle (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail , state_type ) ;
printf ( " Handle (%d,%d,%d,%d) Widget: %s Detail: %s \n " , x , y , width , height , gtk_widget_get_name ( widget ) , detail , state_type ) ;
drawSplitter ( window , style , state_type , orientation , x , y , width , height ) ;
drawSplitter ( window , style , state_type , orientation , x , y , width , height ) ;
@ -1287,33 +1287,33 @@ void draw_layout (GtkStyle *style,
const gchar * detail ,
const gchar * detail ,
gint x ,
gint x ,
gint y ,
gint y ,
PangoLayout * layout)
PangoLayout * tq layout)
{
{
GdkColor color ;
GdkColor color ;
GdkGC * gc ;
GdkGC * gc ;
getTextColor ( & color , state_type ) ;
getTextColor ( & color , state_type ) ;
if ( gtk QtDebug)
if ( gtk T QtDebug)
printf ( " Layout (%d,%d) Widget: %s Detail: %s %d \n " , x , y , gtk_widget_get_name ( widget ) , detail , state_type ) ;
printf ( " Layout (%d,%d) Widget: %s Detail: %s %d \n " , x , y , gtk_widget_get_name ( widget ) , detail , state_type ) ;
if ( DETAIL ( " accellabel " ) | | DETAIL ( " label " ) | | DETAIL ( " cellrenderertext " ) )
if ( DETAIL ( " accellabel " ) | | DETAIL ( " label " ) | | DETAIL ( " cellrenderertext " ) )
{
{
GtkWidget * parent = gtk_widget_get_parent ( widget ) ;
GtkWidget * tq parent = gtk_widget_get_parent ( widget ) ;
GtkWidget * parent1 = gtk_widget_get_parent ( parent) ;
GtkWidget * tq parent1 = gtk_widget_get_parent ( tq parent) ;
/* printf(" parent's names are %s->%s->%s\n", gtk_widget_get_name(widget), gtk_widget_get_name(parent), gtk_widget_get_name(parent1)); */
/* printf(" tq parent's names are %s->%s->%s\n", gtk_widget_get_name(widget), gtk_widget_get_name(tq parent), gtk_widget_get_name(tq parent1)); */
/* In baghira -- even highlight the menu bar items */
/* In baghira -- even highlight the menu bar items */
if ( ( GTK_IS_MENU_ITEM ( parent) & & ( ! GTK_IS_MENU_BAR ( parent1) | | isBaghira | | isPolyester ) ) | | GTK_IS_TREE_VIEW ( widget ) )
if ( ( GTK_IS_MENU_ITEM ( tq parent) & & ( ! GTK_IS_MENU_BAR ( tq parent1) | | isBaghira | | isPolyester ) ) | | GTK_IS_TREE_VIEW ( widget ) )
{
{
PangoAttrList * layoutattr;
PangoAttrList * tq layoutattr;
const gchar * text ;
const gchar * text ;
gint text_length = 0 ;
gint text_length = 0 ;
gint text_bytelen = 0 ;
gint text_bytelen = 0 ;
text = pango_layout_get_text ( layout) ;
text = pango_layout_get_text ( tq layout) ;
if ( text ! = 0 )
if ( text ! = 0 )
{
{
PangoAttribute * textcolorattr ;
PangoAttribute * textcolorattr ;
@ -1324,19 +1324,19 @@ void draw_layout (GtkStyle *style,
textcolorattr - > start_index = 0 ;
textcolorattr - > start_index = 0 ;
textcolorattr - > end_index = text_bytelen ;
textcolorattr - > end_index = text_bytelen ;
layoutattr = pango_layout_get_attributes ( layout) ;
tq layoutattr = pango_layout_get_attributes ( tq layout) ;
if ( layoutattr = = NULL )
if ( tq layoutattr = = NULL )
{
{
layoutattr = pango_attr_list_new ( ) ;
tq layoutattr = pango_attr_list_new ( ) ;
pango_attr_list_insert ( layoutattr, pango_attribute_copy ( textcolorattr ) ) ;
pango_attr_list_insert ( tq layoutattr, pango_attribute_copy ( textcolorattr ) ) ;
pango_layout_set_attributes ( layout, layoutattr) ;
pango_layout_set_attributes ( tq layout, tq layoutattr) ;
pango_attr_list_unref ( layoutattr) ;
pango_attr_list_unref ( tq layoutattr) ;
}
}
else
else
{
{
pango_attr_list_change ( layoutattr, pango_attribute_copy ( textcolorattr ) ) ;
pango_attr_list_change ( tq layoutattr, pango_attribute_copy ( textcolorattr ) ) ;
pango_layout_set_attributes ( layout, layoutattr) ;
pango_layout_set_attributes ( tq layout, tq layoutattr) ;
}
}
pango_attribute_destroy ( textcolorattr ) ;
pango_attribute_destroy ( textcolorattr ) ;
}
}
@ -1355,13 +1355,13 @@ void draw_layout (GtkStyle *style,
if ( state_type = = GTK_STATE_INSENSITIVE )
if ( state_type = = GTK_STATE_INSENSITIVE )
{
{
PangoLayout * ins ;
PangoLayout * ins ;
ins = get_insensitive_layout ( window , layout) ;
ins = get_insensitive_layout ( window , tq layout) ;
gdk_draw_layout ( window , gc , x , y , ins ) ;
gdk_draw_layout ( window , gc , x , y , ins ) ;
g_object_unref ( ins ) ;
g_object_unref ( ins ) ;
}
}
else
else
{
{
gdk_draw_layout ( window , gc , x , y , layout) ;
gdk_draw_layout ( window , gc , x , y , tq layout) ;
}
}
if ( area )
if ( area )
@ -1390,7 +1390,7 @@ range_new (guint start,
static PangoLayout *
static PangoLayout *
get_insensitive_layout ( GdkDrawable * drawable ,
get_insensitive_layout ( GdkDrawable * drawable ,
PangoLayout * layout)
PangoLayout * tq layout)
{
{
GSList * embossed_ranges = NULL ;
GSList * embossed_ranges = NULL ;
GSList * stippled_ranges = NULL ;
GSList * stippled_ranges = NULL ;
@ -1400,7 +1400,7 @@ get_insensitive_layout (GdkDrawable *drawable,
PangoAttrList * attrs ;
PangoAttrList * attrs ;
GdkBitmap * stipple = NULL ;
GdkBitmap * stipple = NULL ;
iter = pango_layout_get_iter ( layout) ;
iter = pango_layout_get_iter ( tq layout) ;
do
do
{
{
@ -1447,7 +1447,7 @@ get_insensitive_layout (GdkDrawable *drawable,
pango_layout_iter_free ( iter ) ;
pango_layout_iter_free ( iter ) ;
new_layout = pango_layout_copy ( layout) ;
new_layout = pango_layout_copy ( tq layout) ;
attrs = pango_layout_get_attributes ( new_layout ) ;
attrs = pango_layout_get_attributes ( new_layout ) ;
@ -1526,25 +1526,25 @@ qtengine_style_register_type (GTypeModule *module)
{
{
static const GTypeInfo object_info =
static const GTypeInfo object_info =
{
{
sizeof ( QtEngineStyleClass) ,
sizeof ( T QtEngineStyleClass) ,
( GBaseInitFunc ) NULL ,
( GBaseInitFunc ) NULL ,
( GBaseFinalizeFunc ) NULL ,
( GBaseFinalizeFunc ) NULL ,
( GClassInitFunc ) qtengine_style_class_init ,
( GClassInitFunc ) qtengine_style_class_init ,
NULL , /* class_finalize */
NULL , /* class_finalize */
NULL , /* class_data */
NULL , /* class_data */
sizeof ( QtEngineStyle) ,
sizeof ( T QtEngineStyle) ,
0 , /* n_preallocs */
0 , /* n_preallocs */
( GInstanceInitFunc ) qtengine_style_init ,
( GInstanceInitFunc ) qtengine_style_init ,
} ;
} ;
qtengine_type_style = g_type_module_register_type ( module ,
qtengine_type_style = g_type_module_register_type ( module ,
GTK_TYPE_STYLE ,
GTK_TYPE_STYLE ,
" QtEngineStyle" ,
" T QtEngineStyle" ,
& object_info , 0 ) ;
& object_info , 0 ) ;
}
}
static void
static void
qtengine_style_init ( QtEngineStyle * style )
qtengine_style_init ( T QtEngineStyle * style )
{
{
}
}
@ -1743,7 +1743,7 @@ static void
gtk_style_real_realize ( GtkStyle * style )
gtk_style_real_realize ( GtkStyle * style )
{
{
GdkGCValues gc_values ;
GdkGCValues gc_values ;
GdkGCValuesMask gc_values_ mask;
GdkGCValuesMask gc_values_ tq mask;
gint i ;
gint i ;
@ -1771,13 +1771,13 @@ gtk_style_real_realize (GtkStyle *style)
style - > white . blue = 0xffff ;
style - > white . blue = 0xffff ;
gdk_colormap_alloc_color ( style - > colormap , & style - > white , FALSE , TRUE ) ;
gdk_colormap_alloc_color ( style - > colormap , & style - > white , FALSE , TRUE ) ;
gc_values_ mask = GDK_GC_FOREGROUND ;
gc_values_ tq mask = GDK_GC_FOREGROUND ;
gc_values . foreground = style - > black ;
gc_values . foreground = style - > black ;
style - > black_gc = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > black_gc = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > white ;
gc_values . foreground = style - > white ;
style - > white_gc = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > white_gc = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
for ( i = 0 ; i < 5 ; i + + )
for ( i = 0 ; i < 5 ; i + + )
{
{
@ -1808,28 +1808,28 @@ gtk_style_real_realize (GtkStyle *style)
style - > text_aa [ i ] . red , style - > text_aa [ i ] . green , style - > text_aa [ i ] . blue ) ;
style - > text_aa [ i ] . red , style - > text_aa [ i ] . green , style - > text_aa [ i ] . blue ) ;
gc_values . foreground = style - > fg [ i ] ;
gc_values . foreground = style - > fg [ i ] ;
style - > fg_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > fg_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > bg [ i ] ;
gc_values . foreground = style - > bg [ i ] ;
style - > bg_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > bg_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > light [ i ] ;
gc_values . foreground = style - > light [ i ] ;
style - > light_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > light_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > dark [ i ] ;
gc_values . foreground = style - > dark [ i ] ;
style - > dark_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > dark_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > mid [ i ] ;
gc_values . foreground = style - > mid [ i ] ;
style - > mid_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > mid_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > text [ i ] ;
gc_values . foreground = style - > text [ i ] ;
style - > text_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > text_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > base [ i ] ;
gc_values . foreground = style - > base [ i ] ;
style - > base_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > base_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
gc_values . foreground = style - > text_aa [ i ] ;
gc_values . foreground = style - > text_aa [ i ] ;
style - > text_aa_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ mask) ;
style - > text_aa_gc [ i ] = ( GdkGC * ) gtk_gc_get ( style - > depth , style - > colormap , & gc_values , gc_values_ tq mask) ;
}
}
}
}
@ -1845,15 +1845,15 @@ static void
set_background ( GtkStyle * style , GdkWindow * window , GtkStateType state_type )
set_background ( GtkStyle * style , GdkWindow * window , GtkStateType state_type )
{
{
GdkPixmap * pixmap ;
GdkPixmap * pixmap ;
gint parent_relative;
gint tq parent_relative;
GdkPixmap * pix_test ;
GdkPixmap * pix_test ;
/* What kind of horrible person would store a pointer to a widget here... */
/* What kind of horrible person would store a pointer to a widget here... */
void * parent = 0 ;
void * tq parent = 0 ;
gdk_window_get_user_data ( window , & parent) ;
gdk_window_get_user_data ( window , & tq parent) ;
if ( GTK_IS_MENU ( ( GtkWidget * ) parent) )
if ( GTK_IS_MENU ( ( GtkWidget * ) tq parent) )
{
{
pix_test = QTENGINE_STYLE( style ) - > menuBackground ;
pix_test = T QTENGINE_STYLE( style ) - > menuBackground ;
}
}
else
else
pix_test = style - > bg_pixmap [ state_type ] ;
pix_test = style - > bg_pixmap [ state_type ] ;
@ -1863,28 +1863,28 @@ set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type)
if ( pix_test = = ( GdkPixmap * ) GDK_PARENT_RELATIVE )
if ( pix_test = = ( GdkPixmap * ) GDK_PARENT_RELATIVE )
{
{
pixmap = NULL ;
pixmap = NULL ;
parent_relative = TRUE ;
tq parent_relative = TRUE ;
}
}
else
else
{
{
pixmap = pix_test ;
pixmap = pix_test ;
parent_relative = FALSE ;
tq parent_relative = FALSE ;
gdk_drawable_set_colormap ( pixmap , style - > colormap ) ;
gdk_drawable_set_colormap ( pixmap , style - > colormap ) ;
}
}
if ( pixmap & & ! gdk_drawable_get_colormap ( pixmap ) ) gdk_drawable_set_colormap ( pixmap , gdk_drawable_get_colormap ( window ) ) ;
if ( pixmap & & ! gdk_drawable_get_colormap ( pixmap ) ) gdk_drawable_set_colormap ( pixmap , gdk_drawable_get_colormap ( window ) ) ;
gdk_window_set_back_pixmap ( window , pixmap , parent_relative) ;
gdk_window_set_back_pixmap ( window , pixmap , tq parent_relative) ;
}
}
else
else
gdk_window_set_background ( window , & style - > bg [ state_type ] ) ;
gdk_window_set_background ( window , & style - > bg [ state_type ] ) ;
}
}
static void
static void
qtengine_style_class_init ( QtEngineStyleClass * klass )
qtengine_style_class_init ( T QtEngineStyleClass * klass )
{
{
GtkStyleClass * style_class = GTK_STYLE_CLASS ( klass ) ;
GtkStyleClass * style_class = GTK_STYLE_CLASS ( klass ) ;
parent_class = g_type_class_peek_parent ( klass ) ;
tq parent_class = g_type_class_peek_parent ( klass ) ;
style_class - > draw_hline = draw_hline ;
style_class - > draw_hline = draw_hline ;
style_class - > draw_vline = draw_vline ;
style_class - > draw_vline = draw_vline ;