/*
This source file is part of Scol
For the latest info, see http://www.scolring.org

Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser 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, or go to
http://www.gnu.org/copyleft/lesser.txt

For others informations, please contact us from http://www.scolring.org/
*/


#ifndef __SCOL_GTK_WIDGET_H__
#define __SCOL_GTK_WIDGET_H__

#include "main.h"



#define GTK_WIDGET_PKG_NB               46

extern int scol_gtkWidgetCB (mmachine m);

/* MASKS */
#define SIGNAL_MASK_PROPAGATE   1
#define SIGNAL_MASK_STOP        2


/* SIGNALS */
#define WIDGET_BUTTONPRESSED      1    /* mousse button has been pressed */
#define WIDGET_BUTTONRELEASED     2   /* mousse button has been released */
#define WIDGET_MOVERESIZE          3   /* size and/or position changed */
#define WIDGET_DESTROY             4   /* destroy a widget */
#define WIDGET_ENTERLEAVE          5   /* the pointer enters or leaves a widget */
#define WIDGET_KEYB_FOCUS          6   /* the keybord gains or lost the focus on a widget */
#define WIDGET_HIDE                7   /* a widget is hidden */
#define WIDGET_SHOW                8   /* a widget is shown */
#define WIDGET_KEY                 9   /* a key has been pressed or released */
#define WIDGET_MOTION              10  /* the pointer moves over a widget */
#define WIDGET_SCROLL              11  /* whell mice turns or is pressed */
#define WIDGET_VALUE_CHANGED       12   /* Scale, Scrollbar, SpinButton, ... */



#define WINDOW_STATE               100  /* when the state of the toplevel window associated to the widget changes */

#define BUTTON_CLICKED             150  /* a button has been clicked */

#define NOTEBOOK_CHANGE            200 /* the current page of a notebook has changed */

#define TEXTBUFFER_CHANGED          220 /* text buffer has changed */
#define TEXTBUFFER_MODIFIED         221 /* text buffer has been modified */



/* CALLBACKS */
#define OBJ2DGTK_WIDGET_CB_BUTTONPRESSED    1
#define OBJ2DGTK_WIDGET_CB_BUTTONRELEASED   2
#define OBJ2DGTK_WIDGET_CB_MOVERESIZE       3
#define OBJ2DGTK_WIDGET_CB_DESTROY          4
#define OBJ2DGTK_WIDGET_CB_ENTERLEAVE       5
#define OBJ2DGTK_WIDGET_CB_KEYB_FOCUS       6
#define OBJ2DGTK_WIDGET_CB_HIDE             7
#define OBJ2DGTK_WIDGET_CB_SHOW             8
#define OBJ2DGTK_WIDGET_CB_KEY              9
#define OBJ2DGTK_WIDGET_CB_MOTION           10
#define OBJ2DGTK_WIDGET_CB_SCROLL           11
#define OBJ2DGTK_WIDGET_CB_VALUE_CHANGED    12


#define OBJ2DGTK_WINDOW_CB_STATE            100

#define OBJ2DGTK_BUTTON_CB_CLICKED          150

#define OBJ2DGTK_NOTEBOOK_CB_CHANGE         200

#define OBJ2DGTK_TEXTBUFFER_CB_CHANGED      220
#define OBJ2DGTK_TEXTBUFFER_CB_MODIFIED     221


/* EVENTS */
#define EVENT_NOTHING           -2

#define EVENT_BUTTON_PRESSED    1
#define EVENT_BUTTON_PRESSED2    2
#define EVENT_BUTTON_PRESSED3    3
#define EVENT_BUTTON_RELEASE    4

#define EVENT_BUTTON_1         1
#define EVENT_BUTTON_2         2
#define EVENT_BUTTON_3         3
#define EVENT_BUTTON_4         4
#define EVENT_BUTTON_5         5

#define EVENT_KEY_SHIFT        1
#define EVENT_KEY_CONTROL      2
#define EVENT_KEY_ALT          3
#define EVENT_KEY_CAPS         4
#define EVENT_KEY_HYPER        5
#define EVENT_KEY_SUPER        6
#define EVENT_KEY_OTHER        30

#define EVENT_SCROLL_UP        1
#define EVENT_SCROLL_DOWN      2
#define EVENT_SCROLL_LEFT      3
#define EVENT_SCROLL_RIGHT     4
#define EVENT_SCROLL_UNKNOWN   5


#endif  /* __SCOL_GTK_WIDGET_H__ */
