summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-06-08 17:56:47 +0200
committerStefano Karapetsas <[email protected]>2012-06-08 17:56:47 +0200
commitc9b9454068f090a7132c6bea6ac07c91843ffb6e (patch)
tree299117f2ea3bab8e3f23d8fc9b3f295505c68595 /stickynotes/stickynotes.c
parentea879f570f86aaded57607af1ddd239e67160f79 (diff)
downloadmate-applets-c9b9454068f090a7132c6bea6ac07c91843ffb6e.tar.bz2
mate-applets-c9b9454068f090a7132c6bea6ac07c91843ffb6e.tar.xz
port to libmatewnckmate-applets-1.3.0
Diffstat (limited to 'stickynotes/stickynotes.c')
-rw-r--r--stickynotes/stickynotes.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index 11448623..418115ba 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -21,8 +21,7 @@
#include <libxml/parser.h>
#include <X11/Xatom.h>
#include <gdk/gdkx.h>
-#define WNCK_I_KNOW_THIS_IS_UNSTABLE 1
-#include <libwnck/libwnck.h>
+#include <libmatewnck/libmatewnck.h>
#include <string.h>
#include "stickynotes.h"
@@ -37,7 +36,7 @@ static gboolean save_scheduled = FALSE;
static void response_cb (GtkWidget *dialog, gint id, gpointer data);
-/* Based on a function found in wnck */
+/* Based on a function found in matewnck */
static void
set_icon_geometry (GdkWindow *window,
int x,
@@ -662,23 +661,23 @@ stickynote_set_visible (StickyNote *note, gboolean visible)
else if (note->workspace > 0)
{
#if 0
- WnckWorkspace *wnck_ws;
+ MatewnckWorkspace *matewnck_ws;
gulong xid;
- WnckWindow *wnck_win;
- WnckScreen *wnck_screen;
+ MatewnckWindow *matewnck_win;
+ MatewnckScreen *matewnck_screen;
g_print ("set_visible(): workspace = %i\n",
note->workspace);
xid = GDK_WINDOW_XID (note->w_window->window);
- wnck_screen = wnck_screen_get_default ();
- wnck_win = wnck_window_get (xid);
- wnck_ws = wnck_screen_get_workspace (
- wnck_screen,
+ matewnck_screen = matewnck_screen_get_default ();
+ matewnck_win = matewnck_window_get (xid);
+ matewnck_ws = matewnck_screen_get_workspace (
+ matewnck_screen,
note->workspace - 1);
- if (wnck_win && wnck_ws)
- wnck_window_move_to_workspace (
- wnck_win, wnck_ws);
+ if (matewnck_win && matewnck_ws)
+ matewnck_window_move_to_workspace (
+ matewnck_win, matewnck_ws);
else
g_print ("set_visible(): errr\n");
#endif
@@ -745,7 +744,7 @@ void stickynotes_remove(StickyNote *note)
gboolean
stickynotes_save_now (void)
{
- WnckScreen *wnck_screen;
+ MatewnckScreen *matewnck_screen;
const gchar *title;
GtkTextBuffer *buffer;
GtkTextIter start, end;
@@ -760,12 +759,12 @@ stickynotes_save_now (void)
xmlDocSetRootElement(doc, root);
xmlNewProp(root, XML_CHAR("version"), XML_CHAR (VERSION));
- wnck_screen = wnck_screen_get_default ();
- wnck_screen_force_update (wnck_screen);
+ matewnck_screen = matewnck_screen_get_default ();
+ matewnck_screen_force_update (matewnck_screen);
/* For all sticky notes */
for (i = 0; i < g_list_length(stickynotes->notes); i++) {
- WnckWindow *wnck_win;
+ MatewnckWindow *matewnck_win;
gulong xid = 0;
/* Access the current note in the list */
@@ -780,14 +779,14 @@ stickynotes_save_now (void)
gchar *y_str = g_strdup_printf("%d", note->y);
xid = GDK_WINDOW_XID (gtk_widget_get_window (note->w_window));
- wnck_win = wnck_window_get (xid);
+ matewnck_win = matewnck_window_get (xid);
if (!mateconf_client_get_bool (stickynotes->mateconf,
MATECONF_PATH "/settings/sticky", NULL) &&
- wnck_win)
+ matewnck_win)
note->workspace = 1 +
- wnck_workspace_get_number (
- wnck_window_get_workspace (wnck_win));
+ matewnck_workspace_get_number (
+ matewnck_window_get_workspace (matewnck_win));
else
note->workspace = 0;
@@ -876,7 +875,7 @@ stickynotes_load (GdkScreen *screen)
xmlDocPtr doc = NULL;
xmlNodePtr root;
xmlNodePtr node;
- /* WnckScreen *wnck_screen; */
+ /* MatewnckScreen *matewnck_screen; */
GList *new_notes, *tmp1; /* Lists of StickyNote*'s */
GList *new_nodes; /* Lists of xmlNodePtr's */
int x, y, w, h;
@@ -1064,8 +1063,8 @@ stickynotes_load (GdkScreen *screen)
tmp1 = new_notes;
/*
- wnck_screen = wnck_screen_get_default ();
- wnck_screen_force_update (wnck_screen);
+ matewnck_screen = matewnck_screen_get_default ();
+ matewnck_screen_force_update (matewnck_screen);
*/
while (tmp1)