gimp/plug-ins/dbbrowser/dbbrowser_utils.h
Tor Lillqvist 0457d6914a New file.
* plug-ins/makefile.msc: New file.

	* plug-ins/*/*.c (Well, not really all files, but many):
 	Portability fixes. Include config.h, and guard inclusion of POSIX
 	and Unix headers like <unistd.h>, <dirent.h> and
 	<sys/time.h>. Include <string.h> if functions from it are
 	used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(),
 	thus no need to include <netinet/in.h>. Include <io.h> on Win32
 	when using open/read/write (which actually are defined as
 	_open/_read/_write by glib.h). Define S_* macros if necessary on
 	Win32. Define rint() and M_PI if necessary (these definitions
 	should be factored out somewhere, no sense repeating them in lots
 	of files). Open files in binary mode when needed.

	* plug-ins/FractalExplorer/FractalExplorer.c: Use
 	g_malloc()/g_free(). Use g_strdup_printf().

  	* plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>.

	* plug-ins/destripe/destripe.c: Guard use of SIGBUS.

	* plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for
 	NULL returns from g_malloc() and g_new() as they abort on failure.
	Use g_strdup_printf().

	* plug-ins/gz/gz.c: Win32 version of running the subprocess.

	* plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for
 	non-Unix (OS/2 and Win32), for instance HAVE_MMAP.

	* plug-ins/script-fu/interp_slib.c: Win32 version of myruntime().

	* plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh).

	* plug-ins/script-fu/script-fu-console.c: Bypass on Win32.

	* plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use
 	g_strdup_printf() instead of separate malloc() and sprintf(). Use
 	g_strescape() for strings being passed to Scheme. Some Win32-only
 	stuff.
1999-05-29 01:28:24 +00:00

118 lines
2.8 KiB
C

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
dbbrowser_utils.h
0.08 26th sept 97 by Thomas NOEL <thomas@minet.net>
*/
/* configuration */
#define DBL_LIST_WIDTH 220
#define DBL_WIDTH DBL_LIST_WIDTH+400
#define DBL_HEIGHT 250
/* end of configuration */
#include <stdlib.h>
#include <string.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#include "dbbrowser.h"
typedef struct {
gchar *label;
gchar *func;
} ListEntry_t;
typedef struct {
GtkWidget* dlg;
GtkWidget* search_entry;
GtkWidget* name_button;
GtkWidget* blurb_button;
GtkWidget* descr_scroll;
GtkWidget* descr_table;
GtkWidget* clist;
GtkWidget* scrolled_win;
/* the currently selected procedure */
gchar *selected_proc_name;
gchar *selected_scheme_proc_name;
gchar *selected_proc_blurb;
gchar *selected_proc_help;
gchar *selected_proc_author;
gchar *selected_proc_copyright;
gchar *selected_proc_date;
int selected_proc_type;
int selected_nparams;
int selected_nreturn_vals;
GParamDef *selected_params;
GParamDef *selected_return_vals;
void (*apply_callback) ( gchar *selected_proc_name,
gchar *selected_scheme_proc_name,
gchar *selected_proc_blurb,
gchar *selected_proc_help,
gchar *selected_proc_author,
gchar *selected_proc_copyright,
gchar *selected_proc_date,
int selected_proc_type,
int selected_nparams,
int selected_nreturn_vals,
GParamDef *selected_params,
GParamDef *selected_return_vals );
} dbbrowser_t;
/* local functions */
static void
dialog_apply_callback(GtkWidget *, gpointer );
static gint
procedure_select_callback (GtkWidget *widget,
gint row,
gint column,
GdkEventButton * bevent,
gpointer data);
static void
dialog_search_callback(GtkWidget *,
gpointer);
static void
dialog_select(dbbrowser_t *dbbrowser,
gchar *proc_name);
static void
dialog_close_callback(GtkWidget *,
gpointer);
static void
convert_string (gchar *str);
static gchar*
GParamType2char(GParamType t);