[Xfce4-commits] r24981 - libxfcegui4/trunk/libxfcegui4
Author: olivier Date: 2007-02-16 20:35:00 + (Fri, 16 Feb 2007) New Revision: 24981 Modified: libxfcegui4/trunk/libxfcegui4/netk-pager.c Log: Fix aspect ratio of the pager when using viewports, required for window managers such as Beryl that use multiple viewports within one single workspace Modified: libxfcegui4/trunk/libxfcegui4/netk-pager.c === --- libxfcegui4/trunk/libxfcegui4/netk-pager.c 2007-02-14 23:41:54 UTC (rev 24980) +++ libxfcegui4/trunk/libxfcegui4/netk-pager.c 2007-02-16 20:35:00 UTC (rev 24981) @@ -262,6 +262,7 @@ int size; int n_rows; int focus_width; +NetkWorkspace *space; pager = NETK_PAGER (widget); @@ -270,12 +271,22 @@ g_assert (pager->priv->n_rows > 0); spaces_per_row = (n_spaces + pager->priv->n_rows - 1) / pager->priv->n_rows; +space = netk_screen_get_workspace (pager->priv->screen, 0); if (pager->priv->orientation == GTK_ORIENTATION_VERTICAL) { -screen_aspect = -(double) netk_screen_get_height (pager->priv->screen) / -(double) netk_screen_get_width (pager->priv->screen); +if (space) +{ +screen_aspect = + (double) netk_workspace_get_height (space) / + (double) netk_workspace_get_width (space); +} +else +{ +screen_aspect = + (double) netk_screen_get_height (pager->priv->screen) / + (double) netk_screen_get_width (pager->priv->screen); +} /* TODO: Handle NETK_PAGER_DISPLAY_NAME for this case */ @@ -299,9 +310,18 @@ } else { -screen_aspect = -(double) netk_screen_get_width (pager->priv->screen) / -(double) netk_screen_get_height (pager->priv->screen); +if (space) +{ +screen_aspect = + (double) netk_workspace_get_width (space) / + (double) netk_workspace_get_height (space); +} +else +{ +screen_aspect = + (double) netk_screen_get_width (pager->priv->screen) / + (double) netk_screen_get_height (pager->priv->screen); +} if (pager->priv->show_all_workspaces) { @@ -390,16 +410,14 @@ if (pager->priv->orientation == GTK_ORIENTATION_VERTICAL) { if (pager->priv->show_all_workspaces) -workspace_size = -(width - (pager->priv->n_rows - 1)) / pager->priv->n_rows; +workspace_size = (width - (pager->priv->n_rows - 1)) / pager->priv->n_rows; else workspace_size = width; } else { if (pager->priv->show_all_workspaces) -workspace_size = -(height - (pager->priv->n_rows - 1)) / pager->priv->n_rows; +workspace_size = (height - (pager->priv->n_rows - 1)) / pager->priv->n_rows; else workspace_size = height; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r24982 - libxfcegui4/branches/xfce_4_4/libxfcegui4
Author: olivier Date: 2007-02-16 20:38:50 + (Fri, 16 Feb 2007) New Revision: 24982 Modified: libxfcegui4/branches/xfce_4_4/libxfcegui4/netk-pager.c Log: Fix aspect ratio of the pager when using viewports, required for window managers such as Beryl that use multiple viewports within one single workspace Modified: libxfcegui4/branches/xfce_4_4/libxfcegui4/netk-pager.c === --- libxfcegui4/branches/xfce_4_4/libxfcegui4/netk-pager.c 2007-02-16 20:35:00 UTC (rev 24981) +++ libxfcegui4/branches/xfce_4_4/libxfcegui4/netk-pager.c 2007-02-16 20:38:50 UTC (rev 24982) @@ -262,6 +262,7 @@ int size; int n_rows; int focus_width; +NetkWorkspace *space; pager = NETK_PAGER (widget); @@ -270,12 +271,22 @@ g_assert (pager->priv->n_rows > 0); spaces_per_row = (n_spaces + pager->priv->n_rows - 1) / pager->priv->n_rows; +space = netk_screen_get_workspace (pager->priv->screen, 0); if (pager->priv->orientation == GTK_ORIENTATION_VERTICAL) { -screen_aspect = -(double) netk_screen_get_height (pager->priv->screen) / -(double) netk_screen_get_width (pager->priv->screen); +if (space) +{ +screen_aspect = + (double) netk_workspace_get_height (space) / + (double) netk_workspace_get_width (space); +} +else +{ +screen_aspect = + (double) netk_screen_get_height (pager->priv->screen) / + (double) netk_screen_get_width (pager->priv->screen); +} /* TODO: Handle NETK_PAGER_DISPLAY_NAME for this case */ @@ -299,9 +310,18 @@ } else { -screen_aspect = -(double) netk_screen_get_width (pager->priv->screen) / -(double) netk_screen_get_height (pager->priv->screen); +if (space) +{ +screen_aspect = + (double) netk_workspace_get_width (space) / + (double) netk_workspace_get_height (space); +} +else +{ +screen_aspect = + (double) netk_screen_get_width (pager->priv->screen) / + (double) netk_screen_get_height (pager->priv->screen); +} if (pager->priv->show_all_workspaces) { @@ -390,16 +410,14 @@ if (pager->priv->orientation == GTK_ORIENTATION_VERTICAL) { if (pager->priv->show_all_workspaces) -workspace_size = -(width - (pager->priv->n_rows - 1)) / pager->priv->n_rows; +workspace_size = (width - (pager->priv->n_rows - 1)) / pager->priv->n_rows; else workspace_size = width; } else { if (pager->priv->show_all_workspaces) -workspace_size = -(height - (pager->priv->n_rows - 1)) / pager->priv->n_rows; +workspace_size = (height - (pager->priv->n_rows - 1)) / pager->priv->n_rows; else workspace_size = height; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r24983 - libxfcegui4/branches/xfce_4_2/libxfcegui4
Author: olivier Date: 2007-02-16 20:41:46 + (Fri, 16 Feb 2007) New Revision: 24983 Modified: libxfcegui4/branches/xfce_4_2/libxfcegui4/netk-pager.c Log: Fix aspect ratio of the pager when using viewports, required for window managers such as Beryl that use multiple viewports within one single workspace Modified: libxfcegui4/branches/xfce_4_2/libxfcegui4/netk-pager.c === --- libxfcegui4/branches/xfce_4_2/libxfcegui4/netk-pager.c 2007-02-16 20:38:50 UTC (rev 24982) +++ libxfcegui4/branches/xfce_4_2/libxfcegui4/netk-pager.c 2007-02-16 20:41:46 UTC (rev 24983) @@ -265,6 +265,7 @@ int size; int n_rows; int focus_width; +NetkWorkspace *space; pager = NETK_PAGER (widget); @@ -273,12 +274,22 @@ g_assert (pager->priv->n_rows > 0); spaces_per_row = (n_spaces + pager->priv->n_rows - 1) / pager->priv->n_rows; +space = netk_screen_get_workspace (pager->priv->screen, 0); if (pager->priv->orientation == GTK_ORIENTATION_VERTICAL) { -screen_aspect = -(double) netk_screen_get_height (pager->priv->screen) / -(double) netk_screen_get_width (pager->priv->screen); +if (space) +{ +screen_aspect = + (double) netk_workspace_get_height (space) / + (double) netk_workspace_get_width (space); +} +else +{ +screen_aspect = + (double) netk_screen_get_height (pager->priv->screen) / + (double) netk_screen_get_width (pager->priv->screen); +} /* TODO: Handle NETK_PAGER_DISPLAY_NAME for this case */ @@ -302,9 +313,18 @@ } else { -screen_aspect = -(double) netk_screen_get_width (pager->priv->screen) / -(double) netk_screen_get_height (pager->priv->screen); +if (space) +{ +screen_aspect = + (double) netk_workspace_get_width (space) / + (double) netk_workspace_get_height (space); +} +else +{ +screen_aspect = + (double) netk_screen_get_width (pager->priv->screen) / + (double) netk_screen_get_height (pager->priv->screen); +} if (pager->priv->show_all_workspaces) { @@ -393,16 +413,14 @@ if (pager->priv->orientation == GTK_ORIENTATION_VERTICAL) { if (pager->priv->show_all_workspaces) -workspace_size = -(width - (pager->priv->n_rows - 1)) / pager->priv->n_rows; +workspace_size = (width - (pager->priv->n_rows - 1)) / pager->priv->n_rows; else workspace_size = width; } else { if (pager->priv->show_all_workspaces) -workspace_size = -(height - (pager->priv->n_rows - 1)) / pager->priv->n_rows; +workspace_size = (height - (pager->priv->n_rows - 1)) / pager->priv->n_rows; else workspace_size = height; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r24984 - squeeze/trunk/libsqueeze
Author: peter Date: 2007-02-16 21:26:20 + (Fri, 16 Feb 2007) New Revision: 24984 Modified: squeeze/trunk/libsqueeze/archive-iter.c squeeze/trunk/libsqueeze/archive.c squeeze/trunk/libsqueeze/libsqueeze-view.h Log: added lsq_archive_iter_get_path Modified: squeeze/trunk/libsqueeze/archive-iter.c === --- squeeze/trunk/libsqueeze/archive-iter.c 2007-02-16 20:41:46 UTC (rev 24983) +++ squeeze/trunk/libsqueeze/archive-iter.c 2007-02-16 21:26:20 UTC (rev 24984) @@ -560,6 +560,54 @@ } } +guint +lsq_archive_iter_get_depth(const LSQArchiveIter *iter) +{ +#ifdef debug + g_return_val_if_fail(iter, 0); +#endif + guint depth = 0; + while((iter = iter->parent)) + depth++; + return depth; +} + +gchar* +lsq_archive_iter_get_path(const LSQArchiveIter *iter) +{ +#ifdef debug + g_return_val_if_fail(iter, NULL); +#endif + const gchar **list; + gchar *path; + guint depth = lsq_archive_iter_get_depth(iter); + + if(lsq_archive_iter_is_directory(iter)) + { + list = g_new(const gchar*, depth+2); + list[depth] = ""; + list[depth+1] = NULL; + } + else + { + list = g_new(const gchar*, depth+1); + list[depth] = NULL; + } + + while(depth > 0) + { + depth--; + list[depth] = lsq_archive_entry_get_filename(iter->entry); + iter = iter->parent; + } + + path = g_strjoinv("/", (gchar**)list); + + g_free(list); + + return path; +} + const gchar* lsq_archive_iter_get_filename(const LSQArchiveIter *iter) { Modified: squeeze/trunk/libsqueeze/archive.c === --- squeeze/trunk/libsqueeze/archive.c 2007-02-16 20:41:46 UTC (rev 24983) +++ squeeze/trunk/libsqueeze/archive.c 2007-02-16 21:26:20 UTC (rev 24984) @@ -438,7 +438,13 @@ } const gchar * -lsq_archive_get_mimetype(LSQArchive *archive) +lsq_archive_get_filename(const LSQArchive *archive) { + return archive->path; +} + +const gchar * +lsq_archive_get_mimetype(const LSQArchive *archive) +{ return thunar_vfs_mime_info_get_name(archive->mime_info); } Modified: squeeze/trunk/libsqueeze/libsqueeze-view.h === --- squeeze/trunk/libsqueeze/libsqueeze-view.h 2007-02-16 20:41:46 UTC (rev 24983) +++ squeeze/trunk/libsqueeze/libsqueeze-view.h 2007-02-16 21:26:20 UTC (rev 24984) @@ -17,8 +17,8 @@ #define __LIBSQUEEZE_VIEW_H__ G_BEGIN_DECLS -const gchar * lsq_archive_get_filename(LSQArchive *archive); -const gchar * lsq_archive_get_mimetype(LSQArchive *archive); +const gchar*lsq_archive_get_filename(const LSQArchive *archive); +const gchar*lsq_archive_get_mimetype(const LSQArchive *archive); gbooleanlsq_archive_iter_is_real(const LSQArchiveIter *); LSQArchiveIter *lsq_archive_iter_get_real_parent(LSQArchiveIter *); @@ -27,9 +27,11 @@ guint lsq_archive_iter_n_children(const LSQArchiveIter *); LSQArchiveIter *lsq_archive_iter_nth_child(LSQArchiveIter *, guint); LSQArchiveIter *lsq_archive_iter_get_child(LSQArchiveIter *, const gchar *); +guint lsq_archive_iter_get_depth(const LSQArchiveIter *); gbooleanlsq_archive_iter_get_prop_value(const LSQArchiveIter *iter, guint n, GValue *value); const gchar*lsq_archive_iter_get_filename(const LSQArchiveIter *); +gchar *lsq_archive_iter_get_path(const LSQArchiveIter *archive); LSQArchiveIter *lsq_archive_get_iter(LSQArchive *archive, const gchar *path); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits