summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
Commit message (Collapse)AuthorAgeFilesLines
* Move declarations before statements.Jan Djärv2010-02-241-25/+9
| | | | | | | | | | | * xterm.c (XTflash): Move declarations before statements. * gtkutil.c (xg_get_gdk_display): Remove (unused). (xg_get_pixbuf_from_pix_and_mask, xg_create_frame_widgets) (xg_toggle_notify_cb, xg_set_toolkit_scroll_bar_thumb) (xg_create_tool_bar): Remove unused variables. (x_wm_set_size_hint): Move declarations before statements. (xg_create_frame_widgets): Remove variable grav,
* Add 2010 to copyright years.Glenn Morris2010-01-131-1/+1
|
* Handle change of internal-border width when maximized.Jan Djärv2010-01-051-3/+72
| | | | | | | | | | | * xterm.c (x_new_font): Move code for setting rows/cols before resizing ... (x_set_window_size): ... to here. bug #2568. * gtkutil.c (xg_clear_under_internal_border): New function. (xg_frame_resized, xg_frame_set_char_size): Call xg_clear_under_internal_border. (xg_update_scrollbar_pos): Clear under old scroll bar position.
* Bug 5177: Scroll bar thumb did not move when scrolling with mouse wheel.Jan Djärv2009-12-131-26/+13
| | | | | | | | | | | | | | | | | | | | * xterm.c (xg_scroll_callback): Parameter list changed, use parameter GtkScrollType to determine scroll/line/page. Only allow dragging if a button < 4 is grabbed (bug #5177). (xg_end_scroll_callback): New function. (x_create_toolkit_scroll_bar): Pass xg_end_scroll_callback to xg_create_scroll_bar. * gtkutil.c (xg_gtk_scroll_destroy): Remove XG_LAST_SB_DATA handling. (scroll_end_callback): Remove. (xg_create_scroll_bar): Add parameter end_callback, bind it to button-release-event. Replace value-changed event with change-value, bug #5177, (xg_event_is_for_scrollbar): Only return true if button is less than 4, bug #5177. * gtkutil.h (XG_LAST_SB_DATA): Remove. (xg_create_scroll_bar): Add GCallback end_callback.
* gtkutil.c: Scroll bar thumb not updated properly (bug #5177).Jan Djärv2009-12-121-2/+19
| | | | | | | (scroll_end_callback): New function (bug #5177) (xg_create_scroll_bar): Call scroll_end_callback on button release event (bug #5177). (xg_event_is_for_scrollbar): != replaced with ==.
* (xg_tool_bar_proxy_help_callback): Fix missing return.Andreas Schwab2009-12-091-1/+1
|
* Use a select wrapper around the GLib event loop, thus taking into account GLibJan Djärv2009-11-211-127/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timeouts and event sources. This simplifies Gtk+-code a lot, and is needed for handling GConf death/restart. * xterm.c: #include xgselect.h. (x_initialize): Call xgselect_initialize. * xsettings.c (something_changedCB): C++ comments => C comments. (init_gconf): Do not deal with any GLib file descriptors, xg_select does that now. * gtkutil.c (xg_timer, xg_process_timeouts, xg_start_timer) (xg_stop_timer, menu_grab_callback_cnt, menu_grab_callback) (scroll_bar_button_cb): Remove. (create_menus): C++ comments => C comments. Don't bind grab-notify event. (xg_create_scroll_bar): Don't bind button-press-event and button-release-event. * process.c: Include xgselect.h if defined (USE_GTK) || defined (HAVE_GCONF). (wait_reading_process_output): Call xg_select for the same condition. * xgselect.c (xg_select): New function to better integrate with GLib/Gtk event handling. Needed if GConf daemon dies/restarts. * xgselect.h: New file, declare xg_select, xgselect_initialize. * Makefile.in (XOBJ): Add xgselect.o.
* gtkutil.c (xg_modify_menubar_widgets): If menubar is totally emptyJan Djärv2009-11-201-0/+4
| | | | add a blank entry so it doesn't collapse into nothing.
* gtkutil.c (xg_update_frame_menubar): Do nothing if menubar already has a parent.Jan Djärv2009-11-141-0/+3
|
* * process.c (ifflag_def): Make flag_sym constant.Dan Nicolaescu2009-11-111-1/+1
| | | | | | | | | | | | | | | | | | (Fnetwork_interface_info): Use a constant pointer. (ifflag_table): * xfns.c (cursor_bits): * xdisp.c (power_letter): * termcap.c (speeds, esctab): * sysdep.c (baud_convert): * keyboard.c (lispy_accent_codes, modifier_names): * image.c (xbm_format, xpm_format, pbm_format, png_format) (jpeg_format, tiff_format, gif_format, svg_format) (interlace_start, interlace_increment, gs_format): * gtkutil.c (separator_names): * fringe.c (swap_nibble): * fns.c (base64_value_to_char, base64_char_to_value): * fileio.c (make_temp_name_tbl): * coding.c (suffixes): Make constant.
* Bug #4574. Common code for file/font dialog. Handle timers with glib-timers.Jan Djärv2009-11-101-78/+119
| | | | | | | | | | | | | | | | | | | | | * keyboard.h: Declare timer_check. * keyboard.c (timer_check_2): New function that does what the old timer_check did. (timer_check): Call timer_check_2 until -1 or a non-zero time is returned, i.e. don't return -1 with timers pending. * process.c: Remove extern declaration of timer_check. * xmenu.c (x_menu_wait_for_event): Remove code that did a timeout even if timer_check returned -1. * gtkutil.c (xg_dialog_response_cb): data is now a struct xg_dialog_data (pop_down_dialog): Destroy widget (if any), cancel timer and unref the event loop. (xg_maybe_add_timer, xg_dialog_run): New functions (bug #4574). (xg_get_file_name, xg_get_font_name): Call xg_dialog_run (bug #4574). Destroy the dialog after xg_dialog_run.
* Fix bug #4870, issues 3 and 4.Jan Djärv2009-11-061-0/+32
| | | | | | | | | * gtkutil.c (xg_event_is_for_scrollbar): New function (bug#4870). * gtkutil.h: Declare xg_event_is_for_scrollbar (bug#4870). * xterm.c (handle_one_xevent): Call xg_event_is_for_scrollbar for ButtonPressRelease and MotionNotify (bug#4870).
* Fix resize due to font change on a maximized/xmonad-controlled frame.Jan Djärv2009-10-211-21/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * xterm.h (x_wait_for_event): Declare it. * xterm.c (pending_event_wait): New variable. (handle_one_xevent): Set pending_event_wait.eventtype to 0 if we see pending_event_wait.eventtype. (handle_one_xevent): Don't change gravity when parent changes. (x_new_font): Call change_frame_size with new rows/columns before we try to resize the frame. (x_wait_for_event): New function. (x_set_window_size_1): Don't change gravity unless change_gravity is set. Call XResizeWindow with FRAME_OUTER_WINDOW. If we are visible, don't change frame size, instead wait for the ConfigureNotify. (x_set_window_size): Call x_set_window_size_1 for USE_X_TOOLKIT also. (x_wm_set_size_hint): Remove ifdefs for USE_X_TOOLKIT. (x_initialize): Initialize pending_event_wait. * xmenu.c (set_frame_menubar): Add internal border width to menu bar size. * widget.c (EmacsFrameSetValues): Add comment. (EmacsFrameSetCharSize): Just call x_set_window_size. * gtkutil.c (xg_frame_set_char_size): Flush events and call x_wait_for_event. (flush_and_sync): Removed again. (xg_get_font_name): Suggest monospace if no previous font is known.
* * alloc.c: Do not define struct catchtag.Dan Nicolaescu2009-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c: Move struct catchtag definition ... * lisp.h: ... here. * image.c: Move png.h #include earlier to avoid warnings. * xterm.c: * xsmfns.c: * xselect.c: * xrdb.c: * xmenu.c: * xftfont.c: * xfont.c: * xfns.c: * xfaces.c: * xdisp.c: * window.c: * widget.c: * w32xfns.c: * w32uniscribe.c: * w32term.c: * w32select.c: * w32reg.c: * w32proc.c: * w32menu.c: * w32inevt.c: * w32heap.c: * w32font.c: * w32fns.c: * w32console.c: * w32.c: * w16select.c: * vm-limit.c: * unexsol.c: * unexec.c: * unexcw.c: * unexaix.c: * undo.c: * tparam.c: * textprop.c: * terminfo.c: * terminal.c: * termcap.c: * term.c: * syntax.c: * sound.c: * sheap.c: * search.c: * scroll.c: * region-cache.c: * regex.c: * ralloc.c: * process.c: * print.c: * msdos.c: * minibuf.c: * menu.c: * marker.c: * macros.c: * keymap.c: * keyboard.c: * intervals.c: * insdel.c: * indent.c: * gtkutil.c: * ftxfont.c: * ftfont.c: * fringe.c: * frame.c: * fontset.c: * font.c: * fns.c: * floatfns.c: * filelock.c: * fileio.c: * emacs.c: * editfns.c: * dosfns.c: * doprnt.c: * doc.c: * dispnew.c: * dired.c: * dbusbind.c: * data.c: * composite.c: * coding.c: * cmds.c: * cm.c: * chartab.c: * charset.c: * character.c: * ccl.c: * category.c: * casetab.c: * casefiddle.c: * callproc.c: * callint.c: * bytecode.c: * buffer.c: * atimer.c: Include setjmp.h. (Bug#4643) * xlwmenu.c: * lwlib.c: * lwlib-utils.c: * lwlib-Xm.c: * lwlib-Xlw.c: * lwlib-Xaw.c: Include setjmp.h.
* gtkutil.c (create_menus): Call gtk_widget_set_size_request forJan Djärv2009-10-081-1/+9
| | | | menu bar with a small width so it doesn't enlarge the frame.
* * xterm.c (Qx_gtk_map_stock): New var.Chong Yidong2009-07-161-5/+5
| | | | | * gtkutil.c (update_frame_tool_bar): Use Qx_gtk_map_stock instead of calling intern each time.
* * gtkutil.c (xg_frame_set_char_size): Do set width/height if theJan Djärv2009-07-021-16/+35
| | | | | | | | | frame isn't visible. (xg_frame_resized): If width/height is -1, get size of window from X server. * xterm.c (handle_one_xevent): Call xg_frame_resized for USE_GTK for MapNotify.
* Remove debug code.Jan Djärv2009-07-021-1/+0
|
* (xg_frame_set_char_size): Do not set pixel width/heightJan Djärv2009-07-021-2/+16
| | | | | here or call change_frame_size. Just call flush_and_sync. (flush_and_sync): Reintroduced.
* (xg_frame_set_char_size): Do not set pixel width/height here orJan Djärv2009-07-021-23/+8
| | | | call change_frame_size.
* * gtkutil.c (xg_tool_bar_proxy_help_callback): New function.Jan Djärv2009-07-011-4/+39
| | | | | (xg_tool_bar_menu_proxy): Attach enter/leave events to xg_tool_bar_proxy_help_callback.
* * emacs.c (USAGE3, standard_args): Add -mm and --maximized.Jan Djärv2009-07-011-88/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.c: Qmaximized is new. (x_set_frame_parameters): Do not handle fullscreen specially. Only set width and height if explicitly set. (x_set_fullscreen): Handle Qmaximized. (x_set_font, x_figure_window_size): Do not handle fullscreen specially. (syms_of_frame): Initialize Qmaximized. * frame.h (fullscreen_type): Add FULLSCREEN_MAXIMIZED. Declare Qfullwidth, Qfullheight, Qfullboth, Qmaximized. * xterm.c (handle_one_xevent): Remove call to x_check_fullscreen for Expose event. Add call to x_check_fullscreen for MapNotify event. Remove all code w.r.t. fullscreen from ConfigureNotify event. Do not set gravity to NorthWestGravity when USE_GTK. (set_wm_state): New function. (do_ewmh_fullscreen): Use set_wm_state. Also handle FULLSCREEN_MAXIMIZED. (x_handle_net_wm_state): Handle FULLSCREEN_MAXIMIZED. (x_check_fullscreen): Simplify so we only handle EMWH type of fullscreen or the case when no window manager is running. That means remove calls to x_real_positions and x_fullscreen_adjust. * gtkutil.c (flush_and_sync, x_wm_size_hint_off): Remove. (xg_frame_set_char_size): Remove calls to x_wm_size_hint_off and flush_and_sync. (xg_height_changed): New function. (xg_create_frame_widgets): Remove call to gtk_widget_set_size_request and gtk_window_set_policy. Set frame gravity after parsing the geometry string. (xg_update_frame_menubar, free_frame_menubar) (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback) (update_frame_tool_bar, free_frame_tool_bar): Call xg_height_changed. Remove calls to xg_frame_set_char_size. * startup.el (command-line-x-option-alist): Add -mm and --maximized. * NEWS: Mention maximized. * frames.texi (Size Parameters): Mention maximized for fullscreen. * xresources.texi (Table of Resources): Mention maximized for fullscreen. * cmdargs.texi (Window Size X): -mm/--maximized is new.
* * gtkutil.c (xg_frame_set_char_size): Set frame pixel width/height toJan Djärv2009-05-111-0/+23
| | | | what we expect to get in the next ConfigureNotify event.
* Make Emacs compile when Gtk+ and -DGTK_DISABLE_DEPRECATED is used.Jan Djärv2009-04-191-6/+7
| | | | | | | | | | * gtkutil.c (xg_tool_bar_menu_proxy, update_frame_tool_bar): Use G_CALLBACK instead of GTK_SIGNAL_FUNC which is deprecated. (xg_initialize): Use g_type_class_ref instead of gtk_type_class which is deprecated. * configure.in (HAVE_GTK_FILE_SELECTION, HAVE_GTK_FILE_CHOOSER): Check if it is declared in gtk.h.
* gtkutil.c (xg_display_open): Assign a value to gdpy_def, checkJan Djärv2009-03-231-3/+6
| | | | that gdpy is set.
* * gtkutil.c (xg_tool_bar_callback): Set focus back to the frameJan Djärv2009-03-141-6/+5
| | | | | after clicking in a detached tool bar. (xg_tool_bar_proxy_callback): Remove call to Fx_focus_frame.
* Fix typos.Juanma Barranquero2009-03-021-1/+1
|
* Fix typo in comment.Juanma Barranquero2009-02-261-21/+21
|
* Add 2009 to copyright years.Glenn Morris2009-01-081-1/+1
|
* * buffer.c (init_buffer): Use realloc instead of xrealloc.Andreas Schwab2008-12-221-1/+1
| | | | * gtkutil.c (free_widget_value): Use xfree instead of free.
* (xg_frame_resized): Remove check if rows/columns haveJan Djärv2008-12-181-0/+7
| | | | | | changed. (xg_tool_bar_proxy_callback): Put focus on the frame after we have clicked on a detached tool bar button.
* (xg_frame_resized): Remove check if rows/columns haveJan Djärv2008-12-181-8/+3
| | | | changed.
* (update_frame_tool_bar): Initialize variable.Chong Yidong2008-12-011-1/+1
|
* (xg_display_open): Reset default display if none exists.Chong Yidong2008-10-071-26/+17
| | | | (xg_display_close): Allow Emacs to close all displays (bug#985).
* (x_wm_set_size_hint): Return immediately if called duringChong Yidong2008-10-061-88/+86
| | | | initialization.
* * gtkutil.c (menu_nav_ended): Remove.Jan Djärv2008-07-291-34/+0
| | | | (create_menus): Remove signal connect for menu_nav_ended.
* * lisp.h (init_weak_hash_tables, syms_of_font)Andreas Schwab2008-07-281-0/+3
| | | | | | | | | (xd_read_queued_messages, syms_of_dbusbind): Declare. (remove_hash_entry): Don't declare. * eval.c (maybe_call_debugger): Make static and move before use. * gtkutil.c: Include <X11/Xft/Xft.h> if HAVE_XFT. * xdisp.c: Include "gtkutil.h" if USE_GTK. * xterm.h (x_set_frame_alpha): Declare.
* (menu_nav_ended): Revert change from 2008-07-24.Jan Djärv2008-07-281-0/+34
| | | | (create_menus): Connect selection-done to menu_nav_ended.
* (xg_get_font_name): Cast w to GTK_FONT_SELECTION_DIALOG.Jan Djärv2008-07-241-42/+11
| | | | | | | | (menu_nav_ended): Remove. (create_menus): Remove signal connect for menu_nav_ended. (xg_update_menubar): Also take deactivate_cb as parameter, pass it to create_menus. (xg_modify_menubar_widgets): Pass deactivate_cb to xg_update_menubar.
* Merge from emacs--rel--22Miles Bader2008-07-171-1/+1
|\ | | | | | | Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1339
| * Include <config.h> instead of "config.h".YAMAMOTO Mitsuharu2008-07-171-1/+1
| |
* | American English spelling fix.Glenn Morris2008-06-271-1/+1
| |
* | * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.Stefan Monnier2008-06-151-1/+3
| | | | | | | | * gtkutil.c (xg_create_frame_widgets): Don't set internal_border_width.
* | (xg_dialog_response_cb): Rename from xg_file_response_callback.Chong Yidong2008-06-101-5/+70
| | | | | | | | | | | | (pop_down_dialog): Rename from pop_down_file_dialog. (xg_get_file_name): Callers changed. (xg_get_font_name): New function.
* | Make "xfree (NULL)" a no-op; remove useless if-before-xfree.Jim Meyering2008-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (xfree): Return right away for a NULL arg. * src/lread.c (nosuffix): Remove now-useless if-before-xfree tests. * src/gtkutil.c (xg_gtk_scroll_destroy): Likewise. * src/mac.c (create_apple_event_from_event_ref): Likewise. (create_apple_event_from_drag_ref, cfstring_create_normalized): Likewise. * src/doprnt.c (doprnt1): Likewise. * src/frame.c (frame): Likewise. * src/keyboard.c (wipe_kboard): Likewise. * src/macterm.c (x_free_frame_resources, xlfdpat_destroy, XFreePixmap): (init_font_name_table, mac_unload_font, x_delete_display): Likewise. * src/term.c (tty_default_color_capabilities, maybe_fatal) (delete_tty): Likewise. * src/w16select.c (string): Likewise. * src/w32.c (w32_get_resource, SET_ENV_BUF_SIZE): Likewise. * src/w32bdf.c (w32_free_bdf_font): Likewise. * src/w32fns.c (w32_unload_font): Likewise. * src/w32font.c (w32font_close): Likewise. * src/window.c (size_window): Likewise. * src/xselect.c (receive_incremental_selection): Likewise. * src/xterm.c (x_free_frame_resources, x_delete_display): Likewise. * src/mactoolbox.c (create_apple_event_from_drag_ref): Likewise. * src/w32.c (stat): Likewise.
* | Switch to recommended form of GPLv3 permissions notice.Glenn Morris2008-05-141-6/+4
| |
* | (xg_set_geometry): Fix indentation.Jan Djärv2008-03-301-69/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (xg_resize_outer_widget): Removed (x_wm_size_hint_off): Fix indentation. (xg_frame_set_char_size): Call flush_and_sync after gtk_window_resize. (x_wm_set_size_hint): Pass NULL as geometry window to gtk_window_set_geometry_hints due to Gtk+ bug nr 68668. Add menu bar and tool bar height to base height. (xg_update_frame_menubar, free_frame_menubar) (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback) (update_frame_tool_bar, free_frame_tool_bar): Change xg_resize_outer_widget to xg_frame_set_char_size.
* | (free_frame_tool_bar): Only call gtk_container_remove ifJan Djärv2008-03-171-2/+9
| | | | | | | | handlebox_widget is != 0.
* | (xg_resize_outer_widget): Only do one of set_geometry orJan Djärv2008-03-011-73/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | set_char_size. (xg_frame_resized): Renamed from xg_resize_widgets. Remove all operations on widgets here. Just set frame size if needed. (flush_and_sync, x_wm_size_hint_off, xg_pack_tool_bar): New functions. (xg_frame_set_char_size): Call x_wm_size_hint_off before resizing. (x_wm_set_size_hint): Set size hints on the edit widget only, not the whole frame. (xg_create_tool_bar): Move attachement of the tool bar to xg_pack_tool_bar. Do not attach the tool bar if there are no items. (free_frame_tool_bar): Remove call to SET_FRAME_GARBAGED.
* | (xg_create_frame_widgets): If frame is embedded, callJan Djärv2008-02-071-1/+5
| | | | | | | | gtk_plug_new.