Browse Source

Follow GNU indent guidelines for switch.

upstream/xfce4-panel-4.10.1
Nick Schermer 12 years ago
parent
commit
b6e3a0e2c6
  1. 82
      libxfce4panel/libxfce4panel-deprecated.h
  2. 68
      libxfce4panel/xfce-arrow-button.c
  3. 24
      libxfce4panel/xfce-hvbox.c
  4. 70
      libxfce4panel/xfce-panel-image.c
  5. 140
      libxfce4panel/xfce-panel-plugin.c
  6. 308
      panel/panel-application.c
  7. 154
      panel/panel-base-window.c
  8. 76
      panel/panel-itembar.c
  9. 90
      panel/panel-module.c
  10. 92
      panel/panel-plugin-external-46.c
  11. 92
      panel/panel-plugin-external.c
  12. 632
      panel/panel-window.c
  13. 94
      plugins/actions/actions.c
  14. 24
      plugins/clock/clock-analog.c
  15. 36
      plugins/clock/clock-binary.c
  16. 28
      plugins/clock/clock-digital.c
  17. 36
      plugins/clock/clock-fuzzy.c
  18. 60
      plugins/clock/clock-lcd.c
  19. 140
      plugins/clock/clock.c
  20. 368
      plugins/launcher/launcher.c
  21. 91
      plugins/pager/pager.c
  22. 244
      plugins/separator/separator.c
  23. 174
      plugins/windowmenu/windowmenu.c

82
libxfce4panel/libxfce4panel-deprecated.h

@ -103,47 +103,47 @@ enum /*< skip >*/
\
switch (message) \
{ \
case PANEL_CLIENT_EVENT_REMOVED: \
xfce_panel_plugin_provider_removed (provider); \
break; \
\
case PANEL_CLIENT_EVENT_SAVE: \
xfce_panel_plugin_provider_save (provider); \
break; \
\
case PANEL_CLIENT_EVENT_SET_BACKGROUND_ALPHA: \
_xpp_alpha = value / 100.00; \
if (_xpp_composited) \
gtk_widget_queue_draw (plug); \
break; \
\
case PANEL_CLIENT_EVENT_SET_ORIENTATION: \
xfce_panel_plugin_provider_set_orientation (provider, value); \
break; \
\
case PANEL_CLIENT_EVENT_SET_SCREEN_POSITION: \
xfce_panel_plugin_provider_set_screen_position (provider, value); \
break; \
\
case PANEL_CLIENT_EVENT_SET_SENSITIVE: \
gtk_widget_set_sensitive (plug, value); \
break; \
\
case PANEL_CLIENT_EVENT_SET_SIZE: \
xfce_panel_plugin_provider_set_size (provider, value); \
break; \
\
case PANEL_CLIENT_EVENT_SHOW_ABOUT: \
xfce_panel_plugin_provider_show_about (provider); \
break; \
\
case PANEL_CLIENT_EVENT_SHOW_CONFIGURE: \
xfce_panel_plugin_provider_show_configure (provider); \
break; \
\
default: \
g_warning ("Received unknow client event %d", message); \
break; \
case PANEL_CLIENT_EVENT_REMOVED: \
xfce_panel_plugin_provider_removed (provider); \
break; \
\
case PANEL_CLIENT_EVENT_SAVE: \
xfce_panel_plugin_provider_save (provider); \
break; \
\
case PANEL_CLIENT_EVENT_SET_BACKGROUND_ALPHA: \
_xpp_alpha = value / 100.00; \
if (_xpp_composited) \
gtk_widget_queue_draw (plug); \
break; \
\
case PANEL_CLIENT_EVENT_SET_ORIENTATION: \
xfce_panel_plugin_provider_set_orientation (provider, value); \
break; \
\
case PANEL_CLIENT_EVENT_SET_SCREEN_POSITION: \
xfce_panel_plugin_provider_set_screen_position (provider, value); \
break; \
\
case PANEL_CLIENT_EVENT_SET_SENSITIVE: \
gtk_widget_set_sensitive (plug, value); \
break; \
\
case PANEL_CLIENT_EVENT_SET_SIZE: \
xfce_panel_plugin_provider_set_size (provider, value); \
break; \
\
case PANEL_CLIENT_EVENT_SHOW_ABOUT: \
xfce_panel_plugin_provider_show_about (provider); \
break; \
\
case PANEL_CLIENT_EVENT_SHOW_CONFIGURE: \
xfce_panel_plugin_provider_show_configure (provider); \
break; \
\
default: \
g_warning ("Received unknow client event %d", message); \
break; \
} \
\
return FALSE; \

68
libxfce4panel/xfce-arrow-button.c

@ -198,13 +198,13 @@ xfce_arrow_button_set_property (GObject *object,
switch (prop_id)
{
case PROP_ARROW_TYPE:
xfce_arrow_button_set_arrow_type (button, g_value_get_enum (value));
break;
case PROP_ARROW_TYPE:
xfce_arrow_button_set_arrow_type (button, g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -220,13 +220,13 @@ xfce_arrow_button_get_property (GObject *object,
switch (prop_id)
{
case PROP_ARROW_TYPE:
g_value_set_enum (value, xfce_arrow_button_get_arrow_type (button));
break;
case PROP_ARROW_TYPE:
g_value_set_enum (value, xfce_arrow_button_get_arrow_type (button));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -314,18 +314,18 @@ xfce_arrow_button_size_request (GtkWidget *widget,
/* reserve space for the arrow */
switch (button->priv->arrow_type)
{
case GTK_ARROW_UP:
case GTK_ARROW_DOWN:
requisition->width += ARROW_WIDTH;
break;
case GTK_ARROW_LEFT:
case GTK_ARROW_RIGHT:
requisition->height += ARROW_WIDTH;
break;
default:
break;
case GTK_ARROW_UP:
case GTK_ARROW_DOWN:
requisition->width += ARROW_WIDTH;
break;
case GTK_ARROW_LEFT:
case GTK_ARROW_RIGHT:
requisition->height += ARROW_WIDTH;
break;
default:
break;
}
}
else if (button->priv->arrow_type != GTK_ARROW_NONE)
@ -359,16 +359,16 @@ xfce_arrow_button_size_allocate (GtkWidget *widget,
/* update the allocation to make space for the arrow */
switch (button->priv->arrow_type)
{
case GTK_ARROW_LEFT:
case GTK_ARROW_RIGHT:
child_allocation.height -= ARROW_WIDTH;
child_allocation.y += ARROW_WIDTH;
break;
default:
child_allocation.width -= ARROW_WIDTH;
child_allocation.x += ARROW_WIDTH;
break;
case GTK_ARROW_LEFT:
case GTK_ARROW_RIGHT:
child_allocation.height -= ARROW_WIDTH;
child_allocation.y += ARROW_WIDTH;
break;
default:
child_allocation.width -= ARROW_WIDTH;
child_allocation.x += ARROW_WIDTH;
break;
}
/* set the child allocation again */

24
libxfce4panel/xfce-hvbox.c

@ -134,13 +134,13 @@ xfce_hvbox_get_property (GObject *object,
switch (prop_id)
{
case PROP_ORIENTATION:
g_value_set_enum (value, hvbox->orientation);
break;
case PROP_ORIENTATION:
g_value_set_enum (value, hvbox->orientation);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -156,13 +156,13 @@ xfce_hvbox_set_property (GObject *object,
switch (prop_id)
{
case PROP_ORIENTATION:
xfce_hvbox_set_orientation (hvbox, g_value_get_enum (value));
break;
case PROP_ORIENTATION:
xfce_hvbox_set_orientation (hvbox, g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

70
libxfce4panel/xfce-panel-image.c

@ -206,21 +206,21 @@ xfce_panel_image_get_property (GObject *object,
switch (prop_id)
{
case PROP_SOURCE:
g_value_set_string (value, priv->source);
break;
case PROP_SOURCE:
g_value_set_string (value, priv->source);
break;
case PROP_PIXBUF:
g_value_set_object (value, priv->pixbuf);
break;
case PROP_PIXBUF:
g_value_set_object (value, priv->pixbuf);
break;
case PROP_SIZE:
g_value_set_int (value, priv->size);
break;
case PROP_SIZE:
g_value_set_int (value, priv->size);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -237,29 +237,29 @@ xfce_panel_image_set_property (GObject *object,
switch (prop_id)
{
case PROP_SOURCE:
xfce_panel_image_set_from_source (XFCE_PANEL_IMAGE (object),
g_value_get_string (value));
break;
case PROP_PIXBUF:
xfce_panel_image_set_from_pixbuf (XFCE_PANEL_IMAGE (object),
g_value_get_object (value));
break;
case PROP_SIZE:
priv = XFCE_PANEL_IMAGE (object)->priv;
size = g_value_get_int (value);
if (G_LIKELY (priv->size != size))
{
priv->size = size;
gtk_widget_queue_resize (GTK_WIDGET (object));
}
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_SOURCE:
xfce_panel_image_set_from_source (XFCE_PANEL_IMAGE (object),
g_value_get_string (value));
break;
case PROP_PIXBUF:
xfce_panel_image_set_from_pixbuf (XFCE_PANEL_IMAGE (object),
g_value_get_object (value));
break;
case PROP_SIZE:
priv = XFCE_PANEL_IMAGE (object)->priv;
size = g_value_get_int (value);
if (G_LIKELY (priv->size != size))
{
priv->size = size;
gtk_widget_queue_resize (GTK_WIDGET (object));
}
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

140
libxfce4panel/xfce-panel-plugin.c

@ -590,45 +590,45 @@ xfce_panel_plugin_get_property (GObject *object,
switch (prop_id)
{
case PROP_NAME:
g_value_set_static_string (value, private->name);
break;
case PROP_NAME:
g_value_set_static_string (value, private->name);
break;
case PROP_DISPLAY_NAME:
g_value_set_static_string (value, private->display_name);
break;
case PROP_DISPLAY_NAME:
g_value_set_static_string (value, private->display_name);
break;
case PROP_COMMENT:
g_value_set_static_string (value, private->comment);
break;
case PROP_COMMENT:
g_value_set_static_string (value, private->comment);
break;
case PROP_UNIQUE_ID:
g_value_set_int (value, private->unique_id);
break;
case PROP_UNIQUE_ID:
g_value_set_int (value, private->unique_id);
break;
case PROP_ARGUMENTS:
g_value_set_boxed (value, private->arguments);
break;
case PROP_ARGUMENTS:
g_value_set_boxed (value, private->arguments);
break;
case PROP_ORIENTATION:
g_value_set_enum (value, private->orientation);
break;
case PROP_ORIENTATION:
g_value_set_enum (value, private->orientation);
break;
case PROP_SIZE:
g_value_set_int (value, private->size);
break;
case PROP_SIZE:
g_value_set_int (value, private->size);
break;
case PROP_SCREEN_POSITION:
g_value_set_enum (value, private->screen_position);
break;
case PROP_SCREEN_POSITION:
g_value_set_enum (value, private->screen_position);
break;
case PROP_EXPAND:
g_value_set_boolean (value, private->expand);
break;
case PROP_EXPAND:
g_value_set_boolean (value, private->expand);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -644,34 +644,34 @@ xfce_panel_plugin_set_property (GObject *object,
switch (prop_id)
{
case PROP_NAME:
private->name = g_value_dup_string (value);
break;
case PROP_DISPLAY_NAME:
private->display_name = g_value_dup_string (value);
break;
case PROP_COMMENT:
private->comment = g_value_dup_string (value);
break;
case PROP_UNIQUE_ID:
private->unique_id = g_value_get_int (value);
break;
case PROP_ARGUMENTS:
private->arguments = g_value_dup_boxed (value);
break;
case PROP_EXPAND:
xfce_panel_plugin_set_expand (XFCE_PANEL_PLUGIN (object),
g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_NAME:
private->name = g_value_dup_string (value);
break;
case PROP_DISPLAY_NAME:
private->display_name = g_value_dup_string (value);
break;
case PROP_COMMENT:
private->comment = g_value_dup_string (value);
break;
case PROP_UNIQUE_ID:
private->unique_id = g_value_get_int (value);
break;
case PROP_ARGUMENTS:
private->arguments = g_value_dup_boxed (value);
break;
case PROP_EXPAND:
xfce_panel_plugin_set_expand (XFCE_PANEL_PLUGIN (object),
g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -1876,21 +1876,21 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin,
switch (xfce_panel_plugin_arrow_type (plugin))
{
case GTK_ARROW_UP:
*y -= requisition.height;
break;
case GTK_ARROW_UP:
*y -= requisition.height;
break;
case GTK_ARROW_DOWN:
*y += attach_widget->allocation.height;
break;
case GTK_ARROW_DOWN:
*y += attach_widget->allocation.height;
break;
case GTK_ARROW_LEFT:
*x -= requisition.width;
break;
case GTK_ARROW_LEFT:
*x -= requisition.width;
break;
default: /* GTK_ARROW_RIGHT and GTK_ARROW_NONE */
*x += attach_widget->allocation.width;
break;
default: /* GTK_ARROW_RIGHT and GTK_ARROW_NONE */
*x += attach_widget->allocation.width;
break;
}
/* get the monitor geometry */

308
panel/panel-application.c

@ -464,91 +464,91 @@ panel_application_plugin_provider_signal (XfcePanelPluginProvider *provide
switch (provider_signal)
{
case PROVIDER_SIGNAL_MOVE_PLUGIN:
/* start plugin drag */
panel_application_plugin_move (GTK_WIDGET (provider), application);
break;
case PROVIDER_SIGNAL_EXPAND_PLUGIN:
case PROVIDER_SIGNAL_COLLAPSE_PLUGIN:
itembar = gtk_bin_get_child (GTK_BIN (window));
gtk_container_child_set (GTK_CONTAINER (itembar),
GTK_WIDGET (provider),
"expand",
provider_signal == PROVIDER_SIGNAL_EXPAND_PLUGIN,
NULL);
break;
case PROVIDER_SIGNAL_WRAP_PLUGIN:
case PROVIDER_SIGNAL_UNWRAP_PLUGIN:
itembar = gtk_bin_get_child (GTK_BIN (window));
gtk_container_child_set (GTK_CONTAINER (itembar),
GTK_WIDGET (provider),
"wrap",
provider_signal == PROVIDER_SIGNAL_WRAP_PLUGIN,
NULL);
break;
case PROVIDER_SIGNAL_LOCK_PANEL:
/* increase window's autohide counter */
panel_window_freeze_autohide (window);
break;
case PROVIDER_SIGNAL_UNLOCK_PANEL:
/* decrease window's autohide counter */
panel_window_thaw_autohide (window);
break;
case PROVIDER_SIGNAL_REMOVE_PLUGIN:
/* give plugin the opportunity to cleanup special configuration */
xfce_panel_plugin_provider_removed (provider);
/* store the provider's unique id and name (lost after destroy) */
unique_id = xfce_panel_plugin_provider_get_unique_id (provider);
name = g_strdup (xfce_panel_plugin_provider_get_name (provider));
/* destroy the plugin */
gtk_widget_destroy (GTK_WIDGET (provider));
/* remove the plugin configuration */
panel_application_plugin_delete_config (application, name, unique_id);
g_free (name);
break;
case PROVIDER_SIGNAL_ADD_NEW_ITEMS:
/* open the items dialog */
panel_item_dialog_show (window);
break;
case PROVIDER_SIGNAL_PANEL_PREFERENCES:
/* open the panel preferences */
panel_preferences_dialog_show (window);
break;
case PROVIDER_SIGNAL_PANEL_QUIT:
case PROVIDER_SIGNAL_PANEL_RESTART:
/* quit or restart */
panel_dbus_service_exit_panel (provider_signal == PROVIDER_SIGNAL_PANEL_RESTART);
break;
case PROVIDER_SIGNAL_PANEL_ABOUT:
/* show the about dialog */
panel_dialogs_show_about ();
break;
case PROVIDER_SIGNAL_FOCUS_PLUGIN:
/* focus the panel window (as part of focusing a widget within the plugin) */
gtk_window_present_with_time (GTK_WINDOW (window), GDK_CURRENT_TIME);
break;
case PROVIDER_SIGNAL_SHOW_CONFIGURE:
case PROVIDER_SIGNAL_SHOW_ABOUT:
/* signals we can ignore, only for external plugins */
break;
default:
g_critical ("Received unknown provider signal %d", provider_signal);
break;
case PROVIDER_SIGNAL_MOVE_PLUGIN:
/* start plugin drag */
panel_application_plugin_move (GTK_WIDGET (provider), application);
break;
case PROVIDER_SIGNAL_EXPAND_PLUGIN:
case PROVIDER_SIGNAL_COLLAPSE_PLUGIN:
itembar = gtk_bin_get_child (GTK_BIN (window));
gtk_container_child_set (GTK_CONTAINER (itembar),
GTK_WIDGET (provider),
"expand",
provider_signal == PROVIDER_SIGNAL_EXPAND_PLUGIN,
NULL);
break;
case PROVIDER_SIGNAL_WRAP_PLUGIN:
case PROVIDER_SIGNAL_UNWRAP_PLUGIN:
itembar = gtk_bin_get_child (GTK_BIN (window));
gtk_container_child_set (GTK_CONTAINER (itembar),
GTK_WIDGET (provider),
"wrap",
provider_signal == PROVIDER_SIGNAL_WRAP_PLUGIN,
NULL);
break;
case PROVIDER_SIGNAL_LOCK_PANEL:
/* increase window's autohide counter */
panel_window_freeze_autohide (window);
break;
case PROVIDER_SIGNAL_UNLOCK_PANEL:
/* decrease window's autohide counter */
panel_window_thaw_autohide (window);
break;
case PROVIDER_SIGNAL_REMOVE_PLUGIN:
/* give plugin the opportunity to cleanup special configuration */
xfce_panel_plugin_provider_removed (provider);
/* store the provider's unique id and name (lost after destroy) */
unique_id = xfce_panel_plugin_provider_get_unique_id (provider);
name = g_strdup (xfce_panel_plugin_provider_get_name (provider));
/* destroy the plugin */
gtk_widget_destroy (GTK_WIDGET (provider));
/* remove the plugin configuration */
panel_application_plugin_delete_config (application, name, unique_id);
g_free (name);
break;
case PROVIDER_SIGNAL_ADD_NEW_ITEMS:
/* open the items dialog */
panel_item_dialog_show (window);
break;
case PROVIDER_SIGNAL_PANEL_PREFERENCES:
/* open the panel preferences */
panel_preferences_dialog_show (window);
break;
case PROVIDER_SIGNAL_PANEL_QUIT:
case PROVIDER_SIGNAL_PANEL_RESTART:
/* quit or restart */
panel_dbus_service_exit_panel (provider_signal == PROVIDER_SIGNAL_PANEL_RESTART);
break;
case PROVIDER_SIGNAL_PANEL_ABOUT:
/* show the about dialog */
panel_dialogs_show_about ();
break;
case PROVIDER_SIGNAL_FOCUS_PLUGIN:
/* focus the panel window (as part of focusing a widget within the plugin) */
gtk_window_present_with_time (GTK_WINDOW (window), GDK_CURRENT_TIME);
break;
case PROVIDER_SIGNAL_SHOW_CONFIGURE:
case PROVIDER_SIGNAL_SHOW_ABOUT:
/* signals we can ignore, only for external plugins */
break;
default:
g_critical ("Received unknown provider signal %d", provider_signal);
break;
}
}
@ -758,77 +758,77 @@ panel_application_drag_data_received (PanelWindow *window,
switch (info)
{
case TARGET_PLUGIN_NAME:
if (G_LIKELY (selection_data->length > 0))
{
/* create a new item with a unique id */
name = (const gchar *) selection_data->data;
succeed = panel_application_plugin_insert (application, window,
screen, name,
-1, NULL, position);
}
break;
case TARGET_PLUGIN_WIDGET:
/* get the source widget */
provider = gtk_drag_get_source_widget (context);
/* debug check */
panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (provider));
/* check if we move to another itembar */
if (gtk_widget_get_parent (provider) == itembar)
{
/* get the current position on the itembar */
old_position = panel_itembar_get_child_index (PANEL_ITEMBAR (itembar),
provider);
/* decrease the counter if we drop after the current position */
if (position > old_position)
position--;
/* reorder the child if needed */
if (old_position != position)
panel_itembar_reorder_child (PANEL_ITEMBAR (itembar), provider, position);
}
else
{
/* reparent the widget, this will also call remove and add for the itembar */
gtk_widget_reparent (provider, itembar);
/* move the item to the correct position on the itembar */
case TARGET_PLUGIN_NAME:
if (G_LIKELY (selection_data->length > 0))
{
/* create a new item with a unique id */
name = (const gchar *) selection_data->data;
succeed = panel_application_plugin_insert (application, window,
screen, name,
-1, NULL, position);
}
break;
case TARGET_PLUGIN_WIDGET:
/* get the source widget */
provider = gtk_drag_get_source_widget (context);
/* debug check */
panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (provider));
/* check if we move to another itembar */
if (gtk_widget_get_parent (provider) == itembar)
{
/* get the current position on the itembar */
old_position = panel_itembar_get_child_index (PANEL_ITEMBAR (itembar),
provider);
/* decrease the counter if we drop after the current position */
if (position > old_position)
position--;
/* reorder the child if needed */
if (old_position != position)
panel_itembar_reorder_child (PANEL_ITEMBAR (itembar), provider, position);
}
else
{
/* reparent the widget, this will also call remove and add for the itembar */
gtk_widget_reparent (provider, itembar);
/* move the item to the correct position on the itembar */
panel_itembar_reorder_child (PANEL_ITEMBAR (itembar), provider, position);
/* send all the needed panel information to the plugin */
panel_window_set_povider_info (window, provider);
}
/* everything went fine */
succeed = TRUE;
break;
case TARGET_TEXT_URI_LIST:
if (G_LIKELY (application->drop_desktop_files))
{
/* pass all the uris to the launcher, it will filter out
* the desktop files on it's own */
uris = gtk_selection_data_get_uris (selection_data);
if (G_LIKELY (uris != NULL))
{
/* create a new item with a unique id */
succeed = panel_application_plugin_insert (application, window,
screen, LAUNCHER_PLUGIN_NAME,
-1, uris, position);
g_strfreev (uris);
}
application->drop_desktop_files = FALSE;
}
break;
/* send all the needed panel information to the plugin */
panel_window_set_povider_info (window, provider);
}
/* everything went fine */
succeed = TRUE;
break;
case TARGET_TEXT_URI_LIST:
if (G_LIKELY (application->drop_desktop_files))
{
/* pass all the uris to the launcher, it will filter out
* the desktop files on it's own */
uris = gtk_selection_data_get_uris (selection_data);
if (G_LIKELY (uris != NULL))
{
/* create a new item with a unique id */
succeed = panel_application_plugin_insert (application, window,
screen, LAUNCHER_PLUGIN_NAME,
-1, uris, position);
g_strfreev (uris);
}
application->drop_desktop_files = FALSE;
}
break;
default:
panel_assert_not_reached ();
break;
default:
panel_assert_not_reached ();
break;
}
/* save the panel configuration if we succeeded */

154
panel/panel-base-window.c

@ -188,33 +188,33 @@ panel_base_window_get_property (GObject *object,
switch (prop_id)
{
case PROP_ENTER_OPACITY:
g_value_set_uint (value, rint (priv->enter_opacity * 100.00));
break;
case PROP_ENTER_OPACITY:
g_value_set_uint (value, rint (priv->enter_opacity * 100.00));
break;
case PROP_LEAVE_OPACITY:
g_value_set_uint (value, rint (priv->leave_opacity * 100.00));
break;
case PROP_LEAVE_OPACITY:
g_value_set_uint (value, rint (priv->leave_opacity * 100.00));
break;
case PROP_BACKGROUND_ALPHA:
g_value_set_uint (value, rint (window->background_alpha * 100.00));
break;
case PROP_BACKGROUND_ALPHA:
g_value_set_uint (value, rint (window->background_alpha * 100.00));
break;
case PROP_BORDERS:
g_value_set_uint (value, priv->borders);
break;
case PROP_BORDERS:
g_value_set_uint (value, priv->borders);
break;
case PROP_ACTIVE:
g_value_set_boolean (value, !!(priv->active_timeout_id != 0));
break;
case PROP_ACTIVE:
g_value_set_boolean (value, !!(priv->active_timeout_id != 0));
break;
case PROP_COMPOSITED:
g_value_set_boolean (value, window->is_composited);
break;
case PROP_COMPOSITED:
g_value_set_boolean (value, window->is_composited);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -232,62 +232,62 @@ panel_base_window_set_property (GObject *object,
switch (prop_id)
{
case PROP_ENTER_OPACITY:
/* set the new enter opacity */
priv->enter_opacity = g_value_get_uint (value) / 100.00;
break;
case PROP_LEAVE_OPACITY:
/* set the new leave opacity */
priv->leave_opacity = g_value_get_uint (value) / 100.00;
if (window->is_composited)
gtk_window_set_opacity (GTK_WINDOW (object), priv->leave_opacity);
break;
case PROP_BACKGROUND_ALPHA:
/* set the new background alpha */
window->background_alpha = g_value_get_uint (value) / 100.00;
if (window->is_composited)
gtk_widget_queue_draw (GTK_WIDGET (object));
/* send the new background alpha to the external plugins */
itembar = gtk_bin_get_child (GTK_BIN (window));
if (G_LIKELY (itembar != NULL))
gtk_container_foreach (GTK_CONTAINER (itembar),
panel_base_window_set_plugin_background_alpha, window);
break;
case PROP_BORDERS:
/* set new window borders and redraw the widget */
panel_base_window_set_borders (PANEL_BASE_WINDOW (object),
g_value_get_uint (value));
break;
case PROP_ACTIVE:
if (g_value_get_boolean (value))
{
if (priv->active_timeout_id == 0)
{
/* start timeout for the marching ants selection */
priv->active_timeout_id = g_timeout_add_seconds_full (
G_PRIORITY_DEFAULT_IDLE, 1,
panel_base_window_active_timeout, object,
panel_base_window_active_timeout_destroyed);
}
}
else if (priv->active_timeout_id != 0)
{
/* stop timeout */
g_source_remove (priv->active_timeout_id);
}
/* queue a draw for first second */
gtk_widget_queue_resize (GTK_WIDGET (object));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_ENTER_OPACITY:
/* set the new enter opacity */
priv->enter_opacity = g_value_get_uint (value) / 100.00;
break;
case PROP_LEAVE_OPACITY:
/* set the new leave opacity */
priv->leave_opacity = g_value_get_uint (value) / 100.00;
if (window->is_composited)
gtk_window_set_opacity (GTK_WINDOW (object), priv->leave_opacity);
break;
case PROP_BACKGROUND_ALPHA:
/* set the new background alpha */
window->background_alpha = g_value_get_uint (value) / 100.00;
if (window->is_composited)
gtk_widget_queue_draw (GTK_WIDGET (object));
/* send the new background alpha to the external plugins */
itembar = gtk_bin_get_child (GTK_BIN (window));
if (G_LIKELY (itembar != NULL))
gtk_container_foreach (GTK_CONTAINER (itembar),
panel_base_window_set_plugin_background_alpha, window);
break;
case PROP_BORDERS:
/* set new window borders and redraw the widget */
panel_base_window_set_borders (PANEL_BASE_WINDOW (object),
g_value_get_uint (value));
break;
case PROP_ACTIVE:
if (g_value_get_boolean (value))
{
if (priv->active_timeout_id == 0)
{
/* start timeout for the marching ants selection */
priv->active_timeout_id = g_timeout_add_seconds_full (
G_PRIORITY_DEFAULT_IDLE, 1,
panel_base_window_active_timeout, object,
panel_base_window_active_timeout_destroyed);
}
}
else if (priv->active_timeout_id != 0)
{
/* stop timeout */
g_source_remove (priv->active_timeout_id);
}
/* queue a draw for first second */
gtk_widget_queue_resize (GTK_WIDGET (object));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}

76
panel/panel-itembar.c

@ -219,17 +219,17 @@ panel_itembar_set_property (GObject *object,
switch (prop_id)
{
case PROP_HORIZONTAL:
itembar->horizontal = g_value_get_boolean (value);
break;
case PROP_HORIZONTAL:
itembar->horizontal = g_value_get_boolean (value);
break;
case PROP_SIZE:
itembar->size = g_value_get_uint (value);
break;
case PROP_SIZE:
itembar->size = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
gtk_widget_queue_resize (GTK_WIDGET (itembar));
@ -245,9 +245,9 @@ panel_itembar_get_property (GObject *object,
{
switch (prop_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -640,23 +640,23 @@ panel_itembar_set_child_property (GtkContainer *container,
switch (prop_id)
{
case CHILD_PROP_EXPAND:
boolean = g_value_get_boolean (value);
if (child->expand == boolean)
return;
child->expand = boolean;
break;
case CHILD_PROP_WRAP:
boolean = g_value_get_boolean (value);
if (child->wrap == boolean)
return;
child->wrap = boolean;
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (container, prop_id, pspec);
break;
case CHILD_PROP_EXPAND:
boolean = g_value_get_boolean (value);
if (child->expand == boolean)
return;
child->expand = boolean;
break;
case CHILD_PROP_WRAP:
boolean = g_value_get_boolean (value);
if (child->wrap == boolean)
return;
child->wrap = boolean;
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (container, prop_id, pspec);
break;
}
gtk_widget_queue_resize (GTK_WIDGET (container));
@ -679,17 +679,17 @@ panel_itembar_get_child_property (GtkContainer *container,
switch (prop_id)
{
case CHILD_PROP_EXPAND:
g_value_set_boolean (value, child->expand);
break;
case CHILD_PROP_EXPAND:
g_value_set_boolean (value, child->expand);
break;
case CHILD_PROP_WRAP:
g_value_set_boolean (value, child->wrap);
break;
case CHILD_PROP_WRAP:
g_value_set_boolean (value, child->wrap);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (container, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (container, prop_id, pspec);
break;
}
}

90
panel/panel-module.c

@ -404,51 +404,51 @@ panel_module_new_plugin (PanelModule *module,
switch (module->mode)
{
case INTERNAL:
if (g_type_module_use (G_TYPE_MODULE (module)))
{
if (module->plugin_type != G_TYPE_NONE)
{
/* plugin is build as an object, to use its gtype */
plugin = g_object_new (module->plugin_type,
"name", panel_module_get_name (module),
"unique-id", unique_id,
"display-name", module->display_name,
"comment", module->comment,
"arguments", arguments,
NULL);
}
else if (module->construct_func != NULL)
{
/* create plugin using the 'old style' construct function */
plugin = (*module->construct_func) (panel_module_get_name (module),
unique_id,
module->display_name,
module->comment,
arguments,
screen);
}
if (G_LIKELY (plugin != NULL))
break;
else
g_type_module_unuse (G_TYPE_MODULE (module));
}
/* fall-through (make wrapper plugin), probably a plugin with
* preinit_func which is not supported for internal plugins */
case WRAPPER:
plugin = panel_plugin_external_new (module, unique_id, arguments);
break;
case EXTERNAL_46:
plugin = panel_plugin_external_46_new (module, unique_id, arguments);
break;
default:
panel_assert_not_reached ();
break;
case INTERNAL:
if (g_type_module_use (G_TYPE_MODULE (module)))
{
if (module->plugin_type != G_TYPE_NONE)
{
/* plugin is build as an object, to use its gtype */
plugin = g_object_new (module->plugin_type,
"name", panel_module_get_name (module),
"unique-id", unique_id,
"display-name", module->display_name,
"comment", module->comment,
"arguments", arguments,
NULL);
}
else if (module->construct_func != NULL)
{
/* create plugin using the 'old style' construct function */
plugin = (*module->construct_func) (panel_module_get_name (module),
unique_id,
module->display_name,
module->comment,
arguments,
screen);
}
if (G_LIKELY (plugin != NULL))
break;
else
g_type_module_unuse (G_TYPE_MODULE (module));
}
/* fall-through (make wrapper plugin), probably a plugin with
* preinit_func which is not supported for internal plugins */
case WRAPPER:
plugin = panel_plugin_external_new (module, unique_id, arguments);
break;
case EXTERNAL_46:
plugin = panel_plugin_external_46_new (module, unique_id, arguments);
break;
default:
panel_assert_not_reached ();
break;
}
if (G_LIKELY (plugin != NULL))

92
panel/panel-plugin-external-46.c

@ -281,21 +281,21 @@ panel_plugin_external_46_get_property (GObject *object,
switch (prop_id)
{
case PROP_UNIQUE_ID:
g_value_set_int (value, external->unique_id);
break;
case PROP_UNIQUE_ID:
g_value_set_int (value, external->unique_id);
break;
case PROP_ARGUMENTS:
g_value_set_boxed (value, external->arguments);
break;
case PROP_ARGUMENTS:
g_value_set_boxed (value, external->arguments);
break;
case PROP_MODULE:
g_value_set_object (value, external->module);
break;
case PROP_MODULE:
g_value_set_object (value, external->module);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -311,21 +311,21 @@ panel_plugin_external_46_set_property (GObject *object,
switch (prop_id)
{
case PROP_UNIQUE_ID:
external->unique_id = g_value_get_int (value);
break;
case PROP_UNIQUE_ID:
external->unique_id = g_value_get_int (value);
break;
case PROP_ARGUMENTS:
external->arguments = g_value_dup_boxed (value);
break;
case PROP_ARGUMENTS:
external->arguments = g_value_dup_boxed (value);
break;
case PROP_MODULE:
external->module = g_value_dup_object (value);
break;
case PROP_MODULE:
external->module = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -409,19 +409,19 @@ panel_plugin_external_46_client_event (GtkWidget *widget,
switch (provider_signal)
{
case PROVIDER_SIGNAL_SHOW_CONFIGURE:
external->show_configure = TRUE;
break;
case PROVIDER_SIGNAL_SHOW_ABOUT:
external->show_about = TRUE;
break;
default:
/* other signals are handled in panel-applications.c */
xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (external),
provider_signal);
break;
case PROVIDER_SIGNAL_SHOW_CONFIGURE:
external->show_configure = TRUE;
break;
case PROVIDER_SIGNAL_SHOW_ABOUT:
external->show_about = TRUE;
break;
default:
/* other signals are handled in panel-applications.c */
xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (external),
provider_signal);
break;
}
return FALSE;
@ -768,15 +768,15 @@ panel_plugin_external_46_child_watch (GPid pid,
/* extract our return value from the status */
switch (WEXITSTATUS (status))
{
case PLUGIN_EXIT_SUCCESS:
case PLUGIN_EXIT_FAILURE:
case PLUGIN_EXIT_PREINIT_FAILED:
case PLUGIN_EXIT_CHECK_FAILED:
case PLUGIN_EXIT_NO_PROVIDER:
/* wait until everything is settled, then destroy the
* external plugin so it is removed from the configuration */
exo_gtk_object_destroy_later (GTK_OBJECT (external));
break;
case PLUGIN_EXIT_SUCCESS:
case PLUGIN_EXIT_FAILURE:
case PLUGIN_EXIT_PREINIT_FAILED:
case PLUGIN_EXIT_CHECK_FAILED:
case PLUGIN_EXIT_NO_PROVIDER:
/* wait until everything is settled, then destroy the
* external plugin so it is removed from the configuration */
exo_gtk_object_destroy_later (GTK_OBJECT (external));
break;
}
}

92
panel/panel-plugin-external.c

@ -348,21 +348,21 @@ panel_plugin_external_get_property (GObject *object,
switch (prop_id)
{
case PROP_UNIQUE_ID:
g_value_set_int (value, external->unique_id);
break;
case PROP_UNIQUE_ID:
g_value_set_int (value, external->unique_id);
break;
case PROP_ARGUMENTS:
g_value_set_boxed (value, external->arguments);
break;
case PROP_ARGUMENTS:
g_value_set_boxed (value, external->arguments);
break;
case PROP_MODULE:
g_value_set_object (value, external->module);
break;
case PROP_MODULE:
g_value_set_object (value, external->module);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -378,21 +378,21 @@ panel_plugin_external_set_property (GObject *object,
switch (prop_id)
{
case PROP_UNIQUE_ID:
external->unique_id = g_value_get_int (value);
break;
case PROP_UNIQUE_ID:
external->unique_id = g_value_get_int (value);
break;
case PROP_ARGUMENTS:
external->arguments = g_value_dup_boxed (value);
break;
case PROP_ARGUMENTS:
external->arguments = g_value_dup_boxed (value);
break;
case PROP_MODULE:
external->module = g_value_dup_object (value);
break;
case PROP_MODULE:
external->module = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -576,19 +576,19 @@ panel_plugin_external_dbus_provider_signal (PanelPluginExternal *exte
switch (provider_signal)
{
case PROVIDER_SIGNAL_SHOW_CONFIGURE:
external->show_configure = TRUE;
break;
case PROVIDER_SIGNAL_SHOW_ABOUT:
external->show_about = TRUE;
break;
default:
/* other signals are handled in panel-applications.c */
xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (external),
provider_signal);
break;
case PROVIDER_SIGNAL_SHOW_CONFIGURE:
external->show_configure = TRUE;
break;
case PROVIDER_SIGNAL_SHOW_ABOUT:
external->show_about = TRUE;
break;
default:
/* other signals are handled in panel-applications.c */
xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (external),
provider_signal);
break;
}
return TRUE;
@ -887,15 +887,15 @@ panel_plugin_external_child_watch (GPid pid,
/* extract our return value from the status */
switch (WEXITSTATUS (status))
{
case PLUGIN_EXIT_SUCCESS:
case PLUGIN_EXIT_FAILURE:
case PLUGIN_EXIT_PREINIT_FAILED:
case PLUGIN_EXIT_CHECK_FAILED:
case PLUGIN_EXIT_NO_PROVIDER:
/* wait until everything is settled, then destroy the
* external plugin so it is removed from the configuration */
exo_gtk_object_destroy_later (GTK_OBJECT (external));
break;
case PLUGIN_EXIT_SUCCESS:
case PLUGIN_EXIT_FAILURE:
case PLUGIN_EXIT_PREINIT_FAILED:
case PLUGIN_EXIT_CHECK_FAILED:
case PLUGIN_EXIT_NO_PROVIDER:
/* wait until everything is settled, then destroy the
* external plugin so it is removed from the configuration */
exo_gtk_object_destroy_later (GTK_OBJECT (external));
break;
}
}

632
panel/panel-window.c

@ -441,49 +441,49 @@ panel_window_get_property (GObject *object,
switch (prop_id)
{
case PROP_HORIZONTAL:
g_value_set_boolean (value, window->horizontal);
break;
case PROP_SIZE:
g_value_set_uint (value, window->size);
break;
case PROP_LENGTH:
g_value_set_uint (value, rint (window->length * 100.00));
break;
case PROP_LOCKED:
g_value_set_boolean (value, window->locked);
break;
case PROP_AUTOHIDE:
g_value_set_boolean (value, !!(window->autohide_state != AUTOHIDE_DISABLED));
break;
case PROP_SPAN_MONITORS:
g_value_set_boolean (value, window->span_monitors);
break;
case PROP_OUTPUT_NAME:
g_value_set_static_string (value, window->output_name);
break;
case PROP_POSITION:
position = g_strdup_printf ("p=%d;x=%d;y=%d",
window->snap_position,
window->base_x,
window->base_y);
g_value_take_string (value, position);
break;
case PROP_DISABLE_STRUTS:
g_value_set_boolean (value, window->struts_disabled);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_HORIZONTAL:
g_value_set_boolean (value, window->horizontal);
break;
case PROP_SIZE:
g_value_set_uint (value, window->size);
break;
case PROP_LENGTH:
g_value_set_uint (value, rint (window->length * 100.00));
break;
case PROP_LOCKED:
g_value_set_boolean (value, window->locked);
break;
case PROP_AUTOHIDE:
g_value_set_boolean (value, !!(window->autohide_state != AUTOHIDE_DISABLED));
break;
case PROP_SPAN_MONITORS:
g_value_set_boolean (value, window->span_monitors);
break;
case PROP_OUTPUT_NAME:
g_value_set_static_string (value, window->output_name);
break;
case PROP_POSITION:
position = g_strdup_printf ("p=%d;x=%d;y=%d",
window->snap_position,
window->base_x,
window->base_y);
g_value_take_string (value, position);
break;
case PROP_DISABLE_STRUTS:
g_value_set_boolean (value, window->struts_disabled);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@ -506,120 +506,120 @@ panel_window_set_property (GObject *object,