[gnome-flashback] desktop-background: rename DesktopWindow to GfDesktopWindow



commit 3b15e59f7a7aa94ed3284c1724d18f47da5af178
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Sep 13 21:22:58 2015 +0300

    desktop-background: rename DesktopWindow to GfDesktopWindow

 .../libdesktop-background/gf-desktop-background.c  |    2 +-
 .../libdesktop-background/gf-desktop-window.c      |  120 ++++++++++----------
 .../libdesktop-background/gf-desktop-window.h      |   26 +---
 3 files changed, 70 insertions(+), 78 deletions(-)
---
diff --git a/gnome-flashback/libdesktop-background/gf-desktop-background.c 
b/gnome-flashback/libdesktop-background/gf-desktop-background.c
index 531fe4b..8f6adca 100644
--- a/gnome-flashback/libdesktop-background/gf-desktop-background.c
+++ b/gnome-flashback/libdesktop-background/gf-desktop-background.c
@@ -459,7 +459,7 @@ desktop_background_init (DesktopBackground *background)
                          G_CALLBACK (desktop_background_change_event), background);
        gnome_bg_load_from_preferences (priv->bg, priv->gnome_settings);
 
-       priv->background = desktop_window_new ();
+       priv->background = gf_desktop_window_new ();
        g_signal_connect (priv->background, "size-allocate",
                          G_CALLBACK (size_allocate), background);
 
diff --git a/gnome-flashback/libdesktop-background/gf-desktop-window.c 
b/gnome-flashback/libdesktop-background/gf-desktop-window.c
index c585727..c2b73ca 100644
--- a/gnome-flashback/libdesktop-background/gf-desktop-window.c
+++ b/gnome-flashback/libdesktop-background/gf-desktop-window.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Alberts Muktupāvels
+ * Copyright (C) 2014 - 2015 Alberts Muktupāvels
  *
  * 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
@@ -15,87 +15,91 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <gdk/gdkx.h>
-#include <X11/Xatom.h>
+#include "config.h"
 #include "gf-desktop-window.h"
 
-G_DEFINE_TYPE (DesktopWindow, desktop_window, GTK_TYPE_WINDOW)
+struct _GfDesktopWindow
+{
+  GtkWindow parent;
+};
+
+G_DEFINE_TYPE (GfDesktopWindow, gf_desktop_window, GTK_TYPE_WINDOW)
 
 static void
-desktop_window_screen_changed (GdkScreen *screen,
-                               gpointer   user_data)
+screen_changed (GdkScreen *screen,
+                gpointer   user_data)
 {
-       DesktopWindow *window;
-       gint           width;
-       gint           height;
-
-       window = DESKTOP_WINDOW (user_data);
-       width = gdk_screen_get_width (screen);
-       height = gdk_screen_get_height (screen);
-
-       g_object_set (window,
-                     "width-request", width,
-                     "height-request", height,
-                     NULL);
+  GfDesktopWindow *window;
+  gint width;
+  gint height;
+
+  window = GF_DESKTOP_WINDOW (user_data);
+  width = gdk_screen_get_width (screen);
+  height = gdk_screen_get_height (screen);
+
+  g_object_set (window,
+                "width-request", width,
+                "height-request", height,
+                NULL);
 }
 
 static void
-desktop_window_map (GtkWidget *widget)
+gf_desktop_window_map (GtkWidget *widget)
 {
-       GTK_WIDGET_CLASS (desktop_window_parent_class)->map (widget);
+  GdkWindow *window;
+
+  GTK_WIDGET_CLASS (gf_desktop_window_parent_class)->map (widget);
+
+  window = gtk_widget_get_window (widget);
 
-       gdk_window_lower (gtk_widget_get_window (widget));
+  gdk_window_lower (window);
 }
 
 static void
-desktop_window_init (DesktopWindow *window)
+gf_desktop_window_class_init (GfDesktopWindowClass *window_class)
 {
-       GdkScreen *screen;
+  GtkWidgetClass *widget_class;
 
-       screen = gdk_screen_get_default ();
+  widget_class = GTK_WIDGET_CLASS (window_class);
 
-       g_signal_connect_object (screen, "monitors-changed",
-                                G_CALLBACK (desktop_window_screen_changed), window,
-                                G_CONNECT_AFTER);
-
-       g_signal_connect_object (screen, "size-changed",
-                                G_CALLBACK (desktop_window_screen_changed), window,
-                                G_CONNECT_AFTER);
-
-       desktop_window_screen_changed (screen, window);
+  widget_class->map = gf_desktop_window_map;
 }
 
 static void
-desktop_window_class_init (DesktopWindowClass *class)
+gf_desktop_window_init (GfDesktopWindow *window)
 {
-       GtkWidgetClass *widget_class;
+  GdkScreen *screen;
+
+  screen = gdk_screen_get_default ();
+
+  g_signal_connect_object (screen, "monitors-changed",
+                           G_CALLBACK (screen_changed), window,
+                           G_CONNECT_AFTER);
 
-       widget_class = GTK_WIDGET_CLASS (class);
+  g_signal_connect_object (screen, "size-changed",
+                           G_CALLBACK (screen_changed), window,
+                           G_CONNECT_AFTER);
 
-       widget_class->map = desktop_window_map;
+  screen_changed (screen, window);
 }
 
 GtkWidget *
-desktop_window_new (void)
+gf_desktop_window_new (void)
 {
-       GObject   *object;
-       GtkWidget *widget;
-       GtkWindow *window;
-
-       object = g_object_new (DESKTOP_WINDOW_TYPE,
-                              "type", GTK_WINDOW_POPUP,
-                              "type-hint", GDK_WINDOW_TYPE_HINT_DESKTOP,
-                              "decorated", FALSE,
-                              "skip-pager-hint", TRUE,
-                              "skip-taskbar-hint", TRUE,
-                              "resizable", FALSE,
-                              "app-paintable", TRUE,
-                              NULL);
-       widget = GTK_WIDGET (object);
-       window = GTK_WINDOW (widget);
-
-       gtk_window_set_keep_below (window, TRUE);
-       gtk_widget_realize (widget);
-
-       return widget;
+  GtkWidget *window;
+
+  window = g_object_new (GF_TYPE_DESKTOP_WINDOW,
+                         "app-paintable", TRUE,
+                         "decorated", FALSE,
+                         "resizable", FALSE,
+                         "skip-pager-hint", TRUE,
+                         "skip-taskbar-hint", TRUE,
+                         "type", GTK_WINDOW_POPUP,
+                         "type-hint", GDK_WINDOW_TYPE_HINT_DESKTOP,
+                         NULL);
+
+  gtk_window_set_keep_below (GTK_WINDOW (window), TRUE);
+  gtk_widget_realize (window);
+
+  return window;
 }
diff --git a/gnome-flashback/libdesktop-background/gf-desktop-window.h 
b/gnome-flashback/libdesktop-background/gf-desktop-window.h
index 9735c81..2b7a781 100644
--- a/gnome-flashback/libdesktop-background/gf-desktop-window.h
+++ b/gnome-flashback/libdesktop-background/gf-desktop-window.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Alberts Muktupāvels
+ * Copyright (C) 2014 - 2015 Alberts Muktupāvels
  *
  * 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
@@ -15,30 +15,18 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef DESKTOP_WINDOW_H
-#define DESKTOP_WINDOW_H
+#ifndef GF_DESKTOP_WINDOW_H
+#define GF_DESKTOP_WINDOW_H
 
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
-#define DESKTOP_WINDOW_TYPE     (desktop_window_get_type ())
-#define DESKTOP_WINDOW(o)       (G_TYPE_CHECK_INSTANCE_CAST ((o), DESKTOP_WINDOW_TYPE, DesktopWindow))
-#define DESKTOP_WINDOW_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), DESKTOP_WINDOW_TYPE, DesktopWindowClass))
+#define GF_TYPE_DESKTOP_WINDOW gf_desktop_window_get_type ()
+G_DECLARE_FINAL_TYPE (GfDesktopWindow, gf_desktop_window,
+                      GF, DESKTOP_WINDOW, GtkWindow)
 
-typedef struct _DesktopWindow        DesktopWindow;
-typedef struct _DesktopWindowClass   DesktopWindowClass;
-
-struct _DesktopWindow {
-       GtkWindow parent;
-};
-
-struct _DesktopWindowClass {
-       GtkWindowClass parent_class;
-};
-
-GType      desktop_window_get_type (void);
-GtkWidget *desktop_window_new      (void);
+GtkWidget *gf_desktop_window_new (void);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]