API: Remove GtkNumerableIcon
This commit is contained in:
@@ -450,8 +450,6 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/focus.png \
|
||||
$(srcdir)/images/handles.png \
|
||||
$(srcdir)/images/extensions.png \
|
||||
$(srcdir)/images/numerableicon.png \
|
||||
$(srcdir)/images/numerableicon2.png \
|
||||
$(srcdir)/images/bloatpad-osx.png \
|
||||
$(srcdir)/images/bloatpad-gnome.png \
|
||||
$(srcdir)/images/bloatpad-xfce.png \
|
||||
|
||||
@@ -349,7 +349,6 @@
|
||||
<xi:include href="xml/gtkmisc.xml" />
|
||||
<xi:include href="xml/gtkstock.xml" />
|
||||
<xi:include href="xml/gtkiconfactory.xml" />
|
||||
<xi:include href="xml/gtknumerableicon.xml" />
|
||||
<xi:include href="xml/gtkarrow.xml" />
|
||||
<xi:include href="xml/gtkstatusicon.xml" />
|
||||
<xi:include href="xml/gtkthemingengine.xml" />
|
||||
|
||||
@@ -2605,35 +2605,6 @@ GtkNotebookTab
|
||||
GtkNotebookPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtknumerableicon</FILE>
|
||||
<TITLE>GtkNumerableIcon</TITLE>
|
||||
GtkNumerableIcon
|
||||
gtk_numerable_icon_new
|
||||
gtk_numerable_icon_new_with_style_context
|
||||
gtk_numerable_icon_get_background_gicon
|
||||
gtk_numerable_icon_set_background_gicon
|
||||
gtk_numerable_icon_get_background_icon_name
|
||||
gtk_numerable_icon_set_background_icon_name
|
||||
gtk_numerable_icon_get_count
|
||||
gtk_numerable_icon_set_count
|
||||
gtk_numerable_icon_get_label
|
||||
gtk_numerable_icon_set_label
|
||||
gtk_numerable_icon_get_style_context
|
||||
gtk_numerable_icon_set_style_context
|
||||
<SUBSECTION Standard>
|
||||
GTK_NUMERABLE_ICON
|
||||
GTK_IS_NUMERABLE_ICON
|
||||
GTK_TYPE_NUMERABLE_ICON
|
||||
GTK_NUMERABLE_ICON_CLASS
|
||||
GTK_IS_NUMERABLE_ICON_CLASS
|
||||
GTK_NUMERABLE_ICON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkNumerableIconPrivate
|
||||
gtk_numerable_icon_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkoffscreenwindow</FILE>
|
||||
<TITLE>GtkOffscreenWindow</TITLE>
|
||||
|
||||
@@ -129,7 +129,6 @@ gtk_misc_get_type
|
||||
gtk_model_button_get_type
|
||||
gtk_mount_operation_get_type
|
||||
gtk_notebook_get_type
|
||||
gtk_numerable_icon_get_type
|
||||
gtk_offscreen_window_get_type
|
||||
gtk_orientable_get_type
|
||||
gtk_overlay_get_type
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -19,7 +19,6 @@ deprecated_h_sources = \
|
||||
deprecated/gtkiconfactory.h \
|
||||
deprecated/gtkimagemenuitem.h \
|
||||
deprecated/gtkmisc.h \
|
||||
deprecated/gtknumerableicon.h \
|
||||
deprecated/gtkradioaction.h \
|
||||
deprecated/gtkrc.h \
|
||||
deprecated/gtkrecentaction.h \
|
||||
@@ -41,7 +40,6 @@ deprecated_h_sources = \
|
||||
deprecated_private_h_sources = \
|
||||
deprecated/gtkgradientprivate.h \
|
||||
deprecated/gtkiconfactoryprivate.h \
|
||||
deprecated/gtknumerableiconprivate.h \
|
||||
deprecated/gtkstylepropertiesprivate.h \
|
||||
deprecated/gtksymboliccolorprivate.h
|
||||
|
||||
@@ -66,7 +64,6 @@ deprecated_c_sources = \
|
||||
deprecated/gtkiconfactory.c \
|
||||
deprecated/gtkimagemenuitem.c \
|
||||
deprecated/gtkmisc.c \
|
||||
deprecated/gtknumerableicon.c \
|
||||
deprecated/gtkradioaction.c \
|
||||
deprecated/gtkrc.c \
|
||||
deprecated/gtkrecentaction.c \
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* gtknumerableicon.h: an emblemed icon with number emblems
|
||||
*
|
||||
* Copyright (C) 2010 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Authors: Cosimo Cecchi <cosimoc@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __GTK_NUMERABLE_ICON_H__
|
||||
#define __GTK_NUMERABLE_ICON_H__
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <gtk/gtkstylecontext.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_NUMERABLE_ICON (gtk_numerable_icon_get_type ())
|
||||
#define GTK_NUMERABLE_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NUMERABLE_ICON, GtkNumerableIcon))
|
||||
#define GTK_NUMERABLE_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NUMERABLE_ICON, GtkNumerableIconClass))
|
||||
#define GTK_IS_NUMERABLE_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NUMERABLE_ICON))
|
||||
#define GTK_IS_NUMERABLE_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NUMERABLE_ICON))
|
||||
#define GTK_NUMERABLE_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NUMERABLE_ICON, GtkNumerableIconClass))
|
||||
|
||||
typedef struct _GtkNumerableIcon GtkNumerableIcon;
|
||||
typedef struct _GtkNumerableIconClass GtkNumerableIconClass;
|
||||
typedef struct _GtkNumerableIconPrivate GtkNumerableIconPrivate;
|
||||
|
||||
struct _GtkNumerableIcon {
|
||||
GEmblemedIcon parent;
|
||||
|
||||
/*< private >*/
|
||||
GtkNumerableIconPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkNumerableIconClass {
|
||||
GEmblemedIconClass parent_class;
|
||||
|
||||
/* padding for future class expansion */
|
||||
gpointer padding[16];
|
||||
};
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GType gtk_numerable_icon_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GIcon * gtk_numerable_icon_new (GIcon *base_icon);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GIcon * gtk_numerable_icon_new_with_style_context (GIcon *base_icon,
|
||||
GtkStyleContext *context);
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GtkStyleContext * gtk_numerable_icon_get_style_context (GtkNumerableIcon *self);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
void gtk_numerable_icon_set_style_context (GtkNumerableIcon *self,
|
||||
GtkStyleContext *style);
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
gint gtk_numerable_icon_get_count (GtkNumerableIcon *self);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
void gtk_numerable_icon_set_count (GtkNumerableIcon *self,
|
||||
gint count);
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
const gchar * gtk_numerable_icon_get_label (GtkNumerableIcon *self);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
void gtk_numerable_icon_set_label (GtkNumerableIcon *self,
|
||||
const gchar *label);
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
void gtk_numerable_icon_set_background_gicon (GtkNumerableIcon *self,
|
||||
GIcon *icon);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
GIcon * gtk_numerable_icon_get_background_gicon (GtkNumerableIcon *self);
|
||||
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
void gtk_numerable_icon_set_background_icon_name (GtkNumerableIcon *self,
|
||||
const gchar *icon_name);
|
||||
GDK_DEPRECATED_IN_3_14
|
||||
const gchar * gtk_numerable_icon_get_background_icon_name (GtkNumerableIcon *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_NUMERABLE_ICON_H__ */
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* gtknumerableiconprivate.h: private methods for GtkNumerableIcon
|
||||
*
|
||||
* Copyright (C) 2010 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Authors: Cosimo Cecchi <cosimoc@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __GTK_NUMERABLE_ICON_PRIVATE_H__
|
||||
#define __GTK_NUMERABLE_ICON_PRIVATE_H__
|
||||
|
||||
#include "gtknumerableicon.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void _gtk_numerable_icon_set_background_icon_size (GtkNumerableIcon *self,
|
||||
gint icon_size);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_NUMERABLE_ICON_PRIVATE_H__ */
|
||||
@@ -264,7 +264,6 @@
|
||||
#include <gtk/deprecated/gtkiconfactory.h>
|
||||
#include <gtk/deprecated/gtkimagemenuitem.h>
|
||||
#include <gtk/deprecated/gtkmisc.h>
|
||||
#include <gtk/deprecated/gtknumerableicon.h>
|
||||
#include <gtk/deprecated/gtkradioaction.h>
|
||||
#include <gtk/deprecated/gtkrc.h>
|
||||
#include <gtk/deprecated/gtkrecentaction.h>
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include "gtkiconcache.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmain.h"
|
||||
#include "deprecated/gtknumerableiconprivate.h"
|
||||
#include "gtksettingsprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
@@ -5560,11 +5559,6 @@ gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme *icon_theme,
|
||||
GList *list, *l;
|
||||
GtkIconInfo *base_info, *emblem_info;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
if (GTK_IS_NUMERABLE_ICON (icon))
|
||||
_gtk_numerable_icon_set_background_icon_size (GTK_NUMERABLE_ICON (icon), size / 2);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
base = g_emblemed_icon_get_icon (G_EMBLEMED_ICON (icon));
|
||||
base_info = gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme, base, size, scale, flags);
|
||||
if (base_info)
|
||||
|
||||
@@ -251,7 +251,6 @@ gtk_OBJECTS = \
|
||||
gtkmountoperation.obj \
|
||||
gtkmountoperation-stub.obj \
|
||||
gtknotebook.obj \
|
||||
gtknumerableicon.obj \
|
||||
gtkoffscreenwindow.obj \
|
||||
gtkorientable.obj \
|
||||
gtkpagesetup.obj \
|
||||
|
||||
@@ -100,7 +100,6 @@ noinst_PROGRAMS = $(TEST_PROGS) \
|
||||
testmountoperation \
|
||||
testmultidisplay \
|
||||
testnotebookdnd \
|
||||
testnumerableicon \
|
||||
testnouiprint \
|
||||
testoffscreen \
|
||||
testoffscreenwindow \
|
||||
@@ -234,7 +233,6 @@ testmountoperation_DEPENDENCIES = $(TEST_DEPS)
|
||||
testmultidisplay_DEPENDENCIES = $(TEST_DEPS)
|
||||
testnotebookdnd_DEPENDENCIES = $(TEST_DEPS)
|
||||
testnouiprint_DEPENDENCIES = $(TEST_DEPS)
|
||||
testnumerableicon_DEPENDENCIES = $(TEST_DEPS)
|
||||
testoffscreen_DEPENDENCIES = $(TEST_DEPS)
|
||||
testoffscreenwindow_DEPENDENCIES = $(TEST_DEPS)
|
||||
testappchooser_DEPENDENCIES = $(TEST_DEPS)
|
||||
@@ -431,9 +429,6 @@ testiconview_SOURCES = \
|
||||
testiconview_keynav_SOURCES = \
|
||||
testiconview-keynav.c
|
||||
|
||||
testnumerableicon_SOURCES = \
|
||||
testnumerableicon.c
|
||||
|
||||
testrecentchooser_SOURCES = \
|
||||
testrecentchooser.c
|
||||
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
/* testnumerableicon.c
|
||||
* Copyright (C) 2010 Red Hat, Inc.
|
||||
* Authors: Cosimo Cecchi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
typedef struct {
|
||||
GIcon *numerable;
|
||||
GtkWidget *image;
|
||||
gboolean odd;
|
||||
GtkIconSize size;
|
||||
} PackData;
|
||||
|
||||
static void
|
||||
button_clicked_cb (GtkButton *b,
|
||||
gpointer user_data)
|
||||
{
|
||||
PackData *d = user_data;
|
||||
GtkCssProvider *provider;
|
||||
GtkStyleContext *style;
|
||||
GError *error = NULL;
|
||||
gchar *data, *bg_str, *grad1, *grad2;
|
||||
const gchar data_format[] = "GtkNumerableIcon { background-color: %s; color: #000000;"
|
||||
"background-image: -gtk-gradient (linear, 0 0, 1 1, from(%s), to(%s));"
|
||||
"font: Monospace 12;"
|
||||
/* "background-image: url('apple-red.png');" */
|
||||
"}";
|
||||
|
||||
bg_str = g_strdup_printf ("rgb(%d,%d,%d)", g_random_int_range (0, 255), g_random_int_range (0, 255), g_random_int_range (0, 255));
|
||||
grad1 = g_strdup_printf ("rgb(%d,%d,%d)", g_random_int_range (0, 255), g_random_int_range (0, 255), g_random_int_range (0, 255));
|
||||
grad2 = g_strdup_printf ("rgb(%d,%d,%d)", g_random_int_range (0, 255), g_random_int_range (0, 255), g_random_int_range (0, 255));
|
||||
|
||||
data = g_strdup_printf (data_format, bg_str, grad1, grad2);
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, data, -1, &error);
|
||||
|
||||
g_assert (error == NULL);
|
||||
|
||||
style = gtk_widget_get_style_context (d->image);
|
||||
gtk_style_context_add_provider (style, GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
|
||||
if (d->odd) {
|
||||
gtk_numerable_icon_set_background_icon_name (GTK_NUMERABLE_ICON (d->numerable), NULL);
|
||||
gtk_numerable_icon_set_count (GTK_NUMERABLE_ICON (d->numerable), g_random_int_range (-99, 99));
|
||||
} else {
|
||||
gtk_numerable_icon_set_background_icon_name (GTK_NUMERABLE_ICON (d->numerable),
|
||||
"emblem-favorite");
|
||||
gtk_numerable_icon_set_label (GTK_NUMERABLE_ICON (d->numerable), "IVX");
|
||||
}
|
||||
|
||||
gtk_image_set_from_gicon (GTK_IMAGE (d->image), d->numerable, d->size);
|
||||
|
||||
d->odd = !d->odd;
|
||||
|
||||
g_free (data);
|
||||
g_free (bg_str);
|
||||
g_free (grad1);
|
||||
g_free (grad2);
|
||||
|
||||
g_object_unref (provider);
|
||||
}
|
||||
|
||||
static void
|
||||
refresh_cb (GtkWidget *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
PackData *d = user_data;
|
||||
|
||||
gtk_image_set_from_gicon (GTK_IMAGE (d->image), d->numerable, d->size);
|
||||
}
|
||||
|
||||
static void
|
||||
pack_numerable (GtkWidget *parent,
|
||||
GtkIconSize size)
|
||||
{
|
||||
PackData *d;
|
||||
GtkWidget *vbox, *label, *image, *button;
|
||||
gchar *str;
|
||||
GIcon *icon, *numerable;
|
||||
|
||||
d = g_slice_new0 (PackData);
|
||||
|
||||
image = gtk_image_new ();
|
||||
icon = g_themed_icon_new ("system-file-manager");
|
||||
numerable = gtk_numerable_icon_new (icon);
|
||||
|
||||
d->image = image;
|
||||
d->numerable = numerable;
|
||||
d->odd = FALSE;
|
||||
d->size = size;
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_box_pack_start (GTK_BOX (parent), vbox, FALSE, FALSE, 0);
|
||||
|
||||
gtk_numerable_icon_set_count (GTK_NUMERABLE_ICON (numerable), 42);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), image, FALSE, FALSE, 0);
|
||||
gtk_numerable_icon_set_style_context (GTK_NUMERABLE_ICON (numerable),
|
||||
gtk_widget_get_style_context (image));
|
||||
gtk_image_set_from_gicon (GTK_IMAGE (image), numerable, size);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
str = g_strdup_printf ("Numerable icon, hash %u", g_icon_hash (numerable));
|
||||
gtk_label_set_label (GTK_LABEL (label), str);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
button = gtk_button_new_with_label ("Change icon number");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (button_clicked_cb), d);
|
||||
|
||||
button = gtk_button_new_with_label ("Refresh");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (refresh_cb), d);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkWidget *hbox, *toplevel;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
toplevel = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
|
||||
gtk_container_add (GTK_CONTAINER (toplevel), hbox);
|
||||
|
||||
pack_numerable (hbox, GTK_ICON_SIZE_DIALOG);
|
||||
pack_numerable (hbox, GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
gtk_widget_show_all (toplevel);
|
||||
|
||||
g_signal_connect (toplevel, "delete-event",
|
||||
G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user