diff options
author | Frederic Plourde <frederic.plourde@collabora.com> | 2012-10-10 14:20:57 +0000 |
---|---|---|
committer | Ross Burton <ross.burton@intel.com> | 2012-10-10 16:31:52 +0100 |
commit | 9a256abf7ee11dbe91cef79f3bc002732f81c393 (patch) | |
tree | 6223dc1527920c2aa9a4cd8ab913479e2f07be0f | |
parent | 7b88c4f2d6ca4c73cafaec8dca55ade890a2cf35 (diff) |
Use GtkBuilder instead of libglade
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | data/Makefile.am | 2 | ||||
-rw-r--r-- | data/Xoo.glade | 693 | ||||
-rw-r--r-- | data/xoo.ui | 521 | ||||
-rw-r--r-- | src/button.c | 2 | ||||
-rw-r--r-- | src/main.c | 128 |
6 files changed, 607 insertions, 741 deletions
diff --git a/configure.ac b/configure.ac index cd9390a..fac53c5 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,7 @@ AM_CONDITIONAL(HAVE_GCONF, test -n "$GCONF_REQ") dnl TODO: make gconf optional -PKG_CHECK_MODULES(APP, [gtk+-2.0 libglade-2.0 $GCONF_REQ]) +PKG_CHECK_MODULES(APP, [gtk+-2.0 $GCONF_REQ]) dnl ------ XTest ------------------------------------------------------------ diff --git a/data/Makefile.am b/data/Makefile.am index 65f357e..ccd41d4 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,7 +5,7 @@ dist_device_DATA = dot.png \ nokia-n800.xml nokia-n800.png uidir = $(pkgdatadir) -dist_ui_DATA = Xoo.glade +dist_ui_DATA = xoo.ui desktopdir = $(datadir)/applications dist_desktop_DATA = xoo.desktop diff --git a/data/Xoo.glade b/data/Xoo.glade deleted file mode 100644 index fe254f0..0000000 --- a/data/Xoo.glade +++ /dev/null @@ -1,693 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="window"> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="events">GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK</property> - <property name="title" translatable="yes">Xoo</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="destroy" handler="on_window_destroy" last_modification_time="Mon, 08 Nov 2004 12:58:27 GMT"/> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkMenuBar" id="menubar"> - <property name="visible">True</property> - <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property> - <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property> - - <child> - <widget class="GtkMenuItem" id="menuitem1"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Device</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem1_menu"> - - <child> - <widget class="GtkMenuItem" id="select_device"> - <property name="visible">True</property> - <property name="label" translatable="yes">Select _Device...</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_select_device_activate" last_modification_time="Mon, 08 Nov 2004 12:08:36 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="send_signal"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Send Debug Signal</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_send_signal_activate" last_modification_time="Mon, 08 Nov 2004 12:08:36 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="preferences"> - <property name="visible">True</property> - <property name="label">gtk-preferences</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_preferences_activate" last_modification_time="Mon, 08 Nov 2004 12:08:36 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="quit"> - <property name="visible">True</property> - <property name="label">gtk-quit</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_quit_activate" last_modification_time="Mon, 08 Nov 2004 12:08:36 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuitem4"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Help</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem4_menu"> - - <child> - <widget class="GtkMenuItem" id="about"> - <property name="visible">True</property> - <property name="label" translatable="yes">_About</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_about_activate" last_modification_time="Mon, 08 Nov 2004 12:08:36 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="eventbox1"> - <property name="visible">True</property> - <property name="events">GDK_BUTTON_PRESS_MASK</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - <signal name="button_press_event" handler="on_popup_menu_show" last_modification_time="Fri, 30 Sep 2005 15:04:11 GMT"/> - - <child> - <widget class="GtkFixed" id="fixed"> - <property name="visible">True</property> - - <child> - <widget class="GtkDrawingArea" id="winnest"> - <property name="width_request">50</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="x">48</property> - <property name="y">48</property> - </packing> - </child> - - <child> - <widget class="GtkImage" id="back"> - <property name="width_request">21</property> - <property name="height_request">21</property> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="x">8</property> - <property name="y">8</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkMenuBar" id="popupmenubar"> - <property name="visible">True</property> - <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property> - <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property> - - <child> - <widget class="GtkMenuItem" id="popupmenu"> - <property name="visible">True</property> - <property name="label" translatable="yes">Popup</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="popupmenu_menu"> - - <child> - <widget class="GtkCheckMenuItem" id="show_decorations"> - <property name="visible">True</property> - <property name="label" translatable="yes">Show decorations</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <signal name="activate" handler="on_show_decorations_toggle" last_modification_time="Mon, 08 Nov 2004 16:05:28 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="prefswindow"> - <property name="title" translatable="yes">Preferences</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">True</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="delete_event" handler="on_delete_event_hide" last_modification_time="Wed, 01 Dec 2004 18:42:22 GMT"/> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="border_width">8</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">8</property> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">6</property> - <property name="bottom_padding">6</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkTable" id="table1"> - <property name="visible">True</property> - <property name="n_rows">4</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">4</property> - <property name="column_spacing">4</property> - - <child> - <widget class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="label" translatable="yes">Extra Options:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">X Server:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="label" translatable="yes">X Display:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="entry_options"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="entry_display"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkEntry" id="entry_server"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button_browse"> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - - <child> - <widget class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="stock">gtk-open</property> - <property name="icon_size">2</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label9"> - <property name="visible">True</property> - <property name="label" translatable="yes">On startup run:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="entry_start"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Embedded X Server</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHButtonBox" id="hbuttonbox1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">8</property> - - <child> - <widget class="GtkButton" id="button_close"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_prefs_cancel_clicked" last_modification_time="Wed, 01 Dec 2004 15:37:57 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button_apply"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-apply</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_prefs_apply_clicked" last_modification_time="Wed, 01 Dec 2004 15:38:11 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="aboutwindow"> - <property name="title" translatable="yes">Xoo</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="delete_event" handler="on_delete_event_hide" last_modification_time="Wed, 01 Dec 2004 18:37:55 GMT"/> - - <child> - <widget class="GtkVBox" id="vbox3"> - <property name="border_width">8</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">8</property> - - <child> - <widget class="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="label" translatable="yes"><span size="xx-large"><b>Xoo</b></span></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="label" translatable="yes">A tool for simulating X-based small-screen devices.</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label8"> - <property name="visible">True</property> - <property name="label" translatable="yes"><small>Copyright © 2004 OpenedHand Ltd -info@o-hand.com</small></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHButtonBox" id="hbuttonbox2"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="button_about_close"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-close</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_about_close_clicked" last_modification_time="Wed, 01 Dec 2004 15:46:16 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/data/xoo.ui b/data/xoo.ui new file mode 100644 index 0000000..3219d17 --- /dev/null +++ b/data/xoo.ui @@ -0,0 +1,521 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 2.12 --> + <!-- interface-naming-policy toplevel-contextual --> + <object class="GtkWindow" id="aboutwindow"> + <property name="can_focus">False</property> + <property name="title" translatable="yes">Xoo</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <signal name="delete-event" handler="on_delete_event_hide" swapped="no"/> + <child> + <object class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">8</property> + <property name="spacing">8</property> + <child> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><span size="xx-large"><b>Xoo</b></span></property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">A tool for simulating X-based small-screen devices.</property> + <property name="justify">center</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><small>Copyright © 2004 OpenedHand Ltd +info@o-hand.com</small></property> + <property name="use_markup">True</property> + <property name="justify">center</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkHButtonBox" id="hbuttonbox2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkButton" id="button_about_close"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_about_close_clicked" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkMenuBar" id="popupmenubar"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkMenuItem" id="popupmenu"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Popup</property> + <property name="use_underline">True</property> + <child type="submenu"> + <object class="GtkMenu" id="popupmenu_menu"> + <property name="can_focus">False</property> + <child> + <object class="GtkCheckMenuItem" id="show_decorations"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Show decorations</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <signal name="activate" handler="on_show_decorations_toggle" swapped="no"/> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + <object class="GtkWindow" id="prefswindow"> + <property name="can_focus">False</property> + <property name="title" translatable="yes">Preferences</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">True</property> + <property name="type_hint">dialog</property> + <signal name="delete-event" handler="on_delete_event_hide" swapped="no"/> + <child> + <object class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">8</property> + <property name="spacing">8</property> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="bottom_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="n_rows">4</property> + <property name="n_columns">2</property> + <property name="column_spacing">4</property> + <property name="row_spacing">4</property> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Extra Options:</property> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">X Server:</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">X Display:</property> + </object> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_options"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + <property name="primary_icon_sensitive">True</property> + <property name="secondary_icon_sensitive">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_display"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + <property name="primary_icon_sensitive">True</property> + <property name="secondary_icon_sensitive">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkEntry" id="entry_server"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + <property name="primary_icon_sensitive">True</property> + <property name="secondary_icon_sensitive">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button_browse"> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <child> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-open</property> + <property name="icon-size">2</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">On startup run:</property> + </object> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_start"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + <property name="primary_icon_sensitive">True</property> + <property name="secondary_icon_sensitive">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHButtonBox" id="hbuttonbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">8</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="button_close"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_prefs_cancel_clicked" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button_apply"> + <property name="label">gtk-apply</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_prefs_apply_clicked" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkWindow" id="window"> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="events">GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK</property> + <property name="title" translatable="yes">Xoo</property> + <property name="resizable">False</property> + <signal name="destroy" handler="on_window_destroy" swapped="no"/> + <child> + <object class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkMenuBar" id="menubar"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkMenuItem" id="menuitem1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">_Device</property> + <property name="use_underline">True</property> + <child type="submenu"> + <object class="GtkMenu" id="menuitem1_menu"> + <property name="can_focus">False</property> + <child> + <object class="GtkMenuItem" id="select_device"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Select _Device...</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_select_device_activate" swapped="no"/> + </object> + </child> + <child> + <object class="GtkMenuItem" id="send_signal"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">_Send Debug Signal</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_send_signal_activate" swapped="no"/> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="preferences"> + <property name="label">gtk-preferences</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <signal name="activate" handler="on_preferences_activate" swapped="no"/> + </object> + </child> + <child> + <object class="GtkSeparatorMenuItem" id="separatormenuitem1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + <child> + <object class="GtkImageMenuItem" id="quit"> + <property name="label">gtk-quit</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <signal name="activate" handler="on_quit_activate" swapped="no"/> + </object> + </child> + </object> + </child> + </object> + </child> + <child> + <object class="GtkMenuItem" id="menuitem4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">_Help</property> + <property name="use_underline">True</property> + <child type="submenu"> + <object class="GtkMenu" id="menuitem4_menu"> + <property name="can_focus">False</property> + <child> + <object class="GtkMenuItem" id="about"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">_About</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_about_activate" swapped="no"/> + </object> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEventBox" id="eventbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="events">GDK_BUTTON_PRESS_MASK</property> + <signal name="button-press-event" handler="on_popup_menu_show" swapped="no"/> + <child> + <object class="GtkFixed" id="fixed"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="winnest"> + <property name="width_request">50</property> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="x">48</property> + <property name="y">48</property> + </packing> + </child> + <child> + <object class="GtkImage" id="back"> + <property name="width_request">21</property> + <property name="height_request">21</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="x">8</property> + <property name="y">8</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/src/button.c b/src/button.c index 2c52eba..b9107be 100644 --- a/src/button.c +++ b/src/button.c @@ -16,7 +16,7 @@ #include "config.h" #include <string.h> #include <stdio.h> -#include <glib/gmessages.h> +#include <glib.h> #include <gtk/gtkimage.h> #include "fakedev.h" @@ -21,7 +21,6 @@ #include <sys/wait.h> #include <gtk/gtk.h> #include <gdk/gdkx.h> -#include <glade/glade-xml.h> #include "fakedev.h" #include "callbacks.h" #include "prefs.h" @@ -57,7 +56,8 @@ find_spare_dpy (void) FakeApp * fakeapp_new (void) { - GladeXML *glade; + GtkBuilder *builder; + GtkWidget *widget; FakeApp *app = g_new0 (FakeApp, 1); app->xnest_dpy_name = find_spare_dpy (); @@ -72,53 +72,83 @@ fakeapp_new (void) app->win_title = "Xoo"; - glade = glade_xml_new (PKGDATADIR "/Xoo.glade", NULL, NULL); - g_assert (glade != NULL); + GError *error = NULL; + builder = gtk_builder_new (); + if (!gtk_builder_add_from_file (builder, PKGDATADIR "/data/xoo.ui", &error)) + { + g_warning ("Coulnd't load builder ui file : %s", error->message); + g_error_free (error); + } + + g_assert (builder != NULL); + + widget = GTK_WIDGET (gtk_builder_get_object (builder, "send_signal")); + g_object_connect (G_OBJECT (widget), "activate", + G_CALLBACK (on_send_signal_activate), app, NULL); - glade_xml_signal_connect_data (glade, "on_send_signal_activate", - (GCallback) on_send_signal_activate, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "quit")); + g_object_connect (G_OBJECT (widget), "activate", + G_CALLBACK (on_quit_activate), app, NULL); - glade_xml_signal_connect_data (glade, "on_quit_activate", - (GCallback) on_quit_activate, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "about")); + g_object_connect (G_OBJECT (widget), "activate", + G_CALLBACK (on_about_activate), app, NULL); - glade_xml_signal_connect_data (glade, "on_about_activate", - (GCallback) on_about_activate, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "window")); + g_object_connect (G_OBJECT (widget), "destroy", + G_CALLBACK (on_window_destroy), app, NULL); - glade_xml_signal_connect_data (glade, "on_window_destroy", - (GCallback) on_window_destroy, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "eventbox1")); + g_object_connect (G_OBJECT (widget), "button_press_event", + G_CALLBACK (on_popup_menu_show), app, NULL); - glade_xml_signal_connect_data (glade, "on_popup_menu_show", - (GCallback) on_popup_menu_show, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "show_decorations")); + g_object_connect (G_OBJECT (widget), "activate", + G_CALLBACK (on_show_decorations_toggle), app, NULL); - glade_xml_signal_connect_data (glade, "on_show_decorations_toggle", - (GCallback) on_show_decorations_toggle, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "aboutwindow")); + g_object_connect (G_OBJECT (widget), "delete_event", + G_CALLBACK (on_delete_event_hide), app, NULL); - glade_xml_signal_connect_data (glade, "on_delete_event_hide", - (GCallback) on_delete_event_hide, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "prefswindow")); + g_object_connect (G_OBJECT (widget), "delete_event", + G_CALLBACK (on_delete_event_hide), app, NULL); - glade_xml_signal_connect_data (glade, "on_select_device_activate", - (GCallback) on_select_device, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "aboutwindow")); + g_object_connect (G_OBJECT (widget), "delete_event", + G_CALLBACK (on_delete_event_hide), app, NULL); + + widget = GTK_WIDGET (gtk_builder_get_object (builder, "select_device")); + g_object_connect (G_OBJECT (widget), "activate", + G_CALLBACK (on_select_device), app, NULL); #if HAVE_GCONF - glade_xml_signal_connect_data (glade, "on_preferences_activate", - (GCallback) on_preferences_activate, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "preferences")); + g_object_connect (G_OBJECT (widget), "activate", + G_CALLBACK (on_preferences_activate), app, NULL); - glade_xml_signal_connect_data (glade, "on_prefs_apply_clicked", - (GCallback) on_prefs_apply_clicked, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "button_apply")); + g_object_connect (G_OBJECT (widget), "clicked", + G_CALLBACK (on_prefs_apply_clicked), app, NULL); - glade_xml_signal_connect_data (glade, "on_prefs_cancel_clicked", - (GCallback) on_prefs_cancel_clicked, app); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "button_close")); + g_object_connect (G_OBJECT (widget), "clicked", + G_CALLBACK (on_prefs_cancel_clicked), app, NULL); #else - - gtk_widget_hide (glade_xml_get_widget (glade, "preferences")); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "preferences")); + gtk_widget_hide (widget); #endif - - app->window = glade_xml_get_widget (glade, "window"); - app->menubar = glade_xml_get_widget (glade, "menubar"); - app->fixed = glade_xml_get_widget (glade, "fixed"); - app->back = glade_xml_get_widget (glade, "back"); - app->winnest = glade_xml_get_widget (glade, "winnest"); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "window")); + app->window = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "menubar")); + app->menubar = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "fixed")); + app->fixed = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "back")); + app->back = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "winnest")); + app->winnest = widget; g_signal_connect (app->window, "key-press-event", (GCallback) key_event, app); @@ -126,24 +156,32 @@ fakeapp_new (void) g_signal_connect (app->window, "key-release-event", (GCallback) key_event, app); - app->prefs_window = glade_xml_get_widget (glade, "prefswindow"); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "prefswindow")); + app->prefs_window = widget; gtk_window_set_transient_for (GTK_WINDOW (app->prefs_window), GTK_WINDOW (app->window)); - app->entry_display = glade_xml_get_widget (glade, "entry_display"); - app->entry_server = glade_xml_get_widget (glade, "entry_server"); - app->entry_options = glade_xml_get_widget (glade, "entry_options"); - app->entry_start = glade_xml_get_widget (glade, "entry_start"); - - app->debug_menu = glade_xml_get_widget (glade, "send_signal"); - app->popupmenu = glade_xml_get_widget (glade, "popupmenu_menu"); - app->about_window = glade_xml_get_widget (glade, "aboutwindow"); + widget = GTK_WIDGET (gtk_builder_get_object (builder, "entry_display")); + app->entry_display = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "entry_server")); + app->entry_server = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "entry_options")); + app->entry_options = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "entry_start")); + app->entry_start = widget; + + widget = GTK_WIDGET (gtk_builder_get_object (builder, "send_signal")); + app->debug_menu = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "popupmenu_menu")); + app->popupmenu = widget; + widget = GTK_WIDGET (gtk_builder_get_object (builder, "aboutwindow")); + app->about_window = widget; gtk_window_set_transient_for (GTK_WINDOW (app->about_window), GTK_WINDOW (app->window)); - g_signal_connect_swapped (glade_xml_get_widget - (glade, "button_about_close"), "clicked", + widget = GTK_WIDGET (gtk_builder_get_object (builder, "button_about_close")); + g_signal_connect_swapped (widget, "clicked", G_CALLBACK (gtk_widget_hide), app->about_window); return app; } |