From 6efaa8c7252257f72b74c4fe86513949c44c131e Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Sun, 9 Apr 2000 20:23:49 +0000 Subject: [PATCH] update from Torsten Landschoff 2000-04-09 Damon Chaplin * gtk/tmpl/gtkmain.sgml: update from Torsten Landschoff * gdk/tmpl/input_methods.sgml: * gdk/tmpl/general.sgml: fixed typos. --- docs/reference/ChangeLog | 8 + docs/reference/gdk/tmpl/general.sgml | 2 +- docs/reference/gdk/tmpl/input_methods.sgml | 4 +- docs/reference/gtk/tmpl/gtkmain.sgml | 266 +++++++++++++++------ 4 files changed, 201 insertions(+), 79 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 1cb588853c..830a412ca7 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,11 @@ +2000-04-09 Damon Chaplin + + * gtk/tmpl/gtkmain.sgml: update from Torsten Landschoff + + + * gdk/tmpl/input_methods.sgml: + * gdk/tmpl/general.sgml: fixed typos. + Tue Mar 14 14:17:46 2000 Raph Levien * gdk/tmpl/rgb.sgml: Better explanation of gdk_rgb_set_min_colors. diff --git a/docs/reference/gdk/tmpl/general.sgml b/docs/reference/gdk/tmpl/general.sgml index 87a746db38..fe9468b73e 100644 --- a/docs/reference/gdk/tmpl/general.sgml +++ b/docs/reference/gdk/tmpl/general.sgml @@ -246,7 +246,7 @@ This overrides any previous keyboard grab by this client. @owner_events: if FALSE then all keyboard events are reported with respect to @window. If TRUE then keyboard events for this application are reported as normal, but keyboard events outside this application are reported with respect -to @window. Both key press and key release events are alwasy reported, +to @window. Both key press and key release events are always reported, independant of the event mask set by the application. @time: a timestamp from a #GdkEvent, or #GDK_CURRENT_TIME if no timestamp is available. diff --git a/docs/reference/gdk/tmpl/input_methods.sgml b/docs/reference/gdk/tmpl/input_methods.sgml index 4ba54c8bd3..8416b02463 100644 --- a/docs/reference/gdk/tmpl/input_methods.sgml +++ b/docs/reference/gdk/tmpl/input_methods.sgml @@ -94,7 +94,7 @@ pre-edit flags and the status flags. The pre-edit flags specify how pre-editing data is displayed. -For example, this could display the text being typed in in the phonetic +For example, this could display the text being typed in the phonetic alphabet before it is composed and inserted as an ideograph. @@ -198,7 +198,7 @@ This should be called when the widget receives the input focus, typically in the widget's focus_in_event method. -@ic: a #GdkInputContext. +@ic: a #GdkIC. @window: the #GdkWindow which will be receiving the key press events. diff --git a/docs/reference/gtk/tmpl/gtkmain.sgml b/docs/reference/gtk/tmpl/gtkmain.sgml index 5ef24dce3e..542ffb6a09 100644 --- a/docs/reference/gtk/tmpl/gtkmain.sgml +++ b/docs/reference/gtk/tmpl/gtkmain.sgml @@ -11,7 +11,7 @@ have control over the program flow all the time this does not apply to applications written using GTK. Instead you set up some objects and register some functions (callbacks) to be called whenever some event occurs and give control to the GTK mainloop (e.g. by calling -gtk_main). +gtk_main). @@ -143,58 +143,123 @@ and invoke timeouts etc. while doing some time intensive computation. - +Runs the main loop until gtk_main_quit() is called. You can nest calls to +gtk_main. In that case gtk_main_quit() will make the innerst invocation +of the main loop return. - +Ask for the current nesting level of the main loop. This can be useful +when calling gtk_quit_add. -@Returns: +@Returns: the nesting level of the current invocation of the main loop. - +Makes the innermost invocation of the main loop return when it regains +control. - +Runs a single iteration of the mainloop. If no events are waiting to be +processed GTK+ will block until the next event is noticed. If you don't +want to block look at gtk_main_iteration_do or check if any events are +pending with gtk_events_pending first. -@Returns: +@Returns: %TRUE if gtk_main_quit has been called for the innermost mainloop. - +Run a single iteration of the mainloop. If no events are available either +return or block dependend on the value of @blocking. -@blocking: -@Returns: +@blocking: %TRUE if you want GTK+ to block if no events are pending. +@Returns: %TRUE if gtk_main_quit has been called for the innermost mainloop. - +Process a single GDK event. This is public only to allow filtering of events +between GDK and GTK. You will not usually need to call this function directly. + + +While you should not call this function directly, you might want to know +how exactly events are handled. So here is what this function does with +the event: -@event: + + + Compress enter/leave notify events. If the event passed build an + enter/leave pair together with the next event (peeked from Gdk) + both events are thrown away. This is to avoid a backlog of (de-)highlighting + widgets crossed by the pointer. + + + Find the widget which got the event. If the widget can't be determined + the event is thrown away unless it belongs to a INCR transaction. In that + case it is passed to gtk_selection_incr_event. + + + Then the event is passed on a stack so you can query the currently handled + event with gtk_get_current_event. + + + The event is sent to a widget. If a grab is active all events for + widgets that are not in the contained in the grab widget are sent to the + latter with a few exceptions: + + + + Deletion and destruction events are still sent to the event widget for + obvious reasons. + + + Events which directly relate to the visual representation of the event + widget. + + + Leave events are delivered to the event widget if there was an enter + event delivered to it before without the paired leave event. + + + Drag events are not redirected because it is unclear what the semantics + of that would be. + + + + Another point of interest might be that all keypresses are first passed + through the key snooper functions if there are any. Read the description + of gtk_key_snooper_install() if you need this feature. + + + After finishing the delivery the event is popped from the event stack. + + + +@event: An event to process (normally) passed by Gdk. - +Each GTK+ module must have a function gtk_module_init with this prototype. +This function is called after loading the module with the argc and argv +cleaned from any arguments that GTK+ handles itself. -@argc: -@argv: +@argc: Pointer to the number of arguments remaining after gtk_init. +@argv: Points to the argument vector. @@ -250,137 +315,170 @@ but always returns %FALSE. - +Makes %widget the current grabbed widget. This means that interaction with +other widgets in the same application is blocked and mouse as well as +keyboard events are delivered to this %widget. -@widget: +@widget: The widget that grabs keyboard and pointer events. - +Queries the current grab. -@Returns: +@Returns: The widget which currently has the grab or %NULL if no grab is active. - +Remove the grab from the given widget. You have to pair calls to gtk_grab_add +and gtk_grab_remove. -@widget: +@widget: The widget which gives up the grab. - +Register a function to be called when the mainloop is started. -@function: -@data: +@function: Function to invoke when gtk_main is called next. +@data: Data to pass to that function. - +Trigger destruction of %object in case the mainloop at level %main_level +is quit. -@main_level: -@object: +@main_level: Level of the mainloop which shall trigger the destruction. +@object: Object to be destroyed. - +Registers a function to be called when an instance of the mainloop is left. -@main_level: -@function: -@data: -@Returns: +@main_level: Level at which termination the function shall be called. You + can pass 0 here to have the function run at the termination of the current + mainloop. +@function: The function to call. This should return 0 to be removed from the + list of quit handlers. Otherwise the function might be called again. +@data: Pointer to pass when calling %function. +@Returns: A handle for this quit handler (you need this for gtk_quit_remove()) + or 0 if you passed a NULL pointer in %function. - +Registers a function to be called when an instance of the mainloop is left. +In comparison to gtk_quit_add() this function adds the possibility to +pass a marshaller and a function to be called when the quit handler is freed. + + +The former can be used to run interpreted code instead of a compiled function +while the latter can be used to free the information stored in %data (while +you can do this in %function as well)... So this function will mostly be +used by GTK+ wrappers for languages other than C. -@main_level: -@function: -@marshal: -@data: -@destroy: -@Returns: +@main_level: Level at which termination the function shall be called. You + can pass 0 here to have the function run at the termination of the current + mainloop. +@function: The function to call. This should return 0 to be removed from the + list of quit handlers. Otherwise the function might be called again. +@marshal: The marshaller to be used. If this is non-NULL, %function is + ignored. +@data: Pointer to pass when calling %function. +@destroy: Function to call to destruct %data. Gets %data as argument. +@Returns: A handle for this quit handler (you need this for gtk_quit_remove()) + or 0 if you passed a NULL pointer in %function. - +Remove a quit handler by it's identifier. -@quit_handler_id: +@quit_handler_id: Identifier for the handler returned when installing it. - +Remove a quit handler identified by it's %data field. -@data: +@data: The pointer passed as %data to gtk_quit_add() or gtk_quit_add_full(). - +Registers a function to be called periodically. The function will be called +repeatedly after %interval milliseconds until it returns %FALSE at which +point the timeout is destroyed and will not be called again. -@interval: -@function: -@marshal: -@data: -@destroy: -@Returns: +@interval: The time between calls to the function, in milliseconds + (1/1000ths of a second.) +@function: The function to call periodically. +@marshal: The marshaller to use instead of the function (if non-NULL). +@data: The data to pass to the function. +@destroy: Function to call when the timeout is destroyed or NULL. +@Returns: A unique id for the event source. - +Registers a function to be called periodically. The function will be called +repeatedly after %interval milliseconds until it returns %FALSE at which +point the timeout is destroyed and will not be called again. -@interval: -@function: -@data: -@Returns: +@interval: The time between calls to the function, in milliseconds + (1/1000ths of a second.) +@function: The function to call periodically. +@data: The data to pass to the function. +@Returns: A unique id for the event source. - +Removes the given timeout destroying all information about it. -@timeout_handler_id: +@timeout_handler_id: The identifier returned when installing the timeout. - +Causes the mainloop to call the given function whenever no events with +higher priority are to be processed. The default priority is +GTK_PRIORITY_DEFAULT, which is rather low. -@function: -@data: -@Returns: +@function: The function to call. +@data: The information to pass to the function. +@Returns: a unique handle for this registration. - +Like gtk_idle_add() this function allows you to have a function called +when the event loop is idle. The difference is that you can give a +priority different from GTK_PRIORITY_DEFAULT to the idle function. -@priority: -@function: -@data: -@Returns: +@priority: The priority which should not be above G_PRIORITY_HIGH_IDLE. +Note that you will interfere with GTK if you use a priority above +GTK_PRIORITY_RESIZE. +@function: The function to call. +@data: Data to pass to that function. +@Returns: A unique id for the event source. @@ -398,18 +496,18 @@ but always returns %FALSE. - +Removes the idle function with the given id. -@idle_handler_id: +@idle_handler_id: Identifies the idle function to remove. - +Removes the idle function identified by the user data. -@data: +@data: remove the idle function which was registered with this user data. @@ -436,42 +534,58 @@ but always returns %FALSE. - +Use this priority for redrawing related stuff. It is used internally by +GTK+ to do pending redraws. This priority is lower than %GTK_PRIORITY_RESIZE +to avoid redrawing a widget just before resizing (and therefore redrawing +it again). - +Use this priority for resizing related stuff. It is used internally by +GTK+ to compute the sizes of widgets. This priority is higher than +%GTK_PRIORITY_REDRAW to avoid resizing a widget which was just redrawn. - +Use this for high priority timeouts. This priority is never used inside +GTK+ so everything running at this priority will be running before anything +inside the toolkit. + +This macro is deprecated. You should use G_PRIORITY_HIGH instead. + - +This priority is for GTK+ internal stuff. Don't use it in your applications. - +Default priority for idle functions. + +This macro is deprecated. You should use G_PRIORITY_DEFAULT_IDLE instead. + - +Priority for very unimportant background tasks. + +This macro is deprecated. You should use G_PRIORITY_LOW instead. +