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:
Benjamin Otte 2013-02-01 17:38:08 +01:00
parent a6bf34e292
commit ad69528bde
17 changed files with 0 additions and 87 deletions

View File

@ -93,7 +93,6 @@ demos.h: @REBUILD@ $(demos) geninclude.pl
gtk3_demo_SOURCES = \
$(demos) \
demo-common.h \
demo_resources.c \
main.c \
demos.h

View File

@ -7,7 +7,6 @@
#include <gtk/gtk.h>
#include "config.h"
#include "demo-common.h"
static GtkWidget *window = NULL;
static GtkWidget *infobar = NULL;

View File

@ -6,7 +6,6 @@
*/
#include <gtk/gtk.h>
#include "demo-common.h"
static GtkWidget *assistant = NULL;
static GtkWidget *progress_bar = NULL;

View File

@ -4,7 +4,6 @@
*/
#include <gtk/gtk.h>
#include "demo-common.h"
static GtkBuilder *builder;

View File

@ -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

View File

@ -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__ */

View File

@ -7,7 +7,6 @@
#include <gtk/gtk.h>
#include <string.h>
#include "demo-common.h"
static GtkWidget *window = NULL;

View File

@ -7,7 +7,6 @@
#include <gtk/gtk.h>
#include <string.h>
#include "demo-common.h"
static GtkWidget *window = NULL;

View File

@ -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;

View File

@ -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)
{

View File

@ -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"

View File

@ -7,7 +7,6 @@
#include <math.h>
#include <gtk/gtk.h>
#include "demo-common.h"
/* In points */
#define HEADER_HEIGHT (10*72/25.4)

View File

@ -6,7 +6,6 @@
*/
#include <gtk/gtk.h>
#include "demo-common.h"
/* Scroll to the end of the buffer.
*/

View File

@ -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

View File

@ -10,7 +10,6 @@
*/
#include <gtk/gtk.h>
#include "demo-common.h"
static GtkWidget *window = NULL;

View File

@ -9,7 +9,6 @@
*/
#include <gtk/gtk.h>
#include "demo-common.h"
static GtkWidget *window = NULL;

View File

@ -7,7 +7,6 @@
#include <string.h>
#include <gtk/gtk.h>
#include "config.h"
#include "demo-common.h"
static GtkWidget *window = NULL;