lwlib-int.h 2.04 KB
Newer Older
1 2
/*
Copyright (C) 1992 Lucid, Inc.
Paul Eggert's avatar
Paul Eggert committed
3
Copyright (C) 2000-2020 Free Software Foundation, Inc.
4 5 6 7 8 9 10 11 12 13 14 15 16 17

This file is part of the Lucid Widget Library.

The Lucid Widget Library 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 1, or (at your option)
any later version.

The Lucid Widget 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 General Public License for more details.

You should have received a copy of the GNU General Public License
18
along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
19 20


Richard M. Stallman's avatar
Richard M. Stallman committed
21 22 23 24 25
#ifndef LWLIB_INTERNAL_H
#define LWLIB_INTERNAL_H

#include "lwlib.h"

26 27
struct widget_xft_data;

Richard M. Stallman's avatar
Richard M. Stallman committed
28 29 30 31 32
typedef struct _widget_instance
{
  Widget		widget;
  Widget		parent;
  Boolean		pop_up_p;
33
#if defined USE_CAIRO || defined HAVE_XFT
34 35
  struct widget_xft_data *xft_data;
#endif
Richard M. Stallman's avatar
Richard M. Stallman committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49
  struct _widget_info*		info;
  struct _widget_instance*	next;
} widget_instance;

typedef struct _widget_info
{
  char*			type;
  char*			name;
  LWLIB_ID		id;
  widget_value*		val;
  Boolean		busy;
  lw_callback		pre_activate_cb;
  lw_callback		selection_cb;
  lw_callback		post_activate_cb;
50
  lw_callback		highlight_cb;
Richard M. Stallman's avatar
Richard M. Stallman committed
51 52 53 54
  struct _widget_instance*	instances;
  struct _widget_info*		next;
} widget_info;

55
typedef Widget (*widget_creation_function) (widget_instance *instance);
Richard M. Stallman's avatar
Richard M. Stallman committed
56 57 58 59 60 61 62 63

typedef struct _widget_creation_entry
{
  char*				type;
  widget_creation_function	function;
} widget_creation_entry;

/* update all other instances of a widget.  Can be used in a callback when
Karl Heuer's avatar
Karl Heuer committed
64
   a widget has been used by the user */
Richard M. Stallman's avatar
Richard M. Stallman committed
65
void
Jan D's avatar
Jan D committed
66
lw_internal_update_other_instances (Widget, XtPointer, XtPointer);
Richard M. Stallman's avatar
Richard M. Stallman committed
67 68 69

/* get the widget_value for a widget in a given instance */
widget_value*
Jan D's avatar
Jan D committed
70
lw_get_widget_value_for_widget (widget_instance *, Widget);
Richard M. Stallman's avatar
Richard M. Stallman committed
71

Jan D's avatar
Jan D committed
72 73
widget_info *lw_get_widget_info (LWLIB_ID);
widget_instance * lw_get_widget_instance (Widget);
Richard M. Stallman's avatar
Richard M. Stallman committed
74

Paul Reilly's avatar
Paul Reilly committed
75
#endif /* LWLIB_INTERNAL_H */