summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-10-09 10:13:15 +0200
committerDave Davenport <qball@gmpclient.org>2016-10-09 10:13:15 +0200
commitf3298801f3a2fc11ab4a9d081f999b05fa5ab7fd (patch)
tree8893fc0e06f674ae30ca46f911ba2fb14e7dd540
parentf10bc5004f34fd9d92066179a47a0f67233e8fc3 (diff)
Split internal widget into separate file
-rw-r--r--Makefile.am2
-rw-r--r--include/widgets/scrollbar.h3
-rw-r--r--include/widgets/textbox.h3
-rw-r--r--include/widgets/widget-internal.h38
-rw-r--r--include/widgets/widget.h34
-rw-r--r--source/widgets/box.c2
-rw-r--r--source/widgets/separator.c2
-rw-r--r--source/widgets/widget.c1
-rw-r--r--test/widget-test.c1
9 files changed, 50 insertions, 36 deletions
diff --git a/Makefile.am b/Makefile.am
index a97eb4d9..42957f9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,6 +55,7 @@ rofi_SOURCES=\
include/history.h\
include/widgets/box.h\
include/widgets/widget.h\
+ include/widgets/widget-internal.h\
include/widgets/textbox.h\
include/widgets/listview.h\
include/widgets/scrollbar.h\
@@ -199,6 +200,7 @@ textbox_test_SOURCES=\
include/mode-private.h\
include/settings.h\
include/widgets/widget.h\
+ include/widgets/widget-internal.h\
include/widgets/textbox.h\
include/xrmoptions.h\
include/helper.h\
diff --git a/include/widgets/scrollbar.h b/include/widgets/scrollbar.h
index 148be6a9..0b7c5fbd 100644
--- a/include/widgets/scrollbar.h
+++ b/include/widgets/scrollbar.h
@@ -1,7 +1,8 @@
#ifndef ROFI_SCROLLBAR_H
#define ROFI_SCROLLBAR_H
#include <cairo.h>
-#include "widget.h"
+#include "widgets/widget.h"
+#include "widgets/widget-internal.h"
/**
* @defgroup Scrollbar Scrollbar
diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h
index e0ae62b1..b7060151 100644
--- a/include/widgets/textbox.h
+++ b/include/widgets/textbox.h
@@ -6,7 +6,8 @@
#include <pango/pango-fontmap.h>
#include <pango/pangocairo.h>
#include <cairo.h>
-#include "widget.h"
+#include "widgets/widget.h"
+#include "widgets/widget-internal.h"
#include "x11-helper.h"
#include "keyb.h"
diff --git a/include/widgets/widget-internal.h b/include/widgets/widget-internal.h
new file mode 100644
index 00000000..b2f3b4f5
--- /dev/null
+++ b/include/widgets/widget-internal.h
@@ -0,0 +1,38 @@
+#ifndef WIDGET_INTERNAL_H
+#define WIDGET_INTERNAL_H
+
+struct _widget
+{
+ /** X position relative to parent */
+ short x;
+ /** Y position relative to parent */
+ short y;
+ /** Width of the widget */
+ short w;
+ /** Height of the widget */
+ short h;
+ /** enabled or not */
+ gboolean enabled;
+ /** Information about packing. */
+ gboolean expand;
+ gboolean end;
+
+ struct _widget *parent;
+ /** Internal */
+ gboolean need_redraw;
+ /** Function prototypes */
+ int ( *get_width )( struct _widget * );
+ int ( *get_height )( struct _widget * );
+
+ void ( *draw )( struct _widget *widget, cairo_t *draw );
+ void ( *resize )( struct _widget *, short, short );
+ void ( *update )( struct _widget * );
+
+ // Signals.
+ widget_clicked_cb clicked;
+ void *clicked_cb_data;
+
+ // Free
+ void ( *free )( struct _widget *widget );
+};
+#endif // WIDGET_INTERNAL_H
diff --git a/include/widgets/widget.h b/include/widgets/widget.h
index 8664c864..84188318 100644
--- a/include/widgets/widget.h
+++ b/include/widgets/widget.h
@@ -17,40 +17,6 @@
*/
typedef struct _widget widget;
typedef gboolean ( *widget_clicked_cb )( widget *, xcb_button_press_event_t *, void * );
-struct _widget
-{
- /** X position relative to parent */
- short x;
- /** Y position relative to parent */
- short y;
- /** Width of the widget */
- short w;
- /** Height of the widget */
- short h;
- /** enabled or not */
- gboolean enabled;
- /** Information about packing. */
- gboolean expand;
- gboolean end;
-
- struct _widget *parent;
- /** Internal */
- gboolean need_redraw;
- /** Function prototypes */
- int ( *get_width )( struct _widget * );
- int ( *get_height )( struct _widget * );
-
- void ( *draw )( struct _widget *widget, cairo_t *draw );
- void ( *resize )( struct _widget *, short, short );
- void ( *update )( struct _widget * );
-
- // Signals.
- widget_clicked_cb clicked;
- void *clicked_cb_data;
-
- // Free
- void ( *free )( struct _widget *widget );
-};
/** Macro to get widget from an implementation (e.g. textbox/scrollbar) */
#define WIDGET( a ) ( ( a ) != NULL ? (widget *) ( a ) : NULL )
diff --git a/source/widgets/box.c b/source/widgets/box.c
index d7fad23e..c762d2fb 100644
--- a/source/widgets/box.c
+++ b/source/widgets/box.c
@@ -26,6 +26,8 @@
#include <config.h>
#include <stdio.h>
+#include "widgets/widget.h"
+#include "widgets/widget-internal.h"
#include "widgets/box.h"
#define LOG_DOMAIN "Widgets.Box"
diff --git a/source/widgets/separator.c b/source/widgets/separator.c
index 8ce539ab..ae5865c5 100644
--- a/source/widgets/separator.c
+++ b/source/widgets/separator.c
@@ -26,6 +26,8 @@
#include <xkbcommon/xkbcommon.h>
#include <glib.h>
#include <string.h>
+#include "widgets/widget.h"
+#include "widgets/widget-internal.h"
#include "widgets/separator.h"
#include "x11-helper.h"
#include "settings.h"
diff --git a/source/widgets/widget.c b/source/widgets/widget.c
index 0c272eab..6b00fccf 100644
--- a/source/widgets/widget.c
+++ b/source/widgets/widget.c
@@ -1,5 +1,6 @@
#include <glib.h>
#include "widgets/widget.h"
+#include "widgets/widget-internal.h"
int widget_intersect ( const widget *widget, int x, int y )
{
diff --git a/test/widget-test.c b/test/widget-test.c
index d500c414..6bdf68f7 100644
--- a/test/widget-test.c
+++ b/test/widget-test.c
@@ -6,6 +6,7 @@
#include <glib.h>
#include <string.h>
#include <widgets/widget.h>
+#include <widgets/widget-internal.h>
unsigned int test =0;
#define TASSERT( a ) { \
assert ( a ); \