Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gtk
Commits
4be48e0e
Commit
4be48e0e
authored
Oct 19, 2004
by
Matthias Clasen
Browse files
Add a "display" option.
* tests/testicontheme.c: Add a "display" option.
parent
6fc2b811
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
4be48e0e
...
...
@@ -24,6 +24,8 @@
*
gtk
/
gtkiconcache
.
c
:
The
glue
code
to
mmap
an
icon
cache
file
and
manage
the
information
it
contains
.
*
tests
/
testicontheme
.
c
:
Add
a
"display"
option
.
2004
-
10
-
19
Matthias
Clasen
<
mclasen
@
redhat
.
com
>
*
tests
/
testicontheme
.
c
:
Set
the
locale
,
tidy
up
output
.
...
...
ChangeLog.pre-2-10
View file @
4be48e0e
...
...
@@ -24,6 +24,8 @@
*
gtk
/
gtkiconcache
.
c
:
The
glue
code
to
mmap
an
icon
cache
file
and
manage
the
information
it
contains
.
*
tests
/
testicontheme
.
c
:
Add
a
"display"
option
.
2004
-
10
-
19
Matthias
Clasen
<
mclasen
@
redhat
.
com
>
*
tests
/
testicontheme
.
c
:
Set
the
locale
,
tidy
up
output
.
...
...
ChangeLog.pre-2-6
View file @
4be48e0e
...
...
@@ -24,6 +24,8 @@
*
gtk
/
gtkiconcache
.
c
:
The
glue
code
to
mmap
an
icon
cache
file
and
manage
the
information
it
contains
.
*
tests
/
testicontheme
.
c
:
Add
a
"display"
option
.
2004
-
10
-
19
Matthias
Clasen
<
mclasen
@
redhat
.
com
>
*
tests
/
testicontheme
.
c
:
Set
the
locale
,
tidy
up
output
.
...
...
ChangeLog.pre-2-8
View file @
4be48e0e
...
...
@@ -24,6 +24,8 @@
*
gtk
/
gtkiconcache
.
c
:
The
glue
code
to
mmap
an
icon
cache
file
and
manage
the
information
it
contains
.
*
tests
/
testicontheme
.
c
:
Add
a
"display"
option
.
2004
-
10
-
19
Matthias
Clasen
<
mclasen
@
redhat
.
com
>
*
tests
/
testicontheme
.
c
:
Set
the
locale
,
tidy
up
output
.
...
...
tests/testicontheme.c
View file @
4be48e0e
#include
<config.h>
#include
<gtk/gtkicontheme.h>
#include
<gtk/gtk.h>
#include
<stdlib.h>
#include
<string.h>
#include
<locale.h>
...
...
@@ -9,7 +8,10 @@ usage (void)
{
g_print
(
"usage: test-icon-theme lookup <theme name> <icon name> [size]]
\n
"
" or
\n
"
"usage: test-icon-theme list <theme name> [context]
\n
"
);
"usage: test-icon-theme list <theme name> [context]
\n
"
" or
\n
"
"usage: test-icon-theme display <theme name> <icon name> [size]
\n
"
);
}
...
...
@@ -28,8 +30,7 @@ main (int argc, char *argv[])
int
size
=
48
;
int
i
;
g_type_init
();
setlocale
(
LC_ALL
,
""
);
gtk_init
(
&
argc
,
&
argv
);
if
(
argc
<
3
)
{
...
...
@@ -43,7 +44,37 @@ main (int argc, char *argv[])
gtk_icon_theme_set_custom_theme
(
icon_theme
,
themename
);
if
(
strcmp
(
argv
[
1
],
"list"
)
==
0
)
if
(
strcmp
(
argv
[
1
],
"display"
)
==
0
)
{
GtkWidget
*
window
,
*
image
;
GtkIconSize
size
;
GdkPixbuf
*
pixbuf
;
if
(
argc
<
4
)
{
g_object_unref
(
icon_theme
);
usage
();
return
1
;
}
if
(
argc
>=
5
)
size
=
atoi
(
argv
[
4
]);
else
size
=
GTK_ICON_SIZE_BUTTON
;
window
=
gtk_window_new
(
GTK_WINDOW_TOPLEVEL
);
#if 1
pixbuf
=
gtk_icon_theme_load_icon
(
icon_theme
,
argv
[
3
],
size
,
0
,
NULL
);
image
=
gtk_image_new_from_pixbuf
(
pixbuf
);
#else
image
=
gtk_image_new_from_icon_name
(
argv
[
3
],
size
);
#endif
gtk_container_add
(
GTK_CONTAINER
(
window
),
image
);
gtk_widget_show_all
(
window
);
gtk_main
();
}
else
if
(
strcmp
(
argv
[
1
],
"list"
)
==
0
)
{
if
(
argc
>=
4
)
context
=
argv
[
3
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment