1 /* Sticky Notes
2  * Copyright (C) 2002-2003 Loban A Rahman
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17  * 02110-1301, USA.
18  */
19 
20 #ifndef __STICKYNOTES_H__
21 #define __STICKYNOTES_H__
22 
23 #define WNCK_I_KNOW_THIS_IS_UNSTABLE 1
24 #include <libwnck/libwnck.h>
25 #include <stickynotes_applet.h>
26 
27 #include <gtksourceview/gtksource.h>
28 
29 typedef struct
30 {
31     GtkWidget *w_window;                  /* Sticky Note window */
32     GtkWidget *w_menu;                    /* Sticky Note menu */
33     GtkWidget *w_properties;              /* Sticky Note properties dialog */
34 
35     GtkWidget *w_entry;                   /* Sticky Note title entry */
36     GtkWidget *w_color;                   /* Sticky Note color picker */
37     GtkWidget *w_color_label;             /* Sticky Note color label */
38     GtkWidget *w_font_color;              /* Sticky Note font color picker */
39     GtkWidget *w_font_color_label;        /* Sticky Note font color label */
40     GtkWidget *w_font;                    /* Sticky Note font picker */
41     GtkWidget *w_font_label;              /* Sticky Note font label */
42     GtkWidget *w_def_color;               /* Sticky Note default color setting */
43     GtkWidget *w_def_font;                /* Sticky Note default font setting */
44 
45     GtkWidget *w_title;                   /* Sticky Note title */
46     GtkWidget *w_body;                    /* Sticky Note text body */
47     GtkWidget *w_scroller;                /* Sticky Note scroller */
48     GtkWidget *w_lock;                    /* Sticky Note lock button */
49     GtkWidget *w_close;                   /* Sticky Note close button */
50     GtkWidget *w_resize_se;               /* Sticky Note resize button (south east) */
51     GtkWidget *w_resize_sw;               /* Sticky Note resize button (south west) */
52 
53     GtkSourceBuffer *buffer;              /* Sticky Note text buffer for undo/redo */
54 
55     GtkToggleAction *ta_lock_toggle_item; /* Lock item in the popup menu */
56 
57     GtkImage *img_lock;                   /* Lock image */
58     GtkImage *img_close;                  /* Close image */
59     GtkImage *img_resize_se;              /* SE resize image */
60     GtkImage *img_resize_sw;              /* SW resize image */
61 
62     gchar *color;                         /* Note color */
63     gchar *font_color;                    /* Font color */
64     gchar *font;                          /* Note font */
65     gboolean locked;                      /* Note locked state */
66 
67     gint x;                               /* Note x-coordinate */
68     gint y;                               /* Note y-coordinate */
69     gint w;                               /* Note width */
70     gint h;                               /* Note height */
71 
72     int workspace;                        /* Workspace the note is on */
73 
74 } StickyNote;
75 
76 StickyNote * stickynote_new (GdkScreen *screen);
77 void stickynote_free (StickyNote *note);
78 
79 gboolean stickynote_get_empty (const StickyNote *note);
80 
81 void stickynote_set_title (StickyNote  *note,
82                            const gchar *title);
83 void stickynote_set_color (StickyNote  *note,
84                            const gchar *color_str,
85                            const gchar *font_color_str,
86                            gboolean     save);
87 void stickynote_set_font (StickyNote  *note,
88                           const gchar *font_str,
89                           gboolean     save);
90 void stickynote_set_locked (StickyNote *note,
91                             gboolean    locked);
92 void stickynote_set_visible (StickyNote *note,
93                              gboolean    visible);
94 
95 void stickynote_change_properties (StickyNote *note);
96 
97 void stickynotes_add (GdkScreen *screen);
98 void stickynotes_remove (StickyNote *note);
99 void stickynotes_save (void);
100 gboolean stickynotes_save_now (void);
101 void stickynotes_load (GdkScreen *screen);
102 
103 #endif /* __STICKYNOTES_H__ */
104