Skip to contentSkip to conversation

Port to ScalingImage2

PATCH In review Jussi Kukkonen 2 participants 6 messages Jul 13, 2016

lore
Share & tools
lore
#0 lore raw

cover Port to ScalingImage2

Port all remaining applets to ScalingImage2.
Also fix a bug in ScalingImage2.

The following changes since commit 145a8075c66952dad9ab5f36d944c78c1ae3f4ab:

Release 2.10, update contact info (2016-06-02 15:08:14 +0300)

are available in the git repository at:

git://github.com/jku/matchbox-panel-2 scaling-image
https://github.com/jku/matchbox-panel-2/tree/scaling-image

Jussi Kukkonen (4):
mb-panel: Remove leftover call from old ScalingImage
battery: Port to ScalingImage2
startup: Port to ScalingImage2
launcher: Port to ScalingImage2

 applets/battery/battery-acpi.c           |  1 +
 applets/battery/battery.c                | 10 ++++++----
 applets/battery/battery.h                |  2 --
 applets/launcher/launcher.c              |  8 ++++----
 applets/startup/startup.c                | 12 +++++-------
 matchbox-panel/mb-panel-scaling-image2.c |  1 -
 6 files changed, 16 insertions(+), 18 deletions(-)
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/4 mb-panel: Remove leftover call from old ScalingImage

---
 matchbox-panel/mb-panel-scaling-image2.c | 1 -
 1 file changed, 1 deletion(-)
matchbox-panel/mb-panel-scaling-image2.c +0 -1
index 8cdc3a1..258f1e4 100644
@@ -220,7 +220,6 @@ reload_icon (MBPanelScalingImage2 *image, gboolean force)
 
         if (!image->priv->icon) {
                 g_clear_object (&image->priv->pixbuf);
-                gtk_image_set_from_pixbuf (GTK_IMAGE (image), NULL);
                 gtk_widget_queue_resize (GTK_WIDGET (image));
                 return;
         }
Signature · 1 line
2.8.1
#2 lore raw

PATCH 2/4 battery: Port to ScalingImage2

---
 applets/battery/battery-acpi.c |  1 +
 applets/battery/battery.c      | 10 ++++++----
 applets/battery/battery.h      |  2 --
 3 files changed, 7 insertions(+), 6 deletions(-)
applets/battery/battery-acpi.c +1 -0
index c44dd12..8431127 100644
@@ -5,6 +5,7 @@
  */
 
 #include "battery.h"
+#include <glib.h>
 #include <libacpi.h>
 
 global_t global;
applets/battery/battery.c +6 -4
index ade3ff6..c755856 100644
@@ -7,9 +7,11 @@
  */
 
 #include "battery.h"
+#include <matchbox-panel/mb-panel.h>
+#include <matchbox-panel/mb-panel-scaling-image2.h>
 
 typedef struct {
-        MBPanelScalingImage *image;
+        MBPanelScalingImage2 *image;
         const char *last_icon;
         guint timeout_id;
 } BatteryApplet;
@@ -38,7 +40,7 @@ timeout (BatteryApplet *applet)
 
         applet->last_icon = icon;
 
-        mb_panel_scaling_image_set_icon (applet->image, icon);
+        mb_panel_scaling_image2_set_icon (applet->image, icon);
 
         /* Keep going */
         return TRUE;
@@ -59,8 +61,8 @@ mb_panel_applet_create (const char    *id,
 
         applet->last_icon = NULL;
 
-        image = mb_panel_scaling_image_new (orientation, NULL);
-        applet->image = MB_PANEL_SCALING_IMAGE (image);
+        image = mb_panel_scaling_image2_new (orientation, NULL);
+        applet->image = MB_PANEL_SCALING_IMAGE2 (image);
 
         gtk_widget_set_name (image, "MatchboxPanelBatteryMonitor");
 
applets/battery/battery.h +0 -2
index 29a44ca..cf23431 100644
@@ -8,8 +8,6 @@
 #define MB_APPLET_BATTERY_H
 
 #include <string.h>
-#include <matchbox-panel/mb-panel.h>
-#include <matchbox-panel/mb-panel-scaling-image.h>
 
 int pm_support(void);
 const char* pm_battery_icon(void);
Signature · 1 line
2.8.1
#3 lore raw

PATCH 3/4 startup: Port to ScalingImage2

In reply to Jussi Kukkonen
---
 applets/startup/startup.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
applets/startup/startup.c +5 -7
index 1b304da..026dce2 100644
@@ -38,7 +38,7 @@
 
 #include <string.h>
 #include <matchbox-panel/mb-panel.h>
-#include <matchbox-panel/mb-panel-scaling-image.h>
+#include <matchbox-panel/mb-panel-scaling-image2.h>
 
 #define TIMEOUT 20
 #define HOURGLASS_PIXMAPS 8
@@ -50,7 +50,7 @@ typedef struct LaunchItem {
 } LaunchItem;
 
 typedef struct {
-        MBPanelScalingImage *image;
+        MBPanelScalingImage2 *image;
         GdkWindow *root_window;
         SnDisplay *sn_display;
         SnMonitorContext *sn_context;
@@ -201,7 +201,7 @@ timeout (StartupApplet *applet)
         sprintf (icon, "%s/hourglass-%i.png", DATADIR,
                  applet->hourglass_cur_frame_n);
 
-        mb_panel_scaling_image_set_icon (applet->image, icon);
+        mb_panel_scaling_image2_set_icon (applet->image, icon);
 
         free (icon);
 
@@ -261,10 +261,8 @@ mb_panel_applet_create (const char    *id,
         applet->hourglass_shown = FALSE;
 
         /* Create image */
-        applet->image = MB_PANEL_SCALING_IMAGE
-                              (mb_panel_scaling_image_new (orientation, NULL));
-        mb_panel_scaling_image_set_caching (applet->image, TRUE);
-
+        applet->image = MB_PANEL_SCALING_IMAGE2
+                              (mb_panel_scaling_image2_new (orientation, NULL));
         gtk_widget_set_name (GTK_WIDGET(applet->image),
                              "MatchboxPanelStartupMonitor");
 
Signature · 1 line
2.8.1
#4 lore raw

PATCH 4/4 launcher: Port to ScalingImage2

In reply to Jussi Kukkonen
---
 applets/launcher/launcher.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
applets/launcher/launcher.c +4 -4
index 0ec8a43..d1ab8e4 100644
@@ -12,7 +12,7 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 #include <matchbox-panel/mb-panel.h>
-#include <matchbox-panel/mb-panel-scaling-image.h>
+#include <matchbox-panel/mb-panel-scaling-image2.h>
 
 #ifdef USE_LIBSN
   #define SN_API_NOT_YET_FROZEN 1
@@ -20,7 +20,7 @@
 #endif
 
 typedef struct {
-        GtkImage *image;
+        MBPanelScalingImage2 *image;
 
         gboolean button_down;
 
@@ -331,7 +331,7 @@ mb_panel_applet_create (const char    *id,
 
         gtk_widget_set_name (event_box, "MatchboxPanelLauncher");
 
-        image = mb_panel_scaling_image_new (orientation, icon);
+        image = mb_panel_scaling_image2_new (orientation, icon);
         g_free (icon);
 
         gtk_container_add (GTK_CONTAINER (event_box), image);
@@ -339,7 +339,7 @@ mb_panel_applet_create (const char    *id,
         /* Set up applet structure */
         applet = g_slice_new0 (LauncherApplet);
 
-        applet->image = GTK_IMAGE (image);
+        applet->image = MB_PANEL_SCALING_IMAGE2 (image);
         
         applet->button_down = FALSE;
 
Signature · 1 line
2.8.1
#5 lore raw
In reply to Jussi Kukkonen

Looks good!

Quoted 36 lines · Jussi Kukkonen

Port all remaining applets to ScalingImage2.
Also fix a bug in ScalingImage2.

The following changes since commit
145a8075c66952dad9ab5f36d944c78c1ae3f4ab:

Release 2.10, update contact info (2016-06-02 15:08:14 +0300)

are available in the git repository at:

git://github.com/jku/matchbox-panel-2 scaling-image
https://github.com/jku/matchbox-panel-2/tree/scaling-image

Jussi Kukkonen (4):
mb-panel: Remove leftover call from old ScalingImage
battery: Port to ScalingImage2
startup: Port to ScalingImage2
launcher: Port to ScalingImage2

 applets/battery/battery-acpi.c           |  1 +
 applets/battery/battery.c                | 10 ++++++----
 applets/battery/battery.h                |  2 --
 applets/launcher/launcher.c              |  8 ++++----
 applets/startup/startup.c                | 12 +++++-------
 matchbox-panel/mb-panel-scaling-image2.c |  1 -
 6 files changed, 16 insertions(+), 18 deletions(-)

--
2.8.1

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto