gimp/app/devices.h
Michael Natterer 14098dc0eb Made --no-interface not calling gtk_init() (and thus not contacting the X
2001-11-17  Michael Natterer  <mitch@gimp.org>

	Made --no-interface not calling gtk_init() (and thus not
	contacting the X server) any more. (Fixes #58961).

	* app/core/gimp.[ch]: added two new function pointers
	"gui_main_loop_func" and "gui_main_loop_quit_func" and an own
	stack of GMainLoops which is used if they are not set.

	* app/gui/gui.[ch]: added main loop functions here and set them as
	pointers in the Gimp instance. Separated gui_libs_init() from
	gui_themes_init() so it can be used as replacement for gtk_init()
	and be called before command line parsing.

	* app/main.c: check for "--no-interface" before initializing
	anything. Added a "--g-fatal-warnings" option (cut'n'paste from
	gtkmain.c). Added a check for "--" (end of options).

	* app/app_procs.c: call the new gimp_main_loop() functions,
	call gui_themes_init().

	* app/devices.[ch]: reduce usage of "the_gimp" by passing "Gimp"
	pointers to some functions.

	* app/plug_in.c: some ugly checks for the_gimp->no_interface which
	will go away once this file is core/ui chopped. Call
	gimp_main_loop() stuff instead of gtk_main().

	* app/core/gimptoolinfo.c: allow passing a NUL GdkPixbuf pointer.
2001-11-17 16:32:34 +00:00

80 lines
2.3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __DEVICES_H__
#define __DEVICES_H__
typedef enum
{
DEVICE_MODE = 1 << 0,
DEVICE_AXES = 1 << 1,
DEVICE_KEYS = 1 << 2,
DEVICE_TOOL = 1 << 3,
DEVICE_FOREGROUND = 1 << 4,
DEVICE_BACKGROUND = 1 << 5,
DEVICE_BRUSH = 1 << 6,
DEVICE_PATTERN = 1 << 7,
DEVICE_GRADIENT = 1 << 8
} DeviceValues;
/* Initialize the input devices */
void devices_init (Gimp *gimp);
/* Restores device settings from rc file */
void devices_restore (Gimp *gimp);
/* Create device info dialog */
GtkWidget * input_dialog_create (void);
/* Create the device status dialog */
GtkWidget * device_status_create (void);
/* Returns TRUE, and makes necessary global changes
* if event is not for current_device
*/
gboolean devices_check_change (GdkEvent *event);
/* Loads stored device settings (tool, cursor, ...) */
void select_device (GdkDevice *device);
/* Add information about one tool from rc file */
void devices_rc_update (gchar *name,
DeviceValues values,
GdkInputMode mode,
gint num_axes,
GdkAxisUse *axes,
gint num_keys,
GdkDeviceKey *keys,
const gchar *tool_name,
GimpRGB *foreground,
GimpRGB *background,
const gchar *brush_name,
const gchar *pattern_name,
const gchar *gradient_name);
/* Free device status (only for session-managment) */
void device_status_free (void);
/* Current device */
extern GdkDevice *current_device;
#endif /* __DEVICES_H__ */