forked from AuroraMiddleware/gtk
Make GtkIconSource an opaque datatype, and add a bunch of accessor
2001-03-19 Havoc Pennington <hp@redhat.com> * gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and add a bunch of accessor functions. This is because we have reasonable expectations of extending what fields it contains in the future. * gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source changes * gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new GtkIconSource
This commit is contained in:
parent
489c376bf4
commit
73e9d113a7
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
2001-03-19 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and
|
||||
add a bunch of accessor functions. This is because we have
|
||||
reasonable expectations of extending what fields it contains in
|
||||
the future.
|
||||
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source
|
||||
changes
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new
|
||||
GtkIconSource
|
||||
|
||||
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
|
||||
|
@ -1,3 +1,16 @@
|
||||
2001-03-19 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and
|
||||
add a bunch of accessor functions. This is because we have
|
||||
reasonable expectations of extending what fields it contains in
|
||||
the future.
|
||||
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source
|
||||
changes
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new
|
||||
GtkIconSource
|
||||
|
||||
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
|
||||
|
@ -1,3 +1,16 @@
|
||||
2001-03-19 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and
|
||||
add a bunch of accessor functions. This is because we have
|
||||
reasonable expectations of extending what fields it contains in
|
||||
the future.
|
||||
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source
|
||||
changes
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new
|
||||
GtkIconSource
|
||||
|
||||
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
|
||||
|
@ -1,3 +1,16 @@
|
||||
2001-03-19 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and
|
||||
add a bunch of accessor functions. This is because we have
|
||||
reasonable expectations of extending what fields it contains in
|
||||
the future.
|
||||
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source
|
||||
changes
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new
|
||||
GtkIconSource
|
||||
|
||||
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
|
||||
|
@ -1,3 +1,16 @@
|
||||
2001-03-19 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and
|
||||
add a bunch of accessor functions. This is because we have
|
||||
reasonable expectations of extending what fields it contains in
|
||||
the future.
|
||||
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source
|
||||
changes
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new
|
||||
GtkIconSource
|
||||
|
||||
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
|
||||
|
@ -1,3 +1,16 @@
|
||||
2001-03-19 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and
|
||||
add a bunch of accessor functions. This is because we have
|
||||
reasonable expectations of extending what fields it contains in
|
||||
the future.
|
||||
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source
|
||||
changes
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new
|
||||
GtkIconSource
|
||||
|
||||
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
|
||||
|
@ -1,3 +1,16 @@
|
||||
2001-03-19 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and
|
||||
add a bunch of accessor functions. This is because we have
|
||||
reasonable expectations of extending what fields it contains in
|
||||
the future.
|
||||
|
||||
* gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source
|
||||
changes
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new
|
||||
GtkIconSource
|
||||
|
||||
Mon Mar 19 15:53:36 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkitemfactory.c gtk/testgtk.c: Handle quoting of / with \; properly
|
||||
|
@ -445,6 +445,24 @@ The position of the cursor.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkEmissionHook ##### -->
|
||||
<para>
|
||||
A simple function pointer to get invoked when the
|
||||
signal is emitted. This allows you tie a hook to the signal type,
|
||||
so that it will trap all emissions of that signal, from any object.
|
||||
</para>
|
||||
<para>
|
||||
You may not attach these to signals created with the
|
||||
#GTK_RUN_NO_HOOKS flag.
|
||||
</para>
|
||||
|
||||
@object:
|
||||
@signal_id:
|
||||
@n_params:
|
||||
@params:
|
||||
@data:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### ENUM GtkFontFilterType ##### -->
|
||||
<para>
|
||||
A set of bit flags used to specify the filter being set
|
||||
@ -1038,6 +1056,20 @@ Internal function.
|
||||
|
||||
@ruler: the gtkruler
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_add_emission_hook ##### -->
|
||||
<para>
|
||||
Add an emission hook for a type of signal, for any object.
|
||||
</para>
|
||||
|
||||
@signal_id: the type of signal to hook for.
|
||||
@hook_func: the function to invoke to handle the emission hook.
|
||||
@data: the user data passed in to hook_func.
|
||||
@Returns: the id (that you may pass as a parameter
|
||||
to gtk_signal_remove_emission_hook()).
|
||||
@i:
|
||||
@h:
|
||||
@d:
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_add_emission_hook_full ##### -->
|
||||
<para>
|
||||
Add an emission hook for a type of signal, for any object.
|
||||
@ -1077,6 +1109,12 @@ This function is labeled private.
|
||||
|
||||
@object: the object whose signal handlers should be destroyed.
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_init ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_n_emissions ##### -->
|
||||
<para>
|
||||
Find out the recursion depth of emissions for a particular type
|
||||
@ -1118,6 +1156,16 @@ Obtain information about a signal.
|
||||
which contains all the information, or NULL.
|
||||
The pointer is allocated just for you: you must g_free() it.
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_remove_emission_hook ##### -->
|
||||
<para>
|
||||
Delete an emission hook. (see gtk_signal_add_emission_hook())
|
||||
</para>
|
||||
|
||||
@signal_id: the id of the signal type.
|
||||
@hook_id: the id of the emission handler, returned by add_emission_hook().
|
||||
@i:
|
||||
@h:
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_set_funcs ##### -->
|
||||
<para>
|
||||
These set default functions to call when the user didn't
|
||||
|
@ -37,14 +37,6 @@ looking up the icon to use for a given stock ID.
|
||||
|
||||
</para>
|
||||
|
||||
@filename:
|
||||
@pixbuf:
|
||||
@direction:
|
||||
@state:
|
||||
@size:
|
||||
@any_direction:
|
||||
@any_state:
|
||||
@any_size:
|
||||
|
||||
<!-- ##### STRUCT GtkIconFactory ##### -->
|
||||
<para>
|
||||
|
@ -157,25 +157,6 @@ you might have to write a marshaller.
|
||||
@field:
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkEmissionHook ##### -->
|
||||
<para>
|
||||
A simple function pointer to get invoked when the
|
||||
signal is emitted. This allows you tie a hook to the signal type,
|
||||
so that it will trap all emissions of that signal, from any object.
|
||||
</para>
|
||||
<para>
|
||||
You may not attach these to signals created with the
|
||||
#GTK_RUN_NO_HOOKS flag.
|
||||
</para>
|
||||
|
||||
@object:
|
||||
@signal_id:
|
||||
@n_params:
|
||||
@params:
|
||||
@data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkSignalRunType ##### -->
|
||||
<para>
|
||||
These configure the signal's emission. They control
|
||||
@ -251,13 +232,6 @@ to the signal.
|
||||
@GTK_RUN_ACTION:
|
||||
@GTK_RUN_NO_HOOKS:
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_init ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_new ##### -->
|
||||
<para>
|
||||
Create a new signal type. (This is usually done in the
|
||||
@ -315,7 +289,7 @@ you don't want a return value.
|
||||
the callbacks.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_lookup ##### -->
|
||||
<!-- ##### MACRO gtk_signal_lookup ##### -->
|
||||
<para>
|
||||
Given the name of the signal and the type of object it connects
|
||||
to, get the signal's identifying integer. Emitting the signal
|
||||
@ -325,12 +299,13 @@ by number is somewhat faster than using the name each time.
|
||||
It also tries the ancestors of the given type.
|
||||
</para>
|
||||
|
||||
@Returns: the signal's identifying number, or 0 if no signal was found.
|
||||
<!-- # Unused Parameters # -->
|
||||
@name: the signal's name, e.g. clicked.
|
||||
@object_type: the type that the signal operates on, e.g. #GTK_TYPE_BUTTON.
|
||||
@Returns: the signal's identifying number, or 0 if no signal was found.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_name ##### -->
|
||||
<!-- ##### MACRO gtk_signal_name ##### -->
|
||||
<para>
|
||||
Given the signal's identifier, find its name.
|
||||
</para>
|
||||
@ -338,8 +313,9 @@ Given the signal's identifier, find its name.
|
||||
Two different signals may have the same name, if they have differing types.
|
||||
</para>
|
||||
|
||||
@signal_id: the signal's identifying number.
|
||||
@Returns: the signal name, or NULL if the signal number was invalid.
|
||||
<!-- # Unused Parameters # -->
|
||||
@signal_id: the signal's identifying number.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_emit ##### -->
|
||||
@ -407,7 +383,7 @@ an array of GtkArgs instead of using C's varargs mechanism.
|
||||
followed by one which is a pointer to the return type.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_emit_stop ##### -->
|
||||
<!-- ##### MACRO gtk_signal_emit_stop ##### -->
|
||||
<para>
|
||||
This function aborts a signal's current emission.
|
||||
</para>
|
||||
@ -421,11 +397,11 @@ It will print a warning if used on a signal which
|
||||
isn't being emitted.
|
||||
</para>
|
||||
|
||||
@object: the object whose signal handlers you wish to stop.
|
||||
@signal_id: the signal identifier, as returned by gtk_signal_lookup().
|
||||
<!-- # Unused Parameters # -->
|
||||
@i:
|
||||
@s:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object whose signal handlers you wish to stop.
|
||||
@signal_id: the signal identifier, as returned by gtk_signal_lookup().
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_emit_stop_by_name ##### -->
|
||||
@ -441,7 +417,7 @@ except it will lookup the signal id for you.
|
||||
@name: the name of the signal you wish to stop.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect ##### -->
|
||||
<para>
|
||||
Attach a function pointer and user data to a signal for
|
||||
a particular object.
|
||||
@ -480,38 +456,38 @@ static void attach_print_signal(GtkButton* button, gint to_print)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object associated with the signal, e.g. if a button
|
||||
is getting pressed, this is that button.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@func_data: value to pass as to your function (through the marshaller).
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_after ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect_after ##### -->
|
||||
<para>
|
||||
Attach a function pointer and user data to a signal
|
||||
so that this handler will be called after the other handlers.
|
||||
</para>
|
||||
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@func_data: value to pass as to your function (through the marshaller).
|
||||
@Returns: the unique identifier for this attachment: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the unique identifier for this attachment: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@func_data: value to pass as to your function (through the marshaller).
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_object ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect_object ##### -->
|
||||
<para>
|
||||
This function is for registering a callback that will
|
||||
call another object's callback. That is,
|
||||
@ -532,21 +508,21 @@ gtk_signal_connect_object(button, "clicked", gtk_widget_show, window);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal.
|
||||
@name: the name of the signal.
|
||||
@func: the function to callback.
|
||||
@slot_object: the object to pass as the first parameter to func.
|
||||
(Though it pretends to take an object, you can
|
||||
really pass any gpointer as the #slot_object .)
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_object_after ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect_object_after ##### -->
|
||||
<para>
|
||||
Attach a signal hook to a signal, passing in an alternate
|
||||
object as the first parameter, and guaranteeing
|
||||
@ -554,16 +530,16 @@ that the default handler and all normal
|
||||
handlers are called first.
|
||||
</para>
|
||||
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@slot_object: the object to pass as the first parameter to #func.
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@slot_object: the object to pass as the first parameter to #func.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_full ##### -->
|
||||
@ -652,95 +628,98 @@ should signal the removal of this signal.
|
||||
@name: name of the signal.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_disconnect ##### -->
|
||||
<!-- ##### MACRO gtk_signal_disconnect ##### -->
|
||||
<para>
|
||||
Destroy a user-defined handler connection.
|
||||
</para>
|
||||
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which the handler pertains to.
|
||||
@handler_id: the connection id.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_disconnect_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_disconnect_by_func ##### -->
|
||||
<para>
|
||||
Destroy all connections for a particular object, with
|
||||
the given function-pointer and user-data.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@f:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_disconnect_by_data ##### -->
|
||||
<!-- ##### MACRO gtk_signal_disconnect_by_data ##### -->
|
||||
<para>
|
||||
Destroy all connections for a particular object, with
|
||||
the given user-data.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_block ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_block ##### -->
|
||||
<para>
|
||||
Prevent an user-defined handler from being invoked. All other
|
||||
signal processing will go on as normal, but this particular
|
||||
handler will ignore it.
|
||||
</para>
|
||||
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal to block.
|
||||
@handler_id: the connection id.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_block_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_block_by_func ##### -->
|
||||
<para>
|
||||
Prevent a user-defined handler from being invoked, by reference to
|
||||
the user-defined handler's function pointer and user data. (It may result in
|
||||
multiple hooks being blocked, if you've called connect multiple times.)
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal to block.
|
||||
@func: the function pointer of the handler to block.
|
||||
@data: the user data of the handler to block.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@f:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal to block.
|
||||
@func: the function pointer of the handler to block.
|
||||
@data: the user data of the handler to block.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_block_by_data ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_block_by_data ##### -->
|
||||
<para>
|
||||
Prevent all user-defined handlers with a certain user data from being invoked.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal we want to block.
|
||||
@data: the user data of the handlers to block.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to block.
|
||||
@data: the user data of the handlers to block.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_unblock ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_unblock ##### -->
|
||||
<para>
|
||||
Undo a block, by connection id. Note that undoing a block doesn't
|
||||
necessarily make the hook callable, because if you block a
|
||||
hook twice, you must unblock it twice.
|
||||
</para>
|
||||
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@handler_id: the emission handler identifier, as returned by
|
||||
gtk_signal_connect(), etc.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_unblock_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_unblock_by_func ##### -->
|
||||
<para>
|
||||
Undo a block, by function pointer and data.
|
||||
Note that undoing a block doesn't
|
||||
@ -748,29 +727,29 @@ necessarily make the hook callable, because if you block a
|
||||
hook twice, you must unblock it twice.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@f:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_unblock_by_data ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_unblock_by_data ##### -->
|
||||
<para>
|
||||
Undo block(s), to all signals for a particular object
|
||||
with a particular user-data pointer
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_pending ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_pending ##### -->
|
||||
<para>
|
||||
Returns a connection id corresponding to a given signal id and object.
|
||||
</para>
|
||||
@ -781,64 +760,36 @@ may opt to not emit the signal if no one is attached anyway,
|
||||
thus saving the cost of building the arguments.
|
||||
</para>
|
||||
|
||||
@i:
|
||||
@s:
|
||||
@b:
|
||||
@Returns: the connection id, if a connection was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object to search for the desired user-defined handler.
|
||||
@signal_id: the number of the signal to search for.
|
||||
@may_be_blocked: whether it is acceptable to return a blocked
|
||||
handler.
|
||||
@Returns: the connection id, if a connection was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@i:
|
||||
@s:
|
||||
@b:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_pending_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_pending_by_func ##### -->
|
||||
<para>
|
||||
Returns a connection id corresponding to a given signal id, object, function
|
||||
pointer and user data.
|
||||
</para>
|
||||
|
||||
@o:
|
||||
@s:
|
||||
@b:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id, if a handler was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object to search for the desired handler.
|
||||
@signal_id: the number of the signal to search for.
|
||||
@may_be_blocked: whether it is acceptable to return a blocked
|
||||
handler.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
@Returns: the connection id, if a handler was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@b:
|
||||
@f:
|
||||
@d:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_add_emission_hook ##### -->
|
||||
<para>
|
||||
Add an emission hook for a type of signal, for any object.
|
||||
</para>
|
||||
|
||||
@signal_id: the type of signal to hook for.
|
||||
@hook_func: the function to invoke to handle the emission hook.
|
||||
@data: the user data passed in to hook_func.
|
||||
@Returns: the id (that you may pass as a parameter
|
||||
to gtk_signal_remove_emission_hook()).
|
||||
<!-- # Unused Parameters # -->
|
||||
@i:
|
||||
@h:
|
||||
@d:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_remove_emission_hook ##### -->
|
||||
<para>
|
||||
Delete an emission hook. (see gtk_signal_add_emission_hook())
|
||||
</para>
|
||||
|
||||
@signal_id: the id of the signal type.
|
||||
@hook_id: the id of the emission handler, returned by add_emission_hook().
|
||||
<!-- # Unused Parameters # -->
|
||||
@i:
|
||||
@h:
|
||||
|
||||
|
||||
<!-- ##### MACRO gtk_signal_default_marshaller ##### -->
|
||||
|
@ -560,30 +560,33 @@ Create a new, unique type.
|
||||
@type_info: must not be null, and @type_info->type_name must also not be null.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_name ##### -->
|
||||
<!-- ##### MACRO gtk_type_name ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@type: a GtkType
|
||||
@Returns: a pointer to the name of a type, or NULL if it has none.
|
||||
<!-- # Unused Parameters # -->
|
||||
@type: a GtkType
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_from_name ##### -->
|
||||
<!-- ##### MACRO gtk_type_from_name ##### -->
|
||||
<para>
|
||||
Get the internal representation of a type given its name.
|
||||
</para>
|
||||
|
||||
@name: the name of a gtk type
|
||||
@Returns: a GtkType
|
||||
<!-- # Unused Parameters # -->
|
||||
@name: the name of a gtk type
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_parent ##### -->
|
||||
<!-- ##### MACRO gtk_type_parent ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@type: a GtkType
|
||||
@Returns: the GtkType of the parent
|
||||
<!-- # Unused Parameters # -->
|
||||
@type: a GtkType
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_class ##### -->
|
||||
@ -608,15 +611,16 @@ has all the proper initializers called.
|
||||
@Returns: gpointer to a GtkTypeObject
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_is_a ##### -->
|
||||
<!-- ##### MACRO gtk_type_is_a ##### -->
|
||||
<para>
|
||||
Look in the type hierarchy to see if @type has @is_a_type among its
|
||||
ancestors. Do so with a simple lookup, not a loop.
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
<!-- # Unused Parameters # -->
|
||||
@type: GtkType
|
||||
@is_a_type: GtkType
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
|
||||
|
@ -33,6 +33,28 @@
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
struct _GtkIconSource
|
||||
{
|
||||
/* Either filename or pixbuf can be NULL. If both are non-NULL,
|
||||
* the pixbuf is assumed to be the already-loaded contents of the
|
||||
* file.
|
||||
*/
|
||||
gchar *filename;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
GtkTextDirection direction;
|
||||
GtkStateType state;
|
||||
GtkIconSize size;
|
||||
|
||||
/* If TRUE, then the parameter is wildcarded, and the above
|
||||
* fields should be ignored. If FALSE, the parameter is
|
||||
* specified, and the above fields should be valid.
|
||||
*/
|
||||
guint any_direction : 1;
|
||||
guint any_state : 1;
|
||||
guint any_size : 1;
|
||||
};
|
||||
|
||||
/* FIXME use a better icon for this */
|
||||
#define MISSING_IMAGE_INLINE dialog_error
|
||||
|
||||
@ -700,7 +722,11 @@ gtk_icon_set_new (void)
|
||||
* gtk_icon_set_new_from_pixbuf:
|
||||
* @pixbuf: a #GdkPixbuf
|
||||
*
|
||||
* Creates a new #GtkIconSet seeded with @pixbuf.
|
||||
* Creates a new #GtkIconSet with @pixbuf as the default/fallback
|
||||
* source image. If you don't add any additional #GtkIconSource to the
|
||||
* icon set, all variants of the icon will be created from @pixbuf,
|
||||
* using scaling, pixelation, etc. as required to adjust the icon size
|
||||
* or make the icon look insensitive/prelighted.
|
||||
*
|
||||
* Return value: a new #GtkIconSet
|
||||
**/
|
||||
@ -866,10 +892,10 @@ find_and_prep_icon_source (GtkIconSet *icon_set,
|
||||
|
||||
g_assert (source->filename);
|
||||
|
||||
if (*source->filename != G_DIR_SEPARATOR)
|
||||
full = gtk_rc_find_pixmap_in_path (NULL, source->filename);
|
||||
else
|
||||
if (g_path_is_absolute (source->filename))
|
||||
full = g_strdup (source->filename);
|
||||
else
|
||||
full = gtk_rc_find_pixmap_in_path (NULL, source->filename);
|
||||
|
||||
error = NULL;
|
||||
source->pixbuf = gdk_pixbuf_new_from_file (full, &error);
|
||||
@ -927,12 +953,13 @@ get_fallback_image (void)
|
||||
* @detail: detail to pass to the theme engine, or %NULL
|
||||
*
|
||||
* Renders an icon using gtk_style_render_icon(). In most cases,
|
||||
* gtk_widget_render_icon() is better, since it automatically
|
||||
* provides most of the arguments from the current widget settings.
|
||||
* A %NULL return value is possible if an icon file fails to load
|
||||
* or the like.
|
||||
* gtk_widget_render_icon() is better, since it automatically provides
|
||||
* most of the arguments from the current widget settings. This
|
||||
* function never returns %NULL; if the icon can't be rendered
|
||||
* (perhaps because an image file fails to load), a default "missing
|
||||
* image" icon will be returned instead.
|
||||
*
|
||||
* Return value: a #GdkPixbuf to be displayed, or %NULL
|
||||
* Return value: a #GdkPixbuf to be displayed
|
||||
**/
|
||||
GdkPixbuf*
|
||||
gtk_icon_set_render_icon (GtkIconSet *icon_set,
|
||||
@ -1025,7 +1052,26 @@ icon_source_compare (gconstpointer ap, gconstpointer bp)
|
||||
* scaled, made to look insensitive, etc. in
|
||||
* gtk_icon_set_render_icon(), but #GtkIconSet needs base images to
|
||||
* work with. The base images and when to use them are described by
|
||||
* #GtkIconSource.
|
||||
* a #GtkIconSource.
|
||||
*
|
||||
* This function copies @source, so you can reuse the same source immediately
|
||||
* without affecting the icon set.
|
||||
*
|
||||
* An example of when you'd use this function: a web browser's "Back
|
||||
* to Previous Page" icon might point in a different direction in
|
||||
* Hebrew and in English; it might look different when insensitive;
|
||||
* and it might change size depending on toolbar mode (small/large
|
||||
* icons). So a single icon set would contain all those variants of
|
||||
* the icon, and you might add a separate source for each one.
|
||||
*
|
||||
* You should nearly always add a "default" icon source with all
|
||||
* fields wildcarded, which will be used as a fallback if no more
|
||||
* specific source matches. #GtkIconSet always prefers more specific
|
||||
* icon sources to more generic icon sources. The order in which you
|
||||
* add the sources to the icon set does not matter.
|
||||
*
|
||||
* gtk_icon_set_new_from_pixbuf() creates a new icon set with a
|
||||
* default icon source based on the given pixbuf.
|
||||
*
|
||||
**/
|
||||
void
|
||||
@ -1047,6 +1093,58 @@ gtk_icon_set_add_source (GtkIconSet *icon_set,
|
||||
icon_source_compare);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_new:
|
||||
*
|
||||
* Creates a new #GtkIconSource. A #GtkIconSource contains a #GdkPixbuf (or
|
||||
* image filename) that serves as the base image for one or more of the
|
||||
* icons in a #GtkIconSet, along with a specification for which icons in the
|
||||
* icon set will be based on that pixbuf or image file. An icon set contains
|
||||
* a set of icons that represent "the same" logical concept in different states,
|
||||
* different global text directions, and different sizes.
|
||||
*
|
||||
* So for example a web browser's "Back to Previous Page" icon might
|
||||
* point in a different direction in Hebrew and in English; it might
|
||||
* look different when insensitive; and it might change size depending
|
||||
* on toolbar mode (small/large icons). So a single icon set would
|
||||
* contain all those variants of the icon. #GtkIconSet contains a list
|
||||
* of #GtkIconSource from which it can derive specific icon variants in
|
||||
* the set.
|
||||
*
|
||||
* In the simplest case, #GtkIconSet contains one source pixbuf from
|
||||
* which it derives all variants. The convenience function
|
||||
* gtk_icon_set_new_from_pixbuf() handles this case; if you only have
|
||||
* one source pixbuf, just use that function.
|
||||
*
|
||||
* If you want to use a different base pixbuf for different icon
|
||||
* variants, you create multiple icon sources, mark which variants
|
||||
* they'll be used to create, and add them to the icon set with
|
||||
* gtk_icon_set_add_source().
|
||||
*
|
||||
* By default, the icon source has all parameters wildcarded. That is,
|
||||
* the icon source will be used as the base icon for any desired text
|
||||
* direction, widget state, or icon size.
|
||||
*
|
||||
* Return value: a new #GtkIconSource
|
||||
**/
|
||||
GtkIconSource*
|
||||
gtk_icon_source_new (void)
|
||||
{
|
||||
GtkIconSource *src;
|
||||
|
||||
src = g_new0 (GtkIconSource, 1);
|
||||
|
||||
src->direction = GTK_TEXT_DIR_NONE;
|
||||
src->size = GTK_ICON_SIZE_INVALID;
|
||||
src->state = GTK_STATE_NORMAL;
|
||||
|
||||
src->any_direction = TRUE;
|
||||
src->any_state = TRUE;
|
||||
src->any_size = TRUE;
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_copy:
|
||||
* @source: a #GtkIconSource
|
||||
@ -1093,6 +1191,345 @@ gtk_icon_source_free (GtkIconSource *source)
|
||||
g_free (source);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_filename:
|
||||
* @source: a #GtkIconSource
|
||||
* @filename: image file to use
|
||||
*
|
||||
* Sets the name of an image file to use as a base image when creating icon
|
||||
* variants for #GtkIconSet. If the filename is absolute, GTK+ will
|
||||
* attempt to open the exact file given. If the filename is relative,
|
||||
* GTK+ will search for it in the "pixmap path" which can be configured
|
||||
* by users in their gtkrc files or specified as part of a theme's gtkrc
|
||||
* file. See #GtkRcStyle for information on gtkrc files.
|
||||
*
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_filename (GtkIconSource *source,
|
||||
const gchar *filename)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
if (source->filename == filename)
|
||||
return;
|
||||
|
||||
if (source->filename)
|
||||
g_free (source->filename);
|
||||
|
||||
source->filename = g_strdup (filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_pixbuf:
|
||||
* @source: a #GtkIconSource
|
||||
* @pixbuf: pixbuf to use as a source
|
||||
*
|
||||
* Sets a pixbuf to use as a base image when creating icon variants
|
||||
* for #GtkIconSet. If an icon source has both a filename and a pixbuf
|
||||
* set, the pixbuf will take priority.
|
||||
*
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_pixbuf (GtkIconSource *source,
|
||||
GdkPixbuf *pixbuf)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
if (pixbuf)
|
||||
g_object_ref (G_OBJECT (pixbuf));
|
||||
|
||||
if (source->pixbuf)
|
||||
g_object_unref (G_OBJECT (source->pixbuf));
|
||||
|
||||
source->pixbuf = pixbuf;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_filename:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Retrieves the source filename, or %NULL if none is set. The
|
||||
* filename is not a copy, and should not be modified or expected to
|
||||
* persist beyond the lifetime of the icon source.
|
||||
*
|
||||
* Return value: image filename
|
||||
**/
|
||||
G_CONST_RETURN gchar*
|
||||
gtk_icon_source_get_filename (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, NULL);
|
||||
|
||||
return source->filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_pixbuf:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Retrieves the source pixbuf, or %NULL if none is set.
|
||||
* The reference count on the pixbuf is not incremented.
|
||||
*
|
||||
* Return value: source pixbuf
|
||||
**/
|
||||
GdkPixbuf*
|
||||
gtk_icon_source_get_pixbuf (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, NULL);
|
||||
|
||||
return source->pixbuf;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_direction_wildcarded:
|
||||
* @source: a #GtkIconSource
|
||||
* @setting: %TRUE to wildcard the text direction
|
||||
*
|
||||
* If the text direction is wildcarded, this source can be used
|
||||
* as the base image for an icon in any #GtkTextDirection.
|
||||
* If the text direction is not wildcarded, then the
|
||||
* text direction the icon source applies to should be set
|
||||
* with gtk_icon_source_set_direction(), and the icon source
|
||||
* will only be used with that text direction.
|
||||
*
|
||||
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
|
||||
* wildcarded sources, and will use an exact match when possible.
|
||||
*
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
|
||||
gboolean setting)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
source->any_direction = setting != FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_state_wildcarded:
|
||||
* @source: a #GtkIconSource
|
||||
* @setting: %TRUE to wildcard the widget state
|
||||
*
|
||||
* If the widget state is wildcarded, this source can be used as the
|
||||
* base image for an icon in any #GtkStateType. If the widget state
|
||||
* is not wildcarded, then the state the source applies to should be
|
||||
* set with gtk_icon_source_set_state() and the icon source will
|
||||
* only be used with that specific state.
|
||||
*
|
||||
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
|
||||
* wildcarded sources, and will use an exact match when possible.
|
||||
*
|
||||
* #GtkIconSet will normally transform wildcarded source images to
|
||||
* produce an appropriate icon for a given state, for example
|
||||
* lightening an image on prelight, but will not modify source images
|
||||
* that match exactly.
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
|
||||
gboolean setting)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
source->any_state = setting != FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_size_wildcarded:
|
||||
* @source: a #GtkIconSource
|
||||
* @setting: %TRUE to wildcard the widget state
|
||||
*
|
||||
* If the icon size is wildcarded, this source can be used as the base
|
||||
* image for an icon of any size. If the size is not wildcarded, then
|
||||
* the size the source applies to should be set with
|
||||
* gtk_icon_source_set_size() and the icon source will only be used
|
||||
* with that specific size.
|
||||
*
|
||||
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
|
||||
* wildcarded sources, and will use an exact match when possible.
|
||||
*
|
||||
* #GtkIconSet will normally scale wildcarded source images to produce
|
||||
* an appropriate icon at a given size, but will not change the size
|
||||
* of source images that match exactly.
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
|
||||
gboolean setting)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
source->any_size = setting != FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_size_wildcarded:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Gets the value set by gtk_icon_source_set_size_wildcarded().
|
||||
*
|
||||
* Return value: %TRUE if this icon source is a base for any icon size variant
|
||||
**/
|
||||
gboolean
|
||||
gtk_icon_source_get_size_wildcarded (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, TRUE);
|
||||
|
||||
return source->any_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_state_wildcarded:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Gets the value set by gtk_icon_source_set_state_wildcarded().
|
||||
*
|
||||
* Return value: %TRUE if this icon source is a base for any widget state variant
|
||||
**/
|
||||
gboolean
|
||||
gtk_icon_source_get_state_wildcarded (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, TRUE);
|
||||
|
||||
return source->any_state;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_direction_wildcarded:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Gets the value set by gtk_icon_source_set_direction_wildcarded().
|
||||
*
|
||||
* Return value: %TRUE if this icon source is a base for any text direction variant
|
||||
**/
|
||||
gboolean
|
||||
gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, TRUE);
|
||||
|
||||
return source->any_direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_direction:
|
||||
* @source: a #GtkIconSource
|
||||
* @direction: text direction this source applies to
|
||||
*
|
||||
* Sets the text direction this icon source is intended to be used
|
||||
* with.
|
||||
*
|
||||
* Setting the text direction on an icon source makes no difference
|
||||
* if the text direction is wildcarded. Therefore, you should usually
|
||||
* call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
|
||||
* in addition to calling this function.
|
||||
*
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_direction (GtkIconSource *source,
|
||||
GtkTextDirection direction)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
source->direction = direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_state:
|
||||
* @source: a #GtkIconSource
|
||||
* @state: widget state this source applies to
|
||||
*
|
||||
* Sets the widget state this icon source is intended to be used
|
||||
* with.
|
||||
*
|
||||
* Setting the widget state on an icon source makes no difference
|
||||
* if the state is wildcarded. Therefore, you should usually
|
||||
* call gtk_icon_source_set_state_wildcarded() to un-wildcard it
|
||||
* in addition to calling this function.
|
||||
*
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_state (GtkIconSource *source,
|
||||
GtkStateType state)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
source->state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_set_size:
|
||||
* @source: a #GtkIconSource
|
||||
* @size: icon size this source applies to
|
||||
*
|
||||
* Sets the icon size this icon source is intended to be used
|
||||
* with.
|
||||
*
|
||||
* Setting the icon size on an icon source makes no difference
|
||||
* if the size is wildcarded. Therefore, you should usually
|
||||
* call gtk_icon_source_set_size_wildcarded() to un-wildcard it
|
||||
* in addition to calling this function.
|
||||
*
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_size (GtkIconSource *source,
|
||||
GtkIconSize size)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
|
||||
source->size = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_direction:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Obtains the text direction this icon source applies to. The return
|
||||
* value is only useful/meaningful if the text direction is NOT
|
||||
* wildcarded.
|
||||
*
|
||||
* Return value: text direction this source matches
|
||||
**/
|
||||
GtkTextDirection
|
||||
gtk_icon_source_get_direction (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, 0);
|
||||
|
||||
return source->direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_state:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Obtains the widget state this icon source applies to. The return
|
||||
* value is only useful/meaningful if the widget state is NOT
|
||||
* wildcarded.
|
||||
*
|
||||
* Return value: widget state this source matches
|
||||
**/
|
||||
GtkStateType
|
||||
gtk_icon_source_get_state (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, 0);
|
||||
|
||||
return source->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_icon_source_get_size:
|
||||
* @source: a #GtkIconSource
|
||||
*
|
||||
* Obtains the icon size this source applies to. The return value
|
||||
* is only useful/meaningful if the icon size is NOT wildcarded.
|
||||
*
|
||||
* Return value: icon size this source matches.
|
||||
**/
|
||||
GtkIconSize
|
||||
gtk_icon_source_get_size (const GtkIconSource *source)
|
||||
{
|
||||
g_return_val_if_fail (source != NULL, 0);
|
||||
|
||||
return source->size;
|
||||
}
|
||||
|
||||
/* Note that the logical maximum is 20 per GtkTextDirection, so we could
|
||||
* eventually set this to >20 to never throw anything out.
|
||||
*/
|
||||
|
@ -117,35 +117,42 @@ GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set,
|
||||
void gtk_icon_set_add_source (GtkIconSet *icon_set,
|
||||
const GtkIconSource *source);
|
||||
|
||||
/* INTERNAL */
|
||||
|
||||
GtkIconSource* gtk_icon_source_new (void);
|
||||
GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source);
|
||||
void gtk_icon_source_free (GtkIconSource *source);
|
||||
|
||||
void gtk_icon_source_set_filename (GtkIconSource *source,
|
||||
const gchar *filename);
|
||||
void gtk_icon_source_set_pixbuf (GtkIconSource *source,
|
||||
GdkPixbuf *pixbuf);
|
||||
|
||||
G_CONST_RETURN gchar* gtk_icon_source_get_filename (const GtkIconSource *source);
|
||||
GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source);
|
||||
|
||||
void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
|
||||
gboolean setting);
|
||||
void gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
|
||||
gboolean setting);
|
||||
void gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
|
||||
gboolean setting);
|
||||
gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source);
|
||||
gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source);
|
||||
gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source);
|
||||
void gtk_icon_source_set_direction (GtkIconSource *source,
|
||||
GtkTextDirection direction);
|
||||
void gtk_icon_source_set_state (GtkIconSource *source,
|
||||
GtkStateType state);
|
||||
void gtk_icon_source_set_size (GtkIconSource *source,
|
||||
GtkIconSize size);
|
||||
GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source);
|
||||
GtkStateType gtk_icon_source_get_state (const GtkIconSource *source);
|
||||
GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source);
|
||||
|
||||
|
||||
/* ignore this */
|
||||
void _gtk_icon_set_invalidate_caches (void);
|
||||
|
||||
struct _GtkIconSource
|
||||
{
|
||||
/* Either filename or pixbuf can be NULL. If both are non-NULL,
|
||||
* the pixbuf is assumed to be the already-loaded contents of the
|
||||
* file.
|
||||
*/
|
||||
gchar *filename;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
GtkTextDirection direction;
|
||||
GtkStateType state;
|
||||
GtkIconSize size;
|
||||
|
||||
/* If TRUE, then the parameter is wildcarded, and the above
|
||||
* fields should be ignored. If FALSE, the parameter is
|
||||
* specified, and the above fields should be valid.
|
||||
*/
|
||||
guint any_direction : 1;
|
||||
guint any_state : 1;
|
||||
guint any_size : 1;
|
||||
};
|
||||
|
||||
|
||||
GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source);
|
||||
void gtk_icon_source_free (GtkIconSource *source);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
78
gtk/gtkrc.c
78
gtk/gtkrc.c
@ -3044,20 +3044,12 @@ gtk_rc_parse_stock_id (GScanner *scanner,
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_source (GtkIconSource *source)
|
||||
{
|
||||
g_free (source->filename);
|
||||
}
|
||||
|
||||
static guint
|
||||
gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
GtkIconSet *icon_set)
|
||||
{
|
||||
guint token;
|
||||
GtkIconSource source = { NULL, NULL,
|
||||
0, 0, 0,
|
||||
TRUE, TRUE, TRUE };
|
||||
GtkIconSource *source;
|
||||
|
||||
token = g_scanner_get_next_token (scanner);
|
||||
if (token != G_TOKEN_LEFT_CURLY)
|
||||
@ -3067,20 +3059,22 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
|
||||
if (token != G_TOKEN_STRING)
|
||||
return G_TOKEN_STRING;
|
||||
|
||||
source.filename = g_strdup (scanner->value.v_string);
|
||||
|
||||
source = gtk_icon_source_new ();
|
||||
|
||||
gtk_icon_source_set_filename (source, scanner->value.v_string);
|
||||
|
||||
token = g_scanner_get_next_token (scanner);
|
||||
|
||||
if (token == G_TOKEN_RIGHT_CURLY)
|
||||
{
|
||||
gtk_icon_set_add_source (icon_set, &source);
|
||||
cleanup_source (&source);
|
||||
gtk_icon_set_add_source (icon_set, source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
else if (token != G_TOKEN_COMMA)
|
||||
{
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_COMMA;
|
||||
}
|
||||
|
||||
@ -3091,20 +3085,20 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
switch (token)
|
||||
{
|
||||
case GTK_RC_TOKEN_RTL:
|
||||
source.any_direction = FALSE;
|
||||
source.direction = GTK_TEXT_DIR_RTL;
|
||||
gtk_icon_source_set_direction_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_direction (source, GTK_TEXT_DIR_RTL);
|
||||
break;
|
||||
|
||||
case GTK_RC_TOKEN_LTR:
|
||||
source.any_direction = FALSE;
|
||||
source.direction = GTK_TEXT_DIR_LTR;
|
||||
gtk_icon_source_set_direction_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_direction (source, GTK_TEXT_DIR_LTR);
|
||||
break;
|
||||
|
||||
case '*':
|
||||
break;
|
||||
|
||||
default:
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
return GTK_RC_TOKEN_RTL;
|
||||
break;
|
||||
}
|
||||
@ -3113,13 +3107,13 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
|
||||
if (token == G_TOKEN_RIGHT_CURLY)
|
||||
{
|
||||
gtk_icon_set_add_source (icon_set, &source);
|
||||
cleanup_source (&source);
|
||||
gtk_icon_set_add_source (icon_set, source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
else if (token != G_TOKEN_COMMA)
|
||||
{
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_COMMA;
|
||||
}
|
||||
|
||||
@ -3130,36 +3124,36 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
switch (token)
|
||||
{
|
||||
case GTK_RC_TOKEN_NORMAL:
|
||||
source.any_state = FALSE;
|
||||
source.state = GTK_STATE_NORMAL;
|
||||
gtk_icon_source_set_state_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_state (source, GTK_STATE_NORMAL);
|
||||
break;
|
||||
|
||||
case GTK_RC_TOKEN_PRELIGHT:
|
||||
source.any_state = FALSE;
|
||||
source.state = GTK_STATE_PRELIGHT;
|
||||
gtk_icon_source_set_state_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_state (source, GTK_STATE_PRELIGHT);
|
||||
break;
|
||||
|
||||
|
||||
case GTK_RC_TOKEN_INSENSITIVE:
|
||||
source.any_state = FALSE;
|
||||
source.state = GTK_STATE_INSENSITIVE;
|
||||
gtk_icon_source_set_state_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_state (source, GTK_STATE_INSENSITIVE);
|
||||
break;
|
||||
|
||||
case GTK_RC_TOKEN_ACTIVE:
|
||||
source.any_state = FALSE;
|
||||
source.state = GTK_STATE_ACTIVE;
|
||||
gtk_icon_source_set_state_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_state (source, GTK_STATE_ACTIVE);
|
||||
break;
|
||||
|
||||
case GTK_RC_TOKEN_SELECTED:
|
||||
source.any_state = FALSE;
|
||||
source.state = GTK_STATE_SELECTED;
|
||||
gtk_icon_source_set_state_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_state (source, GTK_STATE_SELECTED);
|
||||
break;
|
||||
|
||||
case '*':
|
||||
break;
|
||||
|
||||
default:
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
return GTK_RC_TOKEN_PRELIGHT;
|
||||
break;
|
||||
}
|
||||
@ -3168,13 +3162,13 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
|
||||
if (token == G_TOKEN_RIGHT_CURLY)
|
||||
{
|
||||
gtk_icon_set_add_source (icon_set, &source);
|
||||
cleanup_source (&source);
|
||||
gtk_icon_set_add_source (icon_set, source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
else if (token != G_TOKEN_COMMA)
|
||||
{
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_COMMA;
|
||||
}
|
||||
|
||||
@ -3188,7 +3182,7 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
|
||||
if (token != G_TOKEN_STRING)
|
||||
{
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_STRING;
|
||||
}
|
||||
|
||||
@ -3196,8 +3190,8 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
|
||||
if (size != GTK_ICON_SIZE_INVALID)
|
||||
{
|
||||
source.size = size;
|
||||
source.any_size = FALSE;
|
||||
gtk_icon_source_set_size_wildcarded (source, FALSE);
|
||||
gtk_icon_source_set_size (source, size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3206,13 +3200,13 @@ gtk_rc_parse_icon_source (GScanner *scanner,
|
||||
token = g_scanner_get_next_token (scanner);
|
||||
if (token != G_TOKEN_RIGHT_CURLY)
|
||||
{
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
return G_TOKEN_RIGHT_CURLY;
|
||||
}
|
||||
|
||||
gtk_icon_set_add_source (icon_set, &source);
|
||||
gtk_icon_set_add_source (icon_set, source);
|
||||
|
||||
cleanup_source (&source);
|
||||
gtk_icon_source_free (source);
|
||||
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
|
@ -1547,13 +1547,16 @@ gtk_default_render_icon (GtkStyle *style,
|
||||
gint height = 1;
|
||||
GdkPixbuf *scaled;
|
||||
GdkPixbuf *stated;
|
||||
GdkPixbuf *base_pixbuf;
|
||||
|
||||
/* Oddly, style can be NULL in this function, because
|
||||
* GtkIconSet can be used without a style and if so
|
||||
* it uses this function.
|
||||
*/
|
||||
|
||||
g_return_val_if_fail (source->pixbuf != NULL, NULL);
|
||||
|
||||
base_pixbuf = gtk_icon_source_get_pixbuf (source);
|
||||
|
||||
g_return_val_if_fail (base_pixbuf != NULL, NULL);
|
||||
|
||||
if (!gtk_icon_size_lookup (size, &width, &height))
|
||||
{
|
||||
@ -1564,13 +1567,13 @@ gtk_default_render_icon (GtkStyle *style,
|
||||
/* If the size was wildcarded, then scale; otherwise, leave it
|
||||
* alone.
|
||||
*/
|
||||
if (source->any_size)
|
||||
scaled = scale_or_ref (source->pixbuf, width, height);
|
||||
if (gtk_icon_source_get_size_wildcarded (source))
|
||||
scaled = scale_or_ref (base_pixbuf, width, height);
|
||||
else
|
||||
scaled = GDK_PIXBUF (g_object_ref (G_OBJECT (source->pixbuf)));
|
||||
scaled = GDK_PIXBUF (g_object_ref (G_OBJECT (base_pixbuf)));
|
||||
|
||||
/* If the state was wildcarded, then generate a state. */
|
||||
if (source->any_state)
|
||||
if (gtk_icon_source_get_state_wildcarded (source))
|
||||
{
|
||||
if (state == GTK_STATE_INSENSITIVE)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user