summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes.h
blob: bee35bad5e1895e216395bf929c49c229fc1f466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* Sticky Notes
 * Copyright (C) 2002-2003 Loban A Rahman
 *
 * 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, 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., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

#ifndef __STICKYNOTES_H__
#define __STICKYNOTES_H__

#define WNCK_I_KNOW_THIS_IS_UNSTABLE 1
#include <libwnck/libwnck.h>
#include <stickynotes_applet.h>

#include <gtksourceview/gtksource.h>

typedef struct
{
    GtkWidget *w_window;                  /* Sticky Note window */
    GtkWidget *w_menu;                    /* Sticky Note menu */
    GtkWidget *w_properties;              /* Sticky Note properties dialog */

    GtkWidget *w_entry;                   /* Sticky Note title entry */
    GtkWidget *w_color;                   /* Sticky Note color picker */
    GtkWidget *w_color_label;             /* Sticky Note color label */
    GtkWidget *w_font_color;              /* Sticky Note font color picker */
    GtkWidget *w_font_color_label;        /* Sticky Note font color label */
    GtkWidget *w_font;                    /* Sticky Note font picker */
    GtkWidget *w_font_label;              /* Sticky Note font label */
    GtkWidget *w_def_color;               /* Sticky Note default color setting */
    GtkWidget *w_def_font;                /* Sticky Note default font setting */

    GtkWidget *w_title;                   /* Sticky Note title */
    GtkWidget *w_body;                    /* Sticky Note text body */
    GtkWidget *w_scroller;                /* Sticky Note scroller */
    GtkWidget *w_lock;                    /* Sticky Note lock button */
    GtkWidget *w_close;                   /* Sticky Note close button */
    GtkWidget *w_resize_se;               /* Sticky Note resize button (south east) */
    GtkWidget *w_resize_sw;               /* Sticky Note resize button (south west) */

    GtkSourceBuffer *buffer;              /* Sticky Note text buffer for undo/redo */

    GtkToggleAction *ta_lock_toggle_item; /* Lock item in the popup menu */

    GtkImage *img_lock;                   /* Lock image */
    GtkImage *img_close;                  /* Close image */
    GtkImage *img_resize_se;              /* SE resize image */
    GtkImage *img_resize_sw;              /* SW resize image */

    gchar *color;                         /* Note color */
    gchar *font_color;                    /* Font color */
    gchar *font;                          /* Note font */
    gboolean locked;                      /* Note locked state */

    gint x;                               /* Note x-coordinate */
    gint y;                               /* Note y-coordinate */
    gint w;                               /* Note width */
    gint h;                               /* Note height */

    int workspace;                        /* Workspace the note is on */

} StickyNote;

StickyNote * stickynote_new (GdkScreen *screen);
void stickynote_free (StickyNote *note);

gboolean stickynote_get_empty (const StickyNote *note);

void stickynote_set_title (StickyNote  *note,
                           const gchar *title);
void stickynote_set_color (StickyNote  *note,
                           const gchar *color_str,
                           const gchar *font_color_str,
                           gboolean     save);
void stickynote_set_font (StickyNote  *note,
                          const gchar *font_str,
                          gboolean     save);
void stickynote_set_locked (StickyNote *note,
                            gboolean    locked);
void stickynote_set_visible (StickyNote *note,
                             gboolean    visible);

void stickynote_change_properties (StickyNote *note);

void stickynotes_add (GdkScreen *screen);
void stickynotes_remove (StickyNote *note);
void stickynotes_save (void);
gboolean stickynotes_save_now (void);
void stickynotes_load (GdkScreen *screen);

#endif /* __STICKYNOTES_H__ */