Author: dmacvicar
Date: Sun Apr 17 01:05:19 2011
New Revision: 63804
URL: http://svn.opensuse.org/viewcvs/yast?rev=63804&view=rev
Log:
Port deprecated code so it builds with
-DGTK_DISABLE_SINGLE_INCLUDES
-DGTK_DISABLE_DEPRECATED
-DGDK_DISABLE_DEPRECATED
-DGSEAL_ENABLE
First step to port it to current GTK
Modified:
branches/tmp/dmacvicar/gtk/CMakeLists.txt
branches/tmp/dmacvicar/gtk/src/CMakeLists.txt
branches/tmp/dmacvicar/gtk/src/YGDialog.cc
branches/tmp/dmacvicar/gtk/src/YGDumbTab.cc
branches/tmp/dmacvicar/gtk/src/YGFrame.cc
branches/tmp/dmacvicar/gtk/src/YGImage.cc
branches/tmp/dmacvicar/gtk/src/YGLayout.cc
branches/tmp/dmacvicar/gtk/src/YGPushButton.cc
branches/tmp/dmacvicar/gtk/src/YGSelectionStore.h
branches/tmp/dmacvicar/gtk/src/YGText.cc
branches/tmp/dmacvicar/gtk/src/YGTreeView.cc
branches/tmp/dmacvicar/gtk/src/YGUI.cc
branches/tmp/dmacvicar/gtk/src/YGUtils.cc
branches/tmp/dmacvicar/gtk/src/YGUtils.h
branches/tmp/dmacvicar/gtk/src/YGWidget.cc
branches/tmp/dmacvicar/gtk/src/pkg/YGPackageSelector.cc
branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.c
branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.c
branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.c
branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.cc
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgfilterview.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.cc
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.cc
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgmenubar.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgpatternview.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.cc
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerycombo.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerywidget.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgrpmgroupsview.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.cc
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgundolist.cc
branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgvestigialdialog.h
branches/tmp/dmacvicar/gtk/src/pkg/ygtktreemodel.h
branches/tmp/dmacvicar/gtk/src/ygtkbargraph.c
branches/tmp/dmacvicar/gtk/src/ygtkbargraph.h
branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.c
branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.h
branches/tmp/dmacvicar/gtk/src/ygtkfixed.c
branches/tmp/dmacvicar/gtk/src/ygtkfixed.h
branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.c
branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.h
branches/tmp/dmacvicar/gtk/src/ygtkimage.c
branches/tmp/dmacvicar/gtk/src/ygtkimage.h
branches/tmp/dmacvicar/gtk/src/ygtklinklabel.c
branches/tmp/dmacvicar/gtk/src/ygtklinklabel.h
branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.c
branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.h
branches/tmp/dmacvicar/gtk/src/ygtkratiobox.c
branches/tmp/dmacvicar/gtk/src/ygtkratiobox.h
branches/tmp/dmacvicar/gtk/src/ygtkrichtext.c
branches/tmp/dmacvicar/gtk/src/ygtksteps.c
branches/tmp/dmacvicar/gtk/src/ygtksteps.h
branches/tmp/dmacvicar/gtk/src/ygtktextview.h
branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.c
branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.h
branches/tmp/dmacvicar/gtk/src/ygtktreeview.c
branches/tmp/dmacvicar/gtk/src/ygtktreeview.h
branches/tmp/dmacvicar/gtk/src/ygtkwizard.c
branches/tmp/dmacvicar/gtk/src/ygtkwizard.h
Modified: branches/tmp/dmacvicar/gtk/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/CMakeLists.txt?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/CMakeLists.txt (original)
+++ branches/tmp/dmacvicar/gtk/CMakeLists.txt Sun Apr 17 01:05:19 2011
@@ -2,7 +2,7 @@
cmake_minimum_required (VERSION 2.4)
project (yast2-gtk)
-
+SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
## configure
find_package (GTK2 REQUIRED gtk)
Modified: branches/tmp/dmacvicar/gtk/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/CMakeLists.txt?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/CMakeLists.txt (original)
+++ branches/tmp/dmacvicar/gtk/src/CMakeLists.txt Sun Apr 17 01:05:19 2011
@@ -1,5 +1,10 @@
## Makefile.am
+add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES
+ -DGTK_DISABLE_DEPRECATED
+ -DGDK_DISABLE_DEPRECATED
+ -DGSEAL_ENABLE)
+
set (gtk_yast_plugin_SRCS
YGBarGraph.cc
YGComboBox.cc
Modified: branches/tmp/dmacvicar/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGDialog.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGDialog.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGDialog.cc Sun Apr 17 01:05:19 2011
@@ -151,7 +151,7 @@
void normalCursor()
{
if (m_isBusy)
- gdk_window_set_cursor (m_widget->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window(m_widget), NULL);
m_isBusy = false;
}
@@ -163,7 +163,7 @@
gdk_cursor_ref (m_busyCursor);
}
if (!m_isBusy)
- gdk_window_set_cursor (m_widget->window, m_busyCursor);
+ gdk_window_set_cursor (gtk_widget_get_window(m_widget), m_busyCursor);
m_isBusy = true;
}
@@ -222,7 +222,7 @@
/* not main window */ main_window != pThis) {
pThis->close();
return TRUE;
-
+
}
if (event->state & GDK_SHIFT_MASK) {
@@ -416,17 +416,19 @@
// libyui calls YDialog::setSize() to force a geometry recalculation as a
// result of changed layout properties
GtkWidget *window = m_window->getWidget();
- if (GTK_WIDGET_REALIZED (window)) {
+ if (gtk_widget_get_realized (window)) {
gtk_widget_queue_resize (window);
width = MIN (width, YUI::app()->displayWidth());
height = MIN (height, YUI::app()->displayHeight());
#if 1
bool resize = false;
if (isMainDialog()) {
- if (window->allocation.width < width || window->allocation.height < height) {
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(window, &allocation);
+ if (allocation.width < width || allocation.height < height) {
resize = true;
- width = MAX (width, window->allocation.width),
- height = MAX (height, window->allocation.height);
+ width = MAX (width, allocation.width),
+ height = MAX (height, allocation.height);
}
}
else
@@ -445,10 +447,11 @@
static gboolean expose_highlight_cb (GtkWidget *widget,
GdkEventExpose *event)
{
- GtkAllocation *alloc = &widget->allocation;
- int x = alloc->x, y = alloc->y, w = alloc->width, h = alloc->height;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+ int x = alloc.x, y = alloc.y, w = alloc.width, h = alloc.height;
- cairo_t *cr = gdk_cairo_create (widget->window);
+ cairo_t *cr = gdk_cairo_create (gtk_widget_get_window(widget));
cairo_rectangle (cr, x, y, w, h);
cairo_set_source_rgb (cr, 0xff/255.0, 0x88/255.0, 0);
cairo_fill (cr);
@@ -458,10 +461,10 @@
static bool hasWindow (GtkWidget *widget)
{
- if (!GTK_WIDGET_NO_WINDOW (widget))
+ if (gtk_widget_get_has_window(widget))
return true;
// widgets like GtkButton add their windows to parent's
- for (GList *children = gdk_window_peek_children (widget->window);
+ for (GList *children = gdk_window_peek_children (gtk_widget_get_window(widget));
children; children = children->next) {
GdkWindow *child = (GdkWindow *) children->data;
gpointer data;
Modified: branches/tmp/dmacvicar/gtk/src/YGDumbTab.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGDumbTab.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGDumbTab.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGDumbTab.cc Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#include "YGWidget.h"
#include "YGUtils.h"
#include "YDumbTab.h"
-
+#include
#include "ygtkratiobox.h"
class YGDumbTab : public YDumbTab, public YGWidget
@@ -141,7 +141,7 @@
}
// callbacks
- static void switch_page_cb (GtkNotebook *notebook, GtkNotebookPage *page,
+ static void switch_page_cb (GtkNotebook *notebook, GtkWidget *page,
guint tab_nb, YGDumbTab *pThis)
{
GtkWidget *child = gtk_notebook_get_nth_page (notebook, tab_nb);
Modified: branches/tmp/dmacvicar/gtk/src/YGFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGFrame.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGFrame.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGFrame.cc Sun Apr 17 01:05:19 2011
@@ -39,10 +39,10 @@
static GtkWidget *findFirstFocusable (GtkContainer *container)
{
g_return_val_if_fail (container != NULL, NULL);
-
+
for (GList *l = gtk_container_get_children (container);
l; l = l->next) {
- if (GTK_WIDGET_CAN_FOCUS (l->data))
+ if (gtk_widget_get_can_focus (GTK_WIDGET(l->data)))
return GTK_WIDGET (l->data);
else if (GTK_IS_CONTAINER (l->data)) {
GtkWidget *ret = findFirstFocusable (GTK_CONTAINER (l->data));
@@ -130,7 +130,7 @@
virtual void setLabel (const string &_str)
{
GtkWidget *button = gtk_frame_get_label_widget (GTK_FRAME (getWidget()));
- GtkLabel *label = GTK_LABEL (GTK_BIN (button)->child);
+ GtkLabel *label = GTK_LABEL (gtk_bin_get_child(GTK_BIN (button)));
string str (YGUtils::mapKBAccel (_str));
gtk_label_set_text_with_mnemonic (label, str.c_str());
Modified: branches/tmp/dmacvicar/gtk/src/YGImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGImage.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGImage.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGImage.cc Sun Apr 17 01:05:19 2011
@@ -35,7 +35,7 @@
stock = GTK_STOCK_DIALOG_WARNING;
else if (endsWith (filename, "/msg_error.png"))
stock = GTK_STOCK_DIALOG_ERROR;
- if (stock && gtk_style_lookup_icon_set (m_widget->style, stock)) {
+ if (stock && gtk_style_lookup_icon_set (gtk_widget_get_style(m_widget), stock)) {
GdkPixbuf *pixbuf = gtk_widget_render_icon (m_widget, stock, GTK_ICON_SIZE_DIALOG, NULL);
ygtk_image_set_from_pixbuf (image, pixbuf);
}
Modified: branches/tmp/dmacvicar/gtk/src/YGLayout.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGLayout.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGLayout.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGLayout.cc Sun Apr 17 01:05:19 2011
@@ -178,19 +178,20 @@
static gboolean expose_event_cb (GtkWidget *widget, GdkEventExpose *event,
YGAlignment *pThis)
{
- GtkAllocation *alloc = &widget->allocation;
- cairo_t *cr = gdk_cairo_create (widget->window);
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+ cairo_t *cr = gdk_cairo_create (gtk_widget_get_window(widget));
gdk_cairo_set_source_pixbuf (cr, pThis->m_background_pixbuf, 0, 0);
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
- cairo_rectangle (cr, alloc->x, alloc->y, alloc->width, alloc->height);
+ cairo_rectangle (cr, alloc.x, alloc.y, alloc.width, alloc.height);
cairo_fill (cr);
cairo_destroy (cr);
gtk_container_propagate_expose (GTK_CONTAINER (widget),
- GTK_BIN (widget)->child, event);
+ gtk_bin_get_child(GTK_BIN (widget)), event);
return TRUE;
}
};
@@ -234,7 +235,7 @@
YGWIDGET_IMPL_COMMON (YSpacing)
YGLAYOUT_PREFERRED_SIZE_IMPL (YSpacing)
- static void set_size_cb (YGtkFixed *fixed, gint width, gint height,
+ static void set_size_cb (YGtkFixed *fixed, gint width, gint height,
gpointer pThis) {}
};
Modified: branches/tmp/dmacvicar/gtk/src/YGPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGPushButton.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGPushButton.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGPushButton.cc Sun Apr 17 01:05:19 2011
@@ -135,8 +135,8 @@
YPushButton::setDefaultButton (isDefault);
if (isDefault) {
GtkWidget *button = getWidget();
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- if (GTK_WIDGET_REALIZED (button))
+ gtk_widget_set_can_default(button, TRUE);
+ if (gtk_widget_get_realized (button))
inner::realize_cb (button);
g_signal_connect (G_OBJECT (button), "realize",
G_CALLBACK (inner::realize_cb), this);
@@ -148,7 +148,7 @@
if (dynamic_cast (ywidget)) {
GtkWidget *button = YGWidget::get (ywidget)->getWidget();
GtkWidget *icon = gtk_button_get_image (GTK_BUTTON (button));
- return icon && GTK_WIDGET_VISIBLE (icon);
+ return icon && gtk_widget_get_visible (icon);
}
return true;
}
@@ -165,7 +165,7 @@
for (YWidgetListConstIterator it = ybox->childrenBegin();
it != ybox->childrenEnd(); it++) {
if ((YWidget *) pThis == *it) {
- if (ylast && !hasIcon (ylast))
+ if (ylast && !hasIcon (ylast))
pThis->setIcon ("");
break;
}
Modified: branches/tmp/dmacvicar/gtk/src/YGSelectionStore.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGSelectionStore.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGSelectionStore.h (original)
+++ branches/tmp/dmacvicar/gtk/src/YGSelectionStore.h Sun Apr 17 01:05:19 2011
@@ -7,7 +7,7 @@
#ifndef YGSELECTION_STORE_H
#define YGSELECTION_STORE_H
-#include
+#include
struct YItem;
struct YSelectionWidget;
Modified: branches/tmp/dmacvicar/gtk/src/YGText.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGText.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGText.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGText.cc Sun Apr 17 01:05:19 2011
@@ -74,7 +74,7 @@
void scrollToBottom()
{
#if 1
- YGUtils::scrollWidget (GTK_TEXT_VIEW (getWidget())->vadjustment, false);
+ YGUtils::scrollWidget (gtk_text_view_get_vadjustment(GTK_TEXT_VIEW (getWidget())), false);
#else
GtkTextBuffer *buffer = getBuffer();
GtkTextIter iter;
@@ -167,8 +167,8 @@
if (text.size() == m_text.size()) return;
// appending text: avoid flickering and allow user to scroll freely
- GtkAdjustment *vadj = GTK_TEXT_VIEW (getWidget())->vadjustment;
- bool autoScroll = vadj->value >= vadj->upper - vadj->page_size;
+ GtkAdjustment *vadj = gtk_text_view_get_vadjustment(GTK_TEXT_VIEW (getWidget()));
+ bool autoScroll = gtk_adjustment_get_value(vadj) >= gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj);
std::string diff (text.substr (m_text.size()));
YGTextView::appendText (diff);
Modified: branches/tmp/dmacvicar/gtk/src/YGTreeView.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGTreeView.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGTreeView.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGTreeView.cc Sun Apr 17 01:05:19 2011
@@ -378,7 +378,7 @@
void setSortable (bool sortable)
{
- if (!sortable && !GTK_WIDGET_REALIZED (getWidget()))
+ if (!sortable && !gtk_widget_get_realized (getWidget()))
return;
int n = 0;
GList *columns = gtk_tree_view_get_columns (getView());
Modified: branches/tmp/dmacvicar/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGUI.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGUI.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGUI.cc Sun Apr 17 01:05:19 2011
@@ -356,11 +356,14 @@
return;
}
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+
GError *error = 0;
GdkPixbuf *shot =
- gdk_pixbuf_get_from_drawable (NULL, GDK_DRAWABLE (widget->window),
- gdk_colormap_get_system(), 0, 0, 0, 0, widget->allocation.width,
- widget->allocation.height);
+ gdk_pixbuf_get_from_drawable (NULL, GDK_DRAWABLE (gtk_widget_get_window(widget)),
+ gdk_colormap_get_system(), 0, 0, 0, 0, alloc.width,
+ alloc.height);
if (!shot) {
if (interactive)
@@ -643,7 +646,7 @@
GtkDialogFlags (GTK_DIALOG_NO_SEPARATOR), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 300);
- inner::dumpYastHtml (widget, GTK_BOX (GTK_DIALOG (dialog)->vbox));
+ inner::dumpYastHtml (widget, GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (dialog))));
gtk_widget_show_all (dialog);
g_signal_connect (G_OBJECT (dialog), "response",
Modified: branches/tmp/dmacvicar/gtk/src/YGUtils.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGUtils.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGUtils.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGUtils.cc Sun Apr 17 01:05:19 2011
@@ -411,14 +411,14 @@
static gboolean scroll_down_cb (void *pData)
{
GtkAdjustment *vadj = (GtkAdjustment *) pData;
- gtk_adjustment_set_value (vadj, vadj->upper - vadj->page_size);
+ gtk_adjustment_set_value (vadj, gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj));
return FALSE;
}
void YGUtils::scrollWidget (GtkAdjustment *vadj, bool top)
{
if (top)
- gtk_adjustment_set_value (vadj, vadj->lower);
+ gtk_adjustment_set_value (vadj, gtk_adjustment_get_lower(vadj));
else
// since we usually want to call this together with a text change, we
// must wait till that gets in effect
@@ -462,7 +462,7 @@
{
PangoContext *context = gtk_widget_get_pango_context (widget);
PangoFontMetrics *metrics = pango_context_get_metrics (context,
- widget->style->font_desc, NULL);
+ gtk_widget_get_style(widget)->font_desc, NULL);
int width = pango_font_metrics_get_approximate_char_width (metrics);
pango_font_metrics_unref (metrics);
@@ -474,7 +474,7 @@
{
PangoContext *context = gtk_widget_get_pango_context (widget);
PangoFontMetrics *metrics = pango_context_get_metrics (context,
- widget->style->font_desc, NULL);
+ gtk_widget_get_style(widget)->font_desc, NULL);
int height = pango_font_metrics_get_ascent (metrics) +
pango_font_metrics_get_descent (metrics);
@@ -486,7 +486,7 @@
void YGUtils::setWidgetFont (GtkWidget *widget, PangoStyle style, PangoWeight weight,
double scale)
{
- PangoFontDescription *font_desc = widget->style->font_desc;
+ PangoFontDescription *font_desc = gtk_widget_get_style(widget)->font_desc;
int size = pango_font_description_get_size (font_desc);
PangoFontDescription* font = pango_font_description_new();
pango_font_description_set_weight (font, weight);
@@ -504,10 +504,13 @@
if (!g_object_get_data (G_OBJECT (paned), "init")) { // only once
gdouble rel = GPOINTER_TO_INT (_rel) / 100.;
gint parent_size;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(paned, &alloc);
+
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (paned)) == GTK_ORIENTATION_HORIZONTAL)
- parent_size = paned->allocation.width;
+ parent_size = alloc.width;
else
- parent_size = paned->allocation.height;
+ parent_size = alloc.height;
int pos = parent_size * rel;
gtk_paned_set_position (GTK_PANED (paned), pos);
g_object_set_data (G_OBJECT (paned), "init", GINT_TO_POINTER (1));
@@ -714,7 +717,7 @@
if (!icon && label.size() < 22)
icon = fallbackIcon;
if (icon) {
- if (gtk_style_lookup_icon_set (button->style, icon)) {
+ if (gtk_style_lookup_icon_set (gtk_widget_get_style(button), icon)) {
// we want to use GtkImage stock mode so it honors sensitive
GtkWidget *image = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image);
@@ -764,7 +767,7 @@
for (; text[i]; i++)
if (text[i] == '>')
break;
-
+
if (!strncasecmp (text+a, "len && !strncasecmp (text+a, "<b>", 3))) {
for (i++; text[i]; i++) {
Modified: branches/tmp/dmacvicar/gtk/src/YGUtils.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGUtils.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGUtils.h (original)
+++ branches/tmp/dmacvicar/gtk/src/YGUtils.h Sun Apr 17 01:05:19 2011
@@ -7,8 +7,7 @@
#include <string>
#include <list>
-#include
-#include
+#include
/* YGUtils.h/cc have some functionality that is shared between different parts
of the code. */
Modified: branches/tmp/dmacvicar/gtk/src/YGWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/YGWidget.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/YGWidget.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/YGWidget.cc Sun Apr 17 01:05:19 2011
@@ -54,7 +54,7 @@
static void min_size_cb (guint *min_width, guint *min_height, gpointer pData);
YGWidget::YGWidget(YWidget *ywidget, YWidget *yparent,
- GtkType type, const char *property_name, ...)
+ GType type, const char *property_name, ...)
: m_ywidget (ywidget)
{
va_list args;
Modified: branches/tmp/dmacvicar/gtk/src/pkg/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/YGPackageSelector.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/YGPackageSelector.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/YGPackageSelector.cc Sun Apr 17 01:05:19 2011
@@ -258,7 +258,7 @@
(GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (scroll), view);
- GtkBox *vbox = GTK_BOX (GTK_DIALOG(dialog)->vbox);
+ GtkBox *vbox = GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
gtk_box_pack_start (vbox, scroll, TRUE, TRUE, 6);
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
@@ -411,7 +411,7 @@
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (scroll), view);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), scroll);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), scroll);
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 500);
@@ -629,7 +629,7 @@
view.setListener (this);
view.setList (list);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), view.getWidget());
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), view.getWidget());
gtk_widget_show_all (dialog);
int ret = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.c (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.c Sun Apr 17 01:05:19 2011
@@ -31,9 +31,7 @@
{
bcell->active = FALSE;
GtkCellRenderer *cell = GTK_CELL_RENDERER (bcell);
- cell->xpad = BORDER;
- cell->ypad = BORDER;
- cell->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
+ g_object_set(cell, "xpad", BORDER, "ypad", BORDER, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
bcell->icon_size = 16;
}
@@ -118,9 +116,13 @@
static PangoLayout *create_layout (YGtkCellRendererButton *bcell, GtkWidget *widget)
{
GtkCellRendererText *tcell = GTK_CELL_RENDERER_TEXT (bcell);
- if (tcell->text)
- return gtk_widget_create_pango_layout (widget, tcell->text);
- return NULL;
+ gchar *text = NULL;
+ g_object_get(tcell, "text", text, NULL);
+ PangoLayout *layout = NULL;
+ if (text)
+ layout = gtk_widget_create_pango_layout (widget, text);
+ g_object_unref(text);
+ return layout;
}
static void ensure_pixbuf (YGtkCellRendererButton *cell, GtkWidget *widget)
@@ -170,28 +172,35 @@
width += PIXBUF_TEXT_SPACING;
height = MAX (pixbuf_height, text_height);
+ gfloat xalign, yalign;
+ guint xpad, ypad;
+ g_object_get(cell,
+ "xalign", &xalign,
+ "yalign", &yalign,
+ "xpad", &xpad,
+ "ypad", &ypad, NULL);
+
if (cell_area) {
gboolean reverse = gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL;
- gfloat xalign = cell->xalign, yalign = cell->yalign;
if (reverse)
xalign = 1.0 - xalign;
- int cell_width = cell_area->width - cell->xpad*2,
- cell_height = cell_area->height - cell->ypad*2;
- int xoffset = (xalign * (cell_width - width)) + cell->xpad;
- int yoffset = (yalign * (cell_height - height)) + cell->ypad;
+ int cell_width = cell_area->width - xpad*2,
+ cell_height = cell_area->height - ypad*2;
+ int xoffset = (xalign * (cell_width - width)) + xpad;
+ int yoffset = (yalign * (cell_height - height)) + ypad;
if (_xoffset) *_xoffset = xoffset;
if (_yoffset) *_yoffset = yoffset;
int text_x = xoffset, text_y;
if (pixbuf_width && !reverse)
text_x += (pixbuf_width + PIXBUF_TEXT_SPACING);
- text_y = (yalign * (cell_height - text_height)) + cell->ypad;
+ text_y = (yalign * (cell_height - text_height)) + ypad;
int pixbuf_x = xoffset, pixbuf_y;
if (text_width && reverse)
pixbuf_x += (text_width + PIXBUF_TEXT_SPACING);
- pixbuf_y = (yalign * (cell_height - pixbuf_height)) + cell->ypad;
+ pixbuf_y = (yalign * (cell_height - pixbuf_height)) + ypad;
if (_pixbuf_xoffset) *_pixbuf_xoffset = pixbuf_x;
if (_pixbuf_yoffset) *_pixbuf_yoffset = pixbuf_y;
@@ -201,8 +210,8 @@
if (_text_yoffset) *_text_yoffset = text_y;
}
- if (_width) *_width = width + (cell->xpad * 2);
- if (_height) *_height = height + (cell->ypad * 2);
+ if (_width) *_width = width + (xpad * 2);
+ if (_height) *_height = height + (ypad * 2);
}
static void ygtk_cell_renderer_button_get_size (GtkCellRenderer *cell,
@@ -221,10 +230,10 @@
gboolean has_focus = FALSE;
if (flags & GTK_CELL_RENDERER_SELECTED)
- has_focus = GTK_WIDGET_HAS_FOCUS (widget);
+ has_focus = gtk_widget_has_focus (widget);
GtkStateType state = GTK_STATE_NORMAL;
- if (!cell->sensitive || GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
+ if (!gtk_cell_renderer_get_sensitive(cell) || gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
else if ((flags & GTK_CELL_RENDERER_PRELIT))
state = GTK_STATE_PRELIGHT;
@@ -245,7 +254,7 @@
int y = cell_area->y + (cell_area->height - height)/2 + OUTER_BORDER;
width -= OUTER_BORDER*2; height -= OUTER_BORDER*2;
- gtk_paint_box (widget->style, window, state, shadow, expose_area, widget,
+ gtk_paint_box (gtk_widget_get_style(widget), window, state, shadow, expose_area, widget,
"button", x, y, width, height);
int cell_area_x = cell_area->x, cell_area_y = cell_area->y;
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrendererbutton.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_CELL_RENDERER_BUTTON_H
#define YGTK_CELL_RENDERER_BUTTON_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_CELL_RENDERER_BUTTON (ygtk_cell_renderer_button_get_type ())
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.c (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.c Sun Apr 17 01:05:19 2011
@@ -20,7 +20,7 @@
G_DEFINE_TYPE (YGtkCellRendererSideButton, ygtk_cell_renderer_side_button, GTK_TYPE_CELL_RENDERER_TEXT)
static void ygtk_cell_renderer_side_button_init (YGtkCellRendererSideButton *bcell)
-{ GTK_CELL_RENDERER (bcell)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE; }
+{ g_object_set(GTK_CELL_RENDERER(bcell), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL); }
static void free_pixbuf (YGtkCellRendererSideButton *cell)
{
@@ -126,7 +126,9 @@
if (bcell->button_visible) {
GtkStateType state = GTK_STATE_NORMAL;
GtkShadowType shadow = GTK_SHADOW_OUT;
- if (!cell->sensitive || GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
+ gboolean sensitive = TRUE;
+ g_object_get(cell, "sensitive", &sensitive, NULL);
+ if (!sensitive || gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
/* else if ((flags & GTK_CELL_RENDERER_PRELIT))
state = GTK_STATE_PRELIGHT;*/
@@ -143,7 +145,7 @@
button_area.width = icon_width + 4;
button_area.height = icon_height + 4;
button_area.y = cell_area->y + ((cell_area->height - button_area.height) / 2);
- gtk_paint_box (widget->style, window, state, shadow, expose_area, widget,
+ gtk_paint_box (gtk_widget_get_style(widget), window, state, shadow, expose_area, widget,
"button", button_area.x, button_area.y, button_area.width, button_area.height);
GdkRectangle icon_area = button_area;
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderersidebutton.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_CELL_RENDERER_SIDE_BUTTON_H
#define YGTK_CELL_RENDERER_SIDE_BUTTON_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_CELL_RENDERER_SIDE_BUTTON (ygtk_cell_renderer_side_button_get_type())
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.c (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.c Sun Apr 17 01:05:19 2011
@@ -28,11 +28,13 @@
GtkCellRendererText *tcell = GTK_CELL_RENDERER_TEXT (cell);
PangoAttrList *old_extra_attrs = 0, *new_extra_attrs = 0;
if (flags & (GTK_CELL_RENDERER_SELECTED | GTK_CELL_RENDERER_INSENSITIVE)) {
- old_extra_attrs = pango_attr_list_copy (tcell->extra_attrs);
- new_extra_attrs = tcell->extra_attrs;
+ g_object_get(tcell, "attributes", old_extra_attrs, NULL);
+ g_object_get(tcell, "attributes", new_extra_attrs, NULL);
- PangoAttrList *t = pango_attr_list_filter (tcell->extra_attrs,
+ PangoAttrList *t = pango_attr_list_filter (new_extra_attrs,
filter_color_cb, NULL);
+ g_object_set(tcell, "attributes", new_extra_attrs, NULL);
+ pango_attr_list_unref (new_extra_attrs);
pango_attr_list_unref (t);
}
@@ -40,8 +42,8 @@
cell, window, widget, background_area, cell_area, expose_area, flags);
if (old_extra_attrs) {
- tcell->extra_attrs = old_extra_attrs;
- pango_attr_list_unref (new_extra_attrs);
+ g_object_set(tcell, "attributes", old_extra_attrs, NULL);
+ pango_attr_list_unref (old_extra_attrs);
}
}
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkcellrenderertext.h Sun Apr 17 01:05:19 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_CELL_RENDERER_TEXT_H
#define YGTK_CELL_RENDERER_TEXT_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_CELL_RENDERER_TEXT (ygtk_cell_renderer_text_get_type())
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.cc Sun Apr 17 01:05:19 2011
@@ -209,7 +209,7 @@
G_CALLBACK (copy_link_cb), pThis);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
- gtk_menu_popup (GTK_MENU (pThis->popup), NULL, NULL, NULL, NULL,
+ gtk_menu_popup (GTK_MENU (pThis->popup), NULL, NULL, NULL, NULL,
0, gtk_get_current_event_time());
pThis->link_str = link;
}
@@ -617,10 +617,11 @@
static gboolean draw_gray_cb (GtkWidget *widget, GdkEventExpose *event)
{
- GtkAllocation *alloc = &widget->allocation;
- int x = alloc->x, y = alloc->y, w = alloc->width, h = alloc->height;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+ int x = alloc.x, y = alloc.y, w = alloc.width, h = alloc.height;
- cairo_t *cr = gdk_cairo_create (widget->window);
+ cairo_t *cr = gdk_cairo_create (gtk_widget_get_window(widget));
cairo_rectangle (cr, x, y, w, h);
// use alpha to cope with styles who might not have a white background
cairo_set_source_rgba (cr, 0, 0, 0, .060);
@@ -771,7 +772,7 @@
static const char *getLabel (int dep)
{
-
+
switch ((zypp::Dep::for_use_in_switch) dep) {
case zypp::Dep::PROVIDES_e: return "Provides:";
case zypp::Dep::PREREQUIRES_e: return "Pre-requires:";
@@ -1198,7 +1199,7 @@
GtkWidget *child = gtk_event_box_new();
gtk_container_add (GTK_CONTAINER (child), hbox);
- GdkColor *color = &detail_description->style->base [GTK_STATE_NORMAL];
+ GdkColor *color = >k_widget_get_style(detail_description)->base [GTK_STATE_NORMAL];
gtk_widget_modify_bg (child, GTK_STATE_NORMAL, color);
m_scroll = gtk_scrolled_window_new (NULL, NULL);
@@ -1253,7 +1254,10 @@
{
GtkScrolledWindow *_scroll = GTK_SCROLLED_WINDOW (scroll);
GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (_scroll);
- int height = scroll->allocation.height;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(scroll, &alloc);
+
+ int height = alloc.height;
gdouble increment;
switch (step) {
case GTK_MOVEMENT_DISPLAY_LINES:
@@ -1263,17 +1267,17 @@
increment = height * 0.9;
break;
case GTK_MOVEMENT_DISPLAY_LINE_ENDS:
- increment = adj->upper - adj->lower;
+ increment = gtk_adjustment_get_upper(adj) - gtk_adjustment_get_lower(adj);
break;
default:
increment = 0.0;
break;
}
- gdouble value = adj->value + (count * increment);
- value = MIN (value, adj->upper - adj->page_size);
- value = MAX (value, adj->lower);
- if (value != adj->value)
+ gdouble value = gtk_adjustment_get_value(adj) + (count * increment);
+ value = MIN (value, gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj));
+ value = MAX (value, gtk_adjustment_get_lower(adj));
+ if (value != gtk_adjustment_get_value(adj))
gtk_adjustment_set_value (adj, value);
}
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgdetailview.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_DETAIL_VIEW_H
#define YGTK_PKG_DETAIL_VIEW_H
-#include
+#include
#include "yzyppwrapper.h"
struct YGtkPkgDetailView
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgfilterview.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgfilterview.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgfilterview.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgfilterview.h Sun Apr 17 01:05:19 2011
@@ -16,7 +16,7 @@
#define YGTK_PKG_FILTER_VIEW_H
#include "ygtkpkgquerywidget.h"
-#include
+#include
struct YGtkPkgFilterModel // abstract
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.cc Sun Apr 17 01:05:19 2011
@@ -504,7 +504,7 @@
gtk_tree_view_get_model (date_view), &iter))
gtk_tree_selection_select_iter (selection, &iter);
- gdk_window_set_cursor (dialog->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window(GTK_WIDGET(dialog)), NULL);
return FALSE;
}
@@ -637,7 +637,7 @@
gtk_paned_pack1 (GTK_PANED (hpaned), date_scroll, FALSE, FALSE);
gtk_paned_pack2 (GTK_PANED (hpaned), log_scroll, TRUE, FALSE);
YGUtils::setPaneRelPosition (hpaned, .30);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hpaned);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_action_area(GTK_DIALOG (dialog))), hpaned);
gtk_widget_show_all (dialog);
m_dialog = dialog;
@@ -654,7 +654,7 @@
G_CALLBACK (date_selection_changed_cb), log_view);
GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (dialog->window, cursor);
+ gdk_window_set_cursor (gtk_widget_get_window(GTK_WIDGET(dialog)), cursor);
gdk_cursor_unref (cursor);
GtkWidget **views = g_new (GtkWidget *, 3);
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkghistorydialog.h Sun Apr 17 01:05:19 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_PKG_HISTORY_DIALOG_H
#define YGTK_PKG_HISTORY_DIALOG_H
-#include
+#include
struct YGtkPkgHistoryDialog
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.cc Sun Apr 17 01:05:19 2011
@@ -515,7 +515,7 @@
static void selection_changed_cb (GtkTreeSelection *selection, YGtkPkgListView *pThis)
{
- if (GTK_WIDGET_REALIZED (pThis->impl->view) && pThis->impl->listener)
+ if (gtk_widget_get_realized (pThis->impl->view) && pThis->impl->listener)
pThis->impl->listener->selectionChanged();
}
@@ -742,7 +742,7 @@
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
}
- else if (GTK_WIDGET_REALIZED (impl->view))
+ else if (gtk_widget_get_realized (impl->view))
gtk_tree_view_scroll_to_point (GTK_TREE_VIEW (impl->view), -1, 0);
}
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkglistview.h Sun Apr 17 01:05:19 2011
@@ -9,7 +9,7 @@
#define YGTK_PKG_LIST_VIEW_H
#include "yzyppwrapper.h"
-#include
+#include
enum Property {
INSTALLED_CHECK_PROP, NAME_PROP, ACTION_NAME_PROP, NAME_SUMMARY_PROP,
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgmenubar.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgmenubar.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgmenubar.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgmenubar.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_MENU_BAR_H
#define YGTK_PKG_MENU_BAR_H
-#include
+#include
struct YGtkPkgMenuBar
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgpatternview.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgpatternview.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgpatternview.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgpatternview.h Sun Apr 17 01:05:19 2011
@@ -9,7 +9,7 @@
#define YGTK_PKG_PATTERN_LIST_H
#include "ygtkpkgquerywidget.h"
-#include
+#include
struct YGtkPkgPatternView : public YGtkPkgQueryWidget
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.cc Sun Apr 17 01:05:19 2011
@@ -98,7 +98,7 @@
sel->candidateObj().isSatisfied() || sel->hasInstalledObj(),
TEXT_COLUMN, text.c_str(), VERSION_COLUMN, version.c_str(),
VENDOR_COLUMN, prod->vendor().c_str(), DESCRIPTION_COLUMN,
- description.c_str(), -1);
+ description.c_str(), -1);
}
GtkWidget *description = ygtk_rich_text_new();
@@ -121,7 +121,7 @@
renderer = gtk_cell_renderer_toggle_new();
column = gtk_tree_view_column_new_with_attributes (
NULL, renderer, "active", INSTALLED_COLUMN, NULL);
- g_object_set (G_OBJECT (renderer), "sensitive", FALSE, NULL);
+ gtk_cell_renderer_set_sensitive(renderer, FALSE);
gtk_tree_view_append_column (tview, column);
renderer = gtk_cell_renderer_text_new();
@@ -167,7 +167,7 @@
gtk_paned_pack1 (GTK_PANED (vpaned), scroll, TRUE, FALSE);
gtk_paned_pack2 (GTK_PANED (vpaned), description_scroll, FALSE, TRUE);
YGUtils::setPaneRelPosition (vpaned, .70);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vpaned);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), vpaned);
gtk_widget_show_all (dialog);
m_dialog = dialog;
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgproductdialog.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_PRODUCT_DIALOG_H
#define YGTK_PKG_PRODUCT_DIALOG_H
-#include
+#include
struct YGtkPkgProductDialog
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerycombo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerycombo.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerycombo.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerycombo.h Sun Apr 17 01:05:19 2011
@@ -10,7 +10,7 @@
#define YGTK_PKG_QUERY_COMBO_H
#include "ygtkpkgquerywidget.h"
-#include
+#include
struct YGtkPkgQueryCombo : public YGtkPkgQueryWidget
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerywidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerywidget.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerywidget.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgquerywidget.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_QUERY_WIDGET_H
#define YGTK_PKG_QUERY_WIDGET_H
-#include
+#include
#include "yzyppwrapper.h"
struct YGtkPkgQueryWidget
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgrpmgroupsview.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgrpmgroupsview.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgrpmgroupsview.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgrpmgroupsview.h Sun Apr 17 01:05:19 2011
@@ -9,7 +9,7 @@
#define YGTK_PKG_RPM_GROUP_VIEW_H
#include "ygtkpkgquerywidget.h"
-#include
+#include
struct YGtkPkgRpmGroupsView : public YGtkPkgQueryWidget
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.cc Sun Apr 17 01:05:19 2011
@@ -117,13 +117,16 @@
void set_ellipsize (GtkWidget *label)
{
GtkWidget *hbox = gtk_widget_get_parent (this->hbox);
- if (GTK_WIDGET_REALIZED (hbox)) {
+ if (gtk_widget_get_realized (hbox)) {
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_NONE);
GtkRequisition req;
gtk_widget_size_request (hbox, &req);
GtkWidget *window = gtk_widget_get_toplevel (hbox);
- bool ellipsize = req.width > window->allocation.width - 10;
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(window, &allocation);
+
+ bool ellipsize = req.width > allocation.width - 10;
PangoEllipsizeMode mode = ellipsize ? PANGO_ELLIPSIZE_MIDDLE : PANGO_ELLIPSIZE_NONE;
gtk_label_set_ellipsize (GTK_LABEL (label), mode);
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgstatusbar.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_STATUS_BAR_H
#define YGTK_PKG_STATUS_BAR_H
-#include
+#include
struct YGtkPkgUndoList;
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgundolist.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgundolist.cc?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgundolist.cc (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgundolist.cc Sun Apr 17 01:05:19 2011
@@ -307,7 +307,7 @@
if (onApply)
gtk_box_pack_start (GTK_BOX (vbox), create_close_when_done_check(), FALSE, TRUE, 0);
gtk_widget_show (vbox);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), vbox);
int ret = gtk_dialog_run (GTK_DIALOG (dialog));
if (ret == 1)
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgvestigialdialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgvestigialdialog.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgvestigialdialog.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtkpkgvestigialdialog.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_PKG_VESTIGIAL_DIALOG_H
#define YGTK_PKG_VESTIGIAL_DIALOG_H
-#include
+#include
struct YGtkPkgVestigialDialog
{
Modified: branches/tmp/dmacvicar/gtk/src/pkg/ygtktreemodel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/pkg/ygtktreemodel.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/pkg/ygtktreemodel.h (original)
+++ branches/tmp/dmacvicar/gtk/src/pkg/ygtktreemodel.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_TREE_MODEL_H
#define YGTK_TREE_MODEL_H
-#include
+#include
struct YGtkTreeModel
{
Modified: branches/tmp/dmacvicar/gtk/src/ygtkbargraph.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkbargraph.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkbargraph.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkbargraph.c Sun Apr 17 01:05:19 2011
@@ -33,7 +33,7 @@
void ygtk_bar_graph_create_entries (YGtkBarGraph *bar, guint entries)
{
- YGtkRatioBox *box = YGTK_RATIO_BOX (GTK_BIN (bar)->child);
+ YGtkRatioBox *box = YGTK_RATIO_BOX (gtk_bin_get_child(GTK_BIN (bar)));
// Remove the ones in excess
guint i;
@@ -56,7 +56,7 @@
static GtkWidget *ygtk_bar_graph_get_label (YGtkBarGraph *bar, int index, GtkWidget **b)
{
- YGtkRatioBox *hbox = YGTK_RATIO_BOX (GTK_BIN (bar)->child);
+ YGtkRatioBox *hbox = YGTK_RATIO_BOX (gtk_bin_get_child(GTK_BIN (bar)));
GtkWidget *box = ((YGtkRatioBoxChild *) g_list_nth_data (hbox->children, index))->widget;
if (b) *b = box;
return gtk_bin_get_child (GTK_BIN (box));
@@ -92,7 +92,7 @@
// Set proportion
gtk_widget_set_size_request (box, 0, -1);
- YGtkRatioBox *hbox = YGTK_RATIO_BOX (GTK_BIN (bar)->child);
+ YGtkRatioBox *hbox = YGTK_RATIO_BOX (gtk_bin_get_child(GTK_BIN (bar)));
ygtk_ratio_box_set_child_packing (hbox, box, MAX (value, 1));
// Set background color
@@ -174,22 +174,23 @@
static gboolean ygtk_colored_label_expose_event (GtkWidget *widget, GdkEventExpose *event)
{
- GtkAllocation *alloc = &widget->allocation;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
- GdkColor *bg_color = &widget->style->bg[GTK_STATE_NORMAL];
+ GdkColor *bg_color = >k_widget_get_style(widget)->bg[GTK_STATE_NORMAL];
double red = (bg_color->red >> 8) / 255.;
double green = (bg_color->green >> 8) / 255.;
double blue = (bg_color->blue >> 8) / 255.;
cairo_t *cr = gdk_cairo_create (event->window);
- cairo_translate (cr, alloc->x, alloc->y);
- cairo_scale (cr, alloc->width, alloc->height);
+ cairo_translate (cr, alloc.x, alloc.y);
+ cairo_scale (cr, alloc.width, alloc.height);
double x, y, w, h;
- x = alloc->x;
- y = alloc->y;
- w = alloc->width;
- h = alloc->height;
+ x = alloc.x;
+ y = alloc.y;
+ w = alloc.width;
+ h = alloc.height;
cairo_pattern_t *grad = cairo_pattern_create_linear (0, 0, 0, 1);
cairo_pattern_add_color_stop_rgba (grad, 0, pixel_clamp (red+.3), pixel_clamp (green+.3), pixel_clamp (blue+.3), 1);
Modified: branches/tmp/dmacvicar/gtk/src/ygtkbargraph.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkbargraph.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkbargraph.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkbargraph.h Sun Apr 17 01:05:19 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_BAR_GRAPH_H
#define YGTK_BAR_GRAPH_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_BAR_GRAPH (ygtk_bar_graph_get_type ())
@@ -55,7 +55,6 @@
#ifndef YGTK_COLORED_LABEL_H
#define YGTK_COLORED_LABEL_H
-#include
G_BEGIN_DECLS
/* YGtkColoredLabel is a GtkLabel where gtk_modify_bg() can be used. It also
Modified: branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.c Sun Apr 17 01:05:19 2011
@@ -7,6 +7,7 @@
#include
#include "ygtkfieldentry.h"
+#include
#include
#include
@@ -184,7 +185,7 @@
filter_entry_signal = g_signal_new ("field_entry_changed",
G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (YGtkFieldEntryClass, filter_entry_changed),
- NULL, NULL, gtk_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
+ NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}
gboolean ygtk_field_entry_set_focus (YGtkFieldEntry *fields)
Modified: branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkfieldentry.h Sun Apr 17 01:05:19 2011
@@ -12,8 +12,7 @@
#ifndef YGTK_FIELD_ENTRY_H
#define YGTK_FIELD_ENTRY_H
-#include
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_FIELD_ENTRY (ygtk_field_entry_get_type ())
@@ -43,7 +42,7 @@
GtkWidget* ygtk_field_entry_new (void);
GType ygtk_field_entry_get_type (void) G_GNUC_CONST;
-// if this is the first field, separator will be ignored.
+// if this is the first field, separator will be ignored.
guint ygtk_field_entry_add_field (YGtkFieldEntry *entry, gchar separator);
// max_length can be 0 to disable it. valids_chars can be NULL to disable it.
void ygtk_field_entry_setup_field (YGtkFieldEntry *entry, guint index,
Modified: branches/tmp/dmacvicar/gtk/src/ygtkfixed.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkfixed.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkfixed.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkfixed.c Sun Apr 17 01:05:19 2011
@@ -14,7 +14,7 @@
static void ygtk_fixed_init (YGtkFixed *fixed)
{
- GTK_WIDGET_SET_FLAGS (fixed, GTK_NO_WINDOW);
+ gtk_widget_set_has_window(fixed, FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (fixed), FALSE);
}
@@ -68,7 +68,7 @@
for (i = fixed->children; i; i = i->next) {
YGtkFixedChild *child = i->data;
if (child->widget == widget) {
- gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
fixed->children = g_slist_delete_link (fixed->children, i);
g_free (child);
Modified: branches/tmp/dmacvicar/gtk/src/ygtkfixed.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkfixed.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkfixed.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkfixed.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_FIXED_H
#define YGTK_FIXED_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_FIXED (ygtk_fixed_get_type ())
Modified: branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.c Sun Apr 17 01:05:19 2011
@@ -6,12 +6,11 @@
// check the header file for information about this widget
#include
-#include
+#include
#include
#include "ygtkhtmlwrap.h"
// ygutils
-#include
void ygutils_scrollAdj (GtkAdjustment *vadj, gboolean top);
GtkWidget *ygtk_html_wrap_new (void)
@@ -313,7 +312,7 @@
void ygtk_html_wrap_scroll (GtkWidget *widget, gboolean top)
{
- ygutils_scrollAdj (GTK_TEXT_VIEW (widget)->vadjustment, top);
+ ygutils_scrollAdj (gtk_text_view_get_vadjustment(GTK_TEXT_VIEW (widget)), top);
}
gboolean ygtk_html_wrap_search (GtkWidget *widget, const gchar *text)
Modified: branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkhtmlwrap.h Sun Apr 17 01:05:19 2011
@@ -11,7 +11,7 @@
#ifndef YGTK_HTML_WRAP_H
#define YGTK_HTML_WRAP_H
-#include
+#include
G_BEGIN_DECLS
GtkWidget *ygtk_html_wrap_new (void);
Modified: branches/tmp/dmacvicar/gtk/src/ygtkimage.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkimage.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkimage.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkimage.c Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#include
#include "ygdkmngloader.h"
#include "ygtkimage.h"
-#include
+#include
G_DEFINE_TYPE (YGtkImage, ygtk_image, GTK_TYPE_DRAWING_AREA)
@@ -143,8 +143,8 @@
GError *error = 0;
if (anim && ygdk_mng_pixbuf_is_data_mng (data, data_size)) {
GdkPixbufAnimation *pixbuf;
- pixbuf = ygdk_mng_pixbuf_new_from_data (data, data_size, &error);
- ygtk_image_set_animation (image, pixbuf, error ? error->message : "(undefined)");
+ pixbuf = ygdk_mng_pixbuf_new_from_data (data, data_size, &error);
+ ygtk_image_set_animation (image, pixbuf, error ? error->message : "(undefined)");
}
else {
image->animated = anim;
@@ -198,8 +198,8 @@
gtk_icon_source_set_pixbuf (source, pixbuf);
gtk_icon_source_set_size (source, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_icon_source_set_size_wildcarded (source, FALSE);
- rendered = gtk_style_render_icon (widget->style, source,
- gtk_widget_get_direction (widget), GTK_WIDGET_STATE (widget),
+ rendered = gtk_style_render_icon (gtk_widget_get_style(widget), source,
+ gtk_widget_get_direction (widget), gtk_widget_get_state (widget),
/* arbitrary */ (GtkIconSize)-1, widget, "gtk-image");
gtk_icon_source_free (source);
return rendered;
@@ -209,10 +209,15 @@
{
YGtkImage *image = YGTK_IMAGE (widget);
int width, height;
- width = widget->allocation.width;
- height = widget->allocation.height;
+ GtkAllocation alloc;
+ GtkRequisition req;
+ gtk_widget_get_allocation(widget, &alloc);
+ gtk_widget_get_requisition(widget, &req);
+
+ width = alloc.width;
+ height = alloc.height;
- cairo_t *cr = gdk_cairo_create (widget->window);
+ cairo_t *cr = gdk_cairo_create (gtk_widget_get_window(widget));
if (!image->loaded) {
if (image->alt_text) {
@@ -221,8 +226,9 @@
layout = gtk_widget_create_pango_layout (widget, image->alt_text);
int x, y;
- x = (width - widget->requisition.width) / 2;
- y = (height - widget->requisition.height) / 2;
+
+ x = (width - req.width) / 2;
+ y = (height - req.height) / 2;
cairo_move_to (cr, x, y);
pango_cairo_show_layout (cr, layout);
@@ -239,13 +245,13 @@
else
pixbuf = image->pixbuf;
- gboolean needs_transform = GTK_WIDGET_STATE (widget) != GTK_STATE_NORMAL;
+ gboolean needs_transform = gtk_widget_get_state (widget) != GTK_STATE_NORMAL;
if (needs_transform)
pixbuf = ygtk_image_render_state (widget, pixbuf);
int x = 0, y = 0;
if (image->align == CENTER_IMAGE_ALIGN) {
- x = (width - widget->requisition.width) / 2;
- y = (height - widget->requisition.height) / 2;
+ x = (width - req.width) / 2;
+ y = (height - req.height) / 2;
}
gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
Modified: branches/tmp/dmacvicar/gtk/src/ygtkimage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkimage.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkimage.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkimage.h Sun Apr 17 01:05:19 2011
@@ -10,8 +10,8 @@
#ifndef YGTK_IMAGE_H
#define YGTK_IMAGE_H
-#include
-#include
+#include
+#include
G_BEGIN_DECLS
@@ -68,7 +68,7 @@
void ygtk_image_set_from_pixbuf (YGtkImage *image, GdkPixbuf *pixbuf);
void ygtk_image_set_props (YGtkImage *image, YGtkImageAlign align, const gchar *alt_text);
-// as we don't have a window,
+// as we don't have a window,
G_END_DECLS
Modified: branches/tmp/dmacvicar/gtk/src/ygtklinklabel.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtklinklabel.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtklinklabel.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtklinklabel.c Sun Apr 17 01:05:19 2011
@@ -16,17 +16,19 @@
static void ygtk_link_label_init (YGtkLinkLabel *label)
{
- GTK_WIDGET_SET_FLAGS (label, GTK_NO_WINDOW);
+ gtk_widget_set_has_window(GTK_WIDGET(label), FALSE);
}
static void ygtk_link_label_realize (GtkWidget *widget)
{
GTK_WIDGET_CLASS (ygtk_link_label_parent_class)->realize (widget);
GdkWindowAttr attributes;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+ attributes.x = alloc.x;
+ attributes.y = alloc.y;
+ attributes.width = alloc.width;
+ attributes.height = alloc.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = gtk_widget_get_events (widget) |
@@ -36,10 +38,13 @@
gtk_widget_get_display (widget), GDK_HAND2);
YGtkLinkLabel *label = YGTK_LINK_LABEL (widget);
- label->link_window = gdk_window_new (widget->window, &attributes, attributes_mask);
+ label->link_window = gdk_window_new (gtk_widget_get_window(widget), &attributes, attributes_mask);
gdk_window_set_user_data (label->link_window, widget);
GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
- gdk_rgb_find_color (gtk_widget_get_colormap (widget), &white);
+
+ if (!gdk_colormap_alloc_color (gtk_widget_get_colormap (widget),
+ &white, FALSE, TRUE))
+ return;
gdk_window_set_background (label->link_window, &white);
gdk_cursor_unref (attributes.cursor);
}
@@ -114,7 +119,7 @@
PangoFontMetrics *metrics;
gint ascent, descent;
context = pango_layout_get_context (label->layout);
- metrics = pango_context_get_metrics (context, widget->style->font_desc,
+ metrics = pango_context_get_metrics (context, gtk_widget_get_style(widget)->font_desc,
pango_context_get_language (context));
ascent = pango_font_metrics_get_ascent (metrics);
descent = pango_font_metrics_get_descent (metrics);
@@ -165,21 +170,23 @@
gint x = 0, y = 0;
PangoLayout *layout = 0;
- if (event->window == widget->window) {
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+ if (event->window == gtk_widget_get_window(widget)) {
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) {
PangoRectangle extent;
pango_layout_get_extents (label->layout, NULL, &extent);
- x = widget->allocation.width - extent.width/PANGO_SCALE;
+ x = alloc.width - extent.width/PANGO_SCALE;
}
- x += widget->allocation.x;
- y += widget->allocation.y;
+ x += alloc.x;
+ y += alloc.y;
layout = label->layout;
}
else if (event->window == label->link_window)
layout = label->link_layout;
if (layout)
- gtk_paint_layout (widget->style, event->window, GTK_WIDGET_STATE (widget),
+ gtk_paint_layout (gtk_widget_get_style(widget), event->window, gtk_widget_get_state (widget),
FALSE, &event->area, widget, "label", x, y, layout);
return FALSE;
}
Modified: branches/tmp/dmacvicar/gtk/src/ygtklinklabel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtklinklabel.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtklinklabel.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtklinklabel.h Sun Apr 17 01:05:19 2011
@@ -12,7 +12,7 @@
#ifndef YGTK_LINK_LABEL_H
#define YGTK_LINK_LABEL_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_LINK_LABEL (ygtk_link_label_get_type ())
Modified: branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.c Sun Apr 17 01:05:19 2011
@@ -54,7 +54,7 @@
while (child) {
if (child == widget)
return FALSE;
- child = child->parent;
+ child = gtk_widget_get_parent(child);
}
gtk_widget_hide (widget);
return TRUE;
@@ -88,7 +88,7 @@
*y = monitor.y;
else if (*y + req.height > monitor.y + monitor.height)
*y = monitor.y + monitor.height - req.height;
-}
+}
void ygtk_popup_window_popup (GtkWidget *widget, gint x, gint y, guint activate_time)
{
@@ -100,10 +100,10 @@
gtk_widget_show (widget);
// grab this with your teeth
- if (gdk_pointer_grab (widget->window, TRUE,
+ if (gdk_pointer_grab (gtk_widget_get_window(widget), TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
NULL, NULL, activate_time) == 0)
- if (gdk_keyboard_grab (widget->window, TRUE, activate_time) != 0)
+ if (gdk_keyboard_grab (gtk_widget_get_window(widget), TRUE, activate_time) != 0)
gdk_pointer_ungrab (activate_time);
}
@@ -143,26 +143,27 @@
static void ygtk_menu_button_get_popup_pos (YGtkMenuButton *button, gint *x, gint *y)
{
GtkWidget *widget = GTK_WIDGET (button);
- GtkAllocation *button_alloc = &widget->allocation;
+ GtkAllocation button_alloc;
+ gtk_widget_get_allocation(widget, &button_alloc);
// the popup would look awful if smaller than the button
GtkRequisition req;
gtk_widget_size_request (button->popup, &req);
int popup_width = req.width, popup_height = req.height;
- if (button_alloc->width > req.width) {
- gtk_widget_set_size_request (button->popup, button_alloc->width, -1);
- popup_width = button_alloc->width;
+ if (button_alloc.width > req.width) {
+ gtk_widget_set_size_request (button->popup, button_alloc.width, -1);
+ popup_width = button_alloc.width;
}
- gdk_window_get_origin (widget->window, x, y);
- *x += button_alloc->x - popup_width*button->xalign;
- *y += (button_alloc->y-popup_height) + (button_alloc->height+popup_height)*button->yalign;
+ gdk_window_get_origin (gtk_widget_get_window(widget), x, y);
+ *x += button_alloc.x - popup_width*button->xalign;
+ *y += (button_alloc.y-popup_height) + (button_alloc.height+popup_height)*button->yalign;
// GTK doesn't push up menus if they are near the bottom, but we will...
int screen_height;
screen_height = gdk_screen_get_height (gtk_widget_get_screen (widget));
if (*y > screen_height - popup_height)
- *y -= popup_height + button_alloc->height;
+ *y -= popup_height + button_alloc.height;
}
static void ygtk_menu_button_get_menu_pos (GtkMenu *menu, gint *x, gint *y,
Modified: branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkmenubutton.h Sun Apr 17 01:05:19 2011
@@ -11,7 +11,7 @@
#ifndef YGTK_POPUP_WINDOW_H
#define YGTK_POPUP_WINDOW_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_POPUP_WINDOW (ygtk_popup_window_get_type ())
@@ -48,8 +48,6 @@
#ifndef YGTK_MENU_BUTTON_H
#define YGTK_MENU_BUTTON_H
-#include
-#include
G_BEGIN_DECLS
#define YGTK_TYPE_MENU_BUTTON (ygtk_menu_button_get_type ())
Modified: branches/tmp/dmacvicar/gtk/src/ygtkratiobox.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkratiobox.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkratiobox.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkratiobox.c Sun Apr 17 01:05:19 2011
@@ -13,7 +13,7 @@
static void ygtk_ratio_box_init (YGtkRatioBox *box)
{
- GTK_WIDGET_SET_FLAGS (box, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET(box), FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (box), FALSE);
}
@@ -61,7 +61,7 @@
for (child = box->children; child; child = child->next) {
YGtkRatioBoxChild *box_child = (YGtkRatioBoxChild*) child->data;
if (box_child->widget == widget) {
- gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+ gboolean was_visible = gtk_widget_get_visible (widget);
gtk_widget_unparent (widget);
box->children = g_list_remove_link (box->children, child);
@@ -105,7 +105,7 @@
GList *i;
for (i = box->children; i; i = i->next) {
YGtkRatioBoxChild* child = i->data;
- if (!GTK_WIDGET_VISIBLE (child->widget))
+ if (!gtk_widget_get_visible (child->widget))
continue;
GtkRequisition child_req;
@@ -122,7 +122,7 @@
else
requisition->height += spacing;
- int border = GTK_CONTAINER (box)->border_width;
+ int border = gtk_container_get_border_width(GTK_CONTAINER (box));
requisition->width += border*2;
requisition->height += border*2;
}
@@ -139,7 +139,7 @@
GList* i;
for (i = box->children; i; i = i->next) {
YGtkRatioBoxChild* child = i->data;
- if (!GTK_WIDGET_VISIBLE (child->widget))
+ if (!gtk_widget_get_visible (child->widget))
continue;
ratios_sum += child->ratio;
@@ -148,7 +148,7 @@
gint spacing = children_nb ? box->spacing*(children_nb-1) : 0;
- int border = GTK_CONTAINER (box)->border_width;
+ int border = gtk_container_get_border_width(GTK_CONTAINER (box));
int x = allocation->x + border, y = allocation->y + border,
width = allocation->width - border*2, height = allocation->height - border*2;
@@ -161,7 +161,7 @@
for (i = box->children; i; i = i->next) {
YGtkRatioBoxChild* child = i->data;
- if (!GTK_WIDGET_VISIBLE (child->widget))
+ if (!gtk_widget_get_visible (child->widget))
continue;
GtkRequisition child_req;
@@ -199,7 +199,7 @@
if (child_info) {
gtk_widget_freeze_child_notify (child);
child_info->ratio = ratio;
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
+ if (gtk_widget_get_visible (child) && gtk_widget_get_visible (box))
gtk_widget_queue_resize (child);
gtk_widget_thaw_child_notify (child);
@@ -290,18 +290,18 @@
static void ygtk_adj_size_init (YGtkAdjSize *adj_size)
{
- GTK_WIDGET_SET_FLAGS (adj_size, GTK_NO_WINDOW);
+ gtk_widget_set_has_window(GTK_WIDGET(adj_size), FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (adj_size), FALSE);
}
static void ygtk_adj_size_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
- GtkWidget *child = GTK_BIN (widget)->child;
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN (widget));
requisition->width = requisition->height = 0;
- if (child && GTK_WIDGET_VISIBLE (child)) {
+ if (child && gtk_widget_get_visible((child))) {
gtk_widget_size_request (child, requisition);
- guint border = GTK_CONTAINER (widget)->border_width;
+ guint border = gtk_container_get_border_width(GTK_CONTAINER (widget));
requisition->width += border * 2;
requisition->height += border * 2;
@@ -330,10 +330,10 @@
static void ygtk_adj_size_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- GtkWidget *child = GTK_BIN (widget)->child;
- if (child && GTK_WIDGET_VISIBLE (child)) {
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN (widget));
+ if (child && gtk_widget_get_visible (child)) {
GtkAllocation child_alloc = *allocation;
- guint border = GTK_CONTAINER (widget)->border_width;
+ guint border = gtk_container_get_border_width(GTK_CONTAINER (widget));
child_alloc.x += border;
child_alloc.y += border;
child_alloc.width -= border * 2;
Modified: branches/tmp/dmacvicar/gtk/src/ygtkratiobox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkratiobox.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkratiobox.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkratiobox.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_RATIO_BOX_H
#define YGTK_RATIO_BOX_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_RATIO_BOX (ygtk_ratio_box_get_type ())
@@ -112,7 +112,6 @@
#ifndef YGTK_ADJ_SIZE_H
#define YGTK_ADJ_SIZE_H
-#include
G_BEGIN_DECLS
#define YGTK_TYPE_ADJ_SIZE (ygtk_adj_size_get_type ())
Modified: branches/tmp/dmacvicar/gtk/src/ygtkrichtext.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkrichtext.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkrichtext.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkrichtext.c Sun Apr 17 01:05:19 2011
@@ -165,9 +165,12 @@
{
if (wx == -1) {
GtkWidget *widget = GTK_WIDGET (view);
- gdk_window_get_pointer (widget->window, &wx, &wy, NULL);
- if (wx < 0 || wy < 0 || wx >= widget->allocation.width ||
- wy >= widget->allocation.height)
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+
+ gdk_window_get_pointer (gtk_widget_get_window(widget), &wx, &wy, NULL);
+ if (wx < 0 || wy < 0 || wx >= alloc.width ||
+ wy >= alloc.height)
return;
}
@@ -195,6 +198,8 @@
{
GtkTextView *text = GTK_TEXT_VIEW (widget);
YGtkRichText *rtext = YGTK_RICH_TEXT (widget);
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
if (rtext->background_pixbuf) {
GdkWindow *window = gtk_text_view_get_window (text, GTK_TEXT_WINDOW_TEXT);
if (event->window == window) {
@@ -202,8 +207,8 @@
int width = gdk_pixbuf_get_width (rtext->background_pixbuf);
int height = gdk_pixbuf_get_height (rtext->background_pixbuf);
gtk_text_view_buffer_to_window_coords (text, GTK_TEXT_WINDOW_TEXT,
- widget->allocation.width-((2*width)/5), -height/3, &x, &y);
- gdk_draw_pixbuf (GDK_DRAWABLE (window), *widget->style->fg_gc, rtext->background_pixbuf,
+ alloc.width-((2*width)/5), -height/3, &x, &y);
+ gdk_draw_pixbuf (GDK_DRAWABLE (window), *gtk_widget_get_style(widget)->fg_gc, rtext->background_pixbuf,
0, 0, x, y, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
}
}
Modified: branches/tmp/dmacvicar/gtk/src/ygtksteps.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtksteps.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtksteps.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtksteps.c Sun Apr 17 01:05:19 2011
@@ -92,6 +92,9 @@
int n = 0;
for (i = children; i; i = i->next, n++) {
GtkWidget *label = i->data;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(label, &alloc);
+
if (g_object_get_data (G_OBJECT (label), "is-header"))
continue;
PangoLayout *layout;
@@ -101,11 +104,11 @@
layout = steps->current_mark_layout;
else //if (n > steps->current_step)
layout = steps->todo_mark_layout;
- int x = label->allocation.x, y = label->allocation.y;
+ int x = alloc.x, y = alloc.y;
if (reverse) {
PangoRectangle rect;
pango_layout_get_pixel_extents (layout, NULL, &rect);
- x += label->allocation.width - rect.width - 4;
+ x += alloc.width - rect.width - 4;
}
else
x += 4;
Modified: branches/tmp/dmacvicar/gtk/src/ygtksteps.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtksteps.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtksteps.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtksteps.h Sun Apr 17 01:05:19 2011
@@ -18,7 +18,7 @@
#ifndef YGTK_STEPS_H
#define YGTK_STEPS_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_STEPS (ygtk_steps_get_type ())
@@ -42,7 +42,7 @@
PangoLayout *check_mark_layout, *current_mark_layout, *todo_mark_layout;
// for current_mark little animation
guint current_mark_timeout_id, current_mark_frame;
-
+
} YGtkSteps;
typedef struct _YGtkStepsClass
Modified: branches/tmp/dmacvicar/gtk/src/ygtktextview.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtktextview.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtktextview.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtktextview.h Sun Apr 17 01:05:19 2011
@@ -9,7 +9,7 @@
#ifndef YGTK_TEXT_VIEW_H
#define YGTK_TEXT_VIEW_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_TEXT_VIEW (ygtk_text_view_get_type ())
Modified: branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.c Sun Apr 17 01:05:19 2011
@@ -72,7 +72,7 @@
gint *map_x, gint *map_y)
{
int win_width, win_height;
- gdk_window_get_size (picker->map_window, &win_width, &win_height);
+ gdk_drawable_get_size (picker->map_window, &win_width, &win_height);
*map_x = ((win_x - win_width/2) / picker->scale) + picker->map_x;
*map_y = ((win_y - win_height/2) / picker->scale) + picker->map_y;
@@ -82,7 +82,7 @@
gint *win_x, gint *win_y)
{
int win_width, win_height;
- gdk_window_get_size (picker->map_window, &win_width, &win_height);
+ gdk_drawable_get_size (picker->map_window, &win_width, &win_height);
*win_x = ((map_x - picker->map_x) * picker->scale) + win_width/2;
*win_y = ((map_y - picker->map_y) * picker->scale) + win_height/2;
@@ -244,7 +244,7 @@
static void ygtk_time_zone_picker_init (YGtkTimeZonePicker *picker)
{
- GTK_WIDGET_SET_FLAGS (picker, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET(picker), FALSE);
}
static void ygtk_time_zone_picker_destroy (GtkObject *object)
@@ -277,11 +277,14 @@
YGtkTimeZonePicker *picker = YGTK_TIME_ZONE_PICKER (widget);
GdkWindowAttr attributes;
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(widget, &alloc);
+
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ attributes.x = alloc.x;
+ attributes.y = alloc.y;
+ attributes.width = alloc.width;
+ attributes.height = alloc.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |=
@@ -289,10 +292,10 @@
| GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
gint attributes_mask;
attributes_mask = GDK_WA_X | GDK_WA_Y;
- picker->map_window = gdk_window_new (widget->window,
+ picker->map_window = gdk_window_new (gtk_widget_get_window(widget),
&attributes, attributes_mask);
gdk_window_set_user_data (picker->map_window, widget);
- gtk_style_set_background (widget->style, picker->map_window, GTK_STATE_NORMAL);
+ gtk_style_set_background (gtk_widget_get_style(widget), picker->map_window, GTK_STATE_NORMAL);
ygtk_time_zone_picker_closeup (picker, FALSE, 0, 0, FALSE);
}
@@ -410,7 +413,7 @@
static void ygtk_time_zone_picker_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- if (!GTK_WIDGET_REALIZED (widget))
+ if (!gtk_widget_get_realized (widget))
return;
YGtkTimeZonePicker *picker = YGTK_TIME_ZONE_PICKER (widget);
int win_width = allocation->width, win_height = allocation->height;
@@ -452,7 +455,7 @@
cairo_t *cr = gdk_cairo_create (event->window);
int width, height;
- gdk_window_get_size (event->window, &width, &height);
+ gdk_drawable_get_size (event->window, &width, &height);
if (!picker->map_pixbuf) {
// show alt text if no image was loaded
@@ -538,7 +541,7 @@
cleanup:
cairo_destroy (cr);
- gtk_paint_shadow (widget->style, event->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (gtk_widget_get_style(widget), event->window, GTK_STATE_NORMAL,
GTK_SHADOW_IN, &event->area, widget, "frame", 0, 0, width, height);
return TRUE;
}
Modified: branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtktimezonepicker.h Sun Apr 17 01:05:19 2011
@@ -10,7 +10,7 @@
#ifndef YGTK_TIME_ZONE_PICKER_H
#define YGTK_TIME_ZONE_PICKER_H
-#include
+#include
#include
G_BEGIN_DECLS
Modified: branches/tmp/dmacvicar/gtk/src/ygtktreeview.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtktreeview.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtktreeview.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtktreeview.c Sun Apr 17 01:05:19 2011
@@ -113,7 +113,7 @@
gtk_tree_view_convert_bin_window_to_widget_coords (
view, _popup_x, _popup_y, &_popup_x, &_popup_y);
gint x_orig, y_orig;
- gdk_window_get_origin (widget->window, &x_orig, &y_orig);
+ gdk_window_get_origin (gtk_widget_get_window(widget), &x_orig, &y_orig);
_popup_x += x_orig; _popup_y += y_orig;
g_signal_emit (widget, right_click_signal, 0, outreach);
@@ -144,9 +144,11 @@
int width, height;
pango_layout_get_pixel_size (layout, &width, &height);
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(widget, &allocation);
int x, y;
- x = (widget->allocation.width - width) / 2;
- y = (widget->allocation.height - height) / 2;
+ x = (allocation.width - width) / 2;
+ y = (allocation.height - height) / 2;
cairo_move_to (cr, x, y);
pango_cairo_show_layout (cr, layout);
@@ -299,6 +301,6 @@
right_click_signal = g_signal_new ("right-click",
G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (YGtkTreeViewClass, right_click),
- NULL, NULL, gtk_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+ NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}
Modified: branches/tmp/dmacvicar/gtk/src/ygtktreeview.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtktreeview.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtktreeview.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtktreeview.h Sun Apr 17 01:05:19 2011
@@ -8,7 +8,7 @@
#ifndef YGTK_TREE_VIEW_H
#define YGTK_TREE_VIEW_H
-#include
+#include
G_BEGIN_DECLS
#define YGTK_TYPE_TREE_VIEW (ygtk_tree_view_get_type ())
Modified: branches/tmp/dmacvicar/gtk/src/ygtkwizard.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkwizard.c?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkwizard.c (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkwizard.c Sun Apr 17 01:05:19 2011
@@ -149,7 +149,7 @@
G_CALLBACK (search_entry_activated_cb), dialog);
dialog->close_button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
- GTK_WIDGET_SET_FLAGS (dialog->close_button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default(dialog->close_button, TRUE);
GtkWidget *close_box = gtk_hbutton_box_new();
gtk_container_add (GTK_CONTAINER (close_box), dialog->close_button);
@@ -323,7 +323,7 @@
#else
if (help->text)
g_free (help->text);
- help->text = g_strdup (text);
+ help->text = g_strdup (text);
#endif
if (help->dialog)
ygtk_help_text_sync (help, NULL);
@@ -584,7 +584,7 @@
static GtkWidget *button_new (YGtkWizard *wizard)
{
GtkWidget *button = gtk_button_new_with_mnemonic ("");
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default(button, TRUE);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (button_clicked_cb), wizard);
return button;
@@ -647,7 +647,7 @@
GSList *buttons = gtk_size_group_get_widgets (group), *i;
int max_width = 0, total = 0;
for (i = buttons; i; i = i->next) {
- if (!GTK_WIDGET_VISIBLE (i->data))
+ if (!gtk_widget_get_visible (i->data))
continue;
GtkRequisition req;
gtk_widget_get_child_requisition ((GtkWidget *) i->data, &req);
Modified: branches/tmp/dmacvicar/gtk/src/ygtkwizard.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/gtk/src/ygtkwizard.h?rev=63804&r1=63803&r2=63804&view=diff
==============================================================================
--- branches/tmp/dmacvicar/gtk/src/ygtkwizard.h (original)
+++ branches/tmp/dmacvicar/gtk/src/ygtkwizard.h Sun Apr 17 01:05:19 2011
@@ -11,8 +11,8 @@
#define YGTK_WIZARD_H
#include
-#include
-#include
+#include
+
G_BEGIN_DECLS
// test feature: history on help dialog
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org