Skip to content

Commit

Permalink
demos and examples: Ignore deprecations
Browse files Browse the repository at this point in the history
For now, just ignore deprecations. Eventually,
we will have to go through, drop demos that are
for wholly deprecated widgets, and update others.
  • Loading branch information
Matthias Clasen committed Oct 11, 2022
1 parent 5e25659 commit 6efb183
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demos/constraint-editor/constraint-editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "constraint-editor.h"

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

struct _ConstraintEditor
{
GtkWidget parent_instance;
Expand Down
2 changes: 2 additions & 0 deletions demos/constraint-editor/guide-editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "guide-editor.h"

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

struct _GuideEditor
{
GtkWidget parent_instance;
Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/combobox.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

enum
{
ICON_NAME_COL,
Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/editable_cells.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <string.h>
#include <stdlib.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

typedef struct
{
int number;
Expand Down
1 change: 1 addition & 0 deletions demos/gtk-demo/font_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "script-names.h"
#include "language-names.h"

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

#define MAKE_TAG(a,b,c,d) (unsigned int)(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))

Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/fontrendering.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <gtk/gtk.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

static GtkWidget *window = NULL;
static GtkWidget *font_button = NULL;
static GtkWidget *entry = NULL;
Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/iconview.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <gtk/gtk.h>
#include <string.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

static GtkWidget *window = NULL;

#define FOLDER_NAME "/iconview/gnome-fs-directory.png"
Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/iconview_edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <gtk/gtk.h>
#include <string.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

enum
{
COL_TEXT,
Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/sizegroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

/* Convenience function to create a combo box holding a number of strings
*/
GtkWidget *
Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/textview.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <stdlib.h> /* for exit() */
#include "paintable.h"

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

static void easter_egg_callback (GtkWidget *button, gpointer data);

static void
Expand Down
2 changes: 2 additions & 0 deletions demos/gtk-demo/tree_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <gtk/gtk.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

/* TreeItem structure */
typedef struct _TreeItem TreeItem;
struct _TreeItem
Expand Down
12 changes: 12 additions & 0 deletions demos/widget-factory/widget-factory.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ on_record_button_toggled (GtkToggleButton *button,
gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action");
}

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
on_page_combo_changed (GtkComboBox *combo,
gpointer user_data)
Expand Down Expand Up @@ -705,6 +706,7 @@ on_page_combo_changed (GtkComboBox *combo,
default:;
}
}
G_GNUC_END_IGNORE_DEPRECATIONS

static void
on_range_from_changed (GtkSpinButton *from)
Expand Down Expand Up @@ -843,6 +845,7 @@ page_changed_cb (GtkWidget *stack, GParamSpec *pspec, gpointer data)
}
}

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
populate_model (GtkTreeStore *store)
{
Expand Down Expand Up @@ -960,6 +963,7 @@ row_separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)

return is_sep;
}
G_GNUC_END_IGNORE_DEPRECATIONS

static void
update_title_header (GtkListBoxRow *row,
Expand Down Expand Up @@ -1578,6 +1582,7 @@ osd_frame_pressed (GtkGestureClick *gesture,
return GDK_EVENT_STOP;
}

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static gboolean
page_combo_separator_func (GtkTreeModel *model,
GtkTreeIter *iter,
Expand All @@ -1592,6 +1597,7 @@ page_combo_separator_func (GtkTreeModel *model,

return res;
}
G_GNUC_END_IGNORE_DEPRECATIONS

static void
toggle_format (GSimpleAction *action,
Expand Down Expand Up @@ -1844,6 +1850,7 @@ update_buttons (GtkWidget *iv, GtkIconSize size)
gtk_widget_set_sensitive (button, size != GTK_ICON_SIZE_INHERIT);
}

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
increase_icon_size (GtkWidget *iv)
{
Expand Down Expand Up @@ -1894,6 +1901,7 @@ reset_icon_size (GtkWidget *iv)

gtk_widget_queue_resize (iv);
}
G_GNUC_END_IGNORE_DEPRECATIONS

static char *
scale_format_value_blank (GtkScale *scale, double value, gpointer user_data)
Expand Down Expand Up @@ -2270,17 +2278,20 @@ activate (GApplication *app)
g_object_set_data (G_OBJECT (window), "selection_flowbox", widget2);
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (populate_flowbox), widget2);

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
widget = (GtkWidget *)gtk_builder_get_object (builder, "charletree");
populate_model ((GtkTreeStore *)gtk_tree_view_get_model (GTK_TREE_VIEW (widget)));
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (widget), row_separator_func, NULL, NULL);
gtk_tree_view_expand_all (GTK_TREE_VIEW (widget));
G_GNUC_END_IGNORE_DEPRECATIONS

widget = GTK_WIDGET (gtk_builder_get_object (builder, "munsell"));
widget2 = GTK_WIDGET (gtk_builder_get_object (builder, "cchooser"));

populate_colors (widget, widget2);
g_signal_connect (widget2, "notify::rgba", G_CALLBACK (rgba_changed), widget);

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
Expand All @@ -2291,6 +2302,7 @@ activate (GApplication *app)
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
G_GNUC_END_IGNORE_DEPRECATIONS

widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");

Expand Down
2 changes: 2 additions & 0 deletions examples/bp/bloatpad.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <stdlib.h>
#include <gtk/gtk.h>

G_GNUC_BEGIN_IGNORE_DEPRECATIONS

typedef struct
{
GtkApplication parent_instance;
Expand Down

0 comments on commit 6efb183

Please sign in to comment.