mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
gtk-demo: Remove demo_find_file() function
It's not used anymore. With it, the demo-common.h header is not needed anymore and is removed, too (and all the needless includes).
This commit is contained in:
parent
a6bf34e292
commit
ad69528bde
@ -93,7 +93,6 @@ demos.h: @REBUILD@ $(demos) geninclude.pl
|
||||
|
||||
gtk3_demo_SOURCES = \
|
||||
$(demos) \
|
||||
demo-common.h \
|
||||
demo_resources.c \
|
||||
main.c \
|
||||
demos.h
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkWidget *infobar = NULL;
|
||||
|
@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *assistant = NULL;
|
||||
static GtkWidget *progress_bar = NULL;
|
||||
|
@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkBuilder *builder;
|
||||
|
||||
|
@ -31,7 +31,6 @@
|
||||
#undef GDK_DISABLE_DEPRECATED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* The ChangeDisplayInfo structure corresponds to a toplevel window and
|
||||
* holds pointers to widgets inside the toplevel window along with other
|
||||
|
@ -1,11 +0,0 @@
|
||||
#ifndef __DEMO_COMMON_H__
|
||||
#define __DEMO_COMMON_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
gchar *demo_find_file (const gchar *base,
|
||||
GError **err);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __DEMO_COMMON_H__ */
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <glib/gstdio.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GdkPixbufLoader *pixbuf_loader = NULL;
|
||||
|
@ -32,65 +32,6 @@ struct _CallbackData
|
||||
GtkTreePath *path;
|
||||
};
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
#undef DEMOCODEDIR
|
||||
|
||||
static char *
|
||||
get_democodedir (void)
|
||||
{
|
||||
static char *result = NULL;
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
result = g_win32_get_package_installation_directory_of_module (NULL);
|
||||
if (result == NULL)
|
||||
result = "unknown-location";
|
||||
|
||||
result = g_strconcat (result, "\\share\\gtk-3.0\\demo", NULL);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#define DEMOCODEDIR get_democodedir ()
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* demo_find_file:
|
||||
* @base: base filename
|
||||
* @err: location to store error, or %NULL.
|
||||
*
|
||||
* Looks for @base first in the current directory, then in the
|
||||
* location GTK+ where it will be installed on make install,
|
||||
* returns the first file found.
|
||||
*
|
||||
* Return value: the filename, if found or %NULL
|
||||
*/
|
||||
gchar *
|
||||
demo_find_file (const char *base,
|
||||
GError **err)
|
||||
{
|
||||
g_return_val_if_fail (err == NULL || *err == NULL, NULL);
|
||||
|
||||
if (g_file_test ("gtk-logo-rgb.gif", G_FILE_TEST_EXISTS) &&
|
||||
g_file_test (base, G_FILE_TEST_EXISTS))
|
||||
return g_strdup (base);
|
||||
else
|
||||
{
|
||||
char *filename = g_build_filename (DEMOCODEDIR, base, NULL);
|
||||
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_set_error (err, G_FILE_ERROR, G_FILE_ERROR_NOENT,
|
||||
"Cannot find demo data file \"%s\"", base);
|
||||
g_free (filename);
|
||||
return NULL;
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
window_closed_cb (GtkWidget *window, gpointer data)
|
||||
{
|
||||
|
@ -16,8 +16,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "demo-common.h"
|
||||
|
||||
#define FRAME_DELAY 50
|
||||
|
||||
#define BACKGROUND_NAME "/pixbufs/background.jpg"
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* In points */
|
||||
#define HEADER_HEIGHT (10*72/25.4)
|
||||
|
@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* Scroll to the end of the buffer.
|
||||
*/
|
||||
|
@ -10,8 +10,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h> /* for exit() */
|
||||
|
||||
#include "demo-common.h"
|
||||
|
||||
static void easter_egg_callback (GtkWidget *button, gpointer data);
|
||||
|
||||
static void
|
||||
|
@ -10,7 +10,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user