From 09d3b00ca94376ddcb2b1cdb53d6448708936f4f Mon Sep 17 00:00:00 2001 From: Perberos Date: Thu, 8 Dec 2011 13:35:59 -0300 Subject: GDK_DISPLAY() is deprecated --- distro/archlinux/PKGBUILD | 2 +- geyes/themes.c | 105 ++++++++++++++--------------- invest-applet/invest/__init__.py | 2 +- stickynotes/stickynotes.c | 4 +- stickynotes/stickynotes_applet.h | 10 +-- stickynotes/stickynotes_applet_callbacks.c | 4 +- 6 files changed, 63 insertions(+), 64 deletions(-) diff --git a/distro/archlinux/PKGBUILD b/distro/archlinux/PKGBUILD index 86f1a7fe..4e56fdff 100644 --- a/distro/archlinux/PKGBUILD +++ b/distro/archlinux/PKGBUILD @@ -21,7 +21,7 @@ build() { --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ - --libexecdir=/usr/lib/${pkgname} \ + --libexecdir=/usr/lib/mate-applets \ --disable-static \ --disable-scrollkeeper \ --enable-polkit \ diff --git a/geyes/themes.c b/geyes/themes.c index 7c174cc8..10fb31f0 100644 --- a/geyes/themes.c +++ b/geyes/themes.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1999 Dave Camp - * + * * 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 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ #include @@ -38,16 +38,15 @@ enum { TOTAL_COLS }; -void -theme_dirs_create (void) +void theme_dirs_create(void) { static gboolean themes_created = FALSE; - + if (themes_created == TRUE) return; - theme_directories[0] = g_strdup (GEYES_THEMES_DIR); - theme_directories[1] = g_strdup_printf ("%s/.mate2/geyes-themes/", g_get_home_dir()); + theme_directories[0] = g_build_filename(GEYES_THEMES_DIR); + theme_directories[1] = g_build_filename(g_get_home_dir(), ".config", "mate", "geyes-themes", NULL); themes_created = TRUE; } @@ -60,13 +59,13 @@ parse_theme_file (EyesApplet *eyes_applet, FILE *theme_file) fgets (line_buf, 512, theme_file); while (!feof (theme_file)) { token = strtok (line_buf, "="); - if (strncmp (token, "wall-thickness", + if (strncmp (token, "wall-thickness", strlen ("wall-thickness")) == 0) { token += strlen ("wall-thickness"); while (!isdigit (*token)) { token++; } - sscanf (token, "%d", &eyes_applet->wall_thickness); + sscanf (token, "%d", &eyes_applet->wall_thickness); } else if (strncmp (token, "num-eyes", strlen ("num-eyes")) == 0) { token += strlen ("num-eyes"); while (!isdigit (*token)) { @@ -77,24 +76,24 @@ parse_theme_file (EyesApplet *eyes_applet, FILE *theme_file) eyes_applet->num_eyes = MAX_EYES; } else if (strncmp (token, "eye-pixmap", strlen ("eye-pixmap")) == 0) { token = strtok (NULL, "\""); - token = strtok (NULL, "\""); - if (eyes_applet->eye_filename != NULL) + token = strtok (NULL, "\""); + if (eyes_applet->eye_filename != NULL) g_free (eyes_applet->eye_filename); eyes_applet->eye_filename = g_strdup_printf ("%s%s", eyes_applet->theme_dir, token); } else if (strncmp (token, "pupil-pixmap", strlen ("pupil-pixmap")) == 0) { token = strtok (NULL, "\""); - token = strtok (NULL, "\""); - if (eyes_applet->pupil_filename != NULL) + token = strtok (NULL, "\""); + if (eyes_applet->pupil_filename != NULL) g_free (eyes_applet->pupil_filename); - eyes_applet->pupil_filename + eyes_applet->pupil_filename = g_strdup_printf ("%s%s", eyes_applet->theme_dir, - token); + token); } fgets (line_buf, 512, theme_file); - } + } } int @@ -141,7 +140,7 @@ load_theme (EyesApplet *eyes_applet, const gchar *theme_dir) fclose (theme_file); eyes_applet->theme_name = g_strdup (theme_dir); - + if (eyes_applet->eye_image) g_object_unref (eyes_applet->eye_image); eyes_applet->eye_image = gdk_pixbuf_new_from_file (eyes_applet->eye_filename, NULL); @@ -153,9 +152,9 @@ load_theme (EyesApplet *eyes_applet, const gchar *theme_dir) eyes_applet->eye_width = gdk_pixbuf_get_width (eyes_applet->eye_image); eyes_applet->pupil_height = gdk_pixbuf_get_height (eyes_applet->pupil_image); eyes_applet->pupil_width = gdk_pixbuf_get_width (eyes_applet->pupil_image); - + g_free (file_name); - + return TRUE; } @@ -164,14 +163,14 @@ destroy_theme (EyesApplet *eyes_applet) { /* Dunno about this - to unref or not to unref? */ if (eyes_applet->eye_image != NULL) { - g_object_unref (eyes_applet->eye_image); + g_object_unref (eyes_applet->eye_image); eyes_applet->eye_image = NULL; } if (eyes_applet->pupil_image != NULL) { - g_object_unref (eyes_applet->pupil_image); + g_object_unref (eyes_applet->pupil_image); eyes_applet->pupil_image = NULL; } - + g_free (eyes_applet->theme_dir); g_free (eyes_applet->theme_name); } @@ -203,29 +202,29 @@ theme_selected_cb (GtkTreeSelection *selection, gpointer data) GtkTreeIter iter; gchar *theme; gchar *theme_dir; - + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) return; - + gtk_tree_model_get (model, &iter, COL_THEME_DIR, &theme, -1); - + g_return_if_fail (theme); - + theme_dir = g_strdup_printf ("%s/", theme); if (!g_ascii_strncasecmp (theme_dir, eyes_applet->theme_dir, strlen (theme_dir))) { g_free (theme_dir); return; } g_free (theme_dir); - + destroy_eyes (eyes_applet); destroy_theme (eyes_applet); load_theme (eyes_applet, theme); setup_eyes (eyes_applet); - + mate_panel_applet_mateconf_set_string ( eyes_applet->applet, "theme_path", theme, NULL); - + g_free (theme); } @@ -291,7 +290,7 @@ properties_cb (GtkAction *action, gchar *filename; #endif gchar *title; - + if (eyes_applet->prop_box.pbox) { gtk_window_set_screen ( GTK_WINDOW (eyes_applet->prop_box.pbox), @@ -308,7 +307,7 @@ properties_cb (GtkAction *action, gtk_window_set_screen (GTK_WINDOW (pbox), gtk_widget_get_screen (GTK_WIDGET (eyes_applet->applet))); - + gtk_widget_set_size_request (GTK_WIDGET (pbox), 300, 200); gtk_dialog_set_default_response(GTK_DIALOG (pbox), GTK_RESPONSE_CLOSE); gtk_dialog_set_has_separator (GTK_DIALOG (pbox), FALSE); @@ -318,11 +317,11 @@ properties_cb (GtkAction *action, g_signal_connect (pbox, "response", G_CALLBACK (presponse_cb), eyes_applet); - + vbox = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_widget_show (vbox); - + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (pbox))), vbox, TRUE, TRUE, 0); @@ -333,7 +332,7 @@ properties_cb (GtkAction *action, category_vbox = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (categories_vbox), category_vbox, TRUE, TRUE, 0); gtk_widget_show (category_vbox); - + title = g_strconcat ("", _("Themes"), "", NULL); label = gtk_label_new (_(title)); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); @@ -341,20 +340,20 @@ properties_cb (GtkAction *action, gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (category_vbox), label, FALSE, FALSE, 0); g_free (title); - + hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (category_vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); - + indent = gtk_label_new (HIG_IDENTATION); gtk_label_set_justify (GTK_LABEL (indent), GTK_JUSTIFY_LEFT); gtk_box_pack_start (GTK_BOX (hbox), indent, FALSE, FALSE, 0); gtk_widget_show (indent); - + control_vbox = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (hbox), control_vbox, TRUE, TRUE, 0); gtk_widget_show (control_vbox); - + label = gtk_label_new_with_mnemonic (_("_Select a theme:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (control_vbox), label, FALSE, FALSE, 0); @@ -372,12 +371,12 @@ properties_cb (GtkAction *action, g_object_unref (model); gtk_container_add (GTK_CONTAINER (scrolled), tree); - + cell = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("not used", cell, "text", COL_THEME_NAME, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); - + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree)); g_signal_connect (selection, "changed", G_CALLBACK (theme_selected_cb), @@ -395,7 +394,7 @@ properties_cb (GtkAction *action, gchar *theme_dir; gchar *theme_name; #ifdef PATH_MAX - strcpy (filename, + strcpy (filename, theme_directories[i]); strcat (filename, dp->d_name); #else @@ -403,20 +402,20 @@ properties_cb (GtkAction *action, #endif theme_dir = g_strdup_printf ("%s/", filename); theme_name = g_path_get_basename (filename); - + gtk_list_store_append (model, &iter); gtk_list_store_set (model, &iter, COL_THEME_DIR, &filename, COL_THEME_NAME, theme_name, -1); - + if (!g_ascii_strncasecmp (eyes_applet->theme_dir, theme_dir, strlen (theme_dir))) { GtkTreePath *path; - path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), + path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter); - gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree), - path, - NULL, + gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree), + path, + NULL, FALSE); gtk_tree_path_free (path); } @@ -430,13 +429,13 @@ properties_cb (GtkAction *action, #ifndef PATH_MAX g_free (filename); #endif - + gtk_box_pack_start (GTK_BOX (control_vbox), scrolled, TRUE, TRUE, 0); - + gtk_widget_show_all (pbox); - + eyes_applet->prop_box.pbox = pbox; - + return; } diff --git a/invest-applet/invest/__init__.py b/invest-applet/invest/__init__.py index b86ce8ec..101881f5 100644 --- a/invest-applet/invest/__init__.py +++ b/invest-applet/invest/__init__.py @@ -42,7 +42,7 @@ else: BUILDER_DATA_DIR = BUILDERDIR ART_DATA_DIR = SHARED_DATA_DIR -USER_INVEST_DIR = expanduser("~/.mate2/invest-applet") +USER_INVEST_DIR = expanduser("~/.config/mate/invest-applet") if not exists(USER_INVEST_DIR): try: os.makedirs(USER_INVEST_DIR, 0744) diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c index 367a4507..756fe125 100644 --- a/stickynotes/stickynotes.c +++ b/stickynotes/stickynotes.c @@ -839,7 +839,7 @@ stickynotes_save_now (void) g_free(body); } - /* The XML file is $HOME/.mate2/stickynotes_applet, most probably */ + /* The XML file is $HOME/.config/mate/stickynotes_applet, most probably */ { gchar *file = g_strdup_printf("%s%s", g_get_home_dir(), XML_PATH); @@ -875,7 +875,7 @@ stickynotes_load (GdkScreen *screen) GList *new_notes, *tmp1; /* Lists of StickyNote*'s */ GList *new_nodes; /* Lists of xmlNodePtr's */ int x, y, w, h; - /* The XML file is $HOME/.mate2/stickynotes_applet, most probably */ + /* The XML file is $HOME/.config/mate/stickynotes_applet, most probably */ { gchar *file = g_strdup_printf("%s%s", g_get_home_dir(), XML_PATH); diff --git a/stickynotes/stickynotes_applet.h b/stickynotes/stickynotes_applet.h index 023f6162..976aff54 100644 --- a/stickynotes/stickynotes_applet.h +++ b/stickynotes/stickynotes_applet.h @@ -30,7 +30,7 @@ #define MATECONF_PATH "/apps/stickynotes_applet" #define BUILDER_PATH GTK_BUILDERDIR "/stickynotes.ui" -#define XML_PATH "/.mate2/stickynotes_applet" +#define XML_PATH "/.config/mate/stickynotes_applet" #define ICON_PATH STICKYNOTES_ICONDIR #define STICKYNOTES_STOCK_LOCKED "stickynotes-stock-locked" @@ -42,7 +42,7 @@ /* Global Sticky Notes instance */ typedef struct { - GtkBuilder *builder; + GtkBuilder *builder; GtkWidget *w_prefs; /* The prefs dialog */ GtkAdjustment *w_prefs_width; @@ -58,7 +58,7 @@ typedef struct GList *notes; /* Linked-List of all the sticky notes */ GList *applets; /* Linked-List of all the applets */ - + GdkPixbuf *icon_normal; /* Normal applet icon */ GdkPixbuf *icon_prelight; /* Prelighted applet icon */ @@ -85,7 +85,7 @@ typedef struct GtkWidget *w_image; /* The applet icon */ GtkWidget *destroy_all_dialog; /* The applet it's destroy all dialog */ - + gboolean prelighted; /* Whether applet is prelighted */ gboolean pressed; /* Whether applet is pressed */ @@ -95,7 +95,7 @@ typedef struct GtkActionGroup *action_group; GtkWidget *menu_tip; } StickyNotesApplet; - + typedef enum { STICKYNOTES_NEW = 0, diff --git a/stickynotes/stickynotes_applet_callbacks.c b/stickynotes/stickynotes_applet_callbacks.c index 1369d74b..e1b9037c 100644 --- a/stickynotes/stickynotes_applet_callbacks.c +++ b/stickynotes/stickynotes_applet_callbacks.c @@ -181,13 +181,13 @@ void install_check_click_on_desktop (void) Window *data; /* We only use this extra property if the actual user-time property's missing */ - int status = XGetWindowProperty( GDK_DISPLAY(), desktop_window, user_time, + int status = XGetWindowProperty(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), desktop_window, user_time, 0, 4, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes, (unsigned char **)&data ); if (actual_type == None) { /* No user-time property, so look for the user-time-window */ - status = XGetWindowProperty( GDK_DISPLAY(), desktop_window, user_time_window, + status = XGetWindowProperty(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), desktop_window, user_time_window, 0, 4, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes, (unsigned char **)&data ); if (actual_type != None) -- cgit v1.2.1